@vunk/form 2.6.1 → 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,9 +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,
|
|
122
|
-
setExpandRowKeys
|
|
123
|
-
})
|
|
126
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
124
127
|
}]
|
|
125
128
|
}, null);
|
|
126
129
|
}
|
|
@@ -142,9 +145,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
142
145
|
};
|
|
143
146
|
return {
|
|
144
147
|
...formItemProps,
|
|
145
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
146
|
-
setExpandRowKeys
|
|
147
|
-
})
|
|
148
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
148
149
|
};
|
|
149
150
|
});
|
|
150
151
|
return vue.createVNode(fieldset.VkfFieldset, {
|
|
@@ -225,6 +226,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
225
226
|
function setExpandRowKeys(v) {
|
|
226
227
|
expandRowKeys.value = v;
|
|
227
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
|
+
}
|
|
228
245
|
return {
|
|
229
246
|
addToFirst,
|
|
230
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,9 +119,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
114
119
|
return createVNode(VkfFormItemRenderer, {
|
|
115
120
|
"source": [{
|
|
116
121
|
...formItemProps,
|
|
117
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
118
|
-
setExpandRowKeys
|
|
119
|
-
})
|
|
122
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
120
123
|
}]
|
|
121
124
|
}, null);
|
|
122
125
|
}
|
|
@@ -138,9 +141,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
138
141
|
};
|
|
139
142
|
return {
|
|
140
143
|
...formItemProps,
|
|
141
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
142
|
-
setExpandRowKeys
|
|
143
|
-
})
|
|
144
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
144
145
|
};
|
|
145
146
|
});
|
|
146
147
|
return createVNode(VkfFieldset, {
|
|
@@ -221,6 +222,22 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
221
222
|
function setExpandRowKeys(v) {
|
|
222
223
|
expandRowKeys.value = v;
|
|
223
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
|
+
}
|
|
224
241
|
return {
|
|
225
242
|
addToFirst,
|
|
226
243
|
formItemBindProps,
|
|
@@ -20,6 +20,8 @@ export type Column<R extends NormalObject = NormalObject, SourceType extends Nor
|
|
|
20
20
|
prop: Array<string | number>;
|
|
21
21
|
readonly: boolean;
|
|
22
22
|
}, innerContext: {
|
|
23
|
-
|
|
23
|
+
addExpandRowKey: (rowKey: string) => void;
|
|
24
|
+
removeExpandRowKey: (rowKey: string) => void;
|
|
25
|
+
getExpandRowKeys: () => string[];
|
|
24
26
|
}) => Partial<SourceType>;
|
|
25
27
|
};
|