-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SplitHeader should have a clear button
- Loading branch information
1 parent
9c262b7
commit 7d4456b
Showing
11 changed files
with
122 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
plugins/plugin-client-common/src/components/Views/Terminal/ScrollbackState.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2021 The Kubernetes Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Tab as KuiTab, NewSplitRequest } from '@kui-shell/core' | ||
|
||
import Block from './Block' | ||
import { BlockModel } from './Block/BlockModel' | ||
|
||
export type Cleaner = () => void | ||
|
||
export type ScrollbackOptions = NewSplitRequest['options'] | ||
|
||
type ScrollbackState = ScrollbackOptions & { | ||
uuid: string | ||
blocks: BlockModel[] | ||
forceMiniSplit: boolean | ||
|
||
/** tab facade */ | ||
facade?: KuiTab | ||
|
||
/** grab a ref to the active block, to help us maintain focus */ | ||
_activeBlock?: Block | ||
|
||
/** Has the user clicked to focus on a block? */ | ||
focusedBlockIdx?: number | ||
|
||
/** cleanup routines for this split */ | ||
cleaners: Cleaner[] | ||
|
||
/** | ||
* Block index (into this.blocks) to show in a MiniSplit. Must be a | ||
* negative number, interpreted as an index from the end. | ||
*/ | ||
showThisIdxInMiniSplit: number | ||
|
||
/** Memoized handlers */ | ||
remove: () => void | ||
clear: () => void | ||
onClick: (evt: React.MouseEvent<HTMLElement, MouseEvent>) => void | ||
onFocus: (evt: React.FocusEvent) => void | ||
onOutputRender: () => void | ||
navigateTo: (dir: 'first' | 'last' | 'previous' | 'next') => void | ||
setActiveBlock: (c: Block) => void | ||
willFocusBlock: (evt: React.SyntheticEvent) => void | ||
willRemoveBlock: (evt: React.SyntheticEvent, idx?: number) => void | ||
willUpdateCommand: (idx: number, command: string) => void | ||
} | ||
|
||
export default ScrollbackState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,3 +345,8 @@ $action-hover-delay: 210ms; | |
@content; | ||
} | ||
} | ||
@mixin SplitHeaderClear { | ||
.kui--split-clear-button { | ||
@content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters