"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uviewPro_components_uGridItem_types = require("./types.js");
const uni_modules_uviewPro_libs_index = require("../../libs/index.js");
require("../../libs/util/logger.js");
require("../../libs/config/theme-tokens.js");
const uni_modules_uviewPro_libs_hooks_useCompRelation = require("../../libs/hooks/useCompRelation.js");
const __default__ = {
  name: "u-grid-item",
  options: {
    addGlobalClass: true,
    virtualHost: true,
    styleIsolation: "shared"
  }
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  ...__default__,
  props: uni_modules_uviewPro_components_uGridItem_types.GridItemProps,
  emits: ["click"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const { parentExposed } = uni_modules_uviewPro_libs_hooks_useCompRelation.useChildren("u-grid-item", "u-grid");
    const emit = __emit;
    const hoverClass = common_vendor.computed(() => {
      var _a, _b;
      return ((_b = (_a = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a.props) == null ? void 0 : _b.hoverClass) ?? "";
    });
    const border = common_vendor.computed(() => {
      var _a, _b;
      return ((_b = (_a = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a.props) == null ? void 0 : _b.border) ?? true;
    });
    const col = common_vendor.computed(() => {
      var _a, _b;
      return ((_b = (_a = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a.props) == null ? void 0 : _b.col) ?? 3;
    });
    const width = common_vendor.computed(() => 100 / Number(col.value) + "%");
    function click() {
      var _a;
      emit("click", props.index);
      (_a = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a.click(props.index);
    }
    __expose({ click });
    return (_ctx, _cache) => {
      return {
        a: common_vendor.s(_ctx.customStyle),
        b: common_vendor.n(border.value ? "u-border-right u-border-bottom" : ""),
        c: common_vendor.n(_ctx.customClass),
        d: hoverClass.value,
        e: common_vendor.o(click, "e0"),
        f: common_vendor.s(common_vendor.unref(uni_modules_uviewPro_libs_index.$u).toStyle({
          background: _ctx.bgColor,
          width: width.value
        }, _ctx.customStyle))
      };
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-55059f9a"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/components/u-grid-item/u-grid-item.js.map
