var IgxCalloutLayerComponent_1;
import * as tslib_1 from "tslib";
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxSeriesComponent } from "./igx-series-component";
import { CalloutCollisionMode, CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { IgxCalloutStyleUpdatingEventArgs } from "./igx-callout-style-updating-event-args";
import { IgxCalloutContentUpdatingEventArgs } from "./igx-callout-content-updating-event-args";
import { IgxCalloutLabelUpdatingEventArgs } from "./igx-callout-label-updating-event-args";
import { IgxCalloutSeriesSelectingEventArgs } from "./igx-callout-series-selecting-event-args";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { CalloutLayer } from "./CalloutLayer";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-angular-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
export const IgxCalloutLayerComponent_PROVIDERS = [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCalloutLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCalloutLayerComponent) }];
let IgxCalloutLayerComponent = IgxCalloutLayerComponent_1 = class IgxCalloutLayerComponent extends IgxAnnotationLayerComponent {
    constructor() {
        super();
        this._calloutStyleUpdating = null;
        this._calloutContentUpdating = null;
        this._calloutLabelUpdating = null;
        this._calloutSeriesSelecting = null;
    }
    createImplementation() {
        return new CalloutLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * Gets or sets the label mapping property for the callouts.
    */
    get labelMemberPath() {
        return this.i.pc;
    }
    set labelMemberPath(v) {
        this.i.pc = v;
    }
    /**
     * Gets or sets the label mapping property for the callouts.
    */
    get xMemberPath() {
        return this.i.pj;
    }
    set xMemberPath(v) {
        this.i.pj = v;
    }
    /**
     * Gets or sets the label mapping property for the callouts.
    */
    get yMemberPath() {
        return this.i.pm;
    }
    set yMemberPath(v) {
        this.i.pm = v;
    }
    /**
     * Gets or sets the key mapping property for the callouts.
    */
    get keyMemberPath() {
        return this.i.o9;
    }
    set keyMemberPath(v) {
        this.i.o9 = v;
    }
    /**
     * Gets or sets whether to allow the callouts to be variable distances from the target points, for suppporting collision modes.
    */
    get isCalloutOffsettingEnabled() {
        return this.i.ny;
    }
    set isCalloutOffsettingEnabled(v) {
        this.i.ny = ensureBool(v);
    }
    /**
     * Gets or sets the content mapping property for the callouts.
    */
    get contentMemberPath() {
        return this.i.o3;
    }
    set contentMemberPath(v) {
        this.i.o3 = v;
    }
    /**
     * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeries() {
        if (this.i.na == null) {
            return null;
        }
        if (!this.i.na.externalObject) {
            let e = IgxSeriesComponent._createFromInternal(this.i.na);
            if (e) {
                e._implementation = this.i.na;
            }
            this.i.na.externalObject = e;
        }
        return this.i.na.externalObject;
    }
    set targetSeries(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.na = null : this.i.na = v.i;
    }
    /**
     * Gets or sets a channel name to identify other callout layers within the chart to share collision information with.
    */
    get collisionChannel() {
        return this.i.o0;
    }
    set collisionChannel(v) {
        this.i.o0 = v;
    }
    /**
     * Gets or sets how to select the final value to annotate.
    */
    get isAutoCalloutBehaviorEnabled() {
        return this.i.nx;
    }
    set isAutoCalloutBehaviorEnabled(v) {
        this.i.nx = ensureBool(v);
    }
    /**
     * Gets or sets whether to use values, rather than labels for auto callout labels.
    */
    get useValueForAutoCalloutLabels() {
        return this.i.n0;
    }
    set useValueForAutoCalloutLabels(v) {
        this.i.n0 = ensureBool(v);
    }
    /**
     * Gets or sets whether to allow for custom callout styles.
    */
    get isCustomCalloutStyleEnabled() {
        return this.i.nz;
    }
    set isCustomCalloutStyleEnabled(v) {
        this.i.nz = ensureBool(v);
    }
    /**
     * Gets or sets the precision to use when values are used for the auto callout labels.
    */
    get autoCalloutLabelPrecision() {
        return this.i.oi;
    }
    set autoCalloutLabelPrecision(v) {
        this.i.oi = +v;
    }
    /**
     * Gets or sets the color to use for the callout text. Leave unset for an automatic value.
    */
    get calloutTextColor() {
        return brushToString(this.i.qu);
    }
    set calloutTextColor(v) {
        this.i.qu = stringToBrush(v);
    }
    /**
     * Gets or sets the brush that specifies how the backgrounds for the callouts of the layer are painted. Leave unset for an automatic value.
    */
    get calloutBackground() {
        return brushToString(this.i.qr);
    }
    set calloutBackground(v) {
        this.i.qr = stringToBrush(v);
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get calloutInterpolatedValuePrecision() {
        return this.i.oj;
    }
    set calloutInterpolatedValuePrecision(v) {
        this.i.oj = +v;
    }
    /**
     * Gets or sets the brush that specifies how the outlines for the callouts of the layer are painted.
    */
    get calloutOutline() {
        return brushToString(this.i.qt);
    }
    set calloutOutline(v) {
        this.i.qt = stringToBrush(v);
    }
    /**
     * Gets or sets the brush that specifies how the leader lines for the callouts of the layer are painted.
    */
    get calloutLeaderBrush() {
        return brushToString(this.i.qs);
    }
    set calloutLeaderBrush(v) {
        this.i.qs = stringToBrush(v);
    }
    /**
     * Gets or sets the left padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get calloutPaddingLeft() {
        return this.i.ob;
    }
    set calloutPaddingLeft(v) {
        this.i.ob = +v;
    }
    /**
     * Gets or sets the top padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get calloutPaddingTop() {
        return this.i.od;
    }
    set calloutPaddingTop(v) {
        this.i.od = +v;
    }
    /**
     * Gets or sets the right padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get calloutPaddingRight() {
        return this.i.oc;
    }
    set calloutPaddingRight(v) {
        this.i.oc = +v;
    }
    /**
     * Gets or sets the bottom padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get calloutPaddingBottom() {
        return this.i.oa;
    }
    set calloutPaddingBottom(v) {
        this.i.oa = +v;
    }
    /**
     * Gets or sets the strategy to use for avoiding collisions between the callouts in this layer. Leave unset for an automatic value.
    */
    get calloutCollisionMode() {
        return this.i.m4;
    }
    set calloutCollisionMode(v) {
        this.i.m4 = ensureEnum(CalloutCollisionMode_$type, v);
    }
    /**
     * Gets or sets the padding to add to the callout positioning. Leave unset for an automatic value.
    */
    get calloutPositionPadding() {
        return this.i.oe;
    }
    set calloutPositionPadding(v) {
        this.i.oe = +v;
    }
    /**
     * Gets or sets the stroke thickness for the callout backing. Leave unset for an automatic value.
    */
    get calloutStrokeThickness() {
        return this.i.of;
    }
    set calloutStrokeThickness(v) {
        this.i.of = +v;
    }
    /**
     * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
    */
    get textStyle() {
        return this.i.pf;
    }
    set textStyle(v) {
        this.i.pf = v;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.targetSeries && this.targetSeries._styling) {
            this.targetSeries._styling(container, component, this);
        }
        this._inStyling = false;
    }
    getItemValue(item, memberPathName) {
        let iv = this.i.fs(item, memberPathName);
        return (iv);
    }
    /**
     * Invalidates content of callout layer
    
    */
    invalidateCalloutContent() {
        this.i.pv();
    }
    /**
     * Event raised when updating style of callout layer
    */
    get calloutStyleUpdating() {
        if (this._calloutStyleUpdating == null) {
            this._calloutStyleUpdating = new EventEmitter();
            this.i.calloutStyleUpdating = delegateCombine(this.i.calloutStyleUpdating, (o, e) => {
                this._runInZone(() => {
                    let outerArgs = new IgxCalloutStyleUpdatingEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeCalloutStyleUpdating) {
                        this.beforeCalloutStyleUpdating(this, outerArgs);
                    }
                    this._calloutStyleUpdating.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            });
        }
        return this._calloutStyleUpdating;
    }
    /**
     * Raised to allow you to decide on the content for an automatically created callout.
    */
    get calloutContentUpdating() {
        if (this._calloutContentUpdating == null) {
            this._calloutContentUpdating = new EventEmitter();
            this.i.calloutContentUpdating = delegateCombine(this.i.calloutContentUpdating, (o, e) => {
                this._runInZone(() => {
                    let outerArgs = new IgxCalloutContentUpdatingEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeCalloutContentUpdating) {
                        this.beforeCalloutContentUpdating(this, outerArgs);
                    }
                    this._calloutContentUpdating.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            });
        }
        return this._calloutContentUpdating;
    }
    /**
     * Raised to allow you to decide on the label for an automatically created callout.
    */
    get calloutLabelUpdating() {
        if (this._calloutLabelUpdating == null) {
            this._calloutLabelUpdating = new EventEmitter();
            this.i.calloutLabelUpdating = delegateCombine(this.i.calloutLabelUpdating, (o, e) => {
                this._runInZone(() => {
                    let outerArgs = new IgxCalloutLabelUpdatingEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeCalloutLabelUpdating) {
                        this.beforeCalloutLabelUpdating(this, outerArgs);
                    }
                    this._calloutLabelUpdating.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            });
        }
        return this._calloutLabelUpdating;
    }
    /**
     * Raised to allow you to select a target series for a data bound callout.
    */
    get calloutSeriesSelecting() {
        if (this._calloutSeriesSelecting == null) {
            this._calloutSeriesSelecting = new EventEmitter();
            this.i.calloutSeriesSelecting = delegateCombine(this.i.calloutSeriesSelecting, (o, e) => {
                this._runInZone(() => {
                    let outerArgs = new IgxCalloutSeriesSelectingEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeCalloutSeriesSelecting) {
                        this.beforeCalloutSeriesSelecting(this, outerArgs);
                    }
                    this._calloutSeriesSelecting.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            });
        }
        return this._calloutSeriesSelecting;
    }
};
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "labelMemberPath", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "xMemberPath", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "yMemberPath", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "keyMemberPath", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Boolean),
    tslib_1.__metadata("design:paramtypes", [Boolean])
], IgxCalloutLayerComponent.prototype, "isCalloutOffsettingEnabled", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "contentMemberPath", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", IgxSeriesComponent),
    tslib_1.__metadata("design:paramtypes", [IgxSeriesComponent])
], IgxCalloutLayerComponent.prototype, "targetSeries", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "collisionChannel", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Boolean),
    tslib_1.__metadata("design:paramtypes", [Boolean])
], IgxCalloutLayerComponent.prototype, "isAutoCalloutBehaviorEnabled", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Boolean),
    tslib_1.__metadata("design:paramtypes", [Boolean])
], IgxCalloutLayerComponent.prototype, "useValueForAutoCalloutLabels", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Boolean),
    tslib_1.__metadata("design:paramtypes", [Boolean])
], IgxCalloutLayerComponent.prototype, "isCustomCalloutStyleEnabled", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "autoCalloutLabelPrecision", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "calloutTextColor", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "calloutBackground", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutInterpolatedValuePrecision", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "calloutOutline", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "calloutLeaderBrush", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutPaddingLeft", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutPaddingTop", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutPaddingRight", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutPaddingBottom", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutCollisionMode", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutPositionPadding", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxCalloutLayerComponent.prototype, "calloutStrokeThickness", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxCalloutLayerComponent.prototype, "textStyle", null);
tslib_1.__decorate([
    Output(),
    tslib_1.__metadata("design:type", EventEmitter),
    tslib_1.__metadata("design:paramtypes", [])
], IgxCalloutLayerComponent.prototype, "calloutStyleUpdating", null);
tslib_1.__decorate([
    Output(),
    tslib_1.__metadata("design:type", EventEmitter),
    tslib_1.__metadata("design:paramtypes", [])
], IgxCalloutLayerComponent.prototype, "calloutContentUpdating", null);
tslib_1.__decorate([
    Output(),
    tslib_1.__metadata("design:type", EventEmitter),
    tslib_1.__metadata("design:paramtypes", [])
], IgxCalloutLayerComponent.prototype, "calloutLabelUpdating", null);
tslib_1.__decorate([
    Output(),
    tslib_1.__metadata("design:type", EventEmitter),
    tslib_1.__metadata("design:paramtypes", [])
], IgxCalloutLayerComponent.prototype, "calloutSeriesSelecting", null);
IgxCalloutLayerComponent = IgxCalloutLayerComponent_1 = tslib_1.__decorate([
    Component({
        selector: 'igx-callout-layer',
        template: ``,
        providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCalloutLayerComponent_1) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCalloutLayerComponent_1) }],
        changeDetection: ChangeDetectionStrategy.OnPush
    }),
    tslib_1.__metadata("design:paramtypes", [])
], IgxCalloutLayerComponent);
export { IgxCalloutLayerComponent };
//# sourceMappingURL=igx-callout-layer-component.js.map