@vunk/form 2.19.20 → 2.19.22

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 (197) hide show
  1. package/components/ai-provider/index.cjs +1 -0
  2. package/components/ai-provider/index.d.ts +7 -0
  3. package/components/ai-provider/index.mjs +61 -0
  4. package/components/ai-provider/src/ctx.d.ts +8 -0
  5. package/components/ai-provider/src/index.vue.d.ts +23 -0
  6. package/components/ai-provider/src/types.d.ts +56 -0
  7. package/components/ai-provider/src/use.d.ts +3 -0
  8. package/components/api-tables-select/index.cjs +1 -1
  9. package/components/api-tables-select/index.mjs +1 -1
  10. package/components/api-tables-select/src/ctx.d.ts +57 -57
  11. package/components/api-tables-select/src/index.vue.d.ts +46 -419
  12. package/components/button/index.cjs +1 -1
  13. package/components/button/index.mjs +12 -12
  14. package/components/button/src/ctx.d.ts +7 -2
  15. package/components/button/src/index.vue.d.ts +36 -14
  16. package/components/card-input-collection/index.cjs +1 -1
  17. package/components/card-input-collection/index.mjs +136 -141
  18. package/components/card-input-collection/src/core.vue.d.ts +18 -7
  19. package/components/card-input-collection/src/ctx.d.ts +7 -2
  20. package/components/card-input-collection/src/index.vue.d.ts +18 -7
  21. package/components/cascader/index.cjs +1 -1
  22. package/components/cascader/index.mjs +38 -39
  23. package/components/cascader/src/ctx.d.ts +8 -3
  24. package/components/cascader/src/index.vue.d.ts +19 -8
  25. package/components/checkbox/src/ctx.d.ts +8 -3
  26. package/components/checkbox/src/index.vue.d.ts +43 -21
  27. package/components/{cloneDeep-DE0l40hv.mjs → cloneDeep-2YeQ7w2t.mjs} +10 -10
  28. package/components/cloneDeep-Btpy0oPF.js +1 -0
  29. package/components/collapse/index.cjs +1 -1
  30. package/components/collapse/index.mjs +19 -22
  31. package/components/collapse-item/index.cjs +1 -1
  32. package/components/collapse-item/index.mjs +21 -21
  33. package/components/collapse-item/src/index.vue.d.ts +2 -2
  34. package/components/color-picker/index.cjs +1 -1
  35. package/components/color-picker/index.mjs +26 -27
  36. package/components/color-picker/src/ctx.d.ts +7 -2
  37. package/components/color-picker/src/index.vue.d.ts +17 -6
  38. package/components/{style.css → components.css} +1 -1
  39. package/components/date-picker/index.cjs +1 -1
  40. package/components/date-picker/index.mjs +40 -41
  41. package/components/date-picker/src/ctx.d.ts +8 -3
  42. package/components/date-picker/src/index.vue.d.ts +17 -6
  43. package/components/date-picker-range/index.cjs +1 -1
  44. package/components/date-picker-range/index.mjs +17 -17
  45. package/components/date-picker-range/src/ctx.d.ts +14 -9
  46. package/components/date-picker-range/src/index.vue.d.ts +48 -26
  47. package/components/dialog/index.cjs +1 -1
  48. package/components/dialog/index.mjs +41 -52
  49. package/components/dialog/src/ctx.d.ts +1 -1
  50. package/components/dialog/src/index.vue.d.ts +1 -1
  51. package/components/dialog-input-collection/index.cjs +1 -1
  52. package/components/dialog-input-collection/index.mjs +124 -122
  53. package/components/dialog-input-collection/src/ctx.d.ts +7 -2
  54. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -1
  55. package/components/dialog-input-collection/src/index.vue.d.ts +17 -6
  56. package/components/download-plus/index.cjs +1 -1
  57. package/components/download-plus/index.mjs +193 -202
  58. package/components/download-plus/src/ctx.d.ts +7 -2
  59. package/components/download-plus/src/index.vue.d.ts +32 -10
  60. package/components/editable-text/index.cjs +1 -1
  61. package/components/editable-text/index.mjs +72 -75
  62. package/components/editable-text/src/ctx.d.ts +7 -2
  63. package/components/editable-text/src/index.vue.d.ts +18 -7
  64. package/components/el-slider/index.cjs +1 -1
  65. package/components/el-slider/index.mjs +230 -233
  66. package/components/el-slider/src/composables/index.cjs +1 -1
  67. package/components/el-slider/src/composables/index.mjs +1 -1
  68. package/components/el-slider/src/slider-core.vue.d.ts +3 -3
  69. package/components/esri-input-geojson/index.cjs +1 -5
  70. package/components/esri-input-geojson/index.mjs +59 -68
  71. package/components/esri-input-geojson/src/append.vue.d.ts +2 -2
  72. package/components/esri-input-geojson/src/ctx.d.ts +9 -4
  73. package/components/esri-input-geojson/src/index.vue.d.ts +65 -30
  74. package/components/fieldset/src/index.vue.d.ts +1 -1
  75. package/components/form/index.cjs +1 -1
  76. package/components/form/index.mjs +96 -101
  77. package/components/form/src/ctx.d.ts +2 -2
  78. package/components/form/src/index.vue.d.ts +4 -4
  79. package/components/form/src/use.d.ts +2 -2
  80. package/components/form-item/index.cjs +1 -1
  81. package/components/form-item/index.mjs +179 -107
  82. package/components/form-item/src/core.vue.d.ts +7 -3
  83. package/components/form-item/src/ctx.d.ts +7 -1
  84. package/components/form-item/src/index.vue.d.ts +13 -2
  85. package/components/form-item/src/use.d.ts +11 -0
  86. package/components/form-item-renderer/index.cjs +1 -1
  87. package/components/form-item-renderer/index.d.ts +1 -0
  88. package/components/form-item-renderer/index.mjs +85 -78
  89. package/components/form-item-renderer/src/use.d.ts +3 -0
  90. package/components/forms-provider/index.cjs +1 -1
  91. package/components/forms-provider/index.mjs +18 -21
  92. package/components/index-BIo_4rr_.mjs +18620 -0
  93. package/components/index-Bc7UifHG.js +1 -0
  94. package/components/index-D0D9ABpH.js +108 -0
  95. package/components/{index-CeHbpfCD.mjs → index-DCNYT7Wv.mjs} +0 -1
  96. package/components/information-collection/index.cjs +1 -1
  97. package/components/information-collection/index.mjs +32 -38
  98. package/components/information-collection/src/ctx.d.ts +7 -2
  99. package/components/information-collection/src/index.vue.d.ts +17 -6
  100. package/components/information-tag/index.cjs +1 -1
  101. package/components/information-tag/index.mjs +9 -12
  102. package/components/information-tag/src/index.vue.d.ts +1 -1
  103. package/components/input/index.cjs +1 -1
  104. package/components/input/index.mjs +27 -27
  105. package/components/input/src/ctx.d.ts +9 -4
  106. package/components/input/src/index.vue.d.ts +35 -13
  107. package/components/input-array/index.cjs +1 -1
  108. package/components/input-array/index.mjs +71 -74
  109. package/components/input-array/src/ctx.d.ts +7 -2
  110. package/components/input-array/src/index.vue.d.ts +18 -7
  111. package/components/input-collection/index.cjs +1 -1
  112. package/components/input-collection/index.mjs +121 -126
  113. package/components/input-collection/src/core.vue.d.ts +17 -6
  114. package/components/input-collection/src/ctx.d.ts +7 -2
  115. package/components/input-collection/src/index.vue.d.ts +17 -6
  116. package/components/input-file/src/index.vue.d.ts +19 -8
  117. package/components/input-link/index.cjs +1 -1
  118. package/components/input-link/index.mjs +1 -1
  119. package/components/input-link/src/ctx.d.ts +7 -2
  120. package/components/input-link/src/index.vue.d.ts +54 -21
  121. package/components/input-number/index.cjs +1 -1
  122. package/components/input-number/index.mjs +30 -33
  123. package/components/input-number/src/ctx.d.ts +8 -3
  124. package/components/input-number/src/index.vue.d.ts +33 -11
  125. package/components/input-tag/index.cjs +1 -1
  126. package/components/input-tag/index.mjs +24 -24
  127. package/components/input-tag/src/ctx.d.ts +9 -4
  128. package/components/input-tag/src/index.vue.d.ts +33 -11
  129. package/components/monaco-editor/src/ctx.d.ts +8 -3
  130. package/components/monaco-editor/src/index.vue.d.ts +38 -16
  131. package/components/radio/src/ctx.d.ts +7 -2
  132. package/components/radio/src/index.vue.d.ts +40 -18
  133. package/components/radio/src/wraper.vue.d.ts +22 -11
  134. package/components/renderer-data/index.cjs +1 -1
  135. package/components/renderer-data/index.mjs +14 -17
  136. package/components/select/index.cjs +1 -1
  137. package/components/select/index.mjs +167 -131
  138. package/components/select/src/core.vue.d.ts +96 -69
  139. package/components/select/src/ctx.d.ts +9 -4
  140. package/components/select/src/index.vue.d.ts +53 -42
  141. package/components/slider/index.cjs +1 -1
  142. package/components/slider/index.mjs +30 -31
  143. package/components/slider/src/ctx.d.ts +7 -2
  144. package/components/slider/src/index.vue.d.ts +18 -7
  145. package/components/switch/src/ctx.d.ts +7 -2
  146. package/components/switch/src/index.vue.d.ts +18 -7
  147. package/components/tables-select/index.cjs +1 -1
  148. package/components/tables-select/index.mjs +4 -4
  149. package/components/tables-select/src/ctx.d.ts +68 -68
  150. package/components/tables-select/src/index.vue.d.ts +52 -420
  151. package/components/template-instances-provider/index.cjs +1 -1
  152. package/components/template-instances-provider/index.mjs +11 -17
  153. package/components/templates-default/src/index.vue.d.ts +404 -185
  154. package/components/templates-esri/src/index.vue.d.ts +65 -30
  155. package/components/templates-variant/src/index.vue.d.ts +48 -26
  156. package/components/time-picker/index.cjs +1 -1
  157. package/components/time-picker/index.mjs +38 -39
  158. package/components/time-picker/src/ctx.d.ts +8 -3
  159. package/components/time-picker/src/index.vue.d.ts +17 -6
  160. package/components/upload/index.cjs +1 -1
  161. package/components/upload/index.mjs +244 -253
  162. package/components/upload/src/ctx.d.ts +8 -3
  163. package/components/upload/src/file.vue.d.ts +3 -3
  164. package/components/upload/src/index.vue.d.ts +37 -15
  165. package/components/upload/src/wraper.vue.d.ts +19 -8
  166. package/components/upload-plus/index.cjs +7 -15
  167. package/components/upload-plus/index.mjs +1879 -1897
  168. package/components/upload-plus/src/ctx.d.ts +7 -2
  169. package/components/upload-plus/src/index.vue.d.ts +18 -7
  170. package/components/use-watch-C3iIa2DX.js +1 -0
  171. package/components/use-watch-Dp64x0si.mjs +411 -0
  172. package/components/van-cascader/src/ctx.d.ts +7 -2
  173. package/components/van-cascader/src/index.vue.d.ts +19 -8
  174. package/components/var-datetime-picker/src/ctx.d.ts +7 -2
  175. package/components/var-datetime-picker/src/index.vue.d.ts +30 -8
  176. package/components/vditor/src/ctx.d.ts +7 -2
  177. package/components/vditor/src/index.vue.d.ts +41 -19
  178. package/composables/element-plus/index.cjs +1 -1
  179. package/composables/element-plus/index.mjs +10 -10
  180. package/composables/form-mitt/index.mjs +1 -1
  181. package/composables/index.cjs +1 -1
  182. package/composables/index.mjs +53 -53
  183. package/index.css +1 -1
  184. package/locale/index.cjs +1 -1
  185. package/locale/index.mjs +8 -5
  186. package/locale/lang/ar.d.ts +1 -0
  187. package/locale/lang/en.d.ts +1 -0
  188. package/locale/lang/zh-cn.d.ts +1 -0
  189. package/package.json +9 -1
  190. package/shared/element-plus/ctx.d.ts +16 -16
  191. package/shared/types/source/index.d.ts +5 -0
  192. package/shared/upload/index.cjs +1 -1
  193. package/shared/upload/index.mjs +166 -165
  194. package/components/cloneDeep-DaYwfXwD.js +0 -1
  195. package/components/index-BBriTmQP.js +0 -1
  196. package/components/use-watch-Bfrz9pv_.js +0 -1
  197. package/components/use-watch-t49wP7jy.mjs +0 -414
