diff --git a/react-dropzone/react-dropzone-tests.tsx b/react-dropzone/react-dropzone-tests.tsx index ca3d462596..b529f2d057 100644 --- a/react-dropzone/react-dropzone-tests.tsx +++ b/react-dropzone/react-dropzone-tests.tsx @@ -7,25 +7,30 @@ class Test extends React.Component { constructor(props: any) { super(props); } - + render() { return (
{ e.preventDefault(); } } onDropAccepted={(e: any) => { e.preventDefault(); } } onDropRejected={(e: any) => { e.preventDefault(); } } + onDragStart={(e: any) => { e.preventDefault(); } } onDragEnter={(e: any) => { e.preventDefault(); } } onDragLeave={(e: any) => { e.preventDefault(); } } style={{ borderStyle: "dashed" }} activeStyle={{ borderStyle: "dotted" }} + rejectStyle={{ borderStyle: "dotted" }} className="regular" - minSize={2000} - maxSize={Infinity} activeClassName="active" rejectClassName="reject" + minSize={2000} + maxSize={Infinity} + disablePreview={true} disableClick={true} multiple={false} accept="*.png" + name="dropzone" + inputProps={{ id: "dropzone" }} />
); } diff --git a/react-dropzone/react-dropzone.d.ts b/react-dropzone/react-dropzone.d.ts index 792fd436ba..c6eecbf119 100644 --- a/react-dropzone/react-dropzone.d.ts +++ b/react-dropzone/react-dropzone.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-dropzone -// Project: https://github.com/paramaggarwal/react-dropzone -// Definitions by: Mathieu Larouche Dube +// Project: https://github.com/okonet/react-dropzone +// Definitions by: Mathieu Larouche Dube , Ivo Jesus , Luís Rodrigues // Definitions: https://github.com/Vooban/DefinitelyTyped /// @@ -8,39 +8,32 @@ declare namespace ReactDropzone { import React = __React; interface DropzoneProps { - onDrop?: Function; - onDropAccepted?: Function; - onDropRejected?: Function; - onDragEnter?: Function; - onDragLeave?: Function; - style?: Object; - activeStyle?: Object; - className?: string; - activeClassName?: string; - rejectClassName?: string; - /** - * Clicking the brings up the browser file picker. To disable, set to true. - */ - disableClick?: boolean; - /** - * Min file size accepted - */ - minSize?: number; - /** - * Max file size accepted - */ - maxSize?: number; - /** - * To accept only a single file, set this to false. - */ - multiple?: boolean; - /** - * Filters the file types that are valid. It should have a valid MIME type according to input element, for example: - * application/pdf - * image/* - * audio/aiff,audio/midi - */ - accept?: string; + // Drop behavior + onDrop?: Function, + onDropAccepted?: Function, + onDropRejected?: Function, + + // Drag behavior + onDragStart?: Function, + onDragEnter?: Function, + onDragLeave?: Function, + + style?: Object, // CSS styles to apply + activeStyle?: Object, // CSS styles to apply when drop will be accepted + rejectStyle?: Object, // CSS styles to apply when drop will be rejected + className?: string, // Optional className + activeClassName?: string, // className for accepted state + rejectClassName?: string, // className for rejected state + + disablePreview?: boolean, // Enable/disable preview generation + disableClick?: boolean, // Disallow clicking on the dropzone container to open file dialog + + inputProps?: Object, // Pass additional attributes to the tag + multiple?: boolean, // Allow dropping multiple files + accept?: string, // Allow specific types of files. See https://github.com/okonet/attr-accept for more information + name?: string, // name attribute for the input tag + maxSize?: number, + minSize?: number } export class Dropzone extends React.Component { @@ -52,4 +45,3 @@ declare module "react-dropzone" { const Dropzone: typeof ReactDropzone.Dropzone; export = Dropzone; } -