import Input from '../../input';
import Radio from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import Switch from '../../switch';
class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            value: 1,
            dir: true,
        };
        this.onChange = (value, e) => {
            console.log('radio checked', value, e);
            this.setState({
                value,
            });
        };
        this.changeDir = () => {
            this.setState({
                dir: !this.state.dir,
            });
        };
    }
    render() {
        const { value } = this.state;
        return (React.createElement(React.Fragment, null,
            "toggle direction:",
            ' ',
            React.createElement(Switch, { size: "small", defaultChecked: true, onChange: this.changeDir, style: { verticalAlign: 'middle' } }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(Radio.Group, { onChange: this.onChange, value: value, itemDirection: this.state.dir ? 'ver' : 'hoz' },
                React.createElement(Radio, { value: 1 }, "Option A"),
                React.createElement(Radio, { value: 2 }, "Option B"),
                React.createElement(Radio, { value: 3 }, "Option C"),
                React.createElement(Radio, { value: 4 },
                    "More...",
                    value === 4 ? (React.createElement(Input, { style: { width: 100, marginLeft: 10 } })) : null))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('radio-demo-6'));
