@douyinfe/semi-ui 2.13.0-beta.0 → 2.14.0-beta.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/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 +103 -122
- 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 +73 -35
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +719 -368
- 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/gulpfile.js +5 -5
- 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 +36 -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 +15 -8
- 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/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 +33 -22
- 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/upload/index.d.ts +1 -1
- package/lib/cjs/upload/index.js +13 -6
- package/lib/es/_base/base.css +36 -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 +15 -8
- 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/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 +31 -22
- 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/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/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +9 -4
- package/tabs/_story/tabs.stories.js +36 -0
- package/tag/_story/tag.stories.js +1 -1
- package/tagInput/index.tsx +32 -15
- 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/_story/upload.stories.js +152 -0
- package/upload/index.tsx +107 -38
package/lib/cjs/grid/col.js
CHANGED
|
@@ -116,7 +116,8 @@ class Col extends _react.default.Component {
|
|
|
116
116
|
} : {}), style);
|
|
117
117
|
return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, others, {
|
|
118
118
|
style: style,
|
|
119
|
-
className: classes
|
|
119
|
+
className: classes,
|
|
120
|
+
"x-semi-prop": "children"
|
|
120
121
|
}), children);
|
|
121
122
|
}
|
|
122
123
|
|
package/lib/cjs/grid/row.js
CHANGED
|
@@ -181,7 +181,8 @@ class Row extends _react.default.Component {
|
|
|
181
181
|
}
|
|
182
182
|
}, /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, otherProps, {
|
|
183
183
|
className: classes,
|
|
184
|
-
style: rowStyle
|
|
184
|
+
style: rowStyle,
|
|
185
|
+
"x-semi-prop": "children"
|
|
185
186
|
}), children));
|
|
186
187
|
}
|
|
187
188
|
|
|
@@ -103,8 +103,10 @@ class IconButton extends _react.PureComponent {
|
|
|
103
103
|
["".concat(prefixCls, "-content-left")]: iconPosition === 'right',
|
|
104
104
|
["".concat(prefixCls, "-content-right")]: iconPosition === 'left'
|
|
105
105
|
});
|
|
106
|
+
const xSemiProp = this.props['x-semi-children-alias'] || 'children';
|
|
106
107
|
const children = originChildren != null ? /*#__PURE__*/_react.default.createElement("span", {
|
|
107
|
-
className: btnTextCls
|
|
108
|
+
className: btnTextCls,
|
|
109
|
+
"x-semi-prop": xSemiProp
|
|
108
110
|
}, originChildren) : null;
|
|
109
111
|
|
|
110
112
|
if (iconPosition === 'left') {
|
package/lib/cjs/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/cjs/input/index.js
CHANGED
|
@@ -68,10 +68,6 @@ class Input extends _baseComponent.default {
|
|
|
68
68
|
this.foundation.handleClear(e);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
this.handleClearEnterPress = e => {
|
|
72
|
-
this.foundation.handleClearEnterPress(e);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
71
|
this.handleClick = e => {
|
|
76
72
|
this.foundation.handleClick(e);
|
|
77
73
|
};
|
|
@@ -210,7 +206,8 @@ class Input extends _baseComponent.default {
|
|
|
210
206
|
["".concat(prefixCls, "-prepend-icon")]: (0, _utils.isSemiIcon)(addonBefore)
|
|
211
207
|
});
|
|
212
208
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
-
className: prefixWrapperCls
|
|
209
|
+
className: prefixWrapperCls,
|
|
210
|
+
"x-semi-prop": "addonBefore"
|
|
214
211
|
}, addonBefore);
|
|
215
212
|
}
|
|
216
213
|
|
|
@@ -229,7 +226,8 @@ class Input extends _baseComponent.default {
|
|
|
229
226
|
["".concat(prefixCls, "-append-icon")]: (0, _utils.isSemiIcon)(addonAfter)
|
|
230
227
|
});
|
|
231
228
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
232
|
-
className: prefixWrapperCls
|
|
229
|
+
className: prefixWrapperCls,
|
|
230
|
+
"x-semi-prop": "addonAfter"
|
|
233
231
|
}, addonAfter);
|
|
234
232
|
}
|
|
235
233
|
|
|
@@ -241,14 +239,14 @@ class Input extends _baseComponent.default {
|
|
|
241
239
|
const allowClear = this.foundation.isAllowClear(); // use onMouseDown to fix issue 1203
|
|
242
240
|
|
|
243
241
|
if (allowClear) {
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
242
|
+
return (
|
|
243
|
+
/*#__PURE__*/
|
|
244
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
245
|
+
_react.default.createElement("div", {
|
|
246
|
+
className: clearCls,
|
|
247
|
+
onMouseDown: this.handleClear
|
|
248
|
+
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClear, null))
|
|
249
|
+
);
|
|
252
250
|
}
|
|
253
251
|
|
|
254
252
|
return null;
|
|
@@ -256,9 +254,6 @@ class Input extends _baseComponent.default {
|
|
|
256
254
|
|
|
257
255
|
renderModeBtn() {
|
|
258
256
|
const {
|
|
259
|
-
value,
|
|
260
|
-
isFocus,
|
|
261
|
-
isHovering,
|
|
262
257
|
eyeClosed
|
|
263
258
|
} = this.state;
|
|
264
259
|
const {
|
|
@@ -266,8 +261,9 @@ class Input extends _baseComponent.default {
|
|
|
266
261
|
disabled
|
|
267
262
|
} = this.props;
|
|
268
263
|
const modeCls = (0, _classnames.default)("".concat(prefixCls, "-modebtn"));
|
|
269
|
-
const modeIcon = eyeClosed ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconEyeClosedSolid, null) : /*#__PURE__*/_react.default.createElement(_semiIcons.IconEyeOpened, null);
|
|
270
|
-
|
|
264
|
+
const modeIcon = eyeClosed ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconEyeClosedSolid, null) : /*#__PURE__*/_react.default.createElement(_semiIcons.IconEyeOpened, null); // alway show password button for a11y
|
|
265
|
+
|
|
266
|
+
const showModeBtn = mode === 'password' && !disabled;
|
|
271
267
|
const ariaLabel = eyeClosed ? 'Show password' : 'Hidden password';
|
|
272
268
|
|
|
273
269
|
if (showModeBtn) {
|
|
@@ -303,14 +299,18 @@ class Input extends _baseComponent.default {
|
|
|
303
299
|
["".concat(prefixCls, "-inset-label")]: insetLabel,
|
|
304
300
|
["".concat(prefixCls, "-prefix-text")]: labelNode && (0, _isString2.default)(labelNode),
|
|
305
301
|
["".concat(prefixCls, "-prefix-icon")]: (0, _utils.isSemiIcon)(labelNode)
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
302
|
+
});
|
|
303
|
+
return (
|
|
304
|
+
/*#__PURE__*/
|
|
305
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
306
|
+
_react.default.createElement("div", {
|
|
307
|
+
className: prefixWrapperCls,
|
|
308
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
309
|
+
onClick: this.handleClickPrefixOrSuffix,
|
|
310
|
+
id: insetLabelId,
|
|
311
|
+
"x-semi-prop": "prefix,insetLabel"
|
|
312
|
+
}, labelNode)
|
|
313
|
+
);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
showClearBtn() {
|
|
@@ -341,13 +341,17 @@ class Input extends _baseComponent.default {
|
|
|
341
341
|
["".concat(prefixCls, "-suffix-text")]: suffix && (0, _isString2.default)(suffix),
|
|
342
342
|
["".concat(prefixCls, "-suffix-icon")]: (0, _utils.isSemiIcon)(suffix),
|
|
343
343
|
["".concat(prefixCls, "-suffix-hidden")]: suffixAllowClear && Boolean(hideSuffix)
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
344
|
+
});
|
|
345
|
+
return (
|
|
346
|
+
/*#__PURE__*/
|
|
347
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
348
|
+
_react.default.createElement("div", {
|
|
349
|
+
className: suffixWrapperCls,
|
|
350
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
351
|
+
onClick: this.handleClickPrefixOrSuffix,
|
|
352
|
+
"x-semi-prop": "suffix"
|
|
353
|
+
}, suffix)
|
|
354
|
+
);
|
|
351
355
|
}
|
|
352
356
|
|
|
353
357
|
render() {
|
|
@@ -360,6 +364,7 @@ class Input extends _baseComponent.default {
|
|
|
360
364
|
autofocus,
|
|
361
365
|
className,
|
|
362
366
|
disabled,
|
|
367
|
+
defaultValue,
|
|
363
368
|
placeholder,
|
|
364
369
|
prefix,
|
|
365
370
|
mode,
|
|
@@ -380,7 +385,7 @@ class Input extends _baseComponent.default {
|
|
|
380
385
|
maxLength,
|
|
381
386
|
getValueLength
|
|
382
387
|
} = _a,
|
|
383
|
-
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"]);
|
|
388
|
+
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"]);
|
|
384
389
|
|
|
385
390
|
const {
|
|
386
391
|
value,
|
|
@@ -447,7 +452,7 @@ class Input extends _baseComponent.default {
|
|
|
447
452
|
}
|
|
448
453
|
|
|
449
454
|
if (validateStatus === 'error') {
|
|
450
|
-
inputProps['aria-invalid'] =
|
|
455
|
+
inputProps['aria-invalid'] = 'true';
|
|
451
456
|
}
|
|
452
457
|
|
|
453
458
|
return (
|
|
@@ -79,13 +79,12 @@ class inputGroup extends _baseComponent.default {
|
|
|
79
79
|
|
|
80
80
|
const defaultName = 'input-group';
|
|
81
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
-
role: "group",
|
|
83
|
-
"aria-label": "Input group",
|
|
84
|
-
"aria-disabled": this.props.disabled,
|
|
85
82
|
className: groupWrapperCls
|
|
86
83
|
}, label && label.text ? /*#__PURE__*/_react.default.createElement(_label.default, (0, _assign.default)({
|
|
87
84
|
name: defaultName
|
|
88
85
|
}, label)) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
86
|
+
role: "group",
|
|
87
|
+
"aria-disabled": this.props.disabled,
|
|
89
88
|
id: label && label.name || defaultName,
|
|
90
89
|
className: groupCls,
|
|
91
90
|
style: this.props.style,
|
|
@@ -63,10 +63,6 @@ class TextArea extends _baseComponent.default {
|
|
|
63
63
|
this.foundation.handleClear(e);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
this.handleClearEnterPress = e => {
|
|
67
|
-
this.foundation.handleClearEnterPress(e);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
66
|
this.setRef = node => {
|
|
71
67
|
this.libRef.current = node;
|
|
72
68
|
const {
|
|
@@ -191,14 +187,14 @@ class TextArea extends _baseComponent.default {
|
|
|
191
187
|
});
|
|
192
188
|
|
|
193
189
|
if (showClear) {
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
190
|
+
return (
|
|
191
|
+
/*#__PURE__*/
|
|
192
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
193
|
+
_react.default.createElement("div", {
|
|
194
|
+
className: clearCls,
|
|
195
|
+
onClick: this.handleClear
|
|
196
|
+
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClear, null))
|
|
197
|
+
);
|
|
202
198
|
}
|
|
203
199
|
|
|
204
200
|
return null;
|
|
@@ -223,9 +219,6 @@ class TextArea extends _baseComponent.default {
|
|
|
223
219
|
["".concat(prefixCls, "-textarea-counter-exceed")]: current > total
|
|
224
220
|
});
|
|
225
221
|
counter = /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
-
"aria-label": "Textarea value length counter",
|
|
227
|
-
"aria-valuemax": maxCount,
|
|
228
|
-
"aria-valuenow": current,
|
|
229
222
|
className: countCls
|
|
230
223
|
}, current, total ? '/' : null, total);
|
|
231
224
|
} else {
|
package/lib/cjs/list/index.js
CHANGED
|
@@ -55,7 +55,8 @@ class List extends _baseComponent.default {
|
|
|
55
55
|
|
|
56
56
|
if (emptyContent) {
|
|
57
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
-
className: "".concat(_constants.cssClasses.PREFIX, "-empty")
|
|
58
|
+
className: "".concat(_constants.cssClasses.PREFIX, "-empty"),
|
|
59
|
+
"x-semi-prop": "emptyContent"
|
|
59
60
|
}, emptyContent);
|
|
60
61
|
} else {
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
|
|
@@ -140,7 +141,8 @@ class List extends _baseComponent.default {
|
|
|
140
141
|
className: wrapperCls,
|
|
141
142
|
style: style
|
|
142
143
|
}, header ? /*#__PURE__*/_react.default.createElement("div", {
|
|
143
|
-
className: "".concat(_constants.cssClasses.PREFIX, "-header")
|
|
144
|
+
className: "".concat(_constants.cssClasses.PREFIX, "-header"),
|
|
145
|
+
"x-semi-prop": "header"
|
|
144
146
|
}, header) : null, /*#__PURE__*/_react.default.createElement(_listContext.default.Provider, {
|
|
145
147
|
value: {
|
|
146
148
|
grid,
|
|
@@ -151,7 +153,8 @@ class List extends _baseComponent.default {
|
|
|
151
153
|
spinning: loading,
|
|
152
154
|
size: "large"
|
|
153
155
|
}, this.wrapChildren(childrenList, children))), footer ? /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
-
className: "".concat(_constants.cssClasses.PREFIX, "-footer")
|
|
156
|
+
className: "".concat(_constants.cssClasses.PREFIX, "-footer"),
|
|
157
|
+
"x-semi-prop": "footer"
|
|
155
158
|
}, footer) : null, loadMore ? loadMore : null);
|
|
156
159
|
}
|
|
157
160
|
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -119,7 +119,9 @@ class Modal extends _baseComponent.default {
|
|
|
119
119
|
loading: cancelLoading,
|
|
120
120
|
type: "tertiary",
|
|
121
121
|
autoFocus: true
|
|
122
|
-
}, this.props.cancelButtonProps
|
|
122
|
+
}, this.props.cancelButtonProps, {
|
|
123
|
+
"x-semi-children-alias": "cancelText"
|
|
124
|
+
}), cancelText || locale.cancel);
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
|
|
@@ -131,7 +133,9 @@ class Modal extends _baseComponent.default {
|
|
|
131
133
|
theme: "solid",
|
|
132
134
|
loading: confirmLoading,
|
|
133
135
|
onClick: this.handleOk
|
|
134
|
-
}, this.props.okButtonProps
|
|
136
|
+
}, this.props.okButtonProps, {
|
|
137
|
+
"x-semi-children-alias": "okText"
|
|
138
|
+
}), okText || locale.confirm)));
|
|
135
139
|
}; // getDialog = () => {
|
|
136
140
|
// const {
|
|
137
141
|
// footer,
|
|
@@ -121,7 +121,9 @@ class ModalContent extends _baseComponent.default {
|
|
|
121
121
|
let closer;
|
|
122
122
|
|
|
123
123
|
if (closable) {
|
|
124
|
-
const iconType = closeIcon || /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose,
|
|
124
|
+
const iconType = closeIcon || /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
|
|
125
|
+
"x-semi-prop": "closeIcon"
|
|
126
|
+
});
|
|
125
127
|
|
|
126
128
|
closer = /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
127
129
|
"aria-label": "close",
|
|
@@ -143,7 +145,8 @@ class ModalContent extends _baseComponent.default {
|
|
|
143
145
|
icon
|
|
144
146
|
} = this.props;
|
|
145
147
|
return icon ? /*#__PURE__*/_react.default.createElement("span", {
|
|
146
|
-
className: "".concat(_constants.cssClasses.DIALOG, "-icon-wrapper")
|
|
148
|
+
className: "".concat(_constants.cssClasses.DIALOG, "-icon-wrapper"),
|
|
149
|
+
"x-semi-prop": "icon"
|
|
147
150
|
}, icon) : null;
|
|
148
151
|
};
|
|
149
152
|
|
|
@@ -162,7 +165,8 @@ class ModalContent extends _baseComponent.default {
|
|
|
162
165
|
}, icon, /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
|
|
163
166
|
heading: 5,
|
|
164
167
|
className: "".concat(_constants.cssClasses.DIALOG, "-title"),
|
|
165
|
-
id: "".concat(_constants.cssClasses.DIALOG, "-title")
|
|
168
|
+
id: "".concat(_constants.cssClasses.DIALOG, "-title"),
|
|
169
|
+
"x-semi-prop": "title"
|
|
166
170
|
}, title), closer);
|
|
167
171
|
};
|
|
168
172
|
|
|
@@ -181,12 +185,14 @@ class ModalContent extends _baseComponent.default {
|
|
|
181
185
|
return hasHeader ? /*#__PURE__*/_react.default.createElement("div", {
|
|
182
186
|
className: bodyCls,
|
|
183
187
|
id: "".concat(_constants.cssClasses.DIALOG, "-body"),
|
|
184
|
-
style: bodyStyle
|
|
188
|
+
style: bodyStyle,
|
|
189
|
+
"x-semi-prop": "children"
|
|
185
190
|
}, children) : /*#__PURE__*/_react.default.createElement("div", {
|
|
186
191
|
className: "".concat(_constants.cssClasses.DIALOG, "-body-wrapper")
|
|
187
192
|
}, icon, /*#__PURE__*/_react.default.createElement("div", {
|
|
188
193
|
className: bodyCls,
|
|
189
|
-
style: bodyStyle
|
|
194
|
+
style: bodyStyle,
|
|
195
|
+
"x-semi-prop": "children"
|
|
190
196
|
}, children), closer);
|
|
191
197
|
};
|
|
192
198
|
|
|
@@ -218,7 +224,8 @@ class ModalContent extends _baseComponent.default {
|
|
|
218
224
|
const body = this.renderBody();
|
|
219
225
|
const header = this.renderHeader();
|
|
220
226
|
const footer = props.footer ? /*#__PURE__*/_react.default.createElement("div", {
|
|
221
|
-
className: "".concat(_constants.cssClasses.DIALOG, "-footer")
|
|
227
|
+
className: "".concat(_constants.cssClasses.DIALOG, "-footer"),
|
|
228
|
+
"x-semi-prop": "footer"
|
|
222
229
|
}, props.footer) : null;
|
|
223
230
|
|
|
224
231
|
const dialogElement =
|
|
@@ -143,7 +143,8 @@ class Notice extends _baseComponent.default {
|
|
|
143
143
|
|
|
144
144
|
if (iconType) {
|
|
145
145
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
-
className: iconCls
|
|
146
|
+
className: iconCls,
|
|
147
|
+
"x-semi-prop": "icon"
|
|
147
148
|
}, (0, _utils.isSemiIcon)(iconType) ? /*#__PURE__*/_react.default.cloneElement(iconType, {
|
|
148
149
|
size: iconType.props.size || 'large'
|
|
149
150
|
}) : iconType);
|
|
@@ -201,9 +202,11 @@ class Notice extends _baseComponent.default {
|
|
|
201
202
|
className: "".concat(prefixCls, "-content-wrapper")
|
|
202
203
|
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
203
204
|
id: titleID,
|
|
204
|
-
className: "".concat(prefixCls, "-title")
|
|
205
|
+
className: "".concat(prefixCls, "-title"),
|
|
206
|
+
"x-semi-prop": "title"
|
|
205
207
|
}, title) : '', content ? /*#__PURE__*/_react.default.createElement("div", {
|
|
206
|
-
className: "".concat(prefixCls, "-content")
|
|
208
|
+
className: "".concat(prefixCls, "-content"),
|
|
209
|
+
"x-semi-prop": "content"
|
|
207
210
|
}, content) : ''), showClose && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
208
211
|
className: "".concat(prefixCls, "-icon-close"),
|
|
209
212
|
type: "tertiary",
|
|
@@ -188,7 +188,8 @@ class Pagination extends _baseComponent.default {
|
|
|
188
188
|
"aria-disabled": prevDisabled ? true : false,
|
|
189
189
|
"aria-label": "Previous",
|
|
190
190
|
onClick: e => !prevDisabled && this.foundation.goPrev(e),
|
|
191
|
-
className: preClassName
|
|
191
|
+
className: preClassName,
|
|
192
|
+
"x-semi-prop": "prevText"
|
|
192
193
|
}, prevText || /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronLeft, {
|
|
193
194
|
size: "large"
|
|
194
195
|
}));
|
|
@@ -211,7 +212,8 @@ class Pagination extends _baseComponent.default {
|
|
|
211
212
|
"aria-disabled": nextDisabled ? true : false,
|
|
212
213
|
"aria-label": "Next",
|
|
213
214
|
onClick: e => !nextDisabled && this.foundation.goNext(e),
|
|
214
|
-
className: nextClassName
|
|
215
|
+
className: nextClassName,
|
|
216
|
+
"x-semi-prop": "prevText"
|
|
215
217
|
}, nextText || /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronRight, {
|
|
216
218
|
size: "large"
|
|
217
219
|
}));
|
|
@@ -150,13 +150,16 @@ class Popconfirm extends _baseComponent.default {
|
|
|
150
150
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
151
|
className: "".concat(prefixCls, "-header")
|
|
152
152
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
153
|
-
className: "".concat(prefixCls, "-header-icon")
|
|
153
|
+
className: "".concat(prefixCls, "-header-icon"),
|
|
154
|
+
"x-semi-prop": "icon"
|
|
154
155
|
}, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
155
156
|
className: "".concat(prefixCls, "-header-body")
|
|
156
157
|
}, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
-
className: "".concat(prefixCls, "-header-title")
|
|
158
|
+
className: "".concat(prefixCls, "-header-title"),
|
|
159
|
+
"x-semi-prop": "title"
|
|
158
160
|
}, title) : null, showContent ? /*#__PURE__*/_react.default.createElement("div", {
|
|
159
|
-
className: "".concat(prefixCls, "-header-content")
|
|
161
|
+
className: "".concat(prefixCls, "-header-content"),
|
|
162
|
+
"x-semi-prop": "content"
|
|
160
163
|
}, content) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
161
164
|
className: "".concat(prefixCls, "-btn-close"),
|
|
162
165
|
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
package/lib/cjs/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;
|
package/lib/cjs/radio/radio.js
CHANGED
|
@@ -66,6 +66,14 @@ class Radio extends _baseComponent.default {
|
|
|
66
66
|
this.foundation.setHover(false);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
this.handleFocusVisible = event => {
|
|
70
|
+
this.foundation.handleFocusVisible(event);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
this.handleBlur = event => {
|
|
74
|
+
this.foundation.handleBlur();
|
|
75
|
+
};
|
|
76
|
+
|
|
69
77
|
this.state = {
|
|
70
78
|
hover: false,
|
|
71
79
|
addonId: props.addonId,
|
|
@@ -95,6 +103,11 @@ class Radio extends _baseComponent.default {
|
|
|
95
103
|
prefix: 'extra'
|
|
96
104
|
})
|
|
97
105
|
});
|
|
106
|
+
},
|
|
107
|
+
setFocusVisible: focusVisible => {
|
|
108
|
+
this.setState({
|
|
109
|
+
focusVisible
|
|
110
|
+
});
|
|
98
111
|
}
|
|
99
112
|
});
|
|
100
113
|
}
|
|
@@ -128,13 +141,15 @@ class Radio extends _baseComponent.default {
|
|
|
128
141
|
extra,
|
|
129
142
|
mode,
|
|
130
143
|
type,
|
|
131
|
-
value: propValue
|
|
144
|
+
value: propValue,
|
|
145
|
+
name
|
|
132
146
|
} = this.props;
|
|
133
147
|
let realChecked, isDisabled, realMode, isButtonRadioGroup, isCardRadioGroup, isPureCardRadioGroup, isButtonRadioComponent, buttonSize, realPrefixCls;
|
|
134
148
|
const {
|
|
135
149
|
hover: isHover,
|
|
136
150
|
addonId,
|
|
137
|
-
extraId
|
|
151
|
+
extraId,
|
|
152
|
+
focusVisible
|
|
138
153
|
} = this.state;
|
|
139
154
|
let props = {};
|
|
140
155
|
|
|
@@ -161,6 +176,7 @@ class Radio extends _baseComponent.default {
|
|
|
161
176
|
|
|
162
177
|
const isButtonRadio = typeof isButtonRadioGroup === 'undefined' ? isButtonRadioComponent : isButtonRadioGroup;
|
|
163
178
|
const prefix = realPrefixCls || _constants.radioClasses.PREFIX;
|
|
179
|
+
const focusOuter = isCardRadioGroup || isPureCardRadioGroup || isButtonRadio;
|
|
164
180
|
const wrapper = (0, _classnames.default)(prefix, {
|
|
165
181
|
["".concat(prefix, "-disabled")]: isDisabled,
|
|
166
182
|
["".concat(prefix, "-checked")]: realChecked,
|
|
@@ -173,25 +189,29 @@ class Radio extends _baseComponent.default {
|
|
|
173
189
|
["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
|
|
174
190
|
["".concat(prefix, "-cardRadioGroup_checked_disabled")]: isCardRadioGroup && realChecked && isDisabled,
|
|
175
191
|
["".concat(prefix, "-cardRadioGroup_hover")]: isCardRadioGroup && !realChecked && isHover && !isDisabled,
|
|
176
|
-
[className]: Boolean(className)
|
|
192
|
+
[className]: Boolean(className),
|
|
193
|
+
["".concat(prefix, "-focus")]: focusVisible && (isCardRadioGroup || isPureCardRadioGroup)
|
|
177
194
|
});
|
|
178
|
-
const
|
|
195
|
+
const groupName = this.isInGroup() && this.context.radioGroup.name;
|
|
179
196
|
const addonCls = (0, _classnames.default)({
|
|
180
197
|
["".concat(prefix, "-addon")]: !isButtonRadio,
|
|
181
198
|
["".concat(prefix, "-addon-buttonRadio")]: isButtonRadio,
|
|
182
199
|
["".concat(prefix, "-addon-buttonRadio-checked")]: isButtonRadio && realChecked,
|
|
183
200
|
["".concat(prefix, "-addon-buttonRadio-disabled")]: isButtonRadio && isDisabled,
|
|
184
201
|
["".concat(prefix, "-addon-buttonRadio-hover")]: isButtonRadio && !realChecked && !isDisabled && isHover,
|
|
185
|
-
[(0, _concat.default)(_context3 = "".concat(prefix, "-addon-buttonRadio-")).call(_context3, buttonSize)]: isButtonRadio && buttonSize
|
|
202
|
+
[(0, _concat.default)(_context3 = "".concat(prefix, "-addon-buttonRadio-")).call(_context3, buttonSize)]: isButtonRadio && buttonSize,
|
|
203
|
+
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
186
204
|
}, addonClassName);
|
|
187
205
|
|
|
188
206
|
const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
189
207
|
className: addonCls,
|
|
190
208
|
style: addonStyle,
|
|
191
|
-
id: addonId
|
|
209
|
+
id: addonId,
|
|
210
|
+
"x-semi-prop": "children"
|
|
192
211
|
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/_react.default.createElement("div", {
|
|
193
212
|
className: "".concat(prefix, "-extra"),
|
|
194
|
-
id: extraId
|
|
213
|
+
id: extraId,
|
|
214
|
+
"x-semi-prop": "extra"
|
|
195
215
|
}, extra) : null);
|
|
196
216
|
|
|
197
217
|
return /*#__PURE__*/_react.default.createElement("label", {
|
|
@@ -201,7 +221,7 @@ class Radio extends _baseComponent.default {
|
|
|
201
221
|
onMouseLeave: this.handleMouseLeave
|
|
202
222
|
}, /*#__PURE__*/_react.default.createElement(_radioInner.default, (0, _assign.default)({}, this.props, props, {
|
|
203
223
|
mode: realMode,
|
|
204
|
-
name: name,
|
|
224
|
+
name: name !== null && name !== void 0 ? name : groupName,
|
|
205
225
|
isButtonRadio: isButtonRadio,
|
|
206
226
|
isPureCardRadioGroup: isPureCardRadioGroup,
|
|
207
227
|
onChange: this.onChange,
|
|
@@ -209,7 +229,10 @@ class Radio extends _baseComponent.default {
|
|
|
209
229
|
this.radioEntity = ref;
|
|
210
230
|
},
|
|
211
231
|
addonId: children && addonId,
|
|
212
|
-
extraId: extra && extraId
|
|
232
|
+
extraId: extra && extraId,
|
|
233
|
+
focusInner: focusVisible && !focusOuter,
|
|
234
|
+
onInputFocus: this.handleFocusVisible,
|
|
235
|
+
onInputBlur: this.handleBlur
|
|
213
236
|
})), isCardRadioGroup ? /*#__PURE__*/_react.default.createElement("div", {
|
|
214
237
|
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
215
238
|
}, renderContent()) : renderContent());
|
|
@@ -17,6 +17,9 @@ export interface RadioInnerProps extends BaseProps {
|
|
|
17
17
|
addonId?: string;
|
|
18
18
|
extraId?: string;
|
|
19
19
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
20
|
+
focusInner?: boolean;
|
|
21
|
+
onInputFocus?: (e: any) => void;
|
|
22
|
+
onInputBlur?: (e: any) => void;
|
|
20
23
|
}
|
|
21
24
|
interface RadioInnerState {
|
|
22
25
|
checked?: boolean;
|
|
@@ -30,6 +33,9 @@ declare class RadioInner extends BaseComponent<RadioInnerProps, RadioInnerState>
|
|
|
30
33
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
34
|
mode: PropTypes.Requireable<string>;
|
|
32
35
|
'aria-label': PropTypes.Requireable<string>;
|
|
36
|
+
focusInner: PropTypes.Requireable<boolean>;
|
|
37
|
+
onInputFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
|
+
onInputBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
39
|
};
|
|
34
40
|
static defaultProps: {
|
|
35
41
|
onChange: (...args: any[]) => void;
|
|
@@ -93,7 +93,10 @@ class RadioInner extends _baseComponent.default {
|
|
|
93
93
|
isPureCardRadioGroup,
|
|
94
94
|
addonId,
|
|
95
95
|
extraId,
|
|
96
|
-
'aria-label': ariaLabel
|
|
96
|
+
'aria-label': ariaLabel,
|
|
97
|
+
focusInner,
|
|
98
|
+
onInputFocus,
|
|
99
|
+
onInputBlur
|
|
97
100
|
} = this.props;
|
|
98
101
|
const {
|
|
99
102
|
checked
|
|
@@ -106,6 +109,8 @@ class RadioInner extends _baseComponent.default {
|
|
|
106
109
|
["".concat(prefix, "-inner-pureCardRadio")]: isPureCardRadioGroup
|
|
107
110
|
});
|
|
108
111
|
const inner = (0, _classnames.default)({
|
|
112
|
+
["".concat(prefix, "-focus")]: focusInner,
|
|
113
|
+
["".concat(prefix, "-focus-border")]: focusInner && !checked,
|
|
109
114
|
["".concat(prefix, "-inner-display")]: !isButtonRadio
|
|
110
115
|
});
|
|
111
116
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -114,7 +119,6 @@ class RadioInner extends _baseComponent.default {
|
|
|
114
119
|
ref: ref => {
|
|
115
120
|
this.inputEntity = ref;
|
|
116
121
|
},
|
|
117
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
118
122
|
autoFocus: autoFocus,
|
|
119
123
|
type: mode === 'advanced' ? 'checkbox' : 'radio',
|
|
120
124
|
checked: Boolean(checked),
|
|
@@ -123,7 +127,9 @@ class RadioInner extends _baseComponent.default {
|
|
|
123
127
|
name: name,
|
|
124
128
|
"aria-label": ariaLabel,
|
|
125
129
|
"aria-labelledby": addonId,
|
|
126
|
-
"aria-describedby": extraId
|
|
130
|
+
"aria-describedby": extraId,
|
|
131
|
+
onFocus: onInputFocus,
|
|
132
|
+
onBlur: onInputBlur
|
|
127
133
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
128
134
|
className: inner
|
|
129
135
|
}, checked ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconRadio, null) : null));
|
|
@@ -138,7 +144,10 @@ RadioInner.propTypes = {
|
|
|
138
144
|
isButtonRadio: _propTypes.default.bool,
|
|
139
145
|
onChange: _propTypes.default.func,
|
|
140
146
|
mode: _propTypes.default.oneOf(['advanced', '']),
|
|
141
|
-
'aria-label': _propTypes.default.string
|
|
147
|
+
'aria-label': _propTypes.default.string,
|
|
148
|
+
focusInner: _propTypes.default.bool,
|
|
149
|
+
onInputFocus: _propTypes.default.func,
|
|
150
|
+
onInputBlur: _propTypes.default.func
|
|
142
151
|
};
|
|
143
152
|
RadioInner.defaultProps = {
|
|
144
153
|
onChange: _noop2.default,
|