@vunk/form 1.1.77 → 1.1.79

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 (284) hide show
  1. package/components/_plugin-vue_export-helper.mjs +9 -0
  2. package/components/button/{index.js → index.mjs} +33 -29
  3. package/components/button/src/ctx.d.ts +30 -30
  4. package/components/button/src/index.vue.d.ts +69 -69
  5. package/components/cascader/index.css +0 -2
  6. package/components/cascader/{index.js → index.mjs} +22 -22
  7. package/components/cascader/src/ctx.d.ts +37 -45
  8. package/components/cascader/src/index.vue.d.ts +92 -92
  9. package/components/cascader/src/use.d.ts +1 -1
  10. package/components/checkbox/index.css +0 -9
  11. package/components/checkbox/{index.js → index.mjs} +45 -42
  12. package/components/checkbox/src/ctx.d.ts +29 -32
  13. package/components/checkbox/src/index.vue.d.ts +65 -65
  14. package/components/color-picker/{index.js → index.mjs} +23 -22
  15. package/components/color-picker/src/ctx.d.ts +29 -29
  16. package/components/color-picker/src/index.vue.d.ts +67 -67
  17. package/components/date-picker/{index.js → index.mjs} +28 -25
  18. package/components/date-picker/src/ctx.d.ts +49 -49
  19. package/components/date-picker/src/index.vue.d.ts +104 -104
  20. package/components/download-plus/index.css +0 -6
  21. package/components/download-plus/{index.js → index.mjs} +119 -147
  22. package/components/download-plus/src/api.d.ts +1 -1
  23. package/components/download-plus/src/ctx.d.ts +27 -26
  24. package/components/download-plus/src/index.vue.d.ts +59 -59
  25. package/components/esri-input-geojson/index.css +0 -10
  26. package/components/esri-input-geojson/index.mjs +1109 -0
  27. package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
  28. package/components/esri-input-geojson/src/ctx.d.ts +49 -72
  29. package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
  30. package/components/esri-input-geojson/src/types.d.ts +0 -1
  31. package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
  32. package/components/form/{index.js → index.mjs} +31 -27
  33. package/components/form/src/ctx.d.ts +13 -297
  34. package/components/form/src/index.vue.d.ts +97 -659
  35. package/components/form-item/index.css +0 -8
  36. package/components/form-item/{index.js → index.mjs} +22 -19
  37. package/components/form-item/src/ctx.d.ts +13 -11
  38. package/components/form-item/src/index.vue.d.ts +20 -20
  39. package/components/form-item-renderer/{index.js → index.mjs} +9 -7
  40. package/components/form-item-renderer/src/index.vue.d.ts +1 -1
  41. package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
  42. package/components/geoinput/{index.js → index.mjs} +10 -17
  43. package/components/geoinput/src/ctx.d.ts +48 -60
  44. package/components/geoinput/src/index.vue.d.ts +114 -132
  45. package/components/geoinput-read/index.css +0 -2
  46. package/components/geoinput-read/{index.js → index.mjs} +101 -109
  47. package/components/geoinput-read/src/core.vue.d.ts +123 -142
  48. package/components/geoinput-read/src/ctx.d.ts +50 -74
  49. package/components/geoinput-read/src/index.vue.d.ts +102 -120
  50. package/components/geoinput-update/index.css +0 -6
  51. package/components/geoinput-update/index.mjs +399 -0
  52. package/components/geoinput-update/src/ctx.d.ts +49 -69
  53. package/components/geoinput-update/src/index.vue.d.ts +126 -141
  54. package/components/index.mjs +11 -0
  55. package/components/index2.mjs +306 -0
  56. package/components/index3.mjs +484 -0
  57. package/components/input/{index.js → index.mjs} +31 -27
  58. package/components/input/src/ctx.d.ts +47 -66
  59. package/components/input/src/index.vue.d.ts +101 -113
  60. package/components/input-link/index.css +0 -2
  61. package/components/input-link/index.mjs +151 -0
  62. package/components/input-link/src/ctx.d.ts +40 -56
  63. package/components/input-link/src/index.vue.d.ts +89 -101
  64. package/components/input-number/index.css +0 -2
  65. package/components/input-number/{index.js → index.mjs} +25 -25
  66. package/components/input-number/src/ctx.d.ts +31 -37
  67. package/components/input-number/src/index.vue.d.ts +71 -71
  68. package/components/radio/index.css +0 -6
  69. package/components/radio/{index.js → index.mjs} +50 -47
  70. package/components/radio/src/ctx.d.ts +29 -29
  71. package/components/radio/src/index.vue.d.ts +64 -64
  72. package/components/select/index.css +0 -2
  73. package/components/select/{index.js → index.mjs} +49 -48
  74. package/components/select/src/ctx.d.ts +31 -85
  75. package/components/select/src/index.vue.d.ts +121 -230
  76. package/components/slider/{index.js → index.mjs} +28 -24
  77. package/components/slider/src/ctx.d.ts +35 -35
  78. package/components/slider/src/index.vue.d.ts +93 -93
  79. package/components/switch/index.css +0 -2
  80. package/components/switch/{index.js → index.mjs} +29 -24
  81. package/components/switch/src/ctx.d.ts +40 -40
  82. package/components/switch/src/index.vue.d.ts +91 -91
  83. package/components/templates-default/index.mjs +302 -0
  84. package/components/templates-default/src/ctx.d.ts +2 -4
  85. package/components/templates-default/src/index.vue.d.ts +2 -8
  86. package/components/templates-element-plus/index.mjs +106 -0
  87. package/components/templates-esri/index.mjs +59 -0
  88. package/components/templates-layout/index.css +0 -3
  89. package/components/templates-layout/index.mjs +131 -0
  90. package/components/templates-mapbox/index.mjs +59 -0
  91. package/components/upload/index.css +0 -7
  92. package/components/upload/index.mjs +501 -0
  93. package/components/upload/src/ctx.d.ts +36 -38
  94. package/components/upload/src/file.vue.d.ts +22 -21
  95. package/components/upload/src/index.vue.d.ts +78 -78
  96. package/components/upload-plus/index.css +4 -8
  97. package/components/upload-plus/{index.js → index.mjs} +9497 -926
  98. package/components/upload-plus/src/api.d.ts +1 -1
  99. package/components/upload-plus/src/ctx.d.ts +25 -28
  100. package/components/upload-plus/src/index.vue.d.ts +58 -58
  101. package/components/van-cascader/index.css +0 -2
  102. package/components/van-cascader/{index.js → index.mjs} +41 -44
  103. package/components/van-cascader/src/ctx.d.ts +35 -35
  104. package/components/van-cascader/src/index.vue.d.ts +82 -82
  105. package/components/var-datetime-picker/index.css +0 -2
  106. package/components/var-datetime-picker/index.mjs +324 -0
  107. package/components/var-datetime-picker/src/ctx.d.ts +27 -26
  108. package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
  109. package/components/vditor/{index.js → index.mjs} +9 -14
  110. package/components/vditor/src/ctx.d.ts +2 -1
  111. package/components/vditor/src/index.vue.d.ts +2 -3
  112. package/composables/index.mjs +85 -0
  113. package/composables/useSourceManager.d.ts +2 -2
  114. package/defaults.d.ts +1 -1
  115. package/index.css +4 -169
  116. package/index.d.ts +1 -1
  117. package/index.esm.js +44 -1
  118. package/package.json +246 -2
  119. package/shared/const/index.d.ts +1 -1
  120. package/shared/const/index.mjs +56 -0
  121. package/shared/element-plus/ctx.d.ts +26 -94
  122. package/shared/element-plus/index.mjs +285 -0
  123. package/shared/element-plus/instances.d.ts +29 -28
  124. package/shared/form/index.mjs +30 -0
  125. package/shared/helper/index.mjs +9 -0
  126. package/shared/index.mjs +1 -0
  127. package/shared/infer-prop/index.mjs +34 -0
  128. package/shared/progress-it/index.mjs +38 -0
  129. package/shared/rules/index.mjs +53 -0
  130. package/shared/upload/index.mjs +771 -0
  131. package/components/button/src/ctx.js +0 -1
  132. package/components/cascader/src/ctx.js +0 -1
  133. package/components/cascader/src/types.js +0 -1
  134. package/components/cascader/src/use.js +0 -1
  135. package/components/checkbox/src/ctx.js +0 -1
  136. package/components/checkbox/src/index.css +0 -1
  137. package/components/checkbox/src/types.js +0 -1
  138. package/components/color-picker/index.css +0 -1
  139. package/components/color-picker/src/ctx.js +0 -1
  140. package/components/color-picker/src/index.css +0 -1
  141. package/components/color-picker/src/types.js +0 -1
  142. package/components/date-picker/index.css +0 -1
  143. package/components/date-picker/src/ctx.js +0 -1
  144. package/components/date-picker/src/index.css +0 -1
  145. package/components/date-picker/src/types.js +0 -1
  146. package/components/download-plus/src/api.js +0 -1
  147. package/components/download-plus/src/const.js +0 -1
  148. package/components/download-plus/src/ctx.js +0 -1
  149. package/components/download-plus/src/index.css +0 -1
  150. package/components/download-plus/src/types.js +0 -1
  151. package/components/esri-input-geojson/index.js +0 -1563
  152. package/components/esri-input-geojson/src/const.js +0 -1
  153. package/components/esri-input-geojson/src/ctx.js +0 -1
  154. package/components/esri-input-geojson/src/index.css +0 -1
  155. package/components/esri-input-geojson/src/types.js +0 -1
  156. package/components/form/index.css +0 -1
  157. package/components/form/src/ctx.js +0 -1
  158. package/components/form/src/index.css +0 -1
  159. package/components/form/src/types.js +0 -1
  160. package/components/form/src/utils.js +0 -1
  161. package/components/form-item/src/ctx.js +0 -1
  162. package/components/form-item/src/index.css +0 -1
  163. package/components/form-item/src/types.js +0 -1
  164. package/components/form-item-renderer/index.css +0 -1
  165. package/components/form-item-renderer/src/ctx.js +0 -1
  166. package/components/form-item-renderer/src/index.css +0 -1
  167. package/components/form-item-renderer/src/symbols.js +0 -1
  168. package/components/form-item-renderer/src/types.js +0 -1
  169. package/components/form-item-renderer-template/index.css +0 -1
  170. package/components/form-item-renderer-template/src/ctx.js +0 -1
  171. package/components/form-item-renderer-template/src/index.css +0 -1
  172. package/components/form-item-renderer-template/src/types.js +0 -1
  173. package/components/geoinput/index.css +0 -1
  174. package/components/geoinput/src/ctx.js +0 -1
  175. package/components/geoinput/src/index.css +0 -1
  176. package/components/geoinput/src/types.js +0 -1
  177. package/components/geoinput-read/src/ctx.js +0 -1
  178. package/components/geoinput-read/src/index.css +0 -1
  179. package/components/geoinput-read/src/types.js +0 -1
  180. package/components/geoinput-update/index.js +0 -930
  181. package/components/geoinput-update/src/ctx.js +0 -1
  182. package/components/geoinput-update/src/index.css +0 -1
  183. package/components/geoinput-update/src/types.js +0 -1
  184. package/components/input/index.css +0 -1
  185. package/components/input/src/ctx.js +0 -1
  186. package/components/input/src/index.css +0 -1
  187. package/components/input/src/types.js +0 -1
  188. package/components/input-link/index.js +0 -163
  189. package/components/input-link/src/ctx.js +0 -1
  190. package/components/input-link/src/index.css +0 -1
  191. package/components/input-link/src/types.js +0 -1
  192. package/components/input-number/src/ctx.js +0 -1
  193. package/components/input-number/src/index.css +0 -1
  194. package/components/input-number/src/types.js +0 -1
  195. package/components/radio/src/ctx.js +0 -1
  196. package/components/radio/src/index.css +0 -1
  197. package/components/radio/src/types.js +0 -1
  198. package/components/select/src/ctx.js +0 -1
  199. package/components/select/src/index.css +0 -1
  200. package/components/select/src/types.js +0 -1
  201. package/components/slider/index.css +0 -1
  202. package/components/slider/src/ctx.js +0 -1
  203. package/components/slider/src/index.css +0 -1
  204. package/components/slider/src/types.js +0 -1
  205. package/components/switch/src/ctx.js +0 -1
  206. package/components/switch/src/index.css +0 -1
  207. package/components/switch/src/types.js +0 -1
  208. package/components/templates-default/index.css +0 -1
  209. package/components/templates-default/index.js +0 -347
  210. package/components/templates-default/src/ctx.js +0 -1
  211. package/components/templates-default/src/index.css +0 -1
  212. package/components/templates-default/src/types.js +0 -1
  213. package/components/templates-element-plus/index.css +0 -1
  214. package/components/templates-element-plus/index.js +0 -110
  215. package/components/templates-element-plus/src/ctx.js +0 -1
  216. package/components/templates-element-plus/src/index.css +0 -1
  217. package/components/templates-element-plus/src/types.js +0 -1
  218. package/components/templates-esri/index.css +0 -1
  219. package/components/templates-esri/index.js +0 -65
  220. package/components/templates-esri/src/ctx.js +0 -1
  221. package/components/templates-esri/src/index.css +0 -1
  222. package/components/templates-esri/src/types.js +0 -1
  223. package/components/templates-layout/index.js +0 -141
  224. package/components/templates-layout/src/ctx.js +0 -1
  225. package/components/templates-layout/src/index.css +0 -1
  226. package/components/templates-layout/src/types.js +0 -1
  227. package/components/templates-mapbox/index.css +0 -1
  228. package/components/templates-mapbox/index.js +0 -65
  229. package/components/templates-mapbox/src/ctx.js +0 -1
  230. package/components/templates-mapbox/src/index.css +0 -1
  231. package/components/templates-mapbox/src/types.js +0 -1
  232. package/components/upload/index.js +0 -565
  233. package/components/upload/src/ctx.js +0 -1
  234. package/components/upload/src/index.css +0 -1
  235. package/components/upload/src/types.js +0 -1
  236. package/components/upload-plus/src/api.js +0 -28
  237. package/components/upload-plus/src/const.js +0 -1
  238. package/components/upload-plus/src/ctx.js +0 -1
  239. package/components/upload-plus/src/index.css +0 -1
  240. package/components/upload-plus/src/types.js +0 -1
  241. package/components/van-cascader/src/ctx.js +0 -1
  242. package/components/van-cascader/src/index.css +0 -1
  243. package/components/van-cascader/src/types.js +0 -1
  244. package/components/var-datetime-picker/index.js +0 -299
  245. package/components/var-datetime-picker/src/const.js +0 -1
  246. package/components/var-datetime-picker/src/ctx.js +0 -1
  247. package/components/var-datetime-picker/src/index.css +0 -1
  248. package/components/var-datetime-picker/src/types.js +0 -1
  249. package/components/vditor/index.css +0 -1
  250. package/components/vditor/src/ctx.js +0 -1
  251. package/components/vditor/src/index.css +0 -1
  252. package/components/vditor/src/types.js +0 -1
  253. package/composables/index.css +0 -1
  254. package/composables/index.js +0 -1
  255. package/shared/const/index.css +0 -1
  256. package/shared/const/index.js +0 -1
  257. package/shared/element-plus/index.css +0 -1
  258. package/shared/element-plus/index.js +0 -1
  259. package/shared/form/index.css +0 -1
  260. package/shared/form/index.js +0 -1
  261. package/shared/helper/index.css +0 -1
  262. package/shared/helper/index.js +0 -1
  263. package/shared/index.css +0 -1
  264. package/shared/index.js +0 -1
  265. package/shared/infer-prop/index.css +0 -1
  266. package/shared/infer-prop/index.js +0 -1
  267. package/shared/progress-it/index.css +0 -1
  268. package/shared/progress-it/index.js +0 -1
  269. package/shared/rules/index.css +0 -1
  270. package/shared/rules/index.js +0 -1
  271. package/shared/types/form/index.css +0 -1
  272. package/shared/types/form/index.js +0 -1
  273. package/shared/types/index.css +0 -1
  274. package/shared/types/index.js +0 -1
  275. package/shared/types/source/index.css +0 -1
  276. package/shared/types/source/index.js +0 -1
  277. package/shared/types/source-manager/index.css +0 -1
  278. package/shared/types/source-manager/index.js +0 -1
  279. package/shared/upload/index.css +0 -1
  280. package/shared/upload/index.js +0 -1
  281. /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
  282. /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
  283. /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
  284. /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
