import 'whatwg-fetch';
import CascaderSelect from '..';
import React from 'react';
import ReactDOM from 'react-dom';
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.handleChange = (value, data, extra) => {
            console.log(value, data, extra);
        };
        this.state = {
            data: [],
        };
    }
    componentDidMount() {
        fetch('https://os.alipayobjects.com/rmsportal/ODDwqcDFTLAguOvWEolX.json')
            .then(response => response.json())
            .then(data => {
            this.setState({ data });
        })
            .catch(e => console.log(e));
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(CascaderSelect, { dataSource: this.state.data, onChange: this.handleChange }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("div", { style: { backgroundColor: '#f3f3f3', padding: '10px' } },
                React.createElement(CascaderSelect, { theme: 'grey', dataSource: this.state.data, onChange: this.handleChange }))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('cascader-select-demo-1'));
