@vunk/form 2.18.2 → 2.19.0

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 (323) hide show
  1. package/components/_plugin-vue_export-helper.cjs +1 -11
  2. package/components/api-tables-select/index.cjs +1 -467
  3. package/components/api-tables-select/index.mjs +56 -413
  4. package/components/api-tables-select/src/ctx.d.ts +152 -172
  5. package/components/api-tables-select/src/index.vue.d.ts +394 -983
  6. package/components/button/index.cjs +1 -112
  7. package/components/button/index.mjs +57 -85
  8. package/components/button/src/ctx.d.ts +28 -113
  9. package/components/button/src/index.vue.d.ts +317 -625
  10. package/components/card-input-collection/index.cjs +1 -370
  11. package/components/card-input-collection/index.mjs +175 -277
  12. package/components/card-input-collection/src/core.vue.d.ts +54 -951
  13. package/components/card-input-collection/src/ctx.d.ts +19 -49
  14. package/components/card-input-collection/src/index.vue.d.ts +46 -110
  15. package/components/cascader/index.cjs +1 -150
  16. package/components/cascader/index.mjs +88 -116
  17. package/components/cascader/src/ctx.d.ts +140 -207
  18. package/components/cascader/src/index.vue.d.ts +315 -522
  19. package/components/cascader/src/use.d.ts +1 -1
  20. package/components/checkbox/index.cjs +1 -152
  21. package/components/checkbox/index.mjs +75 -119
  22. package/components/checkbox/src/ctx.d.ts +46 -69
  23. package/components/checkbox/src/index.vue.d.ts +448 -1016
  24. package/components/cloneDeep.cjs +1 -2106
  25. package/components/color-picker/index.cjs +1 -80
  26. package/components/color-picker/index.mjs +46 -69
  27. package/components/color-picker/src/ctx.d.ts +130 -107
  28. package/components/color-picker/src/index.vue.d.ts +285 -255
  29. package/components/date-picker/index.cjs +1 -119
  30. package/components/date-picker/index.mjs +63 -97
  31. package/components/date-picker/src/ctx.d.ts +123 -206
  32. package/components/date-picker/src/index.vue.d.ts +269 -1358
  33. package/components/date-picker/src/types.d.ts +7 -7
  34. package/components/date-picker-range/index.cjs +1 -177
  35. package/components/date-picker-range/index.mjs +62 -113
  36. package/components/date-picker-range/src/ctx.d.ts +130 -206
  37. package/components/date-picker-range/src/index.vue.d.ts +861 -448
  38. package/components/debounce.cjs +1 -0
  39. package/components/dialog/index.cjs +1 -126
  40. package/components/dialog/index.mjs +65 -99
  41. package/components/dialog/src/ctx.d.ts +17 -108
  42. package/components/dialog/src/index.vue.d.ts +77 -1072
  43. package/components/dialog-input-collection/index.cjs +1 -624
  44. package/components/dialog-input-collection/index.mjs +276 -498
  45. package/components/dialog-input-collection/src/ctx.d.ts +21 -52
  46. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +29 -6371
  47. package/components/dialog-input-collection/src/index.vue.d.ts +65 -7630
  48. package/components/dialog-input-collection/src/layout.vue.d.ts +13 -73
  49. package/components/download-plus/index.cjs +1 -456
  50. package/components/download-plus/index.mjs +215 -358
  51. package/components/download-plus/src/api.d.ts +1 -1
  52. package/components/download-plus/src/ctx.d.ts +21 -52
  53. package/components/download-plus/src/index.vue.d.ts +437 -1177
  54. package/components/editable-text/index.cjs +1 -295
  55. package/components/editable-text/index.mjs +113 -239
  56. package/components/editable-text/src/ctx.d.ts +24 -50
  57. package/components/editable-text/src/index.vue.d.ts +59 -3258
  58. package/components/el-slider/index.cjs +1 -0
  59. package/components/el-slider/index.d.ts +5 -0
  60. package/components/el-slider/index.mjs +475 -0
  61. package/components/el-slider/src/button.d.ts +36 -0
  62. package/components/el-slider/src/button.vue.d.ts +41 -0
  63. package/components/el-slider/src/composables/index.cjs +1 -0
  64. package/components/el-slider/src/composables/index.d.ts +6 -0
  65. package/components/el-slider/src/composables/index.mjs +9 -0
  66. package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
  67. package/components/el-slider/src/composables/use-marks.d.ts +7 -0
  68. package/components/el-slider/src/composables/use-slide.d.ts +23 -0
  69. package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
  70. package/components/el-slider/src/composables/use-stops.d.ts +8 -0
  71. package/components/el-slider/src/composables/use-watch.d.ts +4 -0
  72. package/components/el-slider/src/constants.d.ts +14 -0
  73. package/components/el-slider/src/marker.d.ts +37 -0
  74. package/components/el-slider/src/slider-core.vue.d.ts +218 -0
  75. package/components/el-slider/src/slider.d.ts +174 -0
  76. package/components/esri-input-geojson/index.cjs +2 -1604
  77. package/components/esri-input-geojson/index.mjs +682 -1290
  78. package/components/esri-input-geojson/src/append.vue.d.ts +239 -1099
  79. package/components/esri-input-geojson/src/const.d.ts +1 -1
  80. package/components/esri-input-geojson/src/ctx.d.ts +66 -161
  81. package/components/esri-input-geojson/src/default-view.vue.d.ts +8 -132
  82. package/components/esri-input-geojson/src/index.vue.d.ts +982 -708
  83. package/components/esri-input-geojson/src/types.d.ts +1 -0
  84. package/components/esri-input-geojson/src/viewer.vue.d.ts +53 -282
  85. package/components/fieldset/index.cjs +1 -110
  86. package/components/fieldset/index.mjs +63 -76
  87. package/components/fieldset/src/ctx.d.ts +4 -4
  88. package/components/fieldset/src/index.vue.d.ts +7 -7
  89. package/components/form/index.cjs +1 -248
  90. package/components/form/index.mjs +107 -161
  91. package/components/form/src/ctx.d.ts +15 -64
  92. package/components/form/src/index.vue.d.ts +374 -2431
  93. package/components/form-item/index.cjs +1 -294
  94. package/components/form-item/index.mjs +140 -229
  95. package/components/form-item/src/core.vue.d.ts +32 -1854
  96. package/components/form-item/src/ctx.d.ts +19 -51
  97. package/components/form-item/src/index.vue.d.ts +38 -101
  98. package/components/form-item-renderer/index.cjs +1 -193
  99. package/components/form-item-renderer/index.mjs +103 -162
  100. package/components/form-item-renderer/src/core.vue.d.ts +9 -9
  101. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  102. package/components/form-item-renderer/src/index.vue.d.ts +24 -74
  103. package/components/form-item-renderer-template/index.cjs +1 -47
  104. package/components/form-item-renderer-template/index.mjs +20 -33
  105. package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
  106. package/components/forms-provider/index.cjs +1 -99
  107. package/components/forms-provider/index.mjs +44 -73
  108. package/components/forms-provider/src/core.d.ts +3 -2
  109. package/components/forms-provider/src/segment.vue.d.ts +8 -8
  110. package/components/forms-provider/src/view.vue.d.ts +14 -4
  111. package/components/index.cjs +1 -399
  112. package/components/index2.cjs +1 -17
  113. package/components/information/index.cjs +1 -65
  114. package/components/information/index.mjs +28 -38
  115. package/components/information/src/ctx.d.ts +2 -2
  116. package/components/information/src/index.vue.d.ts +4 -4
  117. package/components/information-collection/index.cjs +1 -81
  118. package/components/information-collection/index.mjs +44 -48
  119. package/components/information-collection/src/ctx.d.ts +29 -65
  120. package/components/information-collection/src/index.vue.d.ts +64 -136
  121. package/components/information-renderer/index.cjs +1 -16
  122. package/components/information-renderer/index.d.ts +9 -9
  123. package/components/information-renderer/index.mjs +9 -10
  124. package/components/information-tag/index.cjs +1 -101
  125. package/components/information-tag/index.mjs +44 -54
  126. package/components/information-tag/src/ctx.d.ts +6 -21
  127. package/components/information-tag/src/index.vue.d.ts +23 -51
  128. package/components/information-templates-default/index.cjs +1 -101
  129. package/components/information-templates-default/index.mjs +63 -73
  130. package/components/information-templates-default/src/index.vue.d.ts +1 -1
  131. package/components/input/index.cjs +1 -115
  132. package/components/input/index.mjs +60 -83
  133. package/components/input/src/ctx.d.ts +51 -152
  134. package/components/input/src/index.vue.d.ts +392 -951
  135. package/components/input-array/index.cjs +1 -310
  136. package/components/input-array/index.mjs +114 -244
  137. package/components/input-array/src/ctx.d.ts +19 -49
  138. package/components/input-array/src/form-template.vue.d.ts +1 -901
  139. package/components/input-array/src/index.vue.d.ts +43 -730
  140. package/components/input-collection/index.cjs +1 -452
  141. package/components/input-collection/index.mjs +195 -355
  142. package/components/input-collection/src/core.vue.d.ts +64 -1026
  143. package/components/input-collection/src/ctx.d.ts +21 -51
  144. package/components/input-collection/src/index.vue.d.ts +50 -114
  145. package/components/input-file/index.cjs +1 -142
  146. package/components/input-file/index.mjs +68 -100
  147. package/components/input-file/src/ctx.d.ts +8 -29
  148. package/components/input-file/src/index.vue.d.ts +444 -74
  149. package/components/input-file/src/template.vue.d.ts +1 -124
  150. package/components/input-link/index.cjs +1 -167
  151. package/components/input-link/index.mjs +60 -83
  152. package/components/input-link/src/ctx.d.ts +52 -137
  153. package/components/input-link/src/index.vue.d.ts +833 -311
  154. package/components/input-number/index.cjs +1 -119
  155. package/components/input-number/index.mjs +73 -87
  156. package/components/input-number/src/ctx.d.ts +38 -131
  157. package/components/input-number/src/index.vue.d.ts +321 -683
  158. package/components/input-tag/index.cjs +1 -100
  159. package/components/input-tag/index.mjs +51 -78
  160. package/components/input-tag/src/ctx.d.ts +43 -145
  161. package/components/input-tag/src/index.vue.d.ts +324 -778
  162. package/components/isObject.cjs +1 -165
  163. package/components/monaco-editor/index.cjs +1 -83
  164. package/components/monaco-editor/index.mjs +40 -59
  165. package/components/monaco-editor/src/ctx.d.ts +19 -44
  166. package/components/monaco-editor/src/index.vue.d.ts +209 -109
  167. package/components/radio/index.cjs +1 -267
  168. package/components/radio/index.mjs +110 -209
  169. package/components/radio/src/ctx.d.ts +27 -91
  170. package/components/radio/src/index.vue.d.ts +298 -1279
  171. package/components/radio/src/option.vue.d.ts +29 -881
  172. package/components/radio/src/wraper.vue.d.ts +64 -196
  173. package/components/renderer-data/index.cjs +1 -41
  174. package/components/renderer-data/index.mjs +19 -26
  175. package/components/renderer-data/src/ctx.d.ts +1 -1
  176. package/components/renderer-data/src/index.vue.d.ts +2 -2
  177. package/components/select/index.cjs +1 -311
  178. package/components/select/index.mjs +156 -214
  179. package/components/select/src/core.vue.d.ts +638 -1080
  180. package/components/select/src/ctx.d.ts +140 -223
  181. package/components/select/src/index.vue.d.ts +334 -610
  182. package/components/select/src/options.vue.d.ts +1 -1
  183. package/components/slider/index.cjs +1 -88
  184. package/components/slider/index.mjs +41 -70
  185. package/components/slider/src/ctx.d.ts +63 -174
  186. package/components/slider/src/index.vue.d.ts +151 -420
  187. package/components/style.css +1 -0
  188. package/components/switch/index.cjs +1 -88
  189. package/components/switch/index.mjs +37 -69
  190. package/components/switch/src/ctx.d.ts +34 -113
  191. package/components/switch/src/index.vue.d.ts +88 -699
  192. package/components/switch/src/types.d.ts +2 -2
  193. package/components/tables-select/index.cjs +1 -263
  194. package/components/tables-select/index.mjs +102 -172
  195. package/components/tables-select/src/ctx.d.ts +76 -91
  196. package/components/tables-select/src/index.vue.d.ts +228 -4969
  197. package/components/template-instances-provider/index.cjs +1 -31
  198. package/components/template-instances-provider/index.mjs +18 -22
  199. package/components/template-instances-provider/src/index.vue.d.ts +2 -2
  200. package/components/templates-default/index.cjs +1 -235
  201. package/components/templates-default/index.mjs +152 -211
  202. package/components/templates-default/src/ctx.d.ts +5 -3
  203. package/components/templates-default/src/index.vue.d.ts +7298 -157
  204. package/components/templates-element-plus/index.cjs +1 -112
  205. package/components/templates-element-plus/index.mjs +49 -91
  206. package/components/templates-element-plus/src/ctx.d.ts +1 -1
  207. package/components/templates-element-plus/src/index.vue.d.ts +65 -258
  208. package/components/templates-esri/index.cjs +1 -65
  209. package/components/templates-esri/index.mjs +29 -39
  210. package/components/templates-esri/src/ctx.d.ts +1 -1
  211. package/components/templates-esri/src/index.vue.d.ts +1776 -24
  212. package/components/templates-layout/index.cjs +1 -137
  213. package/components/templates-layout/index.mjs +78 -116
  214. package/components/templates-layout/src/ctx.d.ts +1 -1
  215. package/components/templates-layout/src/index.vue.d.ts +79 -411
  216. package/components/templates-variant/index.cjs +1 -70
  217. package/components/templates-variant/index.mjs +33 -43
  218. package/components/templates-variant/src/ctx.d.ts +1 -1
  219. package/components/templates-variant/src/index.vue.d.ts +1238 -24
  220. package/components/time-picker/index.cjs +1 -104
  221. package/components/time-picker/index.mjs +57 -87
  222. package/components/time-picker/src/ctx.d.ts +121 -211
  223. package/components/time-picker/src/index.vue.d.ts +263 -1368
  224. package/components/upload/index.cjs +1 -663
  225. package/components/upload/index.mjs +343 -537
  226. package/components/upload/src/ctx.d.ts +108 -195
  227. package/components/upload/src/file.vue.d.ts +197 -776
  228. package/components/upload/src/index.vue.d.ts +689 -1931
  229. package/components/upload/src/types.d.ts +1 -1
  230. package/components/upload/src/wraper.vue.d.ts +232 -407
  231. package/components/upload-plus/index.cjs +21 -18673
  232. package/components/upload-plus/index.mjs +4598 -18372
  233. package/components/upload-plus/src/api.d.ts +2 -2
  234. package/components/upload-plus/src/ctx.d.ts +24 -51
  235. package/components/upload-plus/src/index.vue.d.ts +51 -1656
  236. package/components/use-watch.cjs +1 -0
  237. package/components/van-cascader/index.cjs +1 -125
  238. package/components/van-cascader/index.mjs +51 -96
  239. package/components/van-cascader/src/ctx.d.ts +135 -203
  240. package/components/van-cascader/src/index.vue.d.ts +312 -985
  241. package/components/var-datetime-picker/index.cjs +1 -333
  242. package/components/var-datetime-picker/index.mjs +175 -254
  243. package/components/var-datetime-picker/src/ctx.d.ts +19 -50
  244. package/components/var-datetime-picker/src/index.vue.d.ts +688 -1115
  245. package/components/vditor/index.cjs +1 -86
  246. package/components/vditor/index.mjs +40 -66
  247. package/components/vditor/src/ctx.d.ts +16 -45
  248. package/components/vditor/src/index.vue.d.ts +195 -120
  249. package/composables/element-plus/index.cjs +1 -23
  250. package/composables/element-plus/index.mjs +14 -18
  251. package/composables/index.cjs +1 -161
  252. package/composables/index.d.ts +1 -0
  253. package/composables/index.mjs +102 -135
  254. package/composables/useForm.d.ts +2 -2
  255. package/composables/useRtl.d.ts +18 -0
  256. package/composables/useSourceManager.d.ts +2 -2
  257. package/composables/useTemplateInstances.d.ts +3 -3
  258. package/index.css +1 -562
  259. package/index.d.ts +0 -3
  260. package/index.esm.js +23 -48
  261. package/locale/index.cjs +1 -102
  262. package/locale/index.mjs +34 -34
  263. package/locale/lang/index.cjs +1 -2
  264. package/locale/lang/index.d.ts +1 -0
  265. package/package.json +14 -85
  266. package/shared/const/index.cjs +1 -59
  267. package/shared/const/index.d.ts +1 -1
  268. package/shared/const/index.mjs +18 -20
  269. package/shared/element-plus/ctx.d.ts +40 -37
  270. package/shared/element-plus/index.cjs +1 -211
  271. package/shared/element-plus/index.mjs +93 -161
  272. package/shared/element-plus/instances.d.ts +207 -321
  273. package/shared/form/index.cjs +1 -33
  274. package/shared/form/index.mjs +23 -25
  275. package/shared/helper/index.cjs +1 -11
  276. package/shared/helper/index.mjs +7 -8
  277. package/shared/index.cjs +1 -8
  278. package/shared/index.mjs +5 -1
  279. package/shared/infer-prop/index.cjs +1 -36
  280. package/shared/infer-prop/index.mjs +22 -28
  281. package/shared/progress-it/index.cjs +1 -42
  282. package/shared/progress-it/index.mjs +15 -31
  283. package/shared/rules/index.cjs +1 -56
  284. package/shared/rules/index.mjs +19 -18
  285. package/shared/types/form/index.cjs +1 -2
  286. package/shared/types/index.cjs +1 -2
  287. package/shared/types/source/index.cjs +1 -2
  288. package/shared/types/source-manager/index.cjs +1 -2
  289. package/shared/upload/index.cjs +1 -774
  290. package/shared/upload/index.mjs +180 -764
  291. package/component.d.ts +0 -3
  292. package/components/_plugin-vue_export-helper.mjs +0 -9
  293. package/components/card-input-collection/index.css +0 -21
  294. package/components/cascader/index.css +0 -9
  295. package/components/checkbox/index.css +0 -30
  296. package/components/cloneDeep.mjs +0 -2104
  297. package/components/date-picker-range/index.css +0 -18
  298. package/components/dialog-input-collection/index.css +0 -21
  299. package/components/download-plus/index.css +0 -68
  300. package/components/editable-text/index.css +0 -9
  301. package/components/esri-input-geojson/index.css +0 -32
  302. package/components/fieldset/index.css +0 -5
  303. package/components/form-item/index.css +0 -35
  304. package/components/index.mjs +0 -378
  305. package/components/index2.mjs +0 -14
  306. package/components/information-tag/index.css +0 -6
  307. package/components/information-templates-default/index.css +0 -16
  308. package/components/input-array/index.css +0 -14
  309. package/components/input-collection/index.css +0 -20
  310. package/components/input-link/index.css +0 -4
  311. package/components/input-number/index.css +0 -13
  312. package/components/isObject.mjs +0 -158
  313. package/components/monaco-editor/index.css +0 -4
  314. package/components/radio/index.css +0 -40
  315. package/components/select/index.css +0 -15
  316. package/components/switch/index.css +0 -10
  317. package/components/tables-select/index.css +0 -3
  318. package/components/templates-layout/index.css +0 -3
  319. package/components/upload/index.css +0 -34
  320. package/components/upload-plus/index.css +0 -84
  321. package/components/van-cascader/index.css +0 -6
  322. package/components/var-datetime-picker/index.css +0 -17
  323. package/defaults.d.ts +0 -5
