import { Icon } from '../icon';
import { Timestamp } from '../timestamp';
import Renderables from '../Renderables';
import { Specification } from "../../support/Specification";
import node from "../../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("div");
        new Specification(this.spec).initNode(label, "lto-label");
        if (!isNested) {
            label.unwrap().appendChild(Timestamp.render());
            var container = node("div");
            container.unwrap().appendChild(new Icon(this.spec.position || "left").render());
            container.appendChild(label);
            return container.unwrap();
        }
        label.addClasses("lto-nested");
        return label.unwrap();
    };
    Label.TYPE = "label";
    return Label;
}());
export { Label };
Renderables.register(Label.TYPE, Label);
//# sourceMappingURL=index.js.map