@@ -1,565 +0,0 @@
1
- import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
3
- import { uploadProps, ElProgress, ElIcon, useNamespace, useLocale, ElUpload, ElLink } from 'element-plus';
4
- import { defineComponent, openBlock, createElementBlock, createElementVNode, resolveComponent, Fragment, createCommentVNode, normalizeClass, createBlock, withModifiers, createVNode, withCtx, toDisplayString, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, createTextVNode } from 'vue';
5
- import { pickObject } from '@vunk/core/shared/utils-object';
6
- import { createUploadBindProps } from '@vunk/form/shared/element-plus';
7
- import { NOOP } from '@vunk/core/shared/utils-function';
8
- import { RestFetch } from '@vunk/core/shared/utils-fetch';
9
- import { useComputedReadonly } from '@vunk/form/composables';
10
- import progress from '@vunk/form/shared/progress-it';
11
-
12
- const props = {
13
- ..._VkfFormItemCtx.props,
14
- ...uploadProps,
15
- tip: {
16
- type: String,
17
- default: ""
18
- },
19
- preview: {
20
- type: Boolean,
21
- default: false
22
- },
23
- beforeUpload: {
24
- type: Function,
25
- default: void 0
26
- },
27
- onDownload: {
28
- type: Function,
29
- default: void 0
30
- }
31
- };
32
- const createBindProps = bindPropsFactory(props);
33
- const emits = {
34
- "update:fileList": null,
35
- "remove": (e) => e
36
- };
37
- const createOnEmits = onEmitsFactory(emits);
38
-
39
- var ctx = /*#__PURE__*/Object.freeze({
40
- __proto__: null,
41
- createBindProps: createBindProps,
42
- createOnEmits: createOnEmits,
43
- emits: emits,
44
- props: props
45
- });
46
-
47
- /*! Element Plus Icons Vue v2.3.1 */
48
-
49
- var check_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
50
- name: "Check",
51
- __name: "check",
52
- setup(__props) {
53
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
54
- xmlns: "http://www.w3.org/2000/svg",
55
- viewBox: "0 0 1024 1024"
56
- }, [createElementVNode("path", {
57
- fill: "currentColor",
58
- d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
59
- })]));
60
- }
61
- });
62
-
63
- // src/components/check.vue
64
- var check_default = check_vue_vue_type_script_setup_true_lang_default;
65
- var circle_check_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
66
- name: "CircleCheck",
67
- __name: "circle-check",
68
- setup(__props) {
69
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
70
- xmlns: "http://www.w3.org/2000/svg",
71
- viewBox: "0 0 1024 1024"
72
- }, [createElementVNode("path", {
73
- fill: "currentColor",
74
- d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
75
- }), createElementVNode("path", {
76
- fill: "currentColor",
77
- d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
78
- })]));
79
- }
80
- });
81
-
82
- // src/components/circle-check.vue
83
- var circle_check_default = circle_check_vue_vue_type_script_setup_true_lang_default;
84
- var close_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
85
- name: "Close",
86
- __name: "close",
87
- setup(__props) {
88
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
89
- xmlns: "http://www.w3.org/2000/svg",
90
- viewBox: "0 0 1024 1024"
91
- }, [createElementVNode("path", {
92
- fill: "currentColor",
93
- d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
94
- })]));
95
- }
96
- });
97
-
98
- // src/components/close.vue
99
- var close_default = close_vue_vue_type_script_setup_true_lang_default;
100
- var delete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
101
- name: "Delete",
102
- __name: "delete",
103
- setup(__props) {
104
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
105
- xmlns: "http://www.w3.org/2000/svg",
106
- viewBox: "0 0 1024 1024"
107
- }, [createElementVNode("path", {
108
- fill: "currentColor",
109
- d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
110
- })]));
111
- }
112
- });
113
-
114
- // src/components/delete.vue
115
- var delete_default = delete_vue_vue_type_script_setup_true_lang_default;
116
- var document_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
117
- name: "Document",
118
- __name: "document",
119
- setup(__props) {
120
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
121
- xmlns: "http://www.w3.org/2000/svg",
122
- viewBox: "0 0 1024 1024"
123
- }, [createElementVNode("path", {
124
- fill: "currentColor",
125
- d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
126
- })]));
127
- }
128
- });
129
-
130
- // src/components/document.vue
131
- var document_default = document_vue_vue_type_script_setup_true_lang_default;
132
- var download_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
133
- name: "Download",
134
- __name: "download",
135
- setup(__props) {
136
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
137
- xmlns: "http://www.w3.org/2000/svg",
138
- viewBox: "0 0 1024 1024"
139
- }, [createElementVNode("path", {
140
- fill: "currentColor",
141
- d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
142
- })]));
143
- }
144
- });
145
-
146
- // src/components/download.vue
147
- var download_default = download_vue_vue_type_script_setup_true_lang_default;
148
- var zoom_in_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
149
- name: "ZoomIn",
150
- __name: "zoom-in",
151
- setup(__props) {
152
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
153
- xmlns: "http://www.w3.org/2000/svg",
154
- viewBox: "0 0 1024 1024"
155
- }, [createElementVNode("path", {
156
- fill: "currentColor",
157
- d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
158
- })]));
159
- }
160
- });
161
-
162
- // src/components/zoom-in.vue
163
- var zoom_in_default = zoom_in_vue_vue_type_script_setup_true_lang_default;
164
-
165
- const restFetch = new RestFetch({
166
- baseURL: ""
167
- });
168
- var script$1 = defineComponent({
169
- components: {
170
- ElProgress,
171
- ElIcon,
172
- Check: check_default,
173
- ZoomIn: zoom_in_default,
174
- Delete: delete_default,
175
- Close: close_default,
176
- CircleCheck: circle_check_default,
177
- Document: document_default,
178
- Download: download_default
179
- },
180
- props: {
181
- listType: {
182
- type: String,
183
- default: "text"
184
- },
185
- file: {
186
- type: Object,
187
- default: () => ({})
188
- },
189
- disabled: {
190
- type: Boolean,
191
- default: false
192
- },
193
- onPreview: {
194
- type: Function,
195
- default: () => NOOP
196
- },
197
- onDownload: {
198
- type: Function,
199
- default: void 0
200
- },
201
- preview: {
202
- type: Boolean,
203
- default: false
204
- }
205
- },
206
- emits: {
207
- "remove": (e) => e
208
- },
209
- setup(props, {
210
- emit
211
- }) {
212
- const nsUpload = useNamespace("upload");
213
- const nsIcon = useNamespace("icon");
214
- const {
215
- t
216
- } = useLocale();
217
- const handleRemove = (file = props.file) => {
218
- emit("remove", file);
219
- };
220
- const handleDownload = (file = props.file) => {
221
- if (props.onDownload) {
222
- props.onDownload(file);
223
- return;
224
- }
225
- let url = "";
226
- if (file.url) {
227
- url = file.url;
228
- } else if (file.raw) {
229
- url = window.URL.createObjectURL(file.raw);
230
- }
231
- url && restFetch.download({
232
- url,
233
- fileName: file.name
234
- }, {
235
- method: "GET"
236
- });
237
- };
238
- return {
239
- handleRemove,
240
- t,
241
- nsIcon,
242
- nsUpload,
243
- handleDownload
244
- };
245
- }
246
- });
247
-
248
- const _hoisted_1$1 = ["src"];
249
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
250
- const _component_Document = resolveComponent("Document");
251
- const _component_el_icon = resolveComponent("el-icon");
252
- const _component_Download = resolveComponent("Download");
253
- const _component_el_progress = resolveComponent("el-progress");
254
- const _component_circle_check = resolveComponent("circle-check");
255
- const _component_Check = resolveComponent("Check");
256
- const _component_Close = resolveComponent("Close");
257
- const _component_zoom_in = resolveComponent("zoom-in");
258
- const _component_Delete = resolveComponent("Delete");
259
- return openBlock(), createElementBlock(
260
- Fragment,
261
- null,
262
- [createCommentVNode(" picture "), _ctx.listType === "picture" || _ctx.file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
263
- Fragment,
264
- {
265
- key: 0
266
- },
267
- [/\.(svg|png|jpg|jpeg)$/.test(_ctx.file.name) ? (openBlock(), createElementBlock("img", {
268
- key: 0,
269
- class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
270
- src: _ctx.file.url,
271
- alt: ""
272
- }, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, {
273
- key: 1
274
- }))],
275
- 64
276
- /* STABLE_FRAGMENT */
277
- )) : createCommentVNode("v-if", true), createCommentVNode(" text "), _ctx.listType !== "picture" && (_ctx.file.status === "uploading" || _ctx.listType !== "picture-card") ? (openBlock(), createElementBlock(
278
- "div",
279
- {
280
- key: 1,
281
- class: normalizeClass(_ctx.nsUpload.be("list", "item-info"))
282
- },
283
- [createElementVNode(
284
- "a",
285
- {
286
- class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
287
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.onPreview(_ctx.file), ["prevent"]))
288
- },
289
- [createVNode(_component_el_icon, {
290
- class: normalizeClass(_ctx.nsIcon.m("document"))
291
- }, {
292
- default: withCtx(() => [createVNode(_component_Document)]),
293
- _: 1
294
- /* STABLE */
295
- }, 8, ["class"]), createVNode(_component_el_icon, {
296
- class: normalizeClass([_ctx.nsIcon.m("download"), _ctx.nsIcon.m("download-primary")]),
297
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleDownload(_ctx.file))
298
- }, {
299
- default: withCtx(() => [createVNode(_component_Download)]),
300
- _: 1
301
- /* STABLE */
302
- }, 8, ["class"]), createElementVNode(
303
- "span",
304
- {
305
- class: normalizeClass(_ctx.nsUpload.be("list", "item-file-name"))
306
- },
307
- toDisplayString(_ctx.file.name),
308
- 3
309
- /* TEXT, CLASS */
310
- )],
311
- 2
312
- /* CLASS */
313
- ), _ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
314
- key: 0,
315
- type: _ctx.listType === "picture-card" ? "circle" : "line",
316
- "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
317
- percentage: Number(_ctx.file.percentage),
318
- style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
319
- }, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)],
320
- 2
321
- /* CLASS */
322
- )) : createCommentVNode("v-if", true), createElementVNode(
323
- "label",
324
- {
325
- class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
326
- },
327
- [_ctx.listType === "text" ? (openBlock(), createBlock(_component_el_icon, {
328
- key: 0,
329
- class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("circle-check")])
330
- }, {
331
- default: withCtx(() => [createVNode(_component_circle_check)]),
332
- _: 1
333
- /* STABLE */
334
- }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_el_icon, {
335
- key: 1,
336
- class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
337
- }, {
338
- default: withCtx(() => [createVNode(_component_Check)]),
339
- _: 1
340
- /* STABLE */
341
- }, 8, ["class"])) : createCommentVNode("v-if", true)],
342
- 2
343
- /* CLASS */
344
- ), !_ctx.disabled ? (openBlock(), createBlock(_component_el_icon, {
345
- key: 2,
346
- class: normalizeClass(_ctx.nsIcon.m("close")),
347
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handleRemove(_ctx.file))
348
- }, {
349
- default: withCtx(() => [createVNode(_component_Close)]),
350
- _: 1
351
- /* STABLE */
352
- }, 8, ["class"])) : createCommentVNode("v-if", true), createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"), createCommentVNode(" This is a bug which needs to be fixed "), createCommentVNode(" TODO: Fix the incorrect navigation interaction "), createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{
353
- t('el.upload.deleteTip')
354
- }}</i> `), createCommentVNode(" picture-card "), _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
355
- "span",
356
- {
357
- key: 3,
358
- class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
359
- },
360
- [_ctx.preview ? (openBlock(), createElementBlock(
361
- "span",
362
- {
363
- key: 0,
364
- class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
365
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.onPreview(_ctx.file))
366
- },
367
- [createVNode(_component_el_icon, {
368
- class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
369
- }, {
370
- default: withCtx(() => [createVNode(_component_zoom_in)]),
371
- _: 1
372
- /* STABLE */
373
- }, 8, ["class"])],
374
- 2
375
- /* CLASS */
376
- )) : createCommentVNode("v-if", true), createCommentVNode(" \u4E0B\u8F7D "), createElementVNode(
377
- "span",
378
- {
379
- class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
380
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleDownload(_ctx.file))
381
- },
382
- [createVNode(_component_el_icon, {
383
- class: normalizeClass(_ctx.nsIcon.m("download"))
384
- }, {
385
- default: withCtx(() => [createVNode(_component_Download)]),
386
- _: 1
387
- /* STABLE */
388
- }, 8, ["class"])],
389
- 2
390
- /* CLASS */
391
- ), !_ctx.disabled ? (openBlock(), createElementBlock(
392
- "span",
393
- {
394
- key: 1,
395
- class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
396
- onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleRemove(_ctx.file))
397
- },
398
- [createVNode(_component_el_icon, {
399
- class: normalizeClass(_ctx.nsIcon.m("delete"))
400
- }, {
401
- default: withCtx(() => [createVNode(_component_Delete)]),
402
- _: 1
403
- /* STABLE */
404
- }, 8, ["class"])],
405
- 2
406
- /* CLASS */
407
- )) : createCommentVNode("v-if", true)],
408
- 2
409
- /* CLASS */
410
- )) : createCommentVNode("v-if", true)],
411
- 64
412
- /* STABLE_FRAGMENT */
413
- );
414
- }
415
-
416
- script$1.render = render$1;
417
- script$1.__file = "upload/src/file.vue";
418
-
419
- var script = defineComponent({
420
- name: "VkfUpload",
421
- components: {
422
- VkfFormItem,
423
- ElUpload,
424
- FileVue: script$1,
425
- ElLink
426
- },
427
- props,
428
- emits,
429
- setup(props2, {
430
- emit
431
- }) {
432
- const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
433
- const coreBindProps = createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
434
- const uploadRef = shallowRef();
435
- const handleRemove = (file) => {
436
- uploadRef.value?.handleRemove(file);
437
- uploadRef.value?.abort(file);
438
- emit("update:fileList", props2.fileList);
439
- };
440
- const readonly = useComputedReadonly(props2);
441
- const onSuccess = (response, uploadFile, uploadFiles) => {
442
- const raw = uploadFile.raw;
443
- raw.progress(true);
444
- uploadFile.percentage = 100;
445
- uploadFile.status = "success";
446
- props2.onSuccess?.(response, uploadFile, uploadFiles);
447
- };
448
- const beforeUpload = async (rawFile) => {
449
- const effect = (e, s) => {
450
- const file = props2.fileList.find((item) => item.uid === rawFile.uid);
451
- if (file) {
452
- file.percentage = Number((e * 100).toFixed(2));
453
- if (s === false) {
454
- file.status = "uploading";
455
- }
456
- }
457
- };
458
- rawFile.progress = progress(effect)(false);
459
- if (props2.beforeUpload) {
460
- const res = await props2.beforeUpload?.(rawFile);
461
- return res;
462
- }
463
- return true;
464
- };
465
- return {
466
- formItemBindProps,
467
- pickObject,
468
- coreBindProps,
469
- uploadRef,
470
- handleRemove,
471
- readonly,
472
- onSuccess,
473
- // onProgress,
474
- beforeUpload
475
- };
476
- }
477
- });
478
-
479
- const _hoisted_1 = {
480
- class: "el-upload__tip"
481
- };
482
- function render(_ctx, _cache, $props, $setup, $data, $options) {
483
- const _component_ElLink = resolveComponent("ElLink");
484
- const _component_FileVue = resolveComponent("FileVue");
485
- const _component_ElUpload = resolveComponent("ElUpload");
486
- const _component_VkfFormItem = resolveComponent("VkfFormItem");
487
- return openBlock(), createBlock(
488
- _component_VkfFormItem,
489
- normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
490
- {
491
- default: withCtx(() => [createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
492
- ref: "uploadRef",
493
- class: ["vkf-upload", {
494
- "is-readonly": _ctx.readonly,
495
- "is-empty": _ctx.fileList?.length === 0,
496
- "is-limit": _ctx.limit && _ctx.fileList?.length >= _ctx.limit
497
- }],
498
- "file-list": _ctx.fileList ?? [],
499
- "on-success": _ctx.onSuccess,
500
- "before-upload": _ctx.beforeUpload,
501
- disabled: _ctx.readonly || _ctx.disabled,
502
- "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fileList", $event))
503
- }), createSlots({
504
- file: withCtx(({
505
- file
506
- }) => [createVNode(_component_FileVue, {
507
- file,
508
- "list-type": _ctx.listType,
509
- disabled: _ctx.readonly || _ctx.disabled,
510
- "on-preview": _ctx.onPreview,
511
- preview: _ctx.preview,
512
- "on-download": _ctx.onDownload,
513
- onRemove: _ctx.handleRemove
514
- }, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "onRemove"])]),
515
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_component_ElLink, {
516
- type: "primary"
517
- }, {
518
- default: withCtx(() => [createTextVNode(" + \u9009\u62E9\u6587\u4EF6 ")]),
519
- _: 1
520
- /* STABLE */
521
- })])]),
522
- _: 2
523
- /* DYNAMIC */
524
- }, [_ctx.tip ? {
525
- name: "tip",
526
- fn: withCtx(() => [createElementVNode(
527
- "div",
528
- _hoisted_1,
529
- toDisplayString(_ctx.tip),
530
- 1
531
- /* TEXT */
532
- )]),
533
- key: "0"
534
- } : void 0]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled"]), createElementVNode(
535
- "span",
536
- {
537
- class: normalizeClass(["vkf-upload-empty-tip", {
538
- "is-readonly": _ctx.readonly,
539
- "is-empty": _ctx.fileList?.length === 0
540
- }])
541
- },
542
- "\u6682\u65E0",
543
- 2
544
- /* CLASS */
545
- )]),
546
- _: 3
547
- /* FORWARDED */
548
- },
549
- 16
550
- /* FULL_PROPS */
551
- );
552
- }
553
-
554
- script.render = render;
555
- script.__file = "upload/src/index.vue";
556
-
557
- var types = /*#__PURE__*/Object.freeze({
558
- __proto__: null
559
- });
560
-
561
- script.install = (app) => {
562
- app.component(script.name, script);
563
- };
564
-
565
- export { script as VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, script as default };
@@ -1 +0,0 @@
1
- import{_VkfFormItemCtx as r}from"@vunk/form/components/form-item";import{bindPropsFactory as p,onEmitsFactory as i}from"@vunk/core/shared/utils-vue";import{uploadProps as n}from"element-plus";const o={...r.props,...n,tip:{type:String,default:""},preview:{type:Boolean,default:!1},beforeUpload:{type:Function,default:void 0},onDownload:{type:Function,default:void 0}},a=p(o),t={"update:fileList":null,remove:e=>e},s=i(t);export{a as createBindProps,s as createOnEmits,t as emits,o as props};
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-