@vunk/form 2.12.1 → 2.12.2
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.
- package/components/dialog-input-collection/index.cjs +122 -101
- package/components/dialog-input-collection/index.mjs +121 -100
- package/components/dialog-input-collection/src/ctx.d.ts +6 -3
- package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1184 -49
- package/components/dialog-input-collection/src/index.vue.d.ts +1365 -223
- package/components/dialog-input-collection/src/layout.vue.d.ts +27 -27
- package/components/dialog-input-collection/src/types.d.ts +1 -1
- package/components/form-item-renderer/index.cjs +5 -3
- package/components/form-item-renderer/index.mjs +5 -3
- package/package.json +1 -1
|
@@ -7,18 +7,20 @@ var index = require('../index.cjs');
|
|
|
7
7
|
var core = require('@vunk/core');
|
|
8
8
|
var formItem = require('@vunk/form/components/form-item');
|
|
9
9
|
var informationRenderer = require('@vunk/form/components/information-renderer');
|
|
10
|
-
var composables = require('@vunk/form/composables');
|
|
10
|
+
var composables$1 = require('@vunk/form/composables');
|
|
11
|
+
var avatar = require('@vunk/plus/components/avatar');
|
|
11
12
|
var tableColumns = require('@vunk/plus/components/table-columns');
|
|
13
|
+
var _enum = require('@vunk/shared/enum');
|
|
14
|
+
var _function = require('@vunk/shared/function');
|
|
12
15
|
var elementPlus = require('element-plus');
|
|
16
|
+
var composables = require('@vunk/core/composables');
|
|
17
|
+
var form$1 = require('@vunk/form/components/form');
|
|
18
|
+
var form = require('@vunk/form/shared/form');
|
|
19
|
+
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
20
|
+
var informationTemplatesDefault = require('@vunk/form/components/information-templates-default');
|
|
13
21
|
var rendererData = require('@vunk/form/components/renderer-data');
|
|
14
22
|
var templateInstancesProvider = require('@vunk/form/components/template-instances-provider');
|
|
15
|
-
var informationTemplatesDefault = require('@vunk/form/components/information-templates-default');
|
|
16
23
|
var templatesDefault = require('@vunk/form/components/templates-default');
|
|
17
|
-
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
18
|
-
var _enum = require('@vunk/shared/enum');
|
|
19
|
-
var avatar = require('@vunk/plus/components/avatar');
|
|
20
|
-
var form = require('@vunk/form/components/form');
|
|
21
|
-
var _function = require('@vunk/shared/function');
|
|
22
24
|
var cloneDeep = require('../cloneDeep.cjs');
|
|
23
25
|
require('../isObject.cjs');
|
|
24
26
|
|
|
@@ -64,6 +66,9 @@ const props = {
|
|
|
64
66
|
type: Object,
|
|
65
67
|
default: () => ({})
|
|
66
68
|
},
|
|
69
|
+
validateCatch: {
|
|
70
|
+
type: Function
|
|
71
|
+
},
|
|
67
72
|
modules: {
|
|
68
73
|
type: Array,
|
|
69
74
|
default: () => ["operations:add"]
|
|
@@ -74,76 +79,6 @@ const emits = {
|
|
|
74
79
|
};
|
|
75
80
|
|
|
76
81
|
var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
77
|
-
__name: "layout",
|
|
78
|
-
props: {
|
|
79
|
-
data: {
|
|
80
|
-
type: Object,
|
|
81
|
-
default: () => ({})
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
emits: ["setData"],
|
|
85
|
-
setup(__props, { expose: __expose }) {
|
|
86
|
-
__expose();
|
|
87
|
-
const __returned__ = { get VkfRendererData() {
|
|
88
|
-
return rendererData.VkfRendererData;
|
|
89
|
-
}, get VkfTemplateInstancesProvider() {
|
|
90
|
-
return templateInstancesProvider.VkfTemplateInstancesProvider;
|
|
91
|
-
}, get VkfInformationTemplates() {
|
|
92
|
-
return informationRenderer.VkfInformationTemplates;
|
|
93
|
-
}, get VkfInformationData() {
|
|
94
|
-
return informationRenderer.VkfInformationData;
|
|
95
|
-
}, get VkfInformationTemplatesDefault() {
|
|
96
|
-
return informationTemplatesDefault.VkfInformationTemplatesDefault;
|
|
97
|
-
}, get VkfTemplatesDefault() {
|
|
98
|
-
return templatesDefault.VkfTemplatesDefault;
|
|
99
|
-
} };
|
|
100
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
101
|
-
return __returned__;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
106
|
-
return vue.openBlock(), vue.createBlock($setup["VkfTemplateInstancesProvider"], null, {
|
|
107
|
-
placeholder: vue.withCtx(() => [
|
|
108
|
-
vue.createVNode($setup["VkfTemplatesDefault"])
|
|
109
|
-
]),
|
|
110
|
-
default: vue.withCtx(() => [
|
|
111
|
-
vue.createVNode($setup["VkfInformationTemplates"], null, {
|
|
112
|
-
placeholder: vue.withCtx(() => [
|
|
113
|
-
vue.createVNode($setup["VkfInformationTemplatesDefault"])
|
|
114
|
-
]),
|
|
115
|
-
default: vue.withCtx(() => [
|
|
116
|
-
vue.createVNode($setup["VkfRendererData"], {
|
|
117
|
-
data: $props.data,
|
|
118
|
-
onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
|
|
119
|
-
}, {
|
|
120
|
-
default: vue.withCtx(() => [
|
|
121
|
-
vue.createVNode($setup["VkfInformationData"], {
|
|
122
|
-
data: $props.data,
|
|
123
|
-
onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event))
|
|
124
|
-
}, {
|
|
125
|
-
default: vue.withCtx(() => [
|
|
126
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
127
|
-
]),
|
|
128
|
-
_: 3
|
|
129
|
-
/* FORWARDED */
|
|
130
|
-
}, 8, ["data"])
|
|
131
|
-
]),
|
|
132
|
-
_: 3
|
|
133
|
-
/* FORWARDED */
|
|
134
|
-
}, 8, ["data"])
|
|
135
|
-
]),
|
|
136
|
-
_: 3
|
|
137
|
-
/* FORWARDED */
|
|
138
|
-
})
|
|
139
|
-
]),
|
|
140
|
-
_: 3
|
|
141
|
-
/* FORWARDED */
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
var TemplatesLayout = /* @__PURE__ */ _pluginVue_exportHelper._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"]]);
|
|
145
|
-
|
|
146
|
-
var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
147
82
|
__name: "dialog-form",
|
|
148
83
|
props: {
|
|
149
84
|
title: {
|
|
@@ -169,6 +104,10 @@ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
169
104
|
dialogFormProps: {
|
|
170
105
|
type: Object,
|
|
171
106
|
default: () => ({})
|
|
107
|
+
},
|
|
108
|
+
validateCatch: {
|
|
109
|
+
type: Function,
|
|
110
|
+
default: form.validateCatch
|
|
172
111
|
}
|
|
173
112
|
},
|
|
174
113
|
emits: ["update:modelValue", "update:visible", "change"],
|
|
@@ -177,32 +116,42 @@ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
177
116
|
const props = __props;
|
|
178
117
|
const emit = __emit;
|
|
179
118
|
const formData = vue.ref(props.modelValue);
|
|
119
|
+
const formDef = composables.useDeferred();
|
|
120
|
+
formDef.promise.then((form) => {
|
|
121
|
+
props.dialogFormProps.elRef?.(form);
|
|
122
|
+
});
|
|
180
123
|
vue.watch(() => props.visible, (v) => {
|
|
181
124
|
if (props.openReset && v) {
|
|
182
125
|
formData.value = { ...props.modelValue };
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
formDef.value?.clearValidate();
|
|
128
|
+
});
|
|
183
129
|
}
|
|
184
130
|
});
|
|
185
131
|
function handleSubmit() {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
132
|
+
formDef.value?.validate().then(() => {
|
|
133
|
+
emit("update:modelValue", formData.value);
|
|
134
|
+
emit("change", formData.value);
|
|
135
|
+
emit("update:visible", false);
|
|
136
|
+
}).catch(props.validateCatch);
|
|
189
137
|
}
|
|
190
|
-
const __returned__ = { props, emit, formData, handleSubmit, get
|
|
191
|
-
return
|
|
138
|
+
const __returned__ = { props, emit, formData, formDef, handleSubmit, get setData() {
|
|
139
|
+
return core.setData;
|
|
140
|
+
}, get VkfForm() {
|
|
141
|
+
return form$1.VkfForm;
|
|
192
142
|
}, get ElDialog() {
|
|
193
143
|
return elementPlus.ElDialog;
|
|
194
|
-
}, get setData() {
|
|
195
|
-
return core.setData;
|
|
196
144
|
} };
|
|
197
145
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
198
146
|
return __returned__;
|
|
199
147
|
}
|
|
200
148
|
});
|
|
201
149
|
|
|
202
|
-
function _sfc_render$
|
|
150
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
203
151
|
const _component_ElButton = vue.resolveComponent("ElButton");
|
|
204
152
|
return vue.openBlock(), vue.createBlock($setup["ElDialog"], {
|
|
205
153
|
"model-value": $props.visible,
|
|
154
|
+
"append-to-body": "",
|
|
206
155
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:visible", $event))
|
|
207
156
|
}, {
|
|
208
157
|
header: vue.withCtx(() => [
|
|
@@ -231,16 +180,87 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
231
180
|
]),
|
|
232
181
|
default: vue.withCtx(() => [
|
|
233
182
|
vue.createVNode($setup["VkfForm"], vue.mergeProps($props.dialogFormProps, {
|
|
183
|
+
"el-ref": $setup.formDef.resolve,
|
|
234
184
|
"form-items": $props.formItems,
|
|
235
185
|
data: $setup.formData,
|
|
236
186
|
onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.formData, $event))
|
|
237
|
-
}), null, 16, ["form-items", "data"])
|
|
187
|
+
}), null, 16, ["el-ref", "form-items", "data"])
|
|
238
188
|
]),
|
|
239
189
|
_: 3
|
|
240
190
|
/* FORWARDED */
|
|
241
191
|
}, 8, ["model-value"]);
|
|
242
192
|
}
|
|
243
|
-
var DialogForm = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$
|
|
193
|
+
var DialogForm = /* @__PURE__ */ _pluginVue_exportHelper._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/dialog-form.vue"]]);
|
|
194
|
+
|
|
195
|
+
var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
196
|
+
__name: "layout",
|
|
197
|
+
props: {
|
|
198
|
+
data: {
|
|
199
|
+
type: Object,
|
|
200
|
+
default: () => ({})
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
emits: ["setData"],
|
|
204
|
+
setup(__props, { expose: __expose }) {
|
|
205
|
+
__expose();
|
|
206
|
+
const __returned__ = { get VkfInformationData() {
|
|
207
|
+
return informationRenderer.VkfInformationData;
|
|
208
|
+
}, get VkfInformationTemplates() {
|
|
209
|
+
return informationRenderer.VkfInformationTemplates;
|
|
210
|
+
}, get VkfInformationTemplatesDefault() {
|
|
211
|
+
return informationTemplatesDefault.VkfInformationTemplatesDefault;
|
|
212
|
+
}, get VkfRendererData() {
|
|
213
|
+
return rendererData.VkfRendererData;
|
|
214
|
+
}, get VkfTemplateInstancesProvider() {
|
|
215
|
+
return templateInstancesProvider.VkfTemplateInstancesProvider;
|
|
216
|
+
}, get VkfTemplatesDefault() {
|
|
217
|
+
return templatesDefault.VkfTemplatesDefault;
|
|
218
|
+
} };
|
|
219
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
220
|
+
return __returned__;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
225
|
+
return vue.openBlock(), vue.createBlock($setup["VkfTemplateInstancesProvider"], null, {
|
|
226
|
+
placeholder: vue.withCtx(() => [
|
|
227
|
+
vue.createVNode($setup["VkfTemplatesDefault"])
|
|
228
|
+
]),
|
|
229
|
+
default: vue.withCtx(() => [
|
|
230
|
+
vue.createVNode($setup["VkfInformationTemplates"], null, {
|
|
231
|
+
placeholder: vue.withCtx(() => [
|
|
232
|
+
vue.createVNode($setup["VkfInformationTemplatesDefault"])
|
|
233
|
+
]),
|
|
234
|
+
default: vue.withCtx(() => [
|
|
235
|
+
vue.createVNode($setup["VkfRendererData"], {
|
|
236
|
+
data: $props.data,
|
|
237
|
+
onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
|
|
238
|
+
}, {
|
|
239
|
+
default: vue.withCtx(() => [
|
|
240
|
+
vue.createVNode($setup["VkfInformationData"], {
|
|
241
|
+
data: $props.data,
|
|
242
|
+
onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event))
|
|
243
|
+
}, {
|
|
244
|
+
default: vue.withCtx(() => [
|
|
245
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
246
|
+
]),
|
|
247
|
+
_: 3
|
|
248
|
+
/* FORWARDED */
|
|
249
|
+
}, 8, ["data"])
|
|
250
|
+
]),
|
|
251
|
+
_: 3
|
|
252
|
+
/* FORWARDED */
|
|
253
|
+
}, 8, ["data"])
|
|
254
|
+
]),
|
|
255
|
+
_: 3
|
|
256
|
+
/* FORWARDED */
|
|
257
|
+
})
|
|
258
|
+
]),
|
|
259
|
+
_: 3
|
|
260
|
+
/* FORWARDED */
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
var TemplatesLayout = /* @__PURE__ */ _pluginVue_exportHelper._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/layout.vue"]]);
|
|
244
264
|
|
|
245
265
|
var _sfc_main = /* @__PURE__ */vue.defineComponent({
|
|
246
266
|
...{
|
|
@@ -254,14 +274,14 @@ var _sfc_main = /* @__PURE__ */vue.defineComponent({
|
|
|
254
274
|
emit: __emit
|
|
255
275
|
}) {
|
|
256
276
|
__expose();
|
|
257
|
-
const ElTable = elementPlus.ElTable;
|
|
258
277
|
const props = __props;
|
|
259
278
|
const emit = __emit;
|
|
279
|
+
const ElTable = elementPlus.ElTable;
|
|
260
280
|
const hasColAdd = vue.computed(() => {
|
|
261
281
|
return props.modules.includes("operations:add");
|
|
262
282
|
});
|
|
263
283
|
const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props);
|
|
264
|
-
const readonly = composables.useComputedReadonly(props);
|
|
284
|
+
const readonly = composables$1.useComputedReadonly(props);
|
|
265
285
|
const formData = vue.computed(() => {
|
|
266
286
|
if (!props.prop || props.prop.length === 0) {
|
|
267
287
|
return props.modelValue;
|
|
@@ -392,9 +412,9 @@ var _sfc_main = /* @__PURE__ */vue.defineComponent({
|
|
|
392
412
|
emit("update:modelValue", core.getValue(data, props.prop));
|
|
393
413
|
};
|
|
394
414
|
const __returned__ = {
|
|
395
|
-
ElTable,
|
|
396
415
|
props,
|
|
397
416
|
emit,
|
|
417
|
+
ElTable,
|
|
398
418
|
hasColAdd,
|
|
399
419
|
formItemBindProps,
|
|
400
420
|
readonly,
|
|
@@ -409,29 +429,29 @@ var _sfc_main = /* @__PURE__ */vue.defineComponent({
|
|
|
409
429
|
handleEdit,
|
|
410
430
|
handleDialogFormChange,
|
|
411
431
|
handleFormSetData,
|
|
412
|
-
get Plus() {
|
|
413
|
-
return index.plus_default;
|
|
414
|
-
},
|
|
415
432
|
get Edit() {
|
|
416
433
|
return index.edit_default;
|
|
417
434
|
},
|
|
435
|
+
get Plus() {
|
|
436
|
+
return index.plus_default;
|
|
437
|
+
},
|
|
418
438
|
get VkfFormItem() {
|
|
419
439
|
return formItem.VkfFormItem;
|
|
420
440
|
},
|
|
441
|
+
get VkAvatar() {
|
|
442
|
+
return avatar.VkAvatar;
|
|
443
|
+
},
|
|
421
444
|
get VkTableColumns() {
|
|
422
445
|
return tableColumns.VkTableColumns;
|
|
423
446
|
},
|
|
424
|
-
get ElButton() {
|
|
425
|
-
return elementPlus.ElButton;
|
|
426
|
-
},
|
|
427
|
-
TemplatesLayout,
|
|
428
447
|
get CRUD() {
|
|
429
448
|
return _enum.CRUD;
|
|
430
449
|
},
|
|
431
|
-
get
|
|
432
|
-
return
|
|
450
|
+
get ElButton() {
|
|
451
|
+
return elementPlus.ElButton;
|
|
433
452
|
},
|
|
434
|
-
DialogForm
|
|
453
|
+
DialogForm,
|
|
454
|
+
TemplatesLayout
|
|
435
455
|
};
|
|
436
456
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
437
457
|
enumerable: false,
|
|
@@ -518,6 +538,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
518
538
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
|
|
519
539
|
"form-items": $setup.cuFormItems,
|
|
520
540
|
"dialog-form-props": _ctx.dialogFormProps,
|
|
541
|
+
"validate-catch": _ctx.validateCatch,
|
|
521
542
|
onChange: $setup.handleDialogFormChange
|
|
522
543
|
}, {
|
|
523
544
|
header: vue.withCtx(() => [
|
|
@@ -536,7 +557,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
536
557
|
]),
|
|
537
558
|
_: 1
|
|
538
559
|
/* STABLE */
|
|
539
|
-
}, 8, ["visible", "modelValue", "form-items", "dialog-form-props"])
|
|
560
|
+
}, 8, ["visible", "modelValue", "form-items", "dialog-form-props", "validate-catch"])
|
|
540
561
|
]),
|
|
541
562
|
_: 3
|
|
542
563
|
/* FORWARDED */
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, createTextVNode, mergeProps, computed, Fragment, reactive, createElementBlock, normalizeProps, guardReactiveProps, createSlots, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
|
|
2
2
|
import { p as plus_default, e as edit_default, d as delete_default } from '../index.mjs';
|
|
3
3
|
import { setData, ensetData, getValue } from '@vunk/core';
|
|
4
4
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
5
|
-
import {
|
|
5
|
+
import { VkfInformationData, VkfInformationTemplates, VkfInformationRenderer } from '@vunk/form/components/information-renderer';
|
|
6
6
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
7
|
+
import { VkAvatar } from '@vunk/plus/components/avatar';
|
|
7
8
|
import { VkTableColumns } from '@vunk/plus/components/table-columns';
|
|
9
|
+
import { CRUD } from '@vunk/shared/enum';
|
|
10
|
+
import { isCallable } from '@vunk/shared/function';
|
|
8
11
|
import { ElDialog, ElButton, ElPopconfirm, ElTable } from 'element-plus';
|
|
12
|
+
import { useDeferred } from '@vunk/core/composables';
|
|
13
|
+
import { VkfForm } from '@vunk/form/components/form';
|
|
14
|
+
import { validateCatch } from '@vunk/form/shared/form';
|
|
15
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
16
|
+
import { VkfInformationTemplatesDefault } from '@vunk/form/components/information-templates-default';
|
|
9
17
|
import { VkfRendererData } from '@vunk/form/components/renderer-data';
|
|
10
18
|
import { VkfTemplateInstancesProvider } from '@vunk/form/components/template-instances-provider';
|
|
11
|
-
import { VkfInformationTemplatesDefault } from '@vunk/form/components/information-templates-default';
|
|
12
19
|
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
20
|
import { c as cloneDeep } from '../cloneDeep.mjs';
|
|
19
21
|
import '../isObject.mjs';
|
|
20
22
|
|
|
@@ -60,6 +62,9 @@ const props = {
|
|
|
60
62
|
type: Object,
|
|
61
63
|
default: () => ({})
|
|
62
64
|
},
|
|
65
|
+
validateCatch: {
|
|
66
|
+
type: Function
|
|
67
|
+
},
|
|
63
68
|
modules: {
|
|
64
69
|
type: Array,
|
|
65
70
|
default: () => ["operations:add"]
|
|
@@ -70,76 +75,6 @@ const emits = {
|
|
|
70
75
|
};
|
|
71
76
|
|
|
72
77
|
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
78
|
__name: "dialog-form",
|
|
144
79
|
props: {
|
|
145
80
|
title: {
|
|
@@ -165,6 +100,10 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
165
100
|
dialogFormProps: {
|
|
166
101
|
type: Object,
|
|
167
102
|
default: () => ({})
|
|
103
|
+
},
|
|
104
|
+
validateCatch: {
|
|
105
|
+
type: Function,
|
|
106
|
+
default: validateCatch
|
|
168
107
|
}
|
|
169
108
|
},
|
|
170
109
|
emits: ["update:modelValue", "update:visible", "change"],
|
|
@@ -173,32 +112,42 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
173
112
|
const props = __props;
|
|
174
113
|
const emit = __emit;
|
|
175
114
|
const formData = ref(props.modelValue);
|
|
115
|
+
const formDef = useDeferred();
|
|
116
|
+
formDef.promise.then((form) => {
|
|
117
|
+
props.dialogFormProps.elRef?.(form);
|
|
118
|
+
});
|
|
176
119
|
watch(() => props.visible, (v) => {
|
|
177
120
|
if (props.openReset && v) {
|
|
178
121
|
formData.value = { ...props.modelValue };
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
formDef.value?.clearValidate();
|
|
124
|
+
});
|
|
179
125
|
}
|
|
180
126
|
});
|
|
181
127
|
function handleSubmit() {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
128
|
+
formDef.value?.validate().then(() => {
|
|
129
|
+
emit("update:modelValue", formData.value);
|
|
130
|
+
emit("change", formData.value);
|
|
131
|
+
emit("update:visible", false);
|
|
132
|
+
}).catch(props.validateCatch);
|
|
185
133
|
}
|
|
186
|
-
const __returned__ = { props, emit, formData, handleSubmit, get
|
|
134
|
+
const __returned__ = { props, emit, formData, formDef, handleSubmit, get setData() {
|
|
135
|
+
return setData;
|
|
136
|
+
}, get VkfForm() {
|
|
187
137
|
return VkfForm;
|
|
188
138
|
}, get ElDialog() {
|
|
189
139
|
return ElDialog;
|
|
190
|
-
}, get setData() {
|
|
191
|
-
return setData;
|
|
192
140
|
} };
|
|
193
141
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
194
142
|
return __returned__;
|
|
195
143
|
}
|
|
196
144
|
});
|
|
197
145
|
|
|
198
|
-
function _sfc_render$
|
|
146
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
199
147
|
const _component_ElButton = resolveComponent("ElButton");
|
|
200
148
|
return openBlock(), createBlock($setup["ElDialog"], {
|
|
201
149
|
"model-value": $props.visible,
|
|
150
|
+
"append-to-body": "",
|
|
202
151
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:visible", $event))
|
|
203
152
|
}, {
|
|
204
153
|
header: withCtx(() => [
|
|
@@ -227,16 +176,87 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
227
176
|
]),
|
|
228
177
|
default: withCtx(() => [
|
|
229
178
|
createVNode($setup["VkfForm"], mergeProps($props.dialogFormProps, {
|
|
179
|
+
"el-ref": $setup.formDef.resolve,
|
|
230
180
|
"form-items": $props.formItems,
|
|
231
181
|
data: $setup.formData,
|
|
232
182
|
onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.formData, $event))
|
|
233
|
-
}), null, 16, ["form-items", "data"])
|
|
183
|
+
}), null, 16, ["el-ref", "form-items", "data"])
|
|
234
184
|
]),
|
|
235
185
|
_: 3
|
|
236
186
|
/* FORWARDED */
|
|
237
187
|
}, 8, ["model-value"]);
|
|
238
188
|
}
|
|
239
|
-
var DialogForm = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
189
|
+
var DialogForm = /* @__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/dialog-form.vue"]]);
|
|
190
|
+
|
|
191
|
+
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
192
|
+
__name: "layout",
|
|
193
|
+
props: {
|
|
194
|
+
data: {
|
|
195
|
+
type: Object,
|
|
196
|
+
default: () => ({})
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
emits: ["setData"],
|
|
200
|
+
setup(__props, { expose: __expose }) {
|
|
201
|
+
__expose();
|
|
202
|
+
const __returned__ = { get VkfInformationData() {
|
|
203
|
+
return VkfInformationData;
|
|
204
|
+
}, get VkfInformationTemplates() {
|
|
205
|
+
return VkfInformationTemplates;
|
|
206
|
+
}, get VkfInformationTemplatesDefault() {
|
|
207
|
+
return VkfInformationTemplatesDefault;
|
|
208
|
+
}, get VkfRendererData() {
|
|
209
|
+
return VkfRendererData;
|
|
210
|
+
}, get VkfTemplateInstancesProvider() {
|
|
211
|
+
return VkfTemplateInstancesProvider;
|
|
212
|
+
}, get VkfTemplatesDefault() {
|
|
213
|
+
return VkfTemplatesDefault;
|
|
214
|
+
} };
|
|
215
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
216
|
+
return __returned__;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
221
|
+
return openBlock(), createBlock($setup["VkfTemplateInstancesProvider"], null, {
|
|
222
|
+
placeholder: withCtx(() => [
|
|
223
|
+
createVNode($setup["VkfTemplatesDefault"])
|
|
224
|
+
]),
|
|
225
|
+
default: withCtx(() => [
|
|
226
|
+
createVNode($setup["VkfInformationTemplates"], null, {
|
|
227
|
+
placeholder: withCtx(() => [
|
|
228
|
+
createVNode($setup["VkfInformationTemplatesDefault"])
|
|
229
|
+
]),
|
|
230
|
+
default: withCtx(() => [
|
|
231
|
+
createVNode($setup["VkfRendererData"], {
|
|
232
|
+
data: $props.data,
|
|
233
|
+
onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
|
|
234
|
+
}, {
|
|
235
|
+
default: withCtx(() => [
|
|
236
|
+
createVNode($setup["VkfInformationData"], {
|
|
237
|
+
data: $props.data,
|
|
238
|
+
onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event))
|
|
239
|
+
}, {
|
|
240
|
+
default: withCtx(() => [
|
|
241
|
+
renderSlot(_ctx.$slots, "default")
|
|
242
|
+
]),
|
|
243
|
+
_: 3
|
|
244
|
+
/* FORWARDED */
|
|
245
|
+
}, 8, ["data"])
|
|
246
|
+
]),
|
|
247
|
+
_: 3
|
|
248
|
+
/* FORWARDED */
|
|
249
|
+
}, 8, ["data"])
|
|
250
|
+
]),
|
|
251
|
+
_: 3
|
|
252
|
+
/* FORWARDED */
|
|
253
|
+
})
|
|
254
|
+
]),
|
|
255
|
+
_: 3
|
|
256
|
+
/* FORWARDED */
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
var TemplatesLayout = /* @__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/layout.vue"]]);
|
|
240
260
|
|
|
241
261
|
var _sfc_main = /* @__PURE__ */defineComponent({
|
|
242
262
|
...{
|
|
@@ -250,9 +270,9 @@ var _sfc_main = /* @__PURE__ */defineComponent({
|
|
|
250
270
|
emit: __emit
|
|
251
271
|
}) {
|
|
252
272
|
__expose();
|
|
253
|
-
const ElTable$1 = ElTable;
|
|
254
273
|
const props = __props;
|
|
255
274
|
const emit = __emit;
|
|
275
|
+
const ElTable$1 = ElTable;
|
|
256
276
|
const hasColAdd = computed(() => {
|
|
257
277
|
return props.modules.includes("operations:add");
|
|
258
278
|
});
|
|
@@ -388,9 +408,9 @@ var _sfc_main = /* @__PURE__ */defineComponent({
|
|
|
388
408
|
emit("update:modelValue", getValue(data, props.prop));
|
|
389
409
|
};
|
|
390
410
|
const __returned__ = {
|
|
391
|
-
ElTable: ElTable$1,
|
|
392
411
|
props,
|
|
393
412
|
emit,
|
|
413
|
+
ElTable: ElTable$1,
|
|
394
414
|
hasColAdd,
|
|
395
415
|
formItemBindProps,
|
|
396
416
|
readonly,
|
|
@@ -405,29 +425,29 @@ var _sfc_main = /* @__PURE__ */defineComponent({
|
|
|
405
425
|
handleEdit,
|
|
406
426
|
handleDialogFormChange,
|
|
407
427
|
handleFormSetData,
|
|
408
|
-
get Plus() {
|
|
409
|
-
return plus_default;
|
|
410
|
-
},
|
|
411
428
|
get Edit() {
|
|
412
429
|
return edit_default;
|
|
413
430
|
},
|
|
431
|
+
get Plus() {
|
|
432
|
+
return plus_default;
|
|
433
|
+
},
|
|
414
434
|
get VkfFormItem() {
|
|
415
435
|
return VkfFormItem;
|
|
416
436
|
},
|
|
437
|
+
get VkAvatar() {
|
|
438
|
+
return VkAvatar;
|
|
439
|
+
},
|
|
417
440
|
get VkTableColumns() {
|
|
418
441
|
return VkTableColumns;
|
|
419
442
|
},
|
|
420
|
-
get ElButton() {
|
|
421
|
-
return ElButton;
|
|
422
|
-
},
|
|
423
|
-
TemplatesLayout,
|
|
424
443
|
get CRUD() {
|
|
425
444
|
return CRUD;
|
|
426
445
|
},
|
|
427
|
-
get
|
|
428
|
-
return
|
|
446
|
+
get ElButton() {
|
|
447
|
+
return ElButton;
|
|
429
448
|
},
|
|
430
|
-
DialogForm
|
|
449
|
+
DialogForm,
|
|
450
|
+
TemplatesLayout
|
|
431
451
|
};
|
|
432
452
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
433
453
|
enumerable: false,
|
|
@@ -514,6 +534,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
514
534
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
|
|
515
535
|
"form-items": $setup.cuFormItems,
|
|
516
536
|
"dialog-form-props": _ctx.dialogFormProps,
|
|
537
|
+
"validate-catch": _ctx.validateCatch,
|
|
517
538
|
onChange: $setup.handleDialogFormChange
|
|
518
539
|
}, {
|
|
519
540
|
header: withCtx(() => [
|
|
@@ -532,7 +553,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
532
553
|
]),
|
|
533
554
|
_: 1
|
|
534
555
|
/* STABLE */
|
|
535
|
-
}, 8, ["visible", "modelValue", "form-items", "dialog-form-props"])
|
|
556
|
+
}, 8, ["visible", "modelValue", "form-items", "dialog-form-props", "validate-catch"])
|
|
536
557
|
]),
|
|
537
558
|
_: 3
|
|
538
559
|
/* FORWARDED */
|