@douyinfe/semi-foundation 2.65.2-alpha.1 → 2.66.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/hotKeys/constants.ts +69 -0
  2. package/hotKeys/foundation.ts +65 -0
  3. package/hotKeys/hotKeys.scss +29 -0
  4. package/hotKeys/variables.scss +9 -0
  5. package/lib/cjs/hotKeys/constants.d.ts +6 -0
  6. package/lib/cjs/hotKeys/constants.js +151 -0
  7. package/lib/cjs/hotKeys/foundation.d.ts +12 -0
  8. package/lib/cjs/hotKeys/foundation.js +61 -0
  9. package/lib/cjs/hotKeys/hotKeys.css +31 -0
  10. package/lib/cjs/hotKeys/hotKeys.scss +29 -0
  11. package/lib/cjs/hotKeys/variables.scss +9 -0
  12. package/lib/cjs/overflowList/foundation.js +1 -1
  13. package/lib/cjs/tabs/constants.d.ts +1 -0
  14. package/lib/cjs/tabs/constants.js +2 -1
  15. package/lib/cjs/tabs/tabs.css +29 -0
  16. package/lib/cjs/tabs/tabs.scss +42 -0
  17. package/lib/cjs/tabs/variables.scss +12 -0
  18. package/lib/cjs/upload/upload.css +2 -0
  19. package/lib/cjs/upload/upload.scss +2 -0
  20. package/lib/es/hotKeys/constants.d.ts +6 -0
  21. package/lib/es/hotKeys/constants.js +144 -0
  22. package/lib/es/hotKeys/foundation.d.ts +12 -0
  23. package/lib/es/hotKeys/foundation.js +53 -0
  24. package/lib/es/hotKeys/hotKeys.css +31 -0
  25. package/lib/es/hotKeys/hotKeys.scss +29 -0
  26. package/lib/es/hotKeys/variables.scss +9 -0
  27. package/lib/es/overflowList/foundation.js +1 -1
  28. package/lib/es/tabs/constants.d.ts +1 -0
  29. package/lib/es/tabs/constants.js +2 -1
  30. package/lib/es/tabs/tabs.css +29 -0
  31. package/lib/es/tabs/tabs.scss +42 -0
  32. package/lib/es/tabs/variables.scss +12 -0
  33. package/lib/es/upload/upload.css +2 -0
  34. package/lib/es/upload/upload.scss +2 -0
  35. package/overflowList/foundation.ts +2 -1
  36. package/package.json +3 -3
  37. package/tabs/constants.ts +2 -1
  38. package/tabs/tabs.scss +42 -0
  39. package/tabs/variables.scss +12 -0
  40. package/upload/upload.scss +2 -0
