diff --git a/src/components/fileupload/FileUpload.d.ts b/src/components/fileupload/FileUpload.d.ts index 504d1ca4f5..9cca45516c 100644 --- a/src/components/fileupload/FileUpload.d.ts +++ b/src/components/fileupload/FileUpload.d.ts @@ -62,6 +62,15 @@ interface FileUploadProgressParams { progress: number; } +interface FileUploadHandlerOptions { + clear(): void; + props: FileUploadProps; +} + +interface FileUploadHandlerParam extends FileUploadFilesParam { + options: FileUploadHandlerOptions; +} + interface FileUploadRemoveParams extends FileUploadSelectParams { } interface FileUploadProps { @@ -102,7 +111,7 @@ interface FileUploadProps { onSelect?(e: FileUploadSelectParams): void; onProgress?(e: FileUploadProgressParams): void; onValidationFail?(file: File): void; - uploadHandler?(e: FileUploadFilesParam): void; + uploadHandler?(e: FileUploadHandlerParam): void; onRemove?(e: FileUploadRemoveParams): void; } diff --git a/src/components/fileupload/FileUpload.js b/src/components/fileupload/FileUpload.js index 36efb5f6be..41367edbc0 100644 --- a/src/components/fileupload/FileUpload.js +++ b/src/components/fileupload/FileUpload.js @@ -294,7 +294,11 @@ export class FileUpload extends Component { if (this.props.uploadHandler) { this.props.uploadHandler({ - files: this.state.files + files: this.state.files, + options: { + clear: this.clear, + props: this.props + } }) } } diff --git a/src/showcase/fileupload/FileUplodDoc.js b/src/showcase/fileupload/FileUplodDoc.js index b7dad120c9..732648840f 100644 --- a/src/showcase/fileupload/FileUplodDoc.js +++ b/src/showcase/fileupload/FileUplodDoc.js @@ -838,6 +838,7 @@ const buttonOptions = { uploadHandler event.files: List of selected files. + event.options: Handler options. Callback to invoke in custom upload mode to upload the files manually.