import { defineComponent, useSlots, computed, resolveComponent, createBlock, openBlock, mergeProps, createSlots, withCtx, createElementBlock, createCommentVNode, unref, Fragment, renderList, createVNode, renderSlot } from 'vue';
import VNodeRenderer from '../../common/VNodeRenderer.mjs';
import { descriptionsProps } from './descriptions.mjs';

const _hoisted_1 = { key: 0 };
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmDescriptions"
  },
  __name: "Descriptions",
  props: descriptionsProps,
  setup(__props) {
    const slots = useSlots();
    const props = __props;
    const gmDescriptionsItemList = computed(() => {
      return slots.default?.().filter((node) => node?.type?.name === "GmDescriptionsItem") ?? [];
    });
    return (_ctx, _cache) => {
      const _component_el_descriptions_item = resolveComponent("el-descriptions-item");
      const _component_el_descriptions = resolveComponent("el-descriptions");
      return openBlock(), createBlock(
        _component_el_descriptions,
        mergeProps({ ref: "elRef" }, props),
        createSlots({
          default: withCtx(() => [
            unref(slots).default ? (openBlock(), createElementBlock("div", _hoisted_1, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(gmDescriptionsItemList.value, (item, index) => {
                  return openBlock(), createBlock(
                    _component_el_descriptions_item,
                    mergeProps({ key: index }, item.props),
                    createSlots({
                      default: withCtx(() => [
                        item.children ? (openBlock(), createBlock(unref(VNodeRenderer), {
                          key: 0,
                          vnode: item.children.default()
                        }, null, 8, ["vnode"])) : createCommentVNode("v-if", true)
                      ]),
                      _: 2
                      /* DYNAMIC */
                    }, [
                      item.children?.label ? {
                        name: "label",
                        fn: withCtx(() => [
                          createVNode(unref(VNodeRenderer), {
                            vnode: item.children.label()
                          }, null, 8, ["vnode"])
                        ]),
                        key: "0"
                      } : void 0
                    ]),
                    1040
                    /* FULL_PROPS, DYNAMIC_SLOTS */
                  );
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true)
          ]),
          _: 2
          /* DYNAMIC */
        }, [
          unref(slots).title ? {
            name: "title",
            fn: withCtx(() => [
              renderSlot(_ctx.$slots, "title")
            ]),
            key: "0"
          } : void 0,
          unref(slots).extra ? {
            name: "extra",
            fn: withCtx(() => [
              renderSlot(_ctx.$slots, "extra")
            ]),
            key: "1"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

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