@unicom-cloud/ui 0.8.66 → 0.8.67

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 (357) hide show
  1. package/Affix.js +79 -79
  2. package/Alert.js +46 -46
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +74 -74
  5. package/Avatar.js +36 -36
  6. package/BackTop.js +35 -35
  7. package/Badge.js +55 -55
  8. package/Breadcrumb.js +42 -42
  9. package/Button.js +24 -24
  10. package/Calendar.js +230 -230
  11. package/Card.js +18 -18
  12. package/Carousel.js +165 -165
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +26 -26
  17. package/Comment.js +18 -18
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +28 -27
  20. package/DatePicker.js +872 -871
  21. package/Descriptions.js +34 -34
  22. package/Divider.js +19 -19
  23. package/Draggable.js +27 -26
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +110 -110
  26. package/Empty.js +3 -3
  27. package/Form.js +984 -945
  28. package/Grid.js +34 -34
  29. package/Icon.js +16 -16
  30. package/IconHover.js +2 -2
  31. package/Image.js +2 -2
  32. package/Input.js +7 -6
  33. package/InputNumber.js +6 -6
  34. package/InputTag.js +1 -1
  35. package/Layout.js +24 -24
  36. package/Link.js +30 -30
  37. package/List.js +95 -95
  38. package/Mentions.js +85 -84
  39. package/Menu.js +2 -2
  40. package/Message.js +7 -6
  41. package/Modal.js +1 -1
  42. package/Notice.js +14 -3
  43. package/Notification.js +9 -7
  44. package/OverflowEllipsis.js +64 -62
  45. package/PageHeader.js +73 -73
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +60 -60
  49. package/Popover.js +31 -31
  50. package/Portal.js +23 -31
  51. package/Progress.js +22 -22
  52. package/Radio.js +2 -2
  53. package/Rate.js +24 -24
  54. package/ResizeBox.js +274 -271
  55. package/Result.js +3 -3
  56. package/Select.js +4 -4
  57. package/SelectView.js +257 -238
  58. package/Skeleton.js +46 -46
  59. package/Slider.js +286 -283
  60. package/Space.js +28 -28
  61. package/SpeechSynthesis.js +62 -55
  62. package/Spin.js +23 -23
  63. package/Statistic.js +80 -80
  64. package/Steps.js +67 -67
  65. package/Switch.js +47 -47
  66. package/Table.js +1445 -1380
  67. package/Tabs.js +5 -5
  68. package/Tag.js +45 -45
  69. package/TimePicker.js +154 -154
  70. package/Timeline.js +2 -2
  71. package/Tooltip.js +80 -79
  72. package/Transfer.js +103 -102
  73. package/Tree.js +3 -2
  74. package/TreeSelect.js +2 -2
  75. package/Trigger.js +699 -772
  76. package/Typography.js +756 -6
  77. package/Upload.js +2 -2
  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/{BHgJ5Y3T.js → -UuKKT0Z.js} +29 -29
  83. package/chunk/{B8QV6E2b.js → AwZqeapI.js} +5 -5
  84. package/chunk/B5gK1Idp.js +19 -0
  85. package/chunk/B7FlazNB.js +24 -0
  86. package/chunk/{DTBtQQ2H.js → BBvWDeuZ.js} +67 -67
  87. package/chunk/BCftTxEy.js +626 -0
  88. package/chunk/{CZOP_ZHJ.js → BGny4zSb.js} +60 -60
  89. package/chunk/BHF15Dog.js +98 -0
  90. package/chunk/BJQ5UNa-.js +1585 -0
  91. package/chunk/BP9sYyk9.js +8 -0
  92. package/chunk/BUdtVdnv.js +38 -0
  93. package/chunk/BVQlOzTS.js +11 -0
  94. package/chunk/B__a_gb_.js +519 -0
  95. package/chunk/BbEYToV1.js +10 -0
  96. package/chunk/BbdDQAnm.js +15 -0
  97. package/chunk/BdUcgWdu.js +11 -0
  98. package/chunk/BfbXSG70.js +26 -0
  99. package/chunk/BndfNLK4.js +186 -0
  100. package/chunk/BoMCZV6K.js +1098 -0
  101. package/chunk/Br0B6y1T.js +18 -0
  102. package/chunk/BrOW642m.js +130 -0
  103. package/chunk/BxUs8_Cr.js +9 -0
  104. package/chunk/{CcV4wQB1.js → C42LIMP9.js} +244 -242
  105. package/chunk/C4YkFMzC.js +778 -0
  106. package/chunk/{Bh23P4l7.js → C9Wcraj7.js} +21 -21
  107. package/chunk/{4-gvEY5y.js → CANgSlh3.js} +10 -10
  108. package/chunk/CJ_o9tZM.js +5 -0
  109. package/chunk/{DNAigumg.js → CK5m7rLl.js} +36 -36
  110. package/chunk/{CANaGbGR.js → CKNyIitu.js} +57 -56
  111. package/chunk/CLiqJm_T.js +10 -0
  112. package/chunk/{BnSVm1YC.js → CNmmhbCn.js} +32 -32
  113. package/chunk/{BFipyA67.js → CP0odX99.js} +51 -51
  114. package/chunk/CPT-OZH2.js +14 -0
  115. package/chunk/CVSF8p0O.js +698 -0
  116. package/chunk/C_agcwLN.js +31 -0
  117. package/chunk/{jhQQCFMn.js → C_gJWGGh.js} +201 -201
  118. package/chunk/{Bc7t9jkb.js → CaasmWg_.js} +11 -11
  119. package/chunk/Ce1j9KTi.js +6 -0
  120. package/chunk/{D_-UD4vO.js → Cf5QNhkG.js} +18 -18
  121. package/chunk/CkNSv2U7.js +56 -0
  122. package/chunk/Cp2f70gB.js +9 -0
  123. package/chunk/CpegYjdC.js +16 -0
  124. package/chunk/CucI3KZr.js +20 -0
  125. package/chunk/CwoFBTYz.js +11 -0
  126. package/chunk/D2KPqPhV.js +17 -0
  127. package/chunk/D7NyvE5f.js +17 -0
  128. package/chunk/D8oTPQ2H.js +384 -0
  129. package/chunk/{CLBavO5c.js → DC1iHEiy.js} +87 -87
  130. package/chunk/{DnvO8A0Z.js → DFrfrmfK.js} +120 -119
  131. package/chunk/DGTIZ_0O.js +6 -0
  132. package/chunk/DJfpiZn_.js +25 -0
  133. package/chunk/DKr2_PYd.js +34 -0
  134. package/chunk/DNUz6zgo.js +11 -0
  135. package/chunk/DRtM649q.js +11 -0
  136. package/chunk/DS_mUWn6.js +41 -0
  137. package/chunk/DU6bs_19.js +10 -0
  138. package/chunk/DWdbwz22.js +10 -0
  139. package/chunk/DcveZuqd.js +6 -0
  140. package/chunk/DdVFknul.js +24 -0
  141. package/chunk/DgRfikwe.js +16 -0
  142. package/chunk/{znkyQ-HR.js → DkyR2EfG.js} +66 -66
  143. package/chunk/{DUeHQKtx.js → DleQ5HwG.js} +42 -42
  144. package/chunk/DnrZEnQ_.js +27 -0
  145. package/chunk/DsRSHWtX.js +1025 -0
  146. package/chunk/Dz5BdmXo.js +270 -0
  147. package/chunk/EANe01DF.js +1030 -0
  148. package/chunk/{CwhPMMWy.js → Ey4YJCkX.js} +7 -7
  149. package/chunk/GoNx5R4F.js +873 -0
  150. package/chunk/HDUQku8d.js +20 -0
  151. package/chunk/HrAP__Hi.js +25 -0
  152. package/chunk/JPPo5nY_.js +9 -0
  153. package/chunk/{Du-bw6qA.js → SLWP34OR.js} +90 -85
  154. package/chunk/VVKtwaGf.js +278 -0
  155. package/chunk/WPNpLxSI.js +16 -0
  156. package/chunk/{CPvvjMwZ.js → WpO_DsK4.js} +49 -48
  157. package/chunk/fdU3ang6.js +14 -0
  158. package/chunk/{DQAot004.js → fkclKOAL.js} +298 -292
  159. package/chunk/flvYlqx3.js +22 -0
  160. package/chunk/kTDayEpF.js +288 -0
  161. package/chunk/{CssIjN1g.js → pZoNQ75H.js} +31 -31
  162. package/chunk/qFf1w_Jq.js +8 -0
  163. package/chunk/{CHnFKgbk.js → w-kM1L5W.js} +155 -155
  164. package/hooks/index.js +53 -49
  165. package/hooks/useComputedState.js +2 -10
  166. package/hooks/useCreate.js +2 -7
  167. package/hooks/useForceUpdate.js +2 -7
  168. package/hooks/useId.js +2 -10
  169. package/hooks/useInView.js +2 -30
  170. package/hooks/useIntersectionObserver.js +2 -23
  171. package/hooks/useInterval.js +2 -17
  172. package/hooks/useIsFirstRender.js +2 -9
  173. package/hooks/useIsomorphicLayoutEffect.js +2 -5
  174. package/hooks/useKeyboardEvent.js +2 -16
  175. package/hooks/useMedia.js +2 -15
  176. package/hooks/useMergeProps.js +2 -18
  177. package/hooks/useMergeValue.js +2 -19
  178. package/hooks/useOnlineStatus.js +4 -0
  179. package/hooks/useOverflowHidden.js +2 -25
  180. package/hooks/useOverrideRef.js +2 -13
  181. package/hooks/usePersistCallback.js +2 -13
  182. package/hooks/usePrefersColorSchemeDark.js +4 -0
  183. package/hooks/usePrevious.js +2 -9
  184. package/hooks/useRefs.js +2 -9
  185. package/hooks/useResizeObserver.js +2 -15
  186. package/hooks/useStateCallback.js +2 -15
  187. package/hooks/useStateWithPromise.js +2 -24
  188. package/hooks/useUpdateEffect.js +2 -9
  189. package/hooks/useVerificationCode.js +73 -0
  190. package/hooks/useWatch.js +2 -10
  191. package/hooks/{use-watermark.js → useWatermark.js} +27 -26
  192. package/hooks/useWindowSize.js +2 -20
  193. package/index.js +571 -584
  194. package/locale/en-US.js +4 -2
  195. package/locale/interface.js +1 -4
  196. package/locale/ja-JP.js +3 -1
  197. package/locale/tr-TR.js +1 -1
  198. package/locale/zh-CN.js +3 -1
  199. package/locale/zh-HK.js +3 -1
  200. package/locale/zh-TW.js +3 -1
  201. package/package.json +1 -1
  202. package/style.css +1 -1
  203. package/types/anchor/util.d.ts +1 -1
  204. package/types/button/index.d.ts +2 -2
  205. package/types/color-picker/hooks/useColorPicker.d.ts +2 -2
  206. package/types/form/Control-old.d.ts +56 -0
  207. package/types/form/Control.d.ts +6 -54
  208. package/types/form/FormItem.d.ts +1 -1
  209. package/types/form/store.d.ts +0 -1
  210. package/types/hooks/index.d.ts +2 -0
  211. package/types/hooks/useComputedState.d.ts +1 -4
  212. package/types/hooks/useCreate.d.ts +1 -2
  213. package/types/hooks/useForceUpdate.d.ts +1 -2
  214. package/types/hooks/useId.d.ts +1 -2
  215. package/types/hooks/useInView.d.ts +1 -11
  216. package/types/hooks/useIntersectionObserver.d.ts +1 -7
  217. package/types/hooks/useInterval.d.ts +1 -2
  218. package/types/hooks/useIsFirstRender.d.ts +1 -2
  219. package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
  220. package/types/hooks/useKeyboardEvent.d.ts +1 -8
  221. package/types/hooks/useMedia.d.ts +1 -2
  222. package/types/hooks/useMergeProps.d.ts +1 -5
  223. package/types/hooks/useMergeValue.d.ts +1 -6
  224. package/types/hooks/useOnlineStatus.d.ts +1 -0
  225. package/types/hooks/useOverflowHidden.d.ts +1 -5
  226. package/types/hooks/useOverrideRef.d.ts +1 -6
  227. package/types/hooks/usePersistCallback.d.ts +1 -2
  228. package/types/hooks/usePrefersColorSchemeDark.d.ts +1 -0
  229. package/types/hooks/usePrevious.d.ts +1 -3
  230. package/types/hooks/useRefs.d.ts +1 -2
  231. package/types/hooks/useResizeObserver.d.ts +1 -6
  232. package/types/hooks/useStateCallback.d.ts +1 -5
  233. package/types/hooks/useStateWithPromise.d.ts +1 -2
  234. package/types/hooks/useUpdateEffect.d.ts +1 -3
  235. package/types/hooks/useWatch.d.ts +1 -3
  236. package/types/hooks/useWindowSize.d.ts +1 -5
  237. package/types/image/interface.d.ts +1 -0
  238. package/types/index.d.ts +157 -86
  239. package/types/input/Input.d.ts +1 -1
  240. package/types/input/Textarea.d.ts +2 -2
  241. package/types/locale/en-US.d.ts +2 -0
  242. package/types/locale/interface.d.ts +1 -2
  243. package/types/locale/ja-JP.d.ts +2 -0
  244. package/types/locale/zh-CN.d.ts +2 -0
  245. package/types/locale/zh-HK.d.ts +2 -0
  246. package/types/locale/zh-TW.d.ts +2 -0
  247. package/types/menu/context.d.ts +1 -1
  248. package/types/message/index.d.ts +14 -14
  249. package/types/message/interface.d.ts +2 -0
  250. package/types/modal/config.d.ts +0 -1
  251. package/types/modal/interface.d.ts +0 -1
  252. package/types/notice/index.d.ts +2 -27
  253. package/types/notification/index.d.ts +15 -16
  254. package/types/notification/interface.d.ts +2 -0
  255. package/types/notification/withNotification.d.ts +2 -0
  256. package/types/select/util.d.ts +1 -2
  257. package/types/select-view/interface.d.ts +2 -1
  258. package/types/speech-synthesis/index.d.ts +1 -1
  259. package/types/table/constant.d.ts +2 -0
  260. package/types/table/hook/useThResizable.d.ts +7 -0
  261. package/types/table/index.d.ts +10 -1
  262. package/types/table/style/index.d.ts +1 -0
  263. package/types/table/th-resizable/index.d.ts +2 -0
  264. package/types/table/thead/Column.d.ts +1 -2
  265. package/types/tree/Tree.d.ts +12 -67
  266. package/types/tree-select/Select.d.ts +2 -2
  267. package/types/trigger/index.d.ts +2 -120
  268. package/types/trigger/interface.d.ts +2 -1
  269. package/types/utils/CSSTransition.d.ts +2 -3
  270. package/types/utils/caseName.d.ts +1 -1
  271. package/types/utils/className.d.ts +1 -1
  272. package/types/utils/constant.d.ts +2 -2
  273. package/types/utils/copy.d.ts +1 -1
  274. package/types/utils/dayjs.d.ts +1 -21
  275. package/types/utils/dom.d.ts +1 -6
  276. package/types/utils/fileToURL.d.ts +1 -1
  277. package/types/utils/fillNBSP.d.ts +1 -1
  278. package/types/utils/getHighlightText.d.ts +1 -5
  279. package/types/utils/getHotkeyHandler.d.ts +1 -8
  280. package/types/utils/getStringLength.d.ts +1 -1
  281. package/types/utils/include.d.ts +1 -1
  282. package/types/utils/index.d.ts +3 -4
  283. package/types/utils/is.d.ts +1 -16
  284. package/types/utils/keyboardCode.d.ts +3 -0
  285. package/types/utils/lodash.d.ts +1 -17
  286. package/types/utils/mergeProps.d.ts +1 -1
  287. package/types/utils/mergedToString.d.ts +1 -1
  288. package/types/utils/omit.d.ts +1 -1
  289. package/types/utils/pad.d.ts +1 -2
  290. package/types/utils/pick.d.ts +2 -4
  291. package/types/utils/reactDOM.d.ts +1 -7
  292. package/types/utils/resizeObserverEffect.d.ts +2 -0
  293. package/types/utils/saveAs.d.ts +1 -1
  294. package/types/utils/screenfull.d.ts +2 -0
  295. package/types/utils/scrollIntoView.d.ts +1 -2
  296. package/types/utils/style.d.ts +1 -3
  297. package/types/utils/throttleByRaf.d.ts +1 -5
  298. package/types/utils/throttleByRaf2.d.ts +1 -0
  299. package/types/utils/warning.d.ts +1 -2
  300. package/types/version/index.d.ts +1 -1
  301. package/utils/CSSTransition.js +2 -6
  302. package/utils/className.js +2 -2
  303. package/utils/constant.js +8 -9
  304. package/utils/contextHolder.js +1 -1
  305. package/utils/copy.js +1 -1
  306. package/utils/dayjs.js +14 -173
  307. package/utils/dom.js +33 -29
  308. package/utils/fillNBSP.js +2 -4
  309. package/utils/getHighlightText.js +2 -38
  310. package/utils/getHotkeyHandler.js +2 -25
  311. package/utils/getStringLength.js +2 -7
  312. package/utils/include.js +2 -7
  313. package/utils/index.js +237 -240
  314. package/utils/is.js +116 -156
  315. package/utils/keyboardCode.js +27 -0
  316. package/utils/mergeProps.js +2 -9
  317. package/utils/mergedToString.js +2 -13
  318. package/utils/omit.js +2 -9
  319. package/utils/pad.js +12 -12
  320. package/utils/pick.js +4 -15
  321. package/utils/reactDOM.js +3 -54
  322. package/utils/resizeObserverEffect.js +4 -0
  323. package/utils/saveAs.js +1 -1
  324. package/utils/screenfull.js +4 -0
  325. package/utils/scrollIntoView.js +2 -21
  326. package/utils/style.js +12 -11
  327. package/utils/throttleByRaf.js +13 -12
  328. package/utils/throttleByRaf2.js +5 -0
  329. package/utils/warning.js +5 -4
  330. package/NotificationBase.js +0 -53
  331. package/chunk/-zpSUpGE.js +0 -1501
  332. package/chunk/BAWsPQBM.js +0 -11
  333. package/chunk/BIT0j3HT.js +0 -269
  334. package/chunk/BbLKnaNO.js +0 -871
  335. package/chunk/Bfhv56O2.js +0 -638
  336. package/chunk/C2lIz2F9.js +0 -60
  337. package/chunk/C6QWSzsM.js +0 -376
  338. package/chunk/CVkHTbic.js +0 -995
  339. package/chunk/CeGEvXby.js +0 -278
  340. package/chunk/D3NFxdmG.js +0 -518
  341. package/chunk/DApXtulb.js +0 -1102
  342. package/chunk/DPByB1ab.js +0 -698
  343. package/chunk/DV1Ab_cG.js +0 -284
  344. package/chunk/dBnNCOIU.js +0 -778
  345. package/chunk/it8qlDZ3.js +0 -1032
  346. package/chunk/l0sNRNKZ.js +0 -1
  347. package/chunk/te_43YrB.js +0 -776
  348. package/hooks/use-verification-code.js +0 -73
  349. package/types/notification-base/index.d.ts +0 -15
  350. package/types/notification-base/style/index.d.ts +0 -2
  351. package/types/trigger/Portal.d.ts +0 -7
  352. package/types/utils/keyCode.d.ts +0 -45
  353. package/types/utils/raf.d.ts +0 -3
  354. package/types/utils/throttleByRafV2.d.ts +0 -5
  355. package/utils/keyCode.js +0 -12
  356. package/utils/raf.js +0 -19
  357. package/utils/throttleByRafV2.js +0 -16
