'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var VNodeRenderer = require('../../common/VNodeRenderer.js');
var descriptions = require('./descriptions.js');

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

exports.default = _sfc_main;
//# sourceMappingURL=Descriptions.vue2.js.map
