@vunk/form 2.10.1 → 2.10.4
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/api-tables-select/index.cjs +37 -36
- package/components/api-tables-select/index.d.ts +4 -0
- package/components/api-tables-select/index.mjs +37 -36
- package/components/api-tables-select/src/ctx.d.ts +374 -0
- package/components/api-tables-select/src/index.vue.d.ts +1335 -0
- package/components/api-tables-select/src/types.d.ts +19 -0
- package/components/button/index.d.ts +4 -0
- package/components/button/src/ctx.d.ts +190 -0
- package/components/button/src/index.vue.d.ts +822 -0
- package/components/button/src/types.d.ts +13 -0
- package/components/card-input-collection/index.cjs +67 -70
- package/components/card-input-collection/index.d.ts +4 -0
- package/components/card-input-collection/index.mjs +68 -71
- package/components/card-input-collection/src/ctx.d.ts +119 -0
- package/components/card-input-collection/src/index.vue.d.ts +1043 -0
- package/components/card-input-collection/src/types.d.ts +10 -0
- package/components/cascader/index.d.ts +6 -0
- package/components/cascader/src/ctx.d.ts +297 -0
- package/components/cascader/src/index.vue.d.ts +650 -0
- package/components/cascader/src/types.d.ts +19 -0
- package/components/cascader/src/use.d.ts +5 -0
- package/components/checkbox/index.cjs +2 -3
- package/components/checkbox/index.d.ts +5 -0
- package/components/checkbox/index.mjs +2 -3
- package/components/checkbox/src/ctx.d.ts +151 -0
- package/components/checkbox/src/index.vue.d.ts +1362 -0
- package/components/checkbox/src/types.d.ts +8 -0
- package/components/color-picker/index.d.ts +4 -0
- package/components/color-picker/src/ctx.d.ts +153 -0
- package/components/color-picker/src/index.vue.d.ts +341 -0
- package/components/color-picker/src/types.d.ts +7 -0
- package/components/date-picker/index.d.ts +5 -0
- package/components/date-picker/src/ctx.d.ts +325 -0
- package/components/date-picker/src/index.vue.d.ts +1422 -0
- package/components/date-picker/src/types.d.ts +20 -0
- package/components/date-picker-range/index.d.ts +4 -0
- package/components/date-picker-range/src/ctx.d.ts +328 -0
- package/components/date-picker-range/src/index.vue.d.ts +717 -0
- package/components/date-picker-range/src/types.d.ts +12 -0
- package/components/download-plus/index.cjs +4 -4
- package/components/download-plus/index.d.ts +4 -0
- package/components/download-plus/index.mjs +4 -4
- package/components/download-plus/src/api.d.ts +13 -0
- package/components/download-plus/src/const.d.ts +9 -0
- package/components/download-plus/src/ctx.d.ts +129 -0
- package/components/download-plus/src/index.vue.d.ts +1432 -0
- package/components/download-plus/src/types.d.ts +17 -0
- package/components/editable-text/index.cjs +9 -0
- package/components/editable-text/index.d.ts +4 -0
- package/components/editable-text/index.mjs +9 -0
- package/components/editable-text/src/ctx.d.ts +132 -0
- package/components/editable-text/src/index.vue.d.ts +3399 -0
- package/components/editable-text/src/types.d.ts +1 -0
- package/components/esri-input-geojson/index.d.ts +6 -0
- package/components/esri-input-geojson/src/append.vue.d.ts +1179 -0
- package/components/esri-input-geojson/src/const.d.ts +12 -0
- package/components/esri-input-geojson/src/ctx.d.ts +340 -0
- package/components/esri-input-geojson/src/default-view.vue.d.ts +133 -0
- package/components/esri-input-geojson/src/index.vue.d.ts +1459 -0
- package/components/esri-input-geojson/src/types.d.ts +22 -0
- package/components/esri-input-geojson/src/viewer.vue.d.ts +427 -0
- package/components/fieldset/index.d.ts +4 -0
- package/components/fieldset/src/ctx.d.ts +12 -0
- package/components/fieldset/src/index.vue.d.ts +23 -0
- package/components/fieldset/src/types.d.ts +1 -0
- package/components/fieldset/src/use.d.ts +5 -0
- package/components/form/index.d.ts +5 -0
- package/components/form/src/ctx.d.ts +132 -0
- package/components/form/src/index.vue.d.ts +4007 -0
- package/components/form/src/types.d.ts +25 -0
- package/components/form/src/utils.d.ts +15 -0
- package/components/form-item/index.d.ts +5 -0
- package/components/form-item/src/ctx.d.ts +107 -0
- package/components/form-item/src/index.vue.d.ts +961 -0
- package/components/form-item/src/types.d.ts +9 -0
- package/components/form-item-renderer/index.d.ts +4 -0
- package/components/form-item-renderer/src/core.vue.d.ts +38 -0
- package/components/form-item-renderer/src/ctx.d.ts +16 -0
- package/components/form-item-renderer/src/index.vue.d.ts +93 -0
- package/components/form-item-renderer/src/types.d.ts +5 -0
- package/components/form-item-renderer/src/utils.d.ts +5 -0
- package/components/form-item-renderer-template/index.d.ts +4 -0
- package/components/form-item-renderer-template/src/ctx.d.ts +7 -0
- package/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
- package/components/form-item-renderer-template/src/types.d.ts +55 -0
- package/components/information/index.d.ts +4 -0
- package/components/information/src/ctx.d.ts +13 -0
- package/components/information/src/index.vue.d.ts +23 -0
- package/components/information/src/types.d.ts +3 -0
- package/components/information-collection/index.d.ts +4 -0
- package/components/information-collection/src/ctx.d.ts +147 -0
- package/components/information-collection/src/index.vue.d.ts +302 -0
- package/components/information-collection/src/types.d.ts +6 -0
- package/components/information-tag/index.d.ts +4 -0
- package/components/information-tag/src/ctx.d.ts +64 -0
- package/components/information-tag/src/index.vue.d.ts +134 -0
- package/components/information-tag/src/types.d.ts +1 -0
- package/components/information-templates-default/index.d.ts +4 -0
- package/components/information-templates-default/src/ctx.d.ts +2 -0
- package/components/information-templates-default/src/index.vue.d.ts +2 -0
- package/components/information-templates-default/src/types.d.ts +1 -0
- package/components/input/index.d.ts +5 -0
- package/components/input/src/ctx.d.ts +269 -0
- package/components/input/src/index.vue.d.ts +1192 -0
- package/components/input/src/types.d.ts +13 -0
- package/components/input-collection/index.cjs +105 -74
- package/components/input-collection/index.d.ts +4 -0
- package/components/input-collection/index.mjs +107 -76
- package/components/input-collection/src/ctx.d.ts +137 -0
- package/components/input-collection/src/index.vue.d.ts +1141 -0
- package/components/input-collection/src/types.d.ts +29 -0
- package/components/input-link/index.d.ts +4 -0
- package/components/input-link/src/ctx.d.ts +273 -0
- package/components/input-link/src/index.vue.d.ts +577 -0
- package/components/input-link/src/types.d.ts +7 -0
- package/components/input-number/index.d.ts +4 -0
- package/components/input-number/src/ctx.d.ts +208 -0
- package/components/input-number/src/index.vue.d.ts +816 -0
- package/components/input-number/src/types.d.ts +12 -0
- package/components/input-tag/index.d.ts +5 -0
- package/components/input-tag/src/ctx.d.ts +239 -0
- package/components/input-tag/src/index.vue.d.ts +991 -0
- package/components/input-tag/src/types.d.ts +22 -0
- package/components/monaco-editor/index.d.ts +4 -0
- package/components/monaco-editor/src/ctx.d.ts +115 -0
- package/components/monaco-editor/src/index.vue.d.ts +303 -0
- package/components/monaco-editor/src/types.d.ts +7 -0
- package/components/radio/index.cjs +2 -3
- package/components/radio/index.d.ts +4 -0
- package/components/radio/index.mjs +2 -3
- package/components/radio/src/ctx.d.ts +162 -0
- package/components/radio/src/index.vue.d.ts +1311 -0
- package/components/radio/src/types.d.ts +8 -0
- package/components/renderer-data/index.d.ts +4 -0
- package/components/renderer-data/src/ctx.d.ts +12 -0
- package/components/renderer-data/src/index.vue.d.ts +20 -0
- package/components/renderer-data/src/types.d.ts +1 -0
- package/components/select/index.d.ts +5 -0
- package/components/select/src/ctx.d.ts +225 -0
- package/components/select/src/index.vue.d.ts +1043 -0
- package/components/select/src/types.d.ts +11 -0
- package/components/slider/index.d.ts +4 -0
- package/components/slider/src/ctx.d.ts +253 -0
- package/components/slider/src/index.vue.d.ts +588 -0
- package/components/slider/src/types.d.ts +7 -0
- package/components/switch/index.d.ts +4 -0
- package/components/switch/src/ctx.d.ts +208 -0
- package/components/switch/src/index.vue.d.ts +895 -0
- package/components/switch/src/types.d.ts +8 -0
- package/components/tables-select/index.d.ts +5 -0
- package/components/tables-select/src/ctx.d.ts +420 -0
- package/components/tables-select/src/index.vue.d.ts +5411 -0
- package/components/tables-select/src/types.d.ts +9 -0
- package/components/template-instances-provider/index.d.ts +3 -0
- package/components/template-instances-provider/src/index.vue.d.ts +6 -0
- package/components/templates-default/index.d.ts +4 -0
- package/components/templates-default/src/ctx.d.ts +19 -0
- package/components/templates-default/src/index.vue.d.ts +187 -0
- package/components/templates-default/src/types.d.ts +55 -0
- package/components/templates-element-plus/index.d.ts +4 -0
- package/components/templates-element-plus/src/ctx.d.ts +9 -0
- package/components/templates-element-plus/src/index.vue.d.ts +301 -0
- package/components/templates-element-plus/src/types.d.ts +13 -0
- package/components/templates-esri/index.d.ts +4 -0
- package/components/templates-esri/src/ctx.d.ts +11 -0
- package/components/templates-esri/src/index.vue.d.ts +43 -0
- package/components/templates-esri/src/types.d.ts +2 -0
- package/components/templates-layout/index.d.ts +4 -0
- package/components/templates-layout/src/ctx.d.ts +9 -0
- package/components/templates-layout/src/index.vue.d.ts +446 -0
- package/components/templates-layout/src/types.d.ts +32 -0
- package/components/templates-variant/index.d.ts +4 -0
- package/components/templates-variant/src/ctx.d.ts +11 -0
- package/components/templates-variant/src/index.vue.d.ts +43 -0
- package/components/templates-variant/src/types.d.ts +2 -0
- package/components/upload/index.cjs +2 -2
- package/components/upload/index.d.ts +5 -0
- package/components/upload/index.mjs +2 -2
- package/components/upload/src/ctx.d.ts +294 -0
- package/components/upload/src/file.vue.d.ts +492 -0
- package/components/upload/src/index.vue.d.ts +1935 -0
- package/components/upload/src/types.d.ts +13 -0
- package/components/upload-plus/index.cjs +79 -86
- package/components/upload-plus/index.d.ts +6 -0
- package/components/upload-plus/index.mjs +79 -86
- package/components/upload-plus/src/api.d.ts +38 -0
- package/components/upload-plus/src/const.d.ts +9 -0
- package/components/upload-plus/src/ctx.d.ts +148 -0
- package/components/upload-plus/src/index.vue.d.ts +1754 -0
- package/components/upload-plus/src/types.d.ts +32 -0
- package/components/van-cascader/index.d.ts +4 -0
- package/components/van-cascader/src/ctx.d.ts +284 -0
- package/components/van-cascader/src/index.vue.d.ts +2116 -0
- package/components/van-cascader/src/types.d.ts +1 -0
- package/components/var-datetime-picker/index.d.ts +4 -0
- package/components/var-datetime-picker/src/const.d.ts +10 -0
- package/components/var-datetime-picker/src/ctx.d.ts +112 -0
- package/components/var-datetime-picker/src/index.vue.d.ts +1482 -0
- package/components/var-datetime-picker/src/types.d.ts +22 -0
- package/components/vditor/index.d.ts +4 -0
- package/components/vditor/src/ctx.d.ts +122 -0
- package/components/vditor/src/index.vue.d.ts +418 -0
- package/components/vditor/src/types.d.ts +7 -0
- package/package.json +1 -1
- package/shared/element-plus/ctx.d.ts +111 -30
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Func, VueComponentPropsType } from '@vunk/core';
|
|
2
|
+
import { BasicSource } from '@vunk/form/shared';
|
|
3
|
+
import VkfInput from './index.vue';
|
|
4
|
+
export type InputSlots = {
|
|
5
|
+
prefix?: Func;
|
|
6
|
+
suffix?: Func;
|
|
7
|
+
prepend?: Func;
|
|
8
|
+
append?: Func;
|
|
9
|
+
};
|
|
10
|
+
export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfInput>, BasicSource {
|
|
11
|
+
prop?: P | P[];
|
|
12
|
+
templateType: 'VkfInput';
|
|
13
|
+
}
|
|
@@ -65,32 +65,32 @@ const emits = {
|
|
|
65
65
|
"update:modelValue": null
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
ElButton: elementPlus.ElButton,
|
|
73
|
-
VkTableColumns: tableColumns.VkTableColumns,
|
|
74
|
-
VkfFormItem: formItem.VkfFormItem,
|
|
75
|
-
VkfTemplateInstancesProvider: templateInstancesProvider.VkfTemplateInstancesProvider,
|
|
76
|
-
VkfTemplatesDefault: templatesDefault.VkfTemplatesDefault,
|
|
77
|
-
VkfRendererData: rendererData.VkfRendererData
|
|
68
|
+
const ROW_KEY = "_row_key";
|
|
69
|
+
var _sfc_main = /* @__PURE__ */vue.defineComponent({
|
|
70
|
+
...{
|
|
71
|
+
name: "VkfInputCollection"
|
|
78
72
|
},
|
|
79
|
-
|
|
73
|
+
__name: "index",
|
|
74
|
+
props: props,
|
|
80
75
|
emits,
|
|
81
|
-
setup(
|
|
82
|
-
|
|
76
|
+
setup(__props, {
|
|
77
|
+
expose: __expose,
|
|
78
|
+
emit: __emit
|
|
83
79
|
}) {
|
|
84
|
-
|
|
85
|
-
const
|
|
80
|
+
__expose();
|
|
81
|
+
const ElTable = elementPlus.ElTable;
|
|
82
|
+
const props = __props;
|
|
83
|
+
const emit = __emit;
|
|
84
|
+
const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props);
|
|
85
|
+
const readonly = composables.useComputedReadonly(props);
|
|
86
86
|
const formData = vue.computed(() => {
|
|
87
|
-
if (!
|
|
88
|
-
return
|
|
87
|
+
if (!props.prop || props.prop.length === 0) {
|
|
88
|
+
return props.modelValue;
|
|
89
89
|
}
|
|
90
90
|
const data = {};
|
|
91
91
|
core.ensetData(data, {
|
|
92
|
-
k:
|
|
93
|
-
v:
|
|
92
|
+
k: props.prop,
|
|
93
|
+
v: props.modelValue
|
|
94
94
|
});
|
|
95
95
|
return data;
|
|
96
96
|
});
|
|
@@ -100,11 +100,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
100
100
|
getExpandRowKeys
|
|
101
101
|
};
|
|
102
102
|
const fullColumns = vue.computed(() => {
|
|
103
|
-
return
|
|
103
|
+
return props.columns.map(column => {
|
|
104
104
|
return {
|
|
105
105
|
...column,
|
|
106
106
|
slots: e => {
|
|
107
|
-
const prop = [
|
|
107
|
+
const prop = [props.prop ?? [], e.$index, column.prop].flat();
|
|
108
108
|
const formItemProps = {
|
|
109
109
|
prop,
|
|
110
110
|
readonly: readonly.value,
|
|
@@ -121,12 +121,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
121
|
};
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
|
-
const expandFormItemRaws = vue.computed(() =>
|
|
124
|
+
const expandFormItemRaws = vue.computed(() => props.columns.filter(e => e.expandVisible));
|
|
125
125
|
const expandColumn = {
|
|
126
126
|
type: "expand",
|
|
127
127
|
slots: e => {
|
|
128
128
|
const source = expandFormItemRaws.value.map(column => {
|
|
129
|
-
const prop = [
|
|
129
|
+
const prop = [props.prop ?? [], e.$index, column.prop].flat();
|
|
130
130
|
const formItemProps = {
|
|
131
131
|
prop,
|
|
132
132
|
label: column.label,
|
|
@@ -154,7 +154,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
154
154
|
label: "\u64CD\u4F5C",
|
|
155
155
|
align: "center",
|
|
156
156
|
width: "85",
|
|
157
|
-
hidden: readonly.value || !
|
|
157
|
+
hidden: readonly.value || !props.splicable,
|
|
158
158
|
className: "vk-input-collection__buttons",
|
|
159
159
|
slots: ({
|
|
160
160
|
$index
|
|
@@ -178,29 +178,28 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
178
178
|
return data;
|
|
179
179
|
});
|
|
180
180
|
function handlePlus(index) {
|
|
181
|
-
const data = cloneDeep.cloneDeep(
|
|
182
|
-
data.splice(index + 1, 0, cloneDeep.cloneDeep(
|
|
181
|
+
const data = cloneDeep.cloneDeep(props.modelValue);
|
|
182
|
+
data.splice(index + 1, 0, cloneDeep.cloneDeep(props.defaultItemValue));
|
|
183
183
|
emit("update:modelValue", data);
|
|
184
184
|
setExpandRowKeys([]);
|
|
185
185
|
}
|
|
186
186
|
function handleMinus(index) {
|
|
187
|
-
const data = cloneDeep.cloneDeep(
|
|
187
|
+
const data = cloneDeep.cloneDeep(props.modelValue);
|
|
188
188
|
data.splice(index, 1);
|
|
189
189
|
emit("update:modelValue", data);
|
|
190
190
|
setExpandRowKeys([]);
|
|
191
191
|
}
|
|
192
192
|
const addToFirst = () => {
|
|
193
|
-
emit("update:modelValue", [cloneDeep.cloneDeep(
|
|
193
|
+
emit("update:modelValue", [cloneDeep.cloneDeep(props.defaultItemValue), ...(props.modelValue ?? [])]);
|
|
194
194
|
setExpandRowKeys([]);
|
|
195
195
|
};
|
|
196
196
|
const handleFormSetData = e => {
|
|
197
197
|
const data = cloneDeep.cloneDeep(formData.value);
|
|
198
198
|
core.ensetData(data, e);
|
|
199
|
-
emit("update:modelValue", core.getValue(data,
|
|
199
|
+
emit("update:modelValue", core.getValue(data, props.prop));
|
|
200
200
|
};
|
|
201
|
-
const ROW_KEY = "_row_key";
|
|
202
201
|
const tableData = vue.computed(() => {
|
|
203
|
-
return
|
|
202
|
+
return props.modelValue?.map((e, index) => {
|
|
204
203
|
return {
|
|
205
204
|
...e,
|
|
206
205
|
[ROW_KEY]: `${index}`
|
|
@@ -208,7 +207,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
208
207
|
});
|
|
209
208
|
});
|
|
210
209
|
const expandRowKeys = vue.ref([]);
|
|
211
|
-
if (
|
|
210
|
+
if (props.defaultExpandAll) {
|
|
212
211
|
expandRowKeys.value = tableData.value.map(e => e[ROW_KEY]);
|
|
213
212
|
}
|
|
214
213
|
const handleExpandChange = (row, expandedRows) => {
|
|
@@ -233,19 +232,58 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
233
232
|
function getExpandRowKeys() {
|
|
234
233
|
return expandRowKeys.value;
|
|
235
234
|
}
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
const __returned__ = {
|
|
236
|
+
ElTable,
|
|
237
|
+
props,
|
|
238
|
+
emit,
|
|
238
239
|
formItemBindProps,
|
|
239
240
|
readonly,
|
|
240
|
-
handleFormSetData,
|
|
241
241
|
formData,
|
|
242
|
-
|
|
242
|
+
innerCtx,
|
|
243
|
+
fullColumns,
|
|
244
|
+
expandFormItemRaws,
|
|
245
|
+
expandColumn,
|
|
246
|
+
buttonsColumn,
|
|
247
|
+
allColumns,
|
|
248
|
+
handlePlus,
|
|
249
|
+
handleMinus,
|
|
250
|
+
addToFirst,
|
|
251
|
+
handleFormSetData,
|
|
252
|
+
ROW_KEY,
|
|
253
|
+
tableData,
|
|
243
254
|
expandRowKeys,
|
|
244
255
|
handleExpandChange,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
256
|
+
setExpandRowKeys,
|
|
257
|
+
addExpandRowKey,
|
|
258
|
+
removeExpandRowKey,
|
|
259
|
+
getExpandRowKeys,
|
|
260
|
+
get Plus() {
|
|
261
|
+
return index.plus_default;
|
|
262
|
+
},
|
|
263
|
+
get VkfFormItem() {
|
|
264
|
+
return formItem.VkfFormItem;
|
|
265
|
+
},
|
|
266
|
+
get VkfRendererData() {
|
|
267
|
+
return rendererData.VkfRendererData;
|
|
268
|
+
},
|
|
269
|
+
get VkfTemplateInstancesProvider() {
|
|
270
|
+
return templateInstancesProvider.VkfTemplateInstancesProvider;
|
|
271
|
+
},
|
|
272
|
+
get VkfTemplatesDefault() {
|
|
273
|
+
return templatesDefault.VkfTemplatesDefault;
|
|
274
|
+
},
|
|
275
|
+
get VkTableColumns() {
|
|
276
|
+
return tableColumns.VkTableColumns;
|
|
277
|
+
},
|
|
278
|
+
get ElButton() {
|
|
279
|
+
return elementPlus.ElButton;
|
|
280
|
+
}
|
|
248
281
|
};
|
|
282
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
283
|
+
enumerable: false,
|
|
284
|
+
value: true
|
|
285
|
+
});
|
|
286
|
+
return __returned__;
|
|
249
287
|
}
|
|
250
288
|
});
|
|
251
289
|
|
|
@@ -254,71 +292,64 @@ const _hoisted_1 = {
|
|
|
254
292
|
class: "vkf-input-collection-options"
|
|
255
293
|
};
|
|
256
294
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
257
|
-
|
|
258
|
-
const _component_ElButton = vue.resolveComponent("ElButton");
|
|
259
|
-
const _component_VkTableColumns = vue.resolveComponent("VkTableColumns");
|
|
260
|
-
const _component_ElTable = vue.resolveComponent("ElTable");
|
|
261
|
-
const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
|
|
262
|
-
const _component_VkfRendererData = vue.resolveComponent("VkfRendererData");
|
|
263
|
-
const _component_VkfTemplateInstancesProvider = vue.resolveComponent("VkfTemplateInstancesProvider");
|
|
264
|
-
return vue.openBlock(), vue.createBlock(_component_VkfTemplateInstancesProvider, null, {
|
|
295
|
+
return vue.openBlock(), vue.createBlock($setup["VkfTemplateInstancesProvider"], null, {
|
|
265
296
|
placeholder: vue.withCtx(() => [
|
|
266
|
-
vue.createVNode(
|
|
297
|
+
vue.createVNode($setup["VkfTemplatesDefault"])
|
|
267
298
|
]),
|
|
268
299
|
default: vue.withCtx(() => [
|
|
269
|
-
vue.createVNode(
|
|
270
|
-
data:
|
|
271
|
-
onSetData:
|
|
300
|
+
vue.createVNode($setup["VkfRendererData"], {
|
|
301
|
+
data: $setup.formData,
|
|
302
|
+
onSetData: $setup.handleFormSetData
|
|
272
303
|
}, {
|
|
273
304
|
default: vue.withCtx(() => [
|
|
274
305
|
vue.createVNode(
|
|
275
|
-
|
|
276
|
-
vue.normalizeProps(vue.guardReactiveProps(
|
|
306
|
+
$setup["VkfFormItem"],
|
|
307
|
+
vue.normalizeProps(vue.guardReactiveProps($setup.formItemBindProps)),
|
|
277
308
|
vue.createSlots({
|
|
278
309
|
default: vue.withCtx(() => [
|
|
279
|
-
|
|
280
|
-
vue.createVNode(
|
|
310
|
+
!$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
311
|
+
vue.createVNode($setup["ElButton"], {
|
|
281
312
|
type: "primary",
|
|
282
|
-
onClick:
|
|
313
|
+
onClick: $setup.addToFirst
|
|
283
314
|
}, {
|
|
284
315
|
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
285
316
|
vue.createTextVNode(" \u6DFB\u52A0 ")
|
|
286
317
|
])),
|
|
287
|
-
_: 1
|
|
288
|
-
|
|
289
|
-
}
|
|
318
|
+
_: 1,
|
|
319
|
+
__: [1]
|
|
320
|
+
})
|
|
290
321
|
])) : vue.createCommentVNode("v-if", true),
|
|
291
|
-
vue.createVNode(
|
|
292
|
-
data:
|
|
322
|
+
vue.createVNode($setup["ElTable"], {
|
|
323
|
+
data: $setup.tableData,
|
|
293
324
|
class: "vkf-input-collection-table",
|
|
294
|
-
"row-key":
|
|
295
|
-
"expand-row-keys":
|
|
296
|
-
onExpandChange:
|
|
325
|
+
"row-key": $setup.ROW_KEY,
|
|
326
|
+
"expand-row-keys": $setup.expandRowKeys,
|
|
327
|
+
onExpandChange: $setup.handleExpandChange
|
|
297
328
|
}, {
|
|
298
329
|
default: vue.withCtx(() => [
|
|
299
|
-
vue.createVNode(
|
|
330
|
+
vue.createVNode($setup["VkTableColumns"], { source: $setup.allColumns }, null, 8, ["source"])
|
|
300
331
|
]),
|
|
301
332
|
_: 1
|
|
302
333
|
/* STABLE */
|
|
303
|
-
}, 8, ["data", "
|
|
334
|
+
}, 8, ["data", "expand-row-keys"])
|
|
304
335
|
]),
|
|
305
336
|
_: 2
|
|
306
337
|
/* DYNAMIC */
|
|
307
338
|
}, [
|
|
308
|
-
|
|
339
|
+
!$setup.readonly && _ctx.splicable && _ctx.labelActions ? {
|
|
309
340
|
name: "labelActions",
|
|
310
341
|
fn: vue.withCtx(() => [
|
|
311
|
-
vue.createVNode(
|
|
342
|
+
vue.createVNode($setup["ElButton"], {
|
|
312
343
|
size: "small",
|
|
313
|
-
icon:
|
|
314
|
-
onClick:
|
|
344
|
+
icon: $setup.Plus,
|
|
345
|
+
onClick: $setup.addToFirst
|
|
315
346
|
}, {
|
|
316
347
|
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
317
348
|
vue.createTextVNode(" \u6DFB\u52A0 ")
|
|
318
349
|
])),
|
|
319
|
-
_: 1
|
|
320
|
-
|
|
321
|
-
}, 8, ["icon"
|
|
350
|
+
_: 1,
|
|
351
|
+
__: [0]
|
|
352
|
+
}, 8, ["icon"])
|
|
322
353
|
]),
|
|
323
354
|
key: "0"
|
|
324
355
|
} : void 0
|
|
@@ -329,7 +360,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
329
360
|
]),
|
|
330
361
|
_: 1
|
|
331
362
|
/* STABLE */
|
|
332
|
-
}, 8, ["data"
|
|
363
|
+
}, 8, ["data"]),
|
|
333
364
|
vue.renderSlot(_ctx.$slots, "default")
|
|
334
365
|
]),
|
|
335
366
|
_: 3
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, createVNode, Fragment, ref,
|
|
1
|
+
import { defineComponent, computed, createVNode, Fragment, ref, openBlock, createBlock, withCtx, normalizeProps, guardReactiveProps, createSlots, createElementBlock, createTextVNode, createCommentVNode, renderSlot } from 'vue';
|
|
2
2
|
import { p as plus_default, f as minus_default } from '../index2.mjs';
|
|
3
3
|
import { ensetData, getValue } from '@vunk/core';
|
|
4
4
|
import { VkfFieldset } from '@vunk/form/components/fieldset';
|
|
@@ -9,7 +9,7 @@ import { VkfTemplateInstancesProvider } from '@vunk/form/components/template-ins
|
|
|
9
9
|
import { VkfTemplatesDefault } from '@vunk/form/components/templates-default';
|
|
10
10
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
11
11
|
import { VkTableColumns } from '@vunk/plus/components/table-columns';
|
|
12
|
-
import {
|
|
12
|
+
import { ElButton, ElTable } from 'element-plus';
|
|
13
13
|
import { c as cloneDeep } from '../cloneDeep.mjs';
|
|
14
14
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
15
15
|
import '../isObject.mjs';
|
|
@@ -61,32 +61,32 @@ const emits = {
|
|
|
61
61
|
"update:modelValue": null
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ElButton,
|
|
69
|
-
VkTableColumns,
|
|
70
|
-
VkfFormItem,
|
|
71
|
-
VkfTemplateInstancesProvider,
|
|
72
|
-
VkfTemplatesDefault,
|
|
73
|
-
VkfRendererData
|
|
64
|
+
const ROW_KEY = "_row_key";
|
|
65
|
+
var _sfc_main = /* @__PURE__ */defineComponent({
|
|
66
|
+
...{
|
|
67
|
+
name: "VkfInputCollection"
|
|
74
68
|
},
|
|
75
|
-
|
|
69
|
+
__name: "index",
|
|
70
|
+
props: props,
|
|
76
71
|
emits,
|
|
77
|
-
setup(
|
|
78
|
-
|
|
72
|
+
setup(__props, {
|
|
73
|
+
expose: __expose,
|
|
74
|
+
emit: __emit
|
|
79
75
|
}) {
|
|
80
|
-
|
|
81
|
-
const
|
|
76
|
+
__expose();
|
|
77
|
+
const ElTable$1 = ElTable;
|
|
78
|
+
const props = __props;
|
|
79
|
+
const emit = __emit;
|
|
80
|
+
const formItemBindProps = _VkfFormItemCtx.createBindProps(props);
|
|
81
|
+
const readonly = useComputedReadonly(props);
|
|
82
82
|
const formData = computed(() => {
|
|
83
|
-
if (!
|
|
84
|
-
return
|
|
83
|
+
if (!props.prop || props.prop.length === 0) {
|
|
84
|
+
return props.modelValue;
|
|
85
85
|
}
|
|
86
86
|
const data = {};
|
|
87
87
|
ensetData(data, {
|
|
88
|
-
k:
|
|
89
|
-
v:
|
|
88
|
+
k: props.prop,
|
|
89
|
+
v: props.modelValue
|
|
90
90
|
});
|
|
91
91
|
return data;
|
|
92
92
|
});
|
|
@@ -96,11 +96,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
96
|
getExpandRowKeys
|
|
97
97
|
};
|
|
98
98
|
const fullColumns = computed(() => {
|
|
99
|
-
return
|
|
99
|
+
return props.columns.map(column => {
|
|
100
100
|
return {
|
|
101
101
|
...column,
|
|
102
102
|
slots: e => {
|
|
103
|
-
const prop = [
|
|
103
|
+
const prop = [props.prop ?? [], e.$index, column.prop].flat();
|
|
104
104
|
const formItemProps = {
|
|
105
105
|
prop,
|
|
106
106
|
readonly: readonly.value,
|
|
@@ -117,12 +117,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
|
-
const expandFormItemRaws = computed(() =>
|
|
120
|
+
const expandFormItemRaws = computed(() => props.columns.filter(e => e.expandVisible));
|
|
121
121
|
const expandColumn = {
|
|
122
122
|
type: "expand",
|
|
123
123
|
slots: e => {
|
|
124
124
|
const source = expandFormItemRaws.value.map(column => {
|
|
125
|
-
const prop = [
|
|
125
|
+
const prop = [props.prop ?? [], e.$index, column.prop].flat();
|
|
126
126
|
const formItemProps = {
|
|
127
127
|
prop,
|
|
128
128
|
label: column.label,
|
|
@@ -150,7 +150,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
150
|
label: "\u64CD\u4F5C",
|
|
151
151
|
align: "center",
|
|
152
152
|
width: "85",
|
|
153
|
-
hidden: readonly.value || !
|
|
153
|
+
hidden: readonly.value || !props.splicable,
|
|
154
154
|
className: "vk-input-collection__buttons",
|
|
155
155
|
slots: ({
|
|
156
156
|
$index
|
|
@@ -174,29 +174,28 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
174
174
|
return data;
|
|
175
175
|
});
|
|
176
176
|
function handlePlus(index) {
|
|
177
|
-
const data = cloneDeep(
|
|
178
|
-
data.splice(index + 1, 0, cloneDeep(
|
|
177
|
+
const data = cloneDeep(props.modelValue);
|
|
178
|
+
data.splice(index + 1, 0, cloneDeep(props.defaultItemValue));
|
|
179
179
|
emit("update:modelValue", data);
|
|
180
180
|
setExpandRowKeys([]);
|
|
181
181
|
}
|
|
182
182
|
function handleMinus(index) {
|
|
183
|
-
const data = cloneDeep(
|
|
183
|
+
const data = cloneDeep(props.modelValue);
|
|
184
184
|
data.splice(index, 1);
|
|
185
185
|
emit("update:modelValue", data);
|
|
186
186
|
setExpandRowKeys([]);
|
|
187
187
|
}
|
|
188
188
|
const addToFirst = () => {
|
|
189
|
-
emit("update:modelValue", [cloneDeep(
|
|
189
|
+
emit("update:modelValue", [cloneDeep(props.defaultItemValue), ...(props.modelValue ?? [])]);
|
|
190
190
|
setExpandRowKeys([]);
|
|
191
191
|
};
|
|
192
192
|
const handleFormSetData = e => {
|
|
193
193
|
const data = cloneDeep(formData.value);
|
|
194
194
|
ensetData(data, e);
|
|
195
|
-
emit("update:modelValue", getValue(data,
|
|
195
|
+
emit("update:modelValue", getValue(data, props.prop));
|
|
196
196
|
};
|
|
197
|
-
const ROW_KEY = "_row_key";
|
|
198
197
|
const tableData = computed(() => {
|
|
199
|
-
return
|
|
198
|
+
return props.modelValue?.map((e, index) => {
|
|
200
199
|
return {
|
|
201
200
|
...e,
|
|
202
201
|
[ROW_KEY]: `${index}`
|
|
@@ -204,7 +203,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
204
203
|
});
|
|
205
204
|
});
|
|
206
205
|
const expandRowKeys = ref([]);
|
|
207
|
-
if (
|
|
206
|
+
if (props.defaultExpandAll) {
|
|
208
207
|
expandRowKeys.value = tableData.value.map(e => e[ROW_KEY]);
|
|
209
208
|
}
|
|
210
209
|
const handleExpandChange = (row, expandedRows) => {
|
|
@@ -229,19 +228,58 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
229
228
|
function getExpandRowKeys() {
|
|
230
229
|
return expandRowKeys.value;
|
|
231
230
|
}
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
const __returned__ = {
|
|
232
|
+
ElTable: ElTable$1,
|
|
233
|
+
props,
|
|
234
|
+
emit,
|
|
234
235
|
formItemBindProps,
|
|
235
236
|
readonly,
|
|
236
|
-
handleFormSetData,
|
|
237
237
|
formData,
|
|
238
|
-
|
|
238
|
+
innerCtx,
|
|
239
|
+
fullColumns,
|
|
240
|
+
expandFormItemRaws,
|
|
241
|
+
expandColumn,
|
|
242
|
+
buttonsColumn,
|
|
243
|
+
allColumns,
|
|
244
|
+
handlePlus,
|
|
245
|
+
handleMinus,
|
|
246
|
+
addToFirst,
|
|
247
|
+
handleFormSetData,
|
|
248
|
+
ROW_KEY,
|
|
249
|
+
tableData,
|
|
239
250
|
expandRowKeys,
|
|
240
251
|
handleExpandChange,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
252
|
+
setExpandRowKeys,
|
|
253
|
+
addExpandRowKey,
|
|
254
|
+
removeExpandRowKey,
|
|
255
|
+
getExpandRowKeys,
|
|
256
|
+
get Plus() {
|
|
257
|
+
return plus_default;
|
|
258
|
+
},
|
|
259
|
+
get VkfFormItem() {
|
|
260
|
+
return VkfFormItem;
|
|
261
|
+
},
|
|
262
|
+
get VkfRendererData() {
|
|
263
|
+
return VkfRendererData;
|
|
264
|
+
},
|
|
265
|
+
get VkfTemplateInstancesProvider() {
|
|
266
|
+
return VkfTemplateInstancesProvider;
|
|
267
|
+
},
|
|
268
|
+
get VkfTemplatesDefault() {
|
|
269
|
+
return VkfTemplatesDefault;
|
|
270
|
+
},
|
|
271
|
+
get VkTableColumns() {
|
|
272
|
+
return VkTableColumns;
|
|
273
|
+
},
|
|
274
|
+
get ElButton() {
|
|
275
|
+
return ElButton;
|
|
276
|
+
}
|
|
244
277
|
};
|
|
278
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
279
|
+
enumerable: false,
|
|
280
|
+
value: true
|
|
281
|
+
});
|
|
282
|
+
return __returned__;
|
|
245
283
|
}
|
|
246
284
|
});
|
|
247
285
|
|
|
@@ -250,71 +288,64 @@ const _hoisted_1 = {
|
|
|
250
288
|
class: "vkf-input-collection-options"
|
|
251
289
|
};
|
|
252
290
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
253
|
-
|
|
254
|
-
const _component_ElButton = resolveComponent("ElButton");
|
|
255
|
-
const _component_VkTableColumns = resolveComponent("VkTableColumns");
|
|
256
|
-
const _component_ElTable = resolveComponent("ElTable");
|
|
257
|
-
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
258
|
-
const _component_VkfRendererData = resolveComponent("VkfRendererData");
|
|
259
|
-
const _component_VkfTemplateInstancesProvider = resolveComponent("VkfTemplateInstancesProvider");
|
|
260
|
-
return openBlock(), createBlock(_component_VkfTemplateInstancesProvider, null, {
|
|
291
|
+
return openBlock(), createBlock($setup["VkfTemplateInstancesProvider"], null, {
|
|
261
292
|
placeholder: withCtx(() => [
|
|
262
|
-
createVNode(
|
|
293
|
+
createVNode($setup["VkfTemplatesDefault"])
|
|
263
294
|
]),
|
|
264
295
|
default: withCtx(() => [
|
|
265
|
-
createVNode(
|
|
266
|
-
data:
|
|
267
|
-
onSetData:
|
|
296
|
+
createVNode($setup["VkfRendererData"], {
|
|
297
|
+
data: $setup.formData,
|
|
298
|
+
onSetData: $setup.handleFormSetData
|
|
268
299
|
}, {
|
|
269
300
|
default: withCtx(() => [
|
|
270
301
|
createVNode(
|
|
271
|
-
|
|
272
|
-
normalizeProps(guardReactiveProps(
|
|
302
|
+
$setup["VkfFormItem"],
|
|
303
|
+
normalizeProps(guardReactiveProps($setup.formItemBindProps)),
|
|
273
304
|
createSlots({
|
|
274
305
|
default: withCtx(() => [
|
|
275
|
-
|
|
276
|
-
createVNode(
|
|
306
|
+
!$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
307
|
+
createVNode($setup["ElButton"], {
|
|
277
308
|
type: "primary",
|
|
278
|
-
onClick:
|
|
309
|
+
onClick: $setup.addToFirst
|
|
279
310
|
}, {
|
|
280
311
|
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
281
312
|
createTextVNode(" \u6DFB\u52A0 ")
|
|
282
313
|
])),
|
|
283
|
-
_: 1
|
|
284
|
-
|
|
285
|
-
}
|
|
314
|
+
_: 1,
|
|
315
|
+
__: [1]
|
|
316
|
+
})
|
|
286
317
|
])) : createCommentVNode("v-if", true),
|
|
287
|
-
createVNode(
|
|
288
|
-
data:
|
|
318
|
+
createVNode($setup["ElTable"], {
|
|
319
|
+
data: $setup.tableData,
|
|
289
320
|
class: "vkf-input-collection-table",
|
|
290
|
-
"row-key":
|
|
291
|
-
"expand-row-keys":
|
|
292
|
-
onExpandChange:
|
|
321
|
+
"row-key": $setup.ROW_KEY,
|
|
322
|
+
"expand-row-keys": $setup.expandRowKeys,
|
|
323
|
+
onExpandChange: $setup.handleExpandChange
|
|
293
324
|
}, {
|
|
294
325
|
default: withCtx(() => [
|
|
295
|
-
createVNode(
|
|
326
|
+
createVNode($setup["VkTableColumns"], { source: $setup.allColumns }, null, 8, ["source"])
|
|
296
327
|
]),
|
|
297
328
|
_: 1
|
|
298
329
|
/* STABLE */
|
|
299
|
-
}, 8, ["data", "
|
|
330
|
+
}, 8, ["data", "expand-row-keys"])
|
|
300
331
|
]),
|
|
301
332
|
_: 2
|
|
302
333
|
/* DYNAMIC */
|
|
303
334
|
}, [
|
|
304
|
-
|
|
335
|
+
!$setup.readonly && _ctx.splicable && _ctx.labelActions ? {
|
|
305
336
|
name: "labelActions",
|
|
306
337
|
fn: withCtx(() => [
|
|
307
|
-
createVNode(
|
|
338
|
+
createVNode($setup["ElButton"], {
|
|
308
339
|
size: "small",
|
|
309
|
-
icon:
|
|
310
|
-
onClick:
|
|
340
|
+
icon: $setup.Plus,
|
|
341
|
+
onClick: $setup.addToFirst
|
|
311
342
|
}, {
|
|
312
343
|
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
313
344
|
createTextVNode(" \u6DFB\u52A0 ")
|
|
314
345
|
])),
|
|
315
|
-
_: 1
|
|
316
|
-
|
|
317
|
-
}, 8, ["icon"
|
|
346
|
+
_: 1,
|
|
347
|
+
__: [0]
|
|
348
|
+
}, 8, ["icon"])
|
|
318
349
|
]),
|
|
319
350
|
key: "0"
|
|
320
351
|
} : void 0
|
|
@@ -325,7 +356,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
325
356
|
]),
|
|
326
357
|
_: 1
|
|
327
358
|
/* STABLE */
|
|
328
|
-
}, 8, ["data"
|
|
359
|
+
}, 8, ["data"]),
|
|
329
360
|
renderSlot(_ctx.$slots, "default")
|
|
330
361
|
]),
|
|
331
362
|
_: 3
|