@para-ui/core 3.0.53 → 3.0.55

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 (407) hide show
  1. package/README.md +24 -0
  2. package/package.json +1 -1
  3. package/AutoBox/index.d.ts +0 -34
  4. package/AutoBox/index.js +0 -277
  5. package/AutoBox/protal.d.ts +0 -17
  6. package/AutoTips/autoTipsMultiline/index.d.ts +0 -18
  7. package/AutoTips/index.d.ts +0 -35
  8. package/AutoTips/index.js +0 -271
  9. package/Breadcrumbs/index.d.ts +0 -53
  10. package/Breadcrumbs/index.js +0 -266
  11. package/Breadcrumbs/lang/en_US.d.ts +0 -4
  12. package/Breadcrumbs/lang/index.d.ts +0 -9
  13. package/Breadcrumbs/lang/zh_CN.d.ts +0 -4
  14. package/Button/SplitButton.d.ts +0 -64
  15. package/Button/index.d.ts +0 -79
  16. package/Button/index.js +0 -376
  17. package/Button/lang/en_US.d.ts +0 -4
  18. package/Button/lang/index.d.ts +0 -9
  19. package/Button/lang/zh_CN.d.ts +0 -4
  20. package/ButtonGroup/index.d.ts +0 -33
  21. package/ButtonGroup/index.js +0 -124
  22. package/Carousel/index.d.ts +0 -38
  23. package/Carousel/index.js +0 -78
  24. package/Cascader/index.d.ts +0 -54
  25. package/Cascader/index.js +0 -159
  26. package/Cascader/lang/en_US.d.ts +0 -4
  27. package/Cascader/lang/index.d.ts +0 -9
  28. package/Cascader/lang/zh_CN.d.ts +0 -4
  29. package/Checkbox/index.d.ts +0 -40
  30. package/Checkbox/index.js +0 -109
  31. package/CheckboxGroup/index.d.ts +0 -45
  32. package/CheckboxGroup/index.js +0 -142
  33. package/Collapse/collapsePanel.d.ts +0 -30
  34. package/Collapse/index.d.ts +0 -57
  35. package/Collapse/index.js +0 -152
  36. package/Collapse/motion.d.ts +0 -5
  37. package/Collapse/util.d.ts +0 -11
  38. package/CollapseBox/index.d.ts +0 -27
  39. package/CollapseBox/index.js +0 -148
  40. package/CollapseBox/util.d.ts +0 -5
  41. package/CollapseLayout/index.d.ts +0 -53
  42. package/CollapseLayout/index.js +0 -176
  43. package/ColorPicker/index.d.ts +0 -4
  44. package/ColorPicker/index.js +0 -4
  45. package/ComboSelect/index.d.ts +0 -6
  46. package/ComboSelect/index.js +0 -1049
  47. package/ComboSelect/interface.d.ts +0 -146
  48. package/ComboSelect/lang/en_US.d.ts +0 -9
  49. package/ComboSelect/lang/index.d.ts +0 -19
  50. package/ComboSelect/lang/zh_CN.d.ts +0 -9
  51. package/ComboSelect/utils.d.ts +0 -9
  52. package/Container/index.d.ts +0 -77
  53. package/Container/index.js +0 -232
  54. package/DatePicker/PickerButton.d.ts +0 -3
  55. package/DatePicker/PickerTag.d.ts +0 -3
  56. package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
  57. package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
  58. package/DatePicker/generatePicker/index.d.ts +0 -95
  59. package/DatePicker/index.d.ts +0 -18
  60. package/DatePicker/index.js +0 -633
  61. package/DatePicker/lang/en_US.d.ts +0 -3
  62. package/DatePicker/lang/index.d.ts +0 -7
  63. package/DatePicker/lang/zh_CN.d.ts +0 -3
  64. package/DatePicker/util.d.ts +0 -22
  65. package/Desktop/index.d.ts +0 -57
  66. package/Desktop/index.js +0 -746
  67. package/DragVerify/index.d.ts +0 -36
  68. package/DragVerify/index.js +0 -385
  69. package/DragVerify/lang/en_US.d.ts +0 -5
  70. package/DragVerify/lang/index.d.ts +0 -11
  71. package/DragVerify/lang/zh_CN.d.ts +0 -5
  72. package/Drawer/index.d.ts +0 -11
  73. package/Drawer/index.js +0 -235
  74. package/Drawer/interface.d.ts +0 -92
  75. package/Drawer/lang/en_US.d.ts +0 -5
  76. package/Drawer/lang/index.d.ts +0 -11
  77. package/Drawer/lang/zh_CN.d.ts +0 -5
  78. package/Dropdown/index.d.ts +0 -40
  79. package/Dropdown/index.js +0 -10
  80. package/DynamicMultiBox/formItem.d.ts +0 -14
  81. package/DynamicMultiBox/index.d.ts +0 -5
  82. package/DynamicMultiBox/index.js +0 -1313
  83. package/DynamicMultiBox/interface.d.ts +0 -161
  84. package/DynamicMultiBox/rowForm.d.ts +0 -24
  85. package/Empty/images/index.d.ts +0 -3
  86. package/Empty/index.d.ts +0 -30
  87. package/Empty/index.js +0 -642
  88. package/Empty/lang/en_US.d.ts +0 -6
  89. package/Empty/lang/index.d.ts +0 -13
  90. package/Empty/lang/zh_CN.d.ts +0 -6
  91. package/Form/index.d.ts +0 -187
  92. package/Form/index.js +0 -355
  93. package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
  94. package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
  95. package/FormItem/compoments/formFile/index.d.ts +0 -38
  96. package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
  97. package/FormItem/compoments/formSelect/index.d.ts +0 -18
  98. package/FormItem/errorTips.d.ts +0 -12
  99. package/FormItem/index.d.ts +0 -152
  100. package/FormItem/index.js +0 -78
  101. package/FormItem/itemType.d.ts +0 -42
  102. package/FormItem/validateFunction.d.ts +0 -15
  103. package/FunctionModal/dialog.d.ts +0 -58
  104. package/FunctionModal/index.d.ts +0 -8
  105. package/FunctionModal/index.js +0 -43
  106. package/FunctionModal/modalContext.d.ts +0 -15
  107. package/GlobalContext/componentsProps.d.ts +0 -21
  108. package/GlobalContext/confirmLocale.d.ts +0 -7
  109. package/GlobalContext/constant.d.ts +0 -8
  110. package/GlobalContext/index.d.ts +0 -28
  111. package/GlobalContext/index.js +0 -41
  112. package/GlobalContext/intl.d.ts +0 -34
  113. package/GlobalContext/useFormatMessage.d.ts +0 -3
  114. package/GlobalContext/usePopupContainer.d.ts +0 -4
  115. package/Help/index.d.ts +0 -24
  116. package/Help/index.js +0 -41
  117. package/HelperText/index.d.ts +0 -27
  118. package/HelperText/index.js +0 -34
  119. package/Hooks/useGlobalProps.d.ts +0 -1
  120. package/InputLang/index.d.ts +0 -46
  121. package/InputLang/index.js +0 -247
  122. package/InputNumber/index.d.ts +0 -71
  123. package/InputNumber/index.js +0 -277
  124. package/Label/index.d.ts +0 -37
  125. package/Label/index.js +0 -85
  126. package/Loading/index.d.ts +0 -17
  127. package/Loading/index.js +0 -47
  128. package/Menu/footerExpansion.d.ts +0 -9
  129. package/Menu/index.d.ts +0 -10
  130. package/Menu/index.js +0 -1105
  131. package/Menu/interface.d.ts +0 -141
  132. package/Menu/logo.d.ts +0 -9
  133. package/Menu/verticalMenuList.d.ts +0 -14
  134. package/Message/index.d.ts +0 -99
  135. package/Message/index.js +0 -246
  136. package/Modal/Confirm/index.d.ts +0 -65
  137. package/Modal/index.d.ts +0 -99
  138. package/Modal/index.js +0 -421
  139. package/Modal/lang/en_US.d.ts +0 -5
  140. package/Modal/lang/index.d.ts +0 -11
  141. package/Modal/lang/zh_CN.d.ts +0 -5
  142. package/MultiBox/index.d.ts +0 -58
  143. package/MultiBox/index.js +0 -272
  144. package/MultiBox/lang/en_US.d.ts +0 -4
  145. package/MultiBox/lang/index.d.ts +0 -9
  146. package/MultiBox/lang/zh_CN.d.ts +0 -4
  147. package/Notification/index.d.ts +0 -74
  148. package/Notification/index.js +0 -252
  149. package/OperateBtn/index.d.ts +0 -59
  150. package/OperateBtn/index.js +0 -237
  151. package/OperateBtn/lang/en_US.d.ts +0 -4
  152. package/OperateBtn/lang/index.d.ts +0 -9
  153. package/OperateBtn/lang/zh_CN.d.ts +0 -4
  154. package/PageHeader/horizontalMeun.d.ts +0 -9
  155. package/PageHeader/horizontalMeunRight.d.ts +0 -9
  156. package/PageHeader/index.d.ts +0 -10
  157. package/PageHeader/index.js +0 -1050
  158. package/PageHeader/interface.d.ts +0 -169
  159. package/Pagination/index.d.ts +0 -46
  160. package/Pagination/index.js +0 -461
  161. package/Pagination/lang/en_US.d.ts +0 -8
  162. package/Pagination/lang/index.d.ts +0 -17
  163. package/Pagination/lang/zh_CN.d.ts +0 -8
  164. package/ParauiProvider/index.d.ts +0 -8
  165. package/ParauiProvider/index.js +0 -52
  166. package/PasswordRules/index.d.ts +0 -46
  167. package/PasswordRules/index.js +0 -113
  168. package/PopConfirm/index.d.ts +0 -61
  169. package/PopConfirm/index.js +0 -194
  170. package/PopConfirm/lang/en_US.d.ts +0 -5
  171. package/PopConfirm/lang/index.d.ts +0 -11
  172. package/PopConfirm/lang/zh_CN.d.ts +0 -5
  173. package/Popover/index.d.ts +0 -16
  174. package/Popover/index.js +0 -59
  175. package/Progress/Line.d.ts +0 -47
  176. package/Progress/Steps.d.ts +0 -17
  177. package/Progress/index.d.ts +0 -83
  178. package/Progress/index.js +0 -323
  179. package/Progress/utils.d.ts +0 -6
  180. package/Querying/images/index.d.ts +0 -3
  181. package/Querying/index.d.ts +0 -26
  182. package/Querying/index.js +0 -760
  183. package/Querying/lang/en_US.d.ts +0 -4
  184. package/Querying/lang/index.d.ts +0 -9
  185. package/Querying/lang/zh_CN.d.ts +0 -4
  186. package/Radio/index.d.ts +0 -38
  187. package/Radio/index.js +0 -97
  188. package/RadioGroup/index.d.ts +0 -46
  189. package/RadioGroup/index.js +0 -134
  190. package/Search/index.d.ts +0 -57
  191. package/Search/index.js +0 -208
  192. package/Select/index.d.ts +0 -93
  193. package/Select/index.js +0 -1146
  194. package/Select/lang/en_US.d.ts +0 -5
  195. package/Select/lang/index.d.ts +0 -11
  196. package/Select/lang/zh_CN.d.ts +0 -5
  197. package/SelectInput/index.d.ts +0 -12
  198. package/SelectInput/index.js +0 -55
  199. package/Selector/index.d.ts +0 -11
  200. package/Selector/index.js +0 -2175
  201. package/Selector/interface.d.ts +0 -432
  202. package/Selector/lang/en_US.d.ts +0 -11
  203. package/Selector/lang/index.d.ts +0 -23
  204. package/Selector/lang/zh_CN.d.ts +0 -11
  205. package/Selector/selectorData/index.d.ts +0 -10
  206. package/Selector/selectorMain/index.d.ts +0 -10
  207. package/Selector/selectorNode/index.d.ts +0 -10
  208. package/Selector/util.d.ts +0 -15
  209. package/SelectorPicker/index.d.ts +0 -53
  210. package/SelectorPicker/index.js +0 -444
  211. package/SelectorPicker/lang/en_US.d.ts +0 -5
  212. package/SelectorPicker/lang/index.d.ts +0 -11
  213. package/SelectorPicker/lang/zh_CN.d.ts +0 -5
  214. package/SingleBox/index.d.ts +0 -44
  215. package/SingleBox/index.js +0 -224
  216. package/SingleBox/lang/en_US.d.ts +0 -4
  217. package/SingleBox/lang/index.d.ts +0 -9
  218. package/SingleBox/lang/zh_CN.d.ts +0 -4
  219. package/Slider/index.d.ts +0 -14
  220. package/Slider/index.js +0 -119
  221. package/Slider/interface.d.ts +0 -102
  222. package/Split/index.d.ts +0 -7
  223. package/Split/index.js +0 -123
  224. package/Status/index.d.ts +0 -21
  225. package/Status/index.js +0 -37
  226. package/Stepper/icons.d.ts +0 -5
  227. package/Stepper/index.d.ts +0 -59
  228. package/Stepper/index.js +0 -97
  229. package/Switch/index.d.ts +0 -78
  230. package/Switch/index.js +0 -71
  231. package/Table/index.d.ts +0 -10
  232. package/Table/index.js +0 -2999
  233. package/Table/interface.d.ts +0 -346
  234. package/Table/lang/en_US.d.ts +0 -8
  235. package/Table/lang/index.d.ts +0 -17
  236. package/Table/lang/zh_CN.d.ts +0 -8
  237. package/Table/tableBody.d.ts +0 -9
  238. package/Table/tableBodyElement/index.d.ts +0 -15
  239. package/Table/tableBodyInterface.d.ts +0 -73
  240. package/Table/tableContainer/index.d.ts +0 -16
  241. package/Table/tableElement/index.d.ts +0 -17
  242. package/Table/tableHead.d.ts +0 -9
  243. package/Table/tableHeadElement/index.d.ts +0 -15
  244. package/Table/tableHeadInterface.d.ts +0 -37
  245. package/Table/tablePagination.d.ts +0 -9
  246. package/Table/tablePaginationInterface.d.ts +0 -27
  247. package/Table/tdElement/index.d.ts +0 -15
  248. package/Table/thElement/index.d.ts +0 -28
  249. package/Table/trElement/index.d.ts +0 -15
  250. package/Table/util.d.ts +0 -34
  251. package/Tabs/index.d.ts +0 -69
  252. package/Tabs/index.js +0 -205
  253. package/Tabs/lang/en_US.d.ts +0 -4
  254. package/Tabs/lang/index.d.ts +0 -9
  255. package/Tabs/lang/zh_CN.d.ts +0 -4
  256. package/Tag/TagGroup.d.ts +0 -66
  257. package/Tag/index.d.ts +0 -34
  258. package/Tag/index.js +0 -259
  259. package/TextEditor/common.d.ts +0 -11
  260. package/TextEditor/index.d.ts +0 -127
  261. package/TextEditor/index.js +0 -286
  262. package/TextField/index.d.ts +0 -90
  263. package/TextField/index.js +0 -611
  264. package/TimePicker/index.d.ts +0 -22
  265. package/TimePicker/index.js +0 -80
  266. package/TimePicker/locale/en_US.d.ts +0 -3
  267. package/TimePicker/locale/zh_CN.d.ts +0 -3
  268. package/TimePicker/style/index.d.ts +0 -1
  269. package/Timeline/TimelineItem.d.ts +0 -30
  270. package/Timeline/index.d.ts +0 -32
  271. package/Timeline/index.js +0 -148
  272. package/Title/index.d.ts +0 -30
  273. package/Title/index.js +0 -50
  274. package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
  275. package/ToggleButton/index.d.ts +0 -49
  276. package/ToggleButton/index.js +0 -193
  277. package/Tooltip/index.d.ts +0 -11
  278. package/Tooltip/index.js +0 -368
  279. package/Tooltip/interface.d.ts +0 -35
  280. package/Tooltip/utils.d.ts +0 -18
  281. package/Transfer/box.d.ts +0 -38
  282. package/Transfer/index.d.ts +0 -32
  283. package/Transfer/index.js +0 -611
  284. package/Transfer/lang/en_US.d.ts +0 -10
  285. package/Transfer/lang/index.d.ts +0 -21
  286. package/Transfer/lang/zh_CN.d.ts +0 -10
  287. package/Transfer/useClick.d.ts +0 -3
  288. package/Tree/OperateBar/index.d.ts +0 -13
  289. package/Tree/Tree.d.ts +0 -4
  290. package/Tree/index.d.ts +0 -5
  291. package/Tree/index.js +0 -38
  292. package/Tree/interface.d.ts +0 -210
  293. package/Tree/lang/en_US.d.ts +0 -8
  294. package/Tree/lang/index.d.ts +0 -17
  295. package/Tree/lang/zh_CN.d.ts +0 -8
  296. package/Tree/utils/closestPolyfill.d.ts +0 -0
  297. package/Tree/utils/tools.d.ts +0 -25
  298. package/Tree/utils/treeUtil.d.ts +0 -15
  299. package/Upload/Dragger/index.d.ts +0 -10
  300. package/Upload/ErroTip/index.d.ts +0 -13
  301. package/Upload/ImageUpload/index.d.ts +0 -16
  302. package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
  303. package/Upload/ImgCrop/constants.d.ts +0 -7
  304. package/Upload/ImgCrop/index.d.ts +0 -6
  305. package/Upload/ImgCrop/interface.d.ts +0 -48
  306. package/Upload/UploadList/index.d.ts +0 -5
  307. package/Upload/index.d.ts +0 -15
  308. package/Upload/index.js +0 -1446
  309. package/Upload/interface.d.ts +0 -136
  310. package/Upload/lang/en_US.d.ts +0 -12
  311. package/Upload/lang/index.d.ts +0 -25
  312. package/Upload/lang/zh_CN.d.ts +0 -12
  313. package/_verture/constant-66aa48a1.js +0 -10
  314. package/_verture/defineProperty-62acccfc.js +0 -34
  315. package/_verture/index-74f820ba.js +0 -1355
  316. package/_verture/index-77f9e0fb.js +0 -236
  317. package/_verture/index-9fd86055.js +0 -711
  318. package/_verture/index-a369ca3f.js +0 -4
  319. package/_verture/index-beef914f.js +0 -340
  320. package/_verture/index-e2881a53.js +0 -16
  321. package/_verture/intl-5cbb940c.js +0 -57
  322. package/_verture/modalContext-92bb0e16.js +0 -201
  323. package/_verture/slicedToArray-76060636.js +0 -43
  324. package/_verture/sortable.esm-49896035.js +0 -3791
  325. package/_verture/style-inject.es-300983ab.js +0 -28
  326. package/_verture/toConsumableArray-81040c9e.js +0 -19
  327. package/_verture/tslib.es6-55ed4bd2.js +0 -38
  328. package/_verture/typeof-498dd2b1.js +0 -11
  329. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
  330. package/_verture/useFormatMessage-703f8b20.js +0 -20
  331. package/_verture/useGlobalProps-1b846a65.js +0 -11
  332. package/_verture/usePopupContainer-87febeb9.js +0 -68
  333. package/_verture/util-7e1fb1e2.js +0 -18
  334. package/index.d.ts +0 -144
  335. package/index.js +0 -180
  336. package/umd/AutoBox.js +0 -43
  337. package/umd/AutoTips.js +0 -15
  338. package/umd/Breadcrumbs.js +0 -42
  339. package/umd/Button.js +0 -43
  340. package/umd/ButtonGroup.js +0 -43
  341. package/umd/Carousel.js +0 -6
  342. package/umd/Cascader.js +0 -43
  343. package/umd/Checkbox.js +0 -42
  344. package/umd/CheckboxGroup.js +0 -42
  345. package/umd/Collapse.js +0 -43
  346. package/umd/CollapseBox.js +0 -1
  347. package/umd/CollapseLayout.js +0 -29
  348. package/umd/ColorPicker.js +0 -1
  349. package/umd/ComboSelect.js +0 -42
  350. package/umd/Container.js +0 -1
  351. package/umd/DatePicker.js +0 -42
  352. package/umd/Desktop.js +0 -42
  353. package/umd/DragVerify.js +0 -28
  354. package/umd/Drawer.js +0 -43
  355. package/umd/Dropdown.js +0 -15
  356. package/umd/DynamicMultiBox.js +0 -54
  357. package/umd/Empty.js +0 -15
  358. package/umd/Form.js +0 -42
  359. package/umd/FormItem.js +0 -42
  360. package/umd/FunctionModal.js +0 -42
  361. package/umd/GlobalContext.js +0 -1
  362. package/umd/Help.js +0 -42
  363. package/umd/HelperText.js +0 -1
  364. package/umd/InputLang.js +0 -42
  365. package/umd/InputNumber.js +0 -42
  366. package/umd/Label.js +0 -42
  367. package/umd/Loading.js +0 -29
  368. package/umd/Menu.js +0 -29
  369. package/umd/Message.js +0 -30
  370. package/umd/Modal.js +0 -42
  371. package/umd/MultiBox.js +0 -42
  372. package/umd/Notification.js +0 -43
  373. package/umd/OperateBtn.js +0 -42
  374. package/umd/PageHeader.js +0 -42
  375. package/umd/Pagination.js +0 -42
  376. package/umd/ParauiProvider.js +0 -15
  377. package/umd/PasswordRules.js +0 -29
  378. package/umd/PopConfirm.js +0 -42
  379. package/umd/Popover.js +0 -15
  380. package/umd/Progress.js +0 -35
  381. package/umd/Querying.js +0 -15
  382. package/umd/Radio.js +0 -42
  383. package/umd/RadioGroup.js +0 -42
  384. package/umd/Search.js +0 -42
  385. package/umd/Select.js +0 -42
  386. package/umd/SelectInput.js +0 -42
  387. package/umd/Selector.js +0 -42
  388. package/umd/SelectorPicker.js +0 -42
  389. package/umd/SingleBox.js +0 -42
  390. package/umd/Slider.js +0 -15
  391. package/umd/Split.js +0 -1
  392. package/umd/Status.js +0 -1
  393. package/umd/Stepper.js +0 -42
  394. package/umd/Switch.js +0 -42
  395. package/umd/Table.js +0 -42
  396. package/umd/Tabs.js +0 -42
  397. package/umd/Tag.js +0 -43
  398. package/umd/TextEditor.js +0 -205
  399. package/umd/TextField.js +0 -42
  400. package/umd/TimePicker.js +0 -42
  401. package/umd/Timeline.js +0 -1
  402. package/umd/Title.js +0 -1
  403. package/umd/ToggleButton.js +0 -43
  404. package/umd/Tooltip.js +0 -15
  405. package/umd/Transfer.js +0 -49
  406. package/umd/Tree.js +0 -42
  407. package/umd/Upload.js +0 -56
