@douyinfe/semi-foundation 2.66.0 → 2.67.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autoComplete/constants.ts +2 -3
- package/autoComplete/foundation.ts +2 -0
- package/autoComplete/option.scss +1 -1
- package/cascader/cascader.scss +0 -1
- package/cascader/rtl.scss +5 -9
- package/cascader/variables.scss +1 -2
- package/chat/chat.scss +4 -0
- package/chat/variables.scss +1 -1
- package/checkbox/checkbox.scss +2 -2
- package/form/foundation.ts +7 -2
- package/form/interface.ts +1 -0
- package/input/input.scss +2 -3
- package/lib/cjs/autoComplete/autoComplete.css +15 -15
- package/lib/cjs/autoComplete/constants.js +2 -2
- package/lib/cjs/autoComplete/foundation.d.ts +1 -0
- package/lib/cjs/autoComplete/foundation.js +1 -0
- package/lib/cjs/autoComplete/option.scss +1 -1
- package/lib/cjs/cascader/cascader.css +14 -19
- package/lib/cjs/cascader/cascader.scss +0 -1
- package/lib/cjs/cascader/rtl.scss +5 -9
- package/lib/cjs/cascader/variables.scss +1 -2
- package/lib/cjs/chat/chat.css +3 -0
- package/lib/cjs/chat/chat.scss +4 -0
- package/lib/cjs/chat/variables.scss +1 -1
- package/lib/cjs/checkbox/checkbox.css +2 -2
- package/lib/cjs/checkbox/checkbox.scss +2 -2
- package/lib/cjs/form/foundation.js +3 -1
- package/lib/cjs/form/interface.d.ts +1 -0
- package/lib/cjs/input/input.css +4 -6
- package/lib/cjs/input/input.scss +2 -3
- package/lib/cjs/pincode/foundation.js +5 -4
- package/lib/cjs/treeSelect/treeSelect.css +3 -0
- package/lib/cjs/treeSelect/treeSelect.scss +4 -0
- package/lib/cjs/upload/foundation.js +2 -0
- package/lib/es/autoComplete/autoComplete.css +15 -15
- package/lib/es/autoComplete/constants.js +2 -2
- package/lib/es/autoComplete/foundation.d.ts +1 -0
- package/lib/es/autoComplete/foundation.js +1 -0
- package/lib/es/autoComplete/option.scss +1 -1
- package/lib/es/cascader/cascader.css +14 -19
- package/lib/es/cascader/cascader.scss +0 -1
- package/lib/es/cascader/rtl.scss +5 -9
- package/lib/es/cascader/variables.scss +1 -2
- package/lib/es/chat/chat.css +3 -0
- package/lib/es/chat/chat.scss +4 -0
- package/lib/es/chat/variables.scss +1 -1
- package/lib/es/checkbox/checkbox.css +2 -2
- package/lib/es/checkbox/checkbox.scss +2 -2
- package/lib/es/form/foundation.js +3 -1
- package/lib/es/form/interface.d.ts +1 -0
- package/lib/es/input/input.css +4 -6
- package/lib/es/input/input.scss +2 -3
- package/lib/es/pincode/foundation.js +5 -4
- package/lib/es/treeSelect/treeSelect.css +3 -0
- package/lib/es/treeSelect/treeSelect.scss +4 -0
- package/lib/es/upload/foundation.js +2 -0
- package/package.json +3 -3
- package/pincode/foundation.ts +5 -4
- package/treeSelect/treeSelect.scss +4 -0
- package/upload/foundation.ts +2 -0
|
@@ -45,13 +45,12 @@ class PinCodeFoundation extends _foundation.default {
|
|
|
45
45
|
};
|
|
46
46
|
this.completeSingleInput = (i, singleInputValue) => __awaiter(this, void 0, void 0, function* () {
|
|
47
47
|
var _a;
|
|
48
|
-
const isControlledComponent =
|
|
48
|
+
const isControlledComponent = this._isInProps("value");
|
|
49
49
|
yield this._adapter.onCurrentActiveIndexChange(i + 1);
|
|
50
50
|
const valueList = [...this.getState("valueList")];
|
|
51
51
|
valueList[i] = singleInputValue;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} else {
|
|
52
|
+
this._adapter.notifyValueChange(valueList);
|
|
53
|
+
if (!isControlledComponent) {
|
|
55
54
|
yield this.updateValueList(valueList);
|
|
56
55
|
}
|
|
57
56
|
const count = this.getProp('count');
|
|
@@ -100,11 +99,13 @@ class PinCodeFoundation extends _foundation.default {
|
|
|
100
99
|
if (e.key === "Backspace") {
|
|
101
100
|
valueList[index] = "";
|
|
102
101
|
this.updateValueList(valueList);
|
|
102
|
+
this._adapter.notifyValueChange(valueList);
|
|
103
103
|
this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
|
|
104
104
|
e.preventDefault();
|
|
105
105
|
} else if (e.key === "Delete") {
|
|
106
106
|
valueList[index] = "";
|
|
107
107
|
this.updateValueList(valueList);
|
|
108
|
+
this._adapter.notifyValueChange(valueList);
|
|
108
109
|
this._adapter.changeSpecificInputFocusState(Math.min(valueList.length - 1, index + 1), "focus");
|
|
109
110
|
e.preventDefault();
|
|
110
111
|
} else if (e.key === "ArrowLeft") {
|
|
@@ -293,6 +293,9 @@
|
|
|
293
293
|
flex: 1;
|
|
294
294
|
min-width: 230px;
|
|
295
295
|
}
|
|
296
|
+
.semi-tree-select-popover .semi-tree-wrapper .semi-tree-option-list-hidden {
|
|
297
|
+
padding: 0;
|
|
298
|
+
}
|
|
296
299
|
.semi-tree-select-popover .semi-tree-wrapper .semi-tree-search-wrapper {
|
|
297
300
|
border-bottom: 1px var(--semi-color-fill-0) solid;
|
|
298
301
|
}
|
|
@@ -53,6 +53,8 @@ class UploadFoundation extends _foundation.default {
|
|
|
53
53
|
this.destroyState = false;
|
|
54
54
|
}
|
|
55
55
|
init() {
|
|
56
|
+
// make sure state reset, otherwise may cause upload abort in React StrictMode, like https://github.com/DouyinFE/semi-design/pull/843
|
|
57
|
+
this.destroyState = false;
|
|
56
58
|
const {
|
|
57
59
|
disabled,
|
|
58
60
|
addOnPasting
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* shadow */
|
|
2
2
|
/* sizing */
|
|
3
3
|
/* spacing */
|
|
4
|
-
.semi-
|
|
4
|
+
.semi-autocomplete-option {
|
|
5
5
|
font-size: 14px;
|
|
6
6
|
line-height: 20px;
|
|
7
7
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
transition: background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);
|
|
22
22
|
}
|
|
23
|
-
.semi-
|
|
23
|
+
.semi-autocomplete-option-icon {
|
|
24
24
|
width: 12px;
|
|
25
25
|
color: transparent;
|
|
26
26
|
visibility: hidden;
|
|
@@ -29,51 +29,51 @@
|
|
|
29
29
|
justify-content: center;
|
|
30
30
|
align-content: center;
|
|
31
31
|
}
|
|
32
|
-
.semi-
|
|
32
|
+
.semi-autocomplete-option-text {
|
|
33
33
|
display: flex;
|
|
34
34
|
flex-wrap: wrap;
|
|
35
35
|
white-space: pre;
|
|
36
36
|
}
|
|
37
|
-
.semi-
|
|
37
|
+
.semi-autocomplete-option-keyword {
|
|
38
38
|
color: var(--semi-color-primary);
|
|
39
39
|
background-color: inherit;
|
|
40
40
|
font-weight: 600;
|
|
41
41
|
}
|
|
42
|
-
.semi-
|
|
42
|
+
.semi-autocomplete-option:active {
|
|
43
43
|
background-color: var(--semi-color-fill-1);
|
|
44
44
|
}
|
|
45
|
-
.semi-
|
|
45
|
+
.semi-autocomplete-option-empty {
|
|
46
46
|
cursor: not-allowed;
|
|
47
47
|
color: var(--semi-color-disabled-text);
|
|
48
48
|
justify-content: center;
|
|
49
49
|
}
|
|
50
|
-
.semi-
|
|
50
|
+
.semi-autocomplete-option-empty:hover {
|
|
51
51
|
background-color: inherit;
|
|
52
52
|
}
|
|
53
|
-
.semi-
|
|
53
|
+
.semi-autocomplete-option-empty:active {
|
|
54
54
|
background-color: inherit;
|
|
55
55
|
}
|
|
56
|
-
.semi-
|
|
56
|
+
.semi-autocomplete-option-disabled {
|
|
57
57
|
color: var(--semi-color-disabled-text);
|
|
58
58
|
cursor: not-allowed;
|
|
59
59
|
}
|
|
60
|
-
.semi-
|
|
60
|
+
.semi-autocomplete-option-disabled:hover {
|
|
61
61
|
background-color: var(--semi-color-fill-0);
|
|
62
62
|
}
|
|
63
|
-
.semi-
|
|
63
|
+
.semi-autocomplete-option-selected {
|
|
64
64
|
font-weight: 600;
|
|
65
65
|
}
|
|
66
|
-
.semi-
|
|
66
|
+
.semi-autocomplete-option-selected .semi-autocomplete-option-icon {
|
|
67
67
|
visibility: visible;
|
|
68
68
|
color: var(--semi-color-text-2);
|
|
69
69
|
}
|
|
70
|
-
.semi-
|
|
70
|
+
.semi-autocomplete-option-focused {
|
|
71
71
|
background-color: var(--semi-color-fill-0);
|
|
72
72
|
}
|
|
73
|
-
.semi-
|
|
73
|
+
.semi-autocomplete-option:first-of-type {
|
|
74
74
|
margin-top: 4px;
|
|
75
75
|
}
|
|
76
|
-
.semi-
|
|
76
|
+
.semi-autocomplete-option:last-of-type {
|
|
77
77
|
margin-bottom: 4px;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -2,8 +2,8 @@ import { strings as tooltipStrings } from '../tooltip/constants';
|
|
|
2
2
|
import { BASE_CLASS_PREFIX, VALIDATE_STATUS } from '../base/constants';
|
|
3
3
|
const cssClasses = {
|
|
4
4
|
PREFIX: `${BASE_CLASS_PREFIX}-autocomplete`,
|
|
5
|
-
PREFIX_OPTION: `${BASE_CLASS_PREFIX}-
|
|
6
|
-
PREFIX_GROUP: `${BASE_CLASS_PREFIX}-
|
|
5
|
+
PREFIX_OPTION: `${BASE_CLASS_PREFIX}-autocomplete-option`,
|
|
6
|
+
PREFIX_GROUP: `${BASE_CLASS_PREFIX}-autocomplete-group`
|
|
7
7
|
};
|
|
8
8
|
const strings = {
|
|
9
9
|
SIZE: ['small', 'large', 'default'],
|
|
@@ -21,6 +21,7 @@ export interface AutoCompleteAdapter<P = Record<string, any>, S = Record<string,
|
|
|
21
21
|
updateInputValue: (inputValue: string | number) => void;
|
|
22
22
|
toggleListVisible: (isShow: boolean) => void;
|
|
23
23
|
updateOptionList: (optionList: Array<StateOptionItem>) => void;
|
|
24
|
+
updateScrollTop: (index: number) => void;
|
|
24
25
|
updateSelection: (selection: Map<any, any>) => void;
|
|
25
26
|
notifySearch: (inputValue: string) => void;
|
|
26
27
|
notifyChange: (value: string | number) => void;
|
|
@@ -182,9 +182,8 @@
|
|
|
182
182
|
align-items: center;
|
|
183
183
|
height: 100%;
|
|
184
184
|
justify-content: center;
|
|
185
|
-
width:
|
|
185
|
+
width: 32px;
|
|
186
186
|
color: var(--semi-color-text-2);
|
|
187
|
-
margin-right: 12px;
|
|
188
187
|
}
|
|
189
188
|
.semi-cascader-clearbtn:hover {
|
|
190
189
|
color: var(--semi-color-primary-hover);
|
|
@@ -360,7 +359,7 @@
|
|
|
360
359
|
.semi-cascader-option-lists .semi-cascader-option-icon {
|
|
361
360
|
display: inline-flex;
|
|
362
361
|
flex-shrink: 0;
|
|
363
|
-
width:
|
|
362
|
+
width: 32px;
|
|
364
363
|
color: var(--semi-color-text-2);
|
|
365
364
|
}
|
|
366
365
|
.semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
|
|
@@ -370,13 +369,13 @@
|
|
|
370
369
|
margin-left: 8px;
|
|
371
370
|
}
|
|
372
371
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon {
|
|
373
|
-
width:
|
|
374
|
-
height:
|
|
372
|
+
width: 32px;
|
|
373
|
+
height: 32px;
|
|
375
374
|
line-height: 0;
|
|
376
375
|
}
|
|
377
376
|
.semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
|
|
378
|
-
width:
|
|
379
|
-
height:
|
|
377
|
+
width: 32px;
|
|
378
|
+
height: 32px;
|
|
380
379
|
}
|
|
381
380
|
.semi-cascader-option-lists .semi-cascader-option-label {
|
|
382
381
|
display: flex;
|
|
@@ -442,12 +441,6 @@
|
|
|
442
441
|
.semi-portal-rtl .semi-cascader {
|
|
443
442
|
direction: rtl;
|
|
444
443
|
}
|
|
445
|
-
.semi-rtl .semi-cascader-arrow, .semi-rtl .semi-cascader-clearbtn,
|
|
446
|
-
.semi-portal-rtl .semi-cascader-arrow,
|
|
447
|
-
.semi-portal-rtl .semi-cascader-clearbtn {
|
|
448
|
-
margin-right: 0;
|
|
449
|
-
margin-left: 12px;
|
|
450
|
-
}
|
|
451
444
|
.semi-rtl .semi-cascader-inset-label,
|
|
452
445
|
.semi-portal-rtl .semi-cascader-inset-label {
|
|
453
446
|
margin-right: 12px;
|
|
@@ -500,25 +493,27 @@
|
|
|
500
493
|
.semi-cascader-option-lists-rtl {
|
|
501
494
|
direction: rtl;
|
|
502
495
|
}
|
|
503
|
-
.semi-cascader-option-lists
|
|
496
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl ul > li {
|
|
504
497
|
padding-right: 12px;
|
|
505
498
|
padding-left: auto;
|
|
506
499
|
}
|
|
507
|
-
.semi-cascader-option-lists
|
|
500
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option-list {
|
|
508
501
|
border-left: 0;
|
|
509
502
|
border-right: 1px solid var(--semi-color-fill-0);
|
|
510
503
|
}
|
|
511
|
-
.semi-cascader-option-lists
|
|
504
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option-list:first-child {
|
|
512
505
|
border-right: none;
|
|
513
506
|
}
|
|
514
|
-
.semi-cascader-option-lists
|
|
507
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option-icon-active, .semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option-icon-empty {
|
|
515
508
|
margin-right: 0;
|
|
516
509
|
margin-left: 8px;
|
|
517
510
|
}
|
|
518
|
-
.semi-cascader-option-lists
|
|
511
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option-flatten {
|
|
519
512
|
padding-right: 0;
|
|
520
513
|
padding-left: 64px;
|
|
521
514
|
}
|
|
522
|
-
.semi-cascader-option-lists
|
|
515
|
+
.semi-cascader-option-lists.semi-cascader-option-lists-rtl .semi-cascader-option .semi-icon-chevron_right {
|
|
516
|
+
margin-left: 0;
|
|
517
|
+
margin-right: 8px;
|
|
523
518
|
transform: scaleX(-1);
|
|
524
519
|
}
|
package/lib/es/cascader/rtl.scss
CHANGED
|
@@ -5,12 +5,6 @@ $module: #{$prefix}-cascader;
|
|
|
5
5
|
.#{$module} {
|
|
6
6
|
direction: rtl;
|
|
7
7
|
|
|
8
|
-
&-arrow,
|
|
9
|
-
&-clearbtn {
|
|
10
|
-
margin-right: 0;
|
|
11
|
-
margin-left: $spacing-cascader_clearBtn-marginRight;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
&-inset-label {
|
|
15
9
|
margin-right: $spacing-cascader_label-marginRight;
|
|
16
10
|
margin-left: $spacing-cascader_label-marginRight;
|
|
@@ -79,12 +73,12 @@ $module: #{$prefix}-cascader;
|
|
|
79
73
|
direction: rtl;
|
|
80
74
|
}
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
&.#{$module}-option-lists-rtl ul > li {
|
|
83
77
|
padding-right: $spacing-cascader_option-paddingLeft;
|
|
84
78
|
padding-left: auto;
|
|
85
79
|
}
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
&.#{$module}-option-lists-rtl .#{$module}-option-list {
|
|
88
82
|
border-left: 0;
|
|
89
83
|
border-right: $width-cascader_option_list-border solid $color-cascader_option_list-border-default;
|
|
90
84
|
|
|
@@ -93,7 +87,7 @@ $module: #{$prefix}-cascader;
|
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
|
|
96
|
-
|
|
90
|
+
&.#{$module}-option-lists-rtl .#{$module}-option {
|
|
97
91
|
&-icon {
|
|
98
92
|
&-active,
|
|
99
93
|
&-empty {
|
|
@@ -108,6 +102,8 @@ $module: #{$prefix}-cascader;
|
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
.#{$prefix}-icon-chevron_right {
|
|
105
|
+
margin-left: 0;
|
|
106
|
+
margin-right: $spacing-cascader_option_icon-marginLeft;
|
|
111
107
|
transform: scaleX(-1);
|
|
112
108
|
}
|
|
113
109
|
}
|
|
@@ -53,7 +53,6 @@ $spacing-cascader_selection_tag-marginY: 1px; // 级联选择触发器多选时
|
|
|
53
53
|
$spacing-cascader_selection_tagInput-marginLeft: - $spacing-extra-tight; // 级联选择触发器多选搜索时 TagInput 的左外边距
|
|
54
54
|
$spacing-cascader_selection_input-marginLeft: $spacing-extra-tight; // 级联选择触发器多选搜索时输入框的左外边距
|
|
55
55
|
$spacing-cascader_selection_n-marginRight: $spacing-extra-tight; // 超出 maxTagCount 后,+n 的右外边距
|
|
56
|
-
$spacing-cascader_clearBtn-marginRight: 12px; // 级联选择触发器清空按钮右侧外边距
|
|
57
56
|
$spacing-cascader_option-icon-marginLeft: 8px; // 级联选择菜单项图标左侧外边距
|
|
58
57
|
|
|
59
58
|
$color-cascader_selection_n-text-default: var(--semi-color-text-0); // 超出 maxTagCount 后,+n 的文字默认颜色
|
|
@@ -93,7 +92,7 @@ $height-cascader_large: $height-control-large; // 级联选择触发器高度 -
|
|
|
93
92
|
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
94
93
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
95
94
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
96
|
-
$width-cascader-icon:
|
|
95
|
+
$width-cascader-icon: 32px; // 级联选择图标尺寸
|
|
97
96
|
$width-cascader_option: 150px; // 级联选择各级菜单宽度
|
|
98
97
|
$height-cascader_option_list: 180px; // 级联选择菜单高度
|
|
99
98
|
$height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
|
package/lib/es/chat/chat.css
CHANGED
package/lib/es/chat/chat.scss
CHANGED
|
@@ -11,7 +11,7 @@ $radius-chat_dropArea: 16px; // 拖拽上传区域圆角
|
|
|
11
11
|
//color
|
|
12
12
|
$color-chat_action_content-bg: var(--semi-color-bg-0); // 返回按钮/停止生成内容按钮背景颜色
|
|
13
13
|
$color-chat_action_content-border: var(--semi-color-border); // 返回按钮/停止生成按钮描边颜色
|
|
14
|
-
$color-chat_divider: var(--semi-color-text-2); //
|
|
14
|
+
$color-chat_divider: var(--semi-color-text-2); // 分割线文字颜色
|
|
15
15
|
$color-chat_chatBox_title: var(--semi-color-text-0); //聊天框标题颜色
|
|
16
16
|
$color-chat_chatBox_action_icon: var(--semi-color-text-2); // 聊天框操作区域按钮图标颜色
|
|
17
17
|
$color-chat_chatBox_action_icon-hover: var(--semi-color-text-0); // 聊天框操作区域按钮图标hover颜色
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
border-color: var(--semi-color-primary-hover);
|
|
106
106
|
color: var(--semi-color-white);
|
|
107
107
|
}
|
|
108
|
-
.semi-checkbox:hover.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-
|
|
108
|
+
.semi-checkbox:hover.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-cardType_enable .semi-checkbox-inner-display {
|
|
109
109
|
background: var(--semi-color-white);
|
|
110
110
|
}
|
|
111
111
|
.semi-checkbox:active .semi-checkbox-inner-display {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
border-color: var(--semi-color-primary-active);
|
|
123
123
|
color: var(--semi-color-white);
|
|
124
124
|
}
|
|
125
|
-
.semi-checkbox:active.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-
|
|
125
|
+
.semi-checkbox:active.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-cardType_enable .semi-checkbox-inner-display {
|
|
126
126
|
background: var(--semi-color-white);
|
|
127
127
|
}
|
|
128
128
|
.semi-checkbox-cardType {
|
|
@@ -148,7 +148,7 @@ $module: #{$prefix}-checkbox;
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
&.#{$module}-cardType.#{$module}-unChecked.#{$module}-
|
|
151
|
+
&.#{$module}-cardType.#{$module}-unChecked.#{$module}-cardType_enable {
|
|
152
152
|
.#{$module}-inner-display {
|
|
153
153
|
background: $color-checkbox_cardType_inner-bg-hover;
|
|
154
154
|
}
|
|
@@ -175,7 +175,7 @@ $module: #{$prefix}-checkbox;
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
&.#{$module}-cardType.#{$module}-unChecked.#{$module}-
|
|
178
|
+
&.#{$module}-cardType.#{$module}-unChecked.#{$module}-cardType_enable {
|
|
179
179
|
.#{$module}-inner-display {
|
|
180
180
|
background: $color-checkbox_cardType_inner-bg-active;
|
|
181
181
|
}
|
|
@@ -452,10 +452,12 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
452
452
|
const notUpdate = opts && opts.notUpdate;
|
|
453
453
|
ObjectUtil.set(this.data.errors, field, error);
|
|
454
454
|
// 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
|
|
455
|
-
// 集中validate时,引起的setError不需要触发notify,否则会过于频繁调用,有多少个field就调用了多少次
|
|
456
455
|
if (!notNotify) {
|
|
457
456
|
this._adapter.notifyChange(this.data);
|
|
458
457
|
}
|
|
458
|
+
this._adapter.notifyErrorChange(this.data.errors, {
|
|
459
|
+
[field]: error
|
|
460
|
+
});
|
|
459
461
|
if (!notUpdate) {
|
|
460
462
|
this._adapter.forceUpdate(callback);
|
|
461
463
|
}
|
|
@@ -11,6 +11,7 @@ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
11
11
|
forceUpdate: (callback?: () => void) => void;
|
|
12
12
|
notifyChange: (formState: FormState) => void;
|
|
13
13
|
notifyValueChange: (values: any, changedValues: any) => void;
|
|
14
|
+
notifyErrorChange: (errors: any, changedError: any) => void;
|
|
14
15
|
notifyReset: () => void;
|
|
15
16
|
getInitValues: () => Partial<Values>;
|
|
16
17
|
getFormProps: (keys: undefined | string | Array<string>) => any;
|
package/lib/es/input/input.css
CHANGED
|
@@ -491,15 +491,13 @@
|
|
|
491
491
|
.semi-input-group .semi-select {
|
|
492
492
|
overflow-y: visible;
|
|
493
493
|
}
|
|
494
|
-
.semi-input-group .semi-input-number,
|
|
495
|
-
.semi-input-group .semi-datepicker,
|
|
496
|
-
.semi-input-group .semi-timepicker,
|
|
497
|
-
.semi-input-group .semi-autocomplete {
|
|
498
|
-
border-radius: 0;
|
|
499
|
-
}
|
|
494
|
+
.semi-input-group .semi-input-number .semi-input-wrapper,
|
|
500
495
|
.semi-input-group .semi-input-number .semi-datepicker-range-input,
|
|
496
|
+
.semi-input-group .semi-datepicker .semi-input-wrapper,
|
|
501
497
|
.semi-input-group .semi-datepicker .semi-datepicker-range-input,
|
|
498
|
+
.semi-input-group .semi-timepicker .semi-input-wrapper,
|
|
502
499
|
.semi-input-group .semi-timepicker .semi-datepicker-range-input,
|
|
500
|
+
.semi-input-group .semi-autocomplete .semi-input-wrapper,
|
|
503
501
|
.semi-input-group .semi-autocomplete .semi-datepicker-range-input {
|
|
504
502
|
border-radius: 0;
|
|
505
503
|
}
|
package/lib/es/input/input.scss
CHANGED
|
@@ -593,7 +593,6 @@ $module: #{$prefix}-input;
|
|
|
593
593
|
align-content: center;
|
|
594
594
|
flex-wrap: wrap;
|
|
595
595
|
|
|
596
|
-
// select与autocomplete的border-radius都是基于select
|
|
597
596
|
.#{$prefix}-select,
|
|
598
597
|
.#{$prefix}-tagInput,
|
|
599
598
|
.#{$prefix}-cascader,
|
|
@@ -633,8 +632,8 @@ $module: #{$prefix}-input;
|
|
|
633
632
|
.#{$prefix}-datepicker,
|
|
634
633
|
.#{$prefix}-timepicker,
|
|
635
634
|
.#{$prefix}-autocomplete {
|
|
636
|
-
|
|
637
|
-
|
|
635
|
+
|
|
636
|
+
.#{$module}-wrapper,
|
|
638
637
|
.#{$prefix}-datepicker-range-input {
|
|
639
638
|
border-radius: 0;
|
|
640
639
|
}
|
|
@@ -38,13 +38,12 @@ class PinCodeFoundation extends BaseFoundation {
|
|
|
38
38
|
};
|
|
39
39
|
this.completeSingleInput = (i, singleInputValue) => __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
var _a;
|
|
41
|
-
const isControlledComponent =
|
|
41
|
+
const isControlledComponent = this._isInProps("value");
|
|
42
42
|
yield this._adapter.onCurrentActiveIndexChange(i + 1);
|
|
43
43
|
const valueList = [...this.getState("valueList")];
|
|
44
44
|
valueList[i] = singleInputValue;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} else {
|
|
45
|
+
this._adapter.notifyValueChange(valueList);
|
|
46
|
+
if (!isControlledComponent) {
|
|
48
47
|
yield this.updateValueList(valueList);
|
|
49
48
|
}
|
|
50
49
|
const count = this.getProp('count');
|
|
@@ -93,11 +92,13 @@ class PinCodeFoundation extends BaseFoundation {
|
|
|
93
92
|
if (e.key === "Backspace") {
|
|
94
93
|
valueList[index] = "";
|
|
95
94
|
this.updateValueList(valueList);
|
|
95
|
+
this._adapter.notifyValueChange(valueList);
|
|
96
96
|
this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
|
|
97
97
|
e.preventDefault();
|
|
98
98
|
} else if (e.key === "Delete") {
|
|
99
99
|
valueList[index] = "";
|
|
100
100
|
this.updateValueList(valueList);
|
|
101
|
+
this._adapter.notifyValueChange(valueList);
|
|
101
102
|
this._adapter.changeSpecificInputFocusState(Math.min(valueList.length - 1, index + 1), "focus");
|
|
102
103
|
e.preventDefault();
|
|
103
104
|
} else if (e.key === "ArrowLeft") {
|
|
@@ -293,6 +293,9 @@
|
|
|
293
293
|
flex: 1;
|
|
294
294
|
min-width: 230px;
|
|
295
295
|
}
|
|
296
|
+
.semi-tree-select-popover .semi-tree-wrapper .semi-tree-option-list-hidden {
|
|
297
|
+
padding: 0;
|
|
298
|
+
}
|
|
296
299
|
.semi-tree-select-popover .semi-tree-wrapper .semi-tree-search-wrapper {
|
|
297
300
|
border-bottom: 1px var(--semi-color-fill-0) solid;
|
|
298
301
|
}
|
|
@@ -46,6 +46,8 @@ class UploadFoundation extends BaseFoundation {
|
|
|
46
46
|
this.destroyState = false;
|
|
47
47
|
}
|
|
48
48
|
init() {
|
|
49
|
+
// make sure state reset, otherwise may cause upload abort in React StrictMode, like https://github.com/DouyinFE/semi-design/pull/843
|
|
50
|
+
this.destroyState = false;
|
|
49
51
|
const {
|
|
50
52
|
disabled,
|
|
51
53
|
addOnPasting
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.67.0-beta.0",
|
|
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.
|
|
10
|
+
"@douyinfe/semi-animation": "2.67.0-beta.0",
|
|
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": "5dbca29ee2a2f9b49e6f91093df201b68b02b16a",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
34
34
|
"@babel/preset-env": "^7.15.8",
|
package/pincode/foundation.ts
CHANGED
|
@@ -42,13 +42,12 @@ class PinCodeFoundation<P = Record<string, any>, S = Record<string, any>> extend
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
completeSingleInput = async (i: number, singleInputValue: string) => {
|
|
45
|
-
const isControlledComponent =
|
|
45
|
+
const isControlledComponent = this._isInProps("value");
|
|
46
46
|
await this._adapter.onCurrentActiveIndexChange(i + 1);
|
|
47
47
|
const valueList = [...this.getState("valueList")];
|
|
48
48
|
valueList[i] = singleInputValue;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
49
|
+
this._adapter.notifyValueChange(valueList);
|
|
50
|
+
if (!isControlledComponent) {
|
|
52
51
|
await this.updateValueList(valueList);
|
|
53
52
|
}
|
|
54
53
|
|
|
@@ -102,11 +101,13 @@ class PinCodeFoundation<P = Record<string, any>, S = Record<string, any>> extend
|
|
|
102
101
|
if (e.key === "Backspace") {
|
|
103
102
|
valueList[index] = "";
|
|
104
103
|
this.updateValueList(valueList);
|
|
104
|
+
this._adapter.notifyValueChange(valueList);
|
|
105
105
|
this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
|
|
106
106
|
e.preventDefault();
|
|
107
107
|
} else if (e.key === "Delete") {
|
|
108
108
|
valueList[index] = "";
|
|
109
109
|
this.updateValueList(valueList);
|
|
110
|
+
this._adapter.notifyValueChange(valueList);
|
|
110
111
|
this._adapter.changeSpecificInputFocusState(Math.min(valueList.length - 1, index + 1), "focus");
|
|
111
112
|
e.preventDefault();
|
|
112
113
|
} else if (e.key === "ArrowLeft") {
|
package/upload/foundation.ts
CHANGED
|
@@ -100,6 +100,8 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
init(): void {
|
|
103
|
+
// make sure state reset, otherwise may cause upload abort in React StrictMode, like https://github.com/DouyinFE/semi-design/pull/843
|
|
104
|
+
this.destroyState = false;
|
|
103
105
|
const { disabled, addOnPasting } = this.getProps();
|
|
104
106
|
if (addOnPasting && !disabled) {
|
|
105
107
|
this.bindPastingHandler();
|