@unicom-cloud/ui 0.8.90 → 0.8.92
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/Affix.js +10 -9
- package/Alert.js +6 -5
- package/AutoComplete.js +11 -8
- package/BackTop.js +12 -10
- package/Badge.js +10 -9
- package/Breadcrumb.js +10 -9
- package/Button.js +9 -8
- package/Calendar.js +13 -10
- package/Card.js +9 -8
- package/Carousel.js +9 -8
- package/Cascader.js +2 -2
- package/Checkbox.js +8 -6
- package/Collapse.js +3 -2
- package/ColorPicker.js +16 -13
- package/Comment.js +6 -5
- package/ConfigProvider.js +6 -5
- package/Copy.js +6 -5
- package/DatePicker.js +13 -8
- package/Descriptions.js +5 -4
- package/Details.js +15 -0
- package/Development.js +5 -3
- package/Divider.js +5 -4
- package/Draggable.js +4 -3
- package/Dropdown.js +12 -10
- package/Empty.js +6 -3
- package/Form.js +17 -13
- package/Icon.js +7 -6
- package/IconHover.js +4 -2
- package/Image.js +5 -5
- package/Input.js +17 -12
- package/InputNumber.js +7 -5
- package/Layout.js +13 -12
- package/Link.js +6 -5
- package/List.js +9 -7
- package/Loading.js +3 -2
- package/Mentions.js +7 -5
- package/Menu.js +7 -6
- package/Message.js +13 -6
- package/Modal.js +2 -2
- package/Notice.js +10 -7
- package/Notification.js +13 -7
- package/OverflowEllipsis.js +5 -4
- package/PageHeader.js +9 -7
- package/Pagination.js +2 -2
- package/Popconfirm.js +6 -5
- package/Popover.js +6 -5
- package/Progress.js +6 -5
- package/Radio.js +8 -6
- package/Rate.js +6 -5
- package/ResizeBox.js +12 -11
- package/Result.js +5 -4
- package/Select.js +6 -5
- package/SelectView.js +2 -2
- package/Skeleton.js +6 -5
- package/Slider.js +11 -8
- package/Space.js +6 -5
- package/SpeechSynthesis.js +4 -2
- package/Spin.js +6 -5
- package/Statistic.js +10 -8
- package/Steps.js +9 -8
- package/SuspenseFallbackTest.js +3 -2
- package/Switch.js +13 -8
- package/Table.js +27 -15
- package/Tabs.js +5 -5
- package/Tag.js +8 -6
- package/Tooltip.js +9 -7
- package/Transfer.js +8 -6
- package/Tree.js +3 -2
- package/TreeSelect.js +3 -3
- package/Trigger.js +17 -12
- package/Typography.js +7 -6
- package/Upload.js +6 -5
- package/affix/index.js +32 -31
- package/alert/index.js +60 -70
- package/anchor/Anchor.js +46 -45
- package/anchor/Link.js +9 -8
- package/anchor/util.js +15 -14
- package/auto-complete/index.js +154 -15
- package/avatar/Avatar.js +6 -5
- package/avatar/Group.js +17 -16
- package/back-top/index.js +38 -36
- package/badge/Count.js +11 -11
- package/badge/index.js +35 -34
- package/breadcrumb/Item.js +7 -7
- package/breadcrumb/index.js +29 -28
- package/button/Group.js +8 -7
- package/button/index.js +13 -12
- package/calendar/Month.js +140 -10
- package/calendar/Year.js +21 -20
- package/calendar/header/Panel.js +57 -0
- package/calendar/header/index.js +110 -0
- package/calendar/hook/useCellClassName.js +41 -0
- package/calendar/index.js +171 -14
- package/card/Grid.js +12 -11
- package/card/Meta.js +14 -13
- package/card/index.js +11 -10
- package/carousel/Arrow.js +16 -15
- package/carousel/Indicator.js +19 -18
- package/carousel/index.js +16 -15
- package/cascader/Cascader.js +299 -24
- package/cascader/base/node.js +142 -0
- package/cascader/base/store.js +93 -0
- package/cascader/hook/useRefCurrent.js +12 -0
- package/cascader/index.js +2 -2
- package/cascader/panel/List.js +278 -0
- package/cascader/panel/Option.js +33 -0
- package/cascader/panel/Search.js +169 -0
- package/cascader/util.js +64 -12
- package/checkbox/Checkbox.js +125 -17
- package/checkbox/Group.js +97 -12
- package/checkbox/GroupBlock.js +62 -6
- package/checkbox/index.js +7 -6
- package/collapse/Collapse.js +67 -234
- package/collapse/Item.js +181 -9
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +21 -20
- package/color-picker/InputAlpha.js +10 -9
- package/color-picker/InputHex.js +27 -25
- package/color-picker/InputRgb.js +27 -24
- package/color-picker/Mode.js +6 -7
- package/color-picker/Palette.js +16 -14
- package/color-picker/Panel.js +269 -15
- package/color-picker/colors.js +8 -7
- package/color-picker/hooks/useColorPicker.js +128 -0
- package/{chunk/k-OUstoD.js → color-picker/hooks/useControlBlock.js} +1 -1
- package/color-picker/index.js +160 -24
- package/color-picker/utils.js +18 -17
- package/comment/index.js +23 -22
- package/components/common/development/index.js +32 -0
- package/components/common/empty/index.js +17 -0
- package/components/common/higher-order/with-speech-synthesis/index.js +61 -0
- package/{chunk/DxVvggX2.js → components/common/hooks/useComputedState.js} +2 -2
- package/components/common/hooks/useCreate.js +8 -0
- package/components/common/hooks/useForceUpdate.js +8 -0
- package/{chunk/B4YRLi8r.js → components/common/hooks/useId.js} +5 -5
- package/components/common/hooks/useInView.js +31 -0
- package/{chunk/B4WG1mhs.js → components/common/hooks/useIntersectionObserver.js} +9 -9
- package/components/common/hooks/useInterval.js +18 -0
- package/{chunk/oopARUrq.js → components/common/hooks/useIsFirstRender.js} +1 -1
- package/components/common/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/components/common/hooks/useKeyboardEvent.js +17 -0
- package/{chunk/BL9DMeor.js → components/common/hooks/useListenResize.js} +1 -1
- package/{chunk/BXAeh0_V.js → components/common/hooks/useMedia.js} +1 -1
- package/{chunk/BFTV6myl.js → components/common/hooks/useMergeProps.js} +3 -3
- package/{chunk/D5wldVRB.js → components/common/hooks/useMergeValue.js} +8 -8
- package/{chunk/zmmqLCF4.js → components/common/hooks/useOnlineStatus.js} +1 -1
- package/{chunk/DU1RCDfh.js → components/common/hooks/useOverflowHidden.js} +1 -1
- package/components/common/hooks/useOverrideRef.js +14 -0
- package/{chunk/BsY85n3_.js → components/common/hooks/usePersistCallback.js} +2 -2
- package/{chunk/rT6qmv-Y.js → components/common/hooks/usePrefersColorSchemeDark.js} +5 -5
- package/components/common/hooks/usePrevious.js +10 -0
- package/components/common/hooks/useRefs.js +10 -0
- package/{chunk/CmZzBtA4.js → components/common/hooks/useResizeObserver.js} +4 -4
- package/{chunk/hEWZQ8Zi.js → components/common/hooks/useStateCallback.js} +5 -5
- package/{chunk/Duezix3m.js → components/common/hooks/useStateWithPromise.js} +6 -6
- package/components/common/hooks/useUpdateEffect.js +12 -0
- package/components/common/hooks/useWatch.js +11 -0
- package/{chunk/CB4jGw4K.js → components/common/hooks/useWindowSize.js} +6 -6
- package/components/common/icons/file/index.js +56 -0
- package/components/common/space/index.js +110 -0
- package/components/common/utils/PqbCSSTransition.js +32 -0
- package/{chunk/B6r8jPCd.js → components/common/utils/constant.js} +2 -2
- package/components/common/utils/copy.js +7 -0
- package/{chunk/B3LeSidy.js → components/common/utils/dayjs.js} +25 -24
- package/components/common/utils/dom.js +51 -0
- package/components/common/utils/fillNBSP.js +7 -0
- package/{chunk/B7M-FGia.js → components/common/utils/getHighlightText.js} +11 -10
- package/{chunk/Dh7Osrvr.js → components/common/utils/getHotkeyHandler.js} +6 -5
- package/{chunk/DKHXj8Kf.js → components/common/utils/getStringLength.js} +3 -2
- package/components/common/utils/include.js +10 -0
- package/components/common/utils/is.js +126 -0
- package/{chunk/DH7HTOV_.js → components/common/utils/mergeProps.js} +3 -2
- package/components/common/utils/mergedToString.js +16 -0
- package/components/common/utils/omit.js +12 -0
- package/components/common/utils/pad.js +18 -0
- package/components/common/utils/pick.js +18 -0
- package/components/common/utils/react19Adapter.js +3 -0
- package/{chunk/BZ3igxQN.js → components/common/utils/reactDOM.js} +13 -13
- package/components/common/utils/resizeObserverEffect.js +23 -0
- package/components/common/utils/scrollIntoView.js +25 -0
- package/components/common/utils/setDarkTheme.js +27 -0
- package/components/common/utils/setPrimaryColor.js +30 -0
- package/{chunk/DzekwbB4.js → components/common/utils/setTheme.js} +16 -14
- package/components/common/utils/style.js +39 -0
- package/components/common/utils/throttleByRaf.js +16 -0
- package/components/common/utils/warning.js +11 -0
- package/config-provider/ConfigProvider.js +56 -13
- package/config-provider/context.js +24 -7
- package/config-provider/index.js +6 -5
- package/copy/index.js +15 -14
- package/date-picker/Picker.js +75 -73
- package/date-picker/RangePicker.js +585 -22
- package/date-picker/hook/useCellClassName.js +60 -0
- package/date-picker/index.js +32 -27
- package/date-picker/panel/Body.js +88 -0
- package/date-picker/panel/Footer.js +71 -0
- package/date-picker/panel/Header.js +69 -0
- package/date-picker/panel/Shortcut.js +45 -0
- package/date-picker/panel/WeekList.js +19 -0
- package/date-picker/panel/date/index.js +193 -0
- package/date-picker/panel/month/index.js +112 -0
- package/date-picker/panel/quarter/index.js +97 -0
- package/date-picker/panel/range/index.js +250 -0
- package/date-picker/panel/week/index.js +35 -0
- package/date-picker/panel/year/index.js +73 -0
- package/date-picker/util.js +8 -8
- package/descriptions/index.js +24 -23
- package/details/index.js +82 -0
- package/details/interface.js +1 -0
- package/development/index.js +17 -36
- package/dist/compute-scroll-into-view/src/index.js +126 -0
- package/dist/dom-helpers/addClass.js +10 -0
- package/dist/dom-helpers/hasClass.js +8 -0
- package/dist/dom-helpers/removeClass.js +18 -0
- package/dist/react-transition-group/chunk/CPfP7aNL.js +381 -0
- package/dist/react-transition-group/chunk/F6QOOr2H.js +500 -0
- package/dist/react-transition-group/src/CSSTransition.js +202 -0
- package/dist/react-transition-group/src/ReplaceTransition.js +43 -0
- package/dist/react-transition-group/src/SwitchTransition.js +117 -0
- package/dist/react-transition-group/src/TransitionGroup.js +160 -0
- package/dist/react-transition-group/src/TransitionGroupContext.js +5 -0
- package/dist/react-transition-group/src/config.js +6 -0
- package/{chunk/Coz3rCng.js → dist/scroll-into-view-if-needed/src/index.js} +5 -5
- package/dist/tinycolor/chunk/DGZSWe7E.js +182 -0
- package/dist/tinycolor/customize/index.js +12 -0
- package/dist/tinycolor/src/conversion.js +143 -0
- package/dist/tinycolor/src/css-color-names.js +153 -0
- package/dist/tinycolor/src/format-input.js +77 -0
- package/dist/tinycolor/src/index.js +388 -0
- package/dist/tinycolor/src/util.js +32 -0
- package/dist/tween/src/easing.js +43 -0
- package/dist/tween/src/tween.js +70 -0
- package/dist/validate/chunk/BXTR2LmP.js +49 -0
- package/{chunk/DEuVgCzp.js → dist/validate/src/index.js} +91 -151
- package/dist/validate/src/util.js +22 -0
- package/divider/index.js +15 -14
- package/draggable/index.js +17 -16
- package/drawer/Drawer.js +41 -39
- package/dropdown/Button.js +88 -9
- package/dropdown/index.js +85 -163
- package/empty/index.js +21 -5
- package/form/Control.js +1 -1
- package/form/Form.js +159 -14
- package/form/FormItem.js +30 -29
- package/form/FormList.js +1 -1
- package/form/context.js +1 -1
- package/form/hook/useContext.js +32 -0
- package/form/hook/useForm.js +58 -0
- package/form/hook/useState.js +31 -0
- package/form/hook/useWatch.js +36 -0
- package/form/index.js +29 -106
- package/form/promisify.js +1 -1
- package/form/store.js +1 -1
- package/form/util.js +5 -5
- package/grid/Col.js +14 -13
- package/grid/Grid.js +23 -22
- package/grid/GridItem.js +23 -22
- package/grid/Row.js +19 -18
- package/{chunk/xAb6ZgqS.js → grid/hook/useResponsiveState.js} +2 -2
- package/hooks/index.js +38 -38
- package/hooks/use-watermark/utils.js +9 -0
- package/hooks/useComputedState.js +2 -2
- package/hooks/useCreate.js +2 -2
- package/hooks/useForceUpdate.js +2 -2
- package/hooks/useId.js +2 -2
- package/hooks/useInView.js +2 -2
- package/hooks/useIntersectionObserver.js +2 -2
- package/hooks/useInterval.js +2 -2
- package/hooks/useIsFirstRender.js +2 -2
- package/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/hooks/useKeyboardEvent.js +2 -2
- package/hooks/useListenResize.js +2 -2
- package/hooks/useMedia.js +2 -2
- package/hooks/useMergeProps.js +2 -2
- package/hooks/useMergeValue.js +2 -2
- package/hooks/useOnlineStatus.js +2 -2
- package/hooks/useOverflowHidden.js +2 -2
- package/hooks/useOverrideRef.js +2 -2
- package/hooks/usePersistCallback.js +2 -2
- package/hooks/usePrefersColorSchemeDark.js +2 -2
- package/hooks/usePrevious.js +2 -2
- package/hooks/useRefs.js +2 -2
- package/hooks/useResizeObserver.js +2 -2
- package/hooks/useStateCallback.js +2 -2
- package/hooks/useStateWithPromise.js +2 -2
- package/hooks/useUpdateEffect.js +2 -2
- package/hooks/useVerificationCode.js +21 -21
- package/hooks/useWatch.js +2 -2
- package/hooks/useWatermark.js +72 -77
- package/hooks/useWindowSize.js +2 -2
- package/icon/addFromIconFontCn.js +31 -5
- package/icon/index.js +22 -48
- package/icon-hover/index.js +37 -5
- package/icons/file.js +15 -63
- package/image/Image.js +35 -32
- package/image/ImageFooter.js +44 -6
- package/image/ImagePreview.js +480 -34
- package/image/ImagePreviewArrow.js +8 -7
- package/image/ImagePreviewGroup.js +9 -9
- package/image/index.js +3 -3
- package/image/util/getFixTranslate.js +7 -0
- package/image/util/getScale.js +74 -0
- package/image/util/hook/useImageStatus.js +16 -0
- package/image/util/hook/useShowFooter.js +7 -0
- package/index.js +681 -614
- package/input/Button.js +67 -9
- package/input/Group.js +9 -8
- package/input/Input.js +158 -684
- package/input/InputElement.js +33 -33
- package/input/Number.js +2 -2
- package/input/Password.js +69 -11
- package/input/Search.js +68 -11
- package/input/Textarea.js +166 -14
- package/input/index.js +17 -13
- package/input-number/index.js +209 -16
- package/input-number/useSelectionRange.js +3 -3
- package/input-tag/InputTag.js +78 -72
- package/layout/Content.js +7 -6
- package/layout/Footer.js +7 -6
- package/layout/Header.js +5 -4
- package/layout/Sider.js +19 -18
- package/layout/index.js +21 -20
- package/link/index.js +15 -14
- package/list/Item.js +12 -11
- package/list/Meta.js +7 -6
- package/list/index.js +268 -17
- package/loading/index.js +13 -13
- package/loading/style/index.module.less.js +4 -0
- package/locale/en-US.js +4 -3
- package/locale/tr-TR.js +4 -3
- package/mentions/index.js +145 -11
- package/menu/Item.js +3 -3
- package/menu/Menu.js +182 -24
- package/menu/OverflowWrap.js +88 -8
- package/menu/index.js +9 -9
- package/menu/sub-menu/Inline.js +111 -0
- package/menu/sub-menu/Pop.js +120 -0
- package/menu/sub-menu/index.js +17 -0
- package/message/index.js +147 -13
- package/message/useMessage.js +57 -5
- package/modal/Confirm.js +110 -11
- package/modal/Modal.js +440 -20
- package/modal/index.js +1 -1
- package/modal/use-modal/Hook.js +52 -0
- package/modal/use-modal/index.js +68 -0
- package/notice/index.js +176 -17
- package/notification/index.js +149 -15
- package/notification/useNotification.js +52 -4
- package/overflow-ellipsis/OverflowItem.js +17 -16
- package/overflow-ellipsis/index.js +30 -29
- package/package.json +1 -1
- package/page-header/index.js +30 -28
- package/pagination/PageItem.js +16 -15
- package/pagination/PageJumper.js +13 -12
- package/pagination/PageOption.js +45 -5
- package/pagination/Pagination.js +244 -11
- package/pagination/index.js +2 -2
- package/picker/Input.js +47 -45
- package/picker/InputRange.js +53 -51
- package/popconfirm/index.js +10 -9
- package/popover/index.js +12 -11
- package/portal/Portal.js +7 -7
- package/progress/CircleProgress.js +1 -1
- package/progress/index.js +32 -31
- package/radio/Group.js +94 -14
- package/radio/GroupBlock.js +68 -7
- package/radio/Radio.js +92 -14
- package/radio/index.js +7 -6
- package/rate/index.js +31 -30
- package/resize-box/ResizeTrigger.js +10 -9
- package/resize-box/Split.js +66 -65
- package/resize-box/SplitGroup.js +10 -9
- package/resize-box/index.js +18 -17
- package/result/index.js +33 -32
- package/select/OptGroup.js +10 -10
- package/select/Option.js +93 -6
- package/select/Select.js +548 -24
- package/select/index.js +3 -3
- package/select/util.js +139 -18
- package/select-view/Core.js +23 -21
- package/select-view/index.js +7 -7
- package/skeleton/index.js +12 -11
- package/slider/Button.js +24 -23
- package/slider/Input.js +11 -11
- package/slider/hook/useInterval.js +73 -0
- package/slider/hook/useLegalValue.js +70 -0
- package/slider/index.js +220 -345
- package/space/index.js +38 -127
- package/space-/index.js +17 -16
- package/speech-synthesis/index.js +9 -63
- package/speech-synthesis/style/index.less.js +1 -0
- package/spin/DotLoading.js +10 -9
- package/spin/index.js +21 -20
- package/statistic/Countdown.js +16 -15
- package/statistic/index.js +45 -43
- package/statistic/util.js +1 -1
- package/steps/index.js +14 -13
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +6 -5
- package/suspense-fallback-test/style/index.less.js +1 -0
- package/switch/index.js +43 -38
- package/table/Table.js +627 -21
- package/table/hook/useColumns.js +141 -0
- package/table/hook/useComponent.js +28 -0
- package/table/hook/useExpand.js +36 -0
- package/table/hook/useRowSelection.js +94 -0
- package/table/hook/useSorter.js +54 -0
- package/table/hook/useStickyClassNames.js +30 -0
- package/table/hook/useStickyOffsets.js +28 -0
- package/table/hook/useThResizable.js +39 -0
- package/table/index.js +28 -15
- package/table/summary/Cell.js +10 -0
- package/table/summary/Row.js +25 -0
- package/table/summary/context.js +5 -0
- package/table/summary/index.js +12 -0
- package/table/tbody/Td.js +180 -0
- package/table/tbody/Tr.js +165 -0
- package/table/tbody/index.js +154 -0
- package/table/tfoot/index.js +16 -0
- package/table/th-resizable/index.js +46 -0
- package/table/thead/Column.js +251 -0
- package/table/thead/index.js +129 -0
- package/tabs/Tab.js +169 -16
- package/tabs/TabContent.js +51 -6
- package/tabs/TabPane.js +13 -12
- package/tabs/hook/useDomSize.js +17 -0
- package/tabs/hook/useHeaderScroll.js +67 -0
- package/tabs/index.js +6 -6
- package/tabs/tab-header/DropdownIcon.js +66 -0
- package/tabs/tab-header/TabInk.js +66 -0
- package/tabs/tab-header/TabNavIcon.js +66 -0
- package/tabs/tab-header/TabTitle.js +78 -0
- package/tabs/tab-header/index.js +331 -0
- package/tag/index.js +32 -30
- package/time-picker/Picker.js +56 -55
- package/time-picker/RangePicker.js +14 -14
- package/time-picker/TimeColumn.js +1 -1
- package/time-picker/TimePicker.js +42 -41
- package/time-picker/util.js +23 -22
- package/timeline/Item.js +4 -3
- package/timeline/Timeline.js +12 -11
- package/tooltip/index.js +35 -33
- package/transfer/Item.js +104 -9
- package/transfer/List.js +186 -13
- package/transfer/index.js +181 -13
- package/tree/Animation.js +100 -9
- package/tree/Node.js +212 -13
- package/tree/NodeList.js +80 -6
- package/tree/Tree.js +595 -17
- package/tree/index.js +3 -2
- package/tree-select/List.js +122 -6
- package/tree-select/Select.js +258 -22
- package/tree-select/hook/useKeyCache.js +55 -0
- package/tree-select/hook/useStateValue.js +95 -0
- package/tree-select/hook/useTreeData.js +13 -0
- package/tree-select/index.js +3 -3
- package/trigger/getPopupStyle.js +2 -2
- package/trigger/index.js +27 -22
- package/types/common/empty/index.d.ts +1 -1
- package/types/common/icons/file/index.d.ts +1 -1
- package/types/common/space/index.d.ts +1 -1
- package/types/common/utils/is.d.ts +2 -1
- package/types/pc/anchor/context.d.ts +1 -1
- package/types/pc/color-picker/InputHex.d.ts +1 -1
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Mode.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/utils.d.ts +1 -1
- package/types/pc/config-provider/context.d.ts +1 -1
- package/types/pc/date-picker/Picker.d.ts +1 -1
- package/types/pc/date-picker/RangePicker.d.ts +1 -1
- package/types/pc/details/index.d.ts +4 -0
- package/types/pc/details/interface.d.ts +33 -0
- package/types/pc/grid/context.d.ts +1 -1
- package/types/pc/grid/util.d.ts +1 -1
- package/types/pc/hooks/use-watermark/index.d.ts +1 -1
- package/types/pc/icons/file/index.d.ts +1 -1
- package/types/pc/index.d.ts +1 -0
- package/types/pc/input/index.d.ts +1 -1
- package/types/pc/message/index.d.ts +1 -2
- package/types/pc/message/useMessage.d.ts +1 -1
- package/types/pc/notification/useNotification.d.ts +1 -1
- package/types/pc/select/interface.d.ts +3 -3
- package/types/pc/space/index.d.ts +1 -1
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/constant.d.ts +1 -1
- package/types/pc/tree/Context.d.ts +2 -2
- package/types/pc/tree/index.d.ts +1 -1
- package/types/pc/tree/interface.d.ts +6 -2
- package/types/pc/trigger/getPopupStyle.d.ts +1 -1
- package/types/pc/typography/EditContent.d.ts +1 -1
- package/types/pc/typography/Ellipsis.d.ts +1 -1
- package/types/pc/typography/Paragraph.d.ts +1 -1
- package/types/pc/typography/Title.d.ts +1 -1
- package/types/pc/upload/Upload.d.ts +2 -2
- package/types/pc/upload/constant.d.ts +4 -0
- package/types/pc/upload/index.d.ts +2 -0
- package/types/pc/upload/interface.d.ts +0 -3
- package/types/pc/upload/request.d.ts +1 -1
- package/types/pc/upload/util.d.ts +1 -1
- package/types/pc/utils/names.d.ts +140 -134
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/verification-code/index.d.ts +1 -1
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/types/pc/watermark/index.d.ts +1 -1
- package/typography/Base.js +43 -42
- package/typography/EditContent.js +7 -7
- package/typography/Ellipsis.js +193 -23
- package/typography/Operations.js +4 -4
- package/typography/Paragraph.js +12 -11
- package/typography/Typography.js +8 -7
- package/typography/index.js +15 -10
- package/typography/useEllipsis.js +21 -21
- package/upload/TriggerNode.js +9 -8
- package/upload/Upload.js +127 -550
- package/upload/Uploader.js +12 -12
- package/upload/constant.js +9 -0
- package/upload/index.js +4 -4
- package/upload/interface.js +1 -9
- package/upload/list/PictureItem.js +119 -0
- package/upload/list/TextItem.js +123 -0
- package/upload/list/UploadProgress.js +96 -0
- package/upload/list/index.js +140 -0
- package/upload/request.js +3 -3
- package/upload/request_.js +5 -5
- package/utils/PqbCSSTransition.js +3 -3
- package/utils/color.js +1 -1
- package/utils/computeScrollIntoView.js +4 -126
- package/utils/constant.js +6 -6
- package/utils/contextHolder.js +29 -4
- package/utils/dayjs.js +11 -11
- package/utils/dom.js +7 -49
- package/utils/fillNBSP.js +3 -3
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +3 -3
- package/utils/index.js +280 -270
- package/utils/is.js +39 -39
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/names.js +4 -0
- package/utils/omit.js +1 -1
- package/utils/pad.js +3 -16
- package/utils/pick.js +5 -5
- package/utils/react19Adapter.js +1 -3
- package/utils/reactDOM.js +3 -3
- package/utils/reactTransitionGroup.js +12 -8
- package/utils/resizeObserverEffect.js +1 -1
- package/utils/scrollIntoView.js +1 -1
- package/utils/setDarkTheme.js +10 -30
- package/utils/setPrimaryColor.js +6 -29
- package/utils/setTheme.js +3 -3
- package/utils/style.js +4 -37
- package/utils/throttleByRaf.js +3 -14
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.js +26 -27
- package/utils/tween.js +4 -3
- package/utils/validate.js +5 -4
- package/utils/warning.js +3 -9
- package/verification-code/VerificationCode.js +25 -24
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +278 -391
- package/virtual-list/util/algorithm.js +32 -0
- package/virtual-list/util/item.js +99 -0
- package/watermark/Watermark.js +17 -16
- package/chunk/5_U1CBIu.js +0 -8
- package/chunk/9TSjT7x_.js +0 -927
- package/chunk/B2yFlXke.js +0 -6
- package/chunk/B44Hj5ad.js +0 -697
- package/chunk/B5RFT17G.js +0 -15
- package/chunk/BJ9_azwQ.js +0 -1391
- package/chunk/BKKEev13.js +0 -11
- package/chunk/BKT9BFf4.js +0 -11
- package/chunk/BL8tIaO8.js +0 -649
- package/chunk/BNevupAU.js +0 -72
- package/chunk/BYdIoY50.js +0 -17
- package/chunk/BbQEqpOn.js +0 -7835
- package/chunk/BcCuJQY8.js +0 -214
- package/chunk/Bg3uJGPu.js +0 -10
- package/chunk/BsUZRQDT.js +0 -23
- package/chunk/C4OrxKE6.js +0 -18
- package/chunk/C8Kcc_9d.js +0 -1479
- package/chunk/CC---6jO.js +0 -110
- package/chunk/CCKr5jj1.js +0 -31
- package/chunk/CIRG541s.js +0 -22
- package/chunk/CPCJg6bv.js +0 -570
- package/chunk/CQ_WOOmf.js +0 -8
- package/chunk/CYhxqVkn.js +0 -9
- package/chunk/CftuXmo_.js +0 -6
- package/chunk/CkEaf5V0.js +0 -473
- package/chunk/ClM74To2.js +0 -58
- package/chunk/ClqoGc3r.js +0 -17
- package/chunk/D-Hw4x_H.js +0 -88
- package/chunk/D-ap9qEk.js +0 -14
- package/chunk/DWvmq7az.js +0 -843
- package/chunk/Dc-uXGtN.js +0 -178
- package/chunk/DxYoPlum.js +0 -50
- package/chunk/NPajzdOv.js +0 -27
- package/chunk/VSe_Wq1g.js +0 -10
- package/chunk/a3hR6zLw.js +0 -12
- package/types/common/assets/hourglass.d.ts +0 -2
package/upload/Upload.js
CHANGED
|
@@ -1,533 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { STATUS as g } from "./
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import "../chunk/ClM74To2.js";
|
|
21
|
-
import he from "@unicom-cloud/icons/IconUiCheck";
|
|
22
|
-
import ge from "@unicom-cloud/icons/IconUiPause";
|
|
23
|
-
import Ue from "@unicom-cloud/icons/IconUiPlayArrowFill";
|
|
24
|
-
import ve from "../progress/index.js";
|
|
25
|
-
import S from "../tooltip/index.js";
|
|
26
|
-
import { isPlainObject as A } from "@unicom-cloud/utils/is";
|
|
27
|
-
import Ie from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
28
|
-
import be from "@unicom-cloud/icons/IconUiFile";
|
|
29
|
-
import xe from "@unicom-cloud/icons/IconUiFileAudio";
|
|
30
|
-
import X from "@unicom-cloud/icons/IconUiFileImage";
|
|
31
|
-
import $e from "@unicom-cloud/icons/IconUiFilePdf";
|
|
32
|
-
import Ne from "@unicom-cloud/icons/IconUiFileVideo";
|
|
33
|
-
import ye from "./Uploader.js";
|
|
34
|
-
const Y = (e) => {
|
|
35
|
-
var x, f, s, l, U, I;
|
|
36
|
-
const m = q(), { file: d, prefixCls: c, progressProps: i, progressRender: t } = e, { locale: n } = D(V), { status: a, percent: N = 0 } = d, v = `${c}-list`, b = i && i.width ? { width: i.width } : {}, h = /* @__PURE__ */ P(T, { children: [
|
|
37
|
-
a === g.fail && e.reuploadIcon !== null && /* @__PURE__ */ r(
|
|
38
|
-
"span",
|
|
39
|
-
{
|
|
40
|
-
className: `${c}-list-reupload-icon`,
|
|
41
|
-
onClick: () => {
|
|
42
|
-
var o;
|
|
43
|
-
(o = e.onReupload) == null || o.call(e, d);
|
|
44
|
-
},
|
|
45
|
-
tabIndex: 0,
|
|
46
|
-
role: "button",
|
|
47
|
-
"aria-label": (x = n == null ? void 0 : n.Upload) == null ? void 0 : x.reupload,
|
|
48
|
-
...m({
|
|
49
|
-
onPressEnter: () => {
|
|
50
|
-
var o;
|
|
51
|
-
(o = e.onReupload) == null || o.call(e, d);
|
|
52
|
-
}
|
|
53
|
-
}),
|
|
54
|
-
children: e.reuploadIcon || (e.listType === "picture-card" ? /* @__PURE__ */ r(J, {}) : (f = n == null ? void 0 : n.Upload) == null ? void 0 : f.reupload)
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
a === g.success && e.successIcon !== null && /* @__PURE__ */ r("span", { className: `${c}-list-success-icon`, children: e.successIcon || /* @__PURE__ */ r(he, {}) }),
|
|
58
|
-
a !== g.success && /* @__PURE__ */ P("div", { className: `${v}-status`, style: b, children: [
|
|
59
|
-
/* @__PURE__ */ r(
|
|
60
|
-
ve,
|
|
61
|
-
{
|
|
62
|
-
showText: !1,
|
|
63
|
-
className: `${v}-progress`,
|
|
64
|
-
type: "circle",
|
|
65
|
-
status: a === g.fail ? "error" : a === g.success ? "success" : "normal",
|
|
66
|
-
percent: N,
|
|
67
|
-
size: "mini",
|
|
68
|
-
...i
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
a === g.init && e.startIcon !== null && /* @__PURE__ */ r(
|
|
72
|
-
"span",
|
|
73
|
-
{
|
|
74
|
-
tabIndex: 0,
|
|
75
|
-
role: "button",
|
|
76
|
-
"aria-label": (s = n == null ? void 0 : n.Upload) == null ? void 0 : s.start,
|
|
77
|
-
className: `${c}-list-start-icon`,
|
|
78
|
-
onClick: () => {
|
|
79
|
-
var o;
|
|
80
|
-
(o = e.onUpload) == null || o.call(e, d);
|
|
81
|
-
},
|
|
82
|
-
...m({
|
|
83
|
-
onPressEnter: () => {
|
|
84
|
-
var o;
|
|
85
|
-
(o = e.onUpload) == null || o.call(e, d);
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
children: e.startIcon || /* @__PURE__ */ r(S, { content: (l = n == null ? void 0 : n.Upload) == null ? void 0 : l.start, children: /* @__PURE__ */ r(Ue, {}) })
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
a === g.uploading && e.cancelIcon !== null && /* @__PURE__ */ r(
|
|
92
|
-
"span",
|
|
93
|
-
{
|
|
94
|
-
className: `${e.prefixCls}-list-cancel-icon`,
|
|
95
|
-
onClick: () => {
|
|
96
|
-
var o;
|
|
97
|
-
(o = e.onAbort) == null || o.call(e, d);
|
|
98
|
-
},
|
|
99
|
-
tabIndex: 0,
|
|
100
|
-
"aria-label": (U = n == null ? void 0 : n.Upload) == null ? void 0 : U.cancel,
|
|
101
|
-
...m({
|
|
102
|
-
onPressEnter: () => {
|
|
103
|
-
var o;
|
|
104
|
-
(o = e.onAbort) == null || o.call(e, d);
|
|
105
|
-
}
|
|
106
|
-
}),
|
|
107
|
-
children: e.cancelIcon || /* @__PURE__ */ r(S, { content: (I = n == null ? void 0 : n.Upload) == null ? void 0 : I.cancel, children: /* @__PURE__ */ r(ge, {}) })
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] })
|
|
111
|
-
] });
|
|
112
|
-
return w(t) ? t(d, h) : h;
|
|
113
|
-
}, Pe = (e, m) => {
|
|
114
|
-
const { disabled: d, prefixCls: c, file: i, showUploadList: t, locale: n } = e, a = q(), N = `${c}-list-item-picture`, { status: v, originFile: b } = i, [h, x] = R(i.url), f = A(t) ? t : {};
|
|
115
|
-
return F(() => {
|
|
116
|
-
if (i.url !== void 0)
|
|
117
|
-
x(i.url);
|
|
118
|
-
else {
|
|
119
|
-
const s = i.originFile;
|
|
120
|
-
s && Q(s).then((l) => {
|
|
121
|
-
x(l);
|
|
122
|
-
}).catch((l) => {
|
|
123
|
-
console.error(l);
|
|
124
|
-
}).finally(() => {
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
return () => {
|
|
128
|
-
};
|
|
129
|
-
}, [i.url, i.originFile]), F(() => {
|
|
130
|
-
var s;
|
|
131
|
-
return (s = e.onChange) == null || s.call(e, { type: "url", data: h }), () => {
|
|
132
|
-
var l;
|
|
133
|
-
(l = e.onChange) == null || l.call(e, { type: "url", data: void 0 });
|
|
134
|
-
};
|
|
135
|
-
}, [h]), /* @__PURE__ */ r("div", { className: N, ref: m, children: v === g.uploading ? /* @__PURE__ */ r(
|
|
136
|
-
Y,
|
|
137
|
-
{
|
|
138
|
-
onReupload: e.onReupload,
|
|
139
|
-
onUpload: e.onUpload,
|
|
140
|
-
onAbort: e.onAbort,
|
|
141
|
-
listType: "picture-card",
|
|
142
|
-
file: i,
|
|
143
|
-
prefixCls: c,
|
|
144
|
-
progressProps: e.progressProps,
|
|
145
|
-
...f
|
|
146
|
-
}
|
|
147
|
-
) : /* @__PURE__ */ P(T, { children: [
|
|
148
|
-
w(f.imageRender) ? f.imageRender(i) : /* @__PURE__ */ r("img", { src: h, alt: i.name }),
|
|
149
|
-
/* @__PURE__ */ P("div", { className: `${N}-mask`, role: "radiogroup", children: [
|
|
150
|
-
i.status === g.fail && /* @__PURE__ */ r("div", { className: `${N}-error-tip`, children: f.errorIcon !== null && /* @__PURE__ */ r("span", { className: `${c}-list-error-icon`, children: f.errorIcon || /* @__PURE__ */ r(fe, {}) }) }),
|
|
151
|
-
/* @__PURE__ */ P("div", { className: `${N}-operation`, children: [
|
|
152
|
-
i.status !== g.fail && f.previewIcon !== null && /* @__PURE__ */ r(
|
|
153
|
-
"span",
|
|
154
|
-
{
|
|
155
|
-
className: `${c}-list-preview-icon`,
|
|
156
|
-
tabIndex: 0,
|
|
157
|
-
role: "button",
|
|
158
|
-
"aria-label": n == null ? void 0 : n.Upload.preview,
|
|
159
|
-
...a({
|
|
160
|
-
onPressEnter: () => {
|
|
161
|
-
var s;
|
|
162
|
-
(s = e.onPreview) == null || s.call(e, i);
|
|
163
|
-
}
|
|
164
|
-
}),
|
|
165
|
-
onClick: () => {
|
|
166
|
-
var s;
|
|
167
|
-
(s = e.onPreview) == null || s.call(e, i);
|
|
168
|
-
},
|
|
169
|
-
children: f.previewIcon || /* @__PURE__ */ r(me, {})
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
i.status === g.fail && f.reuploadIcon !== null && /* @__PURE__ */ r(
|
|
173
|
-
"span",
|
|
174
|
-
{
|
|
175
|
-
className: `${e.prefixCls}-list-reupload-icon`,
|
|
176
|
-
onClick: () => {
|
|
177
|
-
var s;
|
|
178
|
-
(s = e.onReupload) == null || s.call(e, i);
|
|
179
|
-
},
|
|
180
|
-
tabIndex: 0,
|
|
181
|
-
role: "button",
|
|
182
|
-
"aria-label": n == null ? void 0 : n.Upload.reupload,
|
|
183
|
-
...a({
|
|
184
|
-
onPressEnter: () => {
|
|
185
|
-
var s;
|
|
186
|
-
(s = e.onReupload) == null || s.call(e, i);
|
|
187
|
-
}
|
|
188
|
-
}),
|
|
189
|
-
children: f.reuploadIcon || /* @__PURE__ */ r(J, {})
|
|
190
|
-
}
|
|
191
|
-
),
|
|
192
|
-
!d && f.removeIcon !== null && /* @__PURE__ */ r(
|
|
193
|
-
"span",
|
|
194
|
-
{
|
|
195
|
-
className: `${c}-list-remove-icon`,
|
|
196
|
-
onClick: () => {
|
|
197
|
-
var s;
|
|
198
|
-
(s = e.onRemove) == null || s.call(e, i);
|
|
199
|
-
},
|
|
200
|
-
role: "button",
|
|
201
|
-
"aria-label": n == null ? void 0 : n.Upload.delete,
|
|
202
|
-
tabIndex: 0,
|
|
203
|
-
...a({
|
|
204
|
-
onPressEnter: () => {
|
|
205
|
-
var s;
|
|
206
|
-
(s = e.onRemove) == null || s.call(e, i);
|
|
207
|
-
}
|
|
208
|
-
}),
|
|
209
|
-
children: f.removeIcon || /* @__PURE__ */ r(G, {})
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
] })
|
|
213
|
-
] })
|
|
214
|
-
] }) });
|
|
215
|
-
}, Ce = j(Pe), we = (e) => {
|
|
216
|
-
let m = "";
|
|
217
|
-
if (e.originFile && e.originFile.type)
|
|
218
|
-
m = e.originFile.type;
|
|
219
|
-
else {
|
|
220
|
-
const c = (e.name || "").split(".").pop() || "";
|
|
221
|
-
m = c, ["png", "jpg", "jpeg", "bmp", "gif"].indexOf(c) > -1 ? m = "image" : ["mp4", "m2v", "mkv"].indexOf(c) > -1 ? m = "video" : ["mp3", "wav", "wmv"].indexOf(c) > -1 && (m = "audio");
|
|
222
|
-
}
|
|
223
|
-
return m.indexOf("image") > -1 ? X : m.indexOf("pdf") > -1 ? $e : m.indexOf("audio") > -1 ? xe : m.indexOf("video") > -1 ? Ne : be;
|
|
224
|
-
}, Le = (e, m) => {
|
|
225
|
-
const { prefixCls: d, disabled: c, file: i, locale: t } = e, n = `${d}-list-item-text`, a = q(), N = we(i), v = A(e.showUploadList) ? e.showUploadList : {}, b = A(v) ? v : {}, h = i.name || i.originFile && i.originFile.name, [x, f] = R(i.url);
|
|
226
|
-
let s = {};
|
|
227
|
-
return i.status !== g.fail && (s = {
|
|
228
|
-
popupVisible: !1
|
|
229
|
-
}), F(() => {
|
|
230
|
-
if (i.url !== void 0)
|
|
231
|
-
f(i.url);
|
|
232
|
-
else {
|
|
233
|
-
const l = i.originFile;
|
|
234
|
-
l && Q(l).then((U) => {
|
|
235
|
-
f(U);
|
|
236
|
-
}).catch((U) => {
|
|
237
|
-
console.error(U);
|
|
238
|
-
}).finally(() => {
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
return () => {
|
|
242
|
-
};
|
|
243
|
-
}, [i.url, i.originFile]), F(() => {
|
|
244
|
-
var l;
|
|
245
|
-
return (l = e.onChange) == null || l.call(e, { type: "url", data: x }), () => {
|
|
246
|
-
var U;
|
|
247
|
-
(U = e.onChange) == null || U.call(e, { type: "url", data: void 0 });
|
|
248
|
-
};
|
|
249
|
-
}, [x]), /* @__PURE__ */ P(
|
|
250
|
-
"div",
|
|
251
|
-
{
|
|
252
|
-
className: `${d}-list-item ${d}-list-item-${i.status}`,
|
|
253
|
-
ref: m,
|
|
254
|
-
children: [
|
|
255
|
-
/* @__PURE__ */ P("div", { className: n, children: [
|
|
256
|
-
e.listType === "picture-list" && /* @__PURE__ */ r("div", { className: `${n}-thumbnail`, children: w(v.imageRender) ? v.imageRender(i) : /* @__PURE__ */ r("img", { src: x }) }),
|
|
257
|
-
/* @__PURE__ */ P("div", { className: `${n}-content`, children: [
|
|
258
|
-
/* @__PURE__ */ P("div", { className: `${n}-name`, children: [
|
|
259
|
-
e.listType === "text" && b.fileIcon !== null && /* @__PURE__ */ r("span", { className: `${d}-list-file-icon`, children: b.fileIcon || /* @__PURE__ */ r(N, {}) }),
|
|
260
|
-
w(v.fileName) ? /* @__PURE__ */ r("span", { className: `${n}-name-text`, children: v.fileName(i) }) : i.url ? /* @__PURE__ */ r(
|
|
261
|
-
"a",
|
|
262
|
-
{
|
|
263
|
-
href: i.url,
|
|
264
|
-
target: "_blank",
|
|
265
|
-
rel: "noreferrer",
|
|
266
|
-
className: `${n}-name-link`,
|
|
267
|
-
children: h
|
|
268
|
-
}
|
|
269
|
-
) : /* @__PURE__ */ r("span", { className: `${n}-name-text`, children: h }),
|
|
270
|
-
i.status === g.fail && b.errorIcon !== null && /* @__PURE__ */ r(
|
|
271
|
-
S,
|
|
272
|
-
{
|
|
273
|
-
content: (typeof i.response == "object" ? oe(i.response) && i.response : i.response) || (t == null ? void 0 : t.Upload.error),
|
|
274
|
-
...s,
|
|
275
|
-
disabled: i.status !== g.fail,
|
|
276
|
-
children: /* @__PURE__ */ r("span", { className: `${e.prefixCls}-list-error-icon`, children: b.errorIcon || (e.listType === "picture-card" ? /* @__PURE__ */ r(X, {}) : /* @__PURE__ */ r(Ie, {})) })
|
|
277
|
-
}
|
|
278
|
-
)
|
|
279
|
-
] }),
|
|
280
|
-
/* @__PURE__ */ r(
|
|
281
|
-
Y,
|
|
282
|
-
{
|
|
283
|
-
file: i,
|
|
284
|
-
prefixCls: d,
|
|
285
|
-
progressProps: e.progressProps,
|
|
286
|
-
onReupload: e.onReupload,
|
|
287
|
-
onUpload: e.onUpload,
|
|
288
|
-
onAbort: e.onAbort,
|
|
289
|
-
...b
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
] })
|
|
293
|
-
] }),
|
|
294
|
-
/* @__PURE__ */ r("div", { className: `${d}-list-item-operation`, children: !c && b.removeIcon !== null && /* @__PURE__ */ r(
|
|
295
|
-
ae,
|
|
296
|
-
{
|
|
297
|
-
className: `${d}-list-remove-icon-hover`,
|
|
298
|
-
onClick: () => {
|
|
299
|
-
var l;
|
|
300
|
-
(l = e.onRemove) == null || l.call(e, i);
|
|
301
|
-
},
|
|
302
|
-
tabIndex: 0,
|
|
303
|
-
"aria-label": t == null ? void 0 : t.Upload.delete,
|
|
304
|
-
...a({
|
|
305
|
-
onPressEnter: () => {
|
|
306
|
-
var l;
|
|
307
|
-
(l = e.onRemove) == null || l.call(e, i);
|
|
308
|
-
}
|
|
309
|
-
}),
|
|
310
|
-
children: /* @__PURE__ */ r("span", { className: `${d}-list-remove-icon`, children: b.removeIcon || /* @__PURE__ */ r(G, {}) })
|
|
311
|
-
}
|
|
312
|
-
) })
|
|
313
|
-
]
|
|
314
|
-
}
|
|
315
|
-
);
|
|
316
|
-
}, Re = j(Le), Z = (e) => {
|
|
317
|
-
const { locale: m, rtl: d } = D(V), {
|
|
318
|
-
listType: c,
|
|
319
|
-
fileList: i,
|
|
320
|
-
renderUploadList: t,
|
|
321
|
-
renderUploadItem: n,
|
|
322
|
-
prefixCls: a,
|
|
323
|
-
...N
|
|
324
|
-
} = e, [v, b] = R(-1), [h, x] = R([]);
|
|
325
|
-
if (w(t))
|
|
326
|
-
return /* @__PURE__ */ r("div", { className: `${a}-list`, children: t(i, N) });
|
|
327
|
-
const f = (l) => {
|
|
328
|
-
e.imagePreview && b(l);
|
|
329
|
-
};
|
|
330
|
-
function s(l, U, I) {
|
|
331
|
-
(l == null ? void 0 : l.type) === "url" && [g.init, g.success].indexOf(I.status) > -1 && x((o) => {
|
|
332
|
-
const C = [...o];
|
|
333
|
-
return C[U] = l.data, C.filter(Boolean);
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
return F(() => () => {
|
|
337
|
-
}, []), /* @__PURE__ */ P(T, { children: [
|
|
338
|
-
/* @__PURE__ */ r(
|
|
339
|
-
de,
|
|
340
|
-
{
|
|
341
|
-
className: z(
|
|
342
|
-
`${a}-list`,
|
|
343
|
-
`${a}-list-type-${c}`,
|
|
344
|
-
{
|
|
345
|
-
[`${a}-list-rtl`]: d
|
|
346
|
-
}
|
|
347
|
-
),
|
|
348
|
-
children: i.map((l, U) => {
|
|
349
|
-
let I = c === "picture-card" ? /* @__PURE__ */ r(
|
|
350
|
-
"div",
|
|
351
|
-
{
|
|
352
|
-
className: `${a}-list-item ${a}-list-item-${l.status}`,
|
|
353
|
-
children: /* @__PURE__ */ r(
|
|
354
|
-
Ce,
|
|
355
|
-
{
|
|
356
|
-
...e,
|
|
357
|
-
onPreview: (o) => {
|
|
358
|
-
var C;
|
|
359
|
-
f(U), (C = e.onPreview) == null || C.call(e, o);
|
|
360
|
-
},
|
|
361
|
-
file: l,
|
|
362
|
-
locale: m,
|
|
363
|
-
onChange: (o) => {
|
|
364
|
-
s(o, U, l);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
)
|
|
368
|
-
}
|
|
369
|
-
) : /* @__PURE__ */ r(
|
|
370
|
-
Re,
|
|
371
|
-
{
|
|
372
|
-
...e,
|
|
373
|
-
file: l,
|
|
374
|
-
locale: m,
|
|
375
|
-
onChange: (o) => {
|
|
376
|
-
s(o, U, l);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
return w(n) && (I = n(I, l, i)), c === "picture-card" ? /* @__PURE__ */ r(
|
|
381
|
-
W,
|
|
382
|
-
{
|
|
383
|
-
timeout: { enter: 200, exit: 400 },
|
|
384
|
-
classNames: `${a}-slide-inline`,
|
|
385
|
-
onEntered: (o) => {
|
|
386
|
-
o && (o.style.width = "");
|
|
387
|
-
},
|
|
388
|
-
onExit: (o) => {
|
|
389
|
-
o && (o.style.width = `${o.scrollWidth}px`);
|
|
390
|
-
},
|
|
391
|
-
onExiting: (o) => {
|
|
392
|
-
o && (o.style.width = 0);
|
|
393
|
-
},
|
|
394
|
-
onExited: (o) => {
|
|
395
|
-
o && (o.style.width = 0);
|
|
396
|
-
},
|
|
397
|
-
children: I
|
|
398
|
-
},
|
|
399
|
-
l.uid
|
|
400
|
-
) : /* @__PURE__ */ r(
|
|
401
|
-
W,
|
|
402
|
-
{
|
|
403
|
-
timeout: { enter: 200, exit: 400 },
|
|
404
|
-
classNames: `${a}-slide-up`,
|
|
405
|
-
onExit: (o) => {
|
|
406
|
-
o && (o.style.height = `${o.scrollHeight}px`);
|
|
407
|
-
},
|
|
408
|
-
onExiting: (o) => {
|
|
409
|
-
o && (o.style.height = 0);
|
|
410
|
-
},
|
|
411
|
-
onExited: (o) => {
|
|
412
|
-
o && (o.style.height = 0);
|
|
413
|
-
},
|
|
414
|
-
children: I
|
|
415
|
-
},
|
|
416
|
-
l.uid
|
|
417
|
-
);
|
|
418
|
-
})
|
|
419
|
-
}
|
|
420
|
-
),
|
|
421
|
-
c === "picture-card" && e.imagePreview && /* @__PURE__ */ r(
|
|
422
|
-
ue,
|
|
423
|
-
{
|
|
424
|
-
srcList: h,
|
|
425
|
-
visible: v !== -1,
|
|
426
|
-
current: v,
|
|
427
|
-
onChange: f,
|
|
428
|
-
onVisibleChange: (l) => {
|
|
429
|
-
f(l ? v : -1);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
)
|
|
433
|
-
] });
|
|
434
|
-
};
|
|
435
|
-
Z.displayName = "FileList";
|
|
436
|
-
const k = function(e) {
|
|
437
|
-
const m = [].concat(e || []).filter(Boolean);
|
|
438
|
-
return m.reduce((d, c, i) => {
|
|
439
|
-
if (c.uid) {
|
|
440
|
-
const t = m.findIndex(
|
|
441
|
-
(a) => c.uid === a.uid && c !== a
|
|
1
|
+
import { jsx as m, jsxs as M, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import H from "lodash/isFunction";
|
|
3
|
+
import W from "lodash/isNumber";
|
|
4
|
+
import { forwardRef as k, useContext as z, useRef as N, useState as G, useImperativeHandle as J } from "react";
|
|
5
|
+
import "../config-provider/ConfigProvider.js";
|
|
6
|
+
import K from "../components/common/hooks/useMergeProps.js";
|
|
7
|
+
import Q from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import { omit as V } from "../components/common/utils/omit.js";
|
|
9
|
+
import { warning as y } from "../components/common/utils/warning.js";
|
|
10
|
+
import { STATUS as g } from "./constant.js";
|
|
11
|
+
import { FileList as X } from "./list/index.js";
|
|
12
|
+
import Y from "./Uploader.js";
|
|
13
|
+
import Z from "../config-provider/context.js";
|
|
14
|
+
const U = function(f) {
|
|
15
|
+
const c = [].concat(f || []).filter(Boolean);
|
|
16
|
+
return c.reduce((a, n, h) => {
|
|
17
|
+
if (n.uid) {
|
|
18
|
+
const e = c.findIndex(
|
|
19
|
+
(s) => n.uid === s.uid && n !== s
|
|
442
20
|
);
|
|
443
|
-
|
|
444
|
-
const
|
|
21
|
+
y(e !== -1, "[Upload]: duplicate uid");
|
|
22
|
+
const r = {
|
|
445
23
|
status: g.success,
|
|
446
24
|
percent: 100,
|
|
447
|
-
...
|
|
25
|
+
...n
|
|
448
26
|
};
|
|
449
|
-
|
|
27
|
+
e === -1 ? a.push(r) : a.splice(e, 1, r);
|
|
450
28
|
} else {
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
uid:
|
|
29
|
+
y(!0, "[Upload]: uid is required");
|
|
30
|
+
const e = `${String(+/* @__PURE__ */ new Date())}${h}`;
|
|
31
|
+
a.push({
|
|
32
|
+
uid: e,
|
|
455
33
|
status: g.success,
|
|
456
34
|
percent: 100,
|
|
457
|
-
...
|
|
35
|
+
...n
|
|
458
36
|
});
|
|
459
37
|
}
|
|
460
|
-
return
|
|
38
|
+
return a;
|
|
461
39
|
}, []);
|
|
462
|
-
},
|
|
40
|
+
}, _ = {
|
|
463
41
|
listType: "text",
|
|
464
42
|
autoUpload: !0,
|
|
465
43
|
showUploadList: !0,
|
|
466
44
|
beforeUpload: () => !0,
|
|
467
45
|
method: "post"
|
|
468
|
-
},
|
|
469
|
-
const { getPrefixCls:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
),
|
|
474
|
-
var
|
|
475
|
-
"fileList" in
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
|
|
46
|
+
}, ee = (f, c) => {
|
|
47
|
+
const { getPrefixCls: a, componentConfig: n, rtl: h } = z(Z), e = K(
|
|
48
|
+
f,
|
|
49
|
+
_,
|
|
50
|
+
n == null ? void 0 : n.Upload
|
|
51
|
+
), r = a == null ? void 0 : a("upload"), s = N(), x = N(), [D, b] = G(() => "fileList" in e ? U(e.fileList) : "defaultFileList" in e ? U(e.defaultFileList) : []), d = "fileList" in e ? U(e.fileList) : D, v = (t, i) => {
|
|
52
|
+
var o;
|
|
53
|
+
"fileList" in e || b(t), (o = e.onChange) == null || o.call(e, t, i);
|
|
54
|
+
}, F = (t) => {
|
|
55
|
+
t && setTimeout(() => {
|
|
56
|
+
s.current && s.current.upload(t);
|
|
479
57
|
}, 0);
|
|
480
|
-
},
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
if (
|
|
485
|
-
const { onRemove:
|
|
58
|
+
}, R = (t) => {
|
|
59
|
+
var i;
|
|
60
|
+
s.current && s.current.reupload(t), (i = e.onReupload) == null || i.call(e, t);
|
|
61
|
+
}, E = (t) => {
|
|
62
|
+
if (t) {
|
|
63
|
+
const { onRemove: i } = e;
|
|
486
64
|
Promise.resolve(
|
|
487
|
-
|
|
488
|
-
).then((
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
65
|
+
H(i) ? i(t, d) : i
|
|
66
|
+
).then((o) => {
|
|
67
|
+
o !== !1 && (s.current && s.current.abort(t), v(
|
|
68
|
+
d.filter((p) => p.uid !== t.uid),
|
|
69
|
+
t
|
|
492
70
|
));
|
|
493
|
-
}).catch((
|
|
494
|
-
console.error(
|
|
71
|
+
}).catch((o) => {
|
|
72
|
+
console.error(o);
|
|
495
73
|
});
|
|
496
74
|
}
|
|
497
|
-
},
|
|
498
|
-
|
|
75
|
+
}, w = (t) => {
|
|
76
|
+
t && s.current && s.current.abort(t);
|
|
499
77
|
};
|
|
500
|
-
|
|
501
|
-
submit: (
|
|
502
|
-
let
|
|
503
|
-
|
|
504
|
-
|
|
78
|
+
J(c, () => ({
|
|
79
|
+
submit: (t) => {
|
|
80
|
+
let i = [];
|
|
81
|
+
t ? i = [t] : i = d.filter((o) => o.status === g.init), i.forEach((o) => {
|
|
82
|
+
F(o);
|
|
505
83
|
});
|
|
506
84
|
},
|
|
507
85
|
// file: fileList中的file对象
|
|
508
|
-
abort: (
|
|
509
|
-
|
|
86
|
+
abort: (t) => {
|
|
87
|
+
w(t);
|
|
510
88
|
},
|
|
511
89
|
// file: fileList中的file对象
|
|
512
|
-
reupload: (
|
|
513
|
-
|
|
90
|
+
reupload: (t) => {
|
|
91
|
+
R(t);
|
|
514
92
|
},
|
|
515
|
-
getRootDOMNode: () =>
|
|
93
|
+
getRootDOMNode: () => x.current
|
|
516
94
|
}));
|
|
517
95
|
const {
|
|
518
|
-
listType:
|
|
519
|
-
className:
|
|
520
|
-
style:
|
|
521
|
-
renderUploadItem:
|
|
522
|
-
showUploadList:
|
|
523
|
-
renderUploadList:
|
|
524
|
-
progressProps:
|
|
525
|
-
imagePreview:
|
|
526
|
-
...
|
|
527
|
-
} =
|
|
96
|
+
listType: l,
|
|
97
|
+
className: O,
|
|
98
|
+
style: S,
|
|
99
|
+
renderUploadItem: I,
|
|
100
|
+
showUploadList: C,
|
|
101
|
+
renderUploadList: T,
|
|
102
|
+
progressProps: j,
|
|
103
|
+
imagePreview: q,
|
|
104
|
+
...A
|
|
105
|
+
} = e, u = W(e.limit) ? { hideOnExceedLimit: !0, maxCount: e.limit } : { hideOnExceedLimit: !0, ...e.limit }, L = u.maxCount && u.maxCount <= d.length, P = "disabled" in e ? e.disabled : !u.hideOnExceedLimit && L, $ = /* @__PURE__ */ m(
|
|
528
106
|
"div",
|
|
529
107
|
{
|
|
530
|
-
...
|
|
108
|
+
...V(A, [
|
|
531
109
|
"disabled",
|
|
532
110
|
"directory",
|
|
533
111
|
"onReupload",
|
|
@@ -559,70 +137,69 @@ const k = function(e) {
|
|
|
559
137
|
"onDragOver",
|
|
560
138
|
"onDragLeave"
|
|
561
139
|
]),
|
|
562
|
-
className:
|
|
563
|
-
|
|
140
|
+
className: Q(
|
|
141
|
+
r,
|
|
564
142
|
{
|
|
565
|
-
[`${
|
|
566
|
-
[`${
|
|
567
|
-
[`${
|
|
568
|
-
[`${
|
|
569
|
-
[`${
|
|
143
|
+
[`${r}-type-${l}`]: l,
|
|
144
|
+
[`${r}-drag`]: e.drag,
|
|
145
|
+
[`${r}-disabled`]: P,
|
|
146
|
+
[`${r}-hide`]: u.hideOnExceedLimit && L,
|
|
147
|
+
[`${r}-rtl`]: h
|
|
570
148
|
},
|
|
571
|
-
|
|
149
|
+
O
|
|
572
150
|
),
|
|
573
|
-
style:
|
|
574
|
-
ref:
|
|
575
|
-
children: /* @__PURE__ */
|
|
576
|
-
|
|
151
|
+
style: S,
|
|
152
|
+
ref: x,
|
|
153
|
+
children: /* @__PURE__ */ m(
|
|
154
|
+
Y,
|
|
577
155
|
{
|
|
578
|
-
ref:
|
|
579
|
-
...
|
|
580
|
-
limit:
|
|
581
|
-
hide:
|
|
582
|
-
disabled:
|
|
583
|
-
prefixCls:
|
|
584
|
-
fileList:
|
|
585
|
-
onProgress: (
|
|
586
|
-
var
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
), (
|
|
156
|
+
ref: s,
|
|
157
|
+
...e,
|
|
158
|
+
limit: u.maxCount,
|
|
159
|
+
hide: u.hideOnExceedLimit && L,
|
|
160
|
+
disabled: P,
|
|
161
|
+
prefixCls: r,
|
|
162
|
+
fileList: d,
|
|
163
|
+
onProgress: (t, i) => {
|
|
164
|
+
var o;
|
|
165
|
+
t && ("fileList" in e || b(
|
|
166
|
+
d.map((p) => p.uid === t.uid ? t : p)
|
|
167
|
+
), (o = e.onProgress) == null || o.call(e, t, i));
|
|
590
168
|
},
|
|
591
|
-
onFileStatusChange:
|
|
169
|
+
onFileStatusChange: v
|
|
592
170
|
}
|
|
593
171
|
)
|
|
594
172
|
}
|
|
595
173
|
);
|
|
596
|
-
return /* @__PURE__ */
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
174
|
+
return /* @__PURE__ */ M(B, { children: [
|
|
175
|
+
l !== "picture-card" && $,
|
|
176
|
+
C && /* @__PURE__ */ m(
|
|
177
|
+
X,
|
|
600
178
|
{
|
|
601
|
-
imagePreview:
|
|
602
|
-
progressProps:
|
|
603
|
-
showUploadList:
|
|
604
|
-
disabled:
|
|
605
|
-
listType:
|
|
606
|
-
fileList:
|
|
607
|
-
renderUploadItem:
|
|
608
|
-
renderUploadList:
|
|
609
|
-
onUpload:
|
|
610
|
-
onAbort:
|
|
611
|
-
onRemove:
|
|
612
|
-
onReupload:
|
|
613
|
-
onPreview:
|
|
614
|
-
prefixCls:
|
|
179
|
+
imagePreview: q,
|
|
180
|
+
progressProps: j,
|
|
181
|
+
showUploadList: C,
|
|
182
|
+
disabled: e.disabled,
|
|
183
|
+
listType: l,
|
|
184
|
+
fileList: d,
|
|
185
|
+
renderUploadItem: I,
|
|
186
|
+
renderUploadList: T,
|
|
187
|
+
onUpload: F,
|
|
188
|
+
onAbort: w,
|
|
189
|
+
onRemove: E,
|
|
190
|
+
onReupload: R,
|
|
191
|
+
onPreview: e.onPreview,
|
|
192
|
+
prefixCls: r
|
|
615
193
|
}
|
|
616
194
|
),
|
|
617
|
-
|
|
618
|
-
|
|
195
|
+
l === "picture-card" && $,
|
|
196
|
+
e.tip && l === "picture-card" && /* @__PURE__ */ m("div", { className: `${r}-trigger-tip`, children: e.tip })
|
|
619
197
|
] });
|
|
620
|
-
},
|
|
621
|
-
|
|
198
|
+
}, te = k(
|
|
199
|
+
ee
|
|
622
200
|
);
|
|
623
|
-
|
|
201
|
+
te.displayName = "Upload";
|
|
624
202
|
export {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
Te as default
|
|
203
|
+
X as UploadList,
|
|
204
|
+
te as default
|
|
628
205
|
};
|