import * as tslib_1 from "tslib";
import { TimeAxisLabelFormatCollection } from "./igr-time-axis-label-format-collection";
import { IgrCategoryXAxis } from "./igr-category-x-axis";
import { OrdinalTimeXAxis } from "./OrdinalTimeXAxis";
import { TimeAxisLabelFormatCollection as TimeAxisLabelFormatCollection_internal } from "./TimeAxisLabelFormatCollection";
import { TimeAxisLabelFormat } from "./TimeAxisLabelFormat";
import { SyncableObservableCollection$1 } from "igniteui-react-core/ES5/SyncableObservableCollection$1";
/**
 * A horizontal axis that uses an ordinal DateTime scale.
 * On an ordinal time axis, datapoints are aligned according to their order in the ItemsSource, like a category axis.
*
* You can use the `IgrOrdinalTimeXAxis` to display dates at equidistant.
*/
var IgrOrdinalTimeXAxis = /** @class */ (function (_super) {
    tslib_1.__extends(IgrOrdinalTimeXAxis, _super);
    function IgrOrdinalTimeXAxis(props) {
        var _this = _super.call(this, props) || this;
        _this._labelFormats = null;
        return _this;
    }
    IgrOrdinalTimeXAxis.prototype.createImplementation = function () {
        return new OrdinalTimeXAxis();
    };
    Object.defineProperty(IgrOrdinalTimeXAxis.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrOrdinalTimeXAxis.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(IgrOrdinalTimeXAxis.prototype, "labelFormats", {
        /**
         * A list of axis label formats to apply, which are selected according to the visible axis range.
         * The label format selected will be the one with the largest range smaller than the visible range of the axis.
        *
        * You can use the `labelFormats` for adjusting the labels depending on the range of the time shown by the chart.
        *
        * ```ts
        * let labelFormat = new TimeAxisLabelFormat();
        * labelFormat.format = "hh:mm:ss";
        * labelFormat.range = 1000;
        * this.xAxis.labelFormats.add(labelFormat);
        * labelFormat = new TimeAxisLabelFormat();
        * labelFormat.format = "hh:mm";
        * labelFormat.range = 60 * 1000;
        * this.xAxis.labelFormats.add(labelFormat);
        * labelFormat = new TimeAxisLabelFormat();
        * labelFormat.format = "MMM-dd-yy";
        * labelFormat.range = 24 * 60 * 60 * 1000;
        * this.xAxis.labelFormats.add(labelFormat);
        * labelFormat = new TimeAxisLabelFormat();
        * labelFormat.format = "MMM yy";
        * labelFormat.range = 365.24 * 24 * 60 * 60 * 1000;
        * this.xAxis.labelFormats.add(labelFormat);
        * labelFormat = new TimeAxisLabelFormat();
        * labelFormat.format = "yyyy";
        * labelFormat.range = 5 * 365 * 24 * 60 * 60 * 1000;
        * this.xAxis.labelFormats.add(labelFormat);
        * ```
        */
        get: function () {
            if (this._labelFormats === null) {
                var coll = new TimeAxisLabelFormatCollection();
                var innerColl = this.i.le;
                if (!innerColl) {
                    innerColl = new TimeAxisLabelFormatCollection_internal();
                }
                this._labelFormats = coll._fromInner(innerColl);
            }
            return this._labelFormats;
        },
        set: function (v) {
            if (this._labelFormats !== null) {
                this._labelFormats._setSyncTarget(null);
                this._labelFormats = null;
            }
            var coll = new TimeAxisLabelFormatCollection();
            this._labelFormats = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(TimeAxisLabelFormat.$type);
            var innerColl = this.i.le;
            if (!innerColl) {
                innerColl = new TimeAxisLabelFormatCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._labelFormats._setSyncTarget(syncColl);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrOrdinalTimeXAxis.prototype, "minimumValue", {
        /**
         * Sets the minimum DateTime value to be displayed on this axis.
         * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource.  It will ignore any setting outside the actual range of data.
        */
        get: function () {
            return this.i.minimumValue;
        },
        set: function (v) {
            this.i.minimumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrOrdinalTimeXAxis.prototype, "maximumValue", {
        /**
         * Sets the maximum DateTime value to be displayed on this axis.
         * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource.  It will ignore any setting outside the actual range of data.
        */
        get: function () {
            return this.i.maximumValue;
        },
        set: function (v) {
            this.i.maximumValue = v;
        },
        enumerable: true,
        configurable: true
    });
    return IgrOrdinalTimeXAxis;
}(IgrCategoryXAxis));
export { IgrOrdinalTimeXAxis };
