import * as tslib_1 from "tslib";
import * as React from 'react';
import { TimeAxisBreak } from "./TimeAxisBreak";
import { getModifiedProps, isValidProp } from "igniteui-react-core/ES5/componentUtil";
/**
 * Settings for breaks on a time axis.
 * Axis breaks can be added to a time axis in order to omit portions of time on that axis.  For example, weekends can be skipped, if they are not relevant to your data.
*
* The `IgrTimeAxisBreak` class is used for settings time axis breaks.
*
* ```ts
*   <IgrDataChart
*     dataSource={this.state.dataSource}
*     width="700px"
*     height="500px">
*     <IgrTimeXAxis name="xAxis" label="Date"
* 			dateTimeMemberPath="Date" >
*  </IgrTimeXAxis>
*  </IgrDataChart>
* ```
*/
var IgrTimeAxisBreak = /** @class */ (function (_super) {
    tslib_1.__extends(IgrTimeAxisBreak, _super);
    function IgrTimeAxisBreak(props) {
        var _this = _super.call(this, props) || this;
        _this._hasUserValues = new Set();
        _this._implementation = _this.createImplementation();
        _this._implementation.externalObject = _this;
        _this.onImplementationCreated();
        return _this;
    }
    IgrTimeAxisBreak.prototype.createImplementation = function () {
        return new TimeAxisBreak();
    };
    Object.defineProperty(IgrTimeAxisBreak.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgrTimeAxisBreak.prototype.onImplementationCreated = function () {
    };
    Object.defineProperty(IgrTimeAxisBreak.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: true,
        configurable: true
    });
    IgrTimeAxisBreak.prototype.componentDidMount = function () {
        var e_1, _a;
        try {
            for (var _b = tslib_1.__values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this._hasUserValues.add(p);
                    this[p] = this.props[p];
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
    };
    IgrTimeAxisBreak.prototype.shouldComponentUpdate = function (nextProps, nextState) {
        var e_2, _a;
        var mod = getModifiedProps(this.props, nextProps);
        try {
            for (var _b = tslib_1.__values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this._hasUserValues.add(p);
                    this[p] = mod[p];
                }
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_2) throw e_2.error; }
        }
        return true;
    };
    IgrTimeAxisBreak.prototype.render = function () {
        return null;
    };
    Object.defineProperty(IgrTimeAxisBreak.prototype, "start", {
        /**
         * The start time of the axis break.
        *
        * Use `start` property for the start time of the axis break.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis" label="Date"
        * 			dateTimeMemberPath="Date" >
        *  </IgrTimeXAxis>
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.d;
        },
        set: function (v) {
            this.i.d = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBreak.prototype, "end", {
        /**
         * The end time of the axis break.
        *
        * Use `end` property for the end time of the axis break.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis" label="Date"
        * 			dateTimeMemberPath="Date" >
        *
        *  </IgrTimeXAxis>
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.c;
        },
        set: function (v) {
            this.i.c = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrTimeAxisBreak.prototype, "interval", {
        /**
         * The interval at which to repeat this break, expressed as a TimeSpan.
        *
        * Use `interval` property to se the interval at which to repeat this break, expressed as a TimeSpan.
        *
        * ```ts
        *   <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *     <IgrTimeXAxis name="xAxis" label="Date"
        * 			dateTimeMemberPath="Date" >
        *
        *  </IgrTimeXAxis>
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.i;
        },
        set: function (v) {
            this.i.i = +v;
        },
        enumerable: true,
        configurable: true
    });
    return IgrTimeAxisBreak;
}(React.Component));
export { IgrTimeAxisBreak };
