react-dropzone 14.1.1 → 14.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ export type DropzoneOptions = Pick<React.HTMLProps<HTMLElement>, PropTypes> & {
|
|
|
50
50
|
) => Promise<Array<File | DataTransferItem>>;
|
|
51
51
|
onFileDialogCancel?: () => void;
|
|
52
52
|
onFileDialogOpen?: () => void;
|
|
53
|
+
onError?: (err: Error) => void;
|
|
53
54
|
validator?: <T extends File>(file: T) => FileError | FileError[] | null;
|
|
54
55
|
useFsAccessApi?: boolean;
|
|
55
56
|
autoFocus?: boolean;
|
package/typings/tests/all.tsx
CHANGED
|
@@ -16,8 +16,11 @@ export default class Test extends React.Component {
|
|
|
16
16
|
onDropRejected={(files, event) => console.log(files, event)}
|
|
17
17
|
onFileDialogCancel={() => console.log("onFileDialogCancel invoked")}
|
|
18
18
|
onFileDialogOpen={() => console.log("onFileDialogOpen invoked")}
|
|
19
|
+
onError={(e) => console.log(e)}
|
|
20
|
+
validator={(f) => ({ message: f.name, code: "" })}
|
|
19
21
|
minSize={2000}
|
|
20
22
|
maxSize={Infinity}
|
|
23
|
+
maxFiles={100}
|
|
21
24
|
preventDropOnDocument
|
|
22
25
|
noClick={false}
|
|
23
26
|
noKeyboard={false}
|
|
@@ -29,6 +32,7 @@ export default class Test extends React.Component {
|
|
|
29
32
|
"image/*": [".png"],
|
|
30
33
|
}}
|
|
31
34
|
useFsAccessApi={false}
|
|
35
|
+
autoFocus
|
|
32
36
|
>
|
|
33
37
|
{({ getRootProps, getInputProps }) => (
|
|
34
38
|
<div {...getRootProps()}>
|