import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrCategoryAxisBase } from "./igr-category-axis-base";
import { CategoryYAxis } from "./CategoryYAxis";
import { toPoint, fromRect } from "igniteui-react-core";
/**
 * Represents a IgxDataChartComponent category Y axis.
*/
var IgrCategoryYAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrCategoryYAxis, _super);
    function IgrCategoryYAxis(props) {
        var _this = _super.call(this, props) || this;
        _this._actualIntervalChange = null;
        _this._actualIntervalChange_wrapped = null;
        _this._actualMinorIntervalChange = null;
        _this._actualMinorIntervalChange_wrapped = null;
        return _this;
    }
    IgrCategoryYAxis.prototype.createImplementation = function () {
        return new CategoryYAxis();
    };
    Object.defineProperty(IgrCategoryYAxis.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "isVertical", {
        /**
         * Gets if the current axis is a vertical axis.
        */
        get: function () {
            return this.i.cp;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "interval", {
        /**
         * Gets or sets the frequency of displayed labels.
         * The set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label.
        */
        get: function () {
            return this.i.mo;
        },
        set: function (v) {
            this.i.mo = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "actualInterval", {
        /**
         * Gets the effective value for the current Interval.
        */
        get: function () {
            return this.i.ml;
        },
        set: function (v) {
            this.i.ml = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "minorInterval", {
        /**
         * Gets or sets the frequency of displayed minor lines.
         * The set value is a factor that determines how the minor lines will be displayed.
        */
        get: function () {
            return this.i.mp;
        },
        set: function (v) {
            this.i.mp = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "actualMinorInterval", {
        /**
         * Gets the effective value for the current MinorInterval.
        */
        get: function () {
            return this.i.mm;
        },
        set: function (v) {
            this.i.mm = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "zoomMaximumCategoryRange", {
        /**
         * Gets or sets number of visible categories at maximum zooming level
         * This property is overridden by chart's WindowRectMinWidth property
        */
        get: function () {
            return this.i.zoomMaximumCategoryRange;
        },
        set: function (v) {
            this.i.zoomMaximumCategoryRange = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "zoomMaximumItemSpan", {
        /**
         * Gets or sets maximum pixel span of series item that will be visible at maximum zooming level
         * This property ensures that series item does not get stretch above specified value.
         * This property is overridden by chart's WindowRectMinWidth property
        */
        get: function () {
            return this.i.zoomMaximumItemSpan;
        },
        set: function (v) {
            this.i.zoomMaximumItemSpan = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "zoomToCategoryRange", {
        /**
         * Gets or sets range of categories that the chart will zoom in and fill plot area
         * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
        */
        get: function () {
            return this.i.zoomToCategoryRange;
        },
        set: function (v) {
            this.i.zoomToCategoryRange = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "zoomToCategoryStart", {
        /**
         * Gets or sets starting category that chart will move its zoom window. Acceptable value is between 0 and number of data items
         * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
        */
        get: function () {
            return this.i.zoomToCategoryStart;
        },
        set: function (v) {
            this.i.zoomToCategoryStart = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "zoomToItemSpan", {
        /**
         * Gets or sets pixel span of series item that will be used to zoom chart such that the item has desired span
         * Chart will automaticlly zoom in until series item has specified pixel span.
         * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
        */
        get: function () {
            return this.i.zoomToItemSpan;
        },
        set: function (v) {
            this.i.zoomToItemSpan = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgrCategoryYAxis.prototype.getCategoryBoundingBox = function (point, useInterpolation, singularWidth) {
        var iv = this.i.me(toPoint(point), useInterpolation, singularWidth);
        return fromRect(iv);
    };
    IgrCategoryYAxis.prototype.scrollRangeIntoView = function (minimum, maximum) {
        this.i.m4(minimum, maximum);
    };
    /**
     * Scrolls the specified item into view.
    
    * @param item  * Data item to scroll into view
    */
    IgrCategoryYAxis.prototype.scrollIntoView = function (item) {
        this.i.m3(item);
    };
    /**
     * Gets window zoom scale required to zoom to specified number of categories
    
    */
    IgrCategoryYAxis.prototype.getWindowZoomFromCategories = function (categoriesCount) {
        var iv = this.i.getWindowZoomFromCategories(categoriesCount);
        return (iv);
    };
    /**
     * Gets window zoom scale required to zoom to specified span of series item
    
    */
    IgrCategoryYAxis.prototype.getWindowZoomFromItemSpan = function (pixels) {
        var iv = this.i.getWindowZoomFromItemSpan(pixels);
        return (iv);
    };
    Object.defineProperty(IgrCategoryYAxis.prototype, "actualIntervalChange", {
        get: function () {
            return this._actualIntervalChange;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualIntervalChange_wrapped !== null) {
                this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualIntervalChange_wrapped);
                this._actualIntervalChange_wrapped = null;
                this._actualIntervalChange = null;
            }
            this._actualIntervalChange = ev;
            this._actualIntervalChange_wrapped = function (o, e) {
                var ext = _this.actualInterval;
                if (_this.beforeActualIntervalChange) {
                    _this.beforeActualIntervalChange(_this, ext);
                }
                if (_this._actualIntervalChange) {
                    _this._actualIntervalChange(_this, ext);
                }
            };
            this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCategoryYAxis.prototype, "actualMinorIntervalChange", {
        get: function () {
            return this._actualMinorIntervalChange;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualMinorIntervalChange_wrapped !== null) {
                this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
                this._actualMinorIntervalChange_wrapped = null;
                this._actualMinorIntervalChange = null;
            }
            this._actualMinorIntervalChange = ev;
            this._actualMinorIntervalChange_wrapped = function (o, e) {
                var ext = _this.actualMinorInterval;
                if (_this.beforeActualMinorIntervalChange) {
                    _this.beforeActualMinorIntervalChange(_this, ext);
                }
                if (_this._actualMinorIntervalChange) {
                    _this._actualMinorIntervalChange(_this, ext);
                }
            };
            this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
        },
        enumerable: false,
        configurable: true
    });
    return IgrCategoryYAxis;
}(IgrCategoryAxisBase));
export { IgrCategoryYAxis };
