react-dropzone 4.0.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16,21 +16,21 @@ return /******/ (function(modules) { // webpackBootstrap
16
16
  /******/ function __webpack_require__(moduleId) {
17
17
  /******/
18
18
  /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId])
19
+ /******/ if(installedModules[moduleId]) {
20
20
  /******/ return installedModules[moduleId].exports;
21
- /******/
21
+ /******/ }
22
22
  /******/ // Create a new module (and put it into the cache)
23
23
  /******/ var module = installedModules[moduleId] = {
24
- /******/ exports: {},
25
- /******/ id: moduleId,
26
- /******/ loaded: false
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
27
  /******/ };
28
28
  /******/
29
29
  /******/ // Execute the module function
30
30
  /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
31
  /******/
32
32
  /******/ // Flag the module as loaded
33
- /******/ module.loaded = true;
33
+ /******/ module.l = true;
34
34
  /******/
35
35
  /******/ // Return the exports of the module
36
36
  /******/ return module.exports;
@@ -43,880 +43,974 @@ return /******/ (function(modules) { // webpackBootstrap
43
43
  /******/ // expose the module cache
44
44
  /******/ __webpack_require__.c = installedModules;
45
45
  /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, {
50
+ /******/ configurable: false,
51
+ /******/ enumerable: true,
52
+ /******/ get: getter
53
+ /******/ });
54
+ /******/ }
55
+ /******/ };
56
+ /******/
57
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
58
+ /******/ __webpack_require__.n = function(module) {
59
+ /******/ var getter = module && module.__esModule ?
60
+ /******/ function getDefault() { return module['default']; } :
61
+ /******/ function getModuleExports() { return module; };
62
+ /******/ __webpack_require__.d(getter, 'a', getter);
63
+ /******/ return getter;
64
+ /******/ };
65
+ /******/
66
+ /******/ // Object.prototype.hasOwnProperty.call
67
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68
+ /******/
46
69
  /******/ // __webpack_public_path__
47
70
  /******/ __webpack_require__.p = "";
48
71
  /******/
49
72
  /******/ // Load entry module and return exports
50
- /******/ return __webpack_require__(0);
73
+ /******/ return __webpack_require__(__webpack_require__.s = 0);
51
74
  /******/ })
52
75
  /************************************************************************/
