'use strict';

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

var vue = require('vue');
var elementPlus = require('element-plus');

"use strict";
const _hoisted_1 = { class: "me-text-separator" };
const _hoisted_2 = { class: "text-item" };
const _hoisted_3 = {
  key: 0,
  class: "separator"
};
const _hoisted_4 = { class: "separator" };
const _hoisted_5 = { class: "suffix-trigger" };
const _hoisted_6 = { class: "popover-list" };
const __default__ = vue.defineComponent({
  name: "me-text-separator"
});
var script = /* @__PURE__ */ vue.defineComponent({
  ...__default__,
  props: {
    data: { type: Array, required: false, default: () => [] },
    maxCount: { type: Number, required: false, default: 3 },
    borderStyle: { type: null, required: false, default: "solid" },
    popoverPlacement: { type: String, required: false, default: "bottom" }
  },
  setup(__props) {
    const props = __props;
    const visibleData = vue.computed(() => props.data.slice(0, props.maxCount));
    const hasMore = vue.computed(() => props.data.length > props.maxCount);
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        (vue.openBlock(true), vue.createElementBlock(
          vue.Fragment,
          null,
          vue.renderList(visibleData.value, (item, index) => {
            return vue.openBlock(), vue.createElementBlock(
              vue.Fragment,
              { key: index },
              [
                vue.createElementVNode("span", _hoisted_2, [
                  vue.renderSlot(_ctx.$slots, "default", {
                    item,
                    index
                  }, () => [
                    vue.createTextVNode(
                      vue.toDisplayString(item),
                      1
                      /* TEXT */
                    )
                  ])
                ]),
                index < visibleData.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
                  vue.renderSlot(_ctx.$slots, "separator", { index }, () => [
                    vue.createVNode(vue.unref(elementPlus.ElDivider), {
                      direction: "vertical",
                      "border-style": __props.borderStyle
                    }, null, 8, ["border-style"])
                  ])
                ])) : vue.createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        hasMore.value ? (vue.openBlock(), vue.createElementBlock(
          vue.Fragment,
          { key: 0 },
          [
            vue.createElementVNode("div", _hoisted_4, [
              vue.renderSlot(_ctx.$slots, "separator", {
                index: visibleData.value.length
              }, () => [
                vue.createVNode(vue.unref(elementPlus.ElDivider), {
                  direction: "vertical",
                  "border-style": __props.borderStyle
                }, null, 8, ["border-style"])
              ])
            ]),
            vue.createVNode(vue.unref(elementPlus.ElPopover), vue.mergeProps({ placement: __props.popoverPlacement }, _ctx.$attrs), {
              reference: vue.withCtx(() => [
                vue.createElementVNode("span", _hoisted_5, [
                  vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
                    _cache[0] || (_cache[0] = vue.createTextVNode(
                      "...",
                      -1
                      /* CACHED */
                    ))
                  ])
                ])
              ]),
              default: vue.withCtx(() => [
                vue.createElementVNode("div", _hoisted_6, [
                  (vue.openBlock(true), vue.createElementBlock(
                    vue.Fragment,
                    null,
                    vue.renderList(__props.data, (item, index) => {
                      return vue.openBlock(), vue.createElementBlock("div", {
                        key: index,
                        class: "popover-list-item"
                      }, [
                        vue.renderSlot(_ctx.$slots, "popover-item", {
                          item,
                          index
                        }, () => [
                          vue.createTextVNode(
                            vue.toDisplayString(item),
                            1
                            /* TEXT */
                          )
                        ])
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 16, ["placement"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : vue.createCommentVNode("v-if", true)
      ]);
    };
  }
});

exports.default = script;
//# sourceMappingURL=text-separator.vue2.js.map
