import Renderables from '../Renderables';
import node from "../../support/node";
import { Specification } from "../../support/Specification";
/**
 * Implementation of the 'item' markup element.
 * A li HTML element is created and the class lto-item
 * is added to allow CSS manipulations.
 *
 * @see {@link IRenderable}
 * @see {@link Items}
 */
var Item = /** @class */ (function () {
    function Item(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Item.prototype.render = function (renderer, isNested) {
        var _this = this;
        var item = node("li");
        (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); })
            .forEach(function (e) { return e.forEach(function (x) { return item.appendChild(node(x)); }); });
        new Specification(this.spec).initNode(item, "lto-item");
        isNested && item.addClasses("lto-nested");
        return item.unwrap();
    };
    return Item;
}());
export { Item };
Renderables.register("item", Item);
//# sourceMappingURL=index.js.map