"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GridPage = /** @class */ (function () {
    function GridPage() {
        // public page!: IPageService;
        this.structured = false;
        this.uuid = '';
        this.scale = 1;
        this.content = [];
        this.originalContent = [];
        this.deltaContent = [];
        this.rows = 0;
        this.cols = 0;
        this.hiddenColumns = [];
        this.hiddenRows = [];
        this.rowHeights = [];
        this.colWidths = [];
        this.width = 0;
        this.height = 0;
        this.selectedCols = [];
        this.selectedRows = [];
        this.selectedCells = [];
        this.scrollTop = 0;
        this.scrollLeft = 0;
        this.scrollbarSize = 0;
        this.scrollbarWidth = 0;
        this.scrollbarHeight = 0;
        this.selection = {
            rowFrom: -1,
            rowTo: -1,
            colFrom: -1,
            colTo: -1,
            heading: false,
            inside: false,
            selected: false,
            keyboard: false,
            type: 'cell'
        };
        this.headings = false;
        this.touch = false;
        this.columnsDefs = [];
    }
    GridPage.prototype.reset = function () {
        this.scale = 0;
        this.content = [];
        this.originalContent = [];
        this.deltaContent = [];
        this.rows = 0;
        this.cols = 0;
        this.hiddenColumns = [];
        this.hiddenRows = [];
        this.rowHeights = [];
        this.colWidths = [];
        this.width = 0;
        this.height = 0;
        this.selectedCells = [];
        this.selectedCols = [];
        this.selectedRows = [];
        this.scrollTop = 0;
        this.scrollLeft = 0;
        this.columnsDefs = [];
        // this.scrollbarWidth = 0;
    };
    GridPage.prototype.resetSelection = function () {
        this.selectedCells = [];
        this.selectedCols = [];
        this.selectedRows = [];
        this.selection = {
            rowFrom: -1,
            rowTo: -1,
            colFrom: -1,
            colTo: -1,
            heading: false,
            inside: false,
            selected: false,
            keyboard: false,
            type: 'cell'
        };
    };
    GridPage.prototype.rowPos = function (row) {
        return this.rowHeights.slice(0, row).reduce(function (a, b) { return a + b; }, 0);
    };
    GridPage.prototype.colPos = function (row) {
        return this.colWidths.slice(0, row).reduce(function (a, b) { return a + b; }, 0);
    };
    GridPage.prototype.cellPos = function (row, col) {
        return {
            x: this.colWidths.slice(0, col).reduce(function (a, b) { return a + b; }, 0),
            y: this.rowHeights.slice(0, row).reduce(function (a, b) { return a + b; }, 0)
        };
    };
    GridPage.prototype.setSelectedCell = function (cell) {
        this.selectedCells.push(cell);
    };
    GridPage.prototype.getColDefWidth = function (col) {
        if (this.columnsDefs[col] && this.columnsDefs[col].style && this.columnsDefs[col].style.width) {
            return parseFloat(this.columnsDefs[col].style.width);
        }
        return 0;
    };
    return GridPage;
}());
exports.default = GridPage;
//# sourceMappingURL=GridPage.js.map