import Drawer from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from '../..';
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = { visible: false, childrenDrawer: false };
        this.showDrawer = () => {
            this.setState({
                visible: true,
            });
        };
        this.onClose = () => {
            this.setState({
                visible: false,
            });
        };
        this.showChildrenDrawer = () => {
            this.setState({
                childrenDrawer: true,
            });
        };
        this.onChildrenDrawerClose = () => {
            this.setState({
                childrenDrawer: false,
            });
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(Button, { type: "primary", onClick: this.showDrawer }, "Open drawer"),
            React.createElement(Drawer, { title: "Multi-level drawer", width: 520, closeMode: 'mask', onClose: this.onClose, visible: this.state.visible },
                React.createElement(Button, { type: "primary", onClick: this.showChildrenDrawer }, "Two-level drawer"),
                React.createElement("div", { style: { height: 800, marginTop: 40 } }, "\u5F88\u957F\u7684\u5185\u5BB9"),
                React.createElement("div", { style: { marginBottom: 40 } }, "\u5E95\u90E8\u7684\u5185\u5BB9"),
                React.createElement(Drawer, { title: "Two-level Drawer", width: 320, closeMode: 'mask', onClose: this.onChildrenDrawerClose, visible: this.state.childrenDrawer }, "This is two-level drawer"),
                React.createElement("div", { style: {
                        position: 'absolute',
                        bottom: 0,
                        width: '100%',
                        borderTop: '1px solid #e8e8e8',
                        padding: '10px 16px',
                        textAlign: 'right',
                        left: 0,
                        background: '#fff',
                        borderRadius: '0 0 4px 4px',
                    } },
                    React.createElement(Button, { style: {
                            marginRight: 8,
                        }, onClick: this.onClose }, "Cancel"),
                    React.createElement(Button, { onClick: this.onClose, type: "primary" }, "Submit")))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('drawer-demo-3'));
