@douyinfe/semi-ui 2.44.0 → 2.44.1-alpha.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/dist/css/semi.css +8 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +17 -14
- 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/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/arrayField.d.ts +1 -1
- package/lib/cjs/form/arrayField.js +2 -2
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/inputNumber/index.js +2 -3
- package/lib/cjs/modal/confirm.d.ts +16 -16
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/select/index.js +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/tree/index.js +5 -3
- package/lib/cjs/treeSelect/index.js +7 -5
- package/lib/cjs/typography/title.d.ts +2 -2
- 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/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/arrayField.d.ts +1 -1
- package/lib/es/form/arrayField.js +2 -2
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/inputNumber/index.js +2 -3
- package/lib/es/modal/confirm.d.ts +16 -16
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/select/index.js +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/tree/index.js +5 -3
- package/lib/es/treeSelect/index.js +7 -5
- package/lib/es/typography/title.d.ts +2 -2
- package/package.json +8 -8
package/lib/es/form/field.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
34
|
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
|
-
onSearch?: (value: string, event: import("react").
|
|
35
|
+
onSearch?: (value: string, event: import("react").MouseEvent<Element, MouseEvent> | import("react").KeyboardEvent<Element>) => void;
|
|
36
36
|
dropdownClassName?: string;
|
|
37
37
|
dropdownStyle?: import("react").CSSProperties;
|
|
38
38
|
dropdownMargin?: number | {
|
|
@@ -65,7 +65,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
65
65
|
showClear?: boolean;
|
|
66
66
|
showArrow?: boolean;
|
|
67
67
|
renderSelectedItem?: import("../select/index").RenderSelectedItemFn;
|
|
68
|
-
renderCreateItem?: (inputValue: string | number, focus: boolean) => import("react").ReactNode;
|
|
68
|
+
renderCreateItem?: (inputValue: string | number, focus: boolean, style?: import("react").CSSProperties) => import("react").ReactNode;
|
|
69
69
|
renderOptionItem?: (props: import("../select/index").optionRenderProps) => import("react").ReactNode;
|
|
70
70
|
onMouseEnter?: (e: import("react").MouseEvent<Element, MouseEvent>) => any;
|
|
71
71
|
onMouseLeave?: (e: import("react").MouseEvent<Element, MouseEvent>) => any;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
85
85
|
showClear: PropTypes.Requireable<boolean>;
|
|
86
86
|
hideSuffix: PropTypes.Requireable<boolean>;
|
|
87
87
|
placeholder: PropTypes.Requireable<any>;
|
|
88
|
-
size: PropTypes.Requireable<"
|
|
88
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
89
89
|
className: PropTypes.Requireable<string>;
|
|
90
90
|
style: PropTypes.Requireable<object>;
|
|
91
91
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
@@ -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<"small" | "default" | "large">;
|
|
25
25
|
style: PropTypes.Requireable<object>;
|
|
26
26
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -296,7 +296,7 @@ class InputNumber extends BaseComponent {
|
|
|
296
296
|
* We need to set the status to false after trigger focus event
|
|
297
297
|
*/
|
|
298
298
|
if (this.clickUpOrDown) {
|
|
299
|
-
obj.value = this.foundation.doFormat(
|
|
299
|
+
obj.value = this.foundation.doFormat(obj.number, true);
|
|
300
300
|
newValue = obj.value;
|
|
301
301
|
}
|
|
302
302
|
this.foundation.updateStates(obj, () => this.adapter.restoreCursor());
|
|
@@ -308,9 +308,8 @@ class InputNumber extends BaseComponent {
|
|
|
308
308
|
});
|
|
309
309
|
} else {
|
|
310
310
|
// Update input content when controlled input NaN
|
|
311
|
-
newValue = this.foundation.doFormat(valueStr, false);
|
|
312
311
|
this.foundation.updateStates({
|
|
313
|
-
value:
|
|
312
|
+
value: valueStr
|
|
314
313
|
});
|
|
315
314
|
}
|
|
316
315
|
} else if (this.foundation.isValidNumber(parsedNum)) {
|
|
@@ -140,19 +140,19 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
140
140
|
type: "warning";
|
|
141
141
|
};
|
|
142
142
|
export declare function withError(props: ModalReactProps): {
|
|
143
|
-
title?: React.ReactNode;
|
|
144
143
|
children?: React.ReactNode;
|
|
145
|
-
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
146
|
-
style?: React.CSSProperties;
|
|
147
|
-
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
|
-
getPopupContainer?: () => HTMLElement;
|
|
150
144
|
footer?: React.ReactNode;
|
|
151
145
|
header?: React.ReactNode;
|
|
152
|
-
|
|
146
|
+
style?: React.CSSProperties;
|
|
147
|
+
title?: React.ReactNode;
|
|
153
148
|
mask?: boolean;
|
|
154
149
|
visible?: boolean;
|
|
150
|
+
className?: string;
|
|
155
151
|
zIndex?: number;
|
|
152
|
+
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
153
|
+
motion?: boolean;
|
|
154
|
+
getPopupContainer?: () => HTMLElement;
|
|
155
|
+
direction?: any;
|
|
156
156
|
width?: string | number;
|
|
157
157
|
height?: string | number;
|
|
158
158
|
content?: React.ReactNode;
|
|
@@ -201,13 +201,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
201
201
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
202
202
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
203
203
|
'aria-label'?: string;
|
|
204
|
-
title?: string;
|
|
205
|
-
name?: string;
|
|
206
|
-
value?: string | number | readonly string[];
|
|
207
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
|
-
form?: string;
|
|
210
|
-
slot?: string;
|
|
211
204
|
prefix?: string;
|
|
212
205
|
dangerouslySetInnerHTML?: {
|
|
213
206
|
__html: string | TrustedHTML;
|
|
@@ -362,12 +355,17 @@ export declare function withError(props: ModalReactProps): {
|
|
|
362
355
|
onScrollCapture?: React.UIEventHandler<HTMLButtonElement>;
|
|
363
356
|
onWheel?: React.WheelEventHandler<HTMLButtonElement>;
|
|
364
357
|
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement>;
|
|
358
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
365
359
|
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
360
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
366
361
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
367
362
|
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
368
363
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
369
364
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
370
365
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
366
|
+
form?: string;
|
|
367
|
+
slot?: string;
|
|
368
|
+
title?: string;
|
|
371
369
|
hidden?: boolean;
|
|
372
370
|
color?: string;
|
|
373
371
|
defaultChecked?: boolean;
|
|
@@ -376,6 +374,8 @@ export declare function withError(props: ModalReactProps): {
|
|
|
376
374
|
suppressHydrationWarning?: boolean;
|
|
377
375
|
accessKey?: string;
|
|
378
376
|
autoFocus?: boolean;
|
|
377
|
+
name?: string;
|
|
378
|
+
value?: string | number | readonly string[];
|
|
379
379
|
content?: string;
|
|
380
380
|
formAction?: string;
|
|
381
381
|
formEncType?: string;
|
|
@@ -389,7 +389,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
389
389
|
translate?: "no" | "yes";
|
|
390
390
|
role?: React.AriaRole;
|
|
391
391
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
392
|
-
inputMode?: "search" | "
|
|
392
|
+
inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
393
393
|
nonce?: string;
|
|
394
394
|
tabIndex?: number;
|
|
395
395
|
'aria-expanded'?: boolean | "true" | "false";
|
|
@@ -422,7 +422,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
422
422
|
is?: string;
|
|
423
423
|
'aria-activedescendant'?: string;
|
|
424
424
|
'aria-atomic'?: boolean | "true" | "false";
|
|
425
|
-
'aria-autocomplete'?: "
|
|
425
|
+
'aria-autocomplete'?: "none" | "list" | "both" | "inline";
|
|
426
426
|
'aria-busy'?: boolean | "true" | "false";
|
|
427
427
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
428
428
|
'aria-colcount'?: number;
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
61
61
|
extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
62
62
|
addonStyle: PropTypes.Requireable<object>;
|
|
63
63
|
addonClassName: PropTypes.Requireable<string>;
|
|
64
|
-
type: PropTypes.Requireable<"
|
|
64
|
+
type: PropTypes.Requireable<"button" | "default" | "card" | "pureCard">;
|
|
65
65
|
'aria-label': PropTypes.Requireable<string>;
|
|
66
66
|
preventScroll: PropTypes.Requireable<boolean>;
|
|
67
67
|
};
|
|
@@ -49,7 +49,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
51
|
buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
|
|
52
|
-
type: PropTypes.Requireable<"
|
|
52
|
+
type: PropTypes.Requireable<"button" | "default" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
55
55
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
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 | "small" | "default">>;
|
|
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 | "small" | "default">>;
|
|
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/select/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export type SelectProps = {
|
|
|
128
128
|
showClear?: boolean;
|
|
129
129
|
showArrow?: boolean;
|
|
130
130
|
renderSelectedItem?: RenderSelectedItemFn;
|
|
131
|
-
renderCreateItem?: (inputValue: OptionProps['value'], focus: boolean) => React.ReactNode;
|
|
131
|
+
renderCreateItem?: (inputValue: OptionProps['value'], focus: boolean, style?: React.CSSProperties) => React.ReactNode;
|
|
132
132
|
renderOptionItem?: (props: optionRenderProps) => React.ReactNode;
|
|
133
133
|
onMouseEnter?: (e: React.MouseEvent) => any;
|
|
134
134
|
onMouseLeave?: (e: React.MouseEvent) => any;
|
package/lib/es/select/index.js
CHANGED
|
@@ -550,7 +550,7 @@ class Select extends BaseComponent {
|
|
|
550
550
|
}, locale.createText), option.value)));
|
|
551
551
|
return defaultCreateItem;
|
|
552
552
|
}
|
|
553
|
-
const customCreateItem = renderCreateItem(option.value, isFocused);
|
|
553
|
+
const customCreateItem = renderCreateItem(option.value, isFocused, style);
|
|
554
554
|
return (
|
|
555
555
|
/*#__PURE__*/
|
|
556
556
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus
|
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<"small" | "default" | "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<"small" | "middle" | "default">;
|
|
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?: "small" | "default";
|
|
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<"small" | "middle" | "default">;
|
|
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<"small" | "default" | "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>>;
|
|
@@ -132,7 +132,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
132
132
|
secondStep: PropTypes.Requireable<number>;
|
|
133
133
|
focusOnOpen: PropTypes.Requireable<boolean>;
|
|
134
134
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
135
|
-
size: PropTypes.Requireable<"
|
|
135
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
136
136
|
panels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
137
137
|
panelHeader: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
138
138
|
panelFooter: 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<"small" | "default" | "large">;
|
|
53
53
|
panels: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
54
54
|
panelHeader: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
|
55
55
|
panelFooter: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
package/lib/es/tree/index.js
CHANGED
|
@@ -233,8 +233,10 @@ class Tree extends BaseComponent {
|
|
|
233
233
|
const treeDataHasChange = prevProps && prevProps.treeData !== props.treeData;
|
|
234
234
|
return firstInProps || treeDataHasChange;
|
|
235
235
|
};
|
|
236
|
+
const needUpdateTreeData = needUpdate('treeData');
|
|
237
|
+
const needUpdateSimpleJson = needUpdate('treeDataSimpleJson');
|
|
236
238
|
// Update the data of tree in state
|
|
237
|
-
if (
|
|
239
|
+
if (needUpdateTreeData || props.draggable && needUpdateData()) {
|
|
238
240
|
treeData = props.treeData;
|
|
239
241
|
newState.treeData = treeData;
|
|
240
242
|
const entitiesMap = convertDataToEntities(treeData);
|
|
@@ -242,7 +244,7 @@ class Tree extends BaseComponent {
|
|
|
242
244
|
keyEntities = newState.keyEntities;
|
|
243
245
|
newState.cachedKeyValuePairs = Object.assign({}, entitiesMap.valueEntities);
|
|
244
246
|
valueEntities = newState.cachedKeyValuePairs;
|
|
245
|
-
} else if (
|
|
247
|
+
} else if (needUpdateSimpleJson) {
|
|
246
248
|
// Convert treeDataSimpleJson to treeData
|
|
247
249
|
treeData = convertJsonToData(props.treeDataSimpleJson);
|
|
248
250
|
newState.treeData = treeData;
|
|
@@ -259,7 +261,7 @@ class Tree extends BaseComponent {
|
|
|
259
261
|
newState.motionType = null;
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
|
-
const dataUpdated =
|
|
264
|
+
const dataUpdated = needUpdateSimpleJson || needUpdateTreeData;
|
|
263
265
|
const expandAllWhenDataChange = dataUpdated && props.expandAll;
|
|
264
266
|
if (!isSeaching) {
|
|
265
267
|
// Update expandedKeys
|
|
@@ -886,8 +886,10 @@ class TreeSelect extends BaseComponent {
|
|
|
886
886
|
const newState = {
|
|
887
887
|
prevProps: props
|
|
888
888
|
};
|
|
889
|
+
const needUpdateTreeData = needUpdate('treeData');
|
|
890
|
+
const needUpdateExpandedKeys = needUpdate('expandedKeys');
|
|
889
891
|
// TreeNode
|
|
890
|
-
if (
|
|
892
|
+
if (needUpdateTreeData) {
|
|
891
893
|
treeData = props.treeData;
|
|
892
894
|
newState.treeData = treeData;
|
|
893
895
|
const entitiesMap = convertDataToEntities(treeData);
|
|
@@ -903,9 +905,9 @@ class TreeSelect extends BaseComponent {
|
|
|
903
905
|
newState.motionType = null;
|
|
904
906
|
}
|
|
905
907
|
}
|
|
906
|
-
const expandAllWhenDataChange =
|
|
908
|
+
const expandAllWhenDataChange = needUpdateTreeData && props.expandAll;
|
|
907
909
|
// expandedKeys
|
|
908
|
-
if (
|
|
910
|
+
if (needUpdateExpandedKeys || prevProps && needUpdate('autoExpandParent')) {
|
|
909
911
|
newState.expandedKeys = calcExpandedKeys(props.expandedKeys, keyEntities, props.autoExpandParent || !prevProps);
|
|
910
912
|
// only show animation when treeData does not change
|
|
911
913
|
if (prevProps && props.motion && !treeData) {
|
|
@@ -926,7 +928,7 @@ class TreeSelect extends BaseComponent {
|
|
|
926
928
|
newState.expandedKeys = calcExpandedKeysForValues(normalizeValue(props.value, withObject), keyEntities, props.multiple, valueEntities);
|
|
927
929
|
}
|
|
928
930
|
// flattenNodes
|
|
929
|
-
if (treeData ||
|
|
931
|
+
if (treeData || needUpdateExpandedKeys) {
|
|
930
932
|
const flattenNodes = flattenTreeData(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys);
|
|
931
933
|
newState.flattenNodes = flattenNodes;
|
|
932
934
|
}
|
|
@@ -978,7 +980,7 @@ class TreeSelect extends BaseComponent {
|
|
|
978
980
|
newState.loadedKeys = new Set(props.loadedKeys);
|
|
979
981
|
}
|
|
980
982
|
// ================== rePosKey ==================
|
|
981
|
-
if (
|
|
983
|
+
if (needUpdateTreeData || needUpdate('value')) {
|
|
982
984
|
newState.rePosKey = rePosKey + 1;
|
|
983
985
|
}
|
|
984
986
|
// ================ disableStrictly =================
|
|
@@ -60,11 +60,11 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
60
60
|
underline: PropTypes.Requireable<boolean>;
|
|
61
61
|
strong: PropTypes.Requireable<boolean>;
|
|
62
62
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
63
|
-
heading: PropTypes.Requireable<
|
|
63
|
+
heading: PropTypes.Requireable<5 | 2 | 1 | 3 | 4 | 6>;
|
|
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 | "bold" | "default" | "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.44.0",
|
|
3
|
+
"version": "2.44.1-alpha.0",
|
|
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.44.0",
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.44.0",
|
|
25
|
-
"@douyinfe/semi-foundation": "2.44.0",
|
|
26
|
-
"@douyinfe/semi-icons": "2.44.0",
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.44.0",
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.44.0",
|
|
23
|
+
"@douyinfe/semi-animation": "2.44.1-alpha.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.44.1-alpha.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.44.1-alpha.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.44.1-alpha.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.44.1-alpha.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.44.1-alpha.0",
|
|
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": "f0c79fd2bbab63e4dc2d9b71e03cff03353f3edf",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|