@douyinfe/semi-ui 2.19.0-alpha.8 → 2.19.1-alpha.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/_utils/index.ts +9 -5
- package/button/buttonGroup.tsx +4 -38
- package/button/index.tsx +0 -2
- package/checkbox/_story/checkbox.stories.js +0 -2
- package/checkbox/checkbox.tsx +19 -22
- package/checkbox/checkboxGroup.tsx +0 -1
- package/dist/css/semi.css +139 -89
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2892 -13060
- 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/form/interface.ts +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 +13 -25
- 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.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.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.d.ts +1 -1
- package/lib/cjs/carousel/CarouselIndicator.js +11 -26
- package/lib/cjs/carousel/index.d.ts +1 -1
- 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 +18 -35
- 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.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.js +15 -34
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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 +42 -69
- 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 +1 -1
- package/lib/cjs/radio/radio.js +23 -40
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- 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.d.ts +3 -2
- package/lib/cjs/tabs/interface.js +1 -3
- package/lib/cjs/tabs/tabs-context.js +3 -6
- package/lib/cjs/tag/group.d.ts +1 -15
- package/lib/cjs/tag/group.js +10 -23
- package/lib/cjs/tag/index.js +19 -47
- package/lib/cjs/tag/interface.d.ts +6 -3
- 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.d.ts +2 -2
- package/lib/cjs/timePicker/TimePicker.js +21 -38
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/TimeShape.js +3 -6
- package/lib/cjs/timePicker/index.d.ts +2 -2
- 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.d.ts +1 -1
- 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 +9 -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.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.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.d.ts +1 -1
- package/lib/es/carousel/CarouselIndicator.js +8 -17
- package/lib/es/carousel/index.d.ts +1 -1
- 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 +13 -26
- 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.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +12 -27
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- 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.d.ts +1 -1
- 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/interface.d.ts +1 -1
- 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 +39 -60
- 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 +1 -1
- package/lib/es/radio/radio.js +18 -30
- package/lib/es/radio/radioGroup.d.ts +1 -1
- 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/tabs/interface.d.ts +3 -2
- package/lib/es/tag/group.d.ts +1 -15
- package/lib/es/tag/group.js +5 -13
- package/lib/es/tag/index.js +12 -23
- package/lib/es/tag/interface.d.ts +6 -3
- 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.d.ts +2 -2
- package/lib/es/timePicker/TimePicker.js +16 -27
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- 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.d.ts +1 -1
- package/lib/es/upload/index.js +11 -16
- package/package.json +7 -8
- package/popconfirm/_story/popconfirm.stories.js +2 -38
- package/popconfirm/index.tsx +12 -20
- package/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +19 -20
- package/radio/radioGroup.tsx +1 -1
- package/tabs/_story/Demo.tsx +14 -5
- package/tabs/interface.ts +3 -2
- package/tag/group.tsx +2 -16
- package/tag/interface.ts +9 -5
- package/transfer/_story/transfer.stories.js +2 -2
package/lib/cjs/radio/context.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
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"));
|
|
14
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
15
12
|
const Context = /*#__PURE__*/_react.default.createContext(null);
|
|
16
13
|
|
|
17
14
|
var _default = Context;
|
package/lib/cjs/radio/index.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
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
|
-
_Object$defineProperty(exports, "Radio", {
|
|
6
|
+
Object.defineProperty(exports, "Radio", {
|
|
12
7
|
enumerable: true,
|
|
13
8
|
get: function () {
|
|
14
9
|
return _radio.default;
|
|
15
10
|
}
|
|
16
11
|
});
|
|
17
|
-
|
|
18
12
|
exports.default = exports.RadioWithGroup = void 0;
|
|
19
13
|
|
|
20
14
|
var _radioGroup = _interopRequireDefault(require("./radioGroup"));
|
|
21
15
|
|
|
22
16
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
23
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
24
20
|
class RadioWithGroup extends _radio.default {}
|
|
25
21
|
|
|
26
22
|
exports.RadioWithGroup = RadioWithGroup;
|
package/lib/cjs/radio/radio.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
81
81
|
prefixCls?: string;
|
|
82
82
|
name?: string;
|
|
83
83
|
onChange?: (e: RadioChangeEvent) => void;
|
|
84
|
-
buttonSize?: "small" | "
|
|
84
|
+
buttonSize?: "small" | "large" | "middle";
|
|
85
85
|
isCardRadio?: boolean;
|
|
86
86
|
isPureCardRadio?: boolean;
|
|
87
87
|
};
|
package/lib/cjs/radio/radio.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 _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean"));
|
|
18
9
|
|
|
19
10
|
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
@@ -38,7 +29,9 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
38
29
|
|
|
39
30
|
var _radioInner = _interopRequireDefault(require("./radioInner"));
|
|
40
31
|
|
|
41
|
-
var
|
|
32
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
33
|
+
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
35
|
|
|
43
36
|
/* eslint-disable prefer-destructuring */
|
|
44
37
|
class Radio extends _baseComponent.default {
|
|
@@ -100,7 +93,7 @@ class Radio extends _baseComponent.default {
|
|
|
100
93
|
}
|
|
101
94
|
|
|
102
95
|
get adapter() {
|
|
103
|
-
return
|
|
96
|
+
return Object.assign(Object.assign({}, super.adapter), {
|
|
104
97
|
setHover: hover => {
|
|
105
98
|
this.setState({
|
|
106
99
|
hover
|
|
@@ -147,8 +140,6 @@ class Radio extends _baseComponent.default {
|
|
|
147
140
|
}
|
|
148
141
|
|
|
149
142
|
render() {
|
|
150
|
-
var _context, _context2, _context3;
|
|
151
|
-
|
|
152
143
|
const {
|
|
153
144
|
addonClassName,
|
|
154
145
|
addonStyle,
|
|
@@ -205,10 +196,10 @@ class Radio extends _baseComponent.default {
|
|
|
205
196
|
const wrapper = (0, _classnames.default)(prefix, {
|
|
206
197
|
["".concat(prefix, "-disabled")]: isDisabled,
|
|
207
198
|
["".concat(prefix, "-checked")]: realChecked,
|
|
208
|
-
[
|
|
199
|
+
["".concat(prefix, "-").concat(displayMode)]: Boolean(displayMode),
|
|
209
200
|
["".concat(prefix, "-buttonRadioComponent")]: isButtonRadioComponent,
|
|
210
201
|
["".concat(prefix, "-buttonRadioGroup")]: isButtonRadioGroup,
|
|
211
|
-
[
|
|
202
|
+
["".concat(prefix, "-buttonRadioGroup-").concat(buttonSize)]: isButtonRadioGroup && buttonSize,
|
|
212
203
|
["".concat(prefix, "-cardRadioGroup")]: isCardRadioGroup,
|
|
213
204
|
["".concat(prefix, "-cardRadioGroup_disabled")]: isDisabled && isCardRadioGroup,
|
|
214
205
|
["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
|
|
@@ -224,37 +215,27 @@ class Radio extends _baseComponent.default {
|
|
|
224
215
|
["".concat(prefix, "-addon-buttonRadio-checked")]: isButtonRadio && realChecked,
|
|
225
216
|
["".concat(prefix, "-addon-buttonRadio-disabled")]: isButtonRadio && isDisabled,
|
|
226
217
|
["".concat(prefix, "-addon-buttonRadio-hover")]: isButtonRadio && !realChecked && !isDisabled && isHover,
|
|
227
|
-
[
|
|
218
|
+
["".concat(prefix, "-addon-buttonRadio-").concat(buttonSize)]: isButtonRadio && buttonSize,
|
|
228
219
|
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
229
220
|
}, addonClassName);
|
|
230
221
|
|
|
231
|
-
const renderContent = () => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
className: addonCls,
|
|
242
|
-
style: addonStyle,
|
|
243
|
-
id: addonId,
|
|
244
|
-
"x-semi-prop": "children"
|
|
245
|
-
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/_react.default.createElement("div", {
|
|
246
|
-
className: "".concat(prefix, "-extra"),
|
|
247
|
-
id: extraId,
|
|
248
|
-
"x-semi-prop": "extra"
|
|
249
|
-
}, extra) : null);
|
|
250
|
-
};
|
|
222
|
+
const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
223
|
+
className: addonCls,
|
|
224
|
+
style: addonStyle,
|
|
225
|
+
id: addonId,
|
|
226
|
+
"x-semi-prop": "children"
|
|
227
|
+
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
+
className: "".concat(prefix, "-extra"),
|
|
229
|
+
id: extraId,
|
|
230
|
+
"x-semi-prop": "extra"
|
|
231
|
+
}, extra) : null);
|
|
251
232
|
|
|
252
233
|
return /*#__PURE__*/_react.default.createElement("label", {
|
|
253
234
|
style: style,
|
|
254
235
|
className: wrapper,
|
|
255
236
|
onMouseEnter: this.handleMouseEnter,
|
|
256
237
|
onMouseLeave: this.handleMouseLeave
|
|
257
|
-
}, /*#__PURE__*/_react.default.createElement(_radioInner.default,
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_radioInner.default, Object.assign({}, this.props, props, {
|
|
258
239
|
mode: realMode,
|
|
259
240
|
name: name !== null && name !== void 0 ? name : groupName,
|
|
260
241
|
isButtonRadio: isButtonRadio,
|
|
@@ -268,12 +249,14 @@ class Radio extends _baseComponent.default {
|
|
|
268
249
|
focusInner: focusVisible && !focusOuter,
|
|
269
250
|
onInputFocus: this.handleFocusVisible,
|
|
270
251
|
onInputBlur: this.handleBlur
|
|
271
|
-
})),
|
|
252
|
+
})), isCardRadioGroup ? /*#__PURE__*/_react.default.createElement("div", {
|
|
253
|
+
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
254
|
+
}, renderContent()) : renderContent());
|
|
272
255
|
}
|
|
273
256
|
|
|
274
257
|
}
|
|
275
258
|
|
|
276
|
-
Radio.contextType =
|
|
259
|
+
Radio.contextType = _context.default;
|
|
277
260
|
Radio.propTypes = {
|
|
278
261
|
autoFocus: _propTypes.default.bool,
|
|
279
262
|
checked: _propTypes.default.bool,
|
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -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) {
|
|
@@ -45,7 +36,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
45
36
|
this.getFormatName = () => this.props.name || 'default';
|
|
46
37
|
|
|
47
38
|
this.state = {
|
|
48
|
-
value:
|
|
39
|
+
value: undefined
|
|
49
40
|
};
|
|
50
41
|
this.foundation = new _radioGroupFoundation.default(this.adapter);
|
|
51
42
|
}
|
|
@@ -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) {
|