import './demo11.css';
import Field from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, Checkbox, Radio, Switch } from '../..';
class App extends React.Component {
    constructor(props) {
        super(props);
        this.field = new Field(this);
    }
    render() {
        const init = this.field.init;
        return (React.createElement("div", { className: "demo" },
            React.createElement(Radio, Object.assign({}, init('radio', { initValue: false, valueName: 'checked' })),
                ' ',
                "checked"),
            React.createElement("br", null),
            React.createElement(Checkbox, Object.assign({}, init('checkbox', { valueName: 'checked', initValue: true })), "defaultChecked"),
            React.createElement("br", null),
            React.createElement(Switch, Object.assign({}, init('switch', { valueName: 'checked', initValue: false }), { style: { marginTop: 10, marginBottom: 10 } })),
            React.createElement("br", null),
            React.createElement(Button, { type: "primary", onClick: () => {
                    console.log(this.field.getValues());
                } }, "getValues"),
            React.createElement(Button, { onClick: () => {
                    this.field.setValues({
                        radio: true,
                        switch: true,
                        checkbox: false,
                    });
                } },
                ' ',
                "setValues",
                ' '),
            React.createElement(Button, { onClick: () => {
                    this.field.reset();
                } }, "reset")));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('field-demo-11'));
