/*
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, EventEmitter, Output, ViewChild, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef } from '@angular/core';
import { TypeRegistrar } from "igniteui-angular-core/ES2015/type";
export class IgxSimpleDefaultTooltipComponent {
    constructor(_changeDetectorRef) {
        this._changeDetectorRef = _changeDetectorRef;
        this.onContentReady = new EventEmitter();
    }
    ensureDefaultTooltip(gauge) {
        if (gauge.showToolTip) {
            gauge.tooltipTemplate = this.tooltip;
        }
        else {
            gauge.tooltipTemplate = null;
        }
    }
    getLabel(context) {
        if (context.itemName == null) {
            let label = context.label.split(":");
            return label.length < 2 ? context.label : label[1].trim();
        }
        return context.label;
    }
    ngAfterContentInit() {
        this.onContentReady.emit({});
    }
    static register() {
        TypeRegistrar.registerCons("IgxSimpleDefaultTooltipComponent", IgxSimpleDefaultTooltipComponent);
    }
}
IgxSimpleDefaultTooltipComponent.decorators = [
    { type: Component, args: [{
                selector: 'igx-simple-default-tooltips',
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: `  
  <ng-template #tooltip let-context="i" >
    <div class='ui-simple-default-tooltip-content' *ngIf="context">
        <span  style="white-space: nowrap;font-weight: bold;" >{{getLabel(context)}}</span>
    </div>
  </ng-template>
  `,
                styles: []
            },] },
];
/** @nocollapse */
IgxSimpleDefaultTooltipComponent.ctorParameters = () => [
    { type: ChangeDetectorRef, },
];
IgxSimpleDefaultTooltipComponent.propDecorators = {
    "tooltip": [{ type: ViewChild, args: ["tooltip",] },],
    "onContentReady": [{ type: Output },],
};
//# sourceMappingURL=igx-simple-default-tooltip-component.js.map