@unicom-cloud/ui 0.8.56 → 0.8.58

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.
Files changed (261) hide show
  1. package/Affix.js +15 -15
  2. package/Alert.js +5 -5
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +28 -28
  5. package/Avatar.js +11 -11
  6. package/BackTop.js +28 -28
  7. package/Badge.js +10 -10
  8. package/Breadcrumb.js +6 -6
  9. package/Button.js +11 -10
  10. package/Calendar.js +8 -8
  11. package/Card.js +3 -3
  12. package/Carousel.js +7 -7
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +582 -11
  17. package/Comment.js +7 -7
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +6 -6
  20. package/DatePicker.js +14 -12
  21. package/Descriptions.js +3 -3
  22. package/Divider.js +3 -3
  23. package/Draggable.js +12 -12
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +5 -5
  26. package/Empty.js +3 -3
  27. package/Form.js +1410 -10
  28. package/Grid.js +14 -14
  29. package/Icon.js +2 -2
  30. package/IconHover.js +2 -2
  31. package/Image.js +1 -1
  32. package/Input.js +2 -2
  33. package/InputNumber.js +8 -8
  34. package/InputTag.js +1 -1
  35. package/Layout.js +8 -8
  36. package/Link.js +13 -13
  37. package/List.js +21 -21
  38. package/Mentions.js +30 -30
  39. package/Menu.js +1 -1
  40. package/Message.js +3 -3
  41. package/Modal.js +1 -1
  42. package/Notice.js +3 -3
  43. package/Notification.js +4 -4
  44. package/OverflowEllipsis.js +9 -9
  45. package/PageHeader.js +10 -10
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +5 -5
  49. package/Popover.js +7 -7
  50. package/Portal.js +1 -1
  51. package/Progress.js +15 -15
  52. package/Radio.js +2 -2
  53. package/Rate.js +10 -10
  54. package/ResizeBox.js +10 -11
  55. package/Result.js +11 -11
  56. package/Select.js +1 -1
  57. package/SelectView.js +40 -41
  58. package/Skeleton.js +4 -4
  59. package/Slider.js +9 -9
  60. package/Space.js +12 -12
  61. package/SpeechSynthesis.js +1 -1
  62. package/Spin.js +11 -11
  63. package/Statistic.js +43 -43
  64. package/Steps.js +5 -5
  65. package/Switch.js +15 -16
  66. package/Table.js +17 -17
  67. package/Tabs.js +1 -1
  68. package/Tag.js +5 -5
  69. package/TimePicker.js +38 -38
  70. package/Timeline.js +1 -1
  71. package/Tooltip.js +9 -9
  72. package/Transfer.js +26 -26
  73. package/Tree.js +1 -1
  74. package/TreeSelect.js +1 -1
  75. package/Trigger.js +11 -11
  76. package/Typography.js +1 -1
  77. package/Upload.js +4 -1
  78. package/VerificationCode.js +1 -1
  79. package/Version.js +1 -1
  80. package/VirtualList.js +1 -1
  81. package/Watermark.js +1 -1
  82. package/chunk/{m_kOQCiU.js → -LZOUh53.js} +1 -1
  83. package/chunk/{CXNW5Y2a.js → -jdfq71f.js} +1 -1
  84. package/chunk/{CkAOsst1.js → 4-gvEY5y.js} +30 -30
  85. package/chunk/{DQXq1QT0.js → B0GOLsj_.js} +1 -1
  86. package/chunk/{yvbAFxtk.js → B16KHtX-.js} +16 -16
  87. package/chunk/{CggcswbO.js → B2vORJQ8.js} +19 -15
  88. package/chunk/{BCk8e9fj.js → B7Zsp3gO.js} +1 -1
  89. package/chunk/B8QV6E2b.js +34 -0
  90. package/chunk/{BeM2hfks.js → BBVjSFnw.js} +27 -23
  91. package/chunk/{1mEO29GP.js → BDjXkzNj.js} +1 -1
  92. package/chunk/{BuEC_zcc.js → BEDYCG-I.js} +31 -31
  93. package/chunk/{B45v5S9k.js → BHn4xgbv.js} +1 -1
  94. package/chunk/{CF3Telny.js → BJ_7JTqC.js} +3 -3
  95. package/chunk/{BM6dpkeM.js → BLSiP_gg.js} +1 -1
  96. package/chunk/{9Gh1afjL.js → BMJfSSLX.js} +1 -1
  97. package/chunk/{DBJ8d0o0.js → BNHrEI0Y.js} +31 -31
  98. package/chunk/{BP7xX86Q.js → BPZ-6HKJ.js} +131 -134
  99. package/chunk/{DxNRWF67.js → BVLwPZis.js} +11 -11
  100. package/chunk/{BpwDupra.js → BYhtrDV3.js} +9 -9
  101. package/chunk/{D6mVoX-C.js → B_nfMl0e.js} +1 -1
  102. package/chunk/{BWx1cVT_.js → BcS17Pzy.js} +1 -1
  103. package/chunk/Bdh4XVuf.js +1487 -0
  104. package/chunk/{BkHxm4sv.js → BdiEwtQO.js} +1 -1
  105. package/chunk/{DDda6s72.js → BjSHZA0m.js} +6 -6
  106. package/chunk/{C7Okdv4u.js → Bpug_KxP.js} +1 -1
  107. package/chunk/BzPkh4Zv.js +11 -0
  108. package/chunk/{CwXmtKib.js → C1D7T29r.js} +35 -35
  109. package/chunk/{DYZzQ2uT.js → C1u_ckwU.js} +1 -1
  110. package/chunk/C1xMmQIZ.js +468 -0
  111. package/chunk/C2lIz2F9.js +60 -0
  112. package/chunk/{Be7oeWU8.js → C43Hv2Bl.js} +1 -1
  113. package/chunk/{JnyGFb5j.js → C5AQWbC4.js} +79 -79
  114. package/chunk/{fqgc8r6C.js → C9vsih_D.js} +1 -1
  115. package/chunk/CANaGbGR.js +154 -0
  116. package/chunk/{BA02BFUV.js → CAfR2wLq.js} +1 -1
  117. package/chunk/{CcX2pBUh.js → CAfecMDF.js} +1 -1
  118. package/chunk/{BHK9zpXn.js → CKp4rZnD.js} +1 -1
  119. package/chunk/CTxjmYmx.js +19 -0
  120. package/chunk/{BqxwlITu.js → CV2Aqv9q.js} +1 -1
  121. package/chunk/{bsawGxt8.js → CYdarMv9.js} +1 -1
  122. package/chunk/{DafaH1Qt.js → C_S5Mdvd.js} +43 -44
  123. package/chunk/{DkIjpuBZ.js → Cbd50gx8.js} +11 -11
  124. package/chunk/{B2Bp3i5u.js → CbiWdbr_.js} +12 -12
  125. package/chunk/{cUuQh7L_.js → CmB-TL7C.js} +1 -1
  126. package/chunk/{BbYzi8M0.js → CuOl4X0X.js} +4 -4
  127. package/chunk/{BHLTzWzi.js → D-ER56Sf.js} +1 -1
  128. package/chunk/{BK1FKNAX.js → D-aYnb6u.js} +1 -1
  129. package/chunk/{DalIRWr7.js → D2HkyI6A.js} +9 -9
  130. package/chunk/D3NFxdmG.js +518 -0
  131. package/chunk/{C2fspJbE.js → D3xQFJcO.js} +1 -1
  132. package/chunk/{Lk60-jkf.js → DApXtulb.js} +4 -0
  133. package/chunk/{sl8s35SK.js → DJcEys80.js} +1 -1
  134. package/chunk/{B1S1OEw6.js → DLIm6rRJ.js} +1 -1
  135. package/chunk/{C95ipQ6b.js → DOWEHtqM.js} +1 -1
  136. package/chunk/{t51ig1FZ.js → DSGRHf-1.js} +132 -132
  137. package/chunk/{D9TqtOhq.js → DT37l12z.js} +1 -1
  138. package/chunk/{B6fn5y_s.js → DW-B7npC.js} +1 -1
  139. package/chunk/D_-UD4vO.js +119 -0
  140. package/chunk/{Dtnux4qL.js → D_MTFBb0.js} +1 -1
  141. package/chunk/{WkB0MERB.js → DhBo0pPJ.js} +27 -27
  142. package/chunk/DmUhn9ib.js +961 -0
  143. package/chunk/{Bny52uiG.js → DpfUGhi4.js} +10 -10
  144. package/chunk/{DhLbnw3R.js → Dx_5J4fO.js} +1 -1
  145. package/chunk/{B9PsJar0.js → Dy487FZ1.js} +1 -1
  146. package/chunk/{D6RTBH4C.js → IooeSKJJ.js} +10 -10
  147. package/chunk/Kbr6FzOG.js +745 -0
  148. package/chunk/{CwjaGytU.js → RMBPs_Ry.js} +32 -32
  149. package/chunk/Uz-rNulO.js +98 -0
  150. package/chunk/V6euPXVB.js +1025 -0
  151. package/chunk/{Bv8ZRDFt.js → YIlBPVAs.js} +14 -14
  152. package/chunk/{DPvnQJ-H.js → cDZI_t6o.js} +1 -1
  153. package/chunk/{C-w9pFY-.js → cZiP8FvM.js} +3 -3
  154. package/chunk/{DJmWXheU.js → eK7lxdak.js} +8 -8
  155. package/chunk/{Dg2DmtzA.js → gIbzjQ-X.js} +5 -6
  156. package/chunk/{CPl52AZh.js → sScV-J56.js} +1 -1
  157. package/chunk/{BbI3gqVr.js → wI2I1qb0.js} +1 -1
  158. package/hooks/index.js +32 -32
  159. package/hooks/use-verification-code.js +23 -22
  160. package/hooks/use-watermark.js +2 -1
  161. package/hooks/useComputedState.js +2 -1
  162. package/hooks/useCreate.js +2 -1
  163. package/hooks/useForceUpdate.js +2 -1
  164. package/hooks/useId.js +2 -1
  165. package/hooks/useInView.js +5 -4
  166. package/hooks/useIntersectionObserver.js +11 -11
  167. package/hooks/useIsFirstRender.js +2 -1
  168. package/hooks/useIsomorphicLayoutEffect.js +2 -1
  169. package/hooks/useKeyboardEvent.js +3 -2
  170. package/hooks/useMedia.js +2 -1
  171. package/hooks/useMergeProps.js +2 -1
  172. package/hooks/useMergeValue.js +4 -3
  173. package/hooks/useOverflowHidden.js +2 -1
  174. package/hooks/useOverrideRef.js +2 -1
  175. package/hooks/usePersistCallback.js +2 -1
  176. package/hooks/usePrevious.js +2 -1
  177. package/hooks/useRefs.js +2 -1
  178. package/hooks/useResizeObserver.js +2 -1
  179. package/hooks/useStateCallback.js +2 -1
  180. package/hooks/useStateWithPromise.js +2 -1
  181. package/hooks/useUpdateEffect.js +2 -1
  182. package/hooks/useWatch.js +3 -2
  183. package/hooks/useWindowSize.js +2 -1
  184. package/icons.js +35 -35
  185. package/index.js +484 -376
  186. package/locale/en-US.js +3 -11
  187. package/locale/tr-TR.js +3 -11
  188. package/package.json +1 -1
  189. package/types/anchor/Anchor.d.ts +1 -1
  190. package/types/button/index.d.ts +3 -2
  191. package/types/color-picker/hooks/useColorPicker.d.ts +1 -1
  192. package/types/color-picker/hooks/useControlBlock.d.ts +1 -1
  193. package/types/config-provider/interface.d.ts +1 -0
  194. package/types/date-picker/PickerRange.d.ts +1 -1
  195. package/types/hooks/use-verification-code/index.d.ts +2 -1
  196. package/types/hooks/use-watermark/index.d.ts +2 -1
  197. package/types/hooks/useComputedState.d.ts +2 -2
  198. package/types/hooks/useCreate.d.ts +2 -1
  199. package/types/hooks/useForceUpdate.d.ts +2 -1
  200. package/types/hooks/useId.d.ts +2 -1
  201. package/types/hooks/useInView.d.ts +1 -1
  202. package/types/hooks/useIntersectionObserver.d.ts +1 -1
  203. package/types/hooks/useIsFirstRender.d.ts +2 -1
  204. package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
  205. package/types/hooks/useKeyboardEvent.d.ts +2 -2
  206. package/types/hooks/useMedia.d.ts +1 -1
  207. package/types/hooks/useMergeProps.d.ts +2 -1
  208. package/types/hooks/useMergeValue.d.ts +2 -1
  209. package/types/hooks/useOverflowHidden.d.ts +2 -2
  210. package/types/hooks/useOverrideRef.d.ts +2 -1
  211. package/types/hooks/usePersistCallback.d.ts +2 -1
  212. package/types/hooks/usePrevious.d.ts +2 -1
  213. package/types/hooks/useRefs.d.ts +2 -1
  214. package/types/hooks/useResizeObserver.d.ts +2 -1
  215. package/types/hooks/useStateCallback.d.ts +1 -1
  216. package/types/hooks/useStateWithPromise.d.ts +1 -1
  217. package/types/hooks/useUpdateEffect.d.ts +2 -1
  218. package/types/hooks/useWatch.d.ts +2 -1
  219. package/types/hooks/useWindowSize.d.ts +1 -1
  220. package/types/image/interface.d.ts +1 -1
  221. package/types/index.d.ts +13 -22
  222. package/types/table/interface.d.ts +3 -1
  223. package/types/upload/Upload.d.ts +2 -1
  224. package/types/upload/index.d.ts +3 -1
  225. package/types/upload/request_.d.ts +3 -0
  226. package/types/utils/caseName.d.ts +2 -0
  227. package/types/utils/fileToURL.d.ts +2 -0
  228. package/types/utils/fillNBSP.d.ts +1 -1
  229. package/types/utils/index.d.ts +37 -0
  230. package/types/utils/is.d.ts +2 -2
  231. package/types/utils/lodash.d.ts +4 -0
  232. package/types/utils/scrollIntoView.d.ts +2 -1
  233. package/types/version/index.d.ts +1 -1
  234. package/ui.css +1 -0
  235. package/utils/CSSTransition.js +1 -1
  236. package/utils/caseName.js +20 -0
  237. package/utils/className.js +1 -1
  238. package/utils/contextHolder.js +1 -1
  239. package/utils/fileToURL.js +4 -0
  240. package/utils/index.js +219 -0
  241. package/utils/is.js +95 -93
  242. package/utils/keyCode.js +10 -46
  243. package/utils/lodash.js +8 -0
  244. package/utils/mergedToString.js +11 -10
  245. package/utils/reactDOM.js +1 -1
  246. package/utils/saveAs.js +1 -1
  247. package/utils/scrollIntoView.js +8 -7
  248. package/chunk/5pZ3ayqs.js +0 -29
  249. package/chunk/Bl-ODC57.js +0 -945
  250. package/chunk/BlKc_pDZ.js +0 -678
  251. package/chunk/CiEln_Q1.js +0 -517
  252. package/chunk/CilQ012k.js +0 -1796
  253. package/chunk/CnY8SvgY.js +0 -126
  254. package/chunk/DRJO1GfY.js +0 -855
  255. package/chunk/DUxWiN2U.js +0 -1465
  256. package/chunk/Do1aMgY3.js +0 -12
  257. package/chunk/Dw4SJ4o1.js +0 -964
  258. package/chunk/V_IcWDFx.js +0 -49
  259. package/style.css +0 -1
  260. /package/types/utils/{mergeProp.d.ts → mergeProps.d.ts} +0 -0
  261. /package/utils/{mergeProp.js → mergeProps.js} +0 -0
