@douyinfe/semi-ui 2.1.4 → 2.1.5
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/button/Button.tsx +1 -0
- package/checkbox/checkbox.tsx +2 -0
- package/checkbox/checkboxGroup.tsx +3 -2
- package/dist/css/semi.css +7 -7
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +16 -10
- 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/form/hoc/withField.tsx +1 -1
- package/lib/cjs/_base/base.css +2 -2
- package/lib/cjs/button/Button.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +3 -1
- package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/cjs/checkbox/checkboxGroup.js +3 -1
- package/lib/cjs/form/baseForm.d.ts +1 -0
- package/lib/cjs/form/field.d.ts +1 -0
- package/lib/cjs/form/hoc/withField.js +3 -1
- package/lib/cjs/modal/Modal.d.ts +2 -2
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/modal/confirm.d.ts +10 -10
- package/lib/cjs/navigation/index.d.ts +2 -2
- package/lib/cjs/select/index.d.ts +1 -0
- package/lib/cjs/select/index.js +2 -0
- package/lib/cjs/timeline/item.d.ts +2 -2
- package/lib/cjs/timeline/item.js +3 -3
- package/lib/cjs/tree/treeNode.js +0 -2
- package/lib/es/_base/base.css +2 -2
- package/lib/es/button/Button.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +3 -1
- package/lib/es/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/es/checkbox/checkboxGroup.js +3 -1
- package/lib/es/form/baseForm.d.ts +1 -0
- package/lib/es/form/field.d.ts +1 -0
- package/lib/es/form/hoc/withField.js +3 -1
- package/lib/es/modal/Modal.d.ts +2 -2
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/modal/confirm.d.ts +10 -10
- package/lib/es/navigation/index.d.ts +2 -2
- package/lib/es/select/index.d.ts +1 -0
- package/lib/es/select/index.js +2 -0
- package/lib/es/timeline/item.d.ts +2 -2
- package/lib/es/timeline/item.js +3 -3
- package/lib/es/tree/treeNode.js +0 -2
- package/modal/Modal.tsx +4 -4
- package/navigation/index.tsx +2 -2
- package/package.json +8 -8
- package/radio/_story/radio.stories.js +12 -1
- package/select/index.tsx +3 -0
- package/timeline/__test__/timeline.test.js +17 -1
- package/timeline/item.tsx +4 -4
- package/tree/_story/tree.stories.js +2 -2
- package/tree/treeNode.tsx +0 -2
package/form/hoc/withField.tsx
CHANGED
|
@@ -75,7 +75,7 @@ function withField<
|
|
|
75
75
|
// 无需注入的直接返回,eg:Group内的checkbox、radio
|
|
76
76
|
// Return without injection, eg: <Checkbox> / <Radio> inside CheckboxGroup/RadioGroup
|
|
77
77
|
if (!shouldInject) {
|
|
78
|
-
return <Component {...rest} />;
|
|
78
|
+
return <Component {...rest} ref={ref} />;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// grab formState from context
|
package/lib/cjs/_base/base.css
CHANGED
|
@@ -399,7 +399,7 @@ body, body[theme-mode=dark] .semi-always-light {
|
|
|
399
399
|
--semi-color-link-visited: rgba(var(--semi-blue-5), 1);
|
|
400
400
|
--semi-color-border: rgba(var(--semi-grey-9), .08);
|
|
401
401
|
--semi-color-nav-bg: rgba(var(--semi-white), 1);
|
|
402
|
-
--semi-overlay-bg: rgba(22, 22, 26, .6);
|
|
402
|
+
--semi-color-overlay-bg: rgba(22, 22, 26, .6);
|
|
403
403
|
--semi-color-fill-0: rgba(var(--semi-grey-8), .05);
|
|
404
404
|
--semi-color-fill-1: rgba(var(--semi-grey-8), .09);
|
|
405
405
|
--semi-color-fill-2: rgba(var(--semi-grey-8), .13);
|
|
@@ -486,7 +486,7 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
486
486
|
--semi-color-link-visited: rgba(var(--semi-blue-5), 1);
|
|
487
487
|
--semi-color-nav-bg: rgba(35, 36, 41, 1);
|
|
488
488
|
--semi-shadow-elevated: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 4px 14px rgba(0, 0, 0, .25);
|
|
489
|
-
--semi-overlay-bg: rgba(22, 22, 26, .6);
|
|
489
|
+
--semi-color-overlay-bg: rgba(22, 22, 26, .6);
|
|
490
490
|
--semi-color-fill-0: rgba(var(--semi-white), .05);
|
|
491
491
|
--semi-color-fill-1: rgba(var(--semi-white), .09);
|
|
492
492
|
--semi-color-fill-2: rgba(var(--semi-white), .13);
|
|
@@ -7,6 +7,7 @@ export declare type Size = 'default' | 'small' | 'large';
|
|
|
7
7
|
export declare type Theme = 'solid' | 'borderless' | 'light';
|
|
8
8
|
export declare type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
|
|
9
9
|
export interface ButtonProps {
|
|
10
|
+
id?: string;
|
|
10
11
|
block?: boolean;
|
|
11
12
|
circle?: boolean;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -108,7 +108,8 @@ class Checkbox extends _baseComponent.default {
|
|
|
108
108
|
onMouseEnter,
|
|
109
109
|
onMouseLeave,
|
|
110
110
|
extra,
|
|
111
|
-
value
|
|
111
|
+
value,
|
|
112
|
+
id
|
|
112
113
|
} = this.props;
|
|
113
114
|
const {
|
|
114
115
|
checked
|
|
@@ -165,6 +166,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
165
166
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
166
167
|
style: style,
|
|
167
168
|
className: wrapper,
|
|
169
|
+
id: id,
|
|
168
170
|
onMouseEnter: onMouseEnter,
|
|
169
171
|
onMouseLeave: onMouseLeave,
|
|
170
172
|
onClick: this.handleChange
|
|
@@ -91,6 +91,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
91
91
|
prefixCls,
|
|
92
92
|
direction,
|
|
93
93
|
className,
|
|
94
|
+
id,
|
|
94
95
|
style,
|
|
95
96
|
type
|
|
96
97
|
} = this.props;
|
|
@@ -140,7 +141,8 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
140
141
|
|
|
141
142
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
142
143
|
className: prefixClsDisplay,
|
|
143
|
-
style: style
|
|
144
|
+
style: style,
|
|
145
|
+
id: id
|
|
144
146
|
}, /*#__PURE__*/_react.default.createElement(_context7.Context.Provider, {
|
|
145
147
|
value: {
|
|
146
148
|
checkboxGroup: {
|
|
@@ -53,6 +53,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
53
53
|
static TextArea: React.ComponentType<import("utility-types").Subtract<Omit<import("../input").TextAreaProps, "forwardRef"> & React.RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
54
54
|
static InputNumber: React.ComponentType<import("utility-types").Subtract<import("../inputNumber").InputNumberProps & React.RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
55
55
|
static Select: React.ComponentType<import("utility-types").Subtract<{
|
|
56
|
+
id?: string;
|
|
56
57
|
autoFocus?: boolean;
|
|
57
58
|
arrowIcon?: React.ReactNode;
|
|
58
59
|
defaultValue?: string | number | any[] | Record<string, any>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const FormInput: import("react").ComponentType<import("utility-types").S
|
|
|
3
3
|
declare const FormInputNumber: import("react").ComponentType<import("utility-types").Subtract<import("../inputNumber/index").InputNumberProps & import("react").RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
4
4
|
declare const FormTextArea: import("react").ComponentType<import("utility-types").Subtract<Omit<import("../input/textarea").TextAreaProps, "forwardRef"> & import("react").RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
5
5
|
declare const FormSelect: import("react").ComponentType<import("utility-types").Subtract<{
|
|
6
|
+
id?: string;
|
|
6
7
|
autoFocus?: boolean;
|
|
7
8
|
arrowIcon?: import("react").ReactNode;
|
|
8
9
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
@@ -107,7 +107,9 @@ function withField(Component, opts) {
|
|
|
107
107
|
// Return without injection, eg: <Checkbox> / <Radio> inside CheckboxGroup/RadioGroup
|
|
108
108
|
|
|
109
109
|
if (!shouldInject) {
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(Component, (0, _assign.default)({}, rest
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _assign.default)({}, rest, {
|
|
111
|
+
ref: ref
|
|
112
|
+
}));
|
|
111
113
|
} // grab formState from context
|
|
112
114
|
|
|
113
115
|
|
package/lib/cjs/modal/Modal.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
30
30
|
closable: PropTypes.Requireable<boolean>;
|
|
31
31
|
centered: PropTypes.Requireable<boolean>;
|
|
32
32
|
visible: PropTypes.Requireable<boolean>;
|
|
33
|
-
width: PropTypes.Requireable<number>;
|
|
34
|
-
height: PropTypes.Requireable<number>;
|
|
33
|
+
width: PropTypes.Requireable<string | number>;
|
|
34
|
+
height: PropTypes.Requireable<string | number>;
|
|
35
35
|
confirmLoading: PropTypes.Requireable<boolean>;
|
|
36
36
|
cancelLoading: PropTypes.Requireable<boolean>;
|
|
37
37
|
okText: PropTypes.Requireable<string>;
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -343,8 +343,8 @@ Modal.propTypes = {
|
|
|
343
343
|
closable: _propTypes.default.bool,
|
|
344
344
|
centered: _propTypes.default.bool,
|
|
345
345
|
visible: _propTypes.default.bool,
|
|
346
|
-
width: _propTypes.default.number,
|
|
347
|
-
height: _propTypes.default.number,
|
|
346
|
+
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
347
|
+
height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
348
348
|
confirmLoading: _propTypes.default.bool,
|
|
349
349
|
cancelLoading: _propTypes.default.bool,
|
|
350
350
|
okText: _propTypes.default.string,
|
|
@@ -30,7 +30,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
30
30
|
confirmLoading?: boolean;
|
|
31
31
|
cancelLoading?: boolean;
|
|
32
32
|
hasCancel?: boolean;
|
|
33
|
-
height?: number;
|
|
33
|
+
height?: string | number;
|
|
34
34
|
mask?: boolean;
|
|
35
35
|
maskClosable?: boolean;
|
|
36
36
|
maskFixed?: boolean;
|
|
@@ -38,7 +38,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
38
38
|
okText?: string;
|
|
39
39
|
okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
|
|
40
40
|
visible?: boolean;
|
|
41
|
-
width?: number;
|
|
41
|
+
width?: string | number;
|
|
42
42
|
zIndex?: number;
|
|
43
43
|
getPopupContainer?: () => HTMLElement;
|
|
44
44
|
closeOnEsc?: boolean;
|
|
@@ -71,7 +71,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
71
71
|
confirmLoading?: boolean;
|
|
72
72
|
cancelLoading?: boolean;
|
|
73
73
|
hasCancel?: boolean;
|
|
74
|
-
height?: number;
|
|
74
|
+
height?: string | number;
|
|
75
75
|
mask?: boolean;
|
|
76
76
|
maskClosable?: boolean;
|
|
77
77
|
maskFixed?: boolean;
|
|
@@ -79,7 +79,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
79
79
|
okText?: string;
|
|
80
80
|
okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
|
|
81
81
|
visible?: boolean;
|
|
82
|
-
width?: number;
|
|
82
|
+
width?: string | number;
|
|
83
83
|
zIndex?: number;
|
|
84
84
|
getPopupContainer?: () => HTMLElement;
|
|
85
85
|
closeOnEsc?: boolean;
|
|
@@ -112,7 +112,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
112
112
|
confirmLoading?: boolean;
|
|
113
113
|
cancelLoading?: boolean;
|
|
114
114
|
hasCancel?: boolean;
|
|
115
|
-
height?: number;
|
|
115
|
+
height?: string | number;
|
|
116
116
|
mask?: boolean;
|
|
117
117
|
maskClosable?: boolean;
|
|
118
118
|
maskFixed?: boolean;
|
|
@@ -120,7 +120,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
120
120
|
okText?: string;
|
|
121
121
|
okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
|
|
122
122
|
visible?: boolean;
|
|
123
|
-
width?: number;
|
|
123
|
+
width?: string | number;
|
|
124
124
|
zIndex?: number;
|
|
125
125
|
getPopupContainer?: () => HTMLElement;
|
|
126
126
|
closeOnEsc?: boolean;
|
|
@@ -153,7 +153,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
153
153
|
confirmLoading?: boolean;
|
|
154
154
|
cancelLoading?: boolean;
|
|
155
155
|
hasCancel?: boolean;
|
|
156
|
-
height?: number;
|
|
156
|
+
height?: string | number;
|
|
157
157
|
mask?: boolean;
|
|
158
158
|
maskClosable?: boolean;
|
|
159
159
|
maskFixed?: boolean;
|
|
@@ -161,7 +161,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
161
161
|
okText?: string;
|
|
162
162
|
okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
|
|
163
163
|
visible?: boolean;
|
|
164
|
-
width?: number;
|
|
164
|
+
width?: string | number;
|
|
165
165
|
zIndex?: number;
|
|
166
166
|
getPopupContainer?: () => HTMLElement;
|
|
167
167
|
closeOnEsc?: boolean;
|
|
@@ -194,7 +194,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
194
194
|
confirmLoading?: boolean;
|
|
195
195
|
cancelLoading?: boolean;
|
|
196
196
|
hasCancel?: boolean;
|
|
197
|
-
height?: number;
|
|
197
|
+
height?: string | number;
|
|
198
198
|
mask?: boolean;
|
|
199
199
|
maskClosable?: boolean;
|
|
200
200
|
maskFixed?: boolean;
|
|
@@ -202,7 +202,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
202
202
|
okText?: string;
|
|
203
203
|
okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
|
|
204
204
|
visible?: boolean;
|
|
205
|
-
width?: number;
|
|
205
|
+
width?: string | number;
|
|
206
206
|
zIndex?: number;
|
|
207
207
|
getPopupContainer?: () => HTMLElement;
|
|
208
208
|
closeOnEsc?: boolean;
|
|
@@ -36,8 +36,8 @@ export interface NavProps extends BaseProps {
|
|
|
36
36
|
defaultIsCollapsed?: boolean;
|
|
37
37
|
defaultOpenKeys?: React.ReactText[];
|
|
38
38
|
defaultSelectedKeys?: React.ReactText[];
|
|
39
|
-
footer?: React.ReactNode |
|
|
40
|
-
header?: React.ReactNode |
|
|
39
|
+
footer?: React.ReactNode | NavFooterProps;
|
|
40
|
+
header?: React.ReactNode | NavHeaderProps;
|
|
41
41
|
isCollapsed?: boolean;
|
|
42
42
|
items?: NavItems;
|
|
43
43
|
limitIndent?: boolean;
|
|
@@ -48,6 +48,7 @@ export declare type RenderMultipleSelectedItemFn = (optionNode: Record<string, a
|
|
|
48
48
|
};
|
|
49
49
|
export declare type RenderSelectedItemFn = RenderSingleSelectedItemFn | RenderMultipleSelectedItemFn;
|
|
50
50
|
export declare type SelectProps = {
|
|
51
|
+
id?: string;
|
|
51
52
|
autoFocus?: boolean;
|
|
52
53
|
arrowIcon?: React.ReactNode;
|
|
53
54
|
defaultValue?: string | number | any[] | Record<string, any>;
|
package/lib/cjs/select/index.js
CHANGED
|
@@ -873,6 +873,7 @@ class Select extends _baseComponent.default {
|
|
|
873
873
|
multiple,
|
|
874
874
|
filter,
|
|
875
875
|
style,
|
|
876
|
+
id,
|
|
876
877
|
size,
|
|
877
878
|
className,
|
|
878
879
|
validateStatus,
|
|
@@ -946,6 +947,7 @@ class Select extends _baseComponent.default {
|
|
|
946
947
|
ref: ref => this.triggerRef.current = ref,
|
|
947
948
|
onClick: e => this.foundation.handleClick(e),
|
|
948
949
|
style: style,
|
|
950
|
+
id: id,
|
|
949
951
|
tabIndex: tabIndex,
|
|
950
952
|
onMouseEnter: this.onMouseEnter,
|
|
951
953
|
onMouseLeave: this.onMouseLeave,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/timeline/timeline.css';
|
|
4
4
|
export interface TimelineItemProps {
|
|
5
5
|
color?: string;
|
|
6
|
-
time?:
|
|
6
|
+
time?: React.ReactNode;
|
|
7
7
|
type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
8
8
|
dot?: React.ReactNode;
|
|
9
9
|
extra?: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ export interface TimelineItemProps {
|
|
|
14
14
|
export default class Item extends PureComponent<TimelineItemProps> {
|
|
15
15
|
static propTypes: {
|
|
16
16
|
color: PropTypes.Requireable<string>;
|
|
17
|
-
time: PropTypes.Requireable<
|
|
17
|
+
time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
18
18
|
type: PropTypes.Requireable<string>;
|
|
19
19
|
dot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
20
|
extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
package/lib/cjs/timeline/item.js
CHANGED
|
@@ -68,9 +68,9 @@ class Item extends _react.PureComponent {
|
|
|
68
68
|
className: dotCls
|
|
69
69
|
}, dotStyle), dot), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
70
|
className: "".concat(prefixCls, "-content")
|
|
71
|
-
}, children, extra
|
|
71
|
+
}, children, extra && /*#__PURE__*/_react.default.createElement("div", {
|
|
72
72
|
className: "".concat(prefixCls, "-content-extra")
|
|
73
|
-
}, extra)
|
|
73
|
+
}, extra), time && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
74
|
className: "".concat(prefixCls, "-content-time")
|
|
75
75
|
}, time)));
|
|
76
76
|
}
|
|
@@ -80,7 +80,7 @@ class Item extends _react.PureComponent {
|
|
|
80
80
|
exports.default = Item;
|
|
81
81
|
Item.propTypes = {
|
|
82
82
|
color: _propTypes.default.string,
|
|
83
|
-
time: _propTypes.default.
|
|
83
|
+
time: _propTypes.default.node,
|
|
84
84
|
type: _propTypes.default.oneOf(_constants.strings.ITEM_TYPE),
|
|
85
85
|
dot: _propTypes.default.node,
|
|
86
86
|
extra: _propTypes.default.node,
|
package/lib/cjs/tree/treeNode.js
CHANGED
package/lib/es/_base/base.css
CHANGED
|
@@ -399,7 +399,7 @@ body, body[theme-mode=dark] .semi-always-light {
|
|
|
399
399
|
--semi-color-link-visited: rgba(var(--semi-blue-5), 1);
|
|
400
400
|
--semi-color-border: rgba(var(--semi-grey-9), .08);
|
|
401
401
|
--semi-color-nav-bg: rgba(var(--semi-white), 1);
|
|
402
|
-
--semi-overlay-bg: rgba(22, 22, 26, .6);
|
|
402
|
+
--semi-color-overlay-bg: rgba(22, 22, 26, .6);
|
|
403
403
|
--semi-color-fill-0: rgba(var(--semi-grey-8), .05);
|
|
404
404
|
--semi-color-fill-1: rgba(var(--semi-grey-8), .09);
|
|
405
405
|
--semi-color-fill-2: rgba(var(--semi-grey-8), .13);
|
|
@@ -486,7 +486,7 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
486
486
|
--semi-color-link-visited: rgba(var(--semi-blue-5), 1);
|
|
487
487
|
--semi-color-nav-bg: rgba(35, 36, 41, 1);
|
|
488
488
|
--semi-shadow-elevated: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 4px 14px rgba(0, 0, 0, .25);
|
|
489
|
-
--semi-overlay-bg: rgba(22, 22, 26, .6);
|
|
489
|
+
--semi-color-overlay-bg: rgba(22, 22, 26, .6);
|
|
490
490
|
--semi-color-fill-0: rgba(var(--semi-white), .05);
|
|
491
491
|
--semi-color-fill-1: rgba(var(--semi-white), .09);
|
|
492
492
|
--semi-color-fill-2: rgba(var(--semi-white), .13);
|
|
@@ -7,6 +7,7 @@ export declare type Size = 'default' | 'small' | 'large';
|
|
|
7
7
|
export declare type Theme = 'solid' | 'borderless' | 'light';
|
|
8
8
|
export declare type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
|
|
9
9
|
export interface ButtonProps {
|
|
10
|
+
id?: string;
|
|
10
11
|
block?: boolean;
|
|
11
12
|
circle?: boolean;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -84,7 +84,8 @@ class Checkbox extends BaseComponent {
|
|
|
84
84
|
onMouseEnter,
|
|
85
85
|
onMouseLeave,
|
|
86
86
|
extra,
|
|
87
|
-
value
|
|
87
|
+
value,
|
|
88
|
+
id
|
|
88
89
|
} = this.props;
|
|
89
90
|
const {
|
|
90
91
|
checked
|
|
@@ -142,6 +143,7 @@ class Checkbox extends BaseComponent {
|
|
|
142
143
|
return /*#__PURE__*/React.createElement("span", {
|
|
143
144
|
style: style,
|
|
144
145
|
className: wrapper,
|
|
146
|
+
id: id,
|
|
145
147
|
onMouseEnter: onMouseEnter,
|
|
146
148
|
onMouseLeave: onMouseLeave,
|
|
147
149
|
onClick: this.handleChange
|
|
@@ -67,6 +67,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
67
67
|
prefixCls,
|
|
68
68
|
direction,
|
|
69
69
|
className,
|
|
70
|
+
id,
|
|
70
71
|
style,
|
|
71
72
|
type
|
|
72
73
|
} = this.props;
|
|
@@ -118,7 +119,8 @@ class CheckboxGroup extends BaseComponent {
|
|
|
118
119
|
|
|
119
120
|
return /*#__PURE__*/React.createElement("div", {
|
|
120
121
|
className: prefixClsDisplay,
|
|
121
|
-
style: style
|
|
122
|
+
style: style,
|
|
123
|
+
id: id
|
|
122
124
|
}, /*#__PURE__*/React.createElement(Context.Provider, {
|
|
123
125
|
value: {
|
|
124
126
|
checkboxGroup: {
|
|
@@ -53,6 +53,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
53
53
|
static TextArea: React.ComponentType<import("utility-types").Subtract<Omit<import("../input").TextAreaProps, "forwardRef"> & React.RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
54
54
|
static InputNumber: React.ComponentType<import("utility-types").Subtract<import("../inputNumber").InputNumberProps & React.RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
55
55
|
static Select: React.ComponentType<import("utility-types").Subtract<{
|
|
56
|
+
id?: string;
|
|
56
57
|
autoFocus?: boolean;
|
|
57
58
|
arrowIcon?: React.ReactNode;
|
|
58
59
|
defaultValue?: string | number | any[] | Record<string, any>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const FormInput: import("react").ComponentType<import("utility-types").S
|
|
|
3
3
|
declare const FormInputNumber: import("react").ComponentType<import("utility-types").Subtract<import("../inputNumber/index").InputNumberProps & import("react").RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
4
4
|
declare const FormTextArea: import("react").ComponentType<import("utility-types").Subtract<Omit<import("../input/textarea").TextAreaProps, "forwardRef"> & import("react").RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
5
5
|
declare const FormSelect: import("react").ComponentType<import("utility-types").Subtract<{
|
|
6
|
+
id?: string;
|
|
6
7
|
autoFocus?: boolean;
|
|
7
8
|
arrowIcon?: import("react").ReactNode;
|
|
8
9
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
@@ -70,7 +70,9 @@ function withField(Component, opts) {
|
|
|
70
70
|
// Return without injection, eg: <Checkbox> / <Radio> inside CheckboxGroup/RadioGroup
|
|
71
71
|
|
|
72
72
|
if (!shouldInject) {
|
|
73
|
-
return /*#__PURE__*/React.createElement(Component, _Object$assign({}, rest
|
|
73
|
+
return /*#__PURE__*/React.createElement(Component, _Object$assign({}, rest, {
|
|
74
|
+
ref: ref
|
|
75
|
+
}));
|
|
74
76
|
} // grab formState from context
|
|
75
77
|
|
|
76
78
|
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
30
30
|
closable: PropTypes.Requireable<boolean>;
|
|
31
31
|
centered: PropTypes.Requireable<boolean>;
|
|
32
32
|
visible: PropTypes.Requireable<boolean>;
|
|
33
|
-
width: PropTypes.Requireable<number>;
|
|
34
|
-
height: PropTypes.Requireable<number>;
|
|
33
|
+
width: PropTypes.Requireable<string | number>;
|
|
34
|
+
height: PropTypes.Requireable<string | number>;
|
|
35
35
|
confirmLoading: PropTypes.Requireable<boolean>;
|
|
36
36
|
cancelLoading: PropTypes.Requireable<boolean>;
|
|
37
37
|
okText: PropTypes.Requireable<string>;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -304,8 +304,8 @@ Modal.propTypes = {
|
|
|
304
304
|
closable: PropTypes.bool,
|
|
305
305
|
centered: PropTypes.bool,
|
|
306
306
|
visible: PropTypes.bool,
|
|
307
|
-
width: PropTypes.number,
|
|
308
|
-
height: PropTypes.number,
|
|
307
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
308
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
309
309
|
confirmLoading: PropTypes.bool,
|
|
310
310
|
cancelLoading: PropTypes.bool,
|
|
311
311
|
okText: PropTypes.string,
|
|
@@ -30,7 +30,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
30
30
|
confirmLoading?: boolean;
|
|
31
31
|
cancelLoading?: boolean;
|
|
32
32
|
hasCancel?: boolean;
|
|
33
|
-
height?: number;
|
|
33
|
+
height?: string | number;
|
|
34
34
|
mask?: boolean;
|
|
35
35
|
maskClosable?: boolean;
|
|
36
36
|
maskFixed?: boolean;
|
|
@@ -38,7 +38,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
38
38
|
okText?: string;
|
|
39
39
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
40
40
|
visible?: boolean;
|
|
41
|
-
width?: number;
|
|
41
|
+
width?: string | number;
|
|
42
42
|
zIndex?: number;
|
|
43
43
|
getPopupContainer?: () => HTMLElement;
|
|
44
44
|
closeOnEsc?: boolean;
|
|
@@ -71,7 +71,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
71
71
|
confirmLoading?: boolean;
|
|
72
72
|
cancelLoading?: boolean;
|
|
73
73
|
hasCancel?: boolean;
|
|
74
|
-
height?: number;
|
|
74
|
+
height?: string | number;
|
|
75
75
|
mask?: boolean;
|
|
76
76
|
maskClosable?: boolean;
|
|
77
77
|
maskFixed?: boolean;
|
|
@@ -79,7 +79,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
79
79
|
okText?: string;
|
|
80
80
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
81
81
|
visible?: boolean;
|
|
82
|
-
width?: number;
|
|
82
|
+
width?: string | number;
|
|
83
83
|
zIndex?: number;
|
|
84
84
|
getPopupContainer?: () => HTMLElement;
|
|
85
85
|
closeOnEsc?: boolean;
|
|
@@ -112,7 +112,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
112
112
|
confirmLoading?: boolean;
|
|
113
113
|
cancelLoading?: boolean;
|
|
114
114
|
hasCancel?: boolean;
|
|
115
|
-
height?: number;
|
|
115
|
+
height?: string | number;
|
|
116
116
|
mask?: boolean;
|
|
117
117
|
maskClosable?: boolean;
|
|
118
118
|
maskFixed?: boolean;
|
|
@@ -120,7 +120,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
120
120
|
okText?: string;
|
|
121
121
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
122
122
|
visible?: boolean;
|
|
123
|
-
width?: number;
|
|
123
|
+
width?: string | number;
|
|
124
124
|
zIndex?: number;
|
|
125
125
|
getPopupContainer?: () => HTMLElement;
|
|
126
126
|
closeOnEsc?: boolean;
|
|
@@ -153,7 +153,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
153
153
|
confirmLoading?: boolean;
|
|
154
154
|
cancelLoading?: boolean;
|
|
155
155
|
hasCancel?: boolean;
|
|
156
|
-
height?: number;
|
|
156
|
+
height?: string | number;
|
|
157
157
|
mask?: boolean;
|
|
158
158
|
maskClosable?: boolean;
|
|
159
159
|
maskFixed?: boolean;
|
|
@@ -161,7 +161,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
161
161
|
okText?: string;
|
|
162
162
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
163
163
|
visible?: boolean;
|
|
164
|
-
width?: number;
|
|
164
|
+
width?: string | number;
|
|
165
165
|
zIndex?: number;
|
|
166
166
|
getPopupContainer?: () => HTMLElement;
|
|
167
167
|
closeOnEsc?: boolean;
|
|
@@ -194,7 +194,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
194
194
|
confirmLoading?: boolean;
|
|
195
195
|
cancelLoading?: boolean;
|
|
196
196
|
hasCancel?: boolean;
|
|
197
|
-
height?: number;
|
|
197
|
+
height?: string | number;
|
|
198
198
|
mask?: boolean;
|
|
199
199
|
maskClosable?: boolean;
|
|
200
200
|
maskFixed?: boolean;
|
|
@@ -202,7 +202,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
202
202
|
okText?: string;
|
|
203
203
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
204
204
|
visible?: boolean;
|
|
205
|
-
width?: number;
|
|
205
|
+
width?: string | number;
|
|
206
206
|
zIndex?: number;
|
|
207
207
|
getPopupContainer?: () => HTMLElement;
|
|
208
208
|
closeOnEsc?: boolean;
|
|
@@ -36,8 +36,8 @@ export interface NavProps extends BaseProps {
|
|
|
36
36
|
defaultIsCollapsed?: boolean;
|
|
37
37
|
defaultOpenKeys?: React.ReactText[];
|
|
38
38
|
defaultSelectedKeys?: React.ReactText[];
|
|
39
|
-
footer?: React.ReactNode |
|
|
40
|
-
header?: React.ReactNode |
|
|
39
|
+
footer?: React.ReactNode | NavFooterProps;
|
|
40
|
+
header?: React.ReactNode | NavHeaderProps;
|
|
41
41
|
isCollapsed?: boolean;
|
|
42
42
|
items?: NavItems;
|
|
43
43
|
limitIndent?: boolean;
|
package/lib/es/select/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare type RenderMultipleSelectedItemFn = (optionNode: Record<string, a
|
|
|
48
48
|
};
|
|
49
49
|
export declare type RenderSelectedItemFn = RenderSingleSelectedItemFn | RenderMultipleSelectedItemFn;
|
|
50
50
|
export declare type SelectProps = {
|
|
51
|
+
id?: string;
|
|
51
52
|
autoFocus?: boolean;
|
|
52
53
|
arrowIcon?: React.ReactNode;
|
|
53
54
|
defaultValue?: string | number | any[] | Record<string, any>;
|
package/lib/es/select/index.js
CHANGED
|
@@ -818,6 +818,7 @@ class Select extends BaseComponent {
|
|
|
818
818
|
multiple,
|
|
819
819
|
filter,
|
|
820
820
|
style,
|
|
821
|
+
id,
|
|
821
822
|
size,
|
|
822
823
|
className,
|
|
823
824
|
validateStatus,
|
|
@@ -891,6 +892,7 @@ class Select extends BaseComponent {
|
|
|
891
892
|
ref: ref => this.triggerRef.current = ref,
|
|
892
893
|
onClick: e => this.foundation.handleClick(e),
|
|
893
894
|
style: style,
|
|
895
|
+
id: id,
|
|
894
896
|
tabIndex: tabIndex,
|
|
895
897
|
onMouseEnter: this.onMouseEnter,
|
|
896
898
|
onMouseLeave: this.onMouseLeave,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
|
|
4
4
|
export interface TimelineItemProps {
|
|
5
5
|
color?: string;
|
|
6
|
-
time?:
|
|
6
|
+
time?: React.ReactNode;
|
|
7
7
|
type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
8
8
|
dot?: React.ReactNode;
|
|
9
9
|
extra?: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ export interface TimelineItemProps {
|
|
|
14
14
|
export default class Item extends PureComponent<TimelineItemProps> {
|
|
15
15
|
static propTypes: {
|
|
16
16
|
color: PropTypes.Requireable<string>;
|
|
17
|
-
time: PropTypes.Requireable<
|
|
17
|
+
time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
18
18
|
type: PropTypes.Requireable<string>;
|
|
19
19
|
dot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
20
|
extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
package/lib/es/timeline/item.js
CHANGED
|
@@ -40,9 +40,9 @@ export default class Item extends PureComponent {
|
|
|
40
40
|
className: dotCls
|
|
41
41
|
}, dotStyle), dot), /*#__PURE__*/React.createElement("div", {
|
|
42
42
|
className: "".concat(prefixCls, "-content")
|
|
43
|
-
}, children, extra
|
|
43
|
+
}, children, extra && /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
className: "".concat(prefixCls, "-content-extra")
|
|
45
|
-
}, extra)
|
|
45
|
+
}, extra), time && /*#__PURE__*/React.createElement("div", {
|
|
46
46
|
className: "".concat(prefixCls, "-content-time")
|
|
47
47
|
}, time)));
|
|
48
48
|
}
|
|
@@ -50,7 +50,7 @@ export default class Item extends PureComponent {
|
|
|
50
50
|
}
|
|
51
51
|
Item.propTypes = {
|
|
52
52
|
color: PropTypes.string,
|
|
53
|
-
time: PropTypes.
|
|
53
|
+
time: PropTypes.node,
|
|
54
54
|
type: PropTypes.oneOf(strings.ITEM_TYPE),
|
|
55
55
|
dot: PropTypes.node,
|
|
56
56
|
extra: PropTypes.node,
|
package/lib/es/tree/treeNode.js
CHANGED
package/modal/Modal.tsx
CHANGED
|
@@ -47,8 +47,8 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
47
47
|
closable: PropTypes.bool,
|
|
48
48
|
centered: PropTypes.bool,
|
|
49
49
|
visible: PropTypes.bool,
|
|
50
|
-
width: PropTypes.number,
|
|
51
|
-
height: PropTypes.number,
|
|
50
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
51
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
52
52
|
confirmLoading: PropTypes.bool,
|
|
53
53
|
cancelLoading: PropTypes.bool,
|
|
54
54
|
okText: PropTypes.string,
|
|
@@ -264,9 +264,9 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
264
264
|
if (!visible && !hidden) {
|
|
265
265
|
this.foundation.toggleHidden(true, () => this.foundation.afterClose());
|
|
266
266
|
} else if (visible && this.state.hidden) {
|
|
267
|
-
this.foundation.toggleHidden(false)
|
|
267
|
+
this.foundation.toggleHidden(false);
|
|
268
268
|
}
|
|
269
|
-
}
|
|
269
|
+
};
|
|
270
270
|
|
|
271
271
|
renderFooter = (): ReactNode => {
|
|
272
272
|
const {
|