import { EventEmitter } from '../../stencil-public-runtime'; import { AttachmentSort, FileError, FileStatus } from './meta/types'; /** * @category forms */ export declare class MdsInputUpload { private nativeInput?; private extensions; private fileUploaded; private cssMinCols; private idFile; private readonly previewUrls; private t; private host; internals: ElementInternals; dragging: boolean; files: FileStatus[]; progress: number; animateText: boolean; activeSort: AttachmentSort; private formDisabled; /** * Defines the file types the file input should accept, as the accept attribute of a native * file input: MIME types (`image/*` included) and extensions, separated by commas * @example '.pdf,image/*' */ readonly accept: string; /** * Disables the component, like a disabled native file input: no file can be added, dropped or * removed, and the files are left out of the form. A disabled `
` around the component * does the same. */ readonly disabled?: boolean; /** * The name the accepted files are submitted under with the form, one entry per file */ readonly name?: string; /** * Specifies the max size of a single file that can be uploaded in MB */ readonly maxFileSize: number; /** * Specifies the max number of files that can be uploaded */ readonly maxFiles: number; /** * Specifies the order the files start sorted by, status or date of upload, and shows the sort tabs that let the user change it; if not defined the tabs are hidden and the order is the user's last choice */ readonly sort?: AttachmentSort; /** * Specifies initial files uploaded */ readonly initialValue?: FileList | File[]; /** * Emits when the component files are changed */ changedEvent: EventEmitter; formDisabledCallback(disabled: boolean): void; private isDisabled; formResetCallback(): void; connectedCallback(): void; componentWillLoad(): void; componentDidLoad(): void; componentDidRender(): void; disconnectedCallback(): void; updateInitialValue(newValue: FileList | File[] | undefined): void; handleNameChange(): void; handleSortChange(newValue?: AttachmentSort): void; /** * Returns a promise of the accepted files as a FileList, empty if there's none */ getFiles(): Promise; /** * Returns a promise of files error or null if there's none */ getFilesError(): Promise; handleMaxFilesChange(newValue: number, oldValue: number): void; private readonly updateCSSCustomProps; private readonly onDropHandler; private readonly onDragOverHandler; private readonly onDragEnterHandler; private readonly onDragLeaveHandler; private readonly onAdd; private readonly onInputChange; /** * Delete single file from upload * @param filekey */ private readonly onCancel; /** * Delete all files from upload */ private readonly onReset; /** * Reset component's files */ reset(): Promise; private readonly onChangeTab; /** * Prepare file to be submitted. * Limit number of file to maxFiles * Check size and type for every single file. * @param fileList list recieved from input selection or drag and drop */ private prepareFiles; private checkError; private acceptedFiles; private updateFormValue; private update; /** * Update progress bar */ private updateProgress; /** * Sort recieved file and assign the result to this.files for update render * * @param files current list of files to be sorted * @param sort type of sorting */ private sortFiles; private checkFileSize; private checkFileType; private getExtension; private sortByStatusAndName; private sortById; private previewUrl; private revokePreviewUrls; private isSortTabShown; private readonly handleAddFileClick; private readonly handleTabChange; private readonly handleFileDelete; render(): any; }