import { defineComponent, useAttrs, ref, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, renderSlot, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createCommentVNode, normalizeProps, createElementVNode, normalizeStyle } from 'vue';
import '../../../utils/index.mjs';
import '../../form/src/components/form-component.vue.mjs';
import { descriptionsProps } from './descriptions.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';
import _sfc_main$1 from '../../form/src/components/form-component.vue2.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlDescriptions" },
  __name: "descriptions",
  props: descriptionsProps,
  setup(__props) {
    const attrs = useAttrs();
    const bem = createNamespace("descriptions");
    const formComponents = ref([]);
    return (_ctx, _cache) => {
      const _component_ll_descriptions_item = resolveComponent("ll-descriptions-item");
      const _component_ll_icon = resolveComponent("ll-icon");
      const _component_a_descriptions = resolveComponent("a-descriptions");
      return openBlock(), createBlock(_component_a_descriptions, mergeProps({
        class: unref(bem).b()
      }, unref(attrs)), createSlots({
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, () => [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(_ctx.list, (item, i) => {
                return openBlock(), createBlock(
                  _component_ll_descriptions_item,
                  mergeProps({ ref_for: true }, item, { key: i }),
                  {
                    label: withCtx(() => [
                      renderSlot(_ctx.$slots, "label", { item }, () => [
                        createTextVNode(
                          toDisplayString(item.label),
                          1
                          /* TEXT */
                        )
                      ])
                    ]),
                    default: withCtx(() => [
                      renderSlot(_ctx.$slots, "item-content", { item }, () => [
                        item.type ? (openBlock(), createBlock(_sfc_main$1, {
                          key: 0,
                          ref_for: true,
                          ref: (el) => formComponents.value[i] = el,
                          item,
                          "form-data": _ctx.data
                        }, null, 8, ["item", "form-data"])) : (openBlock(), createElementBlock(
                          Fragment,
                          { key: 1 },
                          [
                            createTextVNode(
                              toDisplayString(_ctx.data?.[item?.key] || ""),
                              1
                              /* TEXT */
                            )
                          ],
                          64
                          /* STABLE_FRAGMENT */
                        ))
                      ])
                    ]),
                    _: 2
                    /* DYNAMIC */
                  },
                  1040
                  /* FULL_PROPS, DYNAMIC_SLOTS */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ]),
        _: 2
        /* DYNAMIC */
      }, [
        _ctx.$slots["title"] || _ctx.title || _ctx.titleIcon?.iconName ? {
          name: "title",
          fn: withCtx(() => [
            _ctx.titleIcon?.iconName ? (openBlock(), createBlock(
              _component_ll_icon,
              normalizeProps(mergeProps({ key: 0 }, _ctx.titleIcon)),
              null,
              16
              /* FULL_PROPS */
            )) : createCommentVNode("v-if", true),
            renderSlot(_ctx.$slots, "title", {}, () => [
              createElementVNode(
                "span",
                {
                  style: normalizeStyle({ fontSize: `${_ctx.titleSize}px`, color: _ctx.titleColor })
                },
                toDisplayString(_ctx.title),
                5
                /* TEXT, STYLE */
              )
            ])
          ]),
          key: "0"
        } : void 0,
        _ctx.$slots["extra"] ? {
          name: "extra",
          fn: withCtx(() => [
            renderSlot(_ctx.$slots, "extra")
          ]),
          key: "1"
        } : void 0
      ]), 1040, ["class"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=descriptions.vue2.mjs.map
