'use strict';

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

var vue = require('vue');
var SummaryContext = require('../context/SummaryContext.cjs');
var TableContext = require('../context/TableContext.cjs');
var Cell = require('./Cell.cjs');
var Row = require('./Row.cjs');
var Summary = require('./Summary.cjs');

var Footer = /* @__PURE__ */ vue.defineComponent({
  name: "TableFooter",
  inheritAttrs: false,
  props: ["stickyOffsets", "flattenColumns"],
  setup(props, {
    slots
  }) {
    const tableContext = TableContext.useInjectTable();
    SummaryContext.useProvideSummary(vue.reactive({
      stickyOffsets: vue.toRef(props, "stickyOffsets"),
      flattenColumns: vue.toRef(props, "flattenColumns"),
      scrollColumnIndex: vue.computed(() => {
        const lastColumnIndex = props.flattenColumns.length - 1;
        const scrollColumn = props.flattenColumns[lastColumnIndex];
        return (scrollColumn == null ? void 0 : scrollColumn.scrollbar) ? lastColumnIndex : null;
      })
    }));
    return () => {
      var _a;
      const {
        prefixCls
      } = tableContext;
      return vue.createVNode("tfoot", {
        "class": `${prefixCls}-summary`
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
    };
  }
});
const FooterComponents = Summary.default;

exports.SummaryCell = Cell.default;
exports.SummaryRow = Row.default;
exports.FooterComponents = FooterComponents;
exports.default = Footer;
//# sourceMappingURL=index.cjs.map
