var ImagePicker; import '../ui/dropper.js'; export default window.ImagePicker = ImagePicker = class ImagePicker extends React.Component { constructor(props) { var ref, ref1; super(props); this.state = { value: (ref = props.value) != null ? ref : 0, src: (ref1 = props.src) != null ? ref1 : '' }; this.onUpload = this.onUpload.bind(this); this.getValue = this.getValue.bind(this); } getValue() { return this.state.value; } onUpload(data) { console.log('onUpload', data); return this.setState({ value: data.id, src: data.link }); } render() { var src; ({ src } = this.state); return /*#__PURE__*/React.createElement("div", { class: "image_picker" }, src !== '' ? /*#__PURE__*/React.createElement("img", { src: src }) : null, /*#__PURE__*/React.createElement(Dropper, { buttonTitle: "Выбрать изображение", callback: this.onUpload, type: "image" })); } }; //# sourceMappingURL=ImagePicker.js.map