53
76
  /******/ ([
54
77
  /* 0 */
55
78
  /***/ (function(module, exports, __webpack_require__) {
56
79
 
57
- /* WEBPACK VAR INJECTION */(function(process) {'use strict';
58
-
59
- Object.defineProperty(exports, "__esModule", {
60
- value: true
61
- });
62
-
63
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
64
-
65
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
66
-
67
- var _react = __webpack_require__(2);
68
-
69
- var _react2 = _interopRequireDefault(_react);
70
-
71
- var _propTypes = __webpack_require__(3);
72
-
73
- var _propTypes2 = _interopRequireDefault(_propTypes);
74
-
75
- var _attrAccept = __webpack_require__(4);
76
-
77
- var _attrAccept2 = _interopRequireDefault(_attrAccept);
78
-
79
- var _getDataTransferItems = __webpack_require__(5);
80
-
81
- var _getDataTransferItems2 = _interopRequireDefault(_getDataTransferItems);
82
-
83
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
84
-
85
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
86
-
87
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
88
-
89
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
90
-
91
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
92
-
93
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint prefer-template: 0 */
94
-
95
- var supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true;
96
-
97
- function fileAccepted(file, accept) {
98
- // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with
99
- // that MIME type will always be accepted
100
- return file.type === 'application/x-moz-file' || (0, _attrAccept2.default)(file, accept);
101
- }
102
-
103
- var Dropzone = function (_React$Component) {
104
- _inherits(Dropzone, _React$Component);
105
-
106
- _createClass(Dropzone, null, [{
107
- key: 'onDocumentDragOver',
108
- value: function onDocumentDragOver(evt) {
109
- // allow the entire document to be a drag target
110
- evt.preventDefault();
111
- }
112
- }]);
113
-
114
- function Dropzone(props, context) {
115
- _classCallCheck(this, Dropzone);
116
-
117
- var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context));
118
-
119
- _this.renderChildren = function (children, isDragActive, isDragAccept, isDragReject) {
120
- if (typeof children === 'function') {
121
- return children(_extends({}, _this.state, { isDragActive: isDragActive, isDragAccept: isDragAccept, isDragReject: isDragReject }));
122
- }
123
- return children;
124
- };
125
-
126
- _this.onClick = _this.onClick.bind(_this);
127
- _this.onDocumentDrop = _this.onDocumentDrop.bind(_this);
128
- _this.onDragStart = _this.onDragStart.bind(_this);
129
- _this.onDragEnter = _this.onDragEnter.bind(_this);
130
- _this.onDragLeave = _this.onDragLeave.bind(_this);
131
- _this.onDragOver = _this.onDragOver.bind(_this);
132
- _this.onDrop = _this.onDrop.bind(_this);
133
- _this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this);
134
- _this.setRef = _this.setRef.bind(_this);
135
- _this.setRefs = _this.setRefs.bind(_this);
136
- _this.onInputElementClick = _this.onInputElementClick.bind(_this);
137
- _this.isFileDialogActive = false;
138
- _this.state = {
139
- draggedFiles: [],
140
- acceptedFiles: [],
141
- rejectedFiles: []
142
- };
143
- return _this;
144
- }
145
-
146
- _createClass(Dropzone, [{
147
- key: 'componentDidMount',
148
- value: function componentDidMount() {
149
- var preventDropOnDocument = this.props.preventDropOnDocument;
150
-
151
- this.dragTargets = [];
152
-
153
- if (preventDropOnDocument) {
154
- document.addEventListener('dragover', Dropzone.onDocumentDragOver, false);
155
- document.addEventListener('drop', this.onDocumentDrop, false);
156
- }
157
- this.fileInputEl.addEventListener('click', this.onInputElementClick, false);
158
- // Tried implementing addEventListener, but didn't work out
159
- document.body.onfocus = this.onFileDialogCancel;
160
- }
161
- }, {
162
- key: 'componentWillUnmount',
163
- value: function componentWillUnmount() {
164
- var preventDropOnDocument = this.props.preventDropOnDocument;
165
-
166
- if (preventDropOnDocument) {
167
- document.removeEventListener('dragover', Dropzone.onDocumentDragOver);
168
- document.removeEventListener('drop', this.onDocumentDrop);
169
- }
170
- this.fileInputEl.removeEventListener('click', this.onInputElementClick, false);
171
- // Can be replaced with removeEventListener, if addEventListener works
172
- document.body.onfocus = null;
173
- }
174
- }, {
175
- key: 'onDocumentDrop',
176
- value: function onDocumentDrop(evt) {
177
- if (this.node.contains(evt.target)) {
178
- // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler
179
- return;
180
- }
181
- evt.preventDefault();
182
- this.dragTargets = [];
183
- }
184
- }, {
185
- key: 'onDragStart',
186
- value: function onDragStart(evt) {
187
- if (this.props.onDragStart) {
188
- this.props.onDragStart.call(this, evt);
189
- }
190
- }
191
- }, {
192
- key: 'onDragEnter',
193
- value: function onDragEnter(evt) {
194
- evt.preventDefault();
195
-
196
- // Count the dropzone and any children that are entered.
197
- if (this.dragTargets.indexOf(evt.target) === -1) {
198
- this.dragTargets.push(evt.target);
199
- }
200
-
201
- this.setState({
202
- isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari.
203
- draggedFiles: (0, _getDataTransferItems2.default)(evt)
204
- });
205
-
206
- if (this.props.onDragEnter) {
207
- this.props.onDragEnter.call(this, evt);
208
- }
209
- }
210
- }, {
211
- key: 'onDragOver',
212
- value: function onDragOver(evt) {
213
- // eslint-disable-line class-methods-use-this
214
- evt.preventDefault();
215
- evt.stopPropagation();
216
- try {
217
- evt.dataTransfer.dropEffect = 'copy'; // eslint-disable-line no-param-reassign
218
- } catch (err) {
219
- // continue regardless of error
220
- }
221
-
222
- if (this.props.onDragOver) {
223
- this.props.onDragOver.call(this, evt);
224
- }
225
- return false;
226
- }
227
- }, {
228
- key: 'onDragLeave',
229
- value: function onDragLeave(evt) {
230
- var _this2 = this;
231
-
232
- evt.preventDefault();
233
-
234
- // Only deactivate once the dropzone and all children have been left.
235
- this.dragTargets = this.dragTargets.filter(function (el) {
236
- return el !== evt.target && _this2.node.contains(el);
237
- });
238
- if (this.dragTargets.length > 0) {
239
- return;
240
- }
241
-
242
- // Clear dragging files state
243
- this.setState({
244
- isDragActive: false,
245
- draggedFiles: []
246
- });
247
-
248
- if (this.props.onDragLeave) {
249
- this.props.onDragLeave.call(this, evt);
250
- }
251
- }
252
- }, {
253
- key: 'onDrop',
254
- value: function onDrop(evt) {
255
- var _this3 = this;
256
-
257
- var _props = this.props,
258
- onDrop = _props.onDrop,
259
- onDropAccepted = _props.onDropAccepted,
260
- onDropRejected = _props.onDropRejected,
261
- multiple = _props.multiple,
262
- disablePreview = _props.disablePreview,
263
- accept = _props.accept;
264
-
265
- var fileList = (0, _getDataTransferItems2.default)(evt);
266
- var acceptedFiles = [];
267
- var rejectedFiles = [];
268
-
269
- // Stop default browser behavior
270
- evt.preventDefault();
271
-
272
- // Reset the counter along with the drag on a drop.
273
- this.dragTargets = [];
274
- this.isFileDialogActive = false;
275
-
276
- fileList.forEach(function (file) {
277
- if (!disablePreview) {
278
- try {
279
- file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign
280
- } catch (err) {
281
- if (process.env.NODE_ENV !== 'production') {
282
- console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console
283
- }
284
- }
285
- }
286
-
287
- if (fileAccepted(file, accept) && _this3.fileMatchSize(file)) {
288
- acceptedFiles.push(file);
289
- } else {
290
- rejectedFiles.push(file);
291
- }
292
- });
293
-
294
- if (!multiple) {
295
- // if not in multi mode add any extra accepted files to rejected.
296
- // This will allow end users to easily ignore a multi file drop in "single" mode.
297
- rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(1)));
298
- }
299
-
300
- if (onDrop) {
301
- onDrop.call(this, acceptedFiles, rejectedFiles, evt);
302
- }
303
-
304
- if (rejectedFiles.length > 0 && onDropRejected) {
305
- onDropRejected.call(this, rejectedFiles, evt);
306
- }
307
-
308
- if (acceptedFiles.length > 0 && onDropAccepted) {
309
- onDropAccepted.call(this, acceptedFiles, evt);
310
- }
311
-
312
- // Clear files value
313
- this.draggedFiles = null;
314
-
315
- // Reset drag state
316
- this.setState({
317
- isDragActive: false,
318
- draggedFiles: [],
319
- acceptedFiles: acceptedFiles,
320
- rejectedFiles: rejectedFiles
321
- });
322
- }
323
- }, {
324
- key: 'onClick',
325
- value: function onClick(evt) {
326
- var _props2 = this.props,
327
- onClick = _props2.onClick,
328
- disableClick = _props2.disableClick;
329
-
330
- if (!disableClick) {
331
- evt.stopPropagation();
332
-
333
- if (onClick) {
334
- onClick.call(this, evt);
335
- }
336
-
337
- // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout
338
- // this is so react can handle state changes in the onClick prop above above
339
- // see: https://github.com/okonet/react-dropzone/issues/450
340
- setTimeout(this.open.bind(this), 0);
341
- }
342
- }
343
- }, {
344
- key: 'onInputElementClick',
345
- value: function onInputElementClick(evt) {
346
- evt.stopPropagation();
347
- if (this.props.inputProps && this.props.inputProps.onClick) {
348
- this.props.inputProps.onClick();
349
- }
350
- }
351
- }, {
352
- key: 'onFileDialogCancel',
353
- value: function onFileDialogCancel() {
354
- // timeout will not recognize context of this method
355
- var onFileDialogCancel = this.props.onFileDialogCancel;
356
- var fileInputEl = this.fileInputEl;
357
- var isFileDialogActive = this.isFileDialogActive;
358
- // execute the timeout only if the onFileDialogCancel is defined and FileDialog
359
- // is opened in the browser
360
-
361
- if (onFileDialogCancel && isFileDialogActive) {
362
- setTimeout(function () {
363
- // Returns an object as FileList
364
- var FileList = fileInputEl.files;
365
- if (!FileList.length) {
366
- isFileDialogActive = false;
367
- onFileDialogCancel();
368
- }
369
- }, 300);
370
- }
371
- }
372
- }, {
373
- key: 'setRef',
374
- value: function setRef(ref) {
375
- this.node = ref;
376
- }
377
- }, {
378
- key: 'setRefs',
379
- value: function setRefs(ref) {
380
- this.fileInputEl = ref;
381
- }
382
- }, {
383
- key: 'fileMatchSize',
384
- value: function fileMatchSize(file) {
385
- return file.size <= this.props.maxSize && file.size >= this.props.minSize;
386
- }
387
- }, {
388
- key: 'allFilesAccepted',
389
- value: function allFilesAccepted(files) {
390
- var _this4 = this;
391
-
392
- return files.every(function (file) {
393
- return fileAccepted(file, _this4.props.accept);
394
- });
395
- }
396
-
397
- /**
398
- * Open system file upload dialog.
399
- *
400
- * @public
401
- */
402
-
403
- }, {
404
- key: 'open',
405
- value: function open() {
406
- this.isFileDialogActive = true;
407
- this.fileInputEl.value = null;
408
- this.fileInputEl.click();
409
- }
410
- }, {
411
- key: 'render',
412
- value: function render() {
413
- var _props3 = this.props,
414
- accept = _props3.accept,
415
- acceptClassName = _props3.acceptClassName,
416
- activeClassName = _props3.activeClassName,
417
- inputProps = _props3.inputProps,
418
- multiple = _props3.multiple,
419
- name = _props3.name,
420
- rejectClassName = _props3.rejectClassName,
421
- children = _props3.children,
422
- rest = _objectWithoutProperties(_props3, ['accept', 'acceptClassName', 'activeClassName', 'inputProps', 'multiple', 'name', 'rejectClassName', 'children']);
423
-
424
- var acceptStyle = rest.acceptStyle,
425
- activeStyle = rest.activeStyle,
426
- className = rest.className,
427
- rejectStyle = rest.rejectStyle,
428
- style = rest.style,
429
- props = _objectWithoutProperties(rest, ['acceptStyle', 'activeStyle', 'className', 'rejectStyle', 'style']);
430
-
431
- var _state = this.state,
432
- isDragActive = _state.isDragActive,
433
- draggedFiles = _state.draggedFiles;
434
-
435
- var filesCount = draggedFiles.length;
436
- var isMultipleAllowed = multiple || filesCount <= 1;
437
- var isDragAccept = filesCount > 0 && this.allFilesAccepted(draggedFiles);
438
- var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed);
439
- className = className || '';
440
-
441
- if (isDragActive && activeClassName) {
442
- className += ' ' + activeClassName;
443
- }
444
- if (isDragAccept && acceptClassName) {
445
- className += ' ' + acceptClassName;
446
- }
447
- if (isDragReject && rejectClassName) {
448
- className += ' ' + rejectClassName;
449
- }
450
-
451
- if (!className && !style && !activeStyle && !acceptStyle && !rejectStyle) {
452
- style = {
453
- width: 200,
454
- height: 200,
455
- borderWidth: 2,
456
- borderColor: '#666',
457
- borderStyle: 'dashed',
458
- borderRadius: 5
459
- };
460
- activeStyle = {
461
- borderStyle: 'solid',
462
- borderColor: '#6c6',
463
- backgroundColor: '#eee'
464
- };
465
- acceptStyle = activeStyle;
466
- rejectStyle = {
467
- borderStyle: 'solid',
468
- borderColor: '#c66',
469
- backgroundColor: '#eee'
470
- };
471
- }
472
-
473
- var appliedStyle = _extends({}, style);
474
- if (activeStyle && isDragActive) {
475
- appliedStyle = _extends({}, style, activeStyle);
476
- }
477
- if (acceptStyle && isDragAccept) {
478
- appliedStyle = _extends({}, appliedStyle, acceptStyle);
479
- } else if (rejectStyle && isDragReject) {
480
- appliedStyle = _extends({}, appliedStyle, rejectStyle);
481
- }
482
-
483
- var inputAttributes = {
484
- accept: accept,
485
- type: 'file',
486
- style: { display: 'none' },
487
- multiple: supportMultiple && multiple,
488
- ref: this.setRefs,
489
- onChange: this.onDrop
490
- };
491
-
492
- if (name && name.length) {
493
- inputAttributes.name = name;
494
- }
495
-
496
- // Remove custom properties before passing them to the wrapper div element
497
- var customProps = ['acceptedFiles', 'preventDropOnDocument', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize'];
498
- var divProps = _extends({}, props);
499
- customProps.forEach(function (prop) {
500
- return delete divProps[prop];
501
- });
502
-
503
- return _react2.default.createElement(
504
- 'div',
505
- _extends({
506
- className: className,
507
- style: appliedStyle
508
- }, divProps /* expand user provided props first so event handlers are never overridden */, {
509
- onClick: this.onClick,
510
- onDragStart: this.onDragStart,
511
- onDragEnter: this.onDragEnter,
512
- onDragOver: this.onDragOver,
513
- onDragLeave: this.onDragLeave,
514
- onDrop: this.onDrop,
515
- ref: this.setRef
516
- }),
517
- this.renderChildren(children, isDragActive, isDragAccept, isDragReject),
518
- _react2.default.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes))
519
- );
520
- }
521
- }]);
522
-
523
- return Dropzone;
524
- }(_react2.default.Component);
525
-
526
- Dropzone.propTypes = {
527
- /**
528
- * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.
529
- * Keep in mind that mime type determination is not reliable accross platforms. CSV files,
530
- * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
531
- * Windows. In some cases there might not be a mime type set at all.
532
- * See: https://github.com/okonet/react-dropzone/issues/276
533
- */
534
- accept: _propTypes2.default.string,
535
-
536
- /**
537
- * Contents of the dropzone
538
- */
539
- children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]),
540
-
541
- /**
542
- * Disallow clicking on the dropzone container to open file dialog
543
- */
544
- disableClick: _propTypes2.default.bool,
545
-
546
- /**
547
- * Enable/disable preview generation
548
- */
549
- disablePreview: _propTypes2.default.bool,
550
-
551
- /**
552
- * If false, allow dropped items to take over the current browser window
553
- */
554
- preventDropOnDocument: _propTypes2.default.bool,
555
-
556
- /**
557
- * Pass additional attributes to the `<input type="file"/>` tag
558
- */
559
- inputProps: _propTypes2.default.object,
560
-
561
- /**
562
- * Allow dropping multiple files
563
- */
564
- multiple: _propTypes2.default.bool,
565
-
566
- /**
567
- * `name` attribute for the input tag
568
- */
569
- name: _propTypes2.default.string,
570
-
571
- /**
572
- * Maximum file size
573
- */
574
- maxSize: _propTypes2.default.number,
575
-
576
- /**
577
- * Minimum file size
578
- */
579
- minSize: _propTypes2.default.number,
580
-
581
- /**
582
- * className
583
- */
584
- className: _propTypes2.default.string,
585
-
586
- /**
587
- * className for active state
588
- */
589
- activeClassName: _propTypes2.default.string,
590
-
591
- /**
592
- * className for accepted state
593
- */
594
- acceptClassName: _propTypes2.default.string,
595
-
596
- /**
597
- * className for rejected state
598
- */
599
- rejectClassName: _propTypes2.default.string,
600
-
601
- /**
602
- * CSS styles to apply
603
- */
604
- style: _propTypes2.default.object,
605
-
606
- /**
607
- * CSS styles to apply when drag is active
608
- */
609
- activeStyle: _propTypes2.default.object,
610
-
611
- /**
612
- * CSS styles to apply when drop will be accepted
613
- */
614
- acceptStyle: _propTypes2.default.object,
615
-
616
- /**
617
- * CSS styles to apply when drop will be rejected
618
- */
619
- rejectStyle: _propTypes2.default.object,
620
-
621
- /**
622
- * onClick callback
623
- * @param {Event} event
624
- */
625
- onClick: _propTypes2.default.func,
626
-
627
- /**
628
- * onDrop callback
629
- */
630
- onDrop: _propTypes2.default.func,
631
-
632
- /**
633
- * onDropAccepted callback
634
- */
635
- onDropAccepted: _propTypes2.default.func,
636
-
637
- /**
638
- * onDropRejected callback
639
- */
640
- onDropRejected: _propTypes2.default.func,
641
-
642
- /**
643
- * onDragStart callback
644
- */
645
- onDragStart: _propTypes2.default.func,
646
-
647
- /**
648
- * onDragEnter callback
649
- */
650
- onDragEnter: _propTypes2.default.func,
651
-
652
- /**
653
- * onDragOver callback
654
- */
655
- onDragOver: _propTypes2.default.func,
656
-
657
- /**
658
- * onDragLeave callback
659
- */
660
- onDragLeave: _propTypes2.default.func,
661
-
662
- /**
663
- * Provide a callback on clicking the cancel button of the file dialog
664
- */
665
- onFileDialogCancel: _propTypes2.default.func
666
- };
667
-
668
- Dropzone.defaultProps = {
669
- preventDropOnDocument: true,
670
- disablePreview: false,
671
- disableClick: false,
672
- multiple: true,
673
- maxSize: Infinity,
674
- minSize: 0
675
- };
676
-
677
- exports.default = Dropzone;
678
- module.exports = exports['default'];
679
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
80
+ "use strict";
81
+ /* WEBPACK VAR INJECTION */(function(process) {
82
+
83
+ Object.defineProperty(exports, "__esModule", {
84
+ value: true
85
+ });
86
+
87
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
88
+
89
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
90
+
91
+ var _react = __webpack_require__(2);
92
+
93
+ var _react2 = _interopRequireDefault(_react);
94
+
95
+ var _propTypes = __webpack_require__(3);
96
+
97
+ var _propTypes2 = _interopRequireDefault(_propTypes);
98
+
99
+ var _utils = __webpack_require__(4);
100
+
101
+ var _styles = __webpack_require__(6);
102
+
103
+ var _styles2 = _interopRequireDefault(_styles);
104
+
105
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
106
+
107
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
108
+
109
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
110
+
111
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
112
+
113
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
114
+
115
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint prefer-template: 0 */
116
+
117
+ var Dropzone = function (_React$Component) {
118
+ _inherits(Dropzone, _React$Component);
119
+
120
+ function Dropzone(props, context) {
121
+ _classCallCheck(this, Dropzone);
122
+
123
+ var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context));
124
+
125
+ _this.renderChildren = function (children, isDragActive, isDragAccept, isDragReject) {
126
+ if (typeof children === 'function') {
127
+ return children(_extends({}, _this.state, {
128
+ isDragActive: isDragActive,
129
+ isDragAccept: isDragAccept,
130
+ isDragReject: isDragReject
131
+ }));
132
+ }
133
+ return children;
134
+ };
135
+
136
+ _this.composeHandlers = _this.composeHandlers.bind(_this);
137
+ _this.onClick = _this.onClick.bind(_this);
138
+ _this.onDocumentDrop = _this.onDocumentDrop.bind(_this);
139
+ _this.onDragEnter = _this.onDragEnter.bind(_this);
140
+ _this.onDragLeave = _this.onDragLeave.bind(_this);
141
+ _this.onDragOver = _this.onDragOver.bind(_this);
142
+ _this.onDragStart = _this.onDragStart.bind(_this);
143
+ _this.onDrop = _this.onDrop.bind(_this);
144
+ _this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this);
145
+ _this.onInputElementClick = _this.onInputElementClick.bind(_this);
146
+
147
+ _this.setRef = _this.setRef.bind(_this);
148
+ _this.setRefs = _this.setRefs.bind(_this);
149
+
150
+ _this.isFileDialogActive = false;
151
+
152
+ _this.state = {
153
+ draggedFiles: [],
154
+ acceptedFiles: [],
155
+ rejectedFiles: []
156
+ };
157
+ return _this;
158
+ }
159
+
160
+ _createClass(Dropzone, [{
161
+ key: 'componentDidMount',
162
+ value: function componentDidMount() {
163
+ var preventDropOnDocument = this.props.preventDropOnDocument;
164
+
165
+ this.dragTargets = [];
166
+
167
+ if (preventDropOnDocument) {
168
+ document.addEventListener('dragover', _utils.onDocumentDragOver, false);
169
+ document.addEventListener('drop', this.onDocumentDrop, false);
170
+ }
171
+ this.fileInputEl.addEventListener('click', this.onInputElementClick, false);
172
+ // Tried implementing addEventListener, but didn't work out
173
+ document.body.onfocus = this.onFileDialogCancel;
174
+ }
175
+ }, {
176
+ key: 'componentWillUnmount',
177
+ value: function componentWillUnmount() {
178
+ var preventDropOnDocument = this.props.preventDropOnDocument;
179
+
180
+ if (preventDropOnDocument) {
181
+ document.removeEventListener('dragover', _utils.onDocumentDragOver);
182
+ document.removeEventListener('drop', this.onDocumentDrop);
183
+ }
184
+ this.fileInputEl.removeEventListener('click', this.onInputElementClick, false);
185
+ // Can be replaced with removeEventListener, if addEventListener works
186
+ document.body.onfocus = null;
187
+ }
188
+ }, {
189
+ key: 'composeHandlers',
190
+ value: function composeHandlers(handler) {
191
+ if (this.props.disabled) {
192
+ return null;
193
+ }
194
+
195
+ return handler;
196
+ }
197
+ }, {
198
+ key: 'onDocumentDrop',
199
+ value: function onDocumentDrop(evt) {
200
+ if (this.node.contains(evt.target)) {
201
+ // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler
202
+ return;
203
+ }
204
+ evt.preventDefault();
205
+ this.dragTargets = [];
206
+ }
207
+ }, {
208
+ key: 'onDragStart',
209
+ value: function onDragStart(evt) {
210
+ if (this.props.onDragStart) {
211
+ this.props.onDragStart.call(this, evt);
212
+ }
213
+ }
214
+ }, {
215
+ key: 'onDragEnter',
216
+ value: function onDragEnter(evt) {
217
+ evt.preventDefault();
218
+
219
+ // Count the dropzone and any children that are entered.
220
+ if (this.dragTargets.indexOf(evt.target) === -1) {
221
+ this.dragTargets.push(evt.target);
222
+ }
223
+
224
+ this.setState({
225
+ isDragActive: true, // Do not rely on files for the drag state. It doesn't work in Safari.
226
+ draggedFiles: (0, _utils.getDataTransferItems)(evt)
227
+ });
228
+
229
+ if (this.props.onDragEnter) {
230
+ this.props.onDragEnter.call(this, evt);
231
+ }
232
+ }
233
+ }, {
234
+ key: 'onDragOver',
235
+ value: function onDragOver(evt) {
236
+ // eslint-disable-line class-methods-use-this
237
+ evt.preventDefault();
238
+ evt.stopPropagation();
239
+ try {
240
+ evt.dataTransfer.dropEffect = 'copy'; // eslint-disable-line no-param-reassign
241
+ } catch (err) {
242
+ // continue regardless of error
243
+ }
244
+
245
+ if (this.props.onDragOver) {
246
+ this.props.onDragOver.call(this, evt);
247
+ }
248
+ return false;
249
+ }
250
+ }, {
251
+ key: 'onDragLeave',
252
+ value: function onDragLeave(evt) {
253
+ var _this2 = this;
254
+
255
+ evt.preventDefault();
256
+
257
+ // Only deactivate once the dropzone and all children have been left.
258
+ this.dragTargets = this.dragTargets.filter(function (el) {
259
+ return el !== evt.target && _this2.node.contains(el);
260
+ });
261
+ if (this.dragTargets.length > 0) {
262
+ return;
263
+ }
264
+
265
+ // Clear dragging files state
266
+ this.setState({
267
+ isDragActive: false,
268
+ draggedFiles: []
269
+ });
270
+
271
+ if (this.props.onDragLeave) {
272
+ this.props.onDragLeave.call(this, evt);
273
+ }
274
+ }
275
+ }, {
276
+ key: 'onDrop',
277
+ value: function onDrop(evt) {
278
+ var _this3 = this;
279
+
280
+ var _props = this.props,
281
+ onDrop = _props.onDrop,
282
+ onDropAccepted = _props.onDropAccepted,
283
+ onDropRejected = _props.onDropRejected,
284
+ multiple = _props.multiple,
285
+ disablePreview = _props.disablePreview,
286
+ accept = _props.accept;
287
+
288
+ var fileList = (0, _utils.getDataTransferItems)(evt);
289
+ var acceptedFiles = [];
290
+ var rejectedFiles = [];
291
+
292
+ // Stop default browser behavior
293
+ evt.preventDefault();
294
+
295
+ // Reset the counter along with the drag on a drop.
296
+ this.dragTargets = [];
297
+ this.isFileDialogActive = false;
298
+
299
+ fileList.forEach(function (file) {
300
+ if (!disablePreview) {
301
+ try {
302
+ file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign
303
+ } catch (err) {
304
+ if (process.env.NODE_ENV !== 'production') {
305
+ console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console
306
+ }
307
+ }
308
+ }
309
+
310
+ if ((0, _utils.fileAccepted)(file, accept) && (0, _utils.fileMatchSize)(file, _this3.props.maxSize, _this3.props.minSize)) {
311
+ acceptedFiles.push(file);
312
+ } else {
313
+ rejectedFiles.push(file);
314
+ }
315
+ });
316
+
317
+ if (!multiple) {
318
+ // if not in multi mode add any extra accepted files to rejected.
319
+ // This will allow end users to easily ignore a multi file drop in "single" mode.
320
+ rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(1)));
321
+ }
322
+
323
+ if (onDrop) {
324
+ onDrop.call(this, acceptedFiles, rejectedFiles, evt);
325
+ }
326
+
327
+ if (rejectedFiles.length > 0 && onDropRejected) {
328
+ onDropRejected.call(this, rejectedFiles, evt);
329
+ }
330
+
331
+ if (acceptedFiles.length > 0 && onDropAccepted) {
332
+ onDropAccepted.call(this, acceptedFiles, evt);
333
+ }
334
+
335
+ // Clear files value
336
+ this.draggedFiles = null;
337
+
338
+ // Reset drag state
339
+ this.setState({
340
+ isDragActive: false,
341
+ draggedFiles: [],
342
+ acceptedFiles: acceptedFiles,
343
+ rejectedFiles: rejectedFiles
344
+ });
345
+ }
346
+ }, {
347
+ key: 'onClick',
348
+ value: function onClick(evt) {
349
+ var _props2 = this.props,
350
+ onClick = _props2.onClick,
351
+ disableClick = _props2.disableClick;
352
+
353
+ if (!disableClick) {
354
+ evt.stopPropagation();
355
+
356
+ if (onClick) {
357
+ onClick.call(this, evt);
358
+ }
359
+
360
+ // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout
361
+ // this is so react can handle state changes in the onClick prop above above
362
+ // see: https://github.com/react-dropzone/react-dropzone/issues/450
363
+ setTimeout(this.open.bind(this), 0);
364
+ }
365
+ }
366
+ }, {
367
+ key: 'onInputElementClick',
368
+ value: function onInputElementClick(evt) {
369
+ evt.stopPropagation();
370
+ if (this.props.inputProps && this.props.inputProps.onClick) {
371
+ this.props.inputProps.onClick();
372
+ }
373
+ }
374
+ }, {
375
+ key: 'onFileDialogCancel',
376
+ value: function onFileDialogCancel() {
377
+ // timeout will not recognize context of this method
378
+ var onFileDialogCancel = this.props.onFileDialogCancel;
379
+ var fileInputEl = this.fileInputEl;
380
+ var isFileDialogActive = this.isFileDialogActive;
381
+ // execute the timeout only if the onFileDialogCancel is defined and FileDialog
382
+ // is opened in the browser
383
+
384
+ if (onFileDialogCancel && isFileDialogActive) {
385
+ setTimeout(function () {
386
+ // Returns an object as FileList
387
+ var FileList = fileInputEl.files;
388
+ if (!FileList.length) {
389
+ isFileDialogActive = false;
390
+ onFileDialogCancel();
391
+ }
392
+ }, 300);
393
+ }
394
+ }
395
+ }, {
396
+ key: 'setRef',
397
+ value: function setRef(ref) {
398
+ this.node = ref;
399
+ }
400
+ }, {
401
+ key: 'setRefs',
402
+ value: function setRefs(ref) {
403
+ this.fileInputEl = ref;
404
+ }
405
+ /**
406
+ * Open system file upload dialog.
407
+ *
408
+ * @public
409
+ */
410
+
411
+ }, {
412
+ key: 'open',
413
+ value: function open() {
414
+ this.isFileDialogActive = true;
415
+ this.fileInputEl.value = null;
416
+ this.fileInputEl.click();
417
+ }
418
+ }, {
419
+ key: 'render',
420
+ value: function render() {
421
+ var _props3 = this.props,
422
+ accept = _props3.accept,
423
+ acceptClassName = _props3.acceptClassName,
424
+ activeClassName = _props3.activeClassName,
425
+ children = _props3.children,
426
+ disabled = _props3.disabled,
427
+ disabledClassName = _props3.disabledClassName,
428
+ inputProps = _props3.inputProps,
429
+ multiple = _props3.multiple,
430
+ name = _props3.name,
431
+ rejectClassName = _props3.rejectClassName,
432
+ rest = _objectWithoutProperties(_props3, ['accept', 'acceptClassName', 'activeClassName', 'children', 'disabled', 'disabledClassName', 'inputProps', 'multiple', 'name', 'rejectClassName']);
433
+
434
+ var acceptStyle = rest.acceptStyle,
435
+ activeStyle = rest.activeStyle,
436
+ className = rest.className,
437
+ disabledStyle = rest.disabledStyle,
438
+ rejectStyle = rest.rejectStyle,
439
+ style = rest.style,
440
+ props = _objectWithoutProperties(rest, ['acceptStyle', 'activeStyle', 'className', 'disabledStyle', 'rejectStyle', 'style']);
441
+
442
+ var _state = this.state,
443
+ isDragActive = _state.isDragActive,
444
+ draggedFiles = _state.draggedFiles;
445
+
446
+ var filesCount = draggedFiles.length;
447
+ var isMultipleAllowed = multiple || filesCount <= 1;
448
+ var isDragAccept = filesCount > 0 && (0, _utils.allFilesAccepted)(draggedFiles, this.props.accept);
449
+ var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed);
450
+ className = className || '';
451
+ var noStyles = !className && !style && !activeStyle && !acceptStyle && !rejectStyle && !disabledStyle;
452
+
453
+ if (isDragActive && activeClassName) {
454
+ className += ' ' + activeClassName;
455
+ }
456
+ if (isDragAccept && acceptClassName) {
457
+ className += ' ' + acceptClassName;
458
+ }
459
+ if (isDragReject && rejectClassName) {
460
+ className += ' ' + rejectClassName;
461
+ }
462
+ if (disabled && disabledClassName) {
463
+ className += ' ' + disabledClassName;
464
+ }
465
+
466
+ if (noStyles) {
467
+ style = _styles2.default.default;
468
+ activeStyle = _styles2.default.active;
469
+ acceptStyle = style.active;
470
+ rejectStyle = _styles2.default.rejected;
471
+ disabledStyle = _styles2.default.disabled;
472
+ }
473
+
474
+ var appliedStyle = _extends({}, style);
475
+ if (activeStyle && isDragActive) {
476
+ appliedStyle = _extends({}, style, activeStyle);
477
+ }
478
+ if (acceptStyle && isDragAccept) {
479
+ appliedStyle = _extends({}, appliedStyle, acceptStyle);
480
+ }
481
+ if (rejectStyle && isDragReject) {
482
+ appliedStyle = _extends({}, appliedStyle, rejectStyle);
483
+ }
484
+ if (disabledStyle && disabled) {
485
+ appliedStyle = _extends({}, style, disabledStyle);
486
+ }
487
+
488
+ var inputAttributes = {
489
+ accept: accept,
490
+ disabled: disabled,
491
+ type: 'file',
492
+ style: { display: 'none' },
493
+ multiple: _utils.supportMultiple && multiple,
494
+ ref: this.setRefs,
495
+ onChange: this.onDrop,
496
+ autoComplete: 'off'
497
+ };
498
+
499
+ if (name && name.length) {
500
+ inputAttributes.name = name;
501
+ }
502
+
503
+ // Remove custom properties before passing them to the wrapper div element
504
+ var customProps = ['acceptedFiles', 'preventDropOnDocument', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize'];
505
+ var divProps = _extends({}, props);
506
+ customProps.forEach(function (prop) {
507
+ return delete divProps[prop];
508
+ });
509
+
510
+ return _react2.default.createElement(
511
+ 'div',
512
+ _extends({
513
+ className: className,
514
+ style: appliedStyle
515
+ }, divProps /* expand user provided props first so event handlers are never overridden */, {
516
+ onClick: this.composeHandlers(this.onClick),
517
+ onDragStart: this.composeHandlers(this.onDragStart),
518
+ onDragEnter: this.composeHandlers(this.onDragEnter),
519
+ onDragOver: this.composeHandlers(this.onDragOver),
520
+ onDragLeave: this.composeHandlers(this.onDragLeave),
521
+ onDrop: this.composeHandlers(this.onDrop),
522
+ ref: this.setRef,
523
+ 'aria-disabled': disabled
524
+ }),
525
+ this.renderChildren(children, isDragActive, isDragAccept, isDragReject),
526
+ _react2.default.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes))
527
+ );
528
+ }
529
+ }]);
530
+
531
+ return Dropzone;
532
+ }(_react2.default.Component);
533
+
534
+ exports.default = Dropzone;
535
+
536
+
537
+ Dropzone.propTypes = {
538
+ /**
539
+ * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.
540
+ * Keep in mind that mime type determination is not reliable across platforms. CSV files,
541
+ * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
542
+ * Windows. In some cases there might not be a mime type set at all.
543
+ * See: https://github.com/react-dropzone/react-dropzone/issues/276
544
+ */
545
+ accept: _propTypes2.default.string,
546
+
547
+ /**
548
+ * Contents of the dropzone
549
+ */
550
+ children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]),
551
+
552
+ /**
553
+ * Disallow clicking on the dropzone container to open file dialog
554
+ */
555
+ disableClick: _propTypes2.default.bool,
556
+
557
+ /**
558
+ * Enable/disable the dropzone entirely
559
+ */
560
+ disabled: _propTypes2.default.bool,
561
+
562
+ /**
563
+ * Enable/disable preview generation
564
+ */
565
+ disablePreview: _propTypes2.default.bool,
566
+
567
+ /**
568
+ * If false, allow dropped items to take over the current browser window
569
+ */
570
+ preventDropOnDocument: _propTypes2.default.bool,
571
+
572
+ /**
573
+ * Pass additional attributes to the `<input type="file"/>` tag
574
+ */
575
+ inputProps: _propTypes2.default.object,
576
+
577
+ /**
578
+ * Allow dropping multiple files
579
+ */
580
+ multiple: _propTypes2.default.bool,
581
+
582
+ /**
583
+ * `name` attribute for the input tag
584
+ */
585
+ name: _propTypes2.default.string,
586
+
587
+ /**
588
+ * Maximum file size
589
+ */
590
+ maxSize: _propTypes2.default.number,
591
+
592
+ /**
593
+ * Minimum file size
594
+ */
595
+ minSize: _propTypes2.default.number,
596
+
597
+ /**
598
+ * className
599
+ */
600
+ className: _propTypes2.default.string,
601
+
602
+ /**
603
+ * className for active state
604
+ */
605
+ activeClassName: _propTypes2.default.string,
606
+
607
+ /**
608
+ * className for accepted state
609
+ */
610
+ acceptClassName: _propTypes2.default.string,
611
+
612
+ /**
613
+ * className for rejected state
614
+ */
615
+ rejectClassName: _propTypes2.default.string,
616
+
617
+ /**
618
+ * className for disabled state
619
+ */
620
+ disabledClassName: _propTypes2.default.string,
621
+
622
+ /**
623
+ * CSS styles to apply
624
+ */
625
+ style: _propTypes2.default.object,
626
+
627
+ /**
628
+ * CSS styles to apply when drag is active
629
+ */
630
+ activeStyle: _propTypes2.default.object,
631
+
632
+ /**
633
+ * CSS styles to apply when drop will be accepted
634
+ */
635
+ acceptStyle: _propTypes2.default.object,
636
+
637
+ /**
638
+ * CSS styles to apply when drop will be rejected
639
+ */
640
+ rejectStyle: _propTypes2.default.object,
641
+
642
+ /**
643
+ * CSS styles to apply when dropzone is disabled
644
+ */
645
+ disabledStyle: _propTypes2.default.object,
646
+
647
+ /**
648
+ * onClick callback
649
+ * @param {Event} event
650
+ */
651
+ onClick: _propTypes2.default.func,
652
+
653
+ /**
654
+ * onDrop callback
655
+ */
656
+ onDrop: _propTypes2.default.func,
657
+
658
+ /**
659
+ * onDropAccepted callback
660
+ */
661
+ onDropAccepted: _propTypes2.default.func,
662
+
663
+ /**
664
+ * onDropRejected callback
665
+ */
666
+ onDropRejected: _propTypes2.default.func,
667
+
668
+ /**
669
+ * onDragStart callback
670
+ */
671
+ onDragStart: _propTypes2.default.func,
672
+
673
+ /**
674
+ * onDragEnter callback
675
+ */
676
+ onDragEnter: _propTypes2.default.func,
677
+
678
+ /**
679
+ * onDragOver callback
680
+ */
681
+ onDragOver: _propTypes2.default.func,
682
+
683
+ /**
684
+ * onDragLeave callback
685
+ */
686
+ onDragLeave: _propTypes2.default.func,
687
+
688
+ /**
689
+ * Provide a callback on clicking the cancel button of the file dialog
690
+ */
691
+ onFileDialogCancel: _propTypes2.default.func
692
+ };
693
+
694
+ Dropzone.defaultProps = {
695
+ preventDropOnDocument: true,
696
+ disabled: false,
697
+ disablePreview: false,
698
+ disableClick: false,
699
+ multiple: true,
700
+ maxSize: Infinity,
701
+ minSize: 0
702
+ };
703
+ module.exports = exports['default'];
704
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
680
705
 
