import Renderables from '../Renderables';
/**
 * Implementation of the 'block' markup element. A div HTML element
 * is created and the and the classes lto-block is added to
 * allow CSS modifications.
 *
 * @see {@link IRenderable}
 * @see {@link IStackeable}
 */
var SmallDevice = /** @class */ (function () {
    function SmallDevice(message) {
        this.spec = message;
    }
    /**
     * @inheritDoc
     */
    SmallDevice.prototype.render = function (renderer, isNested) {
        var _this = this;
        var position = this.spec.position || 'left';
        var smallDevice = document.createElement('div');
        smallDevice.classList.add('lto-small-device', "lto-" + position);
        smallDevice.setAttribute("name", this.spec.name || "");
        if (this.spec.id !== undefined) {
            smallDevice.id = this.spec.id;
        }
        if (this.spec.class !== undefined) {
            this.spec.class.split(" ").forEach(function (e) { return smallDevice.classList.add(e); });
        }
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); });
        elements.forEach(function (e) { return e.forEach(function (x) { return smallDevice.appendChild(x); }); });
        return smallDevice;
    };
    return SmallDevice;
}());
export { SmallDevice };
Renderables.register("smallDevice", SmallDevice);
//# sourceMappingURL=index.js.map