@tmagic/form 1.2.0-beta.8 → 1.2.0-beta.9
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/dist/tmagic-form.mjs +15 -2
- package/dist/tmagic-form.mjs.map +1 -1
- package/dist/tmagic-form.umd.js +15 -2
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/Form.vue +9 -1
- package/src/containers/Container.vue +7 -4
- package/src/utils/form.ts +4 -0
package/dist/tmagic-form.mjs
CHANGED
|
@@ -112,6 +112,9 @@ const filterFunction = (mForm, config, props) => {
|
|
|
112
112
|
});
|
|
113
113
|
};
|
|
114
114
|
const display = function(mForm, config, props) {
|
|
115
|
+
if (config === "expand") {
|
|
116
|
+
return config;
|
|
117
|
+
}
|
|
115
118
|
if (typeof config === "function") {
|
|
116
119
|
return filterFunction(mForm, config, props);
|
|
117
120
|
}
|
|
@@ -224,10 +227,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
224
227
|
return type2?.replace(/([A-Z])/g, "-$1").toLowerCase() || (items.value ? "" : "text");
|
|
225
228
|
});
|
|
226
229
|
const display$1 = computed(() => {
|
|
227
|
-
|
|
230
|
+
const value = display(mForm, props.config.display, props);
|
|
231
|
+
if (value === "expand") {
|
|
228
232
|
return expand.value;
|
|
229
233
|
}
|
|
230
|
-
return
|
|
234
|
+
return value;
|
|
231
235
|
});
|
|
232
236
|
const itemLabelWidth = computed(() => props.config.labelWidth || props.labelWidth);
|
|
233
237
|
watchEffect(() => {
|
|
@@ -395,6 +399,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
395
399
|
], 64)) : createCommentVNode("", true),
|
|
396
400
|
__props.config.expand && unref(type) !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
397
401
|
createVNode(unref(TMagicButton), {
|
|
402
|
+
type: "primary",
|
|
403
|
+
size: "small",
|
|
398
404
|
text: "",
|
|
399
405
|
onClick: expandHandler
|
|
400
406
|
}, {
|
|
@@ -2407,6 +2413,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2407
2413
|
}
|
|
2408
2414
|
}
|
|
2409
2415
|
});
|
|
2416
|
+
watchEffect(() => {
|
|
2417
|
+
formState.initValues = props.initValues;
|
|
2418
|
+
formState.config = props.config;
|
|
2419
|
+
formState.keyProp = props.keyProp;
|
|
2420
|
+
formState.popperClass = props.popperClass;
|
|
2421
|
+
formState.parentValues = props.parentValues;
|
|
2422
|
+
});
|
|
2410
2423
|
provide("mForm", formState);
|
|
2411
2424
|
watch(
|
|
2412
2425
|
[() => props.config, () => props.initValues],
|