1 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
2 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
3 | import _inherits from 'babel-runtime/helpers/inherits';
|
4 | import { Component } from 'react';
|
5 |
|
6 | var Base = function (_Component) {
|
7 | _inherits(Base, _Component);
|
8 |
|
9 | function Base() {
|
10 | var _temp, _this, _ret;
|
11 |
|
12 | _classCallCheck(this, Base);
|
13 |
|
14 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
15 | args[_key] = arguments[_key];
|
16 | }
|
17 |
|
18 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.saveUploaderRef = function (ref) {
|
19 |
|
20 | if (ref && typeof ref.getInstance === 'function') {
|
21 | _this.uploaderRef = ref.getInstance();
|
22 | } else {
|
23 | _this.uploaderRef = ref;
|
24 | }
|
25 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
26 | }
|
27 |
|
28 |
|
29 | Base.prototype.abort = function abort(file) {
|
30 |
|
31 | this.uploaderRef.abort(file);
|
32 | };
|
33 |
|
34 |
|
35 |
|
36 | Base.prototype.startUpload = function startUpload() {
|
37 |
|
38 | this.uploaderRef.startUpload();
|
39 | };
|
40 |
|
41 |
|
42 | Base.prototype.isUploading = function isUploading() {
|
43 |
|
44 | return this.uploaderRef.isUploading();
|
45 | };
|
46 |
|
47 | return Base;
|
48 | }(Component);
|
49 |
|
50 | Base.displayName = 'Base';
|
51 | export { Base as default }; |
\ | No newline at end of file |