import ConfigProvider from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, Dialog, Menu, Table } from '../..';
const config = {
    Menu: {
        isSelectIconRight: true,
    },
    Table: {
        hasBorder: false,
    },
    Dialog: {
        footerActions: ['cancel', 'ok'],
    },
};
const dataSource = () => {
    const result = [];
    for (let i = 0; i < 4; i++) {
        result.push({
            title: {
                name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible`,
            },
            id: 100306660940 + i,
            time: 2000 + i,
        });
    }
    return result;
};
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            visible: false,
        };
        this.onOpen = () => {
            this.setState({
                visible: true,
            });
        };
        this.onClose = reason => {
            console.log(reason);
            this.setState({
                visible: false,
            });
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(ConfigProvider, { defaultPropsConfig: config },
                React.createElement("div", null,
                    React.createElement(Button, { onClick: this.onOpen, type: "primary" }, "Open dialog"),
                    React.createElement(Dialog, { title: "Welcome to Alibaba.com", visible: this.state.visible, onOk: this.onClose.bind(this, 'okClick'), onCancel: this.onClose.bind(this, 'cancelClick'), onClose: this.onClose }, "Start your business here by searching a popular product"),
                    React.createElement("br", null),
                    React.createElement("br", null),
                    React.createElement(Menu, { style: { width: 200 }, selectMode: "single", selectedKeys: "1" },
                        React.createElement(Menu.Item, { key: "1" }, "Option 1"),
                        React.createElement(Menu.Item, { disabled: true, key: "2" }, "Disabled option 2"),
                        React.createElement(Menu.SubMenu, { key: "sub", label: "Sub menu" },
                            React.createElement(Menu.Item, { key: "sub-1" }, "Sub option 1"),
                            React.createElement(Menu.Item, { key: "sub-2" }, "Sub option 2")),
                        React.createElement(Menu.Item, { key: "3" }, "Option 3")),
                    React.createElement("br", null),
                    React.createElement(Table, { dataSource: dataSource() },
                        React.createElement(Table.Column, { title: "Id", htmlTitle: "Unique Id", dataIndex: "id" }),
                        React.createElement(Table.Column, { title: "Title", dataIndex: "title.name" }),
                        React.createElement(Table.Column, { title: "Time", dataIndex: "time" }))))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('config-provider-demo-7'));
