import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrCategoryAxisBase } from "./igr-category-axis-base";
import { ensureBool } from "igniteui-react-core";
/**
 * Represents an category-based horizontal X axis that uses a DateTime scale.
*
* Represents horizontal axis that uses a DateTime scale.
*
* ```ts
*   <IgrDataChart
*     dataSource={this.state.dataSource}
*     width="700px"
*     height="500px">
*     <IgrTimeXAxis name="xAxis"
* 	label="Date"
* 	dateTimeMemberPath="Date" />
*  </IgrDataChart>
* ```
*
* ```ts
* timeXAxis = new IgrTimeXAxis({name: "timeXAxis"});
* timeXAxis.title = "Time X Axis";
* timeXAxis.dataSource = data;
* timeXAxis.dateTimeMemberPath = "date";
* timeXAxis.label = "Date";
* this.chart.axes.add(xAxis);
* ```
*/
var IgrTimeAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrTimeAxisBase, _super);
    function IgrTimeAxisBase(props) {
        var _this = _super.call(this, props) || this;
        _this._actualMinimumValueChange = null;
        _this._actualMinimumValueChange_wrapped = null;
        _this._actualMaximumValueChange = null;
        _this._actualMaximumValueChange_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgrTimeAxisBase.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "dateTimeMemberPath", {
        /**
         * Gets or sets the DateTime mapping property for the axis.
        *
        * Use `dateTimeMemberPath` property for DateTime mapping with the axis.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis"
        * 	label="Date"
        * 	dateTimeMemberPath="Date" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * timeXAxis = new IgrTimeXAxis({name: "timeXAxis"});
        * timeXAxis.title = "Time X Axis";
        * timeXAxis.dataSource = data;
        * timeXAxis.dateTimeMemberPath = "date";
        * timeXAxis.label = "Date";
        * this.chart.axes.add(xAxis);
        * ```
        */
        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.
        *
        * Use `isDataPreSorted` property to decide if the data assigned to the date time axis should be considered pre-sorted by date/time.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis"
        * 	label="Date"
        * 	isDataPreSorted={true}
        * 	dateTimeMemberPath="Date" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * timeXAxis = new IgrTimeXAxis({name: "timeXAxis"});
        * timeXAxis.title = "Time X Axis";
        * timeXAxis.dataSource = data;
        * timeXAxis.dateTimeMemberPath = "date";
        * timeXAxis.isDataPreSorted= true ;
        * ```
        */
        get: function () {
            return this.i.lb;
        },
        set: function (v) {
            this.i.lb = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualMinimumValue", {
        /**
         * Gets the coerced minimum value.
        *
        * Use `actualMinimumValue` to get the coerced maximum value.
        */
        get: function () {
            return this.i.actualMinimumValue;
        },
        set: function (v) {
            this.i.actualMinimumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualMaximumValue", {
        /**
         * Gets the coerced maximum value.
        *
        * Use `actualMaximumValue` to get the  coerced maximum value
        */
        get: function () {
            return this.i.actualMaximumValue;
        },
        set: function (v) {
            this.i.actualMaximumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "minimumValue", {
        /**
         * Gets or sets the axis MinimumValue.
        *
        * Use `minimumValue` property for axis minimum value.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis"
        * 	label="Date"
        * 	maximumValue="2019-12-26"/>
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * this.timeXAxis.maximumValue="2019-12-26";
        * ```
        */
        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.
        *
        * Use `maximumValue` property for axis maximum value.
        *
        * ```ts
        * <IgrDataChart
        * dataSource={this.state.dataSource}
        * width="700px"
        * height="500px">
        * <IgrTimeXAxis name="xAxis"
        * label="Date"
        * dateTimeMemberPath="Date"
        * maximumValue ="2019-12-26"
        * />
        * ```
        *
        * ```ts
        * this.timeXAxis.maximumValue="2019-12-26";
        * ```
        */
        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
        *
        * Use `isDateTime` property to Checks if the axis is of date time axis type.
        *
        * ```ts
        * const isDT = this.timeXAxis.isDateTime;
        * ```
        */
        get: function () {
            return this.i.b7;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "isSorting", {
        /**
         * Checks if axis requires sorting of items
        *
        * Use `isSorting` property to Checks if axis requires sorting of items.
        *
        * ```ts
        * const isDT = this.timeXAxis.isDateTime;
        * ```
        */
        get: function () {
            return this.i.cf;
        },
        enumerable: true,
        configurable: true
    });
    IgrTimeAxisBase.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.e7(item, memberPathName);
        return (iv);
    };
    /**
     * 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, "actualMinimumValueChange", {
        get: function () {
            return this._actualMinimumValueChange;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualMinimumValueChange_wrapped !== null) {
                this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinimumValueChange_wrapped);
                this._actualMinimumValueChange_wrapped = null;
                this._actualMinimumValueChange = null;
            }
            this._actualMinimumValueChange = ev;
            this._actualMinimumValueChange_wrapped = function (o, e) {
                var ext = _this.actualMinimumValue;
                if (_this.beforeActualMinimumValueChange) {
                    _this.beforeActualMinimumValueChange(_this, ext);
                }
                if (_this._actualMinimumValueChange) {
                    _this._actualMinimumValueChange(_this, ext);
                }
            };
            this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinimumValueChange_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBase.prototype, "actualMaximumValueChange", {
        get: function () {
            return this._actualMaximumValueChange;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualMaximumValueChange_wrapped !== null) {
                this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMaximumValueChange_wrapped);
                this._actualMaximumValueChange_wrapped = null;
                this._actualMaximumValueChange = null;
            }
            this._actualMaximumValueChange = ev;
            this._actualMaximumValueChange_wrapped = function (o, e) {
                var ext = _this.actualMaximumValue;
                if (_this.beforeActualMaximumValueChange) {
                    _this.beforeActualMaximumValueChange(_this, ext);
                }
                if (_this._actualMaximumValueChange) {
                    _this._actualMaximumValueChange(_this, ext);
                }
            };
            this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMaximumValueChange_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrTimeAxisBase;
}(IgrCategoryAxisBase));
export { IgrTimeAxisBase };
//# sourceMappingURL=igr-time-axis-base.js.map
