@douyinfe/semi-ui 2.12.1-alpha.1 → 2.13.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 +126 -102
- 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 +31 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5321 -3696
- 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/gulpfile.js +5 -5
- 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/_base/base.css +22 -0
- 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.js +3 -13
- 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 +10 -11
- 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 +50 -17
- 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.js +1 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +2 -2
- package/lib/cjs/upload/index.js +6 -13
- package/lib/es/_base/base.css +22 -0
- 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.js +3 -11
- 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 +10 -11
- 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 +47 -17
- 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.js +1 -2
- package/lib/es/typography/title.d.ts +1 -1
- 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/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +4 -9
- package/tabs/_story/tabs.stories.js +36 -0
- package/tag/_story/tag.stories.js +1 -1
- package/tagInput/index.tsx +47 -22
- 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/_story/upload.stories.js +152 -0
- package/upload/index.tsx +38 -107
- package/yarn-error.log +0 -26235
package/lib/es/upload/index.js
CHANGED
|
@@ -230,9 +230,7 @@ class Upload extends BaseComponent {
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps,
|
|
234
|
-
"x-semi-prop": "children"
|
|
235
|
-
}), children);
|
|
233
|
+
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps), children);
|
|
236
234
|
|
|
237
235
|
if (!showUploadList || !fileList.length) {
|
|
238
236
|
if (showAddTriggerInList) {
|
|
@@ -365,18 +363,15 @@ class Upload extends BaseComponent {
|
|
|
365
363
|
onDragEnter: this.onDragEnter,
|
|
366
364
|
onClick: this.onClick
|
|
367
365
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
368
|
-
className: "".concat(dragAreaBaseCls, "-icon")
|
|
369
|
-
"x-semi-prop": "dragIcon"
|
|
366
|
+
className: "".concat(dragAreaBaseCls, "-icon")
|
|
370
367
|
}, dragIcon || /*#__PURE__*/React.createElement(IconUpload, {
|
|
371
368
|
size: "extra-large"
|
|
372
369
|
})), /*#__PURE__*/React.createElement("div", {
|
|
373
370
|
className: "".concat(dragAreaBaseCls, "-text")
|
|
374
371
|
}, /*#__PURE__*/React.createElement("div", {
|
|
375
|
-
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
376
|
-
"x-semi-prop": "dragMainText"
|
|
372
|
+
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
377
373
|
}, dragMainText || locale.mainText), /*#__PURE__*/React.createElement("div", {
|
|
378
|
-
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
379
|
-
"x-semi-prop": "dragSubText"
|
|
374
|
+
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
380
375
|
}, dragSubText), /*#__PURE__*/React.createElement("div", {
|
|
381
376
|
className: "".concat(dragAreaBaseCls, "-tips")
|
|
382
377
|
}, dragAreaStatus === strings.DRAG_AREA_LEGAL && /*#__PURE__*/React.createElement("span", {
|
|
@@ -562,11 +557,9 @@ class Upload extends BaseComponent {
|
|
|
562
557
|
className: inputReplaceCls,
|
|
563
558
|
ref: this.replaceInputRef
|
|
564
559
|
}), this.renderAddContent(), prompt ? /*#__PURE__*/React.createElement("div", {
|
|
565
|
-
className: promptCls
|
|
566
|
-
"x-semi-prop": "prompt"
|
|
560
|
+
className: promptCls
|
|
567
561
|
}, prompt) : null, validateMessage ? /*#__PURE__*/React.createElement("div", {
|
|
568
|
-
className: validateMsgCls
|
|
569
|
-
"x-semi-prop": "validateMessage"
|
|
562
|
+
className: validateMsgCls
|
|
570
563
|
}, validateMessage) : null, this.renderFileList());
|
|
571
564
|
}
|
|
572
565
|
|
package/list/index.tsx
CHANGED
|
@@ -71,11 +71,7 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
71
71
|
renderEmpty = () => {
|
|
72
72
|
const { emptyContent } = this.props;
|
|
73
73
|
if (emptyContent) {
|
|
74
|
-
return (
|
|
75
|
-
<div className={`${cssClasses.PREFIX}-empty`} x-semi-prop="emptyContent">
|
|
76
|
-
{emptyContent}
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
74
|
+
return (<div className={`${cssClasses.PREFIX}-empty`}>{emptyContent}</div>);
|
|
79
75
|
} else {
|
|
80
76
|
return (
|
|
81
77
|
<LocaleConsumer componentName="List">
|
|
@@ -156,27 +152,19 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
156
152
|
}
|
|
157
153
|
return (
|
|
158
154
|
<div className={wrapperCls} style={style}>
|
|
159
|
-
{header ?
|
|
160
|
-
<div className={`${cssClasses.PREFIX}-header`} x-semi-prop="header">
|
|
161
|
-
{header}
|
|
162
|
-
</div>
|
|
163
|
-
) : null}
|
|
155
|
+
{header ? <div className={`${cssClasses.PREFIX}-header`}>{header}</div> : null}
|
|
164
156
|
<ListContext.Provider
|
|
165
157
|
value={{
|
|
166
158
|
grid,
|
|
167
159
|
onRightClick,
|
|
168
|
-
onClick
|
|
160
|
+
onClick
|
|
169
161
|
}}
|
|
170
162
|
>
|
|
171
163
|
<Spin spinning={loading} size="large">
|
|
172
164
|
{this.wrapChildren(childrenList, children)}
|
|
173
165
|
</Spin>
|
|
174
166
|
</ListContext.Provider>
|
|
175
|
-
{footer ?
|
|
176
|
-
<div className={`${cssClasses.PREFIX}-footer`} x-semi-prop="footer">
|
|
177
|
-
{footer}
|
|
178
|
-
</div>
|
|
179
|
-
) : null}
|
|
167
|
+
{footer ? <div className={`${cssClasses.PREFIX}-footer`}>{footer}</div> : null}
|
|
180
168
|
{loadMore ? loadMore : null}
|
|
181
169
|
</div>
|
|
182
170
|
);
|
package/modal/ConfirmModal.tsx
CHANGED
package/modal/Modal.tsx
CHANGED
|
@@ -292,7 +292,6 @@ 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"
|
|
296
295
|
>
|
|
297
296
|
{cancelText || locale.cancel}
|
|
298
297
|
</Button>
|
|
@@ -312,7 +311,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
312
311
|
loading={confirmLoading}
|
|
313
312
|
onClick={this.handleOk}
|
|
314
313
|
{...this.props.okButtonProps}
|
|
315
|
-
x-semi-children-alias="okText"
|
|
316
314
|
>
|
|
317
315
|
{okText || locale.confirm}
|
|
318
316
|
</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/>;
|
|
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`}
|
|
185
|
+
return icon ? <span className={`${cssClasses.DIALOG}-icon-wrapper`}>{icon}</span> : null;
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
renderHeader = () => {
|
|
@@ -197,14 +197,8 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
197
197
|
(
|
|
198
198
|
<div className={`${cssClasses.DIALOG}-header`}>
|
|
199
199
|
{icon}
|
|
200
|
-
<Typography.Title
|
|
201
|
-
|
|
202
|
-
className={`${cssClasses.DIALOG}-title`}
|
|
203
|
-
id={`${cssClasses.DIALOG}-title`}
|
|
204
|
-
x-semi-prop="title"
|
|
205
|
-
>
|
|
206
|
-
{title}
|
|
207
|
-
</Typography.Title>
|
|
200
|
+
<Typography.Title heading={5} className={`${cssClasses.DIALOG}-title`}
|
|
201
|
+
id={`${cssClasses.DIALOG}-title`}>{title}</Typography.Title>
|
|
208
202
|
{closer}
|
|
209
203
|
</div>
|
|
210
204
|
);
|
|
@@ -222,19 +216,16 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
222
216
|
const closer = this.renderCloseBtn();
|
|
223
217
|
const icon = this.renderIcon();
|
|
224
218
|
const hasHeader = title !== null && title !== undefined || 'header' in this.props;
|
|
225
|
-
return hasHeader ?
|
|
226
|
-
<div className={bodyCls} id={`${cssClasses.DIALOG}-body`} style={bodyStyle}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
<div className={bodyCls} style={bodyStyle} x-semi-prop="children">
|
|
233
|
-
{children}
|
|
219
|
+
return hasHeader ?
|
|
220
|
+
<div className={bodyCls} id={`${cssClasses.DIALOG}-body`} style={bodyStyle}>{children}</div> :
|
|
221
|
+
(
|
|
222
|
+
<div className={`${cssClasses.DIALOG}-body-wrapper`}>
|
|
223
|
+
{icon}
|
|
224
|
+
<div className={bodyCls} style={bodyStyle}>{children}</div>
|
|
225
|
+
{closer}
|
|
234
226
|
</div>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
);
|
|
227
|
+
);
|
|
228
|
+
|
|
238
229
|
};
|
|
239
230
|
|
|
240
231
|
getDialogElement = () => {
|
|
@@ -257,11 +248,7 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
257
248
|
}
|
|
258
249
|
const body = this.renderBody();
|
|
259
250
|
const header = this.renderHeader();
|
|
260
|
-
const footer = props.footer ?
|
|
261
|
-
<div className={`${cssClasses.DIALOG}-footer`} x-semi-prop="footer">
|
|
262
|
-
{props.footer}
|
|
263
|
-
</div>
|
|
264
|
-
) : null;
|
|
251
|
+
const footer = props.footer ? <div className={`${cssClasses.DIALOG}-footer`}>{props.footer}</div> : null;
|
|
265
252
|
const dialogElement = (
|
|
266
253
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
267
254
|
<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}>
|
|
110
110
|
{isSemiIcon(iconType) ? React.cloneElement(iconType, { size: iconType.props.size || 'large' }) : iconType}
|
|
111
111
|
</div>
|
|
112
112
|
);
|
|
@@ -170,26 +170,14 @@ 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
|
-
|
|
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
|
-
)}
|
|
173
|
+
{title ? <div id={titleID} className={`${prefixCls}-title`}>{title}</div> : ''}
|
|
174
|
+
{content ? <div className={`${prefixCls}-content`}>{content}</div> : ''}
|
|
187
175
|
</div>
|
|
188
176
|
{showClose && (
|
|
189
177
|
<Button
|
|
190
178
|
className={`${prefixCls}-icon-close`}
|
|
191
179
|
type="tertiary"
|
|
192
|
-
icon={<IconClose
|
|
180
|
+
icon={<IconClose/>}
|
|
193
181
|
theme="borderless"
|
|
194
182
|
size="small"
|
|
195
183
|
onClick={this.close}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.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": "
|
|
18
|
-
"@douyinfe/semi-animation-react": "
|
|
19
|
-
"@douyinfe/semi-foundation": "
|
|
20
|
-
"@douyinfe/semi-icons": "
|
|
21
|
-
"@douyinfe/semi-illustrations": "
|
|
22
|
-
"@douyinfe/semi-theme-default": "
|
|
17
|
+
"@douyinfe/semi-animation": "2.12.0",
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.13.0",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.13.0",
|
|
20
|
+
"@douyinfe/semi-icons": "2.13.0",
|
|
21
|
+
"@douyinfe/semi-illustrations": "2.13.0",
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.13.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": "27671f7d0a04e5569c6bf16c0c6ea6c547a77016",
|
|
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": "
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.13.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,14 +216,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
216
216
|
[`${prefixCls}-item-disabled`]: prevDisabled,
|
|
217
217
|
});
|
|
218
218
|
return (
|
|
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
|
-
>
|
|
219
|
+
<li role="button" aria-disabled={prevDisabled ? true : false} aria-label="Previous" onClick={e => !prevDisabled && this.foundation.goPrev(e)} className={preClassName}>
|
|
227
220
|
{prevText || <IconChevronLeft size="large" />}
|
|
228
221
|
</li>
|
|
229
222
|
);
|
|
@@ -238,14 +231,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
238
231
|
[`${prefixCls}-next`]: true,
|
|
239
232
|
});
|
|
240
233
|
return (
|
|
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
|
-
>
|
|
234
|
+
<li role="button" aria-disabled={nextDisabled ? true : false} aria-label="Next" onClick={e => !nextDisabled && this.foundation.goNext(e)} className={nextClassName}>
|
|
249
235
|
{nextText || <IconChevronRight size="large" />}
|
|
250
236
|
</li>
|
|
251
237
|
);
|
package/popconfirm/index.tsx
CHANGED
|
@@ -174,20 +174,12 @@ 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`}>
|
|
178
178
|
{React.isValidElement(icon) ? icon : null}
|
|
179
179
|
</i>
|
|
180
180
|
<div className={`${prefixCls}-header-body`}>
|
|
181
|
-
{showTitle ?
|
|
182
|
-
|
|
183
|
-
{title}
|
|
184
|
-
</div>
|
|
185
|
-
) : null}
|
|
186
|
-
{showContent ? (
|
|
187
|
-
<div className={`${prefixCls}-header-content`} x-semi-prop="content">
|
|
188
|
-
{content}
|
|
189
|
-
</div>
|
|
190
|
-
) : null}
|
|
181
|
+
{showTitle ? <div className={`${prefixCls}-header-title`}>{title}</div> : null}
|
|
182
|
+
{showContent ? <div className={`${prefixCls}-header-content`}>{content}</div> : null}
|
|
191
183
|
</div>
|
|
192
184
|
<Button
|
|
193
185
|
className={`${prefixCls}-btn-close`}
|
package/popover/index.tsx
CHANGED
|
@@ -44,6 +44,7 @@ export interface PopoverProps extends BaseProps {
|
|
|
44
44
|
guardFocus?: TooltipProps['guardFocus'];
|
|
45
45
|
returnFocusOnClose?: TooltipProps['returnFocusOnClose'];
|
|
46
46
|
onEscKeyDown?: TooltipProps['onEscKeyDown'];
|
|
47
|
+
clickToHide?:TooltipProps['clickToHide']
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
export interface PopoverState {
|
|
@@ -175,5 +176,4 @@ class Popover extends React.PureComponent<PopoverProps, PopoverState> {
|
|
|
175
176
|
);
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
|
|
179
179
|
export default Popover;
|
package/radio/radio.tsx
CHANGED
|
@@ -228,16 +228,8 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
228
228
|
}, addonClassName);
|
|
229
229
|
const renderContent = () => (
|
|
230
230
|
<>
|
|
231
|
-
{children ?
|
|
232
|
-
|
|
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}
|
|
231
|
+
{children ? <span className={addonCls} style={addonStyle} id={addonId}>{children}</span> : null}
|
|
232
|
+
{extra && !isButtonRadio ? <div className={`${prefix}-extra`} id={extraId}>{extra}</div> : null}
|
|
241
233
|
</>
|
|
242
234
|
);
|
|
243
235
|
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`}
|
|
113
|
+
<div className={`${prefixCls}-second`}>{content}</div>
|
|
114
114
|
</div>
|
|
115
115
|
</li>
|
|
116
116
|
);
|
package/scrollList/index.tsx
CHANGED
|
@@ -49,30 +49,14 @@ class ScrollList extends BaseComponent<ScrollListProps, {}> {
|
|
|
49
49
|
<div className={clsWrapper} style={style}>
|
|
50
50
|
{header ? (
|
|
51
51
|
<div className={clsHeader}>
|
|
52
|
-
<div
|
|
53
|
-
className={`${clsHeader}-title`}
|
|
54
|
-
x-semi-prop={this.props['x-semi-header-alias'] || "header"}
|
|
55
|
-
>
|
|
56
|
-
{header}
|
|
57
|
-
</div>
|
|
52
|
+
<div className={`${clsHeader}-title`}>{header}</div>
|
|
58
53
|
<div className={`${clsWrapper}-line`} />
|
|
59
54
|
</div>
|
|
60
55
|
) : null}
|
|
61
|
-
<div
|
|
62
|
-
className={`${clsWrapper}-body`}
|
|
63
|
-
style={{ height: bodyHeight ? bodyHeight : '' }}
|
|
64
|
-
x-semi-prop="children"
|
|
65
|
-
>
|
|
56
|
+
<div className={`${clsWrapper}-body`} style={{ height: bodyHeight ? bodyHeight : '' }}>
|
|
66
57
|
{children}
|
|
67
58
|
</div>
|
|
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}
|
|
59
|
+
{footer ? <div className={`${clsWrapper}-footer`}>{footer}</div> : null}
|
|
76
60
|
</div>
|
|
77
61
|
);
|
|
78
62
|
}
|
|
@@ -759,7 +759,9 @@ export const SelectFilterSingle = () => (
|
|
|
759
759
|
width: '250px',
|
|
760
760
|
margin: 10,
|
|
761
761
|
}}
|
|
762
|
+
showClear
|
|
762
763
|
autoFocus
|
|
764
|
+
onSearch={(val) => console.log(`onSearch:${val}`)}
|
|
763
765
|
onFocus={() => console.log('onFocus')}
|
|
764
766
|
onBlur={() => console.log('onBlur')}
|
|
765
767
|
>
|
|
@@ -783,7 +785,9 @@ export const SelectFilterSingle = () => (
|
|
|
783
785
|
margin: 10,
|
|
784
786
|
}}
|
|
785
787
|
filter={filter}
|
|
788
|
+
showClear
|
|
786
789
|
onBlur={() => console.log('onBlur')}
|
|
790
|
+
onSearch={val => console.log(val)}
|
|
787
791
|
onFocus={() => console.log('onFocus')}
|
|
788
792
|
>
|
|
789
793
|
<Option value={1}>opt1(value:1)</Option>
|
|
@@ -797,11 +801,13 @@ export const SelectFilterSingle = () => (
|
|
|
797
801
|
width: '250px',
|
|
798
802
|
margin: 10,
|
|
799
803
|
}}
|
|
804
|
+
showClear
|
|
800
805
|
filter={customFilter}
|
|
801
806
|
onChange={v => console.log(v)}
|
|
802
807
|
insetLabel="insetLabel"
|
|
803
808
|
onFocus={() => console.log('onFocus')}
|
|
804
809
|
onBlur={() => console.log('onBlur')}
|
|
810
|
+
onSearch={(val) => console.log(val)}
|
|
805
811
|
>
|
|
806
812
|
{colorOptions.map(option => (
|
|
807
813
|
<Option value={option.value} key={option.value}>
|
|
@@ -1553,6 +1559,7 @@ const SearchDemo1 = () => {
|
|
|
1553
1559
|
optionList={optionList}
|
|
1554
1560
|
value={value}
|
|
1555
1561
|
loading={loading}
|
|
1562
|
+
showClear
|
|
1556
1563
|
onChange={onChange}
|
|
1557
1564
|
></Select>
|
|
1558
1565
|
非受控:
|
|
@@ -1561,6 +1568,7 @@ const SearchDemo1 = () => {
|
|
|
1561
1568
|
width: '150px',
|
|
1562
1569
|
}}
|
|
1563
1570
|
filter
|
|
1571
|
+
showClear
|
|
1564
1572
|
onSearch={v => handleSearch(v)}
|
|
1565
1573
|
optionList={optionList}
|
|
1566
1574
|
loading={loading}
|
|
@@ -1571,6 +1579,7 @@ const SearchDemo1 = () => {
|
|
|
1571
1579
|
style={{
|
|
1572
1580
|
width: '150px',
|
|
1573
1581
|
}}
|
|
1582
|
+
showClear
|
|
1574
1583
|
filter
|
|
1575
1584
|
multiple
|
|
1576
1585
|
onSearch={v => handleSearch(v)}
|
|
@@ -1662,6 +1671,7 @@ class SearchDemo2 extends React.Component {
|
|
|
1662
1671
|
style={{
|
|
1663
1672
|
width: 150,
|
|
1664
1673
|
}}
|
|
1674
|
+
showClear
|
|
1665
1675
|
filter
|
|
1666
1676
|
labelInValue
|
|
1667
1677
|
onSearch={this.handleSearch}
|
|
@@ -1677,6 +1687,7 @@ class SearchDemo2 extends React.Component {
|
|
|
1677
1687
|
width: 180,
|
|
1678
1688
|
}}
|
|
1679
1689
|
filter // labelInValue
|
|
1690
|
+
showClear
|
|
1680
1691
|
multiple
|
|
1681
1692
|
value={value}
|
|
1682
1693
|
renderSelectedItem={this.customRender}
|
package/select/index.tsx
CHANGED
|
@@ -878,11 +878,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
878
878
|
return (
|
|
879
879
|
<>
|
|
880
880
|
<div className={contentWrapperCls}>
|
|
881
|
-
{
|
|
882
|
-
<span className={spanCls} x-semi-prop="placeholder">
|
|
883
|
-
{renderText || renderText === 0 ? renderText : placeholder}
|
|
884
|
-
</span>
|
|
885
|
-
}
|
|
881
|
+
{<span className={spanCls}>{renderText || renderText === 0 ? renderText : placeholder}</span>}
|
|
886
882
|
{filterable && showInput ? this.renderInput() : null}
|
|
887
883
|
</div>
|
|
888
884
|
</>
|
|
@@ -1010,7 +1006,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1010
1006
|
[`${prefixcls}-suffix-text`]: suffix && isString(suffix),
|
|
1011
1007
|
[`${prefixcls}-suffix-icon`]: isSemiIcon(suffix),
|
|
1012
1008
|
});
|
|
1013
|
-
return <div className={suffixWrapperCls}
|
|
1009
|
+
return <div className={suffixWrapperCls}>{suffix}</div>;
|
|
1014
1010
|
}
|
|
1015
1011
|
|
|
1016
1012
|
renderPrefix() {
|
|
@@ -1024,11 +1020,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1024
1020
|
[`${prefixcls}-prefix-icon`]: isSemiIcon(labelNode),
|
|
1025
1021
|
});
|
|
1026
1022
|
|
|
1027
|
-
return
|
|
1028
|
-
<div className={prefixWrapperCls} id={insetLabelId} x-semi-prop="prefix,insetLabel">
|
|
1029
|
-
{labelNode}
|
|
1030
|
-
</div>
|
|
1031
|
-
);
|
|
1023
|
+
return <div className={prefixWrapperCls} id={insetLabelId}>{labelNode}</div>;
|
|
1032
1024
|
}
|
|
1033
1025
|
|
|
1034
1026
|
renderSelection() {
|
|
@@ -1075,7 +1067,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1075
1067
|
(selections.size || inputValue) && !disabled && (isHovering || isOpen);
|
|
1076
1068
|
|
|
1077
1069
|
const arrowContent = showArrow ? (
|
|
1078
|
-
<div className={`${prefixcls}-arrow`}
|
|
1070
|
+
<div className={`${prefixcls}-arrow`}>
|
|
1079
1071
|
{arrowIcon}
|
|
1080
1072
|
</div>
|
|
1081
1073
|
) : (
|
package/select/option.tsx
CHANGED
|
@@ -105,11 +105,7 @@ class Option extends PureComponent<OptionProps> {
|
|
|
105
105
|
}
|
|
106
106
|
return (
|
|
107
107
|
<LocaleConsumer<Locale['Select']> componentName="Select">
|
|
108
|
-
{(locale: Locale['Select']) =>
|
|
109
|
-
<div className={optionClassName} x-semi-prop="emptyContent">
|
|
110
|
-
{emptyContent || locale.emptyText}
|
|
111
|
-
</div>
|
|
112
|
-
)}
|
|
108
|
+
{(locale: Locale['Select']) => <div className={optionClassName}>{emptyContent || locale.emptyText}</div>}
|
|
113
109
|
</LocaleConsumer>
|
|
114
110
|
);
|
|
115
111
|
}
|
|
@@ -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`}>
|
|
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}>
|
|
144
144
|
{props.children}
|
|
145
145
|
</div>
|
|
146
146
|
{props.footer ? (
|
|
147
|
-
<div className={`${prefixCls}-footer`}
|
|
147
|
+
<div className={`${prefixCls}-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}>
|
|
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}>
|
|
89
89
|
{childrenNodes}
|
|
90
90
|
</div>
|
|
91
91
|
);
|
package/spin/index.tsx
CHANGED
|
@@ -95,18 +95,14 @@ class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
95
95
|
[`${prefixCls}-animate`]: loading,
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
<div className={spinIconCls}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
)}
|
|
107
|
-
{tip ? <div x-semi-prop="tip">{tip}</div> : null}
|
|
108
|
-
</div>
|
|
109
|
-
) : null;
|
|
98
|
+
return (
|
|
99
|
+
loading ? (
|
|
100
|
+
<div className={`${prefixCls}-wrapper`}>
|
|
101
|
+
{indicator ? <div className={spinIconCls}>{indicator}</div> : <SpinIcon />}
|
|
102
|
+
{tip ? <div>{tip}</div> : null}
|
|
103
|
+
</div>
|
|
104
|
+
) : null
|
|
105
|
+
);
|
|
110
106
|
}
|
|
111
107
|
|
|
112
108
|
render() {
|
|
@@ -126,9 +122,7 @@ class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
126
122
|
return (
|
|
127
123
|
<div className={spinCls} style={style}>
|
|
128
124
|
{this.renderSpin()}
|
|
129
|
-
<div className={`${prefixCls}-children`} style={childStyle}
|
|
130
|
-
{children}
|
|
131
|
-
</div>
|
|
125
|
+
<div className={`${prefixCls}-children`} style={childStyle}>{children}</div>
|
|
132
126
|
</div>
|
|
133
127
|
);
|
|
134
128
|
}
|