"use strict";

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.handlePaginationExport = void 0;

const vutils_1 = require("@visactor/vutils");

function handlePaginationExport(table, exportAllData) {
    const pagination = (0, vutils_1.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)
    };
}

exports.handlePaginationExport = handlePaginationExport;
//# sourceMappingURL=pagination.js.map
