react-components-design-system
Version:
React UI component for design system FIS ES PB5
58 lines (57 loc) • 2.06 kB
TypeScript
import type { Observable } from "rxjs";
import "./UploadFile.scss";
import { AxiosError } from "axios";
export interface FileModel {
id?: number;
fileId?: string | number;
name?: string;
url?: string;
appUserId?: number;
rowId?: string;
content?: string;
mimeType?: string;
isFile?: boolean;
key?: any;
path?: string;
level?: number;
isDelete?: boolean;
clearAction?: (fileId: string | number) => void;
handleInput?: (e: any) => void;
}
export interface UploadFileProps {
/**Option for multiple UploadFile */
isMultiple?: boolean;
/**Title button */
titleButton?: string;
/**Content of UploadFile component */
uploadContent?: string;
/**Content of UploadFile component */
textHint?: string;
/**Function change list file uploaded */
updateList?: (files: FileModel[]) => void;
/**API use to upload list file selected to server*/
uploadFile?: (files: File[] | Blob[]) => Observable<FileModel[]>;
/**Option limit maximum size (b) of list file to upload to server */
maximumSize?: number;
/** Option to change style of upload "link", "button", "dragAndDrop"*/
type?: "link" | "button" | "dragAndDrop";
/**Icon of component */
icon?: JSX.Element;
/**Option to set component have only view mode */
isViewMode?: boolean;
/**Function to set list file in status loading */
setListFileLoading?: (files: FileModel[]) => void;
/**Use to custom style the component*/
className?: string;
/**acept file */
acceptFiles?: string;
/**Function to handle error when upload file */
onUploadError?: (error: AxiosError<any>) => void;
disabled?: boolean;
}
export declare function UploadFile(props: UploadFileProps): import("react/jsx-runtime").JSX.Element;
export declare namespace UploadFile {
var FileLoadedContent: typeof import("./FileLoadedContent/FileLoadedContent").default;
var FileLoadingContent: typeof import("./FileLoadingContent/FileLoadingContent").default;
}
export default UploadFile;