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 __());
    };
})();
import { List } from './withStore/List';
// @ts-ignore
var TreeList = /** @class */ (function (_super) {
    __extends(TreeList, _super);
    function TreeList(props, context) {
        var _this = _super.call(this, props, context) || this;
        _this.state = {
            nodes: _this.props.store.getData()
        };
        return _this;
    }
    TreeList.prototype.onStoreChange = function (data) {
        this.setState({ nodes: data });
    };
    TreeList.prototype.hasItems = function () {
        return this.props.store.getFilteredCount() > 0;
    };
    TreeList.prototype.isEmptyList = function () {
        return (this.props.store.isLoaded() &&
            !this.props.store.hasFilters() &&
            !this.props.store.getTotalCount());
    };
    TreeList.prototype.isEmptyListMessageVisible = function () {
        return this.props.store.isLoaded() && !this.hasItems();
    };
    TreeList.prototype.renderItems = function () {
        var _this = this;
        var result = [];
        this.state.nodes.forEach(function (node, index) {
            _this.props.store.applyCallbackToSubtree(node, index, function (record, recordIndex, level) {
                result.push(_this.renderItem(record, recordIndex, level));
            });
        });
        return result;
    };
    TreeList.prototype.renderItem = function (record, index, level) {
        return null;
    };
    return TreeList;
}(List));
export { TreeList };
//# sourceMappingURL=TreeList.js.map