import { GroupColumn, defaultGroup } from '../model';
import { noRenderer } from './utils';
function isDummyGroup(group) {
    return group.parent == null && group.name === defaultGroup.name;
}
/** @internal */
var GroupCellRenderer = /** @class */ (function () {
    function GroupCellRenderer() {
        this.title = 'Default';
    }
    GroupCellRenderer.prototype.canRender = function (col) {
        return col instanceof GroupColumn;
    };
    GroupCellRenderer.prototype.create = function () {
        return {
            template: "<div><div></div></div>",
            update: function (node, _row, i, group) {
                node.firstElementChild.textContent = isDummyGroup(group) || i > 0 ? '' : group.name + " (" + group.order.length + ")";
            },
            render: function (_ctx, _row, i) {
                return i === 0;
            }
        };
    };
    GroupCellRenderer.prototype.createGroup = function () {
        return {
            template: "<div><div></div></div>",
            update: function (node, group) {
                node.firstElementChild.textContent = isDummyGroup(group) ? '' : group.name + " (" + group.order.length + ")";
            }
        };
    };
    GroupCellRenderer.prototype.createSummary = function () {
        return noRenderer;
    };
    return GroupCellRenderer;
}());
export default GroupCellRenderer;
//# sourceMappingURL=GroupCellRenderer.js.map