import Loading from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, Form, Input } from '../..';
const FormItem = Form.Item;
const layout = {
    labelCol: {
        fixedSpan: 4,
    },
    wrapperCol: {
        span: 18,
    },
};
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            visible: false,
        };
    }
    setVisible(visible) {
        this.setState({
            visible,
        });
    }
    render() {
        const CustomForm = () => (React.createElement(Form, { style: { width: 500 } },
            React.createElement(FormItem, Object.assign({ label: "Username" }, layout),
                React.createElement(Input, null)),
            React.createElement(FormItem, Object.assign({ label: "Password" }, layout),
                React.createElement(Input, { htmlType: "password", placeholder: "please input" })),
            React.createElement(FormItem, Object.assign({ label: "Detail" }, layout),
                React.createElement(Input, { multiple: true }))));
        const ControlButton = () => (React.createElement("div", { style: { paddingLeft: 80 } },
            React.createElement(Button, { onClick: this.setVisible.bind(this, true), type: "primary" }, "Submit"),
            React.createElement(Button, { onClick: this.setVisible.bind(this, false), style: { marginLeft: 5 } }, "Cancel")));
        return (React.createElement("div", null,
            React.createElement(Loading, { visible: this.state.visible },
                React.createElement(CustomForm, null)),
            React.createElement(ControlButton, null)));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('loading-demo-5'));
