@douyinfe/semi-ui 2.14.0-alpha.0 → 2.14.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autoComplete/_story/CustomTrigger/index.jsx +1 -1
- package/avatar/_story/avatar.stories.js +62 -5
- package/avatar/avatarGroup.tsx +16 -4
- package/avatar/index.tsx +88 -17
- package/backtop/index.tsx +11 -7
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +5 -5
- package/breadcrumb/index.tsx +5 -3
- package/button/Button.tsx +10 -8
- package/calendar/_story/calendar.stories.js +125 -1
- package/card/index.tsx +43 -41
- package/carousel/CarouselArrow.tsx +2 -0
- package/carousel/index.tsx +1 -0
- package/cascader/_story/cascader.stories.js +21 -0
- package/cascader/index.tsx +103 -122
- package/cascader/item.tsx +1 -1
- package/checkbox/checkbox.tsx +13 -2
- package/collapsible/index.tsx +8 -1
- package/datePicker/dateInput.tsx +1 -0
- package/datePicker/datePicker.tsx +13 -5
- package/dist/css/semi.css +73 -35
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +957 -545
- 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/_story/form.stories.tsx +9 -2
- package/form/field.tsx +1 -1
- package/form/hoc/withField.tsx +1 -1
- package/form/label.tsx +1 -1
- package/grid/col.tsx +1 -1
- package/grid/row.tsx +1 -1
- package/gulpfile.js +5 -5
- package/iconButton/index.tsx +2 -1
- package/input/_story/input.stories.js +32 -3
- package/input/index.tsx +45 -23
- package/input/inputGroup.tsx +3 -1
- package/input/textarea.tsx +2 -14
- package/lib/cjs/_base/base.css +36 -14
- package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
- package/lib/cjs/avatar/avatarGroup.js +36 -9
- package/lib/cjs/avatar/index.d.ts +5 -0
- package/lib/cjs/avatar/index.js +121 -41
- package/lib/cjs/backtop/index.js +2 -1
- package/lib/cjs/badge/index.js +2 -1
- package/lib/cjs/banner/index.js +9 -4
- package/lib/cjs/breadcrumb/index.js +4 -3
- package/lib/cjs/button/Button.js +13 -3
- package/lib/cjs/card/index.js +10 -5
- package/lib/cjs/carousel/CarouselArrow.js +6 -2
- package/lib/cjs/carousel/index.js +2 -1
- package/lib/cjs/cascader/index.js +15 -8
- package/lib/cjs/cascader/item.js +2 -1
- package/lib/cjs/checkbox/checkbox.js +6 -2
- package/lib/cjs/collapsible/index.js +2 -1
- package/lib/cjs/datePicker/dateInput.js +2 -1
- package/lib/cjs/datePicker/datePicker.js +4 -2
- package/lib/cjs/divider/index.js +2 -1
- package/lib/cjs/dropdown/index.js +2 -1
- package/lib/cjs/empty/index.js +8 -4
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/field.js +2 -2
- package/lib/cjs/form/hoc/withField.js +2 -1
- package/lib/cjs/form/label.js +2 -1
- package/lib/cjs/grid/col.js +2 -1
- package/lib/cjs/grid/row.js +2 -1
- package/lib/cjs/iconButton/index.js +3 -1
- package/lib/cjs/input/index.d.ts +0 -1
- package/lib/cjs/input/index.js +41 -36
- package/lib/cjs/input/inputGroup.js +2 -3
- package/lib/cjs/input/textarea.js +8 -15
- package/lib/cjs/list/index.js +6 -3
- package/lib/cjs/modal/ConfirmModal.js +2 -1
- package/lib/cjs/modal/Modal.js +6 -2
- package/lib/cjs/modal/ModalContent.js +13 -6
- package/lib/cjs/notification/notice.js +6 -3
- package/lib/cjs/pagination/index.js +4 -2
- package/lib/cjs/popconfirm/index.js +6 -3
- package/lib/cjs/radio/radio.d.ts +4 -0
- package/lib/cjs/radio/radio.js +32 -9
- package/lib/cjs/radio/radioInner.d.ts +6 -0
- package/lib/cjs/radio/radioInner.js +13 -4
- package/lib/cjs/rating/item.js +2 -1
- package/lib/cjs/scrollList/index.js +6 -3
- package/lib/cjs/select/index.js +10 -4
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
- package/lib/cjs/skeleton/index.js +3 -1
- package/lib/cjs/space/index.js +2 -1
- package/lib/cjs/spin/index.js +7 -3
- package/lib/cjs/switch/index.js +6 -4
- package/lib/cjs/table/ColumnFilter.js +2 -2
- package/lib/cjs/table/ColumnSelection.js +2 -2
- package/lib/cjs/table/Table.js +6 -3
- package/lib/cjs/tabs/TabBar.js +2 -1
- package/lib/cjs/tabs/TabPane.js +5 -2
- package/lib/cjs/tagInput/index.js +33 -22
- package/lib/cjs/timePicker/Combobox.js +3 -1
- package/lib/cjs/timePicker/TimePicker.js +2 -0
- package/lib/cjs/toast/toast.js +6 -3
- package/lib/cjs/tooltip/index.js +6 -1
- package/lib/cjs/transfer/index.js +6 -5
- package/lib/cjs/tree/treeNode.js +4 -3
- package/lib/cjs/treeSelect/index.js +10 -3
- package/lib/cjs/typography/base.js +2 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/cjs/upload/index.js +13 -6
- package/lib/es/_base/base.css +36 -14
- package/lib/es/avatar/avatarGroup.d.ts +1 -1
- package/lib/es/avatar/avatarGroup.js +37 -9
- package/lib/es/avatar/index.d.ts +5 -0
- package/lib/es/avatar/index.js +119 -38
- package/lib/es/backtop/index.js +2 -1
- package/lib/es/badge/index.js +2 -1
- package/lib/es/banner/index.js +9 -4
- package/lib/es/breadcrumb/index.js +4 -3
- package/lib/es/button/Button.js +11 -3
- package/lib/es/card/index.js +10 -5
- package/lib/es/carousel/CarouselArrow.js +6 -2
- package/lib/es/carousel/index.js +2 -1
- package/lib/es/cascader/index.js +15 -8
- package/lib/es/cascader/item.js +2 -1
- package/lib/es/checkbox/checkbox.js +6 -2
- package/lib/es/collapsible/index.js +2 -1
- package/lib/es/datePicker/dateInput.js +2 -1
- package/lib/es/datePicker/datePicker.js +4 -2
- package/lib/es/divider/index.js +2 -1
- package/lib/es/dropdown/index.js +2 -1
- package/lib/es/empty/index.js +8 -4
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/field.js +1 -1
- package/lib/es/form/hoc/withField.js +2 -1
- package/lib/es/form/label.js +2 -1
- package/lib/es/grid/col.js +2 -1
- package/lib/es/grid/row.js +2 -1
- package/lib/es/iconButton/index.js +3 -1
- package/lib/es/input/index.d.ts +0 -1
- package/lib/es/input/index.js +41 -36
- package/lib/es/input/inputGroup.js +2 -3
- package/lib/es/input/textarea.js +8 -15
- package/lib/es/list/index.js +6 -3
- package/lib/es/modal/ConfirmModal.js +2 -1
- package/lib/es/modal/Modal.js +6 -2
- package/lib/es/modal/ModalContent.js +13 -6
- package/lib/es/notification/notice.js +6 -3
- package/lib/es/pagination/index.js +4 -2
- package/lib/es/popconfirm/index.js +6 -3
- package/lib/es/radio/radio.d.ts +4 -0
- package/lib/es/radio/radio.js +32 -9
- package/lib/es/radio/radioInner.d.ts +6 -0
- package/lib/es/radio/radioInner.js +13 -4
- package/lib/es/rating/item.js +2 -1
- package/lib/es/scrollList/index.js +6 -3
- package/lib/es/select/index.js +10 -4
- package/lib/es/select/option.js +2 -1
- package/lib/es/sideSheet/SideSheetContent.js +6 -3
- package/lib/es/skeleton/index.js +3 -1
- package/lib/es/space/index.js +2 -1
- package/lib/es/spin/index.js +7 -3
- package/lib/es/switch/index.js +6 -4
- package/lib/es/table/ColumnFilter.js +1 -1
- package/lib/es/table/ColumnSelection.js +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 +31 -22
- package/lib/es/timePicker/Combobox.js +3 -1
- package/lib/es/timePicker/TimePicker.js +2 -0
- package/lib/es/toast/toast.js +6 -3
- package/lib/es/tooltip/index.js +6 -1
- package/lib/es/transfer/index.js +3 -2
- package/lib/es/tree/treeNode.js +3 -2
- package/lib/es/treeSelect/index.js +10 -3
- package/lib/es/typography/base.js +2 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/lib/es/upload/index.js +13 -6
- package/list/index.tsx +16 -4
- package/modal/ConfirmModal.tsx +1 -1
- package/modal/Modal.tsx +2 -0
- package/modal/ModalContent.tsx +27 -14
- package/notification/notice.tsx +16 -4
- package/package.json +8 -8
- package/pagination/index.tsx +16 -2
- package/popconfirm/index.tsx +11 -3
- package/radio/_story/radio.stories.js +9 -6
- package/radio/radio.tsx +37 -7
- package/radio/radioInner.tsx +11 -2
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +19 -3
- package/select/index.tsx +13 -4
- package/select/option.tsx +5 -1
- package/sideSheet/SideSheetContent.tsx +3 -3
- package/skeleton/index.tsx +1 -1
- package/space/index.tsx +1 -1
- package/spin/index.tsx +15 -9
- package/switch/index.tsx +9 -14
- package/table/ColumnFilter.tsx +1 -1
- package/table/ColumnSelection.tsx +1 -1
- package/table/Table.tsx +5 -3
- package/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +9 -4
- package/tabs/_story/tabs.stories.js +36 -0
- package/tag/_story/tag.stories.js +1 -1
- package/tagInput/index.tsx +32 -15
- package/timePicker/Combobox.tsx +6 -1
- package/timePicker/TimePicker.tsx +1 -0
- package/toast/toast.tsx +3 -3
- package/tooltip/index.tsx +4 -1
- package/transfer/index.tsx +2 -1
- package/tree/treeNode.tsx +2 -2
- package/treeSelect/_story/treeSelect.stories.js +161 -2
- package/treeSelect/index.tsx +17 -3
- package/typography/base.tsx +1 -1
- package/upload/_story/upload.stories.js +152 -0
- package/upload/index.tsx +107 -38
|
@@ -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;
|
package/lib/cjs/upload/index.js
CHANGED
|
@@ -256,7 +256,9 @@ class Upload extends _baseComponent.default {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
const addContent = /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, addContentProps
|
|
259
|
+
const addContent = /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, addContentProps, {
|
|
260
|
+
"x-semi-prop": "children"
|
|
261
|
+
}), children);
|
|
260
262
|
|
|
261
263
|
if (!showUploadList || !fileList.length) {
|
|
262
264
|
if (showAddTriggerInList) {
|
|
@@ -389,15 +391,18 @@ class Upload extends _baseComponent.default {
|
|
|
389
391
|
onDragEnter: this.onDragEnter,
|
|
390
392
|
onClick: this.onClick
|
|
391
393
|
}, children ? children : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
392
|
-
className: "".concat(dragAreaBaseCls, "-icon")
|
|
394
|
+
className: "".concat(dragAreaBaseCls, "-icon"),
|
|
395
|
+
"x-semi-prop": "dragIcon"
|
|
393
396
|
}, dragIcon || /*#__PURE__*/_react.default.createElement(_semiIcons.IconUpload, {
|
|
394
397
|
size: "extra-large"
|
|
395
398
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
396
399
|
className: "".concat(dragAreaBaseCls, "-text")
|
|
397
400
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
398
|
-
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
401
|
+
className: "".concat(dragAreaBaseCls, "-main-text"),
|
|
402
|
+
"x-semi-prop": "dragMainText"
|
|
399
403
|
}, dragMainText || locale.mainText), /*#__PURE__*/_react.default.createElement("div", {
|
|
400
|
-
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
404
|
+
className: "".concat(dragAreaBaseCls, "-sub-text"),
|
|
405
|
+
"x-semi-prop": "dragSubText"
|
|
401
406
|
}, dragSubText), /*#__PURE__*/_react.default.createElement("div", {
|
|
402
407
|
className: "".concat(dragAreaBaseCls, "-tips")
|
|
403
408
|
}, dragAreaStatus === _constants.strings.DRAG_AREA_LEGAL && /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -583,9 +588,11 @@ class Upload extends _baseComponent.default {
|
|
|
583
588
|
className: inputReplaceCls,
|
|
584
589
|
ref: this.replaceInputRef
|
|
585
590
|
}), this.renderAddContent(), prompt ? /*#__PURE__*/_react.default.createElement("div", {
|
|
586
|
-
className: promptCls
|
|
591
|
+
className: promptCls,
|
|
592
|
+
"x-semi-prop": "prompt"
|
|
587
593
|
}, prompt) : null, validateMessage ? /*#__PURE__*/_react.default.createElement("div", {
|
|
588
|
-
className: validateMsgCls
|
|
594
|
+
className: validateMsgCls,
|
|
595
|
+
"x-semi-prop": "validateMessage"
|
|
589
596
|
}, validateMessage) : null, this.renderFileList());
|
|
590
597
|
}
|
|
591
598
|
|
package/lib/es/_base/base.css
CHANGED
|
@@ -345,13 +345,13 @@ body, body[theme-mode=dark] .semi-always-light {
|
|
|
345
345
|
--semi-color-primary-light-default: rgba(var(--semi-blue-0), 1);
|
|
346
346
|
--semi-color-primary-light-hover: rgba(var(--semi-blue-1), 1);
|
|
347
347
|
--semi-color-primary-light-active: rgba(var(--semi-blue-2), 1);
|
|
348
|
-
--semi-color-secondary: rgba(var(--semi-blue-5), 1);
|
|
349
|
-
--semi-color-secondary-hover: rgba(var(--semi-blue-6), 1);
|
|
350
|
-
--semi-color-secondary-active: rgba(var(--semi-blue-7), 1);
|
|
351
|
-
--semi-color-secondary-disabled: rgba(var(--semi-blue-2), 1);
|
|
352
|
-
--semi-color-secondary-light-default: rgba(var(--semi-blue-0), 1);
|
|
353
|
-
--semi-color-secondary-light-hover: rgba(var(--semi-blue-1), 1);
|
|
354
|
-
--semi-color-secondary-light-active: rgba(var(--semi-blue-2), 1);
|
|
348
|
+
--semi-color-secondary: rgba(var(--semi-light-blue-5), 1);
|
|
349
|
+
--semi-color-secondary-hover: rgba(var(--semi-light-blue-6), 1);
|
|
350
|
+
--semi-color-secondary-active: rgba(var(--semi-light-blue-7), 1);
|
|
351
|
+
--semi-color-secondary-disabled: rgba(var(--semi-light-blue-2), 1);
|
|
352
|
+
--semi-color-secondary-light-default: rgba(var(--semi-light-blue-0), 1);
|
|
353
|
+
--semi-color-secondary-light-hover: rgba(var(--semi-light-blue-1), 1);
|
|
354
|
+
--semi-color-secondary-light-active: rgba(var(--semi-light-blue-2), 1);
|
|
355
355
|
--semi-color-tertiary: rgba(var(--semi-grey-5), 1);
|
|
356
356
|
--semi-color-tertiary-hover: rgba(var(--semi-grey-6), 1);
|
|
357
357
|
--semi-color-tertiary-active: rgba(var(--semi-grey-7), 1);
|
|
@@ -433,13 +433,13 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
433
433
|
--semi-color-primary-light-default: rgba(var(--semi-blue-5), .2);
|
|
434
434
|
--semi-color-primary-light-hover: rgba(var(--semi-blue-5), .3);
|
|
435
435
|
--semi-color-primary-light-active: rgba(var(--semi-blue-5), .4);
|
|
436
|
-
--semi-color-secondary: rgba(var(--semi-blue-5), 1);
|
|
437
|
-
--semi-color-secondary-hover: rgba(var(--semi-blue-6), 1);
|
|
438
|
-
--semi-color-secondary-active: rgba(var(--semi-blue-7), 1);
|
|
439
|
-
--semi-color-secondary-disabled: rgba(var(--semi-blue-2), 1);
|
|
440
|
-
--semi-color-secondary-light-default: rgba(var(--semi-blue-5), .2);
|
|
441
|
-
--semi-color-secondary-light-hover: rgba(var(--semi-blue-5), .3);
|
|
442
|
-
--semi-color-secondary-light-active: rgba(var(--semi-blue-5), .4);
|
|
436
|
+
--semi-color-secondary: rgba(var(--semi-light-blue-5), 1);
|
|
437
|
+
--semi-color-secondary-hover: rgba(var(--semi-light-blue-6), 1);
|
|
438
|
+
--semi-color-secondary-active: rgba(var(--semi-light-blue-7), 1);
|
|
439
|
+
--semi-color-secondary-disabled: rgba(var(--semi-light-blue-2), 1);
|
|
440
|
+
--semi-color-secondary-light-default: rgba(var(--semi-light-blue-5), .2);
|
|
441
|
+
--semi-color-secondary-light-hover: rgba(var(--semi-light-blue-5), .3);
|
|
442
|
+
--semi-color-secondary-light-active: rgba(var(--semi-light-blue-5), .4);
|
|
443
443
|
--semi-color-tertiary: rgba(var(--semi-grey-5), 1);
|
|
444
444
|
--semi-color-tertiary-hover: rgba(var(--semi-grey-6), 1);
|
|
445
445
|
--semi-color-tertiary-active: rgba(var(--semi-grey-7), 1);
|
|
@@ -507,4 +507,26 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
507
507
|
--semi-border-radius-large: 12px;
|
|
508
508
|
--semi-border-radius-circle: 50%;
|
|
509
509
|
--semi-border-radius-full: 9999px;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.semi-light-scrollbar::-webkit-scrollbar, .semi-light-scrollbar *::-webkit-scrollbar {
|
|
513
|
+
width: 8px;
|
|
514
|
+
height: 8px;
|
|
515
|
+
}
|
|
516
|
+
.semi-light-scrollbar::-webkit-scrollbar-track, .semi-light-scrollbar *::-webkit-scrollbar-track {
|
|
517
|
+
background: rgba(0, 0, 0, 0);
|
|
518
|
+
}
|
|
519
|
+
.semi-light-scrollbar::-webkit-scrollbar-corner, .semi-light-scrollbar *::-webkit-scrollbar-corner {
|
|
520
|
+
background-color: rgba(0, 0, 0, 0);
|
|
521
|
+
}
|
|
522
|
+
.semi-light-scrollbar::-webkit-scrollbar-thumb, .semi-light-scrollbar *::-webkit-scrollbar-thumb {
|
|
523
|
+
border-radius: 6px;
|
|
524
|
+
background: transparent;
|
|
525
|
+
transition: all 1s;
|
|
526
|
+
}
|
|
527
|
+
.semi-light-scrollbar:hover::-webkit-scrollbar-thumb, .semi-light-scrollbar *:hover::-webkit-scrollbar-thumb {
|
|
528
|
+
background: var(--semi-color-fill-2);
|
|
529
|
+
}
|
|
530
|
+
.semi-light-scrollbar::-webkit-scrollbar-thumb:hover, .semi-light-scrollbar *::-webkit-scrollbar-thumb:hover {
|
|
531
|
+
background: var(--semi-color-fill-1);
|
|
510
532
|
}
|
|
@@ -15,7 +15,7 @@ export default class AvatarGroup extends PureComponent<AvatarGroupProps> {
|
|
|
15
15
|
renderMore: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
16
|
overlapFrom: PropTypes.Requireable<string>;
|
|
17
17
|
};
|
|
18
|
-
getAllAvatars(): any[];
|
|
18
|
+
getAllAvatars(): (string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
|
|
19
19
|
getMergeAvatars(avatars: React.ReactNode[]): React.ReactNode[];
|
|
20
20
|
renderMoreAvatar(restNumber: number, restAvatars: React.ReactNode[]): JSX.Element;
|
|
21
21
|
render(): JSX.Element;
|
|
@@ -5,8 +5,9 @@ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
|
5
5
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
6
6
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
7
7
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
8
|
-
import
|
|
8
|
+
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
9
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
10
11
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
11
12
|
|
|
12
13
|
var __rest = this && this.__rest || function (s, e) {
|
|
@@ -34,7 +35,12 @@ export default class AvatarGroup extends PureComponent {
|
|
|
34
35
|
const {
|
|
35
36
|
children
|
|
36
37
|
} = this.props;
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
if (children) {
|
|
40
|
+
return _Array$isArray(children) ? React.Children.toArray(children) : [children];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return [];
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
getMergeAvatars(avatars) {
|
|
@@ -58,13 +64,34 @@ export default class AvatarGroup extends PureComponent {
|
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
renderMoreAvatar(restNumber, restAvatars) {
|
|
67
|
+
var _context2;
|
|
68
|
+
|
|
61
69
|
const {
|
|
62
70
|
renderMore
|
|
63
71
|
} = this.props;
|
|
64
72
|
const moreCls = cls("".concat(prefixCls, "-item-more"));
|
|
73
|
+
const restAvatarAlt = restAvatars === null || restAvatars === void 0 ? void 0 : _reduceInstanceProperty(restAvatars).call(restAvatars, (pre, cur) => {
|
|
74
|
+
var _context;
|
|
75
|
+
|
|
76
|
+
const {
|
|
77
|
+
children,
|
|
78
|
+
alt
|
|
79
|
+
} = cur.props;
|
|
80
|
+
const avatarInfo = alt !== null && alt !== void 0 ? alt : typeof children === 'string' ? children : '';
|
|
81
|
+
|
|
82
|
+
if (avatarInfo.length === 0) {
|
|
83
|
+
return pre;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return pre.length > 0 ? _concatInstanceProperty(_context = "".concat(pre, ",")).call(_context, avatarInfo) : avatarInfo;
|
|
87
|
+
}, '');
|
|
88
|
+
|
|
89
|
+
const finalAlt = _concatInstanceProperty(_context2 = " Number of remaining Avatars\uFF1A".concat(restNumber, ",")).call(_context2, restAvatarAlt);
|
|
90
|
+
|
|
65
91
|
let moreAvatar = /*#__PURE__*/React.createElement(Avatar, {
|
|
66
92
|
className: moreCls,
|
|
67
|
-
key: "_+n"
|
|
93
|
+
key: "_+n",
|
|
94
|
+
alt: finalAlt
|
|
68
95
|
}, "+".concat(restNumber));
|
|
69
96
|
|
|
70
97
|
if (_isFunction(renderMore)) {
|
|
@@ -95,15 +122,15 @@ export default class AvatarGroup extends PureComponent {
|
|
|
95
122
|
});
|
|
96
123
|
|
|
97
124
|
if (children) {
|
|
98
|
-
var
|
|
125
|
+
var _context3;
|
|
99
126
|
|
|
100
127
|
const avatars = this.getAllAvatars();
|
|
101
|
-
inner = _mapInstanceProperty(
|
|
102
|
-
var
|
|
128
|
+
inner = _mapInstanceProperty(_context3 = _isNumber(maxCount) ? this.getMergeAvatars(avatars) : avatars).call(_context3, (itm, index) => {
|
|
129
|
+
var _context4, _context5;
|
|
103
130
|
|
|
104
131
|
const className = cls(_get(itm.props, 'className'), {
|
|
105
|
-
[_concatInstanceProperty(
|
|
106
|
-
[_concatInstanceProperty(
|
|
132
|
+
[_concatInstanceProperty(_context4 = "".concat(prefixCls, "-item-start-")).call(_context4, index)]: overlapFrom === 'start',
|
|
133
|
+
[_concatInstanceProperty(_context5 = "".concat(prefixCls, "-item-end-")).call(_context5, index)]: overlapFrom === 'end'
|
|
107
134
|
});
|
|
108
135
|
return /*#__PURE__*/React.cloneElement(itm, _Object$assign(_Object$assign({}, rest), {
|
|
109
136
|
className,
|
|
@@ -115,7 +142,8 @@ export default class AvatarGroup extends PureComponent {
|
|
|
115
142
|
}
|
|
116
143
|
|
|
117
144
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: groupCls
|
|
145
|
+
className: groupCls,
|
|
146
|
+
role: 'list'
|
|
119
147
|
}, inner);
|
|
120
148
|
}
|
|
121
149
|
|
package/lib/es/avatar/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './interface';
|
|
|
9
9
|
export interface AvatarState {
|
|
10
10
|
isImgExist: boolean;
|
|
11
11
|
hoverContent: React.ReactNode;
|
|
12
|
+
focusVisible: boolean;
|
|
12
13
|
}
|
|
13
14
|
export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
14
15
|
static defaultProps: {
|
|
@@ -45,5 +46,9 @@ export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
|
45
46
|
onEnter(e: React.MouseEvent): void;
|
|
46
47
|
onLeave(e: React.MouseEvent): void;
|
|
47
48
|
handleError(): void;
|
|
49
|
+
handleKeyDown(event: any): void;
|
|
50
|
+
handleFocusVisible: (event: React.FocusEvent) => void;
|
|
51
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
52
|
+
getContent: () => React.ReactNode;
|
|
48
53
|
render(): JSX.Element;
|
|
49
54
|
}
|
package/lib/es/avatar/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
2
2
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
-
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
4
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
|
+
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
5
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
6
|
|
|
7
7
|
var __rest = this && this.__rest || function (s, e) {
|
|
@@ -23,6 +23,7 @@ import AvatarFoundation from '@douyinfe/semi-foundation/lib/es/avatar/foundation
|
|
|
23
23
|
import '@douyinfe/semi-foundation/lib/es/avatar/avatar.css';
|
|
24
24
|
import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
|
|
25
25
|
import BaseComponent from '../_base/baseComponent';
|
|
26
|
+
import { handlePrevent } from '@douyinfe/semi-foundation/lib/es/utils/a11y';
|
|
26
27
|
const sizeSet = strings.SIZE;
|
|
27
28
|
const shapeSet = strings.SHAPE;
|
|
28
29
|
const colorSet = strings.COLOR;
|
|
@@ -30,16 +31,88 @@ const prefixCls = cssClasses.PREFIX;
|
|
|
30
31
|
export * from './interface';
|
|
31
32
|
export default class Avatar extends BaseComponent {
|
|
32
33
|
constructor(props) {
|
|
33
|
-
var _context, _context2, _context3;
|
|
34
|
+
var _context, _context2, _context3, _context4, _context5;
|
|
34
35
|
|
|
35
36
|
super(props);
|
|
37
|
+
|
|
38
|
+
this.handleFocusVisible = event => {
|
|
39
|
+
this.foundation.handleFocusVisible(event);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
this.handleBlur = event => {
|
|
43
|
+
this.foundation.handleBlur();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
this.getContent = () => {
|
|
47
|
+
const {
|
|
48
|
+
children,
|
|
49
|
+
onClick,
|
|
50
|
+
imgAttr,
|
|
51
|
+
src,
|
|
52
|
+
srcSet,
|
|
53
|
+
alt
|
|
54
|
+
} = this.props;
|
|
55
|
+
const {
|
|
56
|
+
isImgExist
|
|
57
|
+
} = this.state;
|
|
58
|
+
let content = children;
|
|
59
|
+
const clickable = onClick !== noop;
|
|
60
|
+
const isImg = src && isImgExist;
|
|
61
|
+
const a11yFocusProps = {
|
|
62
|
+
tabIndex: 0,
|
|
63
|
+
onKeyDown: this.handleKeyDown,
|
|
64
|
+
onFocus: this.handleFocusVisible,
|
|
65
|
+
onBlur: this.handleBlur
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
if (isImg) {
|
|
69
|
+
const finalAlt = clickable ? "clickable Avatar: ".concat(alt) : alt;
|
|
70
|
+
|
|
71
|
+
const imgBasicProps = _Object$assign(_Object$assign({
|
|
72
|
+
src,
|
|
73
|
+
srcSet,
|
|
74
|
+
onError: this.handleError
|
|
75
|
+
}, imgAttr), {
|
|
76
|
+
className: cls({
|
|
77
|
+
["".concat(prefixCls, "-no-focus-visible")]: clickable
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const imgProps = clickable ? _Object$assign(_Object$assign({}, imgBasicProps), a11yFocusProps) : imgBasicProps;
|
|
82
|
+
content = /*#__PURE__*/React.createElement("img", _Object$assign({
|
|
83
|
+
alt: finalAlt
|
|
84
|
+
}, imgProps));
|
|
85
|
+
} else if (typeof children === 'string') {
|
|
86
|
+
const tempAlt = alt !== null && alt !== void 0 ? alt : children;
|
|
87
|
+
const finalAlt = clickable ? "clickable Avatar: ".concat(tempAlt) : tempAlt;
|
|
88
|
+
const props = {
|
|
89
|
+
role: 'img',
|
|
90
|
+
'aria-label': finalAlt,
|
|
91
|
+
className: cls("".concat(prefixCls, "-label"), {
|
|
92
|
+
["".concat(prefixCls, "-no-focus-visible")]: clickable
|
|
93
|
+
})
|
|
94
|
+
};
|
|
95
|
+
const finalProps = clickable ? _Object$assign(_Object$assign({}, props), a11yFocusProps) : props;
|
|
96
|
+
content = /*#__PURE__*/React.createElement("span", {
|
|
97
|
+
className: "".concat(prefixCls, "-content")
|
|
98
|
+
}, /*#__PURE__*/React.createElement("span", _Object$assign({}, finalProps, {
|
|
99
|
+
"x-semi-prop": "children"
|
|
100
|
+
}), children));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return content;
|
|
104
|
+
};
|
|
105
|
+
|
|
36
106
|
this.state = {
|
|
37
107
|
isImgExist: true,
|
|
38
|
-
hoverContent: ''
|
|
108
|
+
hoverContent: '',
|
|
109
|
+
focusVisible: false
|
|
39
110
|
};
|
|
40
111
|
this.onEnter = _bindInstanceProperty(_context = this.onEnter).call(_context, this);
|
|
41
112
|
this.onLeave = _bindInstanceProperty(_context2 = this.onLeave).call(_context2, this);
|
|
42
113
|
this.handleError = _bindInstanceProperty(_context3 = this.handleError).call(_context3, this);
|
|
114
|
+
this.handleKeyDown = _bindInstanceProperty(_context4 = this.handleKeyDown).call(_context4, this);
|
|
115
|
+
this.getContent = _bindInstanceProperty(_context5 = this.getContent).call(_context5, this);
|
|
43
116
|
}
|
|
44
117
|
|
|
45
118
|
get adapter() {
|
|
@@ -72,6 +145,11 @@ export default class Avatar extends BaseComponent {
|
|
|
72
145
|
} = this.props;
|
|
73
146
|
onMouseLeave && onMouseLeave(e);
|
|
74
147
|
});
|
|
148
|
+
},
|
|
149
|
+
setFocusVisible: focusVisible => {
|
|
150
|
+
this.setState({
|
|
151
|
+
focusVisible
|
|
152
|
+
});
|
|
75
153
|
}
|
|
76
154
|
});
|
|
77
155
|
}
|
|
@@ -122,8 +200,28 @@ export default class Avatar extends BaseComponent {
|
|
|
122
200
|
this.foundation.handleImgLoadError();
|
|
123
201
|
}
|
|
124
202
|
|
|
203
|
+
handleKeyDown(event) {
|
|
204
|
+
const {
|
|
205
|
+
onClick
|
|
206
|
+
} = this.props;
|
|
207
|
+
|
|
208
|
+
switch (event.key) {
|
|
209
|
+
case "Enter":
|
|
210
|
+
onClick(event);
|
|
211
|
+
handlePrevent(event);
|
|
212
|
+
break;
|
|
213
|
+
|
|
214
|
+
case 'Escape':
|
|
215
|
+
event.target.blur();
|
|
216
|
+
break;
|
|
217
|
+
|
|
218
|
+
default:
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
125
223
|
render() {
|
|
126
|
-
var
|
|
224
|
+
var _context6, _context7, _context8;
|
|
127
225
|
|
|
128
226
|
// eslint-disable-next-line max-len, no-unused-vars
|
|
129
227
|
const _a = this.props,
|
|
@@ -145,46 +243,29 @@ export default class Avatar extends BaseComponent {
|
|
|
145
243
|
|
|
146
244
|
const {
|
|
147
245
|
isImgExist,
|
|
148
|
-
hoverContent
|
|
246
|
+
hoverContent,
|
|
247
|
+
focusVisible
|
|
149
248
|
} = this.state;
|
|
150
249
|
const isImg = src && isImgExist;
|
|
151
250
|
const avatarCls = cls(prefixCls, {
|
|
152
|
-
[_concatInstanceProperty(
|
|
153
|
-
[_concatInstanceProperty(
|
|
154
|
-
[_concatInstanceProperty(
|
|
155
|
-
["".concat(prefixCls, "-img")]: isImg
|
|
251
|
+
[_concatInstanceProperty(_context6 = "".concat(prefixCls, "-")).call(_context6, shape)]: shape,
|
|
252
|
+
[_concatInstanceProperty(_context7 = "".concat(prefixCls, "-")).call(_context7, size)]: size,
|
|
253
|
+
[_concatInstanceProperty(_context8 = "".concat(prefixCls, "-")).call(_context8, color)]: color && !isImg,
|
|
254
|
+
["".concat(prefixCls, "-img")]: isImg,
|
|
255
|
+
["".concat(prefixCls, "-focus")]: focusVisible
|
|
156
256
|
}, className);
|
|
157
|
-
let content = children;
|
|
158
257
|
const hoverRender = hoverContent ? /*#__PURE__*/React.createElement("div", {
|
|
159
|
-
className: "".concat(prefixCls, "-hover")
|
|
258
|
+
className: "".concat(prefixCls, "-hover"),
|
|
259
|
+
"x-semi-prop": "hoverContent"
|
|
160
260
|
}, hoverContent) : null;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
} else if (typeof children === 'string') {
|
|
170
|
-
content = /*#__PURE__*/React.createElement("span", {
|
|
171
|
-
className: "".concat(prefixCls, "-content")
|
|
172
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
173
|
-
className: "".concat(prefixCls, "-label")
|
|
174
|
-
}, children));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
/*#__PURE__*/
|
|
179
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
|
|
180
|
-
React.createElement("span", _Object$assign({}, others, {
|
|
181
|
-
style: style,
|
|
182
|
-
className: avatarCls,
|
|
183
|
-
onClick: onClick,
|
|
184
|
-
onMouseEnter: this.onEnter,
|
|
185
|
-
onMouseLeave: this.onLeave
|
|
186
|
-
}), content, hoverRender)
|
|
187
|
-
);
|
|
261
|
+
return /*#__PURE__*/React.createElement("span", _Object$assign({}, others, {
|
|
262
|
+
style: style,
|
|
263
|
+
className: avatarCls,
|
|
264
|
+
onClick: onClick,
|
|
265
|
+
onMouseEnter: this.onEnter,
|
|
266
|
+
onMouseLeave: this.onLeave,
|
|
267
|
+
role: 'listitem'
|
|
268
|
+
}), this.getContent(), hoverRender);
|
|
188
269
|
}
|
|
189
270
|
|
|
190
271
|
}
|
package/lib/es/backtop/index.js
CHANGED
|
@@ -98,7 +98,8 @@ 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)
|
|
101
|
+
onClick: e => this.handleClick(e),
|
|
102
|
+
"x-semi-prop": "children"
|
|
102
103
|
}), backtopBtn) : null;
|
|
103
104
|
return content;
|
|
104
105
|
}
|
package/lib/es/badge/index.js
CHANGED
|
@@ -71,7 +71,8 @@ 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
|
|
74
|
+
style: style,
|
|
75
|
+
"x-semi-prop": "count"
|
|
75
76
|
}, dot ? null : content));
|
|
76
77
|
}
|
|
77
78
|
|
package/lib/es/banner/index.js
CHANGED
|
@@ -68,6 +68,7 @@ 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",
|
|
71
72
|
"aria-hidden": true
|
|
72
73
|
}),
|
|
73
74
|
theme: "borderless",
|
|
@@ -113,7 +114,8 @@ export default class Banner extends BaseComponent {
|
|
|
113
114
|
|
|
114
115
|
if (iconType) {
|
|
115
116
|
return /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: iconCls
|
|
117
|
+
className: iconCls,
|
|
118
|
+
"x-semi-prop": "icon"
|
|
117
119
|
}, iconType);
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -155,12 +157,15 @@ export default class Banner extends BaseComponent {
|
|
|
155
157
|
}, title ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
156
158
|
heading: 5,
|
|
157
159
|
className: "".concat(prefixCls, "-title"),
|
|
158
|
-
component: "div"
|
|
160
|
+
component: "div",
|
|
161
|
+
"x-semi-prop": "title"
|
|
159
162
|
}, title) : null, description ? /*#__PURE__*/React.createElement(Typography.Paragraph, {
|
|
160
163
|
className: "".concat(prefixCls, "-description"),
|
|
161
|
-
component: "div"
|
|
164
|
+
component: "div",
|
|
165
|
+
"x-semi-prop": "description"
|
|
162
166
|
}, description) : null)), this.renderCloser()), children ? /*#__PURE__*/React.createElement("div", {
|
|
163
|
-
className: "".concat(prefixCls, "-extra")
|
|
167
|
+
className: "".concat(prefixCls, "-extra"),
|
|
168
|
+
"x-semi-prop": "children"
|
|
164
169
|
}, children) : null) : null;
|
|
165
170
|
return banner;
|
|
166
171
|
}
|
|
@@ -47,14 +47,15 @@ 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")
|
|
57
|
+
className: "".concat(clsPrefix, "-separator"),
|
|
58
|
+
"x-semi-prop": "separator"
|
|
58
59
|
}, this.props.separator)));
|
|
59
60
|
|
|
60
61
|
_spliceInstanceProperty(template).call(template, 1, itemsLen - maxItemCount, spread);
|
package/lib/es/button/Button.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import _omit from "lodash/omit";
|
|
1
2
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
2
3
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
4
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
5
7
|
|
|
6
8
|
var __rest = this && this.__rest || function (s, e) {
|
|
7
9
|
var t = {};
|
|
@@ -52,7 +54,7 @@ export default class Button extends PureComponent {
|
|
|
52
54
|
|
|
53
55
|
const baseProps = _Object$assign(_Object$assign({
|
|
54
56
|
disabled
|
|
55
|
-
}, attr), {
|
|
57
|
+
}, _omit(attr, ['x-semi-children-alias'])), {
|
|
56
58
|
className: classNames(prefixCls, {
|
|
57
59
|
[_concatInstanceProperty(_context = "".concat(prefixCls, "-")).call(_context, type)]: !disabled && type,
|
|
58
60
|
["".concat(prefixCls, "-disabled")]: disabled,
|
|
@@ -68,6 +70,12 @@ export default class Button extends PureComponent {
|
|
|
68
70
|
'aria-disabled': disabled
|
|
69
71
|
});
|
|
70
72
|
|
|
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
|
+
|
|
71
79
|
return (
|
|
72
80
|
/*#__PURE__*/
|
|
73
81
|
// eslint-disable-next-line react/button-has-type
|
|
@@ -75,10 +83,10 @@ export default class Button extends PureComponent {
|
|
|
75
83
|
onClick: this.props.onClick,
|
|
76
84
|
onMouseDown: this.props.onMouseDown,
|
|
77
85
|
style: style
|
|
78
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
86
|
+
}), /*#__PURE__*/React.createElement("span", _Object$assign({
|
|
79
87
|
className: "".concat(prefixCls, "-content"),
|
|
80
88
|
onClick: e => disabled && e.stopPropagation()
|
|
81
|
-
}, children))
|
|
89
|
+
}, xSemiProps), children))
|
|
82
90
|
);
|
|
83
91
|
}
|
|
84
92
|
|
package/lib/es/card/index.js
CHANGED
|
@@ -59,7 +59,8 @@ 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")
|
|
62
|
+
className: "".concat(prefixcls, "-header-wrapper-extra"),
|
|
63
|
+
"x-semi-prop": "headerExtraContent"
|
|
63
64
|
}, headerExtraContent), title && /*#__PURE__*/React.createElement("div", {
|
|
64
65
|
className: titleCls
|
|
65
66
|
}, _isString(title) ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
@@ -67,7 +68,8 @@ class Card extends PureComponent {
|
|
|
67
68
|
ellipsis: {
|
|
68
69
|
showTooltip: true,
|
|
69
70
|
rows: 1
|
|
70
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"x-semi-prop": "title"
|
|
71
73
|
}, title) : title)));
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -80,7 +82,8 @@ class Card extends PureComponent {
|
|
|
80
82
|
} = this.props;
|
|
81
83
|
const coverCls = cls("".concat(prefixcls, "-cover"));
|
|
82
84
|
return cover && /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: coverCls
|
|
85
|
+
className: coverCls,
|
|
86
|
+
"x-semi-prop": "cover"
|
|
84
87
|
}, cover);
|
|
85
88
|
};
|
|
86
89
|
|
|
@@ -110,7 +113,8 @@ class Card extends PureComponent {
|
|
|
110
113
|
spacing: 12
|
|
111
114
|
}, _mapInstanceProperty(actions).call(actions, (item, idx) => /*#__PURE__*/React.createElement("div", {
|
|
112
115
|
key: idx,
|
|
113
|
-
className: actionsItemCls
|
|
116
|
+
className: actionsItemCls,
|
|
117
|
+
"x-semi-prop": "actions.".concat(idx)
|
|
114
118
|
}, item)))));
|
|
115
119
|
};
|
|
116
120
|
|
|
@@ -125,7 +129,8 @@ class Card extends PureComponent {
|
|
|
125
129
|
});
|
|
126
130
|
return footer && /*#__PURE__*/React.createElement("div", {
|
|
127
131
|
style: footerStyle,
|
|
128
|
-
className: footerCls
|
|
132
|
+
className: footerCls,
|
|
133
|
+
"x-semi-prop": "footer"
|
|
129
134
|
}, footer);
|
|
130
135
|
};
|
|
131
136
|
}
|
|
@@ -57,12 +57,16 @@ class CarouselArrow extends React.PureComponent {
|
|
|
57
57
|
// role='button'
|
|
58
58
|
className: leftClassNames,
|
|
59
59
|
onClick: prev
|
|
60
|
-
}, _get(this.props, 'arrowProps.leftArrow.props')
|
|
60
|
+
}, _get(this.props, 'arrowProps.leftArrow.props'), {
|
|
61
|
+
"x-semi-prop": "arrowProps.leftArrow.children"
|
|
62
|
+
}), this.renderLeftIcon()), /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
61
63
|
// role='button'
|
|
62
64
|
// tabIndex={0}
|
|
63
65
|
className: rightClassNames,
|
|
64
66
|
onClick: next
|
|
65
|
-
}, _get(this.props, 'arrowProps.rightArrow.props')
|
|
67
|
+
}, _get(this.props, 'arrowProps.rightArrow.props'), {
|
|
68
|
+
"x-semi-prop": "arrowProps.rightArrow.children"
|
|
69
|
+
}), this.renderRightIcon()));
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
}
|
package/lib/es/carousel/index.js
CHANGED
|
@@ -263,7 +263,8 @@ 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
|
-
})
|
|
266
|
+
}),
|
|
267
|
+
"x-semi-prop": "children"
|
|
267
268
|
}, this.renderChildren()), this.renderIndicator(), this.renderArrow());
|
|
268
269
|
}
|
|
269
270
|
|