import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES5/type";
import { AxisRangeChangedEventArgs } from "./igr-axis-range-changed-event-args";
import { IgrCategoryAxisBase } from "./igr-category-axis-base";
import { ensureBool } from "igniteui-react-core/ES5/componentUtil";
/**
 * Represents an category-based horizontal X axis that uses a DateTime scale.
*/
var IgrTimeAxisBase = /** @class */ (function (_super) {
    tslib_1.__extends(IgrTimeAxisBase, _super);
    function IgrTimeAxisBase(props) {
        var _this = _super.call(this, props) || this;
        _this._actualRangeChanged = null;
        _this._actualRangeChanged_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgrTimeAxisBase.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "dateTimeMemberPath", {
        /**
         * Gets or sets the DateTime mapping property for the axis.
        */
        get: function () {
            return this.i.dateTimeMemberPath;
        },
        set: function (v) {
            this.i.dateTimeMemberPath = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "isDataPreSorted", {
        /**
         * Gets or sets whether the data assigned to the date time axis should be considered pre-sorted by date/time.
        */
        get: function () {
            return this.i.kv;
        },
        set: function (v) {
            this.i.kv = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualMinimumValue", {
        /**
         * Gets the coerced minimum value.
        */
        get: function () {
            return this.i.actualMinimumValue;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualMaximumValue", {
        /**
         * Gets the coerced maximum value.
        */
        get: function () {
            return this.i.actualMaximumValue;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "minimumValue", {
        /**
         * Gets or sets the axis MinimumValue.
        */
        get: function () {
            return this.i.minimumValue;
        },
        set: function (v) {
            this.i.minimumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "maximumValue", {
        /**
         * Gets or sets the axis MaximumValue.
        */
        get: function () {
            return this.i.maximumValue;
        },
        set: function (v) {
            this.i.maximumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "isDateTime", {
        /**
         * Checks if the axis is of date time axis type
        */
        get: function () {
            return this.i.b5;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "isSorting", {
        /**
         * Checks if axis requires sorting of items
        */
        get: function () {
            return this.i.cc;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Gets the index of the data item with the value nearest the given value.
    
    * @param unscaledValue  * The value to find a value close to.
    */
    IgrTimeAxisBase.prototype.getIndexClosestToUnscaledValue = function (unscaledValue) {
        var iv = this.i.i$f(unscaledValue);
        return (iv);
    };
    /**
     * Updates the axis when the data has been changed.
    
    */
    IgrTimeAxisBase.prototype.notifyDataChanged = function () {
        this.i.i$i();
    };
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualRangeChanged", {
        get: function () {
            return this._actualRangeChanged;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualRangeChanged !== null) {
                this.i.actualRangeChanged = delegateRemove(this.i.actualRangeChanged, this._actualRangeChanged_wrapped);
                this._actualRangeChanged_wrapped = null;
                this._actualRangeChanged = null;
            }
            this._actualRangeChanged = ev;
            this._actualRangeChanged_wrapped = function (o, e) {
                var outerArgs = new AxisRangeChangedEventArgs();
                outerArgs._provideImplementation(e);
                _this._actualRangeChanged(_this, outerArgs);
            };
            this.i.actualRangeChanged = delegateCombine(this.i.actualRangeChanged, this._actualRangeChanged_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrTimeAxisBase;
}(IgrCategoryAxisBase));
export { IgrTimeAxisBase };
