@douyinfe/semi-ui 2.13.0 → 2.14.0-beta.1
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/autoComplete/_story/CustomTrigger/index.jsx +1 -1
- package/avatar/_story/avatar.stories.js +62 -5
- package/avatar/avatarGroup.tsx +16 -4
- package/avatar/index.tsx +88 -17
- package/backtop/index.tsx +11 -7
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +5 -5
- package/breadcrumb/index.tsx +5 -3
- package/button/Button.tsx +10 -8
- package/calendar/_story/calendar.stories.js +125 -1
- package/card/index.tsx +43 -41
- package/carousel/CarouselArrow.tsx +2 -0
- package/carousel/index.tsx +1 -0
- package/cascader/_story/cascader.stories.js +21 -0
- package/cascader/index.tsx +99 -120
- package/cascader/item.tsx +1 -1
- package/checkbox/checkbox.tsx +13 -2
- package/collapsible/index.tsx +8 -1
- package/datePicker/dateInput.tsx +1 -0
- package/datePicker/datePicker.tsx +13 -5
- package/dist/css/semi.css +51 -35
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +933 -530
- 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/divider/index.tsx +8 -4
- package/dropdown/index.tsx +1 -1
- package/empty/index.tsx +13 -5
- package/form/hoc/withField.tsx +1 -1
- package/form/label.tsx +1 -1
- package/grid/col.tsx +1 -1
- package/grid/row.tsx +1 -1
- package/iconButton/index.tsx +2 -1
- package/input/_story/input.stories.js +32 -3
- package/input/index.tsx +45 -23
- package/input/inputGroup.tsx +3 -1
- package/input/textarea.tsx +2 -14
- package/lib/cjs/_base/base.css +14 -14
- package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
- package/lib/cjs/avatar/avatarGroup.js +36 -9
- package/lib/cjs/avatar/index.d.ts +5 -0
- package/lib/cjs/avatar/index.js +121 -41
- package/lib/cjs/backtop/index.js +2 -1
- package/lib/cjs/badge/index.js +2 -1
- package/lib/cjs/banner/index.js +9 -4
- package/lib/cjs/breadcrumb/index.js +4 -3
- package/lib/cjs/button/Button.js +13 -3
- package/lib/cjs/card/index.js +10 -5
- package/lib/cjs/carousel/CarouselArrow.js +6 -2
- package/lib/cjs/carousel/index.js +2 -1
- package/lib/cjs/cascader/index.js +11 -6
- package/lib/cjs/cascader/item.js +2 -1
- package/lib/cjs/checkbox/checkbox.js +6 -2
- package/lib/cjs/collapsible/index.js +2 -1
- package/lib/cjs/datePicker/dateInput.js +2 -1
- package/lib/cjs/datePicker/datePicker.js +4 -2
- package/lib/cjs/divider/index.js +2 -1
- package/lib/cjs/dropdown/index.js +2 -1
- package/lib/cjs/empty/index.js +8 -4
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/hoc/withField.js +2 -1
- package/lib/cjs/form/label.js +2 -1
- package/lib/cjs/grid/col.js +2 -1
- package/lib/cjs/grid/row.js +2 -1
- package/lib/cjs/iconButton/index.js +3 -1
- package/lib/cjs/input/index.d.ts +0 -1
- package/lib/cjs/input/index.js +41 -36
- package/lib/cjs/input/inputGroup.js +2 -3
- package/lib/cjs/input/textarea.js +8 -15
- package/lib/cjs/list/index.js +6 -3
- package/lib/cjs/modal/ConfirmModal.js +2 -1
- package/lib/cjs/modal/Modal.js +6 -2
- package/lib/cjs/modal/ModalContent.js +13 -6
- package/lib/cjs/notification/notice.js +6 -3
- package/lib/cjs/pagination/index.js +4 -2
- package/lib/cjs/popconfirm/index.js +6 -3
- package/lib/cjs/radio/radio.d.ts +4 -0
- package/lib/cjs/radio/radio.js +32 -9
- package/lib/cjs/radio/radioInner.d.ts +6 -0
- package/lib/cjs/radio/radioInner.js +13 -4
- package/lib/cjs/rating/item.js +2 -1
- package/lib/cjs/scrollList/index.js +6 -3
- package/lib/cjs/select/index.js +10 -4
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
- package/lib/cjs/skeleton/index.js +3 -1
- package/lib/cjs/space/index.js +2 -1
- package/lib/cjs/spin/index.js +7 -3
- package/lib/cjs/switch/index.js +6 -4
- package/lib/cjs/table/Table.js +6 -3
- package/lib/cjs/tabs/TabBar.js +2 -1
- package/lib/cjs/tabs/TabPane.js +5 -2
- package/lib/cjs/tagInput/index.js +25 -15
- package/lib/cjs/timePicker/Combobox.js +3 -1
- package/lib/cjs/timePicker/TimePicker.js +2 -0
- package/lib/cjs/toast/toast.js +6 -3
- package/lib/cjs/tooltip/index.js +6 -1
- package/lib/cjs/transfer/index.js +2 -1
- package/lib/cjs/tree/treeNode.js +2 -1
- package/lib/cjs/treeSelect/index.js +10 -3
- package/lib/cjs/typography/base.js +2 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/cjs/upload/index.js +13 -6
- package/lib/es/_base/base.css +14 -14
- package/lib/es/avatar/avatarGroup.d.ts +1 -1
- package/lib/es/avatar/avatarGroup.js +37 -9
- package/lib/es/avatar/index.d.ts +5 -0
- package/lib/es/avatar/index.js +119 -38
- package/lib/es/backtop/index.js +2 -1
- package/lib/es/badge/index.js +2 -1
- package/lib/es/banner/index.js +9 -4
- package/lib/es/breadcrumb/index.js +4 -3
- package/lib/es/button/Button.js +11 -3
- package/lib/es/card/index.js +10 -5
- package/lib/es/carousel/CarouselArrow.js +6 -2
- package/lib/es/carousel/index.js +2 -1
- package/lib/es/cascader/index.js +11 -6
- package/lib/es/cascader/item.js +2 -1
- package/lib/es/checkbox/checkbox.js +6 -2
- package/lib/es/collapsible/index.js +2 -1
- package/lib/es/datePicker/dateInput.js +2 -1
- package/lib/es/datePicker/datePicker.js +4 -2
- package/lib/es/divider/index.js +2 -1
- package/lib/es/dropdown/index.js +2 -1
- package/lib/es/empty/index.js +8 -4
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +2 -1
- package/lib/es/form/label.js +2 -1
- package/lib/es/grid/col.js +2 -1
- package/lib/es/grid/row.js +2 -1
- package/lib/es/iconButton/index.js +3 -1
- package/lib/es/input/index.d.ts +0 -1
- package/lib/es/input/index.js +41 -36
- package/lib/es/input/inputGroup.js +2 -3
- package/lib/es/input/textarea.js +8 -15
- package/lib/es/list/index.js +6 -3
- package/lib/es/modal/ConfirmModal.js +2 -1
- package/lib/es/modal/Modal.js +6 -2
- package/lib/es/modal/ModalContent.js +13 -6
- package/lib/es/notification/notice.js +6 -3
- package/lib/es/pagination/index.js +4 -2
- package/lib/es/popconfirm/index.js +6 -3
- package/lib/es/radio/radio.d.ts +4 -0
- package/lib/es/radio/radio.js +32 -9
- package/lib/es/radio/radioInner.d.ts +6 -0
- package/lib/es/radio/radioInner.js +13 -4
- package/lib/es/rating/item.js +2 -1
- package/lib/es/scrollList/index.js +6 -3
- package/lib/es/select/index.js +10 -4
- package/lib/es/select/option.js +2 -1
- package/lib/es/sideSheet/SideSheetContent.js +6 -3
- package/lib/es/skeleton/index.js +3 -1
- package/lib/es/space/index.js +2 -1
- package/lib/es/spin/index.js +7 -3
- package/lib/es/switch/index.js +6 -4
- package/lib/es/table/Table.js +6 -3
- package/lib/es/tabs/TabBar.js +2 -1
- package/lib/es/tabs/TabPane.js +5 -2
- package/lib/es/tagInput/index.js +25 -15
- package/lib/es/timePicker/Combobox.js +3 -1
- package/lib/es/timePicker/TimePicker.js +2 -0
- package/lib/es/toast/toast.js +6 -3
- package/lib/es/tooltip/index.js +6 -1
- package/lib/es/transfer/index.js +2 -1
- package/lib/es/tree/treeNode.js +2 -1
- package/lib/es/treeSelect/index.js +10 -3
- package/lib/es/typography/base.js +2 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/lib/es/upload/index.js +13 -6
- package/list/index.tsx +16 -4
- package/modal/ConfirmModal.tsx +1 -1
- package/modal/Modal.tsx +2 -0
- package/modal/ModalContent.tsx +27 -14
- package/notification/notice.tsx +16 -4
- package/package.json +8 -8
- package/pagination/index.tsx +16 -2
- package/popconfirm/index.tsx +11 -3
- package/radio/_story/radio.stories.js +9 -6
- package/radio/radio.tsx +37 -7
- package/radio/radioInner.tsx +11 -2
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +19 -3
- package/select/index.tsx +13 -4
- package/select/option.tsx +5 -1
- package/sideSheet/SideSheetContent.tsx +3 -3
- package/skeleton/index.tsx +1 -1
- package/space/index.tsx +1 -1
- package/spin/index.tsx +15 -9
- package/switch/index.tsx +9 -14
- package/table/Table.tsx +5 -3
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +9 -4
- package/tagInput/index.tsx +23 -4
- package/timePicker/Combobox.tsx +6 -1
- package/timePicker/TimePicker.tsx +1 -0
- package/toast/toast.tsx +3 -3
- package/tooltip/index.tsx +4 -1
- package/transfer/index.tsx +1 -0
- package/tree/treeNode.tsx +1 -1
- package/treeSelect/_story/treeSelect.stories.js +161 -2
- package/treeSelect/index.tsx +17 -3
- package/typography/base.tsx +1 -1
- package/upload/index.tsx +107 -38
- package/yarn-error.log +26235 -0
package/lib/es/divider/index.js
CHANGED
|
@@ -61,7 +61,8 @@ const Divider = props => {
|
|
|
61
61
|
className: dividerClassNames,
|
|
62
62
|
style: _Object$assign(_Object$assign({}, overrideDefaultStyle), style)
|
|
63
63
|
}), children && layout === 'horizontal' ? typeof children === 'string' ? /*#__PURE__*/React.createElement("span", {
|
|
64
|
-
className: "".concat(prefixCls, "-divider_inner-text")
|
|
64
|
+
className: "".concat(prefixCls, "-divider_inner-text"),
|
|
65
|
+
"x-semi-prop": "children"
|
|
65
66
|
}, children) : children : null);
|
|
66
67
|
};
|
|
67
68
|
|
package/lib/es/dropdown/index.js
CHANGED
|
@@ -86,7 +86,8 @@ class Dropdown extends BaseComponent {
|
|
|
86
86
|
className: className,
|
|
87
87
|
style: style
|
|
88
88
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: "".concat(prefixCls, "-content")
|
|
89
|
+
className: "".concat(prefixCls, "-content"),
|
|
90
|
+
"x-semi-prop": "render"
|
|
90
91
|
}, content)));
|
|
91
92
|
}
|
|
92
93
|
|
package/lib/es/empty/index.js
CHANGED
|
@@ -101,15 +101,19 @@ export default class Empty extends BaseComponent {
|
|
|
101
101
|
style: style
|
|
102
102
|
}, /*#__PURE__*/React.createElement("div", {
|
|
103
103
|
className: "".concat(prefixCls, "-image"),
|
|
104
|
-
style: imageStyle
|
|
104
|
+
style: imageStyle,
|
|
105
|
+
"x-semi-prop": "image,darkModeImage"
|
|
105
106
|
}, imageNode), /*#__PURE__*/React.createElement("div", {
|
|
106
107
|
className: "".concat(prefixCls, "-content")
|
|
107
108
|
}, title ? /*#__PURE__*/React.createElement(Typography.Title, _Object$assign({}, titleProps, {
|
|
108
|
-
className: "".concat(prefixCls, "-title")
|
|
109
|
+
className: "".concat(prefixCls, "-title"),
|
|
110
|
+
"x-semi-prop": "title"
|
|
109
111
|
}), title) : null, description ? /*#__PURE__*/React.createElement("div", {
|
|
110
|
-
className: "".concat(prefixCls, "-description")
|
|
112
|
+
className: "".concat(prefixCls, "-description"),
|
|
113
|
+
"x-semi-prop": "description"
|
|
111
114
|
}, description) : null, children ? /*#__PURE__*/React.createElement("div", {
|
|
112
|
-
className: "".concat(prefixCls, "-footer")
|
|
115
|
+
className: "".concat(prefixCls, "-footer"),
|
|
116
|
+
"x-semi-prop": "children"
|
|
113
117
|
}, children) : null));
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -125,7 +125,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
125
125
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
128
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
129
129
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
130
130
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
131
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
73
73
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
76
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
77
77
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
78
78
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
79
79
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
@@ -426,7 +426,8 @@ function withField(Component, opts) {
|
|
|
426
426
|
});
|
|
427
427
|
const extraContent = extraText ? /*#__PURE__*/React.createElement("div", {
|
|
428
428
|
className: extraCls,
|
|
429
|
-
id: extraTextId
|
|
429
|
+
id: extraTextId,
|
|
430
|
+
"x-semi-prop": "extraText"
|
|
430
431
|
}, extraText) : null;
|
|
431
432
|
|
|
432
433
|
let newProps = _Object$assign(_Object$assign({
|
package/lib/es/form/label.js
CHANGED
|
@@ -29,7 +29,8 @@ export default class Label extends PureComponent {
|
|
|
29
29
|
const labelStyle = style ? style : {};
|
|
30
30
|
width ? labelStyle.width = width : null;
|
|
31
31
|
const textContent = /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: "".concat(prefixCls, "-field-label-text")
|
|
32
|
+
className: "".concat(prefixCls, "-field-label-text"),
|
|
33
|
+
"x-semi-prop": "label"
|
|
33
34
|
}, typeof text !== 'undefined' ? text : children);
|
|
34
35
|
const contentWithExtra = /*#__PURE__*/React.createElement(React.Fragment, null, textContent, /*#__PURE__*/React.createElement("div", {
|
|
35
36
|
className: "".concat(prefixCls, "-field-label-extra")
|
package/lib/es/grid/col.js
CHANGED
|
@@ -97,7 +97,8 @@ class Col extends React.Component {
|
|
|
97
97
|
} : {}), style);
|
|
98
98
|
return /*#__PURE__*/React.createElement("div", _Object$assign({}, others, {
|
|
99
99
|
style: style,
|
|
100
|
-
className: classes
|
|
100
|
+
className: classes,
|
|
101
|
+
"x-semi-prop": "children"
|
|
101
102
|
}), children);
|
|
102
103
|
}
|
|
103
104
|
|
package/lib/es/grid/row.js
CHANGED
|
@@ -71,8 +71,10 @@ class IconButton extends PureComponent {
|
|
|
71
71
|
["".concat(prefixCls, "-content-left")]: iconPosition === 'right',
|
|
72
72
|
["".concat(prefixCls, "-content-right")]: iconPosition === 'left'
|
|
73
73
|
});
|
|
74
|
+
const xSemiProp = this.props['x-semi-children-alias'] || 'children';
|
|
74
75
|
const children = originChildren != null ? /*#__PURE__*/React.createElement("span", {
|
|
75
|
-
className: btnTextCls
|
|
76
|
+
className: btnTextCls,
|
|
77
|
+
"x-semi-prop": xSemiProp
|
|
76
78
|
}, originChildren) : null;
|
|
77
79
|
|
|
78
80
|
if (iconPosition === 'left') {
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -161,7 +161,6 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
161
161
|
static getDerivedStateFromProps(props: InputProps, state: InputState): Partial<InputState>;
|
|
162
162
|
componentDidUpdate(prevProps: InputProps): void;
|
|
163
163
|
handleClear: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
164
|
-
handleClearEnterPress: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
165
164
|
handleClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
166
165
|
handleMouseOver: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
167
166
|
handleMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
package/lib/es/input/index.js
CHANGED
|
@@ -41,10 +41,6 @@ class Input extends BaseComponent {
|
|
|
41
41
|
this.foundation.handleClear(e);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
this.handleClearEnterPress = e => {
|
|
45
|
-
this.foundation.handleClearEnterPress(e);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
44
|
this.handleClick = e => {
|
|
49
45
|
this.foundation.handleClick(e);
|
|
50
46
|
};
|
|
@@ -183,7 +179,8 @@ class Input extends BaseComponent {
|
|
|
183
179
|
["".concat(prefixCls, "-prepend-icon")]: isSemiIcon(addonBefore)
|
|
184
180
|
});
|
|
185
181
|
return /*#__PURE__*/React.createElement("div", {
|
|
186
|
-
className: prefixWrapperCls
|
|
182
|
+
className: prefixWrapperCls,
|
|
183
|
+
"x-semi-prop": "addonBefore"
|
|
187
184
|
}, addonBefore);
|
|
188
185
|
}
|
|
189
186
|
|
|
@@ -202,7 +199,8 @@ class Input extends BaseComponent {
|
|
|
202
199
|
["".concat(prefixCls, "-append-icon")]: isSemiIcon(addonAfter)
|
|
203
200
|
});
|
|
204
201
|
return /*#__PURE__*/React.createElement("div", {
|
|
205
|
-
className: prefixWrapperCls
|
|
202
|
+
className: prefixWrapperCls,
|
|
203
|
+
"x-semi-prop": "addonAfter"
|
|
206
204
|
}, addonAfter);
|
|
207
205
|
}
|
|
208
206
|
|
|
@@ -214,14 +212,14 @@ class Input extends BaseComponent {
|
|
|
214
212
|
const allowClear = this.foundation.isAllowClear(); // use onMouseDown to fix issue 1203
|
|
215
213
|
|
|
216
214
|
if (allowClear) {
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
"
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
return (
|
|
216
|
+
/*#__PURE__*/
|
|
217
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
218
|
+
React.createElement("div", {
|
|
219
|
+
className: clearCls,
|
|
220
|
+
onMouseDown: this.handleClear
|
|
221
|
+
}, /*#__PURE__*/React.createElement(IconClear, null))
|
|
222
|
+
);
|
|
225
223
|
}
|
|
226
224
|
|
|
227
225
|
return null;
|
|
@@ -229,9 +227,6 @@ class Input extends BaseComponent {
|
|
|
229
227
|
|
|
230
228
|
renderModeBtn() {
|
|
231
229
|
const {
|
|
232
|
-
value,
|
|
233
|
-
isFocus,
|
|
234
|
-
isHovering,
|
|
235
230
|
eyeClosed
|
|
236
231
|
} = this.state;
|
|
237
232
|
const {
|
|
@@ -239,8 +234,9 @@ class Input extends BaseComponent {
|
|
|
239
234
|
disabled
|
|
240
235
|
} = this.props;
|
|
241
236
|
const modeCls = cls("".concat(prefixCls, "-modebtn"));
|
|
242
|
-
const modeIcon = eyeClosed ? /*#__PURE__*/React.createElement(IconEyeClosedSolid, null) : /*#__PURE__*/React.createElement(IconEyeOpened, null);
|
|
243
|
-
|
|
237
|
+
const modeIcon = eyeClosed ? /*#__PURE__*/React.createElement(IconEyeClosedSolid, null) : /*#__PURE__*/React.createElement(IconEyeOpened, null); // alway show password button for a11y
|
|
238
|
+
|
|
239
|
+
const showModeBtn = mode === 'password' && !disabled;
|
|
244
240
|
const ariaLabel = eyeClosed ? 'Show password' : 'Hidden password';
|
|
245
241
|
|
|
246
242
|
if (showModeBtn) {
|
|
@@ -276,14 +272,18 @@ class Input extends BaseComponent {
|
|
|
276
272
|
["".concat(prefixCls, "-inset-label")]: insetLabel,
|
|
277
273
|
["".concat(prefixCls, "-prefix-text")]: labelNode && _isString(labelNode),
|
|
278
274
|
["".concat(prefixCls, "-prefix-icon")]: isSemiIcon(labelNode)
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
275
|
+
});
|
|
276
|
+
return (
|
|
277
|
+
/*#__PURE__*/
|
|
278
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
279
|
+
React.createElement("div", {
|
|
280
|
+
className: prefixWrapperCls,
|
|
281
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
282
|
+
onClick: this.handleClickPrefixOrSuffix,
|
|
283
|
+
id: insetLabelId,
|
|
284
|
+
"x-semi-prop": "prefix,insetLabel"
|
|
285
|
+
}, labelNode)
|
|
286
|
+
);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
showClearBtn() {
|
|
@@ -314,13 +314,17 @@ class Input extends BaseComponent {
|
|
|
314
314
|
["".concat(prefixCls, "-suffix-text")]: suffix && _isString(suffix),
|
|
315
315
|
["".concat(prefixCls, "-suffix-icon")]: isSemiIcon(suffix),
|
|
316
316
|
["".concat(prefixCls, "-suffix-hidden")]: suffixAllowClear && Boolean(hideSuffix)
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
317
|
+
});
|
|
318
|
+
return (
|
|
319
|
+
/*#__PURE__*/
|
|
320
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
321
|
+
React.createElement("div", {
|
|
322
|
+
className: suffixWrapperCls,
|
|
323
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
324
|
+
onClick: this.handleClickPrefixOrSuffix,
|
|
325
|
+
"x-semi-prop": "suffix"
|
|
326
|
+
}, suffix)
|
|
327
|
+
);
|
|
324
328
|
}
|
|
325
329
|
|
|
326
330
|
render() {
|
|
@@ -333,6 +337,7 @@ class Input extends BaseComponent {
|
|
|
333
337
|
autofocus,
|
|
334
338
|
className,
|
|
335
339
|
disabled,
|
|
340
|
+
defaultValue,
|
|
336
341
|
placeholder,
|
|
337
342
|
prefix,
|
|
338
343
|
mode,
|
|
@@ -353,7 +358,7 @@ class Input extends BaseComponent {
|
|
|
353
358
|
maxLength,
|
|
354
359
|
getValueLength
|
|
355
360
|
} = _a,
|
|
356
|
-
rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
|
|
361
|
+
rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
|
|
357
362
|
|
|
358
363
|
const {
|
|
359
364
|
value,
|
|
@@ -421,7 +426,7 @@ class Input extends BaseComponent {
|
|
|
421
426
|
}
|
|
422
427
|
|
|
423
428
|
if (validateStatus === 'error') {
|
|
424
|
-
inputProps['aria-invalid'] =
|
|
429
|
+
inputProps['aria-invalid'] = 'true';
|
|
425
430
|
}
|
|
426
431
|
|
|
427
432
|
return (
|
|
@@ -53,13 +53,12 @@ export default class inputGroup extends BaseComponent {
|
|
|
53
53
|
|
|
54
54
|
const defaultName = 'input-group';
|
|
55
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
role: "group",
|
|
57
|
-
"aria-label": "Input group",
|
|
58
|
-
"aria-disabled": this.props.disabled,
|
|
59
56
|
className: groupWrapperCls
|
|
60
57
|
}, label && label.text ? /*#__PURE__*/React.createElement(Label, _Object$assign({
|
|
61
58
|
name: defaultName
|
|
62
59
|
}, label)) : null, /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
role: "group",
|
|
61
|
+
"aria-disabled": this.props.disabled,
|
|
63
62
|
id: label && label.name || defaultName,
|
|
64
63
|
className: groupCls,
|
|
65
64
|
style: this.props.style,
|
package/lib/es/input/textarea.js
CHANGED
|
@@ -37,10 +37,6 @@ class TextArea extends BaseComponent {
|
|
|
37
37
|
this.foundation.handleClear(e);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
this.handleClearEnterPress = e => {
|
|
41
|
-
this.foundation.handleClearEnterPress(e);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
40
|
this.setRef = node => {
|
|
45
41
|
this.libRef.current = node;
|
|
46
42
|
const {
|
|
@@ -165,14 +161,14 @@ class TextArea extends BaseComponent {
|
|
|
165
161
|
});
|
|
166
162
|
|
|
167
163
|
if (showClear) {
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
return (
|
|
165
|
+
/*#__PURE__*/
|
|
166
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
167
|
+
React.createElement("div", {
|
|
168
|
+
className: clearCls,
|
|
169
|
+
onClick: this.handleClear
|
|
170
|
+
}, /*#__PURE__*/React.createElement(IconClear, null))
|
|
171
|
+
);
|
|
176
172
|
}
|
|
177
173
|
|
|
178
174
|
return null;
|
|
@@ -197,9 +193,6 @@ class TextArea extends BaseComponent {
|
|
|
197
193
|
["".concat(prefixCls, "-textarea-counter-exceed")]: current > total
|
|
198
194
|
});
|
|
199
195
|
counter = /*#__PURE__*/React.createElement("div", {
|
|
200
|
-
"aria-label": "Textarea value length counter",
|
|
201
|
-
"aria-valuemax": maxCount,
|
|
202
|
-
"aria-valuenow": current,
|
|
203
196
|
className: countCls
|
|
204
197
|
}, current, total ? '/' : null, total);
|
|
205
198
|
} else {
|
package/lib/es/list/index.js
CHANGED
|
@@ -27,7 +27,8 @@ class List extends BaseComponent {
|
|
|
27
27
|
|
|
28
28
|
if (emptyContent) {
|
|
29
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "".concat(cssClasses.PREFIX, "-empty")
|
|
30
|
+
className: "".concat(cssClasses.PREFIX, "-empty"),
|
|
31
|
+
"x-semi-prop": "emptyContent"
|
|
31
32
|
}, emptyContent);
|
|
32
33
|
} else {
|
|
33
34
|
return /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
@@ -115,7 +116,8 @@ class List extends BaseComponent {
|
|
|
115
116
|
className: wrapperCls,
|
|
116
117
|
style: style
|
|
117
118
|
}, header ? /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: "".concat(cssClasses.PREFIX, "-header")
|
|
119
|
+
className: "".concat(cssClasses.PREFIX, "-header"),
|
|
120
|
+
"x-semi-prop": "header"
|
|
119
121
|
}, header) : null, /*#__PURE__*/React.createElement(ListContext.Provider, {
|
|
120
122
|
value: {
|
|
121
123
|
grid,
|
|
@@ -126,7 +128,8 @@ class List extends BaseComponent {
|
|
|
126
128
|
spinning: loading,
|
|
127
129
|
size: "large"
|
|
128
130
|
}, this.wrapChildren(childrenList, children))), footer ? /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: "".concat(cssClasses.PREFIX, "-footer")
|
|
131
|
+
className: "".concat(cssClasses.PREFIX, "-footer"),
|
|
132
|
+
"x-semi-prop": "footer"
|
|
130
133
|
}, footer) : null, loadMore ? loadMore : null);
|
|
131
134
|
}
|
|
132
135
|
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -80,7 +80,9 @@ class Modal extends BaseComponent {
|
|
|
80
80
|
loading: cancelLoading,
|
|
81
81
|
type: "tertiary",
|
|
82
82
|
autoFocus: true
|
|
83
|
-
}, this.props.cancelButtonProps
|
|
83
|
+
}, this.props.cancelButtonProps, {
|
|
84
|
+
"x-semi-children-alias": "cancelText"
|
|
85
|
+
}), cancelText || locale.cancel);
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
88
|
|
|
@@ -92,7 +94,9 @@ class Modal extends BaseComponent {
|
|
|
92
94
|
theme: "solid",
|
|
93
95
|
loading: confirmLoading,
|
|
94
96
|
onClick: this.handleOk
|
|
95
|
-
}, this.props.okButtonProps
|
|
97
|
+
}, this.props.okButtonProps, {
|
|
98
|
+
"x-semi-children-alias": "okText"
|
|
99
|
+
}), okText || locale.confirm)));
|
|
96
100
|
}; // getDialog = () => {
|
|
97
101
|
// const {
|
|
98
102
|
// footer,
|
|
@@ -90,7 +90,9 @@ export default class ModalContent extends BaseComponent {
|
|
|
90
90
|
let closer;
|
|
91
91
|
|
|
92
92
|
if (closable) {
|
|
93
|
-
const iconType = closeIcon || /*#__PURE__*/React.createElement(IconClose,
|
|
93
|
+
const iconType = closeIcon || /*#__PURE__*/React.createElement(IconClose, {
|
|
94
|
+
"x-semi-prop": "closeIcon"
|
|
95
|
+
});
|
|
94
96
|
closer = /*#__PURE__*/React.createElement(Button, {
|
|
95
97
|
"aria-label": "close",
|
|
96
98
|
className: "".concat(cssClasses.DIALOG, "-close"),
|
|
@@ -111,7 +113,8 @@ export default class ModalContent extends BaseComponent {
|
|
|
111
113
|
icon
|
|
112
114
|
} = this.props;
|
|
113
115
|
return icon ? /*#__PURE__*/React.createElement("span", {
|
|
114
|
-
className: "".concat(cssClasses.DIALOG, "-icon-wrapper")
|
|
116
|
+
className: "".concat(cssClasses.DIALOG, "-icon-wrapper"),
|
|
117
|
+
"x-semi-prop": "icon"
|
|
115
118
|
}, icon) : null;
|
|
116
119
|
};
|
|
117
120
|
|
|
@@ -130,7 +133,8 @@ export default class ModalContent extends BaseComponent {
|
|
|
130
133
|
}, icon, /*#__PURE__*/React.createElement(Typography.Title, {
|
|
131
134
|
heading: 5,
|
|
132
135
|
className: "".concat(cssClasses.DIALOG, "-title"),
|
|
133
|
-
id: "".concat(cssClasses.DIALOG, "-title")
|
|
136
|
+
id: "".concat(cssClasses.DIALOG, "-title"),
|
|
137
|
+
"x-semi-prop": "title"
|
|
134
138
|
}, title), closer);
|
|
135
139
|
};
|
|
136
140
|
|
|
@@ -149,12 +153,14 @@ export default class ModalContent extends BaseComponent {
|
|
|
149
153
|
return hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
150
154
|
className: bodyCls,
|
|
151
155
|
id: "".concat(cssClasses.DIALOG, "-body"),
|
|
152
|
-
style: bodyStyle
|
|
156
|
+
style: bodyStyle,
|
|
157
|
+
"x-semi-prop": "children"
|
|
153
158
|
}, children) : /*#__PURE__*/React.createElement("div", {
|
|
154
159
|
className: "".concat(cssClasses.DIALOG, "-body-wrapper")
|
|
155
160
|
}, icon, /*#__PURE__*/React.createElement("div", {
|
|
156
161
|
className: bodyCls,
|
|
157
|
-
style: bodyStyle
|
|
162
|
+
style: bodyStyle,
|
|
163
|
+
"x-semi-prop": "children"
|
|
158
164
|
}, children), closer);
|
|
159
165
|
};
|
|
160
166
|
|
|
@@ -186,7 +192,8 @@ export default class ModalContent extends BaseComponent {
|
|
|
186
192
|
const body = this.renderBody();
|
|
187
193
|
const header = this.renderHeader();
|
|
188
194
|
const footer = props.footer ? /*#__PURE__*/React.createElement("div", {
|
|
189
|
-
className: "".concat(cssClasses.DIALOG, "-footer")
|
|
195
|
+
className: "".concat(cssClasses.DIALOG, "-footer"),
|
|
196
|
+
"x-semi-prop": "footer"
|
|
190
197
|
}, props.footer) : null;
|
|
191
198
|
const dialogElement =
|
|
192
199
|
/*#__PURE__*/
|
|
@@ -115,7 +115,8 @@ class Notice extends BaseComponent {
|
|
|
115
115
|
|
|
116
116
|
if (iconType) {
|
|
117
117
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: iconCls
|
|
118
|
+
className: iconCls,
|
|
119
|
+
"x-semi-prop": "icon"
|
|
119
120
|
}, isSemiIcon(iconType) ? /*#__PURE__*/React.cloneElement(iconType, {
|
|
120
121
|
size: iconType.props.size || 'large'
|
|
121
122
|
}) : iconType);
|
|
@@ -173,9 +174,11 @@ class Notice extends BaseComponent {
|
|
|
173
174
|
className: "".concat(prefixCls, "-content-wrapper")
|
|
174
175
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
175
176
|
id: titleID,
|
|
176
|
-
className: "".concat(prefixCls, "-title")
|
|
177
|
+
className: "".concat(prefixCls, "-title"),
|
|
178
|
+
"x-semi-prop": "title"
|
|
177
179
|
}, title) : '', content ? /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: "".concat(prefixCls, "-content")
|
|
180
|
+
className: "".concat(prefixCls, "-content"),
|
|
181
|
+
"x-semi-prop": "content"
|
|
179
182
|
}, content) : ''), showClose && /*#__PURE__*/React.createElement(Button, {
|
|
180
183
|
className: "".concat(prefixCls, "-icon-close"),
|
|
181
184
|
type: "tertiary",
|
|
@@ -154,7 +154,8 @@ export default class Pagination extends BaseComponent {
|
|
|
154
154
|
"aria-disabled": prevDisabled ? true : false,
|
|
155
155
|
"aria-label": "Previous",
|
|
156
156
|
onClick: e => !prevDisabled && this.foundation.goPrev(e),
|
|
157
|
-
className: preClassName
|
|
157
|
+
className: preClassName,
|
|
158
|
+
"x-semi-prop": "prevText"
|
|
158
159
|
}, prevText || /*#__PURE__*/React.createElement(IconChevronLeft, {
|
|
159
160
|
size: "large"
|
|
160
161
|
}));
|
|
@@ -177,7 +178,8 @@ export default class Pagination extends BaseComponent {
|
|
|
177
178
|
"aria-disabled": nextDisabled ? true : false,
|
|
178
179
|
"aria-label": "Next",
|
|
179
180
|
onClick: e => !nextDisabled && this.foundation.goNext(e),
|
|
180
|
-
className: nextClassName
|
|
181
|
+
className: nextClassName,
|
|
182
|
+
"x-semi-prop": "prevText"
|
|
181
183
|
}, nextText || /*#__PURE__*/React.createElement(IconChevronRight, {
|
|
182
184
|
size: "large"
|
|
183
185
|
}));
|
|
@@ -122,13 +122,16 @@ export default class Popconfirm extends BaseComponent {
|
|
|
122
122
|
}, /*#__PURE__*/React.createElement("div", {
|
|
123
123
|
className: "".concat(prefixCls, "-header")
|
|
124
124
|
}, /*#__PURE__*/React.createElement("i", {
|
|
125
|
-
className: "".concat(prefixCls, "-header-icon")
|
|
125
|
+
className: "".concat(prefixCls, "-header-icon"),
|
|
126
|
+
"x-semi-prop": "icon"
|
|
126
127
|
}, /*#__PURE__*/React.isValidElement(icon) ? icon : null), /*#__PURE__*/React.createElement("div", {
|
|
127
128
|
className: "".concat(prefixCls, "-header-body")
|
|
128
129
|
}, showTitle ? /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: "".concat(prefixCls, "-header-title")
|
|
130
|
+
className: "".concat(prefixCls, "-header-title"),
|
|
131
|
+
"x-semi-prop": "title"
|
|
130
132
|
}, title) : null, showContent ? /*#__PURE__*/React.createElement("div", {
|
|
131
|
-
className: "".concat(prefixCls, "-header-content")
|
|
133
|
+
className: "".concat(prefixCls, "-header-content"),
|
|
134
|
+
"x-semi-prop": "content"
|
|
132
135
|
}, content) : null), /*#__PURE__*/React.createElement(Button, {
|
|
133
136
|
className: "".concat(prefixCls, "-btn-close"),
|
|
134
137
|
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -31,11 +31,13 @@ export declare type RadioProps = {
|
|
|
31
31
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
32
32
|
addonId?: string;
|
|
33
33
|
extraId?: string;
|
|
34
|
+
name?: string;
|
|
34
35
|
};
|
|
35
36
|
export interface RadioState {
|
|
36
37
|
hover?: boolean;
|
|
37
38
|
addonId?: string;
|
|
38
39
|
extraId?: string;
|
|
40
|
+
focusVisible?: boolean;
|
|
39
41
|
}
|
|
40
42
|
export { RadioChangeEvent };
|
|
41
43
|
declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
@@ -84,6 +86,8 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
84
86
|
onChange: (e: RadioChangeEvent) => void;
|
|
85
87
|
handleMouseEnter: (e: React.MouseEvent<HTMLLabelElement>) => void;
|
|
86
88
|
handleMouseLeave: (e: React.MouseEvent<HTMLLabelElement>) => void;
|
|
89
|
+
handleFocusVisible: (event: React.FocusEvent) => void;
|
|
90
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
87
91
|
render(): JSX.Element;
|
|
88
92
|
}
|
|
89
93
|
export default Radio;
|