@douyinfe/semi-ui 2.23.2 → 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/button/Button.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/form/hoc/withField.js +5 -5
- package/lib/cjs/typography/base.d.ts +1 -1
- package/lib/cjs/typography/numeral.d.ts +1 -1
- package/lib/cjs/typography/paragraph.d.ts +1 -1
- package/lib/cjs/typography/text.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +5 -5
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/numeral.d.ts +1 -1
- package/lib/es/typography/paragraph.d.ts +1 -1
- package/lib/es/typography/text.d.ts +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
|
@@ -48,7 +48,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
|
-
type: PropTypes.Requireable<"warning" | "primary" | "
|
|
51
|
+
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
26
|
-
type: import("prop-types").Requireable<"warning" | "primary" | "
|
|
26
|
+
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -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
|
|
|
@@ -64,7 +64,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
66
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
67
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
70
|
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -38,7 +38,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
|
|
|
38
38
|
underline: PropTypes.Requireable<boolean>;
|
|
39
39
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
40
40
|
strong: PropTypes.Requireable<boolean>;
|
|
41
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
41
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
42
42
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
43
43
|
style: PropTypes.Requireable<object>;
|
|
44
44
|
className: PropTypes.Requireable<string>;
|
|
@@ -29,7 +29,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
29
29
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
32
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
33
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
33
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
35
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
@@ -36,7 +36,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
36
36
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
39
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
40
|
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
@@ -48,7 +48,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
|
-
type: PropTypes.Requireable<"warning" | "primary" | "
|
|
51
|
+
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
26
|
-
type: import("prop-types").Requireable<"warning" | "primary" | "
|
|
26
|
+
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -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
|
|
|
@@ -64,7 +64,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
66
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
67
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
70
|
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -38,7 +38,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
|
|
|
38
38
|
underline: PropTypes.Requireable<boolean>;
|
|
39
39
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
40
40
|
strong: PropTypes.Requireable<boolean>;
|
|
41
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
41
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
42
42
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
43
43
|
style: PropTypes.Requireable<object>;
|
|
44
44
|
className: PropTypes.Requireable<string>;
|
|
@@ -29,7 +29,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
29
29
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
32
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
33
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
33
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
35
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
@@ -36,7 +36,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
36
36
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
39
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
40
|
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
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,7 +69,7 @@
|
|
|
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",
|