@vunk/form 2.11.0 → 2.12.1

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 (86) hide show
  1. package/components/button/src/ctx.d.ts +1 -1
  2. package/components/button/src/index.vue.d.ts +15 -15
  3. package/components/card-input-collection/src/index.vue.d.ts +12 -12
  4. package/components/cascader/src/ctx.d.ts +4 -11
  5. package/components/cascader/src/index.vue.d.ts +10 -24
  6. package/components/checkbox/src/index.vue.d.ts +27 -27
  7. package/components/cloneDeep.cjs +269 -37
  8. package/components/cloneDeep.mjs +269 -37
  9. package/components/color-picker/src/ctx.d.ts +17 -1
  10. package/components/color-picker/src/index.vue.d.ts +36 -2
  11. package/components/date-picker/src/ctx.d.ts +2 -1
  12. package/components/date-picker/src/index.vue.d.ts +10 -0
  13. package/components/date-picker-range/src/ctx.d.ts +1 -0
  14. package/components/date-picker-range/src/index.vue.d.ts +3 -0
  15. package/components/dialog-input-collection/index.cjs +562 -0
  16. package/components/dialog-input-collection/index.css +21 -0
  17. package/components/dialog-input-collection/index.d.ts +4 -0
  18. package/components/dialog-input-collection/index.mjs +556 -0
  19. package/components/dialog-input-collection/src/ctx.d.ts +142 -0
  20. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +647 -0
  21. package/components/dialog-input-collection/src/index.vue.d.ts +1972 -0
  22. package/components/dialog-input-collection/src/layout.vue.d.ts +85 -0
  23. package/components/dialog-input-collection/src/types.d.ts +28 -0
  24. package/components/download-plus/index.cjs +2 -2
  25. package/components/download-plus/index.mjs +2 -2
  26. package/components/download-plus/src/index.vue.d.ts +48 -18
  27. package/components/editable-text/index.cjs +1 -1
  28. package/components/editable-text/index.mjs +1 -1
  29. package/components/editable-text/src/index.vue.d.ts +6 -6
  30. package/components/esri-input-geojson/index.cjs +1 -1
  31. package/components/esri-input-geojson/index.mjs +1 -1
  32. package/components/esri-input-geojson/src/append.vue.d.ts +21 -21
  33. package/components/esri-input-geojson/src/ctx.d.ts +10 -1
  34. package/components/esri-input-geojson/src/index.vue.d.ts +21 -0
  35. package/components/form/src/index.vue.d.ts +8 -2853
  36. package/components/form-item/index.cjs +1 -1
  37. package/components/form-item/index.mjs +1 -1
  38. package/components/form-item/src/index.vue.d.ts +15 -15
  39. package/components/index.cjs +397 -11
  40. package/components/index.mjs +378 -11
  41. package/components/index2.cjs +11 -397
  42. package/components/index2.mjs +11 -378
  43. package/components/information/index.cjs +3 -4
  44. package/components/information/index.mjs +3 -4
  45. package/components/information-collection/index.cjs +2 -2
  46. package/components/information-collection/index.mjs +2 -2
  47. package/components/information-collection/src/ctx.d.ts +2 -2
  48. package/components/information-collection/src/index.vue.d.ts +4 -4
  49. package/components/information-renderer/index.cjs +16 -0
  50. package/components/information-renderer/index.d.ts +73 -0
  51. package/components/information-renderer/index.mjs +10 -0
  52. package/components/information-tag/src/ctx.d.ts +1 -1
  53. package/components/information-tag/src/index.vue.d.ts +3 -3
  54. package/components/information-templates-default/index.cjs +25 -7
  55. package/components/information-templates-default/index.mjs +25 -7
  56. package/components/input/src/ctx.d.ts +10 -1
  57. package/components/input/src/index.vue.d.ts +51 -0
  58. package/components/input-collection/index.cjs +12 -1
  59. package/components/input-collection/index.mjs +12 -1
  60. package/components/input-collection/src/index.vue.d.ts +12 -12
  61. package/components/input-collection/src/types.d.ts +2 -2
  62. package/components/input-link/index.cjs +1 -1
  63. package/components/input-link/index.mjs +1 -1
  64. package/components/input-link/src/ctx.d.ts +9 -0
  65. package/components/input-link/src/index.vue.d.ts +19 -0
  66. package/components/input-number/src/ctx.d.ts +9 -1
  67. package/components/input-number/src/index.vue.d.ts +45 -0
  68. package/components/input-tag/src/ctx.d.ts +3 -10
  69. package/components/input-tag/src/index.vue.d.ts +25 -60
  70. package/components/select/src/ctx.d.ts +1 -1
  71. package/components/select/src/index.vue.d.ts +4 -4
  72. package/components/templates-element-plus/src/index.vue.d.ts +6 -6
  73. package/components/upload/index.cjs +1 -1
  74. package/components/upload/index.mjs +1 -1
  75. package/components/upload/src/index.vue.d.ts +9 -9
  76. package/components/upload-plus/index.cjs +2 -2
  77. package/components/upload-plus/index.mjs +2 -2
  78. package/components/upload-plus/src/index.vue.d.ts +49 -19
  79. package/components/van-cascader/src/ctx.d.ts +4 -11
  80. package/components/van-cascader/src/index.vue.d.ts +27 -41
  81. package/components/var-datetime-picker/src/index.vue.d.ts +15 -3
  82. package/components/vditor/src/index.vue.d.ts +1 -1
  83. package/index.css +22 -0
  84. package/package.json +14 -1
  85. package/shared/element-plus/ctx.d.ts +4 -4
  86. package/shared/element-plus/instances.d.ts +2 -1
