"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
;/* empty css                                               */
;/* empty css                                               */
;/* empty css                                                */
;/* empty css                                               */
;/* empty css                                                    */
const Vue = require("vue");
const eventBus = require("../../../utils/eventBus.js");
;/* empty css               */
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
const index$1 = require("../../../../node_modules/vant/es/grid/index.js");
const index$2 = require("../../../../node_modules/vant/es/grid-item/index.js");
const index = require("../../../../node_modules/vant/es/icon/index.js");
const _hoisted_1 = { class: "menu-grid-wrap" };
const _hoisted_2 = {
  key: 0,
  class: "menu-header"
};
const _hoisted_3 = { class: "header-left" };
const _hoisted_4 = { class: "header-title" };
const _hoisted_5 = {
  key: 0,
  class: "header-right"
};
const _hoisted_6 = { class: "more-btn" };
const _hoisted_7 = { class: "menu-item" };
const _hoisted_8 = ["src"];
const _hoisted_9 = {
  key: 1,
  class: "icon-text"
};
const _hoisted_10 = { class: "menu-text" };
const _sfc_main = {
  __name: "MenuGrid",
  props: {
    title: {
      type: String,
      default: ""
    },
    showHeader: {
      type: Boolean,
      default: true
    },
    showMore: {
      type: Boolean,
      default: true
    },
    moreText: {
      type: String,
      default: ""
    },
    columnNum: {
      type: Number,
      default: 5
    },
    menuItems: {
      type: Array,
      default: () => []
    }
  },
  setup(__props) {
    function clickHandler(item) {
      console.log("🚀 ~ clickHandler ~ item:", item);
      eventBus.default.emit("loadPage", item.pageId);
    }
    return (_ctx, _cache) => {
      const _component_van_icon = index.Icon;
      const _component_van_grid_item = index$2.GridItem;
      const _component_van_grid = index$1.Grid;
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        __props.showHeader ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_2, [
          Vue.createElementVNode("div", _hoisted_3, [
            Vue.createElementVNode("span", _hoisted_4, Vue.toDisplayString(__props.title), 1)
          ]),
          __props.showMore ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_5, [
            Vue.createElementVNode("span", _hoisted_6, Vue.toDisplayString(__props.moreText), 1),
            Vue.createVNode(_component_van_icon, {
              name: "arrow",
              class: "more-icon"
            })
          ])) : Vue.createCommentVNode("", true)
        ])) : Vue.createCommentVNode("", true),
        Vue.createVNode(_component_van_grid, {
          "column-num": __props.columnNum,
          border: "false",
          class: "menu-grid"
        }, {
          default: Vue.withCtx(() => [
            (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(__props.menuItems, (item, index2) => {
              return Vue.openBlock(), Vue.createBlock(_component_van_grid_item, {
                key: index2,
                onClick: ($event) => clickHandler(item)
              }, {
                default: Vue.withCtx(() => [
                  Vue.createElementVNode("div", _hoisted_7, [
                    Vue.createElementVNode("div", {
                      class: Vue.normalizeClass(["icon-box", item.bgClass || "icon-blue"])
                    }, [
                      item.iconType === "image" ? (Vue.openBlock(), Vue.createElementBlock("img", {
                        key: 0,
                        src: item.icon,
                        class: "icon-img"
                      }, null, 8, _hoisted_8)) : item.iconText ? (Vue.openBlock(), Vue.createElementBlock("span", _hoisted_9, Vue.toDisplayString(item.iconText), 1)) : (Vue.openBlock(), Vue.createBlock(_component_van_icon, {
                        key: 2,
                        name: item.icon || "apps-o"
                      }, null, 8, ["name"]))
                    ], 2),
                    Vue.createElementVNode("div", _hoisted_10, Vue.toDisplayString(item.label), 1)
                  ])
                ]),
                _: 2
              }, 1032, ["onClick"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["column-num"])
      ]);
    };
  }
};
const _MenuGrid = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-cf276af8"]]);
exports.default = _MenuGrid;
