rc-upload
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -22,3 +22,3 @@ import React, { Component } from 'react'; | ||
componentWillUnmount(): void; | ||
uploadFiles: (files: FileList) => void; | ||
uploadFiles: (files: File[]) => void; | ||
/** | ||
@@ -25,0 +25,0 @@ * Process file before upload. When all the file is ready, we start upload. |
@@ -39,4 +39,8 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
_this.uploadFiles(files); | ||
var acceptedFiles = _toConsumableArray(files).filter(function (file) { | ||
return attrAccept(file, _this.props.accept); | ||
}); | ||
_this.uploadFiles(acceptedFiles); | ||
_this.reset(); | ||
@@ -88,3 +92,3 @@ }; | ||
} else { | ||
var files = Array.prototype.slice.call(e.dataTransfer.files).filter(function (file) { | ||
var files = _toConsumableArray(e.dataTransfer.files).filter(function (file) { | ||
return attrAccept(file, _this.props.accept); | ||
@@ -91,0 +95,0 @@ }); |
@@ -22,3 +22,3 @@ import React, { Component } from 'react'; | ||
componentWillUnmount(): void; | ||
uploadFiles: (files: FileList) => void; | ||
uploadFiles: (files: File[]) => void; | ||
/** | ||
@@ -25,0 +25,0 @@ * Process file before upload. When all the file is ready, we start upload. |
@@ -65,4 +65,7 @@ "use strict"; | ||
var files = e.target.files; | ||
var acceptedFiles = (0, _toConsumableArray2.default)(files).filter(function (file) { | ||
return (0, _attrAccept.default)(file, _this.props.accept); | ||
}); | ||
_this.uploadFiles(files); | ||
_this.uploadFiles(acceptedFiles); | ||
@@ -115,3 +118,3 @@ _this.reset(); | ||
} else { | ||
var files = Array.prototype.slice.call(e.dataTransfer.files).filter(function (file) { | ||
var files = (0, _toConsumableArray2.default)(e.dataTransfer.files).filter(function (file) { | ||
return (0, _attrAccept.default)(file, _this.props.accept); | ||
@@ -118,0 +121,0 @@ }); |
{ | ||
"name": "rc-upload", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "upload ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60463
1462