/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Component, ViewChild, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, Input } from '@angular/core';
import { IgxTemplateContentComponent } from './igx-template-content-component';
import { TypeRegistrar } from './type';
export class IgxTooltipContainerComponent {
    constructor(_changeDetectorRef) {
        this._changeDetectorRef = _changeDetectorRef;
        this._template = null;
        this._containerTemplate = null;
        this._context = null;
    }
    set template(value) {
        this._template = value;
        if (this._context != null) {
            this._changeDetectorRef.detectChanges();
        }
    }
    get template() {
        return this._template;
    }
    set containerTemplate(value) {
        this._containerTemplate = value;
        if (this._context != null) {
            this._changeDetectorRef.detectChanges();
        }
    }
    get containerTemplate() {
        return this._containerTemplate;
    }
    set context(value) {
        this._context = value;
        this._changeDetectorRef.detectChanges();
        if (this._tooltipContent != null) {
            this._tooltipContent.markChanged();
        }
        //console.log("tool:" + this._tooltipContent != null);
    }
    get context() {
        return this._context;
    }
    static register() {
        TypeRegistrar.registerCons("IgxTooltipContainerComponent", IgxTooltipContainerComponent);
    }
}
IgxTooltipContainerComponent.decorators = [
    { type: Component, args: [{
                selector: 'igx-tooltip-container',
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: `
    <ng-template #defaultContainer>
        <div class='ui-tooltip-container' style="padding: 5px; background-color: white; border-color: #666; border-style: solid; border-width: 1px;">
            <igx-template-content *ngIf="context !== null" [template]="template" [context]="context"></igx-template-content>
        </div>
    </ng-template>
    <ng-container *ngTemplateOutlet="containerTemplate ? containerTemplate : defaultContainer; context: context">
    </ng-container>
  `,
                styles: []
            },] },
];
/** @nocollapse */
IgxTooltipContainerComponent.ctorParameters = () => [
    { type: ChangeDetectorRef, },
];
IgxTooltipContainerComponent.propDecorators = {
    "_tooltipContent": [{ type: ViewChild, args: [IgxTemplateContentComponent,] },],
    "template": [{ type: Input },],
    "containerTemplate": [{ type: Input },],
    "context": [{ type: Input },],
};
//# sourceMappingURL=igx-tooltip-container-component.js.map