@douyinfe/semi-ui 2.12.0-beta.4 → 2.12.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/avatar/index.tsx +2 -2
- 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/card/index.tsx +43 -41
- package/carousel/CarouselArrow.tsx +2 -0
- package/carousel/index.tsx +1 -0
- package/cascader/index.tsx +101 -123
- 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 +41 -41
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +492 -363
- 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/index.tsx +38 -11
- package/lib/cjs/avatar/index.js +4 -2
- 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 +9 -6
- package/lib/cjs/cascader/item.js +2 -1
- package/lib/cjs/checkbox/checkbox.js +8 -4
- 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.js +9 -5
- 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/modal/confirm.d.ts +5 -5
- 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.js +4 -2
- package/lib/cjs/rating/item.js +2 -1
- package/lib/cjs/scrollList/index.js +6 -3
- package/lib/cjs/select/index.js +8 -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.d.ts +1 -1
- 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 +4 -2
- package/lib/cjs/timePicker/Combobox.js +3 -1
- package/lib/cjs/toast/toast.js +6 -3
- package/lib/cjs/tooltip/TooltipStyledTransition.js +1 -1
- package/lib/cjs/transfer/index.js +2 -1
- package/lib/cjs/tree/treeNode.js +2 -1
- package/lib/cjs/treeSelect/index.js +6 -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/avatar/index.js +4 -2
- 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 +9 -6
- package/lib/es/cascader/item.js +2 -1
- package/lib/es/checkbox/checkbox.js +8 -4
- 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.js +9 -5
- 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/modal/confirm.d.ts +5 -5
- 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.js +4 -2
- package/lib/es/rating/item.js +2 -1
- package/lib/es/scrollList/index.js +6 -3
- package/lib/es/select/index.js +8 -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.d.ts +1 -1
- 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 +4 -2
- package/lib/es/timePicker/Combobox.js +3 -1
- package/lib/es/toast/toast.js +6 -3
- package/lib/es/tooltip/TooltipStyledTransition.js +1 -1
- package/lib/es/transfer/index.js +2 -1
- package/lib/es/tree/treeNode.js +2 -1
- package/lib/es/treeSelect/index.js +6 -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 +9 -9
- package/pagination/index.tsx +16 -2
- package/popconfirm/index.tsx +11 -3
- package/radio/radio.tsx +10 -2
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +19 -3
- package/select/index.tsx +12 -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 +2 -2
- package/timePicker/Combobox.tsx +6 -1
- package/toast/toast.tsx +3 -3
- package/tooltip/TooltipStyledTransition.tsx +1 -1
- package/transfer/index.tsx +1 -0
- package/tree/treeNode.tsx +1 -1
- package/treeSelect/index.tsx +15 -3
- package/typography/base.tsx +1 -1
- package/upload/index.tsx +107 -38
- package/yarn-error.log +26235 -0
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -373,7 +373,8 @@ export default class TreeNode extends PureComponent {
|
|
|
373
373
|
return /*#__PURE__*/React.createElement("ul", {
|
|
374
374
|
className: wrapperCls
|
|
375
375
|
}, /*#__PURE__*/React.createElement("li", {
|
|
376
|
-
className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty")
|
|
376
|
+
className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty"),
|
|
377
|
+
"x-semi-prop": "emptyContent"
|
|
377
378
|
}, emptyContent));
|
|
378
379
|
} // eslint-disable-next-line max-lines-per-function
|
|
379
380
|
|
|
@@ -59,7 +59,8 @@ class TreeSelect extends BaseComponent {
|
|
|
59
59
|
["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
|
|
60
60
|
});
|
|
61
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: suffixWrapperCls
|
|
62
|
+
className: suffixWrapperCls,
|
|
63
|
+
"x-semi-prop": "suffix"
|
|
63
64
|
}, suffix);
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -79,7 +80,8 @@ class TreeSelect extends BaseComponent {
|
|
|
79
80
|
});
|
|
80
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
82
|
className: prefixWrapperCls,
|
|
82
|
-
id: insetLabelId
|
|
83
|
+
id: insetLabelId,
|
|
84
|
+
"x-semi-prop": "prefix,insetLabel"
|
|
83
85
|
}, labelNode);
|
|
84
86
|
};
|
|
85
87
|
|
|
@@ -336,7 +338,8 @@ class TreeSelect extends BaseComponent {
|
|
|
336
338
|
}
|
|
337
339
|
|
|
338
340
|
return arrowIcon ? /*#__PURE__*/React.createElement("div", {
|
|
339
|
-
className: cls("".concat(prefixcls, "-arrow"))
|
|
341
|
+
className: cls("".concat(prefixcls, "-arrow")),
|
|
342
|
+
"x-semi-prop": "arrowIcon"
|
|
340
343
|
}, arrowIcon) : null;
|
|
341
344
|
};
|
|
342
345
|
|
|
@@ -536,7 +536,8 @@ export default class Base extends Component {
|
|
|
536
536
|
|
|
537
537
|
const iconSize = size === 'small' ? 'small' : 'default';
|
|
538
538
|
return /*#__PURE__*/React.createElement("span", {
|
|
539
|
-
className: "".concat(prefixCls, "-icon")
|
|
539
|
+
className: "".concat(prefixCls, "-icon"),
|
|
540
|
+
"x-semi-prop": "icon"
|
|
540
541
|
}, isSemiIcon(icon) ? /*#__PURE__*/React.cloneElement(icon, {
|
|
541
542
|
size: iconSize
|
|
542
543
|
}) : icon);
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -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/es/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;
|
package/lib/es/upload/index.js
CHANGED
|
@@ -230,7 +230,9 @@ class Upload extends BaseComponent {
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps
|
|
233
|
+
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps, {
|
|
234
|
+
"x-semi-prop": "children"
|
|
235
|
+
}), children);
|
|
234
236
|
|
|
235
237
|
if (!showUploadList || !fileList.length) {
|
|
236
238
|
if (showAddTriggerInList) {
|
|
@@ -363,15 +365,18 @@ class Upload extends BaseComponent {
|
|
|
363
365
|
onDragEnter: this.onDragEnter,
|
|
364
366
|
onClick: this.onClick
|
|
365
367
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
366
|
-
className: "".concat(dragAreaBaseCls, "-icon")
|
|
368
|
+
className: "".concat(dragAreaBaseCls, "-icon"),
|
|
369
|
+
"x-semi-prop": "dragIcon"
|
|
367
370
|
}, dragIcon || /*#__PURE__*/React.createElement(IconUpload, {
|
|
368
371
|
size: "extra-large"
|
|
369
372
|
})), /*#__PURE__*/React.createElement("div", {
|
|
370
373
|
className: "".concat(dragAreaBaseCls, "-text")
|
|
371
374
|
}, /*#__PURE__*/React.createElement("div", {
|
|
372
|
-
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
375
|
+
className: "".concat(dragAreaBaseCls, "-main-text"),
|
|
376
|
+
"x-semi-prop": "dragMainText"
|
|
373
377
|
}, dragMainText || locale.mainText), /*#__PURE__*/React.createElement("div", {
|
|
374
|
-
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
378
|
+
className: "".concat(dragAreaBaseCls, "-sub-text"),
|
|
379
|
+
"x-semi-prop": "dragSubText"
|
|
375
380
|
}, dragSubText), /*#__PURE__*/React.createElement("div", {
|
|
376
381
|
className: "".concat(dragAreaBaseCls, "-tips")
|
|
377
382
|
}, dragAreaStatus === strings.DRAG_AREA_LEGAL && /*#__PURE__*/React.createElement("span", {
|
|
@@ -557,9 +562,11 @@ class Upload extends BaseComponent {
|
|
|
557
562
|
className: inputReplaceCls,
|
|
558
563
|
ref: this.replaceInputRef
|
|
559
564
|
}), this.renderAddContent(), prompt ? /*#__PURE__*/React.createElement("div", {
|
|
560
|
-
className: promptCls
|
|
565
|
+
className: promptCls,
|
|
566
|
+
"x-semi-prop": "prompt"
|
|
561
567
|
}, prompt) : null, validateMessage ? /*#__PURE__*/React.createElement("div", {
|
|
562
|
-
className: validateMsgCls
|
|
568
|
+
className: validateMsgCls,
|
|
569
|
+
"x-semi-prop": "validateMessage"
|
|
563
570
|
}, validateMessage) : null, this.renderFileList());
|
|
564
571
|
}
|
|
565
572
|
|
package/list/index.tsx
CHANGED
|
@@ -71,7 +71,11 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
71
71
|
renderEmpty = () => {
|
|
72
72
|
const { emptyContent } = this.props;
|
|
73
73
|
if (emptyContent) {
|
|
74
|
-
return (
|
|
74
|
+
return (
|
|
75
|
+
<div className={`${cssClasses.PREFIX}-empty`} x-semi-prop="emptyContent">
|
|
76
|
+
{emptyContent}
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
75
79
|
} else {
|
|
76
80
|
return (
|
|
77
81
|
<LocaleConsumer componentName="List">
|
|
@@ -152,19 +156,27 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
152
156
|
}
|
|
153
157
|
return (
|
|
154
158
|
<div className={wrapperCls} style={style}>
|
|
155
|
-
{header ?
|
|
159
|
+
{header ? (
|
|
160
|
+
<div className={`${cssClasses.PREFIX}-header`} x-semi-prop="header">
|
|
161
|
+
{header}
|
|
162
|
+
</div>
|
|
163
|
+
) : null}
|
|
156
164
|
<ListContext.Provider
|
|
157
165
|
value={{
|
|
158
166
|
grid,
|
|
159
167
|
onRightClick,
|
|
160
|
-
onClick
|
|
168
|
+
onClick,
|
|
161
169
|
}}
|
|
162
170
|
>
|
|
163
171
|
<Spin spinning={loading} size="large">
|
|
164
172
|
{this.wrapChildren(childrenList, children)}
|
|
165
173
|
</Spin>
|
|
166
174
|
</ListContext.Provider>
|
|
167
|
-
{footer ?
|
|
175
|
+
{footer ? (
|
|
176
|
+
<div className={`${cssClasses.PREFIX}-footer`} x-semi-prop="footer">
|
|
177
|
+
{footer}
|
|
178
|
+
</div>
|
|
179
|
+
) : null}
|
|
168
180
|
{loadMore ? loadMore : null}
|
|
169
181
|
</div>
|
|
170
182
|
);
|
package/modal/ConfirmModal.tsx
CHANGED
package/modal/Modal.tsx
CHANGED
|
@@ -292,6 +292,7 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
292
292
|
type="tertiary"
|
|
293
293
|
autoFocus={true}
|
|
294
294
|
{...this.props.cancelButtonProps}
|
|
295
|
+
x-semi-children-alias="cancelText"
|
|
295
296
|
>
|
|
296
297
|
{cancelText || locale.cancel}
|
|
297
298
|
</Button>
|
|
@@ -311,6 +312,7 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
311
312
|
loading={confirmLoading}
|
|
312
313
|
onClick={this.handleOk}
|
|
313
314
|
{...this.props.okButtonProps}
|
|
315
|
+
x-semi-children-alias="okText"
|
|
314
316
|
>
|
|
315
317
|
{okText || locale.confirm}
|
|
316
318
|
</Button>
|
package/modal/ModalContent.tsx
CHANGED
|
@@ -163,7 +163,7 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
163
163
|
} = this.props;
|
|
164
164
|
let closer;
|
|
165
165
|
if (closable) {
|
|
166
|
-
const iconType = closeIcon || <IconClose/>;
|
|
166
|
+
const iconType = closeIcon || <IconClose x-semi-prop="closeIcon" />;
|
|
167
167
|
closer = (
|
|
168
168
|
<Button
|
|
169
169
|
aria-label="close"
|
|
@@ -182,7 +182,7 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
182
182
|
|
|
183
183
|
renderIcon = () => {
|
|
184
184
|
const { icon } = this.props;
|
|
185
|
-
return icon ? <span className={`${cssClasses.DIALOG}-icon-wrapper`}>{icon}</span> : null;
|
|
185
|
+
return icon ? <span className={`${cssClasses.DIALOG}-icon-wrapper`} x-semi-prop="icon">{icon}</span> : null;
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
renderHeader = () => {
|
|
@@ -197,8 +197,14 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
197
197
|
(
|
|
198
198
|
<div className={`${cssClasses.DIALOG}-header`}>
|
|
199
199
|
{icon}
|
|
200
|
-
<Typography.Title
|
|
201
|
-
|
|
200
|
+
<Typography.Title
|
|
201
|
+
heading={5}
|
|
202
|
+
className={`${cssClasses.DIALOG}-title`}
|
|
203
|
+
id={`${cssClasses.DIALOG}-title`}
|
|
204
|
+
x-semi-prop="title"
|
|
205
|
+
>
|
|
206
|
+
{title}
|
|
207
|
+
</Typography.Title>
|
|
202
208
|
{closer}
|
|
203
209
|
</div>
|
|
204
210
|
);
|
|
@@ -216,16 +222,19 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
216
222
|
const closer = this.renderCloseBtn();
|
|
217
223
|
const icon = this.renderIcon();
|
|
218
224
|
const hasHeader = title !== null && title !== undefined || 'header' in this.props;
|
|
219
|
-
return hasHeader ?
|
|
220
|
-
<div className={bodyCls} id={`${cssClasses.DIALOG}-body`} style={bodyStyle}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
return hasHeader ? (
|
|
226
|
+
<div className={bodyCls} id={`${cssClasses.DIALOG}-body`} style={bodyStyle} x-semi-prop="children">
|
|
227
|
+
{children}
|
|
228
|
+
</div>
|
|
229
|
+
) : (
|
|
230
|
+
<div className={`${cssClasses.DIALOG}-body-wrapper`}>
|
|
231
|
+
{icon}
|
|
232
|
+
<div className={bodyCls} style={bodyStyle} x-semi-prop="children">
|
|
233
|
+
{children}
|
|
226
234
|
</div>
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
{closer}
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
229
238
|
};
|
|
230
239
|
|
|
231
240
|
getDialogElement = () => {
|
|
@@ -248,7 +257,11 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
248
257
|
}
|
|
249
258
|
const body = this.renderBody();
|
|
250
259
|
const header = this.renderHeader();
|
|
251
|
-
const footer = props.footer ?
|
|
260
|
+
const footer = props.footer ? (
|
|
261
|
+
<div className={`${cssClasses.DIALOG}-footer`} x-semi-prop="footer">
|
|
262
|
+
{props.footer}
|
|
263
|
+
</div>
|
|
264
|
+
) : null;
|
|
252
265
|
const dialogElement = (
|
|
253
266
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
254
267
|
<div
|
package/notification/notice.tsx
CHANGED
|
@@ -106,7 +106,7 @@ class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
|
|
|
106
106
|
}
|
|
107
107
|
if (iconType) {
|
|
108
108
|
return (
|
|
109
|
-
<div className={iconCls}>
|
|
109
|
+
<div className={iconCls} x-semi-prop="icon">
|
|
110
110
|
{isSemiIcon(iconType) ? React.cloneElement(iconType, { size: iconType.props.size || 'large' }) : iconType}
|
|
111
111
|
</div>
|
|
112
112
|
);
|
|
@@ -170,14 +170,26 @@ class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
|
|
|
170
170
|
<div>{this.renderTypeIcon()}</div>
|
|
171
171
|
<div className={`${prefixCls}-inner`}>
|
|
172
172
|
<div className={`${prefixCls}-content-wrapper`}>
|
|
173
|
-
{title ?
|
|
174
|
-
|
|
173
|
+
{title ? (
|
|
174
|
+
<div id={titleID} className={`${prefixCls}-title`} x-semi-prop="title">
|
|
175
|
+
{title}
|
|
176
|
+
</div>
|
|
177
|
+
) : (
|
|
178
|
+
''
|
|
179
|
+
)}
|
|
180
|
+
{content ? (
|
|
181
|
+
<div className={`${prefixCls}-content`} x-semi-prop="content">
|
|
182
|
+
{content}
|
|
183
|
+
</div>
|
|
184
|
+
) : (
|
|
185
|
+
''
|
|
186
|
+
)}
|
|
175
187
|
</div>
|
|
176
188
|
{showClose && (
|
|
177
189
|
<Button
|
|
178
190
|
className={`${prefixCls}-icon-close`}
|
|
179
191
|
type="tertiary"
|
|
180
|
-
icon={<IconClose/>}
|
|
192
|
+
icon={<IconClose />}
|
|
181
193
|
theme="borderless"
|
|
182
194
|
size="small"
|
|
183
195
|
onClick={this.close}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.1-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
|
-
"@douyinfe/semi-animation": "2.12.
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.12.
|
|
19
|
-
"@douyinfe/semi-foundation": "2.12.
|
|
20
|
-
"@douyinfe/semi-icons": "2.12.
|
|
21
|
-
"@douyinfe/semi-illustrations": "2.12.
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.12.
|
|
17
|
+
"@douyinfe/semi-animation": "^2.12.1-alpha.0",
|
|
18
|
+
"@douyinfe/semi-animation-react": "^2.12.1-alpha.0",
|
|
19
|
+
"@douyinfe/semi-foundation": "^2.12.1-alpha.0",
|
|
20
|
+
"@douyinfe/semi-icons": "^2.12.1-alpha.0",
|
|
21
|
+
"@douyinfe/semi-illustrations": "^2.12.1-alpha.0",
|
|
22
|
+
"@douyinfe/semi-theme-default": "^2.12.1-alpha.0",
|
|
23
23
|
"@types/react-window": "^1.8.2",
|
|
24
24
|
"async-validator": "^3.5.0",
|
|
25
25
|
"classnames": "^2.2.6",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b3349c126a25ce2e5fd7e06d97118d4058566a55",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.12.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "^2.12.1-alpha.0",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"babel-loader": "^8.2.2",
|
package/pagination/index.tsx
CHANGED
|
@@ -216,7 +216,14 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
216
216
|
[`${prefixCls}-item-disabled`]: prevDisabled,
|
|
217
217
|
});
|
|
218
218
|
return (
|
|
219
|
-
<li
|
|
219
|
+
<li
|
|
220
|
+
role="button"
|
|
221
|
+
aria-disabled={prevDisabled ? true : false}
|
|
222
|
+
aria-label="Previous"
|
|
223
|
+
onClick={e => !prevDisabled && this.foundation.goPrev(e)}
|
|
224
|
+
className={preClassName}
|
|
225
|
+
x-semi-prop="prevText"
|
|
226
|
+
>
|
|
220
227
|
{prevText || <IconChevronLeft size="large" />}
|
|
221
228
|
</li>
|
|
222
229
|
);
|
|
@@ -231,7 +238,14 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
231
238
|
[`${prefixCls}-next`]: true,
|
|
232
239
|
});
|
|
233
240
|
return (
|
|
234
|
-
<li
|
|
241
|
+
<li
|
|
242
|
+
role="button"
|
|
243
|
+
aria-disabled={nextDisabled ? true : false}
|
|
244
|
+
aria-label="Next"
|
|
245
|
+
onClick={e => !nextDisabled && this.foundation.goNext(e)}
|
|
246
|
+
className={nextClassName}
|
|
247
|
+
x-semi-prop="prevText"
|
|
248
|
+
>
|
|
235
249
|
{nextText || <IconChevronRight size="large" />}
|
|
236
250
|
</li>
|
|
237
251
|
);
|
package/popconfirm/index.tsx
CHANGED
|
@@ -174,12 +174,20 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
174
174
|
<div className={popCardCls} onClick={this.stopImmediatePropagation} style={style}>
|
|
175
175
|
<div className={`${prefixCls}-inner`}>
|
|
176
176
|
<div className={`${prefixCls}-header`}>
|
|
177
|
-
<i className={`${prefixCls}-header-icon`}>
|
|
177
|
+
<i className={`${prefixCls}-header-icon`} x-semi-prop="icon">
|
|
178
178
|
{React.isValidElement(icon) ? icon : null}
|
|
179
179
|
</i>
|
|
180
180
|
<div className={`${prefixCls}-header-body`}>
|
|
181
|
-
{showTitle ?
|
|
182
|
-
|
|
181
|
+
{showTitle ? (
|
|
182
|
+
<div className={`${prefixCls}-header-title`} x-semi-prop="title">
|
|
183
|
+
{title}
|
|
184
|
+
</div>
|
|
185
|
+
) : null}
|
|
186
|
+
{showContent ? (
|
|
187
|
+
<div className={`${prefixCls}-header-content`} x-semi-prop="content">
|
|
188
|
+
{content}
|
|
189
|
+
</div>
|
|
190
|
+
) : null}
|
|
183
191
|
</div>
|
|
184
192
|
<Button
|
|
185
193
|
className={`${prefixCls}-btn-close`}
|
package/radio/radio.tsx
CHANGED
|
@@ -228,8 +228,16 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
228
228
|
}, addonClassName);
|
|
229
229
|
const renderContent = () => (
|
|
230
230
|
<>
|
|
231
|
-
{children ?
|
|
232
|
-
|
|
231
|
+
{children ? (
|
|
232
|
+
<span className={addonCls} style={addonStyle} id={this.addonId} x-semi-prop="children">
|
|
233
|
+
{children}
|
|
234
|
+
</span>
|
|
235
|
+
) : null}
|
|
236
|
+
{extra && !isButtonRadio ? (
|
|
237
|
+
<div className={`${prefix}-extra`} id={this.extraId} x-semi-prop="extra">
|
|
238
|
+
{extra}
|
|
239
|
+
</div>
|
|
240
|
+
) : null}
|
|
233
241
|
</>
|
|
234
242
|
);
|
|
235
243
|
return (
|
package/rating/item.tsx
CHANGED
|
@@ -110,7 +110,7 @@ export default class Item extends PureComponent<RatingItemProps> {
|
|
|
110
110
|
className={`${prefixCls}-wrapper`}
|
|
111
111
|
>
|
|
112
112
|
<div className={`${prefixCls}-first`} style={{ width: `${firstWidth * 100}%` }}>{content}</div>
|
|
113
|
-
<div className={`${prefixCls}-second`}>{content}</div>
|
|
113
|
+
<div className={`${prefixCls}-second`} x-semi-prop="character">{content}</div>
|
|
114
114
|
</div>
|
|
115
115
|
</li>
|
|
116
116
|
);
|
package/scrollList/index.tsx
CHANGED
|
@@ -49,14 +49,30 @@ class ScrollList extends BaseComponent<ScrollListProps, {}> {
|
|
|
49
49
|
<div className={clsWrapper} style={style}>
|
|
50
50
|
{header ? (
|
|
51
51
|
<div className={clsHeader}>
|
|
52
|
-
<div
|
|
52
|
+
<div
|
|
53
|
+
className={`${clsHeader}-title`}
|
|
54
|
+
x-semi-prop={this.props['x-semi-header-alias'] || "header"}
|
|
55
|
+
>
|
|
56
|
+
{header}
|
|
57
|
+
</div>
|
|
53
58
|
<div className={`${clsWrapper}-line`} />
|
|
54
59
|
</div>
|
|
55
60
|
) : null}
|
|
56
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
className={`${clsWrapper}-body`}
|
|
63
|
+
style={{ height: bodyHeight ? bodyHeight : '' }}
|
|
64
|
+
x-semi-prop="children"
|
|
65
|
+
>
|
|
57
66
|
{children}
|
|
58
67
|
</div>
|
|
59
|
-
{footer ?
|
|
68
|
+
{footer ? (
|
|
69
|
+
<div
|
|
70
|
+
className={`${clsWrapper}-footer`}
|
|
71
|
+
x-semi-prop={this.props['x-semi-footer-alias'] || "footer"}
|
|
72
|
+
>
|
|
73
|
+
{footer}
|
|
74
|
+
</div>
|
|
75
|
+
) : null}
|
|
60
76
|
</div>
|
|
61
77
|
);
|
|
62
78
|
}
|
package/select/index.tsx
CHANGED
|
@@ -878,7 +878,11 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
878
878
|
return (
|
|
879
879
|
<>
|
|
880
880
|
<div className={contentWrapperCls}>
|
|
881
|
-
{
|
|
881
|
+
{
|
|
882
|
+
<span className={spanCls} x-semi-prop="placeholder">
|
|
883
|
+
{renderText || renderText === 0 ? renderText : placeholder}
|
|
884
|
+
</span>
|
|
885
|
+
}
|
|
882
886
|
{filterable && showInput ? this.renderInput() : null}
|
|
883
887
|
</div>
|
|
884
888
|
</>
|
|
@@ -1006,7 +1010,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1006
1010
|
[`${prefixcls}-suffix-text`]: suffix && isString(suffix),
|
|
1007
1011
|
[`${prefixcls}-suffix-icon`]: isSemiIcon(suffix),
|
|
1008
1012
|
});
|
|
1009
|
-
return <div className={suffixWrapperCls}>{suffix}</div>;
|
|
1013
|
+
return <div className={suffixWrapperCls} x-semi-prop="suffix">{suffix}</div>;
|
|
1010
1014
|
}
|
|
1011
1015
|
|
|
1012
1016
|
renderPrefix() {
|
|
@@ -1020,7 +1024,11 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1020
1024
|
[`${prefixcls}-prefix-icon`]: isSemiIcon(labelNode),
|
|
1021
1025
|
});
|
|
1022
1026
|
|
|
1023
|
-
return
|
|
1027
|
+
return (
|
|
1028
|
+
<div className={prefixWrapperCls} id={insetLabelId} x-semi-prop="prefix,insetLabel">
|
|
1029
|
+
{labelNode}
|
|
1030
|
+
</div>
|
|
1031
|
+
);
|
|
1024
1032
|
}
|
|
1025
1033
|
|
|
1026
1034
|
renderSelection() {
|
|
@@ -1067,7 +1075,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1067
1075
|
(selections.size || inputValue) && !disabled && (isHovering || isOpen);
|
|
1068
1076
|
|
|
1069
1077
|
const arrowContent = showArrow ? (
|
|
1070
|
-
<div className={`${prefixcls}-arrow`}>
|
|
1078
|
+
<div className={`${prefixcls}-arrow`} x-semi-prop="arrowIcon">
|
|
1071
1079
|
{arrowIcon}
|
|
1072
1080
|
</div>
|
|
1073
1081
|
) : (
|
package/select/option.tsx
CHANGED
|
@@ -105,7 +105,11 @@ class Option extends PureComponent<OptionProps> {
|
|
|
105
105
|
}
|
|
106
106
|
return (
|
|
107
107
|
<LocaleConsumer<Locale['Select']> componentName="Select">
|
|
108
|
-
{(locale: Locale['Select']) =>
|
|
108
|
+
{(locale: Locale['Select']) => (
|
|
109
|
+
<div className={optionClassName} x-semi-prop="emptyContent">
|
|
110
|
+
{emptyContent || locale.emptyText}
|
|
111
|
+
</div>
|
|
112
|
+
)}
|
|
109
113
|
</LocaleConsumer>
|
|
110
114
|
);
|
|
111
115
|
}
|
|
@@ -88,7 +88,7 @@ export default class SideSheetContent extends React.PureComponent<SideSheetConte
|
|
|
88
88
|
let header, closer;
|
|
89
89
|
if (title) {
|
|
90
90
|
header = (
|
|
91
|
-
<div className={`${prefixCls}-title`}>
|
|
91
|
+
<div className={`${prefixCls}-title`} x-semi-prop="title">
|
|
92
92
|
{this.props.title}
|
|
93
93
|
</div>
|
|
94
94
|
);
|
|
@@ -140,11 +140,11 @@ export default class SideSheetContent extends React.PureComponent<SideSheetConte
|
|
|
140
140
|
>
|
|
141
141
|
<div className={`${prefixCls}-content`}>
|
|
142
142
|
{header}
|
|
143
|
-
<div className={`${prefixCls}-body`} style={props.bodyStyle}>
|
|
143
|
+
<div className={`${prefixCls}-body`} style={props.bodyStyle} x-semi-prop="children">
|
|
144
144
|
{props.children}
|
|
145
145
|
</div>
|
|
146
146
|
{props.footer ? (
|
|
147
|
-
<div className={`${prefixCls}-footer`}>
|
|
147
|
+
<div className={`${prefixCls}-footer`} x-semi-prop="footer">
|
|
148
148
|
{props.footer}
|
|
149
149
|
</div>
|
|
150
150
|
) : null}
|
package/skeleton/index.tsx
CHANGED
|
@@ -48,7 +48,7 @@ class Skeleton extends PureComponent<SkeletonProps> {
|
|
|
48
48
|
let content;
|
|
49
49
|
if (loading) {
|
|
50
50
|
content = (
|
|
51
|
-
<div className={skCls} style={style} {...others}>
|
|
51
|
+
<div className={skCls} style={style} {...others} x-semi-prop="placeholder">
|
|
52
52
|
{placeholder}
|
|
53
53
|
</div>
|
|
54
54
|
);
|
package/space/index.tsx
CHANGED
|
@@ -85,7 +85,7 @@ class Space extends PureComponent<SpaceProps> {
|
|
|
85
85
|
});
|
|
86
86
|
const childrenNodes = flatten(children);
|
|
87
87
|
return (
|
|
88
|
-
<div className={classNames} style={realStyle}>
|
|
88
|
+
<div className={classNames} style={realStyle} x-semi-prop="children">
|
|
89
89
|
{childrenNodes}
|
|
90
90
|
</div>
|
|
91
91
|
);
|
package/spin/index.tsx
CHANGED
|
@@ -95,14 +95,18 @@ class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
95
95
|
[`${prefixCls}-animate`]: loading,
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
return loading ? (
|
|
99
|
+
<div className={`${prefixCls}-wrapper`}>
|
|
100
|
+
{indicator ? (
|
|
101
|
+
<div className={spinIconCls} x-semi-prop="indicator">
|
|
102
|
+
{indicator}
|
|
103
|
+
</div>
|
|
104
|
+
) : (
|
|
105
|
+
<SpinIcon />
|
|
106
|
+
)}
|
|
107
|
+
{tip ? <div x-semi-prop="tip">{tip}</div> : null}
|
|
108
|
+
</div>
|
|
109
|
+
) : null;
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
render() {
|
|
@@ -122,7 +126,9 @@ class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
122
126
|
return (
|
|
123
127
|
<div className={spinCls} style={style}>
|
|
124
128
|
{this.renderSpin()}
|
|
125
|
-
<div className={`${prefixCls}-children`} style={childStyle}
|
|
129
|
+
<div className={`${prefixCls}-children`} style={childStyle} x-semi-prop="children">
|
|
130
|
+
{children}
|
|
131
|
+
</div>
|
|
126
132
|
</div>
|
|
127
133
|
);
|
|
128
134
|
}
|