import { defineComponent, reactive, toRef, computed, createVNode } from 'vue';
import { useProvideSummary } from '../context/SummaryContext.mjs';
import { useInjectTable } from '../context/TableContext.mjs';
export { default as SummaryCell } from './Cell.mjs';
export { default as SummaryRow } from './Row.mjs';
import Summary from './Summary.mjs';

var Footer = /* @__PURE__ */ defineComponent({
  name: "TableFooter",
  inheritAttrs: false,
  props: ["stickyOffsets", "flattenColumns"],
  setup(props, {
    slots
  }) {
    const tableContext = useInjectTable();
    useProvideSummary(reactive({
      stickyOffsets: toRef(props, "stickyOffsets"),
      flattenColumns: toRef(props, "flattenColumns"),
      scrollColumnIndex: 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 createVNode("tfoot", {
        "class": `${prefixCls}-summary`
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
    };
  }
});
const FooterComponents = Summary;

export { FooterComponents, Footer as default };
//# sourceMappingURL=index.mjs.map
