import './demo3.css';
import Checkbox from '../../checkbox';
import React from 'react';
import ReactDOM from 'react-dom';
import TreeSelect from '..';
const dataSource = [
    {
        label: 'Component',
        value: '1',
        children: [
            {
                label: 'Form',
                value: '2',
                children: [
                    {
                        label: 'Input',
                        value: '4',
                    },
                    {
                        label: 'Select',
                        value: '5',
                        disabled: true,
                    },
                ],
            },
            {
                label: 'Display',
                value: '3',
                children: [
                    {
                        label: 'Table',
                        value: '6',
                    },
                ],
            },
        ],
    },
];
class Demo extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            multiple: false,
        };
        this.handleChange = (value, data) => {
            console.log(value, data);
        };
        this.handleCheck = v => {
            this.setState({
                multiple: v,
            });
        };
    }
    render() {
        const { multiple } = this.state;
        return (React.createElement("div", { className: "control-select-demo", key: `control-select-demo-${multiple}` },
            React.createElement("label", { className: "multiple-check" },
                React.createElement(Checkbox, { checked: multiple, onChange: this.handleCheck }),
                React.createElement("span", { className: "multiple-text" }, "\u5141\u8BB8\u591A\u9009")),
            React.createElement(TreeSelect, { treeDefaultExpandAll: true, hasClear: true, multiple: multiple, 
                // onSelect={this.handleSelect}
                dataSource: dataSource, style: { width: 200 } })));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('tree-select-demo-3'));
