@asi-ngtools/lib
Version:
This project is a little components library, simple to use, which will help you to simplify your project.
50 lines (49 loc) • 1.91 kB
TypeScript
import { AsiMimeType } from './asi-file-chooser-constants';
import { SafeResourceUrl } from '@angular/platform-browser';
import { DefaultControlValueAccessor } from './../common/default-control-value-accessor';
import { EventEmitter, OnChanges, OnInit, ElementRef, Renderer2 } from '@angular/core';
import { AsiFileService } from './../../services/asi-file.service';
export declare class AsiFileChooserComponent extends DefaultControlValueAccessor implements OnChanges, OnInit {
private fileService;
private renderer;
private elementRef;
/** html id */
id: string;
/** html name */
name: string;
/** Label to display (is translated) */
label: string;
/** Label position */
labelPosition: 'top' | 'left' | 'right' | 'bottom' | 'bottom-center' | 'top-center';
/** Preload filechooser with an url */
fileSrc: string;
/** Allow you to force the name of the file */
fileName: string;
/** Liste of mimetype : "application/pdf" used to display a correct selection view */
accept: Array<AsiMimeType> | AsiMimeType;
/** By default we dont block the file is the user select a wrong type */
blockImport: boolean;
/** Icon to display */
icon: string;
/** Event emitted when an error occured with the selected file */
onError: EventEmitter<any>;
acceptAttribute: string;
fileInput: any;
dragging: boolean;
loaded: boolean;
fileLoaded: boolean;
file: File;
constructor(fileService: AsiFileService, renderer: Renderer2, elementRef: ElementRef);
ngOnInit(): void;
ngOnChanges(): void;
openFileInput(): void;
getFileUrl(): SafeResourceUrl;
clean(): void;
handleDragEnter(): void;
handleDragLeave(): void;
handleDrop(e: Event): void;
handleFileLoad(): void;
handleInputChange(event: any): void;
downloadForIE(): void;
private isValideMimeType(mimeType);
}