import React from 'react';
import ReactDOM from 'react-dom';
import Upload from '..';
import { Input } from '../..';
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.onPaste = e => {
            e.preventDefault();
            const files = e.clipboardData.files;
            files.length && this.uploaderRef.selectFiles(files);
        };
        this.saveUploaderRef = ref => {
            if (!ref.typeahead)
                return;
            this.uploaderRef = ref.typeahead.getInstance();
        };
        this.onChange = value => {
            console.log(value);
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(Input.TextArea, { style: { width: '100%', marginBottom: 10 }, autoHeight: { minRows: 4 }, onPaste: this.onPaste }),
            React.createElement(Upload, { action: "http://118.31.33.81/docs/upload", listType: "image", onChange: this.onChange, ref: this.saveUploaderRef })));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('upload-demo-7'));
