import Radio from '../../radio';
import React from 'react';
import ReactDOM from 'react-dom';
import TreeSelect from '..';
const TreeNode = TreeSelect.Node;
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.handleSize = size => {
            this.setState({ size });
        };
        this.state = {
            size: 'medium',
        };
        this.handleChange = this.handleChange.bind(this);
    }
    handleChange(value, data) {
        console.log(value, data);
    }
    render() {
        const { size } = this.state;
        return (React.createElement("div", null,
            React.createElement(Radio.Group, { shape: "button", value: size, onChange: this.handleSize },
                React.createElement(Radio, { value: "xs" }, "xs"),
                React.createElement(Radio, { value: "small" }, "small"),
                React.createElement(Radio, { value: "medium" }, "medium"),
                React.createElement(Radio, { value: "large" }, "large")),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(TreeSelect, { treeDefaultExpandAll: true, onChange: this.handleChange, style: { width: 200 }, size: size },
                React.createElement(TreeNode, { key: "1", 
                    // @ts-ignore
                    value: "1", label: "Component" },
                    React.createElement(TreeNode, { key: "2", 
                        // @ts-ignore
                        value: "2", label: "Form" },
                        React.createElement(TreeNode, { key: "4", 
                            // @ts-ignore
                            value: "4", label: "Input" }),
                        React.createElement(TreeNode, { key: "5", 
                            // @ts-ignore
                            value: "5", label: "Select", disabled: true })),
                    React.createElement(TreeNode, { key: "3", 
                        // @ts-ignore
                        value: "3", label: "Display" },
                        React.createElement(TreeNode, { key: "6", 
                            // @ts-ignore
                            value: "6", label: "Table" }))))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('tree-select-demo-1'));
