funda-ui
Version:
React components using pure Bootstrap 5+ which does not contain any external style and script libraries.
50 lines (49 loc) • 2.13 kB
TypeScript
import React from 'react';
export declare type FileProps = {
contentRef?: React.ForwardedRef<any>;
wrapperClassName?: string;
controlClassName?: string;
controlExClassName?: string;
labelClassName?: string;
labelHoverClassName?: string;
accept?: string;
inline?: boolean;
autoSubmit?: boolean;
fetchUrl?: string;
fetchMethod?: string;
fetchParams?: any;
multiple?: boolean;
submitLabel?: React.ReactNode | string;
submitClassName?: string;
progressLabel?: React.ReactNode | string;
progressClassName?: string;
value?: string;
requiredLabel?: React.ReactNode | string;
label?: React.ReactNode | string;
name?: string;
disabled?: any;
required?: any;
/** Incoming data, you can set the third parameter of `onComplete` */
data?: any;
/** -- */
id?: string;
tabIndex?: number;
[key: `data-${string}`]: string | undefined;
fetchFuncAsync?: any;
fetchFuncMethod?: string;
fetchFuncMethodParams?: any[];
formDataAppend?: (formData: FormData, files: FileList) => void;
/** Enable chunked upload for large files */
enableChunkedUpload?: boolean;
/** Chunk size in bytes (default: 2MB) */
chunkSize?: number;
/** Custom function to append chunk data to FormData. Receives (formData: FormData, chunk: Blob, chunkIndex: number, totalChunks: number, file: File) */
chunkDataAppend?: (formData: FormData, chunk: Blob, chunkIndex: number, totalChunks: number, file: File) => void;
/** Callback for chunk upload progress. Receives (uploadedBytes: number, totalBytes: number, file: File, chunkIndex: number, totalChunks: number) */
onChunkProgress?: (uploadedBytes: number, totalBytes: number, file: File, chunkIndex: number, totalChunks: number) => void;
onChange?: (e: any, e2: any, value: any) => void;
onComplete?: (e: any, e2: any, callback: any, incomingData: string | null | undefined) => void;
onProgress?: (files: any, e: any, e2: any) => void;
};
declare const File: React.ForwardRefExoticComponent<FileProps & React.RefAttributes<unknown>>;
export default File;