@douyinfe/semi-ui 2.56.2 → 2.56.3
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/dist/umd/semi-ui.js +78 -51
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/locale/source/vi_VN.js +41 -41
- package/lib/cjs/modal/Modal.js +4 -0
- package/lib/cjs/treeSelect/index.d.ts +2 -1
- package/lib/cjs/treeSelect/index.js +12 -26
- package/lib/es/locale/source/vi_VN.js +41 -41
- package/lib/es/modal/Modal.js +4 -0
- package/lib/es/treeSelect/index.d.ts +2 -1
- package/lib/es/treeSelect/index.js +12 -26
- package/package.json +8 -8
|
@@ -21,16 +21,16 @@ const local = {
|
|
|
21
21
|
TimePicker: {
|
|
22
22
|
placeholder: {
|
|
23
23
|
time: 'Chọn thời gian',
|
|
24
|
-
timeRange: 'Chọn
|
|
24
|
+
timeRange: 'Chọn phạm vi thời gian'
|
|
25
25
|
},
|
|
26
26
|
begin: 'Thời gian bắt đầu',
|
|
27
27
|
end: 'Thời gian kết thúc',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
hour: '',
|
|
32
|
-
minute: '',
|
|
33
|
-
second: '',
|
|
28
|
+
hour: 'giờ',
|
|
29
|
+
minute: 'phút',
|
|
30
|
+
second: 'giây',
|
|
31
|
+
// hour: '',
|
|
32
|
+
// minute: '',
|
|
33
|
+
// second: '',
|
|
34
34
|
AM: 'buổi sáng',
|
|
35
35
|
PM: 'vào buổi chiều'
|
|
36
36
|
},
|
|
@@ -47,48 +47,48 @@ const local = {
|
|
|
47
47
|
confirm: 'Xác nhận',
|
|
48
48
|
cancel: 'Huỷ bỏ'
|
|
49
49
|
},
|
|
50
|
-
selectDate: '
|
|
51
|
-
selectTime: 'thời gian
|
|
50
|
+
selectDate: 'Chọn ngày',
|
|
51
|
+
selectTime: 'Chọn thời gian',
|
|
52
52
|
year: 'năm',
|
|
53
53
|
month: 'tháng',
|
|
54
54
|
day: 'ngày',
|
|
55
55
|
monthText: '${month} ${year}',
|
|
56
56
|
months: {
|
|
57
|
-
1: '
|
|
58
|
-
2: '
|
|
57
|
+
1: 'Một',
|
|
58
|
+
2: 'Hai',
|
|
59
59
|
3: 'Ba',
|
|
60
|
-
4: '
|
|
61
|
-
5: '
|
|
62
|
-
6: '
|
|
63
|
-
7: '
|
|
60
|
+
4: 'Tư',
|
|
61
|
+
5: 'Năm',
|
|
62
|
+
6: 'Sáu',
|
|
63
|
+
7: 'Bảy',
|
|
64
64
|
8: 'Tám',
|
|
65
65
|
9: 'Chín',
|
|
66
66
|
10: 'Mười',
|
|
67
|
-
11: '
|
|
68
|
-
12: '
|
|
67
|
+
11: 'Mười một',
|
|
68
|
+
12: 'Mười hai'
|
|
69
69
|
},
|
|
70
70
|
fullMonths: {
|
|
71
|
-
1: '
|
|
72
|
-
2: 'Tháng
|
|
73
|
-
3: '
|
|
74
|
-
4: 'Tháng
|
|
75
|
-
5: '
|
|
76
|
-
6: 'Tháng
|
|
77
|
-
7: 'Tháng
|
|
71
|
+
1: 'Tháng Một',
|
|
72
|
+
2: 'Tháng Hai',
|
|
73
|
+
3: 'Tháng Ba',
|
|
74
|
+
4: 'Tháng Tư',
|
|
75
|
+
5: 'Tháng Năm',
|
|
76
|
+
6: 'Tháng Sáu',
|
|
77
|
+
7: 'Tháng Bảy',
|
|
78
78
|
8: 'Tháng Tám',
|
|
79
79
|
9: 'Tháng Chín',
|
|
80
80
|
10: 'Tháng Mười',
|
|
81
|
-
11: 'Tháng
|
|
82
|
-
12: 'Tháng
|
|
81
|
+
11: 'Tháng Mười một',
|
|
82
|
+
12: 'Tháng Mười hai'
|
|
83
83
|
},
|
|
84
84
|
weeks: {
|
|
85
|
-
Mon: 'Thứ
|
|
86
|
-
Tue: 'Thứ
|
|
87
|
-
Wed: 'Thứ
|
|
88
|
-
Thu: 'Thứ
|
|
89
|
-
Fri: 'Thứ
|
|
90
|
-
Sat: '
|
|
91
|
-
Sun: '
|
|
85
|
+
Mon: 'Thứ Hai',
|
|
86
|
+
Tue: 'Thứ Ba',
|
|
87
|
+
Wed: 'Thứ Tư',
|
|
88
|
+
Thu: 'Thứ Năm',
|
|
89
|
+
Fri: 'Thứ Sáu',
|
|
90
|
+
Sat: 'Thứ bảy',
|
|
91
|
+
Sun: 'Chủ nhật'
|
|
92
92
|
},
|
|
93
93
|
localeFormatToken: {
|
|
94
94
|
FORMAT_SWITCH_DATE: 'dd/MM/yyyy'
|
|
@@ -104,7 +104,7 @@ const local = {
|
|
|
104
104
|
},
|
|
105
105
|
Table: {
|
|
106
106
|
emptyText: 'Không kết quả',
|
|
107
|
-
pageText: 'Hiển thị ${currentStart} đến ${currentEnd} trong tổng số ${total}
|
|
107
|
+
pageText: 'Hiển thị ${currentStart} đến ${currentEnd} trong tổng số ${total}'
|
|
108
108
|
},
|
|
109
109
|
Select: {
|
|
110
110
|
emptyText: 'Không kết quả',
|
|
@@ -123,7 +123,7 @@ const local = {
|
|
|
123
123
|
Calendar: {
|
|
124
124
|
allDay: 'Cả ngày',
|
|
125
125
|
AM: 'buổi sáng ${time}',
|
|
126
|
-
PM: '
|
|
126
|
+
PM: 'buổi chiều ${time}',
|
|
127
127
|
datestring: '',
|
|
128
128
|
remaining: '${remained} mặt hàng'
|
|
129
129
|
},
|
|
@@ -133,7 +133,7 @@ const local = {
|
|
|
133
133
|
legalTips: 'Phát hành và bắt đầu tải lên',
|
|
134
134
|
retry: 'Thử lại',
|
|
135
135
|
replace: 'Thay thế tệp',
|
|
136
|
-
clear: '
|
|
136
|
+
clear: 'Xoá',
|
|
137
137
|
selectedFiles: 'Tệp đã chọn',
|
|
138
138
|
illegalSize: 'Kích thước tệp không hợp lệ',
|
|
139
139
|
fail: 'Tải lên không thành công'
|
|
@@ -153,7 +153,7 @@ const local = {
|
|
|
153
153
|
emptyRight: 'Không có nội dung, kiểm tra từ bên trái',
|
|
154
154
|
placeholder: 'Tìm kiếm',
|
|
155
155
|
clear: 'Clear',
|
|
156
|
-
selectAll: '
|
|
156
|
+
selectAll: 'Chọn tất cả',
|
|
157
157
|
clearSelectAll: 'Bỏ chọn tất cả',
|
|
158
158
|
total: 'Tổng số mục: ${total}',
|
|
159
159
|
selected: 'Số mục đã chọn: ${total}'
|
|
@@ -162,15 +162,15 @@ const local = {
|
|
|
162
162
|
optional: '(không bắt buộc)'
|
|
163
163
|
},
|
|
164
164
|
Image: {
|
|
165
|
-
preview: '
|
|
165
|
+
preview: 'Xem trước',
|
|
166
166
|
loading: 'Đang tải',
|
|
167
167
|
loadError: 'Không tải được',
|
|
168
168
|
prevTip: 'Trước đó',
|
|
169
|
-
nextTip: '
|
|
169
|
+
nextTip: 'Tiếp theo',
|
|
170
170
|
zoomInTip: 'Phóng to',
|
|
171
|
-
zoomOutTip: '
|
|
171
|
+
zoomOutTip: 'Thu nhỏ',
|
|
172
172
|
rotateTip: 'Xoay',
|
|
173
|
-
downloadTip: '
|
|
173
|
+
downloadTip: 'Download',
|
|
174
174
|
adaptiveTip: 'Thích ứng với trang',
|
|
175
175
|
originTip: 'Kích thước ban đầu'
|
|
176
176
|
}
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -60,6 +60,7 @@ class Modal extends _baseComponent.default {
|
|
|
60
60
|
footerFill
|
|
61
61
|
} = this.props;
|
|
62
62
|
const getCancelButton = locale => {
|
|
63
|
+
var _a;
|
|
63
64
|
if (!hasCancel) {
|
|
64
65
|
return null;
|
|
65
66
|
} else {
|
|
@@ -71,6 +72,9 @@ class Modal extends _baseComponent.default {
|
|
|
71
72
|
block: footerFill,
|
|
72
73
|
autoFocus: true
|
|
73
74
|
}, this.props.cancelButtonProps, {
|
|
75
|
+
style: Object.assign(Object.assign({}, footerFill ? {
|
|
76
|
+
marginLeft: "unset"
|
|
77
|
+
} : {}), (_a = this.props.cancelButtonProps) === null || _a === void 0 ? void 0 : _a.style),
|
|
74
78
|
"x-semi-children-alias": "cancelText"
|
|
75
79
|
}), cancelText || locale.cancel);
|
|
76
80
|
}
|
|
@@ -198,6 +198,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
198
198
|
onMotionEnd: any;
|
|
199
199
|
treeSelectID: string;
|
|
200
200
|
context: ContextValue;
|
|
201
|
+
clearInputFlag: boolean;
|
|
201
202
|
constructor(props: TreeSelectProps);
|
|
202
203
|
static getDerivedStateFromProps(props: TreeSelectProps, prevState: TreeSelectState): Partial<TreeSelectState>;
|
|
203
204
|
get adapter(): TreeSelectAdapter<TreeSelectProps, TreeSelectState>;
|
|
@@ -248,7 +249,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
248
249
|
keyEntities: import("../tree/interface").KeyEntities;
|
|
249
250
|
};
|
|
250
251
|
getTreeNodeKey: (treeNode: TreeNodeData) => string;
|
|
251
|
-
|
|
252
|
+
handlePopoverVisibleChange: (isVisible: any) => void;
|
|
252
253
|
afterClose: () => void;
|
|
253
254
|
renderTreeNode: (treeNode: FlattenNode, ind: number, style: React.CSSProperties) => JSX.Element;
|
|
254
255
|
itemKey: (index: number, data: Record<string, any>) => any;
|
|
@@ -682,33 +682,12 @@ class TreeSelect extends _baseComponent.default {
|
|
|
682
682
|
} = data;
|
|
683
683
|
return key;
|
|
684
684
|
};
|
|
685
|
-
/* Event handler function after popover
|
|
686
|
-
this.
|
|
687
|
-
|
|
688
|
-
filterTreeNode,
|
|
689
|
-
searchAutoFocus,
|
|
690
|
-
searchPosition
|
|
691
|
-
} = this.props;
|
|
692
|
-
// 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
|
|
693
|
-
// Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
|
|
694
|
-
if (isVisible === false && filterTreeNode) {
|
|
695
|
-
this.foundation.clearInputValue();
|
|
696
|
-
}
|
|
697
|
-
if (filterTreeNode && searchPosition === _constants.strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
|
|
698
|
-
this.foundation.focusInput(true);
|
|
699
|
-
}
|
|
685
|
+
/* Event handler function after popover visible change */
|
|
686
|
+
this.handlePopoverVisibleChange = isVisible => {
|
|
687
|
+
this.foundation.handlePopoverVisibleChange(isVisible);
|
|
700
688
|
};
|
|
701
689
|
this.afterClose = () => {
|
|
702
|
-
|
|
703
|
-
// 在弹层完全收起之后,再通过 clearInput 重新计算 state 中的 expandedKey, flattenNode
|
|
704
|
-
// 防止在弹出层未收起时弹层面板中选项数目变化导致视觉上出现弹层闪动问题
|
|
705
|
-
// Changes to flattenNode will cause the number of options in the popup panel to change
|
|
706
|
-
// After the pop-up layer is completely closed, recalculate the expandedKey and flattenNode in the state through clearInput.
|
|
707
|
-
// Prevent the pop-up layer from flickering visually due to changes in the number of options in the pop-up panel when the pop-up layer is not collapsed.
|
|
708
|
-
const {
|
|
709
|
-
filterTreeNode
|
|
710
|
-
} = this.props;
|
|
711
|
-
filterTreeNode && this.foundation.clearInput();
|
|
690
|
+
this.foundation.handleAfterClose();
|
|
712
691
|
};
|
|
713
692
|
this.renderTreeNode = (treeNode, ind, style) => {
|
|
714
693
|
const {
|
|
@@ -904,6 +883,7 @@ class TreeSelect extends _baseComponent.default {
|
|
|
904
883
|
this.triggerRef = /*#__PURE__*/_react.default.createRef();
|
|
905
884
|
this.optionsRef = /*#__PURE__*/_react.default.createRef();
|
|
906
885
|
this.clickOutsideHandler = null;
|
|
886
|
+
this.clearInputFlag = false;
|
|
907
887
|
this.foundation = new _foundation.default(this.adapter);
|
|
908
888
|
this.treeSelectID = Math.random().toString(36).slice(2);
|
|
909
889
|
this.onMotionEnd = () => {
|
|
@@ -1254,6 +1234,12 @@ class TreeSelect extends _baseComponent.default {
|
|
|
1254
1234
|
this.setState({
|
|
1255
1235
|
isFocus: bool
|
|
1256
1236
|
});
|
|
1237
|
+
},
|
|
1238
|
+
setClearInputFlag: flag => {
|
|
1239
|
+
this.clearInputFlag = flag;
|
|
1240
|
+
},
|
|
1241
|
+
getClearInputFlag: () => {
|
|
1242
|
+
return this.clearInputFlag;
|
|
1257
1243
|
}
|
|
1258
1244
|
});
|
|
1259
1245
|
}
|
|
@@ -1297,7 +1283,7 @@ class TreeSelect extends _baseComponent.default {
|
|
|
1297
1283
|
autoAdjustOverflow: autoAdjustOverflow,
|
|
1298
1284
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
1299
1285
|
mouseEnterDelay: mouseEnterDelay,
|
|
1300
|
-
onVisibleChange: this.
|
|
1286
|
+
onVisibleChange: this.handlePopoverVisibleChange,
|
|
1301
1287
|
afterClose: this.afterClose
|
|
1302
1288
|
}, selection);
|
|
1303
1289
|
}
|
|
@@ -15,16 +15,16 @@ const local = {
|
|
|
15
15
|
TimePicker: {
|
|
16
16
|
placeholder: {
|
|
17
17
|
time: 'Chọn thời gian',
|
|
18
|
-
timeRange: 'Chọn
|
|
18
|
+
timeRange: 'Chọn phạm vi thời gian'
|
|
19
19
|
},
|
|
20
20
|
begin: 'Thời gian bắt đầu',
|
|
21
21
|
end: 'Thời gian kết thúc',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
hour: '',
|
|
26
|
-
minute: '',
|
|
27
|
-
second: '',
|
|
22
|
+
hour: 'giờ',
|
|
23
|
+
minute: 'phút',
|
|
24
|
+
second: 'giây',
|
|
25
|
+
// hour: '',
|
|
26
|
+
// minute: '',
|
|
27
|
+
// second: '',
|
|
28
28
|
AM: 'buổi sáng',
|
|
29
29
|
PM: 'vào buổi chiều'
|
|
30
30
|
},
|
|
@@ -41,48 +41,48 @@ const local = {
|
|
|
41
41
|
confirm: 'Xác nhận',
|
|
42
42
|
cancel: 'Huỷ bỏ'
|
|
43
43
|
},
|
|
44
|
-
selectDate: '
|
|
45
|
-
selectTime: 'thời gian
|
|
44
|
+
selectDate: 'Chọn ngày',
|
|
45
|
+
selectTime: 'Chọn thời gian',
|
|
46
46
|
year: 'năm',
|
|
47
47
|
month: 'tháng',
|
|
48
48
|
day: 'ngày',
|
|
49
49
|
monthText: '${month} ${year}',
|
|
50
50
|
months: {
|
|
51
|
-
1: '
|
|
52
|
-
2: '
|
|
51
|
+
1: 'Một',
|
|
52
|
+
2: 'Hai',
|
|
53
53
|
3: 'Ba',
|
|
54
|
-
4: '
|
|
55
|
-
5: '
|
|
56
|
-
6: '
|
|
57
|
-
7: '
|
|
54
|
+
4: 'Tư',
|
|
55
|
+
5: 'Năm',
|
|
56
|
+
6: 'Sáu',
|
|
57
|
+
7: 'Bảy',
|
|
58
58
|
8: 'Tám',
|
|
59
59
|
9: 'Chín',
|
|
60
60
|
10: 'Mười',
|
|
61
|
-
11: '
|
|
62
|
-
12: '
|
|
61
|
+
11: 'Mười một',
|
|
62
|
+
12: 'Mười hai'
|
|
63
63
|
},
|
|
64
64
|
fullMonths: {
|
|
65
|
-
1: '
|
|
66
|
-
2: 'Tháng
|
|
67
|
-
3: '
|
|
68
|
-
4: 'Tháng
|
|
69
|
-
5: '
|
|
70
|
-
6: 'Tháng
|
|
71
|
-
7: 'Tháng
|
|
65
|
+
1: 'Tháng Một',
|
|
66
|
+
2: 'Tháng Hai',
|
|
67
|
+
3: 'Tháng Ba',
|
|
68
|
+
4: 'Tháng Tư',
|
|
69
|
+
5: 'Tháng Năm',
|
|
70
|
+
6: 'Tháng Sáu',
|
|
71
|
+
7: 'Tháng Bảy',
|
|
72
72
|
8: 'Tháng Tám',
|
|
73
73
|
9: 'Tháng Chín',
|
|
74
74
|
10: 'Tháng Mười',
|
|
75
|
-
11: 'Tháng
|
|
76
|
-
12: 'Tháng
|
|
75
|
+
11: 'Tháng Mười một',
|
|
76
|
+
12: 'Tháng Mười hai'
|
|
77
77
|
},
|
|
78
78
|
weeks: {
|
|
79
|
-
Mon: 'Thứ
|
|
80
|
-
Tue: 'Thứ
|
|
81
|
-
Wed: 'Thứ
|
|
82
|
-
Thu: 'Thứ
|
|
83
|
-
Fri: 'Thứ
|
|
84
|
-
Sat: '
|
|
85
|
-
Sun: '
|
|
79
|
+
Mon: 'Thứ Hai',
|
|
80
|
+
Tue: 'Thứ Ba',
|
|
81
|
+
Wed: 'Thứ Tư',
|
|
82
|
+
Thu: 'Thứ Năm',
|
|
83
|
+
Fri: 'Thứ Sáu',
|
|
84
|
+
Sat: 'Thứ bảy',
|
|
85
|
+
Sun: 'Chủ nhật'
|
|
86
86
|
},
|
|
87
87
|
localeFormatToken: {
|
|
88
88
|
FORMAT_SWITCH_DATE: 'dd/MM/yyyy'
|
|
@@ -98,7 +98,7 @@ const local = {
|
|
|
98
98
|
},
|
|
99
99
|
Table: {
|
|
100
100
|
emptyText: 'Không kết quả',
|
|
101
|
-
pageText: 'Hiển thị ${currentStart} đến ${currentEnd} trong tổng số ${total}
|
|
101
|
+
pageText: 'Hiển thị ${currentStart} đến ${currentEnd} trong tổng số ${total}'
|
|
102
102
|
},
|
|
103
103
|
Select: {
|
|
104
104
|
emptyText: 'Không kết quả',
|
|
@@ -117,7 +117,7 @@ const local = {
|
|
|
117
117
|
Calendar: {
|
|
118
118
|
allDay: 'Cả ngày',
|
|
119
119
|
AM: 'buổi sáng ${time}',
|
|
120
|
-
PM: '
|
|
120
|
+
PM: 'buổi chiều ${time}',
|
|
121
121
|
datestring: '',
|
|
122
122
|
remaining: '${remained} mặt hàng'
|
|
123
123
|
},
|
|
@@ -127,7 +127,7 @@ const local = {
|
|
|
127
127
|
legalTips: 'Phát hành và bắt đầu tải lên',
|
|
128
128
|
retry: 'Thử lại',
|
|
129
129
|
replace: 'Thay thế tệp',
|
|
130
|
-
clear: '
|
|
130
|
+
clear: 'Xoá',
|
|
131
131
|
selectedFiles: 'Tệp đã chọn',
|
|
132
132
|
illegalSize: 'Kích thước tệp không hợp lệ',
|
|
133
133
|
fail: 'Tải lên không thành công'
|
|
@@ -147,7 +147,7 @@ const local = {
|
|
|
147
147
|
emptyRight: 'Không có nội dung, kiểm tra từ bên trái',
|
|
148
148
|
placeholder: 'Tìm kiếm',
|
|
149
149
|
clear: 'Clear',
|
|
150
|
-
selectAll: '
|
|
150
|
+
selectAll: 'Chọn tất cả',
|
|
151
151
|
clearSelectAll: 'Bỏ chọn tất cả',
|
|
152
152
|
total: 'Tổng số mục: ${total}',
|
|
153
153
|
selected: 'Số mục đã chọn: ${total}'
|
|
@@ -156,15 +156,15 @@ const local = {
|
|
|
156
156
|
optional: '(không bắt buộc)'
|
|
157
157
|
},
|
|
158
158
|
Image: {
|
|
159
|
-
preview: '
|
|
159
|
+
preview: 'Xem trước',
|
|
160
160
|
loading: 'Đang tải',
|
|
161
161
|
loadError: 'Không tải được',
|
|
162
162
|
prevTip: 'Trước đó',
|
|
163
|
-
nextTip: '
|
|
163
|
+
nextTip: 'Tiếp theo',
|
|
164
164
|
zoomInTip: 'Phóng to',
|
|
165
|
-
zoomOutTip: '
|
|
165
|
+
zoomOutTip: 'Thu nhỏ',
|
|
166
166
|
rotateTip: 'Xoay',
|
|
167
|
-
downloadTip: '
|
|
167
|
+
downloadTip: 'Download',
|
|
168
168
|
adaptiveTip: 'Thích ứng với trang',
|
|
169
169
|
originTip: 'Kích thước ban đầu'
|
|
170
170
|
}
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -50,6 +50,7 @@ class Modal extends BaseComponent {
|
|
|
50
50
|
footerFill
|
|
51
51
|
} = this.props;
|
|
52
52
|
const getCancelButton = locale => {
|
|
53
|
+
var _a;
|
|
53
54
|
if (!hasCancel) {
|
|
54
55
|
return null;
|
|
55
56
|
} else {
|
|
@@ -61,6 +62,9 @@ class Modal extends BaseComponent {
|
|
|
61
62
|
block: footerFill,
|
|
62
63
|
autoFocus: true
|
|
63
64
|
}, this.props.cancelButtonProps, {
|
|
65
|
+
style: Object.assign(Object.assign({}, footerFill ? {
|
|
66
|
+
marginLeft: "unset"
|
|
67
|
+
} : {}), (_a = this.props.cancelButtonProps) === null || _a === void 0 ? void 0 : _a.style),
|
|
64
68
|
"x-semi-children-alias": "cancelText"
|
|
65
69
|
}), cancelText || locale.cancel);
|
|
66
70
|
}
|
|
@@ -198,6 +198,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
198
198
|
onMotionEnd: any;
|
|
199
199
|
treeSelectID: string;
|
|
200
200
|
context: ContextValue;
|
|
201
|
+
clearInputFlag: boolean;
|
|
201
202
|
constructor(props: TreeSelectProps);
|
|
202
203
|
static getDerivedStateFromProps(props: TreeSelectProps, prevState: TreeSelectState): Partial<TreeSelectState>;
|
|
203
204
|
get adapter(): TreeSelectAdapter<TreeSelectProps, TreeSelectState>;
|
|
@@ -248,7 +249,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
248
249
|
keyEntities: import("../tree/interface").KeyEntities;
|
|
249
250
|
};
|
|
250
251
|
getTreeNodeKey: (treeNode: TreeNodeData) => string;
|
|
251
|
-
|
|
252
|
+
handlePopoverVisibleChange: (isVisible: any) => void;
|
|
252
253
|
afterClose: () => void;
|
|
253
254
|
renderTreeNode: (treeNode: FlattenNode, ind: number, style: React.CSSProperties) => JSX.Element;
|
|
254
255
|
itemKey: (index: number, data: Record<string, any>) => any;
|
|
@@ -673,33 +673,12 @@ class TreeSelect extends BaseComponent {
|
|
|
673
673
|
} = data;
|
|
674
674
|
return key;
|
|
675
675
|
};
|
|
676
|
-
/* Event handler function after popover
|
|
677
|
-
this.
|
|
678
|
-
|
|
679
|
-
filterTreeNode,
|
|
680
|
-
searchAutoFocus,
|
|
681
|
-
searchPosition
|
|
682
|
-
} = this.props;
|
|
683
|
-
// 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
|
|
684
|
-
// Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
|
|
685
|
-
if (isVisible === false && filterTreeNode) {
|
|
686
|
-
this.foundation.clearInputValue();
|
|
687
|
-
}
|
|
688
|
-
if (filterTreeNode && searchPosition === strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
|
|
689
|
-
this.foundation.focusInput(true);
|
|
690
|
-
}
|
|
676
|
+
/* Event handler function after popover visible change */
|
|
677
|
+
this.handlePopoverVisibleChange = isVisible => {
|
|
678
|
+
this.foundation.handlePopoverVisibleChange(isVisible);
|
|
691
679
|
};
|
|
692
680
|
this.afterClose = () => {
|
|
693
|
-
|
|
694
|
-
// 在弹层完全收起之后,再通过 clearInput 重新计算 state 中的 expandedKey, flattenNode
|
|
695
|
-
// 防止在弹出层未收起时弹层面板中选项数目变化导致视觉上出现弹层闪动问题
|
|
696
|
-
// Changes to flattenNode will cause the number of options in the popup panel to change
|
|
697
|
-
// After the pop-up layer is completely closed, recalculate the expandedKey and flattenNode in the state through clearInput.
|
|
698
|
-
// Prevent the pop-up layer from flickering visually due to changes in the number of options in the pop-up panel when the pop-up layer is not collapsed.
|
|
699
|
-
const {
|
|
700
|
-
filterTreeNode
|
|
701
|
-
} = this.props;
|
|
702
|
-
filterTreeNode && this.foundation.clearInput();
|
|
681
|
+
this.foundation.handleAfterClose();
|
|
703
682
|
};
|
|
704
683
|
this.renderTreeNode = (treeNode, ind, style) => {
|
|
705
684
|
const {
|
|
@@ -895,6 +874,7 @@ class TreeSelect extends BaseComponent {
|
|
|
895
874
|
this.triggerRef = /*#__PURE__*/React.createRef();
|
|
896
875
|
this.optionsRef = /*#__PURE__*/React.createRef();
|
|
897
876
|
this.clickOutsideHandler = null;
|
|
877
|
+
this.clearInputFlag = false;
|
|
898
878
|
this.foundation = new TreeSelectFoundation(this.adapter);
|
|
899
879
|
this.treeSelectID = Math.random().toString(36).slice(2);
|
|
900
880
|
this.onMotionEnd = () => {
|
|
@@ -1245,6 +1225,12 @@ class TreeSelect extends BaseComponent {
|
|
|
1245
1225
|
this.setState({
|
|
1246
1226
|
isFocus: bool
|
|
1247
1227
|
});
|
|
1228
|
+
},
|
|
1229
|
+
setClearInputFlag: flag => {
|
|
1230
|
+
this.clearInputFlag = flag;
|
|
1231
|
+
},
|
|
1232
|
+
getClearInputFlag: () => {
|
|
1233
|
+
return this.clearInputFlag;
|
|
1248
1234
|
}
|
|
1249
1235
|
});
|
|
1250
1236
|
}
|
|
@@ -1288,7 +1274,7 @@ class TreeSelect extends BaseComponent {
|
|
|
1288
1274
|
autoAdjustOverflow: autoAdjustOverflow,
|
|
1289
1275
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
1290
1276
|
mouseEnterDelay: mouseEnterDelay,
|
|
1291
|
-
onVisibleChange: this.
|
|
1277
|
+
onVisibleChange: this.handlePopoverVisibleChange,
|
|
1292
1278
|
afterClose: this.afterClose
|
|
1293
1279
|
}, selection);
|
|
1294
1280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.56.
|
|
3
|
+
"version": "2.56.3",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.56.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.56.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.56.
|
|
26
|
-
"@douyinfe/semi-icons": "2.56.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.56.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.56.
|
|
23
|
+
"@douyinfe/semi-animation": "2.56.3",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.56.3",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.56.3",
|
|
26
|
+
"@douyinfe/semi-icons": "2.56.3",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.56.3",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.56.3",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "933e2bf0c8d66a690b83d0410656ba4cdf265537",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|