@vunk/form 1.1.76 → 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} +24 -23
  15. package/components/color-picker/src/ctx.d.ts +29 -29
  16. package/components/color-picker/src/index.vue.d.ts +77 -64
  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
@@ -0,0 +1,59 @@
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, mergeProps, createCommentVNode } from 'vue';
2
+ import { VkfGeoinput } from '@vunk/form/components/geoinput';
3
+ import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
4
+ import { getValue } from '@vunk/core';
5
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
6
+
7
+ const props = {
8
+ data: {
9
+ type: Object,
10
+ default: () => ({})
11
+ }
12
+ };
13
+ const emits = {
14
+ setData: (data) => data
15
+ };
16
+
17
+ var _sfc_main = defineComponent({
18
+ name: "VkfTemplatesMapbox",
19
+ components: {
20
+ VkfGeoinput,
21
+ VkfFormItemRendererTemplate
22
+ },
23
+ emits,
24
+ props,
25
+ setup() {
26
+ return {
27
+ getValue
28
+ };
29
+ }
30
+ });
31
+
32
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
33
+ const _component_VkfGeoinput = resolveComponent("VkfGeoinput");
34
+ const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
35
+ return openBlock(), createBlock(_component_VkfFormItemRendererTemplate, { type: "VkfGeoinput" }, {
36
+ default: withCtx(({ data: props, templateIf }) => [
37
+ templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfGeoinput, mergeProps({ key: 0 }, props, {
38
+ "model-value": _ctx.getValue(_ctx.data, props.prop),
39
+ "onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
40
+ k: props.prop,
41
+ v: $event
42
+ })
43
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
44
+ ]),
45
+ _: 1
46
+ /* STABLE */
47
+ });
48
+ }
49
+ var VkfTemplatesMapbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\templates-mapbox\\src\\index.vue"]]);
50
+
51
+ var types = /*#__PURE__*/Object.freeze({
52
+ __proto__: null
53
+ });
54
+
55
+ VkfTemplatesMapbox.install = (app) => {
56
+ app.component(VkfTemplatesMapbox.name, VkfTemplatesMapbox);
57
+ };
58
+
59
+ export { VkfTemplatesMapbox, types as __VkfTemplatesMapbox, VkfTemplatesMapbox as default };
@@ -1,4 +1,3 @@
1
-
2
1
  .el-upload-list__item-status-label{
3
2
  z-index: 1;
4
3
  }
@@ -8,8 +7,6 @@
8
7
  .el-upload-list__item-name .el-icon.el-icon--download-primary{
9
8
  color: var(--el-color-primary);
10
9
  }
11
-
12
-
13
10
  .vkf-upload {
14
11
  width: 100%;
15
12
  }
@@ -19,7 +16,6 @@
19
16
  .vkf-upload-empty-tip.is-readonly.is-empty{
20
17
  display: block;
21
18
  }
22
-
23
19
  .vkf-upload.is-readonly .el-upload,
