import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxAxisComponent } from "./igx-axis-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { ValueOverlay } from "./ValueOverlay";
import { ensureBool, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
var IgxValueOverlayComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxValueOverlayComponent, _super);
    function IgxValueOverlayComponent() {
        return _super.call(this) || this;
    }
    IgxValueOverlayComponent.prototype.createImplementation = function () {
        return new ValueOverlay();
    };
    Object.defineProperty(IgxValueOverlayComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axis", {
        /**
         * Gets or sets the axis used by the value overlay.
        */
        get: function () {
            var r = this.i.p8;
            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.p8 = null : this.i.p8 = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "value", {
        /**
         * Gets or sets the value of the overlay.
        */
        get: function () {
            return this.i.qr;
        },
        set: function (v) {
            this.i.qr = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.qc;
        },
        set: function (v) {
            this.i.qc = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationFormatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the axis annotation.
        */
        get: function () {
            return this.i.qa;
        },
        set: function (v) {
            this.i.qa = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.rr);
        },
        set: function (v) {
            this.i.rr = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.rp);
        },
        set: function (v) {
            this.i.rp = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.qg;
        },
        set: function (v) {
            this.i.qg = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated positions.
        */
        get: function () {
            return this.i.qs;
        },
        set: function (v) {
            this.i.qs = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.rq);
        },
        set: function (v) {
            this.i.rq = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingLeft", {
        /**
         * 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.qi;
        },
        set: function (v) {
            this.i.qi = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingTop", {
        /**
         * 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.qk;
        },
        set: function (v) {
            this.i.qk = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingRight", {
        /**
         * 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.qj;
        },
        set: function (v) {
            this.i.qj = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingBottom", {
        /**
         * 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.qh;
        },
        set: function (v) {
            this.i.qh = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.ql;
        },
        set: function (v) {
            this.i.ql = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "isValueOverlay", {
        /**
         * Gets whether the series is a value overlay.
        */
        get: function () {
            return this.i.isValueOverlay;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxValueOverlayComponent.prototype, "labelResolved", {
        get: function () {
            return this.i.q7;
        },
        enumerable: false,
        configurable: true
    });
    IgxValueOverlayComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.axis && this.axis.name && this.axis.name == name) {
            return this.axis;
        }
        return null;
    };
    IgxValueOverlayComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.axis && this.axis._styling) {
            this.axis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxValueOverlayComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.gl(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgxValueOverlayComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.pq(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Gets the item index associated with the specified world position
    
    * @param world
    */
    IgxValueOverlayComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.hf(toPoint(world));
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxValueOverlayComponent.prototype.getItem = function (world) {
        var iv = this.i.hv(toPoint(world));
        return (iv);
    };
    /**
     * Requests that the provided item should be brought into view if possible.
    
    * @param item  * The item to attempt to bring into view.
    */
    IgxValueOverlayComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.eo(item);
        return (iv);
    };
    /**
     * Gets the label for a data item.
    
    * @param value  * The unscaled value to get a label for.
    */
    IgxValueOverlayComponent.prototype.getLabel = function (value) {
        var iv = this.i.q5(value);
        return (iv);
    };
    IgxValueOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxValueOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxValueOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxValueOverlayComponent, selector: "igx-value-overlay", inputs: { axis: "axis", value: "value", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", axisAnnotationFormatLabel: "axisAnnotationFormatLabel", axisAnnotationTextColor: "axisAnnotationTextColor", axisAnnotationBackground: "axisAnnotationBackground", axisAnnotationBackgroundCornerRadius: "axisAnnotationBackgroundCornerRadius", axisAnnotationInterpolatedValuePrecision: "axisAnnotationInterpolatedValuePrecision", axisAnnotationOutline: "axisAnnotationOutline", axisAnnotationPaddingLeft: "axisAnnotationPaddingLeft", axisAnnotationPaddingTop: "axisAnnotationPaddingTop", axisAnnotationPaddingRight: "axisAnnotationPaddingRight", axisAnnotationPaddingBottom: "axisAnnotationPaddingBottom", axisAnnotationStrokeThickness: "axisAnnotationStrokeThickness" }, providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxValueOverlayComponent;
}(IgxSeriesComponent));
export { IgxValueOverlayComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxValueOverlayComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-value-overlay',
                    template: "",
                    providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { axis: [{
                type: Input
            }], value: [{
                type: Input
            }], isAxisAnnotationEnabled: [{
                type: Input
            }], axisAnnotationFormatLabel: [{
                type: Input
            }], axisAnnotationTextColor: [{
                type: Input
            }], axisAnnotationBackground: [{
                type: Input
            }], axisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], axisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], axisAnnotationOutline: [{
                type: Input
            }], axisAnnotationPaddingLeft: [{
                type: Input
            }], axisAnnotationPaddingTop: [{
                type: Input
            }], axisAnnotationPaddingRight: [{
                type: Input
            }], axisAnnotationPaddingBottom: [{
                type: Input
            }], axisAnnotationStrokeThickness: [{
                type: Input
            }] } });
