@douyinfe/semi-ui 2.27.1 → 2.28.0-beta.1
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/dist/css/semi.css +228 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2446 -2082
- 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/lib/cjs/_portal/index.js +2 -2
- package/lib/cjs/_utils/index.js +3 -1
- package/lib/cjs/anchor/index.js +9 -9
- package/lib/cjs/anchor/link.js +8 -8
- package/lib/cjs/autoComplete/index.js +8 -4
- package/lib/cjs/autoComplete/option.js +7 -7
- package/lib/cjs/avatar/avatarGroup.js +7 -7
- package/lib/cjs/avatar/index.js +12 -12
- package/lib/cjs/badge/index.js +8 -8
- package/lib/cjs/banner/index.js +12 -12
- package/lib/cjs/breadcrumb/index.js +12 -12
- package/lib/cjs/breadcrumb/item.js +8 -8
- package/lib/cjs/button/Button.js +9 -9
- package/lib/cjs/button/buttonGroup.js +5 -5
- package/lib/cjs/button/splitButtonGroup.js +1 -1
- package/lib/cjs/calendar/dayCalendar.js +13 -13
- package/lib/cjs/calendar/dayCol.js +17 -17
- package/lib/cjs/calendar/monthCalendar.js +38 -38
- package/lib/cjs/calendar/rangeCalendar.js +27 -27
- package/lib/cjs/calendar/timeCol.js +6 -6
- package/lib/cjs/calendar/weekCalendar.js +27 -27
- package/lib/cjs/card/cardGroup.js +2 -2
- package/lib/cjs/card/index.js +16 -16
- package/lib/cjs/card/meta.js +5 -5
- package/lib/cjs/carousel/CarouselArrow.js +6 -6
- package/lib/cjs/carousel/CarouselIndicator.js +6 -6
- package/lib/cjs/carousel/index.js +12 -12
- package/lib/cjs/cascader/index.d.ts +5 -2
- package/lib/cjs/cascader/index.js +40 -38
- package/lib/cjs/cascader/item.d.ts +15 -1
- package/lib/cjs/cascader/item.js +64 -32
- package/lib/cjs/checkbox/checkbox.js +14 -14
- package/lib/cjs/checkbox/checkboxGroup.js +4 -4
- package/lib/cjs/checkbox/checkboxInner.js +6 -6
- package/lib/cjs/collapse/item.js +9 -9
- package/lib/cjs/collapsible/index.js +3 -3
- package/lib/cjs/configProvider/index.js +1 -1
- package/lib/cjs/datePicker/dateInput.js +16 -16
- package/lib/cjs/datePicker/datePicker.js +9 -9
- package/lib/cjs/datePicker/footer.js +1 -1
- package/lib/cjs/datePicker/index.js +1 -1
- package/lib/cjs/datePicker/month.js +2 -2
- package/lib/cjs/datePicker/monthsGrid.js +27 -27
- package/lib/cjs/datePicker/navigation.js +1 -1
- package/lib/cjs/datePicker/quickControl.js +14 -14
- package/lib/cjs/datePicker/yearAndMonth.js +4 -4
- package/lib/cjs/descriptions/index.js +3 -3
- package/lib/cjs/descriptions/item.js +5 -5
- package/lib/cjs/divider/index.js +7 -7
- package/lib/cjs/dropdown/dropdownDivider.js +1 -1
- package/lib/cjs/dropdown/dropdownItem.js +7 -7
- package/lib/cjs/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownMenu.js +1 -1
- package/lib/cjs/dropdown/dropdownTitle.js +2 -2
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/dropdown/index.js +3 -3
- package/lib/cjs/empty/index.js +7 -7
- package/lib/cjs/form/arrayField.js +1 -1
- package/lib/cjs/form/baseForm.d.ts +3 -1
- package/lib/cjs/form/baseForm.js +2 -2
- package/lib/cjs/form/errorMessage.js +1 -1
- package/lib/cjs/form/field.d.ts +3 -1
- package/lib/cjs/form/group.js +2 -2
- package/lib/cjs/form/hoc/withField.js +16 -16
- package/lib/cjs/form/label.js +9 -9
- package/lib/cjs/form/slot.js +5 -5
- package/lib/cjs/grid/col.js +11 -11
- package/lib/cjs/grid/row.js +4 -4
- package/lib/cjs/highlight/index.js +1 -1
- package/lib/cjs/iconButton/index.js +5 -5
- package/lib/cjs/image/image.js +10 -10
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/preview.js +3 -3
- package/lib/cjs/image/previewFooter.js +12 -12
- package/lib/cjs/image/previewHeader.js +3 -3
- package/lib/cjs/image/previewImage.js +7 -7
- package/lib/cjs/image/previewInner.js +7 -7
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/index.js +38 -38
- package/lib/cjs/input/inputGroup.js +7 -7
- package/lib/cjs/input/textarea.js +14 -14
- package/lib/cjs/inputNumber/index.js +11 -11
- package/lib/cjs/layout/Sider.d.ts +1 -0
- package/lib/cjs/layout/Sider.js +4 -3
- package/lib/cjs/layout/index.js +4 -2
- package/lib/cjs/list/index.js +11 -11
- package/lib/cjs/list/item.js +6 -6
- package/lib/cjs/modal/ConfirmModal.js +7 -7
- package/lib/cjs/modal/Modal.d.ts +0 -2
- package/lib/cjs/modal/Modal.js +8 -10
- package/lib/cjs/modal/ModalContent.js +24 -24
- package/lib/cjs/modal/useModal/index.js +1 -1
- package/lib/cjs/navigation/CollapseButton.js +1 -1
- package/lib/cjs/navigation/Footer.js +2 -2
- package/lib/cjs/navigation/Header.js +5 -5
- package/lib/cjs/navigation/Item.js +16 -16
- package/lib/cjs/navigation/SubNav.js +14 -14
- package/lib/cjs/navigation/index.js +8 -8
- package/lib/cjs/notification/index.js +3 -3
- package/lib/cjs/notification/notice.js +12 -12
- package/lib/cjs/overflowList/index.d.ts +1 -1
- package/lib/cjs/overflowList/index.js +32 -35
- package/lib/cjs/overflowList/intersectionObserver.js +3 -1
- package/lib/cjs/pagination/index.js +26 -26
- package/lib/cjs/popconfirm/index.js +9 -9
- package/lib/cjs/popover/index.js +2 -2
- package/lib/cjs/progress/index.js +14 -14
- package/lib/cjs/radio/radio.js +22 -22
- package/lib/cjs/radio/radioGroup.js +5 -5
- package/lib/cjs/radio/radioInner.js +7 -7
- package/lib/cjs/rating/index.js +5 -5
- package/lib/cjs/rating/item.js +11 -11
- package/lib/cjs/scrollList/index.js +5 -5
- package/lib/cjs/scrollList/scrollItem.js +13 -13
- package/lib/cjs/select/index.d.ts +11 -0
- package/lib/cjs/select/index.js +297 -116
- package/lib/cjs/select/option.js +7 -7
- package/lib/cjs/sideSheet/SideSheetContent.js +10 -10
- package/lib/cjs/sideSheet/index.js +7 -7
- package/lib/cjs/skeleton/index.js +1 -1
- package/lib/cjs/skeleton/item.js +4 -4
- package/lib/cjs/slider/index.js +28 -28
- package/lib/cjs/space/index.js +12 -12
- package/lib/cjs/spin/icon.js +2 -2
- package/lib/cjs/spin/index.d.ts +1 -1
- package/lib/cjs/spin/index.js +6 -6
- package/lib/cjs/steps/basicStep.js +14 -14
- package/lib/cjs/steps/basicSteps.js +6 -6
- package/lib/cjs/steps/fillStep.js +10 -10
- package/lib/cjs/steps/fillSteps.js +4 -4
- package/lib/cjs/steps/navStep.js +5 -5
- package/lib/cjs/steps/navSteps.js +2 -2
- package/lib/cjs/table/Body/BaseRow.js +5 -5
- package/lib/cjs/table/Body/ExpandedRow.js +3 -3
- package/lib/cjs/table/Body/SectionRow.js +1 -1
- package/lib/cjs/table/Body/index.js +8 -8
- package/lib/cjs/table/ColGroup.js +2 -2
- package/lib/cjs/table/ColumnFilter.js +3 -3
- package/lib/cjs/table/ColumnSelection.js +2 -2
- package/lib/cjs/table/ColumnSorter.js +7 -7
- package/lib/cjs/table/CustomExpandIcon.js +2 -2
- package/lib/cjs/table/HeadTable.js +3 -3
- package/lib/cjs/table/Table.js +20 -20
- package/lib/cjs/table/TableCell.js +8 -8
- package/lib/cjs/table/TableHeader.js +1 -1
- package/lib/cjs/table/TableHeaderRow.d.ts +1 -1
- package/lib/cjs/table/TableHeaderRow.js +8 -8
- package/lib/cjs/table/TablePagination.js +3 -3
- package/lib/cjs/tabs/TabBar.js +31 -49
- package/lib/cjs/tabs/TabItem.d.ts +18 -0
- package/lib/cjs/tabs/TabItem.js +95 -0
- package/lib/cjs/tabs/TabPane.js +3 -3
- package/lib/cjs/tabs/index.d.ts +2 -1
- package/lib/cjs/tabs/index.js +5 -2
- package/lib/cjs/tag/group.js +5 -5
- package/lib/cjs/tag/index.js +13 -13
- package/lib/cjs/tagInput/index.js +33 -33
- package/lib/cjs/timePicker/Combobox.js +4 -4
- package/lib/cjs/timePicker/TimeInput.js +4 -4
- package/lib/cjs/timePicker/TimePicker.js +8 -8
- package/lib/cjs/timeline/index.js +8 -8
- package/lib/cjs/timeline/item.js +7 -7
- package/lib/cjs/toast/index.js +5 -5
- package/lib/cjs/toast/toast.js +9 -9
- package/lib/cjs/tooltip/index.js +7 -7
- package/lib/cjs/transfer/index.js +31 -31
- package/lib/cjs/tree/autoSizer.js +1 -1
- package/lib/cjs/tree/index.js +6 -6
- package/lib/cjs/tree/interface.d.ts +1 -0
- package/lib/cjs/tree/nodeList.js +1 -1
- package/lib/cjs/tree/treeNode.js +26 -26
- package/lib/cjs/treeSelect/index.js +41 -41
- package/lib/cjs/typography/base.js +14 -14
- package/lib/cjs/typography/copyable.js +3 -3
- package/lib/cjs/typography/paragraph.js +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/typography/title.js +1 -1
- package/lib/cjs/typography/util.js +1 -1
- package/lib/cjs/upload/fileCard.js +32 -32
- package/lib/cjs/upload/index.js +37 -37
- package/lib/es/_portal/index.js +2 -2
- package/lib/es/_utils/index.js +3 -1
- package/lib/es/anchor/index.js +9 -9
- package/lib/es/anchor/link.js +8 -8
- package/lib/es/autoComplete/index.js +8 -4
- package/lib/es/autoComplete/option.js +7 -7
- package/lib/es/avatar/avatarGroup.js +7 -7
- package/lib/es/avatar/index.js +12 -12
- package/lib/es/badge/index.js +8 -8
- package/lib/es/banner/index.js +12 -12
- package/lib/es/breadcrumb/index.js +12 -12
- package/lib/es/breadcrumb/item.js +8 -8
- package/lib/es/button/Button.js +9 -9
- package/lib/es/button/buttonGroup.js +5 -5
- package/lib/es/button/splitButtonGroup.js +1 -1
- package/lib/es/calendar/dayCalendar.js +13 -13
- package/lib/es/calendar/dayCol.js +17 -17
- package/lib/es/calendar/monthCalendar.js +38 -38
- package/lib/es/calendar/rangeCalendar.js +27 -27
- package/lib/es/calendar/timeCol.js +6 -6
- package/lib/es/calendar/weekCalendar.js +27 -27
- package/lib/es/card/cardGroup.js +2 -2
- package/lib/es/card/index.js +16 -16
- package/lib/es/card/meta.js +5 -5
- package/lib/es/carousel/CarouselArrow.js +6 -6
- package/lib/es/carousel/CarouselIndicator.js +6 -6
- package/lib/es/carousel/index.js +12 -12
- package/lib/es/cascader/index.d.ts +5 -2
- package/lib/es/cascader/index.js +40 -38
- package/lib/es/cascader/item.d.ts +15 -1
- package/lib/es/cascader/item.js +64 -32
- package/lib/es/checkbox/checkbox.js +14 -14
- package/lib/es/checkbox/checkboxGroup.js +4 -4
- package/lib/es/checkbox/checkboxInner.js +6 -6
- package/lib/es/collapse/item.js +9 -9
- package/lib/es/collapsible/index.js +3 -3
- package/lib/es/configProvider/index.js +1 -1
- package/lib/es/datePicker/dateInput.js +16 -16
- package/lib/es/datePicker/datePicker.js +9 -9
- package/lib/es/datePicker/footer.js +1 -1
- package/lib/es/datePicker/index.js +1 -1
- package/lib/es/datePicker/month.js +2 -2
- package/lib/es/datePicker/monthsGrid.js +27 -27
- package/lib/es/datePicker/navigation.js +1 -1
- package/lib/es/datePicker/quickControl.js +14 -14
- package/lib/es/datePicker/yearAndMonth.js +4 -4
- package/lib/es/descriptions/index.js +3 -3
- package/lib/es/descriptions/item.js +5 -5
- package/lib/es/divider/index.js +7 -7
- package/lib/es/dropdown/dropdownDivider.js +1 -1
- package/lib/es/dropdown/dropdownItem.js +7 -7
- package/lib/es/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/es/dropdown/dropdownMenu.js +1 -1
- package/lib/es/dropdown/dropdownTitle.js +2 -2
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/dropdown/index.js +3 -3
- package/lib/es/empty/index.js +7 -7
- package/lib/es/form/arrayField.js +1 -1
- package/lib/es/form/baseForm.d.ts +3 -1
- package/lib/es/form/baseForm.js +2 -2
- package/lib/es/form/errorMessage.js +1 -1
- package/lib/es/form/field.d.ts +3 -1
- package/lib/es/form/group.js +2 -2
- package/lib/es/form/hoc/withField.js +16 -16
- package/lib/es/form/label.js +9 -9
- package/lib/es/form/slot.js +5 -5
- package/lib/es/grid/col.js +11 -11
- package/lib/es/grid/row.js +4 -4
- package/lib/es/highlight/index.js +1 -1
- package/lib/es/iconButton/index.js +5 -5
- package/lib/es/image/image.js +10 -10
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/preview.js +3 -3
- package/lib/es/image/previewFooter.js +12 -12
- package/lib/es/image/previewHeader.js +3 -3
- package/lib/es/image/previewImage.js +7 -7
- package/lib/es/image/previewInner.js +7 -7
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/index.js +38 -38
- package/lib/es/input/inputGroup.js +7 -7
- package/lib/es/input/textarea.js +14 -14
- package/lib/es/inputNumber/index.js +11 -11
- package/lib/es/layout/Sider.d.ts +1 -0
- package/lib/es/layout/Sider.js +4 -3
- package/lib/es/layout/index.js +4 -2
- package/lib/es/list/index.js +11 -11
- package/lib/es/list/item.js +6 -6
- package/lib/es/modal/ConfirmModal.js +7 -7
- package/lib/es/modal/Modal.d.ts +0 -2
- package/lib/es/modal/Modal.js +8 -10
- package/lib/es/modal/ModalContent.js +24 -24
- package/lib/es/modal/useModal/index.js +1 -1
- package/lib/es/navigation/CollapseButton.js +1 -1
- package/lib/es/navigation/Footer.js +2 -2
- package/lib/es/navigation/Header.js +5 -5
- package/lib/es/navigation/Item.js +16 -16
- package/lib/es/navigation/SubNav.js +14 -14
- package/lib/es/navigation/index.js +8 -8
- package/lib/es/notification/index.js +3 -3
- package/lib/es/notification/notice.js +12 -12
- package/lib/es/overflowList/index.d.ts +1 -1
- package/lib/es/overflowList/index.js +31 -35
- package/lib/es/overflowList/intersectionObserver.js +2 -1
- package/lib/es/pagination/index.js +26 -26
- package/lib/es/popconfirm/index.js +9 -9
- package/lib/es/popover/index.js +2 -2
- package/lib/es/progress/index.js +14 -14
- package/lib/es/radio/radio.js +22 -22
- package/lib/es/radio/radioGroup.js +5 -5
- package/lib/es/radio/radioInner.js +7 -7
- package/lib/es/rating/index.js +5 -5
- package/lib/es/rating/item.js +11 -11
- package/lib/es/scrollList/index.js +5 -5
- package/lib/es/scrollList/scrollItem.js +13 -13
- package/lib/es/select/index.d.ts +11 -0
- package/lib/es/select/index.js +288 -112
- package/lib/es/select/option.js +7 -7
- package/lib/es/sideSheet/SideSheetContent.js +10 -10
- package/lib/es/sideSheet/index.js +7 -7
- package/lib/es/skeleton/index.js +1 -1
- package/lib/es/skeleton/item.js +4 -4
- package/lib/es/slider/index.js +28 -28
- package/lib/es/space/index.js +12 -12
- package/lib/es/spin/icon.js +2 -2
- package/lib/es/spin/index.d.ts +1 -1
- package/lib/es/spin/index.js +6 -6
- package/lib/es/steps/basicStep.js +14 -14
- package/lib/es/steps/basicSteps.js +6 -6
- package/lib/es/steps/fillStep.js +10 -10
- package/lib/es/steps/fillSteps.js +4 -4
- package/lib/es/steps/navStep.js +5 -5
- package/lib/es/steps/navSteps.js +2 -2
- package/lib/es/table/Body/BaseRow.js +5 -5
- package/lib/es/table/Body/ExpandedRow.js +3 -3
- package/lib/es/table/Body/SectionRow.js +1 -1
- package/lib/es/table/Body/index.js +8 -8
- package/lib/es/table/ColGroup.js +2 -2
- package/lib/es/table/ColumnFilter.js +3 -3
- package/lib/es/table/ColumnSelection.js +2 -2
- package/lib/es/table/ColumnSorter.js +7 -7
- package/lib/es/table/CustomExpandIcon.js +2 -2
- package/lib/es/table/HeadTable.js +3 -3
- package/lib/es/table/Table.js +20 -20
- package/lib/es/table/TableCell.js +8 -8
- package/lib/es/table/TableHeader.js +1 -1
- package/lib/es/table/TableHeaderRow.d.ts +1 -1
- package/lib/es/table/TableHeaderRow.js +8 -8
- package/lib/es/table/TablePagination.js +3 -3
- package/lib/es/tabs/TabBar.js +30 -50
- package/lib/es/tabs/TabItem.d.ts +18 -0
- package/lib/es/tabs/TabItem.js +78 -0
- package/lib/es/tabs/TabPane.js +3 -3
- package/lib/es/tabs/index.d.ts +2 -1
- package/lib/es/tabs/index.js +4 -2
- package/lib/es/tag/group.js +5 -5
- package/lib/es/tag/index.js +13 -13
- package/lib/es/tagInput/index.js +33 -33
- package/lib/es/timePicker/Combobox.js +4 -4
- package/lib/es/timePicker/TimeInput.js +4 -4
- package/lib/es/timePicker/TimePicker.js +8 -8
- package/lib/es/timeline/index.js +8 -8
- package/lib/es/timeline/item.js +7 -7
- package/lib/es/toast/index.js +5 -5
- package/lib/es/toast/toast.js +9 -9
- package/lib/es/tooltip/index.js +7 -7
- package/lib/es/transfer/index.js +31 -31
- package/lib/es/tree/autoSizer.js +1 -1
- package/lib/es/tree/index.js +6 -6
- package/lib/es/tree/interface.d.ts +1 -0
- package/lib/es/tree/nodeList.js +1 -1
- package/lib/es/tree/treeNode.js +26 -26
- package/lib/es/treeSelect/index.js +41 -41
- package/lib/es/typography/base.js +14 -14
- package/lib/es/typography/copyable.js +3 -3
- package/lib/es/typography/paragraph.js +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/title.js +1 -1
- package/lib/es/typography/util.js +1 -1
- package/lib/es/upload/fileCard.js +32 -32
- package/lib/es/upload/index.js +37 -37
- package/package.json +8 -8
package/lib/es/empty/index.js
CHANGED
|
@@ -75,14 +75,14 @@ export default class Empty extends BaseComponent {
|
|
|
75
75
|
imageNode = /*#__PURE__*/React.createElement("svg", {
|
|
76
76
|
"aria-hidden": "true"
|
|
77
77
|
}, /*#__PURE__*/React.createElement("use", {
|
|
78
|
-
xlinkHref:
|
|
78
|
+
xlinkHref: `#${imgSrc.id}`
|
|
79
79
|
}));
|
|
80
80
|
} else {
|
|
81
81
|
imageNode = imgSrc;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const wrapperCls = cls(className, prefixCls, {
|
|
85
|
-
[
|
|
85
|
+
[`${prefixCls}-${layout}`]: layout
|
|
86
86
|
});
|
|
87
87
|
const titleProps = imageNode ? {
|
|
88
88
|
heading: 4
|
|
@@ -96,19 +96,19 @@ export default class Empty extends BaseComponent {
|
|
|
96
96
|
className: wrapperCls,
|
|
97
97
|
style: style
|
|
98
98
|
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className:
|
|
99
|
+
className: `${prefixCls}-image`,
|
|
100
100
|
style: imageStyle,
|
|
101
101
|
"x-semi-prop": "image,darkModeImage"
|
|
102
102
|
}, imageNode), /*#__PURE__*/React.createElement("div", {
|
|
103
|
-
className:
|
|
103
|
+
className: `${prefixCls}-content`
|
|
104
104
|
}, title ? /*#__PURE__*/React.createElement(Typography.Title, Object.assign({}, titleProps, {
|
|
105
|
-
className:
|
|
105
|
+
className: `${prefixCls}-title`,
|
|
106
106
|
"x-semi-prop": "title"
|
|
107
107
|
}), title) : null, description ? /*#__PURE__*/React.createElement("div", {
|
|
108
|
-
className:
|
|
108
|
+
className: `${prefixCls}-description`,
|
|
109
109
|
"x-semi-prop": "description"
|
|
110
110
|
}, description) : null, children ? /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className:
|
|
111
|
+
className: `${prefixCls}-footer`,
|
|
112
112
|
"x-semi-prop": "children"
|
|
113
113
|
}, children) : null));
|
|
114
114
|
}
|
|
@@ -79,6 +79,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
79
79
|
size?: import("../select").SelectSize;
|
|
80
80
|
disabled?: boolean;
|
|
81
81
|
emptyContent?: React.ReactNode;
|
|
82
|
+
expandRestTagsOnClick?: boolean;
|
|
82
83
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
83
84
|
zIndex?: number;
|
|
84
85
|
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
@@ -91,6 +92,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
91
92
|
marginRight: number;
|
|
92
93
|
marginBottom: number;
|
|
93
94
|
};
|
|
95
|
+
ellipsisTrigger?: boolean;
|
|
94
96
|
outerTopSlot?: React.ReactNode;
|
|
95
97
|
innerTopSlot?: React.ReactNode;
|
|
96
98
|
outerBottomSlot?: React.ReactNode;
|
|
@@ -135,7 +137,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
135
137
|
preventScroll?: boolean;
|
|
136
138
|
showRestTagsPopover?: boolean;
|
|
137
139
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
138
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
140
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
139
141
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
140
142
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
141
143
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/baseForm.js
CHANGED
|
@@ -105,9 +105,9 @@ class Form extends BaseComponent {
|
|
|
105
105
|
const {
|
|
106
106
|
formId
|
|
107
107
|
} = this.state;
|
|
108
|
-
return document.querySelectorAll(
|
|
108
|
+
return document.querySelectorAll(`form[x-form-id="${formId}"] .${cssClasses.PREFIX}-field-error-message`);
|
|
109
109
|
},
|
|
110
|
-
getFieldDOM: field => document.querySelector(
|
|
110
|
+
getFieldDOM: field => document.querySelector(`.${cssClasses.PREFIX}-field[x-field-id="${field}"]`)
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -58,7 +58,7 @@ export default class ErrorMessage extends PureComponent {
|
|
|
58
58
|
error: /*#__PURE__*/React.createElement(IconAlertCircle, null)
|
|
59
59
|
};
|
|
60
60
|
const text = error ? this.generatorText(error) : this.generatorText(helpText);
|
|
61
|
-
const iconCls =
|
|
61
|
+
const iconCls = `${prefix}-field-validate-status-icon`;
|
|
62
62
|
let icon = null;
|
|
63
63
|
|
|
64
64
|
if (isInInputGroup) {
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
27
27
|
size?: import("../select/index").SelectSize;
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
emptyContent?: import("react").ReactNode;
|
|
30
|
+
expandRestTagsOnClick?: boolean;
|
|
30
31
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
31
32
|
zIndex?: number;
|
|
32
33
|
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
@@ -39,6 +40,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
39
40
|
marginRight: number;
|
|
40
41
|
marginBottom: number;
|
|
41
42
|
};
|
|
43
|
+
ellipsisTrigger?: boolean;
|
|
42
44
|
outerTopSlot?: import("react").ReactNode;
|
|
43
45
|
innerTopSlot?: import("react").ReactNode;
|
|
44
46
|
outerBottomSlot?: import("react").ReactNode;
|
|
@@ -83,7 +85,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
83
85
|
preventScroll?: boolean;
|
|
84
86
|
showRestTagsPopover?: boolean;
|
|
85
87
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
86
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
88
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
87
89
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
88
90
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
89
91
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
package/lib/es/form/group.js
CHANGED
|
@@ -89,13 +89,13 @@ class FormInputGroup extends Component {
|
|
|
89
89
|
return null;
|
|
90
90
|
});
|
|
91
91
|
const groupCls = classNames({
|
|
92
|
-
[
|
|
92
|
+
[`${prefix}-field-group`]: true
|
|
93
93
|
});
|
|
94
94
|
const labelCol = formProps.labelCol;
|
|
95
95
|
const wrapperCol = formProps.wrapperCol;
|
|
96
96
|
const labelAlign = formProps.labelAlign;
|
|
97
97
|
const appendCol = labelCol && wrapperCol;
|
|
98
|
-
const labelColCls = labelCol ?
|
|
98
|
+
const labelColCls = labelCol ? `${prefix}-col-${labelAlign}` : '';
|
|
99
99
|
const labelContent = this.renderLabel(label, formProps);
|
|
100
100
|
const inputGroupContent = /*#__PURE__*/React.createElement(InputGroup, Object.assign({}, rest), inner);
|
|
101
101
|
const groupErrorContent = /*#__PURE__*/React.createElement(GroupError, {
|
|
@@ -422,18 +422,18 @@ function withField(Component, opts) {
|
|
|
422
422
|
let mergeExtraPos = extraTextPosition || formProps.extraTextPosition || 'bottom'; // id attribute to improve a11y
|
|
423
423
|
|
|
424
424
|
const a11yId = id ? id : field;
|
|
425
|
-
const labelId =
|
|
426
|
-
const helpTextId =
|
|
427
|
-
const extraTextId =
|
|
428
|
-
const errorMessageId =
|
|
425
|
+
const labelId = `${a11yId}-label`;
|
|
426
|
+
const helpTextId = `${a11yId}-helpText`;
|
|
427
|
+
const extraTextId = `${a11yId}-extraText`;
|
|
428
|
+
const errorMessageId = `${a11yId}-errormessage`;
|
|
429
429
|
|
|
430
430
|
const FieldComponent = () => {
|
|
431
431
|
// prefer to use validateStatus which pass by user throught props
|
|
432
432
|
let blockStatus = validateStatus ? validateStatus : status;
|
|
433
|
-
const extraCls = classNames(
|
|
434
|
-
[
|
|
435
|
-
[
|
|
436
|
-
[
|
|
433
|
+
const extraCls = classNames(`${prefix}-field-extra`, {
|
|
434
|
+
[`${prefix}-field-extra-string`]: typeof extraText === 'string',
|
|
435
|
+
[`${prefix}-field-extra-middle`]: mergeExtraPos === 'middle',
|
|
436
|
+
[`${prefix}-field-extra-bottom`]: mergeExtraPos === 'bottom'
|
|
437
437
|
});
|
|
438
438
|
const extraContent = extraText ? /*#__PURE__*/React.createElement("div", {
|
|
439
439
|
className: extraCls,
|
|
@@ -458,11 +458,11 @@ function withField(Component, opts) {
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
if (helpText) {
|
|
461
|
-
newProps['aria-describedby'] = extraText ?
|
|
461
|
+
newProps['aria-describedby'] = extraText ? `${helpTextId} ${extraTextId}` : helpTextId;
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
if (extraText) {
|
|
465
|
-
newProps['aria-describedby'] = helpText ?
|
|
465
|
+
newProps['aria-describedby'] = helpText ? `${helpTextId} ${extraTextId}` : extraTextId;
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
if (status === 'error') {
|
|
@@ -471,12 +471,12 @@ function withField(Component, opts) {
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
const fieldCls = classNames({
|
|
474
|
-
[
|
|
475
|
-
[
|
|
474
|
+
[`${prefix}-field`]: true,
|
|
475
|
+
[`${prefix}-field-${name}`]: Boolean(name),
|
|
476
476
|
[fieldClassName]: Boolean(fieldClassName)
|
|
477
477
|
});
|
|
478
478
|
const fieldMaincls = classNames({
|
|
479
|
-
[
|
|
479
|
+
[`${prefix}-field-main`]: true
|
|
480
480
|
});
|
|
481
481
|
|
|
482
482
|
if (mergeLabelPos === 'inset' && !noLabel) {
|
|
@@ -497,8 +497,8 @@ function withField(Component, opts) {
|
|
|
497
497
|
|
|
498
498
|
if (pure) {
|
|
499
499
|
let pureCls = classNames(rest.className, {
|
|
500
|
-
[
|
|
501
|
-
[
|
|
500
|
+
[`${prefix}-field-pure`]: true,
|
|
501
|
+
[`${prefix}-field-${name}`]: Boolean(name),
|
|
502
502
|
[fieldClassName]: Boolean(fieldClassName)
|
|
503
503
|
});
|
|
504
504
|
newProps.className = pureCls;
|
|
@@ -506,7 +506,7 @@ function withField(Component, opts) {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
let withCol = mergeLabelCol && mergeWrapperCol;
|
|
509
|
-
const labelColCls = mergeLabelAlign ?
|
|
509
|
+
const labelColCls = mergeLabelAlign ? `${prefix}-col-${mergeLabelAlign}` : ''; // get label
|
|
510
510
|
|
|
511
511
|
let labelContent = null;
|
|
512
512
|
|
package/lib/es/form/label.js
CHANGED
|
@@ -21,26 +21,26 @@ export default class Label extends PureComponent {
|
|
|
21
21
|
optional
|
|
22
22
|
} = this.props;
|
|
23
23
|
const labelCls = classNames(className, {
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
24
|
+
[`${prefixCls}-field-label`]: true,
|
|
25
|
+
[`${prefixCls}-field-label-left`]: align === 'left',
|
|
26
|
+
[`${prefixCls}-field-label-right`]: align === 'right',
|
|
27
|
+
[`${prefixCls}-field-label-required`]: required,
|
|
28
|
+
[`${prefixCls}-field-label-disabled`]: disabled,
|
|
29
|
+
[`${prefixCls}-field-label-with-extra`]: extra
|
|
30
30
|
});
|
|
31
31
|
const labelStyle = style ? style : {};
|
|
32
32
|
width ? labelStyle.width = width : null;
|
|
33
33
|
const optionalText = /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
34
34
|
componentName: "Form"
|
|
35
35
|
}, locale => /*#__PURE__*/React.createElement("span", {
|
|
36
|
-
className:
|
|
36
|
+
className: `${prefixCls}-field-label-optional-text`
|
|
37
37
|
}, locale.optional));
|
|
38
38
|
const textContent = /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className:
|
|
39
|
+
className: `${prefixCls}-field-label-text`,
|
|
40
40
|
"x-semi-prop": "label"
|
|
41
41
|
}, typeof text !== 'undefined' ? text : children, optional ? optionalText : null);
|
|
42
42
|
const contentWithExtra = /*#__PURE__*/React.createElement(React.Fragment, null, textContent, /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className:
|
|
43
|
+
className: `${prefixCls}-field-label-extra`
|
|
44
44
|
}, extra));
|
|
45
45
|
return /*#__PURE__*/React.createElement("label", {
|
|
46
46
|
className: labelCls,
|
package/lib/es/form/slot.js
CHANGED
|
@@ -53,11 +53,11 @@ const FormSlot = props => {
|
|
|
53
53
|
|
|
54
54
|
const appendCol = labelCol && wrapperCol;
|
|
55
55
|
const slotCls = classNames({
|
|
56
|
-
[
|
|
57
|
-
[
|
|
56
|
+
[`${prefix}-field`]: true,
|
|
57
|
+
[`${prefix}-slot`]: true
|
|
58
58
|
}, className);
|
|
59
59
|
const labelColCls = classNames({
|
|
60
|
-
[
|
|
60
|
+
[`${prefix}-col-${labelAlign}`]: true
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
switch (true) {
|
|
@@ -118,8 +118,8 @@ const FormSlot = props => {
|
|
|
118
118
|
width: labelWidth
|
|
119
119
|
}, label);
|
|
120
120
|
let mainCls = classNames({
|
|
121
|
-
[
|
|
122
|
-
[
|
|
121
|
+
[`${prefix}-field-main`]: true,
|
|
122
|
+
[`${prefix}-slot-main`]: true
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
switch (true) {
|
package/lib/es/grid/col.js
CHANGED
|
@@ -39,7 +39,7 @@ class Col extends React.Component {
|
|
|
39
39
|
others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children"]);
|
|
40
40
|
|
|
41
41
|
let sizeClassObj = {};
|
|
42
|
-
const prefix =
|
|
42
|
+
const prefix = `${prefixCls}-col`;
|
|
43
43
|
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach(size => {
|
|
44
44
|
let sizeProps = {};
|
|
45
45
|
|
|
@@ -51,19 +51,19 @@ class Col extends React.Component {
|
|
|
51
51
|
|
|
52
52
|
delete others[size];
|
|
53
53
|
sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), {
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
54
|
+
[`${prefix}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,
|
|
55
|
+
[`${prefix}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
|
|
56
|
+
[`${prefix}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
|
|
57
|
+
[`${prefix}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
|
|
58
|
+
[`${prefix}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
const classes = classnames(prefix, {
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
62
|
+
[`${prefix}-${span}`]: span !== undefined,
|
|
63
|
+
[`${prefix}-order-${order}`]: order,
|
|
64
|
+
[`${prefix}-offset-${offset}`]: offset,
|
|
65
|
+
[`${prefix}-push-${push}`]: push,
|
|
66
|
+
[`${prefix}-pull-${pull}`]: pull
|
|
67
67
|
}, className, sizeClassObj);
|
|
68
68
|
let {
|
|
69
69
|
style
|
package/lib/es/grid/row.js
CHANGED
|
@@ -114,12 +114,12 @@ class Row extends React.Component {
|
|
|
114
114
|
others = __rest(_a, ["prefixCls", "type", "justify", "align", "className", "style", "children"]);
|
|
115
115
|
|
|
116
116
|
const gutters = this.getGutter();
|
|
117
|
-
const prefix =
|
|
117
|
+
const prefix = `${prefixCls}-row`;
|
|
118
118
|
const classes = classnames({
|
|
119
119
|
[prefix]: type !== 'flex',
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
120
|
+
[`${prefix}-${type}`]: type,
|
|
121
|
+
[`${prefix}-${type}-${justify}`]: type && justify,
|
|
122
|
+
[`${prefix}-${type}-${align}`]: type && align
|
|
123
123
|
}, className);
|
|
124
124
|
const rowStyle = Object.assign(Object.assign(Object.assign({}, gutters[0] > 0 ? {
|
|
125
125
|
marginLeft: gutters[0] / -2,
|
|
@@ -65,8 +65,8 @@ class IconButton extends PureComponent {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
const btnTextCls = classNames({
|
|
68
|
-
[
|
|
69
|
-
[
|
|
68
|
+
[`${prefixCls}-content-left`]: iconPosition === 'right',
|
|
69
|
+
[`${prefixCls}-content-right`]: iconPosition === 'left'
|
|
70
70
|
});
|
|
71
71
|
const xSemiProp = this.props['x-semi-children-alias'] || 'children';
|
|
72
72
|
const children = originChildren != null ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -80,9 +80,9 @@ class IconButton extends PureComponent {
|
|
|
80
80
|
finalChildren = /*#__PURE__*/React.createElement(React.Fragment, null, children, IconElem);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const iconBtnCls = classNames(className,
|
|
84
|
-
[
|
|
85
|
-
[
|
|
83
|
+
const iconBtnCls = classNames(className, `${prefixCls}-with-icon`, {
|
|
84
|
+
[`${prefixCls}-with-icon-only`]: children == null || children === '',
|
|
85
|
+
[`${prefixCls}-loading`]: loading
|
|
86
86
|
});
|
|
87
87
|
return /*#__PURE__*/React.createElement(Button, Object.assign({}, otherProps, {
|
|
88
88
|
className: iconBtnCls,
|
package/lib/es/image/image.js
CHANGED
|
@@ -64,7 +64,7 @@ export default class Image extends BaseComponent {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
this.renderDefaultError = () => {
|
|
67
|
-
const prefixClsName =
|
|
67
|
+
const prefixClsName = `${prefixCls}-status`;
|
|
68
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
69
69
|
className: prefixClsName
|
|
70
70
|
}, /*#__PURE__*/React.createElement(IconUploadError, {
|
|
@@ -73,7 +73,7 @@ export default class Image extends BaseComponent {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
this.renderLoad = () => {
|
|
76
|
-
const prefixClsName =
|
|
76
|
+
const prefixClsName = `${prefixCls}-status`;
|
|
77
77
|
const {
|
|
78
78
|
placeholder
|
|
79
79
|
} = this.props;
|
|
@@ -86,7 +86,7 @@ export default class Image extends BaseComponent {
|
|
|
86
86
|
const {
|
|
87
87
|
fallback
|
|
88
88
|
} = this.props;
|
|
89
|
-
const prefixClsName =
|
|
89
|
+
const prefixClsName = `${prefixCls}-status`;
|
|
90
90
|
const fallbackNode = typeof fallback === "string" ? /*#__PURE__*/React.createElement("img", {
|
|
91
91
|
style: {
|
|
92
92
|
width: "100%",
|
|
@@ -105,7 +105,7 @@ export default class Image extends BaseComponent {
|
|
|
105
105
|
loadStatus
|
|
106
106
|
} = this.state;
|
|
107
107
|
return /*#__PURE__*/React.createElement("div", {
|
|
108
|
-
className:
|
|
108
|
+
className: `${prefixCls}-overlay`
|
|
109
109
|
}, loadStatus === "error" && this.renderError(), loadStatus === "loading" && this.renderLoad());
|
|
110
110
|
};
|
|
111
111
|
|
|
@@ -114,13 +114,13 @@ export default class Image extends BaseComponent {
|
|
|
114
114
|
}, locale => locale[key]);
|
|
115
115
|
|
|
116
116
|
this.renderMask = () => /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
117
|
+
className: `${prefixCls}-mask`
|
|
118
118
|
}, /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className:
|
|
119
|
+
className: `${prefixCls}-mask-info`
|
|
120
120
|
}, /*#__PURE__*/React.createElement(IconEyeOpened, {
|
|
121
121
|
size: "extra-large"
|
|
122
122
|
}), /*#__PURE__*/React.createElement("span", {
|
|
123
|
-
className:
|
|
123
|
+
className: `${prefixCls}-mask-info-text`
|
|
124
124
|
}, this.getLocalTextByKey("preview"))));
|
|
125
125
|
|
|
126
126
|
this.state = {
|
|
@@ -216,9 +216,9 @@ export default class Image extends BaseComponent {
|
|
|
216
216
|
src: this.isInGroup() && this.isLazyLoad() ? undefined : src,
|
|
217
217
|
"data-src": src,
|
|
218
218
|
alt: alt,
|
|
219
|
-
className: cls(
|
|
220
|
-
[
|
|
221
|
-
[
|
|
219
|
+
className: cls(`${prefixCls}-img`, {
|
|
220
|
+
[`${prefixCls}-img-preview`]: showPreviewCursor,
|
|
221
|
+
[`${prefixCls}-img-error`]: loadStatus === "error"
|
|
222
222
|
}),
|
|
223
223
|
width: width,
|
|
224
224
|
height: height,
|
|
@@ -59,7 +59,7 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
|
|
|
59
59
|
getProps(): PreviewProps;
|
|
60
60
|
getState(key: string): any;
|
|
61
61
|
getStates(): PreviewState;
|
|
62
|
-
setState(s: Pick<PreviewState,
|
|
62
|
+
setState<K extends keyof PreviewState>(s: Pick<PreviewState, K>, callback?: any): void;
|
|
63
63
|
getCache(c: string): any;
|
|
64
64
|
getCaches(): any;
|
|
65
65
|
setCache(key: any, value: any): void;
|
package/lib/es/image/preview.js
CHANGED
|
@@ -103,7 +103,7 @@ export default class Preview extends BaseComponent {
|
|
|
103
103
|
const {
|
|
104
104
|
lazyLoadMargin
|
|
105
105
|
} = this.props;
|
|
106
|
-
const allElement = document.querySelectorAll(
|
|
106
|
+
const allElement = document.querySelectorAll(`.${prefixCls}-img`); // use IntersectionObserver to lazy load image
|
|
107
107
|
|
|
108
108
|
const observer = new IntersectionObserver(entries => {
|
|
109
109
|
entries.forEach(item => {
|
|
@@ -117,7 +117,7 @@ export default class Preview extends BaseComponent {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
}, {
|
|
120
|
-
root: document.querySelector(
|
|
120
|
+
root: document.querySelector(`#${this.previewGroupId}`),
|
|
121
121
|
rootMargin: lazyLoadMargin
|
|
122
122
|
});
|
|
123
123
|
allElement.forEach(item => observer.observe(item));
|
|
@@ -171,7 +171,7 @@ export default class Preview extends BaseComponent {
|
|
|
171
171
|
}, /*#__PURE__*/React.createElement("div", {
|
|
172
172
|
id: this.previewGroupId,
|
|
173
173
|
style: style,
|
|
174
|
-
className:
|
|
174
|
+
className: `${prefixCls}-preview-group`
|
|
175
175
|
}, newChildren), /*#__PURE__*/React.createElement(PreviewInner, Object.assign({}, restProps, {
|
|
176
176
|
ref: this.previewRef,
|
|
177
177
|
src: finalSrcList,
|
|
@@ -11,7 +11,7 @@ import cls from "classnames";
|
|
|
11
11
|
import PreviewFooterFoundation from '@douyinfe/semi-foundation/lib/es/image/previewFooterFoundation';
|
|
12
12
|
import LocaleConsumer from "../locale/localeConsumer";
|
|
13
13
|
const prefixCls = cssClasses.PREFIX;
|
|
14
|
-
const footerPrefixCls =
|
|
14
|
+
const footerPrefixCls = `${cssClasses.PREFIX}-preview-footer`;
|
|
15
15
|
let mouseActiveTime = 0;
|
|
16
16
|
export default class Footer extends BaseComponent {
|
|
17
17
|
constructor(props) {
|
|
@@ -110,7 +110,7 @@ export default class Footer extends BaseComponent {
|
|
|
110
110
|
} = this.props;
|
|
111
111
|
const icon = /*#__PURE__*/React.createElement(IconChevronLeft, {
|
|
112
112
|
size: "large",
|
|
113
|
-
className: disabledPrev ?
|
|
113
|
+
className: disabledPrev ? `${footerPrefixCls}-disabled` : "",
|
|
114
114
|
onClick: !disabledPrev ? onPrev : undefined
|
|
115
115
|
});
|
|
116
116
|
const content = prevTip !== null && prevTip !== void 0 ? prevTip : this.getLocalTextByKey("prevTip");
|
|
@@ -125,7 +125,7 @@ export default class Footer extends BaseComponent {
|
|
|
125
125
|
} = this.props;
|
|
126
126
|
const icon = /*#__PURE__*/React.createElement(IconChevronRight, {
|
|
127
127
|
size: "large",
|
|
128
|
-
className: disabledNext ?
|
|
128
|
+
className: disabledNext ? `${footerPrefixCls}-disabled` : "",
|
|
129
129
|
onClick: !disabledNext ? onNext : undefined
|
|
130
130
|
});
|
|
131
131
|
const content = nextTip !== null && nextTip !== void 0 ? nextTip : this.getLocalTextByKey("nextTip");
|
|
@@ -142,7 +142,7 @@ export default class Footer extends BaseComponent {
|
|
|
142
142
|
const icon = /*#__PURE__*/React.createElement(IconMinus, {
|
|
143
143
|
size: "large",
|
|
144
144
|
onClick: !disabledZoomOut ? this.handleMinusClick : undefined,
|
|
145
|
-
className: disabledZoomOut ?
|
|
145
|
+
className: disabledZoomOut ? `${footerPrefixCls}-disabled` : ""
|
|
146
146
|
});
|
|
147
147
|
const content = zoomOutTip !== null && zoomOutTip !== void 0 ? zoomOutTip : this.getLocalTextByKey("zoomOutTip");
|
|
148
148
|
return this.getFinalIconElement(icon, content);
|
|
@@ -158,7 +158,7 @@ export default class Footer extends BaseComponent {
|
|
|
158
158
|
const icon = /*#__PURE__*/React.createElement(IconPlus, {
|
|
159
159
|
size: "large",
|
|
160
160
|
onClick: !disabledZoomIn ? this.handlePlusClick : undefined,
|
|
161
|
-
className: disabledZoomIn ?
|
|
161
|
+
className: disabledZoomIn ? `${footerPrefixCls}-disabled` : ""
|
|
162
162
|
});
|
|
163
163
|
const content = zoomInTip !== null && zoomInTip !== void 0 ? zoomInTip : this.getLocalTextByKey("zoomInTip");
|
|
164
164
|
return this.getFinalIconElement(icon, content);
|
|
@@ -172,7 +172,7 @@ export default class Footer extends BaseComponent {
|
|
|
172
172
|
} = this.props;
|
|
173
173
|
const props = {
|
|
174
174
|
size: "large",
|
|
175
|
-
className: cls(
|
|
175
|
+
className: cls(`${footerPrefixCls}-gap`),
|
|
176
176
|
onClick: this.handleRatioClick
|
|
177
177
|
};
|
|
178
178
|
const icon = ratio === "adaptation" ? /*#__PURE__*/React.createElement(IconRealSizeStroked, Object.assign({}, props)) : /*#__PURE__*/React.createElement(IconWindowAdaptionStroked, Object.assign({}, props));
|
|
@@ -208,8 +208,8 @@ export default class Footer extends BaseComponent {
|
|
|
208
208
|
const icon = /*#__PURE__*/React.createElement(IconDownload, {
|
|
209
209
|
size: "large",
|
|
210
210
|
onClick: !disableDownload ? onDownload : undefined,
|
|
211
|
-
className: cls(
|
|
212
|
-
[
|
|
211
|
+
className: cls(`${footerPrefixCls}-gap`, {
|
|
212
|
+
[`${footerPrefixCls}-disabled`]: disableDownload
|
|
213
213
|
})
|
|
214
214
|
});
|
|
215
215
|
const content = downloadTip !== null && downloadTip !== void 0 ? downloadTip : this.getLocalTextByKey("downloadTip");
|
|
@@ -242,14 +242,14 @@ export default class Footer extends BaseComponent {
|
|
|
242
242
|
|
|
243
243
|
if (renderPreviewMenu) {
|
|
244
244
|
return /*#__PURE__*/React.createElement("div", {
|
|
245
|
-
className:
|
|
245
|
+
className: `${footerPrefixCls}-wrapper`
|
|
246
246
|
}, this.customRenderViewMenu());
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
return /*#__PURE__*/React.createElement("section", {
|
|
250
|
-
className: cls(footerPrefixCls,
|
|
250
|
+
className: cls(footerPrefixCls, `${footerPrefixCls}-wrapper`, className)
|
|
251
251
|
}, this.getIconChevronLeft(), /*#__PURE__*/React.createElement("div", {
|
|
252
|
-
className:
|
|
252
|
+
className: `${footerPrefixCls}-page`
|
|
253
253
|
}, /*#__PURE__*/React.createElement("span", null, curPage), /*#__PURE__*/React.createElement("span", null, "/"), /*#__PURE__*/React.createElement("span", null, totalNum)), this.getIconChevronRight(), /*#__PURE__*/React.createElement(Divider, {
|
|
254
254
|
layout: "vertical"
|
|
255
255
|
}), this.getIconMinus(), /*#__PURE__*/React.createElement(Slider, {
|
|
@@ -257,7 +257,7 @@ export default class Footer extends BaseComponent {
|
|
|
257
257
|
min: min,
|
|
258
258
|
max: max,
|
|
259
259
|
step: step,
|
|
260
|
-
tipFormatter: v =>
|
|
260
|
+
tipFormatter: v => `${v}%`,
|
|
261
261
|
tooltipVisible: showTooltip ? undefined : false,
|
|
262
262
|
onChange: this.handleSlideChange
|
|
263
263
|
}), this.getIconPlus(), this.getIconRatio(), /*#__PURE__*/React.createElement(Divider, {
|
|
@@ -3,7 +3,7 @@ import { IconClose } from "@douyinfe/semi-icons";
|
|
|
3
3
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/image/constants';
|
|
4
4
|
import cls from "classnames";
|
|
5
5
|
import { PreviewContext } from "./previewContext";
|
|
6
|
-
const prefixCls =
|
|
6
|
+
const prefixCls = `${cssClasses.PREFIX}-preview-header`;
|
|
7
7
|
|
|
8
8
|
const Header = _ref => {
|
|
9
9
|
let {
|
|
@@ -26,10 +26,10 @@ const Header = _ref => {
|
|
|
26
26
|
return /*#__PURE__*/React.createElement("section", {
|
|
27
27
|
className: cls(prefixCls, className)
|
|
28
28
|
}, /*#__PURE__*/React.createElement("section", {
|
|
29
|
-
className:
|
|
29
|
+
className: `${prefixCls}-title`,
|
|
30
30
|
style: titleStyle
|
|
31
31
|
}, renderHeader ? renderHeader(title) : title), /*#__PURE__*/React.createElement("section", {
|
|
32
|
-
className:
|
|
32
|
+
className: `${prefixCls}-close`,
|
|
33
33
|
onMouseUp: onClose
|
|
34
34
|
}, /*#__PURE__*/React.createElement(IconClose, null)));
|
|
35
35
|
});
|