"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Renderables_1 = require("../../Renderables");
/**
 * Implementation of the 'tr' markup element.
 * A tr HTML element is created and the class
 * lto-row is added to allow CSS manipulations.
 *
 * @see {@link IRenderable}
 * @see {@link IStackeable}
 * @see {@link Table}
 * @see {@link Col}
 */
var Row = /** @class */ (function () {
    function Row(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Row.prototype.render = function (renderer, isNested) {
        var _this = this;
        var row = document.createElement('tr');
        if (this.spec.class !== undefined) {
            this.spec.class.split(" ").forEach(function (e) { return row.classList.add(e); });
        }
        row.classList.add('lto-row');
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); });
        elements.forEach(function (e) { return e.forEach(function (x) { return row.appendChild(x); }); });
        return row;
    };
    return Row;
}());
exports.Row = Row;
Renderables_1.default.register("row", Row);
//# sourceMappingURL=index.js.map