@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
|
@@ -5,7 +5,7 @@ import PropTypes from "prop-types";
|
|
|
5
5
|
import Spin from "../spin";
|
|
6
6
|
import PreviewImageFoundation from '@douyinfe/semi-foundation/lib/es/image/previewImageFoundation';
|
|
7
7
|
const prefixCls = cssClasses.PREFIX;
|
|
8
|
-
const preViewImgPrefixCls =
|
|
8
|
+
const preViewImgPrefixCls = `${prefixCls}-preview-image`;
|
|
9
9
|
let originImageWidth = null;
|
|
10
10
|
let originImageHeight = null;
|
|
11
11
|
let startMouseMove = false; // startMouseOffset:The offset of the mouse relative to the left and top of the picture
|
|
@@ -185,20 +185,20 @@ export default class PreviewImage extends BaseComponent {
|
|
|
185
185
|
const imgStyle = {
|
|
186
186
|
position: "absolute",
|
|
187
187
|
visibility: loading ? "hidden" : "visible",
|
|
188
|
-
transform:
|
|
188
|
+
transform: `rotate(${-rotation}deg)`,
|
|
189
189
|
top,
|
|
190
190
|
left,
|
|
191
|
-
width: loading ? "auto" :
|
|
192
|
-
height: loading ? "auto" :
|
|
191
|
+
width: loading ? "auto" : `${width}px`,
|
|
192
|
+
height: loading ? "auto" : `${height}px`
|
|
193
193
|
};
|
|
194
194
|
return /*#__PURE__*/React.createElement("div", {
|
|
195
|
-
className:
|
|
195
|
+
className: `${preViewImgPrefixCls}`,
|
|
196
196
|
ref: this.containerRef
|
|
197
197
|
}, /*#__PURE__*/React.createElement("img", {
|
|
198
198
|
ref: this.registryImageRef,
|
|
199
199
|
src: src,
|
|
200
200
|
alt: "previewImag",
|
|
201
|
-
className:
|
|
201
|
+
className: `${preViewImgPrefixCls}-img`,
|
|
202
202
|
key: src,
|
|
203
203
|
onMouseMove: this.handleMoveImage,
|
|
204
204
|
onMouseDown: this.onImageMouseDown,
|
|
@@ -211,7 +211,7 @@ export default class PreviewImage extends BaseComponent {
|
|
|
211
211
|
crossOrigin: crossOrigin
|
|
212
212
|
}), loading && /*#__PURE__*/React.createElement(Spin, {
|
|
213
213
|
size: "large",
|
|
214
|
-
wrapperClassName:
|
|
214
|
+
wrapperClassName: `${preViewImgPrefixCls}-spin`
|
|
215
215
|
}));
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -116,7 +116,7 @@ export default class PreviewInner extends BaseComponent {
|
|
|
116
116
|
|
|
117
117
|
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
118
118
|
document.body.style.overflow = 'hidden';
|
|
119
|
-
document.body.style.width =
|
|
119
|
+
document.body.style.width = `calc(${this.originBodyWidth || '100%'} - ${this.scrollBarWidth}px)`;
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
enabledBodyScroll: () => {
|
|
@@ -328,12 +328,12 @@ export default class PreviewInner extends BaseComponent {
|
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
const previewPrefixCls =
|
|
331
|
+
const previewPrefixCls = `${prefixCls}-preview`;
|
|
332
332
|
const previewWrapperCls = cls(previewPrefixCls, {
|
|
333
|
-
[
|
|
334
|
-
[
|
|
333
|
+
[`${prefixCls}-hide`]: !visible,
|
|
334
|
+
[`${previewPrefixCls}-popup`]: getPopupContainer
|
|
335
335
|
}, className);
|
|
336
|
-
const hideViewerCls = !viewerVisible ?
|
|
336
|
+
const hideViewerCls = !viewerVisible ? `${previewPrefixCls}-hide` : "";
|
|
337
337
|
const total = imgSrc.length;
|
|
338
338
|
const showPrev = total !== 1 && (infinite || currentIndex !== 0);
|
|
339
339
|
const showNext = total !== 1 && (infinite || currentIndex !== total - 1);
|
|
@@ -371,7 +371,7 @@ export default class PreviewInner extends BaseComponent {
|
|
|
371
371
|
/*#__PURE__*/
|
|
372
372
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
373
373
|
React.createElement("div", {
|
|
374
|
-
className: cls(
|
|
374
|
+
className: cls(`${previewPrefixCls}-icon`, `${previewPrefixCls}-prev`, hideViewerCls),
|
|
375
375
|
onClick: () => this.handleSwitchImage("prev")
|
|
376
376
|
}, /*#__PURE__*/React.createElement(IconArrowLeft, {
|
|
377
377
|
size: "large"
|
|
@@ -379,7 +379,7 @@ export default class PreviewInner extends BaseComponent {
|
|
|
379
379
|
/*#__PURE__*/
|
|
380
380
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
381
381
|
React.createElement("div", {
|
|
382
|
-
className: cls(
|
|
382
|
+
className: cls(`${previewPrefixCls}-icon`, `${previewPrefixCls}-next`, hideViewerCls),
|
|
383
383
|
onClick: () => this.handleSwitchImage("next")
|
|
384
384
|
}, /*#__PURE__*/React.createElement(IconArrowRight, {
|
|
385
385
|
size: "large"
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
154
154
|
getProps(): InputProps;
|
|
155
155
|
getState(key: string): any;
|
|
156
156
|
getStates(): InputState;
|
|
157
|
-
setState(s: Pick<InputState,
|
|
157
|
+
setState<K extends keyof InputState>(s: Pick<InputState, K>, callback?: any): void;
|
|
158
158
|
getCache(c: string): any;
|
|
159
159
|
getCaches(): any;
|
|
160
160
|
setCache(key: any, value: any): void;
|
package/lib/es/input/index.js
CHANGED
|
@@ -168,9 +168,9 @@ class Input extends BaseComponent {
|
|
|
168
168
|
|
|
169
169
|
if (addonBefore) {
|
|
170
170
|
const prefixWrapperCls = cls({
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
171
|
+
[`${prefixCls}-prepend`]: true,
|
|
172
|
+
[`${prefixCls}-prepend-text`]: addonBefore && _isString(addonBefore),
|
|
173
|
+
[`${prefixCls}-prepend-icon`]: isSemiIcon(addonBefore)
|
|
174
174
|
});
|
|
175
175
|
return /*#__PURE__*/React.createElement("div", {
|
|
176
176
|
className: prefixWrapperCls,
|
|
@@ -188,9 +188,9 @@ class Input extends BaseComponent {
|
|
|
188
188
|
|
|
189
189
|
if (addonAfter) {
|
|
190
190
|
const prefixWrapperCls = cls({
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
191
|
+
[`${prefixCls}-append`]: true,
|
|
192
|
+
[`${prefixCls}-append-text`]: addonAfter && _isString(addonAfter),
|
|
193
|
+
[`${prefixCls}-append-icon`]: isSemiIcon(addonAfter)
|
|
194
194
|
});
|
|
195
195
|
return /*#__PURE__*/React.createElement("div", {
|
|
196
196
|
className: prefixWrapperCls,
|
|
@@ -202,7 +202,7 @@ class Input extends BaseComponent {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
renderClearBtn() {
|
|
205
|
-
const clearCls = cls(
|
|
205
|
+
const clearCls = cls(`${prefixCls}-clearbtn`);
|
|
206
206
|
const {
|
|
207
207
|
clearIcon
|
|
208
208
|
} = this.props;
|
|
@@ -230,7 +230,7 @@ class Input extends BaseComponent {
|
|
|
230
230
|
mode,
|
|
231
231
|
disabled
|
|
232
232
|
} = this.props;
|
|
233
|
-
const modeCls = cls(
|
|
233
|
+
const modeCls = cls(`${prefixCls}-modebtn`);
|
|
234
234
|
const modeIcon = eyeClosed ? /*#__PURE__*/React.createElement(IconEyeClosedSolid, null) : /*#__PURE__*/React.createElement(IconEyeOpened, null); // alway show password button for a11y
|
|
235
235
|
|
|
236
236
|
const showModeBtn = mode === 'password' && !disabled;
|
|
@@ -265,10 +265,10 @@ class Input extends BaseComponent {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
const prefixWrapperCls = cls({
|
|
268
|
-
[
|
|
269
|
-
[
|
|
270
|
-
[
|
|
271
|
-
[
|
|
268
|
+
[`${prefixCls}-prefix`]: true,
|
|
269
|
+
[`${prefixCls}-inset-label`]: insetLabel,
|
|
270
|
+
[`${prefixCls}-prefix-text`]: labelNode && _isString(labelNode),
|
|
271
|
+
[`${prefixCls}-prefix-icon`]: isSemiIcon(labelNode)
|
|
272
272
|
});
|
|
273
273
|
return (
|
|
274
274
|
/*#__PURE__*/
|
|
@@ -307,10 +307,10 @@ class Input extends BaseComponent {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
const suffixWrapperCls = cls({
|
|
310
|
-
[
|
|
311
|
-
[
|
|
312
|
-
[
|
|
313
|
-
[
|
|
310
|
+
[`${prefixCls}-suffix`]: true,
|
|
311
|
+
[`${prefixCls}-suffix-text`]: suffix && _isString(suffix),
|
|
312
|
+
[`${prefixCls}-suffix-icon`]: isSemiIcon(suffix),
|
|
313
|
+
[`${prefixCls}-suffix-hidden`]: suffixAllowClear && Boolean(hideSuffix)
|
|
314
314
|
});
|
|
315
315
|
return (
|
|
316
316
|
/*#__PURE__*/
|
|
@@ -387,31 +387,31 @@ class Input extends BaseComponent {
|
|
|
387
387
|
const suffixAllowClear = this.showClearBtn();
|
|
388
388
|
const suffixIsIcon = isSemiIcon(suffix);
|
|
389
389
|
const ref = this.getInputRef();
|
|
390
|
-
const wrapperPrefix =
|
|
390
|
+
const wrapperPrefix = `${prefixCls}-wrapper`;
|
|
391
391
|
const wrapperCls = cls(wrapperPrefix, className, {
|
|
392
|
-
[
|
|
393
|
-
[
|
|
394
|
-
[
|
|
395
|
-
[
|
|
396
|
-
[
|
|
397
|
-
[
|
|
398
|
-
[
|
|
399
|
-
[
|
|
400
|
-
[
|
|
401
|
-
[
|
|
402
|
-
[
|
|
403
|
-
[
|
|
404
|
-
[
|
|
405
|
-
[
|
|
406
|
-
[
|
|
407
|
-
[
|
|
408
|
-
[
|
|
392
|
+
[`${prefixCls}-wrapper__with-prefix`]: prefix || insetLabel,
|
|
393
|
+
[`${prefixCls}-wrapper__with-suffix`]: suffix,
|
|
394
|
+
[`${prefixCls}-wrapper__with-suffix-hidden`]: suffixAllowClear && Boolean(hideSuffix),
|
|
395
|
+
[`${prefixCls}-wrapper__with-suffix-icon`]: suffixIsIcon,
|
|
396
|
+
[`${prefixCls}-wrapper__with-append`]: addonBefore,
|
|
397
|
+
[`${prefixCls}-wrapper__with-prepend`]: addonAfter,
|
|
398
|
+
[`${prefixCls}-wrapper__with-append-only`]: addonBefore && !addonAfter,
|
|
399
|
+
[`${prefixCls}-wrapper__with-prepend-only`]: !addonBefore && addonAfter,
|
|
400
|
+
[`${wrapperPrefix}-readonly`]: readonly,
|
|
401
|
+
[`${wrapperPrefix}-disabled`]: disabled,
|
|
402
|
+
[`${wrapperPrefix}-warning`]: validateStatus === 'warning',
|
|
403
|
+
[`${wrapperPrefix}-error`]: validateStatus === 'error',
|
|
404
|
+
[`${wrapperPrefix}-focus`]: isFocus,
|
|
405
|
+
[`${wrapperPrefix}-clearable`]: showClear,
|
|
406
|
+
[`${wrapperPrefix}-modebtn`]: mode === 'password',
|
|
407
|
+
[`${wrapperPrefix}-hidden`]: type === 'hidden',
|
|
408
|
+
[`${wrapperPrefix}-${size}`]: size
|
|
409
409
|
});
|
|
410
410
|
const inputCls = cls(prefixCls, {
|
|
411
|
-
[
|
|
412
|
-
[
|
|
413
|
-
[
|
|
414
|
-
[
|
|
411
|
+
[`${prefixCls}-${size}`]: size,
|
|
412
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
413
|
+
[`${prefixCls}-sibling-clearbtn`]: this.foundation.isAllowClear(),
|
|
414
|
+
[`${prefixCls}-sibling-modebtn`]: mode === 'password'
|
|
415
415
|
});
|
|
416
416
|
const inputValue = value === null || value === undefined ? '' : value;
|
|
417
417
|
const inputProps = Object.assign(Object.assign({}, rest), {
|
|
@@ -36,12 +36,12 @@ export default class inputGroup extends BaseComponent {
|
|
|
36
36
|
rest = __rest(_a, ["size", "className", "label", "labelPosition"]);
|
|
37
37
|
|
|
38
38
|
const groupWrapperCls = cls({
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
39
|
+
[`${prefixCls}-group-wrapper`]: true,
|
|
40
|
+
[`${prefixCls}-group-wrapper-with-top-label`]: labelPosition === 'top',
|
|
41
|
+
[`${prefixCls}-group-wrapper-with-left-label`]: labelPosition === 'left'
|
|
42
42
|
});
|
|
43
|
-
const groupCls = cls(
|
|
44
|
-
[
|
|
43
|
+
const groupCls = cls(`${prefixCls}-group`, className, {
|
|
44
|
+
[`${prefixCls}-${size}`]: size !== 'default'
|
|
45
45
|
}); // const labelCls = cls(label.className, '');
|
|
46
46
|
|
|
47
47
|
const defaultName = 'input-group';
|
|
@@ -74,8 +74,8 @@ export default class inputGroup extends BaseComponent {
|
|
|
74
74
|
} = _a,
|
|
75
75
|
rest = __rest(_a, ["size", "style", "className", "children", "label", "onBlur", "onFocus", "disabled"]);
|
|
76
76
|
|
|
77
|
-
const groupCls = cls(
|
|
78
|
-
[
|
|
77
|
+
const groupCls = cls(`${prefixCls}-group`, {
|
|
78
|
+
[`${prefixCls}-${size}`]: size !== 'default'
|
|
79
79
|
}, className);
|
|
80
80
|
let inner;
|
|
81
81
|
|
package/lib/es/input/textarea.js
CHANGED
|
@@ -152,8 +152,8 @@ class TextArea extends BaseComponent {
|
|
|
152
152
|
showClear
|
|
153
153
|
} = this.props;
|
|
154
154
|
const displayClearBtn = this.foundation.isAllowClear();
|
|
155
|
-
const clearCls = cls(
|
|
156
|
-
[
|
|
155
|
+
const clearCls = cls(`${prefixCls}-clearbtn`, {
|
|
156
|
+
[`${prefixCls}-clearbtn-hidden`]: !displayClearBtn
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
if (showClear) {
|
|
@@ -185,8 +185,8 @@ class TextArea extends BaseComponent {
|
|
|
185
185
|
|
|
186
186
|
current = value ? _isFunction(getValueLength) ? getValueLength(value) : value.length : 0;
|
|
187
187
|
total = maxCount || null;
|
|
188
|
-
countCls = cls(
|
|
189
|
-
[
|
|
188
|
+
countCls = cls(`${prefixCls}-textarea-counter`, {
|
|
189
|
+
[`${prefixCls}-textarea-counter-exceed`]: current > total
|
|
190
190
|
});
|
|
191
191
|
counter = /*#__PURE__*/React.createElement("div", {
|
|
192
192
|
className: countCls
|
|
@@ -227,19 +227,19 @@ class TextArea extends BaseComponent {
|
|
|
227
227
|
value,
|
|
228
228
|
minLength: stateMinLength
|
|
229
229
|
} = this.state;
|
|
230
|
-
const wrapperCls = cls(className,
|
|
231
|
-
[
|
|
232
|
-
[
|
|
233
|
-
[
|
|
234
|
-
[
|
|
230
|
+
const wrapperCls = cls(className, `${prefixCls}-textarea-wrapper`, {
|
|
231
|
+
[`${prefixCls}-textarea-wrapper-disabled`]: disabled,
|
|
232
|
+
[`${prefixCls}-textarea-wrapper-readonly`]: readonly,
|
|
233
|
+
[`${prefixCls}-textarea-wrapper-${validateStatus}`]: Boolean(validateStatus),
|
|
234
|
+
[`${prefixCls}-textarea-wrapper-focus`]: isFocus // [`${prefixCls}-textarea-wrapper-resize`]: !autosize && resize,
|
|
235
235
|
|
|
236
236
|
}); // const ref = this.props.forwardRef || this.textAreaRef;
|
|
237
237
|
|
|
238
|
-
const itemCls = cls(
|
|
239
|
-
[
|
|
240
|
-
[
|
|
241
|
-
[
|
|
242
|
-
[
|
|
238
|
+
const itemCls = cls(`${prefixCls}-textarea`, {
|
|
239
|
+
[`${prefixCls}-textarea-disabled`]: disabled,
|
|
240
|
+
[`${prefixCls}-textarea-readonly`]: readonly,
|
|
241
|
+
[`${prefixCls}-textarea-autosize`]: autosize,
|
|
242
|
+
[`${prefixCls}-textarea-showClear`]: showClear
|
|
243
243
|
});
|
|
244
244
|
const itemProps = Object.assign(Object.assign({}, _omit(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear')), {
|
|
245
245
|
className: itemCls,
|
|
@@ -92,17 +92,17 @@ class InputNumber extends BaseComponent {
|
|
|
92
92
|
} = this.state;
|
|
93
93
|
const notAllowedUp = disabled ? disabled : number === max;
|
|
94
94
|
const notAllowedDown = disabled ? disabled : number === min;
|
|
95
|
-
const suffixChildrenCls = classnames(
|
|
96
|
-
[
|
|
97
|
-
[
|
|
95
|
+
const suffixChildrenCls = classnames(`${prefixCls}-number-suffix-btns`, {
|
|
96
|
+
[`${prefixCls}-number-suffix-btns-inner`]: innerButtons,
|
|
97
|
+
[`${prefixCls}-number-suffix-btns-inner-hover`]: innerButtons && hovering && !focusing
|
|
98
98
|
});
|
|
99
|
-
const upClassName = classnames(
|
|
100
|
-
[
|
|
101
|
-
[
|
|
99
|
+
const upClassName = classnames(`${prefixCls}-number-button`, `${prefixCls}-number-button-up`, {
|
|
100
|
+
[`${prefixCls}-number-button-up-disabled`]: disabled,
|
|
101
|
+
[`${prefixCls}-number-button-up-not-allowed`]: notAllowedUp
|
|
102
102
|
});
|
|
103
|
-
const downClassName = classnames(
|
|
104
|
-
[
|
|
105
|
-
[
|
|
103
|
+
const downClassName = classnames(`${prefixCls}-number-button`, `${prefixCls}-number-button-down`, {
|
|
104
|
+
[`${prefixCls}-number-button-down-disabled`]: disabled,
|
|
105
|
+
[`${prefixCls}-number-button-down-not-allowed`]: notAllowedDown
|
|
106
106
|
});
|
|
107
107
|
return /*#__PURE__*/React.createElement("div", {
|
|
108
108
|
className: suffixChildrenCls
|
|
@@ -428,8 +428,8 @@ class InputNumber extends BaseComponent {
|
|
|
428
428
|
value,
|
|
429
429
|
number
|
|
430
430
|
} = this.state;
|
|
431
|
-
const inputNumberCls = classnames(className,
|
|
432
|
-
[
|
|
431
|
+
const inputNumberCls = classnames(className, `${prefixCls}-number`, {
|
|
432
|
+
[`${prefixCls}-number-size-${size}`]: size
|
|
433
433
|
});
|
|
434
434
|
const buttons = this.renderButtons();
|
|
435
435
|
const ariaProps = {
|
package/lib/es/layout/Sider.d.ts
CHANGED
package/lib/es/layout/Sider.js
CHANGED
|
@@ -29,7 +29,7 @@ const generateId = (() => {
|
|
|
29
29
|
let i = 0;
|
|
30
30
|
return () => {
|
|
31
31
|
i += 1;
|
|
32
|
-
return
|
|
32
|
+
return `${cssClasses.PREFIX}-sider-${i}`;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
|
|
@@ -92,14 +92,14 @@ class Sider extends React.PureComponent {
|
|
|
92
92
|
others = __rest(_a, ["prefixCls", "className", "children", "style"]);
|
|
93
93
|
|
|
94
94
|
const classString = cls(className, {
|
|
95
|
-
[
|
|
95
|
+
[`${prefixCls}-sider`]: true
|
|
96
96
|
});
|
|
97
97
|
return /*#__PURE__*/React.createElement("aside", Object.assign({
|
|
98
98
|
className: classString,
|
|
99
99
|
"aria-label": this.props['aria-label'],
|
|
100
100
|
style: style
|
|
101
101
|
}, getDataAttr(others)), /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className:
|
|
102
|
+
className: `${prefixCls}-sider-children`
|
|
103
103
|
}, children));
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -118,4 +118,5 @@ Sider.defaultProps = {
|
|
|
118
118
|
prefixCls: cssClasses.PREFIX
|
|
119
119
|
};
|
|
120
120
|
Sider.contextType = LayoutContext;
|
|
121
|
+
Sider.elementType = "Layout.Sider";
|
|
121
122
|
export default Sider;
|
package/lib/es/layout/index.js
CHANGED
|
@@ -51,7 +51,7 @@ class Basic extends React.PureComponent {
|
|
|
51
51
|
} = _a,
|
|
52
52
|
others = __rest(_a, ["prefixCls", "type", "className", "children", "tagName"]);
|
|
53
53
|
|
|
54
|
-
const classString = cls(className,
|
|
54
|
+
const classString = cls(className, `${prefixCls}-${type}`);
|
|
55
55
|
return /*#__PURE__*/React.createElement(tagName, Object.assign({
|
|
56
56
|
className: classString
|
|
57
57
|
}, others), children);
|
|
@@ -109,7 +109,9 @@ class Layout extends React.Component {
|
|
|
109
109
|
siders
|
|
110
110
|
} = this.state;
|
|
111
111
|
const classString = cls(className, prefixCls, {
|
|
112
|
-
[
|
|
112
|
+
[`${prefixCls}-has-sider`]: typeof hasSider === 'boolean' && hasSider || siders.length > 0 || React.Children.toArray(children).some(child => {
|
|
113
|
+
return /*#__PURE__*/React.isValidElement(child) && child.type && child.type.elementType === "Layout.Sider";
|
|
114
|
+
})
|
|
113
115
|
});
|
|
114
116
|
const Tag = tagName;
|
|
115
117
|
return /*#__PURE__*/React.createElement(LayoutContext.Provider, {
|
package/lib/es/list/index.js
CHANGED
|
@@ -23,14 +23,14 @@ class List extends BaseComponent {
|
|
|
23
23
|
|
|
24
24
|
if (emptyContent) {
|
|
25
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className:
|
|
26
|
+
className: `${cssClasses.PREFIX}-empty`,
|
|
27
27
|
"x-semi-prop": "emptyContent"
|
|
28
28
|
}, emptyContent);
|
|
29
29
|
} else {
|
|
30
30
|
return /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
31
31
|
componentName: "List"
|
|
32
32
|
}, locale => /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
className:
|
|
33
|
+
className: `${cssClasses.PREFIX}-empty`
|
|
34
34
|
}, locale.emptyText));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
@@ -54,7 +54,7 @@ class List extends BaseComponent {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return /*#__PURE__*/React.createElement("ul", {
|
|
57
|
-
className:
|
|
57
|
+
className: `${prefixCls}-items`
|
|
58
58
|
}, childrenList ? childrenList : null, children);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -78,11 +78,11 @@ class List extends BaseComponent {
|
|
|
78
78
|
children
|
|
79
79
|
} = this.props;
|
|
80
80
|
const wrapperCls = cls(prefixCls, className, {
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
81
|
+
[`${prefixCls}-flex`]: layout === 'horizontal',
|
|
82
|
+
[`${prefixCls}-${size}`]: size,
|
|
83
|
+
[`${prefixCls}-grid`]: grid,
|
|
84
|
+
[`${prefixCls}-split`]: split,
|
|
85
|
+
[`${prefixCls}-bordered`]: bordered
|
|
86
86
|
});
|
|
87
87
|
let childrenList;
|
|
88
88
|
|
|
@@ -90,7 +90,7 @@ class List extends BaseComponent {
|
|
|
90
90
|
childrenList = [];
|
|
91
91
|
const items = renderItem ? dataSource.map((item, index) => renderItem(item, index)) : [];
|
|
92
92
|
React.Children.forEach(items, (child, index) => {
|
|
93
|
-
const itemKey = child.key ||
|
|
93
|
+
const itemKey = child.key || `list-item-${index}`;
|
|
94
94
|
childrenList.push( /*#__PURE__*/React.cloneElement(child, {
|
|
95
95
|
key: itemKey
|
|
96
96
|
}));
|
|
@@ -103,7 +103,7 @@ class List extends BaseComponent {
|
|
|
103
103
|
className: wrapperCls,
|
|
104
104
|
style: style
|
|
105
105
|
}, header ? /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className:
|
|
106
|
+
className: `${cssClasses.PREFIX}-header`,
|
|
107
107
|
"x-semi-prop": "header"
|
|
108
108
|
}, header) : null, /*#__PURE__*/React.createElement(ListContext.Provider, {
|
|
109
109
|
value: {
|
|
@@ -115,7 +115,7 @@ class List extends BaseComponent {
|
|
|
115
115
|
spinning: loading,
|
|
116
116
|
size: "large"
|
|
117
117
|
}, this.wrapChildren(childrenList, children))), footer ? /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className:
|
|
118
|
+
className: `${cssClasses.PREFIX}-footer`,
|
|
119
119
|
"x-semi-prop": "footer"
|
|
120
120
|
}, footer) : null, loadMore ? loadMore : null);
|
|
121
121
|
}
|
package/lib/es/list/item.js
CHANGED
|
@@ -56,9 +56,9 @@ export default class ListItem extends PureComponent {
|
|
|
56
56
|
} = this.context;
|
|
57
57
|
const handleContextMenu = onRightClick ? onRightClick : contextOnRightClick;
|
|
58
58
|
const handleClick = onClick ? onClick : contextOnClick;
|
|
59
|
-
const itemCls = cls(
|
|
60
|
-
const bodyCls = cls(
|
|
61
|
-
[
|
|
59
|
+
const itemCls = cls(`${prefixCls}-item`, className);
|
|
60
|
+
const bodyCls = cls(`${prefixCls}-item-body`, {
|
|
61
|
+
[`${prefixCls}-item-body-${align}`]: align
|
|
62
62
|
});
|
|
63
63
|
let body;
|
|
64
64
|
|
|
@@ -66,9 +66,9 @@ export default class ListItem extends PureComponent {
|
|
|
66
66
|
body = /*#__PURE__*/React.createElement("div", {
|
|
67
67
|
className: bodyCls
|
|
68
68
|
}, header ? /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
className:
|
|
69
|
+
className: `${prefixCls}-item-body-header`
|
|
70
70
|
}, header) : null, main ? /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className:
|
|
71
|
+
className: `${prefixCls}-item-body-main`
|
|
72
72
|
}, main) : null);
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -83,7 +83,7 @@ export default class ListItem extends PureComponent {
|
|
|
83
83
|
onMouseEnter: onMouseEnter,
|
|
84
84
|
onMouseLeave: onMouseLeave
|
|
85
85
|
}, body ? body : null, children, extra ? /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className:
|
|
86
|
+
className: `${prefixCls}-item-extra`
|
|
87
87
|
}, extra) : null);
|
|
88
88
|
|
|
89
89
|
if (this.context && contextGrid) {
|
|
@@ -69,20 +69,20 @@ const ConfirmModal = props => {
|
|
|
69
69
|
setVisible(false);
|
|
70
70
|
}
|
|
71
71
|
}, [onCancel]);
|
|
72
|
-
const confirmCls =
|
|
72
|
+
const confirmCls = `${cssClasses.DIALOG}-confirm`;
|
|
73
73
|
const wrapperCls = cls(className, confirmCls, {
|
|
74
|
-
[
|
|
74
|
+
[`${confirmCls}-rtl`]: direction === 'rtl'
|
|
75
75
|
});
|
|
76
|
-
const typeCls = cls(
|
|
76
|
+
const typeCls = cls(`${cssClasses.DIALOG}-${type}`);
|
|
77
77
|
const iconNode = isSemiIcon(icon) ? /*#__PURE__*/React.cloneElement(icon, {
|
|
78
|
-
className:
|
|
78
|
+
className: `${confirmCls}-icon ${typeCls}-icon`,
|
|
79
79
|
size: 'extra-large'
|
|
80
80
|
}) : icon;
|
|
81
81
|
const titleNode = title == null ? null : /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
className:
|
|
82
|
+
className: `${confirmCls}-title-text`
|
|
83
83
|
}, title);
|
|
84
|
-
const contentCls = cls(
|
|
85
|
-
[
|
|
84
|
+
const contentCls = cls(`${confirmCls}-content`, {
|
|
85
|
+
[`${confirmCls}-content-withIcon`]: props.icon
|
|
86
86
|
});
|
|
87
87
|
return /*#__PURE__*/React.createElement(Modal, Object.assign({
|
|
88
88
|
className: wrapperCls,
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -74,8 +74,6 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
74
74
|
centered: boolean;
|
|
75
75
|
closable: boolean;
|
|
76
76
|
visible: boolean;
|
|
77
|
-
confirmLoading: boolean;
|
|
78
|
-
cancelLoading: boolean;
|
|
79
77
|
okType: string;
|
|
80
78
|
maskClosable: boolean;
|
|
81
79
|
hasCancel: boolean;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -65,7 +65,7 @@ class Modal extends BaseComponent {
|
|
|
65
65
|
return /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
66
66
|
"aria-label": "cancel",
|
|
67
67
|
onClick: this.handleCancel,
|
|
68
|
-
loading: cancelLoading,
|
|
68
|
+
loading: cancelLoading === undefined ? this.state.onCancelReturnPromiseStatus === "pending" : cancelLoading,
|
|
69
69
|
type: "tertiary",
|
|
70
70
|
autoFocus: true
|
|
71
71
|
}, this.props.cancelButtonProps, {
|
|
@@ -80,7 +80,7 @@ class Modal extends BaseComponent {
|
|
|
80
80
|
"aria-label": "confirm",
|
|
81
81
|
type: okType,
|
|
82
82
|
theme: "solid",
|
|
83
|
-
loading: confirmLoading,
|
|
83
|
+
loading: confirmLoading === undefined ? this.state.onOKReturnPromiseStatus === "pending" : confirmLoading,
|
|
84
84
|
onClick: this.handleOk
|
|
85
85
|
}, this.props.okButtonProps, {
|
|
86
86
|
"x-semi-children-alias": "okText"
|
|
@@ -125,7 +125,7 @@ class Modal extends BaseComponent {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const classList = cls(className, {
|
|
128
|
-
[
|
|
128
|
+
[`${cssClasses.DIALOG}-displayNone`]: keepDOM && this.state.displayNone
|
|
129
129
|
});
|
|
130
130
|
const shouldRender = this.props.visible || this.props.keepDOM && (!this.props.lazyRender || this._haveRendered) || this.props.motion && !this.state.displayNone
|
|
131
131
|
/* When there is animation, we use displayNone to judge whether animation is ended and judge whether to unmount content */
|
|
@@ -141,7 +141,7 @@ class Modal extends BaseComponent {
|
|
|
141
141
|
}, /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
142
142
|
motion: this.props.motion,
|
|
143
143
|
animationState: visible ? 'enter' : 'leave',
|
|
144
|
-
startClassName: visible ?
|
|
144
|
+
startClassName: visible ? `${cssClasses.DIALOG}-content-animate-show` : `${cssClasses.DIALOG}-content-animate-hide`,
|
|
145
145
|
onAnimationEnd: () => {
|
|
146
146
|
this.updateState();
|
|
147
147
|
}
|
|
@@ -153,7 +153,7 @@ class Modal extends BaseComponent {
|
|
|
153
153
|
return /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
154
154
|
motion: this.props.motion,
|
|
155
155
|
animationState: visible ? 'enter' : 'leave',
|
|
156
|
-
startClassName: visible ?
|
|
156
|
+
startClassName: visible ? `${cssClasses.DIALOG}-mask-animate-show` : `${cssClasses.DIALOG}-mask-animate-hide`,
|
|
157
157
|
onAnimationEnd: () => {
|
|
158
158
|
this.updateState();
|
|
159
159
|
}
|
|
@@ -202,7 +202,7 @@ class Modal extends BaseComponent {
|
|
|
202
202
|
|
|
203
203
|
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
204
204
|
document.body.style.overflow = 'hidden';
|
|
205
|
-
document.body.style.width =
|
|
205
|
+
document.body.style.width = `calc(${this.originBodyWidth || '100%'} - ${this.scrollBarWidth}px)`;
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
enabledBodyScroll: () => {
|
|
@@ -216,10 +216,10 @@ class Modal extends BaseComponent {
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
notifyCancel: e => {
|
|
219
|
-
this.props.onCancel(e);
|
|
219
|
+
return this.props.onCancel(e);
|
|
220
220
|
},
|
|
221
221
|
notifyOk: e => {
|
|
222
|
-
this.props.onOk(e);
|
|
222
|
+
return this.props.onOk(e);
|
|
223
223
|
},
|
|
224
224
|
notifyClose: () => {
|
|
225
225
|
this.props.afterClose();
|
|
@@ -352,8 +352,6 @@ Modal.defaultProps = {
|
|
|
352
352
|
centered: false,
|
|
353
353
|
closable: true,
|
|
354
354
|
visible: false,
|
|
355
|
-
confirmLoading: false,
|
|
356
|
-
cancelLoading: false,
|
|
357
355
|
okType: 'primary',
|
|
358
356
|
maskClosable: true,
|
|
359
357
|
hasCancel: true,
|