import Button from '../../button';
import Checkbox from '..';
import React from 'react';
import ReactDOM from 'react-dom';
class IndeterminateApp extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            checked: false,
            indeterminate: true,
            disabled: false,
        };
        this.toggle = () => {
            if (this.state.indeterminate) {
                this.setState({ indeterminate: false });
            }
            else {
                this.setState({ checked: false, indeterminate: true });
            }
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(Checkbox, { indeterminate: this.state.indeterminate, checked: this.state.checked, onChange: checked => {
                    this.setState({ checked, indeterminate: false });
                } }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(Button, { type: "primary", onClick: this.toggle }, "toggle indeterminate")));
    }
}
ReactDOM.render(React.createElement(IndeterminateApp, null), document.getElementById('checkbox-demo-3'));