681
706
  /***/ }),
682
707
  /* 1 */
683
708
  /***/ (function(module, exports) {
684
709
 
685
- // shim for using process in browser
686
- var process = module.exports = {};
687
-
688
- // cached from whatever global is present so that test runners that stub it
689
- // don't break things. But we need to wrap it in a try catch in case it is
690
- // wrapped in strict mode code which doesn't define any globals. It's inside a
691
- // function because try/catches deoptimize in certain engines.
692
-
693
- var cachedSetTimeout;
694
- var cachedClearTimeout;
695
-
696
- function defaultSetTimout() {
697
- throw new Error('setTimeout has not been defined');
698
- }
699
- function defaultClearTimeout () {
700
- throw new Error('clearTimeout has not been defined');
701
- }
702
- (function () {
703
- try {
704
- if (typeof setTimeout === 'function') {
705
- cachedSetTimeout = setTimeout;
706
- } else {
707
- cachedSetTimeout = defaultSetTimout;
708
- }
709
- } catch (e) {
710
- cachedSetTimeout = defaultSetTimout;
711
- }
712
- try {
713
- if (typeof clearTimeout === 'function') {
714
- cachedClearTimeout = clearTimeout;
715
- } else {
716
- cachedClearTimeout = defaultClearTimeout;
717
- }
718
- } catch (e) {
719
- cachedClearTimeout = defaultClearTimeout;
720
- }
721
- } ())
722
- function runTimeout(fun) {
723
- if (cachedSetTimeout === setTimeout) {
724
- //normal enviroments in sane situations
725
- return setTimeout(fun, 0);
726
- }
727
- // if setTimeout wasn't available but was latter defined
728
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
729
- cachedSetTimeout = setTimeout;
730
- return setTimeout(fun, 0);
731
- }
732
- try {
733
- // when when somebody has screwed with setTimeout but no I.E. maddness
734
- return cachedSetTimeout(fun, 0);
735
- } catch(e){
736
- try {
737
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
738
- return cachedSetTimeout.call(null, fun, 0);
739
- } catch(e){
740
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
741
- return cachedSetTimeout.call(this, fun, 0);
742
- }
743
- }
744
-
745
-
746
- }
747
- function runClearTimeout(marker) {
748
- if (cachedClearTimeout === clearTimeout) {
749
- //normal enviroments in sane situations
750
- return clearTimeout(marker);
751
- }
752
- // if clearTimeout wasn't available but was latter defined
753
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
754
- cachedClearTimeout = clearTimeout;
755
- return clearTimeout(marker);
756
- }
757
- try {
758
- // when when somebody has screwed with setTimeout but no I.E. maddness
759
- return cachedClearTimeout(marker);
760
- } catch (e){
761
- try {
762
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
763
- return cachedClearTimeout.call(null, marker);
764
- } catch (e){
765
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
766
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
767
- return cachedClearTimeout.call(this, marker);
768
- }
769
- }
770
-
771
-
772
-
773
- }
774
- var queue = [];
775
- var draining = false;
776
- var currentQueue;
777
- var queueIndex = -1;
778
-
779
- function cleanUpNextTick() {
780
- if (!draining || !currentQueue) {
781
- return;
782
- }
783
- draining = false;
784
- if (currentQueue.length) {
785
- queue = currentQueue.concat(queue);
786
- } else {
787
- queueIndex = -1;
788
- }
789
- if (queue.length) {
790
- drainQueue();
791
- }
792
- }
793
-
794
- function drainQueue() {
795
- if (draining) {
796
- return;
797
- }
798
- var timeout = runTimeout(cleanUpNextTick);
799
- draining = true;
800
-
801
- var len = queue.length;
802
- while(len) {
803
- currentQueue = queue;
804
- queue = [];
805
- while (++queueIndex < len) {
806
- if (currentQueue) {
807
- currentQueue[queueIndex].run();
808
- }
809
- }
810
- queueIndex = -1;
811
- len = queue.length;
812
- }
813
- currentQueue = null;
814
- draining = false;
815
- runClearTimeout(timeout);
816
- }
817
-
818
- process.nextTick = function (fun) {
819
- var args = new Array(arguments.length - 1);
820
- if (arguments.length > 1) {
821
- for (var i = 1; i < arguments.length; i++) {
822
- args[i - 1] = arguments[i];
823
- }
824
- }
825
- queue.push(new Item(fun, args));
826
- if (queue.length === 1 && !draining) {
827
- runTimeout(drainQueue);
828
- }
829
- };
830
-
831
- // v8 likes predictible objects
832
- function Item(fun, array) {
833
- this.fun = fun;
834
- this.array = array;
835
- }
836
- Item.prototype.run = function () {
837
- this.fun.apply(null, this.array);
838
- };
839
- process.title = 'browser';
840
- process.browser = true;
841
- process.env = {};
842
- process.argv = [];
843
- process.version = ''; // empty string to avoid regexp issues
844
- process.versions = {};
845
-
846
- function noop() {}
847
-
848
- process.on = noop;
849
- process.addListener = noop;
850
- process.once = noop;
851
- process.off = noop;
852
- process.removeListener = noop;
853
- process.removeAllListeners = noop;
854
- process.emit = noop;
855
- process.prependListener = noop;
856
- process.prependOnceListener = noop;
857
-
858
- process.listeners = function (name) { return [] }
859
-
860
- process.binding = function (name) {
861
- throw new Error('process.binding is not supported');
862
- };
863
-
864
- process.cwd = function () { return '/' };
865
- process.chdir = function (dir) {
866
- throw new Error('process.chdir is not supported');
867
- };
868
- process.umask = function() { return 0; };
710
+ // shim for using process in browser
711
+ var process = module.exports = {};
712
+
713
+ // cached from whatever global is present so that test runners that stub it
714
+ // don't break things. But we need to wrap it in a try catch in case it is
715
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
716
+ // function because try/catches deoptimize in certain engines.
717
+
718
+ var cachedSetTimeout;
719
+ var cachedClearTimeout;
720
+
721
+ function defaultSetTimout() {
722
+ throw new Error('setTimeout has not been defined');
723
+ }
724
+ function defaultClearTimeout () {
725
+ throw new Error('clearTimeout has not been defined');
726
+ }
727
+ (function () {
728
+ try {
729
+ if (typeof setTimeout === 'function') {
730
+ cachedSetTimeout = setTimeout;
731
+ } else {
732
+ cachedSetTimeout = defaultSetTimout;
733
+ }
734
+ } catch (e) {
735
+ cachedSetTimeout = defaultSetTimout;
736
+ }
737
+ try {
738
+ if (typeof clearTimeout === 'function') {
739
+ cachedClearTimeout = clearTimeout;
740
+ } else {
741
+ cachedClearTimeout = defaultClearTimeout;
742
+ }
743
+ } catch (e) {
744
+ cachedClearTimeout = defaultClearTimeout;
745
+ }
746
+ } ())
747
+ function runTimeout(fun) {
748
+ if (cachedSetTimeout === setTimeout) {
749
+ //normal enviroments in sane situations
750
+ return setTimeout(fun, 0);
751
+ }
752
+ // if setTimeout wasn't available but was latter defined
753
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
754
+ cachedSetTimeout = setTimeout;
755
+ return setTimeout(fun, 0);
756
+ }
757
+ try {
758
+ // when when somebody has screwed with setTimeout but no I.E. maddness
759
+ return cachedSetTimeout(fun, 0);
760
+ } catch(e){
761
+ try {
762
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
763
+ return cachedSetTimeout.call(null, fun, 0);
764
+ } catch(e){
765
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
766
+ return cachedSetTimeout.call(this, fun, 0);
767
+ }
768
+ }
769
+
770
+
771
+ }
772
+ function runClearTimeout(marker) {
773
+ if (cachedClearTimeout === clearTimeout) {
774
+ //normal enviroments in sane situations
775
+ return clearTimeout(marker);
776
+ }
777
+ // if clearTimeout wasn't available but was latter defined
778
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
779
+ cachedClearTimeout = clearTimeout;
780
+ return clearTimeout(marker);
781
+ }
782
+ try {
783
+ // when when somebody has screwed with setTimeout but no I.E. maddness
784
+ return cachedClearTimeout(marker);
785
+ } catch (e){
786
+ try {
787
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
788
+ return cachedClearTimeout.call(null, marker);
789
+ } catch (e){
790
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
791
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
792
+ return cachedClearTimeout.call(this, marker);
793
+ }
794
+ }
795
+
796
+
797
+
798
+ }
799
+ var queue = [];
800
+ var draining = false;
801
+ var currentQueue;
802
+ var queueIndex = -1;
803
+
804
+ function cleanUpNextTick() {
805
+ if (!draining || !currentQueue) {
806
+ return;
807
+ }
808
+ draining = false;
809
+ if (currentQueue.length) {
810
+ queue = currentQueue.concat(queue);
811
+ } else {
812
+ queueIndex = -1;
813
+ }
814
+ if (queue.length) {
815
+ drainQueue();
816
+ }
817
+ }
818
+
819
+ function drainQueue() {
820
+ if (draining) {
821
+ return;
822
+ }
823
+ var timeout = runTimeout(cleanUpNextTick);
824
+ draining = true;
825
+
826
+ var len = queue.length;
827
+ while(len) {
828
+ currentQueue = queue;
829
+ queue = [];
830
+ while (++queueIndex < len) {
831
+ if (currentQueue) {
832
+ currentQueue[queueIndex].run();
833
+ }
834
+ }
835
+ queueIndex = -1;
836
+ len = queue.length;
837
+ }
838
+ currentQueue = null;
839
+ draining = false;
840
+ runClearTimeout(timeout);
841
+ }
842
+
843
+ process.nextTick = function (fun) {
844
+ var args = new Array(arguments.length - 1);
845
+ if (arguments.length > 1) {
846
+ for (var i = 1; i < arguments.length; i++) {
847
+ args[i - 1] = arguments[i];
848
+ }
849
+ }
850
+ queue.push(new Item(fun, args));
851
+ if (queue.length === 1 && !draining) {
852
+ runTimeout(drainQueue);
853
+ }
854
+ };
855
+
856
+ // v8 likes predictible objects
857
+ function Item(fun, array) {
858
+ this.fun = fun;
859
+ this.array = array;
860
+ }
861
+ Item.prototype.run = function () {
862
+ this.fun.apply(null, this.array);
863
+ };
864
+ process.title = 'browser';
865
+ process.browser = true;
866
+ process.env = {};
867
+ process.argv = [];
868
+ process.version = ''; // empty string to avoid regexp issues
869
+ process.versions = {};
870
+
871
+ function noop() {}
872
+
873
+ process.on = noop;
874
+ process.addListener = noop;
875
+ process.once = noop;
876
+ process.off = noop;
877
+ process.removeListener = noop;
878
+ process.removeAllListeners = noop;
879
+ process.emit = noop;
880
+ process.prependListener = noop;
881
+ process.prependOnceListener = noop;
882
+
883
+ process.listeners = function (name) { return [] }
884
+
885
+ process.binding = function (name) {
886
+ throw new Error('process.binding is not supported');
887
+ };
888
+
889
+ process.cwd = function () { return '/' };
890
+ process.chdir = function (dir) {
891
+ throw new Error('process.chdir is not supported');
892
+ };
893
+ process.umask = function() { return 0; };
869
894
 
