import Button from '../../button';
import Field from '../../field';
import React from 'react';
import ReactDOM from 'react-dom';
import TimePicker from '..';
import moment from 'moment';
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.onClick = () => {
            const value = this.field.getValue('time-picker');
            console.log(value.format('HH:mm:ss'));
        };
        this.field = new Field(this);
    }
    render() {
        const { init } = this.field;
        const props = init('time-picker', {
            rules: [{ required: true, message: 'Time Required' }],
            initValue: moment('00:00:00', 'HH:mm:ss', true),
        });
        return (React.createElement("div", null,
            React.createElement(TimePicker, Object.assign({}, props)),
            " ",
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(Button, { onClick: this.onClick }, "Print Value in Console")));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('time-picker-demo-9'));
