'use strict';

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

var vue = require('vue');
require('../../../../utils/index.js');
var table = require('../../../../constants/table.js');
var tableV2 = require('./tableV2.js');
var event = require('../../../../utils/src/elementPlus/event.js');
var exports$1 = require('../../../../utils/src/elementPlus/exports.js');

var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "GmTableV2"
  },
  __name: "TableV2",
  props: tableV2.tableV2Props,
  emits: tableV2.tableV2Emits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const elRef = vue.ref();
    const slots = vue.useSlots();
    const tableCtx = vue.inject(table.TableCtxKey);
    const props = __props;
    if (tableCtx && tableCtx.tableId === props.tableId) {
      tableCtx.tableV2Ref = elRef;
    }
    const emit = __emit;
    const elEvents = event.getGmEvent(tableV2.elTableV2Emits, emit);
    const exposeEvents = ["scrollTo", "scrollToLeft", "scrollToTop", "scrollToRow"];
    const { exposeFns } = exports$1.getGmExports(elRef, exposeEvents);
    __expose({
      elRef,
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_table_v2 = vue.resolveComponent("el-table-v2");
      return vue.openBlock(), vue.createBlock(
        _component_el_table_v2,
        vue.mergeProps({
          ref_key: "elRef",
          ref: elRef
        }, props, vue.toHandlers(vue.unref(elEvents))),
        vue.createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          vue.unref(slots).cell ? {
            name: "cell",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "cell")
            ]),
            key: "0"
          } : void 0,
          vue.unref(slots).header ? {
            name: "header",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "header")
            ]),
            key: "1"
          } : void 0,
          vue.unref(slots).headerCell ? {
            name: "headerCell",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "headerCell")
            ]),
            key: "2"
          } : void 0,
          vue.unref(slots).row ? {
            name: "row",
            fn: vue.withCtx((slotValue) => [
              vue.renderSlot(_ctx.$slots, "row", vue.normalizeProps(vue.guardReactiveProps(slotValue)))
            ]),
            key: "3"
          } : void 0,
          vue.unref(slots).footer ? {
            name: "footer",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "footer")
            ]),
            key: "4"
          } : void 0,
          vue.unref(slots).empty ? {
            name: "empty",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "empty")
            ]),
            key: "5"
          } : void 0,
          vue.unref(slots).overlay ? {
            name: "overlay",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "overlay"),
              vue.createCommentVNode(' <VNodeRenderer :vnode="slots.overlay?.().children?.[0]" /> ')
            ]),
            key: "6"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=TableV2.vue2.js.map
