@douyinfe/semi-ui 2.19.0-beta.0 → 2.19.1-alpha.2
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/avatar/index.tsx +1 -3
- package/button/buttonGroup.tsx +4 -38
- package/button/index.tsx +0 -2
- package/checkbox/_story/checkbox.stories.js +0 -2
- package/checkbox/checkbox.tsx +20 -25
- package/checkbox/checkboxGroup.tsx +0 -1
- package/dist/css/semi.css +138 -86
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2931 -15958
- 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/getBabelConfig.js +1 -13
- package/lib/cjs/_base/base.js +1 -3
- package/lib/cjs/_base/baseComponent.js +4 -9
- package/lib/cjs/_base/reactUtils.js +4 -9
- package/lib/cjs/_portal/index.js +4 -9
- package/lib/cjs/_utils/hooks/usePrevFocus.js +3 -6
- package/lib/cjs/_utils/index.js +9 -24
- package/lib/cjs/anchor/anchor-context.js +3 -6
- package/lib/cjs/anchor/index.js +14 -35
- package/lib/cjs/anchor/link.js +7 -16
- package/lib/cjs/autoComplete/index.js +13 -30
- package/lib/cjs/autoComplete/option.js +12 -25
- package/lib/cjs/avatar/avatarGroup.js +18 -49
- package/lib/cjs/avatar/index.d.ts +0 -1
- package/lib/cjs/avatar/index.js +24 -49
- package/lib/cjs/avatar/interface.js +1 -3
- package/lib/cjs/backtop/index.js +8 -17
- package/lib/cjs/badge/index.js +14 -31
- package/lib/cjs/banner/index.js +5 -14
- package/lib/cjs/breadcrumb/bread-context.js +3 -6
- package/lib/cjs/breadcrumb/index.js +13 -34
- package/lib/cjs/breadcrumb/item.js +8 -21
- package/lib/cjs/button/Button.js +13 -32
- package/lib/cjs/button/buttonGroup.d.ts +0 -1
- package/lib/cjs/button/buttonGroup.js +10 -78
- package/lib/cjs/button/index.d.ts +0 -1
- package/lib/cjs/button/index.js +7 -13
- package/lib/cjs/button/splitButtonGroup.js +3 -6
- package/lib/cjs/calendar/dayCalendar.js +20 -37
- package/lib/cjs/calendar/dayCol.js +10 -25
- package/lib/cjs/calendar/index.js +9 -25
- package/lib/cjs/calendar/interface.js +1 -3
- package/lib/cjs/calendar/monthCalendar.js +20 -45
- package/lib/cjs/calendar/rangeCalendar.js +19 -44
- package/lib/cjs/calendar/timeCol.js +10 -25
- package/lib/cjs/calendar/weekCalendar.js +19 -44
- package/lib/cjs/card/cardGroup.js +9 -22
- package/lib/cjs/card/index.js +12 -33
- package/lib/cjs/card/meta.js +9 -22
- package/lib/cjs/carousel/CarouselArrow.js +8 -17
- package/lib/cjs/carousel/CarouselIndicator.js +11 -26
- package/lib/cjs/carousel/index.js +10 -29
- package/lib/cjs/carousel/interface.js +1 -3
- package/lib/cjs/cascader/index.js +37 -68
- package/lib/cjs/cascader/item.js +24 -49
- package/lib/cjs/checkbox/checkbox.d.ts +0 -1
- package/lib/cjs/checkbox/checkbox.js +18 -36
- package/lib/cjs/checkbox/checkboxGroup.js +12 -34
- package/lib/cjs/checkbox/checkboxInner.js +6 -15
- package/lib/cjs/checkbox/context.js +3 -6
- package/lib/cjs/checkbox/index.js +4 -8
- package/lib/cjs/collapse/collapse-context.js +3 -6
- package/lib/cjs/collapse/index.js +12 -29
- package/lib/cjs/collapse/item.js +9 -22
- package/lib/cjs/collapsible/index.js +7 -16
- package/lib/cjs/configProvider/context.js +3 -6
- package/lib/cjs/configProvider/index.js +7 -16
- package/lib/cjs/datePicker/dateInput.js +15 -34
- package/lib/cjs/datePicker/datePicker.js +22 -45
- package/lib/cjs/datePicker/footer.js +3 -6
- package/lib/cjs/datePicker/index.js +9 -20
- package/lib/cjs/datePicker/insetInput.js +4 -9
- package/lib/cjs/datePicker/month.js +15 -26
- package/lib/cjs/datePicker/monthsGrid.js +13 -32
- package/lib/cjs/datePicker/navigation.js +5 -12
- package/lib/cjs/datePicker/quickControl.js +18 -31
- package/lib/cjs/datePicker/yearAndMonth.js +13 -30
- package/lib/cjs/descriptions/descriptions-context.js +3 -6
- package/lib/cjs/descriptions/index.js +8 -23
- package/lib/cjs/descriptions/item.js +7 -18
- package/lib/cjs/divider/index.js +9 -22
- package/lib/cjs/dropdown/context.js +3 -6
- package/lib/cjs/dropdown/dropdownDivider.js +3 -6
- package/lib/cjs/dropdown/dropdownItem.js +8 -21
- package/lib/cjs/dropdown/dropdownMenu.js +8 -17
- package/lib/cjs/dropdown/dropdownTitle.js +5 -12
- package/lib/cjs/dropdown/index.js +12 -25
- package/lib/cjs/empty/index.js +5 -14
- package/lib/cjs/form/arrayField.js +28 -57
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +18 -43
- package/lib/cjs/form/context.js +3 -6
- package/lib/cjs/form/errorMessage.js +7 -18
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/field.js +3 -6
- package/lib/cjs/form/group.js +16 -31
- package/lib/cjs/form/hoc/withField.js +26 -53
- package/lib/cjs/form/hoc/withFormApi.js +4 -9
- package/lib/cjs/form/hoc/withFormState.js +4 -9
- package/lib/cjs/form/hooks/index.js +11 -20
- package/lib/cjs/form/hooks/useArrayFieldState.js +1 -4
- package/lib/cjs/form/hooks/useFieldApi.js +3 -6
- package/lib/cjs/form/hooks/useFieldState.js +6 -15
- package/lib/cjs/form/hooks/useFormApi.js +1 -4
- package/lib/cjs/form/hooks/useFormState.js +1 -4
- package/lib/cjs/form/hooks/useFormUpdater.js +1 -4
- package/lib/cjs/form/hooks/useStateWithGetter.js +1 -4
- package/lib/cjs/form/index.js +15 -34
- package/lib/cjs/form/interface.js +3 -10
- package/lib/cjs/form/label.js +5 -12
- package/lib/cjs/form/section.js +5 -12
- package/lib/cjs/form/slot.js +18 -35
- package/lib/cjs/grid/col.js +20 -37
- package/lib/cjs/grid/index.js +6 -10
- package/lib/cjs/grid/row.js +18 -45
- package/lib/cjs/iconButton/index.js +13 -30
- package/lib/cjs/icons/index.js +3 -6
- package/lib/cjs/index.js +94 -189
- package/lib/cjs/input/index.js +13 -26
- package/lib/cjs/input/inputGroup.js +11 -32
- package/lib/cjs/input/textarea.js +11 -24
- package/lib/cjs/inputNumber/index.js +12 -29
- package/lib/cjs/layout/Sider.js +11 -36
- package/lib/cjs/layout/index.js +13 -32
- package/lib/cjs/layout/layout-context.js +3 -6
- package/lib/cjs/list/index.js +9 -25
- package/lib/cjs/list/item.js +10 -27
- package/lib/cjs/list/list-context.js +3 -6
- package/lib/cjs/locale/context.js +3 -6
- package/lib/cjs/locale/interface.js +1 -3
- package/lib/cjs/locale/localeConsumer.js +5 -12
- package/lib/cjs/locale/localeProvider.js +5 -12
- package/lib/cjs/locale/source/ar.js +1 -4
- package/lib/cjs/locale/source/de.js +1 -4
- package/lib/cjs/locale/source/en_GB.js +1 -4
- package/lib/cjs/locale/source/en_US.js +1 -4
- package/lib/cjs/locale/source/es.js +1 -4
- package/lib/cjs/locale/source/fr.js +1 -4
- package/lib/cjs/locale/source/id_ID.js +1 -4
- package/lib/cjs/locale/source/it.js +1 -4
- package/lib/cjs/locale/source/ja_JP.js +1 -4
- package/lib/cjs/locale/source/ko_KR.js +1 -4
- package/lib/cjs/locale/source/ms_MY.js +1 -4
- package/lib/cjs/locale/source/pt_BR.js +1 -4
- package/lib/cjs/locale/source/ru_RU.js +1 -4
- package/lib/cjs/locale/source/th_TH.js +1 -4
- package/lib/cjs/locale/source/tr_TR.js +1 -4
- package/lib/cjs/locale/source/vi_VN.js +1 -4
- package/lib/cjs/locale/source/zh_CN.js +1 -4
- package/lib/cjs/locale/source/zh_TW.js +1 -4
- package/lib/cjs/modal/ConfirmModal.js +11 -28
- package/lib/cjs/modal/Modal.js +14 -33
- package/lib/cjs/modal/ModalContent.js +14 -35
- package/lib/cjs/modal/confirm.js +15 -21
- package/lib/cjs/modal/index.js +3 -6
- package/lib/cjs/modal/useModal/HookModal.js +10 -19
- package/lib/cjs/modal/useModal/index.js +4 -9
- package/lib/cjs/motions/Rotate.js +7 -18
- package/lib/cjs/navigation/CollapseButton.js +4 -9
- package/lib/cjs/navigation/Footer.js +6 -15
- package/lib/cjs/navigation/Header.js +6 -15
- package/lib/cjs/navigation/Item.js +9 -28
- package/lib/cjs/navigation/OpenIconTransition.js +6 -15
- package/lib/cjs/navigation/SubNav.js +10 -29
- package/lib/cjs/navigation/SubNavTransition.js +5 -12
- package/lib/cjs/navigation/index.js +25 -46
- package/lib/cjs/navigation/nav-context.js +3 -6
- package/lib/cjs/notification/NoticeTransition.js +4 -9
- package/lib/cjs/notification/index.js +24 -51
- package/lib/cjs/notification/notice.js +13 -30
- package/lib/cjs/notification/useNotification/HookNotice.js +9 -22
- package/lib/cjs/notification/useNotification/index.js +18 -41
- package/lib/cjs/overflowList/index.js +13 -28
- package/lib/cjs/overflowList/intersectionObserver.js +7 -18
- package/lib/cjs/pagination/index.js +15 -38
- package/lib/cjs/popconfirm/index.d.ts +2 -4
- package/lib/cjs/popconfirm/index.js +41 -68
- package/lib/cjs/popover/Arrow.js +10 -19
- package/lib/cjs/popover/index.js +8 -17
- package/lib/cjs/progress/index.js +7 -20
- package/lib/cjs/radio/context.js +3 -6
- package/lib/cjs/radio/index.js +4 -8
- package/lib/cjs/radio/radio.d.ts +0 -1
- package/lib/cjs/radio/radio.js +23 -41
- package/lib/cjs/radio/radioGroup.js +12 -27
- package/lib/cjs/radio/radioInner.js +7 -16
- package/lib/cjs/rating/index.js +10 -27
- package/lib/cjs/rating/item.js +10 -19
- package/lib/cjs/resizeObserver/index.js +3 -6
- package/lib/cjs/scrollList/index.js +3 -6
- package/lib/cjs/scrollList/scrollItem.js +13 -26
- package/lib/cjs/select/index.js +46 -91
- package/lib/cjs/select/option.js +12 -25
- package/lib/cjs/select/optionGroup.js +3 -6
- package/lib/cjs/select/utils.js +12 -29
- package/lib/cjs/select/virtualRow.js +1 -4
- package/lib/cjs/sideSheet/SideSheetContent.js +9 -22
- package/lib/cjs/sideSheet/SideSheetTransition.js +4 -9
- package/lib/cjs/sideSheet/index.js +15 -28
- package/lib/cjs/skeleton/index.js +9 -22
- package/lib/cjs/skeleton/item.js +13 -34
- package/lib/cjs/slider/index.js +18 -48
- package/lib/cjs/space/index.js +7 -20
- package/lib/cjs/space/utils.js +9 -24
- package/lib/cjs/spin/icon.js +7 -16
- package/lib/cjs/spin/index.js +5 -14
- package/lib/cjs/steps/basicStep.js +4 -11
- package/lib/cjs/steps/basicSteps.js +12 -29
- package/lib/cjs/steps/context.js +3 -6
- package/lib/cjs/steps/fillStep.js +4 -11
- package/lib/cjs/steps/fillSteps.js +12 -28
- package/lib/cjs/steps/index.js +11 -24
- package/lib/cjs/steps/navStep.js +3 -6
- package/lib/cjs/steps/navSteps.js +12 -28
- package/lib/cjs/steps/step.js +8 -17
- package/lib/cjs/switch/index.js +5 -10
- package/lib/cjs/table/Body/BaseRow.js +14 -27
- package/lib/cjs/table/Body/ExpandedRow.js +10 -23
- package/lib/cjs/table/Body/SectionRow.js +15 -36
- package/lib/cjs/table/Body/index.js +39 -64
- package/lib/cjs/table/ColGroup.js +4 -11
- package/lib/cjs/table/Column.js +4 -9
- package/lib/cjs/table/ColumnFilter.js +18 -41
- package/lib/cjs/table/ColumnSelection.js +6 -11
- package/lib/cjs/table/ColumnShape.js +3 -6
- package/lib/cjs/table/ColumnSorter.js +6 -15
- package/lib/cjs/table/CustomExpandIcon.js +5 -12
- package/lib/cjs/table/HeadTable.js +7 -14
- package/lib/cjs/table/ResizableHeaderCell.js +9 -22
- package/lib/cjs/table/ResizableTable.js +23 -40
- package/lib/cjs/table/Table.js +63 -96
- package/lib/cjs/table/TableCell.js +13 -26
- package/lib/cjs/table/TableContextProvider.js +5 -12
- package/lib/cjs/table/TableHeader.js +10 -27
- package/lib/cjs/table/TableHeaderRow.js +18 -33
- package/lib/cjs/table/TablePagination.js +6 -15
- package/lib/cjs/table/getColumns.js +8 -17
- package/lib/cjs/table/index.js +8 -20
- package/lib/cjs/table/interface.js +1 -3
- package/lib/cjs/table/table-context.js +3 -6
- package/lib/cjs/table/utils.js +5 -16
- package/lib/cjs/tabs/TabBar.js +21 -44
- package/lib/cjs/tabs/TabPane.js +14 -31
- package/lib/cjs/tabs/TabPaneTransition.js +5 -10
- package/lib/cjs/tabs/index.js +32 -73
- package/lib/cjs/tabs/interface.js +1 -3
- package/lib/cjs/tabs/tabs-context.js +3 -6
- package/lib/cjs/tag/group.js +10 -23
- package/lib/cjs/tag/index.d.ts +1 -1
- package/lib/cjs/tag/index.js +20 -48
- package/lib/cjs/tag/interface.js +1 -3
- package/lib/cjs/tagInput/index.js +13 -30
- package/lib/cjs/timePicker/Combobox.js +19 -40
- package/lib/cjs/timePicker/PanelShape.js +3 -6
- package/lib/cjs/timePicker/TimeInput.js +9 -20
- package/lib/cjs/timePicker/TimePicker.js +21 -38
- package/lib/cjs/timePicker/TimeShape.js +3 -6
- package/lib/cjs/timePicker/index.js +4 -9
- package/lib/cjs/timeline/index.js +21 -48
- package/lib/cjs/timeline/item.js +7 -20
- package/lib/cjs/toast/ToastTransition.js +4 -9
- package/lib/cjs/toast/index.js +20 -45
- package/lib/cjs/toast/toast.js +9 -20
- package/lib/cjs/toast/useToast/HookToast.js +9 -22
- package/lib/cjs/toast/useToast/index.js +14 -27
- package/lib/cjs/tooltip/ArrowBoundingShape.js +3 -6
- package/lib/cjs/tooltip/TooltipStyledTransition.js +4 -9
- package/lib/cjs/tooltip/TriangleArrow.js +7 -16
- package/lib/cjs/tooltip/TriangleArrowVertical.js +7 -16
- package/lib/cjs/tooltip/index.js +25 -46
- package/lib/cjs/transfer/index.js +30 -63
- package/lib/cjs/tree/autoSizer.js +7 -16
- package/lib/cjs/tree/collapse.js +7 -16
- package/lib/cjs/tree/index.js +46 -70
- package/lib/cjs/tree/interface.js +1 -3
- package/lib/cjs/tree/nodeList.js +11 -28
- package/lib/cjs/tree/treeContext.js +3 -6
- package/lib/cjs/tree/treeNode.js +20 -39
- package/lib/cjs/tree/treeUtil.js +3 -6
- package/lib/cjs/treeSelect/index.js +51 -80
- package/lib/cjs/trigger/index.js +7 -16
- package/lib/cjs/typography/base.js +24 -49
- package/lib/cjs/typography/copyable.js +5 -12
- package/lib/cjs/typography/index.js +5 -15
- package/lib/cjs/typography/interface.js +1 -3
- package/lib/cjs/typography/paragraph.js +6 -15
- package/lib/cjs/typography/text.js +6 -15
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/typography/title.js +10 -25
- package/lib/cjs/typography/typography.js +9 -22
- package/lib/cjs/typography/util.js +8 -21
- package/lib/cjs/upload/fileCard.js +8 -17
- package/lib/cjs/upload/index.js +14 -25
- package/lib/cjs/upload/interface.js +1 -3
- package/lib/es/_base/baseComponent.js +1 -3
- package/lib/es/_portal/index.js +1 -2
- package/lib/es/_utils/index.js +6 -15
- package/lib/es/anchor/index.js +11 -30
- package/lib/es/anchor/link.js +4 -8
- package/lib/es/autoComplete/index.js +10 -21
- package/lib/es/autoComplete/option.js +7 -10
- package/lib/es/avatar/avatarGroup.js +13 -33
- package/lib/es/avatar/index.d.ts +0 -1
- package/lib/es/avatar/index.js +19 -32
- package/lib/es/backtop/index.js +5 -9
- package/lib/es/badge/index.js +7 -13
- package/lib/es/banner/index.js +2 -7
- package/lib/es/breadcrumb/index.js +10 -27
- package/lib/es/breadcrumb/item.js +3 -7
- package/lib/es/button/Button.js +8 -16
- package/lib/es/button/buttonGroup.d.ts +0 -1
- package/lib/es/button/buttonGroup.js +5 -60
- package/lib/es/button/index.d.ts +0 -1
- package/lib/es/button/index.js +4 -7
- package/lib/es/calendar/dayCalendar.js +15 -30
- package/lib/es/calendar/dayCol.js +5 -16
- package/lib/es/calendar/index.js +4 -8
- package/lib/es/calendar/monthCalendar.js +15 -35
- package/lib/es/calendar/rangeCalendar.js +14 -36
- package/lib/es/calendar/timeCol.js +3 -12
- package/lib/es/calendar/weekCalendar.js +14 -36
- package/lib/es/card/cardGroup.js +4 -8
- package/lib/es/card/index.js +7 -15
- package/lib/es/card/meta.js +4 -8
- package/lib/es/carousel/CarouselArrow.js +5 -9
- package/lib/es/carousel/CarouselIndicator.js +8 -17
- package/lib/es/carousel/index.js +5 -13
- package/lib/es/cascader/index.js +30 -55
- package/lib/es/cascader/item.js +17 -33
- package/lib/es/checkbox/checkbox.d.ts +0 -1
- package/lib/es/checkbox/checkbox.js +13 -27
- package/lib/es/checkbox/checkboxGroup.js +7 -23
- package/lib/es/checkbox/checkboxInner.js +1 -2
- package/lib/es/collapse/index.js +9 -17
- package/lib/es/collapse/item.js +4 -8
- package/lib/es/collapsible/index.js +2 -4
- package/lib/es/configProvider/index.js +4 -8
- package/lib/es/datePicker/dateInput.js +12 -27
- package/lib/es/datePicker/datePicker.js +17 -35
- package/lib/es/datePicker/index.js +4 -10
- package/lib/es/datePicker/insetInput.js +1 -2
- package/lib/es/datePicker/month.js +12 -18
- package/lib/es/datePicker/monthsGrid.js +10 -26
- package/lib/es/datePicker/quickControl.js +13 -18
- package/lib/es/datePicker/yearAndMonth.js +10 -22
- package/lib/es/descriptions/index.js +3 -8
- package/lib/es/descriptions/item.js +2 -5
- package/lib/es/divider/index.js +6 -13
- package/lib/es/dropdown/dropdownItem.js +3 -10
- package/lib/es/dropdown/dropdownMenu.js +5 -9
- package/lib/es/dropdown/index.js +9 -16
- package/lib/es/empty/index.js +2 -6
- package/lib/es/form/arrayField.js +20 -42
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +11 -28
- package/lib/es/form/errorMessage.js +2 -6
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/group.js +7 -16
- package/lib/es/form/hoc/withField.js +21 -41
- package/lib/es/form/hoc/withFormApi.js +1 -2
- package/lib/es/form/hoc/withFormState.js +1 -2
- package/lib/es/form/hooks/useFieldState.js +1 -2
- package/lib/es/form/slot.js +11 -18
- package/lib/es/grid/col.js +17 -29
- package/lib/es/grid/row.js +15 -36
- package/lib/es/iconButton/index.js +8 -14
- package/lib/es/input/index.js +10 -17
- package/lib/es/input/inputGroup.js +8 -20
- package/lib/es/input/textarea.js +8 -15
- package/lib/es/inputNumber/index.js +9 -18
- package/lib/es/layout/Sider.js +8 -26
- package/lib/es/layout/index.js +10 -22
- package/lib/es/list/index.js +5 -18
- package/lib/es/list/item.js +5 -11
- package/lib/es/modal/ConfirmModal.js +6 -13
- package/lib/es/modal/Modal.js +9 -16
- package/lib/es/modal/ModalContent.js +9 -21
- package/lib/es/modal/confirm.js +11 -15
- package/lib/es/modal/useModal/HookModal.js +7 -10
- package/lib/es/modal/useModal/index.js +1 -2
- package/lib/es/motions/Rotate.js +2 -4
- package/lib/es/navigation/CollapseButton.js +1 -2
- package/lib/es/navigation/Footer.js +1 -2
- package/lib/es/navigation/Header.js +1 -2
- package/lib/es/navigation/Item.js +6 -19
- package/lib/es/navigation/OpenIconTransition.js +1 -2
- package/lib/es/navigation/SubNav.js +7 -20
- package/lib/es/navigation/index.js +20 -35
- package/lib/es/notification/NoticeTransition.js +1 -2
- package/lib/es/notification/index.js +19 -40
- package/lib/es/notification/notice.js +8 -17
- package/lib/es/notification/useNotification/HookNotice.js +4 -8
- package/lib/es/notification/useNotification/index.js +13 -26
- package/lib/es/overflowList/index.js +10 -18
- package/lib/es/overflowList/intersectionObserver.js +4 -10
- package/lib/es/pagination/index.js +10 -28
- package/lib/es/popconfirm/index.d.ts +2 -4
- package/lib/es/popconfirm/index.js +38 -59
- package/lib/es/popover/Arrow.js +7 -11
- package/lib/es/popover/index.js +5 -8
- package/lib/es/progress/index.js +2 -8
- package/lib/es/radio/radio.d.ts +0 -1
- package/lib/es/radio/radio.js +18 -31
- package/lib/es/radio/radioGroup.js +7 -16
- package/lib/es/radio/radioInner.js +2 -6
- package/lib/es/rating/index.js +5 -18
- package/lib/es/rating/item.js +7 -11
- package/lib/es/scrollList/scrollItem.js +8 -14
- package/lib/es/select/index.js +38 -76
- package/lib/es/select/option.js +7 -10
- package/lib/es/select/utils.js +9 -22
- package/lib/es/sideSheet/SideSheetContent.js +6 -12
- package/lib/es/sideSheet/SideSheetTransition.js +1 -2
- package/lib/es/sideSheet/index.js +10 -18
- package/lib/es/skeleton/index.js +4 -8
- package/lib/es/skeleton/item.js +8 -18
- package/lib/es/slider/index.js +15 -36
- package/lib/es/space/index.js +2 -8
- package/lib/es/space/utils.js +4 -11
- package/lib/es/spin/icon.js +4 -8
- package/lib/es/spin/index.js +2 -6
- package/lib/es/steps/basicStep.js +1 -4
- package/lib/es/steps/basicSteps.js +6 -17
- package/lib/es/steps/fillStep.js +1 -4
- package/lib/es/steps/fillSteps.js +5 -17
- package/lib/es/steps/index.js +6 -9
- package/lib/es/steps/navSteps.js +5 -17
- package/lib/es/steps/step.js +3 -4
- package/lib/es/switch/index.js +2 -3
- package/lib/es/table/Body/BaseRow.js +9 -14
- package/lib/es/table/Body/ExpandedRow.js +5 -8
- package/lib/es/table/Body/SectionRow.js +10 -18
- package/lib/es/table/Body/index.js +34 -56
- package/lib/es/table/ColGroup.js +1 -5
- package/lib/es/table/Column.js +1 -2
- package/lib/es/table/ColumnFilter.js +13 -30
- package/lib/es/table/ColumnSelection.js +3 -4
- package/lib/es/table/ColumnSorter.js +1 -2
- package/lib/es/table/HeadTable.js +4 -6
- package/lib/es/table/ResizableHeaderCell.js +6 -13
- package/lib/es/table/ResizableTable.js +18 -36
- package/lib/es/table/Table.js +56 -76
- package/lib/es/table/TableCell.js +8 -13
- package/lib/es/table/TableHeader.js +7 -18
- package/lib/es/table/TableHeaderRow.js +13 -21
- package/lib/es/table/TablePagination.js +1 -2
- package/lib/es/table/getColumns.js +3 -10
- package/lib/es/table/index.js +3 -4
- package/lib/es/table/utils.js +1 -7
- package/lib/es/tabs/TabBar.js +18 -36
- package/lib/es/tabs/TabPane.js +9 -18
- package/lib/es/tabs/TabPaneTransition.js +2 -3
- package/lib/es/tabs/index.js +22 -48
- package/lib/es/tag/group.js +5 -13
- package/lib/es/tag/index.d.ts +1 -1
- package/lib/es/tag/index.js +13 -24
- package/lib/es/tagInput/index.js +10 -21
- package/lib/es/timePicker/Combobox.js +14 -23
- package/lib/es/timePicker/TimeInput.js +6 -10
- package/lib/es/timePicker/TimePicker.js +16 -27
- package/lib/es/timePicker/index.js +1 -2
- package/lib/es/timeline/index.js +14 -32
- package/lib/es/timeline/item.js +2 -6
- package/lib/es/toast/ToastTransition.js +1 -2
- package/lib/es/toast/index.js +17 -37
- package/lib/es/toast/toast.js +4 -10
- package/lib/es/toast/useToast/HookToast.js +4 -8
- package/lib/es/toast/useToast/index.js +11 -18
- package/lib/es/tooltip/TooltipStyledTransition.js +1 -3
- package/lib/es/tooltip/TriangleArrow.js +4 -8
- package/lib/es/tooltip/TriangleArrowVertical.js +4 -8
- package/lib/es/tooltip/index.js +18 -29
- package/lib/es/transfer/index.js +24 -47
- package/lib/es/tree/autoSizer.js +2 -3
- package/lib/es/tree/collapse.js +2 -5
- package/lib/es/tree/index.js +41 -48
- package/lib/es/tree/nodeList.js +6 -17
- package/lib/es/tree/treeNode.js +15 -23
- package/lib/es/treeSelect/index.js +44 -62
- package/lib/es/trigger/index.js +4 -8
- package/lib/es/typography/base.js +19 -34
- package/lib/es/typography/copyable.js +2 -4
- package/lib/es/typography/paragraph.js +1 -2
- package/lib/es/typography/text.js +1 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/title.js +5 -11
- package/lib/es/typography/typography.js +4 -8
- package/lib/es/typography/util.js +5 -15
- package/lib/es/upload/fileCard.js +3 -4
- package/lib/es/upload/index.js +11 -16
- package/package.json +8 -9
- package/popconfirm/_story/popconfirm.stories.js +1 -37
- package/popconfirm/index.tsx +6 -14
- package/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +19 -22
- package/radio/radioGroup.tsx +1 -1
- package/tag/index.tsx +1 -1
- package/treeSelect/_story/treeSelect.stories.js +0 -3
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
14
|
-
|
|
15
|
-
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
16
|
-
|
|
17
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
18
|
-
|
|
19
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
20
|
-
|
|
21
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
22
|
-
|
|
23
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
24
|
-
|
|
25
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
26
|
-
|
|
27
|
-
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
28
|
-
|
|
29
8
|
var _react = _interopRequireDefault(require("react"));
|
|
30
9
|
|
|
31
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
@@ -34,7 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
34
13
|
|
|
35
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
36
15
|
|
|
37
|
-
var
|
|
16
|
+
var _context = _interopRequireDefault(require("../configProvider/context"));
|
|
38
17
|
|
|
39
18
|
var _notificationListFoundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/notification/notificationListFoundation"));
|
|
40
19
|
|
|
@@ -52,6 +31,8 @@ var _uuid = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/ut
|
|
|
52
31
|
|
|
53
32
|
var _useNotification = _interopRequireDefault(require("./useNotification"));
|
|
54
33
|
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
+
|
|
55
36
|
let ref = null;
|
|
56
37
|
const defaultConfig = {
|
|
57
38
|
duration: 3,
|
|
@@ -92,16 +73,16 @@ class NotificationList extends _baseComponent.default {
|
|
|
92
73
|
key: position,
|
|
93
74
|
className: className,
|
|
94
75
|
style: style
|
|
95
|
-
},
|
|
76
|
+
}, notices.map((notice, index) => notice.motion ? /*#__PURE__*/_react.default.createElement(_NoticeTransition.default, {
|
|
96
77
|
key: notice.id || index,
|
|
97
78
|
position: position,
|
|
98
79
|
motion: notice.motion
|
|
99
|
-
},
|
|
100
|
-
style:
|
|
80
|
+
}, removedItems.find(item => item.id === notice.id) ? null : transitionStyle => /*#__PURE__*/_react.default.createElement(_notice.default, Object.assign({}, notice, {
|
|
81
|
+
style: Object.assign(Object.assign({}, transitionStyle), notice.style),
|
|
101
82
|
key: notice.id,
|
|
102
83
|
close: _this.remove
|
|
103
|
-
}))) : /*#__PURE__*/_react.default.createElement(_notice.default,
|
|
104
|
-
style:
|
|
84
|
+
}))) : /*#__PURE__*/_react.default.createElement(_notice.default, Object.assign({}, notice, {
|
|
85
|
+
style: Object.assign({}, notice.style),
|
|
105
86
|
key: notice.id,
|
|
106
87
|
close: _this.remove
|
|
107
88
|
}))))
|
|
@@ -123,7 +104,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
123
104
|
get adapter() {
|
|
124
105
|
var _this2 = this;
|
|
125
106
|
|
|
126
|
-
return
|
|
107
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
127
108
|
updateNotices: function (notices) {
|
|
128
109
|
let removedItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
129
110
|
_this2.noticeStorage = [...notices];
|
|
@@ -148,9 +129,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
148
129
|
const div = document.createElement('div');
|
|
149
130
|
|
|
150
131
|
if (!this.wrapperId) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.wrapperId = (0, _slice.default)(_context = (0, _uuid.default)('notification-wrapper')).call(_context, 0, 32);
|
|
132
|
+
this.wrapperId = (0, _uuid.default)('notification-wrapper').slice(0, 32);
|
|
154
133
|
}
|
|
155
134
|
|
|
156
135
|
div.className = _constants.cssClasses.WRAPPER;
|
|
@@ -167,12 +146,12 @@ class NotificationList extends _baseComponent.default {
|
|
|
167
146
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(NotificationList, {
|
|
168
147
|
ref: instance => ref = instance
|
|
169
148
|
}), div, () => {
|
|
170
|
-
ref.add(
|
|
149
|
+
ref.add(Object.assign(Object.assign({}, notice), {
|
|
171
150
|
id
|
|
172
151
|
}));
|
|
173
152
|
});
|
|
174
153
|
} else {
|
|
175
|
-
ref.add(
|
|
154
|
+
ref.add(Object.assign(Object.assign({}, notice), {
|
|
176
155
|
id
|
|
177
156
|
}));
|
|
178
157
|
}
|
|
@@ -189,31 +168,31 @@ class NotificationList extends _baseComponent.default {
|
|
|
189
168
|
}
|
|
190
169
|
|
|
191
170
|
static info(opts) {
|
|
192
|
-
return this.addNotice(
|
|
171
|
+
return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
|
|
193
172
|
type: 'info'
|
|
194
173
|
}));
|
|
195
174
|
}
|
|
196
175
|
|
|
197
176
|
static success(opts) {
|
|
198
|
-
return this.addNotice(
|
|
177
|
+
return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
|
|
199
178
|
type: 'success'
|
|
200
179
|
}));
|
|
201
180
|
}
|
|
202
181
|
|
|
203
182
|
static error(opts) {
|
|
204
|
-
return this.addNotice(
|
|
183
|
+
return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
|
|
205
184
|
type: 'error'
|
|
206
185
|
}));
|
|
207
186
|
}
|
|
208
187
|
|
|
209
188
|
static warning(opts) {
|
|
210
|
-
return this.addNotice(
|
|
189
|
+
return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
|
|
211
190
|
type: 'warning'
|
|
212
191
|
}));
|
|
213
192
|
}
|
|
214
193
|
|
|
215
194
|
static open(opts) {
|
|
216
|
-
return this.addNotice(
|
|
195
|
+
return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
|
|
217
196
|
type: 'default'
|
|
218
197
|
}));
|
|
219
198
|
}
|
|
@@ -236,9 +215,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
236
215
|
}
|
|
237
216
|
|
|
238
217
|
static config(opts) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(0, _map.default)(_context2 = ['top', 'left', 'bottom', 'right']).call(_context2, pos => {
|
|
218
|
+
['top', 'left', 'bottom', 'right'].map(pos => {
|
|
242
219
|
if (pos in opts) {
|
|
243
220
|
defaultConfig[pos] = opts[pos];
|
|
244
221
|
}
|
|
@@ -258,10 +235,8 @@ class NotificationList extends _baseComponent.default {
|
|
|
258
235
|
}
|
|
259
236
|
|
|
260
237
|
setPosInStyle(noticeInstance) {
|
|
261
|
-
var _context3;
|
|
262
|
-
|
|
263
238
|
const style = {};
|
|
264
|
-
|
|
239
|
+
['top', 'left', 'bottom', 'right'].forEach(pos => {
|
|
265
240
|
if (pos in noticeInstance) {
|
|
266
241
|
const val = noticeInstance[pos];
|
|
267
242
|
style[pos] = typeof val === 'number' ? "".concat(val, "px") : val;
|
|
@@ -271,15 +246,13 @@ class NotificationList extends _baseComponent.default {
|
|
|
271
246
|
}
|
|
272
247
|
|
|
273
248
|
render() {
|
|
274
|
-
var _context4;
|
|
275
|
-
|
|
276
249
|
let {
|
|
277
250
|
notices
|
|
278
251
|
} = this.state;
|
|
279
252
|
const {
|
|
280
253
|
removedItems
|
|
281
254
|
} = this.state;
|
|
282
|
-
notices =
|
|
255
|
+
notices = Array.from(new Set([...notices, ...removedItems]));
|
|
283
256
|
const noticesInPosition = {
|
|
284
257
|
top: [],
|
|
285
258
|
topLeft: [],
|
|
@@ -288,13 +261,13 @@ class NotificationList extends _baseComponent.default {
|
|
|
288
261
|
bottomLeft: [],
|
|
289
262
|
bottomRight: []
|
|
290
263
|
};
|
|
291
|
-
|
|
264
|
+
notices.forEach(notice => {
|
|
292
265
|
const direction = notice.direction || this.context.direction;
|
|
293
266
|
const defaultPosition = direction === 'rtl' ? 'topLeft' : 'topRight';
|
|
294
267
|
const position = notice.position || defaultPosition;
|
|
295
268
|
noticesInPosition[position].push(notice);
|
|
296
269
|
});
|
|
297
|
-
const noticesList =
|
|
270
|
+
const noticesList = Object.entries(noticesInPosition).map(obj => {
|
|
298
271
|
const pos = obj[0];
|
|
299
272
|
const noticesInPos = obj[1];
|
|
300
273
|
return this.renderNoticeInPosition(noticesInPos, pos, removedItems);
|
|
@@ -304,7 +277,7 @@ class NotificationList extends _baseComponent.default {
|
|
|
304
277
|
|
|
305
278
|
}
|
|
306
279
|
|
|
307
|
-
NotificationList.contextType =
|
|
280
|
+
NotificationList.contextType = _context.default;
|
|
308
281
|
NotificationList.propTypes = {
|
|
309
282
|
style: _propTypes.default.object,
|
|
310
283
|
className: _propTypes.default.string,
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
14
|
-
|
|
15
|
-
var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
|
|
16
|
-
|
|
17
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
18
|
-
|
|
19
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
20
|
-
|
|
21
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
22
|
-
|
|
23
8
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
24
9
|
|
|
25
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -28,7 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
28
13
|
|
|
29
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
30
15
|
|
|
31
|
-
var
|
|
16
|
+
var _context = _interopRequireDefault(require("../configProvider/context"));
|
|
32
17
|
|
|
33
18
|
var _constants = require("@douyinfe/semi-foundation/lib/cjs/notification/constants");
|
|
34
19
|
|
|
@@ -44,13 +29,15 @@ var _semiIcons = require("@douyinfe/semi-icons");
|
|
|
44
29
|
|
|
45
30
|
var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
|
|
46
31
|
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
47
34
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
48
35
|
var t = {};
|
|
49
36
|
|
|
50
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) &&
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
51
38
|
|
|
52
|
-
if (s != null && typeof
|
|
53
|
-
if (
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
54
41
|
}
|
|
55
42
|
return t;
|
|
56
43
|
};
|
|
@@ -95,7 +82,7 @@ class Notice extends _baseComponent.default {
|
|
|
95
82
|
}
|
|
96
83
|
|
|
97
84
|
get adapter() {
|
|
98
|
-
return
|
|
85
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
99
86
|
notifyWrapperToRemove: id => {
|
|
100
87
|
this.props.close(id);
|
|
101
88
|
},
|
|
@@ -111,8 +98,6 @@ class Notice extends _baseComponent.default {
|
|
|
111
98
|
}
|
|
112
99
|
|
|
113
100
|
renderTypeIcon() {
|
|
114
|
-
var _context;
|
|
115
|
-
|
|
116
101
|
const {
|
|
117
102
|
type,
|
|
118
103
|
icon
|
|
@@ -134,7 +119,7 @@ class Notice extends _baseComponent.default {
|
|
|
134
119
|
let iconType = iconMap[type];
|
|
135
120
|
const iconCls = (0, _classnames.default)({
|
|
136
121
|
["".concat(prefixCls, "-icon")]: true,
|
|
137
|
-
[
|
|
122
|
+
["".concat(prefixCls, "-").concat(type)]: true
|
|
138
123
|
});
|
|
139
124
|
|
|
140
125
|
if (icon) {
|
|
@@ -154,8 +139,6 @@ class Notice extends _baseComponent.default {
|
|
|
154
139
|
}
|
|
155
140
|
|
|
156
141
|
render() {
|
|
157
|
-
var _context2, _context3;
|
|
158
|
-
|
|
159
142
|
const direction = this.props.direction || this.context.direction;
|
|
160
143
|
const defaultPosition = direction === 'rtl' ? 'topLeft' : 'topRight';
|
|
161
144
|
|
|
@@ -179,9 +162,9 @@ class Notice extends _baseComponent.default {
|
|
|
179
162
|
} = this.state;
|
|
180
163
|
const wrapper = (0, _classnames.default)(prefixCls, className, {
|
|
181
164
|
["".concat(prefixCls, "-close")]: !visible,
|
|
182
|
-
["".concat(prefixCls, "-icon-show")]:
|
|
183
|
-
[
|
|
184
|
-
[
|
|
165
|
+
["".concat(prefixCls, "-icon-show")]: types.includes(type),
|
|
166
|
+
["".concat(prefixCls, "-").concat(type)]: true,
|
|
167
|
+
["".concat(prefixCls, "-").concat(theme)]: theme === 'light',
|
|
185
168
|
["".concat(prefixCls, "-rtl")]: direction === 'rtl'
|
|
186
169
|
});
|
|
187
170
|
const titleID = (0, _uuid.getUuidShort)({});
|
|
@@ -220,7 +203,7 @@ class Notice extends _baseComponent.default {
|
|
|
220
203
|
|
|
221
204
|
}
|
|
222
205
|
|
|
223
|
-
Notice.contextType =
|
|
206
|
+
Notice.contextType = _context.default;
|
|
224
207
|
Notice.propTypes = {
|
|
225
208
|
duration: _propTypes.default.number,
|
|
226
209
|
id: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
-
|
|
7
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
8
|
-
|
|
9
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
10
|
-
|
|
11
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
4
|
value: true
|
|
13
5
|
});
|
|
14
|
-
|
|
15
6
|
exports.default = void 0;
|
|
16
7
|
|
|
17
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
18
|
-
|
|
19
|
-
var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
|
|
20
|
-
|
|
21
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
22
|
-
|
|
23
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
24
9
|
|
|
25
10
|
var _notice = _interopRequireDefault(require("../notice"));
|
|
26
11
|
|
|
27
|
-
function
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
28
15
|
|
|
29
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor =
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
17
|
|
|
31
18
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
32
19
|
var t = {};
|
|
33
20
|
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) &&
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
35
22
|
|
|
36
|
-
if (s != null && typeof
|
|
37
|
-
if (
|
|
23
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
38
25
|
}
|
|
39
26
|
return t;
|
|
40
27
|
};
|
|
@@ -62,7 +49,7 @@ const HookNotice = (_a, ref) => {
|
|
|
62
49
|
afterClose(String(config.id));
|
|
63
50
|
}
|
|
64
51
|
}, [visible]);
|
|
65
|
-
return visible ? /*#__PURE__*/_react.default.createElement(_notice.default,
|
|
52
|
+
return visible ? /*#__PURE__*/_react.default.createElement(_notice.default, Object.assign({}, config, {
|
|
66
53
|
onHookClose: close
|
|
67
54
|
})) : null;
|
|
68
55
|
};
|
|
@@ -1,33 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
-
|
|
7
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
8
|
-
|
|
9
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
10
|
-
|
|
11
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
4
|
value: true
|
|
13
5
|
});
|
|
14
|
-
|
|
15
6
|
exports.default = useNotification;
|
|
16
7
|
|
|
17
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
18
|
-
|
|
19
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
20
|
-
|
|
21
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
|
-
|
|
23
|
-
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
24
|
-
|
|
25
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
26
|
-
|
|
27
|
-
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
28
|
-
|
|
29
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
30
|
-
|
|
31
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
32
9
|
|
|
33
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -40,9 +17,11 @@ require("@douyinfe/semi-foundation/lib/cjs/notification/notification.css");
|
|
|
40
17
|
|
|
41
18
|
var _uuid = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/uuid"));
|
|
42
19
|
|
|
43
|
-
function
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
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); }
|
|
44
23
|
|
|
45
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor =
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
46
25
|
|
|
47
26
|
// TODO: Automatic folding + unfolding function when there are more than N
|
|
48
27
|
const defaultConfig = {
|
|
@@ -63,7 +42,7 @@ function usePatchElement() {
|
|
|
63
42
|
config
|
|
64
43
|
}, ...originElements]);
|
|
65
44
|
return id => {
|
|
66
|
-
setElements(originElements =>
|
|
45
|
+
setElements(originElements => originElements.filter(_ref => {
|
|
67
46
|
let {
|
|
68
47
|
config: configOfCurrentElement
|
|
69
48
|
} = _ref;
|
|
@@ -73,8 +52,6 @@ function usePatchElement() {
|
|
|
73
52
|
}
|
|
74
53
|
|
|
75
54
|
function renderList() {
|
|
76
|
-
var _context;
|
|
77
|
-
|
|
78
55
|
const noticesInPosition = {
|
|
79
56
|
top: [],
|
|
80
57
|
topLeft: [],
|
|
@@ -83,7 +60,7 @@ function usePatchElement() {
|
|
|
83
60
|
bottomLeft: [],
|
|
84
61
|
bottomRight: []
|
|
85
62
|
};
|
|
86
|
-
|
|
63
|
+
elements.forEach(_ref2 => {
|
|
87
64
|
let {
|
|
88
65
|
element,
|
|
89
66
|
config
|
|
@@ -93,11 +70,11 @@ function usePatchElement() {
|
|
|
93
70
|
} = config;
|
|
94
71
|
noticesInPosition[position].push(element);
|
|
95
72
|
});
|
|
96
|
-
return
|
|
73
|
+
return Object.entries(noticesInPosition).map(obj => {
|
|
97
74
|
const pos = obj[0];
|
|
98
75
|
const notices = obj[1]; // @ts-ignore
|
|
99
76
|
|
|
100
|
-
return
|
|
77
|
+
return Array.isArray(notices) && notices.length ? /*#__PURE__*/_react.default.createElement("div", {
|
|
101
78
|
key: pos,
|
|
102
79
|
className: (0, _classnames.default)(_constants.cssClasses.LIST),
|
|
103
80
|
placement: pos
|
|
@@ -110,11 +87,11 @@ function usePatchElement() {
|
|
|
110
87
|
|
|
111
88
|
function useNotification() {
|
|
112
89
|
const [elements, patchElement] = usePatchElement();
|
|
113
|
-
const noticeRef = new
|
|
90
|
+
const noticeRef = new Map();
|
|
114
91
|
|
|
115
92
|
const addNotice = config => {
|
|
116
93
|
const id = (0, _uuid.default)('semi_notice_');
|
|
117
|
-
const mergeConfig =
|
|
94
|
+
const mergeConfig = Object.assign(Object.assign({}, config), {
|
|
118
95
|
id
|
|
119
96
|
}); // eslint-disable-next-line prefer-const
|
|
120
97
|
|
|
@@ -124,14 +101,14 @@ function useNotification() {
|
|
|
124
101
|
noticeRef.set(id, ele);
|
|
125
102
|
};
|
|
126
103
|
|
|
127
|
-
const notice = /*#__PURE__*/_react.default.createElement(_HookNotice.default,
|
|
104
|
+
const notice = /*#__PURE__*/_react.default.createElement(_HookNotice.default, Object.assign({
|
|
128
105
|
key: id
|
|
129
106
|
}, mergeConfig, {
|
|
130
107
|
afterClose: instanceID => closeFunc(instanceID),
|
|
131
108
|
ref: ref
|
|
132
109
|
}));
|
|
133
110
|
|
|
134
|
-
closeFunc = patchElement(notice,
|
|
111
|
+
closeFunc = patchElement(notice, Object.assign({}, mergeConfig));
|
|
135
112
|
return id;
|
|
136
113
|
};
|
|
137
114
|
|
|
@@ -141,19 +118,19 @@ function useNotification() {
|
|
|
141
118
|
};
|
|
142
119
|
|
|
143
120
|
return [{
|
|
144
|
-
success: config => addNotice(
|
|
121
|
+
success: config => addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), config), {
|
|
145
122
|
type: 'success'
|
|
146
123
|
})),
|
|
147
|
-
info: config => addNotice(
|
|
124
|
+
info: config => addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), config), {
|
|
148
125
|
type: 'info'
|
|
149
126
|
})),
|
|
150
|
-
error: config => addNotice(
|
|
127
|
+
error: config => addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), config), {
|
|
151
128
|
type: 'error'
|
|
152
129
|
})),
|
|
153
|
-
warning: config => addNotice(
|
|
130
|
+
warning: config => addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), config), {
|
|
154
131
|
type: 'warning'
|
|
155
132
|
})),
|
|
156
|
-
open: config => addNotice(
|
|
133
|
+
open: config => addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), config), {
|
|
157
134
|
type: 'default'
|
|
158
135
|
})),
|
|
159
136
|
close: removeElement
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
14
|
-
|
|
15
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
16
|
-
|
|
17
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
18
|
-
|
|
19
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
20
|
-
|
|
21
|
-
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
22
|
-
|
|
23
8
|
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
24
9
|
|
|
25
10
|
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
|
@@ -46,6 +31,8 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
46
31
|
|
|
47
32
|
require("@douyinfe/semi-foundation/lib/cjs/overflowList/overflowList.css");
|
|
48
33
|
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
+
|
|
49
36
|
/* eslint-disable arrow-body-style */
|
|
50
37
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
51
38
|
const Boundary = _constants.strings.BOUNDARY_MAP;
|
|
@@ -71,14 +58,14 @@ class OverflowList extends _baseComponent.default {
|
|
|
71
58
|
this.resize = function () {
|
|
72
59
|
let entries = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
73
60
|
// if any parent is growing, assume we have more room than before
|
|
74
|
-
const growing =
|
|
61
|
+
const growing = entries.some(entry => {
|
|
75
62
|
const previousWidth = _this.previousWidths.get(entry.target) || 0;
|
|
76
63
|
return entry.contentRect.width > previousWidth;
|
|
77
64
|
});
|
|
78
65
|
|
|
79
66
|
_this.repartition(growing);
|
|
80
67
|
|
|
81
|
-
|
|
68
|
+
entries.forEach(entry => _this.previousWidths.set(entry.target, entry.contentRect.width));
|
|
82
69
|
};
|
|
83
70
|
|
|
84
71
|
this.repartition = growing => {
|
|
@@ -112,8 +99,6 @@ class OverflowList extends _baseComponent.default {
|
|
|
112
99
|
};
|
|
113
100
|
|
|
114
101
|
this.renderItemList = () => {
|
|
115
|
-
var _context;
|
|
116
|
-
|
|
117
102
|
const {
|
|
118
103
|
className,
|
|
119
104
|
wrapperClassName,
|
|
@@ -132,9 +117,9 @@ class OverflowList extends _baseComponent.default {
|
|
|
132
117
|
ref: ref => {
|
|
133
118
|
this.scroller = ref;
|
|
134
119
|
},
|
|
135
|
-
style:
|
|
120
|
+
style: Object.assign({}, wrapperStyle),
|
|
136
121
|
key: "".concat(prefixCls, "-scroll-wrapper")
|
|
137
|
-
},
|
|
122
|
+
}, visible.map(visibleItemRenderer).map((item, ind) => {
|
|
138
123
|
const {
|
|
139
124
|
forwardRef,
|
|
140
125
|
key
|
|
@@ -144,7 +129,7 @@ class OverflowList extends _baseComponent.default {
|
|
|
144
129
|
'data-scrollkey': "".concat(key),
|
|
145
130
|
key
|
|
146
131
|
});
|
|
147
|
-
})), overflow[1]] : [collapseFrom === Boundary.START ? overflow : null,
|
|
132
|
+
})), overflow[1]] : [collapseFrom === Boundary.START ? overflow : null, visible.map(visibleItemRenderer), collapseFrom === Boundary.END ? overflow : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
148
133
|
className: "".concat(prefixCls, "-spacer"),
|
|
149
134
|
ref: ref => this.spacer = ref,
|
|
150
135
|
key: "".concat(prefixCls, "-spacer")
|
|
@@ -163,12 +148,12 @@ class OverflowList extends _baseComponent.default {
|
|
|
163
148
|
lastOverflowCount: 0,
|
|
164
149
|
overflow: [],
|
|
165
150
|
visible: props.items,
|
|
166
|
-
visibleState: new
|
|
151
|
+
visibleState: new Map()
|
|
167
152
|
};
|
|
168
153
|
this.foundation = new _foundation.default(this.adapter);
|
|
169
|
-
this.previousWidths = new
|
|
154
|
+
this.previousWidths = new Map();
|
|
170
155
|
this.itemRefs = {};
|
|
171
|
-
this.itemSizeMap = new
|
|
156
|
+
this.itemSizeMap = new Map();
|
|
172
157
|
}
|
|
173
158
|
|
|
174
159
|
static getDerivedStateFromProps(props, prevState) {
|
|
@@ -194,14 +179,14 @@ class OverflowList extends _baseComponent.default {
|
|
|
194
179
|
}
|
|
195
180
|
|
|
196
181
|
get adapter() {
|
|
197
|
-
return
|
|
182
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
198
183
|
updateVisibleState: visibleState => {
|
|
199
184
|
this.setState({
|
|
200
185
|
visibleState
|
|
201
186
|
});
|
|
202
187
|
},
|
|
203
188
|
updateStates: states => {
|
|
204
|
-
this.setState(
|
|
189
|
+
this.setState(Object.assign({}, states));
|
|
205
190
|
},
|
|
206
191
|
notifyIntersect: res => {
|
|
207
192
|
this.props.onIntersect && this.props.onIntersect(res);
|