@@ -1,21 +1,20 @@
1
- import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, normalizeClass, createBlock, createElementVNode, withModifiers, createVNode, withCtx, toDisplayString, createTextVNode, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, h } from 'vue';
2
- import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
3
- import { bindPropsFactory, onEmitsFactory, vOn } from '@vunk/core/shared/utils-vue';
4
- import { uploadProps, ElProgress, ElIcon, ElButton, useNamespace, ElUpload, ElLink, ElMessageBox, genFileId } from 'element-plus';
5
- import { pickObject } from '@vunk/core/shared/utils-object';
6
- import { createUploadBindProps } from '@vunk/form/shared/element-plus';
7
- import { h as check_default, z as zoom_in_default, d as delete_default, i as close_default, j as circle_check_default, k as document_default, a as download_default } from '../index.mjs';
8
- import { RestFetch } from '@vunk/core/shared/utils-fetch';
9
- import { NOOP } from '@vunk/core/shared/utils-function';
10
- import { isCallable } from '@vunk/shared/function';
11
- import { useLocale } from '@vunk/form/composables/element-plus';
12
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
13
- import { useComputedReadonly } from '@vunk/form/composables';
14
- import progress from '@vunk/form/shared/progress-it';
15
-
16
- const props = {
17
- ..._VkfFormItemCtx.props,
18
- ...uploadProps,
1
+ import { defineComponent as T, computed as F, resolveComponent as m, openBlock as p, createElementBlock as g, Fragment as S, normalizeClass as n, createBlock as C, createCommentVNode as b, createElementVNode as I, withModifiers as R, createVNode as s, withCtx as u, toDisplayString as P, createTextVNode as D, normalizeStyle as M, shallowRef as Z, normalizeProps as G, guardReactiveProps as q, mergeProps as A, createSlots as H, renderSlot as J, h as K } from "vue";
2
+ import { _VkfFormItemCtx as O, VkfFormItem as Q } from "@vunk/form/components/form-item";
3
+ import { bindPropsFactory as W, onEmitsFactory as X, vOn as Y } from "@vunk/core/shared/utils-vue";
4
+ import { uploadProps as _, ElProgress as x, ElIcon as ee, ElButton as oe, useNamespace as V, ElUpload as le, ElLink as ne, ElMessageBox as se, genFileId as te } from "element-plus";
5
+ import { pickObject as ae } from "@vunk/core/shared/utils-object";
6
+ import { createUploadBindProps as ie } from "@vunk/form/shared/element-plus";
7
+ import { g as de, z as re, d as ue, h as pe, i as me, j as ce, b as fe } from "../index.cjs";
8
+ import { RestFetch as ve } from "@vunk/core/shared/utils-fetch";
9
+ import { NOOP as ye } from "@vunk/core/shared/utils-function";
10
+ import { isCallable as be } from "@vunk/shared/function";
11
+ import { useLocale as j } from "@vunk/form/composables/element-plus";
12
+ import { _ as z } from "../_plugin-vue_export-helper.cjs";
13
+ import { useComputedReadonly as we } from "@vunk/form/composables";
14
+ import ke from "@vunk/form/shared/progress-it";
15
+ const L = {
16
+ ...O.props,
17
+ ..._,
19
18
  tip: {
20
19
  type: String,
21
20
  default: ""
@@ -42,50 +41,42 @@ const props = {
42
41
  */
43
42
  exceedable: {
44
43
  type: Boolean,
45
- default: false
44
+ default: !1
46
45
  },
47
46
  /**
48
47
  * @description 是否开启超出覆盖文件的确认框
49
48
  */
50
49
  confirmExceed: {
51
50
  type: Boolean,
52
- default: false
51
+ default: !1
53
52
  },
54
53
  /**
55
54
  * @description 同 el-upload 的 slots
56
55
  */
57
56
  slots: null
58
- };
59
- const createBindProps = bindPropsFactory(props);
60
- const emits = {
57
+ }, ge = W(L), B = {
61
58
  "update:fileList": null,
62
- "remove": (e) => e
63
- };
64
- const createOnEmits = onEmitsFactory(emits);
65
-
66
- var ctx = /*#__PURE__*/Object.freeze({
59
+ remove: (e) => e
60
+ }, N = X(B), Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67
61
  __proto__: null,
68
- createBindProps: createBindProps,
69
- createOnEmits: createOnEmits,
70
- emits: emits,
71
- props: props
72
- });
73
-
74
- const restFetch = new RestFetch({
62
+ createBindProps: ge,
63
+ createOnEmits: N,
64
+ emits: B,
65
+ props: L
66
+ }, Symbol.toStringTag, { value: "Module" })), Ee = new ve({
75
67
  baseURL: ""
76
- });
77
- var _sfc_main$2 = defineComponent({
68
+ }), Ue = T({
78
69
  components: {
79
- ElProgress,
80
- ElIcon,
81
- Check: check_default,
82
- ZoomIn: zoom_in_default,
83
- Delete: delete_default,
84
- Close: close_default,
85
- CircleCheck: circle_check_default,
86
- Document: document_default,
87
- Download: download_default,
88
- ElButton
70
+ ElProgress: x,
71
+ ElIcon: ee,
72
+ Check: de,
73
+ ZoomIn: re,
74
+ Delete: ue,
75
+ Close: pe,
76
+ CircleCheck: me,
77
+ Document: ce,
78
+ Download: fe,
79
+ ElButton: oe
89
80
  },
90
81
  props: {
91
82
  listType: {
@@ -98,11 +89,11 @@ var _sfc_main$2 = defineComponent({
98
89
  },
99
90
  disabled: {
100
91
  type: Boolean,
101
- default: false
92
+ default: !1
102
93
  },
103
94
  onPreview: {
104
95
  type: Function,
105
- default: () => NOOP
96
+ default: () => ye
106
97
  },
107
98
  onDownload: {
108
99
  type: Function,
@@ -110,7 +101,7 @@ var _sfc_main$2 = defineComponent({
110
101
  },
111
102
  preview: {
112
103
  type: [Boolean, Function],
113
- default: false
104
+ default: !1
114
105
  },
115
106
  previewLabel: {
116
107
  type: String,
@@ -120,537 +111,352 @@ var _sfc_main$2 = defineComponent({
120
111
  emits: {
121
112
  remove: (e) => e
122
113
  },
123
- setup(props, { emit }) {
124
- const nsUpload = useNamespace("upload");
125
- const nsIcon = useNamespace("icon");
126
- const { tr } = useLocale();
127
- const handleRemove = (file = props.file) => {
128
- emit("remove", file);
129
- };
130
- const handleDownload = (file = props.file) => {
131
- if (props.onDownload) {
132
- props.onDownload(file);
114
+ setup(e, { emit: o }) {
115
+ const E = V("upload"), c = V("icon"), { tr: U } = j(), v = (a = e.file) => {
116
+ o("remove", a);
117
+ }, w = (a = e.file) => {
118
+ if (e.onDownload) {
119
+ e.onDownload(a);
133
120
  return;
134
121
  }
135
- let url = "";
136
- if (file.url) {
137
- url = file.url;
138
- } else if (file.raw) {
139
- url = window.URL.createObjectURL(file.raw);
140
- }
141
- url && restFetch.download({
142
- url,
143
- fileName: file.name
122
+ let l = "";
123
+ a.url ? l = a.url : a.raw && (l = window.URL.createObjectURL(a.raw)), l && Ee.download({
124
+ url: l,
125
+ fileName: a.name
144
126
  }, {
145
127
  method: "GET"
146
128
  });
147
- };
148
- const previewable = computed(() => {
149
- if (isCallable(props.preview)) {
150
- return props.preview(props.file);
151
- }
152
- return props.preview;
153
- });
154
- const previewText = computed(() => props.previewLabel || tr("el.upload.preview", "\u9884\u89C8"));
155
- const handlePreview = (file = props.file) => {
156
- previewable.value && props.onPreview(file);
157
- };
129
+ }, r = F(() => be(e.preview) ? e.preview(e.file) : e.preview), k = F(() => e.previewLabel || U("el.upload.preview", "预览"));
158
130
  return {
159
- handleRemove,
160
- nsIcon,
161
- nsUpload,
162
- handleDownload,
163
- handlePreview,
164
- previewText,
165
- previewable,
166
- tr
131
+ handleRemove: v,
132
+ nsIcon: c,
133
+ nsUpload: E,
134
+ handleDownload: w,
135
+ handlePreview: (a = e.file) => {
136
+ r.value && e.onPreview(a);
137
+ },
138
+ previewText: k,
139
+ previewable: r,
140
+ tr: U
167
141
  };
168
142
  }
169
- });
170
-
171
- const _hoisted_1$1 = ["src"];
172
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
173
- const _component_Document = resolveComponent("Document");
174
- const _component_ElIcon = resolveComponent("ElIcon");
175
- const _component_Download = resolveComponent("Download");
176
- const _component_ElButton = resolveComponent("ElButton");
177
- const _component_ElProgress = resolveComponent("ElProgress");
178
- const _component_CircleCheck = resolveComponent("CircleCheck");
179
- const _component_Check = resolveComponent("Check");
180
- const _component_Close = resolveComponent("Close");
181
- const _component_ZoomIn = resolveComponent("ZoomIn");
182
- const _component_Delete = resolveComponent("Delete");
183
- return openBlock(), createElementBlock(
184
- Fragment,
185
- null,
186
- [
187
- createCommentVNode(" picture "),
188
- _ctx.listType === "picture" || _ctx.file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
189
- Fragment,
190
- { key: 0 },
191
- [
192
- /\.(svg|png|jpg|jpeg)$/.test(_ctx.file.name) ? (openBlock(), createElementBlock("img", {
193
- key: 0,
194
- class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
195
- src: _ctx.file.url,
196
- alt: ""
197
- }, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, {
198
- key: 1,
199
- class: normalizeClass([
200
- _ctx.nsUpload.be("list", "item-thumbnail"),
201
- _ctx.nsIcon.m("document")
202
- ])
203
- }, null, 8, ["class"]))
204
- ],
205
- 64
206
- /* STABLE_FRAGMENT */
207
- )) : createCommentVNode("v-if", true),
208
- createCommentVNode(" text "),
209
- _ctx.listType !== "picture-card" || _ctx.file.status === "uploading" ? (openBlock(), createElementBlock(
210
- "div",
211
- {
212
- key: 1,
213
- class: normalizeClass(_ctx.nsUpload.be("list", "item-info"))
214
- },
215
- [
216
- createElementVNode(
217
- "a",
218
- {
219
- class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
220
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.handlePreview(_ctx.file), ["prevent"]))
221
- },
222
- [
223
- createVNode(_component_ElIcon, {
224
- class: normalizeClass(_ctx.nsIcon.m("document"))
225
- }, {
226
- default: withCtx(() => [
227
- createVNode(_component_Document)
228
- ]),
229
- _: 1
230
- /* STABLE */
231
- }, 8, ["class"]),
232
- createVNode(_component_ElIcon, {
233
- class: normalizeClass([
234
- _ctx.nsIcon.m("download"),
235
- _ctx.nsIcon.m("download-primary")
236
- ]),
237
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.handleDownload(_ctx.file), ["stop"]))
238
- }, {
239
- default: withCtx(() => [
240
- createVNode(_component_Download)
241
- ]),
242
- _: 1
243
- /* STABLE */
244
- }, 8, ["class"]),
245
- createElementVNode(
246
- "span",
247
- {
248
- class: normalizeClass(_ctx.nsUpload.be("list", "item-file-name"))
249
- },
250
- toDisplayString(_ctx.file.name),
251
- 3
252
- /* TEXT, CLASS */
253
- )
254
- ],
255
- 2
256
- /* CLASS */
257
- ),
258
- _ctx.listType === "picture" ? (openBlock(), createElementBlock(
259
- "div",
260
- {
261
- key: 0,
262
- class: normalizeClass(_ctx.nsUpload.be("list", "item-file-actions"))
263
- },
264
- [
265
- createVNode(_component_ElButton, {
266
- disabled: !_ctx.previewable,
267
- class: normalizeClass(_ctx.nsUpload.be("list", "item-file-action-preview")),
268
- plain: "",
269
- size: "small",
270
- round: "",
271
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handlePreview(_ctx.file))
272
- }, {
273
- default: withCtx(() => [
274
- createTextVNode(
275
- toDisplayString(_ctx.previewText),
276
- 1
277
- /* TEXT */
278
- )
279
- ]),
280
- _: 1
281
- /* STABLE */
282
- }, 8, ["disabled", "class"]),
283
- createCommentVNode(" \u4E0B\u8F7D "),
284
- createVNode(_component_ElButton, {
285
- plain: "",
286
- size: "small",
287
- round: "",
288
- type: "primary",
289
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
290
- }, {
291
- default: withCtx(() => [
292
- createTextVNode(
293
- toDisplayString(_ctx.tr("vkf.common.download", "\u4E0B\u8F7D")),
294
- 1
295
- /* TEXT */
296
- )
297
- ]),
298
- _: 1
299
- /* STABLE */
300
- })
301
- ],
302
- 2
303
- /* CLASS */
304
- )) : createCommentVNode("v-if", true),
305
- _ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_ElProgress, {
306
- key: 1,
307
- type: _ctx.listType === "picture-card" ? "circle" : "line",
308
- "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
309
- percentage: Number(_ctx.file.percentage),
310
- style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
311
- }, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
312
- ],
313
- 2
314
- /* CLASS */
315
- )) : createCommentVNode("v-if", true),
316
- createCommentVNode(" label "),
317
- createElementVNode(
318
- "label",
319
- {
320
- class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
321
- },
322
- [
323
- _ctx.listType === "text" ? (openBlock(), createBlock(_component_ElIcon, {
324
- key: 0,
325
- class: normalizeClass([
326
- _ctx.nsIcon.m("upload-success"),
327
- _ctx.nsIcon.m("circle-check")
328
- ])
329
- }, {
330
- default: withCtx(() => [
331
- createVNode(_component_CircleCheck)
332
- ]),
333
- _: 1
334
- /* STABLE */
335
- }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_ElIcon, {
336
- key: 1,
337
- class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
338
- }, {
339
- default: withCtx(() => [
340
- createVNode(_component_Check)
341
- ]),
342
- _: 1
343
- /* STABLE */
344
- }, 8, ["class"])) : createCommentVNode("v-if", true)
345
- ],
346
- 2
347
- /* CLASS */
348
- ),
349
- !_ctx.disabled ? (openBlock(), createBlock(_component_ElIcon, {
350
- key: 2,
351
- class: normalizeClass(_ctx.nsIcon.m("close")),
352
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleRemove(_ctx.file))
143
+ }), he = ["src"];
144
+ function Ce(e, o, E, c, U, v) {
145
+ const w = m("Document"), r = m("ElIcon"), k = m("Download"), h = m("ElButton"), a = m("ElProgress"), l = m("CircleCheck"), i = m("Check"), d = m("Close"), f = m("ZoomIn"), y = m("Delete");
146
+ return p(), g(S, null, [
147
+ e.listType === "picture" || e.file.status !== "uploading" && e.listType === "picture-card" ? (p(), g(S, { key: 0 }, [
148
+ /\.(svg|png|jpg|jpeg)$/.test(e.file.name) ? (p(), g("img", {
149
+ key: 0,
150
+ class: n(e.nsUpload.be("list", "item-thumbnail")),
151
+ src: e.file.url,
152
+ alt: ""
153
+ }, null, 10, he)) : (p(), C(w, {
154
+ key: 1,
155
+ class: n([
156
+ e.nsUpload.be("list", "item-thumbnail"),
157
+ e.nsIcon.m("document")
158
+ ])
159
+ }, null, 8, ["class"]))
160
+ ], 64)) : b("", !0),
161
+ e.listType !== "picture-card" || e.file.status === "uploading" ? (p(), g("div", {
162
+ key: 1,
163
+ class: n(e.nsUpload.be("list", "item-info"))
164
+ }, [
165
+ I("a", {
166
+ class: n(e.nsUpload.be("list", "item-name")),
167
+ onClick: o[1] || (o[1] = R((t) => e.handlePreview(e.file), ["prevent"]))
168
+ }, [
169
+ s(r, {
170
+ class: n(e.nsIcon.m("document"))
171
+ }, {
172
+ default: u(() => [
173
+ s(w)
174
+ ]),
175
+ _: 1
176
+ }, 8, ["class"]),
177
+ s(r, {
178
+ class: n([
179
+ e.nsIcon.m("download"),
180
+ e.nsIcon.m("download-primary")
181
+ ]),
182
+ onClick: o[0] || (o[0] = R((t) => e.handleDownload(e.file), ["stop"]))
183
+ }, {
184
+ default: u(() => [
185
+ s(k)
186
+ ]),
187
+ _: 1
188
+ }, 8, ["class"]),
189
+ I("span", {
190
+ class: n(e.nsUpload.be("list", "item-file-name"))
191
+ }, P(e.file.name), 3)
192
+ ], 2),
193
+ e.listType === "picture" ? (p(), g("div", {
194
+ key: 0,
195
+ class: n(e.nsUpload.be("list", "item-file-actions"))
196
+ }, [
197
+ s(h, {
198
+ disabled: !e.previewable,
199
+ class: n(e.nsUpload.be("list", "item-file-action-preview")),
200
+ plain: "",
201
+ size: "small",
202
+ round: "",
203
+ onClick: o[2] || (o[2] = (t) => e.handlePreview(e.file))
204
+ }, {
205
+ default: u(() => [
206
+ D(P(e.previewText), 1)
207
+ ]),
208
+ _: 1
209
+ }, 8, ["disabled", "class"]),
210
+ s(h, {
211
+ plain: "",
212
+ size: "small",
213
+ round: "",
214
+ type: "primary",
215
+ onClick: o[3] || (o[3] = (t) => e.handleDownload(e.file))
216
+ }, {
217
+ default: u(() => [
218
+ D(P(e.tr("vkf.common.download", "下载")), 1)
219
+ ]),
220
+ _: 1
221
+ })
222
+ ], 2)) : b("", !0),
223
+ e.file.status === "uploading" ? (p(), C(a, {
224
+ key: 1,
225
+ type: e.listType === "picture-card" ? "circle" : "line",
226
+ "stroke-width": e.listType === "picture-card" ? 6 : 2,
227
+ percentage: Number(e.file.percentage),
228
+ style: M(e.listType === "picture-card" ? "" : "margin-top: 0.5rem")
229
+ }, null, 8, ["type", "stroke-width", "percentage", "style"])) : b("", !0)
230
+ ], 2)) : b("", !0),
231
+ I("label", {
232
+ class: n(e.nsUpload.be("list", "item-status-label"))
233
+ }, [
234
+ e.listType === "text" ? (p(), C(r, {
235
+ key: 0,
236
+ class: n([
237
+ e.nsIcon.m("upload-success"),
238
+ e.nsIcon.m("circle-check")
239
+ ])
353
240
  }, {
354
- default: withCtx(() => [
355
- createVNode(_component_Close)
241
+ default: u(() => [
242
+ s(l)
356
243
  ]),
357
244
  _: 1
358
- /* STABLE */
359
- }, 8, ["class"])) : createCommentVNode("v-if", true),
360
- createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn "),
361
- createCommentVNode(" This is a bug which needs to be fixed "),
362
- createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
363
- createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{
364
- t('el.upload.deleteTip')
365
- }}</i> `),
366
- createCommentVNode(" picture-card "),
367
- _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
368
- "span",
369
- {
370
- key: 3,
371
- class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
372
- },
373
- [
374
- createCommentVNode(" \u9884\u89C8 "),
375
- _ctx.previewable ? (openBlock(), createElementBlock(
376
- "span",
377
- {
378
- key: 0,
379
- class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
380
- onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handlePreview(_ctx.file))
381
- },
382
- [
383
- createVNode(_component_ElIcon, {
384
- class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
385
- }, {
386
- default: withCtx(() => [
387
- createVNode(_component_ZoomIn)
388
- ]),
389
- _: 1
390
- /* STABLE */
391
- }, 8, ["class"])
392
- ],
393
- 2
394
- /* CLASS */
395
- )) : createCommentVNode("v-if", true),
396
- createCommentVNode(" \u4E0B\u8F7D "),
397
- createElementVNode(
398
- "span",
399
- {
400
- class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
401
- onClick: _cache[6] || (_cache[6] = ($event) => _ctx.handleDownload(_ctx.file))
402
- },
403
- [
404
- createVNode(_component_ElIcon, {
405
- class: normalizeClass(_ctx.nsIcon.m("download"))
406
- }, {
407
- default: withCtx(() => [
408
- createVNode(_component_Download)
409
- ]),
410
- _: 1
411
- /* STABLE */
412
- }, 8, ["class"])
413
- ],
414
- 2
415
- /* CLASS */
416
- ),
417
- !_ctx.disabled ? (openBlock(), createElementBlock(
418
- "span",
419
- {
420
- key: 1,
421
- class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
422
- onClick: _cache[7] || (_cache[7] = ($event) => _ctx.handleRemove(_ctx.file))
423
- },
424
- [
425
- createVNode(_component_ElIcon, {
426
- class: normalizeClass(_ctx.nsIcon.m("delete"))
427
- }, {
428
- default: withCtx(() => [
429
- createVNode(_component_Delete)
430
- ]),
431
- _: 1
432
- /* STABLE */
433
- }, 8, ["class"])
434
- ],
435
- 2
436
- /* CLASS */
437
- )) : createCommentVNode("v-if", true)
438
- ],
439
- 2
440
- /* CLASS */
441
- )) : createCommentVNode("v-if", true)
442
- ],
443
- 64
444
- /* STABLE_FRAGMENT */
445
- );
245
+ }, 8, ["class"])) : ["picture-card", "picture"].includes(e.listType) ? (p(), C(r, {
246
+ key: 1,
247
+ class: n([e.nsIcon.m("upload-success"), e.nsIcon.m("check")])
248
+ }, {
249
+ default: u(() => [
250
+ s(i)
251
+ ]),
252
+ _: 1
253
+ }, 8, ["class"])) : b("", !0)
254
+ ], 2),
255
+ e.disabled ? b("", !0) : (p(), C(r, {
256
+ key: 2,
257
+ class: n(e.nsIcon.m("close")),
258
+ onClick: o[4] || (o[4] = (t) => e.handleRemove(e.file))
259
+ }, {
260
+ default: u(() => [
261
+ s(d)
262
+ ]),
263
+ _: 1
264
+ }, 8, ["class"])),
265
+ e.listType === "picture-card" ? (p(), g("span", {
266
+ key: 3,
267
+ class: n(e.nsUpload.be("list", "item-actions"))
268
+ }, [
269
+ e.previewable ? (p(), g("span", {
270
+ key: 0,
271
+ class: n(e.nsUpload.be("list", "item-preview")),
272
+ onClick: o[5] || (o[5] = (t) => e.handlePreview(e.file))
273
+ }, [
274
+ s(r, {
275
+ class: n(e.nsIcon.m("zoom-in"))
276
+ }, {
277
+ default: u(() => [
278
+ s(f)
279
+ ]),
280
+ _: 1
281
+ }, 8, ["class"])
282
+ ], 2)) : b("", !0),
283
+ I("span", {
284
+ class: n(e.nsUpload.be("list", "item-download")),
285
+ onClick: o[6] || (o[6] = (t) => e.handleDownload(e.file))
286
+ }, [
287
+ s(r, {
288
+ class: n(e.nsIcon.m("download"))
289
+ }, {
290
+ default: u(() => [
291
+ s(k)
292
+ ]),
293
+ _: 1
294
+ }, 8, ["class"])
295
+ ], 2),
296
+ e.disabled ? b("", !0) : (p(), g("span", {
297
+ key: 1,
298
+ class: n(e.nsUpload.be("list", "item-delete")),
299
+ onClick: o[7] || (o[7] = (t) => e.handleRemove(e.file))
300
+ }, [
301
+ s(r, {
302
+ class: n(e.nsIcon.m("delete"))
303
+ }, {
304
+ default: u(() => [
305
+ s(y)
306
+ ]),
307
+ _: 1
308
+ }, 8, ["class"])
309
+ ], 2))
310
+ ], 2)) : b("", !0)
311
+ ], 64);
446
312
  }
447
- var FileVue = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/upload/src/file.vue"]]);
448
-
449
- var _sfc_main$1 = defineComponent({
313
+ const Ie = /* @__PURE__ */ z(Ue, [["render", Ce]]), Pe = T({
450
314
  components: {
451
- VkfFormItem,
452
- ElUpload,
453
- FileVue,
454
- ElLink
315
+ VkfFormItem: Q,
316
+ ElUpload: le,
317
+ FileVue: Ie,
318
+ ElLink: ne
455
319
  },
456
- props,
457
- emits,
458
- setup(props2, { emit }) {
459
- const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
460
- const { tr } = useLocale();
461
- const coreBindProps = createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
462
- const uploadRef = shallowRef();
463
- const handleRemove = (file) => {
464
- uploadRef.value?.handleRemove(file);
465
- uploadRef.value?.abort(file);
466
- emit("update:fileList", props2.fileList);
467
- };
468
- const handleExceed = (files, uploadFiles) => {
469
- if (props2.onExceed) {
470
- props2.onExceed(files, uploadFiles);
320
+ props: L,
321
+ emits: B,
322
+ setup(e, { emit: o }) {
323
+ const E = O.createBindProps(e), { tr: c } = j(), U = ie(e, ["disabled", "fileList", "beforeUpload", "onSuccess"]), v = Z(), w = (l) => {
324
+ var i, d;
325
+ (i = v.value) == null || i.handleRemove(l), (d = v.value) == null || d.abort(l), o("update:fileList", e.fileList);
326
+ }, r = (l, i) => {
327
+ if (e.onExceed) {
328
+ e.onExceed(l, i);
471
329
  return;
472
330
  }
473
- if (props2.exceedable) {
474
- const doUpload = () => {
475
- uploadRef.value?.clearFiles();
476
- files.forEach((file) => {
477
- file.uid = genFileId();
478
- uploadRef.value?.handleStart(file);
479
- });
480
- uploadRef.value?.submit();
331
+ if (e.exceedable) {
332
+ const d = () => {
333
+ var f, y;
334
+ (f = v.value) == null || f.clearFiles(), l.forEach((t) => {
335
+ var $;
336
+ t.uid = te(), ($ = v.value) == null || $.handleStart(t);
337
+ }), (y = v.value) == null || y.submit();
481
338
  };
482
- if (props2.confirmExceed) {
483
- ElMessageBox.confirm(
484
- tr("vkf.upload.exceedConfirm", "\u5DF2\u8D85\u8FC7\u6700\u5927\u4E0A\u4F20\u6570\u91CF\u9650\u5236\uFF0C\u662F\u5426\u4F7F\u7528\u65B0\u6587\u4EF6\u91CD\u65B0\u4E0A\u4F20\uFF1F"),
485
- tr("el.messagebox.title", "\u63D0\u793A"),
486
- {
487
- confirmButtonText: tr("el.upload.continue", "\u7EE7\u7EED"),
488
- cancelButtonText: tr("el.messagebox.cancel", "\u53D6\u6D88"),
489
- type: "warning"
490
- }
491
- ).then(doUpload);
492
- } else {
493
- doUpload();
494
- }
495
- }
496
- };
497
- const readonly = useComputedReadonly(props2);
498
- const onSuccess = (response, uploadFile, uploadFiles) => {
499
- const raw = uploadFile.raw;
500
- raw.progress(true);
501
- uploadFile.percentage = 100;
502
- uploadFile.status = "success";
503
- props2.onSuccess?.(response, uploadFile, uploadFiles);
504
- };
505
- const beforeUpload = async (rawFile) => {
506
- const effect = (e, s) => {
507
- const file = props2.fileList.find((item) => item.uid === rawFile.uid);
508
- if (file) {
509
- file.percentage = Number((e * 100).toFixed(2));
510
- if (s === false) {
511
- file.status = "uploading";
339
+ e.confirmExceed ? se.confirm(
340
+ c("vkf.upload.exceedConfirm", "已超过最大上传数量限制,是否使用新文件重新上传?"),
341
+ c("el.messagebox.title", "提示"),
342
+ {
343
+ confirmButtonText: c("el.upload.continue", "继续"),
344
+ cancelButtonText: c("el.messagebox.cancel", "取消"),
345
+ type: "warning"
512
346
  }
513
- }
514
- };
515
- rawFile.progress = progress(effect)(false);
516
- if (props2.beforeUpload) {
517
- const res = await props2.beforeUpload?.(rawFile);
518
- return res;
347
+ ).then(d) : d();
519
348
  }
520
- return true;
521
- };
349
+ }, k = we(e);
522
350
  return {
523
- formItemBindProps,
524
- pickObject,
525
- coreBindProps,
526
- uploadRef,
527
- handleRemove,
528
- readonly,
529
- onSuccess,
351
+ formItemBindProps: E,
352
+ pickObject: ae,
353
+ coreBindProps: U,
354
+ uploadRef: v,
355
+ handleRemove: w,
356
+ readonly: k,
357
+ onSuccess: (l, i, d) => {
358
+ var y, t;
359
+ const f = i.raw;
360
+ (y = f.progress) == null || y.call(f, !0), i.percentage = 100, i.status = "success", (t = e.onSuccess) == null || t.call(e, l, i, d);
361
+ },
530
362
  // onProgress,
531
- beforeUpload,
532
- handleExceed,
533
- tr
363
+ beforeUpload: async (l) => {
364
+ var d;
365
+ const i = (f, y) => {
366
+ const t = e.fileList.find(($) => $.uid === l.uid);
367
+ t && (t.percentage = Number((f * 100).toFixed(2)), y === !1 && (t.status = "uploading"));
368
+ };
369
+ return l.progress = ke(i)(!1), e.beforeUpload ? await ((d = e.beforeUpload) == null ? void 0 : d.call(e, l)) : !0;
370
+ },
371
+ handleExceed: r,
372
+ tr: c
534
373
  };
535
374
  }
536
- });
537
-
538
- const _hoisted_1 = { class: "el-upload__tip" };
539
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
540
- const _component_ElLink = resolveComponent("ElLink");
541
- const _component_FileVue = resolveComponent("FileVue");
542
- const _component_ElUpload = resolveComponent("ElUpload");
543
- const _component_VkfFormItem = resolveComponent("VkfFormItem");
544
- return openBlock(), createBlock(
545
- _component_VkfFormItem,
546
- normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
547
- {
548
- default: withCtx(() => [
549
- createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
375
+ }), $e = { class: "el-upload__tip" };
376
+ function Le(e, o, E, c, U, v) {
377
+ const w = m("ElLink"), r = m("FileVue"), k = m("ElUpload"), h = m("VkfFormItem");
378
+ return p(), C(h, G(q(e.formItemBindProps)), {
379
+ default: u(() => {
380
+ var a, l, i;
381
+ return [
382
+ s(k, A(e.coreBindProps, {
550
383
  ref: "uploadRef",
551
384
  class: ["vkf-upload", {
552
- "is-readonly": _ctx.readonly,
553
- "is-empty": _ctx.fileList?.length === 0,
554
- "is-limit": _ctx.limit && _ctx.fileList?.length >= _ctx.limit,
555
- "is-exceedable": _ctx.exceedable
385
+ "is-readonly": e.readonly,
386
+ "is-empty": ((a = e.fileList) == null ? void 0 : a.length) === 0,
387
+ "is-limit": e.limit && ((l = e.fileList) == null ? void 0 : l.length) >= e.limit,
388
+ "is-exceedable": e.exceedable
556
389
  }],
557
- "file-list": _ctx.fileList ?? [],
558
- "on-success": _ctx.onSuccess,
559
- "before-upload": _ctx.beforeUpload,
560
- disabled: _ctx.readonly || _ctx.disabled,
561
- "on-exceed": _ctx.handleExceed,
562
- "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fileList", $event))
563
- }), createSlots({
564
- file: withCtx(({ file }) => [
565
- createVNode(_component_FileVue, {
566
- file,
567
- "list-type": _ctx.listType,
568
- disabled: _ctx.readonly || _ctx.disabled,
569
- "on-preview": _ctx.onPreview,
570
- preview: _ctx.preview,
571
- "on-download": _ctx.onDownload,
572
- "preview-label": _ctx.previewLabel,
573
- onRemove: _ctx.handleRemove
390
+ "file-list": e.fileList ?? [],
391
+ "on-success": e.onSuccess,
392
+ "before-upload": e.beforeUpload,
393
+ disabled: e.readonly || e.disabled,
394
+ "on-exceed": e.handleExceed,
395
+ "onUpdate:fileList": o[0] || (o[0] = (d) => e.$emit("update:fileList", d))
396
+ }), H({
397
+ file: u(({ file: d }) => [
398
+ s(r, {
399
+ file: d,
400
+ "list-type": e.listType,
401
+ disabled: e.readonly || e.disabled,
402
+ "on-preview": e.onPreview,
403
+ preview: e.preview,
404
+ "on-download": e.onDownload,
405
+ "preview-label": e.previewLabel,
406
+ onRemove: e.handleRemove
574
407
  }, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "preview-label", "onRemove"])
575
408
  ]),
576
- default: withCtx(() => [
577
- renderSlot(_ctx.$slots, "default", {}, () => [
578
- createVNode(_component_ElLink, { type: "primary" }, {
579
- default: withCtx(() => [
580
- createTextVNode(
581
- " + " + toDisplayString(_ctx.tr("vkf.upload.selectFile", "\u9009\u62E9\u6587\u4EF6")),
582
- 1
583
- /* TEXT */
584
- )
409
+ default: u(() => [
410
+ J(e.$slots, "default", {}, () => [
411
+ s(w, { type: "primary" }, {
412
+ default: u(() => [
413
+ D(" + " + P(e.tr("vkf.upload.selectFile", "选择文件")), 1)
585
414
  ]),
586
415
  _: 1
587
- /* STABLE */
588
416
  })
589
417
  ])
590
418
  ]),
591
419
  _: 2
592
- /* DYNAMIC */
593
420
  }, [
594
- _ctx.tip ? {
421
+ e.tip ? {
595
422
  name: "tip",
596
- fn: withCtx(() => [
597
- createElementVNode(
598
- "div",
599
- _hoisted_1,
600
- toDisplayString(_ctx.tip),
601
- 1
602
- /* TEXT */
603
- )
423
+ fn: u(() => [
424
+ I("div", $e, P(e.tip), 1)
604
425
  ]),
605
426
  key: "0"
606
427
  } : void 0
607
428
  ]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled", "on-exceed"]),
608
- createElementVNode(
609
- "span",
610
- {
611
- class: normalizeClass(["vkf-upload-empty-tip", {
612
- "is-readonly": _ctx.readonly,
613
- "is-empty": _ctx.fileList?.length === 0
614
- }])
615
- },
616
- toDisplayString(_ctx.tr("vkf.upload.empty", "\u6682\u65E0")),
617
- 3
618
- /* TEXT, CLASS */
619
- )
620
- ]),
621
- _: 3
622
- /* FORWARDED */
623
- },
624
- 16
625
- /* FULL_PROPS */
626
- );
429
+ I("span", {
430
+ class: n(["vkf-upload-empty-tip", {
431
+ "is-readonly": e.readonly,
432
+ "is-empty": ((i = e.fileList) == null ? void 0 : i.length) === 0
433
+ }])
434
+ }, P(e.tr("vkf.upload.empty", "暂无")), 3)
435
+ ];
436
+ }),
437
+ _: 3
438
+ }, 16);
627
439
  }
628
- var Core = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/upload/src/index.vue"]]);
629
-
630
- var _sfc_main = defineComponent({
440
+ const Be = /* @__PURE__ */ z(Pe, [["render", Le]]), He = T({
631
441
  name: "VkfUpload",
632
- props,
633
- emits,
634
- setup(props2, { emit, slots }) {
635
- const coreEmits = createOnEmits(emit);
636
- return () => h(Core, {
637
- ...props2,
638
- ...vOn(coreEmits)
442
+ props: L,
443
+ emits: B,
444
+ setup(e, { emit: o, slots: E }) {
445
+ const c = N(o);
446
+ return () => K(Be, {
447
+ ...e,
448
+ ...Y(c)
639
449
  }, {
640
- ...props2.slots,
641
- ...slots
450
+ ...e.slots,
451
+ ...E
642
452
  });
643
453
  }
644
- });
645
-
646
- var VkfUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/upload/src/wraper.vue"]]);
647
-
648
- var types = /*#__PURE__*/Object.freeze({
454
+ }), Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
649
455
  __proto__: null
650
- });
651
-
652
- VkfUpload.install = (app) => {
653
- app.component(VkfUpload.name || "VkfUpload", VkfUpload);
456
+ }, Symbol.toStringTag, { value: "Module" }));
457
+ export {
458
+ He as VkfUpload,
459
+ Ae as _VkfUploadCtx,
460
+ Je as __VkfUpload,
461
+ He as default
654
462
  };
655
-
656
- export { VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, VkfUpload as default };