@douyinfe/semi-foundation 2.67.2-alpha.0 → 2.67.2
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/cascader/cascader.scss +5 -5
- package/cascader/variables.scss +2 -1
- package/datePicker/foundation.ts +14 -19
- package/lib/cjs/cascader/cascader.css +5 -5
- package/lib/cjs/cascader/cascader.scss +5 -5
- package/lib/cjs/cascader/variables.scss +2 -1
- package/lib/cjs/datePicker/foundation.d.ts +2 -6
- package/lib/cjs/datePicker/foundation.js +17 -24
- package/lib/cjs/select/select.css +1 -0
- package/lib/cjs/select/select.scss +3 -1
- package/lib/cjs/select/variables.scss +3 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/es/cascader/cascader.css +5 -5
- package/lib/es/cascader/cascader.scss +5 -5
- package/lib/es/cascader/variables.scss +2 -1
- package/lib/es/datePicker/foundation.d.ts +2 -6
- package/lib/es/datePicker/foundation.js +17 -24
- package/lib/es/select/select.css +1 -0
- package/lib/es/select/select.scss +3 -1
- package/lib/es/select/variables.scss +3 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/upload/constants.d.ts +1 -1
- package/package.json +3 -3
- package/select/select.scss +3 -1
- package/select/variables.scss +3 -0
package/cascader/cascader.scss
CHANGED
|
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
|
|
|
436
436
|
&-icon {
|
|
437
437
|
display: inline-flex;
|
|
438
438
|
flex-shrink: 0;
|
|
439
|
-
width
|
|
439
|
+
width:$width-cascader-option-icon;
|
|
440
440
|
color: $color-cascader_option-icon-default;
|
|
441
441
|
|
|
442
442
|
&-active,
|
|
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
&-spin-icon {
|
|
453
|
-
width: $width-cascader-icon;
|
|
454
|
-
height: $width-cascader-icon;
|
|
453
|
+
width: $width-cascader-option-icon;
|
|
454
|
+
height: $width-cascader-option-icon;
|
|
455
455
|
line-height: 0;
|
|
456
456
|
|
|
457
457
|
& svg {
|
|
458
|
-
width: $width-cascader-icon;
|
|
459
|
-
height: $width-cascader-icon;
|
|
458
|
+
width: $width-cascader-option-icon;
|
|
459
|
+
height: $width-cascader-option-icon;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
|
package/cascader/variables.scss
CHANGED
|
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
|
|
|
92
92
|
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
93
93
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
94
94
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
95
|
-
$width-cascader-icon: 32px; //
|
|
95
|
+
$width-cascader-icon: 32px; // 级联选择触发器图标尺寸
|
|
96
|
+
$width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
|
|
96
97
|
$width-cascader_option: 150px; // 级联选择各级菜单宽度
|
|
97
98
|
$height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
98
99
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
package/datePicker/foundation.ts
CHANGED
|
@@ -227,7 +227,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
|
|
|
227
227
|
*/
|
|
228
228
|
export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
|
|
229
229
|
|
|
230
|
-
clickConfirmButton: boolean;
|
|
231
230
|
constructor(adapter: DatePickerAdapter) {
|
|
232
231
|
super({ ...adapter });
|
|
233
232
|
}
|
|
@@ -389,17 +388,12 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
389
388
|
* - date type and not multiple, close panel after select date
|
|
390
389
|
* - dateRange type, close panel after select rangeStart and rangeEnd
|
|
391
390
|
* 4. click outside
|
|
392
|
-
* @param {Event} e
|
|
393
|
-
* @param {String} inputValue
|
|
394
|
-
* @param {Date[]} dates
|
|
395
391
|
*/
|
|
396
|
-
closePanel(
|
|
397
|
-
const { value } = this._adapter.getStates();
|
|
398
|
-
const willUpdateDates = isNullOrUndefined(dates) ? value : dates;
|
|
392
|
+
closePanel() {
|
|
399
393
|
if (!this._isControlledComponent('open')) {
|
|
400
394
|
this.close();
|
|
401
395
|
} else {
|
|
402
|
-
this.resetInnerSelectedStates(
|
|
396
|
+
this.resetInnerSelectedStates();
|
|
403
397
|
}
|
|
404
398
|
this._adapter.notifyOpenChange(false);
|
|
405
399
|
}
|
|
@@ -410,7 +404,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
410
404
|
}
|
|
411
405
|
|
|
412
406
|
close() {
|
|
413
|
-
this._adapter.togglePanel(false
|
|
407
|
+
this._adapter.togglePanel(false);
|
|
408
|
+
this.resetInnerSelectedStates();
|
|
414
409
|
this._adapter.unregisterClickOutSide();
|
|
415
410
|
}
|
|
416
411
|
|
|
@@ -434,15 +429,16 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
434
429
|
/**
|
|
435
430
|
* reset cachedSelectedValue, inputValue when close panel
|
|
436
431
|
*/
|
|
437
|
-
resetInnerSelectedStates(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
432
|
+
resetInnerSelectedStates() {
|
|
433
|
+
// 通过 setTimeout 保证需要获取到最新的 state 状态
|
|
434
|
+
setTimeout(() => {
|
|
435
|
+
const { value, cachedSelectedValue } = this._adapter.getStates();
|
|
436
|
+
if (!isEqual(value, cachedSelectedValue)) {
|
|
437
|
+
this.resetCachedSelectedValue(value);
|
|
438
|
+
}
|
|
439
|
+
}, 0);
|
|
443
440
|
this.resetFocus();
|
|
444
441
|
this.clearInputValue();
|
|
445
|
-
this.clickConfirmButton = false;
|
|
446
442
|
}
|
|
447
443
|
|
|
448
444
|
resetFocus(e?: any) {
|
|
@@ -1016,7 +1012,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
1016
1012
|
|
|
1017
1013
|
const focusRecordChecked = !needCheckFocusRecord || (needCheckFocusRecord && this._adapter.couldPanelClosed());
|
|
1018
1014
|
if ((type === 'date' && !this._isMultiple() && closePanel) || (type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked)) {
|
|
1019
|
-
this.closePanel(
|
|
1015
|
+
this.closePanel();
|
|
1020
1016
|
}
|
|
1021
1017
|
}
|
|
1022
1018
|
|
|
@@ -1043,7 +1039,6 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
1043
1039
|
}
|
|
1044
1040
|
|
|
1045
1041
|
handleConfirm() {
|
|
1046
|
-
this.clickConfirmButton = true;
|
|
1047
1042
|
const { cachedSelectedValue, value } = this._adapter.getStates();
|
|
1048
1043
|
const isRangeValueComplete = this._isRangeValueComplete(cachedSelectedValue);
|
|
1049
1044
|
const newValue = isRangeValueComplete ? cachedSelectedValue : value;
|
|
@@ -1051,7 +1046,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
1051
1046
|
this._adapter.updateValue(newValue);
|
|
1052
1047
|
}
|
|
1053
1048
|
// If the input is incomplete, the legal date of the last input is used
|
|
1054
|
-
this.closePanel(
|
|
1049
|
+
this.closePanel();
|
|
1055
1050
|
|
|
1056
1051
|
if (isRangeValueComplete) {
|
|
1057
1052
|
const { notifyValue, notifyDate } = this.disposeCallbackArgs(cachedSelectedValue);
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
.semi-cascader-option-lists .semi-cascader-option-icon {
|
|
360
360
|
display: inline-flex;
|
|
361
361
|
flex-shrink: 0;
|
|
362
|
-
width:
|
|
362
|
+
width: 16px;
|
|
363
363
|
color: var(--semi-color-text-2);
|
|
364
364
|
}
|
|
365
365
|
.semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
|
|
@@ -369,13 +369,13 @@
|
|
|
369
369
|
margin-left: 8px;
|
|
370
370
|
}
|
|
371
371
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon {
|
|
372
|
-
width:
|
|
373
|
-
height:
|
|
372
|
+
width: 16px;
|
|
373
|
+
height: 16px;
|
|
374
374
|
line-height: 0;
|
|
375
375
|
}
|
|
376
376
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
|
|
377
|
-
width:
|
|
378
|
-
height:
|
|
377
|
+
width: 16px;
|
|
378
|
+
height: 16px;
|
|
379
379
|
}
|
|
380
380
|
.semi-cascader-option-lists .semi-cascader-option-label {
|
|
381
381
|
display: flex;
|
|
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
|
|
|
436
436
|
&-icon {
|
|
437
437
|
display: inline-flex;
|
|
438
438
|
flex-shrink: 0;
|
|
439
|
-
width
|
|
439
|
+
width:$width-cascader-option-icon;
|
|
440
440
|
color: $color-cascader_option-icon-default;
|
|
441
441
|
|
|
442
442
|
&-active,
|
|
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
&-spin-icon {
|
|
453
|
-
width: $width-cascader-icon;
|
|
454
|
-
height: $width-cascader-icon;
|
|
453
|
+
width: $width-cascader-option-icon;
|
|
454
|
+
height: $width-cascader-option-icon;
|
|
455
455
|
line-height: 0;
|
|
456
456
|
|
|
457
457
|
& svg {
|
|
458
|
-
width: $width-cascader-icon;
|
|
459
|
-
height: $width-cascader-icon;
|
|
458
|
+
width: $width-cascader-option-icon;
|
|
459
|
+
height: $width-cascader-option-icon;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
|
|
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
|
|
|
92
92
|
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
93
93
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
94
94
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
95
|
-
$width-cascader-icon: 32px; //
|
|
95
|
+
$width-cascader-icon: 32px; // 级联选择触发器图标尺寸
|
|
96
|
+
$width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
|
|
96
97
|
$width-cascader_option: 150px; // 级联选择各级菜单宽度
|
|
97
98
|
$height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
98
99
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
|
@@ -190,7 +190,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
|
|
|
190
190
|
* task 2. When the input box changes, update the date value = > Notify the change
|
|
191
191
|
*/
|
|
192
192
|
export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
|
|
193
|
-
clickConfirmButton: boolean;
|
|
194
193
|
constructor(adapter: DatePickerAdapter);
|
|
195
194
|
init(): void;
|
|
196
195
|
initFromProps({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps, 'value' | 'timeZone'> & {
|
|
@@ -247,11 +246,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
247
246
|
* - date type and not multiple, close panel after select date
|
|
248
247
|
* - dateRange type, close panel after select rangeStart and rangeEnd
|
|
249
248
|
* 4. click outside
|
|
250
|
-
* @param {Event} e
|
|
251
|
-
* @param {String} inputValue
|
|
252
|
-
* @param {Date[]} dates
|
|
253
249
|
*/
|
|
254
|
-
closePanel(
|
|
250
|
+
closePanel(): void;
|
|
255
251
|
open(): void;
|
|
256
252
|
close(): void;
|
|
257
253
|
focus(focusType?: Exclude<RangeType, false>): void;
|
|
@@ -259,7 +255,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
259
255
|
/**
|
|
260
256
|
* reset cachedSelectedValue, inputValue when close panel
|
|
261
257
|
*/
|
|
262
|
-
resetInnerSelectedStates(
|
|
258
|
+
resetInnerSelectedStates(): void;
|
|
263
259
|
resetFocus(e?: any): void;
|
|
264
260
|
/**
|
|
265
261
|
* cachedSelectedValue can be `(Date|null)[]` or `null`
|
|
@@ -217,21 +217,12 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
217
217
|
* - date type and not multiple, close panel after select date
|
|
218
218
|
* - dateRange type, close panel after select rangeStart and rangeEnd
|
|
219
219
|
* 4. click outside
|
|
220
|
-
* @param {Event} e
|
|
221
|
-
* @param {String} inputValue
|
|
222
|
-
* @param {Date[]} dates
|
|
223
220
|
*/
|
|
224
|
-
closePanel(
|
|
225
|
-
let inputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
226
|
-
let dates = arguments.length > 2 ? arguments[2] : undefined;
|
|
227
|
-
const {
|
|
228
|
-
value
|
|
229
|
-
} = this._adapter.getStates();
|
|
230
|
-
const willUpdateDates = (0, _isNullOrUndefined.default)(dates) ? value : dates;
|
|
221
|
+
closePanel() {
|
|
231
222
|
if (!this._isControlledComponent('open')) {
|
|
232
223
|
this.close();
|
|
233
224
|
} else {
|
|
234
|
-
this.resetInnerSelectedStates(
|
|
225
|
+
this.resetInnerSelectedStates();
|
|
235
226
|
}
|
|
236
227
|
this._adapter.notifyOpenChange(false);
|
|
237
228
|
}
|
|
@@ -240,7 +231,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
240
231
|
this._adapter.registerClickOutSide();
|
|
241
232
|
}
|
|
242
233
|
close() {
|
|
243
|
-
this._adapter.togglePanel(false
|
|
234
|
+
this._adapter.togglePanel(false);
|
|
235
|
+
this.resetInnerSelectedStates();
|
|
244
236
|
this._adapter.unregisterClickOutSide();
|
|
245
237
|
}
|
|
246
238
|
focus(focusType) {
|
|
@@ -261,17 +253,19 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
261
253
|
/**
|
|
262
254
|
* reset cachedSelectedValue, inputValue when close panel
|
|
263
255
|
*/
|
|
264
|
-
resetInnerSelectedStates(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
this.
|
|
271
|
-
|
|
256
|
+
resetInnerSelectedStates() {
|
|
257
|
+
// 通过 setTimeout 保证需要获取到最新的 state 状态
|
|
258
|
+
setTimeout(() => {
|
|
259
|
+
const {
|
|
260
|
+
value,
|
|
261
|
+
cachedSelectedValue
|
|
262
|
+
} = this._adapter.getStates();
|
|
263
|
+
if (!(0, _isEqual2.default)(value, cachedSelectedValue)) {
|
|
264
|
+
this.resetCachedSelectedValue(value);
|
|
265
|
+
}
|
|
266
|
+
}, 0);
|
|
272
267
|
this.resetFocus();
|
|
273
268
|
this.clearInputValue();
|
|
274
|
-
this.clickConfirmButton = false;
|
|
275
269
|
}
|
|
276
270
|
resetFocus(e) {
|
|
277
271
|
this._adapter.setRangeInputFocus(false);
|
|
@@ -825,7 +819,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
825
819
|
}
|
|
826
820
|
const focusRecordChecked = !needCheckFocusRecord || needCheckFocusRecord && this._adapter.couldPanelClosed();
|
|
827
821
|
if (type === 'date' && !this._isMultiple() && closePanel || type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked) {
|
|
828
|
-
this.closePanel(
|
|
822
|
+
this.closePanel();
|
|
829
823
|
}
|
|
830
824
|
}
|
|
831
825
|
/**
|
|
@@ -852,7 +846,6 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
852
846
|
}
|
|
853
847
|
}
|
|
854
848
|
handleConfirm() {
|
|
855
|
-
this.clickConfirmButton = true;
|
|
856
849
|
const {
|
|
857
850
|
cachedSelectedValue,
|
|
858
851
|
value
|
|
@@ -863,7 +856,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
863
856
|
this._adapter.updateValue(newValue);
|
|
864
857
|
}
|
|
865
858
|
// If the input is incomplete, the legal date of the last input is used
|
|
866
|
-
this.closePanel(
|
|
859
|
+
this.closePanel();
|
|
867
860
|
if (isRangeValueComplete) {
|
|
868
861
|
const {
|
|
869
862
|
notifyValue,
|
|
@@ -37,6 +37,7 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
37
37
|
&:focus {
|
|
38
38
|
border: $width-select-border-focus solid $color-select-border-focus;
|
|
39
39
|
background-color: $color-select-bg-focus;
|
|
40
|
+
// background-color: plum;
|
|
40
41
|
outline: 0;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -125,7 +126,8 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
125
126
|
|
|
126
127
|
&:focus {
|
|
127
128
|
// when select is disabled, the border should not have active color
|
|
128
|
-
border: $width-select-border-focus solid
|
|
129
|
+
border: $width-select-border-focus solid $color-select_input_disabled-border-focus;
|
|
130
|
+
background-color: $color-select_input_disabled-bg-focus;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.#{$module}-selection,
|
|
@@ -37,8 +37,11 @@ $color-select_clearBtn-text-hover: var(--semi-color-primary); // 选择器输入
|
|
|
37
37
|
$color-select_input-bg-default: transparent; // 选择器输入框清空按钮颜色 - 悬停态
|
|
38
38
|
$color-select_input_disabled-bg: var(--semi-color-disabled-fill); // 禁用选择器输入框背景色
|
|
39
39
|
$color-select_input_disabled-border: var(--semi-color-border); // 禁用选择器输入框描边颜色
|
|
40
|
+
$color-select_input_disabled-border-focus: transparent; // 禁用选择器输入框描边颜色 - 聚焦态
|
|
40
41
|
$color-select_input_disabled-text: var(--semi-color-disabled-text); // 禁用选择器输入框回填内容文字颜色
|
|
41
42
|
$color-select_input_disabled-bg-hover: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 悬停态
|
|
43
|
+
$color-select_input_disabled-bg-focus: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 聚焦态
|
|
44
|
+
|
|
42
45
|
$color-select_input_placeholder-text: var(--semi-color-text-2); // 选择器输入框占位文本文字颜色
|
|
43
46
|
|
|
44
47
|
$color-select_option_main-text: var(--semi-color-text-0); // 选择器菜单选项文本颜色
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
.semi-cascader-option-lists .semi-cascader-option-icon {
|
|
360
360
|
display: inline-flex;
|
|
361
361
|
flex-shrink: 0;
|
|
362
|
-
width:
|
|
362
|
+
width: 16px;
|
|
363
363
|
color: var(--semi-color-text-2);
|
|
364
364
|
}
|
|
365
365
|
.semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
|
|
@@ -369,13 +369,13 @@
|
|
|
369
369
|
margin-left: 8px;
|
|
370
370
|
}
|
|
371
371
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon {
|
|
372
|
-
width:
|
|
373
|
-
height:
|
|
372
|
+
width: 16px;
|
|
373
|
+
height: 16px;
|
|
374
374
|
line-height: 0;
|
|
375
375
|
}
|
|
376
376
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
|
|
377
|
-
width:
|
|
378
|
-
height:
|
|
377
|
+
width: 16px;
|
|
378
|
+
height: 16px;
|
|
379
379
|
}
|
|
380
380
|
.semi-cascader-option-lists .semi-cascader-option-label {
|
|
381
381
|
display: flex;
|
|
@@ -436,7 +436,7 @@ $module: #{$prefix}-cascader;
|
|
|
436
436
|
&-icon {
|
|
437
437
|
display: inline-flex;
|
|
438
438
|
flex-shrink: 0;
|
|
439
|
-
width
|
|
439
|
+
width:$width-cascader-option-icon;
|
|
440
440
|
color: $color-cascader_option-icon-default;
|
|
441
441
|
|
|
442
442
|
&-active,
|
|
@@ -450,13 +450,13 @@ $module: #{$prefix}-cascader;
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
&-spin-icon {
|
|
453
|
-
width: $width-cascader-icon;
|
|
454
|
-
height: $width-cascader-icon;
|
|
453
|
+
width: $width-cascader-option-icon;
|
|
454
|
+
height: $width-cascader-option-icon;
|
|
455
455
|
line-height: 0;
|
|
456
456
|
|
|
457
457
|
& svg {
|
|
458
|
-
width: $width-cascader-icon;
|
|
459
|
-
height: $width-cascader-icon;
|
|
458
|
+
width: $width-cascader-option-icon;
|
|
459
|
+
height: $width-cascader-option-icon;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
|
|
@@ -92,7 +92,8 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
|
|
|
92
92
|
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
93
93
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
94
94
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
95
|
-
$width-cascader-icon: 32px; //
|
|
95
|
+
$width-cascader-icon: 32px; // 级联选择触发器图标尺寸
|
|
96
|
+
$width-cascader-option-icon: 16px; // 级联选择选项面板图标尺寸
|
|
96
97
|
$width-cascader_option: 150px; // 级联选择各级菜单宽度
|
|
97
98
|
$height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
98
99
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
|
@@ -190,7 +190,6 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
|
|
|
190
190
|
* task 2. When the input box changes, update the date value = > Notify the change
|
|
191
191
|
*/
|
|
192
192
|
export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
|
|
193
|
-
clickConfirmButton: boolean;
|
|
194
193
|
constructor(adapter: DatePickerAdapter);
|
|
195
194
|
init(): void;
|
|
196
195
|
initFromProps({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps, 'value' | 'timeZone'> & {
|
|
@@ -247,11 +246,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
247
246
|
* - date type and not multiple, close panel after select date
|
|
248
247
|
* - dateRange type, close panel after select rangeStart and rangeEnd
|
|
249
248
|
* 4. click outside
|
|
250
|
-
* @param {Event} e
|
|
251
|
-
* @param {String} inputValue
|
|
252
|
-
* @param {Date[]} dates
|
|
253
249
|
*/
|
|
254
|
-
closePanel(
|
|
250
|
+
closePanel(): void;
|
|
255
251
|
open(): void;
|
|
256
252
|
close(): void;
|
|
257
253
|
focus(focusType?: Exclude<RangeType, false>): void;
|
|
@@ -259,7 +255,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
259
255
|
/**
|
|
260
256
|
* reset cachedSelectedValue, inputValue when close panel
|
|
261
257
|
*/
|
|
262
|
-
resetInnerSelectedStates(
|
|
258
|
+
resetInnerSelectedStates(): void;
|
|
263
259
|
resetFocus(e?: any): void;
|
|
264
260
|
/**
|
|
265
261
|
* cachedSelectedValue can be `(Date|null)[]` or `null`
|
|
@@ -210,21 +210,12 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
210
210
|
* - date type and not multiple, close panel after select date
|
|
211
211
|
* - dateRange type, close panel after select rangeStart and rangeEnd
|
|
212
212
|
* 4. click outside
|
|
213
|
-
* @param {Event} e
|
|
214
|
-
* @param {String} inputValue
|
|
215
|
-
* @param {Date[]} dates
|
|
216
213
|
*/
|
|
217
|
-
closePanel(
|
|
218
|
-
let inputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
219
|
-
let dates = arguments.length > 2 ? arguments[2] : undefined;
|
|
220
|
-
const {
|
|
221
|
-
value
|
|
222
|
-
} = this._adapter.getStates();
|
|
223
|
-
const willUpdateDates = isNullOrUndefined(dates) ? value : dates;
|
|
214
|
+
closePanel() {
|
|
224
215
|
if (!this._isControlledComponent('open')) {
|
|
225
216
|
this.close();
|
|
226
217
|
} else {
|
|
227
|
-
this.resetInnerSelectedStates(
|
|
218
|
+
this.resetInnerSelectedStates();
|
|
228
219
|
}
|
|
229
220
|
this._adapter.notifyOpenChange(false);
|
|
230
221
|
}
|
|
@@ -233,7 +224,8 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
233
224
|
this._adapter.registerClickOutSide();
|
|
234
225
|
}
|
|
235
226
|
close() {
|
|
236
|
-
this._adapter.togglePanel(false
|
|
227
|
+
this._adapter.togglePanel(false);
|
|
228
|
+
this.resetInnerSelectedStates();
|
|
237
229
|
this._adapter.unregisterClickOutSide();
|
|
238
230
|
}
|
|
239
231
|
focus(focusType) {
|
|
@@ -254,17 +246,19 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
254
246
|
/**
|
|
255
247
|
* reset cachedSelectedValue, inputValue when close panel
|
|
256
248
|
*/
|
|
257
|
-
resetInnerSelectedStates(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.
|
|
264
|
-
|
|
249
|
+
resetInnerSelectedStates() {
|
|
250
|
+
// 通过 setTimeout 保证需要获取到最新的 state 状态
|
|
251
|
+
setTimeout(() => {
|
|
252
|
+
const {
|
|
253
|
+
value,
|
|
254
|
+
cachedSelectedValue
|
|
255
|
+
} = this._adapter.getStates();
|
|
256
|
+
if (!_isEqual(value, cachedSelectedValue)) {
|
|
257
|
+
this.resetCachedSelectedValue(value);
|
|
258
|
+
}
|
|
259
|
+
}, 0);
|
|
265
260
|
this.resetFocus();
|
|
266
261
|
this.clearInputValue();
|
|
267
|
-
this.clickConfirmButton = false;
|
|
268
262
|
}
|
|
269
263
|
resetFocus(e) {
|
|
270
264
|
this._adapter.setRangeInputFocus(false);
|
|
@@ -818,7 +812,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
818
812
|
}
|
|
819
813
|
const focusRecordChecked = !needCheckFocusRecord || needCheckFocusRecord && this._adapter.couldPanelClosed();
|
|
820
814
|
if (type === 'date' && !this._isMultiple() && closePanel || type === 'dateRange' && this._isRangeValueComplete(dates) && closePanel && focusRecordChecked) {
|
|
821
|
-
this.closePanel(
|
|
815
|
+
this.closePanel();
|
|
822
816
|
}
|
|
823
817
|
}
|
|
824
818
|
/**
|
|
@@ -845,7 +839,6 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
845
839
|
}
|
|
846
840
|
}
|
|
847
841
|
handleConfirm() {
|
|
848
|
-
this.clickConfirmButton = true;
|
|
849
842
|
const {
|
|
850
843
|
cachedSelectedValue,
|
|
851
844
|
value
|
|
@@ -856,7 +849,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
856
849
|
this._adapter.updateValue(newValue);
|
|
857
850
|
}
|
|
858
851
|
// If the input is incomplete, the legal date of the last input is used
|
|
859
|
-
this.closePanel(
|
|
852
|
+
this.closePanel();
|
|
860
853
|
if (isRangeValueComplete) {
|
|
861
854
|
const {
|
|
862
855
|
notifyValue,
|
package/lib/es/select/select.css
CHANGED
|
@@ -37,6 +37,7 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
37
37
|
&:focus {
|
|
38
38
|
border: $width-select-border-focus solid $color-select-border-focus;
|
|
39
39
|
background-color: $color-select-bg-focus;
|
|
40
|
+
// background-color: plum;
|
|
40
41
|
outline: 0;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -125,7 +126,8 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
125
126
|
|
|
126
127
|
&:focus {
|
|
127
128
|
// when select is disabled, the border should not have active color
|
|
128
|
-
border: $width-select-border-focus solid
|
|
129
|
+
border: $width-select-border-focus solid $color-select_input_disabled-border-focus;
|
|
130
|
+
background-color: $color-select_input_disabled-bg-focus;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.#{$module}-selection,
|
|
@@ -37,8 +37,11 @@ $color-select_clearBtn-text-hover: var(--semi-color-primary); // 选择器输入
|
|
|
37
37
|
$color-select_input-bg-default: transparent; // 选择器输入框清空按钮颜色 - 悬停态
|
|
38
38
|
$color-select_input_disabled-bg: var(--semi-color-disabled-fill); // 禁用选择器输入框背景色
|
|
39
39
|
$color-select_input_disabled-border: var(--semi-color-border); // 禁用选择器输入框描边颜色
|
|
40
|
+
$color-select_input_disabled-border-focus: transparent; // 禁用选择器输入框描边颜色 - 聚焦态
|
|
40
41
|
$color-select_input_disabled-text: var(--semi-color-disabled-text); // 禁用选择器输入框回填内容文字颜色
|
|
41
42
|
$color-select_input_disabled-bg-hover: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 悬停态
|
|
43
|
+
$color-select_input_disabled-bg-focus: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 聚焦态
|
|
44
|
+
|
|
42
45
|
$color-select_input_placeholder-text: var(--semi-color-text-2); // 选择器输入框占位文本文字颜色
|
|
43
46
|
|
|
44
47
|
$color-select_option_main-text: var(--semi-color-text-0); // 选择器菜单选项文本颜色
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.67.2
|
|
3
|
+
"version": "2.67.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
7
7
|
"prepublishOnly": "npm run build:lib"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@douyinfe/semi-animation": "2.67.2
|
|
10
|
+
"@douyinfe/semi-animation": "2.67.2",
|
|
11
11
|
"@mdx-js/mdx": "^3.0.1",
|
|
12
12
|
"async-validator": "^3.5.0",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"*.scss",
|
|
29
29
|
"*.css"
|
|
30
30
|
],
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "2ff1f1c65aa51266782304dfd1dea055d20ee028",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
34
34
|
"@babel/preset-env": "^7.15.8",
|
package/select/select.scss
CHANGED
|
@@ -37,6 +37,7 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
37
37
|
&:focus {
|
|
38
38
|
border: $width-select-border-focus solid $color-select-border-focus;
|
|
39
39
|
background-color: $color-select-bg-focus;
|
|
40
|
+
// background-color: plum;
|
|
40
41
|
outline: 0;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -125,7 +126,8 @@ $overflowList: #{$prefix}-overflow-list;
|
|
|
125
126
|
|
|
126
127
|
&:focus {
|
|
127
128
|
// when select is disabled, the border should not have active color
|
|
128
|
-
border: $width-select-border-focus solid
|
|
129
|
+
border: $width-select-border-focus solid $color-select_input_disabled-border-focus;
|
|
130
|
+
background-color: $color-select_input_disabled-bg-focus;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.#{$module}-selection,
|
package/select/variables.scss
CHANGED
|
@@ -37,8 +37,11 @@ $color-select_clearBtn-text-hover: var(--semi-color-primary); // 选择器输入
|
|
|
37
37
|
$color-select_input-bg-default: transparent; // 选择器输入框清空按钮颜色 - 悬停态
|
|
38
38
|
$color-select_input_disabled-bg: var(--semi-color-disabled-fill); // 禁用选择器输入框背景色
|
|
39
39
|
$color-select_input_disabled-border: var(--semi-color-border); // 禁用选择器输入框描边颜色
|
|
40
|
+
$color-select_input_disabled-border-focus: transparent; // 禁用选择器输入框描边颜色 - 聚焦态
|
|
40
41
|
$color-select_input_disabled-text: var(--semi-color-disabled-text); // 禁用选择器输入框回填内容文字颜色
|
|
41
42
|
$color-select_input_disabled-bg-hover: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 悬停态
|
|
43
|
+
$color-select_input_disabled-bg-focus: var(--semi-color-disabled-fill); // 选择器输入框回填内容文字颜色 - 聚焦态
|
|
44
|
+
|
|
42
45
|
$color-select_input_placeholder-text: var(--semi-color-text-2); // 选择器输入框占位文本文字颜色
|
|
43
46
|
|
|
44
47
|
$color-select_option_main-text: var(--semi-color-text-0); // 选择器菜单选项文本颜色
|