@douyinfe/semi-ui 2.12.1-alpha.2 → 2.13.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/autoComplete.stories.js +0 -1
- package/autoComplete/index.tsx +1 -1
- package/avatar/index.tsx +2 -2
- package/backtop/index.tsx +7 -11
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +5 -5
- package/breadcrumb/index.tsx +3 -5
- package/button/Button.tsx +8 -10
- package/card/index.tsx +41 -43
- package/carousel/CarouselArrow.tsx +0 -2
- package/carousel/index.tsx +0 -1
- package/cascader/index.tsx +123 -101
- package/cascader/item.tsx +1 -1
- package/checkbox/checkbox.tsx +28 -20
- package/checkbox/checkboxInner.tsx +11 -1
- package/collapsible/index.tsx +1 -8
- package/datePicker/dateInput.tsx +0 -1
- package/datePicker/datePicker.tsx +5 -13
- package/dist/css/semi.css +9 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5372 -3695
- 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 +4 -8
- package/dropdown/index.tsx +1 -1
- package/empty/index.tsx +5 -13
- 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 +1 -2
- package/input/index.tsx +11 -38
- package/inputNumber/__test__/inputNumber.test.js +2 -3
- package/inputNumber/_story/inputNumber.stories.js +53 -0
- package/inputNumber/index.tsx +0 -4
- package/lib/cjs/autoComplete/index.js +1 -1
- package/lib/cjs/avatar/index.js +2 -4
- package/lib/cjs/backtop/index.js +1 -2
- package/lib/cjs/badge/index.js +1 -2
- package/lib/cjs/banner/index.js +4 -9
- package/lib/cjs/breadcrumb/index.js +3 -4
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/Button.js +3 -13
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/card/index.js +5 -10
- package/lib/cjs/carousel/CarouselArrow.js +2 -6
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/carousel/index.js +1 -2
- package/lib/cjs/cascader/index.js +6 -9
- package/lib/cjs/cascader/item.js +1 -2
- package/lib/cjs/checkbox/checkbox.d.ts +3 -2
- package/lib/cjs/checkbox/checkbox.js +33 -15
- package/lib/cjs/checkbox/checkboxInner.d.ts +6 -0
- package/lib/cjs/checkbox/checkboxInner.js +14 -4
- package/lib/cjs/collapsible/index.js +1 -2
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.js +1 -2
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +2 -4
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/divider/index.js +1 -2
- package/lib/cjs/dropdown/index.js +1 -2
- package/lib/cjs/empty/index.js +4 -8
- 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 +1 -2
- package/lib/cjs/form/label.js +1 -2
- package/lib/cjs/grid/col.js +1 -2
- package/lib/cjs/grid/row.js +1 -2
- package/lib/cjs/iconButton/index.js +1 -3
- package/lib/cjs/input/index.js +5 -9
- package/lib/cjs/inputNumber/index.js +0 -4
- package/lib/cjs/list/index.js +3 -6
- package/lib/cjs/modal/ConfirmModal.js +1 -2
- package/lib/cjs/modal/Modal.js +2 -6
- package/lib/cjs/modal/ModalContent.js +6 -13
- package/lib/cjs/notification/notice.js +3 -6
- package/lib/cjs/pagination/index.js +2 -4
- package/lib/cjs/popconfirm/index.js +3 -6
- package/lib/cjs/popover/index.d.ts +1 -0
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radio.js +2 -4
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/item.js +1 -2
- package/lib/cjs/scrollList/index.js +3 -6
- package/lib/cjs/select/index.js +4 -8
- package/lib/cjs/select/option.js +1 -2
- package/lib/cjs/sideSheet/SideSheetContent.js +3 -6
- package/lib/cjs/skeleton/index.js +1 -3
- package/lib/cjs/space/index.js +1 -2
- package/lib/cjs/spin/index.js +3 -7
- package/lib/cjs/switch/index.js +4 -6
- package/lib/cjs/table/Table.js +3 -6
- package/lib/cjs/tabs/TabBar.js +1 -2
- package/lib/cjs/tabs/TabPane.js +2 -5
- package/lib/cjs/tagInput/index.d.ts +6 -1
- package/lib/cjs/tagInput/index.js +42 -10
- package/lib/cjs/timePicker/Combobox.js +1 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/toast/toast.js +3 -6
- package/lib/cjs/transfer/index.js +1 -2
- package/lib/cjs/tree/treeNode.js +1 -2
- package/lib/cjs/treeSelect/index.js +3 -6
- package/lib/cjs/typography/base.d.ts +1 -1
- package/lib/cjs/typography/base.js +1 -2
- package/lib/cjs/typography/paragraph.d.ts +1 -1
- package/lib/cjs/typography/text.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +2 -2
- package/lib/cjs/upload/index.d.ts +2 -2
- package/lib/cjs/upload/index.js +6 -13
- package/lib/es/autoComplete/index.js +1 -1
- package/lib/es/avatar/index.js +2 -4
- package/lib/es/backtop/index.js +1 -2
- package/lib/es/badge/index.js +1 -2
- package/lib/es/banner/index.js +4 -9
- package/lib/es/breadcrumb/index.js +3 -4
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/Button.js +3 -11
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/card/index.js +5 -10
- package/lib/es/carousel/CarouselArrow.js +2 -6
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/carousel/index.js +1 -2
- package/lib/es/cascader/index.js +6 -9
- package/lib/es/cascader/item.js +1 -2
- package/lib/es/checkbox/checkbox.d.ts +3 -2
- package/lib/es/checkbox/checkbox.js +33 -15
- package/lib/es/checkbox/checkboxInner.d.ts +6 -0
- package/lib/es/checkbox/checkboxInner.js +14 -4
- package/lib/es/collapsible/index.js +1 -2
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +1 -2
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +2 -4
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/divider/index.js +1 -2
- package/lib/es/dropdown/index.js +1 -2
- package/lib/es/empty/index.js +4 -8
- 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 +1 -2
- package/lib/es/form/label.js +1 -2
- package/lib/es/grid/col.js +1 -2
- package/lib/es/grid/row.js +1 -2
- package/lib/es/iconButton/index.js +1 -3
- package/lib/es/input/index.js +5 -9
- package/lib/es/inputNumber/index.js +0 -4
- package/lib/es/list/index.js +3 -6
- package/lib/es/modal/ConfirmModal.js +1 -2
- package/lib/es/modal/Modal.js +2 -6
- package/lib/es/modal/ModalContent.js +6 -13
- package/lib/es/notification/notice.js +3 -6
- package/lib/es/pagination/index.js +2 -4
- package/lib/es/popconfirm/index.js +3 -6
- package/lib/es/popover/index.d.ts +1 -0
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radio.js +2 -4
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/item.js +1 -2
- package/lib/es/scrollList/index.js +3 -6
- package/lib/es/select/index.js +4 -8
- package/lib/es/select/option.js +1 -2
- package/lib/es/sideSheet/SideSheetContent.js +3 -6
- package/lib/es/skeleton/index.js +1 -3
- package/lib/es/space/index.js +1 -2
- package/lib/es/spin/index.js +3 -7
- package/lib/es/switch/index.js +4 -6
- package/lib/es/table/Table.js +3 -6
- package/lib/es/tabs/TabBar.js +1 -2
- package/lib/es/tabs/TabPane.js +2 -5
- package/lib/es/tagInput/index.d.ts +6 -1
- package/lib/es/tagInput/index.js +41 -10
- package/lib/es/timePicker/Combobox.js +1 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/toast/toast.js +3 -6
- package/lib/es/transfer/index.js +1 -2
- package/lib/es/tree/treeNode.js +1 -2
- package/lib/es/treeSelect/index.js +3 -6
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/base.js +1 -2
- package/lib/es/typography/paragraph.d.ts +1 -1
- package/lib/es/typography/text.d.ts +1 -1
- package/lib/es/typography/title.d.ts +2 -2
- package/lib/es/upload/index.d.ts +2 -2
- package/lib/es/upload/index.js +6 -13
- package/list/index.tsx +4 -16
- package/modal/ConfirmModal.tsx +1 -1
- package/modal/Modal.tsx +0 -2
- package/modal/ModalContent.tsx +14 -27
- package/notification/notice.tsx +4 -16
- package/package.json +9 -9
- package/pagination/index.tsx +2 -16
- package/popconfirm/index.tsx +3 -11
- package/popover/index.tsx +1 -1
- package/radio/radio.tsx +2 -10
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +3 -19
- package/select/_story/select.stories.js +11 -0
- package/select/index.tsx +4 -12
- package/select/option.tsx +1 -5
- package/sideSheet/SideSheetContent.tsx +3 -3
- package/skeleton/index.tsx +1 -1
- package/space/index.tsx +1 -1
- package/spin/index.tsx +9 -15
- package/switch/index.tsx +14 -9
- package/table/Table.tsx +3 -5
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +4 -9
- package/tagInput/index.tsx +38 -11
- package/timePicker/Combobox.tsx +1 -6
- package/toast/toast.tsx +3 -3
- package/transfer/index.tsx +0 -1
- package/tree/treeNode.tsx +1 -1
- package/treeSelect/index.tsx +3 -15
- package/typography/base.tsx +1 -1
- package/upload/index.tsx +38 -107
- package/yarn-error.log +0 -26235
|
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
33
|
link: PropTypes.Requireable<boolean | object>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
35
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
@@ -36,8 +36,8 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
36
36
|
link: PropTypes.Requireable<boolean | object>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
39
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -6,7 +6,7 @@ import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
|
6
6
|
import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
|
|
7
7
|
import { Locale } from '../locale/interface';
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/cjs/upload/upload.css';
|
|
9
|
-
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult
|
|
9
|
+
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
|
|
10
10
|
export interface UploadProps {
|
|
11
11
|
accept?: string;
|
|
12
12
|
action: string;
|
|
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
140
140
|
style: PropTypes.Requireable<object>;
|
|
141
141
|
timeout: PropTypes.Requireable<number>;
|
|
142
142
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
143
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
143
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/lib/cjs/upload/index.js
CHANGED
|
@@ -256,9 +256,7 @@ class Upload extends _baseComponent.default {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
const addContent = /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, addContentProps,
|
|
260
|
-
"x-semi-prop": "children"
|
|
261
|
-
}), children);
|
|
259
|
+
const addContent = /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, addContentProps), children);
|
|
262
260
|
|
|
263
261
|
if (!showUploadList || !fileList.length) {
|
|
264
262
|
if (showAddTriggerInList) {
|
|
@@ -391,18 +389,15 @@ class Upload extends _baseComponent.default {
|
|
|
391
389
|
onDragEnter: this.onDragEnter,
|
|
392
390
|
onClick: this.onClick
|
|
393
391
|
}, children ? children : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
394
|
-
className: "".concat(dragAreaBaseCls, "-icon")
|
|
395
|
-
"x-semi-prop": "dragIcon"
|
|
392
|
+
className: "".concat(dragAreaBaseCls, "-icon")
|
|
396
393
|
}, dragIcon || /*#__PURE__*/_react.default.createElement(_semiIcons.IconUpload, {
|
|
397
394
|
size: "extra-large"
|
|
398
395
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
399
396
|
className: "".concat(dragAreaBaseCls, "-text")
|
|
400
397
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
401
|
-
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
402
|
-
"x-semi-prop": "dragMainText"
|
|
398
|
+
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
403
399
|
}, dragMainText || locale.mainText), /*#__PURE__*/_react.default.createElement("div", {
|
|
404
|
-
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
405
|
-
"x-semi-prop": "dragSubText"
|
|
400
|
+
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
406
401
|
}, dragSubText), /*#__PURE__*/_react.default.createElement("div", {
|
|
407
402
|
className: "".concat(dragAreaBaseCls, "-tips")
|
|
408
403
|
}, dragAreaStatus === _constants.strings.DRAG_AREA_LEGAL && /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -588,11 +583,9 @@ class Upload extends _baseComponent.default {
|
|
|
588
583
|
className: inputReplaceCls,
|
|
589
584
|
ref: this.replaceInputRef
|
|
590
585
|
}), this.renderAddContent(), prompt ? /*#__PURE__*/_react.default.createElement("div", {
|
|
591
|
-
className: promptCls
|
|
592
|
-
"x-semi-prop": "prompt"
|
|
586
|
+
className: promptCls
|
|
593
587
|
}, prompt) : null, validateMessage ? /*#__PURE__*/_react.default.createElement("div", {
|
|
594
|
-
className: validateMsgCls
|
|
595
|
-
"x-semi-prop": "validateMessage"
|
|
588
|
+
className: validateMsgCls
|
|
596
589
|
}, validateMessage) : null, this.renderFileList());
|
|
597
590
|
}
|
|
598
591
|
|
|
@@ -404,7 +404,7 @@ AutoComplete.defaultProps = {
|
|
|
404
404
|
onChange: _noop,
|
|
405
405
|
onSelectWithObject: false,
|
|
406
406
|
onDropdownVisibleChange: _noop,
|
|
407
|
-
defaultActiveFirstOption:
|
|
407
|
+
defaultActiveFirstOption: false,
|
|
408
408
|
dropdownMatchSelectWidth: true,
|
|
409
409
|
loading: false,
|
|
410
410
|
maxHeight: 300,
|
package/lib/es/avatar/index.js
CHANGED
|
@@ -156,8 +156,7 @@ export default class Avatar extends BaseComponent {
|
|
|
156
156
|
}, className);
|
|
157
157
|
let content = children;
|
|
158
158
|
const hoverRender = hoverContent ? /*#__PURE__*/React.createElement("div", {
|
|
159
|
-
className: "".concat(prefixCls, "-hover")
|
|
160
|
-
"x-semi-prop": "hoverContent"
|
|
159
|
+
className: "".concat(prefixCls, "-hover")
|
|
161
160
|
}, hoverContent) : null;
|
|
162
161
|
|
|
163
162
|
if (isImg) {
|
|
@@ -171,8 +170,7 @@ export default class Avatar extends BaseComponent {
|
|
|
171
170
|
content = /*#__PURE__*/React.createElement("span", {
|
|
172
171
|
className: "".concat(prefixCls, "-content")
|
|
173
172
|
}, /*#__PURE__*/React.createElement("span", {
|
|
174
|
-
className: "".concat(prefixCls, "-label")
|
|
175
|
-
"x-semi-prop": "children"
|
|
173
|
+
className: "".concat(prefixCls, "-label")
|
|
176
174
|
}, children));
|
|
177
175
|
}
|
|
178
176
|
|
package/lib/es/backtop/index.js
CHANGED
|
@@ -98,8 +98,7 @@ export default class BackTop extends BaseComponent {
|
|
|
98
98
|
const content = visible ? /*#__PURE__*/React.createElement("div", _Object$assign({}, others, {
|
|
99
99
|
className: preCls,
|
|
100
100
|
style: style,
|
|
101
|
-
onClick: e => this.handleClick(e)
|
|
102
|
-
"x-semi-prop": "children"
|
|
101
|
+
onClick: e => this.handleClick(e)
|
|
103
102
|
}), backtopBtn) : null;
|
|
104
103
|
return content;
|
|
105
104
|
}
|
package/lib/es/badge/index.js
CHANGED
|
@@ -71,8 +71,7 @@ export default class Badge extends PureComponent {
|
|
|
71
71
|
className: prefixCls
|
|
72
72
|
}, rest), children, /*#__PURE__*/React.createElement("span", {
|
|
73
73
|
className: wrapper,
|
|
74
|
-
style: style
|
|
75
|
-
"x-semi-prop": "count"
|
|
74
|
+
style: style
|
|
76
75
|
}, dot ? null : content));
|
|
77
76
|
}
|
|
78
77
|
|
package/lib/es/banner/index.js
CHANGED
|
@@ -68,7 +68,6 @@ export default class Banner extends BaseComponent {
|
|
|
68
68
|
className: "".concat(prefixCls, "-close"),
|
|
69
69
|
onClick: this.remove,
|
|
70
70
|
icon: closeIcon || /*#__PURE__*/React.createElement(IconClose, {
|
|
71
|
-
"x-semi-prop": "closeIcon",
|
|
72
71
|
"aria-hidden": true
|
|
73
72
|
}),
|
|
74
73
|
theme: "borderless",
|
|
@@ -114,8 +113,7 @@ export default class Banner extends BaseComponent {
|
|
|
114
113
|
|
|
115
114
|
if (iconType) {
|
|
116
115
|
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: iconCls
|
|
118
|
-
"x-semi-prop": "icon"
|
|
116
|
+
className: iconCls
|
|
119
117
|
}, iconType);
|
|
120
118
|
}
|
|
121
119
|
|
|
@@ -157,15 +155,12 @@ export default class Banner extends BaseComponent {
|
|
|
157
155
|
}, title ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
158
156
|
heading: 5,
|
|
159
157
|
className: "".concat(prefixCls, "-title"),
|
|
160
|
-
component: "div"
|
|
161
|
-
"x-semi-prop": "title"
|
|
158
|
+
component: "div"
|
|
162
159
|
}, title) : null, description ? /*#__PURE__*/React.createElement(Typography.Paragraph, {
|
|
163
160
|
className: "".concat(prefixCls, "-description"),
|
|
164
|
-
component: "div"
|
|
165
|
-
"x-semi-prop": "description"
|
|
161
|
+
component: "div"
|
|
166
162
|
}, description) : null)), this.renderCloser()), children ? /*#__PURE__*/React.createElement("div", {
|
|
167
|
-
className: "".concat(prefixCls, "-extra")
|
|
168
|
-
"x-semi-prop": "children"
|
|
163
|
+
className: "".concat(prefixCls, "-extra")
|
|
169
164
|
}, children) : null) : null;
|
|
170
165
|
return banner;
|
|
171
166
|
}
|
|
@@ -47,15 +47,14 @@ class Breadcrumb extends BaseComponent {
|
|
|
47
47
|
}, /*#__PURE__*/React.createElement("span", {
|
|
48
48
|
className: "".concat(clsPrefix, "-item-wrap")
|
|
49
49
|
}, /*#__PURE__*/React.createElement("span", {
|
|
50
|
-
role:
|
|
50
|
+
role: 'button',
|
|
51
51
|
tabIndex: 0,
|
|
52
|
-
"aria-label":
|
|
52
|
+
"aria-label": 'Expand breadcrumb items',
|
|
53
53
|
className: _concatInstanceProperty(_context = "".concat(clsPrefix, "-item ")).call(_context, clsPrefix, "-item-more"),
|
|
54
54
|
onClick: item => this.foundation.handleExpand(item),
|
|
55
55
|
onKeyPress: e => this.foundation.handleExpandEnterPress(e)
|
|
56
56
|
}, hasRenderMore && renderMore(restItem), !hasRenderMore && moreType === 'default' && /*#__PURE__*/React.createElement(IconMore, null), !hasRenderMore && moreType === 'popover' && this.renderPopoverMore(restItem)), /*#__PURE__*/React.createElement("span", {
|
|
57
|
-
className: "".concat(clsPrefix, "-separator")
|
|
58
|
-
"x-semi-prop": "separator"
|
|
57
|
+
className: "".concat(clsPrefix, "-separator")
|
|
59
58
|
}, this.props.separator)));
|
|
60
59
|
|
|
61
60
|
_spliceInstanceProperty(template).call(template, 1, itemsLen - maxItemCount, spread);
|
|
@@ -48,7 +48,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
|
-
type: PropTypes.Requireable<"warning" | "primary" | "
|
|
51
|
+
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/button/Button.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _omit from "lodash/omit";
|
|
2
1
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
3
2
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
5
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
7
5
|
|
|
8
6
|
var __rest = this && this.__rest || function (s, e) {
|
|
9
7
|
var t = {};
|
|
@@ -54,7 +52,7 @@ export default class Button extends PureComponent {
|
|
|
54
52
|
|
|
55
53
|
const baseProps = _Object$assign(_Object$assign({
|
|
56
54
|
disabled
|
|
57
|
-
},
|
|
55
|
+
}, attr), {
|
|
58
56
|
className: classNames(prefixCls, {
|
|
59
57
|
[_concatInstanceProperty(_context = "".concat(prefixCls, "-")).call(_context, type)]: !disabled && type,
|
|
60
58
|
["".concat(prefixCls, "-disabled")]: disabled,
|
|
@@ -70,12 +68,6 @@ export default class Button extends PureComponent {
|
|
|
70
68
|
'aria-disabled': disabled
|
|
71
69
|
});
|
|
72
70
|
|
|
73
|
-
const xSemiProps = {};
|
|
74
|
-
|
|
75
|
-
if (!(className && _includesInstanceProperty(className).call(className, '-with-icon'))) {
|
|
76
|
-
xSemiProps['x-semi-prop'] = this.props['x-semi-children-alias'] || 'children';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
71
|
return (
|
|
80
72
|
/*#__PURE__*/
|
|
81
73
|
// eslint-disable-next-line react/button-has-type
|
|
@@ -83,10 +75,10 @@ export default class Button extends PureComponent {
|
|
|
83
75
|
onClick: this.props.onClick,
|
|
84
76
|
onMouseDown: this.props.onMouseDown,
|
|
85
77
|
style: style
|
|
86
|
-
}), /*#__PURE__*/React.createElement("span",
|
|
78
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
87
79
|
className: "".concat(prefixCls, "-content"),
|
|
88
80
|
onClick: e => disabled && e.stopPropagation()
|
|
89
|
-
},
|
|
81
|
+
}, children))
|
|
90
82
|
);
|
|
91
83
|
}
|
|
92
84
|
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
26
|
-
type: import("prop-types").Requireable<"warning" | "primary" | "
|
|
26
|
+
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
package/lib/es/card/index.js
CHANGED
|
@@ -59,8 +59,7 @@ class Card extends PureComponent {
|
|
|
59
59
|
React.createElement("div", {
|
|
60
60
|
className: headerWrapperCls
|
|
61
61
|
}, headerExtraContent && /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: "".concat(prefixcls, "-header-wrapper-extra")
|
|
63
|
-
"x-semi-prop": "headerExtraContent"
|
|
62
|
+
className: "".concat(prefixcls, "-header-wrapper-extra")
|
|
64
63
|
}, headerExtraContent), title && /*#__PURE__*/React.createElement("div", {
|
|
65
64
|
className: titleCls
|
|
66
65
|
}, _isString(title) ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
@@ -68,8 +67,7 @@ class Card extends PureComponent {
|
|
|
68
67
|
ellipsis: {
|
|
69
68
|
showTooltip: true,
|
|
70
69
|
rows: 1
|
|
71
|
-
}
|
|
72
|
-
"x-semi-prop": "title"
|
|
70
|
+
}
|
|
73
71
|
}, title) : title)));
|
|
74
72
|
}
|
|
75
73
|
|
|
@@ -82,8 +80,7 @@ class Card extends PureComponent {
|
|
|
82
80
|
} = this.props;
|
|
83
81
|
const coverCls = cls("".concat(prefixcls, "-cover"));
|
|
84
82
|
return cover && /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
className: coverCls
|
|
86
|
-
"x-semi-prop": "cover"
|
|
83
|
+
className: coverCls
|
|
87
84
|
}, cover);
|
|
88
85
|
};
|
|
89
86
|
|
|
@@ -113,8 +110,7 @@ class Card extends PureComponent {
|
|
|
113
110
|
spacing: 12
|
|
114
111
|
}, _mapInstanceProperty(actions).call(actions, (item, idx) => /*#__PURE__*/React.createElement("div", {
|
|
115
112
|
key: idx,
|
|
116
|
-
className: actionsItemCls
|
|
117
|
-
"x-semi-prop": "actions.".concat(idx)
|
|
113
|
+
className: actionsItemCls
|
|
118
114
|
}, item)))));
|
|
119
115
|
};
|
|
120
116
|
|
|
@@ -129,8 +125,7 @@ class Card extends PureComponent {
|
|
|
129
125
|
});
|
|
130
126
|
return footer && /*#__PURE__*/React.createElement("div", {
|
|
131
127
|
style: footerStyle,
|
|
132
|
-
className: footerCls
|
|
133
|
-
"x-semi-prop": "footer"
|
|
128
|
+
className: footerCls
|
|
134
129
|
}, footer);
|
|
135
130
|
};
|
|
136
131
|
}
|
|
@@ -57,16 +57,12 @@ class CarouselArrow extends React.PureComponent {
|
|
|
57
57
|
// role='button'
|
|
58
58
|
className: leftClassNames,
|
|
59
59
|
onClick: prev
|
|
60
|
-
}, _get(this.props, 'arrowProps.leftArrow.props'), {
|
|
61
|
-
"x-semi-prop": "arrowProps.leftArrow.children"
|
|
62
|
-
}), this.renderLeftIcon()), /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
60
|
+
}, _get(this.props, 'arrowProps.leftArrow.props')), this.renderLeftIcon()), /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
63
61
|
// role='button'
|
|
64
62
|
// tabIndex={0}
|
|
65
63
|
className: rightClassNames,
|
|
66
64
|
onClick: next
|
|
67
|
-
}, _get(this.props, 'arrowProps.rightArrow.props'),
|
|
68
|
-
"x-semi-prop": "arrowProps.rightArrow.children"
|
|
69
|
-
}), this.renderRightIcon()));
|
|
65
|
+
}, _get(this.props, 'arrowProps.rightArrow.props')), this.renderRightIcon()));
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
}
|
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
package/lib/es/carousel/index.js
CHANGED
|
@@ -263,8 +263,7 @@ class Carousel extends BaseComponent {
|
|
|
263
263
|
className: cls([_concatInstanceProperty(_context2 = "".concat(cssClasses.CAROUSEL_CONTENT, "-")).call(_context2, animation)], {
|
|
264
264
|
["".concat(cssClasses.CAROUSEL_CONTENT)]: true,
|
|
265
265
|
["".concat(cssClasses.CAROUSEL_CONTENT, "-reverse")]: slideDirection === 'left' ? isReverse : !isReverse
|
|
266
|
-
})
|
|
267
|
-
"x-semi-prop": "children"
|
|
266
|
+
})
|
|
268
267
|
}, this.renderChildren()), this.renderIndicator(), this.renderArrow());
|
|
269
268
|
}
|
|
270
269
|
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -285,8 +285,7 @@ class Cascader extends BaseComponent {
|
|
|
285
285
|
["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
|
|
286
286
|
});
|
|
287
287
|
return /*#__PURE__*/React.createElement("div", {
|
|
288
|
-
className: suffixWrapperCls
|
|
289
|
-
"x-semi-prop": "suffix"
|
|
288
|
+
className: suffixWrapperCls
|
|
290
289
|
}, suffix);
|
|
291
290
|
};
|
|
292
291
|
|
|
@@ -306,8 +305,7 @@ class Cascader extends BaseComponent {
|
|
|
306
305
|
});
|
|
307
306
|
return /*#__PURE__*/React.createElement("div", {
|
|
308
307
|
className: prefixWrapperCls,
|
|
309
|
-
id: insetLabelId
|
|
310
|
-
"x-semi-prop": "prefix,insetLabel"
|
|
308
|
+
id: insetLabelId
|
|
311
309
|
}, labelNode);
|
|
312
310
|
};
|
|
313
311
|
|
|
@@ -397,7 +395,7 @@ class Cascader extends BaseComponent {
|
|
|
397
395
|
className: clearCls,
|
|
398
396
|
onClick: this.handleClear,
|
|
399
397
|
onKeyPress: this.handleClearEnterPress,
|
|
400
|
-
role:
|
|
398
|
+
role: 'button',
|
|
401
399
|
tabIndex: 0
|
|
402
400
|
}, /*#__PURE__*/React.createElement(IconClear, null));
|
|
403
401
|
}
|
|
@@ -416,8 +414,7 @@ class Cascader extends BaseComponent {
|
|
|
416
414
|
}
|
|
417
415
|
|
|
418
416
|
return arrowIcon ? /*#__PURE__*/React.createElement("div", {
|
|
419
|
-
className: cls("".concat(prefixcls, "-arrow"))
|
|
420
|
-
"x-semi-prop": "arrowIcon"
|
|
417
|
+
className: cls("".concat(prefixcls, "-arrow"))
|
|
421
418
|
}, arrowIcon) : null;
|
|
422
419
|
};
|
|
423
420
|
|
|
@@ -492,12 +489,12 @@ class Cascader extends BaseComponent {
|
|
|
492
489
|
"aria-errormessage": this.props['aria-errormessage'],
|
|
493
490
|
"aria-label": this.props['aria-label'],
|
|
494
491
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
495
|
-
"aria-describedby": this.props[
|
|
492
|
+
"aria-describedby": this.props["aria-describedby"],
|
|
496
493
|
"aria-required": this.props['aria-required'],
|
|
497
494
|
id: id
|
|
498
495
|
}, mouseEvent, {
|
|
499
496
|
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
500
|
-
role:
|
|
497
|
+
role: 'combobox',
|
|
501
498
|
tabIndex: 0
|
|
502
499
|
}), inner);
|
|
503
500
|
};
|
package/lib/es/cascader/item.js
CHANGED
|
@@ -296,8 +296,7 @@ export default class Item extends PureComponent {
|
|
|
296
296
|
className: _concatInstanceProperty(_context6 = "".concat(prefixcls, " ")).call(_context6, prefixcls, "-empty"),
|
|
297
297
|
key: 'empty-list'
|
|
298
298
|
}, /*#__PURE__*/React.createElement("span", {
|
|
299
|
-
className: "".concat(prefixcls, "-label")
|
|
300
|
-
"x-semi-prop": "emptyContent"
|
|
299
|
+
className: "".concat(prefixcls, "-label")
|
|
301
300
|
}, emptyContent || locale.emptyText));
|
|
302
301
|
});
|
|
303
302
|
}
|
|
@@ -29,6 +29,7 @@ interface CheckboxState {
|
|
|
29
29
|
checked: boolean;
|
|
30
30
|
addonId?: string;
|
|
31
31
|
extraId?: string;
|
|
32
|
+
focusVisible?: boolean;
|
|
32
33
|
}
|
|
33
34
|
declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
34
35
|
static contextType: React.Context<CheckboxContextType>;
|
|
@@ -65,8 +66,6 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
65
66
|
context: CheckboxContextType;
|
|
66
67
|
get adapter(): CheckboxAdapter<CheckboxProps, CheckboxState>;
|
|
67
68
|
foundation: CheckboxFoundation;
|
|
68
|
-
addonId: string;
|
|
69
|
-
extraId: string;
|
|
70
69
|
constructor(props: CheckboxProps);
|
|
71
70
|
componentDidUpdate(prevProps: CheckboxProps): void;
|
|
72
71
|
isInGroup(): boolean;
|
|
@@ -74,6 +73,8 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
74
73
|
blur(): void;
|
|
75
74
|
handleChange: React.MouseEventHandler<HTMLSpanElement>;
|
|
76
75
|
handleEnterPress: (e: React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
76
|
+
handleFocusVisible: (event: React.FocusEvent) => void;
|
|
77
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
77
78
|
render(): JSX.Element;
|
|
78
79
|
}
|
|
79
80
|
export default Checkbox;
|
|
@@ -24,11 +24,20 @@ class Checkbox extends BaseComponent {
|
|
|
24
24
|
|
|
25
25
|
this.handleEnterPress = e => this.foundation.handleEnterPress(e);
|
|
26
26
|
|
|
27
|
+
this.handleFocusVisible = event => {
|
|
28
|
+
this.foundation.handleFocusVisible(event);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
this.handleBlur = event => {
|
|
32
|
+
this.foundation.handleBlur();
|
|
33
|
+
};
|
|
34
|
+
|
|
27
35
|
const checked = false;
|
|
28
36
|
this.state = {
|
|
29
37
|
checked: props.checked || props.defaultChecked || checked,
|
|
30
38
|
addonId: props.addonId,
|
|
31
|
-
extraId: props.extraId
|
|
39
|
+
extraId: props.extraId,
|
|
40
|
+
focusVisible: false
|
|
32
41
|
};
|
|
33
42
|
this.checkboxEntity = null;
|
|
34
43
|
this.foundation = new CheckboxFoundation(this.adapter);
|
|
@@ -66,6 +75,14 @@ class Checkbox extends BaseComponent {
|
|
|
66
75
|
prefix: 'extra'
|
|
67
76
|
})
|
|
68
77
|
});
|
|
78
|
+
},
|
|
79
|
+
setFocusVisible: focusVisible => {
|
|
80
|
+
this.setState({
|
|
81
|
+
focusVisible
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
focusCheckboxEntity: () => {
|
|
85
|
+
this.focus();
|
|
69
86
|
}
|
|
70
87
|
});
|
|
71
88
|
}
|
|
@@ -111,7 +128,8 @@ class Checkbox extends BaseComponent {
|
|
|
111
128
|
const {
|
|
112
129
|
checked,
|
|
113
130
|
addonId,
|
|
114
|
-
extraId
|
|
131
|
+
extraId,
|
|
132
|
+
focusVisible
|
|
115
133
|
} = this.state;
|
|
116
134
|
const props = {
|
|
117
135
|
checked,
|
|
@@ -142,6 +160,7 @@ class Checkbox extends BaseComponent {
|
|
|
142
160
|
}
|
|
143
161
|
|
|
144
162
|
const prefix = prefixCls || css.PREFIX;
|
|
163
|
+
const focusOuter = props.isCardType || props.isPureCardType;
|
|
145
164
|
const wrapper = classnames(prefix, {
|
|
146
165
|
["".concat(prefix, "-disabled")]: props.disabled,
|
|
147
166
|
["".concat(prefix, "-indeterminate")]: indeterminate,
|
|
@@ -152,28 +171,24 @@ class Checkbox extends BaseComponent {
|
|
|
152
171
|
["".concat(prefix, "-cardType_unDisabled")]: !(props.disabled && props.isCardType),
|
|
153
172
|
["".concat(prefix, "-cardType_checked")]: props.isCardType && props.checked && !props.disabled,
|
|
154
173
|
["".concat(prefix, "-cardType_checked_disabled")]: props.isCardType && props.checked && props.disabled,
|
|
155
|
-
[className]: Boolean(className)
|
|
174
|
+
[className]: Boolean(className),
|
|
175
|
+
["".concat(prefix, "-focus")]: focusVisible && focusOuter
|
|
156
176
|
});
|
|
157
177
|
const extraCls = classnames("".concat(prefix, "-extra"), {
|
|
158
178
|
["".concat(prefix, "-cardType_extra_noChildren")]: props.isCardType && !children
|
|
159
179
|
});
|
|
160
|
-
const name = inGroup && this.context.checkboxGroup.name;
|
|
161
|
-
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
162
180
|
|
|
163
181
|
const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
|
|
164
|
-
id:
|
|
165
|
-
className: "".concat(prefix, "-addon")
|
|
166
|
-
"x-semi-prop": xSemiPropChildren
|
|
182
|
+
id: addonId,
|
|
183
|
+
className: "".concat(prefix, "-addon")
|
|
167
184
|
}, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
|
|
168
|
-
id:
|
|
169
|
-
className: extraCls
|
|
170
|
-
"x-semi-prop": "extra"
|
|
185
|
+
id: extraId,
|
|
186
|
+
className: extraCls
|
|
171
187
|
}, extra) : null);
|
|
172
188
|
|
|
173
189
|
return (
|
|
174
190
|
/*#__PURE__*/
|
|
175
191
|
// label is better than span, however span is here which is to solve gitlab issue #364
|
|
176
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
177
192
|
React.createElement("span", {
|
|
178
193
|
role: role,
|
|
179
194
|
tabIndex: tabIndex,
|
|
@@ -186,12 +201,15 @@ class Checkbox extends BaseComponent {
|
|
|
186
201
|
onKeyPress: this.handleEnterPress,
|
|
187
202
|
"aria-labelledby": this.props['aria-labelledby']
|
|
188
203
|
}, /*#__PURE__*/React.createElement(CheckboxInner, _Object$assign({}, this.props, props, {
|
|
189
|
-
addonId: children &&
|
|
190
|
-
extraId: extra &&
|
|
204
|
+
addonId: children && addonId,
|
|
205
|
+
extraId: extra && extraId,
|
|
191
206
|
isPureCardType: props.isPureCardType,
|
|
192
207
|
ref: ref => {
|
|
193
208
|
this.checkboxEntity = ref;
|
|
194
|
-
}
|
|
209
|
+
},
|
|
210
|
+
focusInner: focusVisible && !focusOuter,
|
|
211
|
+
onInputFocus: this.handleFocusVisible,
|
|
212
|
+
onInputBlur: this.handleBlur
|
|
195
213
|
})), props.isCardType ? /*#__PURE__*/React.createElement("div", null, renderContent()) : renderContent())
|
|
196
214
|
);
|
|
197
215
|
}
|
|
@@ -16,6 +16,9 @@ export interface CheckboxInnerProps {
|
|
|
16
16
|
addonId?: string;
|
|
17
17
|
extraId?: string;
|
|
18
18
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
19
|
+
focusInner?: boolean;
|
|
20
|
+
onInputFocus?: (e: any) => void;
|
|
21
|
+
onInputBlur?: (e: any) => void;
|
|
19
22
|
}
|
|
20
23
|
declare class CheckboxInner extends PureComponent<CheckboxInnerProps> {
|
|
21
24
|
static contextType: React.Context<import("./context").CheckboxContextType>;
|
|
@@ -34,6 +37,9 @@ declare class CheckboxInner extends PureComponent<CheckboxInnerProps> {
|
|
|
34
37
|
isPureCardType: PropTypes.Requireable<boolean>;
|
|
35
38
|
addonId: PropTypes.Requireable<string>;
|
|
36
39
|
extraId: PropTypes.Requireable<string>;
|
|
40
|
+
focusInner: PropTypes.Requireable<boolean>;
|
|
41
|
+
onInputFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
|
+
onInputBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
43
|
};
|
|
38
44
|
static defaultProps: {
|
|
39
45
|
onChange: (...args: any[]) => void;
|
|
@@ -27,7 +27,10 @@ class CheckboxInner extends PureComponent {
|
|
|
27
27
|
name,
|
|
28
28
|
isPureCardType,
|
|
29
29
|
addonId,
|
|
30
|
-
extraId
|
|
30
|
+
extraId,
|
|
31
|
+
focusInner,
|
|
32
|
+
onInputFocus,
|
|
33
|
+
onInputBlur
|
|
31
34
|
} = this.props;
|
|
32
35
|
const prefix = prefixCls || css.PREFIX;
|
|
33
36
|
const wrapper = classnames({
|
|
@@ -36,7 +39,9 @@ class CheckboxInner extends PureComponent {
|
|
|
36
39
|
["".concat(prefix, "-inner-pureCardType")]: isPureCardType
|
|
37
40
|
}, css.WRAPPER);
|
|
38
41
|
const inner = classnames({
|
|
39
|
-
["".concat(prefix, "-inner-display")]: true
|
|
42
|
+
["".concat(prefix, "-inner-display")]: true,
|
|
43
|
+
["".concat(prefix, "-focus")]: focusInner,
|
|
44
|
+
["".concat(prefix, "-focus-border")]: focusInner && !checked
|
|
40
45
|
});
|
|
41
46
|
const icon = checked ? /*#__PURE__*/React.createElement(IconCheckboxTick, null) : indeterminate ? /*#__PURE__*/React.createElement(IconCheckboxIndeterminate, null) : null;
|
|
42
47
|
const inputProps = {
|
|
@@ -52,7 +57,9 @@ class CheckboxInner extends PureComponent {
|
|
|
52
57
|
className: css.INPUT,
|
|
53
58
|
onChange: _noop,
|
|
54
59
|
checked: checked,
|
|
55
|
-
disabled: disabled
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
onFocus: onInputFocus,
|
|
62
|
+
onBlur: onInputBlur
|
|
56
63
|
};
|
|
57
64
|
name && (inputProps['name'] = name);
|
|
58
65
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -83,7 +90,10 @@ CheckboxInner.propTypes = {
|
|
|
83
90
|
value: PropTypes.any,
|
|
84
91
|
isPureCardType: PropTypes.bool,
|
|
85
92
|
addonId: PropTypes.string,
|
|
86
|
-
extraId: PropTypes.string
|
|
93
|
+
extraId: PropTypes.string,
|
|
94
|
+
focusInner: PropTypes.bool,
|
|
95
|
+
onInputFocus: PropTypes.func,
|
|
96
|
+
onInputBlur: PropTypes.func
|
|
87
97
|
};
|
|
88
98
|
CheckboxInner.defaultProps = {
|
|
89
99
|
onChange: _noop
|