cfc-ds
Version:
Design System do Conselho Federal de Contabilidade baseado no govbr-ds
65 lines (64 loc) • 2.45 kB
TypeScript
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
import * as i0 from "@angular/core";
export interface UploadConfig {
id: string;
label?: string;
multiple: boolean;
acceptedFileTypes?: string[];
maxFileSize?: number;
helperText?: string;
required?: boolean;
maxFiles?: number;
disabled?: boolean;
showFileList?: boolean;
messages?: {
success?: string;
error?: string;
fileTypeError?: string;
fileSizeError?: string;
maxFilesError?: string;
};
}
export interface SavedFile {
id: string | number;
name: string;
size?: string | number;
url?: string;
text?: string;
}
export declare class UploadComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
config: UploadConfig;
files: SavedFile[];
showDownloadButton: boolean;
showRemoveButton: boolean;
filesChanged: EventEmitter<File[]>;
fileDownload: EventEmitter<SavedFile>;
fileRemove: EventEmitter<SavedFile>;
get showDefaultActions(): boolean;
uploadRoot: ElementRef<HTMLElement>;
fileInput: ElementRef<HTMLInputElement>;
customActionsTemplate: TemplateRef<any>;
private brUploadInstance;
private loadInterval;
private loadTimeout;
private inputChangeTimeout;
private onInputChange;
get acceptedFileTypesString(): string;
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
onDownload(file: SavedFile): void;
onRemove(file: SavedFile): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
private getCore;
private ensureCoreLoaded;
private clearLoadTimer;
private clearInputChangeTimeout;
private initializeUpload;
private uploadTimeout;
private bindInputEvents;
private emitFiles;
private destroyUpload;
static ɵfac: i0.ɵɵFactoryDeclaration<UploadComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<UploadComponent, "cfc-upload", never, { "config": { "alias": "config"; "required": false; }; "files": { "alias": "files"; "required": false; }; "showDownloadButton": { "alias": "showDownloadButton"; "required": false; }; "showRemoveButton": { "alias": "showRemoveButton"; "required": false; }; }, { "filesChanged": "filesChanged"; "fileDownload": "fileDownload"; "fileRemove": "fileRemove"; }, ["customActionsTemplate"], never, false, never>;
}