870
895
 
871
896
  /***/ }),
872
897
  /* 2 */
873
898
  /***/ (function(module, exports) {
874
899
 
875
- module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
900
+ module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
876
901
 
877
902
  /***/ }),
878
903
  /* 3 */
879
904
  /***/ (function(module, exports) {
880
905
 
881
- module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
906
+ module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
882
907
 
883
908
  /***/ }),
884
909
  /* 4 */
885
- /***/ (function(module, exports) {
910
+ /***/ (function(module, exports, __webpack_require__) {
886
911
 
887
- module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]);
912
+ "use strict";
913
+
914
+
915
+ Object.defineProperty(exports, "__esModule", {
916
+ value: true
917
+ });
918
+ exports.supportMultiple = undefined;
919
+ exports.getDataTransferItems = getDataTransferItems;
920
+ exports.fileAccepted = fileAccepted;
921
+ exports.fileMatchSize = fileMatchSize;
922
+ exports.allFilesAccepted = allFilesAccepted;
923
+ exports.onDocumentDragOver = onDocumentDragOver;
924
+
925
+ var _attrAccept = __webpack_require__(5);
926
+
927
+ var _attrAccept2 = _interopRequireDefault(_attrAccept);
928
+
929
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
930
+
931
+ var supportMultiple = exports.supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true;
932
+
933
+ function getDataTransferItems(event) {
934
+ var dataTransferItemsList = [];
935
+ if (event.dataTransfer) {
936
+ var dt = event.dataTransfer;
937
+ if (dt.files && dt.files.length) {
938
+ dataTransferItemsList = dt.files;
939
+ } else if (dt.items && dt.items.length) {
940
+ // During the drag even the dataTransfer.files is null
941
+ // but Chrome implements some drag store, which is accesible via dataTransfer.items
942
+ dataTransferItemsList = dt.items;
943
+ }
944
+ } else if (event.target && event.target.files) {
945
+ dataTransferItemsList = event.target.files;
946
+ }
947
+ // Convert from DataTransferItemsList to the native Array
948
+ return Array.prototype.slice.call(dataTransferItemsList);
949
+ }
950
+
951
+ // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with
952
+ // that MIME type will always be accepted
953
+ function fileAccepted(file, accept) {
954
+ return file.type === 'application/x-moz-file' || (0, _attrAccept2.default)(file, accept);
955
+ }
956
+
957
+ function fileMatchSize(file, maxSize, minSize) {
958
+ return file.size <= maxSize && file.size >= minSize;
959
+ }
960
+
961
+ function allFilesAccepted(files, accept) {
962
+ return files.every(function (file) {
963
+ return fileAccepted(file, accept);
964
+ });
965
+ }
966
+
967
+ // allow the entire document to be a drag target
968
+ function onDocumentDragOver(evt) {
969
+ evt.preventDefault();
970
+ }
888
971
 
889
972
  /***/ }),
