Skip to content

Commit

Permalink
add multiple to Uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
JandenMa committed May 8, 2022
1 parent bd90ccc commit 739888d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ import { UploaderAnswer } from '@rinxun/custom-questions';
| dropFileText | string | 'Drop files here' | false | The text of the Drop File Area. |
| files | Array\<FileProps\> | | true | See **File Props** above. |
| maxSize | number | 5 (MB) | false | Maximum of the uploading file size, UOM is `MB`. |
| multiple | boolean | false | false | If `true` then you can upload multiple files |
| onRemove | func | | true | Callback fired when removed the file.<br />**Signature:**<br/>`function(id: string|number) => void`<br/>*id:* The unique id of the removing file, but if `fileKey`is not null/undefined, here you will get the `fileKey` instead of the `id`. |
| onUpload | func | | true | Callback fired when uploaded a file.<br />**Signature:**<br/>`function(files: Array<File>, index?: number) => void`<br/>*files:* Acceptable files you uploaded.<br />*index:* If more than 1 `Uploader` in the same page, you can define the `index`. |
| sizeExceededErrText | string | Your file exceed the max size of x MB. | false | The alert message when you uploaded a size exceeded file.<br />`x` is the maximum of the uploading file size, if you set the `maxSize` that's it, otherwise, default to 5. |
Expand Down
1 change: 1 addition & 0 deletions components/UploaderAnswer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface FileProps {
export interface UploaderAnswerProps {
color?: CSSProperties['color'];
files: Array<FileProps>;
multiple?: boolean;
onUpload: (files: Array<File>, index?: number) => void;
onRemove: (id: string | number) => void;
viewType: ViewTypeEnum;
Expand Down

0 comments on commit 739888d

Please sign in to comment.