import Button from '../../button';
import React from 'react';
import ReactDOM from 'react-dom';
import Table from '..';
const onRowClick = function (record, index, e) {
    console.log(record, index, e);
}, dataSource = j => {
    const result = [];
    for (let i = 0; i < j; i++) {
        result.push({
            title: {
                name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible`,
            },
            id: 100306660940 + i,
            time: 2000 + i,
        });
    }
    return result;
}, render = (value, index, record) => {
    return React.createElement("a", null,
        "Remove(",
        record.id,
        ")");
};
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            dataSource: dataSource(50),
        };
        this.onClick = () => {
            this.setState({
                dataSource: dataSource(4),
            });
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement("p", null,
                React.createElement(Button, { onClick: this.onClick }, "Reduce count")),
            React.createElement(Table, { dataSource: this.state.dataSource, onRowClick: onRowClick, fixedHeader: true, maxBodyHeight: 400 },
                React.createElement(Table.Column, { title: "Title1", dataIndex: "id", width: 140 }),
                React.createElement(Table.ColumnGroup, { title: "Group2-7" },
                    React.createElement(Table.Column, { title: "Title2", dataIndex: "id", lock: true, width: 140 }),
                    React.createElement(Table.Column, { title: "Title3", dataIndex: "title.name", width: 200 }),
                    React.createElement(Table.ColumnGroup, { title: "Group4-7" },
                        React.createElement(Table.Column, { title: "Title4", dataIndex: "title.name", width: 400 }),
                        React.createElement(Table.Column, { title: "Title5", dataIndex: "title.name", width: 200 }),
                        React.createElement(Table.ColumnGroup, { title: "Group6-7" },
                            React.createElement(Table.Column, { title: "Title6", dataIndex: "title.name", width: 400 }),
                            React.createElement(Table.Column, { title: "Title7", dataIndex: "title.name", width: 200 })))),
                React.createElement(Table.ColumnGroup, null,
                    React.createElement(Table.Column, { title: "Time", dataIndex: "time", width: 500 }),
                    React.createElement(Table.Column, { cell: render, width: 200, lock: "right" })))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('table-demo-15'));
