react-dropfile-field
Advanced tools
Comparing version 0.0.2 to 0.0.3
## Change Log | ||
### Ver 0.0.3 | ||
* #5 [Add onFileCleared handler](https://github.com/georgeOsdDev/react-dropfile-field/issues/5) | ||
### Ver 0.0.2 | ||
@@ -4,0 +8,0 @@ |
@@ -131,2 +131,4 @@ 'use strict'; | ||
files:[] | ||
}, () => { | ||
this.props.onFileClear(); | ||
}); | ||
@@ -175,3 +177,3 @@ } | ||
style={rootStyle} | ||
className={this.state.isDragActive ? 'dragActive': ''} | ||
className={this.state.isDragActive ? 'dragActive' : ''} | ||
onDragLeave={this.handleDragLeave.bind(this)} | ||
@@ -209,2 +211,3 @@ onDragOver={this.handleDragOver.bind(this)} | ||
onDrop: React.PropTypes.func, | ||
onFileClear: React.PropTypes.func, | ||
accept: React.PropTypes.string, | ||
@@ -221,5 +224,6 @@ multiple: React.PropTypes.bool | ||
maxFileCount: 1, | ||
onDrop: () => {} | ||
onDrop: () => {}, | ||
onFileClear: () => {} | ||
}; | ||
export default DropfileField; |
{ | ||
"name": "react-dropfile-field", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "React component which handle file drop and preview", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -32,2 +32,3 @@ # react-dropfile-field [![Build Status](https://travis-ci.org/georgeOsdDev/react-dropfile-field.svg?branch=develop)](https://travis-ci.org/georgeOsdDev/react-dropfile-field) [![npm version](https://badge.fury.io/js/react-dropfile-field.svg)](http://badge.fury.io/js/react-dropfile-field) | ||
onDrop: React.PropTypes.func, | ||
onFileClear: React.PropTypes.func, | ||
accept: React.PropTypes.string, | ||
@@ -44,3 +45,4 @@ multiple: React.PropTypes.bool | ||
maxFileCount: 1, | ||
onDrop: () => {} | ||
onDrop: () => {}, | ||
onFileClear: () => {} | ||
}; | ||
@@ -61,4 +63,6 @@ ``` | ||
* `onDrop(event, files)`: allback for file drop | ||
* `onDrop(event, files)`: callback for file drop event | ||
* `onFileClear()`: callback for file clear event | ||
* `accept`: accept attribute for manually toggled file input | ||
@@ -65,0 +69,0 @@ |
@@ -76,4 +76,2 @@ 'use strict'; | ||
let d1 = false, d2 = false; | ||
canvas.toBlob( | ||
@@ -170,4 +168,11 @@ function (blob) { | ||
}); | ||
}) | ||
it('should call onFileClear when file cleared', function () { | ||
let called; | ||
component = TestUtils.renderIntoDocument(<DropfileField maxFileCount={2} onFileClear={() => {called = true; }}/>); | ||
component.setFiles([file1, file2, file1]); | ||
component.clearFiles(); | ||
expect(called).to.be.eql(true); | ||
}); | ||
}); | ||
@@ -177,4 +182,2 @@ // @TODO | ||
}); |
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
73725
1116
102