@douyinfe/semi-ui 2.22.0-beta.0 → 2.22.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 +438 -38
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +4084 -5300
- 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/_cssAnimation/index.d.ts +39 -0
- package/lib/cjs/_cssAnimation/index.js +133 -0
- package/lib/cjs/anchor/index.d.ts +3 -3
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +7 -8
- package/lib/cjs/autoComplete/option.d.ts +1 -1
- package/lib/cjs/banner/index.d.ts +2 -2
- package/lib/cjs/breadcrumb/index.d.ts +3 -3
- package/lib/cjs/breadcrumb/item.d.ts +3 -3
- package/lib/cjs/button/index.d.ts +2 -2
- package/lib/cjs/calendar/dayCalendar.d.ts +2 -2
- package/lib/cjs/calendar/index.d.ts +2 -2
- package/lib/cjs/calendar/monthCalendar.d.ts +2 -2
- package/lib/cjs/calendar/rangeCalendar.d.ts +2 -2
- package/lib/cjs/calendar/weekCalendar.d.ts +2 -2
- package/lib/cjs/card/cardGroup.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/cascader/index.d.ts +7 -8
- package/lib/cjs/cascader/index.js +8 -6
- package/lib/cjs/collapse/collapse-context.d.ts +1 -2
- package/lib/cjs/collapse/index.d.ts +3 -3
- package/lib/cjs/collapse/item.d.ts +2 -2
- package/lib/cjs/collapsible/index.d.ts +32 -19
- package/lib/cjs/collapsible/index.js +157 -121
- package/lib/cjs/configProvider/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +3 -3
- package/lib/cjs/datePicker/datePicker.d.ts +12 -9
- package/lib/cjs/datePicker/datePicker.js +11 -13
- package/lib/cjs/datePicker/month.d.ts +1 -1
- package/lib/cjs/datePicker/month.js +5 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +7 -6
- package/lib/cjs/datePicker/monthsGrid.js +9 -26
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +13 -8
- package/lib/cjs/descriptions/index.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownItem.d.ts +2 -1
- package/lib/cjs/dropdown/dropdownItem.js +3 -1
- package/lib/cjs/dropdown/index.d.ts +5 -6
- package/lib/cjs/form/baseForm.d.ts +7 -5
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +4 -2
- package/lib/cjs/form/label.d.ts +1 -1
- package/lib/cjs/grid/col.d.ts +6 -6
- package/lib/cjs/grid/row.d.ts +1 -1
- package/lib/cjs/iconButton/index.d.ts +2 -2
- package/lib/cjs/image/image.d.ts +4 -4
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/inputNumber/index.d.ts +2 -2
- package/lib/cjs/locale/source/ro.d.ts +3 -3
- package/lib/cjs/modal/Modal.d.ts +6 -6
- package/lib/cjs/modal/Modal.js +80 -56
- package/lib/cjs/modal/ModalContent.js +6 -5
- package/lib/cjs/modal/confirm.d.ts +10 -10
- package/lib/cjs/modal/confirm.js +1 -15
- package/lib/cjs/modal/useModal/HookModal.d.ts +0 -2
- package/lib/cjs/modal/useModal/HookModal.js +6 -18
- package/lib/cjs/navigation/Footer.d.ts +1 -1
- package/lib/cjs/navigation/Header.d.ts +3 -3
- package/lib/cjs/navigation/Item.d.ts +4 -4
- package/lib/cjs/navigation/Item.js +11 -5
- package/lib/cjs/navigation/OpenIconTransition.d.ts +1 -15
- package/lib/cjs/navigation/OpenIconTransition.js +1 -82
- package/lib/cjs/navigation/SubNav.d.ts +4 -4
- package/lib/cjs/navigation/SubNav.js +43 -27
- package/lib/cjs/navigation/index.d.ts +8 -11
- package/lib/cjs/notification/index.d.ts +0 -1
- package/lib/cjs/notification/index.js +25 -15
- package/lib/cjs/notification/notice.d.ts +3 -1
- package/lib/cjs/notification/notice.js +3 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -5
- package/lib/cjs/popover/index.d.ts +8 -8
- package/lib/cjs/popover/index.js +1 -1
- package/lib/cjs/progress/index.d.ts +4 -4
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/scrollList/index.d.ts +1 -1
- package/lib/cjs/scrollList/scrollItem.d.ts +3 -3
- package/lib/cjs/scrollList/scrollItem.js +2 -2
- package/lib/cjs/select/index.d.ts +11 -6
- package/lib/cjs/select/index.js +108 -60
- package/lib/cjs/select/option.d.ts +1 -1
- package/lib/cjs/select/optionGroup.d.ts +1 -1
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +8 -0
- package/lib/cjs/sideSheet/SideSheetContent.js +10 -6
- package/lib/cjs/sideSheet/index.d.ts +4 -4
- package/lib/cjs/sideSheet/index.js +69 -39
- package/lib/cjs/space/index.d.ts +1 -1
- package/lib/cjs/spin/index.js +1 -4
- package/lib/cjs/table/Body/BaseRow.d.ts +5 -5
- package/lib/cjs/table/Body/ExpandedRow.d.ts +3 -3
- package/lib/cjs/table/Body/SectionRow.d.ts +3 -3
- package/lib/cjs/table/Column.d.ts +4 -4
- package/lib/cjs/table/ColumnShape.d.ts +4 -4
- package/lib/cjs/table/ColumnSorter.d.ts +1 -1
- package/lib/cjs/table/CustomExpandIcon.d.ts +1 -1
- package/lib/cjs/table/CustomExpandIcon.js +13 -5
- package/lib/cjs/table/Table.d.ts +16 -16
- package/lib/cjs/table/TableCell.d.ts +4 -4
- package/lib/cjs/table/TableHeaderRow.d.ts +2 -2
- package/lib/cjs/table/TablePagination.d.ts +1 -1
- package/lib/cjs/table/index.d.ts +15 -15
- package/lib/cjs/tabs/TabPane.d.ts +2 -8
- package/lib/cjs/tabs/TabPane.js +40 -38
- package/lib/cjs/tabs/index.d.ts +5 -3
- package/lib/cjs/tabs/index.js +26 -4
- package/lib/cjs/tabs/interface.d.ts +2 -0
- package/lib/cjs/tag/group.d.ts +1 -0
- package/lib/cjs/tag/group.js +6 -3
- package/lib/cjs/tag/index.d.ts +1 -1
- package/lib/cjs/tag/index.js +1 -0
- package/lib/cjs/tag/interface.d.ts +3 -1
- package/lib/cjs/tagInput/index.d.ts +3 -3
- package/lib/cjs/timePicker/Combobox.js +4 -8
- package/lib/cjs/timePicker/PanelShape.d.ts +2 -2
- package/lib/cjs/timePicker/TimePicker.d.ts +11 -11
- package/lib/cjs/timePicker/TimePicker.js +3 -1
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +10 -9
- package/lib/cjs/timeline/index.d.ts +1 -1
- package/lib/cjs/toast/index.d.ts +2 -4
- package/lib/cjs/toast/index.js +29 -14
- package/lib/cjs/toast/toast.d.ts +4 -2
- package/lib/cjs/toast/toast.js +3 -1
- package/lib/cjs/tooltip/index.d.ts +8 -9
- package/lib/cjs/tooltip/index.js +30 -37
- package/lib/cjs/transfer/index.d.ts +1 -1
- package/lib/cjs/tree/autoSizer.d.ts +2 -2
- package/lib/cjs/tree/index.d.ts +5 -5
- package/lib/cjs/tree/nodeCollapsible.d.ts +11 -0
- package/lib/cjs/tree/nodeCollapsible.js +50 -0
- package/lib/cjs/tree/nodeList.js +6 -5
- package/lib/cjs/tree/treeNode.d.ts +1 -1
- package/lib/cjs/treeSelect/index.d.ts +12 -9
- package/lib/cjs/treeSelect/index.js +23 -9
- package/lib/cjs/trigger/index.d.ts +1 -1
- package/lib/cjs/typography/base.d.ts +8 -8
- package/lib/cjs/typography/index.d.ts +2 -0
- package/lib/cjs/typography/index.js +3 -0
- package/lib/cjs/typography/interface.d.ts +2 -0
- package/lib/cjs/typography/numeral.d.ts +68 -0
- package/lib/cjs/typography/numeral.js +106 -0
- package/lib/cjs/typography/paragraph.d.ts +3 -3
- package/lib/cjs/typography/text.d.ts +4 -4
- package/lib/cjs/typography/title.d.ts +4 -4
- package/lib/cjs/upload/fileCard.d.ts +1 -1
- package/lib/es/_cssAnimation/index.d.ts +39 -0
- package/lib/es/_cssAnimation/index.js +122 -0
- package/lib/es/anchor/index.d.ts +3 -3
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +7 -8
- package/lib/es/autoComplete/option.d.ts +1 -1
- package/lib/es/banner/index.d.ts +2 -2
- package/lib/es/breadcrumb/index.d.ts +3 -3
- package/lib/es/breadcrumb/item.d.ts +3 -3
- package/lib/es/button/index.d.ts +2 -2
- package/lib/es/calendar/dayCalendar.d.ts +2 -2
- package/lib/es/calendar/index.d.ts +2 -2
- package/lib/es/calendar/monthCalendar.d.ts +2 -2
- package/lib/es/calendar/rangeCalendar.d.ts +2 -2
- package/lib/es/calendar/weekCalendar.d.ts +2 -2
- package/lib/es/card/cardGroup.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +7 -8
- package/lib/es/cascader/index.js +8 -6
- package/lib/es/collapse/collapse-context.d.ts +1 -2
- package/lib/es/collapse/index.d.ts +3 -3
- package/lib/es/collapse/item.d.ts +2 -2
- package/lib/es/collapsible/index.d.ts +32 -19
- package/lib/es/collapsible/index.js +158 -119
- package/lib/es/configProvider/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +3 -3
- package/lib/es/datePicker/datePicker.d.ts +12 -9
- package/lib/es/datePicker/datePicker.js +11 -13
- package/lib/es/datePicker/month.d.ts +1 -1
- package/lib/es/datePicker/month.js +5 -1
- package/lib/es/datePicker/monthsGrid.d.ts +7 -6
- package/lib/es/datePicker/monthsGrid.js +9 -26
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +13 -8
- package/lib/es/descriptions/index.d.ts +1 -1
- package/lib/es/dropdown/dropdownItem.d.ts +2 -1
- package/lib/es/dropdown/dropdownItem.js +3 -1
- package/lib/es/dropdown/index.d.ts +5 -6
- package/lib/es/form/baseForm.d.ts +7 -5
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/field.d.ts +4 -2
- package/lib/es/form/label.d.ts +1 -1
- package/lib/es/grid/col.d.ts +6 -6
- package/lib/es/grid/row.d.ts +1 -1
- package/lib/es/iconButton/index.d.ts +2 -2
- package/lib/es/image/image.d.ts +4 -4
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/index.d.ts +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/inputNumber/index.d.ts +2 -2
- package/lib/es/locale/source/ro.d.ts +3 -3
- package/lib/es/modal/Modal.d.ts +6 -6
- package/lib/es/modal/Modal.js +79 -56
- package/lib/es/modal/ModalContent.js +6 -5
- package/lib/es/modal/confirm.d.ts +10 -10
- package/lib/es/modal/confirm.js +1 -14
- package/lib/es/modal/useModal/HookModal.d.ts +0 -2
- package/lib/es/modal/useModal/HookModal.js +7 -19
- package/lib/es/navigation/Footer.d.ts +1 -1
- package/lib/es/navigation/Header.d.ts +3 -3
- package/lib/es/navigation/Item.d.ts +4 -4
- package/lib/es/navigation/Item.js +11 -5
- package/lib/es/navigation/OpenIconTransition.d.ts +1 -15
- package/lib/es/navigation/OpenIconTransition.js +1 -66
- package/lib/es/navigation/SubNav.d.ts +4 -4
- package/lib/es/navigation/SubNav.js +43 -28
- package/lib/es/navigation/index.d.ts +8 -11
- package/lib/es/notification/index.d.ts +0 -1
- package/lib/es/notification/index.js +24 -14
- package/lib/es/notification/notice.d.ts +3 -1
- package/lib/es/notification/notice.js +3 -1
- package/lib/es/popconfirm/index.d.ts +4 -5
- package/lib/es/popover/index.d.ts +8 -8
- package/lib/es/popover/index.js +1 -1
- package/lib/es/progress/index.d.ts +4 -4
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/scrollList/index.d.ts +1 -1
- package/lib/es/scrollList/scrollItem.d.ts +3 -3
- package/lib/es/scrollList/scrollItem.js +3 -3
- package/lib/es/select/index.d.ts +11 -6
- package/lib/es/select/index.js +108 -60
- package/lib/es/select/option.d.ts +1 -1
- package/lib/es/select/optionGroup.d.ts +1 -1
- package/lib/es/sideSheet/SideSheetContent.d.ts +8 -0
- package/lib/es/sideSheet/SideSheetContent.js +10 -6
- package/lib/es/sideSheet/index.d.ts +4 -4
- package/lib/es/sideSheet/index.js +67 -37
- package/lib/es/space/index.d.ts +1 -1
- package/lib/es/spin/index.js +1 -4
- package/lib/es/table/Body/BaseRow.d.ts +5 -5
- package/lib/es/table/Body/ExpandedRow.d.ts +3 -3
- package/lib/es/table/Body/SectionRow.d.ts +3 -3
- package/lib/es/table/Column.d.ts +4 -4
- package/lib/es/table/ColumnShape.d.ts +4 -4
- package/lib/es/table/ColumnSorter.d.ts +1 -1
- package/lib/es/table/CustomExpandIcon.d.ts +1 -1
- package/lib/es/table/CustomExpandIcon.js +13 -5
- package/lib/es/table/Table.d.ts +16 -16
- package/lib/es/table/TableCell.d.ts +4 -4
- package/lib/es/table/TableHeaderRow.d.ts +2 -2
- package/lib/es/table/TablePagination.d.ts +1 -1
- package/lib/es/table/index.d.ts +15 -15
- package/lib/es/tabs/TabPane.d.ts +2 -8
- package/lib/es/tabs/TabPane.js +40 -38
- package/lib/es/tabs/index.d.ts +5 -3
- package/lib/es/tabs/index.js +26 -4
- package/lib/es/tabs/interface.d.ts +2 -0
- package/lib/es/tag/group.d.ts +1 -0
- package/lib/es/tag/group.js +6 -3
- package/lib/es/tag/index.d.ts +1 -1
- package/lib/es/tag/index.js +1 -0
- package/lib/es/tag/interface.d.ts +3 -1
- package/lib/es/tagInput/index.d.ts +3 -3
- package/lib/es/timePicker/Combobox.js +4 -8
- package/lib/es/timePicker/PanelShape.d.ts +2 -2
- package/lib/es/timePicker/TimePicker.d.ts +11 -11
- package/lib/es/timePicker/TimePicker.js +3 -1
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +10 -9
- package/lib/es/timeline/index.d.ts +1 -1
- package/lib/es/toast/index.d.ts +2 -4
- package/lib/es/toast/index.js +27 -13
- package/lib/es/toast/toast.d.ts +4 -2
- package/lib/es/toast/toast.js +3 -1
- package/lib/es/tooltip/index.d.ts +8 -9
- package/lib/es/tooltip/index.js +27 -36
- package/lib/es/transfer/index.d.ts +1 -1
- package/lib/es/tree/autoSizer.d.ts +2 -2
- package/lib/es/tree/index.d.ts +5 -5
- package/lib/es/tree/nodeCollapsible.d.ts +11 -0
- package/lib/es/tree/nodeCollapsible.js +35 -0
- package/lib/es/tree/nodeList.js +6 -5
- package/lib/es/tree/treeNode.d.ts +1 -1
- package/lib/es/treeSelect/index.d.ts +12 -9
- package/lib/es/treeSelect/index.js +22 -8
- package/lib/es/trigger/index.d.ts +1 -1
- package/lib/es/typography/base.d.ts +8 -8
- package/lib/es/typography/index.d.ts +2 -0
- package/lib/es/typography/index.js +2 -0
- package/lib/es/typography/interface.d.ts +2 -0
- package/lib/es/typography/numeral.d.ts +68 -0
- package/lib/es/typography/numeral.js +86 -0
- package/lib/es/typography/paragraph.d.ts +3 -3
- package/lib/es/typography/text.d.ts +4 -4
- package/lib/es/typography/title.d.ts +4 -4
- package/lib/es/upload/fileCard.d.ts +1 -1
- package/package.json +7 -7
- package/lib/cjs/motions/Rotate.d.ts +0 -23
- package/lib/cjs/motions/Rotate.js +0 -76
- package/lib/cjs/navigation/SubNavTransition.d.ts +0 -17
- package/lib/cjs/navigation/SubNavTransition.js +0 -83
- package/lib/cjs/notification/NoticeTransition.d.ts +0 -10
- package/lib/cjs/notification/NoticeTransition.js +0 -85
- package/lib/cjs/sideSheet/SideSheetTransition.d.ts +0 -12
- package/lib/cjs/sideSheet/SideSheetTransition.js +0 -115
- package/lib/cjs/tabs/TabPaneTransition.d.ts +0 -4
- package/lib/cjs/tabs/TabPaneTransition.js +0 -114
- package/lib/cjs/toast/ToastTransition.d.ts +0 -7
- package/lib/cjs/toast/ToastTransition.js +0 -66
- package/lib/cjs/tooltip/TooltipStyledTransition.d.ts +0 -9
- package/lib/cjs/tooltip/TooltipStyledTransition.js +0 -52
- package/lib/cjs/tree/collapse.d.ts +0 -29
- package/lib/cjs/tree/collapse.js +0 -155
- package/lib/es/motions/Rotate.d.ts +0 -23
- package/lib/es/motions/Rotate.js +0 -60
- package/lib/es/navigation/SubNavTransition.d.ts +0 -17
- package/lib/es/navigation/SubNavTransition.js +0 -66
- package/lib/es/notification/NoticeTransition.d.ts +0 -10
- package/lib/es/notification/NoticeTransition.js +0 -74
- package/lib/es/sideSheet/SideSheetTransition.d.ts +0 -12
- package/lib/es/sideSheet/SideSheetTransition.js +0 -102
- package/lib/es/tabs/TabPaneTransition.d.ts +0 -4
- package/lib/es/tabs/TabPaneTransition.js +0 -103
- package/lib/es/toast/ToastTransition.d.ts +0 -7
- package/lib/es/toast/ToastTransition.js +0 -55
- package/lib/es/tooltip/TooltipStyledTransition.d.ts +0 -9
- package/lib/es/tooltip/TooltipStyledTransition.js +0 -38
- package/lib/es/tree/collapse.d.ts +0 -29
- package/lib/es/tree/collapse.js +0 -136
|
@@ -23,10 +23,10 @@ declare const _default: {
|
|
|
23
23
|
renderFilterDropdownItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
24
|
sortChildrenRecord: PropTypes.Requireable<boolean>;
|
|
25
25
|
sortDirections: PropTypes.Requireable<string[]>;
|
|
26
|
-
sortOrder: PropTypes.Requireable<string | boolean
|
|
27
|
-
sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
28
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
26
|
+
sortOrder: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
27
|
+
sorter: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
28
|
+
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
29
29
|
useFullRender: PropTypes.Requireable<boolean>;
|
|
30
|
-
width: PropTypes.Requireable<string | number
|
|
30
|
+
width: PropTypes.Requireable<NonNullable<string | number>>;
|
|
31
31
|
};
|
|
32
32
|
export default _default;
|
|
@@ -15,7 +15,7 @@ export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
|
15
15
|
style: PropTypes.Requireable<object>;
|
|
16
16
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
17
|
prefixCls: PropTypes.Requireable<string>;
|
|
18
|
-
sortOrder: PropTypes.Requireable<string | boolean
|
|
18
|
+
sortOrder: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
19
19
|
};
|
|
20
20
|
static defaultProps: {
|
|
21
21
|
prefixCls: "semi-table";
|
|
@@ -21,7 +21,7 @@ declare namespace CustomExpandIcon {
|
|
|
21
21
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
22
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
23
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
24
|
+
expandIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
25
25
|
prefixCls: PropTypes.Requireable<string>;
|
|
26
26
|
motion: PropTypes.Requireable<boolean>;
|
|
27
27
|
};
|
|
@@ -17,7 +17,7 @@ var _constants = require("@douyinfe/semi-foundation/lib/cjs/table/constants");
|
|
|
17
17
|
|
|
18
18
|
var _isEnterPress = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/isEnterPress"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _cssAnimation = _interopRequireDefault(require("../_cssAnimation"));
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
|
|
@@ -64,10 +64,18 @@ function CustomExpandIcon(props) {
|
|
|
64
64
|
}, [expanded]);
|
|
65
65
|
|
|
66
66
|
if (motion) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const originIcon = icon;
|
|
68
|
+
icon = /*#__PURE__*/_react.default.createElement(_cssAnimation.default, {
|
|
69
|
+
animationState: expanded ? "enter" : "leave",
|
|
70
|
+
startClassName: "".concat(_constants.cssClasses.PREFIX, "-expandedIcon-").concat(expanded ? 'show' : "hide")
|
|
71
|
+
}, _ref => {
|
|
72
|
+
let {
|
|
73
|
+
animationClassName
|
|
74
|
+
} = _ref;
|
|
75
|
+
return /*#__PURE__*/_react.default.cloneElement(originIcon, {
|
|
76
|
+
className: (originIcon.props.className || "") + " " + animationClassName
|
|
77
|
+
});
|
|
78
|
+
});
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
return /*#__PURE__*/_react.default.createElement("span", {
|
package/lib/cjs/table/Table.d.ts
CHANGED
|
@@ -78,21 +78,21 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
78
78
|
renderFilterDropdownItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
79
|
sortChildrenRecord: PropTypes.Requireable<boolean>;
|
|
80
80
|
sortDirections: PropTypes.Requireable<string[]>;
|
|
81
|
-
sortOrder: PropTypes.Requireable<string | boolean
|
|
82
|
-
sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
83
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
81
|
+
sortOrder: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
82
|
+
sorter: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
83
|
+
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
84
84
|
useFullRender: PropTypes.Requireable<boolean>;
|
|
85
|
-
width: PropTypes.Requireable<string | number
|
|
85
|
+
width: PropTypes.Requireable<NonNullable<string | number>>;
|
|
86
86
|
}>[]>;
|
|
87
87
|
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
88
88
|
id: PropTypes.Requireable<string>;
|
|
89
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
89
|
+
expandIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
90
90
|
expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
|
|
91
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
91
|
+
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
92
92
|
onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
93
93
|
showHeader: PropTypes.Requireable<boolean>;
|
|
94
94
|
indentSize: PropTypes.Requireable<number>;
|
|
95
|
-
rowKey: PropTypes.Requireable<string | number | ((...args: any[]) => any)
|
|
95
|
+
rowKey: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
96
96
|
onRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
97
|
onExpandedRowsChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
98
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -104,23 +104,23 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
104
104
|
defaultExpandAllGroupRows: PropTypes.Requireable<boolean>;
|
|
105
105
|
expandAllGroupRows: PropTypes.Requireable<boolean>;
|
|
106
106
|
defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
|
|
107
|
-
pagination: PropTypes.Requireable<boolean | object
|
|
107
|
+
pagination: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
108
108
|
renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
|
|
109
|
-
footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
109
|
+
footer: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
110
110
|
empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
111
111
|
dataSource: PropTypes.Requireable<any[]>;
|
|
112
112
|
childrenRecordName: PropTypes.Requireable<string>;
|
|
113
|
-
rowSelection: PropTypes.Requireable<boolean | object
|
|
113
|
+
rowSelection: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
114
114
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
115
115
|
scroll: PropTypes.Requireable<PropTypes.InferProps<{
|
|
116
|
-
x: PropTypes.Requireable<string | number | boolean
|
|
117
|
-
y: PropTypes.Requireable<string | number
|
|
116
|
+
x: PropTypes.Requireable<NonNullable<string | number | boolean>>;
|
|
117
|
+
y: PropTypes.Requireable<NonNullable<string | number>>;
|
|
118
118
|
}>>;
|
|
119
|
-
groupBy: PropTypes.Requireable<string | number | ((...args: any[]) => any)
|
|
119
|
+
groupBy: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
120
120
|
renderGroupSection: PropTypes.Requireable<(...args: any[]) => any>;
|
|
121
121
|
onGroupedRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
122
122
|
clickGroupedRowToExpand: PropTypes.Requireable<boolean>;
|
|
123
|
-
virtualized: PropTypes.Requireable<boolean | object
|
|
123
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
124
124
|
dropdownPrefixCls: PropTypes.Requireable<string>;
|
|
125
125
|
expandRowByClick: PropTypes.Requireable<boolean>;
|
|
126
126
|
getVirtualizedListRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -294,13 +294,13 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
294
294
|
defaultCurrentPage?: number;
|
|
295
295
|
onPageChange?: (currentPage: number) => void;
|
|
296
296
|
onPageSizeChange?: (newPageSize: number) => void;
|
|
297
|
-
onChange: (
|
|
297
|
+
onChange: (currentPage: number, pageSize: number) => void;
|
|
298
298
|
prevText?: React.ReactNode;
|
|
299
299
|
nextText?: React.ReactNode;
|
|
300
300
|
showSizeChanger?: boolean;
|
|
301
301
|
showQuickJumper?: boolean;
|
|
302
302
|
popoverZIndex?: number;
|
|
303
|
-
popoverPosition?: "
|
|
303
|
+
popoverPosition?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
304
304
|
hideOnSinglePage?: boolean;
|
|
305
305
|
hoverShowPageSelect?: boolean;
|
|
306
306
|
};
|
|
@@ -49,9 +49,9 @@ export default class TableCell extends BaseComponent<TableCellProps, Record<stri
|
|
|
49
49
|
record: PropTypes.Requireable<object>;
|
|
50
50
|
prefixCls: PropTypes.Requireable<string>;
|
|
51
51
|
index: PropTypes.Requireable<number>;
|
|
52
|
-
fixedLeft: PropTypes.Requireable<number | boolean
|
|
52
|
+
fixedLeft: PropTypes.Requireable<NonNullable<number | boolean>>;
|
|
53
53
|
lastFixedLeft: PropTypes.Requireable<boolean>;
|
|
54
|
-
fixedRight: PropTypes.Requireable<number | boolean
|
|
54
|
+
fixedRight: PropTypes.Requireable<NonNullable<number | boolean>>;
|
|
55
55
|
firstFixedRight: PropTypes.Requireable<boolean>;
|
|
56
56
|
indent: PropTypes.Requireable<number>;
|
|
57
57
|
indentSize: PropTypes.Requireable<number>;
|
|
@@ -63,8 +63,8 @@ export default class TableCell extends BaseComponent<TableCellProps, Record<stri
|
|
|
63
63
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
64
|
onDidUpdate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
65
|
isSection: PropTypes.Requireable<boolean>;
|
|
66
|
-
width: PropTypes.Requireable<string | number
|
|
67
|
-
height: PropTypes.Requireable<string | number
|
|
66
|
+
width: PropTypes.Requireable<NonNullable<string | number>>;
|
|
67
|
+
height: PropTypes.Requireable<NonNullable<string | number>>;
|
|
68
68
|
selected: PropTypes.Requireable<boolean>;
|
|
69
69
|
expanded: PropTypes.Requireable<boolean>;
|
|
70
70
|
colIndex: PropTypes.Requireable<number>;
|
|
@@ -21,10 +21,10 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
|
21
21
|
row: PropTypes.Requireable<any[]>;
|
|
22
22
|
prefixCls: PropTypes.Requireable<string>;
|
|
23
23
|
onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
index: PropTypes.Requireable<string | number
|
|
24
|
+
index: PropTypes.Requireable<NonNullable<string | number>>;
|
|
25
25
|
style: PropTypes.Requireable<object>;
|
|
26
26
|
columns: PropTypes.Requireable<any[]>;
|
|
27
|
-
fixed: PropTypes.Requireable<string | boolean
|
|
27
|
+
fixed: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
28
28
|
selectedRowKeysSet: PropTypes.Validator<Set<unknown>>;
|
|
29
29
|
};
|
|
30
30
|
static defaultProps: {
|
|
@@ -13,7 +13,7 @@ export default class TablePagination extends PureComponent<TablePaginationProps>
|
|
|
13
13
|
style: PropTypes.Requireable<object>;
|
|
14
14
|
prefixCls: PropTypes.Requireable<string>;
|
|
15
15
|
pagination: PropTypes.Requireable<object>;
|
|
16
|
-
info: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
16
|
+
info: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
17
17
|
renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
18
|
};
|
|
19
19
|
static defaultProps: {
|
package/lib/cjs/table/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
8
8
|
static DEFAULT_KEY_COLUMN_SELECTION: "column-selection";
|
|
9
9
|
static DEFAULT_KEY_COLUMN_EXPAND: "column-expand";
|
|
10
10
|
static propTypes: {
|
|
11
|
-
resizable: PropTypes.Requireable<boolean | object
|
|
11
|
+
resizable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
12
12
|
className: PropTypes.Requireable<string>;
|
|
13
13
|
style: PropTypes.Requireable<object>;
|
|
14
14
|
prefixCls: PropTypes.Requireable<string>;
|
|
@@ -41,21 +41,21 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
41
41
|
renderFilterDropdownItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
42
|
sortChildrenRecord: PropTypes.Requireable<boolean>;
|
|
43
43
|
sortDirections: PropTypes.Requireable<string[]>;
|
|
44
|
-
sortOrder: PropTypes.Requireable<string | boolean
|
|
45
|
-
sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
46
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
44
|
+
sortOrder: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
45
|
+
sorter: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
46
|
+
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
47
47
|
useFullRender: PropTypes.Requireable<boolean>;
|
|
48
|
-
width: PropTypes.Requireable<string | number
|
|
48
|
+
width: PropTypes.Requireable<NonNullable<string | number>>;
|
|
49
49
|
}>[]>;
|
|
50
50
|
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
51
51
|
id: PropTypes.Requireable<string>;
|
|
52
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
52
|
+
expandIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
53
53
|
expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
|
|
54
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
54
|
+
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
55
55
|
onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
56
|
showHeader: PropTypes.Requireable<boolean>;
|
|
57
57
|
indentSize: PropTypes.Requireable<number>;
|
|
58
|
-
rowKey: PropTypes.Requireable<string | number | ((...args: any[]) => any)
|
|
58
|
+
rowKey: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
59
59
|
onRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
60
|
onExpandedRowsChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
61
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -67,23 +67,23 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
67
67
|
defaultExpandAllGroupRows: PropTypes.Requireable<boolean>;
|
|
68
68
|
expandAllGroupRows: PropTypes.Requireable<boolean>;
|
|
69
69
|
defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
|
|
70
|
-
pagination: PropTypes.Requireable<boolean | object
|
|
70
|
+
pagination: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
71
71
|
renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
-
footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
72
|
+
footer: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
73
73
|
empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
74
74
|
dataSource: PropTypes.Requireable<any[]>;
|
|
75
75
|
childrenRecordName: PropTypes.Requireable<string>;
|
|
76
|
-
rowSelection: PropTypes.Requireable<boolean | object
|
|
76
|
+
rowSelection: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
77
77
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
78
|
scroll: PropTypes.Requireable<PropTypes.InferProps<{
|
|
79
|
-
x: PropTypes.Requireable<string | number | boolean
|
|
80
|
-
y: PropTypes.Requireable<string | number
|
|
79
|
+
x: PropTypes.Requireable<NonNullable<string | number | boolean>>;
|
|
80
|
+
y: PropTypes.Requireable<NonNullable<string | number>>;
|
|
81
81
|
}>>;
|
|
82
|
-
groupBy: PropTypes.Requireable<string | number | ((...args: any[]) => any)
|
|
82
|
+
groupBy: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
83
83
|
renderGroupSection: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
84
|
onGroupedRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
85
85
|
clickGroupedRowToExpand: PropTypes.Requireable<boolean>;
|
|
86
|
-
virtualized: PropTypes.Requireable<boolean | object
|
|
86
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
87
87
|
dropdownPrefixCls: PropTypes.Requireable<string>;
|
|
88
88
|
expandRowByClick: PropTypes.Requireable<boolean>;
|
|
89
89
|
getVirtualizedListRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent, ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TabContextValue } from './interface';
|
|
4
|
-
import { PlainTab, TabPaneProps } from './interface';
|
|
3
|
+
import { PlainTab, TabContextValue, TabPaneProps } from './interface';
|
|
5
4
|
declare class TabPane extends PureComponent<TabPaneProps> {
|
|
6
5
|
static isTabPane: boolean;
|
|
7
6
|
static contextType: React.Context<TabContextValue>;
|
|
@@ -15,15 +14,10 @@ declare class TabPane extends PureComponent<TabPaneProps> {
|
|
|
15
14
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
15
|
closable: PropTypes.Requireable<boolean>;
|
|
17
16
|
};
|
|
18
|
-
lastActiveKey: string;
|
|
19
17
|
ref: React.RefObject<HTMLDivElement>;
|
|
20
|
-
isAnimating: boolean;
|
|
21
18
|
_active: boolean;
|
|
22
19
|
context: TabContextValue;
|
|
23
|
-
|
|
24
|
-
getDirection: (activeKey: string, itemKey: string, panes: Array<PlainTab>) => boolean;
|
|
25
|
-
hideScroll: () => void;
|
|
26
|
-
autoScroll: () => void;
|
|
20
|
+
getDirection: (activeKey: string, itemKey: string, panes: Array<PlainTab>, lastActiveKey: string) => boolean;
|
|
27
21
|
shouldRender: () => boolean;
|
|
28
22
|
render(): ReactNode;
|
|
29
23
|
}
|
package/lib/cjs/tabs/TabPane.js
CHANGED
|
@@ -17,7 +17,7 @@ var _getDataAttr = _interopRequireDefault(require("@douyinfe/semi-foundation/lib
|
|
|
17
17
|
|
|
18
18
|
var _tabsContext = _interopRequireDefault(require("./tabs-context"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _cssAnimation = _interopRequireDefault(require("../_cssAnimation"));
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
@@ -39,15 +39,13 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
39
39
|
class TabPane extends _react.PureComponent {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
42
|
-
this.lastActiveKey = null;
|
|
43
42
|
this.ref = /*#__PURE__*/(0, _react.createRef)(); // get direction from current item key to activeKey
|
|
44
43
|
|
|
45
|
-
this.getDirection = (activeKey, itemKey, panes) => {
|
|
44
|
+
this.getDirection = (activeKey, itemKey, panes, lastActiveKey) => {
|
|
46
45
|
if (itemKey !== null && activeKey !== null && Array.isArray(panes) && panes.length) {
|
|
47
46
|
const activeIndex = panes.findIndex(pane => pane.itemKey === activeKey);
|
|
48
47
|
const itemIndex = panes.findIndex(pane => pane.itemKey === itemKey);
|
|
49
|
-
const lastActiveIndex = panes.findIndex(pane => pane.itemKey ===
|
|
50
|
-
this.lastActiveKey = activeKey;
|
|
48
|
+
const lastActiveIndex = panes.findIndex(pane => pane.itemKey === lastActiveKey);
|
|
51
49
|
|
|
52
50
|
if (activeIndex === itemIndex) {
|
|
53
51
|
return lastActiveIndex > activeIndex;
|
|
@@ -58,24 +56,6 @@ class TabPane extends _react.PureComponent {
|
|
|
58
56
|
|
|
59
57
|
return false;
|
|
60
58
|
};
|
|
61
|
-
/* istanbul ignore next */
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.hideScroll = () => {
|
|
65
|
-
if (this.ref && this.ref.current) {
|
|
66
|
-
this.ref.current.style.overflow = 'hidden';
|
|
67
|
-
this.isAnimating = true;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
/* istanbul ignore next */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.autoScroll = () => {
|
|
74
|
-
if (this.ref && this.ref.current) {
|
|
75
|
-
this.ref.current.style.overflow = '';
|
|
76
|
-
this.isAnimating = false;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
59
|
|
|
80
60
|
this.shouldRender = () => {
|
|
81
61
|
const {
|
|
@@ -91,14 +71,11 @@ class TabPane extends _react.PureComponent {
|
|
|
91
71
|
};
|
|
92
72
|
}
|
|
93
73
|
|
|
94
|
-
componentDidMount() {
|
|
95
|
-
this.lastActiveKey = this.context.activeKey;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
74
|
render() {
|
|
99
75
|
const {
|
|
100
76
|
tabPaneMotion: motion,
|
|
101
|
-
tabPosition
|
|
77
|
+
tabPosition,
|
|
78
|
+
prevActiveKey
|
|
102
79
|
} = this.context;
|
|
103
80
|
|
|
104
81
|
const _a = this.props,
|
|
@@ -117,6 +94,27 @@ class TabPane extends _react.PureComponent {
|
|
|
117
94
|
[_constants.cssClasses.TABS_PANE]: true
|
|
118
95
|
});
|
|
119
96
|
const shouldRender = this.shouldRender();
|
|
97
|
+
|
|
98
|
+
const startClassName = (() => {
|
|
99
|
+
const direction = this.getDirection(this.context.activeKey, itemKey, this.context.panes, prevActiveKey);
|
|
100
|
+
|
|
101
|
+
if (tabPosition === 'top') {
|
|
102
|
+
if (direction) {
|
|
103
|
+
return _constants.cssClasses.TABS_PANE_ANIMATE_RIGHT_SHOW;
|
|
104
|
+
} else {
|
|
105
|
+
return _constants.cssClasses.TABS_PANE_ANIMATE_LEFT_SHOW;
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
if (direction) {
|
|
109
|
+
return _constants.cssClasses.TABS_PANE_ANIMATE_BOTTOM_SHOW;
|
|
110
|
+
} else {
|
|
111
|
+
return _constants.cssClasses.TABS_PANE_ANIMATE_TOP_SHOW;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
})();
|
|
115
|
+
|
|
116
|
+
const isActivatedBecauseOtherTabPaneRemoved = !this.context.panes.find(tabPane => tabPane.itemKey === prevActiveKey);
|
|
117
|
+
const hasMotion = motion && active && !isActivatedBecauseOtherTabPaneRemoved && !this.context.forceDisableMotion;
|
|
120
118
|
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
121
119
|
ref: this.ref,
|
|
122
120
|
role: "tabpanel",
|
|
@@ -128,16 +126,20 @@ class TabPane extends _react.PureComponent {
|
|
|
128
126
|
tabIndex: 0
|
|
129
127
|
}, (0, _getDataAttr.default)(restProps), {
|
|
130
128
|
"x-semi-prop": "children"
|
|
131
|
-
}),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
}), /*#__PURE__*/_react.default.createElement(_cssAnimation.default, {
|
|
130
|
+
motion: hasMotion,
|
|
131
|
+
animationState: active ? "enter" : "leave",
|
|
132
|
+
startClassName: startClassName
|
|
133
|
+
}, _ref => {
|
|
134
|
+
let {
|
|
135
|
+
animationClassName,
|
|
136
|
+
animationEventsNeedBind
|
|
137
|
+
} = _ref;
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
139
|
+
className: "".concat(_constants.cssClasses.TABS_PANE_MOTION_OVERLAY, " ").concat(animationClassName),
|
|
140
|
+
"x-semi-prop": "children"
|
|
141
|
+
}, animationEventsNeedBind), shouldRender ? children : null);
|
|
142
|
+
}));
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
}
|
package/lib/cjs/tabs/index.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ import TabsFoundation, { TabsAdapter } from '@douyinfe/semi-foundation/lib/cjs/t
|
|
|
4
4
|
import BaseComponent from '../_base/baseComponent';
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/cjs/tabs/tabs.css';
|
|
6
6
|
import TabPane from './TabPane';
|
|
7
|
-
import {
|
|
7
|
+
import { PlainTab, TabsProps } from './interface';
|
|
8
8
|
export * from './interface';
|
|
9
9
|
export interface TabsState {
|
|
10
10
|
activeKey: string;
|
|
11
11
|
panes: Array<PlainTab>;
|
|
12
|
+
prevActiveKey: string | null;
|
|
13
|
+
forceDisableMotion: boolean;
|
|
12
14
|
}
|
|
13
15
|
declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
14
16
|
static TabPane: typeof TabPane;
|
|
@@ -29,7 +31,7 @@ declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
|
29
31
|
tabBarExtraContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
30
32
|
tabBarStyle: PropTypes.Requireable<object>;
|
|
31
33
|
tabList: PropTypes.Requireable<any[]>;
|
|
32
|
-
tabPaneMotion: PropTypes.Requireable<boolean
|
|
34
|
+
tabPaneMotion: PropTypes.Requireable<boolean>;
|
|
33
35
|
tabPosition: PropTypes.Requireable<string>;
|
|
34
36
|
type: PropTypes.Requireable<string>;
|
|
35
37
|
onTabClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -42,7 +44,7 @@ declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
|
42
44
|
constructor(props: TabsProps);
|
|
43
45
|
get adapter(): TabsAdapter<TabsProps, TabsState>;
|
|
44
46
|
static getDerivedStateFromProps(props: TabsProps, state: TabsState): Partial<TabsState>;
|
|
45
|
-
componentDidUpdate(prevProps: TabsProps): void;
|
|
47
|
+
componentDidUpdate(prevProps: TabsProps, prevState: TabsState): void;
|
|
46
48
|
setContentRef: RefCallback<HTMLDivElement>;
|
|
47
49
|
onTabClick: (activeKey: string, event: MouseEvent<HTMLDivElement>) => void;
|
|
48
50
|
rePosChildren: (children: ReactElement[], activeKey: string) => ReactElement[];
|
package/lib/cjs/tabs/index.js
CHANGED
|
@@ -126,7 +126,9 @@ class Tabs extends _baseComponent.default {
|
|
|
126
126
|
this.foundation = new _foundation.default(this.adapter);
|
|
127
127
|
this.state = {
|
|
128
128
|
activeKey: this.foundation.getDefaultActiveKey(),
|
|
129
|
-
panes: []
|
|
129
|
+
panes: [],
|
|
130
|
+
prevActiveKey: null,
|
|
131
|
+
forceDisableMotion: false
|
|
130
132
|
};
|
|
131
133
|
this.contentRef = /*#__PURE__*/(0, _react.createRef)();
|
|
132
134
|
this.contentHeight = 'auto';
|
|
@@ -260,13 +262,14 @@ class Tabs extends _baseComponent.default {
|
|
|
260
262
|
const states = {};
|
|
261
263
|
|
|
262
264
|
if (!(0, _isNullOrUndefined.default)(props.activeKey) && props.activeKey !== state.activeKey) {
|
|
265
|
+
state.prevActiveKey = state.activeKey;
|
|
263
266
|
states.activeKey = props.activeKey;
|
|
264
267
|
}
|
|
265
268
|
|
|
266
269
|
return states;
|
|
267
270
|
}
|
|
268
271
|
|
|
269
|
-
componentDidUpdate(prevProps) {
|
|
272
|
+
componentDidUpdate(prevProps, prevState) {
|
|
270
273
|
// Panes state acts on tab bar, no need to compare TabPane children
|
|
271
274
|
const prevChildrenProps = _react.default.Children.toArray(prevProps.children).map(child => (0, _pick2.default)( /*#__PURE__*/(0, _react.isValidElement)(child) ? child.props : null, panePickKeys));
|
|
272
275
|
|
|
@@ -276,6 +279,23 @@ class Tabs extends _baseComponent.default {
|
|
|
276
279
|
|
|
277
280
|
if (!(0, _isEqual2.default)(this.props.tabList, prevProps.tabList)) {
|
|
278
281
|
this.foundation.handleTabListChange();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (prevState.activeKey !== this.state.activeKey && prevState.activeKey !== this.state.prevActiveKey) {
|
|
285
|
+
this.setState({
|
|
286
|
+
prevActiveKey: prevState.activeKey
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (prevProps.activeKey !== this.props.activeKey) {
|
|
291
|
+
const newAddedPanelItemKey = (() => {
|
|
292
|
+
const prevItemKeys = new Set(prevChildrenProps.map(p => p.itemKey));
|
|
293
|
+
return nowChildrenProps.map(p => p.itemKey).filter(itemKey => !prevItemKeys.has(itemKey));
|
|
294
|
+
})();
|
|
295
|
+
|
|
296
|
+
this.setState({
|
|
297
|
+
forceDisableMotion: newAddedPanelItemKey.includes(this.props.activeKey)
|
|
298
|
+
});
|
|
279
299
|
} // children变化,tabList方式使用时,啥也不用做
|
|
280
300
|
// children变化,非tabList方式使用,需要重新取activeKey。TabPane可能是异步更新的,若不重新取,未设activeKey时,第一个不会自动激活
|
|
281
301
|
// children changed: do nothing in tabList case
|
|
@@ -345,7 +365,9 @@ class Tabs extends _baseComponent.default {
|
|
|
345
365
|
lazyRender,
|
|
346
366
|
panes,
|
|
347
367
|
tabPaneMotion,
|
|
348
|
-
tabPosition
|
|
368
|
+
tabPosition,
|
|
369
|
+
prevActiveKey: this.state.prevActiveKey,
|
|
370
|
+
forceDisableMotion: this.state.forceDisableMotion
|
|
349
371
|
}
|
|
350
372
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
351
373
|
ref: this.setContentRef,
|
|
@@ -374,7 +396,7 @@ Tabs.propTypes = {
|
|
|
374
396
|
tabBarExtraContent: _propTypes.default.node,
|
|
375
397
|
tabBarStyle: _propTypes.default.object,
|
|
376
398
|
tabList: _propTypes.default.array,
|
|
377
|
-
tabPaneMotion: _propTypes.default.
|
|
399
|
+
tabPaneMotion: _propTypes.default.bool,
|
|
378
400
|
tabPosition: _propTypes.default.oneOf(_constants.strings.POSITION_MAP),
|
|
379
401
|
type: _propTypes.default.oneOf(_constants.strings.TYPE_MAP),
|
|
380
402
|
onTabClose: _propTypes.default.func,
|
package/lib/cjs/tag/group.d.ts
CHANGED
package/lib/cjs/tag/group.js
CHANGED
|
@@ -32,7 +32,8 @@ class TagGroup extends _react.PureComponent {
|
|
|
32
32
|
const {
|
|
33
33
|
size,
|
|
34
34
|
showPopover,
|
|
35
|
-
popoverProps
|
|
35
|
+
popoverProps,
|
|
36
|
+
onPlusNMouseEnter
|
|
36
37
|
} = this.props;
|
|
37
38
|
|
|
38
39
|
let nTag = /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -42,7 +43,8 @@ class TagGroup extends _react.PureComponent {
|
|
|
42
43
|
style: {
|
|
43
44
|
backgroundColor: 'transparent'
|
|
44
45
|
},
|
|
45
|
-
key: "_+n"
|
|
46
|
+
key: "_+n",
|
|
47
|
+
onMouseEnter: onPlusNMouseEnter
|
|
46
48
|
}, "+", n);
|
|
47
49
|
|
|
48
50
|
if (showPopover) {
|
|
@@ -156,7 +158,8 @@ TagGroup.defaultProps = {
|
|
|
156
158
|
className: '',
|
|
157
159
|
size: tagSize[0],
|
|
158
160
|
avatarShape: 'square',
|
|
159
|
-
onTagClose: () => undefined
|
|
161
|
+
onTagClose: () => undefined,
|
|
162
|
+
onPlusNMouseEnter: () => undefined
|
|
160
163
|
};
|
|
161
164
|
TagGroup.propTypes = {
|
|
162
165
|
children: _propTypes.default.node,
|
package/lib/cjs/tag/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
10
10
|
static defaultProps: TagProps;
|
|
11
11
|
static propTypes: {
|
|
12
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
tagKey: PropTypes.Requireable<string | number
|
|
13
|
+
tagKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
14
14
|
size: PropTypes.Requireable<string>;
|
|
15
15
|
color: PropTypes.Requireable<string>;
|
|
16
16
|
type: PropTypes.Requireable<string>;
|
package/lib/cjs/tag/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export interface TagProps {
|
|
|
23
23
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
24
24
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
25
25
|
tabIndex?: number;
|
|
26
|
+
onMouseEnter?: () => void;
|
|
26
27
|
}
|
|
27
28
|
export interface TagGroupProps<T> {
|
|
28
29
|
style?: React.CSSProperties;
|
|
@@ -35,5 +36,6 @@ export interface TagGroupProps<T> {
|
|
|
35
36
|
popoverProps?: PopoverProps;
|
|
36
37
|
avatarShape?: AvatarShape;
|
|
37
38
|
mode?: string;
|
|
38
|
-
onTagClose
|
|
39
|
+
onTagClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
40
|
+
onPlusNMouseEnter?: () => void;
|
|
39
41
|
}
|
|
@@ -73,7 +73,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
73
73
|
value: PropTypes.Requireable<any[]>;
|
|
74
74
|
inputValue: PropTypes.Requireable<string>;
|
|
75
75
|
placeholder: PropTypes.Requireable<string>;
|
|
76
|
-
separator: PropTypes.Requireable<string | any[]
|
|
76
|
+
separator: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
77
77
|
showClear: PropTypes.Requireable<boolean>;
|
|
78
78
|
addOnBlur: PropTypes.Requireable<boolean>;
|
|
79
79
|
draggable: PropTypes.Requireable<boolean>;
|
|
@@ -91,8 +91,8 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
91
91
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
92
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
93
93
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
94
|
-
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
95
|
-
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
94
|
+
prefix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
95
|
+
suffix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
96
96
|
'aria-label': PropTypes.Requireable<string>;
|
|
97
97
|
preventScroll: PropTypes.Requireable<boolean>;
|
|
98
98
|
};
|