24
20
  .vkf-upload.is-readonly .el-upload{
25
21
  display: none;
@@ -30,9 +26,6 @@
30
26
  .vkf-upload .el-upload-list{
31
27
  min-width: 100px;
32
28
  }
33
-
34
29
  .vkf-upload.is-limit .el-upload{
35
30
  display: none;
36
31
  }
37
-
38
-
@@ -0,0 +1,501 @@
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, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, normalizeClass, createBlock, createElementVNode, 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 { f as check_default, z as zoom_in_default, g as delete_default, h as close_default, i as circle_check_default, j as document_default, d as download_default } from '../index2.mjs';
8
+ import { NOOP } from '@vunk/core/shared/utils-function';
9
+ import { RestFetch } from '@vunk/core/shared/utils-fetch';
10
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
11
+ import { useComputedReadonly } from '@vunk/form/composables';
12
+ import progress from '@vunk/form/shared/progress-it';
13
+
14
+ const props = {
15
+ ..._VkfFormItemCtx.props,
16
+ ...uploadProps,
17
+ tip: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ preview: {
22
+ type: Boolean,
23
+ default: false
24
+ },
25
+ beforeUpload: {
26
+ type: Function,
27
+ default: void 0
28
+ },
29
+ onDownload: {
30
+ type: Function,
31
+ default: void 0
32
+ }
33
+ };
34
+ const createBindProps = bindPropsFactory(props);
35
+ const emits = {
36
+ "update:fileList": null,
37
+ "remove": (e) => e
38
+ };
39
+ const createOnEmits = onEmitsFactory(emits);
40
+
41
+ var ctx = /*#__PURE__*/Object.freeze({
42
+ __proto__: null,
43
+ createBindProps: createBindProps,
44
+ createOnEmits: createOnEmits,
45
+ emits: emits,
46
+ props: props
47
+ });
48
+
49
+ const restFetch = new RestFetch({
50
+ baseURL: ""
51
+ });
52
+ var _sfc_main$1 = defineComponent({
53
+ components: {
54
+ ElProgress,
55
+ ElIcon,
56
+ Check: check_default,
57
+ ZoomIn: zoom_in_default,
58
+ Delete: delete_default,
59
+ Close: close_default,
60
+ CircleCheck: circle_check_default,
61
+ Document: document_default,
62
+ Download: download_default
63
+ },
64
+ props: {
65
+ listType: {
66
+ type: String,
67
+ default: "text"
68
+ },
69
+ file: {
70
+ type: Object,
71
+ default: () => ({})
72
+ },
73
+ disabled: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ onPreview: {
78
+ type: Function,
79
+ default: () => NOOP
80
+ },
81
+ onDownload: {
82
+ type: Function,
83
+ default: void 0
84
+ },
85
+ preview: {
86
+ type: Boolean,
87
+ default: false
88
+ }
89
+ },
90
+ emits: {
91
+ "remove": (e) => e
92
+ },
93
+ setup(props, { emit }) {
94
+ const nsUpload = useNamespace("upload");
95
+ const nsIcon = useNamespace("icon");
96
+ const { t } = useLocale();
97
+ const handleRemove = (file = props.file) => {
98
+ emit("remove", file);
99
+ };
100
+ const handleDownload = (file = props.file) => {
101
+ if (props.onDownload) {
102
+ props.onDownload(file);
103
+ return;
104
+ }
105
+ let url = "";
106
+ if (file.url) {
107
+ url = file.url;
108
+ } else if (file.raw) {
109
+ url = window.URL.createObjectURL(file.raw);
110
+ }
111
+ url && restFetch.download({
112
+ url,
113
+ fileName: file.name
114
+ }, {
115
+ method: "GET"
116
+ });
117
+ };
118
+ return {
119
+ handleRemove,
120
+ t,
121
+ nsIcon,
122
+ nsUpload,
123
+ handleDownload
124
+ };
125
+ }
126
+ });
127
+
128
+ const _hoisted_1$1 = ["src"];
129
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
130
+ const _component_Document = resolveComponent("Document");
131
+ const _component_el_icon = resolveComponent("el-icon");
132
+ const _component_Download = resolveComponent("Download");
133
+ const _component_el_progress = resolveComponent("el-progress");
134
+ const _component_circle_check = resolveComponent("circle-check");
135
+ const _component_Check = resolveComponent("Check");
136
+ const _component_Close = resolveComponent("Close");
137
+ const _component_zoom_in = resolveComponent("zoom-in");
138
+ const _component_Delete = resolveComponent("Delete");
139
+ return openBlock(), createElementBlock(
140
+ Fragment,
141
+ null,
142
+ [
143
+ createCommentVNode(" picture "),
144
+ _ctx.listType === "picture" || _ctx.file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
145
+ Fragment,
146
+ { key: 0 },
147
+ [
148
+ /\.(svg|png|jpg|jpeg)$/.test(_ctx.file.name) ? (openBlock(), createElementBlock("img", {
149
+ key: 0,
150
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
151
+ src: _ctx.file.url,
152
+ alt: ""
153
+ }, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, { key: 1 }))
154
+ ],
155
+ 64
156
+ /* STABLE_FRAGMENT */
157
+ )) : createCommentVNode("v-if", true),
158
+ createCommentVNode(" text "),
159
+ _ctx.listType !== "picture" && (_ctx.file.status === "uploading" || _ctx.listType !== "picture-card") ? (openBlock(), createElementBlock(
160
+ "div",
161
+ {
162
+ key: 1,
163
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-info"))
164
+ },
165
+ [
166
+ createElementVNode(
167
+ "a",
168
+ {
169
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
170
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.onPreview(_ctx.file), ["prevent"]))
171
+ },
172
+ [
173
+ createVNode(_component_el_icon, {
174
+ class: normalizeClass(_ctx.nsIcon.m("document"))
175
+ }, {
176
+ default: withCtx(() => [
177
+ createVNode(_component_Document)
178
+ ]),
179
+ _: 1
180
+ /* STABLE */
181
+ }, 8, ["class"]),
182
+ createVNode(_component_el_icon, {
183
+ class: normalizeClass([
184
+ _ctx.nsIcon.m("download"),
185
+ _ctx.nsIcon.m("download-primary")
186
+ ]),
187
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleDownload(_ctx.file))
188
+ }, {
189
+ default: withCtx(() => [
190
+ createVNode(_component_Download)
191
+ ]),
192
+ _: 1
193
+ /* STABLE */
194
+ }, 8, ["class"]),
195
+ createElementVNode(
196
+ "span",
197
+ {
198
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-file-name"))
199
+ },
200
+ toDisplayString(_ctx.file.name),
201
+ 3
202
+ /* TEXT, CLASS */
203
+ )
204
+ ],
205
+ 2
206
+ /* CLASS */
207
+ ),
208
+ _ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
209
+ key: 0,
210
+ type: _ctx.listType === "picture-card" ? "circle" : "line",
211
+ "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
212
+ percentage: Number(_ctx.file.percentage),
213
+ style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
214
+ }, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
215
+ ],
216
+ 2
217
+ /* CLASS */
218
+ )) : createCommentVNode("v-if", true),
219
+ createElementVNode(
220
+ "label",
221
+ {
222
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
223
+ },
224
+ [
225
+ _ctx.listType === "text" ? (openBlock(), createBlock(_component_el_icon, {
226
+ key: 0,
227
+ class: normalizeClass([
228
+ _ctx.nsIcon.m("upload-success"),
229
+ _ctx.nsIcon.m("circle-check")
230
+ ])
231
+ }, {
232
+ default: withCtx(() => [
233
+ createVNode(_component_circle_check)
234
+ ]),
235
+ _: 1
236
+ /* STABLE */
237
+ }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_el_icon, {
238
+ key: 1,
239
+ class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
240
+ }, {
241
+ default: withCtx(() => [
242
+ createVNode(_component_Check)
243
+ ]),
244
+ _: 1
245
+ /* STABLE */
246
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
247
+ ],
248
+ 2
249
+ /* CLASS */
250
+ ),
251
+ !_ctx.disabled ? (openBlock(), createBlock(_component_el_icon, {
252
+ key: 2,
253
+ class: normalizeClass(_ctx.nsIcon.m("close")),
254
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handleRemove(_ctx.file))
255
+ }, {
256
+ default: withCtx(() => [
257
+ createVNode(_component_Close)
258
+ ]),
259
+ _: 1
260
+ /* STABLE */
261
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
262
+ createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
263
+ createCommentVNode(" This is a bug which needs to be fixed "),
264
+ createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
265
+ createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{
266
+ t('el.upload.deleteTip')
267
+ }}</i> `),
268
+ createCommentVNode(" picture-card "),
269
+ _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
270
+ "span",
271
+ {
272
+ key: 3,
273
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
274
+ },
275
+ [
276
+ _ctx.preview ? (openBlock(), createElementBlock(
277
+ "span",
278
+ {
279
+ key: 0,
280
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
281
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.onPreview(_ctx.file))
282
+ },
283
+ [
284
+ createVNode(_component_el_icon, {
285
+ class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
286
+ }, {
287
+ default: withCtx(() => [
288
+ createVNode(_component_zoom_in)
289
+ ]),
290
+ _: 1
291
+ /* STABLE */
292
+ }, 8, ["class"])
293
+ ],
294
+ 2
295
+ /* CLASS */
296
+ )) : createCommentVNode("v-if", true),
297
+ createCommentVNode(" \u4E0B\u8F7D "),
298
+ createElementVNode(
299
+ "span",
300
+ {
301
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
302
+ onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleDownload(_ctx.file))
303
+ },
304
+ [
305
+ createVNode(_component_el_icon, {
306
+ class: normalizeClass(_ctx.nsIcon.m("download"))
307
+ }, {
308
+ default: withCtx(() => [
309
+ createVNode(_component_Download)
310
+ ]),
311
+ _: 1
312
+ /* STABLE */
313
+ }, 8, ["class"])
314
+ ],
315
+ 2
316
+ /* CLASS */
317
+ ),
318
+ !_ctx.disabled ? (openBlock(), createElementBlock(
319
+ "span",
320
+ {
321
+ key: 1,
322
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
323
+ onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleRemove(_ctx.file))
324
+ },
325
+ [
326
+ createVNode(_component_el_icon, {
327
+ class: normalizeClass(_ctx.nsIcon.m("delete"))
328
+ }, {
329
+ default: withCtx(() => [
330
+ createVNode(_component_Delete)
331
+ ]),
332
+ _: 1
333
+ /* STABLE */
334
+ }, 8, ["class"])
335
+ ],
336
+ 2
337
+ /* CLASS */
338
+ )) : createCommentVNode("v-if", true)
339
+ ],
340
+ 2
341
+ /* CLASS */
342
+ )) : createCommentVNode("v-if", true)
343
+ ],
344
+ 64
345
+ /* STABLE_FRAGMENT */
346
+ );
347
+ }
348
+ var FileVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\upload\\src\\file.vue"]]);
349
+
350
+ var _sfc_main = defineComponent({
351
+ name: "VkfUpload",
352
+ components: {
353
+ VkfFormItem,
354
+ ElUpload,
355
+ FileVue,
356
+ ElLink
357
+ },
358
+ props,
359
+ emits,
360
+ setup(props2, { emit }) {
361
+ const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
362
+ const coreBindProps = createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
363
+ const uploadRef = shallowRef();
364
+ const handleRemove = (file) => {
365
+ uploadRef.value?.handleRemove(file);
366
+ uploadRef.value?.abort(file);
367
+ emit("update:fileList", props2.fileList);
368
+ };
369
+ const readonly = useComputedReadonly(props2);
370
+ const onSuccess = (response, uploadFile, uploadFiles) => {
371
+ const raw = uploadFile.raw;
372
+ raw.progress(true);
373
+ uploadFile.percentage = 100;
374
+ uploadFile.status = "success";
375
+ props2.onSuccess?.(response, uploadFile, uploadFiles);
376
+ };
377
+ const beforeUpload = async (rawFile) => {
378
+ const effect = (e, s) => {
379
+ const file = props2.fileList.find((item) => item.uid === rawFile.uid);
380
+ if (file) {
381
+ file.percentage = Number((e * 100).toFixed(2));
382
+ if (s === false) {
383
+ file.status = "uploading";
384
+ }
385
+ }
386
+ };
387
+ rawFile.progress = progress(effect)(false);
388
+ if (props2.beforeUpload) {
389
+ const res = await props2.beforeUpload?.(rawFile);
390
+ return res;
391
+ }
392
+ return true;
393
+ };
394
+ return {
395
+ formItemBindProps,
396
+ pickObject,
397
+ coreBindProps,
398
+ uploadRef,
399
+ handleRemove,
400
+ readonly,
401
+ onSuccess,
402
+ // onProgress,
403
+ beforeUpload
404
+ };
405
+ }
406
+ });
407
+
408
+ const _hoisted_1 = { class: "el-upload__tip" };
409
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
410
+ const _component_ElLink = resolveComponent("ElLink");
411
+ const _component_FileVue = resolveComponent("FileVue");
412
+ const _component_ElUpload = resolveComponent("ElUpload");
413
+ const _component_VkfFormItem = resolveComponent("VkfFormItem");
414
+ return openBlock(), createBlock(
415
+ _component_VkfFormItem,
416
+ normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
417
+ {
418
+ default: withCtx(() => [
419
+ createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
420
+ ref: "uploadRef",
421
+ class: ["vkf-upload", {
422
+ "is-readonly": _ctx.readonly,
423
+ "is-empty": _ctx.fileList?.length === 0,
424
+ "is-limit": _ctx.limit && _ctx.fileList?.length >= _ctx.limit
425
+ }],
426
+ "file-list": _ctx.fileList ?? [],
427
+ "on-success": _ctx.onSuccess,
428
+ "before-upload": _ctx.beforeUpload,
429
+ disabled: _ctx.readonly || _ctx.disabled,
430
+ "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fileList", $event))
431
+ }), createSlots({
432
+ file: withCtx(({ file }) => [
433
+ createVNode(_component_FileVue, {
434
+ file,
435
+ "list-type": _ctx.listType,
436
+ disabled: _ctx.readonly || _ctx.disabled,
437
+ "on-preview": _ctx.onPreview,
438
+ preview: _ctx.preview,
439
+ "on-download": _ctx.onDownload,
440
+ onRemove: _ctx.handleRemove
441
+ }, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "onRemove"])
442
+ ]),
443
+ default: withCtx(() => [
444
+ renderSlot(_ctx.$slots, "default", {}, () => [
445
+ createVNode(_component_ElLink, { type: "primary" }, {
446
+ default: withCtx(() => [
447
+ createTextVNode(" + \u9009\u62E9\u6587\u4EF6 ")
448
+ ]),
449
+ _: 1
450
+ /* STABLE */
451
+ })
452
+ ])
453
+ ]),
454
+ _: 2
455
+ /* DYNAMIC */
456
+ }, [
457
+ _ctx.tip ? {
458
+ name: "tip",
459
+ fn: withCtx(() => [
460
+ createElementVNode(
461
+ "div",
462
+ _hoisted_1,
463
+ toDisplayString(_ctx.tip),
464
+ 1
465
+ /* TEXT */
466
+ )
467
+ ]),
468
+ key: "0"
469
+ } : void 0
470
+ ]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled"]),
471
+ createElementVNode(
472
+ "span",
473
+ {
474
+ class: normalizeClass(["vkf-upload-empty-tip", {
475
+ "is-readonly": _ctx.readonly,
476
+ "is-empty": _ctx.fileList?.length === 0
477
+ }])
478
+ },
479
+ "\u6682\u65E0",
480
+ 2
481
+ /* CLASS */
482
+ )
483
+ ]),
484
+ _: 3
485
+ /* FORWARDED */
486
+ },
487
+ 16
488
+ /* FULL_PROPS */
489
+ );
490
+ }
491
+ var VkfUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\upload\\src\\index.vue"]]);
492
+
493
+ var types = /*#__PURE__*/Object.freeze({
494
+ __proto__: null
495
+ });
496
+
497
+ VkfUpload.install = (app) => {
498
+ app.component(VkfUpload.name, VkfUpload);
499
+ };
500
+
501
+ export { VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, VkfUpload as default };