'use strict';

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

var vue = require('vue');
var elementPlus = require('element-plus');
var index$1 = require('../../svg-icon/index.js');
var index = require('../../icon-button/index.js');

"use strict";
const _hoisted_1 = ["onClick"];
var script = /* @__PURE__ */ vue.defineComponent({
  __name: "tree-menu-actions",
  props: /* @__PURE__ */ vue.mergeModels({
    tree: { type: null, required: true },
    data: { type: Array, required: false },
    toggleExpandAllEvent: { type: Array, required: false }
  }, {
    "actions": { type: null },
    "actionsModifiers": {}
  }),
  emits: /* @__PURE__ */ vue.mergeModels(["toggleExpandAllEvent", "actionItemEvent"], ["update:actions"]),
  setup(__props, { emit: __emit }) {
    const actions = vue.useModel(__props, "actions");
    const props = __props;
    vue.onMounted(() => {
      console.log(props.tree);
    });
    const emit = __emit;
    const handleTag = (item) => {
      item.status = !item.status;
    };
    const actionItemHandler = (item) => {
      emit("toggleExpandAllEvent", item);
    };
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
        "hide-on-click": false,
        trigger: "hover",
        style: { "cursor": "pointer" }
      }, {
        dropdown: vue.withCtx(() => [
          vue.createVNode(vue.unref(elementPlus.ElDropdownMenu), null, {
            default: vue.withCtx(() => [
              vue.createVNode(vue.unref(elementPlus.ElDropdownItem), null, {
                default: vue.withCtx(() => [
                  vue.createVNode(vue.unref(elementPlus.ElButtonGroup), null, {
                    default: vue.withCtx(() => [
                      vue.createVNode(vue.unref(index.MeIconButton), {
                        icon: "ri-arrow-up-s-fill",
                        onClick: _cache[0] || (_cache[0] = ($event) => actionItemHandler(true))
                      }, {
                        default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
                          vue.createTextVNode(
                            "\u5C55\u5F00",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }),
                      vue.createVNode(vue.unref(index.MeIconButton), {
                        icon: "ri-arrow-down-s-fill",
                        onClick: _cache[1] || (_cache[1] = ($event) => actionItemHandler(false))
                      }, {
                        default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
                          vue.createTextVNode(
                            "\u6298\u53E0 ",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      })
                    ]),
                    _: 1
                    /* STABLE */
                  })
                ]),
                _: 1
                /* STABLE */
              }),
              (vue.openBlock(true), vue.createElementBlock(
                vue.Fragment,
                null,
                vue.renderList(actions.value, (item, index) => {
                  return vue.openBlock(), vue.createBlock(
                    vue.unref(elementPlus.ElDropdownItem),
                    { key: index },
                    {
                      default: vue.withCtx(() => [
                        vue.createElementVNode("div", {
                          onClick: ($event) => handleTag(item),
                          style: { "display": "flex", "align-items": "center", "width": "100%", "justify-content": "space-between" }
                        }, [
                          vue.createElementVNode(
                            "div",
                            {
                              style: vue.normalizeStyle({
                                color: item.status ? "#409eff" : "",
                                fontWeight: item.status ? "bold" : ""
                              })
                            },
                            vue.toDisplayString(item.label),
                            5
                            /* TEXT, STYLE */
                          ),
                          item.status ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.MeSvgIcon), {
                            key: 0,
                            color: "#409eff",
                            name: "ri-check-line"
                          })) : vue.createCommentVNode("v-if", true)
                        ], 8, _hoisted_1)
                      ]),
                      _: 2
                      /* DYNAMIC */
                    },
                    1024
                    /* DYNAMIC_SLOTS */
                  );
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              vue.renderSlot(_ctx.$slots, "dropdown-item")
            ]),
            _: 3
            /* FORWARDED */
          })
        ]),
        default: vue.withCtx(() => [
          _cache[4] || (_cache[4] = vue.createElementVNode(
            "span",
            { class: "el-dropdown-link" },
            " \u64CD\u4F5C ",
            -1
            /* CACHED */
          ))
        ]),
        _: 3
        /* FORWARDED */
      });
    };
  }
});

exports.default = script;
//# sourceMappingURL=tree-menu-actions.vue2.js.map
