knt-shared 1.6.7 → 1.6.8
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/components/Form/BasicForm.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +18 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -20
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4309,21 +4309,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
4309
4309
|
}
|
|
4310
4310
|
return (component == null ? void 0 : component.name) || "Input";
|
|
4311
4311
|
};
|
|
4312
|
-
const
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
if (
|
|
4317
|
-
return
|
|
4312
|
+
const renderSlotContent = (slotConfig, slotData) => {
|
|
4313
|
+
if (isVNode(slotConfig)) {
|
|
4314
|
+
return slotConfig;
|
|
4315
|
+
}
|
|
4316
|
+
if (typeof slotConfig === "string" || typeof slotConfig === "number") {
|
|
4317
|
+
return h("span", String(slotConfig));
|
|
4318
4318
|
}
|
|
4319
|
-
if (typeof
|
|
4320
|
-
return
|
|
4319
|
+
if (typeof slotConfig === "function") {
|
|
4320
|
+
return slotConfig(slotData, formModel);
|
|
4321
4321
|
}
|
|
4322
4322
|
return null;
|
|
4323
4323
|
};
|
|
4324
|
-
const hasComponentSlots = (schema) => {
|
|
4325
|
-
return !!(schema.componentSlots && Object.keys(schema.componentSlots).length > 0);
|
|
4326
|
-
};
|
|
4327
4324
|
const handleSubmit = async (data) => {
|
|
4328
4325
|
try {
|
|
4329
4326
|
submitLoading.value = true;
|
|
@@ -4551,13 +4548,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
4551
4548
|
"onUpdate:modelValue": ($event) => formModel[schema.field] = $event,
|
|
4552
4549
|
placeholder: getPlaceholderText(schema)
|
|
4553
4550
|
}, { ref_for: true }, getComponentProps(schema)), createSlots({ _: 2 }, [
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
(
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4551
|
+
renderList(schema.componentSlots, (slotConfig, slotName) => {
|
|
4552
|
+
return {
|
|
4553
|
+
name: slotName,
|
|
4554
|
+
fn: withCtx((slotData) => [
|
|
4555
|
+
(openBlock(), createBlock(resolveDynamicComponent(renderSlotContent(slotConfig, slotData))))
|
|
4556
|
+
])
|
|
4557
|
+
};
|
|
4558
|
+
})
|
|
4561
4559
|
]), 1040, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
4562
4560
|
];
|
|
4563
4561
|
}),
|
|
@@ -6016,8 +6014,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6016
6014
|
});
|
|
6017
6015
|
return result;
|
|
6018
6016
|
});
|
|
6019
|
-
const getFormSlotName = (
|
|
6020
|
-
const name =
|
|
6017
|
+
const getFormSlotName = (slotName) => {
|
|
6018
|
+
const name = slotName.toString();
|
|
6021
6019
|
return name.startsWith("form-") ? name.slice(5) : name;
|
|
6022
6020
|
};
|
|
6023
6021
|
const tableRef = ref();
|