import { defineComponent, useModel, openBlock, createBlock, unref, mergeProps, withCtx, createElementBlock, Fragment, renderList, createElementVNode, createTextVNode, toDisplayString, createVNode } from 'vue';
import { ElBreadcrumb, ElBreadcrumbItem, ElSelect, ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus';
import { MeSvgIcon } from '../../svg-icon/index.mjs';

"use strict";
const _hoisted_1 = { style: { "cursor": "pointer", "margin-bottom": "2px", "display": "flex" } };
const _hoisted_2 = { key: 2 };
const __default__ = defineComponent({
  name: "me-breadcrumb"
});
var script = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    "modelValue": { type: Array },
    "modelModifiers": {}
  },
  emits: ["update:modelValue"],
  setup(__props) {
    const props = __props;
    const data = useModel(__props, "modelValue");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        unref(ElBreadcrumb),
        mergeProps(_ctx.$attrs, { style: { "margin-bottom": "0px", "display": "flex", "align-items": "center" } }),
        {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(data.value, (item) => {
                return openBlock(), createBlock(unref(ElBreadcrumbItem), {
                  key: item.label,
                  to: item.to
                }, {
                  default: withCtx(() => [
                    item.type == "select" ? (openBlock(), createBlock(unref(ElSelect), {
                      key: 0,
                      modelValue: item.value,
                      "onUpdate:modelValue": ($event) => item.value = $event,
                      style: { "width": "240px", "margin-bottom": "0px" },
                      onChange: item.change,
                      options: item.options,
                      props: item.props
                    }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange", "options", "props"])) : item.type == "menu" ? (openBlock(), createBlock(
                      unref(ElDropdown),
                      {
                        key: 1,
                        trigger: "click"
                      },
                      {
                        dropdown: withCtx(() => [
                          createVNode(
                            unref(ElDropdownMenu),
                            null,
                            {
                              default: withCtx(() => [
                                (openBlock(true), createElementBlock(
                                  Fragment,
                                  null,
                                  renderList(item.options, (menuItem) => {
                                    return openBlock(), createBlock(unref(ElDropdownItem), {
                                      onClick: menuItem.click
                                    }, {
                                      default: withCtx(() => [
                                        createTextVNode(
                                          toDisplayString(menuItem.label),
                                          1
                                          /* TEXT */
                                        )
                                      ]),
                                      _: 2
                                      /* DYNAMIC */
                                    }, 1032, ["onClick"]);
                                  }),
                                  256
                                  /* UNKEYED_FRAGMENT */
                                ))
                              ]),
                              _: 2
                              /* DYNAMIC */
                            },
                            1024
                            /* DYNAMIC_SLOTS */
                          )
                        ]),
                        default: withCtx(() => [
                          createElementVNode("div", _hoisted_1, [
                            createTextVNode(
                              toDisplayString(item.name) + " ",
                              1
                              /* TEXT */
                            ),
                            createVNode(unref(MeSvgIcon), { name: "ri-arrow-down-s-fill" })
                          ])
                        ]),
                        _: 2
                        /* DYNAMIC */
                      },
                      1024
                      /* DYNAMIC_SLOTS */
                    )) : (openBlock(), createElementBlock(
                      "span",
                      _hoisted_2,
                      toDisplayString(item.label),
                      1
                      /* TEXT */
                    ))
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, 1032, ["to"]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ]),
          _: 1
          /* STABLE */
        },
        16
        /* FULL_PROPS */
      );
    };
  }
});

export { script as default };
//# sourceMappingURL=breadcrumb.vue2.mjs.map
