"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var icon_1 = require("../icon");
var timestamp_1 = require("../timestamp");
var Renderables_1 = require("../Renderables");
var Specification_1 = require("../../support/Specification");
var node_1 = require("../../support/node");
/**
 * Implementation of the 'label' markup element.
 * A div HTML element is crated and if the attributes
 * text and icon are set, they are applied.
 * The class lto-label is added to allow CSS manipulations.
 *
 * @see {@link IRenderable}
 * @see {@link Icon}
 */
var Label = /** @class */ (function () {
    function Label(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Label.prototype.render = function (renderer, isNested) {
        var label = node_1.default("div");
        new Specification_1.Specification(this.spec).initNode(label, "lto-label");
        label.setAriaLabel(this.spec.ariaLabel);
        if (!isNested) {
            label.unwrap().appendChild(timestamp_1.Timestamp.render());
            var container = node_1.default("div");
            container.unwrap().appendChild(new icon_1.Icon(this.spec.position || "left").render());
            container.appendChild(label);
            return container.unwrap();
        }
        label.addClasses("lto-nested");
        return label.unwrap();
    };
    Label.TYPE = "label";
    return Label;
}());
exports.Label = Label;
Renderables_1.default.register(Label.TYPE, Label);
//# sourceMappingURL=index.js.map