import { UITreeAction } from './../ui-tree-model';
var UITreePanelConfig = (function () {
    function UITreePanelConfig(init) {
        this.id = 'id';
        this.withLines = false;
        this.autoExpand = true;
        this.actions = [];
        Object.assign(this, init);
    }
    return UITreePanelConfig;
}());
export { UITreePanelConfig };
var UITreePanelConfigAction = (function () {
    function UITreePanelConfigAction(init) {
        this.asDropdown = true;
        Object.assign(this, init);
    }
    UITreePanelConfigAction.prototype.transformToTreeAction = function () {
        var _this = this;
        var action = new UITreeAction({
            label: isFunction(this.label) ? null : this.label,
            generateLabel: isFunction(this.label) ? function (node) { return _this.label(node.model); } : null,
            icon: this.icon,
            color: this.color,
            asDropdown: this.asDropdown,
            this: this.this,
            fn: function (node) { return _this.fn(node.model, node); },
        });
        if (this.display == null) {
            action.display = true;
        }
        else if (typeof this.display == 'boolean') {
            action.display = this.display;
        }
        else {
            action.display = function (node) {
                if (isFunction(_this.display)) {
                    return _this.display(node.model, node);
                }
            };
        }
        return action;
    };
    return UITreePanelConfigAction;
}());
export { UITreePanelConfigAction };

//# sourceMappingURL=ui-tree-panel-config.js.map
