@vunk/form 2.6.0 → 2.6.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.
|
@@ -103,6 +103,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
103
103
|
});
|
|
104
104
|
return data;
|
|
105
105
|
});
|
|
106
|
+
const innerCtx = {
|
|
107
|
+
addExpandRowKey,
|
|
108
|
+
removeExpandRowKey,
|
|
109
|
+
getExpandRowKeys
|
|
110
|
+
};
|
|
106
111
|
const fullColumns = vue.computed(() => {
|
|
107
112
|
return props2.columns.map(column => {
|
|
108
113
|
return {
|
|
@@ -118,7 +123,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
118
123
|
return vue.createVNode(formItemRenderer.VkfFormItemRenderer, {
|
|
119
124
|
"source": [{
|
|
120
125
|
...formItemProps,
|
|
121
|
-
...column.createTemplateProps?.(e, formItemProps)
|
|
126
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
122
127
|
}]
|
|
123
128
|
}, null);
|
|
124
129
|
}
|
|
@@ -140,7 +145,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
140
145
|
};
|
|
141
146
|
return {
|
|
142
147
|
...formItemProps,
|
|
143
|
-
...column.createTemplateProps?.(e, formItemProps)
|
|
148
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
144
149
|
};
|
|
145
150
|
});
|
|
146
151
|
return vue.createVNode(fieldset.VkfFieldset, {
|
|
@@ -221,6 +226,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
221
226
|
function setExpandRowKeys(v) {
|
|
222
227
|
expandRowKeys.value = v;
|
|
223
228
|
}
|
|
229
|
+
function addExpandRowKey(v) {
|
|
230
|
+
if (expandRowKeys.value.indexOf(v) === -1) {
|
|
231
|
+
expandRowKeys.value.push(v);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function removeExpandRowKey(v) {
|
|
235
|
+
for (let i = 0; i < expandRowKeys.value.length; i++) {
|
|
236
|
+
if (expandRowKeys.value[i] === v) {
|
|
237
|
+
expandRowKeys.value.splice(i, 1);
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function getExpandRowKeys() {
|
|
243
|
+
return expandRowKeys.value;
|
|
244
|
+
}
|
|
224
245
|
return {
|
|
225
246
|
addToFirst,
|
|
226
247
|
formItemBindProps,
|
|
@@ -99,6 +99,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
99
|
});
|
|
100
100
|
return data;
|
|
101
101
|
});
|
|
102
|
+
const innerCtx = {
|
|
103
|
+
addExpandRowKey,
|
|
104
|
+
removeExpandRowKey,
|
|
105
|
+
getExpandRowKeys
|
|
106
|
+
};
|
|
102
107
|
const fullColumns = computed(() => {
|
|
103
108
|
return props2.columns.map(column => {
|
|
104
109
|
return {
|
|
@@ -114,7 +119,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
114
119
|
return createVNode(VkfFormItemRenderer, {
|
|
115
120
|
"source": [{
|
|
116
121
|
...formItemProps,
|
|
117
|
-
...column.createTemplateProps?.(e, formItemProps)
|
|
122
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
118
123
|
}]
|
|
119
124
|
}, null);
|
|
120
125
|
}
|
|
@@ -136,7 +141,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
136
141
|
};
|
|
137
142
|
return {
|
|
138
143
|
...formItemProps,
|
|
139
|
-
...column.createTemplateProps?.(e, formItemProps)
|
|
144
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
140
145
|
};
|
|
141
146
|
});
|
|
142
147
|
return createVNode(VkfFieldset, {
|
|
@@ -217,6 +222,22 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
217
222
|
function setExpandRowKeys(v) {
|
|
218
223
|
expandRowKeys.value = v;
|
|
219
224
|
}
|
|
225
|
+
function addExpandRowKey(v) {
|
|
226
|
+
if (expandRowKeys.value.indexOf(v) === -1) {
|
|
227
|
+
expandRowKeys.value.push(v);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function removeExpandRowKey(v) {
|
|
231
|
+
for (let i = 0; i < expandRowKeys.value.length; i++) {
|
|
232
|
+
if (expandRowKeys.value[i] === v) {
|
|
233
|
+
expandRowKeys.value.splice(i, 1);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function getExpandRowKeys() {
|
|
239
|
+
return expandRowKeys.value;
|
|
240
|
+
}
|
|
220
241
|
return {
|
|
221
242
|
addToFirst,
|
|
222
243
|
formItemBindProps,
|
|
@@ -19,5 +19,9 @@ export type Column<R extends NormalObject = NormalObject, SourceType extends Nor
|
|
|
19
19
|
}, formItemProps: {
|
|
20
20
|
prop: Array<string | number>;
|
|
21
21
|
readonly: boolean;
|
|
22
|
+
}, innerContext: {
|
|
23
|
+
addExpandRowKey: (rowKey: string) => void;
|
|
24
|
+
removeExpandRowKey: (rowKey: string) => void;
|
|
25
|
+
getExpandRowKeys: () => string[];
|
|
22
26
|
}) => Partial<SourceType>;
|
|
23
27
|
};
|