import { PageElement } from "./element/page-element";
var Page = /** @class */ (function () {
    function Page(parentPageElement) {
        this._content = [];
        this._rows = [];
        this._parentPageElement = parentPageElement;
    }
    Page.prototype.getShortName = function () {
        return PageElement.buildShortName(this.name);
    };
    Object.defineProperty(Page.prototype, "name", {
        get: function () {
            return this._name;
        },
        set: function (value) {
            this._name = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Page.prototype, "content", {
        get: function () {
            return this._content;
        },
        set: function (value) {
            this._content = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Page.prototype, "id", {
        get: function () {
            return this._id;
        },
        set: function (value) {
            this._id = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Page.prototype, "parentPageElement", {
        get: function () {
            return this._parentPageElement;
        },
        enumerable: false,
        configurable: true
    });
    Page.prototype.updateRows = function () {
        var rows = [];
        var currentPageRow = null;
        for (var _i = 0, _a = this.content; _i < _a.length; _i++) {
            var pageElement = _a[_i];
            if (pageElement.newRow === true || currentPageRow == null) {
                currentPageRow = new PageRow();
                rows.push(currentPageRow);
            }
            currentPageRow.pageElements.push(pageElement);
        }
        this._rows = rows;
    };
    return Page;
}());
export { Page };
var PageRow = /** @class */ (function () {
    function PageRow() {
        this._pageElements = [];
    }
    Object.defineProperty(PageRow.prototype, "pageElements", {
        get: function () {
            return this._pageElements;
        },
        enumerable: false,
        configurable: true
    });
    PageRow.prototype.isVisible = function () {
        for (var _i = 0, _a = this.pageElements; _i < _a.length; _i++) {
            var pageElement = _a[_i];
            if (pageElement.visible) {
                return true;
            }
        }
        return false;
    };
    return PageRow;
}());
//# sourceMappingURL=page.js.map