import 'whatwg-fetch';
import Cascader from '..';
import React from 'react';
import ReactDOM from 'react-dom';
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            label: '',
            data: [],
        };
        this.handleChange = this.handleChange.bind(this);
    }
    componentDidMount() {
        fetch('https://os.alipayobjects.com/rmsportal/ODDwqcDFTLAguOvWEolX.json')
            .then(response => response.json())
            .then(data => {
            this.setState({ data });
        })
            .catch(e => console.log(e));
    }
    handleChange(value, data, extra) {
        console.log(value, data, extra);
        this.setState({
            label: data.map(d => d.label).join(', '),
        });
    }
    render() {
        return (React.createElement("div", null,
            React.createElement("div", { className: "cascader-value", style: { width: '500px', fontSize: '14px', color: '#666' } },
                "Select: ",
                this.state.label),
            React.createElement(Cascader, { multiple: true, dataSource: this.state.data, onChange: this.handleChange }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("div", { style: { background: '#f3f3f3', padding: '10px' } },
                React.createElement(Cascader, { theme: 'grey', multiple: true, dataSource: this.state.data, onChange: this.handleChange }))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('cascader-demo-3'));
