@vunk/form 2.14.18 → 2.14.19

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 (54) hide show
  1. package/components/button/src/ctx.d.ts +8 -1
  2. package/components/button/src/index.vue.d.ts +43 -8
  3. package/components/card-input-collection/src/core.vue.d.ts +30 -9
  4. package/components/cascader/src/ctx.d.ts +63 -6
  5. package/components/cascader/src/index.vue.d.ts +155 -10
  6. package/components/color-picker/src/ctx.d.ts +14 -0
  7. package/components/color-picker/src/index.vue.d.ts +29 -0
  8. package/components/date-picker/src/ctx.d.ts +46 -4
  9. package/components/date-picker/src/index.vue.d.ts +266 -27
  10. package/components/date-picker-range/src/ctx.d.ts +48 -6
  11. package/components/date-picker-range/src/index.vue.d.ts +98 -13
  12. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +4696 -48
  13. package/components/dialog-input-collection/src/index.vue.d.ts +4723 -54
  14. package/components/download-plus/src/index.vue.d.ts +45 -6
  15. package/components/esri-input-geojson/src/append.vue.d.ts +27 -6
  16. package/components/esri-input-geojson/src/ctx.d.ts +7 -1
  17. package/components/esri-input-geojson/src/index.vue.d.ts +13 -0
  18. package/components/fieldset/index.cjs +1 -17
  19. package/components/fieldset/index.mjs +1 -17
  20. package/components/form/src/ctx.d.ts +1 -1
  21. package/components/form/src/index.vue.d.ts +2867 -22
  22. package/components/form-item/src/core.vue.d.ts +27 -6
  23. package/components/input/src/ctx.d.ts +7 -1
  24. package/components/input/src/index.vue.d.ts +31 -0
  25. package/components/input-array/src/form-template.vue.d.ts +27 -6
  26. package/components/input-array/src/index.vue.d.ts +27 -6
  27. package/components/input-collection/src/core.vue.d.ts +27 -6
  28. package/components/input-link/src/ctx.d.ts +6 -0
  29. package/components/input-link/src/index.vue.d.ts +12 -0
  30. package/components/input-number/src/ctx.d.ts +10 -1
  31. package/components/input-number/src/index.vue.d.ts +55 -0
  32. package/components/input-tag/src/ctx.d.ts +17 -1
  33. package/components/input-tag/src/index.vue.d.ts +103 -3
  34. package/components/select/src/core.vue.d.ts +2 -2
  35. package/components/select/src/ctx.d.ts +1 -1
  36. package/components/select/src/index.vue.d.ts +1 -1
  37. package/components/tables-select/src/index.vue.d.ts +108 -12
  38. package/components/upload/index.cjs +93 -35
  39. package/components/upload/index.css +3 -0
  40. package/components/upload/index.mjs +95 -37
  41. package/components/upload/src/ctx.d.ts +1 -4
  42. package/components/upload/src/file.vue.d.ts +427 -6
  43. package/components/upload/src/index.vue.d.ts +427 -12
  44. package/components/upload-plus/src/index.vue.d.ts +45 -6
  45. package/components/van-cascader/index.cjs +40 -43
  46. package/components/van-cascader/index.mjs +41 -44
  47. package/components/van-cascader/src/ctx.d.ts +62 -5
  48. package/components/van-cascader/src/index.vue.d.ts +825 -1681
  49. package/components/var-datetime-picker/src/index.vue.d.ts +159 -25
  50. package/index.css +3 -0
  51. package/package.json +1 -1
  52. package/shared/element-plus/ctx.d.ts +7 -7
  53. package/shared/element-plus/instances.d.ts +45 -3
  54. package/shared/progress-it/index.cjs +3 -1
@@ -1,12 +1,13 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
2
  import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
3
- import { uploadProps, ElProgress, ElIcon, useNamespace, useLocale, ElUpload, ElLink, ElMessageBox, genFileId } 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';
3
+ import { uploadProps, ElProgress, ElIcon, ElButton, useNamespace, useLocale, ElUpload, ElLink, ElMessageBox, genFileId } from 'element-plus';
4
+ import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, normalizeClass, createBlock, createElementVNode, withModifiers, createVNode, withCtx, toDisplayString, createTextVNode, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot } from 'vue';
5
5
  import { pickObject } from '@vunk/core/shared/utils-object';
