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/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 isVNodeChild = (value) => {
4313
- return isVNode(value) || typeof value === "string" || typeof value === "number";
4314
- };
4315
- const renderSlotContent = (slotConfig2, slotData) => {
4316
- if (isVNodeChild(slotConfig2)) {
4317
- return slotConfig2;
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 slotConfig2 === "function") {
4320
- return slotConfig2(slotData, formModel);
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
- hasComponentSlots(schema) ? {
4555
- name: slotName,
4556
- fn: withCtx((slotData) => [
4557
- (openBlock(), createBlock(resolveDynamicComponent(renderSlotContent(slotConfig, slotData))))
4558
- ]),
4559
- key: "0"
4560
- } : void 0
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 = (slotName2) => {
6020
- const name = slotName2.toString();
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();