UNPKG

2.12 kBJavaScriptView Raw
1'use strict';
2
3exports.__esModule = true;
4exports.default = undefined;
5
6var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
7
8var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
9
10var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
11
12var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
13
14var _inherits2 = require('babel-runtime/helpers/inherits');
15
16var _inherits3 = _interopRequireDefault(_inherits2);
17
18var _react = require('react');
19
20function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
22var Base = function (_Component) {
23 (0, _inherits3.default)(Base, _Component);
24
25 function Base() {
26 var _temp, _this, _ret;
27
28 (0, _classCallCheck3.default)(this, Base);
29
30 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
31 args[_key] = arguments[_key];
32 }
33
34 return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.saveUploaderRef = function (ref) {
35 /* istanbul ignore if */
36 if (ref && typeof ref.getInstance === 'function') {
37 _this.uploaderRef = ref.getInstance();
38 } else {
39 _this.uploaderRef = ref;
40 }
41 }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
42 }
43
44 /* istanbul ignore next */
45 Base.prototype.abort = function abort(file) {
46 /* istanbul ignore next */
47 this.uploaderRef.abort(file);
48 };
49 /* istanbul ignore next */
50
51
52 Base.prototype.startUpload = function startUpload() {
53 /* istanbul ignore next */
54 this.uploaderRef.startUpload();
55 };
56
57 /* istanbul ignore next */
58 Base.prototype.isUploading = function isUploading() {
59 /* istanbul ignore next */
60 return this.uploaderRef.isUploading();
61 };
62
63 return Base;
64}(_react.Component);
65
66Base.displayName = 'Base';
67exports.default = Base;
68module.exports = exports['default'];
\No newline at end of file