'use strict';

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

var vue = require('vue');
require('../../../../utils/index.js');
var table = require('../../../../constants/table.js');
var table$1 = require('./table.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: "GmTable"
  },
  __name: "Table",
  props: table$1.tableProps,
  emits: table$1.tableEmits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const tableCtx = vue.inject(table.TableCtxKey);
    const elRef = vue.ref();
    const slots = vue.useSlots();
    const props = __props;
    if (tableCtx && tableCtx.tableId === props.tableId) {
      tableCtx.tableRef = elRef;
    }
    const emit = __emit;
    const elEvents = event.getGmEvent(table$1.elTableEmits, emit);
    const exposeEvents = [
      "clearSelection",
      "getSelectionRows",
      "toggleRowSelection",
      "toggleAllSelection",
      "toggleRowExpansion",
      "setCurrentRow",
      "setChecked",
      "clearSort",
      "clearFilter",
      "doLayout",
      "sort",
      "scrollTo",
      "setScrollTop",
      "setScrollLeft"
    ];
    const { exposeFns } = exports$1.getGmExports(elRef, exposeEvents);
    __expose({
      elRef,
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_table = vue.resolveComponent("el-table");
      return vue.openBlock(), vue.createBlock(
        _component_el_table,
        vue.mergeProps({
          ref_key: "elRef",
          ref: elRef
        }, props, vue.toHandlers(vue.unref(elEvents))),
        vue.createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          vue.unref(slots).default ? {
            name: "default",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "default")
            ]),
            key: "0"
          } : void 0,
          vue.unref(slots).append ? {
            name: "append",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "append")
            ]),
            key: "1"
          } : void 0,
          vue.unref(slots).empty ? {
            name: "empty",
            fn: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "empty")
            ]),
            key: "2"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

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