import { cloneDeep } from "@visactor/vutils";

export function handlePaginationExport(table, exportAllData) {
    const pagination = cloneDeep(table.pagination), isPivot = table.isPivotTable(), layoutMap = table.internalProps.layoutMap;
    let maxRow = table.rowCount - 1;
    return {
        reset: () => {
            isPivot && exportAllData && pagination && (table.internalProps.layoutMap.setPagination(pagination), 
            table.refreshRowColCount());
        },
        handleRowCount: () => (exportAllData && pagination && (isPivot ? (table.internalProps.layoutMap.setPagination(void 0), 
        table.refreshRowColCount(), maxRow = table.rowCount - 1) : maxRow = table.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount), 
        maxRow)
    };
}
//# sourceMappingURL=pagination.js.map
