@kdcloudjs/kdesign 1.7.33-stable.12 → 1.7.33-stable.12-hotfix.3
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 +8518 -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 +78 -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 +86 -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/upload/scan-files.js
CHANGED
|
@@ -19,7 +19,7 @@ function loopFiles(item, callback) {
|
|
|
19
19
|
return sequence();
|
|
20
20
|
}
|
|
21
21
|
var scanFiles = function scanFiles(files, isAccepted, callback) {
|
|
22
|
-
var
|
|
22
|
+
var _traverseFileTree2 = function _traverseFileTree(item, path) {
|
|
23
23
|
item.path = path || '';
|
|
24
24
|
if (item.isFile) {
|
|
25
25
|
item.file(function (file) {
|
|
@@ -44,13 +44,13 @@ var scanFiles = function scanFiles(files, isAccepted, callback) {
|
|
|
44
44
|
loopFiles(item, function (entries) {
|
|
45
45
|
entries.forEach(function (entryItem) {
|
|
46
46
|
var _context;
|
|
47
|
-
|
|
47
|
+
_traverseFileTree2(entryItem, _concatInstanceProperty(_context = "".concat(path)).call(_context, item.name, "/"));
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
files.forEach(function (file) {
|
|
53
|
-
|
|
53
|
+
_traverseFileTree2(file.webkitGetAsEntry());
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
export default scanFiles;
|
package/es/upload/upload.js
CHANGED
|
@@ -72,7 +72,7 @@ function abort(file) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
var InternalUpload = function InternalUpload(props, ref) {
|
|
75
|
-
var _context5,
|
|
75
|
+
var _context5, _context6, _context7;
|
|
76
76
|
var _useContext = useContext(ConfigContext),
|
|
77
77
|
getPrefixCls = _useContext.getPrefixCls,
|
|
78
78
|
pkgPrefixCls = _useContext.prefixCls,
|
|
@@ -230,29 +230,29 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
230
230
|
onSuccess: function onSuccess(response, xhr) {
|
|
231
231
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
232
232
|
var url;
|
|
233
|
-
return _regeneratorRuntime.wrap(function
|
|
233
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
234
234
|
while (1) switch (_context3.prev = _context3.next) {
|
|
235
235
|
case 0:
|
|
236
236
|
file.status = 'done';
|
|
237
237
|
file.response = response;
|
|
238
238
|
file.xhr = xhr;
|
|
239
239
|
if (!(/image/.test(file.type) && !file.url)) {
|
|
240
|
-
_context3.next =
|
|
240
|
+
_context3.next = 2;
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
|
-
_context3.next =
|
|
243
|
+
_context3.next = 1;
|
|
244
244
|
return getBase64(file);
|
|
245
|
-
case
|
|
245
|
+
case 1:
|
|
246
246
|
url = _context3.sent;
|
|
247
247
|
file.url = url;
|
|
248
|
-
case
|
|
248
|
+
case 2:
|
|
249
249
|
delete reqs[uid];
|
|
250
250
|
_onSuccess && _onSuccess(response, file, xhr);
|
|
251
251
|
fileList = _mapInstanceProperty(fileList).call(fileList, function (fileItem) {
|
|
252
252
|
return fileItem.uid === file.uid ? file : fileItem;
|
|
253
253
|
});
|
|
254
254
|
onFileListChange(file, fileList);
|
|
255
|
-
case
|
|
255
|
+
case 3:
|
|
256
256
|
case "end":
|
|
257
257
|
return _context3.stop();
|
|
258
258
|
}
|
|
@@ -391,8 +391,8 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
391
391
|
disabled: disabled
|
|
392
392
|
}, className),
|
|
393
393
|
style: style
|
|
394
|
-
}, listType === 'text' && hasChildren && /*#__PURE__*/React.createElement("label", _extends({
|
|
395
|
-
className: classNames((
|
|
394
|
+
}, listType === 'text' && hasChildren && (/*#__PURE__*/React.createElement("label", _extends({
|
|
395
|
+
className: classNames(_defineProperty(_defineProperty({}, _concatInstanceProperty(_context5 = "".concat(prefixCls, "-")).call(_context5, type), true), "hover", hover))
|
|
396
396
|
}, dragEvents), /*#__PURE__*/React.createElement("span", {
|
|
397
397
|
className: "".concat(prefixCls, "-handle")
|
|
398
398
|
}, children), /*#__PURE__*/React.createElement("span", {
|
|
@@ -402,9 +402,9 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
402
402
|
type: "file"
|
|
403
403
|
}, inputFileProps, {
|
|
404
404
|
ref: inputRef
|
|
405
|
-
})))), (listType === 'picture' || !(listType === 'text' && (!showUploadList || !fileList.length))) && /*#__PURE__*/React.createElement("ul", {
|
|
405
|
+
}))))), (listType === 'picture' || !(listType === 'text' && (!showUploadList || !fileList.length))) && (/*#__PURE__*/React.createElement("ul", {
|
|
406
406
|
className: _concatInstanceProperty(_context6 = "".concat(prefixCls, "-")).call(_context6, listType, "-list")
|
|
407
|
-
}, listType === 'picture' && hasChildren && /*#__PURE__*/React.createElement("li", {
|
|
407
|
+
}, listType === 'picture' && hasChildren && (/*#__PURE__*/React.createElement("li", {
|
|
408
408
|
className: classNames(_concatInstanceProperty(_context7 = "".concat(prefixCls, "-")).call(_context7, listType, "-list-item"))
|
|
409
409
|
}, /*#__PURE__*/React.createElement("label", {
|
|
410
410
|
className: "".concat(prefixCls, "-select")
|
|
@@ -417,8 +417,8 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
417
417
|
type: "file"
|
|
418
418
|
}, inputFileProps, {
|
|
419
419
|
ref: inputRef
|
|
420
|
-
}))))), showUploadList && _mapInstanceProperty(fileList).call(fileList, function (file) {
|
|
421
|
-
return itemRender ? itemRender(
|
|
420
|
+
})))))), showUploadList && _mapInstanceProperty(fileList).call(fileList, function (file) {
|
|
421
|
+
return itemRender ? itemRender(/*#__PURE__*/React.createElement(Item, _extends({}, {
|
|
422
422
|
file: file,
|
|
423
423
|
prefixCls: prefixCls,
|
|
424
424
|
listType: listType,
|
|
@@ -426,7 +426,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
426
426
|
handleRemove: handleRemove,
|
|
427
427
|
disabled: disabled,
|
|
428
428
|
onPreview: onPreview
|
|
429
|
-
})), file, setFileList) : /*#__PURE__*/React.createElement(Item, _extends({
|
|
429
|
+
})), file, setFileList) : (/*#__PURE__*/React.createElement(Item, _extends({
|
|
430
430
|
key: file.uid
|
|
431
431
|
}, {
|
|
432
432
|
file: file,
|
|
@@ -436,11 +436,11 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
436
436
|
handleRemove: handleRemove,
|
|
437
437
|
disabled: disabled,
|
|
438
438
|
onPreview: onPreview
|
|
439
|
-
}));
|
|
440
|
-
})));
|
|
439
|
+
})));
|
|
440
|
+
}))));
|
|
441
441
|
};
|
|
442
442
|
var Item = function Item(_ref3) {
|
|
443
|
-
var _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18
|
|
443
|
+
var _context8, _context9, _context0, _context1, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18;
|
|
444
444
|
var file = _ref3.file,
|
|
445
445
|
prefixCls = _ref3.prefixCls,
|
|
446
446
|
listType = _ref3.listType,
|
|
@@ -462,54 +462,54 @@ var Item = function Item(_ref3) {
|
|
|
462
462
|
className: classNames(_concatInstanceProperty(_context8 = "".concat(prefixCls, "-")).call(_context8, listType, "-list-item"), {
|
|
463
463
|
error: file.status === 'error'
|
|
464
464
|
})
|
|
465
|
-
}, listType === 'text' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
465
|
+
}, listType === 'text' ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
466
466
|
className: _concatInstanceProperty(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon"),
|
|
467
467
|
onClick: handlePreview
|
|
468
468
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
469
469
|
spin: file.status === 'uploading',
|
|
470
470
|
type: mapStatus[file.status]
|
|
471
471
|
})), /*#__PURE__*/React.createElement("span", {
|
|
472
|
-
className: _concatInstanceProperty(
|
|
472
|
+
className: _concatInstanceProperty(_context0 = "".concat(prefixCls, "-")).call(_context0, listType, "-list-item-name"),
|
|
473
473
|
title: file.name,
|
|
474
474
|
onClick: handlePreview
|
|
475
475
|
}, file.name), /*#__PURE__*/React.createElement("span", {
|
|
476
|
-
className: _concatInstanceProperty(
|
|
476
|
+
className: _concatInstanceProperty(_context1 = "".concat(prefixCls, "-")).call(_context1, listType, "-list-item-size")
|
|
477
477
|
}, "(", getFileSize(file.size), ")"), /*#__PURE__*/React.createElement("div", {
|
|
478
|
-
className: _concatInstanceProperty(
|
|
479
|
-
}, file.status === 'error' && /*#__PURE__*/React.createElement("a", {
|
|
478
|
+
className: _concatInstanceProperty(_context10 = "".concat(prefixCls, "-")).call(_context10, listType, "-list-item-action")
|
|
479
|
+
}, file.status === 'error' && (/*#__PURE__*/React.createElement("a", {
|
|
480
480
|
href: "true",
|
|
481
|
-
className: _concatInstanceProperty(
|
|
481
|
+
className: _concatInstanceProperty(_context11 = "".concat(prefixCls, "-")).call(_context11, listType, "-list-item-reupload"),
|
|
482
482
|
onClick: handleReUpload.bind(_this, file)
|
|
483
|
-
}, "\u91CD\u65B0\u4E0A\u4F20"), !disabled && /*#__PURE__*/React.createElement("a", {
|
|
483
|
+
}, "\u91CD\u65B0\u4E0A\u4F20")), !disabled && (/*#__PURE__*/React.createElement("a", {
|
|
484
484
|
href: "true",
|
|
485
|
-
className: _concatInstanceProperty(
|
|
485
|
+
className: _concatInstanceProperty(_context12 = "".concat(prefixCls, "-")).call(_context12, listType, "-list-item-delete"),
|
|
486
486
|
onClick: handleRemove.bind(_this, file)
|
|
487
|
-
}, "\u5220\u9664"))) : file.status === 'uploading' ? /*#__PURE__*/React.createElement("div", {
|
|
488
|
-
className: _concatInstanceProperty(
|
|
487
|
+
}, "\u5220\u9664"))))) : file.status === 'uploading' ? (/*#__PURE__*/React.createElement("div", {
|
|
488
|
+
className: _concatInstanceProperty(_context13 = "".concat(prefixCls, "-")).call(_context13, listType, "-list-item-loading")
|
|
489
489
|
}, /*#__PURE__*/React.createElement(Progress, {
|
|
490
490
|
percent: file.percent,
|
|
491
491
|
textMap: ['文件上传中'],
|
|
492
492
|
showInfo: false
|
|
493
|
-
})) : file.status === 'error' ? /*#__PURE__*/React.createElement("div", {
|
|
494
|
-
className: _concatInstanceProperty(
|
|
493
|
+
}))) : file.status === 'error' ? (/*#__PURE__*/React.createElement("div", {
|
|
494
|
+
className: _concatInstanceProperty(_context14 = "".concat(prefixCls, "-")).call(_context14, listType, "-list-item-error")
|
|
495
495
|
}, /*#__PURE__*/React.createElement("div", {
|
|
496
|
-
className: _concatInstanceProperty(
|
|
496
|
+
className: _concatInstanceProperty(_context15 = "".concat(prefixCls, "-")).call(_context15, listType, "-list-item-error-text")
|
|
497
497
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
498
498
|
type: mapStatus[file.status],
|
|
499
499
|
style: {
|
|
500
500
|
verticalAlign: 'top'
|
|
501
501
|
}
|
|
502
|
-
}), "\u4E0A\u4F20\u5931\u8D25"), !disabled && /*#__PURE__*/React.createElement("div", {
|
|
503
|
-
className: _concatInstanceProperty(
|
|
502
|
+
}), "\u4E0A\u4F20\u5931\u8D25"), !disabled && (/*#__PURE__*/React.createElement("div", {
|
|
503
|
+
className: _concatInstanceProperty(_context16 = "".concat(prefixCls, "-")).call(_context16, listType, "-list-item-action")
|
|
504
504
|
}, /*#__PURE__*/React.createElement("a", {
|
|
505
505
|
href: "true",
|
|
506
|
-
className: _concatInstanceProperty(
|
|
506
|
+
className: _concatInstanceProperty(_context17 = "".concat(prefixCls, "-")).call(_context17, listType, "-list-item-reupload"),
|
|
507
507
|
onClick: handleReUpload.bind(_this, file)
|
|
508
508
|
}, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/React.createElement("a", {
|
|
509
509
|
href: "true",
|
|
510
|
-
className: _concatInstanceProperty(
|
|
510
|
+
className: _concatInstanceProperty(_context18 = "".concat(prefixCls, "-")).call(_context18, listType, "-list-item-delete"),
|
|
511
511
|
onClick: handleRemove.bind(_this, file)
|
|
512
|
-
}, "\u5220\u9664"))) : /*#__PURE__*/React.createElement(Image, {
|
|
512
|
+
}, "\u5220\u9664"))))) : (/*#__PURE__*/React.createElement(Image, {
|
|
513
513
|
onClick: handlePreview,
|
|
514
514
|
previewType: "upload",
|
|
515
515
|
name: file.name,
|
|
@@ -524,7 +524,7 @@ var Item = function Item(_ref3) {
|
|
|
524
524
|
type: "delete",
|
|
525
525
|
onClick: handleRemove.bind(_this, file)
|
|
526
526
|
})]
|
|
527
|
-
}));
|
|
527
|
+
})));
|
|
528
528
|
};
|
|
529
529
|
var Upload = /*#__PURE__*/forwardRef(InternalUpload);
|
|
530
530
|
Upload.displayName = 'Upload';
|
|
@@ -27,7 +27,6 @@ import ResizeObserver from '../_utils/resizeObserver';
|
|
|
27
27
|
export function isNumber(obj) {
|
|
28
28
|
return Object.prototype.toString.call(obj) === '[object Number]' && obj === obj; // eslint-disable-line
|
|
29
29
|
}
|
|
30
|
-
|
|
31
30
|
var DEFAULT_VIRTUAL_ITEM_HEIGHT = 32;
|
|
32
31
|
var KEY_VIRTUAL_ITEM_HEIGHT = "__virtual_item_height_".concat(_sliceInstanceProperty(_context = Math.random().toFixed(5)).call(_context, 2));
|
|
33
32
|
var useComputeVirtualItemHeight = function useComputeVirtualItemHeight(refItemHeightMap) {
|
|
@@ -476,7 +475,7 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
476
475
|
var index = refLongestItemIndex.current === null ? getLongestItemIndex(data) : refLongestItemIndex.current;
|
|
477
476
|
var item = data[index];
|
|
478
477
|
refLongestItemIndex.current = index;
|
|
479
|
-
return item ? /*#__PURE__*/React.createElement("div", {
|
|
478
|
+
return item ? (/*#__PURE__*/React.createElement("div", {
|
|
480
479
|
style: {
|
|
481
480
|
height: 1,
|
|
482
481
|
overflow: 'hidden',
|
|
@@ -484,7 +483,7 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
484
483
|
}
|
|
485
484
|
}, renderChild(item, index, {
|
|
486
485
|
style: {}
|
|
487
|
-
})) : null;
|
|
486
|
+
}))) : null;
|
|
488
487
|
}
|
|
489
488
|
return null;
|
|
490
489
|
};
|
|
@@ -505,14 +504,14 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
505
504
|
}),
|
|
506
505
|
className: className,
|
|
507
506
|
onScroll: isVirtual ? virtualListScrollHandler : rawListScrollHandler
|
|
508
|
-
}, restProps), isVirtual ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Filler, {
|
|
507
|
+
}, restProps), isVirtual ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Filler, {
|
|
509
508
|
height: itemTotalHeight,
|
|
510
509
|
offset: state.status === 'MEASURE_DONE' ? state.startItemTop : 0,
|
|
511
510
|
outerStyle: outerStyle,
|
|
512
511
|
innerStyle: innerStyle
|
|
513
|
-
}, renderChildren(_sliceInstanceProperty(data).call(data, state.startIndex, state.endIndex + 1), state.startIndex)), renderLongestItem()) : needFiller ? /*#__PURE__*/React.createElement(Filler, {
|
|
512
|
+
}, renderChildren(_sliceInstanceProperty(data).call(data, state.startIndex, state.endIndex + 1), state.startIndex)), renderLongestItem())) : needFiller ? (/*#__PURE__*/React.createElement(Filler, {
|
|
514
513
|
height: viewportHeight
|
|
515
|
-
}, renderChildren(data, 0)) : renderChildren(data, 0)));
|
|
514
|
+
}, renderChildren(data, 0))) : renderChildren(data, 0)));
|
|
516
515
|
});
|
|
517
516
|
VirtualList.displayName = 'VirtualList';
|
|
518
517
|
export default VirtualList;
|
package/lib/_utils/KeyCode.js
CHANGED
package/lib/_utils/arrayUtil.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.isArrayValueRepeat = exports.getStringToArray = void 0;
|
|
|
8
8
|
* 检查数组value的值是否唯一
|
|
9
9
|
* @param value 需要检查值是否唯一的数组
|
|
10
10
|
*/
|
|
11
|
-
var isArrayValueRepeat = function isArrayValueRepeat(value) {
|
|
11
|
+
var isArrayValueRepeat = exports.isArrayValueRepeat = function isArrayValueRepeat(value) {
|
|
12
12
|
var hash = {};
|
|
13
13
|
for (var i in value) {
|
|
14
14
|
if (hash[value[i]]) {
|
|
@@ -22,8 +22,7 @@ var isArrayValueRepeat = function isArrayValueRepeat(value) {
|
|
|
22
22
|
* 将字符串转为数组
|
|
23
23
|
* @param { string } val - 字符串
|
|
24
24
|
*/
|
|
25
|
-
exports.
|
|
26
|
-
var getStringToArray = function getStringToArray(val) {
|
|
25
|
+
var getStringToArray = exports.getStringToArray = function getStringToArray(val) {
|
|
27
26
|
if (val) {
|
|
28
27
|
var result = [];
|
|
29
28
|
val.split(' ').forEach(function (item) {
|
|
@@ -34,5 +33,4 @@ var getStringToArray = function getStringToArray(val) {
|
|
|
34
33
|
return result;
|
|
35
34
|
}
|
|
36
35
|
return [];
|
|
37
|
-
};
|
|
38
|
-
exports.getStringToArray = getStringToArray;
|
|
36
|
+
};
|
package/lib/_utils/formatUtil.js
CHANGED
|
@@ -113,7 +113,6 @@ function formatNumber(num, formatParams) {
|
|
|
113
113
|
floatNum = Math.abs(floatNum);
|
|
114
114
|
numInfo.numStr = (0, _slice.default)(_context3 = numInfo.numStr).call(_context3, 1); // 去除第一个负号
|
|
115
115
|
}
|
|
116
|
-
|
|
117
116
|
var numStrArr = numInfo.numStr.split('.');
|
|
118
117
|
numInfo.intStr = numStrArr[0];
|
|
119
118
|
numInfo.decimalStr = numStrArr[1] || '';
|
|
@@ -187,7 +186,6 @@ function formatEditNumber(num, _ref) {
|
|
|
187
186
|
floatNum = Math.abs(floatNum);
|
|
188
187
|
numInfo.numStr = (0, _slice.default)(_context4 = numInfo.numStr).call(_context4, 1); // 去除第一个负号
|
|
189
188
|
}
|
|
190
|
-
|
|
191
189
|
var numStrArr = numInfo.numStr.split('.');
|
|
192
190
|
numInfo.intStr = numStrArr[0];
|
|
193
191
|
numInfo.decimalStr = numStrArr[1] || '';
|
package/lib/_utils/hooks.js
CHANGED
|
@@ -25,9 +25,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
|
|
|
25
25
|
var _react = require("react");
|
|
26
26
|
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
|
|
27
27
|
var _devwarning = _interopRequireDefault(require("./devwarning"));
|
|
28
|
-
function _createForOfIteratorHelper(
|
|
29
|
-
function _unsupportedIterableToArray(
|
|
30
|
-
function _arrayLikeToArray(
|
|
28
|
+
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; } } }; }
|
|
29
|
+
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; } }
|
|
30
|
+
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; }
|
|
31
31
|
/**
|
|
32
32
|
* @description 点击指定区域外执行回调
|
|
33
33
|
*
|
package/lib/_utils/index.js
CHANGED
|
@@ -14,9 +14,8 @@ var _compDefaultProps = _interopRequireDefault(require("../config-provider/compD
|
|
|
14
14
|
* @param {any} userDefaultProps 用户自定义组件默认属性
|
|
15
15
|
* @param {any} compProps 组件接收到的属性
|
|
16
16
|
*/
|
|
17
|
-
var getCompProps = function getCompProps(compName, userDefaultProps, compProps) {
|
|
17
|
+
var getCompProps = exports.getCompProps = function getCompProps(compName, userDefaultProps, compProps) {
|
|
18
18
|
var defaultProps = _compDefaultProps.default[compName];
|
|
19
19
|
var userProps = userDefaultProps && userDefaultProps[compName] || {};
|
|
20
20
|
return (0, _extends2.default)({}, defaultProps, userProps, compProps || {});
|
|
21
|
-
};
|
|
22
|
-
exports.getCompProps = getCompProps;
|
|
21
|
+
};
|
package/lib/_utils/raf.js
CHANGED
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.raf = exports.caf = void 0;
|
|
7
7
|
var target = typeof window === 'undefined' ? global : window;
|
|
8
8
|
var vendors = ['webkit', 'ms', 'moz', 'o'];
|
|
9
|
-
var raf = target.requestAnimationFrame; // eslint-disable-line
|
|
10
|
-
exports.
|
|
11
|
-
var caf = target.cancelAnimationFrame; // eslint-disable-line
|
|
12
|
-
exports.caf = caf;
|
|
9
|
+
var raf = exports.raf = target.requestAnimationFrame; // eslint-disable-line
|
|
10
|
+
var caf = exports.caf = target.cancelAnimationFrame; // eslint-disable-line
|
|
13
11
|
if (!raf || !caf) {
|
|
14
12
|
vendors.some(function (prefix) {
|
|
15
13
|
exports.raf = raf = target["".concat(prefix, "RequestAnimationFrame")];
|
package/lib/_utils/reactNode.js
CHANGED
|
@@ -11,10 +11,8 @@ exports.isFragment = isFragment;
|
|
|
11
11
|
exports.isValidElement = void 0;
|
|
12
12
|
exports.replaceElement = replaceElement;
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
var isValidElement = React.isValidElement;
|
|
17
|
-
exports.isValidElement = isValidElement;
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
var isValidElement = exports.isValidElement = React.isValidElement;
|
|
18
16
|
function replaceElement(element, replacement, props) {
|
|
19
17
|
if (!isValidElement(element)) return replacement;
|
|
20
18
|
return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
|
|
@@ -8,22 +8,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
13
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
14
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
15
14
|
var _react = _interopRequireDefault(require("react"));
|
|
16
15
|
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
|
|
17
16
|
var _reactDom = require("react-dom");
|
|
18
|
-
function
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
19
|
var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
21
|
-
(0, _inherits2.default)(ResizeObserverComponent, _React$Component);
|
|
22
|
-
var _super = _createSuper(ResizeObserverComponent);
|
|
23
20
|
function ResizeObserverComponent() {
|
|
24
21
|
var _this;
|
|
25
22
|
(0, _classCallCheck2.default)(this, ResizeObserverComponent);
|
|
26
|
-
_this =
|
|
23
|
+
_this = _callSuper(this, ResizeObserverComponent, arguments);
|
|
27
24
|
_this.componentWillUnmount = function () {
|
|
28
25
|
if (_this.resizeObserver) {
|
|
29
26
|
_this.destroyResizeObserver();
|
|
@@ -35,7 +32,7 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
35
32
|
onResize && onResize(entry);
|
|
36
33
|
});
|
|
37
34
|
// eslint-disable-next-line react/no-find-dom-node
|
|
38
|
-
_this.resizeObserver.observe((0, _reactDom.findDOMNode)(
|
|
35
|
+
_this.resizeObserver.observe((0, _reactDom.findDOMNode)(_this));
|
|
39
36
|
};
|
|
40
37
|
_this.destroyResizeObserver = function () {
|
|
41
38
|
_this.resizeObserver && _this.resizeObserver.disconnect();
|
|
@@ -43,7 +40,8 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
43
40
|
};
|
|
44
41
|
return _this;
|
|
45
42
|
}
|
|
46
|
-
(0,
|
|
43
|
+
(0, _inherits2.default)(ResizeObserverComponent, _React$Component);
|
|
44
|
+
return (0, _createClass2.default)(ResizeObserverComponent, [{
|
|
47
45
|
key: "componentDidMount",
|
|
48
46
|
value: function componentDidMount() {
|
|
49
47
|
if (! /*#__PURE__*/_react.default.isValidElement(this.props.children)) {
|
|
@@ -66,7 +64,5 @@ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
66
64
|
return this.props.children;
|
|
67
65
|
}
|
|
68
66
|
}]);
|
|
69
|
-
return ResizeObserverComponent;
|
|
70
67
|
}(_react.default.Component);
|
|
71
|
-
var _default = ResizeObserverComponent;
|
|
72
|
-
exports.default = _default;
|
|
68
|
+
var _default = exports.default = ResizeObserverComponent;
|
package/lib/_utils/type.js
CHANGED
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.tupleNum = exports.tuple = void 0;
|
|
7
7
|
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
|
8
|
-
var tuple = function tuple() {
|
|
8
|
+
var tuple = exports.tuple = function tuple() {
|
|
9
9
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
10
|
args[_key] = arguments[_key];
|
|
11
11
|
}
|
|
12
12
|
return args;
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
15
|
-
var tupleNum = function tupleNum() {
|
|
14
|
+
var tupleNum = exports.tupleNum = function tupleNum() {
|
|
16
15
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
17
16
|
args[_key2] = arguments[_key2];
|
|
18
17
|
}
|
|
19
18
|
return args;
|
|
20
|
-
};
|
|
21
|
-
exports.tupleNum = tupleNum;
|
|
19
|
+
};
|
|
@@ -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;
|