@douyinfe/semi-ui 2.56.3-alpha.0 → 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 +74 -50
- 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/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/locale/source/vi_VN.js +41 -41
- package/lib/cjs/modal/Modal.js +4 -0
- package/lib/cjs/modal/confirm.d.ts +6 -6
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/switch/index.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +2 -2
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +1 -1
- package/lib/cjs/treeSelect/index.d.ts +2 -1
- package/lib/cjs/treeSelect/index.js +12 -26
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/locale/source/vi_VN.js +41 -41
- package/lib/es/modal/Modal.js +4 -0
- package/lib/es/modal/confirm.d.ts +6 -6
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/switch/index.d.ts +1 -1
- package/lib/es/table/Table.d.ts +2 -2
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +1 -1
- package/lib/es/treeSelect/index.d.ts +2 -1
- package/lib/es/treeSelect/index.js +12 -26
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
|
@@ -21,7 +21,7 @@ export default class inputGroup extends BaseComponent<InputGroupProps, InputGrou
|
|
|
21
21
|
static propTypes: {
|
|
22
22
|
className: PropTypes.Requireable<string>;
|
|
23
23
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
|
-
size: PropTypes.Requireable<"
|
|
24
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
25
25
|
style: PropTypes.Requireable<object>;
|
|
26
26
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -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
|
}
|
|
@@ -143,12 +143,12 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
143
143
|
type: "warning";
|
|
144
144
|
};
|
|
145
145
|
export declare function withError(props: ModalReactProps): {
|
|
146
|
-
children?: React.ReactNode;
|
|
147
|
-
motion?: boolean;
|
|
148
146
|
title?: React.ReactNode;
|
|
147
|
+
children?: React.ReactNode;
|
|
149
148
|
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
150
149
|
style?: React.CSSProperties;
|
|
151
150
|
className?: string;
|
|
151
|
+
motion?: boolean;
|
|
152
152
|
getPopupContainer?: () => HTMLElement;
|
|
153
153
|
footer?: React.ReactNode;
|
|
154
154
|
header?: React.ReactNode;
|
|
@@ -205,11 +205,11 @@ export declare function withError(props: ModalReactProps): {
|
|
|
205
205
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
206
206
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
207
207
|
'aria-label'?: string;
|
|
208
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
210
208
|
title?: string;
|
|
211
209
|
name?: string;
|
|
212
210
|
value?: string | number | readonly string[];
|
|
211
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
212
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
213
213
|
form?: string;
|
|
214
214
|
slot?: string;
|
|
215
215
|
prefix?: string;
|
|
@@ -387,7 +387,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
387
387
|
translate?: "no" | "yes";
|
|
388
388
|
role?: React.AriaRole;
|
|
389
389
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
390
|
-
inputMode?: "
|
|
390
|
+
inputMode?: "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
391
391
|
nonce?: string;
|
|
392
392
|
tabIndex?: number;
|
|
393
393
|
content?: string;
|
|
@@ -430,7 +430,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
430
430
|
'aria-current'?: boolean | "time" | "true" | "false" | "date" | "location" | "page" | "step";
|
|
431
431
|
'aria-details'?: string;
|
|
432
432
|
'aria-disabled'?: boolean | "true" | "false";
|
|
433
|
-
'aria-dropeffect'?: "
|
|
433
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup";
|
|
434
434
|
'aria-errormessage'?: string;
|
|
435
435
|
'aria-flowto'?: string;
|
|
436
436
|
'aria-grabbed'?: boolean | "true" | "false";
|
package/lib/es/rating/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export default class Rating extends BaseComponent<RatingProps, RatingState> {
|
|
|
69
69
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
70
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
71
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
72
|
-
size: PropTypes.Requireable<NonNullable<number | "
|
|
72
|
+
size: PropTypes.Requireable<NonNullable<number | "default" | "small">>;
|
|
73
73
|
tooltips: PropTypes.Requireable<string[]>;
|
|
74
74
|
id: PropTypes.Requireable<string>;
|
|
75
75
|
preventScroll: PropTypes.Requireable<boolean>;
|
package/lib/es/rating/item.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export default class Item extends BaseComponent<RatingItemProps, RatingItemState
|
|
|
40
40
|
disabled: PropTypes.Requireable<boolean>;
|
|
41
41
|
count: PropTypes.Requireable<number>;
|
|
42
42
|
ariaLabelPrefix: PropTypes.Requireable<string>;
|
|
43
|
-
size: PropTypes.Requireable<NonNullable<number | "
|
|
43
|
+
size: PropTypes.Requireable<NonNullable<number | "default" | "small">>;
|
|
44
44
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
45
45
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/switch/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare class Switch extends BaseComponent<SwitchProps, SwitchState> {
|
|
|
45
45
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
47
|
style: PropTypes.Requireable<object>;
|
|
48
|
-
size: PropTypes.Requireable<"
|
|
48
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
49
49
|
uncheckedText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
50
50
|
id: PropTypes.Requireable<string>;
|
|
51
51
|
};
|
package/lib/es/table/Table.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
60
60
|
components: PropTypes.Requireable<any>;
|
|
61
61
|
bordered: PropTypes.Requireable<boolean>;
|
|
62
62
|
loading: PropTypes.Requireable<boolean>;
|
|
63
|
-
size: PropTypes.Requireable<"
|
|
63
|
+
size: PropTypes.Requireable<"default" | "small" | "middle">;
|
|
64
64
|
tableLayout: PropTypes.Requireable<"" | "fixed" | "auto">;
|
|
65
65
|
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
66
66
|
align: PropTypes.Requireable<"center" | "left" | "right">;
|
|
@@ -297,7 +297,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
297
297
|
showTotal?: boolean;
|
|
298
298
|
pageSize?: number;
|
|
299
299
|
pageSizeOpts?: number[];
|
|
300
|
-
size?: "
|
|
300
|
+
size?: "default" | "small";
|
|
301
301
|
currentPage?: number;
|
|
302
302
|
defaultCurrentPage?: number;
|
|
303
303
|
onPageChange?: (currentPage: number) => void;
|
package/lib/es/table/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
16
16
|
components: PropTypes.Requireable<any>;
|
|
17
17
|
bordered: PropTypes.Requireable<boolean>;
|
|
18
18
|
loading: PropTypes.Requireable<boolean>;
|
|
19
|
-
size: PropTypes.Requireable<"
|
|
19
|
+
size: PropTypes.Requireable<"default" | "small" | "middle">;
|
|
20
20
|
tableLayout: PropTypes.Requireable<"" | "fixed" | "auto">;
|
|
21
21
|
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
22
|
align: PropTypes.Requireable<"center" | "left" | "right">;
|
|
@@ -97,7 +97,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
97
97
|
onAdd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
98
|
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
99
99
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
100
|
-
size: PropTypes.Requireable<"
|
|
100
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
101
101
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
102
102
|
prefix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
103
103
|
suffix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -133,7 +133,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
133
133
|
secondStep: PropTypes.Requireable<number>;
|
|
134
134
|
focusOnOpen: PropTypes.Requireable<boolean>;
|
|
135
135
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
136
|
-
size: PropTypes.Requireable<"
|
|
136
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
137
137
|
stopPropagation: PropTypes.Requireable<boolean>;
|
|
138
138
|
panels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
139
139
|
panelHeader: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -49,7 +49,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
49
49
|
secondStep: import("prop-types").Requireable<number>;
|
|
50
50
|
focusOnOpen: import("prop-types").Requireable<boolean>;
|
|
51
51
|
autoFocus: import("prop-types").Requireable<boolean>;
|
|
52
|
-
size: import("prop-types").Requireable<"
|
|
52
|
+
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
53
53
|
stopPropagation: import("prop-types").Requireable<boolean>;
|
|
54
54
|
panels: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
55
55
|
panelHeader: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
|
@@ -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
|
}
|
|
@@ -64,7 +64,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
64
64
|
style: PropTypes.Requireable<object>;
|
|
65
65
|
className: PropTypes.Requireable<string>;
|
|
66
66
|
component: PropTypes.Requireable<string>;
|
|
67
|
-
weight: PropTypes.Requireable<NonNullable<number | "
|
|
67
|
+
weight: PropTypes.Requireable<NonNullable<number | "default" | "bold" | "medium" | "light" | "regular" | "semibold">>;
|
|
68
68
|
};
|
|
69
69
|
static defaultProps: {
|
|
70
70
|
copyable: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.56.3
|
|
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.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
|
|
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",
|