import 'whatwg-fetch';
import CascaderSelect from '..';
import Radio from '../../radio';
import React from 'react';
import ReactDOM from 'react-dom';
const RadioGroup = Radio.Group;
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            triggerType: 'click',
            data: [],
        };
        this.handleChange = this.handleChange.bind(this);
        this.handleTriggerTypeChange = this.handleTriggerTypeChange.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);
    }
    handleTriggerTypeChange(triggerType) {
        this.setState({
            triggerType,
        });
    }
    render() {
        return (React.createElement("div", null,
            React.createElement("div", { className: "trigger-check" },
                React.createElement(RadioGroup, { dataSource: ['click', 'hover'], shape: "button", value: this.state.triggerType, onChange: this.handleTriggerTypeChange })),
            React.createElement(CascaderSelect, { expandTriggerType: this.state.triggerType, dataSource: this.state.data, onChange: this.handleChange })));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('cascader-select-demo-5'));
