@douyinfe/semi-ui 2.28.0-alpha.0 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/semi.css +227 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2393 -2068
- 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.js +1 -1
- package/lib/cjs/dropdown/dropdownTitle.js +2 -2
- 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 +2 -0
- package/lib/cjs/form/baseForm.js +2 -2
- package/lib/cjs/form/errorMessage.js +1 -1
- package/lib/cjs/form/field.d.ts +2 -0
- 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.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.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 -1
- package/lib/cjs/layout/Sider.js +4 -4
- package/lib/cjs/layout/index.js +3 -3
- 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.js +4 -4
- 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.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.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.d.ts +6 -2
- package/lib/cjs/tagInput/index.js +37 -34
- 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.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.js +1 -1
- package/lib/es/dropdown/dropdownTitle.js +2 -2
- 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 +2 -0
- package/lib/es/form/baseForm.js +2 -2
- package/lib/es/form/errorMessage.js +1 -1
- package/lib/es/form/field.d.ts +2 -0
- 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.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.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 -1
- package/lib/es/layout/Sider.js +4 -4
- package/lib/es/layout/index.js +3 -3
- 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.js +4 -4
- 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.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.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.d.ts +6 -2
- package/lib/es/tagInput/index.js +37 -34
- 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.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
|
@@ -146,14 +146,14 @@ class SubNav extends _baseComponent.default {
|
|
|
146
146
|
iconSize = 'default';
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
const className = (0, _classnames.default)(
|
|
150
|
-
[
|
|
151
|
-
[
|
|
149
|
+
const className = (0, _classnames.default)(`${prefixCls}-item-icon`, {
|
|
150
|
+
[`${prefixCls}-item-icon-toggle-${this.context.toggleIconPosition}`]: isToggleIcon,
|
|
151
|
+
[`${prefixCls}-item-icon-info`]: !isToggleIcon
|
|
152
152
|
});
|
|
153
153
|
const isOpen = this.adapter.getIsOpen();
|
|
154
154
|
const iconElem = /*#__PURE__*/_react.default.isValidElement(icon) ? withTransition ? /*#__PURE__*/_react.default.createElement(_cssAnimation.default, {
|
|
155
155
|
animationState: isOpen ? "enter" : "leave",
|
|
156
|
-
startClassName:
|
|
156
|
+
startClassName: `${_constants.cssClasses.PREFIX}-icon-rotate-${isOpen ? "180" : "0"}`
|
|
157
157
|
}, _ref => {
|
|
158
158
|
let {
|
|
159
159
|
animationClassName
|
|
@@ -191,9 +191,9 @@ class SubNav extends _baseComponent.default {
|
|
|
191
191
|
limitIndent
|
|
192
192
|
} = this.context;
|
|
193
193
|
const isOpen = this.adapter.getIsOpen();
|
|
194
|
-
const titleCls = (0, _classnames.default)(
|
|
195
|
-
[
|
|
196
|
-
[
|
|
194
|
+
const titleCls = (0, _classnames.default)(`${prefixCls}-sub-title`, {
|
|
195
|
+
[`${prefixCls}-sub-title-selected`]: this.adapter.getIsSelected(itemKey),
|
|
196
|
+
[`${prefixCls}-sub-title-disabled`]: disabled
|
|
197
197
|
});
|
|
198
198
|
let withTransition = false;
|
|
199
199
|
let toggleIconType = '';
|
|
@@ -245,9 +245,9 @@ class SubNav extends _baseComponent.default {
|
|
|
245
245
|
onKeyPress: this.handleKeyPress,
|
|
246
246
|
"aria-expanded": isOpen ? 'true' : 'false'
|
|
247
247
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
248
|
-
className:
|
|
248
|
+
className: `${prefixCls}-item-inner`
|
|
249
249
|
}, placeholderIcons, this.context.toggleIconPosition === _constants.strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, _constants.strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== _constants.strings.MODE_HORIZONTAL ? this.renderIcon(icon, _constants.strings.ICON_POS_LEFT, false, false, 'key-inSubNav-position-left') : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
250
|
-
className:
|
|
250
|
+
className: `${prefixCls}-item-text`
|
|
251
251
|
}, text), this.context.toggleIconPosition === _constants.strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIconType, _constants.strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-right')));
|
|
252
252
|
|
|
253
253
|
return titleDiv;
|
|
@@ -266,9 +266,9 @@ class SubNav extends _baseComponent.default {
|
|
|
266
266
|
} = this.context;
|
|
267
267
|
const isOpen = this.adapter.getIsOpen();
|
|
268
268
|
const isHorizontal = mode === _constants.strings.MODE_HORIZONTAL;
|
|
269
|
-
const subNavCls = (0, _classnames.default)(
|
|
270
|
-
[
|
|
271
|
-
[
|
|
269
|
+
const subNavCls = (0, _classnames.default)(`${prefixCls}-sub`, {
|
|
270
|
+
[`${prefixCls}-sub-open`]: isOpen,
|
|
271
|
+
[`${prefixCls}-sub-popover`]: isCollapsed || isHorizontal
|
|
272
272
|
});
|
|
273
273
|
|
|
274
274
|
const ulWithMotion = /*#__PURE__*/_react.default.createElement(_collapsible.default, {
|
|
@@ -306,7 +306,7 @@ class SubNav extends _baseComponent.default {
|
|
|
306
306
|
const isOpen = this.adapter.getIsOpen();
|
|
307
307
|
const openKeysIsControlled = this.adapter.getOpenKeysIsControlled();
|
|
308
308
|
const subNavCls = (0, _classnames.default)({
|
|
309
|
-
[
|
|
309
|
+
[`${prefixCls}-popover`]: isCollapsed
|
|
310
310
|
});
|
|
311
311
|
const dropdownProps = {
|
|
312
312
|
trigger: 'hover',
|
|
@@ -364,7 +364,7 @@ class SubNav extends _baseComponent.default {
|
|
|
364
364
|
itemKey: itemKey,
|
|
365
365
|
forwardRef: this.setItemRef,
|
|
366
366
|
isCollapsed: isCollapsed,
|
|
367
|
-
className:
|
|
367
|
+
className: `${prefixCls}-sub-wrap`,
|
|
368
368
|
onMouseEnter: onMouseEnter,
|
|
369
369
|
onMouseLeave: onMouseLeave,
|
|
370
370
|
disabled: disabled,
|
|
@@ -301,12 +301,12 @@ class Nav extends _baseComponent.default {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
const finalCls = (0, _classnames.default)(prefixCls, className, {
|
|
304
|
-
[
|
|
305
|
-
[
|
|
306
|
-
[
|
|
304
|
+
[`${prefixCls}-collapsed`]: isCollapsed,
|
|
305
|
+
[`${prefixCls}-horizontal`]: mode === 'horizontal',
|
|
306
|
+
[`${prefixCls}-vertical`]: mode === 'vertical'
|
|
307
307
|
});
|
|
308
|
-
const headerListOuterCls = (0, _classnames.default)(
|
|
309
|
-
[
|
|
308
|
+
const headerListOuterCls = (0, _classnames.default)(`${prefixCls}-header-list-outer`, {
|
|
309
|
+
[`${prefixCls}-header-list-outer-collapsed`]: isCollapsed
|
|
310
310
|
});
|
|
311
311
|
|
|
312
312
|
if (this.itemsChanged) {
|
|
@@ -351,16 +351,16 @@ class Nav extends _baseComponent.default {
|
|
|
351
351
|
className: finalCls,
|
|
352
352
|
style: finalStyle
|
|
353
353
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
354
|
-
className:
|
|
354
|
+
className: `${prefixCls}-inner`
|
|
355
355
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
356
356
|
className: headerListOuterCls
|
|
357
357
|
}, headers, /*#__PURE__*/_react.default.createElement("div", {
|
|
358
358
|
style: bodyStyle,
|
|
359
|
-
className:
|
|
359
|
+
className: `${prefixCls}-list-wrapper`
|
|
360
360
|
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
361
361
|
role: "menu",
|
|
362
362
|
"aria-orientation": mode,
|
|
363
|
-
className:
|
|
363
|
+
className: `${prefixCls}-list`
|
|
364
364
|
}, this.adapter.getCache('itemElems'), children))), footers))));
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -78,7 +78,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
78
78
|
return /*#__PURE__*/_react.default.createElement(_cssAnimation.default, {
|
|
79
79
|
key: notice.id,
|
|
80
80
|
animationState: isRemoved ? "leave" : "enter",
|
|
81
|
-
startClassName:
|
|
81
|
+
startClassName: `${_constants.cssClasses.NOTICE}-animation-${isRemoved ? "hide" : "show"}_${position}`
|
|
82
82
|
}, _ref => {
|
|
83
83
|
let {
|
|
84
84
|
animationClassName,
|
|
@@ -214,7 +214,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
214
214
|
static destroyAll() {
|
|
215
215
|
if (ref) {
|
|
216
216
|
ref.destroyAll();
|
|
217
|
-
const wrapper = document.querySelector(
|
|
217
|
+
const wrapper = document.querySelector(`#${this.wrapperId}`);
|
|
218
218
|
|
|
219
219
|
_reactDom.default.unmountComponentAtNode(wrapper);
|
|
220
220
|
|
|
@@ -249,7 +249,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
249
249
|
['top', 'left', 'bottom', 'right'].forEach(pos => {
|
|
250
250
|
if (pos in noticeInstance) {
|
|
251
251
|
const val = noticeInstance[pos];
|
|
252
|
-
style[pos] = typeof val === 'number' ?
|
|
252
|
+
style[pos] = typeof val === 'number' ? `${val}px` : val;
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
return style;
|
|
@@ -118,8 +118,8 @@ class Notice extends _baseComponent.default {
|
|
|
118
118
|
};
|
|
119
119
|
let iconType = iconMap[type];
|
|
120
120
|
const iconCls = (0, _classnames.default)({
|
|
121
|
-
[
|
|
122
|
-
[
|
|
121
|
+
[`${prefixCls}-icon`]: true,
|
|
122
|
+
[`${prefixCls}-${type}`]: true
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
if (icon) {
|
|
@@ -161,11 +161,11 @@ class Notice extends _baseComponent.default {
|
|
|
161
161
|
visible
|
|
162
162
|
} = this.state;
|
|
163
163
|
const wrapper = (0, _classnames.default)(prefixCls, className, {
|
|
164
|
-
[
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
164
|
+
[`${prefixCls}-close`]: !visible,
|
|
165
|
+
[`${prefixCls}-icon-show`]: types.includes(type),
|
|
166
|
+
[`${prefixCls}-${type}`]: true,
|
|
167
|
+
[`${prefixCls}-${theme}`]: theme === 'light',
|
|
168
|
+
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
169
169
|
});
|
|
170
170
|
const titleID = (0, _uuid.getUuidShort)({});
|
|
171
171
|
return (
|
|
@@ -182,18 +182,18 @@ class Notice extends _baseComponent.default {
|
|
|
182
182
|
onAnimationEnd: this.props.onAnimationEnd,
|
|
183
183
|
onAnimationStart: this.props.onAnimationStart
|
|
184
184
|
}, /*#__PURE__*/_react.default.createElement("div", null, this.renderTypeIcon()), /*#__PURE__*/_react.default.createElement("div", {
|
|
185
|
-
className:
|
|
185
|
+
className: `${prefixCls}-inner`
|
|
186
186
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
187
|
-
className:
|
|
187
|
+
className: `${prefixCls}-content-wrapper`
|
|
188
188
|
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
189
189
|
id: titleID,
|
|
190
|
-
className:
|
|
190
|
+
className: `${prefixCls}-title`,
|
|
191
191
|
"x-semi-prop": "title"
|
|
192
192
|
}, title) : '', content ? /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
-
className:
|
|
193
|
+
className: `${prefixCls}-content`,
|
|
194
194
|
"x-semi-prop": "content"
|
|
195
195
|
}, content) : ''), showClose && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
196
|
-
className:
|
|
196
|
+
className: `${prefixCls}-icon-close`,
|
|
197
197
|
type: "tertiary",
|
|
198
198
|
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
|
199
199
|
theme: "borderless",
|
|
@@ -83,7 +83,7 @@ declare class OverflowList extends BaseComponent<OverflowListProps, OverflowList
|
|
|
83
83
|
reintersect: (entries: Array<IntersectionObserverEntry>) => void;
|
|
84
84
|
mergeRef: (ref: RefCallback<any> | MutableRefObject<any> | null, node: Element, key: Key) => void;
|
|
85
85
|
renderOverflow: () => ReactNode | ReactNode[];
|
|
86
|
-
getItemKey: (item: any,
|
|
86
|
+
getItemKey: (item: any, defaultKey?: Key) => any;
|
|
87
87
|
renderItemList: () => React.DetailedReactHTMLElement<{
|
|
88
88
|
className: string;
|
|
89
89
|
style: {
|
|
@@ -29,6 +29,8 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
29
29
|
|
|
30
30
|
require("@douyinfe/semi-foundation/lib/cjs/overflowList/overflowList.css");
|
|
31
31
|
|
|
32
|
+
var _utils = require("../_utils");
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
/* eslint-disable arrow-body-style */
|
|
@@ -85,7 +87,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
85
87
|
return this.props.overflowRenderer(overflow);
|
|
86
88
|
};
|
|
87
89
|
|
|
88
|
-
this.getItemKey = (item,
|
|
90
|
+
this.getItemKey = (item, defaultKey) => {
|
|
89
91
|
const {
|
|
90
92
|
itemKey
|
|
91
93
|
} = this.props;
|
|
@@ -94,7 +96,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
94
96
|
return itemKey(item);
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
return (0, _get2.default)(item, itemKey || 'key',
|
|
99
|
+
return (0, _get2.default)(item, itemKey || 'key', defaultKey);
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
this.renderItemList = () => {
|
|
@@ -130,18 +132,18 @@ class OverflowList extends _baseComponent.default {
|
|
|
130
132
|
});
|
|
131
133
|
}
|
|
132
134
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
-
className:
|
|
135
|
+
className: `${prefixCls}-overflow`
|
|
134
136
|
}, child));
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
const inner = renderMode === RenderMode.SCROLL ? [overflow[0], /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
-
className: (0, _classnames.default)(wrapperClassName,
|
|
141
|
+
className: (0, _classnames.default)(wrapperClassName, `${prefixCls}-scroll-wrapper`),
|
|
140
142
|
ref: ref => {
|
|
141
143
|
this.scroller = ref;
|
|
142
144
|
},
|
|
143
145
|
style: Object.assign({}, wrapperStyle),
|
|
144
|
-
key:
|
|
146
|
+
key: `${prefixCls}-scroll-wrapper`
|
|
145
147
|
}, visible.map(visibleItemRenderer).map(item => {
|
|
146
148
|
const {
|
|
147
149
|
forwardRef,
|
|
@@ -149,7 +151,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
149
151
|
} = item;
|
|
150
152
|
return /*#__PURE__*/_react.default.cloneElement(item, {
|
|
151
153
|
ref: node => this.mergeRef(forwardRef, node, key),
|
|
152
|
-
'data-scrollkey':
|
|
154
|
+
'data-scrollkey': `${key}`,
|
|
153
155
|
key
|
|
154
156
|
});
|
|
155
157
|
})), overflow[1]] : [collapseFrom === Boundary.START ? overflow : null, visible.map((item, idx) => {
|
|
@@ -168,12 +170,12 @@ class OverflowList extends _baseComponent.default {
|
|
|
168
170
|
}
|
|
169
171
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
172
|
key: key,
|
|
171
|
-
className:
|
|
173
|
+
className: `${prefixCls}-item`
|
|
172
174
|
}, child));
|
|
173
175
|
}), collapseFrom === Boundary.END ? overflow : null];
|
|
174
176
|
|
|
175
177
|
const list = /*#__PURE__*/_react.default.createElement('div', {
|
|
176
|
-
className: (0, _classnames.default)(
|
|
178
|
+
className: (0, _classnames.default)(`${prefixCls}`, className),
|
|
177
179
|
style: Object.assign(Object.assign({}, style), renderMode === RenderMode.COLLAPSE ? {
|
|
178
180
|
maxWidth: '100%',
|
|
179
181
|
visibility: overflowStatus === "calculating" ? "hidden" : "visible"
|
|
@@ -199,10 +201,10 @@ class OverflowList extends _baseComponent.default {
|
|
|
199
201
|
|
|
200
202
|
const {
|
|
201
203
|
maxCount
|
|
202
|
-
} = this.state; // 已经按照最大值maxCount
|
|
203
|
-
// Already rendered maxCount items, trigger the real rendering
|
|
204
|
+
} = this.state; // 已经按照最大值maxCount渲染完毕,触发真正的渲染
|
|
205
|
+
// Already rendered maxCount items, trigger the real rendering
|
|
204
206
|
|
|
205
|
-
if (this.itemSizeMap.size === maxCount
|
|
207
|
+
if (this.itemSizeMap.size === maxCount) {
|
|
206
208
|
this.setState({
|
|
207
209
|
overflowStatus: 'calculating'
|
|
208
210
|
});
|
|
@@ -218,7 +220,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
218
220
|
visibleState: new Map(),
|
|
219
221
|
itemSizeMap: new Map(),
|
|
220
222
|
overflowStatus: "calculating",
|
|
221
|
-
pivot:
|
|
223
|
+
pivot: -1,
|
|
222
224
|
overflowWidth: 0,
|
|
223
225
|
maxCount: 0
|
|
224
226
|
};
|
|
@@ -243,17 +245,27 @@ class OverflowList extends _baseComponent.default {
|
|
|
243
245
|
// reset visible state if the above props change.
|
|
244
246
|
newState.direction = OverflowDirection.GROW;
|
|
245
247
|
newState.lastOverflowCount = 0;
|
|
248
|
+
newState.maxCount = 0;
|
|
246
249
|
|
|
247
250
|
if (props.renderMode === RenderMode.SCROLL) {
|
|
248
251
|
newState.visible = props.items;
|
|
249
252
|
newState.overflow = [];
|
|
250
253
|
} else {
|
|
251
|
-
|
|
252
|
-
|
|
254
|
+
let maxCount = props.items.length;
|
|
255
|
+
|
|
256
|
+
if (Math.floor(prevState.containerWidth / _constants.numbers.MINIMUM_HTML_ELEMENT_WIDTH) !== 0) {
|
|
257
|
+
maxCount = Math.min(maxCount, Math.floor(prevState.containerWidth / _constants.numbers.MINIMUM_HTML_ELEMENT_WIDTH));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const isCollapseFromStart = props.collapseFrom === Boundary.START;
|
|
261
|
+
const visible = isCollapseFromStart ? (0, _utils.cloneDeep)(props.items).reverse().slice(0, maxCount) : props.items.slice(0, maxCount);
|
|
262
|
+
const overflow = isCollapseFromStart ? (0, _utils.cloneDeep)(props.items).reverse().slice(maxCount) : props.items.slice(maxCount);
|
|
263
|
+
newState.visible = visible;
|
|
264
|
+
newState.overflow = overflow;
|
|
265
|
+
newState.maxCount = maxCount;
|
|
253
266
|
}
|
|
254
267
|
|
|
255
|
-
newState.pivot =
|
|
256
|
-
newState.maxCount = 0;
|
|
268
|
+
newState.pivot = -1;
|
|
257
269
|
newState.overflowStatus = "calculating";
|
|
258
270
|
}
|
|
259
271
|
|
|
@@ -280,6 +292,9 @@ class OverflowList extends _baseComponent.default {
|
|
|
280
292
|
componentDidUpdate(prevProps, prevState) {
|
|
281
293
|
if (!(0, _isEqual2.default)(prevProps.items, this.props.items)) {
|
|
282
294
|
this.itemRefs = {};
|
|
295
|
+
this.setState({
|
|
296
|
+
visibleState: new Map()
|
|
297
|
+
});
|
|
283
298
|
}
|
|
284
299
|
|
|
285
300
|
const {
|
|
@@ -293,25 +308,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
293
308
|
return;
|
|
294
309
|
}
|
|
295
310
|
|
|
296
|
-
|
|
297
|
-
// 推测container最多能渲染的数量
|
|
298
|
-
// Figure out the maximum number of items in this container
|
|
299
|
-
const maxCount = Math.min(this.props.items.length, Math.floor(containerWidth / _constants.numbers.MINIMUM_HTML_ELEMENT_WIDTH)); // 如果collapseFrom是start, 第一次用来计算容量时,倒转列表顺序渲染
|
|
300
|
-
// If collapseFrom === start, render item from end to start. Figuring out how many items in the end could fit in container.
|
|
301
|
-
|
|
302
|
-
const isCollapseFromStart = this.props.collapseFrom === Boundary.START;
|
|
303
|
-
const visible = isCollapseFromStart ? this.foundation.getReversedItems().slice(0, maxCount) : this.props.items.slice(0, maxCount);
|
|
304
|
-
const overflow = isCollapseFromStart ? this.foundation.getReversedItems().slice(maxCount) : this.props.items.slice(maxCount);
|
|
305
|
-
this.setState({
|
|
306
|
-
overflowStatus: 'calculating',
|
|
307
|
-
visible,
|
|
308
|
-
overflow,
|
|
309
|
-
maxCount: maxCount
|
|
310
|
-
});
|
|
311
|
-
this.itemSizeMap.clear();
|
|
312
|
-
} else {
|
|
313
|
-
this.foundation.handleCollapseOverflow();
|
|
314
|
-
}
|
|
311
|
+
this.foundation.handleCollapseOverflow();
|
|
315
312
|
}
|
|
316
313
|
|
|
317
314
|
render() {
|
|
@@ -13,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
+
var _reactUtils = require("../_base/reactUtils");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
class ReactIntersectionObserver extends _react.default.PureComponent {
|
|
@@ -75,7 +77,7 @@ class ReactIntersectionObserver extends _react.default.PureComponent {
|
|
|
75
77
|
Object.keys(items).forEach(key => {
|
|
76
78
|
const node = items[key];
|
|
77
79
|
|
|
78
|
-
if (!node) {
|
|
80
|
+
if (!(node && (0, _reactUtils.isHTMLElement)(node))) {
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -164,9 +164,9 @@ class Pagination extends _baseComponent.default {
|
|
|
164
164
|
prevDisabled
|
|
165
165
|
} = this.state;
|
|
166
166
|
const preClassName = (0, _classnames.default)({
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
167
|
+
[`${prefixCls}-item`]: true,
|
|
168
|
+
[`${prefixCls}-prev`]: true,
|
|
169
|
+
[`${prefixCls}-item-disabled`]: prevDisabled
|
|
170
170
|
});
|
|
171
171
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
172
172
|
role: "button",
|
|
@@ -188,9 +188,9 @@ class Pagination extends _baseComponent.default {
|
|
|
188
188
|
nextDisabled
|
|
189
189
|
} = this.state;
|
|
190
190
|
const nextClassName = (0, _classnames.default)({
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
191
|
+
[`${prefixCls}-item`]: true,
|
|
192
|
+
[`${prefixCls}-item-disabled`]: nextDisabled,
|
|
193
|
+
[`${prefixCls}-next`]: true
|
|
194
194
|
});
|
|
195
195
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
196
196
|
role: "button",
|
|
@@ -217,7 +217,7 @@ class Pagination extends _baseComponent.default {
|
|
|
217
217
|
const {
|
|
218
218
|
pageSize
|
|
219
219
|
} = this.state;
|
|
220
|
-
const switchCls = (0, _classnames.default)(
|
|
220
|
+
const switchCls = (0, _classnames.default)(`${prefixCls}-switch`);
|
|
221
221
|
|
|
222
222
|
if (!showSizeChanger) {
|
|
223
223
|
return null;
|
|
@@ -228,7 +228,7 @@ class Pagination extends _baseComponent.default {
|
|
|
228
228
|
const options = newPageSizeOpts.map(size => /*#__PURE__*/_react.default.createElement(Option, {
|
|
229
229
|
value: size,
|
|
230
230
|
key: size
|
|
231
|
-
}, /*#__PURE__*/_react.default.createElement("span", null,
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, `${size} `, pageSizeText)));
|
|
232
232
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
233
233
|
className: switchCls
|
|
234
234
|
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -238,7 +238,7 @@ class Pagination extends _baseComponent.default {
|
|
|
238
238
|
key: pageSizeText,
|
|
239
239
|
position: popoverPosition || 'bottomRight',
|
|
240
240
|
clickToHide: true,
|
|
241
|
-
dropdownClassName:
|
|
241
|
+
dropdownClassName: `${prefixCls}-select-dropdown`
|
|
242
242
|
}, options));
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -260,14 +260,14 @@ class Pagination extends _baseComponent.default {
|
|
|
260
260
|
|
|
261
261
|
const isDisabled = totalPageNum === 1;
|
|
262
262
|
const quickJumpCls = (0, _classnames.default)({
|
|
263
|
-
[
|
|
264
|
-
[
|
|
263
|
+
[`${prefixCls}-quickjump`]: true,
|
|
264
|
+
[`${prefixCls}-quickjump-disabled`]: isDisabled
|
|
265
265
|
});
|
|
266
266
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
267
267
|
className: quickJumpCls
|
|
268
268
|
}, /*#__PURE__*/_react.default.createElement("span", null, locale.jumpTo), /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
269
269
|
value: quickJumpPage,
|
|
270
|
-
className:
|
|
270
|
+
className: `${prefixCls}-quickjump-input-number`,
|
|
271
271
|
hideButtons: true,
|
|
272
272
|
disabled: isDisabled,
|
|
273
273
|
onBlur: e => this.foundation.handleQuickJumpBlur(),
|
|
@@ -288,16 +288,16 @@ class Pagination extends _baseComponent.default {
|
|
|
288
288
|
popoverZIndex
|
|
289
289
|
} = this.props;
|
|
290
290
|
return pageList.map((page, i) => {
|
|
291
|
-
const pageListClassName = (0, _classnames.default)(
|
|
292
|
-
[
|
|
291
|
+
const pageListClassName = (0, _classnames.default)(`${prefixCls}-item`, {
|
|
292
|
+
[`${prefixCls}-item-active`]: currentPage === page // [`${prefixCls}-item-rest-opening`]: (i < 3 && isLeftRestHover && page ==='...') || (i > 3 && isRightRestHover && page === '...')
|
|
293
293
|
|
|
294
294
|
});
|
|
295
295
|
|
|
296
296
|
const pageEl = /*#__PURE__*/_react.default.createElement("li", {
|
|
297
|
-
key:
|
|
297
|
+
key: `${page}${i}`,
|
|
298
298
|
onClick: () => this.foundation.goPage(page, i),
|
|
299
299
|
className: pageListClassName,
|
|
300
|
-
"aria-label": page === '...' ? 'More' :
|
|
300
|
+
"aria-label": page === '...' ? 'More' : `Page ${page}`,
|
|
301
301
|
"aria-current": currentPage === page ? "page" : false
|
|
302
302
|
}, page);
|
|
303
303
|
|
|
@@ -308,7 +308,7 @@ class Pagination extends _baseComponent.default {
|
|
|
308
308
|
trigger: "hover",
|
|
309
309
|
// onVisibleChange={visible=>this.handleRestHover(visible, i < 3 ? 'left' : 'right')}
|
|
310
310
|
content: this.renderRestPageList(content),
|
|
311
|
-
key:
|
|
311
|
+
key: `${page}${i}`,
|
|
312
312
|
position: popoverPosition,
|
|
313
313
|
zIndex: popoverZIndex
|
|
314
314
|
}, pageEl);
|
|
@@ -323,7 +323,7 @@ class Pagination extends _baseComponent.default {
|
|
|
323
323
|
const {
|
|
324
324
|
direction
|
|
325
325
|
} = this.context;
|
|
326
|
-
const className = (0, _classnames.default)(
|
|
326
|
+
const className = (0, _classnames.default)(`${prefixCls}-rest-item`);
|
|
327
327
|
const count = restList.length;
|
|
328
328
|
|
|
329
329
|
const row = item => {
|
|
@@ -334,11 +334,11 @@ class Pagination extends _baseComponent.default {
|
|
|
334
334
|
const page = restList[index];
|
|
335
335
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
336
336
|
role: "listitem",
|
|
337
|
-
key:
|
|
337
|
+
key: `${page}${index}`,
|
|
338
338
|
className: className,
|
|
339
339
|
onClick: () => this.foundation.goPage(page, index),
|
|
340
340
|
style: style,
|
|
341
|
-
"aria-label":
|
|
341
|
+
"aria-label": `${page}`
|
|
342
342
|
}, page);
|
|
343
343
|
};
|
|
344
344
|
|
|
@@ -348,7 +348,7 @@ class Pagination extends _baseComponent.default {
|
|
|
348
348
|
/*#__PURE__*/
|
|
349
349
|
// @ts-ignore skip type check cause react-window not update with @types/react 18
|
|
350
350
|
_react.default.createElement(_reactWindow.FixedSizeList, {
|
|
351
|
-
className:
|
|
351
|
+
className: `${prefixCls}-rest-list`,
|
|
352
352
|
itemData: restList,
|
|
353
353
|
itemSize: itemHeight,
|
|
354
354
|
width: 78,
|
|
@@ -369,7 +369,7 @@ class Pagination extends _baseComponent.default {
|
|
|
369
369
|
hoverShowPageSelect,
|
|
370
370
|
showSizeChanger
|
|
371
371
|
} = this.props;
|
|
372
|
-
const paginationCls = (0, _classnames.default)(
|
|
372
|
+
const paginationCls = (0, _classnames.default)(`${prefixCls}-small`, prefixCls, className);
|
|
373
373
|
const {
|
|
374
374
|
currentPage,
|
|
375
375
|
total,
|
|
@@ -387,7 +387,7 @@ class Pagination extends _baseComponent.default {
|
|
|
387
387
|
const pageList = this.renderRestPageList(pageNumbers);
|
|
388
388
|
|
|
389
389
|
const page = /*#__PURE__*/_react.default.createElement("div", {
|
|
390
|
-
className:
|
|
390
|
+
className: `${prefixCls}-item ${prefixCls}-item-small`
|
|
391
391
|
}, currentPage, "/", totalPageNum, " ");
|
|
392
392
|
|
|
393
393
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -410,8 +410,8 @@ class Pagination extends _baseComponent.default {
|
|
|
410
410
|
hideOnSinglePage,
|
|
411
411
|
showSizeChanger
|
|
412
412
|
} = this.props;
|
|
413
|
-
const paginationCls = (0, _classnames.default)(className,
|
|
414
|
-
const showTotalCls =
|
|
413
|
+
const paginationCls = (0, _classnames.default)(className, `${prefixCls}`);
|
|
414
|
+
const showTotalCls = `${prefixCls}-total`;
|
|
415
415
|
const totalPageNum = Math.ceil(total / pageSize);
|
|
416
416
|
|
|
417
417
|
if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
|
|
@@ -423,7 +423,7 @@ class Pagination extends _baseComponent.default {
|
|
|
423
423
|
style: style
|
|
424
424
|
}, showTotal ? /*#__PURE__*/_react.default.createElement("span", {
|
|
425
425
|
className: showTotalCls
|
|
426
|
-
}, locale.total,
|
|
426
|
+
}, locale.total, ` ${Math.ceil(total / pageSize)} `, locale.page) : null, this.renderPrevBtn(), this.renderPageList(), this.renderNextBtn(), this.renderPageSizeSwitch(locale), this.renderQuickJump(locale));
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
render() {
|
|
@@ -142,7 +142,7 @@ class Popconfirm extends _baseComponent.default {
|
|
|
142
142
|
direction
|
|
143
143
|
} = this.context;
|
|
144
144
|
const popCardCls = (0, _classnames.default)(prefixCls, className, {
|
|
145
|
-
[
|
|
145
|
+
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
146
146
|
});
|
|
147
147
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
148
148
|
const showContent = !(content === null || typeof content === 'undefined');
|
|
@@ -154,29 +154,29 @@ class Popconfirm extends _baseComponent.default {
|
|
|
154
154
|
onClick: this.stopImmediatePropagation,
|
|
155
155
|
style: style
|
|
156
156
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
-
className:
|
|
157
|
+
className: `${prefixCls}-inner`
|
|
158
158
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
159
|
-
className:
|
|
159
|
+
className: `${prefixCls}-header`
|
|
160
160
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
161
|
-
className:
|
|
161
|
+
className: `${prefixCls}-header-icon`,
|
|
162
162
|
"x-semi-prop": "icon"
|
|
163
163
|
}, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
-
className:
|
|
164
|
+
className: `${prefixCls}-header-body`
|
|
165
165
|
}, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
-
className:
|
|
166
|
+
className: `${prefixCls}-header-title`,
|
|
167
167
|
"x-semi-prop": "title"
|
|
168
168
|
}, title) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
169
|
-
className:
|
|
169
|
+
className: `${prefixCls}-btn-close`,
|
|
170
170
|
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
|
171
171
|
size: "small",
|
|
172
172
|
theme: 'borderless',
|
|
173
173
|
type: cancelType,
|
|
174
174
|
onClick: this.handleCancel
|
|
175
175
|
})), showContent ? /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
-
className:
|
|
176
|
+
className: `${prefixCls}-body`,
|
|
177
177
|
"x-semi-prop": "content"
|
|
178
178
|
}, content) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
-
className:
|
|
179
|
+
className: `${prefixCls}-footer`
|
|
180
180
|
}, this.renderControls())))
|
|
181
181
|
);
|
|
182
182
|
}
|
package/lib/cjs/popover/index.js
CHANGED
|
@@ -58,7 +58,7 @@ class Popover extends _react.default.PureComponent {
|
|
|
58
58
|
direction
|
|
59
59
|
} = this.context;
|
|
60
60
|
const popCardCls = (0, _classnames.default)(prefixCls, contentClassName, {
|
|
61
|
-
[
|
|
61
|
+
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
62
62
|
});
|
|
63
63
|
const contentNode = this.renderContentNode({
|
|
64
64
|
initialFocusRef,
|
|
@@ -67,7 +67,7 @@ class Popover extends _react.default.PureComponent {
|
|
|
67
67
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
68
68
|
className: popCardCls
|
|
69
69
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className:
|
|
70
|
+
className: `${prefixCls}-content`
|
|
71
71
|
}, contentNode));
|
|
72
72
|
};
|
|
73
73
|
|