vxe-pc-ui 4.20.34 → 4.20.36

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 (879) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/index.d.ts +8 -8
  7. package/es/anchor/src/anchor-link.js +110 -107
  8. package/es/anchor/src/anchor.d.ts +1 -1
  9. package/es/anchor/src/anchor.js +212 -209
  10. package/es/avatar/index.d.ts +6 -6
  11. package/es/avatar/src/avatar.d.ts +1 -1
  12. package/es/avatar/src/avatar.js +132 -129
  13. package/es/backtop/index.d.ts +42 -42
  14. package/es/backtop/src/backtop.d.ts +7 -7
  15. package/es/backtop/src/backtop.js +267 -264
  16. package/es/badge/index.d.ts +6 -6
  17. package/es/badge/src/badge.d.ts +1 -1
  18. package/es/badge/src/badge.js +102 -99
  19. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  20. package/es/breadcrumb/src/breadcrumb.js +70 -67
  21. package/es/button/index.d.ts +20 -20
  22. package/es/button/src/button-group.js +88 -85
  23. package/es/button/src/button.d.ts +3 -3
  24. package/es/calendar/index.d.ts +20 -20
  25. package/es/calendar/src/calendar.d.ts +3 -3
  26. package/es/calendar/src/calendar.js +1371 -1368
  27. package/es/card/index.d.ts +12 -12
  28. package/es/card/src/card.d.ts +2 -2
  29. package/es/card/src/card.js +235 -232
  30. package/es/carousel/index.d.ts +14 -14
  31. package/es/carousel/src/carousel-item.js +78 -75
  32. package/es/carousel/src/carousel.d.ts +2 -2
  33. package/es/carousel/src/carousel.js +392 -389
  34. package/es/cascader/index.d.ts +70 -70
  35. package/es/cascader/src/cascader.d.ts +11 -11
  36. package/es/cascader/src/cascader.js +1667 -1664
  37. package/es/checkbox/index.d.ts +14 -14
  38. package/es/checkbox/src/button.d.ts +2 -2
  39. package/es/checkbox/src/button.js +198 -195
  40. package/es/checkbox/src/checkbox.d.ts +2 -2
  41. package/es/checkbox/src/checkbox.js +181 -178
  42. package/es/checkbox/src/group.d.ts +4 -4
  43. package/es/checkbox/src/group.js +210 -207
  44. package/es/checkbox-button/index.d.ts +14 -14
  45. package/es/checkbox-group/index.d.ts +26 -26
  46. package/es/collapse/index.d.ts +14 -14
  47. package/es/collapse/src/collapse-pane.js +98 -95
  48. package/es/collapse/src/collapse.d.ts +2 -2
  49. package/es/collapse/src/collapse.js +340 -337
  50. package/es/color-picker/index.d.ts +46 -46
  51. package/es/color-picker/src/color-picker.d.ts +8 -8
  52. package/es/color-picker/src/color-picker.js +1116 -1113
  53. package/es/color-picker/src/util.d.ts +9 -1
  54. package/es/components.d.ts +1 -0
  55. package/es/components.js +3 -0
  56. package/es/context-menu/index.d.ts +16 -16
  57. package/es/context-menu/src/context-menu.d.ts +3 -3
  58. package/es/context-menu/src/context-menu.js +601 -598
  59. package/es/countdown/index.d.ts +2 -2
  60. package/es/countdown/src/countdown.d.ts +1 -1
  61. package/es/countdown/src/countdown.js +224 -221
  62. package/es/date-panel/index.d.ts +46 -46
  63. package/es/date-panel/src/date-panel.d.ts +7 -7
  64. package/es/date-panel/src/date-panel.js +1905 -1902
  65. package/es/date-picker/index.d.ts +110 -110
  66. package/es/date-picker/src/date-picker.d.ts +17 -17
  67. package/es/date-picker/src/date-picker.js +1537 -1534
  68. package/es/date-range-picker/index.d.ts +114 -114
  69. package/es/date-range-picker/src/date-range-picker.d.ts +17 -17
  70. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  71. package/es/divider/index.d.ts +6 -6
  72. package/es/divider/src/divider.d.ts +1 -1
  73. package/es/divider/src/divider.js +80 -77
  74. package/es/drawer/index.d.ts +74 -74
  75. package/es/drawer/src/drawer.d.ts +13 -13
  76. package/es/drawer/src/drawer.js +778 -775
  77. package/es/dynamics/index.d.ts +12 -12
  78. package/es/empty/src/empty.js +100 -97
  79. package/es/form/index.d.ts +36 -36
  80. package/es/form/src/form-config-item.d.ts +7 -7
  81. package/es/form/src/form-group.d.ts +7 -7
  82. package/es/form/src/form-group.js +74 -71
  83. package/es/form/src/form-item.d.ts +7 -7
  84. package/es/form/src/form-item.js +76 -73
  85. package/es/form/src/form.d.ts +6 -6
  86. package/es/form/src/form.js +789 -786
  87. package/es/form-gather/index.d.ts +42 -42
  88. package/es/form-group/index.d.ts +42 -42
  89. package/es/form-item/index.d.ts +42 -42
  90. package/es/icon/src/icon.js +59 -56
  91. package/es/icon/style.css +1 -1
  92. package/es/icon/style.mini.css +1 -1
  93. package/es/icon-picker/index.d.ts +22 -22
  94. package/es/icon-picker/src/icon-picker.d.ts +4 -4
  95. package/es/icon-picker/src/icon-picker.js +719 -716
  96. package/es/image/index.d.ts +30 -30
  97. package/es/image/src/group.d.ts +2 -2
  98. package/es/image/src/group.js +130 -127
  99. package/es/image/src/image.d.ts +5 -5
  100. package/es/image/src/image.js +243 -240
  101. package/es/image/src/preview.d.ts +3 -3
  102. package/es/image/src/preview.js +627 -624
  103. package/es/image-group/index.d.ts +8 -8
  104. package/es/image-preview/index.d.ts +16 -16
  105. package/es/index.esm.js +2 -0
  106. package/es/index.js +2 -0
  107. package/es/input/index.d.ts +160 -160
  108. package/es/input/src/input.d.ts +25 -25
  109. package/es/input/src/input.js +2700 -2697
  110. package/es/layout-aside/src/layout-aside.js +138 -135
  111. package/es/layout-body/src/layout-body.js +145 -142
  112. package/es/layout-container/src/layout-container.js +71 -68
  113. package/es/layout-footer/src/layout-footer.js +60 -57
  114. package/es/layout-header/src/layout-header.js +58 -55
  115. package/es/link/src/link.js +131 -128
  116. package/es/list/src/list.js +2174 -2171
  117. package/es/loading/index.d.ts +6 -6
  118. package/es/loading/src/loading.d.ts +1 -1
  119. package/es/loading/src/loading.js +141 -138
  120. package/es/mention/src/mention.js +49 -46
  121. package/es/menu/index.d.ts +32 -32
  122. package/es/menu/src/menu.d.ts +5 -5
  123. package/es/menu/src/menu.js +799 -796
  124. package/es/modal/index.d.ts +92 -92
  125. package/es/modal/src/modal.d.ts +16 -16
  126. package/es/modal/src/modal.js +1519 -1527
  127. package/es/notice-bar/index.d.ts +8 -8
  128. package/es/notice-bar/src/notice-bar.d.ts +2 -2
  129. package/es/notice-bar/src/notice-bar.js +168 -165
  130. package/es/number-input/index.d.ts +134 -134
  131. package/es/number-input/src/number-input.d.ts +21 -21
  132. package/es/number-input/src/number-input.js +1094 -1091
  133. package/es/optgroup/index.d.ts +6 -6
  134. package/es/option/index.d.ts +6 -6
  135. package/es/pager/index.d.ts +34 -34
  136. package/es/pager/src/pager.d.ts +6 -6
  137. package/es/pager/src/pager.js +767 -764
  138. package/es/password-input/index.d.ts +72 -72
  139. package/es/password-input/src/password-input.d.ts +11 -11
  140. package/es/password-input/src/password-input.js +431 -428
  141. package/es/print/index.d.ts +6 -6
  142. package/es/print/src/page-break.js +63 -60
  143. package/es/print/src/print.d.ts +1 -1
  144. package/es/print/src/print.js +303 -300
  145. package/es/pulldown/index.d.ts +22 -22
  146. package/es/pulldown/src/pulldown.d.ts +4 -4
  147. package/es/pulldown/src/pulldown.js +403 -400
  148. package/es/radio/index.d.ts +20 -20
  149. package/es/radio/src/button.d.ts +3 -3
  150. package/es/radio/src/button.js +214 -211
  151. package/es/radio/src/group.d.ts +4 -4
  152. package/es/radio/src/group.js +195 -192
  153. package/es/radio/src/radio.d.ts +3 -3
  154. package/es/radio/src/radio.js +194 -191
  155. package/es/radio-button/index.d.ts +20 -20
  156. package/es/radio-group/index.d.ts +26 -26
  157. package/es/rate/index.d.ts +14 -14
  158. package/es/rate/src/rate.d.ts +2 -2
  159. package/es/rate/src/rate.js +164 -161
  160. package/es/result/src/result.js +116 -113
  161. package/es/row/index.d.ts +6 -6
  162. package/es/row/src/col.js +133 -130
  163. package/es/row/src/row.d.ts +1 -1
  164. package/es/row/src/row.js +111 -108
  165. package/es/scrollbar/index.d.ts +30 -30
  166. package/es/scrollbar/src/scrollbar.d.ts +5 -5
  167. package/es/scrollbar/src/scrollbar.js +518 -515
  168. package/es/segmented/index.d.ts +14 -14
  169. package/es/segmented/src/segmented.d.ts +2 -2
  170. package/es/segmented/src/segmented.js +240 -237
  171. package/es/select/index.d.ts +66 -66
  172. package/es/select/src/optgroup.d.ts +1 -1
  173. package/es/select/src/optgroup.js +44 -41
  174. package/es/select/src/option.d.ts +1 -1
  175. package/es/select/src/option.js +39 -36
  176. package/es/select/src/select.d.ts +11 -11
  177. package/es/select/src/select.js +1914 -1896
  178. package/es/slider/index.d.ts +38 -38
  179. package/es/slider/src/slider.d.ts +6 -6
  180. package/es/slider/src/slider.js +419 -416
  181. package/es/space/index.d.ts +36 -36
  182. package/es/space/src/space.d.ts +6 -6
  183. package/es/space/src/space.js +190 -187
  184. package/es/split/index.d.ts +14 -14
  185. package/es/split-pane/index.d.ts +18 -18
  186. package/es/splitter/index.d.ts +14 -14
  187. package/es/splitter/src/splitter-panel.d.ts +3 -3
  188. package/es/splitter/src/splitter-panel.js +146 -143
  189. package/es/splitter/src/splitter.d.ts +3 -3
  190. package/es/splitter/src/splitter.js +917 -914
  191. package/es/splitter-panel/index.d.ts +18 -18
  192. package/es/step-item/index.d.ts +76 -0
  193. package/es/step-item/index.js +17 -0
  194. package/es/steps/index.d.ts +288 -34
  195. package/es/steps/src/step-info.d.ts +6 -0
  196. package/es/steps/src/step-info.js +20 -0
  197. package/es/steps/src/step-item.d.ts +14 -0
  198. package/es/steps/src/step-item.js +39 -0
  199. package/es/steps/src/steps.d.ts +68 -8
  200. package/es/steps/src/steps.js +299 -47
  201. package/es/steps/src/util.d.ts +7 -0
  202. package/es/steps/src/util.js +44 -0
  203. package/es/steps/style.css +297 -0
  204. package/es/steps/style.mini.css +1 -0
  205. package/es/style.css +307 -1
  206. package/es/style.mini.css +1 -1
  207. package/es/switch/index.d.ts +24 -24
  208. package/es/switch/src/switch.d.ts +4 -4
  209. package/es/switch/src/switch.js +228 -225
  210. package/es/table-select/index.d.ts +30 -30
  211. package/es/table-select/src/table-select.d.ts +5 -5
  212. package/es/table-select/src/table-select.js +865 -862
  213. package/es/table-transfer/src/table-transfer.js +61 -58
  214. package/es/tabs/index.d.ts +26 -26
  215. package/es/tabs/src/tab-pane.js +102 -99
  216. package/es/tabs/src/tabs.d.ts +4 -4
  217. package/es/tabs/src/tabs.js +936 -933
  218. package/es/tag/index.d.ts +16 -16
  219. package/es/tag/src/tag.d.ts +3 -3
  220. package/es/tag/src/tag.js +163 -160
  221. package/es/text/src/text.js +232 -229
  222. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  223. package/es/textarea/index.d.ts +76 -76
  224. package/es/textarea/src/textarea.d.ts +12 -12
  225. package/es/textarea/src/textarea.js +434 -431
  226. package/es/timeline/index.d.ts +6 -6
  227. package/es/timeline/src/timeline.d.ts +1 -1
  228. package/es/timeline/src/timeline.js +74 -36
  229. package/es/timeline/src/util.js +7 -4
  230. package/es/tip/index.d.ts +9 -9
  231. package/es/tip/src/tip.d.ts +1 -1
  232. package/es/tip/src/tip.js +117 -114
  233. package/es/tooltip/index.d.ts +72 -72
  234. package/es/tooltip/src/tooltip.d.ts +14 -14
  235. package/es/tooltip/src/tooltip.js +552 -549
  236. package/es/tour/src/tour.js +49 -46
  237. package/es/transfer/src/transfer.js +95 -92
  238. package/es/tree/index.d.ts +44 -44
  239. package/es/tree/src/tree.d.ts +7 -7
  240. package/es/tree/src/tree.js +3379 -3376
  241. package/es/tree-select/index.d.ts +74 -74
  242. package/es/tree-select/src/tree-select.d.ts +12 -12
  243. package/es/tree-select/src/tree-select.js +969 -966
  244. package/es/ui/index.js +8 -2
  245. package/es/ui/src/log.js +1 -1
  246. package/es/ui/src/vn.d.ts +1 -1
  247. package/es/upload/index.d.ts +128 -128
  248. package/es/upload/src/upload.d.ts +21 -21
  249. package/es/upload/src/upload.js +1791 -1788
  250. package/es/vxe-icon/style.css +1 -1
  251. package/es/vxe-icon/style.mini.css +1 -1
  252. package/es/vxe-steps/style.css +297 -0
  253. package/es/vxe-steps/style.mini.css +1 -0
  254. package/es/watermark/index.d.ts +6 -6
  255. package/es/watermark/src/watermark.d.ts +1 -1
  256. package/es/watermark/src/watermark.js +158 -155
  257. package/lib/alert/index.d.ts +170 -0
  258. package/lib/alert/src/alert.d.ts +35 -0
  259. package/lib/alert/src/alert.js +117 -114
  260. package/lib/anchor/index.d.ts +140 -0
  261. package/lib/anchor/src/anchor-link.d.ts +12 -0
  262. package/lib/anchor/src/anchor-link.js +110 -107
  263. package/lib/anchor/src/anchor.d.ts +26 -0
  264. package/lib/anchor/src/anchor.js +212 -209
  265. package/lib/anchor/src/util.d.ts +3 -0
  266. package/lib/anchor-link/index.d.ts +64 -0
  267. package/lib/avatar/index.d.ts +216 -0
  268. package/lib/avatar/src/avatar.d.ts +48 -0
  269. package/lib/avatar/src/avatar.js +132 -129
  270. package/lib/backtop/index.d.ts +640 -0
  271. package/lib/backtop/src/backtop.d.ts +146 -0
  272. package/lib/backtop/src/backtop.js +267 -264
  273. package/lib/badge/index.d.ts +154 -0
  274. package/lib/badge/src/badge.d.ts +33 -0
  275. package/lib/badge/src/badge.js +102 -99
  276. package/lib/breadcrumb/index.d.ts +108 -0
  277. package/lib/breadcrumb/src/breadcrumb-item.d.ts +10 -0
  278. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  279. package/lib/breadcrumb/src/breadcrumb.d.ts +20 -0
  280. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  281. package/lib/breadcrumb-item/index.d.ts +56 -0
  282. package/lib/button/index.d.ts +592 -0
  283. package/lib/button/src/button-group.d.ts +39 -0
  284. package/lib/button/src/button-group.js +88 -85
  285. package/lib/button/src/button.d.ts +235 -0
  286. package/lib/button-group/index.d.ts +188 -0
  287. package/lib/calendar/index.d.ts +442 -0
  288. package/lib/calendar/src/calendar.d.ts +93 -0
  289. package/lib/calendar/src/calendar.js +1371 -1368
  290. package/lib/card/index.d.ts +314 -0
  291. package/lib/card/src/card.d.ts +71 -0
  292. package/lib/card/src/card.js +235 -232
  293. package/lib/carousel/index.d.ts +360 -0
  294. package/lib/carousel/src/carousel-item.d.ts +12 -0
  295. package/lib/carousel/src/carousel-item.js +78 -75
  296. package/lib/carousel/src/carousel.d.ts +79 -0
  297. package/lib/carousel/src/carousel.js +392 -389
  298. package/lib/carousel/src/util.d.ts +3 -0
  299. package/lib/carousel-item/index.d.ts +64 -0
  300. package/lib/cascader/index.d.ts +842 -0
  301. package/lib/cascader/src/cascader.d.ts +183 -0
  302. package/lib/cascader/src/cascader.js +1665 -1662
  303. package/lib/cascader/src/util.d.ts +2 -0
  304. package/lib/checkbox/index.d.ts +292 -0
  305. package/lib/checkbox/src/button.d.ts +73 -0
  306. package/lib/checkbox/src/button.js +198 -195
  307. package/lib/checkbox/src/checkbox.d.ts +71 -0
  308. package/lib/checkbox/src/checkbox.js +181 -178
  309. package/lib/checkbox/src/group.d.ts +68 -0
  310. package/lib/checkbox/src/group.js +210 -207
  311. package/lib/checkbox-button/index.d.ts +304 -0
  312. package/lib/checkbox-group/index.d.ts +320 -0
  313. package/lib/col/index.d.ts +124 -0
  314. package/lib/collapse/index.d.ts +224 -0
  315. package/lib/collapse/src/collapse-pane.d.ts +16 -0
  316. package/lib/collapse/src/collapse-pane.js +98 -95
  317. package/lib/collapse/src/collapse.d.ts +45 -0
  318. package/lib/collapse/src/collapse.js +340 -337
  319. package/lib/collapse/src/util.d.ts +3 -0
  320. package/lib/collapse-pane/index.d.ts +80 -0
  321. package/lib/color-picker/index.d.ts +636 -0
  322. package/lib/color-picker/src/color-picker.d.ts +159 -0
  323. package/lib/color-picker/src/color-picker.js +1116 -1113
  324. package/lib/color-picker/src/util.d.ts +62 -0
  325. package/lib/components.d.ts +156 -0
  326. package/lib/components.js +3 -0
  327. package/lib/context-menu/index.d.ts +338 -0
  328. package/lib/context-menu/src/context-menu.d.ts +70 -0
  329. package/lib/context-menu/src/context-menu.js +601 -598
  330. package/lib/countdown/index.d.ts +148 -0
  331. package/lib/countdown/src/countdown.d.ts +28 -0
  332. package/lib/countdown/src/countdown.js +224 -221
  333. package/lib/date-panel/index.d.ts +520 -0
  334. package/lib/date-panel/src/date-panel.d.ts +112 -0
  335. package/lib/date-panel/src/date-panel.js +1905 -1902
  336. package/lib/date-panel/src/util.d.ts +40 -0
  337. package/lib/date-picker/index.d.ts +1074 -0
  338. package/lib/date-picker/src/date-picker.d.ts +262 -0
  339. package/lib/date-picker/src/date-picker.js +1537 -1534
  340. package/lib/date-range-picker/index.d.ts +1044 -0
  341. package/lib/date-range-picker/src/date-range-picker.d.ts +245 -0
  342. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  343. package/lib/divider/index.d.ts +198 -0
  344. package/lib/divider/src/divider.d.ts +43 -0
  345. package/lib/divider/src/divider.js +80 -77
  346. package/lib/drawer/index.d.ts +1398 -0
  347. package/lib/drawer/src/drawer.d.ts +317 -0
  348. package/lib/drawer/src/drawer.js +778 -775
  349. package/lib/drawer/src/store.d.ts +2 -0
  350. package/lib/dynamics/index.d.ts +463 -0
  351. package/lib/empty/index.d.ts +116 -0
  352. package/lib/empty/src/empty.d.ts +24 -0
  353. package/lib/empty/src/empty.js +100 -97
  354. package/lib/form/index.d.ts +836 -0
  355. package/lib/form/render/index.d.ts +1 -0
  356. package/lib/form/src/form-config-item.d.ts +187 -0
  357. package/lib/form/src/form-group.d.ts +188 -0
  358. package/lib/form/src/form-group.js +74 -71
  359. package/lib/form/src/form-item.d.ts +271 -0
  360. package/lib/form/src/form-item.js +76 -73
  361. package/lib/form/src/form.d.ts +191 -0
  362. package/lib/form/src/form.js +789 -786
  363. package/lib/form/src/itemInfo.d.ts +5 -0
  364. package/lib/form/src/render.d.ts +27 -0
  365. package/lib/form/src/util.d.ts +13 -0
  366. package/lib/form-gather/index.d.ts +840 -0
  367. package/lib/form-group/index.d.ts +828 -0
  368. package/lib/form-item/index.d.ts +828 -0
  369. package/lib/icon/index.d.ts +132 -0
  370. package/lib/icon/src/icon.d.ts +26 -0
  371. package/lib/icon/src/icon.js +59 -56
  372. package/lib/icon/style/style.css +1 -1
  373. package/lib/icon/style/style.mini.css +1 -1
  374. package/lib/icon-picker/index.d.ts +440 -0
  375. package/lib/icon-picker/src/icon-picker.d.ts +105 -0
  376. package/lib/icon-picker/src/icon-picker.js +719 -716
  377. package/lib/image/index.d.ts +442 -0
  378. package/lib/image/src/group.d.ts +57 -0
  379. package/lib/image/src/group.js +130 -127
  380. package/lib/image/src/image.d.ts +96 -0
  381. package/lib/image/src/image.js +243 -240
  382. package/lib/image/src/preview.d.ts +73 -0
  383. package/lib/image/src/preview.js +627 -624
  384. package/lib/image/src/util.d.ts +2 -0
  385. package/lib/image-group/index.d.ts +270 -0
  386. package/lib/image-preview/index.d.ts +352 -0
  387. package/lib/index.common.js +2 -0
  388. package/lib/index.d.ts +6 -0
  389. package/lib/index.js +2 -0
  390. package/lib/index.umd.js +47411 -46732
  391. package/lib/index.umd.min.js +3 -3
  392. package/lib/input/index.d.ts +1402 -0
  393. package/lib/input/src/input.d.ts +318 -0
  394. package/lib/input/src/input.js +2700 -2697
  395. package/lib/language/ar-EG.d.ts +908 -0
  396. package/lib/language/de-DE.d.ts +908 -0
  397. package/lib/language/en-US.d.ts +908 -0
  398. package/lib/language/es-ES.d.ts +908 -0
  399. package/lib/language/fr-FR.d.ts +908 -0
  400. package/lib/language/hu-HU.d.ts +908 -0
  401. package/lib/language/hy-AM.d.ts +908 -0
  402. package/lib/language/id-ID.d.ts +908 -0
  403. package/lib/language/it-IT.d.ts +908 -0
  404. package/lib/language/ja-JP.d.ts +908 -0
  405. package/lib/language/ko-KR.d.ts +908 -0
  406. package/lib/language/ms-MY.d.ts +908 -0
  407. package/lib/language/nb-NO.d.ts +908 -0
  408. package/lib/language/pt-BR.d.ts +908 -0
  409. package/lib/language/ru-RU.d.ts +908 -0
  410. package/lib/language/th-TH.d.ts +908 -0
  411. package/lib/language/ug-CN.d.ts +908 -0
  412. package/lib/language/uk-UA.d.ts +908 -0
  413. package/lib/language/uz-UZ.d.ts +908 -0
  414. package/lib/language/vi-VN.d.ts +908 -0
  415. package/lib/language/zh-CHT.d.ts +908 -0
  416. package/lib/language/zh-CN.d.ts +908 -0
  417. package/lib/language/zh-HK.d.ts +908 -0
  418. package/lib/language/zh-MO.d.ts +908 -0
  419. package/lib/language/zh-TC.d.ts +908 -0
  420. package/lib/language/zh-TW.d.ts +908 -0
  421. package/lib/layout-aside/index.d.ts +178 -0
  422. package/lib/layout-aside/src/layout-aside.d.ts +39 -0
  423. package/lib/layout-aside/src/layout-aside.js +138 -135
  424. package/lib/layout-body/index.d.ts +192 -0
  425. package/lib/layout-body/src/layout-body.d.ts +42 -0
  426. package/lib/layout-body/src/layout-body.js +145 -142
  427. package/lib/layout-container/index.d.ts +130 -0
  428. package/lib/layout-container/src/layout-container.d.ts +27 -0
  429. package/lib/layout-container/src/layout-container.js +71 -68
  430. package/lib/layout-footer/index.d.ts +56 -0
  431. package/lib/layout-footer/src/layout-footer.d.ts +10 -0
  432. package/lib/layout-footer/src/layout-footer.js +60 -57
  433. package/lib/layout-header/index.d.ts +48 -0
  434. package/lib/layout-header/src/layout-header.d.ts +8 -0
  435. package/lib/layout-header/src/layout-header.js +58 -55
  436. package/lib/link/index.d.ts +210 -0
  437. package/lib/link/src/link.d.ts +51 -0
  438. package/lib/link/src/link.js +131 -128
  439. package/lib/list/index.d.ts +538 -0
  440. package/lib/list/src/list.d.ts +110 -0
  441. package/lib/list/src/list.js +2173 -2170
  442. package/lib/list/src/store.d.ts +6 -0
  443. package/lib/list/src/util.d.ts +2 -0
  444. package/lib/loading/index.d.ts +257 -0
  445. package/lib/loading/src/loading.d.ts +56 -0
  446. package/lib/loading/src/loading.js +141 -138
  447. package/lib/locale/ar-EG.umd.d.ts +908 -0
  448. package/lib/locale/de-DE.umd.d.ts +908 -0
  449. package/lib/locale/en-US.umd.d.ts +908 -0
  450. package/lib/locale/es-ES.umd.d.ts +908 -0
  451. package/lib/locale/fr-FR.umd.d.ts +908 -0
  452. package/lib/locale/hu-HU.umd.d.ts +908 -0
  453. package/lib/locale/hy-AM.umd.d.ts +908 -0
  454. package/lib/locale/id-ID.umd.d.ts +908 -0
  455. package/lib/locale/it-IT.umd.d.ts +908 -0
  456. package/lib/locale/ja-JP.umd.d.ts +908 -0
  457. package/lib/locale/ko-KR.umd.d.ts +908 -0
  458. package/lib/locale/ms-MY.umd.d.ts +908 -0
  459. package/lib/locale/nb-NO.umd.d.ts +908 -0
  460. package/lib/locale/pt-BR.umd.d.ts +908 -0
  461. package/lib/locale/ru-RU.umd.d.ts +908 -0
  462. package/lib/locale/th-TH.umd.d.ts +908 -0
  463. package/lib/locale/ug-CN.umd.d.ts +908 -0
  464. package/lib/locale/uk-UA.umd.d.ts +908 -0
  465. package/lib/locale/uz-UZ.umd.d.ts +908 -0
  466. package/lib/locale/vi-VN.umd.d.ts +908 -0
  467. package/lib/locale/zh-CHT.umd.d.ts +908 -0
  468. package/lib/locale/zh-CN.umd.d.ts +908 -0
  469. package/lib/locale/zh-HK.umd.d.ts +908 -0
  470. package/lib/locale/zh-MO.umd.d.ts +908 -0
  471. package/lib/locale/zh-TC.umd.d.ts +908 -0
  472. package/lib/locale/zh-TW.umd.d.ts +908 -0
  473. package/lib/mention/index.d.ts +84 -0
  474. package/lib/mention/src/mention.d.ts +16 -0
  475. package/lib/mention/src/mention.js +49 -46
  476. package/lib/menu/index.d.ts +446 -0
  477. package/lib/menu/src/menu.d.ts +98 -0
  478. package/lib/menu/src/menu.js +799 -796
  479. package/lib/modal/index.d.ts +1934 -0
  480. package/lib/modal/src/modal.d.ts +457 -0
  481. package/lib/modal/src/modal.js +1519 -1527
  482. package/lib/modal/src/store.d.ts +2 -0
  483. package/lib/notice-bar/index.d.ts +232 -0
  484. package/lib/notice-bar/src/notice-bar.d.ts +49 -0
  485. package/lib/notice-bar/src/notice-bar.js +168 -165
  486. package/lib/number-input/index.d.ts +1208 -0
  487. package/lib/number-input/src/number-input.d.ts +268 -0
  488. package/lib/number-input/src/number-input.js +1094 -1091
  489. package/lib/number-input/src/util.d.ts +3 -0
  490. package/lib/optgroup/index.d.ts +150 -0
  491. package/lib/option/index.d.ts +158 -0
  492. package/lib/pager/index.d.ts +682 -0
  493. package/lib/pager/src/pager.d.ts +155 -0
  494. package/lib/pager/src/pager.js +767 -764
  495. package/lib/password-input/index.d.ts +572 -0
  496. package/lib/password-input/src/password-input.d.ts +122 -0
  497. package/lib/password-input/src/password-input.js +431 -428
  498. package/lib/print/index.d.ts +454 -0
  499. package/lib/print/src/page-break.d.ts +9 -0
  500. package/lib/print/src/page-break.js +63 -60
  501. package/lib/print/src/print.d.ts +113 -0
  502. package/lib/print/src/print.js +303 -300
  503. package/lib/print/src/util.d.ts +6 -0
  504. package/lib/print-page-break/index.d.ts +60 -0
  505. package/lib/pulldown/index.d.ts +356 -0
  506. package/lib/pulldown/src/pulldown.d.ts +99 -0
  507. package/lib/pulldown/src/pulldown.js +403 -400
  508. package/lib/radio/index.d.ts +292 -0
  509. package/lib/radio/src/button.d.ts +73 -0
  510. package/lib/radio/src/button.js +214 -211
  511. package/lib/radio/src/group.d.ts +66 -0
  512. package/lib/radio/src/group.js +195 -192
  513. package/lib/radio/src/radio.d.ts +71 -0
  514. package/lib/radio/src/radio.js +194 -191
  515. package/lib/radio-button/index.d.ts +304 -0
  516. package/lib/radio-group/index.d.ts +308 -0
  517. package/lib/rate/index.d.ts +200 -0
  518. package/lib/rate/src/rate.d.ts +41 -0
  519. package/lib/rate/src/rate.js +164 -161
  520. package/lib/result/index.d.ts +96 -0
  521. package/lib/result/src/result.d.ts +20 -0
  522. package/lib/result/src/result.js +116 -113
  523. package/lib/row/index.d.ts +192 -0
  524. package/lib/row/src/col.d.ts +26 -0
  525. package/lib/row/src/col.js +133 -130
  526. package/lib/row/src/row.d.ts +40 -0
  527. package/lib/row/src/row.js +111 -108
  528. package/lib/scrollbar/index.d.ts +660 -0
  529. package/lib/scrollbar/src/scrollbar.d.ts +167 -0
  530. package/lib/scrollbar/src/scrollbar.js +518 -515
  531. package/lib/segmented/index.d.ts +210 -0
  532. package/lib/segmented/src/segmented.d.ts +44 -0
  533. package/lib/segmented/src/segmented.js +240 -237
  534. package/lib/select/index.d.ts +1120 -0
  535. package/lib/select/src/optgroup.d.ts +31 -0
  536. package/lib/select/src/optgroup.js +44 -41
  537. package/lib/select/src/option-info.d.ts +5 -0
  538. package/lib/select/src/option.d.ts +33 -0
  539. package/lib/select/src/option.js +39 -36
  540. package/lib/select/src/select.d.ts +303 -0
  541. package/lib/select/src/select.js +1915 -1897
  542. package/lib/select/src/util.d.ts +10 -0
  543. package/lib/slider/index.d.ts +530 -0
  544. package/lib/slider/src/slider.d.ts +115 -0
  545. package/lib/slider/src/slider.js +419 -416
  546. package/lib/space/index.d.ts +548 -0
  547. package/lib/space/src/space.d.ts +126 -0
  548. package/lib/space/src/space.js +190 -187
  549. package/lib/split/index.d.ts +348 -0
  550. package/lib/split-pane/index.d.ts +230 -0
  551. package/lib/splitter/index.d.ts +348 -0
  552. package/lib/splitter/src/splitter-panel.d.ts +51 -0
  553. package/lib/splitter/src/splitter-panel.js +146 -143
  554. package/lib/splitter/src/splitter.d.ts +73 -0
  555. package/lib/splitter/src/splitter.js +917 -914
  556. package/lib/splitter/src/util.d.ts +3 -0
  557. package/lib/splitter-panel/index.d.ts +230 -0
  558. package/lib/step-item/index.d.ts +76 -0
  559. package/lib/step-item/index.js +47 -0
  560. package/lib/steps/index.d.ts +314 -0
  561. package/lib/steps/src/step-info.d.ts +6 -0
  562. package/lib/steps/src/step-info.js +49 -0
  563. package/lib/steps/src/step-item.d.ts +14 -0
  564. package/lib/steps/src/step-item.js +59 -0
  565. package/lib/steps/src/steps.d.ts +69 -0
  566. package/lib/steps/src/steps.js +298 -46
  567. package/lib/steps/src/util.d.ts +7 -0
  568. package/lib/steps/src/util.js +74 -0
  569. package/lib/steps/style/style.css +297 -0
  570. package/lib/steps/style/style.mini.css +1 -0
  571. package/lib/style.css +307 -1
  572. package/lib/style.mini.css +1 -1
  573. package/lib/switch/index.d.ts +332 -0
  574. package/lib/switch/src/switch.d.ts +71 -0
  575. package/lib/switch/src/switch.js +228 -225
  576. package/lib/tab-pane/index.d.ts +96 -0
  577. package/lib/table-select/index.d.ts +528 -0
  578. package/lib/table-select/src/table-select.d.ts +122 -0
  579. package/lib/table-select/src/table-select.js +865 -862
  580. package/lib/table-transfer/index.d.ts +100 -0
  581. package/lib/table-transfer/src/table-transfer.d.ts +20 -0
  582. package/lib/table-transfer/src/table-transfer.js +61 -58
  583. package/lib/tabs/index.d.ts +488 -0
  584. package/lib/tabs/src/tab-pane.d.ts +20 -0
  585. package/lib/tabs/src/tab-pane.js +102 -99
  586. package/lib/tabs/src/tabs.d.ts +105 -0
  587. package/lib/tabs/src/tabs.js +936 -933
  588. package/lib/tabs/src/util.d.ts +3 -0
  589. package/lib/tag/index.d.ts +332 -0
  590. package/lib/tag/src/tag.d.ts +71 -0
  591. package/lib/tag/src/tag.js +163 -160
  592. package/lib/text/index.d.ts +242 -0
  593. package/lib/text/src/text.d.ts +48 -0
  594. package/lib/text/src/text.js +232 -229
  595. package/lib/text-ellipsis/index.d.ts +218 -0
  596. package/lib/text-ellipsis/src/text-ellipsis.d.ts +53 -0
  597. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  598. package/lib/textarea/index.d.ts +738 -0
  599. package/lib/textarea/src/textarea.d.ts +170 -0
  600. package/lib/textarea/src/textarea.js +434 -431
  601. package/lib/timeline/index.d.ts +176 -0
  602. package/lib/timeline/src/timeline-info.d.ts +6 -0
  603. package/lib/timeline/src/timeline-item.d.ts +12 -0
  604. package/lib/timeline/src/timeline.d.ts +38 -0
  605. package/lib/timeline/src/timeline.js +74 -36
  606. package/lib/timeline/src/util.d.ts +7 -0
  607. package/lib/timeline/src/util.js +7 -4
  608. package/lib/timeline-item/index.d.ts +68 -0
  609. package/lib/tip/index.d.ts +275 -0
  610. package/lib/tip/src/tip.d.ts +46 -0
  611. package/lib/tip/src/tip.js +117 -114
  612. package/lib/tooltip/index.d.ts +890 -0
  613. package/lib/tooltip/src/tooltip.d.ts +202 -0
  614. package/lib/tooltip/src/tooltip.js +552 -549
  615. package/lib/tour/index.d.ts +84 -0
  616. package/lib/tour/src/tour.d.ts +16 -0
  617. package/lib/tour/src/tour.js +49 -46
  618. package/lib/transfer/index.d.ts +100 -0
  619. package/lib/transfer/src/transfer.d.ts +20 -0
  620. package/lib/transfer/src/transfer.js +95 -92
  621. package/lib/tree/index.d.ts +1402 -0
  622. package/lib/tree/src/store.d.ts +6 -0
  623. package/lib/tree/src/tree.d.ts +313 -0
  624. package/lib/tree/src/tree.js +3379 -3376
  625. package/lib/tree/src/util.d.ts +3 -0
  626. package/lib/tree-select/index.d.ts +986 -0
  627. package/lib/tree-select/src/tree-select.d.ts +255 -0
  628. package/lib/tree-select/src/tree-select.js +969 -966
  629. package/lib/ui/index.d.ts +6 -0
  630. package/lib/ui/index.js +8 -2
  631. package/lib/ui/src/anime.d.ts +10 -0
  632. package/lib/ui/src/comp.d.ts +2 -0
  633. package/lib/ui/src/dom.d.ts +70 -0
  634. package/lib/ui/src/log.d.ts +6 -0
  635. package/lib/ui/src/log.js +1 -1
  636. package/lib/ui/src/utils.d.ts +23 -0
  637. package/lib/ui/src/vn.d.ts +6 -0
  638. package/lib/upload/index.d.ts +1778 -0
  639. package/lib/upload/src/upload.d.ts +413 -0
  640. package/lib/upload/src/upload.js +1788 -1785
  641. package/lib/upload/src/util.d.ts +16 -0
  642. package/lib/vxe-alert/index.d.ts +3 -0
  643. package/lib/vxe-anchor/index.d.ts +3 -0
  644. package/lib/vxe-anchor-link/index.d.ts +3 -0
  645. package/lib/vxe-avatar/index.d.ts +3 -0
  646. package/lib/vxe-backtop/index.d.ts +3 -0
  647. package/lib/vxe-badge/index.d.ts +3 -0
  648. package/lib/vxe-breadcrumb/index.d.ts +3 -0
  649. package/lib/vxe-breadcrumb-item/index.d.ts +3 -0
  650. package/lib/vxe-button/index.d.ts +3 -0
  651. package/lib/vxe-button-group/index.d.ts +3 -0
  652. package/lib/vxe-calendar/index.d.ts +3 -0
  653. package/lib/vxe-card/index.d.ts +3 -0
  654. package/lib/vxe-carousel/index.d.ts +3 -0
  655. package/lib/vxe-carousel-item/index.d.ts +3 -0
  656. package/lib/vxe-cascader/index.d.ts +3 -0
  657. package/lib/vxe-checkbox/index.d.ts +3 -0
  658. package/lib/vxe-checkbox-button/index.d.ts +3 -0
  659. package/lib/vxe-checkbox-group/index.d.ts +3 -0
  660. package/lib/vxe-col/index.d.ts +3 -0
  661. package/lib/vxe-collapse/index.d.ts +3 -0
  662. package/lib/vxe-collapse-pane/index.d.ts +3 -0
  663. package/lib/vxe-color-picker/index.d.ts +3 -0
  664. package/lib/vxe-context-menu/index.d.ts +3 -0
  665. package/lib/vxe-countdown/index.d.ts +3 -0
  666. package/lib/vxe-date-panel/index.d.ts +3 -0
  667. package/lib/vxe-date-picker/index.d.ts +3 -0
  668. package/lib/vxe-date-range-picker/index.d.ts +3 -0
  669. package/lib/vxe-divider/index.d.ts +3 -0
  670. package/lib/vxe-drawer/index.d.ts +3 -0
  671. package/lib/vxe-empty/index.d.ts +3 -0
  672. package/lib/vxe-form/index.d.ts +3 -0
  673. package/lib/vxe-form-gather/index.d.ts +3 -0
  674. package/lib/vxe-form-group/index.d.ts +3 -0
  675. package/lib/vxe-form-item/index.d.ts +3 -0
  676. package/lib/vxe-icon/index.d.ts +3 -0
  677. package/lib/vxe-icon/style/style.css +1 -1
  678. package/lib/vxe-icon/style/style.mini.css +1 -1
  679. package/lib/vxe-icon-picker/index.d.ts +3 -0
  680. package/lib/vxe-image/index.d.ts +3 -0
  681. package/lib/vxe-image-group/index.d.ts +3 -0
  682. package/lib/vxe-image-preview/index.d.ts +3 -0
  683. package/lib/vxe-input/index.d.ts +3 -0
  684. package/lib/vxe-layout-aside/index.d.ts +3 -0
  685. package/lib/vxe-layout-body/index.d.ts +3 -0
  686. package/lib/vxe-layout-container/index.d.ts +3 -0
  687. package/lib/vxe-layout-footer/index.d.ts +3 -0
  688. package/lib/vxe-layout-header/index.d.ts +3 -0
  689. package/lib/vxe-link/index.d.ts +3 -0
  690. package/lib/vxe-list/index.d.ts +3 -0
  691. package/lib/vxe-loading/index.d.ts +3 -0
  692. package/lib/vxe-mention/index.d.ts +3 -0
  693. package/lib/vxe-menu/index.d.ts +3 -0
  694. package/lib/vxe-modal/index.d.ts +3 -0
  695. package/lib/vxe-notice-bar/index.d.ts +3 -0
  696. package/lib/vxe-number-input/index.d.ts +3 -0
  697. package/lib/vxe-optgroup/index.d.ts +3 -0
  698. package/lib/vxe-option/index.d.ts +3 -0
  699. package/lib/vxe-pager/index.d.ts +3 -0
  700. package/lib/vxe-password-input/index.d.ts +3 -0
  701. package/lib/vxe-print/index.d.ts +3 -0
  702. package/lib/vxe-print-page-break/index.d.ts +3 -0
  703. package/lib/vxe-pulldown/index.d.ts +3 -0
  704. package/lib/vxe-radio/index.d.ts +3 -0
  705. package/lib/vxe-radio-button/index.d.ts +3 -0
  706. package/lib/vxe-radio-group/index.d.ts +3 -0
  707. package/lib/vxe-rate/index.d.ts +3 -0
  708. package/lib/vxe-result/index.d.ts +3 -0
  709. package/lib/vxe-row/index.d.ts +3 -0
  710. package/lib/vxe-scrollbar/index.d.ts +3 -0
  711. package/lib/vxe-segmented/index.d.ts +3 -0
  712. package/lib/vxe-select/index.d.ts +3 -0
  713. package/lib/vxe-slider/index.d.ts +3 -0
  714. package/lib/vxe-space/index.d.ts +3 -0
  715. package/lib/vxe-split/index.d.ts +3 -0
  716. package/lib/vxe-split-pane/index.d.ts +3 -0
  717. package/lib/vxe-splitter/index.d.ts +3 -0
  718. package/lib/vxe-splitter-panel/index.d.ts +3 -0
  719. package/lib/vxe-steps/index.d.ts +3 -0
  720. package/lib/vxe-steps/style/style.css +297 -0
  721. package/lib/vxe-steps/style/style.mini.css +1 -0
  722. package/lib/vxe-switch/index.d.ts +3 -0
  723. package/lib/vxe-tab-pane/index.d.ts +3 -0
  724. package/lib/vxe-table-select/index.d.ts +3 -0
  725. package/lib/vxe-table-transfer/index.d.ts +3 -0
  726. package/lib/vxe-tabs/index.d.ts +3 -0
  727. package/lib/vxe-tag/index.d.ts +3 -0
  728. package/lib/vxe-text/index.d.ts +3 -0
  729. package/lib/vxe-text-ellipsis/index.d.ts +3 -0
  730. package/lib/vxe-textarea/index.d.ts +3 -0
  731. package/lib/vxe-timeline/index.d.ts +3 -0
  732. package/lib/vxe-timeline-item/index.d.ts +3 -0
  733. package/lib/vxe-tip/index.d.ts +3 -0
  734. package/lib/vxe-tooltip/index.d.ts +3 -0
  735. package/lib/vxe-tour/index.d.ts +3 -0
  736. package/lib/vxe-transfer/index.d.ts +3 -0
  737. package/lib/vxe-tree/index.d.ts +3 -0
  738. package/lib/vxe-tree-select/index.d.ts +3 -0
  739. package/lib/vxe-ui/index.d.ts +3 -0
  740. package/lib/vxe-upload/index.d.ts +3 -0
  741. package/lib/vxe-watermark/index.d.ts +3 -0
  742. package/lib/watermark/index.d.ts +183 -0
  743. package/lib/watermark/src/util.d.ts +9 -0
  744. package/lib/watermark/src/watermark.d.ts +39 -0
  745. package/lib/watermark/src/watermark.js +158 -155
  746. package/package.json +9 -9
  747. package/packages/alert/src/alert.ts +2 -2
  748. package/packages/anchor/src/anchor-link.ts +2 -2
  749. package/packages/anchor/src/anchor.ts +2 -2
  750. package/packages/avatar/src/avatar.ts +2 -2
  751. package/packages/backtop/src/backtop.ts +2 -2
  752. package/packages/badge/src/badge.ts +2 -2
  753. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  754. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  755. package/packages/button/src/button-group.ts +2 -2
  756. package/packages/calendar/src/calendar.ts +2 -2
  757. package/packages/card/src/card.ts +2 -2
  758. package/packages/carousel/src/carousel-item.ts +2 -2
  759. package/packages/carousel/src/carousel.ts +2 -2
  760. package/packages/cascader/src/cascader.ts +2 -2
  761. package/packages/checkbox/src/button.ts +3 -15
  762. package/packages/checkbox/src/checkbox.ts +2 -2
  763. package/packages/checkbox/src/group.ts +2 -2
  764. package/packages/collapse/src/collapse-pane.ts +2 -2
  765. package/packages/collapse/src/collapse.ts +2 -2
  766. package/packages/color-picker/src/color-picker.ts +2 -2
  767. package/packages/components.ts +3 -0
  768. package/packages/context-menu/src/context-menu.ts +3 -16
  769. package/packages/countdown/src/countdown.ts +2 -2
  770. package/packages/date-panel/src/date-panel.ts +2 -2
  771. package/packages/date-picker/src/date-picker.ts +2 -2
  772. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  773. package/packages/divider/src/divider.ts +2 -2
  774. package/packages/drawer/src/drawer.ts +2 -2
  775. package/packages/empty/src/empty.ts +2 -2
  776. package/packages/form/src/form-group.ts +2 -2
  777. package/packages/form/src/form-item.ts +2 -2
  778. package/packages/form/src/form.ts +2 -2
  779. package/packages/icon/src/icon.ts +2 -2
  780. package/packages/icon-picker/src/icon-picker.ts +2 -2
  781. package/packages/image/src/group.ts +2 -2
  782. package/packages/image/src/image.ts +2 -2
  783. package/packages/image/src/preview.ts +3 -16
  784. package/packages/index.ts +2 -2
  785. package/packages/input/src/input.ts +2 -2
  786. package/packages/layout-aside/src/layout-aside.ts +2 -2
  787. package/packages/layout-body/src/layout-body.ts +2 -2
  788. package/packages/layout-container/src/layout-container.ts +3 -14
  789. package/packages/layout-footer/src/layout-footer.ts +2 -2
  790. package/packages/layout-header/src/layout-header.ts +2 -2
  791. package/packages/link/src/link.ts +2 -2
  792. package/packages/list/src/list.ts +2 -2
  793. package/packages/loading/src/loading.ts +2 -2
  794. package/packages/mention/src/mention.ts +2 -2
  795. package/packages/menu/src/menu.ts +2 -2
  796. package/packages/modal/src/modal.ts +5 -20
  797. package/packages/notice-bar/src/notice-bar.ts +2 -2
  798. package/packages/number-input/src/number-input.ts +3 -17
  799. package/packages/pager/src/pager.ts +2 -2
  800. package/packages/password-input/src/password-input.ts +2 -2
  801. package/packages/print/src/page-break.ts +2 -2
  802. package/packages/print/src/print.ts +2 -2
  803. package/packages/pulldown/src/pulldown.ts +2 -2
  804. package/packages/radio/src/button.ts +3 -16
  805. package/packages/radio/src/group.ts +3 -17
  806. package/packages/radio/src/radio.ts +2 -2
  807. package/packages/rate/src/rate.ts +2 -2
  808. package/packages/result/src/result.ts +2 -2
  809. package/packages/row/src/col.ts +2 -2
  810. package/packages/row/src/row.ts +2 -2
  811. package/packages/scrollbar/src/scrollbar.ts +3 -4
  812. package/packages/segmented/src/segmented.ts +2 -2
  813. package/packages/select/src/optgroup.ts +2 -2
  814. package/packages/select/src/option.ts +2 -2
  815. package/packages/select/src/select.ts +33 -19
  816. package/packages/slider/src/slider.ts +2 -2
  817. package/packages/space/src/space.ts +2 -2
  818. package/packages/splitter/src/splitter-panel.ts +2 -2
  819. package/packages/splitter/src/splitter.ts +2 -2
  820. package/packages/step-item/index.ts +16 -0
  821. package/packages/steps/src/step-info.ts +18 -0
  822. package/packages/steps/src/step-item.ts +41 -0
  823. package/packages/steps/src/steps.ts +273 -13
  824. package/packages/steps/src/util.ts +44 -0
  825. package/packages/switch/src/switch.ts +2 -2
  826. package/packages/table-select/src/table-select.ts +2 -2
  827. package/packages/table-transfer/src/table-transfer.ts +3 -15
  828. package/packages/tabs/src/tab-pane.ts +2 -2
  829. package/packages/tabs/src/tabs.ts +2 -2
  830. package/packages/tag/src/tag.ts +2 -2
  831. package/packages/text/src/text.ts +2 -2
  832. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  833. package/packages/textarea/src/textarea.ts +2 -2
  834. package/packages/timeline/src/timeline-info.ts +17 -17
  835. package/packages/timeline/src/timeline.ts +93 -49
  836. package/packages/timeline/src/util.ts +44 -41
  837. package/packages/tip/src/tip.ts +2 -2
  838. package/packages/tooltip/src/tooltip.ts +2 -2
  839. package/packages/tour/src/tour.ts +2 -2
  840. package/packages/transfer/src/transfer.ts +2 -2
  841. package/packages/tree/src/tree.ts +2 -2
  842. package/packages/tree-select/src/tree-select.ts +2 -2
  843. package/packages/ui/index.ts +8 -1
  844. package/packages/upload/src/upload.ts +2 -2
  845. package/packages/watermark/src/watermark.ts +2 -2
  846. package/styles/all.scss +1 -0
  847. package/styles/components/step-item.scss +0 -0
  848. package/styles/components/steps.scss +354 -0
  849. package/styles/theme/base.scss +9 -0
  850. package/types/all.d.ts +3 -0
  851. package/types/components/gantt.d.ts +1 -3
  852. package/types/components/select.d.ts +1 -13
  853. package/types/components/step-item.d.ts +72 -0
  854. package/types/components/steps.d.ts +67 -8
  855. package/types/components/table.d.ts +7 -66
  856. package/types/handles/form-design.d.ts +1 -4
  857. package/types/ui/global-config.d.ts +2 -0
  858. package/types/ui/global-icon.d.ts +7 -0
  859. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  860. /package/dist/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  861. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  862. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  863. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  864. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  865. /package/es/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  866. /package/es/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  867. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  868. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  869. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  870. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  871. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  872. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  873. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  874. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  875. /package/lib/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  876. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
  877. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793683457630.ttf} +0 -0
  878. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793683457630.woff} +0 -0
  879. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793683457630.woff2} +0 -0
