Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dropfile-field

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropfile-field - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

CHANGELOG.md
## 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 @@

8

lib/components/DropfileField.js

@@ -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

});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc