UNPKG

1.55 kBTypeScriptView Raw
1import { MaterialButtonProps } from "@unlimited-react-components/material-button";
2import { Localization } from "../../localization/localization";
3import { CustomValidateFileResponse } from "../dropzone/components/utils/validation.utils";
4export interface InputButtonProps extends MaterialButtonProps {
5 /**
6 * the id of the component
7 */
8 id?: string;
9 /**
10 * whether to accept multiple files or not
11 */
12 multiple?: boolean;
13 /**
14 * The list of mimetypes and extensions of files
15 * to accept. This is a comma separated list of
16 * mime types or file extensions.
17 * Eg.: image/\*,application/pdf,.psd
18 */
19 accept?: string;
20 /**
21 * If given, this label will be shwed inside the button
22 */
23 label?: string;
24 /**
25 * what to do after selecting the files. Returns the File[] to the parent component
26 */
27 onChange?: Function;
28 /**
29 * custom validator
30 * must be a function that recieves as first parameter a File Object
31 * and must return a boolean value
32 */
33 validator?: (f: File) => CustomValidateFileResponse;
34 /**
35 * Max number of files to be accepted.
36 */
37 /**
38 * max file size allowed in bytes
39 */
40 maxFileSize?: number;
41 /**
42 * language to be used
43 * for now
44 * only English, French , Portuguese and Spanish are supported
45 */
46 localization?: Localization;
47}
48/**
49 * The default props when not given
50 */
51export declare const InputButtonDefaultProps: InputButtonProps;