@@ -1,20 +1,20 @@
1
- import { defineComponent as D, computed as S, resolveComponent as m, openBlock as p, createElementBlock as g, Fragment as F, normalizeClass as n, createBlock as E, createCommentVNode as b, createElementVNode as I, withModifiers as R, createVNode as s, withCtx as u, toDisplayString as P, createTextVNode as T, 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 _, ElButton as x, ElIcon as ee, ElProgress as oe, useNamespace as V, ElLink as le, ElUpload 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 { f as de, h as re, i as ue, j as pe, d as me, z as ce, k as fe } from "../index-CeHbpfCD.mjs";
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-CHgC5LLL.mjs";
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
- ..._,
1
+ import { defineComponent as T, computed as D, resolveComponent as d, openBlock as r, createElementBlock as w, Fragment as S, normalizeClass as l, createBlock as C, createCommentVNode as v, createElementVNode as E, withModifiers as F, createVNode as s, withCtx as i, toDisplayString as I, createTextVNode as B, normalizeStyle as N, shallowRef as M, normalizeProps as Z, guardReactiveProps as G, mergeProps as q, createSlots as A, renderSlot as H, h as J } from "vue";
2
+ import { _VkfFormItemCtx as V, VkfFormItem as K } from "@vunk/form/components/form-item";
3
+ import { bindPropsFactory as Q, onEmitsFactory as W, vOn as X } from "@vunk/core/shared/utils-vue";
4
+ import { uploadProps as Y, ElButton as _, ElIcon as x, ElProgress as ee, useNamespace as R, ElLink as oe, ElUpload as le, ElMessageBox as ne, genFileId as se } from "element-plus";
5
+ import { pickObject as te } from "@vunk/core/shared/utils-object";
6
+ import { createUploadBindProps as ae } from "@vunk/form/shared/element-plus";
7
+ import { f as ie, h as re, i as de, j as pe, d as ue, z as me, k as ce } from "../index-DCNYT7Wv.mjs";
8
+ import { RestFetch as fe } from "@vunk/core/shared/utils-fetch";
9
+ import { NOOP as ve } from "@vunk/core/shared/utils-function";
10
+ import { isCallable as ye } from "@vunk/shared/function";
11
+ import { useLocale as O } from "@vunk/form/composables/element-plus";
12
+ import { _ as j } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
13
+ import { useComputedReadonly as be } from "@vunk/form/composables";
14
+ import we from "@vunk/form/shared/progress-it";
15
+ const $ = {
16
+ ...V.props,
17
+ ...Y,
18
18
  tip: {
19
19
  type: String,
20
20
  default: ""
@@ -54,29 +54,29 @@ const L = {
54
54
  * @description 同 el-upload 的 slots
55
55
  */
56
56
  slots: null
57
- }, ge = W(L), B = {
57
+ }, ke = Q($), L = {
58
58
  "update:fileList": null,
59
59
  remove: (e) => e
60
- }, N = X(B), Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
60
+ }, z = W(L), qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
61
  __proto__: null,
62
- createBindProps: ge,
63
- createOnEmits: N,
64
- emits: B,
65
- props: L
66
- }, Symbol.toStringTag, { value: "Module" })), Ue = new ve({
62
+ createBindProps: ke,
63
+ createOnEmits: z,
64
+ emits: L,
65
+ props: $
66
+ }, Symbol.toStringTag, { value: "Module" })), ge = new fe({
67
67
  baseURL: ""
68
- }), he = D({
68
+ }), Ue = T({
69
69
  components: {
70
- ElProgress: oe,
71
- ElIcon: ee,
72
- Check: fe,
73
- ZoomIn: ce,
74
- Delete: me,
70
+ ElProgress: ee,
71
+ ElIcon: x,
72
+ Check: ce,
73
+ ZoomIn: me,
74
+ Delete: ue,
75
75
  Close: pe,
76
- CircleCheck: ue,
76
+ CircleCheck: de,
77
77
  Document: re,
78
- Download: de,
79
- ElButton: x
78
+ Download: ie,
79
+ ElButton: _
80
80
  },
81
81
  props: {
82
82
  listType: {
@@ -93,7 +93,7 @@ const L = {
93
93
  },
94
94
  onPreview: {
95
95
  type: Function,
96
- default: () => ye
96
+ default: () => ve
97
97
  },
98
98
  onDownload: {
99
99
  type: Function,
@@ -112,351 +112,342 @@ const L = {
112
112
  remove: (e) => e
113
113
  },
114
114
  setup(e, { emit: o }) {
115
- const U = V("upload"), c = V("icon"), { tr: h } = j(), v = (a = e.file) => {
116
- o("remove", a);
117
- }, w = (a = e.file) => {
115
+ const k = R("upload"), p = R("icon"), { tr: U } = O(), u = (t = e.file) => {
116
+ o("remove", t);
117
+ }, y = (t = e.file) => {
118
118
  if (e.onDownload) {
119
- e.onDownload(a);
119
+ e.onDownload(t);
120
120
  return;
121
121
  }
122
- let l = "";
123
- a.url ? l = a.url : a.raw && (l = window.URL.createObjectURL(a.raw)), l && Ue.download({
124
- url: l,
125
- fileName: a.name
122
+ let n = "";
123
+ t.url ? n = t.url : t.raw && (n = window.URL.createObjectURL(t.raw)), n && ge.download({
124
+ url: n,
125
+ fileName: t.name
126
126
  }, {
127
127
  method: "GET"
128
128
  });
129
- }, r = S(() => be(e.preview) ? e.preview(e.file) : e.preview), k = S(() => e.previewLabel || h("el.upload.preview", "预览"));
129
+ }, a = D(() => ye(e.preview) ? e.preview(e.file) : e.preview), b = D(() => e.previewLabel || U("el.upload.preview", "预览"));
130
130
  return {
131
- handleRemove: v,
132
- nsIcon: c,
133
- nsUpload: U,
134
- handleDownload: w,
135
- handlePreview: (a = e.file) => {
136
- r.value && e.onPreview(a);
131
+ handleRemove: u,
132
+ nsIcon: p,
133
+ nsUpload: k,
134
+ handleDownload: y,
135
+ handlePreview: (t = e.file) => {
136
+ a.value && e.onPreview(t);
137
137
  },
138
- previewText: k,
139
- previewable: r,
140
- tr: h
138
+ previewText: b,
139
+ previewable: a,
140
+ tr: U
141
141
  };
142
142
  }
143
- }), Ce = ["src"];
144
- function Ee(e, o, U, c, h, v) {
145
- const w = m("Document"), r = m("ElIcon"), k = m("Download"), C = m("ElButton"), a = m("ElProgress"), l = m("CircleCheck"), i = m("Check"), d = m("Close"), f = m("ZoomIn"), y = m("Delete");
146
- return p(), g(F, null, [
147
- e.listType === "picture" || e.file.status !== "uploading" && e.listType === "picture-card" ? (p(), g(F, { key: 0 }, [
148
- /\.(svg|png|jpg|jpeg)$/.test(e.file.name) ? (p(), g("img", {
143
+ }), he = ["src"];
144
+ function Ce(e, o, k, p, U, u) {
145
+ const y = d("Document"), a = d("ElIcon"), b = d("Download"), h = d("ElButton"), t = d("ElProgress"), n = d("CircleCheck"), m = d("Check"), c = d("Close"), g = d("ZoomIn"), P = d("Delete");
146
+ return r(), w(S, null, [
147
+ e.listType === "picture" || e.file.status !== "uploading" && e.listType === "picture-card" ? (r(), w(S, { key: 0 }, [
148
+ /\.(svg|png|jpg|jpeg)$/.test(e.file.name) ? (r(), w("img", {
149
149
  key: 0,
150
- class: n(e.nsUpload.be("list", "item-thumbnail")),
150
+ class: l(e.nsUpload.be("list", "item-thumbnail")),
151
151
  src: e.file.url,
152
152
  alt: ""
153
- }, null, 10, Ce)) : (p(), E(w, {
153
+ }, null, 10, he)) : (r(), C(y, {
154
154
  key: 1,
155
- class: n([
155
+ class: l([
156
156
  e.nsUpload.be("list", "item-thumbnail"),
157
157
  e.nsIcon.m("document")
158
158
  ])
159
159
  }, null, 8, ["class"]))
160
- ], 64)) : b("", !0),
161
- e.listType !== "picture-card" || e.file.status === "uploading" ? (p(), g("div", {
160
+ ], 64)) : v("", !0),
161
+ e.listType !== "picture-card" || e.file.status === "uploading" ? (r(), w("div", {
162
162
  key: 1,
163
- class: n(e.nsUpload.be("list", "item-info"))
163
+ class: l(e.nsUpload.be("list", "item-info"))
164
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"]))
165
+ E("a", {
166
+ class: l(e.nsUpload.be("list", "item-name")),
167
+ onClick: o[1] || (o[1] = F((f) => e.handlePreview(e.file), ["prevent"]))
168
168
  }, [
169
- s(r, {
170
- class: n(e.nsIcon.m("document"))
169
+ s(a, {
170
+ class: l(e.nsIcon.m("document"))
171
171
  }, {
172
- default: u(() => [
173
- s(w)
172
+ default: i(() => [
173
+ s(y)
174
174
  ]),
175
175
  _: 1
176
176
  }, 8, ["class"]),
177
- s(r, {
178
- class: n([
177
+ s(a, {
178
+ class: l([
179
179
  e.nsIcon.m("download"),
180
180
  e.nsIcon.m("download-primary")
181
181
  ]),
182
- onClick: o[0] || (o[0] = R((t) => e.handleDownload(e.file), ["stop"]))
182
+ onClick: o[0] || (o[0] = F((f) => e.handleDownload(e.file), ["stop"]))
183
183
  }, {
184
- default: u(() => [
185
- s(k)
184
+ default: i(() => [
185
+ s(b)
186
186
  ]),
187
187
  _: 1
188
188
  }, 8, ["class"]),
189
- I("span", {
190
- class: n(e.nsUpload.be("list", "item-file-name"))
191
- }, P(e.file.name), 3)
189
+ E("span", {
190
+ class: l(e.nsUpload.be("list", "item-file-name"))
191
+ }, I(e.file.name), 3)
192
192
  ], 2),
193
- e.listType === "picture" ? (p(), g("div", {
193
+ e.listType === "picture" ? (r(), w("div", {
194
194
  key: 0,
195
- class: n(e.nsUpload.be("list", "item-file-actions"))
195
+ class: l(e.nsUpload.be("list", "item-file-actions"))
196
196
  }, [
197
- s(C, {
197
+ s(h, {
198
198
  disabled: !e.previewable,
199
- class: n(e.nsUpload.be("list", "item-file-action-preview")),
199
+ class: l(e.nsUpload.be("list", "item-file-action-preview")),
200
200
  plain: "",
201
201
  size: "small",
202
202
  round: "",
203
- onClick: o[2] || (o[2] = (t) => e.handlePreview(e.file))
203
+ onClick: o[2] || (o[2] = (f) => e.handlePreview(e.file))
204
204
  }, {
205
- default: u(() => [
206
- T(P(e.previewText), 1)
205
+ default: i(() => [
206
+ B(I(e.previewText), 1)
207
207
  ]),
208
208
  _: 1
209
209
  }, 8, ["disabled", "class"]),
210
- s(C, {
210
+ s(h, {
211
211
  plain: "",
212
212
  size: "small",
213
213
  round: "",
214
214
  type: "primary",
215
- onClick: o[3] || (o[3] = (t) => e.handleDownload(e.file))
215
+ onClick: o[3] || (o[3] = (f) => e.handleDownload(e.file))
216
216
  }, {
217
- default: u(() => [
218
- T(P(e.tr("vkf.common.download", "下载")), 1)
217
+ default: i(() => [
218
+ B(I(e.tr("vkf.common.download", "下载")), 1)
219
219
  ]),
220
220
  _: 1
221
221
  })
222
- ], 2)) : b("", !0),
223
- e.file.status === "uploading" ? (p(), E(a, {
222
+ ], 2)) : v("", !0),
223
+ e.file.status === "uploading" ? (r(), C(t, {
224
224
  key: 1,
225
225
  type: e.listType === "picture-card" ? "circle" : "line",
226
226
  "stroke-width": e.listType === "picture-card" ? 6 : 2,
227
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"))
228
+ style: N(e.listType === "picture-card" ? "" : "margin-top: 0.5rem")
229
+ }, null, 8, ["type", "stroke-width", "percentage", "style"])) : v("", !0)
230
+ ], 2)) : v("", !0),
231
+ E("label", {
232
+ class: l(e.nsUpload.be("list", "item-status-label"))
233
233
  }, [
234
- e.listType === "text" ? (p(), E(r, {
234
+ e.listType === "text" ? (r(), C(a, {
235
235
  key: 0,
236
- class: n([
236
+ class: l([
237
237
  e.nsIcon.m("upload-success"),
238
238
  e.nsIcon.m("circle-check")
239
239
  ])
240
240
  }, {
241
- default: u(() => [
242
- s(l)
241
+ default: i(() => [
242
+ s(n)
243
243
  ]),
244
244
  _: 1
245
- }, 8, ["class"])) : ["picture-card", "picture"].includes(e.listType) ? (p(), E(r, {
245
+ }, 8, ["class"])) : ["picture-card", "picture"].includes(e.listType) ? (r(), C(a, {
246
246
  key: 1,
247
- class: n([e.nsIcon.m("upload-success"), e.nsIcon.m("check")])
247
+ class: l([e.nsIcon.m("upload-success"), e.nsIcon.m("check")])
248
248
  }, {
249
- default: u(() => [
250
- s(i)
249
+ default: i(() => [
250
+ s(m)
251
251
  ]),
252
252
  _: 1
253
- }, 8, ["class"])) : b("", !0)
253
+ }, 8, ["class"])) : v("", !0)
254
254
  ], 2),
255
- e.disabled ? b("", !0) : (p(), E(r, {
255
+ e.disabled ? v("", !0) : (r(), C(a, {
256
256
  key: 2,
257
- class: n(e.nsIcon.m("close")),
258
- onClick: o[4] || (o[4] = (t) => e.handleRemove(e.file))
257
+ class: l(e.nsIcon.m("close")),
258
+ onClick: o[4] || (o[4] = (f) => e.handleRemove(e.file))
259
259
  }, {
260
- default: u(() => [
261
- s(d)
260
+ default: i(() => [
261
+ s(c)
262
262
  ]),
263
263
  _: 1
264
264
  }, 8, ["class"])),
265
- e.listType === "picture-card" ? (p(), g("span", {
265
+ e.listType === "picture-card" ? (r(), w("span", {
266
266
  key: 3,
267
- class: n(e.nsUpload.be("list", "item-actions"))
267
+ class: l(e.nsUpload.be("list", "item-actions"))
268
268
  }, [
269
- e.previewable ? (p(), g("span", {
269
+ e.previewable ? (r(), w("span", {
270
270
  key: 0,
271
- class: n(e.nsUpload.be("list", "item-preview")),
272
- onClick: o[5] || (o[5] = (t) => e.handlePreview(e.file))
271
+ class: l(e.nsUpload.be("list", "item-preview")),
272
+ onClick: o[5] || (o[5] = (f) => e.handlePreview(e.file))
273
273
  }, [
274
- s(r, {
275
- class: n(e.nsIcon.m("zoom-in"))
274
+ s(a, {
275
+ class: l(e.nsIcon.m("zoom-in"))
276
276
  }, {
277
- default: u(() => [
278
- s(f)
277
+ default: i(() => [
278
+ s(g)
279
279
  ]),
280
280
  _: 1
281
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))
282
+ ], 2)) : v("", !0),
283
+ E("span", {
284
+ class: l(e.nsUpload.be("list", "item-download")),
285
+ onClick: o[6] || (o[6] = (f) => e.handleDownload(e.file))
286
286
  }, [
287
- s(r, {
288
- class: n(e.nsIcon.m("download"))
287
+ s(a, {
288
+ class: l(e.nsIcon.m("download"))
289
289
  }, {
290
- default: u(() => [
291
- s(k)
290
+ default: i(() => [
291
+ s(b)
292
292
  ]),
293
293
  _: 1
294
294
  }, 8, ["class"])
295
295
  ], 2),
296
- e.disabled ? b("", !0) : (p(), g("span", {
296
+ e.disabled ? v("", !0) : (r(), w("span", {
297
297
  key: 1,
298
- class: n(e.nsUpload.be("list", "item-delete")),
299
- onClick: o[7] || (o[7] = (t) => e.handleRemove(e.file))
298
+ class: l(e.nsUpload.be("list", "item-delete")),
299
+ onClick: o[7] || (o[7] = (f) => e.handleRemove(e.file))
300
300
  }, [
301
- s(r, {
302
- class: n(e.nsIcon.m("delete"))
301
+ s(a, {
302
+ class: l(e.nsIcon.m("delete"))
303
303
  }, {
304
- default: u(() => [
305
- s(y)
304
+ default: i(() => [
305
+ s(P)
306
306
  ]),
307
307
  _: 1
308
308
  }, 8, ["class"])
309
309
  ], 2))
310
- ], 2)) : b("", !0)
310
+ ], 2)) : v("", !0)
311
311
  ], 64);
312
312
  }
313
- const Ie = /* @__PURE__ */ z(he, [["render", Ee]]), Pe = D({
313
+ const Ee = /* @__PURE__ */ j(Ue, [["render", Ce]]), Ie = T({
314
314
  components: {
315
- VkfFormItem: Q,
316
- ElUpload: ne,
317
- FileVue: Ie,
318
- ElLink: le
315
+ VkfFormItem: K,
316
+ ElUpload: le,
317
+ FileVue: Ee,
318
+ ElLink: oe
319
319
  },
320
- props: L,
321
- emits: B,
320
+ props: $,
321
+ emits: L,
322
322
  setup(e, { emit: o }) {
323
- const U = O.createBindProps(e), { tr: c } = j(), h = 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) => {
323
+ const k = V.createBindProps(e), { tr: p } = O(), U = ae(e, ["disabled", "fileList", "beforeUpload", "onSuccess"]), u = M(), y = (n) => {
324
+ u.value?.handleRemove(n), u.value?.abort(n), o("update:fileList", e.fileList);
325
+ }, a = (n, m) => {
327
326
  if (e.onExceed) {
328
- e.onExceed(l, i);
327
+ e.onExceed(n, m);
329
328
  return;
330
329
  }
331
330
  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();
331
+ const c = () => {
332
+ u.value?.clearFiles(), n.forEach((g) => {
333
+ g.uid = se(), u.value?.handleStart(g);
334
+ }), u.value?.submit();
338
335
  };
339
- e.confirmExceed ? se.confirm(
340
- c("vkf.upload.exceedConfirm", "已超过最大上传数量限制,是否使用新文件重新上传?"),
341
- c("el.messagebox.title", "提示"),
336
+ e.confirmExceed ? ne.confirm(
337
+ p("vkf.upload.exceedConfirm", "已超过最大上传数量限制,是否使用新文件重新上传?"),
338
+ p("el.messagebox.title", "提示"),
342
339
  {
343
- confirmButtonText: c("el.upload.continue", "继续"),
344
- cancelButtonText: c("el.messagebox.cancel", "取消"),
340
+ confirmButtonText: p("el.upload.continue", "继续"),
341
+ cancelButtonText: p("el.messagebox.cancel", "取消"),
345
342
  type: "warning"
346
343
  }
347
- ).then(d) : d();
344
+ ).then(c) : c();
348
345
  }
349
- }, k = we(e);
346
+ }, b = be(e);
350
347
  return {
351
- formItemBindProps: U,
352
- pickObject: ae,
353
- coreBindProps: h,
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);
348
+ formItemBindProps: k,
349
+ pickObject: te,
350
+ coreBindProps: U,
351
+ uploadRef: u,
352
+ handleRemove: y,
353
+ readonly: b,
354
+ onSuccess: (n, m, c) => {
355
+ m.raw.progress?.(!0), m.percentage = 100, m.status = "success", e.onSuccess?.(n, m, c);
361
356
  },
362
357
  // onProgress,
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"));
358
+ beforeUpload: async (n) => {
359
+ const m = (c, g) => {
360
+ const P = e.fileList.find((f) => f.uid === n.uid);
361
+ P && (P.percentage = Number((c * 100).toFixed(2)), g === !1 && (P.status = "uploading"));
368
362
  };
369
- return l.progress = ke(i)(!1), e.beforeUpload ? await ((d = e.beforeUpload) == null ? void 0 : d.call(e, l)) : !0;
363
+ return n.progress = we(m)(!1), e.beforeUpload ? await e.beforeUpload?.(n) : !0;
370
364
  },
371
- handleExceed: r,
372
- tr: c
365
+ handleExceed: a,
366
+ tr: p
373
367
  };
374
368
  }
375
- }), $e = { class: "el-upload__tip" };
376
- function Le(e, o, U, c, h, v) {
377
- const w = m("ElLink"), r = m("FileVue"), k = m("ElUpload"), C = m("VkfFormItem");
378
- return p(), E(C, G(q(e.formItemBindProps)), {
379
- default: u(() => {
380
- var a, l, i;
381
- return [
382
- s(k, A(e.coreBindProps, {
383
- ref: "uploadRef",
384
- class: ["vkf-upload", {
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
389
- }],
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
407
- }, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "preview-label", "onRemove"])
408
- ]),
409
- default: u(() => [
410
- J(e.$slots, "default", {}, () => [
411
- s(w, { type: "primary" }, {
412
- default: u(() => [
413
- T(" + " + P(e.tr("vkf.upload.selectFile", "选择文件")), 1)
414
- ]),
415
- _: 1
416
- })
417
- ])
369
+ }), Pe = { class: "el-upload__tip" };
370
+ function $e(e, o, k, p, U, u) {
371
+ const y = d("ElLink"), a = d("FileVue"), b = d("ElUpload"), h = d("VkfFormItem");
372
+ return r(), C(h, Z(G(e.formItemBindProps)), {
373
+ default: i(() => [
374
+ s(b, q(e.coreBindProps, {
375
+ ref: "uploadRef",
376
+ class: ["vkf-upload", {
377
+ "is-readonly": e.readonly,
378
+ "is-empty": e.fileList?.length === 0,
379
+ "is-limit": e.limit && e.fileList?.length >= e.limit,
380
+ "is-exceedable": e.exceedable
381
+ }],
382
+ "file-list": e.fileList ?? [],
383
+ "on-success": e.onSuccess,
384
+ "before-upload": e.beforeUpload,
385
+ disabled: e.readonly || e.disabled,
386
+ "on-exceed": e.handleExceed,
387
+ "onUpdate:fileList": o[0] || (o[0] = (t) => e.$emit("update:fileList", t))
388
+ }), A({
389
+ file: i(({ file: t }) => [
390
+ s(a, {
391
+ file: t,
392
+ "list-type": e.listType,
393
+ disabled: e.readonly || e.disabled,
394
+ "on-preview": e.onPreview,
395
+ preview: e.preview,
396
+ "on-download": e.onDownload,
397
+ "preview-label": e.previewLabel,
398
+ onRemove: e.handleRemove
399
+ }, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "preview-label", "onRemove"])
400
+ ]),
401
+ default: i(() => [
402
+ H(e.$slots, "default", {}, () => [
403
+ s(y, { type: "primary" }, {
404
+ default: i(() => [
405
+ B(" + " + I(e.tr("vkf.upload.selectFile", "选择文件")), 1)
406
+ ]),
407
+ _: 1
408
+ })
409
+ ])
410
+ ]),
411
+ _: 2
412
+ }, [
413
+ e.tip ? {
414
+ name: "tip",
415
+ fn: i(() => [
416
+ E("div", Pe, I(e.tip), 1)
418
417
  ]),
419
- _: 2
420
- }, [
421
- e.tip ? {
422
- name: "tip",
423
- fn: u(() => [
424
- I("div", $e, P(e.tip), 1)
425
- ]),
426
- key: "0"
427
- } : void 0
428
- ]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled", "on-exceed"]),
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
- }),
418
+ key: "0"
419
+ } : void 0
420
+ ]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled", "on-exceed"]),
421
+ E("span", {
422
+ class: l(["vkf-upload-empty-tip", {
423
+ "is-readonly": e.readonly,
424
+ "is-empty": e.fileList?.length === 0
425
+ }])
426
+ }, I(e.tr("vkf.upload.empty", "暂无")), 3)
427
+ ]),
437
428
  _: 3
438
429
  }, 16);
439
430
  }
440
- const Be = /* @__PURE__ */ z(Pe, [["render", Le]]), He = D({
431
+ const Le = /* @__PURE__ */ j(Ie, [["render", $e]]), Ae = T({
441
432
  name: "VkfUpload",
442
- props: L,
443
- emits: B,
444
- setup(e, { emit: o, slots: U }) {
445
- const c = N(o);
446
- return () => K(Be, {
433
+ props: $,
434
+ emits: L,
435
+ setup(e, { emit: o, slots: k }) {
436
+ const p = z(o);
437
+ return () => J(Le, {
447
438
  ...e,
448
- ...Y(c)
439
+ ...X(p)
449
440
  }, {
450
441
  ...e.slots,
451
- ...U
442
+ ...k
452
443
  });
453
444
  }
454
- }), Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
445
+ }), He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
455
446
  __proto__: null
456
447
  }, Symbol.toStringTag, { value: "Module" }));
457
448
  export {
458
- He as VkfUpload,
459
- Ae as _VkfUploadCtx,
460
- Je as __VkfUpload,
461
- He as default
449
+ Ae as VkfUpload,
450
+ qe as _VkfUploadCtx,
451
+ He as __VkfUpload,
452
+ Ae as default
462
453
  };