/*
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 * as tslib_1 from "tslib";
import { Component, EventEmitter, Output, ViewChild, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef } from '@angular/core';
import { TypeRegistrar } from "igniteui-angular-core/ES5/type";
var IgxDoughnutChartDefaultTooltipsComponent = /** @class */ (function () {
    function IgxDoughnutChartDefaultTooltipsComponent(_changeDetectorRef) {
        this._changeDetectorRef = _changeDetectorRef;
        this.onContentReady = new EventEmitter();
    }
    IgxDoughnutChartDefaultTooltipsComponent_1 = IgxDoughnutChartDefaultTooltipsComponent;
    IgxDoughnutChartDefaultTooltipsComponent.prototype.ensureDefaultTooltip = function (series) {
        if (series.showDefaultTooltip) {
            series.tooltipTemplate = this.doughnutSliceTooltip;
        }
        else {
            if (series.tooltipTemplate === this.doughnutSliceTooltip) {
                series.tooltipTemplate = null;
            }
        }
    };
    IgxDoughnutChartDefaultTooltipsComponent.prototype.getSliceLabel = function (series, item) {
        return item[series.labelMemberPath];
    };
    IgxDoughnutChartDefaultTooltipsComponent.prototype.getValue = function (series, item) {
        return item[this.getValueMemberPath(series)];
    };
    IgxDoughnutChartDefaultTooltipsComponent.prototype.getValueMemberPath = function (series) {
        return series.valueMemberPath;
    };
    IgxDoughnutChartDefaultTooltipsComponent.prototype.getBrush = function (i) {
        if (i.slice.background)
            return i.slice.background.fill;
        return "black";
    };
    IgxDoughnutChartDefaultTooltipsComponent.register = function () {
        TypeRegistrar.registerCons("IgxDoughnutChartDefaultTooltipsComponent", IgxDoughnutChartDefaultTooltipsComponent_1);
    };
    IgxDoughnutChartDefaultTooltipsComponent.prototype.ngAfterContentInit = function () {
        this.onContentReady.emit({});
    };
    var IgxDoughnutChartDefaultTooltipsComponent_1;
    tslib_1.__decorate([
        ViewChild("doughnutSliceTooltip", { static: true }),
        tslib_1.__metadata("design:type", TemplateRef)
    ], IgxDoughnutChartDefaultTooltipsComponent.prototype, "doughnutSliceTooltip", void 0);
    tslib_1.__decorate([
        Output(),
        tslib_1.__metadata("design:type", EventEmitter)
    ], IgxDoughnutChartDefaultTooltipsComponent.prototype, "onContentReady", void 0);
    IgxDoughnutChartDefaultTooltipsComponent = IgxDoughnutChartDefaultTooltipsComponent_1 = tslib_1.__decorate([
        Component({
            selector: 'igx-dougnut-chart-default-tooltips',
            changeDetection: ChangeDetectionStrategy.OnPush,
            template: "\n    <ng-template #doughnutSliceTooltip let-series=\"series\" let-item=\"item\" let-implementation=\"i\">\n        <div class='ui-chart-default-tooltip-content'>            \n            <span [style.color]=\"getBrush(implementation)\">{{getSliceLabel(series, item)}}</span>\n            <br/>\n            <span class=\"ui-tooltip-priority\">{{getValueMemberPath(series)}} : {{getValue(series, item)}}</span>\n        </div>\n    </ng-template>\n  ",
            styles: []
        }),
        tslib_1.__metadata("design:paramtypes", [ChangeDetectorRef])
    ], IgxDoughnutChartDefaultTooltipsComponent);
    return IgxDoughnutChartDefaultTooltipsComponent;
}());
export { IgxDoughnutChartDefaultTooltipsComponent };
//# sourceMappingURL=igx-doughnut-chart-default-tooltips-component.js.map