@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,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;
|
package/lib/cjs/select/index.js
CHANGED
|
@@ -1,43 +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 = void 0;
|
|
16
7
|
|
|
17
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
18
|
-
|
|
19
|
-
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
20
|
-
|
|
21
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
22
|
-
|
|
23
|
-
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
24
|
-
|
|
25
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
26
|
-
|
|
27
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
28
|
-
|
|
29
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
30
|
-
|
|
31
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
32
|
-
|
|
33
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
34
|
-
|
|
35
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
36
|
-
|
|
37
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
38
|
-
|
|
39
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
|
|
40
|
-
|
|
41
8
|
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
42
9
|
|
|
43
10
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
@@ -56,7 +23,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
56
23
|
|
|
57
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
58
25
|
|
|
59
|
-
var
|
|
26
|
+
var _context = _interopRequireDefault(require("../configProvider/context"));
|
|
60
27
|
|
|
61
28
|
var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/select/foundation"));
|
|
62
29
|
|
|
@@ -100,9 +67,11 @@ var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
|
|
|
100
67
|
|
|
101
68
|
require("@douyinfe/semi-foundation/lib/cjs/select/select.css");
|
|
102
69
|
|
|
103
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof
|
|
70
|
+
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); }
|
|
104
71
|
|
|
105
|
-
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 =
|
|
72
|
+
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; }
|
|
73
|
+
|
|
74
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
106
75
|
|
|
107
76
|
/* eslint-disable max-len */
|
|
108
77
|
|
|
@@ -112,8 +81,6 @@ const key = 0; // Notes: Use the label of the option as the identifier, that is,
|
|
|
112
81
|
|
|
113
82
|
class Select extends _baseComponent.default {
|
|
114
83
|
constructor(props) {
|
|
115
|
-
var _context, _context2, _context3, _context4, _context5, _context6;
|
|
116
|
-
|
|
117
84
|
super(props);
|
|
118
85
|
|
|
119
86
|
this.setOptionContainerEl = node => this.optionContainerEl = {
|
|
@@ -126,7 +93,7 @@ class Select extends _baseComponent.default {
|
|
|
126
93
|
isOpen: false,
|
|
127
94
|
isFocus: false,
|
|
128
95
|
options: [],
|
|
129
|
-
selections: new
|
|
96
|
+
selections: new Map(),
|
|
130
97
|
dropdownMinWidth: null,
|
|
131
98
|
optionKey: key,
|
|
132
99
|
inputValue: '',
|
|
@@ -147,12 +114,12 @@ class Select extends _baseComponent.default {
|
|
|
147
114
|
this.optionsRef = /*#__PURE__*/_react.default.createRef();
|
|
148
115
|
this.optionContainerEl = /*#__PURE__*/_react.default.createRef();
|
|
149
116
|
this.clickOutsideHandler = null;
|
|
150
|
-
this.onSelect =
|
|
151
|
-
this.onClear =
|
|
152
|
-
this.onMouseEnter =
|
|
153
|
-
this.onMouseLeave =
|
|
154
|
-
this.renderOption =
|
|
155
|
-
this.onKeyPress =
|
|
117
|
+
this.onSelect = this.onSelect.bind(this);
|
|
118
|
+
this.onClear = this.onClear.bind(this);
|
|
119
|
+
this.onMouseEnter = this.onMouseEnter.bind(this);
|
|
120
|
+
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
121
|
+
this.renderOption = this.renderOption.bind(this);
|
|
122
|
+
this.onKeyPress = this.onKeyPress.bind(this);
|
|
156
123
|
this.foundation = new _foundation.default(this.adapter);
|
|
157
124
|
(0, _warning.default)('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
|
|
158
125
|
(0, _warning.default)('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
|
|
@@ -248,7 +215,7 @@ class Select extends _baseComponent.default {
|
|
|
248
215
|
this.props.onDeselect(value, option);
|
|
249
216
|
}
|
|
250
217
|
};
|
|
251
|
-
return
|
|
218
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.adapter), keyboardAdapter), filterAdapter), multipleAdapter), {
|
|
252
219
|
// Collect all subitems, each item is visible by default when collected, and is not selected
|
|
253
220
|
getOptionsFromChildren: function () {
|
|
254
221
|
let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.children;
|
|
@@ -259,7 +226,7 @@ class Select extends _baseComponent.default {
|
|
|
259
226
|
} = _this.props;
|
|
260
227
|
|
|
261
228
|
if (optionList && optionList.length) {
|
|
262
|
-
options =
|
|
229
|
+
options = optionList.map((itemOpt, index) => Object.assign({
|
|
263
230
|
_show: true,
|
|
264
231
|
_selected: false,
|
|
265
232
|
_scrollIndex: index
|
|
@@ -310,7 +277,7 @@ class Select extends _baseComponent.default {
|
|
|
310
277
|
});
|
|
311
278
|
},
|
|
312
279
|
// clone Map, important!!!, prevent unexpected modify on state
|
|
313
|
-
getSelections: () => new
|
|
280
|
+
getSelections: () => new Map(this.state.selections),
|
|
314
281
|
notifyChange: value => {
|
|
315
282
|
this.props.onChange(value);
|
|
316
283
|
},
|
|
@@ -384,20 +351,16 @@ class Select extends _baseComponent.default {
|
|
|
384
351
|
return this.state.isFocusInContainer;
|
|
385
352
|
},
|
|
386
353
|
updateScrollTop: index => {
|
|
387
|
-
var _context8, _context9;
|
|
388
|
-
|
|
389
354
|
// eslint-disable-next-line max-len
|
|
390
355
|
let optionClassName = ".".concat(prefixcls, "-option-selected");
|
|
391
356
|
|
|
392
357
|
if (index !== undefined) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
optionClassName = (0, _concat.default)(_context7 = ".".concat(prefixcls, "-option:nth-child(")).call(_context7, index, ")");
|
|
358
|
+
optionClassName = ".".concat(prefixcls, "-option:nth-child(").concat(index, ")");
|
|
396
359
|
}
|
|
397
360
|
|
|
398
|
-
let destNode = document.querySelector(
|
|
361
|
+
let destNode = document.querySelector("#".concat(prefixcls, "-").concat(this.selectOptionListID, " ").concat(optionClassName));
|
|
399
362
|
|
|
400
|
-
if (
|
|
363
|
+
if (Array.isArray(destNode)) {
|
|
401
364
|
// eslint-disable-next-line prefer-destructuring
|
|
402
365
|
destNode = destNode[0];
|
|
403
366
|
}
|
|
@@ -425,10 +388,10 @@ class Select extends _baseComponent.default {
|
|
|
425
388
|
}
|
|
426
389
|
|
|
427
390
|
componentDidUpdate(prevProps, prevState) {
|
|
428
|
-
|
|
391
|
+
const prevChildrenKeys = _react.default.Children.toArray(prevProps.children).map(child => child.key);
|
|
392
|
+
|
|
393
|
+
const nowChildrenKeys = _react.default.Children.toArray(this.props.children).map(child => child.key);
|
|
429
394
|
|
|
430
|
-
const prevChildrenKeys = (0, _map2.default)(_context10 = _react.default.Children.toArray(prevProps.children)).call(_context10, child => child.key);
|
|
431
|
-
const nowChildrenKeys = (0, _map2.default)(_context11 = _react.default.Children.toArray(this.props.children)).call(_context11, child => child.key);
|
|
432
395
|
let isOptionsChanged = false;
|
|
433
396
|
|
|
434
397
|
if (!(0, _isEqual2.default)(prevChildrenKeys, nowChildrenKeys) || !(0, _isEqual2.default)(prevProps.optionList, this.props.optionList)) {
|
|
@@ -447,8 +410,6 @@ class Select extends _baseComponent.default {
|
|
|
447
410
|
}
|
|
448
411
|
|
|
449
412
|
renderInput() {
|
|
450
|
-
var _context12;
|
|
451
|
-
|
|
452
413
|
const {
|
|
453
414
|
size,
|
|
454
415
|
multiple,
|
|
@@ -465,7 +426,7 @@ class Select extends _baseComponent.default {
|
|
|
465
426
|
inputValue,
|
|
466
427
|
focusIndex
|
|
467
428
|
} = this.state;
|
|
468
|
-
const selectInputProps =
|
|
429
|
+
const selectInputProps = Object.assign({
|
|
469
430
|
value: inputValue,
|
|
470
431
|
disabled,
|
|
471
432
|
className: inputcls,
|
|
@@ -480,10 +441,10 @@ class Select extends _baseComponent.default {
|
|
|
480
441
|
selectInputProps.style = style;
|
|
481
442
|
}
|
|
482
443
|
|
|
483
|
-
return /*#__PURE__*/_react.default.createElement(_index3.default,
|
|
444
|
+
return /*#__PURE__*/_react.default.createElement(_index3.default, Object.assign({
|
|
484
445
|
ref: this.inputRef,
|
|
485
446
|
size: size,
|
|
486
|
-
"aria-activedescendant": focusIndex !== -1 ?
|
|
447
|
+
"aria-activedescendant": focusIndex !== -1 ? "".concat(this.selectID, "-option-").concat(focusIndex) : '',
|
|
487
448
|
onFocus: e => {
|
|
488
449
|
// if multiple and filter, when use tab key to let select get focus
|
|
489
450
|
// need to manual update state isFocus to let the focus style take effect
|
|
@@ -560,20 +521,18 @@ class Select extends _baseComponent.default {
|
|
|
560
521
|
let optionStyle = style || {};
|
|
561
522
|
|
|
562
523
|
if (option.style) {
|
|
563
|
-
optionStyle =
|
|
524
|
+
optionStyle = Object.assign(Object.assign({}, optionStyle), option.style);
|
|
564
525
|
}
|
|
565
526
|
|
|
566
527
|
if (option._inputCreateOnly) {
|
|
567
528
|
optionContent = this.renderCreateOption(option, isFocused, optionIndex, style);
|
|
568
529
|
} else {
|
|
569
|
-
var _context13;
|
|
570
|
-
|
|
571
530
|
// use another name to make sure that 'key' in optionList still exist when we call onChange
|
|
572
531
|
if ('key' in option) {
|
|
573
532
|
option._keyInOptionList = option.key;
|
|
574
533
|
}
|
|
575
534
|
|
|
576
|
-
optionContent = /*#__PURE__*/_react.default.createElement(_option.default,
|
|
535
|
+
optionContent = /*#__PURE__*/_react.default.createElement(_option.default, Object.assign({
|
|
577
536
|
showTick: true
|
|
578
537
|
}, option, {
|
|
579
538
|
selected: option._selected,
|
|
@@ -584,7 +543,7 @@ class Select extends _baseComponent.default {
|
|
|
584
543
|
key: option.key || option.label + option.value + optionIndex,
|
|
585
544
|
renderOptionItem: renderOptionItem,
|
|
586
545
|
inputValue: inputValue,
|
|
587
|
-
id:
|
|
546
|
+
id: "".concat(this.selectID, "-option-").concat(optionIndex)
|
|
588
547
|
}), option.label);
|
|
589
548
|
}
|
|
590
549
|
|
|
@@ -597,7 +556,7 @@ class Select extends _baseComponent.default {
|
|
|
597
556
|
} = this.props; // default render method
|
|
598
557
|
|
|
599
558
|
if (typeof renderCreateItem === 'undefined') {
|
|
600
|
-
const defaultCreateItem = /*#__PURE__*/_react.default.createElement(_option.default,
|
|
559
|
+
const defaultCreateItem = /*#__PURE__*/_react.default.createElement(_option.default, Object.assign({
|
|
601
560
|
key: option.key || option.label + option.value,
|
|
602
561
|
onSelect: (v, e) => this.onSelect(v, optionIndex, e),
|
|
603
562
|
onMouseEnter: () => this.onOptionHover(optionIndex),
|
|
@@ -633,14 +592,14 @@ class Select extends _baseComponent.default {
|
|
|
633
592
|
|
|
634
593
|
renderWithGroup(visibleOptions) {
|
|
635
594
|
const content = [];
|
|
636
|
-
const groupStatus = new
|
|
637
|
-
|
|
595
|
+
const groupStatus = new Map();
|
|
596
|
+
visibleOptions.forEach((option, optionIndex) => {
|
|
638
597
|
const parentGroup = option._parentGroup;
|
|
639
598
|
const optionContent = this.renderOption(option, optionIndex);
|
|
640
599
|
|
|
641
600
|
if (parentGroup && !groupStatus.has(parentGroup.label)) {
|
|
642
601
|
// when use with OptionGroup and group content not already insert
|
|
643
|
-
const groupContent = /*#__PURE__*/_react.default.createElement(_optionGroup.default,
|
|
602
|
+
const groupContent = /*#__PURE__*/_react.default.createElement(_optionGroup.default, Object.assign({}, parentGroup, {
|
|
644
603
|
key: parentGroup.label
|
|
645
604
|
}));
|
|
646
605
|
|
|
@@ -682,8 +641,6 @@ class Select extends _baseComponent.default {
|
|
|
682
641
|
}
|
|
683
642
|
|
|
684
643
|
renderOptions(children) {
|
|
685
|
-
var _context14;
|
|
686
|
-
|
|
687
644
|
const {
|
|
688
645
|
dropdownMinWidth,
|
|
689
646
|
options,
|
|
@@ -702,26 +659,26 @@ class Select extends _baseComponent.default {
|
|
|
702
659
|
multiple
|
|
703
660
|
} = this.props; // Do a filter first, instead of directly judging in forEach, so that the focusIndex can correspond to
|
|
704
661
|
|
|
705
|
-
const visibleOptions =
|
|
662
|
+
const visibleOptions = options.filter(item => item._show);
|
|
706
663
|
let listContent = this.renderWithGroup(visibleOptions);
|
|
707
664
|
|
|
708
665
|
if (virtualize) {
|
|
709
666
|
listContent = this.renderVirtualizeList(visibleOptions);
|
|
710
667
|
}
|
|
711
668
|
|
|
712
|
-
const style =
|
|
669
|
+
const style = Object.assign({
|
|
713
670
|
minWidth: dropdownMinWidth
|
|
714
671
|
}, dropdownStyle);
|
|
715
672
|
const optionListCls = (0, _classnames.default)({
|
|
716
673
|
["".concat(prefixcls, "-option-list")]: true,
|
|
717
674
|
["".concat(prefixcls, "-option-list-chosen")]: selections.size
|
|
718
675
|
});
|
|
719
|
-
const isEmpty = !options.length || !
|
|
676
|
+
const isEmpty = !options.length || !options.some(item => item._show);
|
|
720
677
|
return (
|
|
721
678
|
/*#__PURE__*/
|
|
722
679
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
723
680
|
_react.default.createElement("div", {
|
|
724
|
-
id:
|
|
681
|
+
id: "".concat(prefixcls, "-").concat(this.selectOptionListID),
|
|
725
682
|
className: dropdownClassName,
|
|
726
683
|
style: style,
|
|
727
684
|
ref: this.setOptionContainerEl,
|
|
@@ -800,9 +757,9 @@ class Select extends _baseComponent.default {
|
|
|
800
757
|
});
|
|
801
758
|
}
|
|
802
759
|
|
|
803
|
-
const mapItems = maxTagCount ?
|
|
760
|
+
const mapItems = maxTagCount ? selectedItems.slice(0, maxTagCount) : selectedItems; // no need to render rest tag when maxTagCount is setting
|
|
804
761
|
|
|
805
|
-
const tags =
|
|
762
|
+
const tags = mapItems.map((item, i) => {
|
|
806
763
|
const label = item[0];
|
|
807
764
|
const {
|
|
808
765
|
value
|
|
@@ -835,7 +792,7 @@ class Select extends _baseComponent.default {
|
|
|
835
792
|
};
|
|
836
793
|
|
|
837
794
|
if (isRenderInTag) {
|
|
838
|
-
return /*#__PURE__*/_react.default.createElement(_index.default,
|
|
795
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, Object.assign({}, basic, {
|
|
839
796
|
color: "white",
|
|
840
797
|
size: size || 'large',
|
|
841
798
|
key: value,
|
|
@@ -904,7 +861,7 @@ class Select extends _baseComponent.default {
|
|
|
904
861
|
|
|
905
862
|
if (virtualize) {
|
|
906
863
|
let minItemIndex = -1;
|
|
907
|
-
|
|
864
|
+
selections.forEach(item => {
|
|
908
865
|
const itemIndex = (0, _get2.default)(item, '_scrollIndex');
|
|
909
866
|
/* When the itemIndex is legal */
|
|
910
867
|
|
|
@@ -959,8 +916,6 @@ class Select extends _baseComponent.default {
|
|
|
959
916
|
}
|
|
960
917
|
|
|
961
918
|
renderSelection() {
|
|
962
|
-
var _context15, _context16;
|
|
963
|
-
|
|
964
919
|
const {
|
|
965
920
|
disabled,
|
|
966
921
|
multiple,
|
|
@@ -1014,7 +969,7 @@ class Select extends _baseComponent.default {
|
|
|
1014
969
|
className: "".concat(prefixcls, "-arrow-empty")
|
|
1015
970
|
});
|
|
1016
971
|
const inner = useCustomTrigger ? /*#__PURE__*/_react.default.createElement(_trigger.default, {
|
|
1017
|
-
value:
|
|
972
|
+
value: Array.from(selections.values()),
|
|
1018
973
|
inputValue: inputValue,
|
|
1019
974
|
onChange: this.handleInputChange,
|
|
1020
975
|
onClear: this.onClear,
|
|
@@ -1022,7 +977,7 @@ class Select extends _baseComponent.default {
|
|
|
1022
977
|
triggerRender: triggerRender,
|
|
1023
978
|
placeholder: placeholder,
|
|
1024
979
|
componentName: "Select",
|
|
1025
|
-
componentProps:
|
|
980
|
+
componentProps: Object.assign({}, this.props)
|
|
1026
981
|
}) : [/*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
1027
982
|
key: "prefix"
|
|
1028
983
|
}, prefix || insetLabel ? this.renderPrefix() : null), /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
@@ -1051,11 +1006,11 @@ class Select extends _baseComponent.default {
|
|
|
1051
1006
|
/*#__PURE__*/
|
|
1052
1007
|
|
|
1053
1008
|
/* eslint-disable-next-line jsx-a11y/aria-activedescendant-has-tabindex */
|
|
1054
|
-
_react.default.createElement("div",
|
|
1009
|
+
_react.default.createElement("div", Object.assign({
|
|
1055
1010
|
role: "combobox",
|
|
1056
1011
|
"aria-disabled": disabled,
|
|
1057
1012
|
"aria-expanded": isOpen,
|
|
1058
|
-
"aria-controls":
|
|
1013
|
+
"aria-controls": "".concat(prefixcls, "-").concat(this.selectOptionListID),
|
|
1059
1014
|
"aria-haspopup": "listbox",
|
|
1060
1015
|
"aria-label": selections.size ? 'selected' : '',
|
|
1061
1016
|
"aria-invalid": this.props['aria-invalid'],
|
|
@@ -1069,7 +1024,7 @@ class Select extends _baseComponent.default {
|
|
|
1069
1024
|
style: style,
|
|
1070
1025
|
id: this.selectID,
|
|
1071
1026
|
tabIndex: tabIndex,
|
|
1072
|
-
"aria-activedescendant": focusIndex !== -1 ?
|
|
1027
|
+
"aria-activedescendant": focusIndex !== -1 ? "".concat(this.selectID, "-option-").concat(focusIndex) : '',
|
|
1073
1028
|
onMouseEnter: this.onMouseEnter,
|
|
1074
1029
|
onMouseLeave: this.onMouseLeave,
|
|
1075
1030
|
onFocus: e => this.foundation.handleTriggerFocus(e),
|
|
@@ -1125,7 +1080,7 @@ class Select extends _baseComponent.default {
|
|
|
1125
1080
|
|
|
1126
1081
|
}
|
|
1127
1082
|
|
|
1128
|
-
Select.contextType =
|
|
1083
|
+
Select.contextType = _context.default;
|
|
1129
1084
|
Select.Option = _option.default;
|
|
1130
1085
|
Select.OptGroup = _optionGroup.default;
|
|
1131
1086
|
Select.propTypes = {
|
package/lib/cjs/select/option.js
CHANGED
|
@@ -1,25 +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 = 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 _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
24
9
|
|
|
25
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -36,17 +21,19 @@ var _semiIcons = require("@douyinfe/semi-icons");
|
|
|
36
21
|
|
|
37
22
|
var _index = require("../_utils/index");
|
|
38
23
|
|
|
39
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
40
27
|
|
|
41
|
-
function
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
29
|
|
|
43
30
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
44
31
|
var t = {};
|
|
45
32
|
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) &&
|
|
33
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
47
34
|
|
|
48
|
-
if (s != null && typeof
|
|
49
|
-
if (
|
|
35
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
36
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
50
37
|
}
|
|
51
38
|
return t;
|
|
52
39
|
};
|
|
@@ -68,7 +55,7 @@ class Option extends _react.PureComponent {
|
|
|
68
55
|
const isDisabled = props.disabled;
|
|
69
56
|
|
|
70
57
|
if (!isDisabled) {
|
|
71
|
-
props.onSelect(
|
|
58
|
+
props.onSelect(Object.assign(Object.assign({}, rest), {
|
|
72
59
|
value,
|
|
73
60
|
label: label || children
|
|
74
61
|
}), event);
|
|
@@ -137,7 +124,7 @@ class Option extends _react.PureComponent {
|
|
|
137
124
|
|
|
138
125
|
|
|
139
126
|
if (typeof renderOptionItem === 'function') {
|
|
140
|
-
return renderOptionItem(
|
|
127
|
+
return renderOptionItem(Object.assign({
|
|
141
128
|
disabled,
|
|
142
129
|
focused,
|
|
143
130
|
selected,
|
|
@@ -146,7 +133,7 @@ class Option extends _react.PureComponent {
|
|
|
146
133
|
value,
|
|
147
134
|
inputValue,
|
|
148
135
|
onMouseEnter: e => onMouseEnter(e),
|
|
149
|
-
onClick: e => this.onClick(
|
|
136
|
+
onClick: e => this.onClick(Object.assign({
|
|
150
137
|
value,
|
|
151
138
|
label,
|
|
152
139
|
children
|
|
@@ -167,7 +154,7 @@ class Option extends _react.PureComponent {
|
|
|
167
154
|
_react.default.createElement("div", {
|
|
168
155
|
className: optionClassName,
|
|
169
156
|
onClick: e => {
|
|
170
|
-
this.onClick(
|
|
157
|
+
this.onClick(Object.assign({
|
|
171
158
|
value,
|
|
172
159
|
label,
|
|
173
160
|
children
|
|
@@ -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 _constants = require("@douyinfe/semi-foundation/lib/cjs/select/constants");
|
|
|
20
15
|
|
|
21
16
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
22
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
23
20
|
const prefixCls = _constants.cssClasses.PREFIX_GROUP;
|
|
24
21
|
|
|
25
22
|
class OptionGroup extends _baseComponent.default {
|