knt-shared 1.6.6 → 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
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance, inject, defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, resolveComponent, createCommentVNode, createVNode, createBlock, unref, reactive, Fragment, renderList, withModifiers, ref, watch, onMounted, onUnmounted, withDirectives, vModelText, vShow, toDisplayString, withCtx, createTextVNode, useCssVars, nextTick, renderSlot, mergeProps, createSlots, onBeforeUnmount, toRef, normalizeProps, guardReactiveProps, h, resolveDynamicComponent, useSlots } from "vue";
1
+ import { getCurrentInstance, inject, defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, resolveComponent, createCommentVNode, createVNode, createBlock, unref, reactive, Fragment, renderList, withModifiers, ref, watch, onMounted, onUnmounted, withDirectives, vModelText, vShow, toDisplayString, withCtx, createTextVNode, useCssVars, nextTick, renderSlot, mergeProps, createSlots, onBeforeUnmount, toRef, normalizeProps, guardReactiveProps, h, resolveDynamicComponent, isVNode, useSlots } from "vue";
2
2
  import { Message, Transfer, Mention, Upload, Rate, Slider, Switch, RangePicker, TimePicker, DatePicker, TreeSelect, Cascader, CheckboxGroup, Checkbox, RadioGroup, Radio, Select, AutoComplete, Textarea, InputPassword, InputNumber, Input, ImagePreviewGroup, Image, Modal } from "@arco-design/web-vue";
3
3
  const configProviderInjectionKey = Symbol("ArcoConfigProvider");
4
4
  const CLASS_PREFIX = "arco";
@@ -4309,6 +4309,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4309
4309
  }
4310
4310
  return (component == null ? void 0 : component.name) || "Input";
4311
4311
  };
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
+ }
4319
+ if (typeof slotConfig === "function") {
4320
+ return slotConfig(slotData, formModel);
4321
+ }
4322
+ return null;
4323
+ };
4312
4324
  const handleSubmit = async (data) => {
4313
4325
  try {
4314
4326
  submitLoading.value = true;
@@ -4535,7 +4547,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4535
4547
  modelValue: formModel[schema.field],
4536
4548
  "onUpdate:modelValue": ($event) => formModel[schema.field] = $event,
4537
4549
  placeholder: getPlaceholderText(schema)
4538
- }, { ref_for: true }, getComponentProps(schema)), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"]))
4550
+ }, { ref_for: true }, getComponentProps(schema)), createSlots({ _: 2 }, [
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
+ })
4559
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "placeholder"]))
4539
4560
  ];
4540
4561
  }),
4541
4562
  _: 2