@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import './variables.scss';
|
|
2
2
|
|
|
3
3
|
$module: #{$prefix}-upload;
|
|
4
4
|
|
|
@@ -47,7 +47,7 @@ $module: #{$prefix}-upload;
|
|
|
47
47
|
align-items: center;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
&[x-prompt-pos=
|
|
50
|
+
&[x-prompt-pos='right'] {
|
|
51
51
|
.#{$module}-add {
|
|
52
52
|
display: inline-flex;
|
|
53
53
|
}
|
|
@@ -57,7 +57,7 @@ $module: #{$prefix}-upload;
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
&[x-prompt-pos=
|
|
60
|
+
&[x-prompt-pos='bottom'] {
|
|
61
61
|
.#{$module}-add {
|
|
62
62
|
display: flex;
|
|
63
63
|
}
|
|
@@ -72,15 +72,14 @@ $module: #{$prefix}-upload;
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
&[x-prompt-pos=
|
|
75
|
+
&[x-prompt-pos='left'] {
|
|
76
76
|
.#{$module}-add {
|
|
77
77
|
display: inline-flex;
|
|
78
|
-
order: 2;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
.#{$module}-prompt {
|
|
82
81
|
display: inline-flex;
|
|
83
|
-
order: 1;
|
|
82
|
+
order: -1;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
.#{$module}-file-list {
|
|
@@ -247,7 +246,6 @@ $module: #{$prefix}-upload;
|
|
|
247
246
|
}
|
|
248
247
|
|
|
249
248
|
&-icon {
|
|
250
|
-
|
|
251
249
|
&-loading,
|
|
252
250
|
&-error {
|
|
253
251
|
font-size: $width-upload_file_card-icon;
|
|
@@ -275,7 +273,6 @@ $module: #{$prefix}-upload;
|
|
|
275
273
|
}
|
|
276
274
|
|
|
277
275
|
.#{$module}-file-card {
|
|
278
|
-
|
|
279
276
|
&-info-validate-message {
|
|
280
277
|
color: $color-upload_file_card_fail_info-text;
|
|
281
278
|
}
|
|
@@ -288,26 +285,18 @@ $module: #{$prefix}-upload;
|
|
|
288
285
|
&-picture {
|
|
289
286
|
display: flex;
|
|
290
287
|
|
|
291
|
-
&[x-prompt-pos=
|
|
288
|
+
&[x-prompt-pos='bottom'] {
|
|
292
289
|
flex-direction: column;
|
|
293
290
|
|
|
294
291
|
.#{$module}-prompt {
|
|
295
292
|
order: 1;
|
|
296
293
|
}
|
|
297
|
-
|
|
298
|
-
.#{$module}-add {
|
|
299
|
-
order: 0;
|
|
300
|
-
}
|
|
301
294
|
}
|
|
302
295
|
|
|
303
|
-
&[x-prompt-pos=
|
|
296
|
+
&[x-prompt-pos='right'] {
|
|
304
297
|
.#{$module}-prompt {
|
|
305
298
|
order: 1;
|
|
306
299
|
}
|
|
307
|
-
|
|
308
|
-
.#{$module}-add {
|
|
309
|
-
order: 0;
|
|
310
|
-
}
|
|
311
300
|
}
|
|
312
301
|
|
|
313
302
|
&-add {
|
|
@@ -321,7 +310,6 @@ $module: #{$prefix}-upload;
|
|
|
321
310
|
border: $width-upload_picture_add-border dashed $color-upload-border;
|
|
322
311
|
color: $color-upload-icon;
|
|
323
312
|
border-radius: $radius-upload_picture_add;
|
|
324
|
-
order: 2;
|
|
325
313
|
cursor: pointer;
|
|
326
314
|
|
|
327
315
|
&:hover {
|
|
@@ -370,38 +358,32 @@ $module: #{$prefix}-upload;
|
|
|
370
358
|
}
|
|
371
359
|
|
|
372
360
|
&-close {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
background-color: $color-upload_pic_remove-bg;
|
|
361
|
+
visibility: hidden;
|
|
362
|
+
display: inline-flex;
|
|
376
363
|
position: absolute;
|
|
377
364
|
top: $spacing-upload_picture_file_card_close-top;
|
|
378
365
|
right: $spacing-upload_picture_file_card_close-right;
|
|
379
|
-
@include all-center;
|
|
380
|
-
display: none;
|
|
381
366
|
border-radius: $radius-upload_picture_file_card_close;
|
|
382
|
-
color: white;
|
|
383
367
|
cursor: pointer;
|
|
384
368
|
transition: all 0s;
|
|
385
369
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
display: flex;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.#{$module}-picture-file-card-replace {
|
|
393
|
-
visibility: visible;
|
|
394
|
-
}
|
|
370
|
+
&-icon-close {
|
|
371
|
+
font-size: $width-upload_picture_file_card_close;
|
|
372
|
+
color: $color-upload_picture_file_card_close-icon;
|
|
395
373
|
}
|
|
396
374
|
|
|
397
|
-
|
|
375
|
+
&::before {
|
|
376
|
+
visibility: hidden;
|
|
377
|
+
background-color: $color-upload_picture_file_card_hover-bg;
|
|
378
|
+
content: '';
|
|
398
379
|
position: absolute;
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
380
|
+
left: 0;
|
|
381
|
+
right: 0;
|
|
382
|
+
top: 0;
|
|
383
|
+
bottom: 0;
|
|
402
384
|
}
|
|
403
|
-
|
|
404
385
|
&-retry {
|
|
386
|
+
visibility: hidden;
|
|
405
387
|
background-color: $color-upload_file_card_retry-bg;
|
|
406
388
|
width: $width-upload_file_card_retry;
|
|
407
389
|
height: $width-upload_file_card_retry;
|
|
@@ -416,7 +398,6 @@ $module: #{$prefix}-upload;
|
|
|
416
398
|
justify-content: center;
|
|
417
399
|
cursor: pointer;
|
|
418
400
|
}
|
|
419
|
-
|
|
420
401
|
&-icon-retry {
|
|
421
402
|
transform: scale(-1, 1);
|
|
422
403
|
font-size: $width-upload_file_card_retry-icon;
|
|
@@ -432,6 +413,17 @@ $module: #{$prefix}-upload;
|
|
|
432
413
|
color: $color-upload_replace-text;
|
|
433
414
|
transform: translate3D(-50%, -50%, 0);
|
|
434
415
|
}
|
|
416
|
+
|
|
417
|
+
&-preview {
|
|
418
|
+
visibility: hidden;
|
|
419
|
+
display: inline-flex;
|
|
420
|
+
position: absolute;
|
|
421
|
+
cursor: pointer;
|
|
422
|
+
top: 50%;
|
|
423
|
+
left: 50%;
|
|
424
|
+
transform: translate3D(-50%, -50%, 0);
|
|
425
|
+
}
|
|
426
|
+
|
|
435
427
|
&-pic-info {
|
|
436
428
|
display: inline-flex;
|
|
437
429
|
box-sizing: border-box;
|
|
@@ -468,6 +460,39 @@ $module: #{$prefix}-upload;
|
|
|
468
460
|
&-error {
|
|
469
461
|
outline: 1px solid $color-upload_picture_file_card_error-border;
|
|
470
462
|
}
|
|
463
|
+
|
|
464
|
+
&:hover {
|
|
465
|
+
&::before {
|
|
466
|
+
visibility: visible;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.#{$module}-picture-file-card-close {
|
|
470
|
+
visibility: visible;
|
|
471
|
+
}
|
|
472
|
+
.#{$module}-picture-file-card-replace {
|
|
473
|
+
visibility: visible;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.#{$module}-picture-file-card-retry {
|
|
477
|
+
visibility: visible;
|
|
478
|
+
}
|
|
479
|
+
.#{$module}-picture-file-card-preview {
|
|
480
|
+
visibility: visible;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
&-uploading {
|
|
485
|
+
&::before {
|
|
486
|
+
visibility: visible;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.#{$prefix}-progress-circle {
|
|
491
|
+
position: absolute;
|
|
492
|
+
top: 50%;
|
|
493
|
+
left: 50%;
|
|
494
|
+
transform: translate(-50%, -50%);
|
|
495
|
+
}
|
|
471
496
|
}
|
|
472
497
|
}
|
|
473
498
|
|
|
@@ -542,4 +567,4 @@ $module: #{$prefix}-upload;
|
|
|
542
567
|
}
|
|
543
568
|
}
|
|
544
569
|
|
|
545
|
-
@import
|
|
570
|
+
@import './rtl.scss';
|
|
@@ -16,7 +16,7 @@ $color-upload_drag_area_tips-text: var(--semi-color-primary); // 上传可拖拽
|
|
|
16
16
|
$color-upload_file_card_fail_info-text: var(--semi-color-danger); // 上传文件卡片失败提示信息文本颜色
|
|
17
17
|
$color-upload_file_card_preview_placeholder-bg: rgba(var(--semi-grey-3), 1); // 文件卡片默认预览背景颜色
|
|
18
18
|
$color-upload_file_card_preview_placeholder-text: rgba(var(--semi-white), 1); // 文件卡片默认预览图颜色
|
|
19
|
-
$color-upload_file_card_retry-bg:
|
|
19
|
+
$color-upload_file_card_retry-bg: var(--semi-color-white); // 重新上传按钮背景颜色
|
|
20
20
|
$color-upload_file_card_retry-text: var(--semi-color-primary); // 重新上传按钮文本颜色
|
|
21
21
|
$color-upload-icon: var(--semi-color-tertiary); // 图片墙上传图标加号颜色
|
|
22
22
|
$color-upload_pic_add-bg-active: var(--semi-color-fill-2); // 图片墙上传背景色 - 按下
|
|
@@ -26,6 +26,8 @@ $color-upload_pic_remove-bg: var(--semi-color-overlay-bg); // 图片墙上传移
|
|
|
26
26
|
$color-upload_picture_file_card_loading_error-icon: var(--semi-color-danger); // 图片墙上传移除图标颜色
|
|
27
27
|
$color-upload_picture_file_card_error-border: var(--semi-color-danger); // 图片墙上传移除图标颜色
|
|
28
28
|
$color-upload_picture_file_card_pic_info-text: var(--semi-color-white); // 图片墙图片信息(序号)文字颜色
|
|
29
|
+
$color-upload_picture_file_card_close-icon: var(--semi-color-white); // 图片墙关闭图标颜色
|
|
30
|
+
$color-upload_picture_file_card_hover-bg: var(--semi-color-overlay-bg); // 图片墙预览悬浮背景色
|
|
29
31
|
$color-upload_preview-icon: var(--semi-color-text-2); // 上传文件卡片文本颜色
|
|
30
32
|
$color-upload_retry-text: var(--semi-color-primary); // 上传文件卡片重新上传按钮文本颜色
|
|
31
33
|
$color-upload_replace-text: var(--semi-color-white); // 上传文件卡片重新替换按钮文本颜色
|
|
@@ -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
|
|
@@ -38,6 +38,24 @@ import { strings as inputStrings } from '../input/constants';
|
|
|
38
38
|
export default class DatePickerFoundation extends BaseFoundation {
|
|
39
39
|
constructor(adapter) {
|
|
40
40
|
super(_Object$assign({}, adapter));
|
|
41
|
+
/**
|
|
42
|
+
* clear range input focus when open is controlled
|
|
43
|
+
* fixed github 1375
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
this.clearRangeInputFocus = () => {
|
|
47
|
+
const {
|
|
48
|
+
type
|
|
49
|
+
} = this._adapter.getProps();
|
|
50
|
+
|
|
51
|
+
const {
|
|
52
|
+
rangeInputFocus
|
|
53
|
+
} = this._adapter.getStates();
|
|
54
|
+
|
|
55
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
56
|
+
this._adapter.setRangeInputFocus(false);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
41
59
|
|
|
42
60
|
this.getMergedMotion = motion => {
|
|
43
61
|
const mergedMotion = typeof motion === 'undefined' || motion ? _Object$assign(_Object$assign({}, 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/es/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/es/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>;
|
|
@@ -486,7 +486,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
486
486
|
} // update formState value
|
|
487
487
|
|
|
488
488
|
|
|
489
|
-
updateStateValue(field, value, opts) {
|
|
489
|
+
updateStateValue(field, value, opts, callback) {
|
|
490
490
|
const notNotify = opts && opts.notNotify;
|
|
491
491
|
const notUpdate = opts && opts.notUpdate;
|
|
492
492
|
const fieldAllowEmpty = opts && opts.fieldAllowEmpty;
|
|
@@ -518,7 +518,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
if (!notUpdate) {
|
|
521
|
-
this._adapter.forceUpdate();
|
|
521
|
+
this._adapter.forceUpdate(callback);
|
|
522
522
|
}
|
|
523
523
|
} // get touched from formState
|
|
524
524
|
|
|
@@ -532,7 +532,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
532
532
|
} // update formState touched
|
|
533
533
|
|
|
534
534
|
|
|
535
|
-
updateStateTouched(field, isTouched, opts) {
|
|
535
|
+
updateStateTouched(field, isTouched, opts, callback) {
|
|
536
536
|
const notNotify = opts && opts.notNotify;
|
|
537
537
|
const notUpdate = opts && opts.notUpdate;
|
|
538
538
|
ObjectUtil.set(this.data.touched, field, isTouched);
|
|
@@ -542,7 +542,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
if (!notUpdate) {
|
|
545
|
-
this._adapter.forceUpdate();
|
|
545
|
+
this._adapter.forceUpdate(callback);
|
|
546
546
|
}
|
|
547
547
|
} // get error from formState
|
|
548
548
|
|
|
@@ -556,7 +556,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
556
556
|
} // update formState error
|
|
557
557
|
|
|
558
558
|
|
|
559
|
-
updateStateError(field, error, opts) {
|
|
559
|
+
updateStateError(field, error, opts, callback) {
|
|
560
560
|
const notNotify = opts && opts.notNotify;
|
|
561
561
|
const notUpdate = opts && opts.notUpdate;
|
|
562
562
|
ObjectUtil.set(this.data.errors, field, error); // The setError caused by centralized validation does not need to trigger notify, otherwise it will be called too frequently, as many times as there are fields
|
|
@@ -567,7 +567,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
if (!notUpdate) {
|
|
570
|
-
this._adapter.forceUpdate();
|
|
570
|
+
this._adapter.forceUpdate(callback);
|
|
571
571
|
}
|
|
572
572
|
} // For internal use in the FormApi Operating Field
|
|
573
573
|
|
|
@@ -586,22 +586,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
586
586
|
// At this time, first modify formState directly, then find out the subordinate fields and drive them to update
|
|
587
587
|
// Eg: peoples: [0, 2, 3]. Each value of the peoples array corresponds to an Input Field
|
|
588
588
|
// When the user directly calls formA pi.set Value ('peoples', [2,3])
|
|
589
|
-
this.updateStateValue(field, newValue, opts)
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
} // If the reset happens to be, then update the updateKey corresponding to ArrayField to render it again
|
|
604
|
-
|
|
589
|
+
this.updateStateValue(field, newValue, opts, () => {
|
|
590
|
+
let nestedFields = this._getNestedField(field);
|
|
591
|
+
|
|
592
|
+
if (nestedFields.size) {
|
|
593
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
594
|
+
let fieldPath = fieldStaff.field;
|
|
595
|
+
let newFieldVal = ObjectUtil.get(_valuesInstanceProperty(this.data), fieldPath);
|
|
596
|
+
let nestedBatchUpdateOpts = {
|
|
597
|
+
notNotify: true,
|
|
598
|
+
notUpdate: true
|
|
599
|
+
};
|
|
600
|
+
fieldStaff.fieldApi.setValue(newFieldVal, nestedBatchUpdateOpts);
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
}); // If the reset happens to be, then update the updateKey corresponding to ArrayField to render it again
|
|
605
604
|
|
|
606
605
|
if (this.getArrayField(field)) {
|
|
607
606
|
this.updateArrayField(field, {
|
|
@@ -619,21 +618,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
619
618
|
if (fieldApi) {
|
|
620
619
|
fieldApi.setError(newError, opts);
|
|
621
620
|
} else {
|
|
622
|
-
this.updateStateError(field, newError, opts)
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
}
|
|
621
|
+
this.updateStateError(field, newError, opts, () => {
|
|
622
|
+
let nestedFields = this._getNestedField(field);
|
|
623
|
+
|
|
624
|
+
if (nestedFields.size) {
|
|
625
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
626
|
+
let fieldPath = fieldStaff.field;
|
|
627
|
+
let newFieldError = ObjectUtil.get(this.data.errors, fieldPath);
|
|
628
|
+
let nestedBatchUpdateOpts = {
|
|
629
|
+
notNotify: true,
|
|
630
|
+
notUpdate: true
|
|
631
|
+
};
|
|
632
|
+
fieldStaff.fieldApi.setError(newFieldError, nestedBatchUpdateOpts);
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
});
|
|
637
636
|
|
|
638
637
|
if (this.getArrayField(field)) {
|
|
639
638
|
this.updateArrayField(field, {
|
|
@@ -649,21 +648,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
649
648
|
if (fieldApi) {
|
|
650
649
|
fieldApi.setTouched(isTouched, opts);
|
|
651
650
|
} else {
|
|
652
|
-
this.updateStateTouched(field, isTouched, opts)
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
}
|
|
651
|
+
this.updateStateTouched(field, isTouched, opts, () => {
|
|
652
|
+
let nestedFields = this._getNestedField(field);
|
|
653
|
+
|
|
654
|
+
if (nestedFields.size) {
|
|
655
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
656
|
+
let fieldPath = fieldStaff.field;
|
|
657
|
+
let newFieldTouch = ObjectUtil.get(this.data.touched, fieldPath);
|
|
658
|
+
let nestedBatchUpdateOpts = {
|
|
659
|
+
notNotify: true,
|
|
660
|
+
notUpdate: true
|
|
661
|
+
};
|
|
662
|
+
fieldStaff.fieldApi.setTouched(newFieldTouch, nestedBatchUpdateOpts);
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
});
|
|
667
666
|
|
|
668
667
|
if (this.getArrayField(field)) {
|
|
669
668
|
this.updateArrayField(field, {
|
|
@@ -7,7 +7,7 @@ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
7
7
|
cloneDeep: (val: any, ...rest: any[]) => any;
|
|
8
8
|
notifySubmit: (values: any) => void;
|
|
9
9
|
notifySubmitFail: (errors: Record<string, any>, values: any) => void;
|
|
10
|
-
forceUpdate: () => void;
|
|
10
|
+
forceUpdate: (callback?: () => void) => void;
|
|
11
11
|
notifyChange: (formState: FormState) => void;
|
|
12
12
|
notifyValueChange: (values: any, changedValues: any) => void;
|
|
13
13
|
notifyReset: () => void;
|
package/lib/es/input/input.css
CHANGED
|
@@ -278,6 +278,7 @@
|
|
|
278
278
|
cursor: not-allowed;
|
|
279
279
|
color: var(--semi-color-disabled-text);
|
|
280
280
|
background-color: var(--semi-color-disabled-fill);
|
|
281
|
+
-webkit-text-fill-color: var(--semi-color-disabled-text);
|
|
281
282
|
}
|
|
282
283
|
.semi-input-wrapper-disabled:hover {
|
|
283
284
|
background-color: var(--semi-color-disabled-fill);
|
package/lib/es/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
|
}
|
|
@@ -5,7 +5,7 @@ declare const cssClasses: {
|
|
|
5
5
|
};
|
|
6
6
|
declare const strings: {
|
|
7
7
|
readonly SIZE_SET: readonly ["small", "large", "default"];
|
|
8
|
-
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
8
|
+
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
9
9
|
readonly MODE_SELECT: "select";
|
|
10
10
|
readonly MODE_AUTOCOMPLETE: "autoComplete";
|
|
11
11
|
readonly STATUS: readonly ["default", "error", "warning", "success"];
|