@unicom-cloud/ui 0.8.78 → 0.8.79
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 +3 -3
- package/Alert.js +3 -3
- package/AutoComplete.js +5 -5
- package/BackTop.js +5 -5
- package/Badge.js +3 -3
- package/Breadcrumb.js +4 -4
- package/Button.js +2 -2
- package/Calendar.js +4 -4
- package/Card.js +2 -2
- package/Carousel.js +2 -2
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -3
- package/Comment.js +2 -2
- package/ConfigProvider.js +1 -1
- package/Copy.js +4 -4
- package/DatePicker.js +1 -1
- package/Descriptions.js +2 -2
- package/Divider.js +2 -2
- package/Draggable.js +2 -2
- package/Dropdown.js +5 -5
- package/Empty.js +2 -2
- package/Icon.js +9 -5
- package/IconHover.js +2 -2
- package/Image.js +1 -1
- package/InputNumber.js +3 -3
- package/Layout.js +2 -2
- package/Link.js +3 -3
- package/List.js +4 -4
- package/Mentions.js +5 -5
- package/Menu.js +1 -1
- package/Message.js +3 -3
- package/Modal.js +1 -1
- package/Notice.js +9 -8
- package/Notification.js +3 -3
- package/OverflowEllipsis.js +2 -2
- package/PageHeader.js +3 -3
- package/Pagination.js +1 -1
- package/Popconfirm.js +3 -3
- package/Popover.js +3 -3
- package/Progress.js +2 -2
- package/Radio.js +1 -1
- package/Rate.js +3 -3
- package/ResizeBox.js +3 -3
- package/Result.js +2 -2
- package/Select.js +1 -1
- package/SelectView.js +5 -6
- package/Skeleton.js +2 -2
- package/Slider.js +4 -4
- package/Space.js +2 -2
- package/SpeechSynthesis.js +18 -20
- package/Spin.js +3 -3
- package/Statistic.js +3 -3
- package/Steps.js +2 -2
- package/Switch.js +7 -8
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +3 -3
- package/Tooltip.js +3 -3
- package/Transfer.js +4 -4
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +9 -10
- package/Typography.js +1 -1
- package/affix/index.js +17 -17
- package/alert/index.js +13 -13
- package/anchor/Anchor.js +40 -40
- package/anchor/Link.js +14 -14
- package/anchor/util.js +2 -2
- package/auto-complete/index.js +5 -5
- package/avatar/Avatar.js +17 -17
- package/avatar/Group.js +13 -13
- package/back-top/index.js +13 -13
- package/badge/Count.js +13 -13
- package/badge/index.js +21 -21
- package/breadcrumb/Item.js +25 -25
- package/breadcrumb/index.js +12 -12
- package/button/Group.js +6 -6
- package/button/index.js +30 -30
- package/calendar/Month.js +2 -2
- package/calendar/Year.js +1 -1
- package/calendar/index.js +4 -4
- package/card/Grid.js +13 -13
- package/card/Meta.js +13 -13
- package/card/index.js +29 -29
- package/carousel/Arrow.js +6 -6
- package/carousel/Indicator.js +27 -27
- package/carousel/index.js +24 -24
- package/cascader/Cascader.js +8 -8
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +4 -4
- package/checkbox/Group.js +4 -4
- package/checkbox/GroupBlock.js +3 -3
- package/checkbox/index.js +2 -2
- package/chunk/{ZrBrCzQX.js → B4WG1mhs.js} +6 -7
- package/chunk/{Cwm8LL5p.js → B4mZh-RK.js} +7245 -7249
- package/chunk/{CjqvxJml.js → BG7YGUsx.js} +32 -32
- package/chunk/{BhBEMwvI.js → BNevupAU.js} +18 -20
- package/chunk/BYdIoY50.js +17 -0
- package/chunk/{Cc_-i0o_.js → BZ3igxQN.js} +6 -7
- package/chunk/{uEGHykhe.js → BZ9g7J4R.js} +1 -1
- package/chunk/BsUZRQDT.js +23 -0
- package/chunk/{CBgu99gQ.js → C5X4hOkx.js} +130 -130
- package/chunk/{B0n0iRhF.js → CCKr5jj1.js} +1 -1
- package/chunk/{CNcLypMY.js → CQvM33Vg.js} +190 -189
- package/chunk/CXPOj2uy.js +19 -0
- package/chunk/{DAAff-FT.js → ClM74To2.js} +9 -10
- package/chunk/{RS6OAxzv.js → D-ap9qEk.js} +2 -2
- package/chunk/{tpmioyz1.js → DEiyXzBZ.js} +28 -28
- package/chunk/{CplLA01W.js → DEuVgCzp.js} +45 -52
- package/chunk/{BPQXH_5i.js → DYspELhF.js} +43 -43
- package/chunk/DxYoPlum.js +50 -0
- package/chunk/{BpYX5PN4.js → NPajzdOv.js} +2 -2
- package/chunk/{BBkdXHrJ.js → rT6qmv-Y.js} +1 -1
- package/chunk/{BC5fEyWK.js → yLRv5RIK.js} +61 -61
- package/chunk/{C_4I3haT.js → yhU2zeeu.js} +96 -96
- package/collapse/Collapse.js +4 -4
- package/collapse/Item.js +4 -4
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +22 -22
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +4 -4
- package/color-picker/index.js +3 -3
- package/comment/index.js +18 -18
- package/config-provider/ConfigProvider.js +2 -2
- package/config-provider/context.js +2 -2
- package/config-provider/index.js +2 -2
- package/copy/index.js +23 -23
- package/date-picker/Picker.js +41 -41
- package/date-picker/PickerRange.js +3 -3
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +28 -28
- package/divider/index.js +15 -15
- package/draggable/Item.js +11 -11
- package/draggable/index.js +15 -15
- package/drawer/Drawer.js +31 -31
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +22 -22
- package/empty/index.js +2 -2
- package/form/Control.js +46 -46
- package/form/Form.js +12 -12
- package/form/FormItem.js +12 -12
- package/form/FormLabel.js +11 -11
- package/form/context.js +7 -6
- package/form/promisify.js +9 -10
- package/form/store.js +1 -1
- package/form/util.js +1 -1
- package/grid/Col.js +38 -38
- package/grid/Row.js +15 -15
- package/grid/grid-item.js +17 -17
- package/grid/grid.js +28 -28
- package/hooks/index.js +6 -6
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/useVerificationCode.js +30 -30
- package/icon/index.js +20 -16
- package/icon-hover/index.js +2 -2
- package/image/Image.js +22 -22
- package/image/ImageFooter.js +2 -2
- package/image/ImagePreview.js +11 -11
- package/image/ImagePreviewArrow.js +16 -16
- package/image/ImagePreviewGroup.js +2 -2
- package/image/ImagePreviewToolbar.js +7 -7
- package/image/TriggerForToolbar.js +7 -7
- package/image/index.js +1 -1
- package/index.js +547 -580
- package/input/Group.js +10 -10
- package/input/Input.js +213 -214
- package/input/InputElement.js +10 -11
- package/input/Password.js +4 -4
- package/input/Search.js +3 -3
- package/input/Textarea.js +7 -8
- package/input/useComposition.js +6 -6
- package/input-number/index.js +3 -3
- package/input-tag/InputTag.js +110 -111
- package/layout/Content.js +4 -4
- package/layout/Footer.js +6 -6
- package/layout/Header.js +8 -8
- package/layout/Sider.js +29 -29
- package/layout/index.js +16 -16
- package/link/index.js +27 -27
- package/list/Item.js +5 -5
- package/list/Meta.js +11 -11
- package/list/index.js +4 -4
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/mentions/index.js +5 -5
- package/menu/Item.js +11 -11
- package/menu/ItemGroup.js +8 -8
- package/menu/Menu.js +5 -5
- package/menu/OverflowWrap.js +2 -2
- package/menu/index.js +2 -2
- package/message/index.js +3 -3
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +7 -7
- package/modal/index.js +1 -1
- package/notice/index.js +9 -8
- package/notification/index.js +3 -3
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +6 -6
- package/overflow-ellipsis/index.js +27 -27
- package/package.json +1 -1
- package/page-header/index.js +3 -3
- package/pagination/PageItem.js +7 -7
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +3 -3
- package/pagination/Pagination.js +4 -4
- package/pagination/index.js +1 -1
- package/picker/Input.js +7 -7
- package/picker/InputRange.js +77 -77
- package/popconfirm/index.js +11 -11
- package/popover/index.js +21 -21
- package/progress/CircleProgress.js +14 -14
- package/progress/LineProgess.js +14 -14
- package/progress/StepProgress.js +9 -9
- package/progress/index.js +26 -26
- package/radio/Group.js +4 -4
- package/radio/GroupBlock.js +3 -3
- package/radio/Radio.js +4 -4
- package/radio/index.js +2 -2
- package/rate/index.js +16 -16
- package/resize-box/ResizeTrigger.js +27 -28
- package/resize-box/Split.js +21 -21
- package/resize-box/SplitGroup.js +40 -40
- package/resize-box/index.js +23 -23
- package/result/index.js +29 -29
- package/select/Option.js +2 -2
- package/select/Select.js +11 -12
- package/select/index.js +2 -2
- package/select/util.js +5 -5
- package/select-view/Core.js +104 -106
- package/select-view/index.js +22 -23
- package/skeleton/Image.js +14 -14
- package/skeleton/Text.js +16 -16
- package/skeleton/index.js +11 -11
- package/slider/Button.js +4 -4
- package/slider/Dot.js +9 -9
- package/slider/Input.js +20 -20
- package/slider/Tick.js +14 -14
- package/slider/index.js +103 -103
- package/slider/util.js +3 -3
- package/space/index.js +14 -14
- package/speech-synthesis/index.js +26 -28
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +16 -16
- package/statistic/Countdown.js +17 -17
- package/statistic/index.js +32 -32
- package/steps/Step.js +8 -8
- package/steps/index.js +17 -17
- package/switch/index.js +32 -33
- package/table/Table.js +5 -5
- package/table/index.js +1 -1
- package/tabs/Tab.js +4 -4
- package/tabs/TabContent.js +3 -3
- package/tabs/TabPane.js +11 -11
- package/tabs/index.js +2 -2
- package/tabs/util.js +1 -1
- package/tag/index.js +16 -16
- package/time-picker/Picker.js +50 -50
- package/time-picker/TimeColumn.js +8 -8
- package/time-picker/TimePicker.js +32 -32
- package/time-picker/util.js +1 -1
- package/timeline/Item.js +15 -15
- package/timeline/Timeline.js +24 -24
- package/tooltip/index.js +23 -23
- package/transfer/Item.js +4 -4
- package/transfer/List.js +4 -4
- package/transfer/index.js +4 -4
- package/tree/Animation.js +3 -3
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +2 -2
- package/tree/Tree.js +4 -4
- package/tree/index.js +1 -1
- package/tree-select/List.js +2 -2
- package/tree-select/Select.js +8 -9
- package/tree-select/index.js +2 -2
- package/trigger/getPopupStyle.js +18 -19
- package/trigger/index.js +32 -33
- package/types/button/index.d.ts +2 -2
- package/types/color-picker/colors.d.ts +1 -1
- package/types/date-picker/util.d.ts +1 -1
- package/types/icon/index.d.ts +3 -1
- package/types/index.d.ts +1 -1
- package/types/menu/context.d.ts +1 -1
- package/typography/Base.js +33 -35
- package/typography/EditContent.js +16 -16
- package/typography/Ellipsis.js +24 -26
- package/typography/Operations.js +1 -1
- package/typography/Paragraph.js +8 -8
- package/typography/Typography.js +7 -7
- package/typography/index.js +1 -1
- package/upload/TriggerNode.js +8 -8
- package/upload/Upload.js +64 -65
- package/upload/Uploader.js +12 -12
- package/upload/request.js +13 -12
- package/upload/request_.js +5 -6
- package/utils/PqbCSSTransition.js +1 -1
- package/utils/caseName.js +4 -3
- package/utils/className.js +4 -3
- package/utils/constant.js +3 -3
- package/utils/contextHolder.js +1 -1
- package/utils/copy.js +5 -4
- package/utils/fileToURL.js +4 -3
- package/utils/index.js +261 -298
- package/utils/is.js +78 -115
- package/utils/keyboardCode.js +4 -26
- package/utils/math.js +10 -32
- package/utils/react19Adapter.js +1 -1
- package/utils/reactDOM.js +1 -1
- package/utils/saveAs.js +4 -3
- package/utils/screenfull.js +4 -3
- package/utils/scrollIntoView.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/tree.js +7 -83
- package/utils/tween.js +1 -1
- package/utils/validate.js +1 -1
- package/verification-code/VerificationCode.js +25 -25
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +1 -1
- package/watermark/Watermark.js +8 -8
- package/chunk/ATwvJ8j2.js +0 -6
- package/chunk/BFmckYou.js +0 -25
- package/chunk/Bl7BnD1R.js +0 -119
- package/chunk/Bmvhjhzq.js +0 -24
- package/chunk/BrOW642m.js +0 -130
- package/chunk/C0pRaDCf.js +0 -96
- package/chunk/CBzE-PUr.js +0 -23
- package/chunk/CUFsOxJ2.js +0 -10
- package/chunk/Ce1j9KTi.js +0 -6
- package/chunk/D0Dlbc2g.js +0 -41
- package/chunk/DRTWRsgI.js +0 -34
- package/chunk/DeV0v__J.js +0 -20
- package/chunk/DohlrJ4S.js +0 -50
- package/chunk/XTEsYGuF.js +0 -17
- package/chunk/yl4BU7Sd.js +0 -1068
package/typography/Ellipsis.js
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../chunk/
|
|
3
|
+
import "../chunk/CQvM33Vg.js";
|
|
4
4
|
import "../chunk/BFTV6myl.js";
|
|
5
|
-
import "../chunk/
|
|
5
|
+
import "../chunk/CXPOj2uy.js";
|
|
6
6
|
import "lodash/isEqualWith";
|
|
7
|
-
import "../chunk/
|
|
7
|
+
import "../chunk/ClM74To2.js";
|
|
8
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
8
9
|
import "lodash/isNumber";
|
|
9
10
|
import "lodash/merge";
|
|
10
11
|
import "../utils/dom.js";
|
|
11
|
-
import "../chunk/
|
|
12
|
-
import "../chunk/
|
|
13
|
-
import "
|
|
12
|
+
import "../chunk/B4WG1mhs.js";
|
|
13
|
+
import "../chunk/BZ3igxQN.js";
|
|
14
|
+
import "@unicom-cloud/utils/constant";
|
|
14
15
|
import "lodash/debounce";
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "lodash/kebabCase.js";
|
|
18
|
-
import "lodash/lowerFirst.js";
|
|
19
|
-
import "lodash/snakeCase.js";
|
|
20
|
-
import "lodash/startCase.js";
|
|
21
|
-
import "lodash/upperFirst.js";
|
|
22
|
-
import "../chunk/CUFsOxJ2.js";
|
|
16
|
+
import "@unicom-cloud/utils/case-name";
|
|
17
|
+
import "@unicom-cloud/utils/class-name";
|
|
23
18
|
import "../chunk/9TSjT7x_.js";
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
19
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
20
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
26
21
|
import "../chunk/tamGhTJp.js";
|
|
22
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
27
23
|
import "lodash/escapeRegExp";
|
|
28
24
|
import "lodash/isArray";
|
|
29
25
|
import "lodash/isString";
|
|
@@ -41,17 +37,20 @@ import "lodash/startCase";
|
|
|
41
37
|
import "lodash/throttle";
|
|
42
38
|
import "lodash/uniq";
|
|
43
39
|
import "lodash/upperFirst";
|
|
44
|
-
import "
|
|
40
|
+
import "@unicom-cloud/utils/math";
|
|
45
41
|
import "lodash/isPlainObject";
|
|
46
42
|
import "../chunk/BJ9_azwQ.js";
|
|
47
|
-
import "
|
|
43
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
44
|
+
import "@unicom-cloud/utils/screenfull";
|
|
48
45
|
import "../utils/throttleByRaf.js";
|
|
46
|
+
import "@unicom-cloud/utils/tree";
|
|
47
|
+
import "@unicom-cloud/utils/is";
|
|
49
48
|
import "uuid";
|
|
50
|
-
import "../chunk/
|
|
49
|
+
import "../chunk/DEuVgCzp.js";
|
|
51
50
|
import "../affix/index.js";
|
|
52
51
|
import "../alert/index.js";
|
|
53
52
|
import "../anchor/Anchor.js";
|
|
54
|
-
import { E as
|
|
53
|
+
import { E as or } from "../chunk/B4mZh-RK.js";
|
|
55
54
|
import "../avatar/index.js";
|
|
56
55
|
import "../back-top/index.js";
|
|
57
56
|
import "../badge/index.js";
|
|
@@ -59,7 +58,7 @@ import "../breadcrumb/index.js";
|
|
|
59
58
|
import "../button/index.js";
|
|
60
59
|
import "../card/index.js";
|
|
61
60
|
import "../carousel/index.js";
|
|
62
|
-
import "../chunk/
|
|
61
|
+
import "../chunk/DEiyXzBZ.js";
|
|
63
62
|
import "../comment/index.js";
|
|
64
63
|
import "../copy/index.js";
|
|
65
64
|
import "../date-picker/index.js";
|
|
@@ -75,8 +74,8 @@ import "../input/Input.js";
|
|
|
75
74
|
import "../input-tag/InputTag.js";
|
|
76
75
|
import "../layout/index.js";
|
|
77
76
|
import "../link/index.js";
|
|
78
|
-
import "../chunk/
|
|
79
|
-
import "../chunk/
|
|
77
|
+
import "../chunk/C5X4hOkx.js";
|
|
78
|
+
import "../chunk/DYspELhF.js";
|
|
80
79
|
import "../page-header/index.js";
|
|
81
80
|
import "../popconfirm/index.js";
|
|
82
81
|
import "../popover/index.js";
|
|
@@ -95,7 +94,7 @@ import "../statistic/index.js";
|
|
|
95
94
|
import "../steps/index.js";
|
|
96
95
|
import "../suspense-fallback-test/index.js";
|
|
97
96
|
import "../switch/index.js";
|
|
98
|
-
import "../chunk/
|
|
97
|
+
import "../chunk/BG7YGUsx.js";
|
|
99
98
|
import "../tag/index.js";
|
|
100
99
|
import "../time-picker/index.js";
|
|
101
100
|
import "../timeline/Timeline.js";
|
|
@@ -105,7 +104,6 @@ import "../upload/Upload.js";
|
|
|
105
104
|
import "../verification-code/VerificationCode.js";
|
|
106
105
|
import "../watermark/Watermark.js";
|
|
107
106
|
import "../chunk/CIRG541s.js";
|
|
108
|
-
import "lodash/isPlainObject.js";
|
|
109
107
|
export {
|
|
110
|
-
|
|
108
|
+
or as default
|
|
111
109
|
};
|
package/typography/Operations.js
CHANGED
|
@@ -4,7 +4,7 @@ import L from "lodash/isArray";
|
|
|
4
4
|
import a from "lodash/isPlainObject";
|
|
5
5
|
import { useEffect as U } from "react";
|
|
6
6
|
import q from "../copy/index.js";
|
|
7
|
-
import { u as z } from "../chunk/
|
|
7
|
+
import { u as z } from "../chunk/BYdIoY50.js";
|
|
8
8
|
import B from "../tooltip/index.js";
|
|
9
9
|
import { m as C } from "../chunk/B5RFT17G.js";
|
|
10
10
|
function X(P) {
|
package/typography/Paragraph.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { a as f } from "../chunk/
|
|
4
|
-
import
|
|
2
|
+
import { forwardRef as p, useContext as c } from "react";
|
|
3
|
+
import { a as f } from "../chunk/CQvM33Vg.js";
|
|
4
|
+
import i from "@unicom-cloud/utils/class-name";
|
|
5
5
|
import l from "./Base.js";
|
|
6
|
-
function g(a,
|
|
7
|
-
const { spacing:
|
|
6
|
+
function g(a, s) {
|
|
7
|
+
const { spacing: r = "default", className: o } = a, { getPrefixCls: e } = c(f), t = e("typography"), m = r === "close" ? i(`${t}-spacing-close`, o) : o;
|
|
8
8
|
return /* @__PURE__ */ n(
|
|
9
9
|
l,
|
|
10
10
|
{
|
|
11
11
|
...a,
|
|
12
|
-
ref:
|
|
12
|
+
ref: s,
|
|
13
13
|
componentType: "Paragraph",
|
|
14
|
-
className:
|
|
14
|
+
className: m
|
|
15
15
|
}
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
const x =
|
|
18
|
+
const x = p(
|
|
19
19
|
g
|
|
20
20
|
);
|
|
21
21
|
x.displayName = "Paragraph";
|
package/typography/Typography.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as c, useContext as
|
|
3
|
-
import { a as
|
|
4
|
-
import
|
|
5
|
-
function y(o,
|
|
6
|
-
const { getPrefixCls:
|
|
7
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c, useContext as l } from "react";
|
|
3
|
+
import { a as f } from "../chunk/CQvM33Vg.js";
|
|
4
|
+
import i from "@unicom-cloud/utils/class-name";
|
|
5
|
+
function y(o, s) {
|
|
6
|
+
const { getPrefixCls: a } = l(f), t = a("typography"), { className: r, style: e, children: p } = o, m = i(t, r);
|
|
7
|
+
return /* @__PURE__ */ n("article", { ref: s, style: e, className: m, children: p });
|
|
8
8
|
}
|
|
9
9
|
const g = c(y);
|
|
10
10
|
g.displayName = "Typography";
|
package/typography/index.js
CHANGED
package/upload/TriggerNode.js
CHANGED
|
@@ -3,19 +3,19 @@ import y from "@unicom-cloud/icons/IconUiPlus";
|
|
|
3
3
|
import A from "@unicom-cloud/icons/IconUiUpload";
|
|
4
4
|
import C, { forwardRef as G, useContext as K, useState as U, useEffect as L } from "react";
|
|
5
5
|
import O from "../button/index.js";
|
|
6
|
-
import { a as R } from "../chunk/
|
|
7
|
-
import { u as B } from "../chunk/
|
|
8
|
-
import
|
|
6
|
+
import { a as R } from "../chunk/CQvM33Vg.js";
|
|
7
|
+
import { u as B } from "../chunk/BYdIoY50.js";
|
|
8
|
+
import I from "@unicom-cloud/utils/class-name";
|
|
9
9
|
import { loopDirectory as H, getFiles as S } from "./util.js";
|
|
10
10
|
const V = (e, T) => {
|
|
11
11
|
const k = B(), { locale: l } = K(R), [c, g] = U(!1), [s, f] = U(0), {
|
|
12
|
-
tip:
|
|
12
|
+
tip: N,
|
|
13
13
|
children: m,
|
|
14
14
|
disabled: n,
|
|
15
15
|
drag: w,
|
|
16
16
|
listType: F,
|
|
17
17
|
prefixCls: a,
|
|
18
|
-
accept:
|
|
18
|
+
accept: E,
|
|
19
19
|
multiple: P
|
|
20
20
|
} = e, $ = {
|
|
21
21
|
disabled: n
|
|
@@ -45,7 +45,7 @@ const V = (e, T) => {
|
|
|
45
45
|
var i, b;
|
|
46
46
|
if (t.preventDefault(), !n && e.drag !== !1) {
|
|
47
47
|
if (g(!1), e.directory)
|
|
48
|
-
H(t.dataTransfer.items,
|
|
48
|
+
H(t.dataTransfer.items, E, (u) => {
|
|
49
49
|
var d;
|
|
50
50
|
(d = e.onDragFiles) == null || d.call(e, u);
|
|
51
51
|
});
|
|
@@ -55,7 +55,7 @@ const V = (e, T) => {
|
|
|
55
55
|
const h = o.webkitGetAsEntry();
|
|
56
56
|
return h != null && h.isDirectory ? [...D, j] : D;
|
|
57
57
|
}
|
|
58
|
-
}, []), d = [].slice.call(t.dataTransfer.files || []).filter((D, o) => !u.includes(o)), v = S(d,
|
|
58
|
+
}, []), d = [].slice.call(t.dataTransfer.files || []).filter((D, o) => !u.includes(o)), v = S(d, E);
|
|
59
59
|
v.length > 0 && ((i = e.onDragFiles) == null || i.call(e, P ? v : v.slice(0, 1)));
|
|
60
60
|
}
|
|
61
61
|
(b = e.onDrop) == null || b.call(e, t);
|
|
@@ -90,7 +90,7 @@ const V = (e, T) => {
|
|
|
90
90
|
children: [
|
|
91
91
|
/* @__PURE__ */ r(y, {}),
|
|
92
92
|
/* @__PURE__ */ r("p", { className: `${a}-trigger-drag-text`, children: c ? l.Upload.dragHover : l.Upload.drag }),
|
|
93
|
-
|
|
93
|
+
N && /* @__PURE__ */ r("div", { className: `${a}-trigger-tip`, children: N })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
) : /* @__PURE__ */ x(
|
package/upload/Upload.js
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as y, Fragment as T, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import w from "lodash/isFunction";
|
|
3
3
|
import le from "lodash/isNumber";
|
|
4
|
-
import { useContext as D, forwardRef as j, useState as
|
|
5
|
-
import { a as V, I as ae } from "../chunk/
|
|
4
|
+
import { useContext as D, forwardRef as j, useState as R, useEffect as F, isValidElement as re, useRef as K, useImperativeHandle as oe } from "react";
|
|
5
|
+
import { a as V, I as ae } from "../chunk/CQvM33Vg.js";
|
|
6
6
|
import { u as se } from "../chunk/BFTV6myl.js";
|
|
7
|
-
import
|
|
7
|
+
import z from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import { o as ce } from "../chunk/BKKEev13.js";
|
|
9
9
|
import M from "../utils/warning.js";
|
|
10
10
|
import { STATUS as g } from "./interface.js";
|
|
11
11
|
import { b as de } from "../chunk/BJ9_azwQ.js";
|
|
12
12
|
import ue from "../image/ImagePreviewGroup.js";
|
|
13
|
-
import { P as W } from "../chunk/
|
|
13
|
+
import { P as W } from "../chunk/NPajzdOv.js";
|
|
14
14
|
import G from "@unicom-cloud/icons/IconUiDelete";
|
|
15
15
|
import me from "@unicom-cloud/icons/IconUiEye";
|
|
16
16
|
import fe from "@unicom-cloud/icons/IconUiImageClose";
|
|
17
17
|
import J from "@unicom-cloud/icons/IconUiUpload";
|
|
18
|
-
import {
|
|
19
|
-
import { u as q } from "../chunk/
|
|
20
|
-
import "../chunk/
|
|
18
|
+
import { fileToURL as Q } from "@unicom-cloud/utils/file";
|
|
19
|
+
import { u as q } from "../chunk/BYdIoY50.js";
|
|
20
|
+
import "../chunk/ClM74To2.js";
|
|
21
21
|
import he from "@unicom-cloud/icons/IconUiCheck";
|
|
22
22
|
import ge from "@unicom-cloud/icons/IconUiPause";
|
|
23
23
|
import Ue from "@unicom-cloud/icons/IconUiPlayArrowFill";
|
|
24
24
|
import ve from "../progress/index.js";
|
|
25
25
|
import S from "../tooltip/index.js";
|
|
26
|
-
import "
|
|
27
|
-
import A from "lodash/isPlainObject.js";
|
|
26
|
+
import { isPlainObject as A } from "@unicom-cloud/utils/is";
|
|
28
27
|
import xe from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
29
28
|
import Ie from "@unicom-cloud/icons/IconUiFile";
|
|
30
29
|
import be from "@unicom-cloud/icons/IconUiFileAudio";
|
|
31
30
|
import X from "@unicom-cloud/icons/IconUiFileImage";
|
|
32
31
|
import $e from "@unicom-cloud/icons/IconUiFilePdf";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
32
|
+
import Ne from "@unicom-cloud/icons/IconUiFileVideo";
|
|
33
|
+
import Pe from "./Uploader.js";
|
|
35
34
|
const Y = (e) => {
|
|
36
35
|
var b, f, s, o, U, x;
|
|
37
|
-
const m = q(), { file: d, prefixCls: c, progressProps: i, progressRender: l } = e, { locale: r } = D(V), { status: a, percent:
|
|
36
|
+
const m = q(), { file: d, prefixCls: c, progressProps: i, progressRender: l } = e, { locale: r } = D(V), { status: a, percent: N = 0 } = d, v = `${c}-list`, I = i && i.width ? { width: i.width } : {}, h = /* @__PURE__ */ y(T, { children: [
|
|
38
37
|
a === g.fail && e.reuploadIcon !== null && /* @__PURE__ */ t(
|
|
39
38
|
"span",
|
|
40
39
|
{
|
|
@@ -56,7 +55,7 @@ const Y = (e) => {
|
|
|
56
55
|
}
|
|
57
56
|
),
|
|
58
57
|
a === g.success && e.successIcon !== null && /* @__PURE__ */ t("span", { className: `${c}-list-success-icon`, children: e.successIcon || /* @__PURE__ */ t(he, {}) }),
|
|
59
|
-
a !== g.success && /* @__PURE__ */
|
|
58
|
+
a !== g.success && /* @__PURE__ */ y("div", { className: `${v}-status`, style: I, children: [
|
|
60
59
|
/* @__PURE__ */ t(
|
|
61
60
|
ve,
|
|
62
61
|
{
|
|
@@ -64,7 +63,7 @@ const Y = (e) => {
|
|
|
64
63
|
className: `${v}-progress`,
|
|
65
64
|
type: "circle",
|
|
66
65
|
status: a === g.fail ? "error" : a === g.success ? "success" : "normal",
|
|
67
|
-
percent:
|
|
66
|
+
percent: N,
|
|
68
67
|
size: "mini",
|
|
69
68
|
...i
|
|
70
69
|
}
|
|
@@ -111,9 +110,9 @@ const Y = (e) => {
|
|
|
111
110
|
] })
|
|
112
111
|
] });
|
|
113
112
|
return w(l) ? l(d, h) : h;
|
|
114
|
-
},
|
|
115
|
-
const { disabled: d, prefixCls: c, file: i, showUploadList: l, locale: r } = e, a = q(),
|
|
116
|
-
return
|
|
113
|
+
}, ye = (e, m) => {
|
|
114
|
+
const { disabled: d, prefixCls: c, file: i, showUploadList: l, locale: r } = e, a = q(), N = `${c}-list-item-picture`, { status: v, originFile: I } = i, [h, b] = R(i.url), f = A(l) ? l : {};
|
|
115
|
+
return F(() => {
|
|
117
116
|
if (i.url !== void 0)
|
|
118
117
|
b(i.url);
|
|
119
118
|
else {
|
|
@@ -127,13 +126,13 @@ const Y = (e) => {
|
|
|
127
126
|
}
|
|
128
127
|
return () => {
|
|
129
128
|
};
|
|
130
|
-
}, [i.url, i.originFile]),
|
|
129
|
+
}, [i.url, i.originFile]), F(() => {
|
|
131
130
|
var s;
|
|
132
131
|
return (s = e.onChange) == null || s.call(e, { type: "url", data: h }), () => {
|
|
133
132
|
var o;
|
|
134
133
|
(o = e.onChange) == null || o.call(e, { type: "url", data: void 0 });
|
|
135
134
|
};
|
|
136
|
-
}, [h]), /* @__PURE__ */ t("div", { className:
|
|
135
|
+
}, [h]), /* @__PURE__ */ t("div", { className: N, ref: m, children: v === g.uploading ? /* @__PURE__ */ t(
|
|
137
136
|
Y,
|
|
138
137
|
{
|
|
139
138
|
onReupload: e.onReupload,
|
|
@@ -145,11 +144,11 @@ const Y = (e) => {
|
|
|
145
144
|
progressProps: e.progressProps,
|
|
146
145
|
...f
|
|
147
146
|
}
|
|
148
|
-
) : /* @__PURE__ */
|
|
147
|
+
) : /* @__PURE__ */ y(T, { children: [
|
|
149
148
|
w(f.imageRender) ? f.imageRender(i) : /* @__PURE__ */ t("img", { src: h, alt: i.name }),
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
i.status === g.fail && /* @__PURE__ */ t("div", { className: `${
|
|
152
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ y("div", { className: `${N}-mask`, role: "radiogroup", children: [
|
|
150
|
+
i.status === g.fail && /* @__PURE__ */ t("div", { className: `${N}-error-tip`, children: f.errorIcon !== null && /* @__PURE__ */ t("span", { className: `${c}-list-error-icon`, children: f.errorIcon || /* @__PURE__ */ t(fe, {}) }) }),
|
|
151
|
+
/* @__PURE__ */ y("div", { className: `${N}-operation`, children: [
|
|
153
152
|
i.status !== g.fail && f.previewIcon !== null && /* @__PURE__ */ t(
|
|
154
153
|
"span",
|
|
155
154
|
{
|
|
@@ -213,7 +212,7 @@ const Y = (e) => {
|
|
|
213
212
|
] })
|
|
214
213
|
] })
|
|
215
214
|
] }) });
|
|
216
|
-
},
|
|
215
|
+
}, Ce = j(ye), we = (e) => {
|
|
217
216
|
let m = "";
|
|
218
217
|
if (e.originFile && e.originFile.type)
|
|
219
218
|
m = e.originFile.type;
|
|
@@ -221,13 +220,13 @@ const Y = (e) => {
|
|
|
221
220
|
const c = (e.name || "").split(".").pop() || "";
|
|
222
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");
|
|
223
222
|
}
|
|
224
|
-
return m.indexOf("image") > -1 ? X : m.indexOf("pdf") > -1 ? $e : m.indexOf("audio") > -1 ? be : m.indexOf("video") > -1 ?
|
|
223
|
+
return m.indexOf("image") > -1 ? X : m.indexOf("pdf") > -1 ? $e : m.indexOf("audio") > -1 ? be : m.indexOf("video") > -1 ? Ne : Ie;
|
|
225
224
|
}, Le = (e, m) => {
|
|
226
|
-
const { prefixCls: d, disabled: c, file: i, locale: l } = e, r = `${d}-list-item-text`, a = q(),
|
|
225
|
+
const { prefixCls: d, disabled: c, file: i, locale: l } = e, r = `${d}-list-item-text`, a = q(), N = we(i), v = A(e.showUploadList) ? e.showUploadList : {}, I = A(v) ? v : {}, h = i.name || i.originFile && i.originFile.name, [b, f] = R(i.url);
|
|
227
226
|
let s = {};
|
|
228
227
|
return i.status !== g.fail && (s = {
|
|
229
228
|
popupVisible: !1
|
|
230
|
-
}),
|
|
229
|
+
}), F(() => {
|
|
231
230
|
if (i.url !== void 0)
|
|
232
231
|
f(i.url);
|
|
233
232
|
else {
|
|
@@ -241,23 +240,23 @@ const Y = (e) => {
|
|
|
241
240
|
}
|
|
242
241
|
return () => {
|
|
243
242
|
};
|
|
244
|
-
}, [i.url, i.originFile]),
|
|
243
|
+
}, [i.url, i.originFile]), F(() => {
|
|
245
244
|
var o;
|
|
246
245
|
return (o = e.onChange) == null || o.call(e, { type: "url", data: b }), () => {
|
|
247
246
|
var U;
|
|
248
247
|
(U = e.onChange) == null || U.call(e, { type: "url", data: void 0 });
|
|
249
248
|
};
|
|
250
|
-
}, [b]), /* @__PURE__ */
|
|
249
|
+
}, [b]), /* @__PURE__ */ y(
|
|
251
250
|
"div",
|
|
252
251
|
{
|
|
253
252
|
className: `${d}-list-item ${d}-list-item-${i.status}`,
|
|
254
253
|
ref: m,
|
|
255
254
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ y("div", { className: r, children: [
|
|
257
256
|
e.listType === "picture-list" && /* @__PURE__ */ t("div", { className: `${r}-thumbnail`, children: w(v.imageRender) ? v.imageRender(i) : /* @__PURE__ */ t("img", { src: b }) }),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
e.listType === "text" && I.fileIcon !== null && /* @__PURE__ */ t("span", { className: `${d}-list-file-icon`, children: I.fileIcon || /* @__PURE__ */ t(
|
|
257
|
+
/* @__PURE__ */ y("div", { className: `${r}-content`, children: [
|
|
258
|
+
/* @__PURE__ */ y("div", { className: `${r}-name`, children: [
|
|
259
|
+
e.listType === "text" && I.fileIcon !== null && /* @__PURE__ */ t("span", { className: `${d}-list-file-icon`, children: I.fileIcon || /* @__PURE__ */ t(N, {}) }),
|
|
261
260
|
w(v.fileName) ? /* @__PURE__ */ t("span", { className: `${r}-name-text`, children: v.fileName(i) }) : i.url ? /* @__PURE__ */ t(
|
|
262
261
|
"a",
|
|
263
262
|
{
|
|
@@ -314,28 +313,28 @@ const Y = (e) => {
|
|
|
314
313
|
]
|
|
315
314
|
}
|
|
316
315
|
);
|
|
317
|
-
},
|
|
316
|
+
}, Re = j(Le), Z = (e) => {
|
|
318
317
|
const { locale: m, rtl: d } = D(V), {
|
|
319
318
|
listType: c,
|
|
320
319
|
fileList: i,
|
|
321
320
|
renderUploadList: l,
|
|
322
321
|
renderUploadItem: r,
|
|
323
322
|
prefixCls: a,
|
|
324
|
-
...
|
|
325
|
-
} = e, [v, I] =
|
|
323
|
+
...N
|
|
324
|
+
} = e, [v, I] = R(-1), [h, b] = R([]);
|
|
326
325
|
if (w(l))
|
|
327
|
-
return /* @__PURE__ */ t("div", { className: `${a}-list`, children: l(i,
|
|
326
|
+
return /* @__PURE__ */ t("div", { className: `${a}-list`, children: l(i, N) });
|
|
328
327
|
const f = (o) => {
|
|
329
328
|
e.imagePreview && I(o);
|
|
330
329
|
};
|
|
331
330
|
function s(o, U, x) {
|
|
332
331
|
(o == null ? void 0 : o.type) === "url" && [g.init, g.success].indexOf(x.status) > -1 && b((n) => {
|
|
333
|
-
const
|
|
334
|
-
return
|
|
332
|
+
const C = [...n];
|
|
333
|
+
return C[U] = o.data, C.filter(Boolean);
|
|
335
334
|
});
|
|
336
335
|
}
|
|
337
|
-
return
|
|
338
|
-
}, []), /* @__PURE__ */
|
|
336
|
+
return F(() => () => {
|
|
337
|
+
}, []), /* @__PURE__ */ y(T, { children: [
|
|
339
338
|
/* @__PURE__ */ t(
|
|
340
339
|
de,
|
|
341
340
|
{
|
|
@@ -352,12 +351,12 @@ const Y = (e) => {
|
|
|
352
351
|
{
|
|
353
352
|
className: `${a}-list-item ${a}-list-item-${o.status}`,
|
|
354
353
|
children: /* @__PURE__ */ t(
|
|
355
|
-
|
|
354
|
+
Ce,
|
|
356
355
|
{
|
|
357
356
|
...e,
|
|
358
357
|
onPreview: (n) => {
|
|
359
|
-
var
|
|
360
|
-
f(U), (
|
|
358
|
+
var C;
|
|
359
|
+
f(U), (C = e.onPreview) == null || C.call(e, n);
|
|
361
360
|
},
|
|
362
361
|
file: o,
|
|
363
362
|
locale: m,
|
|
@@ -368,7 +367,7 @@ const Y = (e) => {
|
|
|
368
367
|
)
|
|
369
368
|
}
|
|
370
369
|
) : /* @__PURE__ */ t(
|
|
371
|
-
|
|
370
|
+
Re,
|
|
372
371
|
{
|
|
373
372
|
...e,
|
|
374
373
|
file: o,
|
|
@@ -460,7 +459,7 @@ const k = function(e) {
|
|
|
460
459
|
}
|
|
461
460
|
return d;
|
|
462
461
|
}, []);
|
|
463
|
-
},
|
|
462
|
+
}, Fe = {
|
|
464
463
|
listType: "text",
|
|
465
464
|
autoUpload: !0,
|
|
466
465
|
showUploadList: !0,
|
|
@@ -469,11 +468,11 @@ const k = function(e) {
|
|
|
469
468
|
}, Ee = (e, m) => {
|
|
470
469
|
const { getPrefixCls: d, componentConfig: c, rtl: i } = D(V), l = se(
|
|
471
470
|
e,
|
|
472
|
-
|
|
471
|
+
Fe,
|
|
473
472
|
c == null ? void 0 : c.Upload
|
|
474
|
-
), r = d("upload"), a = K(),
|
|
475
|
-
var
|
|
476
|
-
"fileList" in l || I(u), (
|
|
473
|
+
), r = d("upload"), a = K(), N = K(), [v, I] = R(() => "fileList" in l ? k(l.fileList) : "defaultFileList" in l ? k(l.defaultFileList) : []), h = "fileList" in l ? k(l.fileList) : v, b = (u, $) => {
|
|
474
|
+
var P;
|
|
475
|
+
"fileList" in l || I(u), (P = l.onChange) == null || P.call(l, u, $);
|
|
477
476
|
}, f = (u) => {
|
|
478
477
|
u && setTimeout(() => {
|
|
479
478
|
a.current && a.current.upload(u);
|
|
@@ -486,13 +485,13 @@ const k = function(e) {
|
|
|
486
485
|
const { onRemove: $ } = l;
|
|
487
486
|
Promise.resolve(
|
|
488
487
|
w($) ? $(u, h) : $
|
|
489
|
-
).then((
|
|
490
|
-
|
|
488
|
+
).then((P) => {
|
|
489
|
+
P !== !1 && (a.current && a.current.abort(u), b(
|
|
491
490
|
h.filter((E) => E.uid !== u.uid),
|
|
492
491
|
u
|
|
493
492
|
));
|
|
494
|
-
}).catch((
|
|
495
|
-
console.error(
|
|
493
|
+
}).catch((P) => {
|
|
494
|
+
console.error(P);
|
|
496
495
|
});
|
|
497
496
|
}
|
|
498
497
|
}, U = (u) => {
|
|
@@ -501,8 +500,8 @@ const k = function(e) {
|
|
|
501
500
|
oe(m, () => ({
|
|
502
501
|
submit: (u) => {
|
|
503
502
|
let $ = [];
|
|
504
|
-
u ? $ = [u] : $ = h.filter((
|
|
505
|
-
f(
|
|
503
|
+
u ? $ = [u] : $ = h.filter((P) => P.status === g.init), $.forEach((P) => {
|
|
504
|
+
f(P);
|
|
506
505
|
});
|
|
507
506
|
},
|
|
508
507
|
// file: fileList中的file对象
|
|
@@ -513,12 +512,12 @@ const k = function(e) {
|
|
|
513
512
|
reupload: (u) => {
|
|
514
513
|
s(u);
|
|
515
514
|
},
|
|
516
|
-
getRootDOMNode: () =>
|
|
515
|
+
getRootDOMNode: () => N.current
|
|
517
516
|
}));
|
|
518
517
|
const {
|
|
519
518
|
listType: x,
|
|
520
519
|
className: n,
|
|
521
|
-
style:
|
|
520
|
+
style: C,
|
|
522
521
|
renderUploadItem: p,
|
|
523
522
|
showUploadList: H,
|
|
524
523
|
renderUploadList: ee,
|
|
@@ -571,10 +570,10 @@ const k = function(e) {
|
|
|
571
570
|
},
|
|
572
571
|
n
|
|
573
572
|
),
|
|
574
|
-
style:
|
|
575
|
-
ref:
|
|
573
|
+
style: C,
|
|
574
|
+
ref: N,
|
|
576
575
|
children: /* @__PURE__ */ t(
|
|
577
|
-
|
|
576
|
+
Pe,
|
|
578
577
|
{
|
|
579
578
|
ref: a,
|
|
580
579
|
...l,
|
|
@@ -584,17 +583,17 @@ const k = function(e) {
|
|
|
584
583
|
prefixCls: r,
|
|
585
584
|
fileList: h,
|
|
586
585
|
onProgress: (u, $) => {
|
|
587
|
-
var
|
|
586
|
+
var P;
|
|
588
587
|
u && ("fileList" in l || I(
|
|
589
588
|
h.map((E) => E.uid === u.uid ? u : E)
|
|
590
|
-
), (
|
|
589
|
+
), (P = l.onProgress) == null || P.call(l, u, $));
|
|
591
590
|
},
|
|
592
591
|
onFileStatusChange: b
|
|
593
592
|
}
|
|
594
593
|
)
|
|
595
594
|
}
|
|
596
595
|
);
|
|
597
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ y(T, { children: [
|
|
598
597
|
x !== "picture-card" && B,
|
|
599
598
|
H && /* @__PURE__ */ t(
|
|
600
599
|
Z,
|
package/upload/Uploader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as J, Fragment as K, jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { isFile as M } from "@unicom-cloud/utils/is";
|
|
3
|
+
import j from "lodash/isFunction";
|
|
4
4
|
import Q from "lodash/isNumber";
|
|
5
5
|
import W from "lodash/isPlainObject";
|
|
6
6
|
import X, { useRef as Y, useState as Z, useImperativeHandle as _ } from "react";
|
|
7
|
-
import { P as tt } from "../chunk/
|
|
7
|
+
import { P as tt } from "../chunk/NPajzdOv.js";
|
|
8
8
|
import et from "./TriggerNode.js";
|
|
9
9
|
import { STATUS as c } from "./interface.js";
|
|
10
10
|
import it from "./request.js";
|
|
@@ -63,11 +63,11 @@ function ot(i, E) {
|
|
|
63
63
|
withCredentials: h,
|
|
64
64
|
customRequest: r,
|
|
65
65
|
method: m
|
|
66
|
-
} = i,
|
|
66
|
+
} = i, N = {
|
|
67
67
|
onProgress: (g, o) => {
|
|
68
|
-
var
|
|
68
|
+
var $;
|
|
69
69
|
const F = q(t);
|
|
70
|
-
F && (F.status = c.uploading, F.percent = g, (
|
|
70
|
+
F && (F.status = c.uploading, F.percent = g, ($ = i == null ? void 0 : i.onProgress) == null || $.call(i, F, o));
|
|
71
71
|
},
|
|
72
72
|
onSuccess: (g) => {
|
|
73
73
|
const o = q(t);
|
|
@@ -85,7 +85,7 @@ function ot(i, E) {
|
|
|
85
85
|
};
|
|
86
86
|
l(t);
|
|
87
87
|
let w;
|
|
88
|
-
r ? w = await r(
|
|
88
|
+
r ? w = await r(N) : e && (w = it({ ...N, action: e, method: m })), x({
|
|
89
89
|
uploadRequests: {
|
|
90
90
|
...b.uploadRequests,
|
|
91
91
|
[t.uid]: w
|
|
@@ -112,7 +112,7 @@ function ot(i, E) {
|
|
|
112
112
|
}, 0);
|
|
113
113
|
};
|
|
114
114
|
t.forEach((r, m) => {
|
|
115
|
-
nt(r, i.accept) && (
|
|
115
|
+
nt(r, i.accept) && (j(i.beforeUpload) ? Promise.resolve(i.beforeUpload(r, t)).then((a) => {
|
|
116
116
|
if (a !== !1) {
|
|
117
117
|
const u = M(a) ? a : r;
|
|
118
118
|
h(u, m);
|
|
@@ -132,7 +132,7 @@ function ot(i, E) {
|
|
|
132
132
|
drag: C,
|
|
133
133
|
listType: D,
|
|
134
134
|
hide: H,
|
|
135
|
-
directory:
|
|
135
|
+
directory: I,
|
|
136
136
|
onDrop: V,
|
|
137
137
|
onDragOver: B,
|
|
138
138
|
onDragLeave: G
|
|
@@ -153,7 +153,7 @@ function ot(i, E) {
|
|
|
153
153
|
type: "file",
|
|
154
154
|
accept: W(d) ? d == null ? void 0 : d.type : d,
|
|
155
155
|
multiple: k,
|
|
156
|
-
...
|
|
156
|
+
...I ? { webkitdirectory: "true" } : {},
|
|
157
157
|
onChange: (t) => {
|
|
158
158
|
const e = t.target.files;
|
|
159
159
|
e && (T([].slice.call(e)), R.current.value = "");
|
|
@@ -174,7 +174,7 @@ function ot(i, E) {
|
|
|
174
174
|
children: /* @__PURE__ */ y(
|
|
175
175
|
et,
|
|
176
176
|
{
|
|
177
|
-
directory:
|
|
177
|
+
directory: I,
|
|
178
178
|
tip: U,
|
|
179
179
|
multiple: k,
|
|
180
180
|
accept: d,
|
|
@@ -190,7 +190,7 @@ function ot(i, E) {
|
|
|
190
190
|
!v && ((e = (t = R.current) == null ? void 0 : t.click) == null || e.call(t));
|
|
191
191
|
},
|
|
192
192
|
prefixCls: L,
|
|
193
|
-
children:
|
|
193
|
+
children: j(P) ? P({ fileList: i.fileList }) : P
|
|
194
194
|
}
|
|
195
195
|
)
|
|
196
196
|
},
|