@@ -62,1727 +62,1796 @@ function createInternalData() {
62
62
  // prevDragPos: ''
63
63
  };
64
64
  }
65
- var upload_default = (0, import_comp.defineVxeComponent)({
66
- name: "VxeUpload",
67
- props: {
68
- modelValue: [Array, String, Object],
69
- showList: {
70
- type: Boolean,
71
- default: () => getConfig().upload.showList
72
- },
73
- moreConfig: Object,
74
- readonly: {
75
- type: Boolean,
76
- default: null
77
- },
78
- disabled: {
79
- type: Boolean,
80
- default: null
81
- },
82
- autoSubmit: {
83
- type: Boolean,
84
- default: () => getConfig().upload.autoSubmit
85
- },
86
- mode: {
87
- type: String,
88
- default: () => getConfig().upload.mode
89
- },
90
- imageTypes: {
91
- type: Array,
92
- default: () => import_xe_utils.default.clone(getConfig().upload.imageTypes, true)
93
- },
94
- imageConfig: {
95
- type: Object,
96
- default: () => import_xe_utils.default.clone(getConfig().upload.imageConfig, true)
97
- },
98
- /**
99
- * 已废弃,被 image-config 替换
100
- * @deprecated
101
- */
102
- imageStyle: {
103
- type: Object,
104
- default: () => import_xe_utils.default.clone(getConfig().upload.imageStyle, true)
105
- },
106
- fileTypes: {
107
- type: Array,
108
- default: () => import_xe_utils.default.clone(getConfig().upload.fileTypes, true)
109
- },
110
- dragSort: Boolean,
111
- dragToUpload: {
112
- type: Boolean,
113
- default: () => import_xe_utils.default.clone(getConfig().upload.dragToUpload, true)
114
- },
115
- dragPlaceholder: {
116
- type: String,
117
- default: () => getConfig().upload.dragPlaceholder
118
- },
119
- pasteToUpload: {
120
- type: Boolean,
121
- default: () => import_xe_utils.default.clone(getConfig().upload.pasteToUpload, true)
122
- },
123
- keyField: String,
124
- singleMode: Boolean,
125
- urlMode: Boolean,
126
- urlArgs: {
127
- type: Boolean,
128
- default: () => getConfig().upload.urlArgs
129
- },
130
- multiple: Boolean,
131
- limitSize: {
132
- type: [String, Number],
133
- default: () => getConfig().upload.limitSize
134
- },
135
- showLimitSize: {
136
- type: Boolean,
137
- default: () => getConfig().upload.showLimitSize
138
- },
139
- limitSizeText: {
140
- type: [String, Number, Function],
141
- default: () => getConfig().upload.limitSizeText
142
- },
143
- limitCount: {
144
- type: [String, Number],
145
- default: () => getConfig().upload.limitCount
146
- },
147
- showLimitCount: {
148
- type: Boolean,
149
- default: () => getConfig().upload.showLimitCount
150
- },
151
- limitCountText: {
152
- type: [String, Number, Function],
153
- default: () => getConfig().upload.limitCountText
154
- },
155
- nameField: {
156
- type: String,
157
- default: () => getConfig().upload.nameField
158
- },
159
- typeField: {
160
- type: String,
161
- default: () => getConfig().upload.typeField
162
- },
163
- urlField: {
164
- type: String,
165
- default: () => getConfig().upload.urlField
166
- },
167
- sizeField: {
168
- type: String,
169
- default: () => getConfig().upload.sizeField
170
- },
171
- showErrorStatus: {
172
- type: Boolean,
173
- default: () => getConfig().upload.showErrorStatus
174
- },
175
- showProgress: {
176
- type: Boolean,
177
- default: () => getConfig().upload.showProgress
178
- },
179
- progressText: {
180
- type: [String, Number, Function],
181
- default: () => getConfig().upload.progressText
182
- },
183
- previewImageConfig: Object,
184
- showSubmitButton: Boolean,
185
- autoHiddenButton: {
186
- type: Boolean,
187
- default: () => getConfig().upload.autoHiddenButton
188
- },
189
- showUploadButton: {
190
- type: Boolean,
191
- default: () => getConfig().upload.showUploadButton
192
- },
193
- buttonText: {
194
- type: [String, Number, Function],
195
- default: () => getConfig().upload.buttonText
196
- },
197
- buttonIcon: {
198
- type: String,
199
- default: () => getConfig().upload.buttonIcon
200
- },
201
- showButtonText: {
202
- type: Boolean,
203
- default: () => getConfig().upload.showButtonText
204
- },
205
- showButtonIcon: {
206
- type: Boolean,
207
- default: () => getConfig().upload.showButtonIcon
208
- },
209
- showRemoveButton: {
210
- type: Boolean,
211
- default: () => getConfig().upload.showRemoveButton
212
- },
213
- showDownloadButton: {
214
- type: Boolean,
215
- default: () => getConfig().upload.showDownloadButton
216
- },
217
- showPreview: {
218
- type: Boolean,
219
- default: () => getConfig().upload.showPreview
220
- },
221
- showTip: {
222
- type: Boolean,
223
- default: () => null
224
- },
225
- maxSimultaneousUploads: {
226
- type: Number,
227
- default: () => getConfig().upload.maxSimultaneousUploads
65
+ var upload_default = (
66
+ /* define-vxe-component start */
67
+ (0, import_comp.defineVxeComponent)({
68
+ name: "VxeUpload",
69
+ props: {
70
+ modelValue: [Array, String, Object],
71
+ showList: {
72
+ type: Boolean,
73
+ default: () => getConfig().upload.showList
74
+ },
75
+ moreConfig: Object,
76
+ readonly: {
77
+ type: Boolean,
78
+ default: null
79
+ },
80
+ disabled: {
81
+ type: Boolean,
82
+ default: null
83
+ },
84
+ autoSubmit: {
85
+ type: Boolean,
86
+ default: () => getConfig().upload.autoSubmit
87
+ },
88
+ mode: {
89
+ type: String,
90
+ default: () => getConfig().upload.mode
91
+ },
92
+ imageTypes: {
93
+ type: Array,
94
+ default: () => import_xe_utils.default.clone(getConfig().upload.imageTypes, true)
95
+ },
96
+ imageConfig: {
97
+ type: Object,
98
+ default: () => import_xe_utils.default.clone(getConfig().upload.imageConfig, true)
99
+ },
100
+ /**
101
+ * 已废弃,被 image-config 替换
102
+ * @deprecated
103
+ */
104
+ imageStyle: {
105
+ type: Object,
106
+ default: () => import_xe_utils.default.clone(getConfig().upload.imageStyle, true)
107
+ },
108
+ fileTypes: {
109
+ type: Array,
110
+ default: () => import_xe_utils.default.clone(getConfig().upload.fileTypes, true)
111
+ },
112
+ dragSort: Boolean,
113
+ dragToUpload: {
114
+ type: Boolean,
115
+ default: () => import_xe_utils.default.clone(getConfig().upload.dragToUpload, true)
116
+ },
117
+ dragPlaceholder: {
118
+ type: String,
119
+ default: () => getConfig().upload.dragPlaceholder
120
+ },
121
+ pasteToUpload: {
122
+ type: Boolean,
123
+ default: () => import_xe_utils.default.clone(getConfig().upload.pasteToUpload, true)
124
+ },
125
+ keyField: String,
126
+ singleMode: Boolean,
127
+ urlMode: Boolean,
128
+ urlArgs: {
129
+ type: Boolean,
130
+ default: () => getConfig().upload.urlArgs
131
+ },
132
+ multiple: Boolean,
133
+ limitSize: {
134
+ type: [String, Number],
135
+ default: () => getConfig().upload.limitSize
136
+ },
137
+ showLimitSize: {
138
+ type: Boolean,
139
+ default: () => getConfig().upload.showLimitSize
140
+ },
141
+ limitSizeText: {
142
+ type: [String, Number, Function],
143
+ default: () => getConfig().upload.limitSizeText
144
+ },
145
+ limitCount: {
146
+ type: [String, Number],
147
+ default: () => getConfig().upload.limitCount
148
+ },
149
+ showLimitCount: {
150
+ type: Boolean,
151
+ default: () => getConfig().upload.showLimitCount
152
+ },
153
+ limitCountText: {
154
+ type: [String, Number, Function],
155
+ default: () => getConfig().upload.limitCountText
156
+ },
157
+ nameField: {
158
+ type: String,
159
+ default: () => getConfig().upload.nameField
160
+ },
161
+ typeField: {
162
+ type: String,
163
+ default: () => getConfig().upload.typeField
164
+ },
165
+ urlField: {
166
+ type: String,
167
+ default: () => getConfig().upload.urlField
168
+ },
169
+ sizeField: {
170
+ type: String,
171
+ default: () => getConfig().upload.sizeField
172
+ },
173
+ showErrorStatus: {
174
+ type: Boolean,
175
+ default: () => getConfig().upload.showErrorStatus
176
+ },
177
+ showProgress: {
178
+ type: Boolean,
179
+ default: () => getConfig().upload.showProgress
180
+ },
181
+ progressText: {
182
+ type: [String, Number, Function],
183
+ default: () => getConfig().upload.progressText
184
+ },
185
+ previewImageConfig: Object,
186
+ showSubmitButton: Boolean,
187
+ autoHiddenButton: {
188
+ type: Boolean,
189
+ default: () => getConfig().upload.autoHiddenButton
190
+ },
191
+ showUploadButton: {
192
+ type: Boolean,
193
+ default: () => getConfig().upload.showUploadButton
194
+ },
195
+ buttonText: {
196
+ type: [String, Number, Function],
197
+ default: () => getConfig().upload.buttonText
198
+ },
199
+ buttonIcon: {
200
+ type: String,
201
+ default: () => getConfig().upload.buttonIcon
202
+ },
203
+ showButtonText: {
204
+ type: Boolean,
205
+ default: () => getConfig().upload.showButtonText
206
+ },
207
+ showButtonIcon: {
208
+ type: Boolean,
209
+ default: () => getConfig().upload.showButtonIcon
210
+ },
211
+ showRemoveButton: {
212
+ type: Boolean,
213
+ default: () => getConfig().upload.showRemoveButton
214
+ },
215
+ showDownloadButton: {
216
+ type: Boolean,
217
+ default: () => getConfig().upload.showDownloadButton
218
+ },
219
+ showPreview: {
220
+ type: Boolean,
221
+ default: () => getConfig().upload.showPreview
222
+ },
223
+ showTip: {
224
+ type: Boolean,
225
+ default: () => null
226
+ },
227
+ maxSimultaneousUploads: {
228
+ type: Number,
229
+ default: () => getConfig().upload.maxSimultaneousUploads
230
+ },
231
+ tipText: [String, Number, Function],
232
+ hintText: String,
233
+ previewMethod: Function,
234
+ beforeSelectMethod: Function,
235
+ uploadMethod: Function,
236
+ beforeRemoveMethod: Function,
237
+ removeMethod: Function,
238
+ beforeDownloadMethod: Function,
239
+ downloadMethod: Function,
240
+ getUrlMethod: Function,
241
+ getThumbnailUrlMethod: Function,
242
+ size: {
243
+ type: String,
244
+ default: () => getConfig().upload.size || getConfig().size
245
+ }
228
246
  },
229
- tipText: [String, Number, Function],
230
- hintText: String,
231
- previewMethod: Function,
232
- beforeSelectMethod: Function,
233
- uploadMethod: Function,
234
- beforeRemoveMethod: Function,
235
- removeMethod: Function,
236
- beforeDownloadMethod: Function,
237
- downloadMethod: Function,
238
- getUrlMethod: Function,
239
- getThumbnailUrlMethod: Function,
240
- size: {
241
- type: String,
242
- default: () => getConfig().upload.size || getConfig().size
243
- }
244
- },
245
- emits: ["update:modelValue", "change", "add", "remove", "remove-fail", "download", "download-fail", "upload-start", "upload-success", "upload-error", "upload-end", "upload-queue-start", "upload-queue-end", "sort-dragend", "more-visible"],
246
- setup(props, context) {
247
- const { emit, slots } = context;
248
- const $xeForm = (0, import_vue.inject)("$xeForm", null);
249
- const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
250
- const $xeTable = (0, import_vue.inject)("$xeTable", null);
251
- const xID = import_xe_utils.default.uniqueId();
252
- const { computeSize } = useFns.useSize(props);
253
- const refElem = (0, import_vue.ref)();
254
- const refPopupElem = (0, import_vue.ref)();
255
- const refDragLineElem = (0, import_vue.ref)();
256
- const refModalDragLineElem = (0, import_vue.ref)();
257
- const reactData = (0, import_vue.reactive)(createReactData());
258
- const internalData = createInternalData();
259
- const refMaps = {
260
- refElem
261
- };
262
- const computeFormReadonly = (0, import_vue.computed)(() => {
263
- const { readonly } = props;
264
- if (readonly === null) {
265
- if ($xeForm) {
266
- return $xeForm.props.readonly;
247
+ emits: ["update:modelValue", "change", "add", "remove", "remove-fail", "download", "download-fail", "upload-start", "upload-success", "upload-error", "upload-end", "upload-queue-start", "upload-queue-end", "sort-dragend", "more-visible"],
248
+ setup(props, context) {
249
+ const { emit, slots } = context;
250
+ const $xeForm = (0, import_vue.inject)("$xeForm", null);
251
+ const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
252
+ const $xeTable = (0, import_vue.inject)("$xeTable", null);
253
+ const xID = import_xe_utils.default.uniqueId();
254
+ const { computeSize } = useFns.useSize(props);
255
+ const refElem = (0, import_vue.ref)();
256
+ const refPopupElem = (0, import_vue.ref)();
257
+ const refDragLineElem = (0, import_vue.ref)();
258
+ const refModalDragLineElem = (0, import_vue.ref)();
259
+ const reactData = (0, import_vue.reactive)(createReactData());
260
+ const internalData = createInternalData();
261
+ const refMaps = {
262
+ refElem
263
+ };
264
+ const computeFormReadonly = (0, import_vue.computed)(() => {
265
+ const { readonly } = props;
266
+ if (readonly === null) {
267
+ if ($xeForm) {
268
+ return $xeForm.props.readonly;
269
+ }
270
+ return false;
267
271
  }
268
- return false;
269
- }
270
- return readonly;
271
- });
272
- const computeIsDisabled = (0, import_vue.computed)(() => {
273
- const { disabled } = props;
274
- if (disabled === null) {
275
- if ($xeForm) {
276
- return $xeForm.props.disabled;
272
+ return readonly;
273
+ });
274
+ const computeIsDisabled = (0, import_vue.computed)(() => {
275
+ const { disabled } = props;
276
+ if (disabled === null) {
277
+ if ($xeForm) {
278
+ return $xeForm.props.disabled;
279
+ }
280
+ return false;
277
281
  }
278
- return false;
279
- }
280
- return disabled;
281
- });
282
- const computeKeyField = (0, import_vue.computed)(() => {
283
- return props.keyField || "_X_KEY";
284
- });
285
- const computeIsImage = (0, import_vue.computed)(() => {
286
- return props.mode === "image";
287
- });
288
- const computeNameProp = (0, import_vue.computed)(() => {
289
- return props.nameField || "name";
290
- });
291
- const computeTypeProp = (0, import_vue.computed)(() => {
292
- return props.typeField || "type";
293
- });
294
- const computeUrlProp = (0, import_vue.computed)(() => {
295
- return props.urlField || "url";
296
- });
297
- const computeSizeProp = (0, import_vue.computed)(() => {
298
- return props.sizeField || "size";
299
- });
300
- const computeLimitMaxSize = (0, import_vue.computed)(() => {
301
- return import_xe_utils.default.toNumber(props.limitSize) * 1024 * 1024;
302
- });
303
- const computeLimitMaxCount = (0, import_vue.computed)(() => {
304
- return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 1;
305
- });
306
- const computePreviewImageOpts = (0, import_vue.computed)(() => {
307
- const { showDownloadButton } = props;
308
- return Object.assign(
309
- {
310
- showDownloadButton
311
- },
312
- getConfig().upload.previewImageConfig,
313
- props.previewImageConfig
314
- );
315
- });
316
- const computeOverCount = (0, import_vue.computed)(() => {
317
- const { multiple } = props;
318
- const { fileList } = reactData;
319
- const limitMaxCount = computeLimitMaxCount.value;
320
- if (multiple) {
321
- if (limitMaxCount) {
322
- return fileList.length >= limitMaxCount;
282
+ return disabled;
283
+ });
284
+ const computeKeyField = (0, import_vue.computed)(() => {
285
+ return props.keyField || "_X_KEY";
286
+ });
287
+ const computeIsImage = (0, import_vue.computed)(() => {
288
+ return props.mode === "image";
289
+ });
290
+ const computeNameProp = (0, import_vue.computed)(() => {
291
+ return props.nameField || "name";
292
+ });
293
+ const computeTypeProp = (0, import_vue.computed)(() => {
294
+ return props.typeField || "type";
295
+ });
296
+ const computeUrlProp = (0, import_vue.computed)(() => {
297
+ return props.urlField || "url";
298
+ });
299
+ const computeSizeProp = (0, import_vue.computed)(() => {
300
+ return props.sizeField || "size";
301
+ });
302
+ const computeLimitMaxSize = (0, import_vue.computed)(() => {
303
+ return import_xe_utils.default.toNumber(props.limitSize) * 1024 * 1024;
304
+ });
305
+ const computeLimitMaxCount = (0, import_vue.computed)(() => {
306
+ return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 1;
307
+ });
308
+ const computePreviewImageOpts = (0, import_vue.computed)(() => {
309
+ const { showDownloadButton } = props;
310
+ return Object.assign(
311
+ {
312
+ showDownloadButton
313
+ },
314
+ getConfig().upload.previewImageConfig,
315
+ props.previewImageConfig
316
+ );
317
+ });
318
+ const computeOverCount = (0, import_vue.computed)(() => {
319
+ const { multiple } = props;
320
+ const { fileList } = reactData;
321
+ const limitMaxCount = computeLimitMaxCount.value;
322
+ if (multiple) {
323
+ if (limitMaxCount) {
324
+ return fileList.length >= limitMaxCount;
325
+ }
326
+ return true;
323
327
  }
324
- return true;
325
- }
326
- return fileList.length >= 1;
327
- });
328
- const computeLimitSizeUnit = (0, import_vue.computed)(() => {
329
- const limitSize = import_xe_utils.default.toNumber(props.limitSize);
330
- if (limitSize) {
331
- if (limitSize > 1048576) {
332
- return `${limitSize / 1048576}T`;
328
+ return fileList.length >= 1;
329
+ });
330
+ const computeLimitSizeUnit = (0, import_vue.computed)(() => {
331
+ const limitSize = import_xe_utils.default.toNumber(props.limitSize);
332
+ if (limitSize) {
333
+ if (limitSize > 1048576) {
334
+ return `${limitSize / 1048576}T`;
335
+ }
336
+ if (limitSize > 1024) {
337
+ return `${limitSize / 1024}G`;
338
+ }
339
+ return `${limitSize}M`;
333
340
  }
334
- if (limitSize > 1024) {
335
- return `${limitSize / 1024}G`;
341
+ return "";
342
+ });
343
+ const computedShowTipText = (0, import_vue.computed)(() => {
344
+ const { showTip, tipText } = props;
345
+ if (import_xe_utils.default.isBoolean(showTip)) {
346
+ return showTip;
336
347
  }
337
- return `${limitSize}M`;
338
- }
339
- return "";
340
- });
341
- const computedShowTipText = (0, import_vue.computed)(() => {
342
- const { showTip, tipText } = props;
343
- if (import_xe_utils.default.isBoolean(showTip)) {
344
- return showTip;
345
- }
346
- const defShowTip = getConfig().upload.showTip;
347
- if (import_xe_utils.default.isBoolean(defShowTip)) {
348
- return defShowTip;
349
- }
350
- if (tipText) {
351
- return true;
352
- }
353
- return false;
354
- });
355
- const computedDefTipText = (0, import_vue.computed)(() => {
356
- const { limitSize, fileTypes, multiple, limitCount } = props;
357
- const tipText = props.tipText || props.hintText;
358
- const isImage = computeIsImage.value;
359
- const limitSizeUnit = computeLimitSizeUnit.value;
360
- if (import_xe_utils.default.isString(tipText)) {
361
- return tipText;
362
- }
363
- if (import_xe_utils.default.isFunction(tipText)) {
364
- return `${tipText({})}`;
365
- }
366
- const defTips = [];
367
- if (isImage) {
368
- if (multiple && limitCount) {
369
- defTips.push(getI18n("vxe.upload.imgCountHint", [limitCount]));
348
+ const defShowTip = getConfig().upload.showTip;
349
+ if (import_xe_utils.default.isBoolean(defShowTip)) {
350
+ return defShowTip;
370
351
  }
371
- if (limitSize && limitSizeUnit) {
372
- defTips.push(getI18n("vxe.upload.imgSizeHint", [limitSizeUnit]));
352
+ if (tipText) {
353
+ return true;
373
354
  }
374
- } else {
375
- if (fileTypes && fileTypes.length) {
376
- defTips.push(getI18n("vxe.upload.fileTypeHint", [fileTypes.join("/")]));
355
+ return false;
356
+ });
357
+ const computedDefTipText = (0, import_vue.computed)(() => {
358
+ const { limitSize, fileTypes, multiple, limitCount } = props;
359
+ const tipText = props.tipText || props.hintText;
360
+ const isImage = computeIsImage.value;
361
+ const limitSizeUnit = computeLimitSizeUnit.value;
362
+ if (import_xe_utils.default.isString(tipText)) {
363
+ return tipText;
377
364
  }
378
- if (limitSize && limitSizeUnit) {
379
- defTips.push(getI18n("vxe.upload.fileSizeHint", [limitSizeUnit]));
365
+ if (import_xe_utils.default.isFunction(tipText)) {
366
+ return `${tipText({})}`;
380
367
  }
381
- if (multiple && limitCount) {
382
- defTips.push(getI18n("vxe.upload.fileCountHint", [limitCount]));
368
+ const defTips = [];
369
+ if (isImage) {
370
+ if (multiple && limitCount) {
371
+ defTips.push(getI18n("vxe.upload.imgCountHint", [limitCount]));
372
+ }
373
+ if (limitSize && limitSizeUnit) {
374
+ defTips.push(getI18n("vxe.upload.imgSizeHint", [limitSizeUnit]));
375
+ }
376
+ } else {
377
+ if (fileTypes && fileTypes.length) {
378
+ defTips.push(getI18n("vxe.upload.fileTypeHint", [fileTypes.join("/")]));
379
+ }
380
+ if (limitSize && limitSizeUnit) {
381
+ defTips.push(getI18n("vxe.upload.fileSizeHint", [limitSizeUnit]));
382
+ }
383
+ if (multiple && limitCount) {
384
+ defTips.push(getI18n("vxe.upload.fileCountHint", [limitCount]));
385
+ }
383
386
  }
384
- }
385
- return defTips.join(getI18n("vxe.base.comma"));
386
- });
387
- const computeImageOpts = (0, import_vue.computed)(() => {
388
- return Object.assign({}, props.imageConfig || props.imageStyle);
389
- });
390
- const computeImgStyle = (0, import_vue.computed)(() => {
391
- const imageOpts = computeImageOpts.value;
392
- const { width, height } = imageOpts;
393
- const stys = {};
394
- if (width) {
395
- stys.width = (0, import_dom.toCssUnit)(width);
396
- }
397
- if (height) {
398
- stys.height = (0, import_dom.toCssUnit)(height);
399
- }
400
- return stys;
401
- });
402
- const computeMoreOpts = (0, import_vue.computed)(() => {
403
- return Object.assign({ showMoreButton: true }, props.moreConfig);
404
- });
405
- const computeMaps = {
406
- computeUrlProp
407
- };
408
- const $xeUpload = {
409
- xID,
410
- props,
411
- context,
412
- reactData,
413
- internalData,
414
- getRefMaps: () => refMaps,
415
- getComputeMaps: () => computeMaps
416
- };
417
- const getUniqueKey = () => {
418
- return import_xe_utils.default.uniqueId();
419
- };
420
- const getFieldKey = (item) => {
421
- const keyField = computeKeyField.value;
422
- return item[keyField];
423
- };
424
- const updateFileList = () => {
425
- const { modelValue, multiple } = props;
426
- const formReadonly = computeFormReadonly.value;
427
- const keyField = computeKeyField.value;
428
- const nameProp = computeNameProp.value;
429
- const typeProp = computeTypeProp.value;
430
- const urlProp = computeUrlProp.value;
431
- const sizeProp = computeSizeProp.value;
432
- const fileList = modelValue ? (modelValue ? import_xe_utils.default.isArray(modelValue) ? modelValue : [modelValue] : []).map((item) => {
433
- if (!item || import_xe_utils.default.isString(item)) {
434
- const url = `${item || ""}`;
435
- const urlObj = import_xe_utils.default.parseUrl(item);
436
- const name2 = (urlObj ? urlObj.searchQuery[nameProp] : "") || parseFileName(url);
437
- return {
438
- [nameProp]: name2,
439
- [typeProp]: (urlObj ? urlObj.searchQuery[typeProp] : "") || parseFileType(name2),
440
- [urlProp]: url,
441
- [sizeProp]: import_xe_utils.default.toNumber(urlObj ? urlObj.searchQuery[sizeProp] : 0) || 0,
442
- [keyField]: getUniqueKey()
443
- };
387
+ return defTips.join(getI18n("vxe.base.comma"));
388
+ });
389
+ const computeImageOpts = (0, import_vue.computed)(() => {
390
+ return Object.assign({}, props.imageConfig || props.imageStyle);
391
+ });
392
+ const computeImgStyle = (0, import_vue.computed)(() => {
393
+ const imageOpts = computeImageOpts.value;
394
+ const { width, height } = imageOpts;
395
+ const stys = {};
396
+ if (width) {
397
+ stys.width = (0, import_dom.toCssUnit)(width);
444
398
  }
445
- const name = item[nameProp] || "";
446
- item[nameProp] = name;
447
- item[typeProp] = item[typeProp] || parseFileType(name);
448
- item[urlProp] = item[urlProp] || "";
449
- item[sizeProp] = item[sizeProp] || 0;
450
- item[keyField] = item[keyField] || getUniqueKey();
451
- return item;
452
- }) : [];
453
- reactData.fileList = formReadonly || multiple ? fileList : fileList.slice(0, 1);
454
- };
455
- const parseFileName = (url) => {
456
- return decodeURIComponent(`${url || ""}`).split("/").pop() || "";
457
- };
458
- const parseFileType = (name) => {
459
- const index = name.lastIndexOf(".");
460
- if (index > 0) {
461
- return name.substring(index + 1).toLowerCase();
462
- }
463
- return "";
464
- };
465
- const dispatchEvent = (type, params, evnt) => {
466
- emit(type, createEvent(evnt, { $upload: $xeUpload }, params));
467
- };
468
- const emitModel = (value) => {
469
- emit("update:modelValue", value);
470
- };
471
- const handleModel = (vals) => {
472
- const { singleMode, urlMode, urlArgs } = props;
473
- const urlProp = computeUrlProp.value;
474
- const nameProp = computeNameProp.value;
475
- let restList = vals ? vals.slice(0) : [];
476
- if (urlMode) {
477
- restList = restList.map((item) => {
478
- const url = item[urlProp];
479
- if (url && urlArgs) {
480
- const urlObj = import_xe_utils.default.parseUrl(url);
481
- if (!urlObj.searchQuery[nameProp]) {
482
- if (url.indexOf("blob:") === -1) {
483
- return `${url}${url.indexOf("?") === -1 ? "?" : "&"}${nameProp}=${encodeURIComponent(item[nameProp] || "")}`;
399
+ if (height) {
400
+ stys.height = (0, import_dom.toCssUnit)(height);
401
+ }
402
+ return stys;
403
+ });
404
+ const computeMoreOpts = (0, import_vue.computed)(() => {
405
+ return Object.assign({ showMoreButton: true }, props.moreConfig);
406
+ });
407
+ const computeMaps = {
408
+ computeUrlProp
409
+ };
410
+ const $xeUpload = {
411
+ xID,
412
+ props,
413
+ context,
414
+ reactData,
415
+ internalData,
416
+ getRefMaps: () => refMaps,
417
+ getComputeMaps: () => computeMaps
418
+ };
419
+ const getUniqueKey = () => {
420
+ return import_xe_utils.default.uniqueId();
421
+ };
422
+ const getFieldKey = (item) => {
423
+ const keyField = computeKeyField.value;
424
+ return item[keyField];
425
+ };
426
+ const updateFileList = () => {
427
+ const { modelValue, multiple } = props;
428
+ const formReadonly = computeFormReadonly.value;
429
+ const keyField = computeKeyField.value;
430
+ const nameProp = computeNameProp.value;
431
+ const typeProp = computeTypeProp.value;
432
+ const urlProp = computeUrlProp.value;
433
+ const sizeProp = computeSizeProp.value;
434
+ const fileList = modelValue ? (modelValue ? import_xe_utils.default.isArray(modelValue) ? modelValue : [modelValue] : []).map((item) => {
435
+ if (!item || import_xe_utils.default.isString(item)) {
436
+ const url = `${item || ""}`;
437
+ const urlObj = import_xe_utils.default.parseUrl(item);
438
+ const name2 = (urlObj ? urlObj.searchQuery[nameProp] : "") || parseFileName(url);
439
+ return {
440
+ [nameProp]: name2,
441
+ [typeProp]: (urlObj ? urlObj.searchQuery[typeProp] : "") || parseFileType(name2),
442
+ [urlProp]: url,
443
+ [sizeProp]: import_xe_utils.default.toNumber(urlObj ? urlObj.searchQuery[sizeProp] : 0) || 0,
444
+ [keyField]: getUniqueKey()
445
+ };
446
+ }
447
+ const name = item[nameProp] || "";
448
+ item[nameProp] = name;
449
+ item[typeProp] = item[typeProp] || parseFileType(name);
450
+ item[urlProp] = item[urlProp] || "";
451
+ item[sizeProp] = item[sizeProp] || 0;
452
+ item[keyField] = item[keyField] || getUniqueKey();
453
+ return item;
454
+ }) : [];
455
+ reactData.fileList = formReadonly || multiple ? fileList : fileList.slice(0, 1);
456
+ };
457
+ const parseFileName = (url) => {
458
+ return decodeURIComponent(`${url || ""}`).split("/").pop() || "";
459
+ };
460
+ const parseFileType = (name) => {
461
+ const index = name.lastIndexOf(".");
462
+ if (index > 0) {
463
+ return name.substring(index + 1).toLowerCase();
464
+ }
465
+ return "";
466
+ };
467
+ const dispatchEvent = (type, params, evnt) => {
468
+ emit(type, createEvent(evnt, { $upload: $xeUpload }, params));
469
+ };
470
+ const emitModel = (value) => {
471
+ emit("update:modelValue", value);
472
+ };
473
+ const handleModel = (vals) => {
474
+ const { singleMode, urlMode, urlArgs } = props;
475
+ const urlProp = computeUrlProp.value;
476
+ const nameProp = computeNameProp.value;
477
+ let restList = vals ? vals.slice(0) : [];
478
+ if (urlMode) {
479
+ restList = restList.map((item) => {
480
+ const url = item[urlProp];
481
+ if (url && urlArgs) {
482
+ const urlObj = import_xe_utils.default.parseUrl(url);
483
+ if (!urlObj.searchQuery[nameProp]) {
484
+ if (url.indexOf("blob:") === -1) {
485
+ return `${url}${url.indexOf("?") === -1 ? "?" : "&"}${nameProp}=${encodeURIComponent(item[nameProp] || "")}`;
486
+ }
484
487
  }
485
488
  }
486
- }
487
- return url;
488
- });
489
- }
490
- const value = singleMode ? restList[0] || null : restList;
491
- emitModel(value);
492
- return value;
493
- };
494
- const handleChangeEvent = (evnt, vals) => {
495
- const value = handleModel(vals);
496
- dispatchEvent("change", { value }, evnt);
497
- return value;
498
- };
499
- const getThumbnailFileUrl = (item) => {
500
- const getThumbnailUrlFn = props.getThumbnailUrlMethod || getConfig().upload.getThumbnailUrlMethod;
501
- if (getThumbnailUrlFn) {
502
- return getThumbnailUrlFn({
503
- $upload: $xeUpload,
504
- option: item
505
- });
506
- }
507
- return getFileUrl(item);
508
- };
509
- const getFileUrl = (item) => {
510
- const getUrlFn = props.getUrlMethod || getConfig().upload.getUrlMethod;
511
- const urlProp = computeUrlProp.value;
512
- return getUrlFn ? getUrlFn({
513
- $upload: $xeUpload,
514
- option: item
515
- }) : item[urlProp];
516
- };
517
- const handleDefaultFilePreview = (item) => {
518
- const { imageTypes, showDownloadButton } = props;
519
- const typeProp = computeTypeProp.value;
520
- const previewImageOpts = computePreviewImageOpts.value;
521
- const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
522
- const { imagePreviewTypes } = internalData;
523
- if (imagePreviewTypes.concat(imageTypes || []).some((type) => `${type}`.toLowerCase() === `${item[typeProp]}`.toLowerCase())) {
524
- if (import_core.VxeUI.previewImage) {
525
- import_core.VxeUI.previewImage({
526
- ...previewImageOpts,
527
- urlList: [getFileUrl(item)],
528
- showDownloadButton,
529
- beforeDownloadMethod: beforeDownloadFn ? () => {
530
- return beforeDownloadFn({
531
- $upload: $xeUpload,
532
- option: item
533
- });
534
- } : void 0
489
+ return url;
535
490
  });
536
491
  }
537
- }
538
- };
539
- const handlePreviewFileEvent = (evnt, item) => {
540
- const previewFn = props.previewMethod || getConfig().upload.previewMethod;
541
- if (props.showPreview) {
542
- if (previewFn) {
543
- previewFn({
492
+ const value = singleMode ? restList[0] || null : restList;
493
+ emitModel(value);
494
+ return value;
495
+ };
496
+ const handleChangeEvent = (evnt, vals) => {
497
+ const value = handleModel(vals);
498
+ dispatchEvent("change", { value }, evnt);
499
+ return value;
500
+ };
501
+ const getThumbnailFileUrl = (item) => {
502
+ const getThumbnailUrlFn = props.getThumbnailUrlMethod || getConfig().upload.getThumbnailUrlMethod;
503
+ if (getThumbnailUrlFn) {
504
+ return getThumbnailUrlFn({
544
505
  $upload: $xeUpload,
545
506
  option: item
546
507
  });
547
- } else {
548
- handleDefaultFilePreview(item);
549
508
  }
550
- }
551
- };
552
- const handlePreviewImageEvent = (evnt, item, index) => {
553
- const { showDownloadButton } = props;
554
- const { fileList } = reactData;
555
- const previewImageOpts = computePreviewImageOpts.value;
556
- const previewFn = props.previewMethod || getConfig().upload.previewMethod;
557
- const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
558
- if (props.showPreview) {
559
- if (previewFn) {
560
- previewFn({
561
- $upload: $xeUpload,
562
- option: item
563
- });
564
- } else if (import_core.VxeUI.previewImage) {
565
- import_core.VxeUI.previewImage({
566
- ...previewImageOpts,
567
- urlList: fileList.map((item2) => getFileUrl(item2)),
568
- activeIndex: index,
569
- showDownloadButton,
570
- beforeDownloadMethod: beforeDownloadFn ? ({ index: index2 }) => {
571
- return beforeDownloadFn({
572
- $upload: $xeUpload,
573
- option: fileList[index2]
574
- });
575
- } : void 0
576
- });
509
+ return getFileUrl(item);
510
+ };
511
+ const getFileUrl = (item) => {
512
+ const getUrlFn = props.getUrlMethod || getConfig().upload.getUrlMethod;
513
+ const urlProp = computeUrlProp.value;
514
+ return getUrlFn ? getUrlFn({
515
+ $upload: $xeUpload,
516
+ option: item
517
+ }) : item[urlProp];
518
+ };
519
+ const handleDefaultFilePreview = (item) => {
520
+ const { imageTypes, showDownloadButton } = props;
521
+ const typeProp = computeTypeProp.value;
522
+ const previewImageOpts = computePreviewImageOpts.value;
523
+ const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
524
+ const { imagePreviewTypes } = internalData;
525
+ if (imagePreviewTypes.concat(imageTypes || []).some((type) => `${type}`.toLowerCase() === `${item[typeProp]}`.toLowerCase())) {
526
+ if (import_core.VxeUI.previewImage) {
527
+ import_core.VxeUI.previewImage({
528
+ ...previewImageOpts,
529
+ urlList: [getFileUrl(item)],
530
+ showDownloadButton,
531
+ beforeDownloadMethod: beforeDownloadFn ? () => {
532
+ return beforeDownloadFn({
533
+ $upload: $xeUpload,
534
+ option: item
535
+ });
536
+ } : void 0
537
+ });
538
+ }
577
539
  }
578
- }
579
- };
580
- const handleUploadResult = (item, file) => {
581
- const { showErrorStatus } = props;
582
- const fileKey = getFieldKey(item);
583
- const uploadFn = props.uploadMethod || getConfig().upload.uploadMethod;
584
- if (uploadFn) {
585
- dispatchEvent("upload-start", { option: item }, null);
586
- return Promise.resolve(
587
- uploadFn({
588
- $upload: $xeUpload,
589
- file,
590
- option: item,
591
- updateProgress(percentNum) {
592
- const { fileCacheMaps } = reactData;
593
- const cacheItem = fileCacheMaps[getFieldKey(item)];
594
- if (cacheItem) {
595
- cacheItem.percent = Math.max(0, Math.min(99, import_xe_utils.default.toNumber(percentNum)));
596
- }
597
- }
598
- })
599
- ).then((res) => {
600
- const { fileCacheMaps } = reactData;
601
- const cacheItem = fileCacheMaps[fileKey];
602
- if (cacheItem) {
603
- cacheItem.percent = 100;
604
- cacheItem.status = "success";
605
- cacheItem.response = res;
540
+ };
541
+ const handlePreviewFileEvent = (evnt, item) => {
542
+ const previewFn = props.previewMethod || getConfig().upload.previewMethod;
543
+ if (props.showPreview) {
544
+ if (previewFn) {
545
+ previewFn({
546
+ $upload: $xeUpload,
547
+ option: item
548
+ });
549
+ } else {
550
+ handleDefaultFilePreview(item);
606
551
  }
607
- Object.assign(item, res);
608
- handleModel(reactData.fileList);
609
- dispatchEvent("upload-success", { option: item, data: res }, null);
610
- }).catch((res) => {
611
- const { fileCacheMaps } = reactData;
612
- const cacheItem = fileCacheMaps[fileKey];
613
- if (cacheItem) {
614
- cacheItem.status = "error";
615
- cacheItem.response = res;
552
+ }
553
+ };
554
+ const handlePreviewImageEvent = (evnt, item, index) => {
555
+ const { showDownloadButton } = props;
556
+ const { fileList } = reactData;
557
+ const previewImageOpts = computePreviewImageOpts.value;
558
+ const previewFn = props.previewMethod || getConfig().upload.previewMethod;
559
+ const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
560
+ if (props.showPreview) {
561
+ if (previewFn) {
562
+ previewFn({
563
+ $upload: $xeUpload,
564
+ option: item
565
+ });
566
+ } else if (import_core.VxeUI.previewImage) {
567
+ import_core.VxeUI.previewImage({
568
+ ...previewImageOpts,
569
+ urlList: fileList.map((item2) => getFileUrl(item2)),
570
+ activeIndex: index,
571
+ showDownloadButton,
572
+ beforeDownloadMethod: beforeDownloadFn ? ({ index: index2 }) => {
573
+ return beforeDownloadFn({
574
+ $upload: $xeUpload,
575
+ option: fileList[index2]
576
+ });
577
+ } : void 0
578
+ });
616
579
  }
617
- if (showErrorStatus) {
580
+ }
581
+ };
582
+ const handleUploadResult = (item, file) => {
583
+ const { showErrorStatus } = props;
584
+ const fileKey = getFieldKey(item);
585
+ const uploadFn = props.uploadMethod || getConfig().upload.uploadMethod;
586
+ if (uploadFn) {
587
+ dispatchEvent("upload-start", { option: item }, null);
588
+ return Promise.resolve(
589
+ uploadFn({
590
+ $upload: $xeUpload,
591
+ file,
592
+ option: item,
593
+ updateProgress(percentNum) {
594
+ const { fileCacheMaps } = reactData;
595
+ const cacheItem = fileCacheMaps[getFieldKey(item)];
596
+ if (cacheItem) {
597
+ cacheItem.percent = Math.max(0, Math.min(99, import_xe_utils.default.toNumber(percentNum)));
598
+ }
599
+ }
600
+ })
601
+ ).then((res) => {
602
+ const { fileCacheMaps } = reactData;
603
+ const cacheItem = fileCacheMaps[fileKey];
604
+ if (cacheItem) {
605
+ cacheItem.percent = 100;
606
+ cacheItem.status = "success";
607
+ cacheItem.response = res;
608
+ }
618
609
  Object.assign(item, res);
619
- } else {
620
- reactData.fileList = reactData.fileList.filter((obj) => getFieldKey(obj) !== fileKey);
621
- delete fileCacheMaps[fileKey];
622
- }
623
- handleModel(reactData.fileList);
624
- dispatchEvent("upload-error", { option: item, data: res }, null);
625
- }).finally(() => {
610
+ handleModel(reactData.fileList);
611
+ dispatchEvent("upload-success", { option: item, data: res }, null);
612
+ }).catch((res) => {
613
+ const { fileCacheMaps } = reactData;
614
+ const cacheItem = fileCacheMaps[fileKey];
615
+ if (cacheItem) {
616
+ cacheItem.status = "error";
617
+ cacheItem.response = res;
618
+ }
619
+ if (showErrorStatus) {
620
+ Object.assign(item, res);
621
+ } else {
622
+ reactData.fileList = reactData.fileList.filter((obj) => getFieldKey(obj) !== fileKey);
623
+ delete fileCacheMaps[fileKey];
624
+ }
625
+ handleModel(reactData.fileList);
626
+ dispatchEvent("upload-error", { option: item, data: res }, null);
627
+ }).finally(() => {
628
+ const { fileCacheMaps } = reactData;
629
+ const cacheItem = fileCacheMaps[fileKey];
630
+ if (cacheItem) {
631
+ cacheItem.loading = false;
632
+ }
633
+ const result = {
634
+ option: item,
635
+ status: cacheItem ? cacheItem.status : null,
636
+ response: cacheItem ? cacheItem.response : null
637
+ };
638
+ dispatchEvent("upload-end", { option: item, result }, null);
639
+ });
640
+ } else {
626
641
  const { fileCacheMaps } = reactData;
627
642
  const cacheItem = fileCacheMaps[fileKey];
628
643
  if (cacheItem) {
629
644
  cacheItem.loading = false;
630
645
  }
631
- const result = {
632
- option: item,
633
- status: cacheItem ? cacheItem.status : null,
634
- response: cacheItem ? cacheItem.response : null
635
- };
636
- dispatchEvent("upload-end", { option: item, result }, null);
637
- });
638
- } else {
646
+ }
647
+ return Promise.resolve();
648
+ };
649
+ const handleReUploadEvent = (evnt, item) => {
650
+ const { uploadMethod, urlMode } = props;
639
651
  const { fileCacheMaps } = reactData;
652
+ const fileKey = getFieldKey(item);
640
653
  const cacheItem = fileCacheMaps[fileKey];
641
- if (cacheItem) {
642
- cacheItem.loading = false;
643
- }
644
- }
645
- return Promise.resolve();
646
- };
647
- const handleReUploadEvent = (evnt, item) => {
648
- const { uploadMethod, urlMode } = props;
649
- const { fileCacheMaps } = reactData;
650
- const fileKey = getFieldKey(item);
651
- const cacheItem = fileCacheMaps[fileKey];
652
- const uploadFn = uploadMethod || getConfig().upload.uploadMethod;
653
- if (uploadFn && cacheItem) {
654
- const file = cacheItem.file;
655
- cacheItem.loading = true;
656
- cacheItem.status = "pending";
657
- cacheItem.percent = 0;
658
- handleUploadResult(item, file).then(() => {
659
- if (urlMode) {
660
- handleChangeEvent(evnt, reactData.fileList);
661
- }
662
- });
663
- }
664
- };
665
- const handleUploadFile = (files, evnt) => {
666
- const { multiple, showLimitSize, limitSizeText, showLimitCount, limitCountText, autoSubmit } = props;
667
- const { fileList } = reactData;
668
- const beforeSelectFn = props.beforeSelectMethod || getConfig().upload.beforeSelectMethod;
669
- const uploadFn = props.uploadMethod || getConfig().upload.uploadMethod;
670
- const keyField = computeKeyField.value;
671
- const nameProp = computeNameProp.value;
672
- const typeProp = computeTypeProp.value;
673
- const urlProp = computeUrlProp.value;
674
- const sizeProp = computeSizeProp.value;
675
- const limitMaxSize = computeLimitMaxSize.value;
676
- const limitMaxCount = computeLimitMaxCount.value;
677
- const limitSizeUnit = computeLimitSizeUnit.value;
678
- let selectFiles = files;
679
- if (multiple && limitMaxCount) {
680
- if (showLimitCount && fileList.length >= limitMaxCount) {
681
- if (import_core.VxeUI.modal) {
682
- import_core.VxeUI.modal.notification({
683
- title: getI18n("vxe.modal.errTitle"),
684
- status: "error",
685
- content: limitCountText ? `${import_xe_utils.default.isFunction(limitCountText) ? limitCountText({ maxCount: limitMaxCount }) : limitCountText}` : getI18n("vxe.upload.overCountErr", [limitMaxCount])
686
- });
687
- }
688
- return;
689
- }
690
- const overNum = selectFiles.length - (limitMaxCount - fileList.length);
691
- if (showLimitCount && overNum > 0) {
692
- const overExtraList = selectFiles.slice(limitMaxCount - fileList.length);
693
- if (limitCountText) {
694
- import_core.VxeUI.modal.notification({
695
- title: getI18n("vxe.modal.errTitle"),
696
- status: "error",
697
- content: `${import_xe_utils.default.isFunction(limitCountText) ? limitCountText({ maxCount: limitMaxCount }) : limitCountText}`
698
- });
699
- } else if (import_core.VxeUI.modal) {
700
- import_core.VxeUI.modal.notification({
701
- title: getI18n("vxe.modal.errTitle"),
702
- status: "error",
703
- width: null,
704
- slots: {
705
- default() {
706
- return (0, import_vue.h)(
707
- "div",
708
- {
709
- class: "vxe-upload--file-message-over-error"
710
- },
711
- [
712
- (0, import_vue.h)("div", {}, getI18n("vxe.upload.overCountExtraErr", [limitMaxCount, overNum])),
713
- (0, import_vue.h)(
714
- "div",
715
- {
716
- class: "vxe-upload--file-message-over-extra"
717
- },
718
- overExtraList.map((file, index) => {
719
- return (0, import_vue.h)(
720
- "div",
721
- {
722
- key: index,
723
- class: "vxe-upload--file-message-over-extra-item"
724
- },
725
- file.name
726
- );
727
- })
728
- )
729
- ]
730
- );
731
- }
732
- }
733
- });
734
- }
654
+ const uploadFn = uploadMethod || getConfig().upload.uploadMethod;
655
+ if (uploadFn && cacheItem) {
656
+ const file = cacheItem.file;
657
+ cacheItem.loading = true;
658
+ cacheItem.status = "pending";
659
+ cacheItem.percent = 0;
660
+ handleUploadResult(item, file).then(() => {
661
+ if (urlMode) {
662
+ handleChangeEvent(evnt, reactData.fileList);
663
+ }
664
+ });
735
665
  }
736
- selectFiles = selectFiles.slice(0, limitMaxCount - fileList.length);
737
- }
738
- if (showLimitSize && limitMaxSize) {
739
- for (let i = 0; i < files.length; i++) {
740
- const file = files[0];
741
- if (file.size > limitMaxSize) {
666
+ };
667
+ const handleUploadFile = (files, evnt) => {
668
+ const { multiple, showLimitSize, limitSizeText, showLimitCount, limitCountText, autoSubmit } = props;
669
+ const { fileList } = reactData;
670
+ const beforeSelectFn = props.beforeSelectMethod || getConfig().upload.beforeSelectMethod;
671
+ const uploadFn = props.uploadMethod || getConfig().upload.uploadMethod;
672
+ const keyField = computeKeyField.value;
673
+ const nameProp = computeNameProp.value;
674
+ const typeProp = computeTypeProp.value;
675
+ const urlProp = computeUrlProp.value;
676
+ const sizeProp = computeSizeProp.value;
677
+ const limitMaxSize = computeLimitMaxSize.value;
678
+ const limitMaxCount = computeLimitMaxCount.value;
679
+ const limitSizeUnit = computeLimitSizeUnit.value;
680
+ let selectFiles = files;
681
+ if (multiple && limitMaxCount) {
682
+ if (showLimitCount && fileList.length >= limitMaxCount) {
742
683
  if (import_core.VxeUI.modal) {
743
684
  import_core.VxeUI.modal.notification({
744
685
  title: getI18n("vxe.modal.errTitle"),
745
686
  status: "error",
746
- content: limitSizeText ? `${import_xe_utils.default.isFunction(limitSizeText) ? limitSizeText({ maxSize: limitMaxSize }) : limitSizeText}` : getI18n("vxe.upload.overSizeErr", [limitSizeUnit])
687
+ content: limitCountText ? `${import_xe_utils.default.isFunction(limitCountText) ? limitCountText({ maxCount: limitMaxCount }) : limitCountText}` : getI18n("vxe.upload.overCountErr", [limitMaxCount])
747
688
  });
748
689
  }
749
690
  return;
750
691
  }
692
+ const overNum = selectFiles.length - (limitMaxCount - fileList.length);
693
+ if (showLimitCount && overNum > 0) {
694
+ const overExtraList = selectFiles.slice(limitMaxCount - fileList.length);
695
+ if (limitCountText) {
696
+ import_core.VxeUI.modal.notification({
697
+ title: getI18n("vxe.modal.errTitle"),
698
+ status: "error",
699
+ content: `${import_xe_utils.default.isFunction(limitCountText) ? limitCountText({ maxCount: limitMaxCount }) : limitCountText}`
700
+ });
701
+ } else if (import_core.VxeUI.modal) {
702
+ import_core.VxeUI.modal.notification({
703
+ title: getI18n("vxe.modal.errTitle"),
704
+ status: "error",
705
+ width: null,
706
+ slots: {
707
+ default() {
708
+ return (0, import_vue.h)(
709
+ "div",
710
+ {
711
+ class: "vxe-upload--file-message-over-error"
712
+ },
713
+ [
714
+ (0, import_vue.h)("div", {}, getI18n("vxe.upload.overCountExtraErr", [limitMaxCount, overNum])),
715
+ (0, import_vue.h)(
716
+ "div",
717
+ {
718
+ class: "vxe-upload--file-message-over-extra"
719
+ },
720
+ overExtraList.map((file, index) => {
721
+ return (0, import_vue.h)(
722
+ "div",
723
+ {
724
+ key: index,
725
+ class: "vxe-upload--file-message-over-extra-item"
726
+ },
727
+ file.name
728
+ );
729
+ })
730
+ )
731
+ ]
732
+ );
733
+ }
734
+ }
735
+ });
736
+ }
737
+ }
738
+ selectFiles = selectFiles.slice(0, limitMaxCount - fileList.length);
751
739
  }
752
- }
753
- dispatchEvent("upload-queue-start", { files: selectFiles }, evnt);
754
- const cacheMaps = Object.assign({}, reactData.fileCacheMaps);
755
- const uploadFileList = multiple ? fileList : [];
756
- const newFileList = [];
757
- const uploadPromiseRests = [];
758
- selectFiles.forEach((file) => {
759
- const { name } = file;
760
- const fileKey = getUniqueKey();
761
- const fileObj = {
762
- [nameProp]: name,
763
- [typeProp]: parseFileType(name),
764
- [sizeProp]: file.size,
765
- [urlProp]: URL.createObjectURL(file),
766
- [keyField]: fileKey
767
- };
768
- if (uploadFn) {
769
- cacheMaps[fileKey] = {
770
- file,
771
- loading: !!autoSubmit,
772
- status: "pending",
773
- percent: 0,
774
- response: null
775
- };
776
- }
777
- const item = (0, import_vue.reactive)(fileObj);
778
- if (!beforeSelectFn || beforeSelectFn({ $upload: $xeUpload, file })) {
779
- if (uploadFn && autoSubmit) {
780
- uploadPromiseRests.push(handleUploadResult(item, file));
740
+ if (showLimitSize && limitMaxSize) {
741
+ for (let i = 0; i < files.length; i++) {
742
+ const file = files[0];
743
+ if (file.size > limitMaxSize) {
744
+ if (import_core.VxeUI.modal) {
745
+ import_core.VxeUI.modal.notification({
746
+ title: getI18n("vxe.modal.errTitle"),
747
+ status: "error",
748
+ content: limitSizeText ? `${import_xe_utils.default.isFunction(limitSizeText) ? limitSizeText({ maxSize: limitMaxSize }) : limitSizeText}` : getI18n("vxe.upload.overSizeErr", [limitSizeUnit])
749
+ });
750
+ }
751
+ return;
752
+ }
781
753
  }
782
- newFileList.push(item);
783
- uploadFileList.push(item);
784
754
  }
785
- });
786
- reactData.fileList = uploadFileList;
787
- reactData.fileCacheMaps = cacheMaps;
788
- uploadFileList.forEach((item) => {
789
- dispatchEvent("add", { option: item }, evnt);
790
- });
791
- Promise.all(uploadPromiseRests).then(() => {
792
- const { fileCacheMaps } = reactData;
793
- const restFileList = reactData.fileList;
794
- const uploadResults = newFileList.map((option) => {
795
- const fileKey = getFieldKey(option);
796
- const cacheItem = fileCacheMaps[fileKey];
797
- return {
798
- option,
799
- status: cacheItem ? cacheItem.status : null,
800
- response: cacheItem ? cacheItem.response : null
755
+ dispatchEvent("upload-queue-start", { files: selectFiles }, evnt);
756
+ const cacheMaps = Object.assign({}, reactData.fileCacheMaps);
757
+ const uploadFileList = multiple ? fileList : [];
758
+ const newFileList = [];
759
+ const uploadPromiseRests = [];
760
+ selectFiles.forEach((file) => {
761
+ const { name } = file;
762
+ const fileKey = getUniqueKey();
763
+ const fileObj = {
764
+ [nameProp]: name,
765
+ [typeProp]: parseFileType(name),
766
+ [sizeProp]: file.size,
767
+ [urlProp]: URL.createObjectURL(file),
768
+ [keyField]: fileKey
801
769
  };
770
+ if (uploadFn) {
771
+ cacheMaps[fileKey] = {
772
+ file,
773
+ loading: !!autoSubmit,
774
+ status: "pending",
775
+ percent: 0,
776
+ response: null
777
+ };
778
+ }
779
+ const item = (0, import_vue.reactive)(fileObj);
780
+ if (!beforeSelectFn || beforeSelectFn({ $upload: $xeUpload, file })) {
781
+ if (uploadFn && autoSubmit) {
782
+ uploadPromiseRests.push(handleUploadResult(item, file));
783
+ }
784
+ newFileList.push(item);
785
+ uploadFileList.push(item);
786
+ }
802
787
  });
803
- const value = handleChangeEvent(evnt, restFileList);
804
- dispatchEvent("upload-queue-end", { value, options: restFileList, results: uploadResults, files: selectFiles }, evnt);
805
- if ($xeForm && formItemInfo) {
806
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
788
+ reactData.fileList = uploadFileList;
789
+ reactData.fileCacheMaps = cacheMaps;
790
+ uploadFileList.forEach((item) => {
791
+ dispatchEvent("add", { option: item }, evnt);
792
+ });
793
+ Promise.all(uploadPromiseRests).then(() => {
794
+ const { fileCacheMaps } = reactData;
795
+ const restFileList = reactData.fileList;
796
+ const uploadResults = newFileList.map((option) => {
797
+ const fileKey = getFieldKey(option);
798
+ const cacheItem = fileCacheMaps[fileKey];
799
+ return {
800
+ option,
801
+ status: cacheItem ? cacheItem.status : null,
802
+ response: cacheItem ? cacheItem.response : null
803
+ };
804
+ });
805
+ const value = handleChangeEvent(evnt, restFileList);
806
+ dispatchEvent("upload-queue-end", { value, options: restFileList, results: uploadResults, files: selectFiles }, evnt);
807
+ if ($xeForm && formItemInfo) {
808
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
809
+ }
810
+ });
811
+ };
812
+ const handleChoose = (evnt) => {
813
+ const { multiple, imageTypes, fileTypes } = props;
814
+ const isDisabled = computeIsDisabled.value;
815
+ const isImage = computeIsImage.value;
816
+ if (isDisabled) {
817
+ return Promise.resolve({
818
+ status: false,
819
+ files: [],
820
+ file: null
821
+ });
807
822
  }
808
- });
809
- };
810
- const handleChoose = (evnt) => {
811
- const { multiple, imageTypes, fileTypes } = props;
812
- const isDisabled = computeIsDisabled.value;
813
- const isImage = computeIsImage.value;
814
- if (isDisabled) {
815
- return Promise.resolve({
816
- status: false,
817
- files: [],
818
- file: null
823
+ return (0, import_util.readLocalFile)({
824
+ multiple,
825
+ types: isImage ? imageTypes : fileTypes
826
+ }).then((params) => {
827
+ handleUploadFile(params.files, evnt);
828
+ return params;
819
829
  });
820
- }
821
- return (0, import_util.readLocalFile)({
822
- multiple,
823
- types: isImage ? imageTypes : fileTypes
824
- }).then((params) => {
825
- handleUploadFile(params.files, evnt);
826
- return params;
827
- });
828
- };
829
- const clickEvent = (evnt) => {
830
- handleChoose(evnt).catch(() => {
831
- });
832
- };
833
- const handleRemoveEvent = (evnt, item, index) => {
834
- const { fileList } = reactData;
835
- fileList.splice(index, 1);
836
- handleChangeEvent(evnt, fileList);
837
- if ($xeForm && formItemInfo) {
838
- $xeForm.triggerItemEvent(evnt || { type: "remove" }, formItemInfo.itemConfig.field, fileList);
839
- }
840
- if (evnt) {
841
- dispatchEvent("remove", { option: item }, evnt);
842
- }
843
- };
844
- const removeFileEvent = (evnt, item, index) => {
845
- const beforeRemoveFn = props.beforeRemoveMethod || getConfig().upload.beforeRemoveMethod;
846
- const removeFn = props.removeMethod || getConfig().upload.removeMethod;
847
- return Promise.resolve(
848
- beforeRemoveFn ? beforeRemoveFn({
849
- $upload: $xeUpload,
850
- option: item
851
- }) : true
852
- ).then((status) => {
853
- if (status) {
854
- if (removeFn) {
855
- Promise.resolve(
856
- removeFn({
857
- $upload: $xeUpload,
858
- option: item
859
- })
860
- ).then(() => {
830
+ };
831
+ const clickEvent = (evnt) => {
832
+ handleChoose(evnt).catch(() => {
833
+ });
834
+ };
835
+ const handleRemoveEvent = (evnt, item, index) => {
836
+ const { fileList } = reactData;
837
+ fileList.splice(index, 1);
838
+ handleChangeEvent(evnt, fileList);
839
+ if ($xeForm && formItemInfo) {
840
+ $xeForm.triggerItemEvent(evnt || { type: "remove" }, formItemInfo.itemConfig.field, fileList);
841
+ }
842
+ if (evnt) {
843
+ dispatchEvent("remove", { option: item }, evnt);
844
+ }
845
+ };
846
+ const removeFileEvent = (evnt, item, index) => {
847
+ const beforeRemoveFn = props.beforeRemoveMethod || getConfig().upload.beforeRemoveMethod;
848
+ const removeFn = props.removeMethod || getConfig().upload.removeMethod;
849
+ return Promise.resolve(
850
+ beforeRemoveFn ? beforeRemoveFn({
851
+ $upload: $xeUpload,
852
+ option: item
853
+ }) : true
854
+ ).then((status) => {
855
+ if (status) {
856
+ if (removeFn) {
857
+ Promise.resolve(
858
+ removeFn({
859
+ $upload: $xeUpload,
860
+ option: item
861
+ })
862
+ ).then(() => {
863
+ handleRemoveEvent(evnt, item, index);
864
+ }).catch((e) => e);
865
+ } else {
861
866
  handleRemoveEvent(evnt, item, index);
862
- }).catch((e) => e);
867
+ }
863
868
  } else {
864
- handleRemoveEvent(evnt, item, index);
869
+ if (evnt) {
870
+ dispatchEvent("remove-fail", { option: item }, evnt);
871
+ }
865
872
  }
873
+ return status;
874
+ });
875
+ };
876
+ const handleDownloadEvent = (evnt, item) => {
877
+ dispatchEvent("download", { option: item }, evnt);
878
+ };
879
+ const downloadFileEvent = (evnt, item) => {
880
+ const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
881
+ const downloadFn = props.downloadMethod || getConfig().upload.downloadMethod;
882
+ Promise.resolve(
883
+ beforeDownloadFn ? beforeDownloadFn({
884
+ $upload: $xeUpload,
885
+ option: item
886
+ }) : true
887
+ ).then((status) => {
888
+ if (status) {
889
+ if (downloadFn) {
890
+ Promise.resolve(
891
+ downloadFn({
892
+ $upload: $xeUpload,
893
+ option: item
894
+ })
895
+ ).then(() => {
896
+ handleDownloadEvent(evnt, item);
897
+ }).catch((e) => e);
898
+ } else {
899
+ handleDownloadEvent(evnt, item);
900
+ }
901
+ } else {
902
+ dispatchEvent("download-fail", { option: item }, evnt);
903
+ }
904
+ });
905
+ };
906
+ const handleUploadDragleaveEvent = (evnt) => {
907
+ const targetElem = evnt.currentTarget;
908
+ const { clientX, clientY } = evnt;
909
+ if (targetElem) {
910
+ const { x: targetX, y: targetY, height: targetHeight, width: targetWidth } = targetElem.getBoundingClientRect();
911
+ if (clientX < targetX || clientX > targetX + targetWidth || clientY < targetY || clientY > targetY + targetHeight) {
912
+ reactData.isDragUploadStatus = false;
913
+ }
914
+ }
915
+ };
916
+ const handleUploadDragoverEvent = (evnt) => {
917
+ const dataTransfer = evnt.dataTransfer;
918
+ if (dataTransfer) {
919
+ const { items } = dataTransfer;
920
+ if (items && items.length) {
921
+ evnt.preventDefault();
922
+ reactData.isDragUploadStatus = true;
923
+ }
924
+ }
925
+ };
926
+ const uploadTransferFileEvent = (evnt, files) => {
927
+ const { imageTypes, fileTypes } = props;
928
+ const { imagePreviewTypes } = internalData;
929
+ const isImage = computeIsImage.value;
930
+ if (isImage) {
931
+ const pasteImgTypes = imagePreviewTypes.concat(imageTypes && imageTypes.length ? imageTypes : []);
932
+ files = files.filter((file) => {
933
+ const fileType = `${file.type.split("/")[1] || ""}`.toLowerCase();
934
+ if (pasteImgTypes.some((type) => `${type}`.toLowerCase() === fileType)) {
935
+ return true;
936
+ }
937
+ return false;
938
+ });
866
939
  } else {
867
- if (evnt) {
868
- dispatchEvent("remove-fail", { option: item }, evnt);
940
+ if (fileTypes && fileTypes.length) {
941
+ const errTypes = [];
942
+ files.forEach((file) => {
943
+ const fileType = parseFileType(file.name);
944
+ if (!fileTypes.some((type) => `${type}`.toLowerCase() === fileType)) {
945
+ errTypes.push(fileType);
946
+ }
947
+ });
948
+ if (errTypes.length) {
949
+ if (import_core.VxeUI.modal) {
950
+ import_core.VxeUI.modal.message({
951
+ content: getI18n("vxe.error.notType", [errTypes.join(", ")]),
952
+ status: "error"
953
+ });
954
+ }
955
+ return;
956
+ }
869
957
  }
870
958
  }
871
- return status;
872
- });
873
- };
874
- const handleDownloadEvent = (evnt, item) => {
875
- dispatchEvent("download", { option: item }, evnt);
876
- };
877
- const downloadFileEvent = (evnt, item) => {
878
- const beforeDownloadFn = props.beforeDownloadMethod || getConfig().upload.beforeDownloadMethod;
879
- const downloadFn = props.downloadMethod || getConfig().upload.downloadMethod;
880
- Promise.resolve(
881
- beforeDownloadFn ? beforeDownloadFn({
882
- $upload: $xeUpload,
883
- option: item
884
- }) : true
885
- ).then((status) => {
886
- if (status) {
887
- if (downloadFn) {
888
- Promise.resolve(
889
- downloadFn({
890
- $upload: $xeUpload,
891
- option: item
892
- })
893
- ).then(() => {
894
- handleDownloadEvent(evnt, item);
895
- }).catch((e) => e);
896
- } else {
897
- handleDownloadEvent(evnt, item);
959
+ if (!files.length) {
960
+ if (import_core.VxeUI.modal) {
961
+ import_core.VxeUI.modal.notification({
962
+ title: getI18n("vxe.modal.errTitle"),
963
+ status: "error",
964
+ content: getI18n("vxe.upload.uploadTypeErr")
965
+ });
966
+ }
967
+ return;
968
+ }
969
+ handleUploadFile(files, evnt);
970
+ };
971
+ const handleUploadDropEvent = (evnt) => {
972
+ const dataTransfer = evnt.dataTransfer;
973
+ if (dataTransfer) {
974
+ const { items } = dataTransfer;
975
+ if (items && items.length) {
976
+ evnt.preventDefault();
977
+ const files = handleTransferFiles(items);
978
+ if (files.length) {
979
+ uploadTransferFileEvent(evnt, files);
980
+ }
981
+ }
982
+ }
983
+ reactData.isDragUploadStatus = false;
984
+ };
985
+ const handleTransferFiles = (items) => {
986
+ const files = [];
987
+ import_xe_utils.default.arrayEach(items, (item) => {
988
+ const file = item.getAsFile();
989
+ if (file) {
990
+ files.push(file);
898
991
  }
992
+ });
993
+ return files;
994
+ };
995
+ const handleMoreEvent = (evntParams) => {
996
+ const formReadonly = computeFormReadonly.value;
997
+ const isImage = computeIsImage.value;
998
+ const evnt = evntParams.$event;
999
+ if (import_core.VxeUI.modal) {
1000
+ import_core.VxeUI.modal.open({
1001
+ id: internalData.moreId,
1002
+ title: formReadonly ? getI18n("vxe.upload.morePopup.readTitle") : getI18n(`vxe.upload.morePopup.${isImage ? "imageTitle" : "fileTitle"}`),
1003
+ width: 660,
1004
+ height: 500,
1005
+ escClosable: true,
1006
+ showMaximize: true,
1007
+ resize: true,
1008
+ maskClosable: true,
1009
+ slots: {
1010
+ default() {
1011
+ const { showErrorStatus, dragToUpload, dragSort, dragPlaceholder } = props;
1012
+ const { isActivated, isDragMove, isDragUploadStatus, dragIndex } = reactData;
1013
+ const { fileList } = reactData;
1014
+ const isDisabled = computeIsDisabled.value;
1015
+ const moreContSlot = slots.moreContent || slots["more-content"];
1016
+ const ons = {};
1017
+ if (dragToUpload && dragIndex === -1) {
1018
+ ons.onDragover = handleUploadDragoverEvent;
1019
+ ons.onDragleave = handleUploadDragleaveEvent;
1020
+ ons.onDrop = handleUploadDropEvent;
1021
+ }
1022
+ return (0, import_vue.h)(
1023
+ "div",
1024
+ {
1025
+ ref: refPopupElem,
1026
+ class: [
1027
+ "vxe-upload--more-popup",
1028
+ {
1029
+ "is--readonly": formReadonly,
1030
+ "is--disabled": isDisabled,
1031
+ "is--active": isActivated,
1032
+ "show--error": showErrorStatus,
1033
+ "is--drag": isDragUploadStatus
1034
+ }
1035
+ ],
1036
+ ...ons
1037
+ },
1038
+ moreContSlot ? (0, import_vn.getSlotVNs)(moreContSlot({ options: fileList })) : [
1039
+ isImage ? dragSort ? (0, import_vue.h)(
1040
+ import_vue.TransitionGroup,
1041
+ {
1042
+ name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1043
+ tag: "div",
1044
+ class: "vxe-upload--image-more-list"
1045
+ },
1046
+ {
1047
+ default: () => renderImageItemList(fileList, true).concat(renderImageAction(true))
1048
+ }
1049
+ ) : (0, import_vue.h)(
1050
+ "div",
1051
+ {
1052
+ class: "vxe-upload--image-more-list"
1053
+ },
1054
+ renderImageItemList(fileList, true).concat(renderImageAction(true))
1055
+ ) : (0, import_vue.h)(
1056
+ "div",
1057
+ {
1058
+ class: "vxe-upload--file-more-list"
1059
+ },
1060
+ [
1061
+ renderFileAction(true),
1062
+ dragSort ? (0, import_vue.h)(
1063
+ import_vue.TransitionGroup,
1064
+ {
1065
+ name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1066
+ tag: "div",
1067
+ class: "vxe-upload--file-list"
1068
+ },
1069
+ {
1070
+ default: () => renderFileItemList(fileList, false)
1071
+ }
1072
+ ) : (0, import_vue.h)(
1073
+ "div",
1074
+ {
1075
+ class: "vxe-upload--file-list"
1076
+ },
1077
+ renderFileItemList(fileList, true)
1078
+ )
1079
+ ]
1080
+ ),
1081
+ dragSort ? (0, import_vue.h)("div", {
1082
+ ref: refModalDragLineElem,
1083
+ class: "vxe-upload--drag-line"
1084
+ }) : renderEmptyElement($xeUpload),
1085
+ isDragUploadStatus ? (0, import_vue.h)(
1086
+ "div",
1087
+ {
1088
+ class: "vxe-upload--drag-placeholder"
1089
+ },
1090
+ dragPlaceholder || getI18n("vxe.upload.dragPlaceholder")
1091
+ ) : renderEmptyElement($xeUpload)
1092
+ ]
1093
+ );
1094
+ }
1095
+ },
1096
+ onShow() {
1097
+ reactData.showMorePopup = true;
1098
+ },
1099
+ onHide({ $event }) {
1100
+ reactData.showMorePopup = false;
1101
+ if ($event) {
1102
+ dispatchEvent("more-visible", { visible: false }, $event);
1103
+ }
1104
+ }
1105
+ });
1106
+ if (evnt) {
1107
+ dispatchEvent("more-visible", { visible: true }, evnt);
1108
+ }
1109
+ }
1110
+ };
1111
+ const showDropTip = (evnt, dragEl, dragPos) => {
1112
+ const { showMorePopup } = reactData;
1113
+ const el = refElem.value;
1114
+ const popupEl = refPopupElem.value;
1115
+ const wrapperEl = showMorePopup ? popupEl : el;
1116
+ if (!wrapperEl) {
1117
+ return;
1118
+ }
1119
+ const wrapperRect = wrapperEl.getBoundingClientRect();
1120
+ const ddLineEl = refDragLineElem.value;
1121
+ const mdLineEl = refModalDragLineElem.value;
1122
+ const currDLineEl = showMorePopup ? mdLineEl : ddLineEl;
1123
+ if (currDLineEl) {
1124
+ const dragRect = dragEl.getBoundingClientRect();
1125
+ currDLineEl.style.display = "block";
1126
+ currDLineEl.style.top = `${Math.max(1, dragRect.y - wrapperRect.y)}px`;
1127
+ currDLineEl.style.left = `${Math.max(1, dragRect.x - wrapperRect.x)}px`;
1128
+ currDLineEl.style.height = `${dragRect.height}px`;
1129
+ currDLineEl.style.width = `${dragRect.width - 1}px`;
1130
+ currDLineEl.setAttribute("drag-pos", dragPos);
1131
+ }
1132
+ };
1133
+ const hideDropTip = () => {
1134
+ const ddLineEl = refDragLineElem.value;
1135
+ const mdLineEl = refModalDragLineElem.value;
1136
+ if (ddLineEl) {
1137
+ ddLineEl.style.display = "";
1138
+ }
1139
+ if (mdLineEl) {
1140
+ mdLineEl.style.display = "";
1141
+ }
1142
+ };
1143
+ const handleDragSortDragstartEvent = (evnt) => {
1144
+ evnt.stopPropagation();
1145
+ if (evnt.dataTransfer) {
1146
+ evnt.dataTransfer.setDragImage((0, import_dom.getTpImg)(), 0, 0);
1147
+ }
1148
+ const dragEl = evnt.currentTarget;
1149
+ const parentEl = dragEl.parentElement;
1150
+ const dragIndex = import_xe_utils.default.findIndexOf(Array.from(parentEl.children), (item) => dragEl === item);
1151
+ reactData.isDragMove = true;
1152
+ reactData.dragIndex = dragIndex;
1153
+ setTimeout(() => {
1154
+ reactData.isDragMove = false;
1155
+ }, 500);
1156
+ };
1157
+ const handleDragSortDragoverEvent = (evnt) => {
1158
+ evnt.stopPropagation();
1159
+ evnt.preventDefault();
1160
+ const { dragIndex } = reactData;
1161
+ if (dragIndex === -1) {
1162
+ return;
1163
+ }
1164
+ const isImage = computeIsImage.value;
1165
+ const dragEl = evnt.currentTarget;
1166
+ const parentEl = dragEl.parentElement;
1167
+ const currIndex = import_xe_utils.default.findIndexOf(Array.from(parentEl.children), (item) => dragEl === item);
1168
+ let dragPos = "";
1169
+ if (isImage) {
1170
+ const offsetX = evnt.clientX - dragEl.getBoundingClientRect().x;
1171
+ dragPos = offsetX < dragEl.clientWidth / 2 ? "left" : "right";
899
1172
  } else {
900
- dispatchEvent("download-fail", { option: item }, evnt);
1173
+ const offsetY = evnt.clientY - dragEl.getBoundingClientRect().y;
1174
+ dragPos = offsetY < dragEl.clientHeight / 2 ? "top" : "bottom";
901
1175
  }
902
- });
903
- };
904
- const handleUploadDragleaveEvent = (evnt) => {
905
- const targetElem = evnt.currentTarget;
906
- const { clientX, clientY } = evnt;
907
- if (targetElem) {
908
- const { x: targetX, y: targetY, height: targetHeight, width: targetWidth } = targetElem.getBoundingClientRect();
909
- if (clientX < targetX || clientX > targetX + targetWidth || clientY < targetY || clientY > targetY + targetHeight) {
910
- reactData.isDragUploadStatus = false;
1176
+ if (dragIndex === currIndex) {
1177
+ showDropTip(evnt, dragEl, dragPos);
1178
+ return;
911
1179
  }
912
- }
913
- };
914
- const handleUploadDragoverEvent = (evnt) => {
915
- const dataTransfer = evnt.dataTransfer;
916
- if (dataTransfer) {
917
- const { items } = dataTransfer;
918
- if (items && items.length) {
1180
+ showDropTip(evnt, dragEl, dragPos);
1181
+ internalData.prevDragIndex = currIndex;
1182
+ internalData.prevDragPos = dragPos;
1183
+ };
1184
+ const handleDragSortDragendEvent = (evnt) => {
1185
+ const { fileList, dragIndex } = reactData;
1186
+ const { prevDragIndex, prevDragPos } = internalData;
1187
+ const oldIndex = dragIndex;
1188
+ const targetIndex = prevDragIndex;
1189
+ const dragOffsetIndex = prevDragPos === "bottom" || prevDragPos === "right" ? 1 : 0;
1190
+ const oldItem = fileList[oldIndex];
1191
+ const newItem = fileList[targetIndex];
1192
+ if (oldItem && newItem) {
1193
+ fileList.splice(oldIndex, 1);
1194
+ const ptfIndex = import_xe_utils.default.findIndexOf(fileList, (item) => newItem === item);
1195
+ const nIndex = ptfIndex + dragOffsetIndex;
1196
+ fileList.splice(nIndex, 0, oldItem);
1197
+ dispatchEvent(
1198
+ "sort-dragend",
1199
+ {
1200
+ oldItem,
1201
+ newItem,
1202
+ dragPos: prevDragPos,
1203
+ offsetIndex: dragOffsetIndex,
1204
+ _index: {
1205
+ newIndex: nIndex,
1206
+ oldIndex
1207
+ }
1208
+ },
1209
+ evnt
1210
+ );
1211
+ }
1212
+ hideDropTip();
1213
+ reactData.dragIndex = -1;
1214
+ };
1215
+ const handleItemMousedownEvent = (evnt) => {
1216
+ if ($xeTable) {
1217
+ evnt.stopPropagation();
1218
+ }
1219
+ reactData.isActivated = true;
1220
+ };
1221
+ const handleGlobalPasteEvent = (evnt) => {
1222
+ const { pasteToUpload } = props;
1223
+ const { isActivated } = reactData;
1224
+ if (!isActivated || !pasteToUpload) {
1225
+ return;
1226
+ }
1227
+ const clipboardData = evnt.clipboardData || evnt.originalEvent.clipboardData;
1228
+ if (!clipboardData) {
1229
+ return;
1230
+ }
1231
+ const { items } = clipboardData;
1232
+ if (!items) {
1233
+ return;
1234
+ }
1235
+ const files = handleTransferFiles(items);
1236
+ if (files.length) {
919
1237
  evnt.preventDefault();
920
- reactData.isDragUploadStatus = true;
1238
+ uploadTransferFileEvent(evnt, files);
921
1239
  }
922
- }
923
- };
924
- const uploadTransferFileEvent = (evnt, files) => {
925
- const { imageTypes, fileTypes } = props;
926
- const { imagePreviewTypes } = internalData;
927
- const isImage = computeIsImage.value;
928
- if (isImage) {
929
- const pasteImgTypes = imagePreviewTypes.concat(imageTypes && imageTypes.length ? imageTypes : []);
930
- files = files.filter((file) => {
931
- const fileType = `${file.type.split("/")[1] || ""}`.toLowerCase();
932
- if (pasteImgTypes.some((type) => `${type}`.toLowerCase() === fileType)) {
933
- return true;
1240
+ };
1241
+ const handleGlobalClickEvent = (evnt) => {
1242
+ const el = refElem.value;
1243
+ const popupEl = refPopupElem.value;
1244
+ let isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag;
1245
+ if (!isActivated && popupEl) {
1246
+ const parentEl = popupEl.parentElement || popupEl;
1247
+ const modalEl = parentEl ? parentEl.parentElement : parentEl;
1248
+ isActivated = (0, import_dom.getEventTargetNode)(evnt, modalEl).flag;
1249
+ }
1250
+ reactData.isActivated = isActivated;
1251
+ };
1252
+ const handleGlobalBlurEvent = () => {
1253
+ reactData.isActivated = false;
1254
+ };
1255
+ const handleClearFile = (evnt) => {
1256
+ const { fileList } = reactData;
1257
+ const urlProp = computeUrlProp.value;
1258
+ const rest = [];
1259
+ import_xe_utils.default.lastEach(fileList, (item, index) => {
1260
+ rest.push(
1261
+ removeFileEvent(evnt, item, index).then((status) => {
1262
+ return { url: item[urlProp], status };
1263
+ })
1264
+ );
1265
+ });
1266
+ return Promise.all(rest);
1267
+ };
1268
+ const handleRemoveFile = (evnt, urlOrItem) => {
1269
+ const { fileList } = reactData;
1270
+ const urlProp = computeUrlProp.value;
1271
+ const urls = import_xe_utils.default.isArray(urlOrItem) ? urlOrItem : [urlOrItem];
1272
+ const rest = [];
1273
+ urls.forEach((obj) => {
1274
+ if (obj) {
1275
+ const url = import_xe_utils.default.isString(obj) ? obj : obj[urlProp];
1276
+ const index = import_xe_utils.default.findIndexOf(fileList, (fileItem) => fileItem[urlProp] === url);
1277
+ if (index > -1) {
1278
+ rest.push(
1279
+ removeFileEvent(evnt, fileList[index], index).then((status) => {
1280
+ return { url, status };
1281
+ })
1282
+ );
1283
+ }
934
1284
  }
935
- return false;
936
1285
  });
937
- } else {
938
- if (fileTypes && fileTypes.length) {
939
- const errTypes = [];
940
- files.forEach((file) => {
941
- const fileType = parseFileType(file.name);
942
- if (!fileTypes.some((type) => `${type}`.toLowerCase() === fileType)) {
943
- errTypes.push(fileType);
1286
+ return Promise.all(rest);
1287
+ };
1288
+ const uploadMethods = {
1289
+ dispatchEvent,
1290
+ choose() {
1291
+ return handleChoose(null);
1292
+ },
1293
+ clear() {
1294
+ return handleClearFile(null);
1295
+ },
1296
+ clearByEvent(evnt) {
1297
+ return handleClearFile(evnt);
1298
+ },
1299
+ getPendingFiles() {
1300
+ const { fileList, fileCacheMaps } = reactData;
1301
+ const pendingFiles = [];
1302
+ fileList.forEach((item) => {
1303
+ const fileKey = getFieldKey(item);
1304
+ const cacheItem = fileCacheMaps[fileKey];
1305
+ if (cacheItem && cacheItem.status === "pending") {
1306
+ pendingFiles.push(cacheItem.file);
944
1307
  }
945
1308
  });
946
- if (errTypes.length) {
947
- if (import_core.VxeUI.modal) {
948
- import_core.VxeUI.modal.message({
949
- content: getI18n("vxe.error.notType", [errTypes.join(", ")]),
950
- status: "error"
951
- });
1309
+ return pendingFiles;
1310
+ },
1311
+ submit(isFull) {
1312
+ const { maxSimultaneousUploads } = props;
1313
+ const msNum = import_xe_utils.default.toNumber(maxSimultaneousUploads || 1) || 1;
1314
+ const { fileList, fileCacheMaps } = reactData;
1315
+ const allPendingList = fileList.filter((item) => {
1316
+ const fileKey = getFieldKey(item);
1317
+ const cacheItem = fileCacheMaps[fileKey];
1318
+ return cacheItem && (cacheItem.status === "pending" || isFull && cacheItem.status === "error");
1319
+ });
1320
+ const handleSubmit = (item) => {
1321
+ const fileKey = getFieldKey(item);
1322
+ const cacheItem = fileCacheMaps[fileKey];
1323
+ if (cacheItem) {
1324
+ const file = cacheItem.file;
1325
+ if (file && (cacheItem.status === "pending" || isFull && cacheItem.status === "error")) {
1326
+ cacheItem.loading = true;
1327
+ cacheItem.percent = 0;
1328
+ return handleUploadResult(item, file).then(handleNextSubmit);
1329
+ }
952
1330
  }
953
- return;
954
- }
955
- }
956
- }
957
- if (!files.length) {
958
- if (import_core.VxeUI.modal) {
959
- import_core.VxeUI.modal.notification({
960
- title: getI18n("vxe.modal.errTitle"),
961
- status: "error",
962
- content: getI18n("vxe.upload.uploadTypeErr")
1331
+ return handleNextSubmit();
1332
+ };
1333
+ const handleNextSubmit = () => {
1334
+ if (allPendingList.length) {
1335
+ const item = allPendingList[0];
1336
+ allPendingList.splice(0, 1);
1337
+ return handleSubmit(item).then(handleNextSubmit);
1338
+ }
1339
+ return Promise.resolve();
1340
+ };
1341
+ return Promise.all(allPendingList.splice(0, msNum).map(handleSubmit)).then(() => {
963
1342
  });
964
- }
965
- return;
966
- }
967
- handleUploadFile(files, evnt);
968
- };
969
- const handleUploadDropEvent = (evnt) => {
970
- const dataTransfer = evnt.dataTransfer;
971
- if (dataTransfer) {
972
- const { items } = dataTransfer;
973
- if (items && items.length) {
974
- evnt.preventDefault();
975
- const files = handleTransferFiles(items);
976
- if (files.length) {
977
- uploadTransferFileEvent(evnt, files);
1343
+ },
1344
+ getMoreVisible() {
1345
+ return reactData.showMorePopup;
1346
+ },
1347
+ openMore() {
1348
+ handleMoreEvent({ $event: new Event("click") });
1349
+ return (0, import_vue.nextTick)();
1350
+ },
1351
+ openMoreByEvent(evnt) {
1352
+ handleMoreEvent({ $event: evnt });
1353
+ return (0, import_vue.nextTick)();
1354
+ },
1355
+ closeMore() {
1356
+ if (import_core.VxeUI.modal) {
1357
+ import_core.VxeUI.modal.close(internalData.moreId);
978
1358
  }
1359
+ return (0, import_vue.nextTick)();
1360
+ },
1361
+ remove(urlOrItem) {
1362
+ return handleRemoveFile(null, urlOrItem);
1363
+ },
1364
+ removeByEvent(evnt, urlOrItem) {
1365
+ return handleRemoveFile(evnt, urlOrItem);
979
1366
  }
980
- }
981
- reactData.isDragUploadStatus = false;
982
- };
983
- const handleTransferFiles = (items) => {
984
- const files = [];
985
- import_xe_utils.default.arrayEach(items, (item) => {
986
- const file = item.getAsFile();
987
- if (file) {
988
- files.push(file);
1367
+ };
1368
+ const uploadPrivateMethods = {
1369
+ removeFileEvent
1370
+ };
1371
+ Object.assign($xeUpload, uploadMethods, uploadPrivateMethods);
1372
+ const renderFileItemList = (currList, isMoreView) => {
1373
+ const { showRemoveButton, showDownloadButton, showProgress, progressText, showPreview, showErrorStatus, dragSort, autoSubmit, showSubmitButton } = props;
1374
+ const { fileList, fileCacheMaps } = reactData;
1375
+ const isDisabled = computeIsDisabled.value;
1376
+ const formReadonly = computeFormReadonly.value;
1377
+ const nameProp = computeNameProp.value;
1378
+ const typeProp = computeTypeProp.value;
1379
+ const optionSlot = slots.option;
1380
+ const actionSlot = slots.action;
1381
+ const cornerSlot = slots.corner;
1382
+ const nameSlot = slots.name;
1383
+ const ons = {};
1384
+ if (dragSort && currList.length > 1) {
1385
+ ons.onDragstart = handleDragSortDragstartEvent;
1386
+ ons.onDragover = handleDragSortDragoverEvent;
1387
+ ons.onDragend = handleDragSortDragendEvent;
989
1388
  }
990
- });
991
- return files;
992
- };
993
- const handleMoreEvent = (evntParams) => {
994
- const formReadonly = computeFormReadonly.value;
995
- const isImage = computeIsImage.value;
996
- const evnt = evntParams.$event;
997
- if (import_core.VxeUI.modal) {
998
- import_core.VxeUI.modal.open({
999
- id: internalData.moreId,
1000
- title: formReadonly ? getI18n("vxe.upload.morePopup.readTitle") : getI18n(`vxe.upload.morePopup.${isImage ? "imageTitle" : "fileTitle"}`),
1001
- width: 660,
1002
- height: 500,
1003
- escClosable: true,
1004
- showMaximize: true,
1005
- resize: true,
1006
- maskClosable: true,
1007
- slots: {
1008
- default() {
1009
- const { showErrorStatus, dragToUpload, dragSort, dragPlaceholder } = props;
1010
- const { isActivated, isDragMove, isDragUploadStatus, dragIndex } = reactData;
1011
- const { fileList } = reactData;
1012
- const isDisabled = computeIsDisabled.value;
1013
- const moreContSlot = slots.moreContent || slots["more-content"];
1014
- const ons = {};
1015
- if (dragToUpload && dragIndex === -1) {
1016
- ons.onDragover = handleUploadDragoverEvent;
1017
- ons.onDragleave = handleUploadDragleaveEvent;
1018
- ons.onDrop = handleUploadDropEvent;
1019
- }
1020
- return (0, import_vue.h)(
1389
+ return currList.map((item, index) => {
1390
+ const fileKey = getFieldKey(item);
1391
+ const cacheItem = fileCacheMaps[fileKey];
1392
+ let isLoading = false;
1393
+ let isError = false;
1394
+ let isPending = false;
1395
+ const fileName = `${item[nameProp] || ""}`;
1396
+ if (cacheItem) {
1397
+ isLoading = cacheItem.loading;
1398
+ isError = cacheItem.status === "error";
1399
+ isPending = cacheItem.status === "pending";
1400
+ }
1401
+ return (0, import_vue.h)(
1402
+ "div",
1403
+ {
1404
+ key: dragSort ? fileKey : index,
1405
+ class: [
1406
+ "vxe-upload--file-item",
1407
+ {
1408
+ "is--preview": showPreview,
1409
+ "is--loading": isLoading,
1410
+ "is--pending": isPending,
1411
+ "is--error": isError
1412
+ }
1413
+ ],
1414
+ fileid: fileKey,
1415
+ draggable: dragSort ? true : null,
1416
+ ...ons
1417
+ },
1418
+ optionSlot ? (0, import_vn.getSlotVNs)(optionSlot({ option: item, isMoreView, options: fileList })) : [
1419
+ (0, import_vue.h)(
1021
1420
  "div",
1022
1421
  {
1023
- ref: refPopupElem,
1024
- class: [
1025
- "vxe-upload--more-popup",
1026
- {
1027
- "is--readonly": formReadonly,
1028
- "is--disabled": isDisabled,
1029
- "is--active": isActivated,
1030
- "show--error": showErrorStatus,
1031
- "is--drag": isDragUploadStatus
1422
+ class: "vxe-upload--file-item-icon"
1423
+ },
1424
+ [
1425
+ (0, import_vue.h)("i", {
1426
+ class: getIcon()[`UPLOAD_FILE_TYPE_${`${item[typeProp]}`.toLocaleUpperCase()}`] || getIcon().UPLOAD_FILE_TYPE_DEFAULT
1427
+ })
1428
+ ]
1429
+ ),
1430
+ (0, import_vue.h)(
1431
+ "div",
1432
+ {
1433
+ class: "vxe-upload--file-item-name",
1434
+ title: fileName,
1435
+ onClick(evnt) {
1436
+ if (!isLoading && !isError) {
1437
+ handlePreviewFileEvent(evnt, item);
1032
1438
  }
1033
- ],
1034
- ...ons
1439
+ }
1035
1440
  },
1036
- moreContSlot ? (0, import_vn.getSlotVNs)(moreContSlot({ options: fileList })) : [
1037
- isImage ? dragSort ? (0, import_vue.h)(
1038
- import_vue.TransitionGroup,
1039
- {
1040
- name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1041
- tag: "div",
1042
- class: "vxe-upload--image-more-list"
1043
- },
1044
- {
1045
- default: () => renderImageItemList(fileList, true).concat(renderImageAction(true))
1441
+ nameSlot ? (0, import_vn.getSlotVNs)(nameSlot({ option: item, isMoreView, options: fileList })) : fileName
1442
+ ),
1443
+ isLoading ? (0, import_vue.h)(
1444
+ "div",
1445
+ {
1446
+ class: "vxe-upload--file-item-loading-icon"
1447
+ },
1448
+ [
1449
+ (0, import_vue.h)("i", {
1450
+ class: getIcon().UPLOAD_LOADING
1451
+ })
1452
+ ]
1453
+ ) : renderEmptyElement($xeUpload),
1454
+ showProgress && isLoading && cacheItem ? (0, import_vue.h)(
1455
+ "div",
1456
+ {
1457
+ class: "vxe-upload--file-item-loading-text"
1458
+ },
1459
+ progressText ? import_xe_utils.default.toFormatString(`${import_xe_utils.default.isFunction(progressText) ? progressText({}) : progressText}`, { percent: cacheItem.percent }) : getI18n("vxe.upload.uploadProgress", [cacheItem.percent])
1460
+ ) : renderEmptyElement($xeUpload),
1461
+ !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, import_vue.h)(
1462
+ "div",
1463
+ {
1464
+ class: "vxe-upload--file-item-rebtn"
1465
+ },
1466
+ [
1467
+ (0, import_vue.h)(import_button.default, {
1468
+ icon: isError ? getIcon().UPLOAD_IMAGE_RE_UPLOAD : getIcon().UPLOAD_IMAGE_UPLOAD,
1469
+ mode: "text",
1470
+ status: "primary",
1471
+ content: isError ? getI18n("vxe.upload.reUpload") : getI18n("vxe.upload.manualUpload"),
1472
+ onClick(evnt) {
1473
+ handleReUploadEvent(evnt, item);
1046
1474
  }
1047
- ) : (0, import_vue.h)(
1475
+ })
1476
+ ]
1477
+ ) : renderEmptyElement($xeUpload),
1478
+ (0, import_vue.h)(
1479
+ "div",
1480
+ {
1481
+ class: "vxe-upload--file-item-btn-wrapper"
1482
+ },
1483
+ actionSlot ? (0, import_vn.getSlotVNs)(actionSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly })) : [
1484
+ cornerSlot ? (0, import_vue.h)(
1048
1485
  "div",
1049
1486
  {
1050
- class: "vxe-upload--image-more-list"
1487
+ class: "vxe-upload--file-item-action"
1051
1488
  },
1052
- renderImageItemList(fileList, true).concat(renderImageAction(true))
1053
- ) : (0, import_vue.h)(
1489
+ (0, import_vn.getSlotVNs)(cornerSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly }))
1490
+ ) : renderEmptyElement($xeUpload),
1491
+ showDownloadButton && !(isLoading || isPending) ? (0, import_vue.h)(
1054
1492
  "div",
1055
1493
  {
1056
- class: "vxe-upload--file-more-list"
1494
+ class: "vxe-upload--file-item-download-btn",
1495
+ onClick(evnt) {
1496
+ downloadFileEvent(evnt, item);
1497
+ }
1057
1498
  },
1058
1499
  [
1059
- renderFileAction(true),
1060
- dragSort ? (0, import_vue.h)(
1061
- import_vue.TransitionGroup,
1062
- {
1063
- name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1064
- tag: "div",
1065
- class: "vxe-upload--file-list"
1066
- },
1067
- {
1068
- default: () => renderFileItemList(fileList, false)
1069
- }
1070
- ) : (0, import_vue.h)(
1071
- "div",
1072
- {
1073
- class: "vxe-upload--file-list"
1074
- },
1075
- renderFileItemList(fileList, true)
1076
- )
1500
+ (0, import_vue.h)("i", {
1501
+ class: getIcon().UPLOAD_FILE_DOWNLOAD
1502
+ })
1077
1503
  ]
1078
- ),
1079
- dragSort ? (0, import_vue.h)("div", {
1080
- ref: refModalDragLineElem,
1081
- class: "vxe-upload--drag-line"
1082
- }) : renderEmptyElement($xeUpload),
1083
- isDragUploadStatus ? (0, import_vue.h)(
1504
+ ) : renderEmptyElement($xeUpload),
1505
+ showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0, import_vue.h)(
1084
1506
  "div",
1085
1507
  {
1086
- class: "vxe-upload--drag-placeholder"
1508
+ class: "vxe-upload--file-item-remove-btn",
1509
+ onClick(evnt) {
1510
+ removeFileEvent(evnt, item, index);
1511
+ }
1087
1512
  },
1088
- dragPlaceholder || getI18n("vxe.upload.dragPlaceholder")
1513
+ [
1514
+ (0, import_vue.h)("i", {
1515
+ class: getIcon().UPLOAD_FILE_REMOVE
1516
+ })
1517
+ ]
1089
1518
  ) : renderEmptyElement($xeUpload)
1090
1519
  ]
1091
- );
1092
- }
1093
- },
1094
- onShow() {
1095
- reactData.showMorePopup = true;
1096
- },
1097
- onHide({ $event }) {
1098
- reactData.showMorePopup = false;
1099
- if ($event) {
1100
- dispatchEvent("more-visible", { visible: false }, $event);
1101
- }
1102
- }
1103
- });
1104
- if (evnt) {
1105
- dispatchEvent("more-visible", { visible: true }, evnt);
1106
- }
1107
- }
1108
- };
1109
- const showDropTip = (evnt, dragEl, dragPos) => {
1110
- const { showMorePopup } = reactData;
1111
- const el = refElem.value;
1112
- const popupEl = refPopupElem.value;
1113
- const wrapperEl = showMorePopup ? popupEl : el;
1114
- if (!wrapperEl) {
1115
- return;
1116
- }
1117
- const wrapperRect = wrapperEl.getBoundingClientRect();
1118
- const ddLineEl = refDragLineElem.value;
1119
- const mdLineEl = refModalDragLineElem.value;
1120
- const currDLineEl = showMorePopup ? mdLineEl : ddLineEl;
1121
- if (currDLineEl) {
1122
- const dragRect = dragEl.getBoundingClientRect();
1123
- currDLineEl.style.display = "block";
1124
- currDLineEl.style.top = `${Math.max(1, dragRect.y - wrapperRect.y)}px`;
1125
- currDLineEl.style.left = `${Math.max(1, dragRect.x - wrapperRect.x)}px`;
1126
- currDLineEl.style.height = `${dragRect.height}px`;
1127
- currDLineEl.style.width = `${dragRect.width - 1}px`;
1128
- currDLineEl.setAttribute("drag-pos", dragPos);
1129
- }
1130
- };
1131
- const hideDropTip = () => {
1132
- const ddLineEl = refDragLineElem.value;
1133
- const mdLineEl = refModalDragLineElem.value;
1134
- if (ddLineEl) {
1135
- ddLineEl.style.display = "";
1136
- }
1137
- if (mdLineEl) {
1138
- mdLineEl.style.display = "";
1139
- }
1140
- };
1141
- const handleDragSortDragstartEvent = (evnt) => {
1142
- evnt.stopPropagation();
1143
- if (evnt.dataTransfer) {
1144
- evnt.dataTransfer.setDragImage((0, import_dom.getTpImg)(), 0, 0);
1145
- }
1146
- const dragEl = evnt.currentTarget;
1147
- const parentEl = dragEl.parentElement;
1148
- const dragIndex = import_xe_utils.default.findIndexOf(Array.from(parentEl.children), (item) => dragEl === item);
1149
- reactData.isDragMove = true;
1150
- reactData.dragIndex = dragIndex;
1151
- setTimeout(() => {
1152
- reactData.isDragMove = false;
1153
- }, 500);
1154
- };
1155
- const handleDragSortDragoverEvent = (evnt) => {
1156
- evnt.stopPropagation();
1157
- evnt.preventDefault();
1158
- const { dragIndex } = reactData;
1159
- if (dragIndex === -1) {
1160
- return;
1161
- }
1162
- const isImage = computeIsImage.value;
1163
- const dragEl = evnt.currentTarget;
1164
- const parentEl = dragEl.parentElement;
1165
- const currIndex = import_xe_utils.default.findIndexOf(Array.from(parentEl.children), (item) => dragEl === item);
1166
- let dragPos = "";
1167
- if (isImage) {
1168
- const offsetX = evnt.clientX - dragEl.getBoundingClientRect().x;
1169
- dragPos = offsetX < dragEl.clientWidth / 2 ? "left" : "right";
1170
- } else {
1171
- const offsetY = evnt.clientY - dragEl.getBoundingClientRect().y;
1172
- dragPos = offsetY < dragEl.clientHeight / 2 ? "top" : "bottom";
1173
- }
1174
- if (dragIndex === currIndex) {
1175
- showDropTip(evnt, dragEl, dragPos);
1176
- return;
1177
- }
1178
- showDropTip(evnt, dragEl, dragPos);
1179
- internalData.prevDragIndex = currIndex;
1180
- internalData.prevDragPos = dragPos;
1181
- };
1182
- const handleDragSortDragendEvent = (evnt) => {
1183
- const { fileList, dragIndex } = reactData;
1184
- const { prevDragIndex, prevDragPos } = internalData;
1185
- const oldIndex = dragIndex;
1186
- const targetIndex = prevDragIndex;
1187
- const dragOffsetIndex = prevDragPos === "bottom" || prevDragPos === "right" ? 1 : 0;
1188
- const oldItem = fileList[oldIndex];
1189
- const newItem = fileList[targetIndex];
1190
- if (oldItem && newItem) {
1191
- fileList.splice(oldIndex, 1);
1192
- const ptfIndex = import_xe_utils.default.findIndexOf(fileList, (item) => newItem === item);
1193
- const nIndex = ptfIndex + dragOffsetIndex;
1194
- fileList.splice(nIndex, 0, oldItem);
1195
- dispatchEvent(
1196
- "sort-dragend",
1197
- {
1198
- oldItem,
1199
- newItem,
1200
- dragPos: prevDragPos,
1201
- offsetIndex: dragOffsetIndex,
1202
- _index: {
1203
- newIndex: nIndex,
1204
- oldIndex
1205
- }
1206
- },
1207
- evnt
1208
- );
1209
- }
1210
- hideDropTip();
1211
- reactData.dragIndex = -1;
1212
- };
1213
- const handleItemMousedownEvent = (evnt) => {
1214
- if ($xeTable) {
1215
- evnt.stopPropagation();
1216
- }
1217
- reactData.isActivated = true;
1218
- };
1219
- const handleGlobalPasteEvent = (evnt) => {
1220
- const { pasteToUpload } = props;
1221
- const { isActivated } = reactData;
1222
- if (!isActivated || !pasteToUpload) {
1223
- return;
1224
- }
1225
- const clipboardData = evnt.clipboardData || evnt.originalEvent.clipboardData;
1226
- if (!clipboardData) {
1227
- return;
1228
- }
1229
- const { items } = clipboardData;
1230
- if (!items) {
1231
- return;
1232
- }
1233
- const files = handleTransferFiles(items);
1234
- if (files.length) {
1235
- evnt.preventDefault();
1236
- uploadTransferFileEvent(evnt, files);
1237
- }
1238
- };
1239
- const handleGlobalClickEvent = (evnt) => {
1240
- const el = refElem.value;
1241
- const popupEl = refPopupElem.value;
1242
- let isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag;
1243
- if (!isActivated && popupEl) {
1244
- const parentEl = popupEl.parentElement || popupEl;
1245
- const modalEl = parentEl ? parentEl.parentElement : parentEl;
1246
- isActivated = (0, import_dom.getEventTargetNode)(evnt, modalEl).flag;
1247
- }
1248
- reactData.isActivated = isActivated;
1249
- };
1250
- const handleGlobalBlurEvent = () => {
1251
- reactData.isActivated = false;
1252
- };
1253
- const handleClearFile = (evnt) => {
1254
- const { fileList } = reactData;
1255
- const urlProp = computeUrlProp.value;
1256
- const rest = [];
1257
- import_xe_utils.default.lastEach(fileList, (item, index) => {
1258
- rest.push(
1259
- removeFileEvent(evnt, item, index).then((status) => {
1260
- return { url: item[urlProp], status };
1261
- })
1262
- );
1263
- });
1264
- return Promise.all(rest);
1265
- };
1266
- const handleRemoveFile = (evnt, urlOrItem) => {
1267
- const { fileList } = reactData;
1268
- const urlProp = computeUrlProp.value;
1269
- const urls = import_xe_utils.default.isArray(urlOrItem) ? urlOrItem : [urlOrItem];
1270
- const rest = [];
1271
- urls.forEach((obj) => {
1272
- if (obj) {
1273
- const url = import_xe_utils.default.isString(obj) ? obj : obj[urlProp];
1274
- const index = import_xe_utils.default.findIndexOf(fileList, (fileItem) => fileItem[urlProp] === url);
1275
- if (index > -1) {
1276
- rest.push(
1277
- removeFileEvent(evnt, fileList[index], index).then((status) => {
1278
- return { url, status };
1279
- })
1280
- );
1281
- }
1282
- }
1283
- });
1284
- return Promise.all(rest);
1285
- };
1286
- const uploadMethods = {
1287
- dispatchEvent,
1288
- choose() {
1289
- return handleChoose(null);
1290
- },
1291
- clear() {
1292
- return handleClearFile(null);
1293
- },
1294
- clearByEvent(evnt) {
1295
- return handleClearFile(evnt);
1296
- },
1297
- getPendingFiles() {
1298
- const { fileList, fileCacheMaps } = reactData;
1299
- const pendingFiles = [];
1300
- fileList.forEach((item) => {
1301
- const fileKey = getFieldKey(item);
1302
- const cacheItem = fileCacheMaps[fileKey];
1303
- if (cacheItem && cacheItem.status === "pending") {
1304
- pendingFiles.push(cacheItem.file);
1305
- }
1306
- });
1307
- return pendingFiles;
1308
- },
1309
- submit(isFull) {
1310
- const { maxSimultaneousUploads } = props;
1311
- const msNum = import_xe_utils.default.toNumber(maxSimultaneousUploads || 1) || 1;
1312
- const { fileList, fileCacheMaps } = reactData;
1313
- const allPendingList = fileList.filter((item) => {
1314
- const fileKey = getFieldKey(item);
1315
- const cacheItem = fileCacheMaps[fileKey];
1316
- return cacheItem && (cacheItem.status === "pending" || isFull && cacheItem.status === "error");
1317
- });
1318
- const handleSubmit = (item) => {
1319
- const fileKey = getFieldKey(item);
1320
- const cacheItem = fileCacheMaps[fileKey];
1321
- if (cacheItem) {
1322
- const file = cacheItem.file;
1323
- if (file && (cacheItem.status === "pending" || isFull && cacheItem.status === "error")) {
1324
- cacheItem.loading = true;
1325
- cacheItem.percent = 0;
1326
- return handleUploadResult(item, file).then(handleNextSubmit);
1327
- }
1328
- }
1329
- return handleNextSubmit();
1330
- };
1331
- const handleNextSubmit = () => {
1332
- if (allPendingList.length) {
1333
- const item = allPendingList[0];
1334
- allPendingList.splice(0, 1);
1335
- return handleSubmit(item).then(handleNextSubmit);
1336
- }
1337
- return Promise.resolve();
1338
- };
1339
- return Promise.all(allPendingList.splice(0, msNum).map(handleSubmit)).then(() => {
1520
+ )
1521
+ ]
1522
+ );
1340
1523
  });
1341
- },
1342
- getMoreVisible() {
1343
- return reactData.showMorePopup;
1344
- },
1345
- openMore() {
1346
- handleMoreEvent({ $event: new Event("click") });
1347
- return (0, import_vue.nextTick)();
1348
- },
1349
- openMoreByEvent(evnt) {
1350
- handleMoreEvent({ $event: evnt });
1351
- return (0, import_vue.nextTick)();
1352
- },
1353
- closeMore() {
1354
- if (import_core.VxeUI.modal) {
1355
- import_core.VxeUI.modal.close(internalData.moreId);
1356
- }
1357
- return (0, import_vue.nextTick)();
1358
- },
1359
- remove(urlOrItem) {
1360
- return handleRemoveFile(null, urlOrItem);
1361
- },
1362
- removeByEvent(evnt, urlOrItem) {
1363
- return handleRemoveFile(evnt, urlOrItem);
1364
- }
1365
- };
1366
- const uploadPrivateMethods = {
1367
- removeFileEvent
1368
- };
1369
- Object.assign($xeUpload, uploadMethods, uploadPrivateMethods);
1370
- const renderFileItemList = (currList, isMoreView) => {
1371
- const { showRemoveButton, showDownloadButton, showProgress, progressText, showPreview, showErrorStatus, dragSort, autoSubmit, showSubmitButton } = props;
1372
- const { fileList, fileCacheMaps } = reactData;
1373
- const isDisabled = computeIsDisabled.value;
1374
- const formReadonly = computeFormReadonly.value;
1375
- const nameProp = computeNameProp.value;
1376
- const typeProp = computeTypeProp.value;
1377
- const optionSlot = slots.option;
1378
- const actionSlot = slots.action;
1379
- const cornerSlot = slots.corner;
1380
- const nameSlot = slots.name;
1381
- const ons = {};
1382
- if (dragSort && currList.length > 1) {
1383
- ons.onDragstart = handleDragSortDragstartEvent;
1384
- ons.onDragover = handleDragSortDragoverEvent;
1385
- ons.onDragend = handleDragSortDragendEvent;
1386
- }
1387
- return currList.map((item, index) => {
1388
- const fileKey = getFieldKey(item);
1389
- const cacheItem = fileCacheMaps[fileKey];
1390
- let isLoading = false;
1391
- let isError = false;
1392
- let isPending = false;
1393
- const fileName = `${item[nameProp] || ""}`;
1394
- if (cacheItem) {
1395
- isLoading = cacheItem.loading;
1396
- isError = cacheItem.status === "error";
1397
- isPending = cacheItem.status === "pending";
1524
+ };
1525
+ const renderFileAction = (isMoreView) => {
1526
+ const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props;
1527
+ const { fileList } = reactData;
1528
+ const isDisabled = computeIsDisabled.value;
1529
+ const formReadonly = computeFormReadonly.value;
1530
+ const showTipText = computedShowTipText.value;
1531
+ const defTipText = computedDefTipText.value;
1532
+ const overCount = computeOverCount.value;
1533
+ const defaultSlot = slots.default;
1534
+ const tipSlot = slots.tip || slots.hint;
1535
+ if (formReadonly || !showUploadButton) {
1536
+ return renderEmptyElement($xeUpload);
1398
1537
  }
1399
1538
  return (0, import_vue.h)(
1400
1539
  "div",
1401
1540
  {
1402
- key: dragSort ? fileKey : index,
1403
- class: [
1404
- "vxe-upload--file-item",
1405
- {
1406
- "is--preview": showPreview,
1407
- "is--loading": isLoading,
1408
- "is--pending": isPending,
1409
- "is--error": isError
1410
- }
1411
- ],
1412
- fileid: fileKey,
1413
- draggable: dragSort ? true : null,
1414
- ...ons
1541
+ class: "vxe-upload--file-action"
1415
1542
  },
1416
- optionSlot ? (0, import_vn.getSlotVNs)(optionSlot({ option: item, isMoreView, options: fileList })) : [
1417
- (0, import_vue.h)(
1543
+ [
1544
+ autoHiddenButton && overCount ? renderEmptyElement($xeUpload) : (0, import_vue.h)(
1418
1545
  "div",
1419
1546
  {
1420
- class: "vxe-upload--file-item-icon"
1547
+ class: "vxe-upload--file-action-btn",
1548
+ onClick: clickEvent
1421
1549
  },
1422
- [
1423
- (0, import_vue.h)("i", {
1424
- class: getIcon()[`UPLOAD_FILE_TYPE_${`${item[typeProp]}`.toLocaleUpperCase()}`] || getIcon().UPLOAD_FILE_TYPE_DEFAULT
1550
+ defaultSlot ? (0, import_vn.getSlotVNs)(defaultSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : [
1551
+ (0, import_vue.h)(import_button.default, {
1552
+ class: "vxe-upload--file-action-button",
1553
+ content: isMoreView || showButtonText ? buttonText ? `${import_xe_utils.default.isFunction(buttonText) ? buttonText({}) : buttonText}` : getI18n("vxe.upload.fileBtnText") : "",
1554
+ icon: showButtonIcon ? buttonIcon || getIcon().UPLOAD_FILE_ADD : "",
1555
+ disabled: isDisabled
1425
1556
  })
1426
1557
  ]
1427
1558
  ),
1428
- (0, import_vue.h)(
1429
- "div",
1430
- {
1431
- class: "vxe-upload--file-item-name",
1432
- title: fileName,
1433
- onClick(evnt) {
1434
- if (!isLoading && !isError) {
1435
- handlePreviewFileEvent(evnt, item);
1436
- }
1437
- }
1438
- },
1439
- nameSlot ? (0, import_vn.getSlotVNs)(nameSlot({ option: item, isMoreView, options: fileList })) : fileName
1440
- ),
1441
- isLoading ? (0, import_vue.h)(
1442
- "div",
1443
- {
1444
- class: "vxe-upload--file-item-loading-icon"
1445
- },
1446
- [
1447
- (0, import_vue.h)("i", {
1448
- class: getIcon().UPLOAD_LOADING
1449
- })
1450
- ]
1451
- ) : renderEmptyElement($xeUpload),
1452
- showProgress && isLoading && cacheItem ? (0, import_vue.h)(
1453
- "div",
1454
- {
1455
- class: "vxe-upload--file-item-loading-text"
1456
- },
1457
- progressText ? import_xe_utils.default.toFormatString(`${import_xe_utils.default.isFunction(progressText) ? progressText({}) : progressText}`, { percent: cacheItem.percent }) : getI18n("vxe.upload.uploadProgress", [cacheItem.percent])
1458
- ) : renderEmptyElement($xeUpload),
1459
- !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, import_vue.h)(
1559
+ showTipText && (defTipText || tipSlot) ? (0, import_vue.h)(
1460
1560
  "div",
1461
1561
  {
1462
- class: "vxe-upload--file-item-rebtn"
1562
+ class: "vxe-upload--file-action-tip"
1463
1563
  },
1464
- [
1465
- (0, import_vue.h)(import_button.default, {
1466
- icon: isError ? getIcon().UPLOAD_IMAGE_RE_UPLOAD : getIcon().UPLOAD_IMAGE_UPLOAD,
1467
- mode: "text",
1468
- status: "primary",
1469
- content: isError ? getI18n("vxe.upload.reUpload") : getI18n("vxe.upload.manualUpload"),
1470
- onClick(evnt) {
1471
- handleReUploadEvent(evnt, item);
1472
- }
1473
- })
1474
- ]
1475
- ) : renderEmptyElement($xeUpload),
1564
+ tipSlot ? (0, import_vn.getSlotVNs)(tipSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : `${defTipText}`
1565
+ ) : renderEmptyElement($xeUpload)
1566
+ ]
1567
+ );
1568
+ };
1569
+ const rendeFileMode = () => {
1570
+ const { showList, moreConfig, dragSort } = props;
1571
+ const { fileList, isDragMove } = reactData;
1572
+ const moreOpts = computeMoreOpts.value;
1573
+ const { maxCount, showMoreButton, layout, moreButtonText } = moreOpts;
1574
+ const isHorizontal = layout === "horizontal";
1575
+ const moreBtnSlot = slots.moreButton || slots["more-button"];
1576
+ let currList = fileList;
1577
+ let overMaxNum = 0;
1578
+ let isMoreMax = false;
1579
+ let isMiniMore = false;
1580
+ if (import_xe_utils.default.isNumber(maxCount) && fileList.length > maxCount) {
1581
+ isMoreMax = true;
1582
+ isMiniMore = maxCount === 0;
1583
+ overMaxNum = fileList.length - maxCount;
1584
+ currList = fileList.slice(0, maxCount);
1585
+ }
1586
+ return (0, import_vue.h)(
1587
+ "div",
1588
+ {
1589
+ key: "all",
1590
+ class: "vxe-upload--file-wrapper"
1591
+ },
1592
+ showList ? [
1593
+ showMoreButton && moreConfig && isHorizontal ? renderEmptyElement($xeUpload) : renderFileAction(true),
1476
1594
  (0, import_vue.h)(
1477
1595
  "div",
1478
1596
  {
1479
- class: "vxe-upload--file-item-btn-wrapper"
1597
+ class: [
1598
+ "vxe-upload--file-list-wrapper",
1599
+ {
1600
+ "is--horizontal": isHorizontal
1601
+ }
1602
+ ]
1480
1603
  },
1481
- actionSlot ? (0, import_vn.getSlotVNs)(actionSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly })) : [
1482
- cornerSlot ? (0, import_vue.h)(
1483
- "div",
1604
+ [
1605
+ currList.length ? dragSort ? (0, import_vue.h)(
1606
+ import_vue.TransitionGroup,
1484
1607
  {
1485
- class: "vxe-upload--file-item-action"
1608
+ name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1609
+ tag: "div",
1610
+ class: "vxe-upload--file-list"
1486
1611
  },
1487
- (0, import_vn.getSlotVNs)(cornerSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly }))
1488
- ) : renderEmptyElement($xeUpload),
1489
- showDownloadButton && !(isLoading || isPending) ? (0, import_vue.h)(
1612
+ {
1613
+ default: () => renderFileItemList(currList, false)
1614
+ }
1615
+ ) : (0, import_vue.h)(
1490
1616
  "div",
1491
1617
  {
1492
- class: "vxe-upload--file-item-download-btn",
1493
- onClick(evnt) {
1494
- downloadFileEvent(evnt, item);
1495
- }
1618
+ class: "vxe-upload--file-list"
1496
1619
  },
1497
- [
1498
- (0, import_vue.h)("i", {
1499
- class: getIcon().UPLOAD_FILE_DOWNLOAD
1500
- })
1501
- ]
1620
+ renderFileItemList(currList, false)
1502
1621
  ) : renderEmptyElement($xeUpload),
1503
- showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0, import_vue.h)(
1622
+ showMoreButton && overMaxNum ? (0, import_vue.h)(
1504
1623
  "div",
1505
1624
  {
1506
- class: "vxe-upload--file-item-remove-btn",
1507
- onClick(evnt) {
1508
- removeFileEvent(evnt, item, index);
1509
- }
1625
+ class: "vxe-upload--file-over-more"
1510
1626
  },
1511
- [
1512
- (0, import_vue.h)("i", {
1513
- class: getIcon().UPLOAD_FILE_REMOVE
1627
+ moreBtnSlot ? (0, import_vn.getSlotVNs)(moreBtnSlot({ options: fileList })) : [
1628
+ (0, import_vue.h)(import_button.default, {
1629
+ mode: "text",
1630
+ content: moreButtonText ? import_xe_utils.default.isFunction(moreButtonText) ? moreButtonText({ $upload: $xeUpload, options: fileList }) : import_xe_utils.default.toFormatString(moreButtonText, [fileList.length]) : getI18n(isMoreMax && isMiniMore ? "vxe.upload.moreFileBtnText" : "vxe.upload.moreBtnText", [fileList.length]),
1631
+ status: "primary",
1632
+ onClick: handleMoreEvent
1514
1633
  })
1515
1634
  ]
1516
- ) : renderEmptyElement($xeUpload)
1635
+ ) : renderEmptyElement($xeUpload),
1636
+ showMoreButton && moreConfig && isHorizontal ? renderFileAction(false) : renderEmptyElement($xeUpload)
1517
1637
  ]
1518
1638
  )
1519
- ]
1639
+ ] : [renderFileAction(false)]
1520
1640
  );
1521
- });
1522
- };
1523
- const renderFileAction = (isMoreView) => {
1524
- const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props;
1525
- const { fileList } = reactData;
1526
- const isDisabled = computeIsDisabled.value;
1527
- const formReadonly = computeFormReadonly.value;
1528
- const showTipText = computedShowTipText.value;
1529
- const defTipText = computedDefTipText.value;
1530
- const overCount = computeOverCount.value;
1531
- const defaultSlot = slots.default;
1532
- const tipSlot = slots.tip || slots.hint;
1533
- if (formReadonly || !showUploadButton) {
1534
- return renderEmptyElement($xeUpload);
1535
- }
1536
- return (0, import_vue.h)(
1537
- "div",
1538
- {
1539
- class: "vxe-upload--file-action"
1540
- },
1541
- [
1542
- autoHiddenButton && overCount ? renderEmptyElement($xeUpload) : (0, import_vue.h)(
1543
- "div",
1544
- {
1545
- class: "vxe-upload--file-action-btn",
1546
- onClick: clickEvent
1547
- },
1548
- defaultSlot ? (0, import_vn.getSlotVNs)(defaultSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : [
1549
- (0, import_vue.h)(import_button.default, {
1550
- class: "vxe-upload--file-action-button",
1551
- content: isMoreView || showButtonText ? buttonText ? `${import_xe_utils.default.isFunction(buttonText) ? buttonText({}) : buttonText}` : getI18n("vxe.upload.fileBtnText") : "",
1552
- icon: showButtonIcon ? buttonIcon || getIcon().UPLOAD_FILE_ADD : "",
1553
- disabled: isDisabled
1554
- })
1555
- ]
1556
- ),
1557
- showTipText && (defTipText || tipSlot) ? (0, import_vue.h)(
1558
- "div",
1559
- {
1560
- class: "vxe-upload--file-action-tip"
1561
- },
1562
- tipSlot ? (0, import_vn.getSlotVNs)(tipSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : `${defTipText}`
1563
- ) : renderEmptyElement($xeUpload)
1564
- ]
1565
- );
1566
- };
1567
- const rendeFileMode = () => {
1568
- const { showList, moreConfig, dragSort } = props;
1569
- const { fileList, isDragMove } = reactData;
1570
- const moreOpts = computeMoreOpts.value;
1571
- const { maxCount, showMoreButton, layout, moreButtonText } = moreOpts;
1572
- const isHorizontal = layout === "horizontal";
1573
- const moreBtnSlot = slots.moreButton || slots["more-button"];
1574
- let currList = fileList;
1575
- let overMaxNum = 0;
1576
- let isMoreMax = false;
1577
- let isMiniMore = false;
1578
- if (import_xe_utils.default.isNumber(maxCount) && fileList.length > maxCount) {
1579
- isMoreMax = true;
1580
- isMiniMore = maxCount === 0;
1581
- overMaxNum = fileList.length - maxCount;
1582
- currList = fileList.slice(0, maxCount);
1583
- }
1584
- return (0, import_vue.h)(
1585
- "div",
1586
- {
1587
- key: "all",
1588
- class: "vxe-upload--file-wrapper"
1589
- },
1590
- showList ? [
1591
- showMoreButton && moreConfig && isHorizontal ? renderEmptyElement($xeUpload) : renderFileAction(true),
1592
- (0, import_vue.h)(
1641
+ };
1642
+ const renderImageItemList = (currList, isMoreView) => {
1643
+ const { showRemoveButton, showProgress, progressText, showPreview, showErrorStatus, dragSort, autoSubmit, showSubmitButton } = props;
1644
+ const { fileList, fileCacheMaps } = reactData;
1645
+ const isDisabled = computeIsDisabled.value;
1646
+ const formReadonly = computeFormReadonly.value;
1647
+ const imageOpts = computeImageOpts.value;
1648
+ const imgStyle = computeImgStyle.value;
1649
+ const optionSlot = slots.option;
1650
+ const actionSlot = slots.action;
1651
+ const cornerSlot = slots.corner;
1652
+ const ons = {
1653
+ onMousedown: handleItemMousedownEvent
1654
+ };
1655
+ if (dragSort && currList.length > 1) {
1656
+ ons.onDragstart = handleDragSortDragstartEvent;
1657
+ ons.onDragover = handleDragSortDragoverEvent;
1658
+ ons.onDragend = handleDragSortDragendEvent;
1659
+ }
1660
+ return currList.map((item, index) => {
1661
+ const fileKey = getFieldKey(item);
1662
+ const cacheItem = fileCacheMaps[fileKey];
1663
+ let isLoading = false;
1664
+ let isError = false;
1665
+ let isPending = false;
1666
+ if (cacheItem) {
1667
+ isLoading = cacheItem.loading;
1668
+ isError = cacheItem.status === "error";
1669
+ isPending = cacheItem.status === "pending";
1670
+ }
1671
+ return (0, import_vue.h)(
1593
1672
  "div",
1594
1673
  {
1674
+ key: dragSort ? fileKey : index,
1595
1675
  class: [
1596
- "vxe-upload--file-list-wrapper",
1676
+ "vxe-upload--image-item",
1597
1677
  {
1598
- "is--horizontal": isHorizontal
1678
+ "is--preview": showPreview,
1679
+ "is--circle": imageOpts.circle,
1680
+ "is--loading": isLoading,
1681
+ "is--pending": isPending,
1682
+ "is--error": isError
1599
1683
  }
1600
- ]
1684
+ ],
1685
+ fileid: fileKey,
1686
+ draggable: dragSort ? true : null,
1687
+ ...ons
1601
1688
  },
1602
- [
1603
- currList.length ? dragSort ? (0, import_vue.h)(
1604
- import_vue.TransitionGroup,
1605
- {
1606
- name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1607
- tag: "div",
1608
- class: "vxe-upload--file-list"
1609
- },
1610
- {
1611
- default: () => renderFileItemList(currList, false)
1612
- }
1613
- ) : (0, import_vue.h)(
1614
- "div",
1615
- {
1616
- class: "vxe-upload--file-list"
1617
- },
1618
- renderFileItemList(currList, false)
1619
- ) : renderEmptyElement($xeUpload),
1620
- showMoreButton && overMaxNum ? (0, import_vue.h)(
1689
+ optionSlot ? (0, import_vn.getSlotVNs)(optionSlot({ option: item, isMoreView, options: fileList })) : [
1690
+ (0, import_vue.h)(
1621
1691
  "div",
1622
1692
  {
1623
- class: "vxe-upload--file-over-more"
1693
+ class: "vxe-upload--image-item-box",
1694
+ style: isMoreView ? null : imgStyle,
1695
+ onClick(evnt) {
1696
+ if (!isLoading && !isError) {
1697
+ handlePreviewImageEvent(evnt, item, index);
1698
+ }
1699
+ }
1624
1700
  },
1625
- moreBtnSlot ? (0, import_vn.getSlotVNs)(moreBtnSlot({ options: fileList })) : [
1626
- (0, import_vue.h)(import_button.default, {
1627
- mode: "text",
1628
- content: moreButtonText ? import_xe_utils.default.isFunction(moreButtonText) ? moreButtonText({ $upload: $xeUpload, options: fileList }) : import_xe_utils.default.toFormatString(moreButtonText, [fileList.length]) : getI18n(isMoreMax && isMiniMore ? "vxe.upload.moreFileBtnText" : "vxe.upload.moreBtnText", [fileList.length]),
1629
- status: "primary",
1630
- onClick: handleMoreEvent
1631
- })
1701
+ [
1702
+ isLoading && cacheItem ? (0, import_vue.h)(
1703
+ "div",
1704
+ {
1705
+ class: "vxe-upload--image-item-loading"
1706
+ },
1707
+ [
1708
+ (0, import_vue.h)(
1709
+ "div",
1710
+ {
1711
+ class: "vxe-upload--image-item-loading-icon"
1712
+ },
1713
+ [
1714
+ (0, import_vue.h)("i", {
1715
+ class: getIcon().UPLOAD_LOADING
1716
+ })
1717
+ ]
1718
+ ),
1719
+ showProgress ? (0, import_vue.h)(
1720
+ "div",
1721
+ {
1722
+ class: "vxe-upload--image-item-loading-text"
1723
+ },
1724
+ progressText ? import_xe_utils.default.toFormatString(`${import_xe_utils.default.isFunction(progressText) ? progressText({}) : progressText}`, { percent: cacheItem.percent }) : getI18n("vxe.upload.uploadProgress", [cacheItem.percent])
1725
+ ) : renderEmptyElement($xeUpload)
1726
+ ]
1727
+ ) : renderEmptyElement($xeUpload),
1728
+ (0, import_vue.h)(
1729
+ "div",
1730
+ {
1731
+ class: "vxe-upload--image-item-img-wrapper",
1732
+ title: getI18n("vxe.upload.viewItemTitle")
1733
+ },
1734
+ [
1735
+ (0, import_vue.h)("img", {
1736
+ class: "vxe-upload--image-item-img",
1737
+ src: getThumbnailFileUrl(item)
1738
+ })
1739
+ ]
1740
+ ),
1741
+ !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, import_vue.h)(
1742
+ "div",
1743
+ {
1744
+ class: "vxe-upload--image-item-rebtn"
1745
+ },
1746
+ [
1747
+ (0, import_vue.h)(import_button.default, {
1748
+ icon: isError ? getIcon().UPLOAD_IMAGE_RE_UPLOAD : getIcon().UPLOAD_IMAGE_UPLOAD,
1749
+ mode: "text",
1750
+ status: "primary",
1751
+ content: isError ? getI18n("vxe.upload.reUpload") : getI18n("vxe.upload.manualUpload"),
1752
+ onClick(evnt) {
1753
+ handleReUploadEvent(evnt, item);
1754
+ }
1755
+ })
1756
+ ]
1757
+ ) : renderEmptyElement($xeUpload),
1758
+ (0, import_vue.h)(
1759
+ "div",
1760
+ {
1761
+ class: "vxe-upload--image-item-btn-wrapper",
1762
+ onClick(evnt) {
1763
+ evnt.stopPropagation();
1764
+ }
1765
+ },
1766
+ actionSlot ? (0, import_vn.getSlotVNs)(actionSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly })) : [
1767
+ cornerSlot ? (0, import_vue.h)(
1768
+ "div",
1769
+ {
1770
+ class: "vxe-upload--file-item-action"
1771
+ },
1772
+ (0, import_vn.getSlotVNs)(cornerSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly }))
1773
+ ) : renderEmptyElement($xeUpload),
1774
+ showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0, import_vue.h)(
1775
+ "div",
1776
+ {
1777
+ class: "vxe-upload--image-item-remove-btn",
1778
+ onClick(evnt) {
1779
+ evnt.stopPropagation();
1780
+ removeFileEvent(evnt, item, index);
1781
+ }
1782
+ },
1783
+ [
1784
+ (0, import_vue.h)("i", {
1785
+ class: getIcon().UPLOAD_IMAGE_REMOVE
1786
+ })
1787
+ ]
1788
+ ) : renderEmptyElement($xeUpload)
1789
+ ]
1790
+ )
1632
1791
  ]
1633
- ) : renderEmptyElement($xeUpload),
1634
- showMoreButton && moreConfig && isHorizontal ? renderFileAction(false) : renderEmptyElement($xeUpload)
1792
+ )
1635
1793
  ]
1636
- )
1637
- ] : [renderFileAction(false)]
1638
- );
1639
- };
1640
- const renderImageItemList = (currList, isMoreView) => {
1641
- const { showRemoveButton, showProgress, progressText, showPreview, showErrorStatus, dragSort, autoSubmit, showSubmitButton } = props;
1642
- const { fileList, fileCacheMaps } = reactData;
1643
- const isDisabled = computeIsDisabled.value;
1644
- const formReadonly = computeFormReadonly.value;
1645
- const imageOpts = computeImageOpts.value;
1646
- const imgStyle = computeImgStyle.value;
1647
- const optionSlot = slots.option;
1648
- const actionSlot = slots.action;
1649
- const cornerSlot = slots.corner;
1650
- const ons = {
1651
- onMousedown: handleItemMousedownEvent
1794
+ );
1795
+ });
1652
1796
  };
1653
- if (dragSort && currList.length > 1) {
1654
- ons.onDragstart = handleDragSortDragstartEvent;
1655
- ons.onDragover = handleDragSortDragoverEvent;
1656
- ons.onDragend = handleDragSortDragendEvent;
1657
- }
1658
- return currList.map((item, index) => {
1659
- const fileKey = getFieldKey(item);
1660
- const cacheItem = fileCacheMaps[fileKey];
1661
- let isLoading = false;
1662
- let isError = false;
1663
- let isPending = false;
1664
- if (cacheItem) {
1665
- isLoading = cacheItem.loading;
1666
- isError = cacheItem.status === "error";
1667
- isPending = cacheItem.status === "pending";
1797
+ const renderImageAction = (isMoreView) => {
1798
+ const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props;
1799
+ const { fileList } = reactData;
1800
+ const formReadonly = computeFormReadonly.value;
1801
+ const showTipText = computedShowTipText.value;
1802
+ const defTipText = computedDefTipText.value;
1803
+ const overCount = computeOverCount.value;
1804
+ const imgStyle = computeImgStyle.value;
1805
+ const defaultSlot = slots.default;
1806
+ const tipSlot = slots.tip || slots.hint;
1807
+ if (formReadonly || !showUploadButton || autoHiddenButton && overCount) {
1808
+ return renderEmptyElement($xeUpload);
1668
1809
  }
1669
1810
  return (0, import_vue.h)(
1670
1811
  "div",
1671
1812
  {
1672
- key: dragSort ? fileKey : index,
1673
- class: [
1674
- "vxe-upload--image-item",
1675
- {
1676
- "is--preview": showPreview,
1677
- "is--circle": imageOpts.circle,
1678
- "is--loading": isLoading,
1679
- "is--pending": isPending,
1680
- "is--error": isError
1681
- }
1682
- ],
1683
- fileid: fileKey,
1684
- draggable: dragSort ? true : null,
1685
- ...ons
1813
+ key: "action",
1814
+ class: "vxe-upload--image-action"
1686
1815
  },
1687
- optionSlot ? (0, import_vn.getSlotVNs)(optionSlot({ option: item, isMoreView, options: fileList })) : [
1816
+ [
1688
1817
  (0, import_vue.h)(
1689
1818
  "div",
1690
1819
  {
1691
- class: "vxe-upload--image-item-box",
1692
- style: isMoreView ? null : imgStyle,
1693
- onClick(evnt) {
1694
- if (!isLoading && !isError) {
1695
- handlePreviewImageEvent(evnt, item, index);
1696
- }
1697
- }
1820
+ class: "vxe-upload--image-action-btn",
1821
+ onClick: clickEvent
1698
1822
  },
1699
- [
1700
- isLoading && cacheItem ? (0, import_vue.h)(
1823
+ defaultSlot ? defaultSlot({ isMoreView, options: fileList, $upload: $xeUpload }) : [
1824
+ (0, import_vue.h)(
1701
1825
  "div",
1702
1826
  {
1703
- class: "vxe-upload--image-item-loading"
1827
+ class: "vxe-upload--image-action-box",
1828
+ style: isMoreView ? null : imgStyle
1704
1829
  },
1705
1830
  [
1706
- (0, import_vue.h)(
1831
+ showButtonIcon ? (0, import_vue.h)(
1707
1832
  "div",
1708
1833
  {
1709
- class: "vxe-upload--image-item-loading-icon"
1834
+ class: "vxe-upload--image-action-icon"
1710
1835
  },
1711
1836
  [
1712
1837
  (0, import_vue.h)("i", {
1713
- class: getIcon().UPLOAD_LOADING
1838
+ class: buttonIcon || getIcon().UPLOAD_IMAGE_ADD
1714
1839
  })
1715
1840
  ]
1716
- ),
1717
- showProgress ? (0, import_vue.h)(
1718
- "div",
1719
- {
1720
- class: "vxe-upload--image-item-loading-text"
1721
- },
1722
- progressText ? import_xe_utils.default.toFormatString(`${import_xe_utils.default.isFunction(progressText) ? progressText({}) : progressText}`, { percent: cacheItem.percent }) : getI18n("vxe.upload.uploadProgress", [cacheItem.percent])
1723
- ) : renderEmptyElement($xeUpload)
1724
- ]
1725
- ) : renderEmptyElement($xeUpload),
1726
- (0, import_vue.h)(
1727
- "div",
1728
- {
1729
- class: "vxe-upload--image-item-img-wrapper",
1730
- title: getI18n("vxe.upload.viewItemTitle")
1731
- },
1732
- [
1733
- (0, import_vue.h)("img", {
1734
- class: "vxe-upload--image-item-img",
1735
- src: getThumbnailFileUrl(item)
1736
- })
1737
- ]
1738
- ),
1739
- !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, import_vue.h)(
1740
- "div",
1741
- {
1742
- class: "vxe-upload--image-item-rebtn"
1743
- },
1744
- [
1745
- (0, import_vue.h)(import_button.default, {
1746
- icon: isError ? getIcon().UPLOAD_IMAGE_RE_UPLOAD : getIcon().UPLOAD_IMAGE_UPLOAD,
1747
- mode: "text",
1748
- status: "primary",
1749
- content: isError ? getI18n("vxe.upload.reUpload") : getI18n("vxe.upload.manualUpload"),
1750
- onClick(evnt) {
1751
- handleReUploadEvent(evnt, item);
1752
- }
1753
- })
1754
- ]
1755
- ) : renderEmptyElement($xeUpload),
1756
- (0, import_vue.h)(
1757
- "div",
1758
- {
1759
- class: "vxe-upload--image-item-btn-wrapper",
1760
- onClick(evnt) {
1761
- evnt.stopPropagation();
1762
- }
1763
- },
1764
- actionSlot ? (0, import_vn.getSlotVNs)(actionSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly })) : [
1765
- cornerSlot ? (0, import_vue.h)(
1841
+ ) : renderEmptyElement($xeUpload),
1842
+ isMoreView || showButtonText ? (0, import_vue.h)(
1766
1843
  "div",
1767
1844
  {
1768
- class: "vxe-upload--file-item-action"
1845
+ class: "vxe-upload--image-action-content"
1769
1846
  },
1770
- (0, import_vn.getSlotVNs)(cornerSlot({ option: item, isMoreView, options: fileList, readonly: formReadonly }))
1847
+ buttonText ? `${import_xe_utils.default.isFunction(buttonText) ? buttonText({}) : buttonText}` : getI18n("vxe.upload.imgBtnText")
1771
1848
  ) : renderEmptyElement($xeUpload),
1772
- showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0, import_vue.h)(
1849
+ showTipText && (defTipText || tipSlot) ? (0, import_vue.h)(
1773
1850
  "div",
1774
1851
  {
1775
- class: "vxe-upload--image-item-remove-btn",
1776
- onClick(evnt) {
1777
- evnt.stopPropagation();
1778
- removeFileEvent(evnt, item, index);
1779
- }
1852
+ class: "vxe-upload--image-action-hint"
1780
1853
  },
1781
- [
1782
- (0, import_vue.h)("i", {
1783
- class: getIcon().UPLOAD_IMAGE_REMOVE
1784
- })
1785
- ]
1854
+ tipSlot ? (0, import_vn.getSlotVNs)(tipSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : `${defTipText}`
1786
1855
  ) : renderEmptyElement($xeUpload)
1787
1856
  ]
1788
1857
  )
@@ -1790,110 +1859,66 @@ var upload_default = (0, import_comp.defineVxeComponent)({
1790
1859
  )
1791
1860
  ]
1792
1861
  );
1793
- });
1794
- };
1795
- const renderImageAction = (isMoreView) => {
1796
- const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props;
1797
- const { fileList } = reactData;
1798
- const formReadonly = computeFormReadonly.value;
1799
- const showTipText = computedShowTipText.value;
1800
- const defTipText = computedDefTipText.value;
1801
- const overCount = computeOverCount.value;
1802
- const imgStyle = computeImgStyle.value;
1803
- const defaultSlot = slots.default;
1804
- const tipSlot = slots.tip || slots.hint;
1805
- if (formReadonly || !showUploadButton || autoHiddenButton && overCount) {
1806
- return renderEmptyElement($xeUpload);
1807
- }
1808
- return (0, import_vue.h)(
1809
- "div",
1810
- {
1811
- key: "action",
1812
- class: "vxe-upload--image-action"
1813
- },
1814
- [
1815
- (0, import_vue.h)(
1816
- "div",
1817
- {
1818
- class: "vxe-upload--image-action-btn",
1819
- onClick: clickEvent
1820
- },
1821
- defaultSlot ? defaultSlot({ isMoreView, options: fileList, $upload: $xeUpload }) : [
1822
- (0, import_vue.h)(
1823
- "div",
1824
- {
1825
- class: "vxe-upload--image-action-box",
1826
- style: isMoreView ? null : imgStyle
1827
- },
1828
- [
1829
- showButtonIcon ? (0, import_vue.h)(
1862
+ };
1863
+ const renderImageMode = () => {
1864
+ const { showList, dragSort } = props;
1865
+ const { fileList, isDragMove } = reactData;
1866
+ const moreOpts = computeMoreOpts.value;
1867
+ const moreBtnSlot = slots.moreButton || slots["more-button"];
1868
+ const { maxCount, showMoreButton, moreButtonText } = moreOpts;
1869
+ let currList = fileList;
1870
+ let overMaxNum = 0;
1871
+ let isMoreMax = false;
1872
+ let isMiniMore = false;
1873
+ if (import_xe_utils.default.isNumber(maxCount) && fileList.length > maxCount) {
1874
+ isMoreMax = true;
1875
+ isMiniMore = maxCount === 0;
1876
+ overMaxNum = fileList.length - maxCount;
1877
+ currList = fileList.slice(0, maxCount);
1878
+ }
1879
+ return (0, import_vue.h)(
1880
+ "div",
1881
+ {
1882
+ key: "image",
1883
+ class: "vxe-upload--image-wrapper"
1884
+ },
1885
+ showList ? [
1886
+ dragSort ? (0, import_vue.h)(
1887
+ import_vue.TransitionGroup,
1888
+ {
1889
+ name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1890
+ tag: "div",
1891
+ class: "vxe-upload--image-list"
1892
+ },
1893
+ {
1894
+ default: () => renderImageItemList(currList, false).concat([
1895
+ showMoreButton && overMaxNum ? (0, import_vue.h)(
1830
1896
  "div",
1831
1897
  {
1832
- class: "vxe-upload--image-action-icon"
1898
+ key: "om",
1899
+ class: "vxe-upload--image-over-more"
1833
1900
  },
1834
- [
1835
- (0, import_vue.h)("i", {
1836
- class: buttonIcon || getIcon().UPLOAD_IMAGE_ADD
1901
+ moreBtnSlot ? (0, import_vn.getSlotVNs)(moreBtnSlot({ options: fileList })) : [
1902
+ (0, import_vue.h)(import_button.default, {
1903
+ mode: "text",
1904
+ content: moreButtonText ? import_xe_utils.default.isFunction(moreButtonText) ? moreButtonText({ $upload: $xeUpload, options: fileList }) : import_xe_utils.default.toFormatString(moreButtonText, [fileList.length]) : getI18n(isMoreMax && isMiniMore ? "vxe.upload.moreImgBtnText" : "vxe.upload.moreBtnText", [fileList.length]),
1905
+ status: "primary",
1906
+ onClick: handleMoreEvent
1837
1907
  })
1838
1908
  ]
1839
1909
  ) : renderEmptyElement($xeUpload),
1840
- isMoreView || showButtonText ? (0, import_vue.h)(
1841
- "div",
1842
- {
1843
- class: "vxe-upload--image-action-content"
1844
- },
1845
- buttonText ? `${import_xe_utils.default.isFunction(buttonText) ? buttonText({}) : buttonText}` : getI18n("vxe.upload.imgBtnText")
1846
- ) : renderEmptyElement($xeUpload),
1847
- showTipText && (defTipText || tipSlot) ? (0, import_vue.h)(
1848
- "div",
1849
- {
1850
- class: "vxe-upload--image-action-hint"
1851
- },
1852
- tipSlot ? (0, import_vn.getSlotVNs)(tipSlot({ isMoreView, options: fileList, $upload: $xeUpload })) : `${defTipText}`
1853
- ) : renderEmptyElement($xeUpload)
1854
- ]
1855
- )
1856
- ]
1857
- )
1858
- ]
1859
- );
1860
- };
1861
- const renderImageMode = () => {
1862
- const { showList, dragSort } = props;
1863
- const { fileList, isDragMove } = reactData;
1864
- const moreOpts = computeMoreOpts.value;
1865
- const moreBtnSlot = slots.moreButton || slots["more-button"];
1866
- const { maxCount, showMoreButton, moreButtonText } = moreOpts;
1867
- let currList = fileList;
1868
- let overMaxNum = 0;
1869
- let isMoreMax = false;
1870
- let isMiniMore = false;
1871
- if (import_xe_utils.default.isNumber(maxCount) && fileList.length > maxCount) {
1872
- isMoreMax = true;
1873
- isMiniMore = maxCount === 0;
1874
- overMaxNum = fileList.length - maxCount;
1875
- currList = fileList.slice(0, maxCount);
1876
- }
1877
- return (0, import_vue.h)(
1878
- "div",
1879
- {
1880
- key: "image",
1881
- class: "vxe-upload--image-wrapper"
1882
- },
1883
- showList ? [
1884
- dragSort ? (0, import_vue.h)(
1885
- import_vue.TransitionGroup,
1886
- {
1887
- name: `vxe-upload--drag-list${isDragMove ? "" : "-disabled"}`,
1888
- tag: "div",
1889
- class: "vxe-upload--image-list"
1890
- },
1891
- {
1892
- default: () => renderImageItemList(currList, false).concat([
1910
+ renderImageAction(false)
1911
+ ])
1912
+ }
1913
+ ) : (0, import_vue.h)(
1914
+ "div",
1915
+ {
1916
+ class: "vxe-upload--image-list"
1917
+ },
1918
+ renderImageItemList(currList, false).concat([
1893
1919
  showMoreButton && overMaxNum ? (0, import_vue.h)(
1894
1920
  "div",
1895
1921
  {
1896
- key: "om",
1897
1922
  class: "vxe-upload--image-over-more"
1898
1923
  },
1899
1924
  moreBtnSlot ? (0, import_vn.getSlotVNs)(moreBtnSlot({ options: fileList })) : [
@@ -1907,133 +1932,111 @@ var upload_default = (0, import_comp.defineVxeComponent)({
1907
1932
  ) : renderEmptyElement($xeUpload),
1908
1933
  renderImageAction(false)
1909
1934
  ])
1910
- }
1911
- ) : (0, import_vue.h)(
1912
- "div",
1913
- {
1914
- class: "vxe-upload--image-list"
1915
- },
1916
- renderImageItemList(currList, false).concat([
1917
- showMoreButton && overMaxNum ? (0, import_vue.h)(
1918
- "div",
1919
- {
1920
- class: "vxe-upload--image-over-more"
1921
- },
1922
- moreBtnSlot ? (0, import_vn.getSlotVNs)(moreBtnSlot({ options: fileList })) : [
1923
- (0, import_vue.h)(import_button.default, {
1924
- mode: "text",
1925
- content: moreButtonText ? import_xe_utils.default.isFunction(moreButtonText) ? moreButtonText({ $upload: $xeUpload, options: fileList }) : import_xe_utils.default.toFormatString(moreButtonText, [fileList.length]) : getI18n(isMoreMax && isMiniMore ? "vxe.upload.moreImgBtnText" : "vxe.upload.moreBtnText", [fileList.length]),
1926
- status: "primary",
1927
- onClick: handleMoreEvent
1928
- })
1929
- ]
1930
- ) : renderEmptyElement($xeUpload),
1931
- renderImageAction(false)
1932
- ])
1933
- )
1934
- ] : [
1935
- (0, import_vue.h)(
1936
- "div",
1937
- {
1938
- class: "vxe-upload--image-list"
1939
- },
1940
- [renderImageAction(false)]
1941
- )
1942
- ]
1943
- );
1944
- };
1945
- const renderVN = () => {
1946
- const { showErrorStatus, dragToUpload, pasteToUpload, dragSort, dragPlaceholder } = props;
1947
- const { isDragUploadStatus, showMorePopup, isActivated, dragIndex } = reactData;
1948
- const vSize = computeSize.value;
1949
- const isDisabled = computeIsDisabled.value;
1950
- const formReadonly = computeFormReadonly.value;
1951
- const isImage = computeIsImage.value;
1952
- const ons = {
1953
- onMousedown: handleItemMousedownEvent
1935
+ )
1936
+ ] : [
1937
+ (0, import_vue.h)(
1938
+ "div",
1939
+ {
1940
+ class: "vxe-upload--image-list"
1941
+ },
1942
+ [renderImageAction(false)]
1943
+ )
1944
+ ]
1945
+ );
1954
1946
  };
1955
- if (dragToUpload && dragIndex === -1) {
1956
- ons.onDragover = handleUploadDragoverEvent;
1957
- ons.onDragleave = handleUploadDragleaveEvent;
1958
- ons.onDrop = handleUploadDropEvent;
1959
- }
1960
- return (0, import_vue.h)(
1961
- "div",
1962
- {
1963
- ref: refElem,
1964
- class: [
1965
- "vxe-upload",
1966
- {
1967
- [`size--${vSize}`]: vSize,
1968
- "is--active": isActivated,
1969
- "is--readonly": formReadonly,
1970
- "is--disabled": isDisabled,
1971
- "is--paste": pasteToUpload,
1972
- "show--error": showErrorStatus,
1973
- "is--drag": isDragUploadStatus
1974
- }
1975
- ],
1976
- ...ons
1977
- },
1978
- [
1979
- isImage ? renderImageMode() : rendeFileMode(),
1980
- dragSort ? (0, import_vue.h)("div", {
1981
- ref: refDragLineElem,
1982
- class: "vxe-upload--drag-line"
1983
- }) : renderEmptyElement($xeUpload),
1984
- isDragUploadStatus && !showMorePopup ? (0, import_vue.h)(
1985
- "div",
1986
- {
1987
- class: "vxe-upload--drag-placeholder"
1988
- },
1989
- dragPlaceholder || getI18n("vxe.upload.dragPlaceholder")
1990
- ) : renderEmptyElement($xeUpload)
1991
- ]
1947
+ const renderVN = () => {
1948
+ const { showErrorStatus, dragToUpload, pasteToUpload, dragSort, dragPlaceholder } = props;
1949
+ const { isDragUploadStatus, showMorePopup, isActivated, dragIndex } = reactData;
1950
+ const vSize = computeSize.value;
1951
+ const isDisabled = computeIsDisabled.value;
1952
+ const formReadonly = computeFormReadonly.value;
1953
+ const isImage = computeIsImage.value;
1954
+ const ons = {
1955
+ onMousedown: handleItemMousedownEvent
1956
+ };
1957
+ if (dragToUpload && dragIndex === -1) {
1958
+ ons.onDragover = handleUploadDragoverEvent;
1959
+ ons.onDragleave = handleUploadDragleaveEvent;
1960
+ ons.onDrop = handleUploadDropEvent;
1961
+ }
1962
+ return (0, import_vue.h)(
1963
+ "div",
1964
+ {
1965
+ ref: refElem,
1966
+ class: [
1967
+ "vxe-upload",
1968
+ {
1969
+ [`size--${vSize}`]: vSize,
1970
+ "is--active": isActivated,
1971
+ "is--readonly": formReadonly,
1972
+ "is--disabled": isDisabled,
1973
+ "is--paste": pasteToUpload,
1974
+ "show--error": showErrorStatus,
1975
+ "is--drag": isDragUploadStatus
1976
+ }
1977
+ ],
1978
+ ...ons
1979
+ },
1980
+ [
1981
+ isImage ? renderImageMode() : rendeFileMode(),
1982
+ dragSort ? (0, import_vue.h)("div", {
1983
+ ref: refDragLineElem,
1984
+ class: "vxe-upload--drag-line"
1985
+ }) : renderEmptyElement($xeUpload),
1986
+ isDragUploadStatus && !showMorePopup ? (0, import_vue.h)(
1987
+ "div",
1988
+ {
1989
+ class: "vxe-upload--drag-placeholder"
1990
+ },
1991
+ dragPlaceholder || getI18n("vxe.upload.dragPlaceholder")
1992
+ ) : renderEmptyElement($xeUpload)
1993
+ ]
1994
+ );
1995
+ };
1996
+ const listFlag = (0, import_vue.ref)(0);
1997
+ (0, import_vue.watch)(
1998
+ () => props.modelValue ? props.modelValue.length : 0,
1999
+ () => {
2000
+ listFlag.value++;
2001
+ }
1992
2002
  );
1993
- };
1994
- const listFlag = (0, import_vue.ref)(0);
1995
- (0, import_vue.watch)(
1996
- () => props.modelValue ? props.modelValue.length : 0,
1997
- () => {
1998
- listFlag.value++;
1999
- }
2000
- );
2001
- (0, import_vue.watch)(
2002
- () => props.modelValue,
2003
- () => {
2004
- listFlag.value++;
2005
- }
2006
- );
2007
- (0, import_vue.watch)(listFlag, () => {
2003
+ (0, import_vue.watch)(
2004
+ () => props.modelValue,
2005
+ () => {
2006
+ listFlag.value++;
2007
+ }
2008
+ );
2009
+ (0, import_vue.watch)(listFlag, () => {
2010
+ updateFileList();
2011
+ });
2012
+ (0, import_vue.onMounted)(() => {
2013
+ if (props.multiple && props.singleMode) {
2014
+ errLog("vxe.error.errConflicts", ["multiple", "single-mode"]);
2015
+ }
2016
+ if (props.imageStyle) {
2017
+ warnLog("vxe.error.delProp", ["image-style", "image-config"]);
2018
+ }
2019
+ if (props.dragSort) {
2020
+ (0, import_dom.initTpImg)();
2021
+ }
2022
+ globalEvents.on($xeUpload, "paste", handleGlobalPasteEvent);
2023
+ globalEvents.on($xeUpload, "click", handleGlobalClickEvent);
2024
+ globalEvents.on($xeUpload, "blur", handleGlobalBlurEvent);
2025
+ });
2026
+ (0, import_vue.onBeforeUnmount)(() => {
2027
+ reactData.isDragUploadStatus = false;
2028
+ globalEvents.off($xeUpload, "paste");
2029
+ globalEvents.off($xeUpload, "click");
2030
+ globalEvents.off($xeUpload, "blur");
2031
+ import_xe_utils.default.assign(reactData, createReactData());
2032
+ import_xe_utils.default.assign(internalData, createInternalData());
2033
+ });
2008
2034
  updateFileList();
2009
- });
2010
- (0, import_vue.onMounted)(() => {
2011
- if (props.multiple && props.singleMode) {
2012
- errLog("vxe.error.errConflicts", ["multiple", "single-mode"]);
2013
- }
2014
- if (props.imageStyle) {
2015
- warnLog("vxe.error.delProp", ["image-style", "image-config"]);
2016
- }
2017
- if (props.dragSort) {
2018
- (0, import_dom.initTpImg)();
2019
- }
2020
- globalEvents.on($xeUpload, "paste", handleGlobalPasteEvent);
2021
- globalEvents.on($xeUpload, "click", handleGlobalClickEvent);
2022
- globalEvents.on($xeUpload, "blur", handleGlobalBlurEvent);
2023
- });
2024
- (0, import_vue.onBeforeUnmount)(() => {
2025
- reactData.isDragUploadStatus = false;
2026
- globalEvents.off($xeUpload, "paste");
2027
- globalEvents.off($xeUpload, "click");
2028
- globalEvents.off($xeUpload, "blur");
2029
- import_xe_utils.default.assign(reactData, createReactData());
2030
- import_xe_utils.default.assign(internalData, createInternalData());
2031
- });
2032
- updateFileList();
2033
- $xeUpload.renderVN = renderVN;
2034
- return $xeUpload;
2035
- },
2036
- render() {
2037
- return this.renderVN();
2038
- }
2039
- });
2035
+ $xeUpload.renderVN = renderVN;
2036
+ return $xeUpload;
2037
+ },
2038
+ render() {
2039
+ return this.renderVN();
2040
+ }
2041
+ })
2042
+ );