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 React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ColumnItem } from './ColumnItem';
export var ItemType = PropTypes.shape({
    id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
    name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
    parentId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
    raw: PropTypes.any
});
var Column = /** @class */ (function (_super) {
    __extends(Column, _super);
    function Column() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.renderItem = function (_a, index) {
            var id = _a.id, name = _a.name;
            var _b = _this.props, selectedId = _b.selectedId, isActive = _b.isActive, countChildren = _b.countChildren, onSelect = _b.onSelect;
            return (React.createElement(ColumnItem, { key: id, id: id, name: name, isSelected: id === selectedId, isPrimary: id === selectedId && isActive, numChildren: countChildren(id), onSelect: onSelect, index: index }));
        };
        return _this;
    }
    Column.prototype.render = function () {
        var _a = this.props, items = _a.items, index = _a.index;
        return (React.createElement("div", { className: "rc-column-tree-view-col", "data-test-automation-id": "columnTreeViewColumn" + index },
            React.createElement("div", { className: "rc-column-tree-view-col-content" }, items.map(this.renderItem))));
    };
    Column.propTypes = {
        isActive: PropTypes.bool,
        selectedId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
        items: PropTypes.arrayOf(ItemType),
        onSelect: PropTypes.func,
        countChildren: PropTypes.func,
        index: PropTypes.number.isRequired
    };
    Column.defaultProps = {
        isActive: false,
        selectedId: null,
        items: [],
        onSelect: function (id) { },
        countChildren: function (id) { return 0; }
    };
    return Column;
}(Component));
export { Column };
//# sourceMappingURL=Column.js.map