@douyinfe/semi-foundation 2.1.0-beta.2 → 2.1.1
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.
- package/calendar/foundation.ts +3 -1
- package/cascader/foundation.ts +1 -1
- package/collapse/foundation.ts +1 -1
- package/lib/es/calendar/foundation.d.ts +2 -1
- package/lib/es/cascader/foundation.d.ts +1 -1
- package/lib/es/collapse/foundation.d.ts +1 -1
- package/lib/es/pagination/foundation.d.ts +2 -2
- package/lib/es/popconfirm/popconfirmFoundation.d.ts +2 -0
- package/lib/es/popconfirm/popconfirmFoundation.js +4 -0
- package/lib/es/scrollList/itemFoundation.d.ts +3 -3
- package/lib/es/select/foundation.d.ts +2 -1
- package/lib/es/select/foundation.js +10 -5
- package/lib/es/table/utils.d.ts +1 -1
- package/lib/es/tabs/foundation.d.ts +3 -0
- package/lib/es/tabs/foundation.js +4 -8
- package/lib/es/tabs/tabs.css +13 -1
- package/lib/es/tabs/tabs.scss +96 -76
- package/lib/es/tagInput/foundation.d.ts +1 -0
- package/lib/es/tagInput/foundation.js +2 -0
- package/lib/es/timeline/timeline.css +1 -0
- package/lib/es/timeline/timeline.scss +1 -0
- package/lib/es/timeline/variables.scss +1 -0
- package/lib/es/tooltip/foundation.js +5 -2
- package/lib/es/tree/foundation.d.ts +1 -1
- package/lib/es/tree/treeUtil.js +10 -7
- package/lib/es/treeSelect/foundation.d.ts +10 -12
- package/lib/es/utils/log.js +3 -1
- package/package.json +3 -3
- package/pagination/foundation.ts +2 -2
- package/popconfirm/popconfirmFoundation.ts +5 -0
- package/scrollList/itemFoundation.ts +3 -3
- package/select/foundation.ts +10 -8
- package/table/utils.ts +1 -1
- package/tabs/foundation.ts +7 -8
- package/tabs/tabs.scss +96 -76
- package/tagInput/foundation.ts +2 -0
- package/timeline/timeline.scss +1 -0
- package/timeline/variables.scss +1 -0
- package/tooltip/foundation.ts +4 -2
- package/tree/foundation.ts +1 -1
- package/tree/treeUtil.ts +1 -1
- package/treeSelect/foundation.ts +11 -10
- package/utils/log.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
11
|
-
"@douyinfe/semi-animation": "2.1.
|
|
11
|
+
"@douyinfe/semi-animation": "2.1.1",
|
|
12
12
|
"async-validator": "^3.5.0",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"date-fns": "^2.9.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"*.scss",
|
|
25
25
|
"*.css"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "be28426a48482f95f11422cda5b5f2c0d86f4be5",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
30
30
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
package/pagination/foundation.ts
CHANGED
|
@@ -12,9 +12,9 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
12
12
|
setCurrentPage: (pageIndex: number) => void;
|
|
13
13
|
registerKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
14
14
|
unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
15
|
-
notifyPageChange: (pageIndex: number
|
|
15
|
+
notifyPageChange: (pageIndex: number) => void;
|
|
16
16
|
notifyPageSizeChange: (pageSize: number) => void;
|
|
17
|
-
notifyChange: (pageIndex: number
|
|
17
|
+
notifyChange: (pageIndex: number, pageSize: number) => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type PageRenderText = number | '...';
|
|
@@ -7,6 +7,7 @@ export interface PopconfirmAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
7
7
|
notifyConfirm: (e: any) => void;
|
|
8
8
|
notifyCancel: (e: any) => void;
|
|
9
9
|
notifyVisibleChange: (visible: boolean) => void;
|
|
10
|
+
notifyClickOutSide: (e: any) => void;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export default class PopConfirmFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<PopconfirmAdapter<P, S>, P, S> {
|
|
@@ -25,6 +26,10 @@ export default class PopConfirmFoundation<P = Record<string, any>, S = Record<st
|
|
|
25
26
|
this.handleVisibleChange(false);
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
handleClickOutSide(e: any): void {
|
|
30
|
+
this._adapter.notifyClickOutSide(e);
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
handleVisibleChange(visible: boolean): void {
|
|
29
34
|
if (!this._isControlledComponent('visible')) {
|
|
30
35
|
this._adapter.setVisible(visible);
|
|
@@ -11,16 +11,16 @@ export interface Item {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any
|
|
14
|
+
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any>, I = Item> extends DefaultAdapter<P, S> {
|
|
15
15
|
setPrependCount: (prependCount: number) => void;
|
|
16
16
|
setAppendCount: (appendCount: number) => void;
|
|
17
17
|
setSelectedNode: (el: HTMLElement) => void;
|
|
18
18
|
isDisabledIndex: (i: number) => boolean;
|
|
19
|
-
notifySelectItem: (data:
|
|
19
|
+
notifySelectItem: (data: I) => void;
|
|
20
20
|
scrollToCenter: (selectedNode: Element, scrollWrapper?: Element, duration?: number) => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any
|
|
23
|
+
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any>, I = Item> extends BaseFoundation<ScrollItemAdapter<P, S, I>, P, S> {
|
|
24
24
|
_cachedSelectedNode: HTMLElement = null;
|
|
25
25
|
|
|
26
26
|
selectIndex(index: number, listWrapper: HTMLElement) {
|
package/select/foundation.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable max-len */
|
|
3
3
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
4
4
|
import KeyCode from '../utils/keyCode';
|
|
5
|
-
import { isNumber, isString, isEqual } from 'lodash-es';
|
|
5
|
+
import { isNumber, isString, isEqual, omit } from 'lodash-es';
|
|
6
6
|
import warning from '../utils/warning';
|
|
7
7
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
8
8
|
import { BasicOptionProps } from './optionFoundation';
|
|
@@ -45,8 +45,9 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
45
45
|
updateHovering(isHover: boolean): void;
|
|
46
46
|
updateScrollTop(): void;
|
|
47
47
|
}
|
|
48
|
-
type PropValue = string | number | Record<string, any>;
|
|
49
48
|
|
|
49
|
+
type LabelValue = string | number;
|
|
50
|
+
type PropValue = LabelValue | Record<string, any>;
|
|
50
51
|
export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
51
52
|
|
|
52
53
|
constructor(adapter: SelectAdapter) {
|
|
@@ -230,9 +231,9 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
230
231
|
selections.set(optionExist.label, optionExist);
|
|
231
232
|
} else if (noMatchOptionInList) {
|
|
232
233
|
// If the current value does not have a corresponding item in the optionList, construct an option and update it to the selection. However, it does not need to be inserted into the list
|
|
233
|
-
let optionNotExist = { value: propValue, label: propValue, _notExist: true };
|
|
234
|
+
let optionNotExist = { value: propValue, label: propValue, _notExist: true, _scrollIndex: -1 } as BasicOptionProps;
|
|
234
235
|
if (onChangeWithObject) {
|
|
235
|
-
optionNotExist = { ...propValue as BasicOptionProps, _notExist: true
|
|
236
|
+
optionNotExist = { ...propValue as BasicOptionProps, _notExist: true, _scrollIndex: -1 };
|
|
236
237
|
}
|
|
237
238
|
selections.set(optionNotExist.label, optionNotExist);
|
|
238
239
|
}
|
|
@@ -258,11 +259,11 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
258
259
|
|
|
259
260
|
// When onChangeWithObject is true
|
|
260
261
|
if (onChangeWithObject && propValueIsArray) {
|
|
261
|
-
selectedValues = propValue.map(
|
|
262
|
+
selectedValues = (propValue as BasicOptionProps[]).map(item => item.value);
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
if (propValueIsArray && selectedValues.length) {
|
|
265
|
-
selectedValues.forEach((selectedValue
|
|
266
|
+
(selectedValues as LabelValue[]).forEach((selectedValue, i: number) => {
|
|
266
267
|
// The current value exists in the current optionList
|
|
267
268
|
const index = originalOptions.findIndex(option => option.value === selectedValue);
|
|
268
269
|
if (index !== -1) {
|
|
@@ -277,7 +278,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
277
278
|
// The current value does not exist in the current optionList or the list before the change. Construct an option and update it to the selection
|
|
278
279
|
let optionNotExist = { value: selectedValue, label: selectedValue, _notExist: true };
|
|
279
280
|
onChangeWithObject ? (optionNotExist = { ...propValue[i] as any, _notExist: true }) : null;
|
|
280
|
-
selections.set(optionNotExist.label, optionNotExist);
|
|
281
|
+
selections.set(optionNotExist.label, { ...optionNotExist, _scrollIndex: -1 });
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
});
|
|
@@ -409,7 +410,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
409
410
|
this._notifyDeselect(value, { value, label, ...rest });
|
|
410
411
|
selections.delete(label);
|
|
411
412
|
} else if (maxLimit && selections.size === maxLimit) {
|
|
412
|
-
this._adapter.notifyMaxLimit({ value, label, ...rest });
|
|
413
|
+
this._adapter.notifyMaxLimit({ value, label, ...omit(rest, '_scrollIndex') });
|
|
413
414
|
return;
|
|
414
415
|
} else {
|
|
415
416
|
this._notifySelect(value, { value, label, ...rest });
|
|
@@ -787,6 +788,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
787
788
|
delete option._parentGroup;
|
|
788
789
|
delete option._show;
|
|
789
790
|
delete option._selected;
|
|
791
|
+
delete option._scrollIndex;
|
|
790
792
|
if ('_keyInOptionList' in option) {
|
|
791
793
|
option.key = option._keyInOptionList;
|
|
792
794
|
delete option._keyInOptionList;
|
package/table/utils.ts
CHANGED
|
@@ -166,7 +166,7 @@ export function isSelectionColumn(column: Record<string, any>) {
|
|
|
166
166
|
return get(column, 'key') === strings.DEFAULT_KEY_COLUMN_SELECTION;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
export function filterColumns(columns: Record<string, any>[], ignoreKeys = [strings.DEFAULT_KEY_COLUMN_SCROLLBAR]) {
|
|
169
|
+
export function filterColumns(columns: Record<string, any>[], ignoreKeys = [strings.DEFAULT_KEY_COLUMN_SCROLLBAR as string]) {
|
|
170
170
|
return filter(columns, col => !ignoreKeys.includes(col.key));
|
|
171
171
|
}
|
|
172
172
|
|
package/tabs/foundation.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { noop } from 'lodash-es';
|
|
|
3
3
|
|
|
4
4
|
export interface TabsAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
5
5
|
collectPane: () => void;
|
|
6
|
+
collectActiveKey: () => void;
|
|
6
7
|
notifyTabClick: (activeKey: string, event: any) => void;
|
|
7
8
|
notifyChange: (activeKey: string) => void;
|
|
8
9
|
setNewActiveKey: (activeKey: string) => void;
|
|
9
10
|
getDefaultActiveKeyFromChildren: () => string;
|
|
11
|
+
notifyTabDelete: (tabKey: string) => void;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
class TabsFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TabsAdapter<P, S>, P, S> {
|
|
@@ -64,15 +66,12 @@ class TabsFoundation<P = Record<string, any>, S = Record<string, any>> extends B
|
|
|
64
66
|
|
|
65
67
|
handleTabPanesChange(): void {
|
|
66
68
|
this._adapter.collectPane();
|
|
69
|
+
this._adapter.collectActiveKey();
|
|
70
|
+
}
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
activeKey = this._adapter.getDefaultActiveKeyFromChildren();
|
|
71
|
-
}
|
|
72
|
-
if (typeof activeKey !== 'undefined') {
|
|
73
|
-
this.handleNewActiveKey(activeKey);
|
|
74
|
-
}
|
|
72
|
+
handleTabDelete(tabKey: string): void {
|
|
73
|
+
this._adapter.notifyTabDelete(tabKey);
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
export default TabsFoundation;
|
|
77
|
+
export default TabsFoundation;
|
package/tabs/tabs.scss
CHANGED
|
@@ -6,26 +6,26 @@ $module: #{$prefix}-tabs;
|
|
|
6
6
|
.#{$module} {
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
position: relative;
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
&-left {
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
&-bar {
|
|
16
16
|
position: relative;
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
outline: none;
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
&-left {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
&-extra {
|
|
26
26
|
padding: $spacing-tabs_bar_extra-paddingY $spacing-tabs_bar_extra-paddingX;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
.#{$module}-tab {
|
|
30
30
|
@include font-size-regular;
|
|
31
31
|
cursor: pointer;
|
|
@@ -33,76 +33,92 @@ $module: #{$prefix}-tabs;
|
|
|
33
33
|
position: relative;
|
|
34
34
|
display: block;
|
|
35
35
|
float: left;
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
font-weight: $font-tabs_tab-fontWeight;
|
|
38
38
|
color: $color-tabs_tab_line_default-text-default;
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
user-select: none;
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
.#{$prefix}-icon {
|
|
43
43
|
position: relative;
|
|
44
44
|
margin-right: $spacing-tabs_tab_icon-marginRight;
|
|
45
45
|
top: $spacing-tabs_tab_icon-top;
|
|
46
46
|
color: $color-tabs_tab-icon-default;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
.#{$prefix}-icon-close {
|
|
50
|
+
margin-right: 0;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
color: var(--semi-color-text-2);
|
|
53
|
+
margin-left: 10px;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
&:hover {
|
|
50
58
|
color: $color-tabs_tab_line_default-text-hover;
|
|
51
|
-
|
|
59
|
+
|
|
52
60
|
.#{$prefix}-icon {
|
|
53
61
|
color: $color-tabs_tab-icon-hover;
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
|
-
|
|
64
|
+
|
|
57
65
|
&:active {
|
|
58
66
|
color: $color-tabs_tab_line_default-text-active;
|
|
59
|
-
|
|
67
|
+
|
|
60
68
|
.#{$prefix}-icon {
|
|
61
69
|
color: $color-tabs_tab-icon-active;
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
72
|
}
|
|
65
|
-
|
|
73
|
+
|
|
66
74
|
.#{$module}-tab-active {
|
|
67
|
-
|
|
75
|
+
|
|
68
76
|
&,
|
|
69
77
|
&:hover {
|
|
70
|
-
color: $color-tabs_tab_line_selected-text-default;
|
|
71
78
|
cursor: default;
|
|
72
79
|
// border-bottom: 2px solid $color-tabs_tab_line_indicator_selected-icon-default;
|
|
73
80
|
font-weight: $font-tabs_tab_active-fontWeight;
|
|
74
81
|
color: $color-tabs_tab_line_selected-text-default;
|
|
75
|
-
|
|
82
|
+
|
|
76
83
|
.#{$prefix}-icon {
|
|
77
84
|
color: $color-tabs_tab_selected-icon-default;
|
|
78
85
|
}
|
|
86
|
+
|
|
87
|
+
.#{$prefix}-icon-close {
|
|
88
|
+
color: var(--semi-color-text-2);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.#{$prefix}-icon-close:hover {
|
|
93
|
+
color: var(--semi-color-text-1);
|
|
79
94
|
}
|
|
80
95
|
}
|
|
81
|
-
|
|
96
|
+
|
|
82
97
|
.#{$module}-tab-disabled {
|
|
83
98
|
cursor: not-allowed;
|
|
84
99
|
color: $color-tabs_tab_line_disabled-text-default;
|
|
85
|
-
|
|
100
|
+
|
|
86
101
|
&:hover {
|
|
87
102
|
color: $color-tabs_tab_line_disabled-text-hover;
|
|
88
103
|
border-bottom: none;
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
106
|
}
|
|
92
|
-
|
|
107
|
+
|
|
93
108
|
&-bar-collapse {
|
|
94
109
|
&,
|
|
95
110
|
.#{$module}-bar-overflow-list {
|
|
96
111
|
display: flex;
|
|
97
112
|
align-items: center;
|
|
98
113
|
}
|
|
99
|
-
|
|
114
|
+
|
|
100
115
|
.#{$prefix}-overflow-list {
|
|
101
116
|
flex: 1;
|
|
117
|
+
|
|
102
118
|
.#{$prefix}-overflow-list-scroll-wrapper {
|
|
103
119
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
104
120
|
scrollbar-width: none; /* Firefox */
|
|
105
|
-
|
|
121
|
+
|
|
106
122
|
&::-webkit-scrollbar {
|
|
107
123
|
display: none; /* Safari and Chrome */
|
|
108
124
|
width: 0;
|
|
@@ -110,98 +126,100 @@ $module: #{$prefix}-tabs;
|
|
|
110
126
|
}
|
|
111
127
|
}
|
|
112
128
|
}
|
|
113
|
-
|
|
129
|
+
|
|
114
130
|
.#{$module}-bar-arrow-start {
|
|
115
131
|
margin-right: $spacing-tabs_overflow_icon-marginRight;
|
|
116
132
|
}
|
|
117
|
-
|
|
133
|
+
|
|
118
134
|
.#{$module}-bar-arrow-end {
|
|
119
135
|
margin-left: $spacing-tabs_overflow_icon-marginLeft;
|
|
120
136
|
}
|
|
121
137
|
}
|
|
122
|
-
|
|
138
|
+
|
|
123
139
|
&-bar-dropdown {
|
|
124
140
|
max-height: $height-tabs_overflow_list;
|
|
125
141
|
overflow-y: auto;
|
|
126
142
|
}
|
|
127
|
-
|
|
143
|
+
|
|
128
144
|
&-bar:after {
|
|
129
145
|
content: "";
|
|
130
146
|
height: 0;
|
|
131
147
|
display: block;
|
|
132
148
|
clear: both;
|
|
133
149
|
}
|
|
134
|
-
|
|
150
|
+
|
|
135
151
|
&-bar-line {
|
|
136
152
|
&.#{$module}-bar-top {
|
|
137
153
|
border-bottom: $width-tabs_bar_line-border solid $color-tabs_tab_line_default-border-default;
|
|
138
|
-
|
|
154
|
+
|
|
139
155
|
.#{$module}-tab {
|
|
140
156
|
padding: $spacing-tabs_bar_line_tab-paddingTop $spacing-tabs_bar_line_tab-paddingRight $spacing-tabs_bar_line_tab-paddingBottom $spacing-tabs_bar_line_tab-paddingLeft;
|
|
141
|
-
|
|
157
|
+
|
|
158
|
+
&:nth-of-type(1) {
|
|
142
159
|
padding-left: 0;
|
|
143
160
|
}
|
|
161
|
+
|
|
144
162
|
border-bottom: $width-tabs_bar_line_tab-border solid transparent;
|
|
145
|
-
|
|
163
|
+
|
|
146
164
|
&:hover {
|
|
147
165
|
border-bottom: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_default-border-hover;
|
|
148
166
|
}
|
|
149
|
-
|
|
167
|
+
|
|
150
168
|
&:active {
|
|
151
169
|
border-bottom: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_default-border-active;
|
|
152
170
|
}
|
|
153
|
-
|
|
171
|
+
|
|
154
172
|
&:not(:last-of-type) {
|
|
155
173
|
margin-right: $spacing-tabs_bar_line_tab-marginRight;
|
|
156
174
|
}
|
|
157
|
-
|
|
175
|
+
|
|
158
176
|
&-small {
|
|
159
177
|
padding: $spacing-tabs_bar_line_tab_small-paddingTop $spacing-tabs_bar_line_tab_small-paddingRight $spacing-tabs_bar_line_tab_small-paddingBottom $spacing-tabs_bar_line_tab_small-paddingLeft;
|
|
160
178
|
}
|
|
161
|
-
|
|
179
|
+
|
|
162
180
|
&-medium {
|
|
163
181
|
padding: $spacing-tabs_bar_line_tab_medium-paddingTop $spacing-tabs_bar_line_tab_medium-paddingRight $spacing-tabs_bar_line_tab_medium-paddingBottom $spacing-tabs_bar_line_tab_medium-paddingLeft;
|
|
164
182
|
}
|
|
165
183
|
}
|
|
166
|
-
|
|
184
|
+
|
|
167
185
|
.#{$module}-tab-active {
|
|
168
|
-
|
|
186
|
+
|
|
169
187
|
&,
|
|
170
188
|
&:hover {
|
|
171
189
|
border-bottom: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_indicator_selected-icon-default;
|
|
172
190
|
}
|
|
173
191
|
}
|
|
174
192
|
}
|
|
175
|
-
|
|
193
|
+
|
|
176
194
|
&.#{$module}-bar-left {
|
|
177
195
|
border-right: $width-tabs_bar_line-border solid $color-tabs_tab_line_default-border-default;
|
|
178
|
-
|
|
196
|
+
|
|
179
197
|
.#{$module}-tab {
|
|
180
198
|
padding: $spacing-tabs_bar_line_tab_left-padding;
|
|
181
199
|
border-left: $width-tabs_bar_line_tab-border solid transparent;
|
|
182
|
-
|
|
200
|
+
|
|
183
201
|
&:hover {
|
|
184
202
|
border-left: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_default-border-hover;
|
|
185
203
|
background-color: $color-tabs_tab_line_vertical-bg-hover;
|
|
186
204
|
}
|
|
187
|
-
|
|
205
|
+
|
|
188
206
|
&:active {
|
|
189
207
|
border-left: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_default-border-active;
|
|
190
208
|
background-color: $color-tabs_tab_line_vertical-bg-active;
|
|
191
209
|
}
|
|
192
|
-
|
|
210
|
+
|
|
193
211
|
&-small {
|
|
194
212
|
padding: $spacing-tabs_bar_line_tab_left_small-padding;
|
|
195
213
|
}
|
|
196
|
-
|
|
214
|
+
|
|
197
215
|
&-medium {
|
|
198
216
|
padding: $spacing-tabs_bar_line_tab_left_medium-padding;
|
|
199
217
|
}
|
|
200
218
|
}
|
|
201
|
-
|
|
219
|
+
|
|
202
220
|
.#{$module}-tab-active {
|
|
203
221
|
background-color: $color-tabs_tab_line_vertical_selected-bg-default;
|
|
204
|
-
|
|
222
|
+
|
|
205
223
|
&,
|
|
206
224
|
&:hover {
|
|
207
225
|
border-left: $width-tabs_bar_line_tab-border solid $color-tabs_tab_line_indicator_selected-icon-default;
|
|
@@ -209,47 +227,49 @@ $module: #{$prefix}-tabs;
|
|
|
209
227
|
}
|
|
210
228
|
}
|
|
211
229
|
}
|
|
212
|
-
|
|
230
|
+
|
|
213
231
|
// type='bar' extar need specific
|
|
214
232
|
.#{$module}-bar-extra {
|
|
215
233
|
height: $height-tabs_bar_extra_large;
|
|
216
234
|
line-height: $font-tabs_bar_extra_large-lineHeight;
|
|
217
235
|
}
|
|
236
|
+
|
|
218
237
|
.#{$module}-bar-line-extra-small {
|
|
219
238
|
height: $height-tabs_bar_extra_small;
|
|
220
239
|
line-height: $font-tabs_bar_extra_small-lineHeight;
|
|
221
240
|
}
|
|
222
241
|
}
|
|
223
|
-
|
|
242
|
+
|
|
224
243
|
&-bar-card {
|
|
225
244
|
&.#{$module}-bar-top {
|
|
226
|
-
|
|
245
|
+
|
|
227
246
|
&::before {
|
|
228
247
|
position: absolute;
|
|
229
248
|
right: 0;
|
|
230
249
|
left: 0;
|
|
231
250
|
bottom: 0;
|
|
232
251
|
border-bottom: $width-tabs_bar_card-border solid $color-tabs_tab_card_default-border-default;
|
|
233
|
-
content:
|
|
252
|
+
content: "";
|
|
234
253
|
}
|
|
254
|
+
|
|
235
255
|
// border-bottom: $border-thickness-control solid $color-tabs_tab_line_default-border-default;
|
|
236
|
-
|
|
256
|
+
|
|
237
257
|
.#{$module}-tab {
|
|
238
258
|
border: $width-tabs_bar_card-border solid transparent;
|
|
239
259
|
border-bottom: none;
|
|
240
260
|
border-radius: $radius-tabs_tab_card;
|
|
241
|
-
|
|
261
|
+
|
|
242
262
|
&:hover {
|
|
243
263
|
border-bottom: none;
|
|
244
264
|
}
|
|
245
|
-
|
|
265
|
+
|
|
246
266
|
&:not(:last-of-type) {
|
|
247
267
|
margin-right: $spacing-tabs_bar_card_tab-marginRight;
|
|
248
268
|
}
|
|
249
269
|
}
|
|
250
|
-
|
|
270
|
+
|
|
251
271
|
.#{$module}-tab-active {
|
|
252
|
-
|
|
272
|
+
|
|
253
273
|
&,
|
|
254
274
|
&:hover {
|
|
255
275
|
padding: $spacing-tabs_bar_card_tab_active-paddingTop $spacing-tabs_bar_card_tab_active-paddingRight $spacing-tabs_bar_card_tab_active-paddingBottom $spacing-tabs_bar_card_tab_active-paddingLeft;
|
|
@@ -260,26 +280,26 @@ $module: #{$prefix}-tabs;
|
|
|
260
280
|
}
|
|
261
281
|
}
|
|
262
282
|
}
|
|
263
|
-
|
|
283
|
+
|
|
264
284
|
&.#{$module}-bar-left {
|
|
265
285
|
border-right: $width-tabs_bar_card-border solid $color-tabs_tab_line_default-border-default;
|
|
266
|
-
|
|
286
|
+
|
|
267
287
|
.#{$module}-tab {
|
|
268
288
|
border: $width-tabs_bar_card-border solid transparent;
|
|
269
289
|
border-right: none;
|
|
270
290
|
border-radius: $radius-tabs_tab_card_left;
|
|
271
|
-
|
|
291
|
+
|
|
272
292
|
&:hover {
|
|
273
293
|
border-right: none;
|
|
274
294
|
}
|
|
275
|
-
|
|
295
|
+
|
|
276
296
|
&:not(:last-of-type) {
|
|
277
297
|
margin-bottom: $spacing-tabs_bar_card_tab_left-marginBottom;
|
|
278
298
|
}
|
|
279
299
|
}
|
|
280
|
-
|
|
300
|
+
|
|
281
301
|
.#{$module}-tab-active {
|
|
282
|
-
|
|
302
|
+
|
|
283
303
|
&:after {
|
|
284
304
|
content: " ";
|
|
285
305
|
width: 1px;
|
|
@@ -289,7 +309,7 @@ $module: #{$prefix}-tabs;
|
|
|
289
309
|
bottom: 0;
|
|
290
310
|
background: $color-tabs_tab_card_selected-bg-default;
|
|
291
311
|
}
|
|
292
|
-
|
|
312
|
+
|
|
293
313
|
&,
|
|
294
314
|
&:hover {
|
|
295
315
|
padding: $spacing-tabs_bar_card_tab_left_active-paddingY $spacing-tabs_bar_card_tab_left_active-paddingX;
|
|
@@ -300,59 +320,59 @@ $module: #{$prefix}-tabs;
|
|
|
300
320
|
}
|
|
301
321
|
}
|
|
302
322
|
}
|
|
303
|
-
|
|
323
|
+
|
|
304
324
|
.#{$module}-tab {
|
|
305
325
|
padding: $spacing-tabs_bar_card_tab-paddingY $spacing-tabs_bar_card_tab-paddingX;
|
|
306
|
-
|
|
326
|
+
|
|
307
327
|
&:hover {
|
|
308
328
|
background: $color-tabs_tab_card-bg-hover;
|
|
309
329
|
}
|
|
310
|
-
|
|
330
|
+
|
|
311
331
|
&:active {
|
|
312
332
|
background: $color-tabs_tab_card-bg-active;
|
|
313
333
|
}
|
|
314
334
|
}
|
|
315
335
|
}
|
|
316
|
-
|
|
336
|
+
|
|
317
337
|
&-bar-button {
|
|
318
338
|
border: none;
|
|
319
|
-
|
|
339
|
+
|
|
320
340
|
&.#{$module}-bar-left {
|
|
321
341
|
.#{$module}-tab {
|
|
322
|
-
|
|
342
|
+
|
|
323
343
|
&:not(:last-of-type) {
|
|
324
344
|
margin-bottom: $spacing-tabs_bar_button_tab_left-marginBottom;
|
|
325
345
|
}
|
|
326
346
|
}
|
|
327
347
|
}
|
|
328
|
-
|
|
348
|
+
|
|
329
349
|
&.#{$module}-bar-top {
|
|
330
350
|
.#{$module}-tab {
|
|
331
|
-
|
|
351
|
+
|
|
332
352
|
&:not(:last-of-type) {
|
|
333
353
|
margin-right: $spacing-tabs_bar_button_tab-marginRight;
|
|
334
354
|
}
|
|
335
355
|
}
|
|
336
356
|
}
|
|
337
|
-
|
|
357
|
+
|
|
338
358
|
.#{$module}-tab {
|
|
339
359
|
padding: $spacing-tabs_bar_button_tab-paddingY $spacing-tabs_bar_button_tab-paddingX;
|
|
340
360
|
border-radius: $radius-tabs_tab_button;
|
|
341
361
|
color: $color-tabs_tab_button-text-default;
|
|
342
362
|
border: none;
|
|
343
|
-
|
|
363
|
+
|
|
344
364
|
&:hover {
|
|
345
365
|
border: none;
|
|
346
366
|
background-color: $color-tabs_tab_button-bg-hover;
|
|
347
367
|
}
|
|
348
|
-
|
|
368
|
+
|
|
349
369
|
&:active {
|
|
350
370
|
background-color: $color-tabs_tab_button-bg-active;
|
|
351
371
|
}
|
|
352
372
|
}
|
|
353
|
-
|
|
373
|
+
|
|
354
374
|
.#{$module}-tab-active {
|
|
355
|
-
|
|
375
|
+
|
|
356
376
|
&,
|
|
357
377
|
&:hover {
|
|
358
378
|
color: $color-tabs_tab_button_selected-text-default;
|
|
@@ -361,19 +381,19 @@ $module: #{$prefix}-tabs;
|
|
|
361
381
|
}
|
|
362
382
|
}
|
|
363
383
|
}
|
|
364
|
-
|
|
384
|
+
|
|
365
385
|
&-content {
|
|
366
386
|
width: 100%;
|
|
367
387
|
padding: $spacing-tabs_content-paddingY $spacing-tabs_content-paddingX;
|
|
368
388
|
// overflow: hidden;
|
|
369
389
|
// display: flex;
|
|
370
390
|
}
|
|
371
|
-
|
|
391
|
+
|
|
372
392
|
&-content-left {
|
|
373
393
|
height: 100%;
|
|
374
394
|
padding: $spacing-tabs_content_left-paddingY $spacing-tabs_content_left-paddingX;
|
|
375
395
|
}
|
|
376
|
-
|
|
396
|
+
|
|
377
397
|
&-pane {
|
|
378
398
|
width: 100%;
|
|
379
399
|
overflow: hidden;
|
|
@@ -381,7 +401,7 @@ $module: #{$prefix}-tabs;
|
|
|
381
401
|
// flex-shrink: 0;
|
|
382
402
|
// position: absolute;
|
|
383
403
|
}
|
|
384
|
-
|
|
404
|
+
|
|
385
405
|
&-pane-inactive,
|
|
386
406
|
&-content-no-animated &-pane-inactive {
|
|
387
407
|
display: none;
|
package/tagInput/foundation.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface TagInputAdapter extends DefaultAdapter {
|
|
|
24
24
|
notifyTagChange: (v: string[]) => void;
|
|
25
25
|
notifyTagAdd: (v: string[]) => void;
|
|
26
26
|
notifyTagRemove: (v: string, idx: number) => void;
|
|
27
|
+
notifyKeyDown: (e: TagInputMouseEvent) => void;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
@@ -90,6 +91,7 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
90
91
|
const removedTag = tagsArray[length - 1];
|
|
91
92
|
this._onRemove(newTagList, removedTag, length - 1);
|
|
92
93
|
}
|
|
94
|
+
this._adapter.notifyKeyDown(e);
|
|
93
95
|
};
|
|
94
96
|
|
|
95
97
|
_handleAddTags(e: TagInputChangeEvent) {
|