@kdcloudjs/kdesign 1.7.33-stable.12 → 1.7.33-stable.12-hotfix.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/dist/kdesign-complete.less +19 -4
- package/dist/kdesign.css +10 -6
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +8510 -6736
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +16 -13
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/formatUtil.js +0 -2
- package/es/_utils/hooks.js +3 -3
- package/es/_utils/resizeObserver.js +7 -10
- package/es/_utils/usePopper.d.ts +1 -1
- package/es/_utils/usePopper.js +42 -42
- package/es/alert/alert.js +4 -5
- package/es/anchor/anchor-link.js +1 -2
- package/es/anchor/anchor.js +24 -24
- package/es/avatar/avatar.js +3 -3
- package/es/badge/badge.js +6 -6
- package/es/base-data/base-data.js +32 -32
- package/es/button/button.js +11 -12
- package/es/button/group.js +6 -6
- package/es/card/card.js +3 -3
- package/es/carousel/carousel.js +6 -6
- package/es/carousel/slidebar.d.ts +2 -2
- package/es/carousel/slidebar.js +3 -4
- package/es/cascader/cascader.js +28 -31
- package/es/cascader/util.js +6 -6
- package/es/checkbox/checkbox.js +13 -13
- package/es/city-picker/city-picker.js +26 -28
- package/es/city-picker/option.js +3 -4
- package/es/collapse/panel.js +10 -15
- package/es/color-picker/color-picker-panel.js +7 -7
- package/es/color-picker/color-picker.js +17 -18
- package/es/color-picker/utils/colorFormat.js +6 -6
- package/es/config-provider/ConfigContext.d.ts +2 -0
- package/es/config-provider/compDefaultProps.d.ts +3 -3
- package/es/config-provider/defaultConfig.d.ts +1 -0
- package/es/config-provider/defaultConfig.js +2 -1
- package/es/date-picker/calendar.d.ts +2 -2
- package/es/date-picker/calendar.js +2 -3
- package/es/date-picker/date-panel.d.ts +1 -1
- package/es/date-picker/date-panel.js +5 -6
- package/es/date-picker/date-picker.js +3 -3
- package/es/date-picker/hooks/use-range-cls.js +1 -2
- package/es/date-picker/panel/date-time/date-time.d.ts +1 -1
- package/es/date-picker/panel/header/header.d.ts +1 -1
- package/es/date-picker/panel/header/header.js +10 -10
- package/es/date-picker/panel/month/month.d.ts +2 -2
- package/es/date-picker/panel/month/month.js +1 -2
- package/es/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/es/date-picker/panel/quarter/quarter.js +1 -2
- package/es/date-picker/panel/time/time-column.d.ts +1 -1
- package/es/date-picker/panel/time/time-column.js +1 -2
- package/es/date-picker/panel/time/time.d.ts +2 -2
- package/es/date-picker/panel/time/time.js +2 -2
- package/es/date-picker/panel/week/week.d.ts +2 -2
- package/es/date-picker/panel/week/week.js +6 -7
- package/es/date-picker/panel/year/year.d.ts +2 -2
- package/es/date-picker/panel/year/year.js +2 -3
- package/es/date-picker/popper.js +1 -2
- package/es/date-picker/range/input-range.js +5 -5
- package/es/date-picker/range-picker.js +6 -6
- package/es/date-picker/single/input-date.js +3 -3
- package/es/date-picker/utils/date-fns.js +0 -1
- package/es/date-picker/utils/get-extra-footer.d.ts +1 -1
- package/es/date-picker/utils/get-ranges.d.ts +2 -2
- package/es/date-picker/utils/get-ranges.js +2 -2
- package/es/drawer/drawer.js +10 -10
- package/es/dropdown/dropdown.js +9 -9
- package/es/dropdown/menu.js +2 -2
- package/es/empty/defaultEmptyImg.d.ts +2 -2
- package/es/empty/empty.js +6 -6
- package/es/empty/illustrationEmptyImg.d.ts +2 -2
- package/es/filter/condition.js +5 -5
- package/es/filter/filter.js +2 -2
- package/es/filter/scheme.js +13 -13
- package/es/form/Field.js +4 -5
- package/es/form/FieldLabel.js +1 -2
- package/es/form/FieldWrapper.js +4 -4
- package/es/form/Form.js +2 -2
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +3 -3
- package/es/image/preview-group.js +3 -3
- package/es/image/preview.js +7 -7
- package/es/image-cropper/image-cropper.js +4 -4
- package/es/image-cropper/operation-bar.js +5 -5
- package/es/input/ClearableLabeledInput.js +8 -9
- package/es/input/TextArea.js +5 -6
- package/es/input/calculateNodeHeight.js +0 -5
- package/es/input/input.js +2 -2
- package/es/input-number/inputNumber.js +4 -4
- package/es/layout/sider.js +6 -6
- package/es/link/link.js +3 -3
- package/es/locale/locale.js +6 -7
- package/es/menu/menu.js +2 -2
- package/es/menu/menuItem.js +2 -2
- package/es/menu/subMenu.js +6 -6
- package/es/message/content.js +1 -1
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +11 -11
- package/es/notification/content.js +3 -3
- package/es/notification/index.js +6 -3
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/pagination/pagination.js +15 -15
- package/es/popconfirm/popconfirm.js +2 -2
- package/es/progress/circle.js +5 -5
- package/es/progress/progress.js +2 -2
- package/es/radio/radio.js +1 -2
- package/es/rate/rate.js +7 -8
- package/es/search/option.js +1 -2
- package/es/search/quick-search.js +9 -10
- package/es/search/search-panel.js +6 -4
- package/es/search/search.js +6 -6
- package/es/select/option.js +3 -4
- package/es/select/select.js +28 -30
- package/es/slider/marks.d.ts +1 -1
- package/es/slider/marks.js +1 -2
- package/es/slider/slider.js +1 -2
- package/es/slider/sliderTooltip.js +1 -2
- package/es/slider/steps.d.ts +1 -1
- package/es/slider/steps.js +1 -2
- package/es/slider/track.d.ts +2 -2
- package/es/slider/track.js +1 -2
- package/es/space/space.js +3 -3
- package/es/spin/spin.js +6 -6
- package/es/split-panel/split-panel.js +7 -7
- package/es/stepper/stepper.js +6 -7
- package/es/steps/Step.js +2 -2
- package/es/steps/Steps.js +2 -2
- package/es/switch/switch.js +4 -4
- package/es/table/table.js +21 -5
- package/es/tabs/arrow-button.js +2 -2
- package/es/tabs/style/index.css +9 -5
- package/es/tabs/style/index.less +19 -4
- package/es/tabs/tab-pane.js +5 -4
- package/es/tabs/tabs.d.ts +2 -0
- package/es/tabs/tabs.js +71 -33
- package/es/tag/tag.js +5 -5
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +1 -1
- package/es/transfer/list-item.js +1 -2
- package/es/transfer/list.js +7 -8
- package/es/transfer/operation.d.ts +1 -1
- package/es/transfer/operation.js +2 -2
- package/es/transfer/search.js +2 -2
- package/es/transfer/transfer.js +1 -2
- package/es/tree/tree.js +12 -12
- package/es/tree/treeHooks.js +3 -3
- package/es/tree/treeNode.js +10 -13
- package/es/tree/utils/treeUtils.js +13 -13
- package/es/tree-select/tree-select.js +25 -26
- package/es/typography/base.js +2 -2
- package/es/upload/scan-files.js +3 -3
- package/es/upload/upload.js +36 -36
- package/es/virtual-list/virtual-list.js +5 -6
- package/lib/_utils/KeyCode.js +1 -2
- package/lib/_utils/arrayUtil.js +3 -5
- package/lib/_utils/formatUtil.js +0 -2
- package/lib/_utils/hooks.js +3 -3
- package/lib/_utils/index.js +2 -3
- package/lib/_utils/raf.js +2 -4
- package/lib/_utils/reactNode.js +2 -4
- package/lib/_utils/resizeObserver.js +8 -12
- package/lib/_utils/type.js +3 -5
- package/lib/_utils/usePopper.d.ts +1 -1
- package/lib/_utils/usePopper.js +46 -50
- package/lib/alert/alert.js +8 -13
- package/lib/alert/index.js +1 -2
- package/lib/anchor/anchor-link.js +3 -6
- package/lib/anchor/anchor.js +27 -30
- package/lib/anchor/context.js +2 -4
- package/lib/anchor/index.js +1 -2
- package/lib/avatar/avatar.js +7 -11
- package/lib/avatar/index.js +2 -4
- package/lib/badge/badge.js +10 -14
- package/lib/badge/index.js +2 -4
- package/lib/base-data/base-data.js +34 -36
- package/lib/base-data/index.js +2 -4
- package/lib/base-data/interface.js +1 -2
- package/lib/button/button.js +18 -26
- package/lib/button/group.js +9 -12
- package/lib/button/index.js +1 -2
- package/lib/card/card.js +5 -7
- package/lib/card/index.js +2 -4
- package/lib/carousel/carousel.js +10 -14
- package/lib/carousel/displayList.js +2 -3
- package/lib/carousel/fadeList.js +2 -3
- package/lib/carousel/index.js +2 -4
- package/lib/carousel/slideList.js +2 -3
- package/lib/carousel/slidebar.d.ts +2 -2
- package/lib/carousel/slidebar.js +5 -7
- package/lib/cascader/cascader.js +31 -37
- package/lib/cascader/index.js +2 -4
- package/lib/cascader/util.js +18 -30
- package/lib/checkbox/checkbox.js +15 -17
- package/lib/checkbox/group.js +8 -10
- package/lib/checkbox/index.js +2 -4
- package/lib/city-picker/city-picker.js +28 -32
- package/lib/city-picker/index.js +2 -4
- package/lib/city-picker/interface.js +2 -4
- package/lib/city-picker/option.js +5 -8
- package/lib/collapse/collapse.js +3 -6
- package/lib/collapse/index.js +1 -2
- package/lib/collapse/panel.js +12 -19
- package/lib/color-picker/color-picker-panel.js +9 -11
- package/lib/color-picker/color-picker.js +19 -22
- package/lib/color-picker/constant/colorTypes.js +2 -3
- package/lib/color-picker/constant/defaultColor.js +1 -2
- package/lib/color-picker/constant/systemPresetColor.js +1 -2
- package/lib/color-picker/index.js +2 -4
- package/lib/color-picker/interface.js +2 -4
- package/lib/color-picker/utils/colorFormat.js +13 -19
- package/lib/color-picker/utils/hooks/useOnClickOutside.js +1 -2
- package/lib/config-provider/ConfigContext.d.ts +2 -0
- package/lib/config-provider/ConfigContext.js +1 -2
- package/lib/config-provider/SizeContext.js +2 -4
- package/lib/config-provider/compDefaultProps.d.ts +3 -3
- package/lib/config-provider/compDefaultProps.js +2 -4
- package/lib/config-provider/configProvider.js +2 -4
- package/lib/config-provider/defaultConfig.d.ts +1 -0
- package/lib/config-provider/defaultConfig.js +3 -3
- package/lib/config-provider/index.js +1 -2
- package/lib/date-picker/calendar.d.ts +2 -2
- package/lib/date-picker/calendar.js +4 -7
- package/lib/date-picker/context.js +2 -4
- package/lib/date-picker/date-panel.d.ts +1 -1
- package/lib/date-picker/date-panel.js +7 -10
- package/lib/date-picker/date-picker.js +5 -7
- package/lib/date-picker/hooks/use-range-cls.js +1 -2
- package/lib/date-picker/hooks/use-range-disabled.js +1 -2
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -2
- package/lib/date-picker/hooks/use-text-value-mapping.js +1 -2
- package/lib/date-picker/index.js +1 -2
- package/lib/date-picker/locale/zh_CN.js +1 -2
- package/lib/date-picker/panel/date-time/date-time.d.ts +1 -1
- package/lib/date-picker/panel/date-time/date-time.js +2 -4
- package/lib/date-picker/panel/header/header.d.ts +1 -1
- package/lib/date-picker/panel/header/header.js +12 -14
- package/lib/date-picker/panel/month/month.d.ts +2 -2
- package/lib/date-picker/panel/month/month.js +3 -6
- package/lib/date-picker/panel/quarter/quarter.d.ts +2 -2
- package/lib/date-picker/panel/quarter/quarter.js +3 -6
- package/lib/date-picker/panel/time/time-column.d.ts +1 -1
- package/lib/date-picker/panel/time/time-column.js +10 -12
- package/lib/date-picker/panel/time/time.d.ts +2 -2
- package/lib/date-picker/panel/time/time.js +4 -6
- package/lib/date-picker/panel/week/week.d.ts +2 -2
- package/lib/date-picker/panel/week/week.js +8 -11
- package/lib/date-picker/panel/year/year.d.ts +2 -2
- package/lib/date-picker/panel/year/year.js +4 -7
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +7 -9
- package/lib/date-picker/range-picker.js +8 -10
- package/lib/date-picker/single/input-date.js +5 -7
- package/lib/date-picker/utils/date-fns.js +11 -8
- package/lib/date-picker/utils/get-extra-footer.d.ts +1 -1
- package/lib/date-picker/utils/get-extra-footer.js +1 -2
- package/lib/date-picker/utils/get-ranges.d.ts +2 -2
- package/lib/date-picker/utils/get-ranges.js +2 -2
- package/lib/date-picker/utils/index.js +4 -7
- package/lib/drawer/drawer.js +13 -16
- package/lib/drawer/index.js +2 -4
- package/lib/dropdown/dropdown.js +11 -13
- package/lib/dropdown/index.js +2 -4
- package/lib/dropdown/menu.js +5 -8
- package/lib/empty/defaultEmptyImg.d.ts +2 -2
- package/lib/empty/defaultEmptyImg.js +2 -4
- package/lib/empty/empty.js +8 -10
- package/lib/empty/illustrationEmptyImg.d.ts +2 -2
- package/lib/empty/illustrationEmptyImg.js +2 -4
- package/lib/empty/index.js +2 -4
- package/lib/filter/condition.js +7 -9
- package/lib/filter/filter.js +4 -6
- package/lib/filter/index.js +2 -4
- package/lib/filter/scheme.js +15 -17
- package/lib/form/Field.js +7 -11
- package/lib/form/FieldContext.js +1 -2
- package/lib/form/FieldLabel.js +3 -6
- package/lib/form/FieldWrapper.js +6 -8
- package/lib/form/Form.js +4 -6
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForceUpdate.js +1 -2
- package/lib/form/hooks/useForm.js +2 -4
- package/lib/form/index.js +2 -4
- package/lib/grid/col.js +2 -4
- package/lib/grid/row.js +3 -6
- package/lib/icon/icon.js +4 -6
- package/lib/icon/index.js +2 -4
- package/lib/icon/interface.js +3 -6
- package/lib/image/image.js +5 -7
- package/lib/image/index.js +2 -4
- package/lib/image/preview-group.js +5 -7
- package/lib/image/preview.js +9 -11
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +6 -8
- package/lib/image-cropper/index.js +1 -2
- package/lib/image-cropper/operation-bar.js +7 -9
- package/lib/index.js +1 -2
- package/lib/input/ClearableLabeledInput.js +10 -13
- package/lib/input/TextArea.js +7 -10
- package/lib/input/calculateNodeHeight.js +0 -5
- package/lib/input/index.js +2 -4
- package/lib/input/input.js +6 -10
- package/lib/input-number/index.js +1 -2
- package/lib/input-number/inputNumber.js +6 -8
- package/lib/layout/index.js +2 -4
- package/lib/layout/layout.js +6 -12
- package/lib/layout/sider.js +18 -20
- package/lib/link/index.js +2 -4
- package/lib/link/link.js +6 -9
- package/lib/locale/index.js +2 -4
- package/lib/locale/locale.js +10 -14
- package/lib/locale/zh-CN.js +1 -2
- package/lib/menu/index.js +2 -4
- package/lib/menu/menu.js +4 -6
- package/lib/menu/menuItem.js +5 -8
- package/lib/menu/subMenu.js +7 -8
- package/lib/menu/util.js +8 -16
- package/lib/message/content.js +3 -5
- package/lib/message/index.js +1 -2
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/index.js +2 -4
- package/lib/modal/modal.js +15 -19
- package/lib/notification/content.js +5 -7
- package/lib/notification/index.js +7 -5
- package/lib/notification-base/index.js +2 -3
- package/lib/notification-base/notice.js +5 -8
- package/lib/notification-base/notification.js +2 -4
- package/lib/pagination/index.js +1 -2
- package/lib/pagination/pagination.js +19 -23
- package/lib/popconfirm/index.js +2 -4
- package/lib/popconfirm/popconfirm.js +4 -6
- package/lib/progress/circle.js +6 -7
- package/lib/progress/index.js +1 -2
- package/lib/progress/line.js +1 -2
- package/lib/progress/progress.js +6 -10
- package/lib/progress/utils.js +3 -5
- package/lib/radio/context.js +3 -6
- package/lib/radio/group.js +2 -4
- package/lib/radio/index.js +1 -2
- package/lib/radio/radio-button.js +2 -4
- package/lib/radio/radio.js +3 -6
- package/lib/rate/index.js +1 -2
- package/lib/rate/rate.js +10 -14
- package/lib/search/index.js +1 -2
- package/lib/search/interface.js +3 -6
- package/lib/search/option.js +3 -6
- package/lib/search/quick-search.js +11 -14
- package/lib/search/search-panel.js +8 -8
- package/lib/search/search.js +8 -10
- package/lib/select/index.js +1 -2
- package/lib/select/interface.js +3 -6
- package/lib/select/option.js +5 -8
- package/lib/select/select.js +30 -34
- package/lib/slider/index.js +2 -4
- package/lib/slider/marks.d.ts +1 -1
- package/lib/slider/marks.js +2 -4
- package/lib/slider/slider.js +3 -6
- package/lib/slider/sliderTooltip.js +3 -6
- package/lib/slider/steps.d.ts +1 -1
- package/lib/slider/steps.js +2 -4
- package/lib/slider/track.d.ts +2 -2
- package/lib/slider/track.js +2 -4
- package/lib/space/index.js +2 -4
- package/lib/space/space.js +5 -7
- package/lib/spin/index.js +2 -4
- package/lib/spin/spin.js +9 -12
- package/lib/split-panel/index.js +2 -4
- package/lib/split-panel/split-panel.js +10 -13
- package/lib/split-panel/trigger.js +1 -2
- package/lib/stepper/index.js +2 -4
- package/lib/stepper/stepper.js +9 -13
- package/lib/steps/Step.js +3 -4
- package/lib/steps/Steps.js +4 -6
- package/lib/steps/index.js +1 -2
- package/lib/steps/interface.js +3 -6
- package/lib/switch/index.js +1 -2
- package/lib/switch/switch.js +7 -10
- package/lib/table/feature/autoRowSpan.js +1 -2
- package/lib/table/feature/colGroupExtendable.js +1 -2
- package/lib/table/feature/columnDrag.js +1 -2
- package/lib/table/feature/columnResize.js +1 -2
- package/lib/table/feature/contextMenu.js +1 -2
- package/lib/table/feature/filter.js +1 -2
- package/lib/table/feature/mergeCellHover.js +1 -2
- package/lib/table/feature/rowDetail.js +1 -2
- package/lib/table/feature/rowSelection.js +1 -2
- package/lib/table/feature/sort.js +1 -2
- package/lib/table/feature/treeMode.js +1 -2
- package/lib/table/feature/useFooterDataSource.js +1 -2
- package/lib/table/feature/useRangeSelection.js +1 -2
- package/lib/table/feature/useRowDrag.js +1 -2
- package/lib/table/index.js +1 -2
- package/lib/table/table.js +23 -9
- package/lib/tabs/active-line.js +2 -4
- package/lib/tabs/arrow-button.js +4 -6
- package/lib/tabs/context.js +3 -6
- package/lib/tabs/index.js +1 -2
- package/lib/tabs/style/index.css +9 -5
- package/lib/tabs/style/index.less +19 -4
- package/lib/tabs/tab-pane.js +8 -10
- package/lib/tabs/tabs.d.ts +2 -0
- package/lib/tabs/tabs.js +79 -47
- package/lib/tag/index.js +2 -4
- package/lib/tag/tag.js +10 -15
- package/lib/timeline/Timeline.js +7 -9
- package/lib/timeline/TimelineItem.js +7 -9
- package/lib/timeline/index.js +1 -2
- package/lib/tooltip/index.js +2 -4
- package/lib/tooltip/tooltip.js +3 -5
- package/lib/transfer/index.js +1 -2
- package/lib/transfer/list-body.js +3 -6
- package/lib/transfer/list-item.js +2 -4
- package/lib/transfer/list.js +9 -12
- package/lib/transfer/operation.d.ts +1 -1
- package/lib/transfer/operation.js +3 -4
- package/lib/transfer/search.js +3 -4
- package/lib/transfer/transfer.js +3 -6
- package/lib/tree/index.js +2 -4
- package/lib/tree/tree.js +14 -16
- package/lib/tree/treeHooks.js +12 -20
- package/lib/tree/treeNode.js +12 -17
- package/lib/tree/utils/treeUtils.js +38 -62
- package/lib/tree-select/index.js +2 -4
- package/lib/tree-select/interface.js +3 -6
- package/lib/tree-select/tree-select.js +27 -30
- package/lib/typography/base.js +5 -8
- package/lib/typography/index.js +1 -2
- package/lib/typography/paragraph.js +2 -4
- package/lib/typography/text.js +1 -2
- package/lib/typography/title.js +2 -4
- package/lib/typography/typography.js +2 -4
- package/lib/upload/dragger.js +2 -4
- package/lib/upload/index.js +2 -4
- package/lib/upload/scan-files.js +4 -5
- package/lib/upload/upload.js +38 -40
- package/lib/upload/verify-file.js +2 -3
- package/lib/view-container/context.js +3 -6
- package/lib/view-container/index.js +1 -2
- package/lib/view-container/view-container.js +2 -4
- package/lib/virtual-list/Filler.js +2 -4
- package/lib/virtual-list/index.js +2 -4
- package/lib/virtual-list/utils/itemUtil.js +1 -2
- package/lib/virtual-list/virtual-list.js +7 -10
- package/package.json +7 -5
- package/CHANGELOG.md +0 -1880
package/es/_utils/formatUtil.js
CHANGED
|
@@ -105,7 +105,6 @@ export function formatNumber(num, formatParams) {
|
|
|
105
105
|
floatNum = Math.abs(floatNum);
|
|
106
106
|
numInfo.numStr = _sliceInstanceProperty(_context3 = numInfo.numStr).call(_context3, 1); // 去除第一个负号
|
|
107
107
|
}
|
|
108
|
-
|
|
109
108
|
var numStrArr = numInfo.numStr.split('.');
|
|
110
109
|
numInfo.intStr = numStrArr[0];
|
|
111
110
|
numInfo.decimalStr = numStrArr[1] || '';
|
|
@@ -179,7 +178,6 @@ export function formatEditNumber(num, _ref) {
|
|
|
179
178
|
floatNum = Math.abs(floatNum);
|
|
180
179
|
numInfo.numStr = _sliceInstanceProperty(_context4 = numInfo.numStr).call(_context4, 1); // 去除第一个负号
|
|
181
180
|
}
|
|
182
|
-
|
|
183
181
|
var numStrArr = numInfo.numStr.split('.');
|
|
184
182
|
numInfo.intStr = numStrArr[0];
|
|
185
183
|
numInfo.decimalStr = numStrArr[1] || '';
|
package/es/_utils/hooks.js
CHANGED
|
@@ -7,9 +7,9 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
|
7
7
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
8
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
9
9
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
10
|
-
function _createForOfIteratorHelper(
|
|
11
|
-
function _unsupportedIterableToArray(
|
|
12
|
-
function _arrayLikeToArray(
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context2; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context2 = {}.toString.call(r)).call(_context2, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
import { useEffect, useState, useRef, useReducer } from 'react';
|
|
14
14
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
15
15
|
import devWarning from './devwarning';
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
6
4
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
7
5
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
8
|
-
|
|
9
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
12
11
|
import { findDOMNode } from 'react-dom';
|
|
13
12
|
var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
14
|
-
_inherits(ResizeObserverComponent, _React$Component);
|
|
15
|
-
var _super = _createSuper(ResizeObserverComponent);
|
|
16
13
|
function ResizeObserverComponent() {
|
|
17
14
|
var _this;
|
|
18
15
|
_classCallCheck(this, ResizeObserverComponent);
|
|
19
|
-
_this =
|
|
16
|
+
_this = _callSuper(this, ResizeObserverComponent, arguments);
|
|
20
17
|
_this.componentWillUnmount = function () {
|
|
21
18
|
if (_this.resizeObserver) {
|
|
22
19
|
_this.destroyResizeObserver();
|
|
@@ -28,7 +25,7 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
28
25
|
onResize && onResize(entry);
|
|
29
26
|
});
|
|
30
27
|
// eslint-disable-next-line react/no-find-dom-node
|
|
31
|
-
_this.resizeObserver.observe(findDOMNode(
|
|
28
|
+
_this.resizeObserver.observe(findDOMNode(_this));
|
|
32
29
|
};
|
|
33
30
|
_this.destroyResizeObserver = function () {
|
|
34
31
|
_this.resizeObserver && _this.resizeObserver.disconnect();
|
|
@@ -36,7 +33,8 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
36
33
|
};
|
|
37
34
|
return _this;
|
|
38
35
|
}
|
|
39
|
-
|
|
36
|
+
_inherits(ResizeObserverComponent, _React$Component);
|
|
37
|
+
return _createClass(ResizeObserverComponent, [{
|
|
40
38
|
key: "componentDidMount",
|
|
41
39
|
value: function componentDidMount() {
|
|
42
40
|
if (! /*#__PURE__*/React.isValidElement(this.props.children)) {
|
|
@@ -59,6 +57,5 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
59
57
|
return this.props.children;
|
|
60
58
|
}
|
|
61
59
|
}]);
|
|
62
|
-
return ResizeObserverComponent;
|
|
63
60
|
}(React.Component);
|
|
64
61
|
export default ResizeObserverComponent;
|
package/es/_utils/usePopper.d.ts
CHANGED
|
@@ -27,5 +27,5 @@ export interface PopperProps {
|
|
|
27
27
|
getPopupContainer?: (locatorNode: HTMLElement) => HTMLElement;
|
|
28
28
|
onTransitionEnd?: (e: React.TransitionEvent) => void;
|
|
29
29
|
}
|
|
30
|
-
declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): JSX.Element;
|
|
30
|
+
declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): React.JSX.Element;
|
|
31
31
|
export default usePopper;
|
package/es/_utils/usePopper.js
CHANGED
|
@@ -47,44 +47,44 @@ function getRotate(matrix) {
|
|
|
47
47
|
}
|
|
48
48
|
return deg >= 360 ? 0 : deg;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var _getTranslatePos = function getTranslatePos(el) {
|
|
51
51
|
var elPos = {
|
|
52
52
|
top: getTranslate(el, 'y') || 0,
|
|
53
53
|
left: getTranslate(el, 'x') || 0
|
|
54
54
|
};
|
|
55
55
|
if (el.parentElement) {
|
|
56
|
-
var parentPos =
|
|
56
|
+
var parentPos = _getTranslatePos(el.parentElement);
|
|
57
57
|
elPos.top += parentPos.top;
|
|
58
58
|
elPos.left += parentPos.left;
|
|
59
59
|
}
|
|
60
60
|
return elPos;
|
|
61
61
|
};
|
|
62
|
-
var
|
|
62
|
+
var _getOffsetPos = function getOffsetPos(el) {
|
|
63
63
|
var elPos = {
|
|
64
64
|
top: el.offsetTop,
|
|
65
65
|
left: el.offsetLeft
|
|
66
66
|
};
|
|
67
67
|
if (el.offsetParent) {
|
|
68
|
-
var parentPos =
|
|
68
|
+
var parentPos = _getOffsetPos(el.offsetParent);
|
|
69
69
|
elPos.top += parentPos.top;
|
|
70
70
|
elPos.left += parentPos.left;
|
|
71
71
|
}
|
|
72
72
|
return elPos;
|
|
73
73
|
};
|
|
74
|
-
var
|
|
74
|
+
var _getBorderWidth = function getBorderWidth(el) {
|
|
75
75
|
var border = {
|
|
76
76
|
top: 0,
|
|
77
77
|
left: 0
|
|
78
78
|
};
|
|
79
79
|
if (el.offsetParent) {
|
|
80
80
|
var _context, _context2;
|
|
81
|
-
var parentBorder =
|
|
81
|
+
var parentBorder = _getBorderWidth(el.offsetParent);
|
|
82
82
|
border.top += parentBorder.top + parseInt(_sliceInstanceProperty(_context = getComputedStyle(el.offsetParent, null).borderTopWidth).call(_context, 0, -2));
|
|
83
83
|
border.left += parentBorder.left + parseInt(_sliceInstanceProperty(_context2 = getComputedStyle(el.offsetParent, null).borderTopWidth).call(_context2, 0, -2));
|
|
84
84
|
}
|
|
85
85
|
return border;
|
|
86
86
|
};
|
|
87
|
-
var
|
|
87
|
+
var _getScrollDist = function getScrollDist(el, container) {
|
|
88
88
|
var elScroll = {
|
|
89
89
|
top: el.scrollTop,
|
|
90
90
|
left: el.scrollLeft
|
|
@@ -94,7 +94,7 @@ var getScrollDist = function getScrollDist(el, container) {
|
|
|
94
94
|
elScroll.top -= document.documentElement.scrollTop;
|
|
95
95
|
elScroll.left -= document.documentElement.scrollLeft;
|
|
96
96
|
} else if (el.parentElement && container.contains(el.parentElement)) {
|
|
97
|
-
var parentScroll =
|
|
97
|
+
var parentScroll = _getScrollDist(el.parentElement, container);
|
|
98
98
|
elScroll.top += parentScroll.top;
|
|
99
99
|
elScroll.left += parentScroll.left;
|
|
100
100
|
}
|
|
@@ -114,7 +114,7 @@ var getRealDom = function getRealDom(locatorRef, locatorElement) {
|
|
|
114
114
|
return locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current[name];
|
|
115
115
|
};
|
|
116
116
|
function usePopper(locatorElement, popperElement, props) {
|
|
117
|
-
var _context3, _context4
|
|
117
|
+
var _context3, _context4;
|
|
118
118
|
var prefixCls = props.prefixCls,
|
|
119
119
|
onTrigger = props.onTrigger,
|
|
120
120
|
popperStyle = props.popperStyle,
|
|
@@ -204,13 +204,13 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
204
204
|
canAlign = _useState8[0],
|
|
205
205
|
setCanAlign = _useState8[1];
|
|
206
206
|
var _useState9 = useState(false),
|
|
207
|
-
|
|
208
|
-
visible =
|
|
209
|
-
setVisible =
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
active =
|
|
213
|
-
setActive =
|
|
207
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
208
|
+
visible = _useState0[0],
|
|
209
|
+
setVisible = _useState0[1];
|
|
210
|
+
var _useState1 = useState(false),
|
|
211
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
212
|
+
active = _useState10[0],
|
|
213
|
+
setActive = _useState10[1];
|
|
214
214
|
useEffect(function () {
|
|
215
215
|
if (props.visible) {
|
|
216
216
|
!exist && setExist(true);
|
|
@@ -220,18 +220,18 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
220
220
|
setVisible(false);
|
|
221
221
|
}
|
|
222
222
|
}, [exist, props.visible]);
|
|
223
|
-
var
|
|
223
|
+
var _useState11 = useState(''),
|
|
224
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
225
|
+
evType = _useState12[0],
|
|
226
|
+
setEvType = _useState12[1];
|
|
227
|
+
var _useState13 = useState(),
|
|
224
228
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var _useState15 = useState(),
|
|
229
|
+
align = _useState14[0],
|
|
230
|
+
setAlign = _useState14[1];
|
|
231
|
+
var _useState15 = useState(placement),
|
|
228
232
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
var _useState17 = useState(placement),
|
|
232
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
233
|
-
nextPlacement = _useState18[0],
|
|
234
|
-
setNextPlacement = _useState18[1];
|
|
233
|
+
nextPlacement = _useState16[0],
|
|
234
|
+
setNextPlacement = _useState16[1];
|
|
235
235
|
var alignPopper = useCallback(function () {
|
|
236
236
|
var realDom = getRealDom(locatorRef, locatorElement);
|
|
237
237
|
if (realDom && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current)) {
|
|
@@ -245,21 +245,21 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
245
245
|
right = _realDom$getBoundingC.right,
|
|
246
246
|
height = _realDom$getBoundingC.height,
|
|
247
247
|
width = _realDom$getBoundingC.width;
|
|
248
|
-
var
|
|
249
|
-
containerTop =
|
|
250
|
-
containerLeft =
|
|
251
|
-
var
|
|
252
|
-
locatorTop =
|
|
253
|
-
locatorLeft =
|
|
254
|
-
var
|
|
255
|
-
translateTop =
|
|
256
|
-
translateLeft =
|
|
257
|
-
var
|
|
258
|
-
borderTop =
|
|
259
|
-
borderLeft =
|
|
260
|
-
var
|
|
261
|
-
scrollTop =
|
|
262
|
-
scrollLeft =
|
|
248
|
+
var _getOffsetPos2 = _getOffsetPos(container),
|
|
249
|
+
containerTop = _getOffsetPos2.top,
|
|
250
|
+
containerLeft = _getOffsetPos2.left;
|
|
251
|
+
var _getOffsetPos3 = _getOffsetPos(realDom),
|
|
252
|
+
locatorTop = _getOffsetPos3.top,
|
|
253
|
+
locatorLeft = _getOffsetPos3.left;
|
|
254
|
+
var _getTranslatePos2 = _getTranslatePos(realDom),
|
|
255
|
+
translateTop = _getTranslatePos2.top,
|
|
256
|
+
translateLeft = _getTranslatePos2.left;
|
|
257
|
+
var _getBorderWidth2 = _getBorderWidth(realDom),
|
|
258
|
+
borderTop = _getBorderWidth2.top,
|
|
259
|
+
borderLeft = _getBorderWidth2.left;
|
|
260
|
+
var _getScrollDist2 = _getScrollDist(realDom.parentElement, container),
|
|
261
|
+
scrollTop = _getScrollDist2.top,
|
|
262
|
+
scrollLeft = _getScrollDist2.left;
|
|
263
263
|
var locatorPos = {
|
|
264
264
|
width: width,
|
|
265
265
|
height: height,
|
|
@@ -428,7 +428,7 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
428
428
|
}, 200);
|
|
429
429
|
}
|
|
430
430
|
}, [alignPopper, canAlign, onVisibleChange, props]);
|
|
431
|
-
var arrowStyle = (
|
|
431
|
+
var arrowStyle = _defineProperty(_defineProperty({}, "--arrowSize", arrowSize + 'px'), "--arrowSpill", arrowWidth / -2 + 'px');
|
|
432
432
|
if (arrowPos.top) arrowStyle["--arrowTop"] = arrowPos.top + 'px';
|
|
433
433
|
if (arrowPos.left) arrowStyle["--arrowLeft"] = arrowPos.left + 'px';
|
|
434
434
|
var popperContainerStyle = _extends(_extends(_extends({
|
package/es/alert/alert.js
CHANGED
|
@@ -55,7 +55,6 @@ function createAlertContainer(alertContainer, alertPrefixCls, bannerOffset) {
|
|
|
55
55
|
allBannerAlertPortals.set(posKey, container);
|
|
56
56
|
}
|
|
57
57
|
var Alert = function Alert(props) {
|
|
58
|
-
var _classNames, _classNames2;
|
|
59
58
|
var _useContext = useContext(ConfigContext),
|
|
60
59
|
getPrefixCls = _useContext.getPrefixCls,
|
|
61
60
|
prefixCls = _useContext.prefixCls,
|
|
@@ -137,7 +136,7 @@ var Alert = function Alert(props) {
|
|
|
137
136
|
clearTimeout(timerRef.current);
|
|
138
137
|
};
|
|
139
138
|
}, [delayOffTime, message, previousMessage, timerRef, hideAlert]);
|
|
140
|
-
var alertClasses = classNames(alertPrefixCls, className, (
|
|
139
|
+
var alertClasses = classNames(alertPrefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(alertPrefixCls, "-closable"), closable), "".concat(alertPrefixCls, "-banner"), banner), "".concat(alertPrefixCls, "-leave"), !visible || !message), "".concat(alertPrefixCls, "-visible"), visible && message), "".concat(alertPrefixCls, "-container"), true));
|
|
141
140
|
var handleClose = function handleClose() {
|
|
142
141
|
onClose && onClose();
|
|
143
142
|
setVisible(false);
|
|
@@ -173,13 +172,13 @@ var Alert = function Alert(props) {
|
|
|
173
172
|
ref: alertRef,
|
|
174
173
|
style: style
|
|
175
174
|
}, othersProps), showIcon && iconNode, /*#__PURE__*/React.createElement("div", {
|
|
176
|
-
className: classNames((
|
|
177
|
-
}, message), extra, closable && type !== 'success' && /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
className: classNames(_defineProperty(_defineProperty({}, "".concat(alertPrefixCls, "-message"), true), "".concat(alertPrefixCls, "-without-icon-message"), !showIcon))
|
|
176
|
+
}, message), extra, closable && type !== 'success' && (/*#__PURE__*/React.createElement("div", {
|
|
178
177
|
className: "".concat(alertPrefixCls, "-close-icon"),
|
|
179
178
|
onClick: handleClose
|
|
180
179
|
}, closeNode || /*#__PURE__*/React.createElement(Icon, {
|
|
181
180
|
type: "close"
|
|
182
|
-
})));
|
|
181
|
+
}))));
|
|
183
182
|
if (banner) {
|
|
184
183
|
return /*#__PURE__*/ReactDOM.createPortal(AlertComp, alertContainer.current);
|
|
185
184
|
} else {
|
package/es/anchor/anchor-link.js
CHANGED
|
@@ -41,10 +41,9 @@ var AnchorLink = function AnchorLink(props) {
|
|
|
41
41
|
scrollTo(href);
|
|
42
42
|
};
|
|
43
43
|
var renderAnchorLink = function renderAnchorLink() {
|
|
44
|
-
var _classNames2;
|
|
45
44
|
var active = activeLink === href;
|
|
46
45
|
var anchorLinkClasses = classNames("".concat(anchorLinkPrefixCls, "-link"), _defineProperty({}, "".concat(anchorLinkPrefixCls, "-link-active"), active), className);
|
|
47
|
-
var titleClassName = classNames("".concat(anchorLinkPrefixCls, "-link-title"), (
|
|
46
|
+
var titleClassName = classNames("".concat(anchorLinkPrefixCls, "-link-title"), _defineProperty(_defineProperty({}, "".concat(anchorLinkPrefixCls, "-link-title-active"), active), "".concat(anchorLinkPrefixCls, "-link-title-secondary"), !isFirstLevel && type === 'bookmarks'));
|
|
48
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
48
|
className: anchorLinkClasses
|
|
50
49
|
}, /*#__PURE__*/React.createElement("span", {
|
package/es/anchor/anchor.js
CHANGED
|
@@ -78,7 +78,7 @@ function scrollTo(y) {
|
|
|
78
78
|
var container = getContainer();
|
|
79
79
|
var scrollTop = getScroll(container, true);
|
|
80
80
|
var startTime = Date.now();
|
|
81
|
-
var
|
|
81
|
+
var _frameFunc = function frameFunc() {
|
|
82
82
|
var timestamp = Date.now();
|
|
83
83
|
var time = timestamp - startTime;
|
|
84
84
|
var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
|
@@ -93,12 +93,12 @@ function scrollTo(y) {
|
|
|
93
93
|
container.scrollTop = nextScrollTop;
|
|
94
94
|
}
|
|
95
95
|
if (time < duration) {
|
|
96
|
-
window.requestAnimationFrame(
|
|
96
|
+
window.requestAnimationFrame(_frameFunc);
|
|
97
97
|
} else if (typeof callback === 'function') {
|
|
98
98
|
callback();
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
window.requestAnimationFrame(
|
|
101
|
+
window.requestAnimationFrame(_frameFunc);
|
|
102
102
|
}
|
|
103
103
|
var InternalAnchor = function InternalAnchor(props, ref) {
|
|
104
104
|
var _a;
|
|
@@ -146,29 +146,29 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
146
146
|
anchorPosition = _useState8[0],
|
|
147
147
|
setAnchorPosition = _useState8[1];
|
|
148
148
|
var _useState9 = useState(0),
|
|
149
|
-
|
|
150
|
-
listWidth =
|
|
151
|
-
setListWidth =
|
|
149
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
150
|
+
listWidth = _useState0[0],
|
|
151
|
+
setListWidth = _useState0[1];
|
|
152
|
+
var _useState1 = useState(0),
|
|
153
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
154
|
+
menuWrapWidth = _useState10[0],
|
|
155
|
+
setMenuWrapWidth = _useState10[1];
|
|
152
156
|
var _useState11 = useState(0),
|
|
153
157
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var _useState13 = useState(0),
|
|
158
|
+
listPostion = _useState12[0],
|
|
159
|
+
setListPosition = _useState12[1];
|
|
160
|
+
var _useState13 = useState([0]),
|
|
157
161
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var _useState15 = useState(
|
|
162
|
+
positionHistory = _useState14[0],
|
|
163
|
+
setPositionHistory = _useState14[1];
|
|
164
|
+
var _useState15 = useState(!!props.visible),
|
|
161
165
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var _useState17 = useState(
|
|
166
|
+
optionShow = _useState16[0],
|
|
167
|
+
setOptionShow = _useState16[1];
|
|
168
|
+
var _useState17 = useState(false),
|
|
165
169
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var _useState19 = useState(false),
|
|
169
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
170
|
-
isLocked = _useState20[0],
|
|
171
|
-
setIsLocked = _useState20[1];
|
|
170
|
+
isLocked = _useState18[0],
|
|
171
|
+
setIsLocked = _useState18[1];
|
|
172
172
|
var isAdcanced = type === 'advanced';
|
|
173
173
|
// ref
|
|
174
174
|
var wrapperRef = React.useRef(null);
|
|
@@ -485,14 +485,14 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
485
485
|
ref: fixedRef,
|
|
486
486
|
className: anchorAdvancedClass,
|
|
487
487
|
style: dropdownStyle
|
|
488
|
-
}, lockedIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
488
|
+
}, lockedIcon !== false && (/*#__PURE__*/React.createElement("span", {
|
|
489
489
|
className: "".concat(anchorPrefixCls, "-advanced-lock"),
|
|
490
490
|
onClick: function onClick() {
|
|
491
491
|
return setIsLocked(!isLocked);
|
|
492
492
|
}
|
|
493
|
-
}, isLocked ? lock : unlock), anchorBookmarksContent(wrapperRef));
|
|
493
|
+
}, isLocked ? lock : unlock)), anchorBookmarksContent(wrapperRef));
|
|
494
494
|
};
|
|
495
|
-
var anchorAdvancedContent = usePopper(
|
|
495
|
+
var anchorAdvancedContent = usePopper(/*#__PURE__*/React.createElement("span", {
|
|
496
496
|
className: "".concat(anchorPrefixCls, "-advanced-arrows"),
|
|
497
497
|
ref: isAdcanced ? ref || iconRef : null
|
|
498
498
|
}, icon || /*#__PURE__*/React.createElement(Icon, {
|
package/es/avatar/avatar.js
CHANGED
|
@@ -12,7 +12,7 @@ import { Icon } from '../index';
|
|
|
12
12
|
export var AvatarSizes = tuple('large', 'middle', 'small', 'extra-small');
|
|
13
13
|
export var AvatarShapes = tuple('circle', 'square');
|
|
14
14
|
var InternalAvatar = function InternalAvatar(props, ref) {
|
|
15
|
-
var
|
|
15
|
+
var _context;
|
|
16
16
|
var _useContext = useContext(ConfigContext),
|
|
17
17
|
getPrefixCls = _useContext.getPrefixCls,
|
|
18
18
|
prefixCls = _useContext.prefixCls,
|
|
@@ -50,10 +50,10 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
50
50
|
var avatarChildrenRef = React.useRef();
|
|
51
51
|
// class
|
|
52
52
|
var avatarPrefixCls = getPrefixCls(prefixCls, 'avatar', customPrefixcls);
|
|
53
|
-
var sizeClasses = classNames((
|
|
53
|
+
var sizeClasses = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(avatarPrefixCls, "-lg"), size === 'large'), "".concat(avatarPrefixCls, "-md"), size === 'middle'), "".concat(avatarPrefixCls, "-sm"), size === 'small'), "".concat(avatarPrefixCls, "-xs"), size === 'extra-small'));
|
|
54
54
|
var hasImageElement = /*#__PURE__*/React.isValidElement(src);
|
|
55
55
|
var isShowDefaultIcon = !src && !icon && !children;
|
|
56
|
-
var avatarClasses = classNames(avatarPrefixCls, sizeClasses, (
|
|
56
|
+
var avatarClasses = classNames(avatarPrefixCls, sizeClasses, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _concatInstanceProperty(_context = "".concat(avatarPrefixCls, "-")).call(_context, shape), !!shape), "".concat(avatarPrefixCls, "-image"), hasImageElement || src && isImgExist), "".concat(avatarPrefixCls, "-icon"), !!icon || isShowDefaultIcon), "".concat(avatarPrefixCls, "-disabled"), disabled), className);
|
|
57
57
|
var sizeStyle = typeof size === 'number' ? {
|
|
58
58
|
width: size,
|
|
59
59
|
height: size,
|
package/es/badge/badge.js
CHANGED
|
@@ -20,7 +20,7 @@ import { tuple } from '../_utils/type';
|
|
|
20
20
|
export var PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');
|
|
21
21
|
export var BadgeSizes = tuple('default', 'small');
|
|
22
22
|
var Badge = function Badge(props) {
|
|
23
|
-
var
|
|
23
|
+
var _context, _context2;
|
|
24
24
|
var _useContext = useContext(ConfigContext),
|
|
25
25
|
getPrefixCls = _useContext.getPrefixCls,
|
|
26
26
|
prefixCls = _useContext.prefixCls,
|
|
@@ -74,10 +74,10 @@ var Badge = function Badge(props) {
|
|
|
74
74
|
return _extends(_extends({}, offsetStyle), style);
|
|
75
75
|
}, [offset, style]);
|
|
76
76
|
// =============================== Render ===============================
|
|
77
|
-
var badgeClassName = classNames(badgePrefixCls, (
|
|
77
|
+
var badgeClassName = classNames(badgePrefixCls, _defineProperty(_defineProperty({}, "".concat(badgePrefixCls, "-status"), hasStatus), "".concat(badgePrefixCls, "-not-a-wrapper"), !children), className);
|
|
78
78
|
var isDot = isDotRef.current;
|
|
79
|
-
var scrollNumberCls = classNames((
|
|
80
|
-
var statusCls = classNames((
|
|
79
|
+
var scrollNumberCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(badgePrefixCls, "-dot"), isDot), "".concat(badgePrefixCls, "-count"), !isDot), "".concat(badgePrefixCls, "-count-sm"), size === 'small'), "".concat(badgePrefixCls, "-multiple-words"), !isDot && mergedCount && mergedCount.toString().length > 1), _concatInstanceProperty(_context = "".concat(badgePrefixCls, "-status-")).call(_context, status), !!status));
|
|
80
|
+
var statusCls = classNames(_defineProperty(_defineProperty({}, "".concat(badgePrefixCls, "-status-dot"), hasStatus), _concatInstanceProperty(_context2 = "".concat(badgePrefixCls, "-status-")).call(_context2, status), !!status));
|
|
81
81
|
var statusStyle = {};
|
|
82
82
|
if (color) {
|
|
83
83
|
statusStyle.background = color;
|
|
@@ -89,13 +89,13 @@ var Badge = function Badge(props) {
|
|
|
89
89
|
className: "".concat(prefixCls, "-status-text")
|
|
90
90
|
}, text);
|
|
91
91
|
// Display Component
|
|
92
|
-
var displayNode = isSingleNumber ? /*#__PURE__*/React.createElement("sup", {
|
|
92
|
+
var displayNode = isSingleNumber ? (/*#__PURE__*/React.createElement("sup", {
|
|
93
93
|
className: scrollNumberCls,
|
|
94
94
|
style: _extends(_extends({}, mergedStyle), {
|
|
95
95
|
backgroundColor: color
|
|
96
96
|
}),
|
|
97
97
|
title: titleNode
|
|
98
|
-
}, mergedCount) : cloneElement(count, function (oriProps) {
|
|
98
|
+
}, mergedCount)) : cloneElement(count, function (oriProps) {
|
|
99
99
|
return {
|
|
100
100
|
style: _extends(_extends({}, mergedStyle), oriProps.style),
|
|
101
101
|
className: classNames("".concat(badgePrefixCls, "-custom-component"), oriProps === null || oriProps === void 0 ? void 0 : oriProps.className)
|