import { IgrAxis } from "./igr-axis";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CategoryToolTipLayer } from "./CategoryToolTipLayer";
import { ensureBool } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays grouped tooltips for series that use a category axis.
*/
export class IgrCategoryToolTipLayer extends IgrAnnotationLayer {
    createImplementation() {
        return new CategoryToolTipLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
    */
    get isDefaultTooltipBehaviorDisabled() {
        return this.i.c2;
    }
    /**
     * Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content.
    */
    get targetAxis() {
        if (this.i.pd == null) {
            return null;
        }
        if (!this.i.pd.externalObject) {
            let e = IgrAxis._createFromInternal(this.i.pd);
            if (e) {
                e._implementation = this.i.pd;
            }
            this.i.pd.externalObject = e;
        }
        return this.i.pd.externalObject;
    }
    set targetAxis(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;
    }
    /**
     * Gets or sets whether to use value interpolation when drawing the tooltips.
    */
    get useInterpolation() {
        return this.i.ph;
    }
    set useInterpolation(v) {
        this.i.ph = ensureBool(v);
    }
    findByName(name) {
        var baseResult = super.findByName(name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        return null;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
    /**
     * Hides any tooltips presented by the layer, if any.
    
    */
    hideToolTips() {
        this.i.j1();
    }
}
//# sourceMappingURL=igr-category-tool-tip-layer.js.map
