@douyinfe/semi-foundation 2.30.2 → 2.31.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.
- package/carousel/foundation.ts +8 -2
- package/cascader/cascader.scss +8 -0
- package/cascader/foundation.ts +11 -3
- package/cascader/variables.scss +3 -1
- package/image/previewImageFoundation.ts +1 -2
- package/image/previewInnerFoundation.ts +0 -6
- package/lib/cjs/carousel/foundation.d.ts +2 -0
- package/lib/cjs/carousel/foundation.js +8 -3
- package/lib/cjs/cascader/cascader.css +6 -0
- package/lib/cjs/cascader/cascader.scss +8 -0
- package/lib/cjs/cascader/foundation.js +10 -2
- package/lib/cjs/cascader/variables.scss +3 -1
- package/lib/cjs/image/previewImageFoundation.js +1 -3
- package/lib/cjs/image/previewInnerFoundation.d.ts +0 -1
- package/lib/cjs/image/previewInnerFoundation.js +0 -6
- package/lib/cjs/select/foundation.d.ts +3 -3
- package/lib/cjs/select/foundation.js +14 -13
- package/lib/cjs/table/foundation.d.ts +4 -0
- package/lib/cjs/table/foundation.js +13 -2
- package/lib/cjs/table/rtl.scss +33 -2
- package/lib/cjs/table/table.css +50 -51
- package/lib/cjs/table/table.scss +8 -0
- package/lib/cjs/table/utils.d.ts +2 -0
- package/lib/cjs/table/utils.js +18 -0
- package/lib/cjs/tag/tag.css +10 -0
- package/lib/cjs/tag/tag.scss +13 -3
- package/lib/cjs/tooltip/foundation.d.ts +2 -0
- package/lib/cjs/tooltip/foundation.js +10 -1
- package/lib/es/carousel/foundation.d.ts +2 -0
- package/lib/es/carousel/foundation.js +8 -3
- package/lib/es/cascader/cascader.css +6 -0
- package/lib/es/cascader/cascader.scss +8 -0
- package/lib/es/cascader/foundation.js +10 -2
- package/lib/es/cascader/variables.scss +3 -1
- package/lib/es/image/previewImageFoundation.js +1 -3
- package/lib/es/image/previewInnerFoundation.d.ts +0 -1
- package/lib/es/image/previewInnerFoundation.js +0 -6
- package/lib/es/select/foundation.d.ts +3 -3
- package/lib/es/select/foundation.js +14 -13
- package/lib/es/table/foundation.d.ts +4 -0
- package/lib/es/table/foundation.js +13 -2
- package/lib/es/table/rtl.scss +33 -2
- package/lib/es/table/table.css +50 -51
- package/lib/es/table/table.scss +8 -0
- package/lib/es/table/utils.d.ts +2 -0
- package/lib/es/table/utils.js +16 -0
- package/lib/es/tag/tag.css +10 -0
- package/lib/es/tag/tag.scss +13 -3
- package/lib/es/tooltip/foundation.d.ts +2 -0
- package/lib/es/tooltip/foundation.js +10 -1
- package/package.json +2 -2
- package/select/foundation.ts +15 -13
- package/table/foundation.ts +13 -2
- package/table/rtl.scss +33 -2
- package/table/table.scss +8 -0
- package/table/utils.ts +14 -0
- package/tag/tag.scss +13 -3
- package/tooltip/foundation.ts +15 -7
package/carousel/foundation.ts
CHANGED
|
@@ -18,6 +18,11 @@ class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> exten
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
_interval = null;
|
|
21
|
+
_forcePlay = false;
|
|
22
|
+
|
|
23
|
+
setForcePlay(forcePlay: boolean) {
|
|
24
|
+
this._forcePlay = forcePlay;
|
|
25
|
+
}
|
|
21
26
|
|
|
22
27
|
play(interval: number): void {
|
|
23
28
|
if (this._interval) {
|
|
@@ -105,7 +110,7 @@ class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> exten
|
|
|
105
110
|
getSwitchingTime(): number {
|
|
106
111
|
const { autoPlay, speed } = this.getProps();
|
|
107
112
|
const autoPlayType = typeof autoPlay;
|
|
108
|
-
if (autoPlayType === 'boolean'
|
|
113
|
+
if (autoPlayType === 'boolean'){
|
|
109
114
|
return numbers.DEFAULT_INTERVAL + speed;
|
|
110
115
|
}
|
|
111
116
|
if (isObject(autoPlay)){
|
|
@@ -121,7 +126,8 @@ class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> exten
|
|
|
121
126
|
handleAutoPlay(): void {
|
|
122
127
|
const { autoPlay } = this.getProps();
|
|
123
128
|
const autoPlayType = typeof autoPlay;
|
|
124
|
-
|
|
129
|
+
// when user manually call the play function, force play
|
|
130
|
+
if ((autoPlayType === 'boolean' && autoPlay) || isObject(autoPlay) || this._forcePlay){
|
|
125
131
|
this.play(this.getSwitchingTime());
|
|
126
132
|
}
|
|
127
133
|
}
|
package/cascader/cascader.scss
CHANGED
|
@@ -324,6 +324,14 @@ $module: #{$prefix}-cascader;
|
|
|
324
324
|
align-items: center;
|
|
325
325
|
position: relative;
|
|
326
326
|
|
|
327
|
+
&-small {
|
|
328
|
+
height: $height-cascader_selection_wrapper_small;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&-large {
|
|
332
|
+
height: $height-cascader_selection_wrapper_large;
|
|
333
|
+
}
|
|
334
|
+
|
|
327
335
|
.#{$prefix}-input-wrapper {
|
|
328
336
|
position: absolute;
|
|
329
337
|
top: 0;
|
package/cascader/foundation.ts
CHANGED
|
@@ -441,7 +441,11 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
441
441
|
if (filterable && !multiple) {
|
|
442
442
|
const displayText = this.renderDisplayText(selectedKey, keyEntities);
|
|
443
443
|
updateStates.inputPlaceHolder = displayText;
|
|
444
|
-
|
|
444
|
+
/*
|
|
445
|
+
* displayText should not be assign to inputValue,
|
|
446
|
+
* cause inputValue should only change by user enter
|
|
447
|
+
*/
|
|
448
|
+
// updateStates.inputValue = displayText;
|
|
445
449
|
}
|
|
446
450
|
/**
|
|
447
451
|
* If selectedKeys does not meet the update conditions,
|
|
@@ -472,7 +476,11 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
472
476
|
if (filterable && !multiple) {
|
|
473
477
|
const displayText = this._defaultRenderText(valuePath);
|
|
474
478
|
updateStates.inputPlaceHolder = displayText;
|
|
475
|
-
|
|
479
|
+
/*
|
|
480
|
+
* displayText should not be assign to inputValue,
|
|
481
|
+
* cause inputValue should only change by user enter
|
|
482
|
+
*/
|
|
483
|
+
// updateStates.inputValue = displayText;
|
|
476
484
|
}
|
|
477
485
|
keyEntities[key] = optionNotExist as BasicEntity;
|
|
478
486
|
// Fix: 1155, if the data is loaded asynchronously to update treeData, the emptying operation should not be done when entering the updateSelectedKey method
|
|
@@ -553,7 +561,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
553
561
|
}
|
|
554
562
|
|
|
555
563
|
|
|
556
|
-
updateSearching = (isSearching:boolean)=>{
|
|
564
|
+
updateSearching = (isSearching: boolean)=>{
|
|
557
565
|
this._adapter.updateStates({ isSearching: false });
|
|
558
566
|
}
|
|
559
567
|
|
package/cascader/variables.scss
CHANGED
|
@@ -96,7 +96,9 @@ $height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
|
96
96
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
|
97
97
|
$height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
|
|
98
98
|
$height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
|
|
99
|
-
$height-
|
|
99
|
+
$height-cascader_selection_wrapper_small: 22px; //级联选择单选搜索时搜索框高度 - 小尺寸
|
|
100
|
+
$height-cascader_selection_wrapper: 30px; // 级联选择单选搜索时搜索框高度 - 默认尺寸
|
|
101
|
+
$height-cascader_selection_wrapper_large: 38px; //级联选择单选搜索时搜索框高度 - 大尺寸
|
|
100
102
|
|
|
101
103
|
$spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
|
|
102
104
|
$spacing-cascader_icon-marginX: $spacing-tight; // 级联选择 prefix/suffix 图标水平内间距
|
|
@@ -77,8 +77,7 @@ export default class PreviewImageFoundation<P = Record<string, any>, S = Record<
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
handleWindowResize = (): void => {
|
|
80
|
-
const { setRatio } = this.getProps();
|
|
81
|
-
const { ratio } = this.getProps();
|
|
80
|
+
const { ratio, setRatio } = this.getProps();
|
|
82
81
|
const { originImageWidth, originImageHeight } = this._adapter.getOriginImageSize();
|
|
83
82
|
if (originImageWidth && originImageHeight) {
|
|
84
83
|
if (ratio !== "adaptation") {
|
|
@@ -41,12 +41,6 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
|
|
|
41
41
|
this._adapter.enabledBodyScroll();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
handleRatio(type: string) {
|
|
45
|
-
this.setState({
|
|
46
|
-
ratio: type,
|
|
47
|
-
} as any);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
44
|
handleViewVisibleChange = () => {
|
|
51
45
|
const nowTime = new Date().getTime();
|
|
52
46
|
const mouseActiveTime = this._adapter.getMouseActiveTime();
|
|
@@ -9,6 +9,8 @@ export interface CarouselAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
9
9
|
declare class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<CarouselAdapter<P, S>, P, S> {
|
|
10
10
|
constructor(adapter: CarouselAdapter<P, S>);
|
|
11
11
|
_interval: any;
|
|
12
|
+
_forcePlay: boolean;
|
|
13
|
+
setForcePlay(forcePlay: boolean): void;
|
|
12
14
|
play(interval: number): void;
|
|
13
15
|
stop(): void;
|
|
14
16
|
goTo(activeIndex: number): void;
|
|
@@ -19,6 +19,11 @@ class CarouselFoundation extends _foundation.default {
|
|
|
19
19
|
constructor(adapter) {
|
|
20
20
|
super(Object.assign({}, adapter));
|
|
21
21
|
this._interval = null;
|
|
22
|
+
this._forcePlay = false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
setForcePlay(forcePlay) {
|
|
26
|
+
this._forcePlay = forcePlay;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
play(interval) {
|
|
@@ -136,7 +141,7 @@ class CarouselFoundation extends _foundation.default {
|
|
|
136
141
|
} = this.getProps();
|
|
137
142
|
const autoPlayType = typeof autoPlay;
|
|
138
143
|
|
|
139
|
-
if (autoPlayType === 'boolean'
|
|
144
|
+
if (autoPlayType === 'boolean') {
|
|
140
145
|
return _constants.numbers.DEFAULT_INTERVAL + speed;
|
|
141
146
|
}
|
|
142
147
|
|
|
@@ -155,9 +160,9 @@ class CarouselFoundation extends _foundation.default {
|
|
|
155
160
|
const {
|
|
156
161
|
autoPlay
|
|
157
162
|
} = this.getProps();
|
|
158
|
-
const autoPlayType = typeof autoPlay;
|
|
163
|
+
const autoPlayType = typeof autoPlay; // when user manually call the play function, force play
|
|
159
164
|
|
|
160
|
-
if (autoPlayType === 'boolean' && autoPlay || (0, _isObject2.default)(autoPlay)) {
|
|
165
|
+
if (autoPlayType === 'boolean' && autoPlay || (0, _isObject2.default)(autoPlay) || this._forcePlay) {
|
|
161
166
|
this.play(this.getSwitchingTime());
|
|
162
167
|
}
|
|
163
168
|
}
|
|
@@ -263,6 +263,12 @@
|
|
|
263
263
|
align-items: center;
|
|
264
264
|
position: relative;
|
|
265
265
|
}
|
|
266
|
+
.semi-cascader-single.semi-cascader-filterable .semi-cascader-selection .semi-cascader-search-wrapper-small {
|
|
267
|
+
height: 22px;
|
|
268
|
+
}
|
|
269
|
+
.semi-cascader-single.semi-cascader-filterable .semi-cascader-selection .semi-cascader-search-wrapper-large {
|
|
270
|
+
height: 38px;
|
|
271
|
+
}
|
|
266
272
|
.semi-cascader-single.semi-cascader-filterable .semi-cascader-selection .semi-cascader-search-wrapper .semi-input-wrapper {
|
|
267
273
|
position: absolute;
|
|
268
274
|
top: 0;
|
|
@@ -324,6 +324,14 @@ $module: #{$prefix}-cascader;
|
|
|
324
324
|
align-items: center;
|
|
325
325
|
position: relative;
|
|
326
326
|
|
|
327
|
+
&-small {
|
|
328
|
+
height: $height-cascader_selection_wrapper_small;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&-large {
|
|
332
|
+
height: $height-cascader_selection_wrapper_large;
|
|
333
|
+
}
|
|
334
|
+
|
|
327
335
|
.#{$prefix}-input-wrapper {
|
|
328
336
|
position: absolute;
|
|
329
337
|
top: 0;
|
|
@@ -305,7 +305,11 @@ class CascaderFoundation extends _foundation.default {
|
|
|
305
305
|
if (filterable && !multiple) {
|
|
306
306
|
const displayText = this.renderDisplayText(selectedKey, keyEntities);
|
|
307
307
|
updateStates.inputPlaceHolder = displayText;
|
|
308
|
-
|
|
308
|
+
/*
|
|
309
|
+
* displayText should not be assign to inputValue,
|
|
310
|
+
* cause inputValue should only change by user enter
|
|
311
|
+
*/
|
|
312
|
+
// updateStates.inputValue = displayText;
|
|
309
313
|
}
|
|
310
314
|
/**
|
|
311
315
|
* If selectedKeys does not meet the update conditions,
|
|
@@ -339,7 +343,11 @@ class CascaderFoundation extends _foundation.default {
|
|
|
339
343
|
const displayText = this._defaultRenderText(valuePath);
|
|
340
344
|
|
|
341
345
|
updateStates.inputPlaceHolder = displayText;
|
|
342
|
-
|
|
346
|
+
/*
|
|
347
|
+
* displayText should not be assign to inputValue,
|
|
348
|
+
* cause inputValue should only change by user enter
|
|
349
|
+
*/
|
|
350
|
+
// updateStates.inputValue = displayText;
|
|
343
351
|
}
|
|
344
352
|
|
|
345
353
|
keyEntities[key] = optionNotExist; // Fix: 1155, if the data is loaded asynchronously to update treeData, the emptying operation should not be done when entering the updateSelectedKey method
|
|
@@ -96,7 +96,9 @@ $height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
|
96
96
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
|
97
97
|
$height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
|
|
98
98
|
$height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
|
|
99
|
-
$height-
|
|
99
|
+
$height-cascader_selection_wrapper_small: 22px; //级联选择单选搜索时搜索框高度 - 小尺寸
|
|
100
|
+
$height-cascader_selection_wrapper: 30px; // 级联选择单选搜索时搜索框高度 - 默认尺寸
|
|
101
|
+
$height-cascader_selection_wrapper_large: 38px; //级联选择单选搜索时搜索框高度 - 大尺寸
|
|
100
102
|
|
|
101
103
|
$spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
|
|
102
104
|
$spacing-cascader_icon-marginX: $spacing-tight; // 级联选择 prefix/suffix 图标水平内间距
|
|
@@ -26,7 +26,6 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
|
|
|
26
26
|
constructor(adapter: PreviewInnerAdapter<P, S>);
|
|
27
27
|
beforeShow(): void;
|
|
28
28
|
afterHide(): void;
|
|
29
|
-
handleRatio(type: string): void;
|
|
30
29
|
handleViewVisibleChange: () => void;
|
|
31
30
|
handleMouseMoveEvent: (e: any, event: string) => void;
|
|
32
31
|
handleMouseMove: (e: any) => void;
|
|
@@ -23,7 +23,7 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
23
23
|
notifyClear(): void;
|
|
24
24
|
updateInputValue(inputValue: string): void;
|
|
25
25
|
focusInput(): void;
|
|
26
|
-
notifySearch(inputValue: string): void;
|
|
26
|
+
notifySearch(inputValue: string, event?: any): void;
|
|
27
27
|
registerKeyDown(handler: () => void): void;
|
|
28
28
|
unregisterKeyDown(): void;
|
|
29
29
|
notifyChange(value: string | BasicOptionProps | (string | BasicOptionProps)[]): void;
|
|
@@ -78,9 +78,9 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
78
78
|
clearSelected(): void;
|
|
79
79
|
updateOptionsActiveStatus(selections: Map<any, any>, options?: BasicOptionProps[]): void;
|
|
80
80
|
removeTag(item: BasicOptionProps): void;
|
|
81
|
-
clearInput(): void;
|
|
81
|
+
clearInput(event?: any): void;
|
|
82
82
|
focusInput(): void;
|
|
83
|
-
handleInputChange(sugInput: string): void;
|
|
83
|
+
handleInputChange(sugInput: string, event: any): void;
|
|
84
84
|
_filterOption(originalOptions: BasicOptionProps[], sugInput: string): BasicOptionProps[];
|
|
85
85
|
_createOptionByInput(allowCreate: boolean, optionsAfterFilter: BasicOptionProps[], sugInput: string): BasicOptionProps[];
|
|
86
86
|
bindKeyBoardEvent(): void;
|
|
@@ -461,7 +461,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
461
461
|
|
|
462
462
|
this._adapter.once('popoverClose', () => {
|
|
463
463
|
if (isFilterable) {
|
|
464
|
-
this.clearInput();
|
|
464
|
+
this.clearInput(e);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
if (closeCb) {
|
|
@@ -579,7 +579,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
579
579
|
|
|
580
580
|
if (this._isFilterable()) {
|
|
581
581
|
if (autoClearSearchValue) {
|
|
582
|
-
this.clearInput();
|
|
582
|
+
this.clearInput(event);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
this.focusInput();
|
|
@@ -599,7 +599,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
599
599
|
if (this._isFilterable()) {
|
|
600
600
|
// When filter active,if autoClearSearchValue is true,reset input after select
|
|
601
601
|
if (autoClearSearchValue) {
|
|
602
|
-
this.clearInput(); // At the same time, the filtering of options is also cleared, in order to show all candidates
|
|
602
|
+
this.clearInput(event); // At the same time, the filtering of options is also cleared, in order to show all candidates
|
|
603
603
|
|
|
604
604
|
const sugInput = '';
|
|
605
605
|
options = this._filterOption(options, sugInput);
|
|
@@ -689,9 +689,10 @@ class SelectFoundation extends _foundation.default {
|
|
|
689
689
|
|
|
690
690
|
this._notifyChange(selections);
|
|
691
691
|
}
|
|
692
|
-
}
|
|
692
|
+
} // The reason why event input is optional is that clearInput may be manually called by the user through ref
|
|
693
|
+
|
|
693
694
|
|
|
694
|
-
clearInput() {
|
|
695
|
+
clearInput(event) {
|
|
695
696
|
const {
|
|
696
697
|
inputValue
|
|
697
698
|
} = this.getStates(); // only when input is not null, select should notifySearch and updateOptions
|
|
@@ -699,7 +700,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
699
700
|
if (inputValue !== '') {
|
|
700
701
|
this._adapter.updateInputValue('');
|
|
701
702
|
|
|
702
|
-
this._adapter.notifySearch(''); // reset options filter
|
|
703
|
+
this._adapter.notifySearch('', event); // reset options filter
|
|
703
704
|
|
|
704
705
|
|
|
705
706
|
const {
|
|
@@ -726,7 +727,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
726
727
|
this._adapter.setIsFocusInContainer(false);
|
|
727
728
|
}
|
|
728
729
|
|
|
729
|
-
handleInputChange(sugInput) {
|
|
730
|
+
handleInputChange(sugInput, event) {
|
|
730
731
|
// Input is a controlled component, so the value needs to be updated
|
|
731
732
|
this._adapter.updateInputValue(sugInput);
|
|
732
733
|
|
|
@@ -750,7 +751,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
750
751
|
|
|
751
752
|
this._adapter.updateOptions(optionsAfterFilter);
|
|
752
753
|
|
|
753
|
-
this._adapter.notifySearch(sugInput); // In multi-select mode, the drop-down box is repositioned each time you enter, because it may cause a line break as the input changes
|
|
754
|
+
this._adapter.notifySearch(sugInput, event); // In multi-select mode, the drop-down box is repositioned each time you enter, because it may cause a line break as the input changes
|
|
754
755
|
|
|
755
756
|
|
|
756
757
|
if (this._isMultiple()) {
|
|
@@ -1026,7 +1027,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
1026
1027
|
}
|
|
1027
1028
|
} else {
|
|
1028
1029
|
// there are no focusable elements inside the container, tab to next element and trigger blur
|
|
1029
|
-
this.close();
|
|
1030
|
+
this.close(event);
|
|
1030
1031
|
|
|
1031
1032
|
this._notifyBlur(event);
|
|
1032
1033
|
}
|
|
@@ -1052,7 +1053,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
1052
1053
|
// focus in the last element in container, focus back to trigger and close panel
|
|
1053
1054
|
this._focusTrigger();
|
|
1054
1055
|
|
|
1055
|
-
this.close();
|
|
1056
|
+
this.close(event);
|
|
1056
1057
|
(0, _a11y.handlePrevent)(event);
|
|
1057
1058
|
}
|
|
1058
1059
|
}
|
|
@@ -1064,7 +1065,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
1064
1065
|
|
|
1065
1066
|
if (!isFocusInContainer) {
|
|
1066
1067
|
// focus in trigger, close the panel, shift tab to previe element and trigger blur
|
|
1067
|
-
this.close();
|
|
1068
|
+
this.close(event);
|
|
1068
1069
|
|
|
1069
1070
|
this._notifyBlur(event);
|
|
1070
1071
|
} else if (activeElement === focusableElements[0]) {
|
|
@@ -1107,7 +1108,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
1107
1108
|
this.onSelect(selectedOption, focusIndex, event);
|
|
1108
1109
|
}
|
|
1109
1110
|
} else {
|
|
1110
|
-
this.close();
|
|
1111
|
+
this.close(event);
|
|
1111
1112
|
}
|
|
1112
1113
|
}
|
|
1113
1114
|
}
|
|
@@ -1286,7 +1287,7 @@ class SelectFoundation extends _foundation.default {
|
|
|
1286
1287
|
} = this.getProps();
|
|
1287
1288
|
|
|
1288
1289
|
if (filter) {
|
|
1289
|
-
this.clearInput();
|
|
1290
|
+
this.clearInput(e);
|
|
1290
1291
|
}
|
|
1291
1292
|
|
|
1292
1293
|
this.clearSelected(); // prevent this click open dropdown
|
|
@@ -54,6 +54,9 @@ export interface TableAdapter<RecordType> extends DefaultAdapter {
|
|
|
54
54
|
getCachedFilteredSortedDataSource: () => RecordType[];
|
|
55
55
|
getCachedFilteredSortedRowKeys: () => BaseRowKeyType[];
|
|
56
56
|
getCachedFilteredSortedRowKeysSet: () => Set<BaseRowKeyType>;
|
|
57
|
+
setAllDisabledRowKeys: (allDisabledRowKeys: BaseRowKeyType[]) => void;
|
|
58
|
+
getAllDisabledRowKeys: () => BaseRowKeyType[];
|
|
59
|
+
getAllDisabledRowKeysSet: () => Set<BaseRowKeyType>;
|
|
57
60
|
notifyFilterDropdownVisibleChange: (visible: boolean, dataIndex: string) => void;
|
|
58
61
|
notifyChange: (changeInfo: {
|
|
59
62
|
pagination: BasePagination;
|
|
@@ -159,6 +162,7 @@ declare class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<Re
|
|
|
159
162
|
*/
|
|
160
163
|
setCachedFilteredSortedDataSource: (filteredSortedDataSource: RecordType[]) => void;
|
|
161
164
|
destroy(): void;
|
|
165
|
+
setAllDisabledRowKeys(disabledRowKeys: any): void;
|
|
162
166
|
handleClick(e: any): void;
|
|
163
167
|
handleMouseEnter(e: any): void;
|
|
164
168
|
handleMouseLeave(e: any): void;
|
|
@@ -166,12 +166,14 @@ class TableFoundation extends _foundation.default {
|
|
|
166
166
|
} = this._adapter.getStates();
|
|
167
167
|
|
|
168
168
|
const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
|
|
169
|
+
const allDataDisabledRowKeys = this.getAllDisabledRowKeys(filteredSortedDataSource);
|
|
169
170
|
const pageData = this.getCurrentPageData(filteredSortedDataSource);
|
|
170
171
|
this.setAdapterPageData(pageData);
|
|
171
172
|
this.initExpandedRowKeys(pageData);
|
|
172
173
|
this.initSelectedRowKeys(pageData); // cache dataSource after mount, and then calculate it on demand
|
|
173
174
|
|
|
174
175
|
this.setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
176
|
+
this.setAllDisabledRowKeys(allDataDisabledRowKeys);
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
initExpandedRowKeys() {
|
|
@@ -525,6 +527,10 @@ class TableFoundation extends _foundation.default {
|
|
|
525
527
|
|
|
526
528
|
destroy() {}
|
|
527
529
|
|
|
530
|
+
setAllDisabledRowKeys(disabledRowKeys) {
|
|
531
|
+
this._adapter.setAllDisabledRowKeys(disabledRowKeys);
|
|
532
|
+
}
|
|
533
|
+
|
|
528
534
|
handleClick(e) {}
|
|
529
535
|
|
|
530
536
|
handleMouseEnter(e) {}
|
|
@@ -774,8 +780,11 @@ class TableFoundation extends _foundation.default {
|
|
|
774
780
|
const selectedRowKeysSet = this._getSelectedRowKeysSet();
|
|
775
781
|
|
|
776
782
|
let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
|
|
777
|
-
|
|
778
|
-
const
|
|
783
|
+
|
|
784
|
+
const disabledRowKeys = this._adapter.getAllDisabledRowKeys();
|
|
785
|
+
|
|
786
|
+
const disabledRowKeysSet = this._adapter.getAllDisabledRowKeysSet();
|
|
787
|
+
|
|
779
788
|
let changedRowKeys; // Select all, if not disabled && not in selectedRowKeys
|
|
780
789
|
|
|
781
790
|
if (selected) {
|
|
@@ -1142,7 +1151,9 @@ class TableFoundation extends _foundation.default {
|
|
|
1142
1151
|
handleClickFilterOrSorter(queries) {
|
|
1143
1152
|
const dataSource = [...this.getProp('dataSource')];
|
|
1144
1153
|
const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
|
|
1154
|
+
const allDataDisabledRowKeys = this.getAllDisabledRowKeys(sortedDataSource);
|
|
1145
1155
|
this.setCachedFilteredSortedDataSource(sortedDataSource);
|
|
1156
|
+
this.setAllDisabledRowKeys(allDataDisabledRowKeys);
|
|
1146
1157
|
const pageData = this.getCurrentPageData(sortedDataSource);
|
|
1147
1158
|
this.setAdapterPageData(pageData);
|
|
1148
1159
|
}
|
package/lib/cjs/table/rtl.scss
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
$module: #{$prefix}-table;
|
|
2
2
|
|
|
3
|
-
.#{$
|
|
4
|
-
.#{$prefix}-portal-rtl {
|
|
3
|
+
.#{$module}-wrapper-rtl {
|
|
5
4
|
.#{$module} {
|
|
6
5
|
direction: rtl;
|
|
7
6
|
text-align: right;
|
|
@@ -148,6 +147,34 @@ $module: #{$prefix}-table;
|
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
}
|
|
150
|
+
|
|
151
|
+
&-scroll {
|
|
152
|
+
&-position {
|
|
153
|
+
&-left {
|
|
154
|
+
.#{$module}-tbody,
|
|
155
|
+
.#{$module}-thead {
|
|
156
|
+
& > .#{$module}-row > .#{$module}-cell-fixed-left-last {
|
|
157
|
+
box-shadow: $shadow-table_right;
|
|
158
|
+
}
|
|
159
|
+
& > .#{$module}-row > .#{$module}-cell-fixed-right-first {
|
|
160
|
+
box-shadow: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&-right {
|
|
166
|
+
.#{$module}-tbody,
|
|
167
|
+
.#{$module}-thead {
|
|
168
|
+
& > .#{$module}-row > .#{$module}-cell-fixed-left-last {
|
|
169
|
+
box-shadow: none;
|
|
170
|
+
}
|
|
171
|
+
& > .#{$module}-row > .#{$module}-cell-fixed-right-first {
|
|
172
|
+
box-shadow: $shadow-table_left;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
151
178
|
}
|
|
152
179
|
|
|
153
180
|
.#{$module}-expand-icon {
|
|
@@ -155,4 +182,8 @@ $module: #{$prefix}-table;
|
|
|
155
182
|
margin-left: $spacing-table_expand_icon-marginRight;
|
|
156
183
|
transform: scaleX(-1) translateY(2px);
|
|
157
184
|
}
|
|
185
|
+
|
|
186
|
+
.#{$prefix}-spin {
|
|
187
|
+
direction: rtl;
|
|
188
|
+
}
|
|
158
189
|
}
|