@@ -0,0 +1,69 @@
1
+ import { BASE_CLASS_PREFIX } from "../base/constants";
2
+
3
+ const cssClasses = {
4
+ PREFIX: `${BASE_CLASS_PREFIX}-hotKeys`,
5
+ } as const;
6
+
7
+ const strings = {
8
+ };
9
+
10
+ export { cssClasses, strings };
11
+
12
+ export function keyToCode(key: KeyboardEvent["key"]) {
13
+ const keyCodeMap = {
14
+ // alpha
15
+ 'a': 'KeyA', 'b': 'KeyB', 'c': 'KeyC', 'd': 'KeyD', 'e': 'KeyE',
16
+ 'f': 'KeyF', 'g': 'KeyG', 'h': 'KeyH', 'i': 'KeyI', 'j': 'KeyJ',
17
+ 'k': 'KeyK', 'l': 'KeyL', 'm': 'KeyM', 'n': 'KeyN', 'o': 'KeyO',
18
+ 'p': 'KeyP', 'q': 'KeyQ', 'r': 'KeyR', 's': 'KeyS', 't': 'KeyT',
19
+ 'u': 'KeyU', 'v': 'KeyV', 'w': 'KeyW', 'x': 'KeyX', 'y': 'KeyY',
20
+ 'z': 'KeyZ',
21
+
22
+ // digit
23
+ '0': 'Digit0', '1': 'Digit1', '2': 'Digit2', '3': 'Digit3',
24
+ '4': 'Digit4', '5': 'Digit5', '6': 'Digit6', '7': 'Digit7',
25
+ '8': 'Digit8', '9': 'Digit9',
26
+
27
+ // punctuation
28
+ ' ': 'Space', 'enter': 'Enter', 'escape': 'Escape', 'backspace': 'Backspace',
29
+ 'tab': 'Tab', '-': 'Minus', '=': 'Equal', '[': 'BracketLeft',
30
+ ']': 'BracketRight', '\\': 'Backslash', ';': 'Semicolon',
31
+ "'": 'Quote', '`': 'Backquote', ',': 'Comma', '.': 'Period',
32
+ '/': 'Slash', '?': 'Slash', '!': 'Digit1', '@': 'Digit2',
33
+ '#': 'Digit3', '$': 'Digit4', '%': 'Digit5', '^': 'Digit6',
34
+ '&': 'Digit7', '*': 'Digit8', '(': 'Digit9', ')': 'Digit0',
35
+
36
+ // arrow
37
+ 'arrowup': 'ArrowUp', 'arrowdown': 'ArrowDown',
38
+ 'arrowleft': 'ArrowLeft', 'arrowright': 'ArrowRight',
39
+
40
+ // function
41
+ 'shift': 'ShiftLeft', 'control': 'ControlLeft', 'alt': 'AltLeft',
42
+ 'meta': 'MetaLeft', 'capslock': 'CapsLock', 'f1': 'F1',
43
+ 'f2': 'F2', 'f3': 'F3', 'f4': 'F4', 'f5': 'F5', 'f6': 'F6',
44
+ 'f7': 'F7', 'f8': 'F8', 'f9': 'F9', 'f10': 'F10', 'f11': 'F11',
45
+ 'f12': 'F12', 'insert': 'Insert', 'delete': 'Delete', 'home': 'Home',
46
+ 'end': 'End', 'pageup': 'PageUp', 'pagedown': 'PageDown',
47
+ 'numlock': 'NumLock', 'scrolllock': 'ScrollLock', 'pause': 'Pause',
48
+
49
+ // numpad
50
+ 'numpad0': 'Numpad0', 'numpad1': 'Numpad1', 'numpad2': 'Numpad2',
51
+ 'numpad3': 'Numpad3', 'numpad4': 'Numpad4', 'numpad5': 'Numpad5',
52
+ 'numpad6': 'Numpad6', 'numpad7': 'Numpad7', 'numpad8': 'Numpad8',
53
+ 'numpad9': 'Numpad9', 'numpaddecimal': 'NumpadDecimal',
54
+ 'numpaddivide': 'NumpadDivide', 'numpadmultiply': 'NumpadMultiply',
55
+ 'numpadsubtract': 'NumpadSubtract', 'numpadadd': 'NumpadAdd',
56
+ 'numpadenter': 'NumpadEnter',
57
+
58
+ // Others
59
+ 'printscreen': 'PrintScreen', 'contextmenu': 'ContextMenu',
60
+ 'help': 'Help', 'select': 'Select', 'execute': 'Execute',
61
+ 'clear': 'Clear', 'kana': 'KanaMode', 'kanji': 'KanjiMode',
62
+ 'nonconvert': 'NonConvert', 'convert': 'Convert',
63
+ 'process': 'Process', 'accept': 'Accept', 'modechange': 'ModeChange',
64
+ 'launchapp1': 'LaunchApp1', 'launchapp2': 'LaunchApp2',
65
+ 'launchmail': 'LaunchMail', 'mediaselect': 'MediaSelect'
66
+ };
67
+
68
+ return keyCodeMap[key.toLowerCase()] || undefined;
69
+ }
@@ -0,0 +1,65 @@
1
+ import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
+ import { keyToCode } from './constants';
3
+
4
+ export interface HotKeysAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
5
+ notifyClick: () => void;
6
+ getListenerTarget: () => HTMLElement
7
+ }
8
+
9
+ export default class HotKeysFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<HotKeysAdapter<P, S>, P, S> {
10
+ constructor(adapter: HotKeysAdapter<P, S>) {
11
+ super({ ...adapter });
12
+ }
13
+
14
+ init(): void {
15
+ // init Listener
16
+ const target = this._adapter.getListenerTarget();
17
+ target?.addEventListener('keydown', this.handleKeyDown);
18
+ }
19
+
20
+ handleKeyDown = (event: KeyboardEvent): void => {
21
+ const disabled = this.getProps().disabled;
22
+ if (disabled) {
23
+ return;
24
+ }
25
+ const hotKeys = this.getProps().hotKeys;
26
+ let allModifier = new Array(4).fill(false); // Meta Shift Alt Ctrl
27
+ let clickedModifier = [event.metaKey, event.shiftKey, event.altKey, event.ctrlKey];
28
+ const keysPressed = hotKeys?.map((key: KeyboardEvent["key"])=> {
29
+ if (key === "Meta") {
30
+ allModifier[0] = true;
31
+ return event.metaKey;
32
+ } else if (key === "Shift") {
33
+ allModifier[1] = true;
34
+ return event.shiftKey;
35
+ } else if (key === "Alt") {
36
+ allModifier[2] = true;
37
+ return event.altKey;
38
+ } else if (key === "Control") {
39
+ allModifier[3] = true;
40
+ return event.ctrlKey;
41
+ }
42
+ return event.code === keyToCode(key);
43
+ });
44
+
45
+ if (!allModifier.every((value, index) => value === clickedModifier[index])) {
46
+ return;
47
+ }
48
+ if (keysPressed.every(Boolean)) {
49
+ event.preventDefault();
50
+ this.handleClick();
51
+ return;
52
+ }
53
+
54
+ }
55
+
56
+ handleClick(): void {
57
+ this._adapter.notifyClick();
58
+ }
59
+
60
+ destroy(): void {
61
+ // remove Listener
62
+ const target = this._adapter.getListenerTarget();
63
+ target?.removeEventListener('keydown', this.handleKeyDown);
64
+ }
65
+ }
@@ -0,0 +1,29 @@
1
+ @import "./variables.scss";
2
+
3
+ $module: #{$prefix}-hotKeys;
4
+
5
+ .#{$module} {
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ user-select: none;
9
+ white-space: nowrap;
10
+ vertical-align: bottom;
11
+ @include all-center;
12
+ display: inline-flex;
13
+
14
+ &-content {
15
+ @include font-size-small;
16
+ border-radius: $radius-hotKeys;
17
+ height: $height-hotKeys;
18
+ padding: $spacing-hotKeys-paddingY $spacing-hotKeys-paddingX;
19
+ border: $width-hotKeys-border;
20
+ background-color: $color-hotKeys-bg;
21
+ color: $color-hotKeys-text;
22
+ }
23
+
24
+ &-split {
25
+ @include font-size-small;
26
+ margin: 0 3px;
27
+ }
28
+
29
+ }
@@ -0,0 +1,9 @@
1
+ $color-hotKeys-bg: var(--semi-color-fill-0); // 快捷键背景颜色
2
+ $color-hotKeys-text: var(--semi-color-text-2); // 快捷键文字颜色
3
+
4
+ $width-hotKeys-border: 1px; // 快捷键描边宽度
5
+ $radius-hotKeys: 2px; // 边框半径
6
+
7
+ $height-hotKeys: 20px; // 快捷键高度
8
+ $spacing-hotKeys-paddingY: 2px;
9
+ $spacing-hotKeys-paddingX: $spacing-tight;
@@ -0,0 +1,6 @@
1
+ declare const cssClasses: {
2
+ readonly PREFIX: "semi-hotKeys";
3
+ };
4
+ declare const strings: {};
5
+ export { cssClasses, strings };
6
+ export declare function keyToCode(key: KeyboardEvent["key"]): any;
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cssClasses = void 0;
7
+ exports.keyToCode = keyToCode;
8
+ exports.strings = void 0;
9
+ var _constants = require("../base/constants");
10
+ const cssClasses = exports.cssClasses = {
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-hotKeys`
12
+ };
13
+ const strings = exports.strings = {};
14
+ function keyToCode(key) {
15
+ const keyCodeMap = {
16
+ // alpha
17
+ 'a': 'KeyA',
18
+ 'b': 'KeyB',
19
+ 'c': 'KeyC',
20
+ 'd': 'KeyD',
21
+ 'e': 'KeyE',
22
+ 'f': 'KeyF',
23
+ 'g': 'KeyG',
24
+ 'h': 'KeyH',
25
+ 'i': 'KeyI',
26
+ 'j': 'KeyJ',
27
+ 'k': 'KeyK',
28
+ 'l': 'KeyL',
29
+ 'm': 'KeyM',
30
+ 'n': 'KeyN',
31
+ 'o': 'KeyO',
32
+ 'p': 'KeyP',
33
+ 'q': 'KeyQ',
34
+ 'r': 'KeyR',
35
+ 's': 'KeyS',
36
+ 't': 'KeyT',
37
+ 'u': 'KeyU',
38
+ 'v': 'KeyV',
39
+ 'w': 'KeyW',
40
+ 'x': 'KeyX',
41
+ 'y': 'KeyY',
42
+ 'z': 'KeyZ',
43
+ // digit
44
+ '0': 'Digit0',
45
+ '1': 'Digit1',
46
+ '2': 'Digit2',
47
+ '3': 'Digit3',
48
+ '4': 'Digit4',
49
+ '5': 'Digit5',
50
+ '6': 'Digit6',
51
+ '7': 'Digit7',
52
+ '8': 'Digit8',
53
+ '9': 'Digit9',
54
+ // punctuation
55
+ ' ': 'Space',
56
+ 'enter': 'Enter',
57
+ 'escape': 'Escape',
58
+ 'backspace': 'Backspace',
59
+ 'tab': 'Tab',
60
+ '-': 'Minus',
61
+ '=': 'Equal',
62
+ '[': 'BracketLeft',
63
+ ']': 'BracketRight',
64
+ '\\': 'Backslash',
65
+ ';': 'Semicolon',
66
+ "'": 'Quote',
67
+ '`': 'Backquote',
68
+ ',': 'Comma',
69
+ '.': 'Period',
70
+ '/': 'Slash',
71
+ '?': 'Slash',
72
+ '!': 'Digit1',
73
+ '@': 'Digit2',
74
+ '#': 'Digit3',
75
+ '$': 'Digit4',
76
+ '%': 'Digit5',
77
+ '^': 'Digit6',
78
+ '&': 'Digit7',
79
+ '*': 'Digit8',
80
+ '(': 'Digit9',
81
+ ')': 'Digit0',
82
+ // arrow
83
+ 'arrowup': 'ArrowUp',
84
+ 'arrowdown': 'ArrowDown',
85
+ 'arrowleft': 'ArrowLeft',
86
+ 'arrowright': 'ArrowRight',
87
+ // function
88
+ 'shift': 'ShiftLeft',
89
+ 'control': 'ControlLeft',
90
+ 'alt': 'AltLeft',
91
+ 'meta': 'MetaLeft',
92
+ 'capslock': 'CapsLock',
93
+ 'f1': 'F1',
94
+ 'f2': 'F2',
95
+ 'f3': 'F3',
96
+ 'f4': 'F4',
97
+ 'f5': 'F5',
98
+ 'f6': 'F6',
99
+ 'f7': 'F7',
100
+ 'f8': 'F8',
101
+ 'f9': 'F9',
102
+ 'f10': 'F10',
103
+ 'f11': 'F11',
104
+ 'f12': 'F12',
105
+ 'insert': 'Insert',
106
+ 'delete': 'Delete',
107
+ 'home': 'Home',
108
+ 'end': 'End',
109
+ 'pageup': 'PageUp',
110
+ 'pagedown': 'PageDown',
111
+ 'numlock': 'NumLock',
112
+ 'scrolllock': 'ScrollLock',
113
+ 'pause': 'Pause',
114
+ // numpad
115
+ 'numpad0': 'Numpad0',
116
+ 'numpad1': 'Numpad1',
117
+ 'numpad2': 'Numpad2',
118
+ 'numpad3': 'Numpad3',
119
+ 'numpad4': 'Numpad4',
120
+ 'numpad5': 'Numpad5',
121
+ 'numpad6': 'Numpad6',
122
+ 'numpad7': 'Numpad7',
123
+ 'numpad8': 'Numpad8',
124
+ 'numpad9': 'Numpad9',
125
+ 'numpaddecimal': 'NumpadDecimal',
126
+ 'numpaddivide': 'NumpadDivide',
127
+ 'numpadmultiply': 'NumpadMultiply',
128
+ 'numpadsubtract': 'NumpadSubtract',
129
+ 'numpadadd': 'NumpadAdd',
130
+ 'numpadenter': 'NumpadEnter',
131
+ // Others
132
+ 'printscreen': 'PrintScreen',
133
+ 'contextmenu': 'ContextMenu',
134
+ 'help': 'Help',
135
+ 'select': 'Select',
136
+ 'execute': 'Execute',
137
+ 'clear': 'Clear',
138
+ 'kana': 'KanaMode',
139
+ 'kanji': 'KanjiMode',
140
+ 'nonconvert': 'NonConvert',
141
+ 'convert': 'Convert',
142
+ 'process': 'Process',
143
+ 'accept': 'Accept',
144
+ 'modechange': 'ModeChange',
145
+ 'launchapp1': 'LaunchApp1',
146
+ 'launchapp2': 'LaunchApp2',
147
+ 'launchmail': 'LaunchMail',
148
+ 'mediaselect': 'MediaSelect'
149
+ };
150
+ return keyCodeMap[key.toLowerCase()] || undefined;
151
+ }
@@ -0,0 +1,12 @@
1
+ import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
+ export interface HotKeysAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
3
+ notifyClick: () => void;
4
+ getListenerTarget: () => HTMLElement;
5
+ }
6
+ export default class HotKeysFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<HotKeysAdapter<P, S>, P, S> {
7
+ constructor(adapter: HotKeysAdapter<P, S>);
8
+ init(): void;
9
+ handleKeyDown: (event: KeyboardEvent) => void;
10
+ handleClick(): void;
11
+ destroy(): void;
12
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _foundation = _interopRequireDefault(require("../base/foundation"));
8
+ var _constants = require("./constants");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ class HotKeysFoundation extends _foundation.default {
11
+ constructor(adapter) {
12
+ super(Object.assign({}, adapter));
13
+ this.handleKeyDown = event => {
14
+ const disabled = this.getProps().disabled;
15
+ if (disabled) {
16
+ return;
17
+ }
18
+ const hotKeys = this.getProps().hotKeys;
19
+ let allModifier = new Array(4).fill(false); // Meta Shift Alt Ctrl
20
+ let clickedModifier = [event.metaKey, event.shiftKey, event.altKey, event.ctrlKey];
21
+ const keysPressed = hotKeys === null || hotKeys === void 0 ? void 0 : hotKeys.map(key => {
22
+ if (key === "Meta") {
23
+ allModifier[0] = true;
24
+ return event.metaKey;
25
+ } else if (key === "Shift") {
26
+ allModifier[1] = true;
27
+ return event.shiftKey;
28
+ } else if (key === "Alt") {
29
+ allModifier[2] = true;
30
+ return event.altKey;
31
+ } else if (key === "Control") {
32
+ allModifier[3] = true;
33
+ return event.ctrlKey;
34
+ }
35
+ return event.code === (0, _constants.keyToCode)(key);
36
+ });
37
+ if (!allModifier.every((value, index) => value === clickedModifier[index])) {
38
+ return;
39
+ }
40
+ if (keysPressed.every(Boolean)) {
41
+ event.preventDefault();
42
+ this.handleClick();
43
+ return;
44
+ }
45
+ };
46
+ }
47
+ init() {
48
+ // init Listener
49
+ const target = this._adapter.getListenerTarget();
50
+ target === null || target === void 0 ? void 0 : target.addEventListener('keydown', this.handleKeyDown);
51
+ }
52
+ handleClick() {
53
+ this._adapter.notifyClick();
54
+ }
55
+ destroy() {
56
+ // remove Listener
57
+ const target = this._adapter.getListenerTarget();
58
+ target === null || target === void 0 ? void 0 : target.removeEventListener('keydown', this.handleKeyDown);
59
+ }
60
+ }
61
+ exports.default = HotKeysFoundation;
@@ -0,0 +1,31 @@
1
+ /* shadow */
2
+ /* sizing */
3
+ /* spacing */
4
+ .semi-hotKeys {
5
+ box-sizing: border-box;
6
+ position: relative;
7
+ user-select: none;
8
+ white-space: nowrap;
9
+ vertical-align: bottom;
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ display: inline-flex;
14
+ }
15
+ .semi-hotKeys-content {
16
+ font-size: 12px;
17
+ line-height: 16px;
18
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
19
+ border-radius: 2px;
20
+ height: 20px;
21
+ padding: 2px 8px;
22
+ border: 1px;
23
+ background-color: var(--semi-color-fill-0);
24
+ color: var(--semi-color-text-2);
25
+ }
26
+ .semi-hotKeys-split {
27
+ font-size: 12px;
28
+ line-height: 16px;
29
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
30
+ margin: 0 3px;
31
+ }
@@ -0,0 +1,29 @@
1
+ @import "./variables.scss";
2
+
3
+ $module: #{$prefix}-hotKeys;
4
+
5
+ .#{$module} {
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ user-select: none;
9
+ white-space: nowrap;
10
+ vertical-align: bottom;
11
+ @include all-center;
12
+ display: inline-flex;
13
+
14
+ &-content {
15
+ @include font-size-small;
16
+ border-radius: $radius-hotKeys;
17
+ height: $height-hotKeys;
18
+ padding: $spacing-hotKeys-paddingY $spacing-hotKeys-paddingX;
19
+ border: $width-hotKeys-border;
20
+ background-color: $color-hotKeys-bg;
21
+ color: $color-hotKeys-text;
22
+ }
23
+
24
+ &-split {
25
+ @include font-size-small;
26
+ margin: 0 3px;
27
+ }
28
+
29
+ }
@@ -0,0 +1,9 @@
1
+ $color-hotKeys-bg: var(--semi-color-fill-0); // 快捷键背景颜色
2
+ $color-hotKeys-text: var(--semi-color-text-2); // 快捷键文字颜色
3
+
4
+ $width-hotKeys-border: 1px; // 快捷键描边宽度
5
+ $radius-hotKeys: 2px; // 边框半径
6
+
7
+ $height-hotKeys: 20px; // 快捷键高度
8
+ $spacing-hotKeys-paddingY: 2px;
9
+ $spacing-hotKeys-paddingX: $spacing-tight;
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _get2 = _interopRequireDefault(require("lodash/get"));
8
- var _fastCopy = _interopRequireDefault(require("fast-copy"));
9
8
  var _foundation = _interopRequireDefault(require("../base/foundation"));
