import DatePicker from '../../date-picker';
import Field from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import Switch from '../../switch';
import moment from 'moment';
class App extends React.Component {
    constructor(props) {
        super(props);
        this.field = new Field(this);
    }
    render() {
        const init = this.field.init;
        return (React.createElement("div", null,
            React.createElement(Switch, Object.assign({}, init('switch', {
                getValueFormatter: value => (value ? 1 : 0),
                setValueFormatter: value => value === 1,
            }))),
            React.createElement("br", null),
            React.createElement(DatePicker, Object.assign({}, init('time', {
                getValueFormatter: value => value.format('YYYY-MM-DD'),
                setValueFormatter: value => moment(value, 'YYYY-MM-DD'),
            }))),
            React.createElement("br", null),
            React.createElement("pre", { style: { marginTop: 8 } }, JSON.stringify(this.field.getValues(), null, 2))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('field-demo-3'));
