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