@douyinfe/semi-ui 2.23.3 → 2.24.0-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/umd/semi-ui.js +201 -201
- 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/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.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/hoc/withField.js +5 -5
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/typography/numeral.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.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/hoc/withField.js +5 -5
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/typography/numeral.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/package.json +9 -9
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -43,7 +43,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
43
43
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
44
44
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
45
45
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
46
|
-
type: PropTypes.Requireable<"
|
|
46
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
47
47
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
48
48
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
49
49
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -432,13 +432,13 @@ function withField(Component, opts) {
|
|
|
432
432
|
const extraTextId = "".concat(a11yId, "-extraText");
|
|
433
433
|
const errorMessageId = "".concat(a11yId, "-errormessage");
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
const FieldComponent = () => {
|
|
436
436
|
// prefer to use validateStatus which pass by user throught props
|
|
437
437
|
let blockStatus = validateStatus ? validateStatus : status;
|
|
438
438
|
const extraCls = (0, _classnames.default)("".concat(prefix, "-field-extra"), {
|
|
439
439
|
["".concat(prefix, "-field-extra-string")]: typeof extraText === 'string',
|
|
440
440
|
["".concat(prefix, "-field-extra-middle")]: mergeExtraPos === 'middle',
|
|
441
|
-
["".concat(prefix, "-field-extra-
|
|
441
|
+
["".concat(prefix, "-field-extra-bottom")]: mergeExtraPos === 'bottom'
|
|
442
442
|
});
|
|
443
443
|
const extraContent = extraText ? /*#__PURE__*/_react.default.createElement("div", {
|
|
444
444
|
className: extraCls,
|
|
@@ -552,17 +552,17 @@ function withField(Component, opts) {
|
|
|
552
552
|
"x-field-id": field,
|
|
553
553
|
"x-extra-pos": mergeExtraPos
|
|
554
554
|
}, withCol ? withColContent : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, labelContent, fieldMainContent));
|
|
555
|
-
}
|
|
555
|
+
}; // !important optimization
|
|
556
556
|
|
|
557
557
|
|
|
558
558
|
const shouldUpdate = [...Object.values(fieldState), ...Object.values(props), field, mergeLabelPos, mergeLabelAlign, formProps.disabled];
|
|
559
559
|
|
|
560
560
|
if (options.shouldMemo) {
|
|
561
561
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
562
|
-
return (0, _react.useMemo)(
|
|
562
|
+
return (0, _react.useMemo)(FieldComponent, [...shouldUpdate]);
|
|
563
563
|
} else {
|
|
564
564
|
// Some Custom Component with inner state shouldn't be memo, otherwise the component will not updated when the internal state is updated
|
|
565
|
-
return FieldComponent;
|
|
565
|
+
return FieldComponent();
|
|
566
566
|
}
|
|
567
567
|
};
|
|
568
568
|
|
package/lib/cjs/radio/radio.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
82
82
|
prefixCls?: string;
|
|
83
83
|
name?: string;
|
|
84
84
|
onChange?: (e: RadioChangeEvent) => void;
|
|
85
|
-
buttonSize?: "small" | "
|
|
85
|
+
buttonSize?: "small" | "large" | "middle";
|
|
86
86
|
isCardRadio?: boolean;
|
|
87
87
|
isPureCardRadio?: boolean;
|
|
88
88
|
};
|
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -28,7 +28,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
|
|
|
28
28
|
static propTypes: {
|
|
29
29
|
rule: PropTypes.Requireable<"text" | "numbers" | "bytes-decimal" | "bytes-binary" | "percentages" | "exponential">;
|
|
30
30
|
precision: PropTypes.Requireable<number>;
|
|
31
|
-
truncate: PropTypes.Requireable<"
|
|
31
|
+
truncate: PropTypes.Requireable<"round" | "ceil" | "floor">;
|
|
32
32
|
parser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
33
|
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
delete: PropTypes.Requireable<boolean>;
|
|
@@ -142,7 +142,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
142
142
|
style: PropTypes.Requireable<object>;
|
|
143
143
|
timeout: PropTypes.Requireable<number>;
|
|
144
144
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
145
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
145
|
+
uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
|
|
146
146
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
147
147
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
148
148
|
withCredentials: PropTypes.Requireable<boolean>;
|
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -43,7 +43,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
43
43
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
44
44
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
45
45
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
46
|
-
type: PropTypes.Requireable<"
|
|
46
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
47
47
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
48
48
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
49
49
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -407,13 +407,13 @@ function withField(Component, opts) {
|
|
|
407
407
|
const extraTextId = "".concat(a11yId, "-extraText");
|
|
408
408
|
const errorMessageId = "".concat(a11yId, "-errormessage");
|
|
409
409
|
|
|
410
|
-
|
|
410
|
+
const FieldComponent = () => {
|
|
411
411
|
// prefer to use validateStatus which pass by user throught props
|
|
412
412
|
let blockStatus = validateStatus ? validateStatus : status;
|
|
413
413
|
const extraCls = classNames("".concat(prefix, "-field-extra"), {
|
|
414
414
|
["".concat(prefix, "-field-extra-string")]: typeof extraText === 'string',
|
|
415
415
|
["".concat(prefix, "-field-extra-middle")]: mergeExtraPos === 'middle',
|
|
416
|
-
["".concat(prefix, "-field-extra-
|
|
416
|
+
["".concat(prefix, "-field-extra-bottom")]: mergeExtraPos === 'bottom'
|
|
417
417
|
});
|
|
418
418
|
const extraContent = extraText ? /*#__PURE__*/React.createElement("div", {
|
|
419
419
|
className: extraCls,
|
|
@@ -524,17 +524,17 @@ function withField(Component, opts) {
|
|
|
524
524
|
"x-field-id": field,
|
|
525
525
|
"x-extra-pos": mergeExtraPos
|
|
526
526
|
}, withCol ? withColContent : /*#__PURE__*/React.createElement(React.Fragment, null, labelContent, fieldMainContent));
|
|
527
|
-
}
|
|
527
|
+
}; // !important optimization
|
|
528
528
|
|
|
529
529
|
|
|
530
530
|
const shouldUpdate = [...Object.values(fieldState), ...Object.values(props), field, mergeLabelPos, mergeLabelAlign, formProps.disabled];
|
|
531
531
|
|
|
532
532
|
if (options.shouldMemo) {
|
|
533
533
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
534
|
-
return useMemo(
|
|
534
|
+
return useMemo(FieldComponent, [...shouldUpdate]);
|
|
535
535
|
} else {
|
|
536
536
|
// Some Custom Component with inner state shouldn't be memo, otherwise the component will not updated when the internal state is updated
|
|
537
|
-
return FieldComponent;
|
|
537
|
+
return FieldComponent();
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
540
|
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
82
82
|
prefixCls?: string;
|
|
83
83
|
name?: string;
|
|
84
84
|
onChange?: (e: RadioChangeEvent) => void;
|
|
85
|
-
buttonSize?: "small" | "
|
|
85
|
+
buttonSize?: "small" | "large" | "middle";
|
|
86
86
|
isCardRadio?: boolean;
|
|
87
87
|
isPureCardRadio?: boolean;
|
|
88
88
|
};
|
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -28,7 +28,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
|
|
|
28
28
|
static propTypes: {
|
|
29
29
|
rule: PropTypes.Requireable<"text" | "numbers" | "bytes-decimal" | "bytes-binary" | "percentages" | "exponential">;
|
|
30
30
|
precision: PropTypes.Requireable<number>;
|
|
31
|
-
truncate: PropTypes.Requireable<"
|
|
31
|
+
truncate: PropTypes.Requireable<"round" | "ceil" | "floor">;
|
|
32
32
|
parser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
33
|
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
delete: PropTypes.Requireable<boolean>;
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
142
142
|
style: PropTypes.Requireable<object>;
|
|
143
143
|
timeout: PropTypes.Requireable<number>;
|
|
144
144
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
145
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
145
|
+
uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
|
|
146
146
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
147
147
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
148
148
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"lib/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@douyinfe/semi-animation": "2.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.
|
|
23
|
-
"@douyinfe/semi-icons": "2.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.
|
|
20
|
+
"@douyinfe/semi-animation": "2.24.0-alpha.0",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.24.0-alpha.0",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.24.0-alpha.0",
|
|
23
|
+
"@douyinfe/semi-icons": "2.24.0-alpha.0",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.24.0-alpha.0",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.24.0-alpha.0",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "0b5cb6431df9bb1b02c4a1a6fceb1a5f6b69fe0b",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.23.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.23.2",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"@types/react": ">=16.0.0",
|