6
6
  import { createUploadBindProps } from '@vunk/form/shared/element-plus';
7
7
  import { h as check_default, z as zoom_in_default, d as delete_default, i as close_default, j as circle_check_default, k as document_default, a as download_default } from '../index.mjs';
8
- import { NOOP } from '@vunk/core/shared/utils-function';
9
8
  import { RestFetch } from '@vunk/core/shared/utils-fetch';
9
+ import { NOOP } from '@vunk/core/shared/utils-function';
10
+ import { isCallable } from '@vunk/shared/function';
10
11
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
11
12
  import { useComputedReadonly } from '@vunk/form/composables';
12
13
  import progress from '@vunk/form/shared/progress-it';
@@ -18,10 +19,7 @@ const props = {
18
19
  type: String,
19
20
  default: ""
20
21
  },
21
- preview: {
22
- type: Boolean,
23
- default: false
24
- },
22
+ preview: null,
25
23
  beforeUpload: {
26
24
  type: Function,
27
25
  default: void 0
@@ -77,7 +75,8 @@ var _sfc_main$1 = defineComponent({
77
75
  Close: close_default,
78
76
  CircleCheck: circle_check_default,
79
77
  Document: document_default,
80
- Download: download_default
78
+ Download: download_default,
79
+ ElButton
81
80
  },
82
81
  props: {
83
82
  listType: {
@@ -101,12 +100,12 @@ var _sfc_main$1 = defineComponent({
101
100
  default: void 0
102
101
  },
103
102
  preview: {
104
- type: Boolean,
103
+ type: [Boolean, Function],
105
104
  default: false
106
105
  }
107
106
  },
108
107
  emits: {
109
- "remove": (e) => e
108
+ remove: (e) => e
110
109
  },
111
110
  setup(props, { emit }) {
112
111
  const nsUpload = useNamespace("upload");
@@ -133,12 +132,23 @@ var _sfc_main$1 = defineComponent({
133
132
  method: "GET"
134
133
  });
135
134
  };
135
+ const previewable = computed(() => {
136
+ if (isCallable(props.preview)) {
137
+ return props.preview(props.file);
138
+ }
139
+ return props.preview;
140
+ });
141
+ const handlePreview = (file = props.file) => {
142
+ previewable.value && props.onPreview(file);
143
+ };
136
144
  return {
137
145
  handleRemove,
138
146
  t,
139
147
  nsIcon,
140
148
  nsUpload,
141
- handleDownload
149
+ handleDownload,
150
+ handlePreview,
151
+ previewable
142
152
  };
143
153
  }
144
154
  });
@@ -146,13 +156,14 @@ var _sfc_main$1 = defineComponent({
146
156
  const _hoisted_1$1 = ["src"];
147
157
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
148
158
  const _component_Document = resolveComponent("Document");
149
- const _component_el_icon = resolveComponent("el-icon");
159
+ const _component_ElIcon = resolveComponent("ElIcon");
150
160
  const _component_Download = resolveComponent("Download");
151
- const _component_el_progress = resolveComponent("el-progress");
152
- const _component_circle_check = resolveComponent("circle-check");
161
+ const _component_ElButton = resolveComponent("ElButton");
162
+ const _component_ElProgress = resolveComponent("ElProgress");
163
+ const _component_CircleCheck = resolveComponent("CircleCheck");
153
164
  const _component_Check = resolveComponent("Check");
154
165
  const _component_Close = resolveComponent("Close");
155
- const _component_zoom_in = resolveComponent("zoom-in");
166
+ const _component_ZoomIn = resolveComponent("ZoomIn");
156
167
  const _component_Delete = resolveComponent("Delete");
157
168
  return openBlock(), createElementBlock(
158
169
  Fragment,
@@ -168,13 +179,19 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
168
179
  class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
169
180
  src: _ctx.file.url,
170
181
  alt: ""
171
- }, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, { key: 1 }))
182
+ }, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, {
183
+ key: 1,
184
+ class: normalizeClass([
185
+ _ctx.nsUpload.be("list", "item-thumbnail"),
186
+ _ctx.nsIcon.m("document")
187
+ ])
188
+ }, null, 8, ["class"]))
172
189
  ],
