import * as React from 'react';
import { TimeAxisLabelFormat } from "./TimeAxisLabelFormat";
import { getModifiedProps, isValidProp } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Settings for a label format on a time axis.
 * Label formats can be applied to a time axis, which are dynamic, according to the visible range.  During zooming, the visible range of the axis can change, and so a different label format is selected.  The label format selected will be the one with the largest range smaller than the visible range of the axis.
*/
export class IgrTimeAxisLabelFormat extends React.Component {
    constructor(props) {
        super(props);
        this._hasUserValues = new Set();
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new TimeAxisLabelFormat();
    }
    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 visible axis range at which to apply this label format.
    */
    get range() {
        return this.i.f;
    }
    set range(v) {
        this.i.f = +v;
    }
    /**
     * The DateTime format string to apply.
     * Some common DateTime format strings are: yyyy, MM/dd/yy, and hh:mm:ss.
    */
    get format() {
        return this.i.b;
    }
    set format(v) {
        this.i.b = v;
    }
}
