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