var __extends = (this && this.__extends) || (function () {
    var 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 function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Component, Injector, Optional, Inject, forwardRef, SkipSelf, ElementRef, NgModule, EventEmitter } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OntimizeWebModule, Util, OSharedModule, OFormComponent, OntimizeService, dataServiceFactory } from 'ontimize-web-ngx';
import { OTreeComponent } from './o-tree.component';
var ɵ0 = dataServiceFactory;
var OTreeNodeComponent = (function (_super) {
    __extends(OTreeNodeComponent, _super);
    function OTreeNodeComponent(injector, elRef, form, oTree, parentNode) {
        var _this = _super.call(this, injector, elRef, form) || this;
        _this.oTree = oTree;
        _this.parentNode = parentNode;
        _this.onNodeSelected = new EventEmitter();
        _this.onNodeExpanded = new EventEmitter();
        _this.onNodeCollapsed = new EventEmitter();
        _this.onLoadNextLevel = new EventEmitter();
        _this.forcedShowRoot = false;
        return _this;
    }
    OTreeNodeComponent.prototype.ngOnInit = function () {
        _super.prototype.initialize.call(this);
        this.queryOnBind = true;
        this.queryOnInit = false;
        if (Util.isDefined(this.parentNode)) {
            this.parentNode.registerChildNode(this);
        }
        else if (Util.isDefined(this.oTree)) {
            this.oTree.registerTreeNode(this);
        }
    };
    OTreeNodeComponent.prototype.registerChildNode = function (child) {
        this.treeNodes.push(child);
    };
    OTreeNodeComponent.prototype.onLanguageChangeCallback = function () {
    };
    OTreeNodeComponent.DEFAULT_INPUTS_O_TREE_NODE = OTreeComponent.DEFAULT_BASIC_INPUTS_O_TREE;
    OTreeNodeComponent.DEFAULT_OUTPUTS_O_TREE_NODE = OTreeComponent.DEFAULT_OUTPUTS_O_TREE;
    OTreeNodeComponent.decorators = [
        { type: Component, args: [{
                    selector: 'o-tree-node',
                    template: ' ',
                    inputs: OTreeComponent.DEFAULT_BASIC_INPUTS_O_TREE,
                    outputs: OTreeComponent.DEFAULT_OUTPUTS_O_TREE,
                    providers: [
                        { provide: OntimizeService, useFactory: ɵ0, deps: [Injector] }
                    ],
                },] },
    ];
    OTreeNodeComponent.ctorParameters = function () { return [
        { type: Injector, },
        { type: ElementRef, },
        { type: OFormComponent, decorators: [{ type: Optional }, { type: Inject, args: [forwardRef(function () { return OFormComponent; }),] },] },
        { type: OTreeComponent, decorators: [{ type: Optional }, { type: Inject, args: [forwardRef(function () { return OTreeComponent; }),] },] },
        { type: OTreeNodeComponent, decorators: [{ type: SkipSelf }, { type: Optional },] },
    ]; };
    return OTreeNodeComponent;
}(OTreeComponent));
export { OTreeNodeComponent };
var OTreeNodeComponentModule = (function () {
    function OTreeNodeComponentModule() {
    }
    OTreeNodeComponentModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [OTreeNodeComponent],
                    imports: [OntimizeWebModule, OSharedModule, CommonModule],
                    exports: [OTreeNodeComponent]
                },] },
    ];
    return OTreeNodeComponentModule;
}());
export { OTreeNodeComponentModule };
export { ɵ0 };
//# sourceMappingURL=o-tree-node.component.js.map