@@ -0,0 +1,556 @@
1
+ import { defineComponent, openBlock, createBlock, withCtx, createVNode, renderSlot, ref, watch, resolveComponent, createTextVNode, mergeProps, computed, Fragment, reactive, createElementBlock, normalizeProps, guardReactiveProps, createSlots, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
2
+ import { p as plus_default, e as edit_default, d as delete_default } from '../index.mjs';
3
+ import { setData, ensetData, getValue } from '@vunk/core';
4
+ import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
5
+ import { VkfInformationTemplates, VkfInformationData, VkfInformationRenderer } from '@vunk/form/components/information-renderer';
6
+ import { useComputedReadonly } from '@vunk/form/composables';
7
+ import { VkTableColumns } from '@vunk/plus/components/table-columns';
8
+ import { ElDialog, ElButton, ElPopconfirm, ElTable } from 'element-plus';
9
+ import { VkfRendererData } from '@vunk/form/components/renderer-data';
10
+ import { VkfTemplateInstancesProvider } from '@vunk/form/components/template-instances-provider';
11
+ import { VkfInformationTemplatesDefault } from '@vunk/form/components/information-templates-default';
12
+ import { VkfTemplatesDefault } from '@vunk/form/components/templates-default';
13
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
14
+ import { CRUD } from '@vunk/shared/enum';
15
+ import { VkAvatar } from '@vunk/plus/components/avatar';
16
+ import { VkfForm } from '@vunk/form/components/form';
17
+ import { isCallable } from '@vunk/shared/function';
18
+ import { c as cloneDeep } from '../cloneDeep.mjs';
19
+ import '../isObject.mjs';
20
+
21
+ const props = {
22
+ ..._VkfFormItemCtx.props,
23
+ columns: {
24
+ type: Array,
25
+ default: () => []
26
+ },
27
+ /**
28
+ * @description 表格数据 v-model
29
+ */
30
+ modelValue: {
31
+ type: Array,
32
+ default: () => []
33
+ },
34
+ readonly: {
35
+ type: Boolean,
36
+ default: void 0
37
+ },
38
+ /**
39
+ * @description 是否可以splice
40
+ */
41
+ splicable: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ /**
46
+ * @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
47
+ */
48
+ labelActions: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ /**
53
+ * @description 添加记录时的默认值
54
+ */
55
+ defaultItemValue: {
56
+ type: Object,
57
+ default: () => ({})
58
+ },
59
+ dialogFormProps: {
60
+ type: Object,
61
+ default: () => ({})
62
+ },
63
+ modules: {
64
+ type: Array,
65
+ default: () => ["operations:add"]
66
+ }
67
+ };
68
+ const emits = {
69
+ "update:modelValue": null
70
+ };
71
+
72
+ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
73
+ __name: "layout",
74
+ props: {
75
+ data: {
76
+ type: Object,
77
+ default: () => ({})
78
+ }
79
+ },
80
+ emits: ["setData"],
81
+ setup(__props, { expose: __expose }) {
82
+ __expose();
83
+ const __returned__ = { get VkfRendererData() {
84
+ return VkfRendererData;
85
+ }, get VkfTemplateInstancesProvider() {
86
+ return VkfTemplateInstancesProvider;
87
+ }, get VkfInformationTemplates() {
88
+ return VkfInformationTemplates;
89
+ }, get VkfInformationData() {
90
+ return VkfInformationData;
91
+ }, get VkfInformationTemplatesDefault() {
92
+ return VkfInformationTemplatesDefault;
93
+ }, get VkfTemplatesDefault() {
94
+ return VkfTemplatesDefault;
95
+ } };
96
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
97
+ return __returned__;
98
+ }
99
+ });
100
+
101
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
102
+ return openBlock(), createBlock($setup["VkfTemplateInstancesProvider"], null, {
103
+ placeholder: withCtx(() => [
104
+ createVNode($setup["VkfTemplatesDefault"])
105
+ ]),
106
+ default: withCtx(() => [
107
+ createVNode($setup["VkfInformationTemplates"], null, {
108
+ placeholder: withCtx(() => [
109
+ createVNode($setup["VkfInformationTemplatesDefault"])
110
+ ]),
111
+ default: withCtx(() => [
112
+ createVNode($setup["VkfRendererData"], {
113
+ data: $props.data,
114
+ onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
115
+ }, {
116
+ default: withCtx(() => [
117
+ createVNode($setup["VkfInformationData"], {
118
+ data: $props.data,
119
+ onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event))
120
+ }, {
121
+ default: withCtx(() => [
122
+ renderSlot(_ctx.$slots, "default")
123
+ ]),
124
+ _: 3
125
+ /* FORWARDED */
126
+ }, 8, ["data"])
127
+ ]),
128
+ _: 3
129
+ /* FORWARDED */
130
+ }, 8, ["data"])
131
+ ]),
132
+ _: 3
133
+ /* FORWARDED */
134
+ })
135
+ ]),
136
+ _: 3
137
+ /* FORWARDED */
138
+ });
139
+ }
140
+ var TemplatesLayout = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/layout.vue"]]);
141
+
142
+ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
143
+ __name: "dialog-form",
144
+ props: {
145
+ title: {
146
+ type: String,
147
+ default: ""
148
+ },
149
+ modelValue: {
150
+ type: Object,
151
+ default: () => ({})
152
+ },
153
+ openReset: {
154
+ type: Boolean,
155
+ default: true
156
+ },
157
+ visible: {
158
+ type: Boolean,
159
+ default: false
160
+ },
161
+ formItems: {
162
+ type: Array,
163
+ default: () => []
164
+ },
165
+ dialogFormProps: {
166
+ type: Object,
167
+ default: () => ({})
168
+ }
169
+ },
170
+ emits: ["update:modelValue", "update:visible", "change"],
171
+ setup(__props, { expose: __expose, emit: __emit }) {
172
+ __expose();
173
+ const props = __props;
174
+ const emit = __emit;
175
+ const formData = ref(props.modelValue);
176
+ watch(() => props.visible, (v) => {
177
+ if (props.openReset && v) {
178
+ formData.value = { ...props.modelValue };
179
+ }
180
+ });
181
+ function handleSubmit() {
182
+ emit("update:modelValue", formData.value);
183
+ emit("change", formData.value);
184
+ emit("update:visible", false);
185
+ }
186
+ const __returned__ = { props, emit, formData, handleSubmit, get VkfForm() {
187
+ return VkfForm;
188
+ }, get ElDialog() {
189
+ return ElDialog;
190
+ }, get setData() {
191
+ return setData;
192
+ } };
193
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
194
+ return __returned__;
195
+ }
196
+ });
197
+
198
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
199
+ const _component_ElButton = resolveComponent("ElButton");
200
+ return openBlock(), createBlock($setup["ElDialog"], {
201
+ "model-value": $props.visible,
202
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:visible", $event))
203
+ }, {
204
+ header: withCtx(() => [
205
+ renderSlot(_ctx.$slots, "header")
206
+ ]),
207
+ footer: withCtx(() => [
208
+ createVNode(_component_ElButton, {
209
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:visible", false))
210
+ }, {
211
+ default: withCtx(() => _cache[3] || (_cache[3] = [
212
+ createTextVNode(" \u53D6\u6D88 ")
213
+ ])),
214
+ _: 1,
215
+ __: [3]
216
+ }),
217
+ createVNode(_component_ElButton, {
218
+ type: "primary",
219
+ onClick: $setup.handleSubmit
220
+ }, {
221
+ default: withCtx(() => _cache[4] || (_cache[4] = [
222
+ createTextVNode(" \u786E\u5B9A ")
223
+ ])),
224
+ _: 1,
225
+ __: [4]
226
+ })
227
+ ]),
228
+ default: withCtx(() => [
229
+ createVNode($setup["VkfForm"], mergeProps($props.dialogFormProps, {
230
+ "form-items": $props.formItems,
231
+ data: $setup.formData,
232
+ onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.formData, $event))
233
+ }), null, 16, ["form-items", "data"])
234
+ ]),
235
+ _: 3
236
+ /* FORWARDED */
237
+ }, 8, ["model-value"]);
238
+ }
239
+ var DialogForm = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/dialog-form.vue"]]);
240
+
241
+ var _sfc_main = /* @__PURE__ */defineComponent({
242
+ ...{
243
+ name: "VkfDialogInputCollection"
244
+ },
245
+ __name: "index",
246
+ props: props,
247
+ emits,
248
+ setup(__props, {
249
+ expose: __expose,
250
+ emit: __emit
251
+ }) {
252
+ __expose();
253
+ const ElTable$1 = ElTable;
254
+ const props = __props;
255
+ const emit = __emit;
256
+ const hasColAdd = computed(() => {
257
+ return props.modules.includes("operations:add");
258
+ });
259
+ const formItemBindProps = _VkfFormItemCtx.createBindProps(props);
260
+ const readonly = useComputedReadonly(props);
261
+ const formData = computed(() => {
262
+ if (!props.prop || props.prop.length === 0) {
263
+ return props.modelValue;
264
+ }
265
+ const data = {};
266
+ ensetData(data, {
267
+ k: props.prop,
268
+ v: props.modelValue
269
+ });
270
+ return data;
271
+ });
272
+ const fullColumns = computed(() => {
273
+ return props.columns.map(column => {
274
+ const tableColProp = Array.isArray(column.prop) ? column.prop.join(".") : column.prop;
275
+ return {
276
+ ...column,
277
+ prop: tableColProp,
278
+ slots: e => {
279
+ const prop = [props.prop ?? [], e.$index, column.prop].flat();
280
+ const formItemProps = {
281
+ prop,
282
+ readonly: readonly.value,
283
+ templateType: column.templateType,
284
+ templateProps: column.templateProps
285
+ };
286
+ if (isCallable(column.templateProps)) {
287
+ formItemProps.templateProps = () => {
288
+ return column.templateProps(e.row);
289
+ };
290
+ }
291
+ return createVNode(VkfInformationRenderer, {
292
+ "source": [{
293
+ ...formItemProps,
294
+ ...column.createTemplateProps?.(e, formItemProps)
295
+ }]
296
+ }, null);
297
+ }
298
+ };
299
+ });
300
+ });
301
+ const buttonsColumn = computed(() => ({
302
+ label: "\u64CD\u4F5C",
303
+ align: "center",
304
+ width: "85",
305
+ hidden: readonly.value || !props.splicable,
306
+ className: "vk-input-collection__buttons",
307
+ slots: ({
308
+ $index
309
+ }) => createVNode(Fragment, null, [hasColAdd.value && createVNode(ElButton, {
310
+ "size": "small",
311
+ "icon": plus_default,
312
+ "type": "primary",
313
+ "link": true,
314
+ "onClick": () => handlePlus($index)
315
+ }, null), createVNode(ElButton, {
316
+ "size": "small",
317
+ "icon": edit_default,
318
+ "type": "primary",
319
+ "link": true,
320
+ "onClick": () => handleEdit($index)
321
+ }, null), createVNode(ElPopconfirm, {
322
+ "title": "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
323
+ "onConfirm": () => handleMinus($index),
324
+ "confirmButtonText": "\u5220\u9664",
325
+ "cancelButtonText": "\u53D6\u6D88"
326
+ }, {
327
+ reference: () => createVNode(ElButton, {
328
+ "size": "small",
329
+ "icon": delete_default,
330
+ "type": "danger",
331
+ "link": true
332
+ }, null)
333
+ })])
334
+ }));
335
+ const allColumns = computed(() => {
336
+ const data = [...fullColumns.value, buttonsColumn.value];
337
+ return data;
338
+ });
339
+ const cuState = reactive({
340
+ type: CRUD.create,
341
+ index: 0,
342
+ // 新增时,表示在哪条点击的 +
343
+ data: {},
344
+ dialogVisible: false
345
+ });
346
+ const cuFormItems = computed(() => {
347
+ return props.columns.map(c => {
348
+ return {
349
+ label: c.label,
350
+ readonly: readonly.value,
351
+ prop: c.prop,
352
+ templateType: c.templateType,
353
+ templateProps: c.templateProps
354
+ };
355
+ });
356
+ });
357
+ function handleMinus(index) {
358
+ const data = cloneDeep(props.modelValue);
359
+ data.splice(index, 1);
360
+ emit("update:modelValue", data);
361
+ }
362
+ function handlePlus(index) {
363
+ cuState.index = index;
364
+ cuState.data = cloneDeep(props.defaultItemValue);
365
+ cuState.type = CRUD.create;
366
+ cuState.dialogVisible = true;
367
+ }
368
+ function handleEdit(index) {
369
+ const data = props.modelValue[index];
370
+ cuState.index = index;
371
+ cuState.data = cloneDeep(data);
372
+ cuState.type = CRUD.update;
373
+ cuState.dialogVisible = true;
374
+ }
375
+ function handleDialogFormChange(data) {
376
+ const newData = cloneDeep(props.modelValue);
377
+ if (cuState.type === CRUD.create) {
378
+ newData.splice(cuState.index + 1, 0, data);
379
+ } else if (cuState.type === CRUD.update) {
380
+ newData[cuState.index] = data;
381
+ }
382
+ emit("update:modelValue", newData);
383
+ }
384
+ const handleFormSetData = e => {
385
+ console.warn("\u8868\u5355\u9879\u6B63\u5728\u76F4\u63A5\u4FEE\u6539 Data, \u8FD9\u5728 dialog-input-collection \u53EF\u80FD\u662F\u4E00\u4E2A\u610F\u5916\u64CD\u4F5C", e);
386
+ const data = cloneDeep(formData.value);
387
+ ensetData(data, e);
388
+ emit("update:modelValue", getValue(data, props.prop));
389
+ };
390
+ const __returned__ = {
391
+ ElTable: ElTable$1,
392
+ props,
393
+ emit,
394
+ hasColAdd,
395
+ formItemBindProps,
396
+ readonly,
397
+ formData,
398
+ fullColumns,
399
+ buttonsColumn,
400
+ allColumns,
401
+ cuState,
402
+ cuFormItems,
403
+ handleMinus,
404
+ handlePlus,
405
+ handleEdit,
406
+ handleDialogFormChange,
407
+ handleFormSetData,
408
+ get Plus() {
409
+ return plus_default;
410
+ },
411
+ get Edit() {
412
+ return edit_default;
413
+ },
414
+ get VkfFormItem() {
415
+ return VkfFormItem;
416
+ },
417
+ get VkTableColumns() {
418
+ return VkTableColumns;
419
+ },
420
+ get ElButton() {
421
+ return ElButton;
422
+ },
423
+ TemplatesLayout,
424
+ get CRUD() {
425
+ return CRUD;
426
+ },
427
+ get VkAvatar() {
428
+ return VkAvatar;
429
+ },
430
+ DialogForm
431
+ };
432
+ Object.defineProperty(__returned__, "__isScriptSetup", {
433
+ enumerable: false,
434
+ value: true
435
+ });
436
+ return __returned__;
437
+ }
438
+ });
439
+
440
+ const _hoisted_1 = {
441
+ key: 0,
442
+ class: "vkf-dialog-input-collection-options"
443
+ };
444
+ const _hoisted_2 = { class: "vkf-dialog-input-collection__dialog-header" };
445
+ const _hoisted_3 = { class: "vkf-dialog-input-collection__dialog-title" };
446
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
447
+ return openBlock(), createElementBlock(
448
+ Fragment,
449
+ null,
450
+ [
451
+ createVNode($setup["TemplatesLayout"], {
452
+ data: $setup.formData,
453
+ onSetData: $setup.handleFormSetData
454
+ }, {
455
+ default: withCtx(() => [
456
+ createVNode(
457
+ $setup["VkfFormItem"],
458
+ normalizeProps(guardReactiveProps($setup.formItemBindProps)),
459
+ createSlots({
460
+ default: withCtx(() => [
461
+ !$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (openBlock(), createElementBlock("div", _hoisted_1, [
462
+ createVNode($setup["ElButton"], {
463
+ type: "primary",
464
+ onClick: _cache[1] || (_cache[1] = ($event) => $setup.handlePlus(-1))
465
+ }, {
466
+ default: withCtx(() => _cache[5] || (_cache[5] = [
467
+ createTextVNode(" \u6DFB\u52A0 ")
468
+ ])),
469
+ _: 1,
470
+ __: [5]
471
+ })
472
+ ])) : createCommentVNode("v-if", true),
473
+ createVNode($setup["ElTable"], {
474
+ data: _ctx.modelValue,
475
+ class: "vkf-dialog-input-collection-table"
476
+ }, {
477
+ default: withCtx(() => [
478
+ createVNode($setup["VkTableColumns"], { source: $setup.allColumns }, null, 8, ["source"])
479
+ ]),
480
+ _: 1
481
+ /* STABLE */
482
+ }, 8, ["data"])
483
+ ]),
484
+ _: 2
485
+ /* DYNAMIC */
486
+ }, [
487
+ _ctx.labelActions ? {
488
+ name: "labelActions",
489
+ fn: withCtx(() => [
490
+ renderSlot(_ctx.$slots, "labelActions"),
491
+ !$setup.readonly && _ctx.splicable ? (openBlock(), createBlock($setup["ElButton"], {
492
+ key: 0,
493
+ size: "small",
494
+ icon: $setup.Plus,
495
+ onClick: _cache[0] || (_cache[0] = ($event) => $setup.handlePlus(-1))
496
+ }, {
497
+ default: withCtx(() => _cache[4] || (_cache[4] = [
498
+ createTextVNode(" \u6DFB\u52A0 ")
499
+ ])),
500
+ _: 1,
501
+ __: [4]
502
+ }, 8, ["icon"])) : createCommentVNode("v-if", true)
503
+ ]),
504
+ key: "0"
505
+ } : void 0
506
+ ]),
507
+ 1040
508
+ /* FULL_PROPS, DYNAMIC_SLOTS */
509
+ ),
510
+ createVNode($setup["DialogForm"], {
511
+ visible: $setup.cuState.dialogVisible,
512
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => $setup.cuState.dialogVisible = $event),
513
+ modelValue: $setup.cuState.data,
514
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
515
+ "form-items": $setup.cuFormItems,
516
+ "dialog-form-props": _ctx.dialogFormProps,
517
+ onChange: $setup.handleDialogFormChange
518
+ }, {
519
+ header: withCtx(() => [
520
+ createElementVNode("div", _hoisted_2, [
521
+ createVNode($setup["VkAvatar"], {
522
+ icon: $setup.cuState.type === $setup.CRUD.create ? $setup.Plus : $setup.Edit
523
+ }, null, 8, ["icon"]),
524
+ createElementVNode(
525
+ "span",
526
+ _hoisted_3,
527
+ toDisplayString($setup.props.label),
528
+ 1
529
+ /* TEXT */
530
+ )
531
+ ])
532
+ ]),
533
+ _: 1
534
+ /* STABLE */
535
+ }, 8, ["visible", "modelValue", "form-items", "dialog-form-props"])
536
+ ]),
537
+ _: 3
538
+ /* FORWARDED */
539
+ }, 8, ["data"]),
540
+ renderSlot(_ctx.$slots, "default")
541
+ ],
542
+ 64
543
+ /* STABLE_FRAGMENT */
544
+ );
545
+ }
546
+ var VkfDialogInputCollection = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/index.vue"]]);
547
+
548
+ var types = /*#__PURE__*/Object.freeze({
549
+ __proto__: null
550
+ });
551
+
552
+ VkfDialogInputCollection.install = (app) => {
553
+ app.component(VkfDialogInputCollection.name || "VkfDialogInputCollection", VkfDialogInputCollection);
554
+ };
555
+
556
+ export { VkfDialogInputCollection, types as __VkfDialogInputCollection, VkfDialogInputCollection as default };
@@ -0,0 +1,142 @@
1
+ import { PropType } from 'vue';
2
+ import { NormalObject } from '@vunk/shared';
3
+ import { Modules } from './types';
4
+ export declare const props: {
5
+ columns: {
6
+ type: PropType<any[]>;
7
+ default: () => any[];
8
+ };
9
+ /**
10
+ * @description 表格数据 v-model
11
+ */
12
+ modelValue: {
13
+ type: PropType<NormalObject[]>;
14
+ default: () => any[];
15
+ };
16
+ readonly: {
17
+ type: BooleanConstructor;
18
+ default: any;
19
+ };
20
+ /**
21
+ * @description 是否可以splice
22
+ */
23
+ splicable: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ /**
28
+ * @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
29
+ */
30
+ labelActions: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ /**
35
+ * @description 添加记录时的默认值
36
+ */
37
+ defaultItemValue: {
38
+ type: PropType<NormalObject>;
39
+ default: () => {};
40
+ };
41
+ dialogFormProps: {
42
+ type: ObjectConstructor;
43
+ default: () => {};
44
+ };
45
+ modules: {
46
+ type: PropType<Modules[]>;
47
+ default: () => string[];
48
+ };
49
+ required: {
50
+ readonly type: PropType<boolean>;
51
+ readonly required: false;
52
+ readonly validator: ((val: unknown) => boolean) | undefined;
53
+ __epPropKey: true;
54
+ } & {
55
+ readonly default: undefined;
56
+ };
57
+ formItemSize: {
58
+ type: PropType<"default" | "small" | "large">;
59
+ default: "default" | "small" | "large";
60
+ };
61
+ formItemSlots: {
62
+ type: PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
63
+ default: any;
64
+ };
65
+ elRef: {
66
+ type: PropType<any>;
67
+ required: boolean;
68
+ };
69
+ inline: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ formItemTip: {
74
+ type: StringConstructor;
75
+ default: any;
76
+ };
77
+ formItemTipClass: any;
78
+ labelTip: {
79
+ type: StringConstructor;
80
+ default: any;
81
+ };
82
+ information: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ label: StringConstructor;
87
+ labelWidth: {
88
+ readonly type: PropType<string | number>;
89
+ readonly required: false;
90
+ readonly validator: ((val: unknown) => boolean) | undefined;
91
+ __epPropKey: true;
92
+ } & {
93
+ readonly default: "";
94
+ };
95
+ labelPosition: {
96
+ readonly type: PropType<"" | "top" | "left" | "right">;
97
+ readonly required: false;
98
+ readonly validator: ((val: unknown) => boolean) | undefined;
99
+ __epPropKey: true;
100
+ } & {
101
+ readonly default: "";
102
+ };
103
+ prop: {
104
+ readonly type: PropType<import("element-plus").FormItemProp>;
105
+ readonly required: false;
106
+ readonly validator: ((val: unknown) => boolean) | undefined;
107
+ __epPropKey: true;
108
+ };
109
+ rules: {
110
+ readonly type: PropType<unknown>;
111
+ readonly required: false;
112
+ readonly validator: ((val: unknown) => boolean) | undefined;
113
+ __epPropKey: true;
114
+ };
115
+ error: StringConstructor;
116
+ validateStatus: {
117
+ readonly type: PropType<"" | "error" | "success" | "validating">;
118
+ readonly required: false;
119
+ readonly validator: ((val: unknown) => boolean) | undefined;
120
+ __epPropKey: true;
121
+ };
122
+ for: StringConstructor;
123
+ inlineMessage: {
124
+ readonly type: PropType<string | boolean>;
125
+ readonly required: false;
126
+ readonly validator: ((val: unknown) => boolean) | undefined;
127
+ __epPropKey: true;
128
+ } & {
129
+ readonly default: "";
130
+ };
131
+ showMessage: {
132
+ readonly type: PropType<boolean>;
133
+ readonly required: false;
134
+ readonly validator: ((val: unknown) => boolean) | undefined;
135
+ __epPropKey: true;
136
+ } & {
137
+ readonly default: true;
138
+ };
139
+ };
140
+ export declare const emits: {
141
+ 'update:modelValue': any;
142
+ };