package/Upload/index.js DELETED
@@ -1,1446 +0,0 @@
1
- import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
2
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-81040c9e.js';
3
- import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
4
- import { a as __awaiter, _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
5
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
- import { useState, useEffect, useRef, memo, forwardRef, useCallback, useImperativeHandle, useMemo } from 'react';
7
- import RcUpload from 'rc-upload';
8
- import UploadIcon from '@para-ui/icons/UploadFile';
9
- import LoadingIcon from '@para-ui/icons/Loading';
10
- import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
11
- import { r as regenerator } from '../_verture/index-beef914f.js';
12
- import Delete from '@para-ui/icons/Delete';
13
- import TextIcon from '@para-ui/icons/Text';
14
- import PhotoIcon from '@para-ui/icons/Photo';
15
- import clsx from 'clsx';
16
- import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-66aa48a1.js';
17
- import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
18
- import Forbid from '@para-ui/icons/Forbid';
19
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
20
- import EditOutline from '@para-ui/icons/EditOutline';
21
- import { Button } from '../Button/index.js';
22
- import { Slider } from '../Slider/index.js';
23
- import Cropper from 'react-easy-crop';
24
- import { Modal } from '../Modal/index.js';
25
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
26
- import '@para-ui/core/GlobalContext';
27
- import '@para-ui/icons/LoadingF';
28
- import '../Tooltip/index.js';
29
- import 'rc-tooltip';
30
- import 'rc-tooltip/lib/placements';
31
- import '@para-ui/icons/Down';
32
- import '../_verture/index-77f9e0fb.js';
33
- import 'rc-dropdown';
34
- import '../_verture/usePopupContainer-87febeb9.js';
35
- import 'dayjs';
36
- import '@paraview/lib';
37
- import 'rc-slider';
38
- import 'rc-dialog';
39
- import '@para-ui/icons/Close';
40
- import '../_verture/index-e2881a53.js';
41
- import 'react-dom';
42
- import '@para-ui/icons/CheckCircleF';
43
- import '@para-ui/icons/CloseCircleF';
44
- import '@para-ui/icons/WarningCircle';
45
- import '@para-ui/icons/WarningCircleF';
46
-
47
- var css_248z$4 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午3:08\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload-list-text .upload-list-item {\n margin-top: 8px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info {\n display: flex;\n align-items: center;\n padding: 0 8px;\n line-height: 28px;\n font-size: 14px;\n color: rgb(46, 55, 67);\n border-radius: 4px;\n transition: background-color 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon {\n line-height: 0;\n opacity: 1;\n transition: opacity 0.3s;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-fileicon svg {\n color: inherit;\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text-name {\n margin-left: 10px;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions {\n position: absolute;\n opacity: 0;\n visibility: hidden;\n line-height: 0;\n transition: opacity 0.3s;\n cursor: pointer;\n}\n.paraui-v3-upload-list-text .upload-list-item-info .upload-list-text .upload-list-actions svg {\n color: rgb(235, 96, 84);\n font-size: inherit;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-actions {\n visibility: visible;\n opacity: 1;\n}\n.paraui-v3-upload-list-text .upload-list-item-info:hover .upload-list-text .upload-list-fileicon-active {\n opacity: 0;\n}\n.paraui-v3-upload-list-picture {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item {\n position: relative;\n display: inline-block;\n width: 100px;\n height: 100px;\n margin-right: 16px;\n border-radius: 4px;\n cursor: default;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item::before {\n content: \" \";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-picture-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n font-size: 12px;\n line-height: 24px;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 0 0 4px 4px;\n color: rgb(255, 255, 255);\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n line-height: 0;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item .upload-list-actions svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly)::before {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly) .upload-list-actions {\n opacity: 1;\n}\n.paraui-v3-upload-list-picture .upload-list-picture-item:hover:not(.upload-list-picture-item-readonly) .upload-list-picture-name {\n opacity: 0;\n}";
48
- styleInject(css_248z$4);
49
-
50
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
51
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
52
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
53
- //UploadList
54
- var UploadList = function UploadList(props) {
55
- var _props$listType = props.listType,
56
- listType = _props$listType === void 0 ? 'text' : _props$listType,
57
- _props$items = props.items,
58
- items = _props$items === void 0 ? [] : _props$items,
59
- onRemove = props.onRemove,
60
- _props$showRemoveIcon = props.showRemoveIcon,
61
- showRemoveIcon = _props$showRemoveIcon === void 0 ? true : _props$showRemoveIcon,
62
- removeIcon = props.removeIcon,
63
- itemRender = props.itemRender,
64
- readonly = props.readonly;
65
- var _useState = useState([]),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- uploadList = _useState2[0],
68
- setUploadList = _useState2[1];
69
- //处理删除
70
- var handleRemove = function handleRemove(file, evt) {
71
- evt.stopPropagation();
72
- onRemove === null || onRemove === void 0 ? void 0 : onRemove(file);
73
- };
74
- //渲染列表actions
75
- var renderActions = function renderActions(file) {
76
- return showRemoveIcon && !readonly && jsx("span", Object.assign({
77
- className: 'upload-list-actions',
78
- onClick: function onClick(evt) {
79
- return handleRemove(file, evt);
80
- }
81
- }, {
82
- children: removeIcon || jsx(Delete, {})
83
- }));
84
- };
85
- //文件列表 text
86
- var renderFileListText = function renderFileListText() {
87
- if (!(uploadList === null || uploadList === void 0 ? void 0 : uploadList.length)) return null;
88
- return uploadList.map(function (file, idx) {
89
- var _a;
90
- if (itemRender)
91
- //自定义渲染
92
- return itemRender(file, uploadList);
93
- var isImage = !!((_a = file.type) === null || _a === void 0 ? void 0 : _a.includes('image/'));
94
- return jsx("div", Object.assign({
95
- className: 'upload-list-item'
96
- }, {
97
- children: jsx("div", Object.assign({
98
- className: 'upload-list-item-info'
99
- }, {
100
- children: jsxs("span", Object.assign({
101
- className: 'upload-list-text'
102
- }, {
103
- children: [jsx("span", Object.assign({
104
- className: clsx('upload-list-fileicon', showRemoveIcon && 'upload-list-fileicon-active')
105
- }, {
106
- children: isImage ? jsx(PhotoIcon, {}) : jsx(TextIcon, {})
107
- })), renderActions(file), jsx("span", Object.assign({
108
- className: "upload-list-text-name"
109
- }, {
110
- children: file.name
111
- }))]
112
- }))
113
- }))
114
- }), idx);
115
- });
116
- };
117
- //文件列表 picture-card
118
- var renderFileListPicture = function renderFileListPicture() {
119
- if (!(uploadList === null || uploadList === void 0 ? void 0 : uploadList.length)) return null;
120
- return uploadList.map(function (file, idx) {
121
- if (itemRender)
122
- //自定义渲染
123
- return itemRender(file, uploadList);
124
- return jsxs("div", Object.assign({
125
- className: "upload-list-picture-item ".concat(readonly ? 'upload-list-picture-item-readonly' : '')
126
- }, {
127
- children: [jsx("img", {
128
- src: file.dataUrl || file.url,
129
- alt: file.name
130
- }), jsx("span", Object.assign({
131
- className: 'upload-list-picture-name',
132
- title: file.name
133
- }, {
134
- children: file.name
135
- })), renderActions(file)]
136
- }), idx);
137
- });
138
- };
139
- //处理文件
140
- var handleFileFormat = function handleFileFormat() {
141
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
142
- var readerFileAsDataUrl, _iterator, _step, file, dataUrl;
143
- return regenerator.wrap(function _callee2$(_context2) {
144
- while (1) switch (_context2.prev = _context2.next) {
145
- case 0:
146
- if (items === null || items === void 0 ? void 0 : items.length) {
147
- _context2.next = 2;
148
- break;
149
- }
150
- return _context2.abrupt("return", setUploadList([]));
151
- case 2:
152
- //读取file as DataUrl
153
- readerFileAsDataUrl = function readerFileAsDataUrl(file) {
154
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
155
- return regenerator.wrap(function _callee$(_context) {
156
- while (1) switch (_context.prev = _context.next) {
157
- case 0:
158
- return _context.abrupt("return", new Promise(function (resolve) {
159
- var fileReader = new FileReader();
160
- if (file.originFileObj) {
161
- fileReader.onload = function () {
162
- resolve(fileReader.result);
163
- };
164
- fileReader.readAsDataURL(file.originFileObj);
165
- } else resolve('');
166
- }));
167
- case 1:
168
- case "end":
169
- return _context.stop();
170
- }
171
- }, _callee);
172
- }));
173
- };
174
- _iterator = _createForOfIteratorHelper(items);
175
- _context2.prev = 4;
176
- _iterator.s();
177
- case 6:
178
- if ((_step = _iterator.n()).done) {
179
- _context2.next = 15;
180
- break;
181
- }
182
- file = _step.value;
183
- if (!file.originFileObj) {
184
- _context2.next = 13;
185
- break;
186
- }
187
- _context2.next = 11;
188
- return readerFileAsDataUrl(file);
189
- case 11:
190
- dataUrl = _context2.sent;
191
- file.dataUrl = dataUrl;
192
- case 13:
193
- _context2.next = 6;
194
- break;
195
- case 15:
196
- _context2.next = 20;
197
- break;
198
- case 17:
199
- _context2.prev = 17;
200
- _context2.t0 = _context2["catch"](4);
201
- _iterator.e(_context2.t0);
202
- case 20:
203
- _context2.prev = 20;
204
- _iterator.f();
205
- return _context2.finish(20);
206
- case 23:
207
- setUploadList(_toConsumableArray(items));
208
- case 24:
209
- case "end":
210
- return _context2.stop();
211
- }
212
- }, _callee2, null, [[4, 17, 20, 23]]);
213
- }));
214
- };
215
- useEffect(function () {
216
- if (listType === 'picture-card') handleFileFormat();else setUploadList(function (pre) {
217
- if (items) return _toConsumableArray(items);
218
- return pre;
219
- });
220
- }, [items]);
221
- return jsx(Fragment, {
222
- children: listType === 'text' ? jsx("section", Object.assign({
223
- className: "".concat($prefixCls, "-upload-list-text")
224
- }, {
225
- children: renderFileListText()
226
- })) : jsx("section", Object.assign({
227
- className: "".concat($prefixCls, "-upload-list-picture")
228
- }, {
229
- children: renderFileListPicture()
230
- }))
231
- });
232
- };
233
-
234
- var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/15 下午7:12\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload-error {\n position: absolute;\n left: 0;\n top: 100%;\n margin-top: 12px;\n display: inline-flex;\n align-items: center;\n padding: 0 12px;\n line-height: 28px;\n background-color: #FDF6F5;\n color: rgb(235, 96, 84);\n font-size: 14px;\n white-space: nowrap;\n border-radius: 4px;\n z-index: 1;\n}\n.paraui-v3-upload-error svg {\n margin-right: 4px;\n font-size: inherit;\n color: inherit;\n}\n.paraui-v3-upload-error-image {\n margin-top: 8px;\n}\n.paraui-v3-upload-error-drag {\n top: 20px;\n left: 50%;\n margin-top: 0;\n transform: translateX(-50%);\n}";
235
- styleInject(css_248z$3);
236
-
237
- //error tip
238
- var ErrorTip = function ErrorTip(props) {
239
- return jsxs("div", Object.assign({
240
- className: clsx("".concat($prefixCls, "-upload-error"), props.className)
241
- }, {
242
- children: [jsx(Forbid, {}), props.message]
243
- }));
244
- };
245
-
246
- var en = {
247
- uploadError: 'Upload error',
248
- uploading: 'Uploading',
249
- clickUploadFile: 'Click to upload file',
250
- dragFileUpload: 'After downloading the template and completing the information, you can directly drag and drop the file here to upload it. Supported formats: XLS, XLSX...',
251
- add: 'Add',
252
- edit: 'Edit',
253
- disabled: 'Disabled',
254
- delete: 'Delete',
255
- editImage: 'Edit image'
256
- };
257
-
258
- var zh = {
259
- uploadError: '上传失败',
260
- uploading: '正在上传',
261
- clickUploadFile: '点击上传文件',
262
- dragFileUpload: '下载模板并完善信息后,可直接将文件拖拽到此处进行上传,支持格式:XLS、XLSX...',
263
- add: '新增',
264
- edit: '编辑',
265
- disabled: '禁用',
266
- delete: '删除',
267
- editImage: '编辑图片'
268
- };
269
-
270
- var localeJson = {
271
- zh: zh,
272
- en: en
273
- };
274
-
275
- var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午7:31\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload-image {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-upload-image .upload-image-select {\n position: relative;\n width: 100px;\n height: 100px;\n background-color: rgba(171, 176, 185, 0.12);\n border-radius: 4px;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-image .upload-image-select-loading {\n pointer-events: none;\n}\n.paraui-v3-upload-image .upload-image-select .component-upload {\n display: inline-block;\n width: 100%;\n height: 100%;\n}\n.paraui-v3-upload-image .upload-image-select:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-upload-image .upload-image-select:hover .upload-image-picture-card {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-upload-image .upload-image-picture-card {\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(46, 55, 67);\n font-size: 14px;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper::before {\n content: \" \";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n font-size: 12px;\n line-height: 24px;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 0 0 4px 4px;\n color: rgb(255, 255, 255);\n transition: 0.3s;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper-action {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n line-height: 0;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper-action svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper:hover::before {\n opacity: 1;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-name {\n opacity: 0;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-action {\n opacity: 1;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-image-icon {\n color: rgb(54, 102, 214);\n font-size: 30px;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-image-loading {\n color: rgb(54, 102, 214);\n font-size: 30px;\n animation: imageLoadingCircle 1s infinite linear;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-image-text {\n margin-top: 6px;\n color: inherit;\n transition: 0.3s;\n}\n.paraui-v3-upload-image .upload-image-picture-card .upload-image-text-loading {\n color: rgb(54, 102, 214);\n}\n@keyframes imageLoadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}";
276
- styleInject(css_248z$2);
277
-
278
- //ImageUpload
279
- var ImageUpload = function ImageUpload(props) {
280
- var className = props.className,
281
- style = props.style,
282
- _onStart = props.onStart,
283
- _onSuccess = props.onSuccess,
284
- _onError = props.onError,
285
- _onProgress = props.onProgress,
286
- onRemove = props.onRemove,
287
- _beforeUpload = props.beforeUpload,
288
- onChange = props.onChange,
289
- _props$defaultFileLis = props.defaultFileList,
290
- defaultFileList = _props$defaultFileLis === void 0 ? [] : _props$defaultFileLis,
291
- fileList = props.fileList,
292
- _props$showUploadList = props.showUploadList,
293
- showUploadList = _props$showUploadList === void 0 ? true : _props$showUploadList,
294
- maxCount = props.maxCount,
295
- _props$children = props.children,
296
- children = _props$children === void 0 ? null : _props$children,
297
- itemRender = props.itemRender,
298
- _props$showUploadErro = props.showUploadError,
299
- showUploadError = _props$showUploadErro === void 0 ? true : _props$showUploadErro,
300
- _props$stash = props.stash,
301
- stash = _props$stash === void 0 ? false : _props$stash,
302
- _props$uploading = props.uploading,
303
- uploading = _props$uploading === void 0 ? true : _props$uploading,
304
- _props$showLoading = props.showLoading,
305
- loading = _props$showLoading === void 0 ? true : _props$showLoading,
306
- defaultImage = props.defaultImage,
307
- readonly = props.readonly,
308
- restProps = __rest(props, ["className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "stash", "uploading", "showLoading", "defaultImage", "readonly"]);
309
- var intl = useFormatMessage('Upload', localeJson);
310
- var _useState = useState(defaultFileList),
311
- _useState2 = _slicedToArray(_useState, 2),
312
- uploadFileList = _useState2[0],
313
- setUploadFileList = _useState2[1]; //文件列表
314
- var _useState3 = useState(false),
315
- _useState4 = _slicedToArray(_useState3, 2),
316
- showLoading = _useState4[0],
317
- setShowLoading = _useState4[1]; //upload loading
318
- var _useState5 = useState(false),
319
- _useState6 = _slicedToArray(_useState5, 2),
320
- errTip = _useState6[0],
321
- setErrTip = _useState6[1]; //upload error tip
322
- var _useState7 = useState({
323
- imageUrl: ''
324
- }),
325
- _useState8 = _slicedToArray(_useState7, 2),
326
- avatar = _useState8[0],
327
- setAvatar = _useState8[1]; //不显示列表时上传头像
328
- var _ref = typeof showUploadList === 'boolean' ? {} : showUploadList,
329
- showRemoveIcon = _ref.showRemoveIcon,
330
- removeIcon = _ref.removeIcon; //显示上传列表
331
- var _ref2 = typeof showUploadError === 'boolean' ? {} : showUploadError,
332
- _ref2$uploadErrorMsg = _ref2.uploadErrorMsg,
333
- uploadErrorMsg = _ref2$uploadErrorMsg === void 0 ? intl({
334
- id: 'uploadError'
335
- }) : _ref2$uploadErrorMsg,
336
- _ref2$leaveDelay = _ref2.leaveDelay,
337
- leaveDelay = _ref2$leaveDelay === void 0 ? 2000 : _ref2$leaveDelay; //错误信息提示
338
- var cropFileRef = useRef(); //裁剪文件
339
- //复写属性
340
- var overrideProps = Object.assign(Object.assign({
341
- accept: 'image/*'
342
- }, restProps), {
343
- beforeUpload: function beforeUpload(file, fileList) {
344
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
345
- var result;
346
- return regenerator.wrap(function _callee$(_context) {
347
- while (1) switch (_context.prev = _context.next) {
348
- case 0:
349
- if (restProps.action && loading && uploading) setShowLoading(true);
350
- _context.next = 3;
351
- return _beforeUpload === null || _beforeUpload === void 0 ? void 0 : _beforeUpload(file, fileList);
352
- case 3:
353
- result = _context.sent;
354
- if (!(result === false)) {
355
- _context.next = 9;
356
- break;
357
- }
358
- setShowLoading(false);
359
- return _context.abrupt("return", false);
360
- case 9:
361
- if (!(_typeof(result) === 'object' && result)) {
362
- _context.next = 16;
363
- break;
364
- }
365
- if (!(result instanceof File || result instanceof Blob)) {
366
- _context.next = 12;
367
- break;
368
- }
369
- return _context.abrupt("return", result);
370
- case 12:
371
- cropFileRef.current = result.cropFile;
372
- return _context.abrupt("return", result.isUpload);
373
- case 16:
374
- return _context.abrupt("return", true);
375
- case 17:
376
- case "end":
377
- return _context.stop();
378
- }
379
- }, _callee);
380
- }));
381
- },
382
- onStart: function onStart(file) {
383
- _onStart === null || _onStart === void 0 ? void 0 : _onStart(file);
384
- },
385
- onSuccess: function onSuccess(response, file, xhr) {
386
- setShowLoading(false);
387
- errTip && showErrTip(false);
388
- var nextFileList = updateFileList(file);
389
- onInternalChange(nextFileList);
390
- _onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess(response, file, xhr);
391
- },
392
- onError: function onError(error, response, file) {
393
- setShowLoading(false);
394
- showErrTip(!!showUploadError);
395
- _onError === null || _onError === void 0 ? void 0 : _onError(error, response, file);
396
- },
397
- onProgress: function onProgress(e, file) {
398
- _onProgress === null || _onProgress === void 0 ? void 0 : _onProgress(e, file);
399
- },
400
- onBatchStart: function onBatchStart(fileList) {
401
- if (stash) {
402
- if (cropFileRef.current) {
403
- var idx = fileList.findIndex(function (_) {
404
- var _a;
405
- return _.file.uid === ((_a = cropFileRef.current) === null || _a === void 0 ? void 0 : _a.uid);
406
- });
407
- if (idx > -1) {
408
- fileList.splice(idx, 1, {
409
- file: cropFileRef.current,
410
- parsedFile: cropFileRef.current
411
- });
412
- }
413
- }
414
- var arr = fileList.map(function (_) {
415
- return _.parsedFile || _.file;
416
- });
417
- var mList = mergedFileList(arr);
418
- onInternalChange(mList);
419
- }
420
- }
421
- });
422
- //内部变化
423
- var onInternalChange = function onInternalChange(changedFileList) {
424
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
425
- var cloneList, file, imageUrl;
426
- return regenerator.wrap(function _callee2$(_context2) {
427
- while (1) switch (_context2.prev = _context2.next) {
428
- case 0:
429
- cloneList = _toConsumableArray(changedFileList);
430
- if (showUploadList) {
431
- _context2.next = 13;
432
- break;
433
- }
434
- //不显示上传列表
435
- file = cloneList.slice(-1)[0];
436
- if (!file) {
437
- _context2.next = 11;
438
- break;
439
- }
440
- _context2.next = 6;
441
- return readerFileAsDataUrl(file);
442
- case 6:
443
- imageUrl = _context2.sent;
444
- file.dataUrl = imageUrl;
445
- avatar.imageUrl = imageUrl;
446
- avatar.imageName = file.name;
447
- setAvatar(Object.assign({}, avatar));
448
- case 11:
449
- onChange === null || onChange === void 0 ? void 0 : onChange([file]);
450
- return _context2.abrupt("return");
451
- case 13:
452
- if (maxCount === 1) {
453
- cloneList = cloneList.slice(-1);
454
- } else if (maxCount) {
455
- cloneList = cloneList.slice(0, maxCount);
456
- }
457
- onChange === null || onChange === void 0 ? void 0 : onChange(cloneList);
458
- setUploadFileList(cloneList);
459
- case 16:
460
- case "end":
461
- return _context2.stop();
462
- }
463
- }, _callee2);
464
- }));
465
- };
466
- //更新文件列表
467
- var updateFileList = function updateFileList(file) {
468
- var cloneList = _toConsumableArray(uploadFileList);
469
- var fileObj = Object.assign(Object.assign({}, file), {
470
- lastModified: file.lastModified,
471
- lastModifiedDate: file.lastModifiedDate,
472
- name: file.name,
473
- size: file.size,
474
- type: file.type,
475
- uid: file.uid,
476
- originFileObj: file
477
- });
478
- return cloneList.concat(fileObj);
479
- };
480
- //合并文件列表
481
- var mergedFileList = function mergedFileList(fileList) {
482
- var cloneList = _toConsumableArray(uploadFileList);
483
- var newFileList = fileList.map(function (file) {
484
- return Object.assign(Object.assign({}, file), {
485
- lastModified: file.lastModified,
486
- lastModifiedDate: file.lastModifiedDate,
487
- name: file.name,
488
- size: file.size,
489
- type: file.type,
490
- uid: file.uid,
491
- originFileObj: file
492
- });
493
- });
494
- return cloneList.concat(newFileList);
495
- };
496
- //删除文件
497
- var handleRemove = function handleRemove(file) {
498
- Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(function (ret) {
499
- // Prevent removing file
500
- if (ret === false) return;
501
- var idx = uploadFileList.findIndex(function (_) {
502
- return _.uid === file.uid;
503
- });
504
- if (idx > -1) uploadFileList.splice(idx, 1);
505
- onInternalChange(uploadFileList);
506
- });
507
- };
508
- //读取dataUrl
509
- var readerFileAsDataUrl = function readerFileAsDataUrl(file) {
510
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee3() {
511
- return regenerator.wrap(function _callee3$(_context3) {
512
- while (1) switch (_context3.prev = _context3.next) {
513
- case 0:
514
- return _context3.abrupt("return", new Promise(function (resolve) {
515
- var fileReader = new FileReader();
516
- if (file.originFileObj) {
517
- fileReader.onload = function () {
518
- resolve(fileReader.result);
519
- };
520
- fileReader.readAsDataURL(file.originFileObj);
521
- } else resolve('');
522
- }));
523
- case 1:
524
- case "end":
525
- return _context3.stop();
526
- }
527
- }, _callee3);
528
- }));
529
- };
530
- //显示错误提示
531
- var showErrTip = function showErrTip(flag) {
532
- setErrTip(flag);
533
- if (leaveDelay < 0) return;
534
- setTimeout(function () {
535
- setErrTip(false);
536
- }, leaveDelay);
537
- };
538
- useEffect(function () {
539
- if (fileList) {
540
- setUploadFileList(_toConsumableArray(fileList));
541
- }
542
- }, [fileList]);
543
- useEffect(function () {
544
- if (defaultImage) {
545
- setAvatar(Object.assign({}, defaultImage));
546
- }
547
- }, [defaultImage]);
548
- //渲染上传列表
549
- var renderUploadList = function renderUploadList() {
550
- return showUploadList && jsx(UploadList, {
551
- listType: 'picture-card',
552
- readonly: readonly,
553
- items: uploadFileList,
554
- showRemoveIcon: showRemoveIcon,
555
- removeIcon: removeIcon,
556
- onRemove: handleRemove,
557
- itemRender: itemRender
558
- });
559
- };
560
- //渲染内容
561
- var renderUploadContent = function renderUploadContent() {
562
- var _a;
563
- if (!showUploadList && avatar.imageUrl && !showLoading) {
564
- return jsxs("div", Object.assign({
565
- className: 'upload-img-wrapper'
566
- }, {
567
- children: [jsx("img", {
568
- src: avatar.imageUrl,
569
- alt: (_a = avatar.imageName) !== null && _a !== void 0 ? _a : ''
570
- }), avatar.imageName && jsx("span", Object.assign({
571
- className: "upload-img-wrapper-name"
572
- }, {
573
- children: avatar.imageName
574
- })), jsx("span", Object.assign({
575
- className: 'upload-img-wrapper-action'
576
- }, {
577
- children: jsx(EditOutline, {})
578
- }))]
579
- }));
580
- }
581
- return jsxs(Fragment, {
582
- children: [showLoading ? jsx(LoadingIcon, {
583
- className: 'upload-image-loading'
584
- }) : jsx(UploadIcon, {
585
- className: 'upload-image-icon'
586
- }), jsx("span", Object.assign({
587
- className: clsx('upload-image-text', showLoading && 'upload-image-text-loading')
588
- }, {
589
- children: showLoading ? intl({
590
- id: 'uploading'
591
- }) : children
592
- }))]
593
- });
594
- };
595
- //渲染上传控件
596
- var renderUploadSelector = function renderUploadSelector() {
597
- if (readonly) return null;
598
- return jsxs("div", Object.assign({
599
- className: clsx('upload-image-select', showLoading && 'upload-image-select-loading')
600
- }, {
601
- children: [jsx(RcUpload, Object.assign({}, overrideProps, {
602
- prefixCls: "".concat($rcPrefixCls, "-upload")
603
- }, {
604
- children: jsx("div", Object.assign({
605
- className: 'upload-image-picture-card'
606
- }, {
607
- children: renderUploadContent()
608
- }))
609
- })), errTip && jsx(ErrorTip, {
610
- message: uploadErrorMsg,
611
- className: "".concat($prefixCls, "-upload-error-image")
612
- })]
613
- }));
614
- };
615
- return jsxs("div", Object.assign({
616
- className: clsx("".concat($prefixCls, "-upload-image"), className),
617
- style: style
618
- }, {
619
- children: [renderUploadList(), renderUploadSelector()]
620
- }));
621
- };
622
-
623
- //Dragger upload
624
- var Dragger = function Dragger(props) {
625
- return jsx(Upload, Object.assign({}, props, {
626
- type: 'drag'
627
- }));
628
- };
629
-
630
- var PREFIX = "".concat($prefixCls, "-img-crop");
631
- var INIT_ZOOM = 1;
632
- var ZOOM_STEP = 0.1;
633
- var INIT_ROTATE = 0;
634
- var ROTATE_STEP = 1;
635
- var MIN_ROTATE = -180;
636
- var MAX_ROTATE = 180;
637
-
638
- var EasyCrop = /*#__PURE__*/forwardRef(function (props, ref) {
639
- var cropperRef = props.cropperRef,
640
- image = props.image,
641
- aspect = props.aspect,
642
- shape = props.shape,
643
- grid = props.grid,
644
- zoom = props.zoom,
645
- rotate = props.rotate,
646
- minZoom = props.minZoom,
647
- maxZoom = props.maxZoom,
648
- fixedCropSize = props.fixedCropSize,
649
- cropperProps = props.cropperProps;
650
- var _useState = useState({
651
- x: 0,
652
- y: 0
653
- }),
654
- _useState2 = _slicedToArray(_useState, 2),
655
- crop = _useState2[0],
656
- onCropChange = _useState2[1]; //裁剪变化
657
- var _useState3 = useState({
658
- width: 0,
659
- height: 0
660
- }),
661
- _useState4 = _slicedToArray(_useState3, 2),
662
- cropSize = _useState4[0],
663
- setCropSize = _useState4[1]; //裁剪大小
664
- var _useState5 = useState(INIT_ZOOM),
665
- _useState6 = _slicedToArray(_useState5, 2),
666
- zoomVal = _useState6[0],
667
- setZoomVal = _useState6[1]; //缩放值
668
- var _useState7 = useState(INIT_ROTATE),
669
- _useState8 = _slicedToArray(_useState7, 2),
670
- rotateVal = _useState8[0],
671
- setRotateVal = _useState8[1]; //旋转值
672
- var cropPixelsRef = useRef({
673
- width: 0,
674
- height: 0,
675
- x: 0,
676
- y: 0
677
- }); //裁剪区域
678
- //media 加载完成回调
679
- var onMediaLoaded = useCallback(function (mediaSize) {
680
- if (fixedCropSize) return;
681
- var width = mediaSize.width,
682
- height = mediaSize.height;
683
- var ratioWidth = height * aspect;
684
- if (width > ratioWidth) {
685
- setCropSize({
686
- width: ratioWidth,
687
- height: height
688
- });
689
- } else {
690
- setCropSize({
691
- width: width,
692
- height: width / aspect
693
- });
694
- }
695
- }, [aspect]);
696
- //裁剪完成回调
697
- var onCropComplete = useCallback(function (croppedArea, croppedAreaPixels) {
698
- cropPixelsRef.current = croppedAreaPixels;
699
- }, []);
700
- //ref 暴露方法
701
- useImperativeHandle(ref, function () {
702
- return {
703
- rotateVal: rotateVal,
704
- setZoomVal: setZoomVal,
705
- setRotateVal: setRotateVal,
706
- cropPixelsRef: cropPixelsRef
707
- };
708
- }, [rotateVal]);
709
- return jsxs(Fragment, {
710
- children: [jsx(Cropper, Object.assign({}, cropperProps, {
711
- ref: cropperRef,
712
- image: image,
713
- crop: crop,
714
- cropSize: !fixedCropSize ? cropSize : fixedCropSize,
715
- onCropChange: onCropChange,
716
- aspect: aspect,
717
- cropShape: shape,
718
- showGrid: grid,
719
- zoomWithScroll: zoom,
720
- zoom: zoomVal,
721
- rotation: rotateVal,
722
- onZoomChange: setZoomVal,
723
- onRotationChange: setRotateVal,
724
- minZoom: minZoom,
725
- maxZoom: maxZoom,
726
- onMediaLoaded: onMediaLoaded,
727
- onCropComplete: onCropComplete,
728
- classes: {
729
- containerClassName: "".concat(PREFIX, "-container"),
730
- mediaClassName: "".concat(PREFIX, "-media")
731
- }
732
- })), zoom && jsxs("section", Object.assign({
733
- className: "".concat(PREFIX, "-control ").concat(PREFIX, "-control-zoom")
734
- }, {
735
- children: [jsx("button", Object.assign({
736
- onClick: function onClick() {
737
- return setZoomVal(zoomVal - ZOOM_STEP);
738
- },
739
- disabled: zoomVal - ZOOM_STEP < minZoom
740
- }, {
741
- children: "\uFF0D"
742
- })), jsx(Slider, {
743
- min: minZoom,
744
- max: maxZoom,
745
- step: ZOOM_STEP,
746
- value: zoomVal,
747
- onChange: setZoomVal
748
- }), jsx("button", Object.assign({
749
- onClick: function onClick() {
750
- return setZoomVal(zoomVal + ZOOM_STEP);
751
- },
752
- disabled: zoomVal + ZOOM_STEP > maxZoom
753
- }, {
754
- children: "\uFF0B"
755
- }))]
756
- })), rotate && jsxs("section", Object.assign({
757
- className: "".concat(PREFIX, "-control ").concat(PREFIX, "-control-rotate")
758
- }, {
759
- children: [jsx("button", Object.assign({
760
- onClick: function onClick() {
761
- return setRotateVal(rotateVal - ROTATE_STEP);
762
- },
763
- disabled: rotateVal === MIN_ROTATE
764
- }, {
765
- children: "\u21BA"
766
- })), jsx(Slider, {
767
- min: MIN_ROTATE,
768
- max: MAX_ROTATE,
769
- step: ROTATE_STEP,
770
- value: rotateVal,
771
- onChange: setRotateVal
772
- }), jsx("button", Object.assign({
773
- onClick: function onClick() {
774
- return setRotateVal(rotateVal + ROTATE_STEP);
775
- },
776
- disabled: rotateVal === MAX_ROTATE
777
- }, {
778
- children: "\u21BB"
779
- }))]
780
- }))]
781
- });
782
- });
783
- var EasyCrop$1 = /*#__PURE__*/memo(EasyCrop);
784
-
785
- var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/4/20 下午4:44\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-container {\n position: relative;\n width: 100%;\n height: 40vh;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control {\n display: flex;\n align-items: center;\n width: 60%;\n margin-left: auto;\n margin-right: auto;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control:first-of-type {\n margin-top: 16px;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control:last-of-type {\n margin-bottom: -8px;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 34px;\n height: 34px;\n padding: 0;\n font-style: normal;\n background: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control button[disabled] {\n cursor: default;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control button + div:only-of-type {\n flex: 1;\n margin: 0 8px;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control-zoom button {\n font-size: 18px;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control-rotate button {\n font-size: 16px;\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control-rotate button:first-of-type {\n transform: rotate(-20deg);\n}\n.paraui-v3-img-crop-modal .paraui-v3-img-crop-control-rotate button:last-of-type {\n transform: rotate(20deg);\n}";
786
- styleInject(css_248z$1);
787
-
788
- //图片裁剪组件
789
- var ImgCrop = /*#__PURE__*/forwardRef(function (props, ref) {
790
- var _props$aspect = props.aspect,
791
- aspect = _props$aspect === void 0 ? 1 : _props$aspect,
792
- _props$shape = props.shape,
793
- shape = _props$shape === void 0 ? 'rect' : _props$shape,
794
- _props$grid = props.grid,
795
- grid = _props$grid === void 0 ? false : _props$grid,
796
- _props$quality = props.quality,
797
- quality = _props$quality === void 0 ? 0.4 : _props$quality,
798
- _props$fillColor = props.fillColor,
799
- fillColor = _props$fillColor === void 0 ? 'transparent' : _props$fillColor,
800
- _props$zoom = props.zoom,
801
- zoom = _props$zoom === void 0 ? true : _props$zoom,
802
- _props$rotate = props.rotate,
803
- rotate = _props$rotate === void 0 ? false : _props$rotate,
804
- _props$minZoom = props.minZoom,
805
- minZoom = _props$minZoom === void 0 ? 1 : _props$minZoom,
806
- _props$maxZoom = props.maxZoom,
807
- maxZoom = _props$maxZoom === void 0 ? 3 : _props$maxZoom,
808
- modalTitle = props.modalTitle,
809
- modalWidth = props.modalWidth,
810
- modalOk = props.modalOk,
811
- modalCancel = props.modalCancel,
812
- onModalOk = props.onModalOk,
813
- onModalCancel = props.onModalCancel,
814
- beforeCrop = props.beforeCrop,
815
- onUploadFail = props.onUploadFail,
816
- cropperProps = props.cropperProps,
817
- children = props.children,
818
- _props$fixedCropSize = props.fixedCropSize,
819
- fixedCropSize = _props$fixedCropSize === void 0 ? {
820
- width: 120,
821
- height: 120
822
- } : _props$fixedCropSize;
823
- var intl = useFormatMessage('Upload', localeJson);
824
- var _useState = useState(''),
825
- _useState2 = _slicedToArray(_useState, 2),
826
- image = _useState2[0],
827
- setImage = _useState2[1];
828
- var fileRef = useRef();
829
- var beforeUploadRef = useRef();
830
- var resolveRef = useRef();
831
- var rejectRef = useRef();
832
- //存储回调
833
- var cbRef = useRef({});
834
- cbRef.current.onModalOk = onModalOk;
835
- cbRef.current.onModalCancel = onModalCancel;
836
- cbRef.current.beforeCrop = beforeCrop;
837
- cbRef.current.onUploadFail = onUploadFail;
838
- var easyCropRef = useRef({});
839
- //上传组件
840
- var uploadComponent = useMemo(function () {
841
- var upload = Array.isArray(children) ? children[0] : children;
842
- var _a = upload.props,
843
- beforeUpload = _a.beforeUpload,
844
- accept = _a.accept,
845
- restUploadProps = __rest(_a, ["beforeUpload", "accept"]);
846
- beforeUploadRef.current = beforeUpload;
847
- return Object.assign(Object.assign({}, upload), {
848
- props: Object.assign(Object.assign({}, restUploadProps), {
849
- accept: accept || 'image/*',
850
- beforeUpload: function beforeUpload(file, fileList) {
851
- return new Promise(function (resolve, reject) {
852
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
853
- var reader;
854
- return regenerator.wrap(function _callee$(_context) {
855
- while (1) switch (_context.prev = _context.next) {
856
- case 0:
857
- _context.t0 = cbRef.current.beforeCrop;
858
- if (!_context.t0) {
859
- _context.next = 5;
860
- break;
861
- }
862
- _context.next = 4;
863
- return cbRef.current.beforeCrop(file, fileList);
864
- case 4:
865
- _context.t0 = !_context.sent;
866
- case 5:
867
- if (!_context.t0) {
868
- _context.next = 8;
869
- break;
870
- }
871
- reject();
872
- return _context.abrupt("return");
873
- case 8:
874
- fileRef.current = file;
875
- resolveRef.current = function (newFile) {
876
- var flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
877
- var _a, _b;
878
- (_b = (_a = cbRef.current).onModalOk) === null || _b === void 0 ? void 0 : _b.call(_a, newFile);
879
- if (!flag) return resolve({
880
- cropFile: newFile,
881
- isUpload: flag
882
- });
883
- resolve(newFile);
884
- };
885
- rejectRef.current = function (uploadErr) {
886
- var _a, _b;
887
- (_b = (_a = cbRef.current).onUploadFail) === null || _b === void 0 ? void 0 : _b.call(_a, uploadErr);
888
- reject(uploadErr);
889
- };
890
- reader = new FileReader();
891
- reader.addEventListener('load', function () {
892
- return typeof reader.result === 'string' && setImage(reader.result);
893
- });
894
- reader.readAsDataURL(file);
895
- case 14:
896
- case "end":
897
- return _context.stop();
898
- }
899
- }, _callee);
900
- }));
901
- });
902
- }
903
- })
904
- });
905
- }, [children]);
906
- //modal 关闭后操作
907
- var onClose = function onClose() {
908
- setImage('');
909
- easyCropRef.current.setZoomVal(INIT_ZOOM);
910
- easyCropRef.current.setRotateVal(INIT_ROTATE);
911
- };
912
- //modal cancel
913
- var onCancel = useCallback(function () {
914
- var _a, _b;
915
- (_b = (_a = cbRef.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a);
916
- onClose();
917
- }, []);
918
- //modal ok
919
- var onOk = useCallback(function () {
920
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee3() {
921
- var canvas, ctx, imgSource, _easyCropRef$current$, cropWidth, cropHeight, cropX, cropY, imgWidth, imgHeight, angle, sine, cosine, squareWidth, squareHeight, squareHalfWidth, squareHalfHeight, imgX, imgY, imgData, changeImageSizeAfterCrop, _fileRef$current, type, name, uid, idx, onBlob;
922
- return regenerator.wrap(function _callee3$(_context3) {
923
- while (1) switch (_context3.prev = _context3.next) {
924
- case 0:
925
- onClose();
926
- canvas = document.createElement('canvas');
927
- ctx = canvas.getContext('2d');
928
- imgSource = document.querySelector(".".concat(PREFIX, "-media"));
929
- _easyCropRef$current$ = easyCropRef.current.cropPixelsRef.current, cropWidth = _easyCropRef$current$.width, cropHeight = _easyCropRef$current$.height, cropX = _easyCropRef$current$.x, cropY = _easyCropRef$current$.y;
930
- if (rotate && easyCropRef.current.rotateVal !== INIT_ROTATE) {
931
- imgWidth = imgSource.naturalWidth, imgHeight = imgSource.naturalHeight;
932
- angle = easyCropRef.current.rotateVal * (Math.PI / 180); // get container for rotated image
933
- sine = Math.abs(Math.sin(angle));
934
- cosine = Math.abs(Math.cos(angle));
935
- squareWidth = imgWidth * cosine + imgHeight * sine;
936
- squareHeight = imgHeight * cosine + imgWidth * sine;
937
- canvas.width = squareWidth;
938
- canvas.height = squareHeight;
939
- ctx.fillStyle = fillColor;
940
- ctx.fillRect(0, 0, squareWidth, squareHeight);
941
- // rotate container
942
- squareHalfWidth = squareWidth / 2;
943
- squareHalfHeight = squareHeight / 2;
944
- ctx.translate(squareHalfWidth, squareHalfHeight);
945
- ctx.rotate(angle);
946
- ctx.translate(-squareHalfWidth, -squareHalfHeight);
947
- // draw rotated image
948
- imgX = (squareWidth - imgWidth) / 2;
949
- imgY = (squareHeight - imgHeight) / 2;
950
- ctx.drawImage(imgSource, 0, 0, imgWidth, imgHeight, imgX, imgY, imgWidth, imgHeight);
951
- // crop rotated image
952
- imgData = ctx.getImageData(0, 0, squareWidth, squareHeight);
953
- canvas.width = cropWidth;
954
- canvas.height = cropHeight;
955
- ctx.putImageData(imgData, -cropX, -cropY);
956
- } else {
957
- canvas.width = cropWidth;
958
- canvas.height = cropHeight;
959
- ctx.fillStyle = fillColor;
960
- ctx.fillRect(0, 0, cropWidth, cropHeight);
961
- ctx.drawImage(imgSource, cropX, cropY, cropWidth, cropHeight, 0, 0, cropWidth, cropHeight);
962
- }
963
- //裁剪之后改变图片大小
964
- changeImageSizeAfterCrop = function changeImageSizeAfterCrop(newFile) {
965
- return new Promise(function (resolve) {
966
- var name = newFile.name,
967
- type = newFile.type,
968
- uid = newFile.uid;
969
- var width = fixedCropSize.width,
970
- height = fixedCropSize.height; //固定裁剪大小
971
- var changeCanvas = document.createElement('canvas');
972
- var changeCtx = changeCanvas.getContext('2d');
973
- var img = new Image();
974
- img.onload = function () {
975
- changeCanvas.width = width;
976
- changeCanvas.height = height;
977
- changeCtx.drawImage(img, 0, 0, width, height);
978
- changeCanvas.toBlob(function (cBlob) {
979
- var changeFile = Object.assign(new File([cBlob], name, {
980
- type: type
981
- }), {
982
- uid: uid
983
- });
984
- resolve(changeFile);
985
- }, type, quality);
986
- };
987
- img.onerror = function () {
988
- resolve(newFile);
989
- };
990
- var fileReader = new FileReader();
991
- fileReader.onload = function () {
992
- img.src = fileReader.result;
993
- };
994
- fileReader.onerror = function () {
995
- resolve(newFile);
996
- };
997
- fileReader.readAsDataURL(newFile);
998
- });
999
- }; // get the new image
1000
- _fileRef$current = fileRef.current, type = _fileRef$current.type, name = _fileRef$current.name, uid = _fileRef$current.uid;
1001
- if (/svg/ig.test(type)) {
1002
- //svg 转为 png
1003
- type = 'image/png';
1004
- idx = name.lastIndexOf('.');
1005
- if (idx > -1) name = name.substring(0, idx) + '.png';
1006
- }
1007
- //转为blob
1008
- onBlob = function onBlob(blob) {
1009
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
1010
- var _a, _b, _c, _d, _e, _f, newFile, changeFile, res, passedFile;
1011
- return regenerator.wrap(function _callee2$(_context2) {
1012
- while (1) switch (_context2.prev = _context2.next) {
1013
- case 0:
1014
- newFile = Object.assign(new File([blob], name, {
1015
- type: type
1016
- }), {
1017
- uid: uid
1018
- });
1019
- _context2.next = 3;
1020
- return changeImageSizeAfterCrop(newFile);
1021
- case 3:
1022
- changeFile = _context2.sent;
1023
- if (!(typeof beforeUploadRef.current !== 'function')) {
1024
- _context2.next = 6;
1025
- break;
1026
- }
1027
- return _context2.abrupt("return", (_a = resolveRef.current) === null || _a === void 0 ? void 0 : _a.call(resolveRef, changeFile));
1028
- case 6:
1029
- res = beforeUploadRef.current(changeFile, [changeFile]);
1030
- if (!(typeof res !== 'boolean' && !res)) {
1031
- _context2.next = 10;
1032
- break;
1033
- }
1034
- console.error('beforeUpload must return a boolean or Promise');
1035
- return _context2.abrupt("return");
1036
- case 10:
1037
- if (!(res === true)) {
1038
- _context2.next = 12;
1039
- break;
1040
- }
1041
- return _context2.abrupt("return", (_b = resolveRef.current) === null || _b === void 0 ? void 0 : _b.call(resolveRef, changeFile));
1042
- case 12:
1043
- if (!(res === false)) {
1044
- _context2.next = 14;
1045
- break;
1046
- }
1047
- return _context2.abrupt("return", (_c = resolveRef.current) === null || _c === void 0 ? void 0 : _c.call(resolveRef, changeFile, false));
1048
- case 14:
1049
- if (!(res && res instanceof Promise)) {
1050
- _context2.next = 27;
1051
- break;
1052
- }
1053
- _context2.prev = 15;
1054
- _context2.next = 18;
1055
- return res;
1056
- case 18:
1057
- passedFile = _context2.sent;
1058
- if (!(passedFile instanceof File || passedFile instanceof Blob)) {
1059
- _context2.next = 21;
1060
- break;
1061
- }
1062
- return _context2.abrupt("return", (_d = resolveRef.current) === null || _d === void 0 ? void 0 : _d.call(resolveRef, passedFile));
1063
- case 21:
1064
- (_e = resolveRef.current) === null || _e === void 0 ? void 0 : _e.call(resolveRef, changeFile, passedFile);
1065
- _context2.next = 27;
1066
- break;
1067
- case 24:
1068
- _context2.prev = 24;
1069
- _context2.t0 = _context2["catch"](15);
1070
- (_f = rejectRef.current) === null || _f === void 0 ? void 0 : _f.call(rejectRef, _context2.t0);
1071
- case 27:
1072
- case "end":
1073
- return _context2.stop();
1074
- }
1075
- }, _callee2, null, [[15, 24]]);
1076
- }));
1077
- };
1078
- canvas.toBlob(onBlob, type, quality);
1079
- case 11:
1080
- case "end":
1081
- return _context3.stop();
1082
- }
1083
- }, _callee3);
1084
- }));
1085
- }, [fillColor, quality, rotate]);
1086
- //img crop 组件
1087
- var getComponent = function getComponent(titleOfModal) {
1088
- return jsxs(Fragment, {
1089
- children: [uploadComponent, image && jsx(Modal, Object.assign({
1090
- open: true,
1091
- className: "".concat(PREFIX, "-modal"),
1092
- size: 'md',
1093
- title: titleOfModal !== null && titleOfModal !== void 0 ? titleOfModal : intl({
1094
- id: 'editImage'
1095
- }),
1096
- onOk: onOk,
1097
- onCancel: onCancel,
1098
- okText: modalOk,
1099
- cancelText: modalCancel,
1100
- contentWidth: modalWidth
1101
- }, {
1102
- children: jsx(EasyCrop$1, {
1103
- ref: easyCropRef,
1104
- cropperRef: ref,
1105
- image: image,
1106
- aspect: aspect,
1107
- shape: shape,
1108
- grid: grid,
1109
- zoom: zoom,
1110
- rotate: rotate,
1111
- minZoom: minZoom,
1112
- maxZoom: maxZoom,
1113
- fixedCropSize: fixedCropSize,
1114
- cropperProps: cropperProps
1115
- })
1116
- }))]
1117
- });
1118
- };
1119
- return jsx(Fragment, {
1120
- children: getComponent(modalTitle)
1121
- });
1122
- });
1123
-
1124
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午1:40\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-upload .component-upload {\n position: relative;\n display: inline-block;\n}\n.paraui-v3-upload-loading {\n pointer-events: none;\n}\n.paraui-v3-upload .paraui-v3-button {\n color: rgb(54, 102, 214);\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-upload .paraui-v3-button:hover {\n border-color: rgba(54, 102, 214, 0.8);\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-upload .paraui-v3-button-loading .button-icon {\n animation: uploadLoadingCircle 1s infinite linear;\n}\n.paraui-v3-upload-drag {\n position: relative;\n}\n.paraui-v3-upload-drag .component-upload {\n display: block;\n}\n.paraui-v3-upload-drag-loading {\n pointer-events: none;\n}\n.paraui-v3-upload-drag-hover .upload-drag-container {\n border-color: rgba(54, 102, 214, 0.4);\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-upload-drag .upload-drag-container {\n display: inline-flex;\n width: 100%;\n max-width: 960px;\n height: 220px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 14px;\n line-height: 1;\n border: 2px dashed rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-radius: 4px;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-upload-drag .upload-drag-container:hover {\n border-color: rgba(54, 102, 214, 0.4);\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-icon {\n line-height: 0;\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-icon svg {\n font-size: 48px;\n color: rgb(54, 102, 214);\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-icon .upload-drag-loading {\n animation: uploadLoadingCircle 1s infinite linear;\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-text {\n margin: 20px 0 12px 0;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-text-loading {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-text-filename {\n margin-right: 5px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-upload-drag .upload-drag-container .upload-drag-hint {\n color: rgba(46, 55, 67, 0.7);\n padding: 0 20px;\n text-align: center;\n}\n@keyframes uploadLoadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}";
1125
- styleInject(css_248z);
1126
-
1127
- //upload
1128
- var InternalUpload = function InternalUpload(props) {
1129
- var _props$type = props.type,
1130
- type = _props$type === void 0 ? 'select' : _props$type,
1131
- className = props.className,
1132
- style = props.style,
1133
- _onStart = props.onStart,
1134
- _onSuccess = props.onSuccess,
1135
- _onError = props.onError,
1136
- _onProgress = props.onProgress,
1137
- onRemove = props.onRemove,
1138
- _beforeUpload = props.beforeUpload,
1139
- onChange = props.onChange,
1140
- onDrop = props.onDrop,
1141
- _props$defaultFileLis = props.defaultFileList,
1142
- defaultFileList = _props$defaultFileLis === void 0 ? [] : _props$defaultFileLis,
1143
- fileList = props.fileList,
1144
- _props$showUploadList = props.showUploadList,
1145
- showUploadList = _props$showUploadList === void 0 ? true : _props$showUploadList,
1146
- maxCount = props.maxCount,
1147
- _props$children = props.children,
1148
- children = _props$children === void 0 ? null : _props$children,
1149
- itemRender = props.itemRender,
1150
- _props$showUploadErro = props.showUploadError,
1151
- showUploadError = _props$showUploadErro === void 0 ? true : _props$showUploadErro,
1152
- _props$size = props.size,
1153
- size = _props$size === void 0 ? 'large' : _props$size,
1154
- _props$stash = props.stash,
1155
- stash = _props$stash === void 0 ? false : _props$stash,
1156
- _props$uploading = props.uploading,
1157
- uploading = _props$uploading === void 0 ? true : _props$uploading,
1158
- _props$showLoading = props.showLoading,
1159
- loading = _props$showLoading === void 0 ? true : _props$showLoading,
1160
- dragArea = props.dragArea,
1161
- restProps = __rest(props, ["type", "className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "onDrop", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "size", "stash", "uploading", "showLoading", "dragArea"]);
1162
- var intl = useFormatMessage('Upload', localeJson);
1163
- var _useState = useState(defaultFileList),
1164
- _useState2 = _slicedToArray(_useState, 2),
1165
- uploadFileList = _useState2[0],
1166
- setUploadFileList = _useState2[1]; //文件列表
1167
- var _useState3 = useState(false),
1168
- _useState4 = _slicedToArray(_useState3, 2),
1169
- showLoading = _useState4[0],
1170
- setShowLoading = _useState4[1]; //upload loading
1171
- var _useState5 = useState(false),
1172
- _useState6 = _slicedToArray(_useState5, 2),
1173
- errTip = _useState6[0],
1174
- setErrTip = _useState6[1]; //upload error tip
1175
- var _ref = typeof showUploadList === 'boolean' ? {} : showUploadList,
1176
- showRemoveIcon = _ref.showRemoveIcon,
1177
- removeIcon = _ref.removeIcon; //显示上传列表
1178
- var _ref2 = typeof showUploadError === 'boolean' ? {} : showUploadError,
1179
- _ref2$uploadErrorMsg = _ref2.uploadErrorMsg,
1180
- uploadErrorMsg = _ref2$uploadErrorMsg === void 0 ? intl({
1181
- id: 'uploadError'
1182
- }) : _ref2$uploadErrorMsg,
1183
- _ref2$leaveDelay = _ref2.leaveDelay,
1184
- leaveDelay = _ref2$leaveDelay === void 0 ? 3000 : _ref2$leaveDelay; //错误信息提示
1185
- var _useState7 = useState('drop'),
1186
- _useState8 = _slicedToArray(_useState7, 2),
1187
- dragState = _useState8[0],
1188
- setDragState = _useState8[1]; //拖拽状态
1189
- var curFileRef = useRef(); //正上传文件
1190
- var recordNonAcceptFileRef = useRef(); //记录非accept推荐文件
1191
- //复写属性
1192
- var overrideProps = Object.assign(Object.assign({}, restProps), {
1193
- beforeUpload: function beforeUpload(file, fileList) {
1194
- if (restProps.action && loading && uploading) {
1195
- setShowLoading(true);
1196
- curFileRef.current = file;
1197
- }
1198
- var val = _beforeUpload === null || _beforeUpload === void 0 ? void 0 : _beforeUpload(file, fileList);
1199
- if (val === false) {
1200
- setShowLoading(false);
1201
- curFileRef.current = null;
1202
- return false;
1203
- } else if (val instanceof Promise) return val;else return true;
1204
- },
1205
- onStart: function onStart(file) {
1206
- _onStart === null || _onStart === void 0 ? void 0 : _onStart(file);
1207
- },
1208
- onSuccess: function onSuccess(response, file, xhr) {
1209
- setShowLoading(false);
1210
- curFileRef.current = null;
1211
- errTip && showErrTip(false);
1212
- var nextFileList = updateFileList(file);
1213
- onInternalChange(nextFileList);
1214
- _onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess(response, file, xhr);
1215
- },
1216
- onError: function onError(error, response, file) {
1217
- setShowLoading(false);
1218
- curFileRef.current = null;
1219
- showErrTip(!!showUploadError);
1220
- _onError === null || _onError === void 0 ? void 0 : _onError(error, response, file);
1221
- },
1222
- onProgress: function onProgress(e, file) {
1223
- _onProgress === null || _onProgress === void 0 ? void 0 : _onProgress(e, file);
1224
- },
1225
- onBatchStart: function onBatchStart(fileList) {
1226
- if (stash) {
1227
- var arr = fileList.map(function (_) {
1228
- return _.file;
1229
- });
1230
- if (type === 'drag' && restProps.accept && recordNonAcceptFileRef.current) {
1231
- arr.push(recordNonAcceptFileRef.current);
1232
- recordNonAcceptFileRef.current = null;
1233
- }
1234
- var mList = mergedFileList(arr);
1235
- onInternalChange(mList);
1236
- }
1237
- }
1238
- });
1239
- //内部变化
1240
- var onInternalChange = function onInternalChange(changedFileList) {
1241
- var cloneList = _toConsumableArray(changedFileList);
1242
- // Cut to match count
1243
- if (maxCount === 1) {
1244
- cloneList = cloneList.slice(-1);
1245
- } else if (maxCount) {
1246
- cloneList = cloneList.slice(0, maxCount);
1247
- }
1248
- onChange === null || onChange === void 0 ? void 0 : onChange(cloneList);
1249
- setUploadFileList(cloneList);
1250
- };
1251
- //更新文件列表
1252
- var updateFileList = function updateFileList(file) {
1253
- var cloneList = _toConsumableArray(uploadFileList);
1254
- var fileObj = Object.assign(Object.assign({}, file), {
1255
- lastModified: file.lastModified,
1256
- lastModifiedDate: file.lastModifiedDate,
1257
- name: file.name,
1258
- size: file.size,
1259
- type: file.type,
1260
- uid: file.uid,
1261
- originFileObj: file
1262
- });
1263
- return cloneList.concat(fileObj);
1264
- };
1265
- //合并文件列表
1266
- var mergedFileList = function mergedFileList(fileList) {
1267
- var cloneList = _toConsumableArray(uploadFileList);
1268
- var newFileList = fileList.map(function (file) {
1269
- return Object.assign(Object.assign({}, file), {
1270
- lastModified: file.lastModified,
1271
- lastModifiedDate: file.lastModifiedDate,
1272
- name: file.name,
1273
- size: file.size,
1274
- type: file.type,
1275
- uid: file.uid || "rc-upload-".concat(Date.now()),
1276
- originFileObj: file
1277
- });
1278
- });
1279
- return cloneList.concat(newFileList);
1280
- };
1281
- //删除文件
1282
- var handleRemove = function handleRemove(file) {
1283
- Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(function (ret) {
1284
- // Prevent removing file
1285
- if (ret === false) return;
1286
- var idx = uploadFileList.findIndex(function (_) {
1287
- return _.uid === file.uid;
1288
- });
1289
- if (idx > -1) uploadFileList.splice(idx, 1);
1290
- onInternalChange(uploadFileList);
1291
- });
1292
- };
1293
- //拖拽区域
1294
- var onFileDrop = function onFileDrop(e) {
1295
- var _a, _b;
1296
- setDragState(e.type);
1297
- if (e.type === 'drop') {
1298
- onDrop === null || onDrop === void 0 ? void 0 : onDrop(e);
1299
- //拖拽且设置accept
1300
- if (type === 'drag' && restProps.accept) {
1301
- var dropFile = (_b = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0];
1302
- if (dropFile) {
1303
- var reg = new RegExp(restProps.accept, 'ig');
1304
- if (!reg.test(dropFile.type)) {
1305
- recordNonAcceptFileRef.current = dropFile;
1306
- }
1307
- }
1308
- }
1309
- }
1310
- };
1311
- //显示错误提示
1312
- var showErrTip = function showErrTip(flag) {
1313
- setErrTip(flag);
1314
- if (leaveDelay < 0) return;
1315
- setTimeout(function () {
1316
- setErrTip(false);
1317
- }, leaveDelay);
1318
- };
1319
- useEffect(function () {
1320
- if (fileList) {
1321
- setUploadFileList(_toConsumableArray(fileList));
1322
- }
1323
- }, [fileList]);
1324
- //渲染上传列表
1325
- var renderUploadList = function renderUploadList() {
1326
- return showUploadList && jsx(UploadList, {
1327
- listType: 'text',
1328
- items: uploadFileList,
1329
- showRemoveIcon: showRemoveIcon,
1330
- removeIcon: removeIcon,
1331
- onRemove: handleRemove,
1332
- itemRender: itemRender
1333
- });
1334
- };
1335
- //渲染上传按钮
1336
- var renderButton = function renderButton() {
1337
- var icon = jsx(UploadIcon, {});
1338
- var text = children;
1339
- if (showLoading) {
1340
- icon = jsx(LoadingIcon, {});
1341
- text = intl({
1342
- id: 'uploading'
1343
- });
1344
- }
1345
- return jsx(Button, Object.assign({
1346
- variant: 'outlined',
1347
- size: size,
1348
- startIcon: icon,
1349
- className: clsx(showLoading && "".concat($prefixCls, "-button-loading"))
1350
- }, {
1351
- children: text
1352
- }));
1353
- };
1354
- //渲染拖拽区域
1355
- var renderDragArea = function renderDragArea() {
1356
- var _a;
1357
- var icon = jsx(UploadIcon, {});
1358
- var text = intl({
1359
- id: 'clickUploadFile'
1360
- });
1361
- var hint = intl({
1362
- id: 'dragFileUpload'
1363
- });
1364
- var _ref3 = dragArea !== null && dragArea !== void 0 ? dragArea : {},
1365
- _ref3$areaIcon = _ref3.areaIcon,
1366
- areaIcon = _ref3$areaIcon === void 0 ? icon : _ref3$areaIcon,
1367
- _ref3$areaText = _ref3.areaText,
1368
- areaText = _ref3$areaText === void 0 ? text : _ref3$areaText,
1369
- _ref3$areaDesc = _ref3.areaDesc,
1370
- areaDesc = _ref3$areaDesc === void 0 ? hint : _ref3$areaDesc;
1371
- if (showLoading) {
1372
- areaIcon = jsx(LoadingIcon, {
1373
- className: 'upload-drag-loading'
1374
- });
1375
- areaText = jsxs("span", Object.assign({
1376
- className: 'upload-drag-text-loading'
1377
- }, {
1378
- children: [jsx("span", Object.assign({
1379
- className: 'upload-drag-text-filename'
1380
- }, {
1381
- children: (_a = curFileRef.current) === null || _a === void 0 ? void 0 : _a.name
1382
- })), intl({
1383
- id: 'uploading'
1384
- }), "..."]
1385
- }));
1386
- }
1387
- return jsx("div", Object.assign({
1388
- className: 'upload-drag-container'
1389
- }, {
1390
- children: children ? children : jsxs(Fragment, {
1391
- children: [jsx("p", Object.assign({
1392
- className: 'upload-drag-icon'
1393
- }, {
1394
- children: areaIcon
1395
- })), jsx("p", Object.assign({
1396
- className: 'upload-drag-text'
1397
- }, {
1398
- children: areaText
1399
- })), !showLoading && jsx("p", Object.assign({
1400
- className: 'upload-drag-hint'
1401
- }, {
1402
- children: areaDesc
1403
- }))]
1404
- })
1405
- }));
1406
- };
1407
- //拖拽上传
1408
- if (type === 'drag') {
1409
- var _clsx;
1410
- var dragCls = clsx("".concat($prefixCls, "-upload-drag"), className, (_clsx = {}, _defineProperty(_clsx, "".concat($prefixCls, "-upload-drag-loading"), showLoading), _defineProperty(_clsx, "".concat($prefixCls, "-upload-drag-hover"), dragState === 'dragover'), _clsx));
1411
- return jsxs("div", Object.assign({
1412
- className: dragCls,
1413
- onDrop: onFileDrop,
1414
- onDragOver: onFileDrop,
1415
- onDragLeave: onFileDrop
1416
- }, {
1417
- children: [jsx(RcUpload, Object.assign({}, overrideProps, {
1418
- prefixCls: "".concat($rcPrefixCls, "-upload")
1419
- }, {
1420
- children: renderDragArea()
1421
- })), renderUploadList(), errTip && jsx(ErrorTip, {
1422
- message: uploadErrorMsg,
1423
- className: "".concat($prefixCls, "-upload-error-drag")
1424
- })]
1425
- }));
1426
- }
1427
- var makeCls = clsx("".concat($prefixCls, "-upload"), className, showLoading && "".concat($prefixCls, "-upload-loading"));
1428
- return jsxs("div", Object.assign({
1429
- className: makeCls,
1430
- style: style
1431
- }, {
1432
- children: [jsxs(RcUpload, Object.assign({}, overrideProps, {
1433
- prefixCls: "".concat($rcPrefixCls, "-upload")
1434
- }, {
1435
- children: [renderButton(), errTip && jsx(ErrorTip, {
1436
- message: uploadErrorMsg
1437
- })]
1438
- })), renderUploadList()]
1439
- }));
1440
- };
1441
- var Upload = InternalUpload;
1442
- Upload.ImageUpload = ImageUpload;
1443
- Upload.Dragger = Dragger;
1444
- Upload.ImgCrop = ImgCrop;
1445
-
1446
- export { Upload as default };