import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import { HttpClient } from '@angular/common/http'; import { ChangeDetectorRef, EventEmitter } from '@angular/core'; import { ThemePalette } from '@angular/material/core'; import { FileInformation } from '@mtna/file-manager'; import { MtnaErrorService } from '@mtna/lib-ui/error'; import { MtnaLogger } from '@mtna/lib-ui/logger'; import { MtnaFileSizePipe } from '@mtna/lib-ui/pipes'; import * as i0 from "@angular/core"; /** * The File Upload Component allows users to upload files to the server via drag and drop or the * traditional file explorer. */ export declare class MtnaFileUploadComponent { private cdr; errorService: MtnaErrorService; bytePipe: MtnaFileSizePipe; private http; private logger; static ngAcceptInputType_automaticUpload: BooleanInput; static ngAcceptInputType_disabled: BooleanInput; static ngAcceptInputType_isProd: BooleanInput; static ngAcceptInputType_maxUploadSize: NumberInput; static ngAcceptInputType_uploading: BooleanInput; /** Whether the component will upload to the /_files endpoint (when true) or just Output * via `fileToUpload` (when false). Defaults to true. */ get automaticUpload(): boolean; set automaticUpload(a: boolean); private _automaticUpload; /** * Optional, text for upload button. */ buttonText: string; /** * Optional, color for upload button. */ buttonColor: ThemePalette; /** Whether or not the upload is disabled. Defaults to false. */ get disabled(): boolean; set disabled(d: boolean); private _disabled; /** The URL to POST the file upload. If not provided, FileList will be emitted via * `fileToUpload`, regardless of `automaticUpload` status. */ fileUploadUrl?: string; /** Set if use is for production. When in prod mode, it will set the XSRF-TOKEN. Defaults to false. */ get isProd(): boolean; set isProd(p: boolean); private _isProd; /** Optional, In bytes that sets a limit for maximum file size. Default is 20MB. Defaults to 20M bytes. */ get maxUploadSize(): number; set maxUploadSize(max: number); private _maxUploadSize; /** Whether a file is uploading. Defaults to false. */ get uploading(): boolean; set uploading(u: boolean); private _uploading; /** * Event fired when the file is uploaded. A FileInformation object is emitted. */ uploaded: EventEmitter; /** Event fired when file is selected/dropped AND automaticUpload is set to false. Outputs files. */ fileToUpload: EventEmitter; /** * Event fired when the file(s) are uploading. Emits true if uploading. */ uploadStatus: EventEmitter; /** * Error message to be displayed to user */ _errorMessage?: string; /** * counter to keep track of drag events to ensure the outer div remains * 'active' when dragging file into drop zone. */ _dragCounter: number; constructor(cdr: ChangeDetectorRef, errorService: MtnaErrorService, bytePipe: MtnaFileSizePipe, http: HttpClient, logger: MtnaLogger); /** * Changes the uploading status when called and then emits the change. */ changeUploadingStatus(uploadingStatus: boolean): void; getCookie(name: string): string; /** * Handles when file(s) are dragged into the dropzone. Triggers change in class to * change style of dropzone. * @param event */ handleDragEnter(event: DragEvent): void; /** * Handles when file(s) being dragged aren't in the dropzone. Triggers change in class to * change style of dropzone. */ handleDragLeave(): void; /** * Handles when file(s) are dragged into the dropzone and remain in the dropzone. * @param event */ handleDragOver(event: Event): void; /** * Handles when file(s) are dropped into the dropzone. Starts file upload process. * @param event */ handleDrop(event: DragEvent): void; /** * Uploads the files to the upload url provided. * @param files - List of files that were dropped or selected by the user. */ processFiles(files: FileList | Event): void; private _updateErrorMessage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }