@douyinfe/semi-ui 2.19.0-beta.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/anchor/index.tsx +39 -7
- package/anchor/link.tsx +11 -2
- package/calendar/_story/calendar.stories.js +20 -3
- package/dist/css/semi.css +2 -10
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2758 -12743
- 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/dropdown/index.tsx +5 -1
- package/getBabelConfig.js +1 -13
- package/lib/cjs/_base/base.css +1 -0
- 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.d.ts +4 -0
- package/lib/cjs/anchor/index.js +50 -36
- package/lib/cjs/anchor/link.d.ts +2 -0
- package/lib/cjs/anchor/link.js +15 -18
- 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.js +23 -47
- 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.js +12 -41
- package/lib/cjs/button/index.js +7 -12
- 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.js +8 -17
- package/lib/cjs/checkbox/checkboxGroup.js +13 -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 +17 -26
- package/lib/cjs/empty/index.js +5 -14
- package/lib/cjs/form/arrayField.js +28 -57
- 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.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.js +10 -19
- 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.js +10 -19
- package/lib/cjs/radio/radioGroup.js +11 -26
- 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 +23 -34
- package/lib/cjs/tag/index.js +19 -47
- 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 +27 -48
- 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.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/base.css +1 -0
- 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.d.ts +4 -0
- package/lib/es/anchor/index.js +46 -31
- package/lib/es/anchor/link.d.ts +2 -0
- package/lib/es/anchor/link.js +12 -10
- 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.js +18 -30
- 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.js +7 -22
- package/lib/es/button/index.js +4 -6
- 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.js +3 -8
- package/lib/es/checkbox/checkboxGroup.js +8 -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 +16 -17
- package/lib/es/empty/index.js +2 -6
- package/lib/es/form/arrayField.js +20 -42
- package/lib/es/form/baseForm.js +11 -28
- package/lib/es/form/errorMessage.js +2 -6
- 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.js +7 -10
- 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.js +5 -9
- package/lib/es/radio/radioGroup.js +6 -15
- 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 +18 -24
- package/lib/es/tag/index.js +12 -23
- 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 +20 -31
- 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.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 +7 -8
- package/tag/_story/tag.stories.js +51 -1
- package/tag/group.tsx +12 -11
- package/tooltip/index.tsx +2 -1
|
@@ -1,21 +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 _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
16
|
-
|
|
17
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
18
|
-
|
|
19
8
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
20
9
|
|
|
21
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -32,7 +21,9 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
32
21
|
|
|
33
22
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
34
23
|
|
|
35
|
-
var
|
|
24
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
27
|
|
|
37
28
|
class RadioGroup extends _baseComponent.default {
|
|
38
29
|
constructor(props) {
|
|
@@ -71,7 +62,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
71
62
|
}
|
|
72
63
|
|
|
73
64
|
get adapter() {
|
|
74
|
-
return
|
|
65
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
75
66
|
setValue: value => {
|
|
76
67
|
this.setState({
|
|
77
68
|
value
|
|
@@ -86,8 +77,6 @@ class RadioGroup extends _baseComponent.default {
|
|
|
86
77
|
}
|
|
87
78
|
|
|
88
79
|
render() {
|
|
89
|
-
var _context, _context2, _context3;
|
|
90
|
-
|
|
91
80
|
const {
|
|
92
81
|
children,
|
|
93
82
|
options,
|
|
@@ -108,18 +97,16 @@ class RadioGroup extends _baseComponent.default {
|
|
|
108
97
|
const prefixClsDisplay = (0, _classnames.default)(className, {
|
|
109
98
|
[prefix]: true,
|
|
110
99
|
["".concat(prefix, "-wrapper")]: true,
|
|
111
|
-
[
|
|
112
|
-
[
|
|
113
|
-
[
|
|
100
|
+
["".concat(prefix, "-").concat(direction)]: direction && !isButtonRadio,
|
|
101
|
+
["".concat(prefix, "-").concat(direction, "-default")]: direction && isDefaultRadio,
|
|
102
|
+
["".concat(prefix, "-").concat(direction, "-card")]: direction && isCardRadio,
|
|
114
103
|
["".concat(prefix, "-buttonRadio")]: isButtonRadio
|
|
115
104
|
});
|
|
116
105
|
const realValue = this.state.value;
|
|
117
106
|
let inner;
|
|
118
107
|
|
|
119
108
|
if (options) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
inner = (0, _map.default)(_context4 = options || []).call(_context4, (option, index) => {
|
|
109
|
+
inner = (options || []).map((option, index) => {
|
|
123
110
|
if (typeof option === 'string') {
|
|
124
111
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
125
112
|
key: index,
|
|
@@ -138,9 +125,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
138
125
|
}
|
|
139
126
|
});
|
|
140
127
|
} else if (children) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
inner = (0, _map.default)(_context5 = _react.default.Children).call(_context5, children, (itm, index) => /*#__PURE__*/_react.default.isValidElement(itm) ? /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
128
|
+
inner = _react.default.Children.map(children, (itm, index) => /*#__PURE__*/_react.default.isValidElement(itm) ? /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
144
129
|
key: index
|
|
145
130
|
}) : null);
|
|
146
131
|
}
|
|
@@ -155,7 +140,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
155
140
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
156
141
|
"aria-describedby": this.props['aria-describedby'],
|
|
157
142
|
"aria-required": this.props['aria-required']
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement(_context.default.Provider, {
|
|
159
144
|
value: {
|
|
160
145
|
radioGroup: {
|
|
161
146
|
onChange: this.onChange,
|
|
@@ -1,19 +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 _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
14
|
-
|
|
15
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
16
|
-
|
|
17
8
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
18
9
|
|
|
19
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -26,26 +17,26 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
26
17
|
|
|
27
18
|
var _constants = require("@douyinfe/semi-foundation/lib/cjs/radio/constants");
|
|
28
19
|
|
|
29
|
-
var
|
|
20
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
30
21
|
|
|
31
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
32
23
|
|
|
33
24
|
var _semiIcons = require("@douyinfe/semi-icons");
|
|
34
25
|
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
35
28
|
class RadioInner extends _baseComponent.default {
|
|
36
29
|
constructor(props) {
|
|
37
|
-
var _context;
|
|
38
|
-
|
|
39
30
|
super(props);
|
|
40
31
|
this.state = {
|
|
41
32
|
checked: false
|
|
42
33
|
};
|
|
43
34
|
this.foundation = new _radioInnerFoundation.default(this.adapter);
|
|
44
|
-
this.onChange =
|
|
35
|
+
this.onChange = this.onChange.bind(this);
|
|
45
36
|
}
|
|
46
37
|
|
|
47
38
|
get adapter() {
|
|
48
|
-
return
|
|
39
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
49
40
|
setNativeControlChecked: checked => {
|
|
50
41
|
this.setState({
|
|
51
42
|
checked
|
|
@@ -142,7 +133,7 @@ class RadioInner extends _baseComponent.default {
|
|
|
142
133
|
|
|
143
134
|
}
|
|
144
135
|
|
|
145
|
-
RadioInner.contextType =
|
|
136
|
+
RadioInner.contextType = _context.default;
|
|
146
137
|
RadioInner.propTypes = {
|
|
147
138
|
checked: _propTypes.default.bool,
|
|
148
139
|
disabled: _propTypes.default.bool,
|
package/lib/cjs/rating/index.js
CHANGED
|
@@ -1,23 +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 _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
16
|
-
|
|
17
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
18
|
-
|
|
19
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
20
|
-
|
|
21
8
|
var _react = _interopRequireDefault(require("react"));
|
|
22
9
|
|
|
23
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
@@ -26,7 +13,7 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
26
13
|
|
|
27
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
28
15
|
|
|
29
|
-
var
|
|
16
|
+
var _context = _interopRequireDefault(require("../configProvider/context"));
|
|
30
17
|
|
|
31
18
|
var _constants = require("@douyinfe/semi-foundation/lib/cjs/rating/constants");
|
|
32
19
|
|
|
@@ -42,6 +29,8 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
42
29
|
|
|
43
30
|
require("@douyinfe/semi-foundation/lib/cjs/rating/rating.css");
|
|
44
31
|
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
45
34
|
class Rating extends _baseComponent.default {
|
|
46
35
|
constructor(props) {
|
|
47
36
|
super(props);
|
|
@@ -131,8 +120,6 @@ class Rating extends _baseComponent.default {
|
|
|
131
120
|
};
|
|
132
121
|
|
|
133
122
|
this.getItemList = ariaLabelPrefix => {
|
|
134
|
-
var _context, _context2;
|
|
135
|
-
|
|
136
123
|
const {
|
|
137
124
|
count,
|
|
138
125
|
allowHalf,
|
|
@@ -148,7 +135,7 @@ class Rating extends _baseComponent.default {
|
|
|
148
135
|
focused
|
|
149
136
|
} = this.state; // index == count is for Empty rating
|
|
150
137
|
|
|
151
|
-
const itemList =
|
|
138
|
+
const itemList = [...Array(count + 1).keys()].map(ind => {
|
|
152
139
|
const content = /*#__PURE__*/_react.default.createElement(_item.default, {
|
|
153
140
|
ref: this.saveRef(ind),
|
|
154
141
|
index: ind,
|
|
@@ -169,15 +156,13 @@ class Rating extends _baseComponent.default {
|
|
|
169
156
|
});
|
|
170
157
|
|
|
171
158
|
if (tooltips) {
|
|
172
|
-
var _context3;
|
|
173
|
-
|
|
174
159
|
const text = tooltips[ind] ? tooltips[ind] : '';
|
|
175
160
|
const showTips = hoverValue - 1 === ind;
|
|
176
161
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
177
162
|
visible: showTips,
|
|
178
163
|
trigger: "custom",
|
|
179
164
|
content: text,
|
|
180
|
-
key:
|
|
165
|
+
key: "".concat(ind, "-").concat(showTips)
|
|
181
166
|
}, content);
|
|
182
167
|
}
|
|
183
168
|
|
|
@@ -200,7 +185,7 @@ class Rating extends _baseComponent.default {
|
|
|
200
185
|
|
|
201
186
|
static getDerivedStateFromProps(nextProps, state) {
|
|
202
187
|
if ('value' in nextProps && nextProps.value !== undefined) {
|
|
203
|
-
return
|
|
188
|
+
return Object.assign(Object.assign({}, state), {
|
|
204
189
|
value: nextProps.value
|
|
205
190
|
});
|
|
206
191
|
}
|
|
@@ -209,7 +194,7 @@ class Rating extends _baseComponent.default {
|
|
|
209
194
|
}
|
|
210
195
|
|
|
211
196
|
get adapter() {
|
|
212
|
-
return
|
|
197
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
213
198
|
focus: () => {
|
|
214
199
|
const {
|
|
215
200
|
disabled,
|
|
@@ -301,8 +286,6 @@ class Rating extends _baseComponent.default {
|
|
|
301
286
|
}
|
|
302
287
|
|
|
303
288
|
render() {
|
|
304
|
-
var _context4, _context5, _context6;
|
|
305
|
-
|
|
306
289
|
const {
|
|
307
290
|
style,
|
|
308
291
|
prefixCls,
|
|
@@ -317,7 +300,7 @@ class Rating extends _baseComponent.default {
|
|
|
317
300
|
emptyStarFocusVisible
|
|
318
301
|
} = this.state;
|
|
319
302
|
const ariaLabelPrefix = this.getAriaLabelPrefix();
|
|
320
|
-
const ariaLabel =
|
|
303
|
+
const ariaLabel = "Rating: ".concat(value, " of ").concat(count, " ").concat(ariaLabelPrefix).concat(value === 1 ? '' : 's', ",");
|
|
321
304
|
const itemList = this.getItemList(ariaLabelPrefix);
|
|
322
305
|
const listCls = (0, _classnames.default)(prefixCls, {
|
|
323
306
|
["".concat(prefixCls, "-disabled")]: disabled,
|
|
@@ -346,7 +329,7 @@ class Rating extends _baseComponent.default {
|
|
|
346
329
|
}
|
|
347
330
|
|
|
348
331
|
exports.default = Rating;
|
|
349
|
-
Rating.contextType =
|
|
332
|
+
Rating.contextType = _context.default;
|
|
350
333
|
Rating.propTypes = {
|
|
351
334
|
'aria-describedby': _propTypes.default.string,
|
|
352
335
|
'aria-errormessage': _propTypes.default.string,
|
package/lib/cjs/rating/item.js
CHANGED
|
@@ -1,19 +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 _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
16
|
-
|
|
17
8
|
var _react = _interopRequireDefault(require("react"));
|
|
18
9
|
|
|
19
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -30,6 +21,8 @@ var _foundation = require("@douyinfe/semi-foundation/lib/cjs/rating/foundation")
|
|
|
30
21
|
|
|
31
22
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
32
23
|
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
33
26
|
class Item extends _baseComponent.default {
|
|
34
27
|
constructor(props) {
|
|
35
28
|
super(props);
|
|
@@ -113,7 +106,7 @@ class Item extends _baseComponent.default {
|
|
|
113
106
|
}
|
|
114
107
|
|
|
115
108
|
get adapter() {
|
|
116
|
-
return
|
|
109
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
117
110
|
setFirstStarFocus: value => {
|
|
118
111
|
this.setState({
|
|
119
112
|
firstStarFocus: value
|
|
@@ -128,8 +121,6 @@ class Item extends _baseComponent.default {
|
|
|
128
121
|
}
|
|
129
122
|
|
|
130
123
|
render() {
|
|
131
|
-
var _context, _context2, _context3, _context4;
|
|
132
|
-
|
|
133
124
|
const {
|
|
134
125
|
index,
|
|
135
126
|
prefixCls,
|
|
@@ -156,7 +147,7 @@ class Item extends _baseComponent.default {
|
|
|
156
147
|
const starCls = (0, _classnames.default)(prefixCls, {
|
|
157
148
|
["".concat(prefixCls, "-half")]: isHalf,
|
|
158
149
|
["".concat(prefixCls, "-full")]: isFull,
|
|
159
|
-
[
|
|
150
|
+
["".concat(prefixCls, "-").concat(size)]: !isCustomSize
|
|
160
151
|
});
|
|
161
152
|
const sizeStyle = isCustomSize ? {
|
|
162
153
|
width: size,
|
|
@@ -189,7 +180,7 @@ class Item extends _baseComponent.default {
|
|
|
189
180
|
'aria-posinset': 2 * index + 1,
|
|
190
181
|
'aria-setsize': AriaSetSize,
|
|
191
182
|
'aria-disabled': disabled,
|
|
192
|
-
'aria-label':
|
|
183
|
+
'aria-label': "".concat(index + 0.5, " ").concat(ariaLabelPrefix, "s"),
|
|
193
184
|
'aria-labelledby': this.props['aria-describedby'],
|
|
194
185
|
'aria-describedby': this.props['aria-describedby'],
|
|
195
186
|
className: (0, _classnames.default)("".concat(prefixCls, "-first"), "".concat(_constants.cssClasses.PREFIX, "-no-focus")),
|
|
@@ -209,7 +200,7 @@ class Item extends _baseComponent.default {
|
|
|
209
200
|
'aria-posinset': allowHalf ? 2 * (index + 1) : index + 1,
|
|
210
201
|
'aria-setsize': AriaSetSize,
|
|
211
202
|
'aria-disabled': disabled,
|
|
212
|
-
'aria-label':
|
|
203
|
+
'aria-label': "".concat(isEmpty ? 0 : index + 1, " ").concat(ariaLabelPrefix).concat(index === 0 ? '' : 's'),
|
|
213
204
|
'aria-labelledby': this.props['aria-describedby'],
|
|
214
205
|
'aria-describedby': this.props['aria-describedby'],
|
|
215
206
|
className: (0, _classnames.default)("".concat(prefixCls, "-second"), "".concat(_constants.cssClasses.PREFIX, "-no-focus")),
|
|
@@ -223,13 +214,13 @@ class Item extends _baseComponent.default {
|
|
|
223
214
|
};
|
|
224
215
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
225
216
|
className: starCls,
|
|
226
|
-
style:
|
|
217
|
+
style: Object.assign({}, sizeStyle),
|
|
227
218
|
key: index
|
|
228
|
-
}, /*#__PURE__*/_react.default.createElement("div",
|
|
219
|
+
}, /*#__PURE__*/_react.default.createElement("div", Object.assign({}, starWrapProps), allowHalf && !isEmpty && /*#__PURE__*/_react.default.createElement("div", Object.assign({}, firstStarProps, {
|
|
229
220
|
style: {
|
|
230
221
|
width: "".concat(firstWidth * 100, "%")
|
|
231
222
|
}
|
|
232
|
-
}), content), /*#__PURE__*/_react.default.createElement("div",
|
|
223
|
+
}), content), /*#__PURE__*/_react.default.createElement("div", Object.assign({}, secondStarProps, {
|
|
233
224
|
"x-semi-prop": "character"
|
|
234
225
|
}), content)));
|
|
235
226
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
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
8
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -20,6 +15,8 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
20
15
|
|
|
21
16
|
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
|
|
22
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
23
20
|
class ReactResizeObserver extends _baseComponent.default {
|
|
24
21
|
constructor(props) {
|
|
25
22
|
super(props);
|
|
@@ -1,13 +1,8 @@
|
|
|
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
8
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -26,6 +21,8 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
26
21
|
|
|
27
22
|
require("@douyinfe/semi-foundation/lib/cjs/scrollList/scrollList.css");
|
|
28
23
|
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
29
26
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
30
27
|
class ScrollList extends _baseComponent.default {
|
|
31
28
|
constructor(props) {
|
|
@@ -1,28 +1,15 @@
|
|
|
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 _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
14
|
-
|
|
15
|
-
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
16
|
-
|
|
17
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
18
|
-
|
|
19
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
20
|
-
|
|
21
8
|
var _times2 = _interopRequireDefault(require("lodash/times"));
|
|
22
9
|
|
|
23
10
|
var _findIndex2 = _interopRequireDefault(require("lodash/findIndex"));
|
|
24
11
|
|
|
25
|
-
var
|
|
12
|
+
var _map2 = _interopRequireDefault(require("lodash/map"));
|
|
26
13
|
|
|
27
14
|
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
28
15
|
|
|
@@ -48,6 +35,8 @@ var _scrollTo = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cj
|
|
|
48
35
|
|
|
49
36
|
var _isElement = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/isElement"));
|
|
50
37
|
|
|
38
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
+
|
|
51
40
|
const msPerFrame = 1000 / 60;
|
|
52
41
|
const blankReg = /^\s*$/;
|
|
53
42
|
const wheelMode = 'wheel';
|
|
@@ -123,7 +112,7 @@ class ScrollItem extends _baseComponent.default {
|
|
|
123
112
|
list
|
|
124
113
|
} = this.props;
|
|
125
114
|
|
|
126
|
-
if (
|
|
115
|
+
if (Array.isArray(list) && list.length && index > -1) {
|
|
127
116
|
const size = list.length;
|
|
128
117
|
const indexInData = index % size;
|
|
129
118
|
return this.isDisabledData(list[indexInData]);
|
|
@@ -159,7 +148,7 @@ class ScrollItem extends _baseComponent.default {
|
|
|
159
148
|
children
|
|
160
149
|
} = list;
|
|
161
150
|
const reg = new RegExp("\\s*".concat(selectedCls, "\\s*"), 'g');
|
|
162
|
-
(0,
|
|
151
|
+
(0, _map2.default)(children, node => {
|
|
163
152
|
node.className = node.className && node.className.replace(reg, ' ');
|
|
164
153
|
|
|
165
154
|
if (blankReg.test(node.className)) {
|
|
@@ -298,7 +287,7 @@ class ScrollItem extends _baseComponent.default {
|
|
|
298
287
|
transform: commonTrans,
|
|
299
288
|
list
|
|
300
289
|
} = _this.props;
|
|
301
|
-
return
|
|
290
|
+
return list.map((item, index) => {
|
|
302
291
|
const {
|
|
303
292
|
transform: itemTrans
|
|
304
293
|
} = item;
|
|
@@ -331,7 +320,7 @@ class ScrollItem extends _baseComponent.default {
|
|
|
331
320
|
return (
|
|
332
321
|
/*#__PURE__*/
|
|
333
322
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
334
|
-
_react.default.createElement("li",
|
|
323
|
+
_react.default.createElement("li", Object.assign({
|
|
335
324
|
key: prefixKey + index
|
|
336
325
|
}, events, {
|
|
337
326
|
className: cls,
|
|
@@ -368,8 +357,6 @@ class ScrollItem extends _baseComponent.default {
|
|
|
368
357
|
|
|
369
358
|
|
|
370
359
|
this.renderInfiniteList = () => {
|
|
371
|
-
var _context, _context2;
|
|
372
|
-
|
|
373
360
|
const {
|
|
374
361
|
list,
|
|
375
362
|
cycled,
|
|
@@ -380,12 +367,12 @@ class ScrollItem extends _baseComponent.default {
|
|
|
380
367
|
prependCount,
|
|
381
368
|
appendCount
|
|
382
369
|
} = this.state;
|
|
383
|
-
const prependList = (0,
|
|
370
|
+
const prependList = (0, _times2.default)(prependCount).reduce((arr, num) => {
|
|
384
371
|
const items = this.renderItemList("pre_".concat(num, "_"));
|
|
385
372
|
arr.unshift(...items);
|
|
386
373
|
return arr;
|
|
387
374
|
}, []);
|
|
388
|
-
const appendList = (0,
|
|
375
|
+
const appendList = (0, _times2.default)(appendCount).reduce((arr, num) => {
|
|
389
376
|
const items = this.renderItemList("app_".concat(num, "_"));
|
|
390
377
|
arr.push(...items);
|
|
391
378
|
return arr;
|
|
@@ -448,8 +435,8 @@ class ScrollItem extends _baseComponent.default {
|
|
|
448
435
|
get adapter() {
|
|
449
436
|
var _this2 = this;
|
|
450
437
|
|
|
451
|
-
return
|
|
452
|
-
setState: (states, callback) => this.setState(
|
|
438
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
439
|
+
setState: (states, callback) => this.setState(Object.assign({}, states), callback),
|
|
453
440
|
setPrependCount: prependCount => this.setState({
|
|
454
441
|
prependCount
|
|
455
442
|
}),
|
|
@@ -531,7 +518,7 @@ class ScrollItem extends _baseComponent.default {
|
|
|
531
518
|
list
|
|
532
519
|
} = this.props;
|
|
533
520
|
|
|
534
|
-
if ((0, _isElement.default)(refNode) && (0, _isElement.default)(listWrapper) && typeof offset === 'number' &&
|
|
521
|
+
if ((0, _isElement.default)(refNode) && (0, _isElement.default)(listWrapper) && typeof offset === 'number' && Array.isArray(list) && list.length) {
|
|
535
522
|
offset = offset % list.length;
|
|
536
523
|
const refIndex = this.getIndexByNode(refNode);
|
|
537
524
|
let targetIndex = refIndex + offset;
|