import * as React from 'react';
import { TimeAxisBreak } from "./TimeAxisBreak";
import { getModifiedProps, isValidProp } from "igniteui-react-core/ES2015/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>
* ```
*/
export class IgrTimeAxisBreak extends React.Component {
    constructor(props) {
        super(props);
        this._hasUserValues = new Set();
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new TimeAxisBreak();
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    get hasUserValues() {
        return this._hasUserValues;
    }
    componentDidMount() {
        for (const p of Object.keys(this.props)) {
            if (isValidProp(this, p)) {
                this._hasUserValues.add(p);
                this[p] = this.props[p];
            }
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        const mod = getModifiedProps(this.props, nextProps);
        for (const p of Object.keys(mod)) {
            if (isValidProp(this, p)) {
                this._hasUserValues.add(p);
                this[p] = mod[p];
            }
        }
        return true;
    }
    render() {
        return null;
    }
    /**
     * 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 start() {
        return this.i.d;
    }
    set start(v) {
        this.i.d = v;
    }
    /**
     * 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 end() {
        return this.i.c;
    }
    set end(v) {
        this.i.c = v;
    }
    /**
     * 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 interval() {
        return this.i.i;
    }
    set interval(v) {
        this.i.i = +v;
    }
}
