"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentList = void 0;
var React = require("react");
var component_list_item_1 = require("./component-list-item");
var ComponentList = /** @class */ (function (_super) {
    __extends(ComponentList, _super);
    function ComponentList() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.setRef = function (element) {
            _this.container = element || undefined;
        };
        return _this;
    }
    ComponentList.prototype.render = function () {
        var _this = this;
        return React.createElement("div", { className: 'items-container', ref: this.setRef }, this.props.items.map(function (item) { return _this.createItem(item); }));
    };
    ComponentList.prototype.componentDidMount = function () {
        if (this.container && this.props.resolveContainer) {
            this.props.resolveContainer(this.container);
        }
    };
    ComponentList.prototype.createItem = function (item) {
        return React.createElement(component_list_item_1.ComponentListItem, { key: this.props.itemLabel(item), item: item, itemRenderer: this.props.itemRenderer, install: this.props.install, uninstall: this.props.uninstall });
    };
    return ComponentList;
}(React.Component));
exports.ComponentList = ComponentList;
//# sourceMappingURL=component-list.js.map