@douyinfe/semi-foundation 2.4.1 → 2.5.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/button/constants.ts +2 -2
- package/cascader/cascader.scss +3 -2
- package/cascader/variables.scss +6 -3
- package/datePicker/foundation.ts +12 -0
- package/form/form.scss +7 -1
- package/form/foundation.ts +40 -36
- package/form/interface.ts +1 -1
- package/input/input.scss +2 -1
- package/lib/cjs/autoComplete/constants.d.ts +1 -1
- package/lib/cjs/button/constants.d.ts +9 -1
- package/lib/cjs/cascader/cascader.css +2 -1
- package/lib/cjs/cascader/cascader.scss +3 -2
- package/lib/cjs/cascader/variables.scss +6 -3
- package/lib/cjs/datePicker/foundation.d.ts +5 -0
- package/lib/cjs/datePicker/foundation.js +18 -0
- package/lib/cjs/dropdown/constants.d.ts +1 -1
- package/lib/cjs/form/form.css +4 -0
- package/lib/cjs/form/form.scss +7 -1
- package/lib/cjs/form/foundation.d.ts +6 -6
- package/lib/cjs/form/foundation.js +51 -52
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/input/input.css +1 -0
- package/lib/cjs/input/input.scss +2 -1
- package/lib/cjs/select/constants.d.ts +1 -1
- package/lib/cjs/select/foundation.d.ts +1 -1
- package/lib/cjs/select/foundation.js +2 -1
- package/lib/cjs/select/optionFoundation.d.ts +1 -1
- package/lib/cjs/select/optionFoundation.js +3 -3
- package/lib/cjs/slider/foundation.js +2 -2
- package/lib/cjs/table/foundation.d.ts +2 -0
- package/lib/cjs/table/foundation.js +16 -4
- package/lib/cjs/table/table.css +0 -1
- package/lib/cjs/table/table.scss +3 -4
- package/lib/cjs/table/utils.js +4 -1
- package/lib/cjs/tooltip/constants.d.ts +1 -1
- package/lib/cjs/tooltip/constants.js +1 -1
- package/lib/cjs/tooltip/foundation.js +65 -4
- package/lib/cjs/tree/foundation.d.ts +4 -1
- package/lib/cjs/tree/foundation.js +69 -20
- package/lib/cjs/treeSelect/foundation.d.ts +3 -3
- package/lib/cjs/treeSelect/foundation.js +103 -35
- package/lib/cjs/upload/upload.css +49 -27
- package/lib/cjs/upload/upload.scss +66 -41
- package/lib/cjs/upload/variables.scss +3 -1
- package/lib/es/autoComplete/constants.d.ts +1 -1
- package/lib/es/button/constants.d.ts +9 -1
- package/lib/es/cascader/cascader.css +2 -1
- package/lib/es/cascader/cascader.scss +3 -2
- package/lib/es/cascader/variables.scss +6 -3
- package/lib/es/datePicker/foundation.d.ts +5 -0
- package/lib/es/datePicker/foundation.js +18 -0
- package/lib/es/dropdown/constants.d.ts +1 -1
- package/lib/es/form/form.css +4 -0
- package/lib/es/form/form.scss +7 -1
- package/lib/es/form/foundation.d.ts +6 -6
- package/lib/es/form/foundation.js +51 -52
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/input/input.css +1 -0
- package/lib/es/input/input.scss +2 -1
- package/lib/es/select/constants.d.ts +1 -1
- package/lib/es/select/foundation.d.ts +1 -1
- package/lib/es/select/foundation.js +2 -1
- package/lib/es/select/optionFoundation.d.ts +1 -1
- package/lib/es/select/optionFoundation.js +3 -3
- package/lib/es/slider/foundation.js +2 -2
- package/lib/es/table/foundation.d.ts +2 -0
- package/lib/es/table/foundation.js +16 -4
- package/lib/es/table/table.css +0 -1
- package/lib/es/table/table.scss +3 -4
- package/lib/es/table/utils.js +4 -1
- package/lib/es/tooltip/constants.d.ts +1 -1
- package/lib/es/tooltip/constants.js +1 -1
- package/lib/es/tooltip/foundation.js +65 -4
- package/lib/es/tree/foundation.d.ts +4 -1
- package/lib/es/tree/foundation.js +69 -20
- package/lib/es/treeSelect/foundation.d.ts +3 -3
- package/lib/es/treeSelect/foundation.js +102 -35
- package/lib/es/upload/upload.css +49 -27
- package/lib/es/upload/upload.scss +66 -41
- package/lib/es/upload/variables.scss +3 -1
- package/package.json +3 -3
- package/select/foundation.ts +3 -2
- package/select/optionFoundation.ts +3 -3
- package/slider/foundation.ts +2 -2
- package/table/foundation.ts +23 -10
- package/table/table.scss +3 -4
- package/table/utils.ts +3 -1
- package/tooltip/constants.ts +2 -0
- package/tooltip/foundation.ts +52 -4
- package/tree/foundation.ts +56 -17
- package/treeSelect/foundation.ts +89 -41
- package/upload/upload.scss +66 -41
- package/upload/variables.scss +3 -1
package/button/constants.ts
CHANGED
|
@@ -4,7 +4,7 @@ const cssClasses = {
|
|
|
4
4
|
PREFIX: `${BASE_CLASS_PREFIX}-button`,
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
const strings
|
|
7
|
+
const strings = {
|
|
8
8
|
sizes: ['default', 'small', 'large'],
|
|
9
9
|
iconPositions: ['left', 'right'],
|
|
10
10
|
htmlTypes: ['button', 'reset', 'submit'],
|
|
@@ -12,7 +12,7 @@ const strings: Record<string, any> = {
|
|
|
12
12
|
themes: ['solid', 'borderless', 'light'],
|
|
13
13
|
DEFAULT_ICON_SIZE: 'default',
|
|
14
14
|
DEFAULT_ICON_POSITION: 'left',
|
|
15
|
-
};
|
|
15
|
+
} as const;
|
|
16
16
|
|
|
17
17
|
const numbers = {};
|
|
18
18
|
|
package/cascader/cascader.scss
CHANGED
|
@@ -20,6 +20,7 @@ $module: #{$prefix}-cascader;
|
|
|
20
20
|
|
|
21
21
|
&:hover {
|
|
22
22
|
background-color: $color-cascader_default-bg-hover;
|
|
23
|
+
border: $width-cascader_hover-border $color-cascader_default-border-hover solid;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
&-small {
|
|
@@ -110,7 +111,7 @@ $module: #{$prefix}-cascader;
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
&-tag {
|
|
113
|
-
margin: $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-
|
|
114
|
+
margin: $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-marginRight $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-marginLeft;
|
|
114
115
|
|
|
115
116
|
&:first-child {
|
|
116
117
|
margin-left: 0;
|
|
@@ -119,7 +120,7 @@ $module: #{$prefix}-cascader;
|
|
|
119
120
|
&-disabled.#{$prefix}-tag {
|
|
120
121
|
color: $color-cascader_input_disabled-text-default;
|
|
121
122
|
cursor: not-allowed;
|
|
122
|
-
|
|
123
|
+
|
|
123
124
|
.#{$prefix}-tag-close {
|
|
124
125
|
color: $color-cascader_input_disabled-text-default;
|
|
125
126
|
cursor: not-allowed;
|
package/cascader/variables.scss
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
$radius-cascader: var(--semi-border-radius-small); // 级联选择菜单圆角
|
|
2
2
|
|
|
3
|
-
$color-cascader_default-border-default: transparent; // 级联选择描边颜色
|
|
3
|
+
$color-cascader_default-border-default: transparent; // 级联选择描边颜色 - 默认
|
|
4
|
+
$color-cascader_default-border-hover: transparent; // 级联选择描边颜色 - 悬浮
|
|
5
|
+
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
4
6
|
$color-cascader_default-bg-default: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 默认
|
|
5
7
|
$color-cascader_default-bg-hover: var(--semi-color-fill-1); // 级联选择菜单项背景颜色 - 悬浮
|
|
6
|
-
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
7
8
|
$color-cascader_option_list-border-default: var(--semi-color-fill-0); // 级联选择各级菜单分割线颜色
|
|
8
9
|
$color-cascader_option_main-text-default: var(--semi-color-text-0); // 级联选择菜单项文字颜色
|
|
9
10
|
$color-cascader_option-bg-hover: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 悬浮
|
|
@@ -43,7 +44,8 @@ $spacing-cascader_selection-paddingLeft: 12px; // 级联选择触发器左侧内
|
|
|
43
44
|
$spacing-cascader_selection-paddingRight: 12px; // 级联选择触发器右侧内边距
|
|
44
45
|
$spacing-cascader_selection_multiple-paddingLeft: $spacing-extra-tight; // 级联选择触发器多选时左侧内边距
|
|
45
46
|
$spacing-cascader_selection_multiple-paddingRight: $spacing-extra-tight; // 级联选择触发器多选时右侧内边距
|
|
46
|
-
$spacing-cascader_selection_tag-
|
|
47
|
+
$spacing-cascader_selection_tag-marginLeft: $spacing-none; // 级联选择触发器多选时标签的水平左外边距
|
|
48
|
+
$spacing-cascader_selection_tag-marginRight: $spacing-super-tight; // 级联选择触发器多选时标签的水平右外边距
|
|
47
49
|
$spacing-cascader_selection_tag-marginY: 1px; // 级联选择触发器多选时标签的垂直外边距
|
|
48
50
|
$spacing-cascader_selection_tagInput-marginLeft: - $spacing-extra-tight; // 级联选择触发器多选搜索时 TagInput 的左外边距
|
|
49
51
|
$spacing-cascader_selection_input-marginLeft: $spacing-extra-tight; // 级联选择触发器多选搜索时输入框的左外边距
|
|
@@ -83,6 +85,7 @@ $width-cascader: 80px; // 级联选择触发器最小宽度
|
|
|
83
85
|
$height-cascader_default: $height-control-default; // 级联选择触发器高度 - 默认
|
|
84
86
|
$height-cascader_small: $height-control-small; // 级联选择触发器高度 - 小尺寸
|
|
85
87
|
$height-cascader_large: $height-control-large; // 级联选择触发器高度 - 大尺寸
|
|
88
|
+
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
86
89
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
87
90
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
88
91
|
$width-cascader-icon: 16px; // 级联选择图标尺寸
|
package/datePicker/foundation.ts
CHANGED
|
@@ -384,6 +384,18 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
384
384
|
this._adapter.notifyBlur(e);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/**
|
|
388
|
+
* clear range input focus when open is controlled
|
|
389
|
+
* fixed github 1375
|
|
390
|
+
*/
|
|
391
|
+
clearRangeInputFocus = () => {
|
|
392
|
+
const { type } = this._adapter.getProps();
|
|
393
|
+
const { rangeInputFocus } = this._adapter.getStates();
|
|
394
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
395
|
+
this._adapter.setRangeInputFocus(false);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
387
399
|
/**
|
|
388
400
|
* Callback when the content of the input box changes
|
|
389
401
|
* Update the date panel if the changed value is a legal date, otherwise only update the input box
|
package/form/form.scss
CHANGED
|
@@ -8,6 +8,8 @@ $col: #{$form}-col;
|
|
|
8
8
|
|
|
9
9
|
$checkboxGroup: #{$prefix}-checkboxGroup;
|
|
10
10
|
$radioGroup: #{$prefix}-radioGroup;
|
|
11
|
+
$buttonRadioGroup: #{$prefix}-radioGroup-buttonRadio;
|
|
12
|
+
|
|
11
13
|
$switch: #{$prefix}-switch;
|
|
12
14
|
$rating: #{$prefix}-rating;
|
|
13
15
|
|
|
@@ -154,7 +156,6 @@ $rating: #{$prefix}-rating;
|
|
|
154
156
|
padding-top: $spacing-form_label_posTop-paddingTop;
|
|
155
157
|
padding-bottom: $spacing-form_label_posTop-paddingBottom;
|
|
156
158
|
}
|
|
157
|
-
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
&[x-label-pos="left"] {
|
|
@@ -173,6 +174,11 @@ $rating: #{$prefix}-rating;
|
|
|
173
174
|
padding-top: $spacing-form_label-paddingTop;
|
|
174
175
|
padding-bottom: $spacing-form_label-paddingTop;
|
|
175
176
|
}
|
|
177
|
+
// no need to adjust height for button radio, already 32px
|
|
178
|
+
.#{$buttonRadioGroup} {
|
|
179
|
+
padding-top: 0;
|
|
180
|
+
padding-bottom: 0;
|
|
181
|
+
}
|
|
176
182
|
.#{$switch},
|
|
177
183
|
.#{$rating} {
|
|
178
184
|
vertical-align: middle;
|
package/form/foundation.ts
CHANGED
|
@@ -410,7 +410,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
// update formState value
|
|
413
|
-
updateStateValue(field: string, value: any, opts: CallOpts): void {
|
|
413
|
+
updateStateValue(field: string, value: any, opts: CallOpts, callback?: () => void): void {
|
|
414
414
|
const notNotify = opts && opts.notNotify;
|
|
415
415
|
const notUpdate = opts && opts.notUpdate;
|
|
416
416
|
const fieldAllowEmpty = opts && opts.fieldAllowEmpty;
|
|
@@ -442,7 +442,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
if (!notUpdate) {
|
|
445
|
-
this._adapter.forceUpdate();
|
|
445
|
+
this._adapter.forceUpdate(callback);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
|
|
@@ -455,7 +455,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
// update formState touched
|
|
458
|
-
updateStateTouched(field: string, isTouched: boolean, opts?: CallOpts): void {
|
|
458
|
+
updateStateTouched(field: string, isTouched: boolean, opts?: CallOpts, callback?: () => void): void {
|
|
459
459
|
const notNotify = opts && opts.notNotify;
|
|
460
460
|
const notUpdate = opts && opts.notUpdate;
|
|
461
461
|
ObjectUtil.set(this.data.touched, field, isTouched);
|
|
@@ -464,7 +464,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
464
464
|
this._adapter.notifyChange(this.data);
|
|
465
465
|
}
|
|
466
466
|
if (!notUpdate) {
|
|
467
|
-
this._adapter.forceUpdate();
|
|
467
|
+
this._adapter.forceUpdate(callback);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
|
|
@@ -477,7 +477,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
// update formState error
|
|
480
|
-
updateStateError(field: string, error: any, opts: CallOpts): void {
|
|
480
|
+
updateStateError(field: string, error: any, opts: CallOpts, callback?: () => void): void {
|
|
481
481
|
const notNotify = opts && opts.notNotify;
|
|
482
482
|
const notUpdate = opts && opts.notUpdate;
|
|
483
483
|
ObjectUtil.set(this.data.errors, field, error);
|
|
@@ -488,7 +488,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
if (!notUpdate) {
|
|
491
|
-
this._adapter.forceUpdate();
|
|
491
|
+
this._adapter.forceUpdate(callback);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
|
|
@@ -506,16 +506,18 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
506
506
|
// At this time, first modify formState directly, then find out the subordinate fields and drive them to update
|
|
507
507
|
// Eg: peoples: [0, 2, 3]. Each value of the peoples array corresponds to an Input Field
|
|
508
508
|
// When the user directly calls formA pi.set Value ('peoples', [2,3])
|
|
509
|
-
this.updateStateValue(field, newValue, opts)
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
509
|
+
this.updateStateValue(field, newValue, opts, () => {
|
|
510
|
+
let nestedFields = this._getNestedField(field);
|
|
511
|
+
if (nestedFields.size) {
|
|
512
|
+
nestedFields.forEach(fieldStaff => {
|
|
513
|
+
let fieldPath = fieldStaff.field;
|
|
514
|
+
let newFieldVal = ObjectUtil.get(this.data.values, fieldPath);
|
|
515
|
+
let nestedBatchUpdateOpts = { notNotify: true, notUpdate: true };
|
|
516
|
+
fieldStaff.fieldApi.setValue(newFieldVal, nestedBatchUpdateOpts);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
|
|
519
521
|
// If the reset happens to be, then update the updateKey corresponding to ArrayField to render it again
|
|
520
522
|
if (this.getArrayField(field)) {
|
|
521
523
|
this.updateArrayField(field, { updateKey: new Date().valueOf() });
|
|
@@ -528,16 +530,17 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
528
530
|
if (fieldApi) {
|
|
529
531
|
fieldApi.setError(newError, opts);
|
|
530
532
|
} else {
|
|
531
|
-
this.updateStateError(field, newError, opts)
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
533
|
+
this.updateStateError(field, newError, opts, () => {
|
|
534
|
+
let nestedFields = this._getNestedField(field);
|
|
535
|
+
if (nestedFields.size) {
|
|
536
|
+
nestedFields.forEach(fieldStaff => {
|
|
537
|
+
let fieldPath = fieldStaff.field;
|
|
538
|
+
let newFieldError = ObjectUtil.get(this.data.errors, fieldPath);
|
|
539
|
+
let nestedBatchUpdateOpts = { notNotify: true, notUpdate: true };
|
|
540
|
+
fieldStaff.fieldApi.setError(newFieldError, nestedBatchUpdateOpts);
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
});
|
|
541
544
|
if (this.getArrayField(field)) {
|
|
542
545
|
this.updateArrayField(field, { updateKey: new Date().valueOf() });
|
|
543
546
|
}
|
|
@@ -549,16 +552,17 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
549
552
|
if (fieldApi) {
|
|
550
553
|
fieldApi.setTouched(isTouched, opts);
|
|
551
554
|
} else {
|
|
552
|
-
this.updateStateTouched(field, isTouched, opts)
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
555
|
+
this.updateStateTouched(field, isTouched, opts, () => {
|
|
556
|
+
let nestedFields = this._getNestedField(field);
|
|
557
|
+
if (nestedFields.size) {
|
|
558
|
+
nestedFields.forEach(fieldStaff => {
|
|
559
|
+
let fieldPath = fieldStaff.field;
|
|
560
|
+
let newFieldTouch = ObjectUtil.get(this.data.touched, fieldPath);
|
|
561
|
+
let nestedBatchUpdateOpts = { notNotify: true, notUpdate: true };
|
|
562
|
+
fieldStaff.fieldApi.setTouched(newFieldTouch, nestedBatchUpdateOpts);
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
});
|
|
562
566
|
if (this.getArrayField(field)) {
|
|
563
567
|
this.updateArrayField(field, { updateKey: new Date().valueOf() });
|
|
564
568
|
}
|
package/form/interface.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
12
12
|
cloneDeep: (val: any, ...rest: any[]) => any;
|
|
13
13
|
notifySubmit: (values: any) => void;
|
|
14
14
|
notifySubmitFail: (errors: Record<string, any>, values: any) => void;
|
|
15
|
-
forceUpdate: () => void;
|
|
15
|
+
forceUpdate: (callback?: () => void) => void;
|
|
16
16
|
notifyChange: (formState: FormState) => void;
|
|
17
17
|
notifyValueChange: (values: any, changedValues: any) => void;
|
|
18
18
|
notifyReset: () => void;
|
package/input/input.scss
CHANGED
|
@@ -382,7 +382,8 @@ $module: #{$prefix}-input;
|
|
|
382
382
|
// border: $border-thickness-control $color-input_disabled-border-default solid;
|
|
383
383
|
color: $color-input_disabled-text-default;
|
|
384
384
|
background-color: $color-input_disabled-bg-default;
|
|
385
|
-
|
|
385
|
+
// fix issue 670 in safari
|
|
386
|
+
-webkit-text-fill-color: $color-input_disabled-text-default;
|
|
386
387
|
&:hover {
|
|
387
388
|
background-color: $color-input_disabled-bg-default;
|
|
388
389
|
}
|
|
@@ -3,7 +3,7 @@ declare const cssClasses: {
|
|
|
3
3
|
};
|
|
4
4
|
declare const strings: {
|
|
5
5
|
readonly SIZE: readonly ["small", "large", "default"];
|
|
6
|
-
readonly POSITION: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
6
|
+
readonly POSITION: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
7
7
|
readonly OPTIONS: readonly ["children", "value"];
|
|
8
8
|
readonly STATUS: readonly ["default", "error", "warning", "success"];
|
|
9
9
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
declare const cssClasses: {
|
|
2
2
|
PREFIX: string;
|
|
3
3
|
};
|
|
4
|
-
declare const strings:
|
|
4
|
+
declare const strings: {
|
|
5
|
+
readonly sizes: readonly ["default", "small", "large"];
|
|
6
|
+
readonly iconPositions: readonly ["left", "right"];
|
|
7
|
+
readonly htmlTypes: readonly ["button", "reset", "submit"];
|
|
8
|
+
readonly btnTypes: readonly ["primary", "secondary", "tertiary", "warning", "danger"];
|
|
9
|
+
readonly themes: readonly ["solid", "borderless", "light"];
|
|
10
|
+
readonly DEFAULT_ICON_SIZE: "default";
|
|
11
|
+
readonly DEFAULT_ICON_POSITION: "left";
|
|
12
|
+
};
|
|
5
13
|
declare const numbers: {};
|
|
6
14
|
export { cssClasses, strings, numbers };
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
.semi-cascader:hover {
|
|
21
21
|
background-color: var(--semi-color-fill-1);
|
|
22
|
+
border: 1px transparent solid;
|
|
22
23
|
}
|
|
23
24
|
.semi-cascader-small {
|
|
24
25
|
min-height: 24px;
|
|
@@ -94,7 +95,7 @@
|
|
|
94
95
|
color: var(--semi-color-text-2);
|
|
95
96
|
}
|
|
96
97
|
.semi-cascader-selection-tag {
|
|
97
|
-
margin: 1px 2px;
|
|
98
|
+
margin: 1px 2px 1px 0;
|
|
98
99
|
}
|
|
99
100
|
.semi-cascader-selection-tag:first-child {
|
|
100
101
|
margin-left: 0;
|
|
@@ -20,6 +20,7 @@ $module: #{$prefix}-cascader;
|
|
|
20
20
|
|
|
21
21
|
&:hover {
|
|
22
22
|
background-color: $color-cascader_default-bg-hover;
|
|
23
|
+
border: $width-cascader_hover-border $color-cascader_default-border-hover solid;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
&-small {
|
|
@@ -110,7 +111,7 @@ $module: #{$prefix}-cascader;
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
&-tag {
|
|
113
|
-
margin: $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-
|
|
114
|
+
margin: $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-marginRight $spacing-cascader_selection_tag-marginY $spacing-cascader_selection_tag-marginLeft;
|
|
114
115
|
|
|
115
116
|
&:first-child {
|
|
116
117
|
margin-left: 0;
|
|
@@ -119,7 +120,7 @@ $module: #{$prefix}-cascader;
|
|
|
119
120
|
&-disabled.#{$prefix}-tag {
|
|
120
121
|
color: $color-cascader_input_disabled-text-default;
|
|
121
122
|
cursor: not-allowed;
|
|
122
|
-
|
|
123
|
+
|
|
123
124
|
.#{$prefix}-tag-close {
|
|
124
125
|
color: $color-cascader_input_disabled-text-default;
|
|
125
126
|
cursor: not-allowed;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
$radius-cascader: var(--semi-border-radius-small); // 级联选择菜单圆角
|
|
2
2
|
|
|
3
|
-
$color-cascader_default-border-default: transparent; // 级联选择描边颜色
|
|
3
|
+
$color-cascader_default-border-default: transparent; // 级联选择描边颜色 - 默认
|
|
4
|
+
$color-cascader_default-border-hover: transparent; // 级联选择描边颜色 - 悬浮
|
|
5
|
+
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
4
6
|
$color-cascader_default-bg-default: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 默认
|
|
5
7
|
$color-cascader_default-bg-hover: var(--semi-color-fill-1); // 级联选择菜单项背景颜色 - 悬浮
|
|
6
|
-
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
7
8
|
$color-cascader_option_list-border-default: var(--semi-color-fill-0); // 级联选择各级菜单分割线颜色
|
|
8
9
|
$color-cascader_option_main-text-default: var(--semi-color-text-0); // 级联选择菜单项文字颜色
|
|
9
10
|
$color-cascader_option-bg-hover: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 悬浮
|
|
@@ -43,7 +44,8 @@ $spacing-cascader_selection-paddingLeft: 12px; // 级联选择触发器左侧内
|
|
|
43
44
|
$spacing-cascader_selection-paddingRight: 12px; // 级联选择触发器右侧内边距
|
|
44
45
|
$spacing-cascader_selection_multiple-paddingLeft: $spacing-extra-tight; // 级联选择触发器多选时左侧内边距
|
|
45
46
|
$spacing-cascader_selection_multiple-paddingRight: $spacing-extra-tight; // 级联选择触发器多选时右侧内边距
|
|
46
|
-
$spacing-cascader_selection_tag-
|
|
47
|
+
$spacing-cascader_selection_tag-marginLeft: $spacing-none; // 级联选择触发器多选时标签的水平左外边距
|
|
48
|
+
$spacing-cascader_selection_tag-marginRight: $spacing-super-tight; // 级联选择触发器多选时标签的水平右外边距
|
|
47
49
|
$spacing-cascader_selection_tag-marginY: 1px; // 级联选择触发器多选时标签的垂直外边距
|
|
48
50
|
$spacing-cascader_selection_tagInput-marginLeft: - $spacing-extra-tight; // 级联选择触发器多选搜索时 TagInput 的左外边距
|
|
49
51
|
$spacing-cascader_selection_input-marginLeft: $spacing-extra-tight; // 级联选择触发器多选搜索时输入框的左外边距
|
|
@@ -83,6 +85,7 @@ $width-cascader: 80px; // 级联选择触发器最小宽度
|
|
|
83
85
|
$height-cascader_default: $height-control-default; // 级联选择触发器高度 - 默认
|
|
84
86
|
$height-cascader_small: $height-control-small; // 级联选择触发器高度 - 小尺寸
|
|
85
87
|
$height-cascader_large: $height-control-large; // 级联选择触发器高度 - 大尺寸
|
|
88
|
+
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
86
89
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
87
90
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
88
91
|
$width-cascader-icon: 16px; // 级联选择图标尺寸
|
|
@@ -221,6 +221,11 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
221
221
|
* @param {Date[]} dates
|
|
222
222
|
*/
|
|
223
223
|
closePanel(e?: any, inputValue?: string, dates?: Date[]): void;
|
|
224
|
+
/**
|
|
225
|
+
* clear range input focus when open is controlled
|
|
226
|
+
* fixed github 1375
|
|
227
|
+
*/
|
|
228
|
+
clearRangeInputFocus: () => void;
|
|
224
229
|
/**
|
|
225
230
|
* Callback when the content of the input box changes
|
|
226
231
|
* Update the date panel if the changed value is a legal date, otherwise only update the input box
|
|
@@ -76,6 +76,24 @@ var _constants2 = require("../input/constants");
|
|
|
76
76
|
class DatePickerFoundation extends _foundation.default {
|
|
77
77
|
constructor(adapter) {
|
|
78
78
|
super((0, _assign.default)({}, adapter));
|
|
79
|
+
/**
|
|
80
|
+
* clear range input focus when open is controlled
|
|
81
|
+
* fixed github 1375
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
this.clearRangeInputFocus = () => {
|
|
85
|
+
const {
|
|
86
|
+
type
|
|
87
|
+
} = this._adapter.getProps();
|
|
88
|
+
|
|
89
|
+
const {
|
|
90
|
+
rangeInputFocus
|
|
91
|
+
} = this._adapter.getStates();
|
|
92
|
+
|
|
93
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
94
|
+
this._adapter.setRangeInputFocus(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
79
97
|
|
|
80
98
|
this.getMergedMotion = motion => {
|
|
81
99
|
const mergedMotion = typeof motion === 'undefined' || motion ? (0, _assign.default)((0, _assign.default)({}, motion), {
|
|
@@ -4,7 +4,7 @@ declare const cssClasses: {
|
|
|
4
4
|
DISABLED: string;
|
|
5
5
|
};
|
|
6
6
|
declare const strings: {
|
|
7
|
-
POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
7
|
+
POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
8
8
|
TRIGGER_SET: string[];
|
|
9
9
|
DEFAULT_LEAVE_DELAY: number;
|
|
10
10
|
ITEM_TYPE: string[];
|
package/lib/cjs/form/form.css
CHANGED
|
@@ -111,6 +111,10 @@
|
|
|
111
111
|
padding-top: 6px;
|
|
112
112
|
padding-bottom: 6px;
|
|
113
113
|
}
|
|
114
|
+
.semi-form-field[x-label-pos=left] .semi-radioGroup-buttonRadio {
|
|
115
|
+
padding-top: 0;
|
|
116
|
+
padding-bottom: 0;
|
|
117
|
+
}
|
|
114
118
|
.semi-form-field[x-label-pos=left] .semi-switch,
|
|
115
119
|
.semi-form-field[x-label-pos=left] .semi-rating {
|
|
116
120
|
vertical-align: middle;
|
package/lib/cjs/form/form.scss
CHANGED
|
@@ -8,6 +8,8 @@ $col: #{$form}-col;
|
|
|
8
8
|
|
|
9
9
|
$checkboxGroup: #{$prefix}-checkboxGroup;
|
|
10
10
|
$radioGroup: #{$prefix}-radioGroup;
|
|
11
|
+
$buttonRadioGroup: #{$prefix}-radioGroup-buttonRadio;
|
|
12
|
+
|
|
11
13
|
$switch: #{$prefix}-switch;
|
|
12
14
|
$rating: #{$prefix}-rating;
|
|
13
15
|
|
|
@@ -154,7 +156,6 @@ $rating: #{$prefix}-rating;
|
|
|
154
156
|
padding-top: $spacing-form_label_posTop-paddingTop;
|
|
155
157
|
padding-bottom: $spacing-form_label_posTop-paddingBottom;
|
|
156
158
|
}
|
|
157
|
-
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
&[x-label-pos="left"] {
|
|
@@ -173,6 +174,11 @@ $rating: #{$prefix}-rating;
|
|
|
173
174
|
padding-top: $spacing-form_label-paddingTop;
|
|
174
175
|
padding-bottom: $spacing-form_label-paddingTop;
|
|
175
176
|
}
|
|
177
|
+
// no need to adjust height for button radio, already 32px
|
|
178
|
+
.#{$buttonRadioGroup} {
|
|
179
|
+
padding-top: 0;
|
|
180
|
+
padding-bottom: 0;
|
|
181
|
+
}
|
|
176
182
|
.#{$switch},
|
|
177
183
|
.#{$rating} {
|
|
178
184
|
vertical-align: middle;
|
|
@@ -41,11 +41,11 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
41
41
|
setValues(values: any, { isOverride }: {
|
|
42
42
|
isOverride?: boolean;
|
|
43
43
|
}): void;
|
|
44
|
-
updateStateValue(field: string, value: any, opts: CallOpts): void;
|
|
44
|
+
updateStateValue(field: string, value: any, opts: CallOpts, callback?: () => void): void;
|
|
45
45
|
getTouched(field?: string): boolean | Record<string, any> | undefined;
|
|
46
|
-
updateStateTouched(field: string, isTouched: boolean, opts?: CallOpts): void;
|
|
46
|
+
updateStateTouched(field: string, isTouched: boolean, opts?: CallOpts, callback?: () => void): void;
|
|
47
47
|
getError(field?: string): any;
|
|
48
|
-
updateStateError(field: string, error: any, opts: CallOpts): void;
|
|
48
|
+
updateStateError(field: string, error: any, opts: CallOpts, callback?: () => void): void;
|
|
49
49
|
getFieldSetterApi(): {
|
|
50
50
|
setValue: (field: string, value: any, opts: CallOpts) => void;
|
|
51
51
|
setError: (field: string, error: any, opts: CallOpts) => void;
|
|
@@ -54,9 +54,9 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
54
54
|
getModifyFormStateApi(): {
|
|
55
55
|
register: (field: string, fieldState: FieldState, fieldStuff: FieldStaff) => void;
|
|
56
56
|
unRegister: (field: string) => void;
|
|
57
|
-
updateStateValue: (field: string, value: any, opts: CallOpts) => void;
|
|
58
|
-
updateStateError: (field: string, error: any, opts: CallOpts) => void;
|
|
59
|
-
updateStateTouched: (field: string, isTouched: boolean, opts?: CallOpts) => void;
|
|
57
|
+
updateStateValue: (field: string, value: any, opts: CallOpts, callback?: () => void) => void;
|
|
58
|
+
updateStateError: (field: string, error: any, opts: CallOpts, callback?: () => void) => void;
|
|
59
|
+
updateStateTouched: (field: string, isTouched: boolean, opts?: CallOpts, callback?: () => void) => void;
|
|
60
60
|
getValue: (field: string, opts?: CallOpts) => any;
|
|
61
61
|
getError: (field?: string) => any;
|
|
62
62
|
getTouched: (field?: string) => boolean | Record<string, any>;
|