10
9
  var _constants = require("./constants");
10
+ var _fastCopy = _interopRequireDefault(require("fast-copy"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const Boundary = _constants.strings.BOUNDARY_MAP;
13
13
  const OverflowDirection = _constants.strings.OVERFLOW_DIR;
@@ -4,6 +4,7 @@ declare const cssClasses: {
4
4
  TABS_BAR_LINE: string;
5
5
  TABS_BAR_CARD: string;
6
6
  TABS_BAR_BUTTON: string;
7
+ TABS_BAR_SLASH: string;
7
8
  TABS_BAR_EXTRA: string;
8
9
  TABS_TAB: string;
9
10
  TABS_TAB_ACTIVE: string;
@@ -11,6 +11,7 @@ const cssClasses = exports.cssClasses = {
11
11
  TABS_BAR_LINE: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-line`,
12
12
  TABS_BAR_CARD: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-card`,
13
13
  TABS_BAR_BUTTON: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-button`,
14
+ TABS_BAR_SLASH: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-slash`,
14
15
  TABS_BAR_EXTRA: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-extra`,
15
16
  TABS_TAB: `${_constants.BASE_CLASS_PREFIX}-tabs-tab`,
16
17
  TABS_TAB_ACTIVE: `${_constants.BASE_CLASS_PREFIX}-tabs-tab-active`,
@@ -32,7 +33,7 @@ const numbers = exports.numbers = {
32
33
  DEFAULT_ACTIVE_KEY: 1
33
34
  };
34
35
  const strings = exports.strings = {
35
- TYPE_MAP: ['line', 'card', 'button'],
36
+ TYPE_MAP: ['line', 'card', 'button', 'slash'],
36
37
  SIZE: ['small', 'medium', 'large'],
37
38
  POSITION_MAP: ['top', 'left']
38
39
  };
@@ -135,18 +135,27 @@
135
135
  margin-left: 10px;
136
136
  cursor: pointer;
137
137
  }
138
+ .semi-tabs-tab-single.semi-tabs-tab .semi-icon.semi-tabs-tab-icon-close.semi-icon-close:hover {
139
+ color: var(--semi-color-text-0);
140
+ }
138
141
  .semi-tabs-tab-single.semi-tabs-tab:hover {
139
142
  color: var(--semi-color-text-0);
140
143
  }
141
144
  .semi-tabs-tab-single.semi-tabs-tab:hover .semi-icon:not(.semi-icon-checkbox_tick, .semi-icon-radio, .semi-icon-checkbox_indeterminate) {
142
145
  color: var(--semi-color-text-0);
143
146
  }
147
+ .semi-tabs-tab-single.semi-tabs-tab:hover .semi-icon.semi-tabs-tab-icon-close {
148
+ color: var(--semi-color-text-2);
149
+ }
144
150
  .semi-tabs-tab-single.semi-tabs-tab:active {
145
151
  color: var(--semi-color-text-0);
146
152
  }
147
153
  .semi-tabs-tab-single.semi-tabs-tab:active .semi-icon:not(.semi-icon-checkbox_tick, .semi-icon-radio, .semi-icon-checkbox_indeterminate) {
148
154
  color: var(--semi-color-text-0);
149
155
  }
156
+ .semi-tabs-tab-single.semi-tabs-tab:active .semi-icon.semi-tabs-tab-icon-close {
157
+ color: var(--semi-color-text-2);
158
+ }
150
159
  .semi-tabs-tab-single.semi-tabs-tab-active, .semi-tabs-tab-single.semi-tabs-tab-active:hover {
151
160
  cursor: default;
152
161
  font-weight: 600;
@@ -424,6 +433,26 @@
424
433
  border: none;
425
434
  background-color: var(--semi-color-primary-light-default);
426
435
  }
436
+ .semi-tabs-bar-slash .semi-tabs-tab {
437
+ padding: 12px 0px;
438
+ }
439
+ .semi-tabs-bar-slash .semi-tabs-tab:nth-of-type(1) {
440
+ padding-left: 0;
441
+ }
442
+ .semi-tabs-bar-slash .semi-tabs-tab:not(:last-of-type) {
443
+ margin-right: 16px;
444
+ }
445
+ .semi-tabs-bar-slash .semi-tabs-tab:not(:last-of-type):after {
446
+ content: "";
447
+ margin-left: 16px;
448
+ display: inline-block;
449
+ height: 14px;
450
+ width: 8px;
451
+ margin-top: 3px;
452
+ margin-bottom: 3px;
453
+ vertical-align: bottom;
454
+ background: linear-gradient(to bottom right, transparent 0%, transparent calc(50% - 1px), var(--semi-color-text-2) 50%, transparent calc(50% + 1px), transparent 100%);
455
+ }
427
456
  .semi-tabs-content {
428
457
  width: 100%;
429
458
  padding: 5px 0;
@@ -174,6 +174,10 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix
174
174
  color: var(--semi-color-text-2);
175
175
  margin-left: 10px;
176
176
  cursor: pointer;
177
+
178
+ &.#{$prefix}-icon-close:hover {
179
+ color: var(--semi-color-text-0);
180
+ }
177
181
  }
178
182
 
179
183
  &:hover {
@@ -182,6 +186,10 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix
182
186
  .#{$prefix}-icon:not(#{$ignoreIcon}) {
183
187
  color: $color-tabs_tab-icon-hover;
184
188
  }
189
+
190
+ .#{$prefix}-icon.#{$module}-tab-icon-close {
191
+ color: var(--semi-color-text-2);
192
+ }
185
193
  }
186
194
 
187
195
  &:active {
@@ -190,6 +198,10 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix
190
198
  .#{$prefix}-icon:not(#{$ignoreIcon}) {
191
199
  color: $color-tabs_tab-icon-active;
192
200
  }
201
+
202
+ .#{$prefix}-icon.#{$module}-tab-icon-close {
203
+ color: var(--semi-color-text-2);
204
+ }
193
205
  }
194
206
  }
195
207
 
@@ -583,6 +595,36 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix
583
595
  }
584
596
  }
585
597
 
598
+ &-bar-slash {
599
+
600
+ .#{$module}-tab {
601
+ padding: $spacing-tabs_bar_slash_tab-paddingY $spacing-tabs_bar_slash_tab-paddingX;
602
+
603
+ &:nth-of-type(1) {
604
+ padding-left: 0;
605
+ }
606
+
607
+ &:not(:last-of-type) {
608
+ margin-right: $spacing-tabs_bar_slash-marginRight;
609
+
610
+ &:after {
611
+ content: "";
612
+ margin-left: $spacing-tabs_bar_slash_line_marginLeft;
613
+ display: inline-block;
614
+ height: $height-tabs_tab_slash_line;
615
+ width: $width-tabs_tab_slash_line;
616
+ margin-top: $spacing-tabs_bar_slash_line_marginTop;
617
+ margin-bottom: $spacing-tabs_bar_slash_line_marginBottom;
618
+ vertical-align: bottom;
619
+ // Get diagonal slash
620
+ background: linear-gradient(to bottom right, transparent 0%,
621
+ transparent calc(50% - 1px), $color-tabs_tab_slash_line 50%,
622
+ transparent calc(50% + 1px), transparent 100%);
623
+ }
624
+ }
625
+ }
626
+ }
627
+
586
628
  &-content {
587
629
  width: 100%;
588
630
  padding: $spacing-tabs_content-paddingY $spacing-tabs_content-paddingX;