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