import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { CategoryHighlightLayer } from "./CategoryHighlightLayer";
import { ensureBool } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents an annotation layer that targets a category axis, or all category axes in the chart.
 * If the axis contains any series that are aligned between major gridlines of the axis (column, waterfall, etc) this will render a shape that fills the current category.
 * Otherwise it will render a band with an adjustable thickness at the closest gridline to the pointer position.
 * Setting UseIterpolation to true will cause the x position in the latter case to become affixed to the x position of the pointer.
*/
var IgxCategoryHighlightLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxCategoryHighlightLayerComponent, _super);
    function IgxCategoryHighlightLayerComponent() {
        return _super.call(this) || this;
    }
    IgxCategoryHighlightLayerComponent.prototype.createImplementation = function () {
        return new CategoryHighlightLayer();
    };
    Object.defineProperty(IgxCategoryHighlightLayerComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCategoryHighlightLayerComponent.prototype, "targetAxis", {
        /**
         * Gets or sets the axis to target this annotation to. If null, this annotation targets all category axes simultaneously.
        */
        get: function () {
            if (this.i.pd == null) {
                return null;
            }
            if (!this.i.pd.externalObject) {
                var e = IgxCategoryAxisBaseComponent._createFromInternal(this.i.pd);
                if (e) {
                    e._implementation = this.i.pd;
                }
                this.i.pd.externalObject = e;
            }
            return this.i.pd.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.pd = null : this.i.pd = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCategoryHighlightLayerComponent.prototype, "useInterpolation", {
        /**
         * Gets or sets whether to use value interpolation when drawing a line through the best value for the pointer position.
        */
        get: function () {
            return this.i.pg;
        },
        set: function (v) {
            this.i.pg = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCategoryHighlightLayerComponent.prototype, "bandHighlightWidth", {
        /**
         * Gets or sets the width to use for the highlight region if drawing a band rather than filling a category.
        */
        get: function () {
            return this.i.ph;
        },
        set: function (v) {
            this.i.ph = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgxCategoryHighlightLayerComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        return null;
    };
    IgxCategoryHighlightLayerComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxCategoryHighlightLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxCategoryHighlightLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxCategoryHighlightLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: IgxCategoryHighlightLayerComponent, selector: "igx-category-highlight-layer", inputs: { targetAxis: "targetAxis", useInterpolation: "useInterpolation", bandHighlightWidth: "bandHighlightWidth" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCategoryHighlightLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCategoryHighlightLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxCategoryHighlightLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxCategoryHighlightLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxCategoryHighlightLayerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-category-highlight-layer',
                    template: "",
                    providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCategoryHighlightLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCategoryHighlightLayerComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { targetAxis: [{
                type: Input
            }], useInterpolation: [{
                type: Input
            }], bandHighlightWidth: [{
                type: Input
            }] } });
//# sourceMappingURL=igx-category-highlight-layer-component.js.map
