rc-upload
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -14,2 +14,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
import getUid from './uid'; | ||
import attrAccept from 'attr-accept'; | ||
@@ -49,3 +50,2 @@ var AjaxUploader = function (_Component) { | ||
} | ||
var files = e.dataTransfer.files; | ||
@@ -123,4 +123,8 @@ _this.uploadFiles(files); | ||
var onStart = props.onStart, | ||
onProgress = props.onProgress; | ||
onProgress = props.onProgress, | ||
accept = props.accept; | ||
if (!attrAccept(file, accept)) { | ||
return; | ||
} | ||
if (typeof data === 'function') { | ||
@@ -127,0 +131,0 @@ data = data(file); |
@@ -51,4 +51,10 @@ 'use strict'; | ||
var _attrAccept = require('attr-accept'); | ||
var _attrAccept2 = _interopRequireDefault(_attrAccept); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
/* eslint react/no-is-mounted:0 react/sort-comp:0 */ | ||
var AjaxUploader = function (_Component) { | ||
@@ -87,3 +93,2 @@ (0, _inherits3['default'])(AjaxUploader, _Component); | ||
} | ||
var files = e.dataTransfer.files; | ||
@@ -161,4 +166,8 @@ _this.uploadFiles(files); | ||
var onStart = props.onStart, | ||
onProgress = props.onProgress; | ||
onProgress = props.onProgress, | ||
accept = props.accept; | ||
if (!(0, _attrAccept2['default'])(file, accept)) { | ||
return; | ||
} | ||
if (typeof data === 'function') { | ||
@@ -266,3 +275,3 @@ data = data(file); | ||
return AjaxUploader; | ||
}(_react.Component); /* eslint react/no-is-mounted:0 react/sort-comp:0 */ | ||
}(_react.Component); | ||
@@ -269,0 +278,0 @@ AjaxUploader.propTypes = { |
{ | ||
"name": "rc-upload", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "upload ui component for react", | ||
@@ -54,2 +54,3 @@ "keywords": [ | ||
"dependencies": { | ||
"attr-accept": "^1.1.0", | ||
"babel-runtime": "6.x", | ||
@@ -56,0 +57,0 @@ "classnames": "^2.2.5", |
@@ -29,3 +29,3 @@ # rc-upload | ||
http://localhost:8000/examples/ | ||
http://localhost:8020/examples/ | ||
@@ -32,0 +32,0 @@ online example: http://react-component.github.io/upload/examples/simple.html |
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
58255
1455
5
+ Addedattr-accept@^1.1.0
+ Addedattr-accept@1.1.3(transitive)