@douyinfe/semi-ui 2.22.0-alpha.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 +450 -38
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5068 -6354
- 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/_base/baseComponent.js +3 -0
- package/lib/cjs/_cssAnimation/index.d.ts +39 -0
- package/lib/cjs/_cssAnimation/index.js +133 -0
- package/lib/cjs/anchor/index.d.ts +2 -2
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +6 -7
- 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/checkbox/checkbox.d.ts +5 -1
- package/lib/cjs/checkbox/checkbox.js +24 -0
- package/lib/cjs/checkbox/checkboxGroup.js +2 -2
- package/lib/cjs/checkbox/context.d.ts +1 -2
- 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 +10 -7
- 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 +6 -5
- package/lib/cjs/datePicker/monthsGrid.js +9 -26
- 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/dropdownMenu.d.ts +1 -0
- package/lib/cjs/dropdown/index.d.ts +5 -5
- package/lib/cjs/form/baseForm.d.ts +6 -4
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +3 -1
- 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 +2 -1
- package/lib/cjs/image/previewImage.d.ts +1 -1
- package/lib/cjs/image/previewImage.js +8 -5
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +3 -3
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/input/index.d.ts +1 -0
- package/lib/cjs/input/textarea.js +1 -1
- 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 +7 -7
- 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 +10 -5
- 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/slider/index.js +2 -2
- package/lib/cjs/space/index.d.ts +1 -1
- package/lib/cjs/spin/index.d.ts +1 -0
- 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 +15 -15
- package/lib/cjs/table/Table.js +20 -1
- package/lib/cjs/table/TableCell.d.ts +4 -4
- package/lib/cjs/table/TableHeaderRow.d.ts +3 -2
- package/lib/cjs/table/TablePagination.d.ts +1 -1
- package/lib/cjs/table/index.d.ts +15 -15
- package/lib/cjs/table/interface.d.ts +2 -0
- 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 +7 -11
- package/lib/cjs/tooltip/index.js +30 -39
- 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 +3 -3
- package/lib/cjs/upload/fileCard.d.ts +1 -1
- package/lib/es/_base/baseComponent.js +3 -0
- package/lib/es/_cssAnimation/index.d.ts +39 -0
- package/lib/es/_cssAnimation/index.js +122 -0
- package/lib/es/anchor/index.d.ts +2 -2
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +6 -7
- 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/checkbox/checkbox.d.ts +5 -1
- package/lib/es/checkbox/checkbox.js +24 -0
- package/lib/es/checkbox/checkboxGroup.js +2 -2
- package/lib/es/checkbox/context.d.ts +1 -2
- 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 +10 -7
- 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 +6 -5
- package/lib/es/datePicker/monthsGrid.js +9 -26
- 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/dropdownMenu.d.ts +1 -0
- package/lib/es/dropdown/index.d.ts +5 -5
- package/lib/es/form/baseForm.d.ts +6 -4
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/field.d.ts +3 -1
- 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 +2 -1
- package/lib/es/image/previewImage.d.ts +1 -1
- package/lib/es/image/previewImage.js +8 -5
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +3 -3
- package/lib/es/index.d.ts +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/input/index.d.ts +1 -0
- package/lib/es/input/textarea.js +1 -1
- 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 +7 -7
- 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 +10 -5
- 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/slider/index.js +2 -2
- package/lib/es/space/index.d.ts +1 -1
- package/lib/es/spin/index.d.ts +1 -0
- 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 +15 -15
- package/lib/es/table/Table.js +18 -1
- package/lib/es/table/TableCell.d.ts +4 -4
- package/lib/es/table/TableHeaderRow.d.ts +3 -2
- package/lib/es/table/TablePagination.d.ts +1 -1
- package/lib/es/table/index.d.ts +15 -15
- package/lib/es/table/interface.d.ts +2 -0
- 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 +7 -11
- package/lib/es/tooltip/index.js +27 -38
- 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 +3 -3
- package/lib/es/upload/fileCard.d.ts +1 -1
- package/package.json +7 -8
- 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
package/lib/es/select/index.js
CHANGED
|
@@ -46,6 +46,56 @@ class Select extends BaseComponent {
|
|
|
46
46
|
|
|
47
47
|
this.handleInputChange = value => this.foundation.handleInputChange(value);
|
|
48
48
|
|
|
49
|
+
this.getTagItem = (item, i, renderSelectedItem) => {
|
|
50
|
+
const {
|
|
51
|
+
size,
|
|
52
|
+
disabled: selectDisabled
|
|
53
|
+
} = this.props;
|
|
54
|
+
const label = item[0];
|
|
55
|
+
const {
|
|
56
|
+
value
|
|
57
|
+
} = item[1];
|
|
58
|
+
const disabled = item[1].disabled || selectDisabled;
|
|
59
|
+
|
|
60
|
+
const onClose = (tagContent, e) => {
|
|
61
|
+
if (e && typeof e.preventDefault === 'function') {
|
|
62
|
+
e.preventDefault(); // make sure that tag will not hidden immediately in controlled mode
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
this.foundation.removeTag({
|
|
66
|
+
label,
|
|
67
|
+
value
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
content,
|
|
73
|
+
isRenderInTag
|
|
74
|
+
} = renderSelectedItem(item[1], {
|
|
75
|
+
index: i,
|
|
76
|
+
disabled,
|
|
77
|
+
onClose
|
|
78
|
+
});
|
|
79
|
+
const basic = {
|
|
80
|
+
disabled,
|
|
81
|
+
closable: !disabled,
|
|
82
|
+
onClose
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
if (isRenderInTag) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, basic, {
|
|
87
|
+
color: "white",
|
|
88
|
+
size: size || 'large',
|
|
89
|
+
key: value,
|
|
90
|
+
tabIndex: -1
|
|
91
|
+
}), content);
|
|
92
|
+
} else {
|
|
93
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
94
|
+
key: value
|
|
95
|
+
}, content);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
49
99
|
this.state = {
|
|
50
100
|
isOpen: false,
|
|
51
101
|
isFocus: false,
|
|
@@ -59,7 +109,8 @@ class Select extends BaseComponent {
|
|
|
59
109
|
keyboardEventSet: {},
|
|
60
110
|
optionGroups: [],
|
|
61
111
|
isHovering: false,
|
|
62
|
-
isFocusInContainer: false
|
|
112
|
+
isFocusInContainer: false,
|
|
113
|
+
isFullTags: false
|
|
63
114
|
};
|
|
64
115
|
/* Generate random string */
|
|
65
116
|
|
|
@@ -693,14 +744,15 @@ class Select extends BaseComponent {
|
|
|
693
744
|
renderSelectedItem
|
|
694
745
|
} = this.props;
|
|
695
746
|
const {
|
|
747
|
+
showRestTagsPopover,
|
|
748
|
+
restTagsPopoverProps,
|
|
696
749
|
placeholder,
|
|
697
|
-
maxTagCount
|
|
698
|
-
size
|
|
750
|
+
maxTagCount
|
|
699
751
|
} = this.props;
|
|
700
752
|
const {
|
|
701
|
-
inputValue
|
|
753
|
+
inputValue,
|
|
754
|
+
isFullTags
|
|
702
755
|
} = this.state;
|
|
703
|
-
const selectDisabled = this.props.disabled;
|
|
704
756
|
const renderTags = [];
|
|
705
757
|
const selectedItems = [...selections];
|
|
706
758
|
|
|
@@ -711,53 +763,57 @@ class Select extends BaseComponent {
|
|
|
711
763
|
});
|
|
712
764
|
}
|
|
713
765
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
const label = item[0];
|
|
718
|
-
const {
|
|
719
|
-
value
|
|
720
|
-
} = item[1];
|
|
721
|
-
const disabled = item[1].disabled || selectDisabled;
|
|
766
|
+
let mapItems = [];
|
|
767
|
+
let tags = [];
|
|
768
|
+
let tagContent;
|
|
722
769
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
this.foundation.removeTag({
|
|
729
|
-
label,
|
|
730
|
-
value
|
|
731
|
-
});
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
const {
|
|
735
|
-
content,
|
|
736
|
-
isRenderInTag
|
|
737
|
-
} = renderSelectedItem(item[1], {
|
|
738
|
-
index: i,
|
|
739
|
-
disabled,
|
|
740
|
-
onClose
|
|
770
|
+
if (!_isNumber(maxTagCount)) {
|
|
771
|
+
// maxTagCount is not set, all tags are displayed
|
|
772
|
+
mapItems = selectedItems;
|
|
773
|
+
tags = mapItems.map((item, i) => {
|
|
774
|
+
return this.getTagItem(item, i, renderSelectedItem);
|
|
741
775
|
});
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
776
|
+
tagContent = tags;
|
|
777
|
+
} else {
|
|
778
|
+
// maxTagCount is set
|
|
779
|
+
if (showRestTagsPopover) {
|
|
780
|
+
// showRestTagsPopover = true,
|
|
781
|
+
mapItems = isFullTags ? selectedItems : selectedItems.slice(0, maxTagCount);
|
|
782
|
+
tags = mapItems.map((item, i) => {
|
|
783
|
+
return this.getTagItem(item, i, renderSelectedItem);
|
|
784
|
+
});
|
|
785
|
+
const n = selectedItems.length > maxTagCount ? maxTagCount : undefined;
|
|
786
|
+
tagContent = /*#__PURE__*/React.createElement(TagGroup, {
|
|
787
|
+
tagList: tags,
|
|
788
|
+
maxTagCount: n,
|
|
789
|
+
restCount: isFullTags ? undefined : selectedItems.length - maxTagCount,
|
|
790
|
+
size: "large",
|
|
791
|
+
mode: "custom",
|
|
792
|
+
showPopover: showRestTagsPopover,
|
|
793
|
+
popoverProps: restTagsPopoverProps,
|
|
794
|
+
onPlusNMouseEnter: () => {
|
|
795
|
+
this.foundation.updateIsFullTags();
|
|
796
|
+
}
|
|
797
|
+
});
|
|
755
798
|
} else {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
799
|
+
// If maxTagCount is set, showRestTagsPopover is false/undefined,
|
|
800
|
+
// then there is no popover when hovering, no extra Tags are displayed,
|
|
801
|
+
// only the tags and restCount displayed in the trigger need to be passed in
|
|
802
|
+
mapItems = selectedItems.slice(0, maxTagCount);
|
|
803
|
+
const n = selectedItems.length > maxTagCount ? maxTagCount : undefined;
|
|
804
|
+
tags = mapItems.map((item, i) => {
|
|
805
|
+
return this.getTagItem(item, i, renderSelectedItem);
|
|
806
|
+
});
|
|
807
|
+
tagContent = /*#__PURE__*/React.createElement(TagGroup, {
|
|
808
|
+
tagList: tags,
|
|
809
|
+
maxTagCount: n,
|
|
810
|
+
restCount: selectedItems.length - maxTagCount,
|
|
811
|
+
size: "large",
|
|
812
|
+
mode: "custom"
|
|
813
|
+
});
|
|
759
814
|
}
|
|
760
|
-
}
|
|
815
|
+
}
|
|
816
|
+
|
|
761
817
|
const contentWrapperCls = cls({
|
|
762
818
|
["".concat(prefixcls, "-content-wrapper")]: true,
|
|
763
819
|
["".concat(prefixcls, "-content-wrapper-one-line")]: maxTagCount,
|
|
@@ -772,16 +828,6 @@ class Select extends BaseComponent {
|
|
|
772
828
|
const placeholderText = placeholder && !inputValue ? /*#__PURE__*/React.createElement("span", {
|
|
773
829
|
className: spanCls
|
|
774
830
|
}, placeholder) : null;
|
|
775
|
-
const n = selectedItems.length > maxTagCount ? maxTagCount : undefined;
|
|
776
|
-
const NotOneLine = !maxTagCount; // Multiple lines (that is, do not set maxTagCount), do not use TagGroup, directly traverse with Tag, otherwise Input cannot follow the correct position
|
|
777
|
-
|
|
778
|
-
const tagContent = NotOneLine ? tags : /*#__PURE__*/React.createElement(TagGroup, {
|
|
779
|
-
tagList: tags,
|
|
780
|
-
maxTagCount: n,
|
|
781
|
-
restCount: maxTagCount ? selectedItems.length - maxTagCount : undefined,
|
|
782
|
-
size: "large",
|
|
783
|
-
mode: "custom"
|
|
784
|
-
});
|
|
785
831
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
786
832
|
className: contentWrapperCls
|
|
787
833
|
}, tags && tags.length ? tagContent : placeholderText, !filterable ? null : this.renderInput()));
|
|
@@ -1085,7 +1131,7 @@ Select.propTypes = {
|
|
|
1085
1131
|
triggerRender: PropTypes.func,
|
|
1086
1132
|
stopPropagation: PropTypes.bool,
|
|
1087
1133
|
// motion doesn't need to be exposed
|
|
1088
|
-
motion: PropTypes.
|
|
1134
|
+
motion: PropTypes.bool,
|
|
1089
1135
|
onChangeWithObject: PropTypes.bool,
|
|
1090
1136
|
suffix: PropTypes.node,
|
|
1091
1137
|
prefix: PropTypes.node,
|
|
@@ -1155,7 +1201,9 @@ Select.defaultProps = {
|
|
|
1155
1201
|
autoClearSearchValue: true,
|
|
1156
1202
|
arrowIcon: /*#__PURE__*/React.createElement(IconChevronDown, {
|
|
1157
1203
|
"aria-label": ''
|
|
1158
|
-
})
|
|
1204
|
+
}),
|
|
1205
|
+
showRestTagsPopover: false,
|
|
1206
|
+
restTagsPopoverProps: {} // Radio selection is different from the default renderSelectedItem for multiple selection, so it is not declared here
|
|
1159
1207
|
// renderSelectedItem: (optionNode) => optionNode.label,
|
|
1160
1208
|
// The default creator rendering is related to i18, so it is not declared here
|
|
1161
1209
|
// renderCreateItem: (input) => input
|
|
@@ -25,7 +25,7 @@ declare class Option extends PureComponent<OptionProps> {
|
|
|
25
25
|
static propTypes: {
|
|
26
26
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
27
|
disabled: PropTypes.Requireable<boolean>;
|
|
28
|
-
value: PropTypes.Requireable<string | number
|
|
28
|
+
value: PropTypes.Requireable<NonNullable<string | number>>;
|
|
29
29
|
selected: PropTypes.Requireable<boolean>;
|
|
30
30
|
label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
31
31
|
empty: PropTypes.Requireable<boolean>;
|
|
@@ -10,7 +10,7 @@ export interface OptionGroupProps {
|
|
|
10
10
|
declare class OptionGroup extends BaseComponent<OptionGroupProps> {
|
|
11
11
|
static isSelectOptionGroup: boolean;
|
|
12
12
|
static propTypes: {
|
|
13
|
-
children: PropTypes.Requireable<any[] | PropTypes.ReactNodeLike
|
|
13
|
+
children: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
|
14
14
|
label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
15
|
className: PropTypes.Requireable<string>;
|
|
16
16
|
style: PropTypes.Requireable<object>;
|
|
@@ -5,6 +5,7 @@ export interface SideSheetContentProps {
|
|
|
5
5
|
mask?: boolean;
|
|
6
6
|
maskStyle?: CSSProperties;
|
|
7
7
|
maskClosable?: boolean;
|
|
8
|
+
maskClassName?: string;
|
|
8
9
|
title?: React.ReactNode;
|
|
9
10
|
closable?: boolean;
|
|
10
11
|
headerStyle?: CSSProperties;
|
|
@@ -13,9 +14,16 @@ export interface SideSheetContentProps {
|
|
|
13
14
|
style: CSSProperties;
|
|
14
15
|
bodyStyle?: CSSProperties;
|
|
15
16
|
className: string;
|
|
17
|
+
dialogClassName?: string;
|
|
16
18
|
children?: React.ReactNode;
|
|
17
19
|
footer?: React.ReactNode;
|
|
18
20
|
'aria-label'?: string;
|
|
21
|
+
maskExtraProps?: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
wrapperExtraProps?: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
19
27
|
}
|
|
20
28
|
export default class SideSheetContent extends React.PureComponent<SideSheetContentProps> {
|
|
21
29
|
static propTypes: {
|
|
@@ -46,6 +46,8 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
getMaskElement() {
|
|
49
|
+
var _a;
|
|
50
|
+
|
|
49
51
|
const {
|
|
50
52
|
mask,
|
|
51
53
|
maskStyle,
|
|
@@ -53,13 +55,13 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
53
55
|
} = this.props;
|
|
54
56
|
|
|
55
57
|
if (mask) {
|
|
56
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
57
59
|
"aria-hidden": true,
|
|
58
60
|
key: "mask",
|
|
59
|
-
className: "".concat(prefixCls, "-mask"),
|
|
61
|
+
className: cls("".concat(prefixCls, "-mask"), (_a = this.props.maskClassName) !== null && _a !== void 0 ? _a : ""),
|
|
60
62
|
style: maskStyle,
|
|
61
63
|
onClick: maskClosable ? this.onMaskClick : null
|
|
62
|
-
});
|
|
64
|
+
}, this.props.maskExtraProps));
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
return null;
|
|
@@ -101,6 +103,8 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
getDialogElement() {
|
|
106
|
+
var _a;
|
|
107
|
+
|
|
104
108
|
const props = __rest(this.props, []);
|
|
105
109
|
|
|
106
110
|
const style = {};
|
|
@@ -118,14 +122,14 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
const header = this.renderHeader();
|
|
121
|
-
const dialogElement = /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
const dialogElement = /*#__PURE__*/React.createElement("div", Object.assign({
|
|
122
126
|
key: "dialog-element",
|
|
123
127
|
role: "dialog",
|
|
124
128
|
tabIndex: -1,
|
|
125
|
-
className: "".concat(prefixCls, "-inner "
|
|
129
|
+
className: cls("".concat(prefixCls, "-inner"), "".concat(prefixCls, "-inner-wrap"), (_a = this.props.dialogClassName) !== null && _a !== void 0 ? _a : ""),
|
|
126
130
|
// onMouseDown={this.onDialogMouseDown}
|
|
127
131
|
style: Object.assign(Object.assign({}, props.style), style)
|
|
128
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
}, this.props.wrapperExtraProps), /*#__PURE__*/React.createElement("div", {
|
|
129
133
|
className: "".concat(prefixCls, "-content")
|
|
130
134
|
}, header, /*#__PURE__*/React.createElement("div", {
|
|
131
135
|
className: "".concat(prefixCls, "-body"),
|
|
@@ -5,7 +5,6 @@ import { ContextValue } from '../configProvider/context';
|
|
|
5
5
|
import { SideSheetAdapter, SideSheetProps, SideSheetState } from '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheetFoundation';
|
|
6
6
|
import '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheet.css';
|
|
7
7
|
export type { SideSheetContentProps } from './SideSheetContent';
|
|
8
|
-
export type { SideSheetTransitionProps } from './SideSheetTransition';
|
|
9
8
|
export interface SideSheetReactProps extends SideSheetProps {
|
|
10
9
|
bodyStyle?: CSSProperties;
|
|
11
10
|
headerStyle?: CSSProperties;
|
|
@@ -27,18 +26,18 @@ export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSh
|
|
|
27
26
|
closable: PropTypes.Requireable<boolean>;
|
|
28
27
|
disableScroll: PropTypes.Requireable<boolean>;
|
|
29
28
|
getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
-
height: PropTypes.Requireable<string | number
|
|
29
|
+
height: PropTypes.Requireable<NonNullable<string | number>>;
|
|
31
30
|
mask: PropTypes.Requireable<boolean>;
|
|
32
31
|
maskClosable: PropTypes.Requireable<boolean>;
|
|
33
32
|
maskStyle: PropTypes.Requireable<object>;
|
|
34
|
-
motion: PropTypes.Requireable<boolean | object
|
|
33
|
+
motion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
35
34
|
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
35
|
placement: PropTypes.Requireable<string>;
|
|
37
36
|
size: PropTypes.Requireable<string>;
|
|
38
37
|
style: PropTypes.Requireable<object>;
|
|
39
38
|
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
39
|
visible: PropTypes.Requireable<boolean>;
|
|
41
|
-
width: PropTypes.Requireable<string | number
|
|
40
|
+
width: PropTypes.Requireable<NonNullable<string | number>>;
|
|
42
41
|
zIndex: PropTypes.Requireable<number>;
|
|
43
42
|
afterVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
43
|
closeOnEsc: PropTypes.Requireable<boolean>;
|
|
@@ -57,6 +56,7 @@ export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSh
|
|
|
57
56
|
componentWillUnmount(): void;
|
|
58
57
|
handleCancel: (e: React.MouseEvent) => void;
|
|
59
58
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
59
|
+
updateState: () => void;
|
|
60
60
|
renderContent(): JSX.Element;
|
|
61
61
|
render(): JSX.Element;
|
|
62
62
|
}
|
|
@@ -20,10 +20,10 @@ import Portal from '../_portal';
|
|
|
20
20
|
import cls from 'classnames';
|
|
21
21
|
import ConfigContext from '../configProvider/context';
|
|
22
22
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/sideSheet/constants';
|
|
23
|
-
import SideSheetTransition from './SideSheetTransition';
|
|
24
23
|
import SideSheetContent from './SideSheetContent';
|
|
25
24
|
import SideSheetFoundation from '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheetFoundation';
|
|
26
25
|
import '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheet.css';
|
|
26
|
+
import CSSAnimation from "../_cssAnimation";
|
|
27
27
|
const prefixCls = cssClasses.PREFIX;
|
|
28
28
|
const defaultWidthList = strings.WIDTH;
|
|
29
29
|
const defaultHeight = strings.HEIGHT;
|
|
@@ -39,11 +39,17 @@ export default class SideSheet extends BaseComponent {
|
|
|
39
39
|
this.foundation.handleKeyDown(e);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
this.updateState = () => {
|
|
43
|
+
const shouldRender = this.props.visible || this.props.keepDOM;
|
|
44
|
+
this.foundation.setShouldRender(shouldRender);
|
|
45
|
+
this.foundation.toggleDisplayNone(!this.props.visible);
|
|
46
|
+
};
|
|
47
|
+
|
|
42
48
|
this.state = {
|
|
43
|
-
|
|
49
|
+
displayNone: !this.props.visible,
|
|
50
|
+
shouldRender: this.props.visible
|
|
44
51
|
};
|
|
45
52
|
this.foundation = new SideSheetFoundation(this.adapter);
|
|
46
|
-
this._active = false;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
get adapter() {
|
|
@@ -82,10 +88,17 @@ export default class SideSheet extends BaseComponent {
|
|
|
82
88
|
window.removeEventListener('keydown', this.handleKeyDown);
|
|
83
89
|
}
|
|
84
90
|
},
|
|
85
|
-
|
|
86
|
-
if (
|
|
91
|
+
toggleDisplayNone: displayNone => {
|
|
92
|
+
if (displayNone !== this.state.displayNone) {
|
|
93
|
+
this.setState({
|
|
94
|
+
displayNone: displayNone
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
setShouldRender: shouldRender => {
|
|
99
|
+
if (shouldRender !== this.state.shouldRender) {
|
|
87
100
|
this.setState({
|
|
88
|
-
|
|
101
|
+
shouldRender
|
|
89
102
|
});
|
|
90
103
|
}
|
|
91
104
|
}
|
|
@@ -95,12 +108,12 @@ export default class SideSheet extends BaseComponent {
|
|
|
95
108
|
static getDerivedStateFromProps(props, prevState) {
|
|
96
109
|
const newState = {};
|
|
97
110
|
|
|
98
|
-
if (props.visible && prevState.
|
|
99
|
-
newState.
|
|
111
|
+
if (props.visible && prevState.displayNone) {
|
|
112
|
+
newState.displayNone = false;
|
|
100
113
|
}
|
|
101
114
|
|
|
102
|
-
if (!props.visible && !props.motion && !prevState.
|
|
103
|
-
newState.
|
|
115
|
+
if (!props.visible && !props.motion && !prevState.displayNone) {
|
|
116
|
+
newState.displayNone = true;
|
|
104
117
|
}
|
|
105
118
|
|
|
106
119
|
return newState;
|
|
@@ -109,7 +122,6 @@ export default class SideSheet extends BaseComponent {
|
|
|
109
122
|
componentDidMount() {
|
|
110
123
|
if (this.props.visible) {
|
|
111
124
|
this.foundation.beforeShow();
|
|
112
|
-
this._active = this._active || this.props.visible;
|
|
113
125
|
}
|
|
114
126
|
}
|
|
115
127
|
|
|
@@ -123,6 +135,16 @@ export default class SideSheet extends BaseComponent {
|
|
|
123
135
|
if (prevProps.visible && !this.props.visible) {
|
|
124
136
|
this.foundation.afterHide();
|
|
125
137
|
}
|
|
138
|
+
|
|
139
|
+
const shouldRender = this.props.visible || this.props.keepDOM;
|
|
140
|
+
|
|
141
|
+
if (shouldRender === true && this.state.shouldRender === false) {
|
|
142
|
+
this.foundation.setShouldRender(true);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (prevState.displayNone !== this.state.displayNone) {
|
|
146
|
+
this.foundation.onVisibleChange(!this.state.displayNone);
|
|
147
|
+
}
|
|
126
148
|
}
|
|
127
149
|
|
|
128
150
|
componentWillUnmount() {
|
|
@@ -162,7 +184,7 @@ export default class SideSheet extends BaseComponent {
|
|
|
162
184
|
["".concat(prefixCls, "-popup")]: getPopupContainer,
|
|
163
185
|
["".concat(prefixCls, "-horizontal")]: isHorizontal,
|
|
164
186
|
["".concat(prefixCls, "-rtl")]: direction === 'rtl',
|
|
165
|
-
["".concat(prefixCls, "-hidden")]: keepDOM && this.state.
|
|
187
|
+
["".concat(prefixCls, "-hidden")]: keepDOM && this.state.displayNone
|
|
166
188
|
});
|
|
167
189
|
const contentProps = Object.assign(Object.assign({}, props), {
|
|
168
190
|
visible,
|
|
@@ -171,33 +193,41 @@ export default class SideSheet extends BaseComponent {
|
|
|
171
193
|
width: sheetWidth,
|
|
172
194
|
height: sheetHeight,
|
|
173
195
|
onClose: this.handleCancel
|
|
174
|
-
});
|
|
175
|
-
const mergedMotion = this.foundation.getMergedMotion();
|
|
176
|
-
this._active = this._active || visible;
|
|
177
|
-
const shouldRender = (visible || keepDOM) && this._active;
|
|
178
|
-
|
|
179
|
-
if (mergedMotion) {
|
|
180
|
-
return /*#__PURE__*/React.createElement(SideSheetTransition, {
|
|
181
|
-
placement: placement,
|
|
182
|
-
motion: mergedMotion,
|
|
183
|
-
controlled: keepDOM,
|
|
184
|
-
visible: visible
|
|
185
|
-
}, shouldRender ? transitionStyles => /*#__PURE__*/React.createElement(SideSheetContent, Object.assign({}, contentProps, {
|
|
186
|
-
style: Object.assign(Object.assign({}, transitionStyles), style),
|
|
187
|
-
maskStyle: Object.assign({
|
|
188
|
-
opacity: transitionStyles.opacity
|
|
189
|
-
}, maskStyle)
|
|
190
|
-
}), children) : null);
|
|
191
|
-
}
|
|
196
|
+
}); // Since user could change animate duration , we don't know which animation end first. So we call updateState func twice.
|
|
192
197
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
198
|
+
return /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
199
|
+
motion: this.props.motion,
|
|
200
|
+
animationState: visible ? 'enter' : 'leave',
|
|
201
|
+
startClassName: visible ? "".concat(prefixCls, "-animation-mask_show") : "".concat(prefixCls, "-animation-mask_hide"),
|
|
202
|
+
onAnimationEnd: this.updateState
|
|
203
|
+
}, _ref => {
|
|
204
|
+
let {
|
|
205
|
+
animationClassName: maskAnimationClassName,
|
|
206
|
+
animationEventsNeedBind: maskAnimationEventsNeedBind
|
|
207
|
+
} = _ref;
|
|
208
|
+
return /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
209
|
+
motion: this.props.motion,
|
|
210
|
+
animationState: visible ? 'enter' : 'leave',
|
|
211
|
+
startClassName: visible ? "".concat(prefixCls, "-animation-content_show_").concat(this.props.placement) : "".concat(prefixCls, "-animation-content_hide_").concat(this.props.placement),
|
|
212
|
+
onAnimationEnd: this.updateState
|
|
213
|
+
/* for no mask case*/
|
|
199
214
|
|
|
200
|
-
|
|
215
|
+
}, _ref2 => {
|
|
216
|
+
let {
|
|
217
|
+
animationClassName,
|
|
218
|
+
animationStyle,
|
|
219
|
+
animationEventsNeedBind
|
|
220
|
+
} = _ref2;
|
|
221
|
+
return this.state.shouldRender ? /*#__PURE__*/React.createElement(SideSheetContent, Object.assign({}, contentProps, {
|
|
222
|
+
maskExtraProps: maskAnimationEventsNeedBind,
|
|
223
|
+
wrapperExtraProps: animationEventsNeedBind,
|
|
224
|
+
dialogClassName: animationClassName,
|
|
225
|
+
maskClassName: maskAnimationClassName,
|
|
226
|
+
maskStyle: Object.assign({}, maskStyle),
|
|
227
|
+
style: Object.assign(Object.assign({}, animationStyle), style)
|
|
228
|
+
}), children) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
201
231
|
}
|
|
202
232
|
|
|
203
233
|
render() {
|
package/lib/es/slider/index.js
CHANGED
|
@@ -456,8 +456,8 @@ export default class Slider extends BaseComponent {
|
|
|
456
456
|
setOverallVars: (key, value) => {
|
|
457
457
|
this[key] = value;
|
|
458
458
|
},
|
|
459
|
-
getMinHandleEl: () => this.minHanleEl,
|
|
460
|
-
getMaxHandleEl: () => this.maxHanleEl,
|
|
459
|
+
getMinHandleEl: () => this.minHanleEl.current,
|
|
460
|
+
getMaxHandleEl: () => this.maxHanleEl.current,
|
|
461
461
|
onHandleDown: e => {
|
|
462
462
|
this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
|
|
463
463
|
|
package/lib/es/space/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare class Space extends PureComponent<SpaceProps> {
|
|
|
17
17
|
wrap: PropTypes.Requireable<boolean>;
|
|
18
18
|
align: PropTypes.Requireable<string>;
|
|
19
19
|
vertical: PropTypes.Requireable<boolean>;
|
|
20
|
-
spacing: PropTypes.Requireable<string | number | any[]
|
|
20
|
+
spacing: PropTypes.Requireable<NonNullable<string | number | any[]>>;
|
|
21
21
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
22
|
style: PropTypes.Requireable<object>;
|
|
23
23
|
className: PropTypes.Requireable<string>;
|
package/lib/es/spin/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
55
55
|
getCaches(): any;
|
|
56
56
|
setCache(key: any, value: any): void;
|
|
57
57
|
stopPropagation(e: any): void;
|
|
58
|
+
persistEvent: (event: any) => void;
|
|
58
59
|
};
|
|
59
60
|
componentWillUnmount(): void;
|
|
60
61
|
renderSpin(): JSX.Element;
|
package/lib/es/spin/index.js
CHANGED
|
@@ -59,13 +59,10 @@ class Spin extends BaseComponent {
|
|
|
59
59
|
const {
|
|
60
60
|
loading
|
|
61
61
|
} = this.state;
|
|
62
|
-
const spinIconCls = cls({
|
|
63
|
-
["".concat(prefixCls, "-animate")]: loading
|
|
64
|
-
});
|
|
65
62
|
return loading ? /*#__PURE__*/React.createElement("div", {
|
|
66
63
|
className: "".concat(prefixCls, "-wrapper")
|
|
67
64
|
}, indicator ? /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className:
|
|
65
|
+
className: "".concat(prefixCls, "-animate"),
|
|
69
66
|
"x-semi-prop": "indicator"
|
|
70
67
|
}, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", {
|
|
71
68
|
"x-semi-prop": "tip"
|
|
@@ -52,12 +52,12 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
52
52
|
columns: PropTypes.Validator<any[]>;
|
|
53
53
|
components: PropTypes.Validator<object>;
|
|
54
54
|
disabled: PropTypes.Requireable<boolean>;
|
|
55
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
55
|
+
expandIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
56
56
|
expandableRow: PropTypes.Requireable<boolean>;
|
|
57
57
|
expanded: PropTypes.Requireable<boolean>;
|
|
58
58
|
expandedRow: PropTypes.Requireable<boolean>;
|
|
59
|
-
fixed: PropTypes.Requireable<string | boolean
|
|
60
|
-
height: PropTypes.Requireable<string | number
|
|
59
|
+
fixed: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
60
|
+
height: PropTypes.Requireable<NonNullable<string | number>>;
|
|
61
61
|
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
62
62
|
hovered: PropTypes.Validator<boolean>;
|
|
63
63
|
indent: PropTypes.Requireable<number>;
|
|
@@ -78,11 +78,11 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
78
78
|
renderExpandIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
79
|
replaceClassName: PropTypes.Requireable<string>;
|
|
80
80
|
rowExpandable: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
|
-
rowKey: PropTypes.Validator<string | number
|
|
81
|
+
rowKey: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
82
82
|
selected: PropTypes.Requireable<boolean>;
|
|
83
83
|
store: PropTypes.Requireable<object>;
|
|
84
84
|
style: PropTypes.Requireable<object>;
|
|
85
|
-
virtualized: PropTypes.Requireable<boolean | object
|
|
85
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
86
86
|
visible: PropTypes.Validator<boolean>;
|
|
87
87
|
};
|
|
88
88
|
static defaultProps: {
|
|
@@ -36,13 +36,13 @@ export default class TableExpandedRow extends PureComponent<TableExpandedRowProp
|
|
|
36
36
|
components: PropTypes.Requireable<object>;
|
|
37
37
|
defaultExpandAllRows: PropTypes.Requireable<boolean>;
|
|
38
38
|
defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
|
|
39
|
-
expandIcon: PropTypes.Requireable<object | PropTypes.ReactNodeLike
|
|
39
|
+
expandIcon: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
|
40
40
|
expandRowByClick: PropTypes.Requireable<boolean>;
|
|
41
41
|
expanded: PropTypes.Requireable<boolean>;
|
|
42
42
|
expandedRowKeys: PropTypes.Requireable<any[]>;
|
|
43
43
|
expandedRowRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
44
|
indentSize: PropTypes.Requireable<number>;
|
|
45
|
-
index: PropTypes.Requireable<string | number
|
|
45
|
+
index: PropTypes.Requireable<NonNullable<string | number>>;
|
|
46
46
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
47
|
onExpandedRowsChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
@@ -50,7 +50,7 @@ export default class TableExpandedRow extends PureComponent<TableExpandedRowProp
|
|
|
50
50
|
renderExpandIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
51
|
store: PropTypes.Requireable<object>;
|
|
52
52
|
style: PropTypes.Requireable<object>;
|
|
53
|
-
virtualized: PropTypes.Requireable<boolean | object
|
|
53
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
54
54
|
};
|
|
55
55
|
static defaultProps: {
|
|
56
56
|
record: {};
|
|
@@ -34,7 +34,7 @@ declare class SectionRow extends PureComponent<SectionRowProps> {
|
|
|
34
34
|
index: PropTypes.Requireable<number>;
|
|
35
35
|
columns: PropTypes.Requireable<any[]>;
|
|
36
36
|
group: PropTypes.Validator<object>;
|
|
37
|
-
groupKey: PropTypes.Validator<string | number
|
|
37
|
+
groupKey: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
38
38
|
data: PropTypes.Requireable<any[]>;
|
|
39
39
|
renderGroupSection: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
40
|
onGroupedRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -43,12 +43,12 @@ declare class SectionRow extends PureComponent<SectionRowProps> {
|
|
|
43
43
|
expanded: PropTypes.Requireable<boolean>;
|
|
44
44
|
prefixCls: PropTypes.Requireable<string>;
|
|
45
45
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
-
virtualized: PropTypes.Requireable<boolean | object
|
|
46
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
47
47
|
style: PropTypes.Requireable<object>;
|
|
48
48
|
renderExpandIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
49
|
className: PropTypes.Requireable<string>;
|
|
50
50
|
store: PropTypes.Requireable<object>;
|
|
51
|
-
rowKey: PropTypes.Requireable<string | number | ((...args: any[]) => any)
|
|
51
|
+
rowKey: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
52
52
|
};
|
|
53
53
|
static defaultProps: {
|
|
54
54
|
prefixCls: "semi-table";
|