173
190
  64
174
191
  /* STABLE_FRAGMENT */
175
192
  )) : createCommentVNode("v-if", true),
176
193
  createCommentVNode(" text "),
177
- _ctx.listType !== "picture" && (_ctx.file.status === "uploading" || _ctx.listType !== "picture-card") ? (openBlock(), createElementBlock(
194
+ _ctx.listType !== "picture-card" || _ctx.file.status === "uploading" ? (openBlock(), createElementBlock(
178
195
  "div",
179
196
  {
180
197
  key: 1,
@@ -185,10 +202,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
185
202
  "a",
186
203
  {
187
204
  class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
188
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.onPreview(_ctx.file), ["prevent"]))
205
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.handlePreview(_ctx.file), ["prevent"]))
189
206
  },
190
207
  [
191
- createVNode(_component_el_icon, {
208
+ createVNode(_component_ElIcon, {
192
209
  class: normalizeClass(_ctx.nsIcon.m("document"))
193
210
  }, {
194
211
  default: withCtx(() => [
@@ -197,12 +214,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
197
214
  _: 1
198
215
  /* STABLE */
199
216
  }, 8, ["class"]),
200
- createVNode(_component_el_icon, {
217
+ createVNode(_component_ElIcon, {
201
218
  class: normalizeClass([
202
219
  _ctx.nsIcon.m("download"),
203
220
  _ctx.nsIcon.m("download-primary")
204
221
  ]),
205
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleDownload(_ctx.file))
222
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.handleDownload(_ctx.file), ["stop"]))
206
223
  }, {
207
224
  default: withCtx(() => [
208
225
  createVNode(_component_Download)
@@ -223,8 +240,47 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
223
240
  2
224
241
  /* CLASS */
225
242
  ),
226
- _ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
227
- key: 0,
243
+ _ctx.listType === "picture" ? (openBlock(), createElementBlock(
244
+ "div",
245
+ {
246
+ key: 0,
247
+ class: normalizeClass(_ctx.nsUpload.be("list", "item-file-actions"))
248
+ },
249
+ [
250
+ createCommentVNode(" \u9884\u89C8 "),
251
+ _ctx.previewable ? (openBlock(), createBlock(_component_ElButton, {
252
+ key: 0,
253
+ plain: "",
254
+ size: "small",
255
+ round: "",
256
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handlePreview(_ctx.file))
257
+ }, {
258
+ default: withCtx(() => _cache[8] || (_cache[8] = [
259
+ createTextVNode(" \u9884\u89C8 ")
260
+ ])),
261
+ _: 1,
262
+ __: [8]
263
+ })) : createCommentVNode("v-if", true),
264
+ createCommentVNode(" \u4E0B\u8F7D "),
265
+ createVNode(_component_ElButton, {
266
+ plain: "",
267
+ size: "small",
268
+ round: "",
269
+ type: "primary",
270
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
271
+ }, {
272
+ default: withCtx(() => _cache[9] || (_cache[9] = [
273
+ createTextVNode(" \u4E0B\u8F7D ")
274
+ ])),
275
+ _: 1,
276
+ __: [9]
277
+ })
278
+ ],
279
+ 2
280
+ /* CLASS */
281
+ )) : createCommentVNode("v-if", true),
282
+ _ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_ElProgress, {
283
+ key: 1,
228
284
  type: _ctx.listType === "picture-card" ? "circle" : "line",
229
285
  "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
230
286
  percentage: Number(_ctx.file.percentage),
@@ -234,13 +290,14 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
234
290
  2
235
291
  /* CLASS */
236
292
  )) : createCommentVNode("v-if", true),
293
+ createCommentVNode(" label "),
237
294
  createElementVNode(
238
295
  "label",
239
296
  {
240
297
  class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
241
298
  },
242
299
  [
243
- _ctx.listType === "text" ? (openBlock(), createBlock(_component_el_icon, {
300
+ _ctx.listType === "text" ? (openBlock(), createBlock(_component_ElIcon, {
244
301
  key: 0,
245
302
  class: normalizeClass([
246
303
  _ctx.nsIcon.m("upload-success"),
@@ -248,11 +305,11 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
248
305
  ])
249
306
  }, {
250
307
  default: withCtx(() => [
251
- createVNode(_component_circle_check)
308
+ createVNode(_component_CircleCheck)
252
309
  ]),
253
310
  _: 1
254
311
  /* STABLE */
255
- }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_el_icon, {
312
+ }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_ElIcon, {
256
313
  key: 1,
257
314
  class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
258
315
  }, {
@@ -266,10 +323,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
266
323
  2
267
324
  /* CLASS */
268
325
  ),
269
- !_ctx.disabled ? (openBlock(), createBlock(_component_el_icon, {
326
+ !_ctx.disabled ? (openBlock(), createBlock(_component_ElIcon, {
270
327
  key: 2,
271
328
  class: normalizeClass(_ctx.nsIcon.m("close")),
272
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handleRemove(_ctx.file))
329
+ onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleRemove(_ctx.file))
273
330
  }, {
274
331
  default: withCtx(() => [
275
332
  createVNode(_component_Close)
@@ -277,7 +334,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
277
334
  _: 1
278
335
  /* STABLE */
279
336
  }, 8, ["class"])) : createCommentVNode("v-if", true),
280
- createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
337
+ createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn "),
281
338
  createCommentVNode(" This is a bug which needs to be fixed "),
282
339
  createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
283
340
  createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{
@@ -291,19 +348,20 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
291
348
  class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
292
349
  },
293
350
  [
294
- _ctx.preview ? (openBlock(), createElementBlock(
351
+ createCommentVNode(" \u9884\u89C8 "),
352
+ _ctx.previewable ? (openBlock(), createElementBlock(
295
353
  "span",
296
354
  {
297
355
  key: 0,
298
356
  class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
299
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.onPreview(_ctx.file))
357
+ onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handlePreview(_ctx.file))
300
358
  },
301
359
  [
302
- createVNode(_component_el_icon, {
360
+ createVNode(_component_ElIcon, {
303
361
  class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
304
362
  }, {
305
363
  default: withCtx(() => [
306
- createVNode(_component_zoom_in)
364
+ createVNode(_component_ZoomIn)
307
365
  ]),
308
366
  _: 1
309
367
  /* STABLE */
@@ -317,10 +375,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
317
375
  "span",
318
376
  {
319
377
  class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
320
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleDownload(_ctx.file))
378
+ onClick: _cache[6] || (_cache[6] = ($event) => _ctx.handleDownload(_ctx.file))
321
379
  },
322
380
  [
323
- createVNode(_component_el_icon, {
381
+ createVNode(_component_ElIcon, {
324
382
  class: normalizeClass(_ctx.nsIcon.m("download"))
325
383
  }, {
326
384
  default: withCtx(() => [
@@ -338,10 +396,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
338
396
  {
339
397
  key: 1,
340
398
  class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
341
- onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleRemove(_ctx.file))
399
+ onClick: _cache[7] || (_cache[7] = ($event) => _ctx.handleRemove(_ctx.file))
342
400
  },
343
401
  [
344
- createVNode(_component_el_icon, {
402
+ createVNode(_component_ElIcon, {
345
403
  class: normalizeClass(_ctx.nsIcon.m("delete"))
346
404
  }, {
347
405
  default: withCtx(() => [
@@ -7,10 +7,7 @@ export declare const props: {
7
7
  type: StringConstructor;
8
8
  default: string;
9
9
  };
10
- preview: {
11
- type: BooleanConstructor;
12
- default: boolean;
13
- };
10
+ preview: any;
14
11
  beforeUpload: {
15
12
  type: FunctionConstructor;
16
13
  default: any;