package/chunk/Dw4SJ4o1.js DELETED
@@ -1,964 +0,0 @@
1
- import { jsxs as L, Fragment as M, jsx as r } from "react/jsx-runtime";
2
- import F from "lodash/isFunction";
3
- import me from "lodash/isNumber";
4
- import te, { useContext as W, forwardRef as J, isValidElement as Ue, useState as B, useMemo as Ie, useEffect as xe, useRef as ie, useImperativeHandle as fe } from "react";
5
- import { b as X, I as $e } from "./DUxWiN2U.js";
6
- import ye from "../hooks/useMergeProps.js";
7
- import { y as z } from "./Do1aMgY3.js";
8
- import we from "../utils/omit.js";
9
- import ce from "../utils/warning.js";
10
- import { b as Pe, P as ne } from "./BP7xX86Q.js";
11
- import { a as Ne } from "./CwXmtKib.js";
12
- import { I as ge } from "./sl8s35SK.js";
13
- import { I as Re } from "./C7Okdv4u.js";
14
- import { I as Le } from "./CPl52AZh.js";
15
- import { I as ae, a as Ce, b as Fe, c as he, d as Ee, e as De, f as Oe } from "./BHK9zpXn.js";
16
- import Q from "../hooks/useKeyboardEvent.js";
17
- import "../utils/is.js";
18
- import { I as Te } from "./CXNW5Y2a.js";
19
- import ke from "../Progress.js";
20
- import re from "../Tooltip.js";
21
- import { H as pe } from "./BeM2hfks.js";
22
- import H from "lodash/isPlainObject";
23
- import { b as je } from "./B45v5S9k.js";
24
- import { I as Se } from "./DYZzQ2uT.js";
25
- import { I as de } from "./B6fn5y_s.js";
26
- import qe from "../Button.js";
27
- import Ae from "lodash/isArray";
28
- import { NOOP as Z } from "../utils/constant.js";
29
- const y = {
30
- init: "init",
31
- uploading: "uploading",
32
- success: "done",
33
- fail: "error"
34
- }, be = (e) => {
35
- var U, n, g, P, o, b;
36
- const d = Q(), { file: u, prefixCls: s, progressProps: t, progressRender: a } = e, { locale: i } = W(X), { status: l, percent: m = 0 } = u, f = `${s}-list`, h = t && t.width ? { width: t.width } : {}, x = /* @__PURE__ */ L(M, { children: [
37
- l === y.fail && e.reuploadIcon !== null && /* @__PURE__ */ r(
38
- "span",
39
- {
40
- className: `${s}-list-reupload-icon`,
41
- onClick: () => {
42
- var I;
43
- (I = e.onReupload) == null || I.call(e, u);
44
- },
45
- tabIndex: 0,
46
- role: "button",
47
- "aria-label": (U = i == null ? void 0 : i.Upload) == null ? void 0 : U.reupload,
48
- ...d({
49
- onPressEnter: () => {
50
- var I;
51
- (I = e.onReupload) == null || I.call(e, u);
52
- }
53
- }),
54
- children: e.reuploadIcon || (e.listType === "picture-card" ? /* @__PURE__ */ r(ae, {}) : (n = i == null ? void 0 : i.Upload) == null ? void 0 : n.reupload)
55
- }
56
- ),
57
- l === y.success && e.successIcon !== null && /* @__PURE__ */ r("span", { className: `${s}-list-success-icon`, children: e.successIcon || /* @__PURE__ */ r(Te, {}) }),
58
- l !== y.success && /* @__PURE__ */ L("div", { className: `${f}-status`, style: h, children: [
59
- /* @__PURE__ */ r(
60
- ke,
61
- {
62
- showText: !1,
63
- className: `${f}-progress`,
64
- type: "circle",
65
- status: l === y.fail ? "error" : l === y.success ? "success" : "normal",
66
- percent: m,
67
- size: "mini",
68
- ...t
69
- }
70
- ),
71
- l === y.init && e.startIcon !== null && /* @__PURE__ */ r(
72
- "span",
73
- {
74
- tabIndex: 0,
75
- role: "button",
76
- "aria-label": (g = i == null ? void 0 : i.Upload) == null ? void 0 : g.start,
77
- className: `${s}-list-start-icon`,
78
- onClick: () => {
79
- var I;
80
- (I = e.onUpload) == null || I.call(e, u);
81
- },
82
- ...d({
83
- onPressEnter: () => {
84
- var I;
85
- (I = e.onUpload) == null || I.call(e, u);
86
- }
87
- }),
88
- children: e.startIcon || /* @__PURE__ */ r(re, { content: (P = i == null ? void 0 : i.Upload) == null ? void 0 : P.start, children: /* @__PURE__ */ r(Ce, {}) })
89
- }
90
- ),
91
- l === y.uploading && e.cancelIcon !== null && /* @__PURE__ */ r(
92
- "span",
93
- {
94
- className: `${e.prefixCls}-list-cancel-icon`,
95
- onClick: () => {
96
- var I;
97
- (I = e.onAbort) == null || I.call(e, u);
98
- },
99
- tabIndex: 0,
100
- "aria-label": (o = i == null ? void 0 : i.Upload) == null ? void 0 : o.cancel,
101
- ...d({
102
- onPressEnter: () => {
103
- var I;
104
- (I = e.onAbort) == null || I.call(e, u);
105
- }
106
- }),
107
- children: e.cancelIcon || /* @__PURE__ */ r(re, { content: (b = i == null ? void 0 : i.Upload) == null ? void 0 : b.cancel, children: /* @__PURE__ */ r(Fe, {}) })
108
- }
109
- )
110
- ] })
111
- ] });
112
- return F(a) ? a(u, x) : x;
113
- }, He = (e, d) => {
114
- const { disabled: u, prefixCls: s, file: t, showUploadList: a, locale: i } = e, l = Q(), m = `${s}-list-item-picture`, { status: f, originFile: h } = t, x = t.url !== void 0 ? t.url : h && F(URL.createObjectURL) && URL.createObjectURL(h), U = H(a) ? a : {};
115
- return /* @__PURE__ */ r("div", { className: m, ref: d, children: f === y.uploading ? /* @__PURE__ */ r(
116
- be,
117
- {
118
- onReupload: e.onReupload,
119
- onUpload: e.onUpload,
120
- onAbort: e.onAbort,
121
- listType: "picture-card",
122
- file: t,
123
- prefixCls: s,
124
- progressProps: e.progressProps,
125
- ...U
126
- }
127
- ) : /* @__PURE__ */ L(M, { children: [
128
- F(U.imageRender) ? U.imageRender(t) : /* @__PURE__ */ r("img", { src: x, alt: t.name }),
129
- /* @__PURE__ */ L("div", { className: `${m}-mask`, role: "radiogroup", children: [
130
- t.status === y.fail && /* @__PURE__ */ r("div", { className: `${m}-error-tip`, children: U.errorIcon !== null && /* @__PURE__ */ r("span", { className: `${s}-list-error-icon`, children: U.errorIcon || /* @__PURE__ */ r(Le, {}) }) }),
131
- /* @__PURE__ */ L("div", { className: `${m}-operation`, children: [
132
- t.status !== y.fail && U.previewIcon !== null && /* @__PURE__ */ r(
133
- "span",
134
- {
135
- className: `${s}-list-preview-icon`,
136
- tabIndex: 0,
137
- role: "button",
138
- "aria-label": i.Upload.preview,
139
- ...l({
140
- onPressEnter: () => {
141
- var n;
142
- (n = e.onPreview) == null || n.call(e, t);
143
- }
144
- }),
145
- onClick: () => {
146
- var n;
147
- (n = e.onPreview) == null || n.call(e, t);
148
- },
149
- children: U.previewIcon || /* @__PURE__ */ r(Re, {})
150
- }
151
- ),
152
- t.status === y.fail && U.reuploadIcon !== null && /* @__PURE__ */ r(
153
- "span",
154
- {
155
- className: `${e.prefixCls}-list-reupload-icon`,
156
- onClick: () => {
157
- var n;
158
- (n = e.onReupload) == null || n.call(e, t);
159
- },
160
- tabIndex: 0,
161
- role: "button",
162
- "aria-label": i.Upload.reupload,
163
- ...l({
164
- onPressEnter: () => {
165
- var n;
166
- (n = e.onReupload) == null || n.call(e, t);
167
- }
168
- }),
169
- children: U.reuploadIcon || /* @__PURE__ */ r(ae, {})
170
- }
171
- ),
172
- !u && U.removeIcon !== null && /* @__PURE__ */ r(
173
- "span",
174
- {
175
- className: `${s}-list-remove-icon`,
176
- onClick: () => {
177
- var n;
178
- (n = e.onRemove) == null || n.call(e, t);
179
- },
180
- role: "button",
181
- "aria-label": i.Upload.delete,
182
- tabIndex: 0,
183
- ...l({
184
- onPressEnter: () => {
185
- var n;
186
- (n = e.onRemove) == null || n.call(e, t);
187
- }
188
- }),
189
- children: U.removeIcon || /* @__PURE__ */ r(ge, {})
190
- }
191
- )
192
- ] })
193
- ] })
194
- ] }) });
195
- }, Ve = J(He), Ge = (e) => {
196
- let d = "";
197
- if (e.originFile && e.originFile.type)
198
- d = e.originFile.type;
199
- else {
200
- const s = (e.name || "").split(".").pop() || "";
201
- d = s, ["png", "jpg", "jpeg", "bmp", "gif"].indexOf(s) > -1 ? d = "image" : ["mp4", "m2v", "mkv"].indexOf(s) > -1 ? d = "video" : ["mp3", "wav", "wmv"].indexOf(s) > -1 && (d = "audio");
202
- }
203
- return d.indexOf("image") > -1 ? he : d.indexOf("pdf") > -1 ? Ee : d.indexOf("audio") > -1 ? De : d.indexOf("video") > -1 ? Oe : Se;
204
- }, Be = (e, d) => {
205
- const { prefixCls: u, disabled: s, file: t, locale: a } = e, i = `${u}-list-item-text`, l = Q(), m = Ge(t), f = H(e.showUploadList) ? e.showUploadList : {}, h = H(f) ? f : {}, x = t.name || t.originFile && t.originFile.name, U = t.url !== void 0 ? t.url : t.originFile && F(URL.createObjectURL) && URL.createObjectURL(t.originFile);
206
- let n = {};
207
- return t.status !== y.fail && (n = {
208
- popupVisible: !1
209
- }), /* @__PURE__ */ L(
210
- "div",
211
- {
212
- className: `${u}-list-item ${u}-list-item-${t.status}`,
213
- ref: d,
214
- children: [
215
- /* @__PURE__ */ L("div", { className: i, children: [
216
- e.listType === "picture-list" && /* @__PURE__ */ r("div", { className: `${i}-thumbnail`, children: F(f.imageRender) ? f.imageRender(t) : /* @__PURE__ */ r("img", { src: U }) }),
217
- /* @__PURE__ */ L("div", { className: `${i}-content`, children: [
218
- /* @__PURE__ */ L("div", { className: `${i}-name`, children: [
219
- e.listType === "text" && h.fileIcon !== null && /* @__PURE__ */ r("span", { className: `${u}-list-file-icon`, children: h.fileIcon || /* @__PURE__ */ r(m, {}) }),
220
- F(f.fileName) ? /* @__PURE__ */ r("span", { className: `${i}-name-text`, children: f.fileName(t) }) : t.url ? /* @__PURE__ */ r(
221
- "a",
222
- {
223
- href: t.url,
224
- target: "_blank",
225
- rel: "noreferrer",
226
- className: `${i}-name-link`,
227
- children: x
228
- }
229
- ) : /* @__PURE__ */ r("span", { className: `${i}-name-text`, children: x }),
230
- t.status === y.fail && h.errorIcon !== null && /* @__PURE__ */ r(
231
- re,
232
- {
233
- content: (typeof t.response == "object" ? Ue(t.response) && t.response : t.response) || a.Upload.error,
234
- ...n,
235
- disabled: t.status !== y.fail,
236
- children: /* @__PURE__ */ r("span", { className: `${e.prefixCls}-list-error-icon`, children: h.errorIcon || (e.listType === "picture-card" ? /* @__PURE__ */ r(he, {}) : /* @__PURE__ */ r(je, {})) })
237
- }
238
- )
239
- ] }),
240
- /* @__PURE__ */ r(
241
- be,
242
- {
243
- file: t,
244
- prefixCls: u,
245
- progressProps: e.progressProps,
246
- onReupload: e.onReupload,
247
- onUpload: e.onUpload,
248
- onAbort: e.onAbort,
249
- ...h
250
- }
251
- )
252
- ] })
253
- ] }),
254
- /* @__PURE__ */ r("div", { className: `${u}-list-item-operation`, children: !s && h.removeIcon !== null && /* @__PURE__ */ r(
255
- $e,
256
- {
257
- className: `${u}-list-remove-icon-hover`,
258
- onClick: () => {
259
- var g;
260
- (g = e.onRemove) == null || g.call(e, t);
261
- },
262
- tabIndex: 0,
263
- "aria-label": a.Upload.delete,
264
- ...l({
265
- onPressEnter: () => {
266
- var g;
267
- (g = e.onRemove) == null || g.call(e, t);
268
- }
269
- }),
270
- children: /* @__PURE__ */ r("span", { className: `${u}-list-remove-icon`, children: h.removeIcon || /* @__PURE__ */ r(ge, {}) })
271
- }
272
- ) })
273
- ]
274
- }
275
- );
276
- }, Me = J(Be), ve = (e) => {
277
- const { locale: d, rtl: u } = W(X), {
278
- listType: s,
279
- fileList: t,
280
- renderUploadList: a,
281
- renderUploadItem: i,
282
- prefixCls: l,
283
- ...m
284
- } = e, [f, h] = B(-1), x = Ie(() => t.map((n) => {
285
- let g = n.url;
286
- return n.url === void 0 && [y.init, y.success].indexOf(n.status) > -1 && (g = n.originFile && F(URL.createObjectURL) && URL.createObjectURL(n.originFile)), g;
287
- }).filter(Boolean), [t]);
288
- if (F(a))
289
- return /* @__PURE__ */ r("div", { className: `${l}-list`, children: a(t, m) });
290
- const U = (n) => {
291
- e.imagePreview && h(n);
292
- };
293
- return /* @__PURE__ */ L(M, { children: [
294
- /* @__PURE__ */ r(
295
- Pe,
296
- {
297
- className: z(
298
- `${l}-list`,
299
- `${l}-list-type-${s}`,
300
- {
301
- [`${l}-list-rtl`]: u
302
- }
303
- ),
304
- children: t.map((n, g) => {
305
- let P = s === "picture-card" ? /* @__PURE__ */ r(
306
- "div",
307
- {
308
- className: `${l}-list-item ${l}-list-item-${n.status}`,
309
- children: /* @__PURE__ */ r(
310
- Ve,
311
- {
312
- ...e,
313
- onPreview: (o) => {
314
- var b;
315
- U(g), (b = e.onPreview) == null || b.call(e, o);
316
- },
317
- file: n,
318
- locale: d
319
- }
320
- )
321
- }
322
- ) : /* @__PURE__ */ r(Me, { ...e, file: n, locale: d });
323
- return F(i) && (P = i(P, n, t)), s === "picture-card" ? /* @__PURE__ */ r(
324
- ne,
325
- {
326
- timeout: { enter: 200, exit: 400 },
327
- classNames: `${l}-slide-inline`,
328
- onEntered: (o) => {
329
- o && (o.style.width = "");
330
- },
331
- onExit: (o) => {
332
- o && (o.style.width = `${o.scrollWidth}px`);
333
- },
334
- onExiting: (o) => {
335
- o && (o.style.width = 0);
336
- },
337
- onExited: (o) => {
338
- o && (o.style.width = 0);
339
- },
340
- children: P
341
- },
342
- n.uid
343
- ) : /* @__PURE__ */ r(
344
- ne,
345
- {
346
- timeout: { enter: 200, exit: 400 },
347
- classNames: `${l}-slide-up`,
348
- onExit: (o) => {
349
- o && (o.style.height = `${o.scrollHeight}px`);
350
- },
351
- onExiting: (o) => {
352
- o && (o.style.height = 0);
353
- },
354
- onExited: (o) => {
355
- o && (o.style.height = 0);
356
- },
357
- children: P
358
- },
359
- n.uid
360
- );
361
- })
362
- }
363
- ),
364
- s === "picture-card" && e.imagePreview && /* @__PURE__ */ r(
365
- Ne,
366
- {
367
- srcList: x,
368
- visible: f !== -1,
369
- current: f,
370
- onChange: U,
371
- onVisibleChange: (n) => {
372
- U(n ? f : -1);
373
- }
374
- }
375
- )
376
- ] });
377
- };
378
- ve.displayName = "FileList";
379
- const oe = (e, d) => {
380
- const u = H(d) ? d == null ? void 0 : d.type : d;
381
- if (!(H(d) && d.strict === !1) && u && e) {
382
- const t = Ae(u) ? u : u.split(",").map((i) => i.trim()).filter((i) => i), a = (e.name.indexOf(".") > -1 ? `.${e.name.split(".").pop()}` : "").toLowerCase();
383
- return t.some((i) => {
384
- const l = i && i.toLowerCase(), m = (e.type || "").toLowerCase(), f = m.split("/")[0];
385
- if (l === m || `${f}${a.replace(".", "/")}` === l || /^\*(\/\*)?$/.test(l))
386
- return !0;
387
- if (/\/\*/.test(l))
388
- return m.replace(/\/.*$/, "") === l.replace(/\/.*$/, "");
389
- if (/\..*/.test(l)) {
390
- let h = [l];
391
- return (l === ".jpg" || l === ".jpeg") && (h = [".jpg", ".jpeg"]), h.indexOf(a) > -1;
392
- }
393
- return !1;
394
- });
395
- }
396
- return !!e;
397
- }, _e = (e, d) => {
398
- if (!e)
399
- return;
400
- let u = [].slice.call(e);
401
- return d && (u = u.filter((s) => oe(s, d))), u;
402
- }, Ke = (e, d, u) => {
403
- const s = [];
404
- let t = 0;
405
- const a = () => {
406
- !t && u(s);
407
- }, i = (m) => {
408
- if (t += 1, m != null && m.isFile) {
409
- m.file((f) => {
410
- t -= 1, oe(f, d) && (Object.defineProperty(f, "webkitRelativePath", {
411
- value: m.fullPath.replace(/^\//, "")
412
- }), s.push(f)), a();
413
- });
414
- return;
415
- }
416
- if (m != null && m.isDirectory) {
417
- const f = m.createReader();
418
- let h = !1;
419
- const x = () => {
420
- f.readEntries((U) => {
421
- h || (t -= 1, h = !0), U.length === 0 ? a() : (x(), U.forEach(i));
422
- });
423
- };
424
- x();
425
- return;
426
- }
427
- t -= 1, a();
428
- };
429
- [].slice.call(e).forEach((m) => {
430
- m.webkitGetAsEntry && i(m.webkitGetAsEntry());
431
- });
432
- }, ze = (e, d) => {
433
- const u = Q(), { locale: s } = W(X), [t, a] = B(!1), [i, l] = B(0), {
434
- tip: m,
435
- children: f,
436
- disabled: h,
437
- drag: x,
438
- listType: U,
439
- prefixCls: n,
440
- accept: g,
441
- multiple: P
442
- } = e, o = {
443
- disabled: h
444
- };
445
- return xe(() => {
446
- l(0);
447
- }, [t]), f === null ? null : /* @__PURE__ */ r(
448
- "div",
449
- {
450
- className: `${n}-trigger`,
451
- onClick: h ? void 0 : e.onClick,
452
- ...u({
453
- onPressEnter: () => {
454
- var b;
455
- !h && ((b = e.onClick) == null || b.call(e));
456
- }
457
- }),
458
- ref: d,
459
- onDragEnter: () => {
460
- l(i + 1);
461
- },
462
- onDragLeave: (b) => {
463
- var I;
464
- b.preventDefault(), i === 0 ? (a(!1), !h && ((I = e.onDragLeave) == null || I.call(e, b))) : l(i - 1);
465
- },
466
- onDrop: (b) => {
467
- var I, S;
468
- if (b.preventDefault(), !h && e.drag !== !1) {
469
- if (a(!1), e.directory)
470
- Ke(b.dataTransfer.items, g, (k) => {
471
- var O;
472
- (O = e.onDragFiles) == null || O.call(e, k);
473
- });
474
- else {
475
- const k = [].slice.call(b.dataTransfer.items || []).reduce((q, j, V) => {
476
- if (j.webkitGetAsEntry) {
477
- const c = j.webkitGetAsEntry();
478
- return c != null && c.isDirectory ? [...q, V] : q;
479
- }
480
- }, []), O = [].slice.call(b.dataTransfer.files || []).filter((q, j) => !k.includes(j)), p = _e(O, g);
481
- p.length > 0 && ((I = e.onDragFiles) == null || I.call(e, P ? p : p.slice(0, 1)));
482
- }
483
- (S = e.onDrop) == null || S.call(e, b);
484
- }
485
- },
486
- onDragOver: (b) => {
487
- var I;
488
- b.preventDefault(), !h && !t && (a(!0), (I = e.onDragOver) == null || I.call(e, b));
489
- },
490
- children: te.isValidElement(f) ? /* @__PURE__ */ r(
491
- "div",
492
- {
493
- className: z({ [`${n}-trigger-custom-active`]: t }),
494
- children: te.cloneElement(f, o)
495
- }
496
- ) : U === "picture-card" ? /* @__PURE__ */ r("div", { className: `${n}-trigger-picture-wrapper`, children: /* @__PURE__ */ r(
497
- "div",
498
- {
499
- className: `${n}-trigger-picture`,
500
- tabIndex: 0,
501
- "aria-label": s.Upload.upload,
502
- children: /* @__PURE__ */ r("div", { className: `${n}-trigger-picture-text`, children: e.triggerPictureIcon ?? /* @__PURE__ */ r(de, {}) })
503
- }
504
- ) }) : x ? /* @__PURE__ */ L(
505
- "div",
506
- {
507
- className: z(`${n}-trigger-drag`, {
508
- [`${n}-trigger-drag-active`]: t
509
- }),
510
- tabIndex: 0,
511
- "aria-label": s.Upload.drag,
512
- children: [
513
- e.triggerPictureIcon ?? /* @__PURE__ */ r(de, {}),
514
- /* @__PURE__ */ r("p", { className: `${n}-trigger-drag-text`, children: t ? s.Upload.dragHover : s.Upload.drag }),
515
- m && /* @__PURE__ */ r("div", { className: `${n}-trigger-tip`, children: m })
516
- ]
517
- }
518
- ) : /* @__PURE__ */ L(
519
- qe,
520
- {
521
- ...o,
522
- "aria-label": s.Upload.upload,
523
- type: "primary",
524
- className: `${n}-trigger-with-icon`,
525
- children: [
526
- /* @__PURE__ */ r(ae, {}),
527
- s.Upload.upload
528
- ]
529
- }
530
- )
531
- }
532
- );
533
- }, We = J(
534
- ze
535
- );
536
- function ue(e) {
537
- const d = e.responseText || e.response;
538
- if (!d)
539
- return d;
540
- try {
541
- return JSON.parse(d);
542
- } catch {
543
- return d;
544
- }
545
- }
546
- const Je = function(e) {
547
- const {
548
- onProgress: d = Z,
549
- onError: u = Z,
550
- onSuccess: s = Z,
551
- action: t,
552
- method: a,
553
- headers: i = {},
554
- name: l,
555
- file: m,
556
- data: f = {},
557
- withCredentials: h = !1
558
- } = e;
559
- function x(o) {
560
- return typeof o == "function" ? o(m) : o;
561
- }
562
- const U = x(l), n = x(f), g = new XMLHttpRequest();
563
- d && g.upload && (g.upload.onprogress = function(o) {
564
- let b;
565
- o.total > 0 && (b = o.loaded / o.total * 100), d(parseInt(b, 10), o);
566
- }), g.onerror = function(b) {
567
- u(b);
568
- }, g.onload = function() {
569
- if (g.status < 200 || g.status >= 300)
570
- return u(ue(g));
571
- s(ue(g));
572
- };
573
- const P = new FormData();
574
- n && Object.keys(n).map((o) => P.append(o, n[o])), P.append(U || "file", m), g.open(a, t, !0), h && "withCredentials" in g && (g.withCredentials = !0);
575
- for (const o in i)
576
- Object.prototype.hasOwnProperty.call(i, o) && i[o] !== null && g.setRequestHeader(o, i[o]);
577
- return g.send(P), {
578
- abort() {
579
- g.abort();
580
- }
581
- };
582
- };
583
- function Xe(e, d) {
584
- const u = ie(null), [s, t] = B({ uploadRequests: {} });
585
- function a(c) {
586
- x(c);
587
- }
588
- function i(c) {
589
- var R;
590
- const $ = s.uploadRequests[c.uid];
591
- $ && ((R = $.abort) == null || R.call($), f({
592
- ...c,
593
- status: y.fail
594
- }), m(c.uid));
595
- }
596
- function l(c) {
597
- x({
598
- ...c,
599
- percent: 0,
600
- status: y.uploading
601
- });
602
- }
603
- function m(c) {
604
- const $ = { ...s.uploadRequests };
605
- delete $[c], t({
606
- uploadRequests: $
607
- });
608
- }
609
- fe(d, () => ({
610
- // 提供 ref 调用
611
- upload: a,
612
- abort: i,
613
- reupload: l,
614
- // 删除上传(手动上传时,文件会出现在上传列表,但属于init状态)
615
- delete: m
616
- }));
617
- function f(c, $ = e.fileList) {
618
- const { onFileStatusChange: R } = e, C = "uid" in c ? "uid" : "name";
619
- R == null || R(
620
- $.map((v) => v[C] === c[C] ? c : v),
621
- c
622
- );
623
- }
624
- function h(c) {
625
- const $ = "uid" in c ? "uid" : "name";
626
- return e.fileList.find((C) => C[$] === c[$]);
627
- }
628
- async function x(c) {
629
- const {
630
- action: $,
631
- headers: R,
632
- name: C,
633
- data: v,
634
- withCredentials: N,
635
- customRequest: w,
636
- method: E
637
- } = e, le = {
638
- onProgress: (G, D) => {
639
- var K, se;
640
- const _ = h(c);
641
- _ && (_.status = y.uploading, _.percent = G, (se = (K = this == null ? void 0 : this.props) == null ? void 0 : K.onProgress) == null || se.call(K, _, D));
642
- },
643
- onSuccess: (G) => {
644
- const D = h(c);
645
- D && (D.status = y.success, D.response = G, f(D)), m(c.uid);
646
- },
647
- onError: (G) => {
648
- const D = h(c);
649
- D && (D.status = y.fail, D.response = G, f(D)), m(c.uid);
650
- },
651
- headers: R,
652
- name: C,
653
- file: c.originFile,
654
- data: v,
655
- withCredentials: N
656
- };
657
- f(c);
658
- let Y;
659
- $ ? Y = Je({ ...le, action: $, method: E }) : w && (Y = await w(le)), t({
660
- uploadRequests: {
661
- ...s.uploadRequests,
662
- [c.uid]: Y
663
- }
664
- });
665
- }
666
- function U(c) {
667
- const { limit: $, fileList: R, onExceedLimit: C, autoUpload: v } = e;
668
- if (me($) && $ < R.length + c.length)
669
- return C == null ? void 0 : C(c, R);
670
- const N = (w, E) => {
671
- const T = e.fileList || [], A = {
672
- uid: `${String(+/* @__PURE__ */ new Date())}${E}`,
673
- originFile: w,
674
- percent: 0,
675
- status: y.init,
676
- name: w.name
677
- };
678
- f(A), T.push(A), f(A, T), v && setTimeout(() => {
679
- x({
680
- ...A,
681
- status: y.uploading
682
- });
683
- }, 0);
684
- };
685
- c.forEach((w, E) => {
686
- oe(w, e.accept) && (F(e.beforeUpload) ? Promise.resolve(e.beforeUpload(w, c)).then((T) => {
687
- if (T !== !1) {
688
- const A = pe(T) ? T : w;
689
- N(A, E);
690
- }
691
- }).catch((T) => {
692
- console.error(T);
693
- }) : N(w, E));
694
- });
695
- }
696
- const {
697
- accept: n,
698
- multiple: g,
699
- children: P,
700
- prefixCls: o,
701
- tip: b,
702
- disabled: I,
703
- drag: S,
704
- listType: k,
705
- hide: O,
706
- directory: p,
707
- onDrop: q,
708
- onDragOver: j,
709
- onDragLeave: V
710
- } = e;
711
- return /* @__PURE__ */ L(M, { children: [
712
- /* @__PURE__ */ r(
713
- "input",
714
- {
715
- ref: u,
716
- style: {
717
- visibility: "hidden",
718
- opacity: 0,
719
- position: "fixed",
720
- top: "-227px",
721
- left: "-227px",
722
- zIndex: -999999
723
- },
724
- type: "file",
725
- accept: H(n) ? n == null ? void 0 : n.type : n,
726
- multiple: g,
727
- ...p ? { webkitdirectory: "true" } : {},
728
- onChange: (c) => {
729
- const $ = c.target.files;
730
- $ && (U([].slice.call($)), u.current.value = "");
731
- },
732
- onClick: (c) => {
733
- c.stopPropagation();
734
- }
735
- },
736
- "trigger-input"
737
- ),
738
- /* @__PURE__ */ r(
739
- ne,
740
- {
741
- in: !O,
742
- timeout: 100,
743
- unmountOnExit: !0,
744
- classNames: "fadeIn",
745
- children: /* @__PURE__ */ r(
746
- We,
747
- {
748
- directory: p,
749
- tip: b,
750
- multiple: g,
751
- accept: n,
752
- disabled: I,
753
- drag: S,
754
- listType: k,
755
- triggerPictureIcon: e.triggerPictureIcon,
756
- onDrop: q,
757
- onDragOver: j,
758
- onDragLeave: V,
759
- onDragFiles: U,
760
- onClick: () => {
761
- var c, $;
762
- !I && (($ = (c = u.current) == null ? void 0 : c.click) == null || $.call(c));
763
- },
764
- prefixCls: o,
765
- children: F(P) ? P({ fileList: e.fileList }) : P
766
- }
767
- )
768
- },
769
- "trigger-node"
770
- ),
771
- b && k !== "picture-card" && !S ? /* @__PURE__ */ r("div", { className: `${o}-trigger-tip`, children: b }, "trigger-tip") : null
772
- ] });
773
- }
774
- const Qe = te.forwardRef(Xe), ee = function(e) {
775
- const d = [].concat(e || []).filter(Boolean);
776
- return d.reduce((u, s, t) => {
777
- if (s.uid) {
778
- const a = d.findIndex(
779
- (l) => s.uid === l.uid && s !== l
780
- );
781
- ce(a !== -1, "[Upload]: duplicate uid");
782
- const i = {
783
- status: y.success,
784
- percent: 100,
785
- ...s
786
- };
787
- a === -1 ? u.push(i) : u.splice(a, 1, i);
788
- } else {
789
- ce(!0, "[Upload]: uid is required");
790
- const a = `${String(+/* @__PURE__ */ new Date())}${t}`;
791
- u.push({
792
- uid: a,
793
- status: y.success,
794
- percent: 100,
795
- ...s
796
- });
797
- }
798
- return u;
799
- }, []);
800
- }, Ye = {
801
- listType: "text",
802
- autoUpload: !0,
803
- showUploadList: !0,
804
- beforeUpload: () => !0,
805
- method: "post"
806
- }, Ze = (e, d) => {
807
- const { getPrefixCls: u, componentConfig: s, rtl: t } = W(X), a = ye(
808
- e,
809
- Ye,
810
- s == null ? void 0 : s.Upload
811
- ), i = u("upload"), l = ie(), m = ie(), [f, h] = B(() => "fileList" in a ? ee(a.fileList) : "defaultFileList" in a ? ee(a.defaultFileList) : []), x = "fileList" in a ? ee(a.fileList) : f, U = (v, N) => {
812
- var w;
813
- "fileList" in a || h(v), (w = a.onChange) == null || w.call(a, v, N);
814
- }, n = (v) => {
815
- v && setTimeout(() => {
816
- l.current && l.current.upload(v);
817
- }, 0);
818
- }, g = (v) => {
819
- var N;
820
- l.current && l.current.reupload(v), (N = a.onReupload) == null || N.call(a, v);
821
- }, P = (v) => {
822
- if (v) {
823
- const { onRemove: N } = a;
824
- Promise.resolve(
825
- F(N) ? N(v, x) : N
826
- ).then((w) => {
827
- w !== !1 && (l.current && l.current.abort(v), U(
828
- x.filter((E) => E.uid !== v.uid),
829
- v
830
- ));
831
- }).catch((w) => {
832
- console.error(w);
833
- });
834
- }
835
- }, o = (v) => {
836
- v && l.current && l.current.abort(v);
837
- };
838
- fe(d, () => ({
839
- submit: (v) => {
840
- let N = [];
841
- v ? N = [v] : N = x.filter((w) => w.status === y.init), N.forEach((w) => {
842
- n(w);
843
- });
844
- },
845
- // file: fileList中的file对象
846
- abort: (v) => {
847
- o(v);
848
- },
849
- // file: fileList中的file对象
850
- reupload: (v) => {
851
- g(v);
852
- },
853
- getRootDOMNode: () => m.current
854
- }));
855
- const {
856
- listType: b,
857
- className: I,
858
- style: S,
859
- renderUploadItem: k,
860
- showUploadList: O,
861
- renderUploadList: p,
862
- progressProps: q,
863
- imagePreview: j,
864
- ...V
865
- } = a, c = me(a.limit) ? { hideOnExceedLimit: !0, maxCount: a.limit } : { hideOnExceedLimit: !0, ...a.limit }, $ = c.maxCount && c.maxCount <= x.length, R = "disabled" in a ? a.disabled : !c.hideOnExceedLimit && $, C = /* @__PURE__ */ r(
866
- "div",
867
- {
868
- ...we(V, [
869
- "disabled",
870
- "directory",
871
- "onReupload",
872
- "defaultFileList",
873
- "fileList",
874
- "autoUpload",
875
- "error",
876
- "action",
877
- "method",
878
- "multiple",
879
- "name",
880
- "accept",
881
- "customRequest",
882
- "children",
883
- "autoUpload",
884
- "limit",
885
- "drag",
886
- "tip",
887
- "headers",
888
- "data",
889
- "withCredentials",
890
- "onChange",
891
- "onPreview",
892
- "onRemove",
893
- "onProgress",
894
- "onExceedLimit",
895
- "beforeUpload",
896
- "onDrop",
897
- "onDragOver",
898
- "onDragLeave"
899
- ]),
900
- className: z(
901
- i,
902
- {
903
- [`${i}-type-${b}`]: b,
904
- [`${i}-drag`]: a.drag,
905
- [`${i}-disabled`]: R,
906
- [`${i}-hide`]: c.hideOnExceedLimit && $,
907
- [`${i}-rtl`]: t
908
- },
909
- I
910
- ),
911
- style: S,
912
- ref: m,
913
- children: /* @__PURE__ */ r(
914
- Qe,
915
- {
916
- ref: l,
917
- ...a,
918
- limit: c.maxCount,
919
- hide: c.hideOnExceedLimit && $,
920
- disabled: R,
921
- prefixCls: i,
922
- fileList: x,
923
- onProgress: (v, N) => {
924
- var w;
925
- v && ("fileList" in a || h(
926
- x.map((E) => E.uid === v.uid ? v : E)
927
- ), (w = a.onProgress) == null || w.call(a, v, N));
928
- },
929
- onFileStatusChange: U
930
- }
931
- )
932
- }
933
- );
934
- return /* @__PURE__ */ L(M, { children: [
935
- b !== "picture-card" && C,
936
- O && /* @__PURE__ */ r(
937
- ve,
938
- {
939
- imagePreview: j,
940
- progressProps: q,
941
- showUploadList: O,
942
- disabled: a.disabled,
943
- listType: b,
944
- fileList: x,
945
- renderUploadItem: k,
946
- renderUploadList: p,
947
- onUpload: n,
948
- onAbort: o,
949
- onRemove: P,
950
- onReupload: g,
951
- onPreview: a.onPreview,
952
- prefixCls: i
953
- }
954
- ),
955
- b === "picture-card" && C,
956
- a.tip && b === "picture-card" && /* @__PURE__ */ r("div", { className: `${i}-trigger-tip`, children: a.tip })
957
- ] });
958
- }, et = J(
959
- Ze
960
- );
961
- et.displayName = "Upload";
962
- export {
963
- et as U
964
- };