import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { IgxSeriesComponent } from "./igx-series-component";
import { IgxAxisComponent } from "./igx-axis-component";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { ValueLayer } from "./ValueLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgxValueLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxValueLayerComponent, _super);
    function IgxValueLayerComponent() {
        return _super.call(this) || this;
    }
    IgxValueLayerComponent.prototype.createImplementation = function () {
        return new ValueLayer();
    };
    Object.defineProperty(IgxValueLayerComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "isAnnotationValueLayer", {
        /**
         * Gets whether the series is an crosshair annotation layer.
        */
        get: function () {
            return this.i.de;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "valueMode", {
        /**
         * Gets or sets the value mode for the overlay.
        */
        get: function () {
            return this.i.tg;
        },
        set: function (v) {
            this.i.tg = ensureEnum(ValueLayerValueMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "horizontalLineStroke", {
        /**
         * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v2);
        },
        set: function (v) {
            this.i.v2 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "verticalLineStroke", {
        /**
         * Gets or sets the color to use for vertical line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v3);
        },
        set: function (v) {
            this.i.v3 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "targetSeriesName", {
        /**
         * Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            return this.i.ub;
        },
        set: function (v) {
            this.i.ub = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            var r = this.i.te;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxSeriesComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.te = null : this.i.te = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "targetAxisName", {
        /**
         * Gets or sets the name of the axis to target this annotation to. If null, this annotation targets all axis simultaneously.
        */
        get: function () {
            return this.i.t8;
        },
        set: function (v) {
            this.i.t8 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "targetAxis", {
        /**
         * Gets or sets the axis to target this annotation to. If null, this annotation targets all value axis simultaneously.
        */
        get: function () {
            var r = this.i.tb;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.tb = null : this.i.tb = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "useInterpolation", {
        /**
         * Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
        */
        get: function () {
            return this.i.tn;
        },
        set: function (v) {
            this.i.tn = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.tk;
        },
        set: function (v) {
            this.i.tk = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v6);
        },
        set: function (v) {
            this.i.v6 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v4);
        },
        set: function (v) {
            this.i.v4 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.tq;
        },
        set: function (v) {
            this.i.tq = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.t2;
        },
        set: function (v) {
            this.i.t2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v5);
        },
        set: function (v) {
            this.i.v5 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.ts;
        },
        set: function (v) {
            this.i.ts = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.tu;
        },
        set: function (v) {
            this.i.tu = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.tt;
        },
        set: function (v) {
            this.i.tt = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.tr;
        },
        set: function (v) {
            this.i.tr = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.ty;
        },
        set: function (v) {
            this.i.ty = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.t0;
        },
        set: function (v) {
            this.i.t0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.tz;
        },
        set: function (v) {
            this.i.tz = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.tx;
        },
        set: function (v) {
            this.i.tx = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.tv;
        },
        set: function (v) {
            this.i.tv = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v9);
        },
        set: function (v) {
            this.i.v9 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v7);
        },
        set: function (v) {
            this.i.v7 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.tw;
        },
        set: function (v) {
            this.i.tw = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.t3;
        },
        set: function (v) {
            this.i.t3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.v8);
        },
        set: function (v) {
            this.i.v8 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.t1;
        },
        set: function (v) {
            this.i.t1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueLayerComponent.prototype, "skipUnknownValues", {
        /**
         * Gets or sets whether to skip unknown values when searching for series values.
        */
        get: function () {
            return this.i.tm;
        },
        set: function (v) {
            this.i.tm = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgxValueLayerComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
            return this.targetSeries;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        return null;
    };
    IgxValueLayerComponent.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);
        }
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxValueLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxValueLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxValueLayerComponent, selector: "igx-value-layer", inputs: { valueMode: "valueMode", horizontalLineStroke: "horizontalLineStroke", verticalLineStroke: "verticalLineStroke", targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", targetAxisName: "targetAxisName", targetAxis: "targetAxis", useInterpolation: "useInterpolation", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", xAxisAnnotationTextColor: "xAxisAnnotationTextColor", xAxisAnnotationBackground: "xAxisAnnotationBackground", xAxisAnnotationBackgroundCornerRadius: "xAxisAnnotationBackgroundCornerRadius", xAxisAnnotationInterpolatedValuePrecision: "xAxisAnnotationInterpolatedValuePrecision", xAxisAnnotationOutline: "xAxisAnnotationOutline", xAxisAnnotationPaddingLeft: "xAxisAnnotationPaddingLeft", xAxisAnnotationPaddingTop: "xAxisAnnotationPaddingTop", xAxisAnnotationPaddingRight: "xAxisAnnotationPaddingRight", xAxisAnnotationPaddingBottom: "xAxisAnnotationPaddingBottom", yAxisAnnotationPaddingLeft: "yAxisAnnotationPaddingLeft", yAxisAnnotationPaddingTop: "yAxisAnnotationPaddingTop", yAxisAnnotationPaddingRight: "yAxisAnnotationPaddingRight", yAxisAnnotationPaddingBottom: "yAxisAnnotationPaddingBottom", xAxisAnnotationStrokeThickness: "xAxisAnnotationStrokeThickness", yAxisAnnotationTextColor: "yAxisAnnotationTextColor", yAxisAnnotationBackground: "yAxisAnnotationBackground", yAxisAnnotationBackgroundCornerRadius: "yAxisAnnotationBackgroundCornerRadius", yAxisAnnotationInterpolatedValuePrecision: "yAxisAnnotationInterpolatedValuePrecision", yAxisAnnotationOutline: "yAxisAnnotationOutline", yAxisAnnotationStrokeThickness: "yAxisAnnotationStrokeThickness", skipUnknownValues: "skipUnknownValues" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxValueLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxValueLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueLayerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-value-layer',
                    template: "",
                    providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { valueMode: [{
                type: Input
            }], horizontalLineStroke: [{
                type: Input
            }], verticalLineStroke: [{
                type: Input
            }], targetSeriesName: [{
                type: Input
            }], targetSeries: [{
                type: Input
            }], targetAxisName: [{
                type: Input
            }], targetAxis: [{
                type: Input
            }], useInterpolation: [{
                type: Input
            }], isAxisAnnotationEnabled: [{
                type: Input
            }], xAxisAnnotationTextColor: [{
                type: Input
            }], xAxisAnnotationBackground: [{
                type: Input
            }], xAxisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], xAxisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], xAxisAnnotationOutline: [{
                type: Input
            }], xAxisAnnotationPaddingLeft: [{
                type: Input
            }], xAxisAnnotationPaddingTop: [{
                type: Input
            }], xAxisAnnotationPaddingRight: [{
                type: Input
            }], xAxisAnnotationPaddingBottom: [{
                type: Input
            }], yAxisAnnotationPaddingLeft: [{
                type: Input
            }], yAxisAnnotationPaddingTop: [{
                type: Input
            }], yAxisAnnotationPaddingRight: [{
                type: Input
            }], yAxisAnnotationPaddingBottom: [{
                type: Input
            }], xAxisAnnotationStrokeThickness: [{
                type: Input
            }], yAxisAnnotationTextColor: [{
                type: Input
            }], yAxisAnnotationBackground: [{
                type: Input
            }], yAxisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], yAxisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], yAxisAnnotationOutline: [{
                type: Input
            }], yAxisAnnotationStrokeThickness: [{
                type: Input
            }], skipUnknownValues: [{
                type: Input
            }] } });