@@ -0,0 +1,1030 @@
1
+ import { jsxs as E, Fragment as z, jsx as n } from "react/jsx-runtime";
2
+ import O from "lodash/isFunction";
3
+ import ge from "lodash/isNumber";
4
+ import te, { useContext as M, forwardRef as Q, useState as A, useEffect as _, isValidElement as $e, useRef as ie, useImperativeHandle as he } from "react";
5
+ import { a as W, I as Ie } from "./BJQ5UNa-.js";
6
+ import { c as we } from "./B5gK1Idp.js";
7
+ import { m as X } from "./JPPo5nY_.js";
8
+ import { c as Ce } from "./BdUcgWdu.js";
9
+ import ue from "../utils/warning.js";
10
+ import { _ as Ne, N as ne } from "./DC1iHEiy.js";
11
+ import { a as Fe } from "./fkclKOAL.js";
12
+ import be from "@unicom-cloud/icons/IconUiDelete";
13
+ import Pe from "@unicom-cloud/icons/IconUiEye";
14
+ import Ee from "@unicom-cloud/icons/IconUiImageClose";
15
+ import oe from "@unicom-cloud/icons/IconUiUpload";
16
+ import { l as ve } from "./CTxjmYmx.js";
17
+ import { h as Y } from "./D2KPqPhV.js";
18
+ import "./CkNSv2U7.js";
19
+ import Le from "@unicom-cloud/icons/IconUiCheck";
20
+ import Re from "@unicom-cloud/icons/IconUiPause";
21
+ import De from "@unicom-cloud/icons/IconUiPlayArrowFill";
22
+ import Te from "../Progress.js";
23
+ import re from "../Tooltip.js";
24
+ import ae from "lodash/isPlainObject.js";
25
+ import ke from "@unicom-cloud/icons/IconUiExclamationCircleFill";
26
+ import Oe from "@unicom-cloud/icons/IconUiFile";
27
+ import Se from "@unicom-cloud/icons/IconUiFileAudio";
28
+ import ye from "@unicom-cloud/icons/IconUiFileImage";
29
+ import je from "@unicom-cloud/icons/IconUiFilePdf";
30
+ import qe from "@unicom-cloud/icons/IconUiFileVideo";
31
+ import { K as Ae } from "./CSC_V_25.js";
32
+ import le from "lodash/isPlainObject";
33
+ import me from "@unicom-cloud/icons/IconUiPlus";
34
+ import Ve from "../Button.js";
35
+ import He from "lodash/isArray";
36
+ import { o as p } from "./CJ_o9tZM.js";
37
+ const I = {
38
+ init: "init",
39
+ uploading: "uploading",
40
+ success: "done",
41
+ fail: "error"
42
+ }, Ue = (e) => {
43
+ var w, g, l, d, m, b;
44
+ const c = Y(), { file: u, prefixCls: s, progressProps: t, progressRender: r } = e, { locale: i } = M(W), { status: o, percent: v = 0 } = u, U = `${s}-list`, y = t && t.width ? { width: t.width } : {}, x = /* @__PURE__ */ E(z, { children: [
45
+ o === I.fail && e.reuploadIcon !== null && /* @__PURE__ */ n(
46
+ "span",
47
+ {
48
+ className: `${s}-list-reupload-icon`,
49
+ onClick: () => {
50
+ var a;
51
+ (a = e.onReupload) == null || a.call(e, u);
52
+ },
53
+ tabIndex: 0,
54
+ role: "button",
55
+ "aria-label": (w = i == null ? void 0 : i.Upload) == null ? void 0 : w.reupload,
56
+ ...c({
57
+ onPressEnter: () => {
58
+ var a;
59
+ (a = e.onReupload) == null || a.call(e, u);
60
+ }
61
+ }),
62
+ children: e.reuploadIcon || (e.listType === "picture-card" ? /* @__PURE__ */ n(oe, {}) : (g = i == null ? void 0 : i.Upload) == null ? void 0 : g.reupload)
63
+ }
64
+ ),
65
+ o === I.success && e.successIcon !== null && /* @__PURE__ */ n("span", { className: `${s}-list-success-icon`, children: e.successIcon || /* @__PURE__ */ n(Le, {}) }),
66
+ o !== I.success && /* @__PURE__ */ E("div", { className: `${U}-status`, style: y, children: [
67
+ /* @__PURE__ */ n(
68
+ Te,
69
+ {
70
+ showText: !1,
71
+ className: `${U}-progress`,
72
+ type: "circle",
73
+ status: o === I.fail ? "error" : o === I.success ? "success" : "normal",
74
+ percent: v,
75
+ size: "mini",
76
+ ...t
77
+ }
78
+ ),
79
+ o === I.init && e.startIcon !== null && /* @__PURE__ */ n(
80
+ "span",
81
+ {
82
+ tabIndex: 0,
83
+ role: "button",
84
+ "aria-label": (l = i == null ? void 0 : i.Upload) == null ? void 0 : l.start,
85
+ className: `${s}-list-start-icon`,
86
+ onClick: () => {
87
+ var a;
88
+ (a = e.onUpload) == null || a.call(e, u);
89
+ },
90
+ ...c({
91
+ onPressEnter: () => {
92
+ var a;
93
+ (a = e.onUpload) == null || a.call(e, u);
94
+ }
95
+ }),
96
+ children: e.startIcon || /* @__PURE__ */ n(re, { content: (d = i == null ? void 0 : i.Upload) == null ? void 0 : d.start, children: /* @__PURE__ */ n(De, {}) })
97
+ }
98
+ ),
99
+ o === I.uploading && e.cancelIcon !== null && /* @__PURE__ */ n(
100
+ "span",
101
+ {
102
+ className: `${e.prefixCls}-list-cancel-icon`,
103
+ onClick: () => {
104
+ var a;
105
+ (a = e.onAbort) == null || a.call(e, u);
106
+ },
107
+ tabIndex: 0,
108
+ "aria-label": (m = i == null ? void 0 : i.Upload) == null ? void 0 : m.cancel,
109
+ ...c({
110
+ onPressEnter: () => {
111
+ var a;
112
+ (a = e.onAbort) == null || a.call(e, u);
113
+ }
114
+ }),
115
+ children: e.cancelIcon || /* @__PURE__ */ n(re, { content: (b = i == null ? void 0 : i.Upload) == null ? void 0 : b.cancel, children: /* @__PURE__ */ n(Re, {}) })
116
+ }
117
+ )
118
+ ] })
119
+ ] });
120
+ return O(r) ? r(u, x) : x;
121
+ }, Ge = (e, c) => {
122
+ const { disabled: u, prefixCls: s, file: t, showUploadList: r, locale: i } = e, o = Y(), v = `${s}-list-item-picture`, { status: U, originFile: y } = t, [x, w] = A(t.url), g = ae(r) ? r : {};
123
+ return _(() => {
124
+ if (t.url !== void 0)
125
+ w(t.url);
126
+ else {
127
+ const l = t.originFile;
128
+ l && ve(l).then((d) => {
129
+ w(d);
130
+ }).catch((d) => {
131
+ console.error(d);
132
+ }).finally(() => {
133
+ });
134
+ }
135
+ return () => {
136
+ };
137
+ }, [t.url, t.originFile]), _(() => {
138
+ var l;
139
+ return (l = e.onChange) == null || l.call(e, { type: "url", data: x }), () => {
140
+ var d;
141
+ (d = e.onChange) == null || d.call(e, { type: "url", data: void 0 });
142
+ };
143
+ }, [x]), /* @__PURE__ */ n("div", { className: v, ref: c, children: U === I.uploading ? /* @__PURE__ */ n(
144
+ Ue,
145
+ {
146
+ onReupload: e.onReupload,
147
+ onUpload: e.onUpload,
148
+ onAbort: e.onAbort,
149
+ listType: "picture-card",
150
+ file: t,
151
+ prefixCls: s,
152
+ progressProps: e.progressProps,
153
+ ...g
154
+ }
155
+ ) : /* @__PURE__ */ E(z, { children: [
156
+ O(g.imageRender) ? g.imageRender(t) : /* @__PURE__ */ n("img", { src: x, alt: t.name }),
157
+ /* @__PURE__ */ E("div", { className: `${v}-mask`, role: "radiogroup", children: [
158
+ t.status === I.fail && /* @__PURE__ */ n("div", { className: `${v}-error-tip`, children: g.errorIcon !== null && /* @__PURE__ */ n("span", { className: `${s}-list-error-icon`, children: g.errorIcon || /* @__PURE__ */ n(Ee, {}) }) }),
159
+ /* @__PURE__ */ E("div", { className: `${v}-operation`, children: [
160
+ t.status !== I.fail && g.previewIcon !== null && /* @__PURE__ */ n(
161
+ "span",
162
+ {
163
+ className: `${s}-list-preview-icon`,
164
+ tabIndex: 0,
165
+ role: "button",
166
+ "aria-label": i.Upload.preview,
167
+ ...o({
168
+ onPressEnter: () => {
169
+ var l;
170
+ (l = e.onPreview) == null || l.call(e, t);
171
+ }
172
+ }),
173
+ onClick: () => {
174
+ var l;
175
+ (l = e.onPreview) == null || l.call(e, t);
176
+ },
177
+ children: g.previewIcon || /* @__PURE__ */ n(Pe, {})
178
+ }
179
+ ),
180
+ t.status === I.fail && g.reuploadIcon !== null && /* @__PURE__ */ n(
181
+ "span",
182
+ {
183
+ className: `${e.prefixCls}-list-reupload-icon`,
184
+ onClick: () => {
185
+ var l;
186
+ (l = e.onReupload) == null || l.call(e, t);
187
+ },
188
+ tabIndex: 0,
189
+ role: "button",
190
+ "aria-label": i.Upload.reupload,
191
+ ...o({
192
+ onPressEnter: () => {
193
+ var l;
194
+ (l = e.onReupload) == null || l.call(e, t);
195
+ }
196
+ }),
197
+ children: g.reuploadIcon || /* @__PURE__ */ n(oe, {})
198
+ }
199
+ ),
200
+ !u && g.removeIcon !== null && /* @__PURE__ */ n(
201
+ "span",
202
+ {
203
+ className: `${s}-list-remove-icon`,
204
+ onClick: () => {
205
+ var l;
206
+ (l = e.onRemove) == null || l.call(e, t);
207
+ },
208
+ role: "button",
209
+ "aria-label": i.Upload.delete,
210
+ tabIndex: 0,
211
+ ...o({
212
+ onPressEnter: () => {
213
+ var l;
214
+ (l = e.onRemove) == null || l.call(e, t);
215
+ }
216
+ }),
217
+ children: g.removeIcon || /* @__PURE__ */ n(be, {})
218
+ }
219
+ )
220
+ ] })
221
+ ] })
222
+ ] }) });
223
+ }, _e = Q(Ge), Be = (e) => {
224
+ let c = "";
225
+ if (e.originFile && e.originFile.type)
226
+ c = e.originFile.type;
227
+ else {
228
+ const s = (e.name || "").split(".").pop() || "";
229
+ c = s, ["png", "jpg", "jpeg", "bmp", "gif"].indexOf(s) > -1 ? c = "image" : ["mp4", "m2v", "mkv"].indexOf(s) > -1 ? c = "video" : ["mp3", "wav", "wmv"].indexOf(s) > -1 && (c = "audio");
230
+ }
231
+ return c.indexOf("image") > -1 ? ye : c.indexOf("pdf") > -1 ? je : c.indexOf("audio") > -1 ? Se : c.indexOf("video") > -1 ? qe : Oe;
232
+ }, Ke = (e, c) => {
233
+ const { prefixCls: u, disabled: s, file: t, locale: r } = e, i = `${u}-list-item-text`, o = Y(), v = Be(t), U = ae(e.showUploadList) ? e.showUploadList : {}, y = ae(U) ? U : {}, x = t.name || t.originFile && t.originFile.name, [w, g] = A(t.url);
234
+ let l = {};
235
+ return t.status !== I.fail && (l = {
236
+ popupVisible: !1
237
+ }), _(() => {
238
+ if (t.url !== void 0)
239
+ g(t.url);
240
+ else {
241
+ const d = t.originFile;
242
+ d && ve(d).then((m) => {
243
+ g(m);
244
+ }).catch((m) => {
245
+ console.error(m);
246
+ }).finally(() => {
247
+ });
248
+ }
249
+ return () => {
250
+ };
251
+ }, [t.url, t.originFile]), _(() => {
252
+ var d;
253
+ return (d = e.onChange) == null || d.call(e, { type: "url", data: w }), () => {
254
+ var m;
255
+ (m = e.onChange) == null || m.call(e, { type: "url", data: void 0 });
256
+ };
257
+ }, [w]), /* @__PURE__ */ E(
258
+ "div",
259
+ {
260
+ className: `${u}-list-item ${u}-list-item-${t.status}`,
261
+ ref: c,
262
+ children: [
263
+ /* @__PURE__ */ E("div", { className: i, children: [
264
+ e.listType === "picture-list" && /* @__PURE__ */ n("div", { className: `${i}-thumbnail`, children: O(U.imageRender) ? U.imageRender(t) : /* @__PURE__ */ n("img", { src: w }) }),
265
+ /* @__PURE__ */ E("div", { className: `${i}-content`, children: [
266
+ /* @__PURE__ */ E("div", { className: `${i}-name`, children: [
267
+ e.listType === "text" && y.fileIcon !== null && /* @__PURE__ */ n("span", { className: `${u}-list-file-icon`, children: y.fileIcon || /* @__PURE__ */ n(v, {}) }),
268
+ O(U.fileName) ? /* @__PURE__ */ n("span", { className: `${i}-name-text`, children: U.fileName(t) }) : t.url ? /* @__PURE__ */ n(
269
+ "a",
270
+ {
271
+ href: t.url,
272
+ target: "_blank",
273
+ rel: "noreferrer",
274
+ className: `${i}-name-link`,
275
+ children: x
276
+ }
277
+ ) : /* @__PURE__ */ n("span", { className: `${i}-name-text`, children: x }),
278
+ t.status === I.fail && y.errorIcon !== null && /* @__PURE__ */ n(
279
+ re,
280
+ {
281
+ content: (typeof t.response == "object" ? $e(t.response) && t.response : t.response) || r.Upload.error,
282
+ ...l,
283
+ disabled: t.status !== I.fail,
284
+ children: /* @__PURE__ */ n("span", { className: `${e.prefixCls}-list-error-icon`, children: y.errorIcon || (e.listType === "picture-card" ? /* @__PURE__ */ n(ye, {}) : /* @__PURE__ */ n(ke, {})) })
285
+ }
286
+ )
287
+ ] }),
288
+ /* @__PURE__ */ n(
289
+ Ue,
290
+ {
291
+ file: t,
292
+ prefixCls: u,
293
+ progressProps: e.progressProps,
294
+ onReupload: e.onReupload,
295
+ onUpload: e.onUpload,
296
+ onAbort: e.onAbort,
297
+ ...y
298
+ }
299
+ )
300
+ ] })
301
+ ] }),
302
+ /* @__PURE__ */ n("div", { className: `${u}-list-item-operation`, children: !s && y.removeIcon !== null && /* @__PURE__ */ n(
303
+ Ie,
304
+ {
305
+ className: `${u}-list-remove-icon-hover`,
306
+ onClick: () => {
307
+ var d;
308
+ (d = e.onRemove) == null || d.call(e, t);
309
+ },
310
+ tabIndex: 0,
311
+ "aria-label": r.Upload.delete,
312
+ ...o({
313
+ onPressEnter: () => {
314
+ var d;
315
+ (d = e.onRemove) == null || d.call(e, t);
316
+ }
317
+ }),
318
+ children: /* @__PURE__ */ n("span", { className: `${u}-list-remove-icon`, children: y.removeIcon || /* @__PURE__ */ n(be, {}) })
319
+ }
320
+ ) })
321
+ ]
322
+ }
323
+ );
324
+ }, ze = Q(Ke), xe = (e) => {
325
+ const { locale: c, rtl: u } = M(W), {
326
+ listType: s,
327
+ fileList: t,
328
+ renderUploadList: r,
329
+ renderUploadItem: i,
330
+ prefixCls: o,
331
+ ...v
332
+ } = e, [U, y] = A(-1), [x, w] = A([]);
333
+ if (O(r))
334
+ return /* @__PURE__ */ n("div", { className: `${o}-list`, children: r(t, v) });
335
+ const g = (d) => {
336
+ e.imagePreview && y(d);
337
+ };
338
+ function l(d, m, b) {
339
+ (d == null ? void 0 : d.type) === "url" && [I.init, I.success].indexOf(b.status) > -1 && w((a) => {
340
+ const L = [...a];
341
+ return L[m] = d.data, L.filter(Boolean);
342
+ });
343
+ }
344
+ return _(() => () => {
345
+ }, []), /* @__PURE__ */ E(z, { children: [
346
+ /* @__PURE__ */ n(
347
+ Ne,
348
+ {
349
+ className: X(
350
+ `${o}-list`,
351
+ `${o}-list-type-${s}`,
352
+ {
353
+ [`${o}-list-rtl`]: u
354
+ }
355
+ ),
356
+ children: t.map((d, m) => {
357
+ let b = s === "picture-card" ? /* @__PURE__ */ n(
358
+ "div",
359
+ {
360
+ className: `${o}-list-item ${o}-list-item-${d.status}`,
361
+ children: /* @__PURE__ */ n(
362
+ _e,
363
+ {
364
+ ...e,
365
+ onPreview: (a) => {
366
+ var L;
367
+ g(m), (L = e.onPreview) == null || L.call(e, a);
368
+ },
369
+ file: d,
370
+ locale: c,
371
+ onChange: (a) => {
372
+ l(a, m, d);
373
+ }
374
+ }
375
+ )
376
+ }
377
+ ) : /* @__PURE__ */ n(
378
+ ze,
379
+ {
380
+ ...e,
381
+ file: d,
382
+ locale: c,
383
+ onChange: (a) => {
384
+ l(a, m, d);
385
+ }
386
+ }
387
+ );
388
+ return O(i) && (b = i(b, d, t)), s === "picture-card" ? /* @__PURE__ */ n(
389
+ ne,
390
+ {
391
+ timeout: { enter: 200, exit: 400 },
392
+ classNames: `${o}-slide-inline`,
393
+ onEntered: (a) => {
394
+ a && (a.style.width = "");
395
+ },
396
+ onExit: (a) => {
397
+ a && (a.style.width = `${a.scrollWidth}px`);
398
+ },
399
+ onExiting: (a) => {
400
+ a && (a.style.width = 0);
401
+ },
402
+ onExited: (a) => {
403
+ a && (a.style.width = 0);
404
+ },
405
+ children: b
406
+ },
407
+ d.uid
408
+ ) : /* @__PURE__ */ n(
409
+ ne,
410
+ {
411
+ timeout: { enter: 200, exit: 400 },
412
+ classNames: `${o}-slide-up`,
413
+ onExit: (a) => {
414
+ a && (a.style.height = `${a.scrollHeight}px`);
415
+ },
416
+ onExiting: (a) => {
417
+ a && (a.style.height = 0);
418
+ },
419
+ onExited: (a) => {
420
+ a && (a.style.height = 0);
421
+ },
422
+ children: b
423
+ },
424
+ d.uid
425
+ );
426
+ })
427
+ }
428
+ ),
429
+ s === "picture-card" && e.imagePreview && /* @__PURE__ */ n(
430
+ Fe,
431
+ {
432
+ srcList: x,
433
+ visible: U !== -1,
434
+ current: U,
435
+ onChange: g,
436
+ onVisibleChange: (d) => {
437
+ g(d ? U : -1);
438
+ }
439
+ }
440
+ )
441
+ ] });
442
+ };
443
+ xe.displayName = "FileList";
444
+ const se = (e, c) => {
445
+ const u = le(c) ? c == null ? void 0 : c.type : c;
446
+ if (!(le(c) && c.strict === !1) && u && e) {
447
+ const t = He(u) ? u : u.split(",").map((i) => i.trim()).filter((i) => i), r = (e.name.indexOf(".") > -1 ? `.${e.name.split(".").pop()}` : "").toLowerCase();
448
+ return t.some((i) => {
449
+ const o = i && i.toLowerCase(), v = (e.type || "").toLowerCase(), U = v.split("/")[0];
450
+ if (o === v || `${U}${r.replace(".", "/")}` === o || /^\*(\/\*)?$/.test(o))
451
+ return !0;
452
+ if (/\/\*/.test(o))
453
+ return v.replace(/\/.*$/, "") === o.replace(/\/.*$/, "");
454
+ if (/\..*/.test(o)) {
455
+ let y = [o];
456
+ return (o === ".jpg" || o === ".jpeg") && (y = [".jpg", ".jpeg"]), y.indexOf(r) > -1;
457
+ }
458
+ return !1;
459
+ });
460
+ }
461
+ return !!e;
462
+ }, Me = (e, c) => {
463
+ if (!e)
464
+ return;
465
+ let u = [].slice.call(e);
466
+ return c && (u = u.filter((s) => se(s, c))), u;
467
+ }, We = (e, c, u) => {
468
+ const s = [];
469
+ let t = 0;
470
+ const r = () => {
471
+ !t && u(s);
472
+ }, i = (v) => {
473
+ if (t += 1, v != null && v.isFile) {
474
+ v.file((U) => {
475
+ t -= 1, se(U, c) && (Object.defineProperty(U, "webkitRelativePath", {
476
+ value: v.fullPath.replace(/^\//, "")
477
+ }), s.push(U)), r();
478
+ });
479
+ return;
480
+ }
481
+ if (v != null && v.isDirectory) {
482
+ const U = v.createReader();
483
+ let y = !1;
484
+ const x = () => {
485
+ U.readEntries((w) => {
486
+ y || (t -= 1, y = !0), w.length === 0 ? r() : (x(), w.forEach(i));
487
+ });
488
+ };
489
+ x();
490
+ return;
491
+ }
492
+ t -= 1, r();
493
+ };
494
+ [].slice.call(e).forEach((v) => {
495
+ v.webkitGetAsEntry && i(v.webkitGetAsEntry());
496
+ });
497
+ }, Je = (e, c) => {
498
+ const u = Y(), { locale: s } = M(W), [t, r] = A(!1), [i, o] = A(0), {
499
+ tip: v,
500
+ children: U,
501
+ disabled: y,
502
+ drag: x,
503
+ listType: w,
504
+ prefixCls: g,
505
+ accept: l,
506
+ multiple: d
507
+ } = e, m = {
508
+ disabled: y
509
+ };
510
+ return _(() => {
511
+ o(0);
512
+ }, [t]), U === null ? null : /* @__PURE__ */ n(
513
+ "div",
514
+ {
515
+ className: `${g}-trigger`,
516
+ onClick: y ? void 0 : e.onClick,
517
+ ...u({
518
+ onPressEnter: () => {
519
+ var b;
520
+ !y && ((b = e.onClick) == null || b.call(e));
521
+ }
522
+ }),
523
+ ref: c,
524
+ onDragEnter: () => {
525
+ o(i + 1);
526
+ },
527
+ onDragLeave: (b) => {
528
+ var a;
529
+ b.preventDefault(), i === 0 ? (r(!1), !y && ((a = e.onDragLeave) == null || a.call(e, b))) : o(i - 1);
530
+ },
531
+ onDrop: (b) => {
532
+ var a, L;
533
+ if (b.preventDefault(), !y && e.drag !== !1) {
534
+ if (r(!1), e.directory)
535
+ We(b.dataTransfer.items, l, (S) => {
536
+ var T;
537
+ (T = e.onDragFiles) == null || T.call(e, S);
538
+ });
539
+ else {
540
+ const S = [].slice.call(b.dataTransfer.items || []).reduce((j, q, B) => {
541
+ if (q.webkitGetAsEntry) {
542
+ const R = q.webkitGetAsEntry();
543
+ return R != null && R.isDirectory ? [...j, B] : j;
544
+ }
545
+ }, []), T = [].slice.call(b.dataTransfer.files || []).filter((j, q) => !S.includes(q)), V = Me(T, l);
546
+ V.length > 0 && ((a = e.onDragFiles) == null || a.call(e, d ? V : V.slice(0, 1)));
547
+ }
548
+ (L = e.onDrop) == null || L.call(e, b);
549
+ }
550
+ },
551
+ onDragOver: (b) => {
552
+ var a;
553
+ b.preventDefault(), !y && !t && (r(!0), (a = e.onDragOver) == null || a.call(e, b));
554
+ },
555
+ children: te.isValidElement(U) ? /* @__PURE__ */ n(
556
+ "div",
557
+ {
558
+ className: X({ [`${g}-trigger-custom-active`]: t }),
559
+ children: te.cloneElement(U, m)
560
+ }
561
+ ) : w === "picture-card" ? /* @__PURE__ */ n("div", { className: `${g}-trigger-picture-wrapper`, children: /* @__PURE__ */ n(
562
+ "div",
563
+ {
564
+ className: `${g}-trigger-picture`,
565
+ tabIndex: 0,
566
+ "aria-label": s.Upload.upload,
567
+ children: /* @__PURE__ */ n("div", { className: `${g}-trigger-picture-text`, children: /* @__PURE__ */ n(me, {}) })
568
+ }
569
+ ) }) : x ? /* @__PURE__ */ E(
570
+ "div",
571
+ {
572
+ className: X(`${g}-trigger-drag`, {
573
+ [`${g}-trigger-drag-active`]: t
574
+ }),
575
+ tabIndex: 0,
576
+ "aria-label": s.Upload.drag,
577
+ children: [
578
+ /* @__PURE__ */ n(me, {}),
579
+ /* @__PURE__ */ n("p", { className: `${g}-trigger-drag-text`, children: t ? s.Upload.dragHover : s.Upload.drag }),
580
+ v && /* @__PURE__ */ n("div", { className: `${g}-trigger-tip`, children: v })
581
+ ]
582
+ }
583
+ ) : /* @__PURE__ */ E(
584
+ Ve,
585
+ {
586
+ ...m,
587
+ "aria-label": s.Upload.upload,
588
+ type: "primary",
589
+ className: `${g}-trigger-with-icon`,
590
+ children: [
591
+ /* @__PURE__ */ n(oe, {}),
592
+ s.Upload.upload
593
+ ]
594
+ }
595
+ )
596
+ }
597
+ );
598
+ }, Xe = Q(
599
+ Je
600
+ );
601
+ function fe(e) {
602
+ const c = e.responseText || e.response;
603
+ if (!c)
604
+ return c;
605
+ try {
606
+ return JSON.parse(c);
607
+ } catch {
608
+ return c;
609
+ }
610
+ }
611
+ const Qe = function(e) {
612
+ const {
613
+ onProgress: c = p,
614
+ onError: u = p,
615
+ onSuccess: s = p,
616
+ action: t,
617
+ method: r,
618
+ headers: i = {},
619
+ name: o,
620
+ file: v,
621
+ data: U = {},
622
+ withCredentials: y = !1
623
+ } = e;
624
+ function x(m) {
625
+ return typeof m == "function" ? m(v) : m;
626
+ }
627
+ const w = x(o), g = x(U), l = new XMLHttpRequest();
628
+ c && l.upload && (l.upload.onprogress = function(m) {
629
+ let b;
630
+ m.total > 0 && (b = m.loaded / m.total * 100), c(parseInt(b, 10), m);
631
+ }), l.onerror = function(b) {
632
+ u(b);
633
+ }, l.onload = function() {
634
+ if (l.status < 200 || l.status >= 300)
635
+ return u(fe(l));
636
+ s(fe(l));
637
+ };
638
+ const d = new FormData();
639
+ g && Object.keys(g).map((m) => d.append(m, g[m])), d.append(w || "file", v), l.open(r, t, !0), y && "withCredentials" in l && (l.withCredentials = !0);
640
+ for (const m in i)
641
+ Object.prototype.hasOwnProperty.call(i, m) && i[m] !== null && l.setRequestHeader(m, i[m]);
642
+ return l.send(d), {
643
+ abort() {
644
+ l.abort();
645
+ }
646
+ };
647
+ };
648
+ function Ye(e, c) {
649
+ const { toAuthor: u } = M(W), s = ie(null), [t, r] = A({ uploadRequests: {} });
650
+ function i(f) {
651
+ w(f);
652
+ }
653
+ function o(f) {
654
+ var F;
655
+ const $ = t.uploadRequests[f.uid];
656
+ $ && ((F = $.abort) == null || F.call($), y({
657
+ ...f,
658
+ status: I.fail
659
+ }), U(f.uid));
660
+ }
661
+ function v(f) {
662
+ w({
663
+ ...f,
664
+ percent: 0,
665
+ status: I.uploading
666
+ });
667
+ }
668
+ function U(f) {
669
+ const $ = { ...t.uploadRequests };
670
+ delete $[f], r({
671
+ uploadRequests: $
672
+ });
673
+ }
674
+ he(c, () => ({
675
+ // 提供 ref 调用
676
+ upload: i,
677
+ abort: o,
678
+ reupload: v,
679
+ // 删除上传(手动上传时,文件会出现在上传列表,但属于init状态)
680
+ delete: U
681
+ }));
682
+ function y(f, $ = e.fileList) {
683
+ const { onFileStatusChange: F } = e, h = "uid" in f ? "uid" : "name";
684
+ F == null || F(
685
+ $.map((C) => C[h] === f[h] ? f : C),
686
+ f
687
+ );
688
+ }
689
+ function x(f) {
690
+ const $ = "uid" in f ? "uid" : "name";
691
+ return e.fileList.find((h) => h[$] === f[$]);
692
+ }
693
+ async function w(f) {
694
+ const {
695
+ action: $,
696
+ headers: F,
697
+ name: h,
698
+ data: C,
699
+ withCredentials: N,
700
+ customRequest: P,
701
+ method: G
702
+ } = e, ce = {
703
+ onProgress: (K, D) => {
704
+ var de;
705
+ const J = x(f);
706
+ J && (J.status = I.uploading, J.percent = K, (de = e == null ? void 0 : e.onProgress) == null || de.call(e, J, D));
707
+ },
708
+ onSuccess: (K) => {
709
+ const D = x(f);
710
+ D && (D.status = I.success, D.response = K, y(D)), U(f.uid);
711
+ },
712
+ onError: (K) => {
713
+ const D = x(f);
714
+ D && (D.status = I.fail, D.response = K, y(D)), U(f.uid);
715
+ },
716
+ headers: F,
717
+ name: h,
718
+ file: f.originFile,
719
+ data: C,
720
+ withCredentials: N
721
+ };
722
+ y(f);
723
+ let Z;
724
+ P ? Z = await P(ce) : $ && (Z = Qe({ ...ce, action: $, method: G })), r({
725
+ uploadRequests: {
726
+ ...t.uploadRequests,
727
+ [f.uid]: Z
728
+ }
729
+ });
730
+ }
731
+ function g(f) {
732
+ const { limit: $, fileList: F, onExceedLimit: h, autoUpload: C } = e;
733
+ if (ge($) && $ < F.length + f.length)
734
+ return h == null ? void 0 : h(f, F);
735
+ const N = (P, G) => {
736
+ const k = e.fileList || [], H = {
737
+ uid: `${String(+/* @__PURE__ */ new Date())}${G}`,
738
+ originFile: P,
739
+ percent: 0,
740
+ status: I.init,
741
+ name: P.name
742
+ };
743
+ y(H), k.push(H), y(H, k), C && setTimeout(() => {
744
+ w({
745
+ ...H,
746
+ status: I.uploading
747
+ });
748
+ }, 0);
749
+ };
750
+ f.forEach((P, G) => {
751
+ se(P, e.accept) && (O(e.beforeUpload) ? Promise.resolve(e.beforeUpload(P, f)).then((k) => {
752
+ if (k !== !1) {
753
+ const H = Ae(k) ? k : P;
754
+ N(H, G);
755
+ }
756
+ }).catch((k) => {
757
+ console.error(k);
758
+ }) : N(P, G));
759
+ });
760
+ }
761
+ const {
762
+ accept: l,
763
+ multiple: d,
764
+ children: m,
765
+ prefixCls: b,
766
+ tip: a,
767
+ disabled: L,
768
+ drag: S,
769
+ listType: T,
770
+ hide: V,
771
+ directory: j,
772
+ onDrop: q,
773
+ onDragOver: B,
774
+ onDragLeave: R
775
+ } = e;
776
+ return /* @__PURE__ */ E(z, { children: [
777
+ /* @__PURE__ */ n(
778
+ "input",
779
+ {
780
+ ref: s,
781
+ style: {
782
+ visibility: "hidden",
783
+ opacity: 0,
784
+ position: "fixed",
785
+ top: "-227px",
786
+ left: "-227px",
787
+ zIndex: -999999
788
+ },
789
+ type: "file",
790
+ accept: le(l) ? l == null ? void 0 : l.type : l,
791
+ multiple: d,
792
+ ...j ? { webkitdirectory: "true" } : {},
793
+ onChange: (f) => {
794
+ const $ = f.target.files;
795
+ $ && (g([].slice.call($)), s.current.value = "");
796
+ },
797
+ onClick: (f) => {
798
+ f.stopPropagation();
799
+ }
800
+ },
801
+ "trigger-input"
802
+ ),
803
+ /* @__PURE__ */ n(
804
+ ne,
805
+ {
806
+ in: !V,
807
+ timeout: 100,
808
+ unmountOnExit: !0,
809
+ classNames: "fadeIn",
810
+ children: /* @__PURE__ */ n(
811
+ Xe,
812
+ {
813
+ directory: j,
814
+ tip: a,
815
+ multiple: d,
816
+ accept: l,
817
+ disabled: L,
818
+ drag: S,
819
+ listType: T,
820
+ onDrop: q,
821
+ onDragOver: B,
822
+ onDragLeave: R,
823
+ onDragFiles: g,
824
+ onClick: () => {
825
+ var f, $;
826
+ !L && (($ = (f = s.current) == null ? void 0 : f.click) == null || $.call(f));
827
+ },
828
+ prefixCls: b,
829
+ children: O(m) ? m({ fileList: e.fileList }) : m
830
+ }
831
+ )
832
+ },
833
+ "trigger-node"
834
+ ),
835
+ a && T !== "picture-card" && !S ? /* @__PURE__ */ n("div", { className: `${b}-trigger-tip`, children: a }, "trigger-tip") : null
836
+ ] });
837
+ }
838
+ const Ze = te.forwardRef(Ye), ee = function(e) {
839
+ const c = [].concat(e || []).filter(Boolean);
840
+ return c.reduce((u, s, t) => {
841
+ if (s.uid) {
842
+ const r = c.findIndex(
843
+ (o) => s.uid === o.uid && s !== o
844
+ );
845
+ ue(r !== -1, "[Upload]: duplicate uid");
846
+ const i = {
847
+ status: I.success,
848
+ percent: 100,
849
+ ...s
850
+ };
851
+ r === -1 ? u.push(i) : u.splice(r, 1, i);
852
+ } else {
853
+ ue(!0, "[Upload]: uid is required");
854
+ const r = `${String(+/* @__PURE__ */ new Date())}${t}`;
855
+ u.push({
856
+ uid: r,
857
+ status: I.success,
858
+ percent: 100,
859
+ ...s
860
+ });
861
+ }
862
+ return u;
863
+ }, []);
864
+ }, pe = {
865
+ listType: "text",
866
+ autoUpload: !0,
867
+ showUploadList: !0,
868
+ beforeUpload: () => !0,
869
+ method: "post"
870
+ }, et = (e, c) => {
871
+ const { getPrefixCls: u, componentConfig: s, rtl: t } = M(W), r = we(
872
+ e,
873
+ pe,
874
+ s == null ? void 0 : s.Upload
875
+ ), i = u("upload"), o = ie(), v = ie(), [U, y] = A(() => "fileList" in r ? ee(r.fileList) : "defaultFileList" in r ? ee(r.defaultFileList) : []), x = "fileList" in r ? ee(r.fileList) : U, w = (h, C) => {
876
+ var N;
877
+ "fileList" in r || y(h), (N = r.onChange) == null || N.call(r, h, C);
878
+ }, g = (h) => {
879
+ h && setTimeout(() => {
880
+ o.current && o.current.upload(h);
881
+ }, 0);
882
+ }, l = (h) => {
883
+ var C;
884
+ o.current && o.current.reupload(h), (C = r.onReupload) == null || C.call(r, h);
885
+ }, d = (h) => {
886
+ if (h) {
887
+ const { onRemove: C } = r;
888
+ Promise.resolve(
889
+ O(C) ? C(h, x) : C
890
+ ).then((N) => {
891
+ N !== !1 && (o.current && o.current.abort(h), w(
892
+ x.filter((P) => P.uid !== h.uid),
893
+ h
894
+ ));
895
+ }).catch((N) => {
896
+ console.error(N);
897
+ });
898
+ }
899
+ }, m = (h) => {
900
+ h && o.current && o.current.abort(h);
901
+ };
902
+ he(c, () => ({
903
+ submit: (h) => {
904
+ let C = [];
905
+ h ? C = [h] : C = x.filter((N) => N.status === I.init), C.forEach((N) => {
906
+ g(N);
907
+ });
908
+ },
909
+ // file: fileList中的file对象
910
+ abort: (h) => {
911
+ m(h);
912
+ },
913
+ // file: fileList中的file对象
914
+ reupload: (h) => {
915
+ l(h);
916
+ },
917
+ getRootDOMNode: () => v.current
918
+ }));
919
+ const {
920
+ listType: b,
921
+ className: a,
922
+ style: L,
923
+ renderUploadItem: S,
924
+ showUploadList: T,
925
+ renderUploadList: V,
926
+ progressProps: j,
927
+ imagePreview: q,
928
+ ...B
929
+ } = r, R = ge(r.limit) ? { hideOnExceedLimit: !0, maxCount: r.limit } : { hideOnExceedLimit: !0, ...r.limit }, f = R.maxCount && R.maxCount <= x.length, $ = "disabled" in r ? r.disabled : !R.hideOnExceedLimit && f, F = /* @__PURE__ */ n(
930
+ "div",
931
+ {
932
+ ...Ce(B, [
933
+ "disabled",
934
+ "directory",
935
+ "onReupload",
936
+ "defaultFileList",
937
+ "fileList",
938
+ "autoUpload",
939
+ "error",
940
+ "action",
941
+ "method",
942
+ "multiple",
943
+ "name",
944
+ "accept",
945
+ "customRequest",
946
+ "children",
947
+ "autoUpload",
948
+ "limit",
949
+ "drag",
950
+ "tip",
951
+ "headers",
952
+ "data",
953
+ "withCredentials",
954
+ "onChange",
955
+ "onPreview",
956
+ "onRemove",
957
+ "onProgress",
958
+ "onExceedLimit",
959
+ "beforeUpload",
960
+ "onDrop",
961
+ "onDragOver",
962
+ "onDragLeave"
963
+ ]),
964
+ className: X(
965
+ i,
966
+ {
967
+ [`${i}-type-${b}`]: b,
968
+ [`${i}-drag`]: r.drag,
969
+ [`${i}-disabled`]: $,
970
+ [`${i}-hide`]: R.hideOnExceedLimit && f,
971
+ [`${i}-rtl`]: t
972
+ },
973
+ a
974
+ ),
975
+ style: L,
976
+ ref: v,
977
+ children: /* @__PURE__ */ n(
978
+ Ze,
979
+ {
980
+ ref: o,
981
+ ...r,
982
+ limit: R.maxCount,
983
+ hide: R.hideOnExceedLimit && f,
984
+ disabled: $,
985
+ prefixCls: i,
986
+ fileList: x,
987
+ onProgress: (h, C) => {
988
+ var N;
989
+ h && ("fileList" in r || y(
990
+ x.map((P) => P.uid === h.uid ? h : P)
991
+ ), (N = r.onProgress) == null || N.call(r, h, C));
992
+ },
993
+ onFileStatusChange: w
994
+ }
995
+ )
996
+ }
997
+ );
998
+ return /* @__PURE__ */ E(z, { children: [
999
+ b !== "picture-card" && F,
1000
+ T && /* @__PURE__ */ n(
1001
+ xe,
1002
+ {
1003
+ imagePreview: q,
1004
+ progressProps: j,
1005
+ showUploadList: T,
1006
+ disabled: r.disabled,
1007
+ listType: b,
1008
+ fileList: x,
1009
+ renderUploadItem: S,
1010
+ renderUploadList: V,
1011
+ onUpload: g,
1012
+ onAbort: m,
1013
+ onRemove: d,
1014
+ onReupload: l,
1015
+ onPreview: r.onPreview,
1016
+ prefixCls: i
1017
+ }
1018
+ ),
1019
+ b === "picture-card" && F,
1020
+ r.tip && b === "picture-card" && /* @__PURE__ */ n("div", { className: `${i}-trigger-tip`, children: r.tip })
1021
+ ] });
1022
+ }, tt = Q(
1023
+ et
1024
+ );
1025
+ tt.displayName = "Upload";
1026
+ export {
1027
+ xe as F,
1028
+ I as S,
1029
+ tt as U
1030
+ };