import { ElementRef, EventEmitter, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { FormUtilityService } from '../../services/form-utility.service'; import { FieldConfig } from '../../models/field-config.model'; import { AllowedFileTypes } from '../../models/allowed-file-types.model'; import { FileUploadService } from '../../services/file-upload.service'; import { AlignBrowsedFiles } from '../../models/align-browsed-files.model'; import { AlignType } from '@ieeesa-npm/models'; import { FileUploadStatus } from '../../models/file-upload-status.model'; import { FileDownloadAndDeleteConfig } from '../../models/file-download-config.model'; import { DownloadAttachment } from '../../models/download-file.model'; import * as i0 from "@angular/core"; /** * Provides functionality for uploading files to aws s3 bucket. * @export * @class FileUploadComponent * @implements {OnInit} */ export declare class FileUploadComponent implements OnInit { formUtilityService: FormUtilityService; fileUploadService: FileUploadService; fileField: ElementRef; constants: { ariaLabel: { clear: string; warning: string; previousMonth: string; nextMonth: string; menuIcon: string; close: string; search: string; addFormGroup: string; }; button: { cancel: string; ok: string; add: string; }; modalConfig: { ariaLabel: string; autoFocus: string; width: string; }; chips: { noOfDefaultVisibleChips: number; label: { viewAll: string; viewLess: string; }; ariaLabel: { chipsList: string; }; icons: { arrow: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }; remove: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }; check: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }; }; }; dataTable: { label: { clearAll: string; }; message: { noRecordFound: string; }; ariaLabel: { search: string; selectAll: string; select: string; link: string; pagination: string; }; buttons: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }[]; }; datePicker: { selectDateLabel: string; dateFormatLabel: string; startDateLabel: string; endDateLabel: string; datePickerIcon: string; }; dropdown: { placeholderText: string; }; filter: { label: { filterBy: string; applyButton: string; clearAll: string; }; buttons: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }[]; }; textarea: { maxLengthDefault: number; leftCharacters: string; }; autocomplete: { minCharToSearch: number; debounceTime: number; }; multiSelectAutoComplete: { label: { clearAll: string; }; ariaLabel: { selectedOption: string; removeOption: string; }; icons: { remove: string; clearAll: string; }; }; header: { alt: { logo: string; }; ariaLabel: { helpLink: string; hamburgerMenu: string; }; label: { signOut: string; }; buttons: { id: number; iconURL: string; toolTip: string; ariaLabel: string; }[]; userProfileMenuOptions: { id: number; iconURL: string; label: string; ariaLabel: string; toolTip: string; isToolTipNeeded: boolean; }[]; errors: { "2029": string; }; }; footer: { alt: { logo: string; }; links: { label: string; ariaLabel: string; redirectUrl: string; }[]; ieeeLogo: string; copyright: { link: string; textPart1: string; textPart2: string; hyperLinkPart3: string; textPart4: string; }; }; welcome: { buttons: { label: string; ariaLabel: string; url: string; }[]; }; breadcrumb: { label: { initial: string; }; }; loader: { ariaLabel: { spinner: string; }; }; defaultWelcomeBgColor: string; timePicker: { defaultTimeFormat: number; timePickerIcon: string; }; colorPicker: { label: { select: string; cancel: string; }; ariaLabel: { colorPicker: string; next: string; back: string; select: string; cancel: string; hexCodeInput: string; palette: string; }; defaultColor: string; ariaDescription: string; ariaDescribedById: string; paletteColors: { name: string; hexCode: string; }[]; }; fileUpload: { label: { fileUpload: string; allowedFileSize1: string; allowedFileSize2: string; allowedFileFormat: string; /** * Emits downloadSelectedFile event. * @memberof FileUploadComponent */ browseFiles: string; uploadProgress: string; upload: string; mb: string; uploadFor: string; uploadErrorMsg: string; of: string; filesUploaded: string; fileAlreadyExists: string; }; ariaLabel: { fileUpload: string; browseFiles: string; fileUploadIcon: string; removeFileIcon: string; deleteFileIcon: string; fileDownload: string; fileUploadInput: string; }; iconUrl: { fileUploadIcon: string; fileRemoveIcon: string; deleteIcon: string; }; buttons: { id: number; ariaLabel: string; iconURL: string; toolTip: string; disabled: boolean; }[]; message: { error: { ER1002: string; invalidFileFormat: string; invalidFileSize: string; "2026": string; "2059": string; "2060": string; "2061": string; "2062": string; "2063": string; "2064": string; }; }; limit: { maxFilesUploadedOnce: number; }; }; list: { defaultIndentation: number; dragAndDropIconUrl: string; }; search: { minCharToSearch: number; searchIcon: string; }; richTextEditor: { label: { editor: string; }; ariaLabel: { editor: string; colorPicker: string; }; }; fileDownload: { buttons: { id: number; ariaLabel: string; iconURL: string; toolTip: string; disabled: boolean; }[]; preSignedDuration: string; message: { errors: { ER1002: string; "5038": string; "6027": string; "6028": string; }; }; }; breakPointMaxWidth: string; }; fileUploadLabel: { fileUpload: string; allowedFileSize1: string; allowedFileSize2: string; allowedFileFormat: string; /** * Emits downloadSelectedFile event. * @memberof FileUploadComponent */ browseFiles: string; uploadProgress: string; upload: string; mb: string; uploadFor: string; uploadErrorMsg: string; of: string; filesUploaded: string; fileAlreadyExists: string; }; fileUploadAriaLabel: { fileUpload: string; browseFiles: string; fileUploadIcon: string; removeFileIcon: string; deleteFileIcon: string; fileDownload: string; fileUploadInput: string; }; fileUploadIconUrl: { fileUploadIcon: string; fileRemoveIcon: string; deleteIcon: string; }; fileUploadBtn: { id: number; ariaLabel: string; iconURL: string; toolTip: string; disabled: boolean; }; allowedFileTypeErrorMessage: string; maxFileSizeErrorMessage: string; allowedFileTypesAndSizeText: string; config: FieldConfig; group: FormGroup; isValidFileType: boolean; isValidFileSize: boolean; isValidMaxFileUploadLimit: boolean; selectedFiles: FileList | File | any; selectedFileNames: string; isFormField: boolean; totalSize: number; uploadedFiles: FileList | File | any; actionButtonAlign: AlignType; alignmentType: typeof AlignType; isUploadButtonDisabled: boolean; formControlName: string; isFileSelected: boolean; supportMessage: string; allowedFileTypes: AllowedFileTypes[]; isMultiFileUpload: boolean; isUploadInProgress: boolean; fileUploadHeading: string; isAllowAnyFileType: boolean; alignBrowsedFiles: AlignBrowsedFiles; isUploadButtonNeeded: boolean; maxUploadFileSize: number; private uploadedSizeValue; alignFileUploadErrorMessageTo: AlignType; maxFilesUploadedOnce: number; maxFilesUploadLimitErrorMessage: string; private _fileUploadStatus; get fileUploadStatus(): FileUploadStatus; set fileUploadStatus(value: FileUploadStatus); get uploadedSize(): number; set uploadedSize(value: number); private _fileDownloadAndDeleteConfig; set fileDownloadAndDeleteConfig(value: FileDownloadAndDeleteConfig); get fileDownloadAndDeleteConfig(): FileDownloadAndDeleteConfig; uploadSelectedFiles: EventEmitter; downloadSelectedFile: EventEmitter; apiBaseUrl: string; selectedFileNamesCount: number; constructor(formUtilityService: FormUtilityService, fileUploadService: FileUploadService); /** * Initializes component properties and retrieves configuration. * @memberof FileUploadComponent */ ngOnInit(): void; /** * Formats allowed file format and size message in required format. * @memberof FileUploadComponent */ getAllowedFileFormatSizeMessage(): void; /** * Handles the selected file(s) and emits FileUpload event emitter for uploading the file(s). * @param {(File | FileList)} file * @memberof FileUploadComponent */ getFile(file: File | FileList): void; /** * Validates the selected file(s) format and size. * @param {(File | FileList)} file * @return {boolean} * @memberof FileUploadComponent */ validateFile(file: File | FileList): boolean; /** * Initiates the file upload process for independent file upload component. * @memberof FileUploadComponent */ onUpload(): void; /** * Clears the form group control value of type input and resets other file upload properties. * @memberof FileUploadComponent */ resetUpload(): void; /** * Removes the selected file from the uploaded files list. * @param {number} index * @memberof FileUploadComponent */ onDeleteFile(file: File, index: number): void; /** * For tab key keydown event it passes event and restricts other keys from keyboard. * @param {KeyboardEvent} event -Keydown event object. * @memberof FileUploadComponent */ onKeyDown(event: KeyboardEvent): void; /** * Emits downloadSelectedFile event. * @memberof FileUploadComponent */ downloadFile(file: File | DownloadAttachment): void; /** * Returns unique identifier for the file list. * @param {number} index * @return {(number | string)} * @memberof FileUploadComponent */ trackByFn(index: number): number | string; /** * Triggers and opens the file browse window when the Browse button is clicked. * @memberof FileUploadComponent */ fileClick(): void; /** * Returns the failed file names with comma separation. * @param {string[]} fileNames * @return {*} {string} * @memberof FileUploadComponent */ displayFileNames(fileNames: string[]): string; /** * Removes the unselected file from the browsed or selected files and emits uploadSelectedFiles event with the selected files. * @param {number} index * @memberof FileUploadComponent */ removeFile(index: number): void; /** * Enables or disables the file upload button. * @param {boolean} enable * @memberof FileUploadComponent */ canEnableUploadButton(enable: boolean): void; /** * Based on isMultiFileUpload flag return files to download. * @memberof FileUploadComponent */ getFilesToDownload(): DownloadAttachment[]; /** * TrackByFunction is called for each file in the collection and return a unique identifier for that file. * @param {number} index * @param {File} file * @return {File} * @memberof FileUploadComponent */ trackByFunc(index: number, file: File): File; /** * Sets empty value to file form control once it is clicked. * @param {Event} event * @memberof FileUploadComponent */ setEmptyValue(event: Event): void; /** * Removes the file from selectedFiles once the file uploaded successfully to AWS S3. * @param {File} file * @memberof FileUploadComponent */ removeSelectedFileInUploadedFiles(fileName: string): void; /** * Returns the count of files selected for the upload. * @return {number} * @memberof FileUploadComponent */ getSelectedFileCount(): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }