import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, createBlock, unref, withCtx, createCommentVNode } from 'vue';
import { MeSvgIcon } from '../../svg-icon/index.mjs';
import { ElTag } from 'element-plus';

"use strict";
const _hoisted_1 = { class: "tree-menu-node" };
const _hoisted_2 = { key: 1 };
var script = /* @__PURE__ */ defineComponent({
  __name: "tree-menu-node",
  props: {
    actions: { type: null, required: true },
    node: { type: null, required: true },
    data: { type: null, required: true }
  },
  setup(__props) {
    const props = __props;
    const showTag = (item) => {
      if (item.status == false) {
        return false;
      }
      const isMeta = item.key.indexOf("meta.") !== -1;
      if (isMeta) {
        const key = item.key.split(".")[1];
        return props.data.meta[key] === item.value;
      }
      return props.data[item.key] === item.value;
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode(
          "span",
          null,
          toDisplayString(props.node.label),
          1
          /* TEXT */
        ),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.actions, (item, index) => {
            return openBlock(), createElementBlock(
              Fragment,
              {
                key: item.key
              },
              [
                showTag(item) ? (openBlock(), createBlock(unref(ElTag), {
                  key: 0,
                  round: "",
                  size: "small",
                  style: { "margin-left": "10px" },
                  type: item.type
                }, {
                  default: withCtx(() => [
                    item.tagIcon ? (openBlock(), createBlock(unref(MeSvgIcon), {
                      key: 0,
                      name: item.tagIcon
                    }, null, 8, ["name"])) : (openBlock(), createElementBlock(
                      "div",
                      _hoisted_2,
                      toDisplayString(item.tagLabel),
                      1
                      /* TEXT */
                    ))
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, 1032, ["type"])) : createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});

export { script as default };
//# sourceMappingURL=tree-menu-node.vue2.mjs.map