890
973
  /* 5 */
891
974
  /***/ (function(module, exports) {
892
975
 
893
- "use strict";
894
-
895
- Object.defineProperty(exports, "__esModule", {
896
- value: true
897
- });
898
- exports.default = getDataTransferFiles;
899
- function getDataTransferFiles(event) {
900
- var dataTransferItemsList = [];
901
- if (event.dataTransfer) {
902
- var dt = event.dataTransfer;
903
- if (dt.files && dt.files.length) {
904
- dataTransferItemsList = dt.files;
905
- } else if (dt.items && dt.items.length) {
906
- // During the drag even the dataTransfer.files is null
907
- // but Chrome implements some drag store, which is accesible via dataTransfer.items
908
- dataTransferItemsList = dt.items;
909
- }
910
- } else if (event.target && event.target.files) {
911
- dataTransferItemsList = event.target.files;
912
- }
913
- // Convert from DataTransferItemsList to the native Array
914
- return Array.prototype.slice.call(dataTransferItemsList);
915
- }
916
- module.exports = exports["default"];
976
+ module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]);
977
+
978
+ /***/ }),
979
+ /* 6 */
980
+ /***/ (function(module, exports, __webpack_require__) {
981
+
982
+ "use strict";
983
+
984
+
985
+ Object.defineProperty(exports, "__esModule", {
986
+ value: true
987
+ });
988
+ exports.default = {
989
+ rejected: {
990
+ borderStyle: 'solid',
991
+ borderColor: '#c66',
992
+ backgroundColor: '#eee'
993
+ },
994
+ disabled: {
995
+ opacity: 0.5
996
+ },
997
+ active: {
998
+ borderStyle: 'solid',
999
+ borderColor: '#6c6',
1000
+ backgroundColor: '#eee'
1001
+ },
1002
+ default: {
1003
+ width: 200,
1004
+ height: 200,
1005
+ borderWidth: 2,
1006
+ borderColor: '#666',
1007
+ borderStyle: 'dashed',
1008
+ borderRadius: 5
1009
+ }
1010
+ };
1011
+ module.exports = exports['default'];
917
1012
 
918
1013
  /***/ })
919
- /******/ ])
1014
+ /******/ ]);
920
1015
  });
921
- ;
922
1016
  //# sourceMappingURL=index.js.map