@taiga-ui/kit
Version:
Taiga UI Angular main components kit
56 lines (55 loc) • 3.2 kB
TypeScript
import { ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
import { NgControl } from '@angular/forms';
import { AbstractTuiNullableControl, TuiFocusableElementAccessor, TuiNativeFocusableElement } from '@taiga-ui/cdk';
import { TuiBrightness, TuiSizeL } from '@taiga-ui/core';
import { TuiFileLike } from '@taiga-ui/kit/interfaces';
import { PolymorpheusContent } from '@tinkoff/ng-polymorpheus';
import { Observable } from 'rxjs';
export declare class TuiInputFileComponent extends AbstractTuiNullableControl<TuiFileLike | ReadonlyArray<TuiFileLike>> implements TuiFocusableElementAccessor {
readonly isMobile: boolean;
readonly inputFileTexts$: Observable<Record<'defaultLabelSingle' | 'defaultLabelMultiple' | 'defaultLinkSingle' | 'defaultLinkMultiple' | 'maxSizeRejectionReason' | 'formatRejectionReason' | 'drop' | 'dropMultiple', string>>;
readonly mode$: Observable<TuiBrightness | null>;
readonly units$: Observable<[string, string, string]>;
link: PolymorpheusContent;
label: PolymorpheusContent;
accept: string;
multiple: boolean;
size: TuiSizeL;
showSize: boolean;
maxFileSize: number;
loadingFiles: ReadonlyArray<TuiFileLike>;
rejectedFiles: ReadonlyArray<TuiFileLike>;
rejectedFilesChange: EventEmitter<readonly TuiFileLike[]>;
readonly input?: ElementRef<HTMLInputElement>;
private dataTransfer;
constructor(control: NgControl | null, changeDetectorRef: ChangeDetectorRef, isMobile: boolean, inputFileTexts$: Observable<Record<'defaultLabelSingle' | 'defaultLabelMultiple' | 'defaultLinkSingle' | 'defaultLinkMultiple' | 'maxSizeRejectionReason' | 'formatRejectionReason' | 'drop' | 'dropMultiple', string>>, mode$: Observable<TuiBrightness | null>, units$: Observable<[string, string, string]>);
get nativeFocusableElement(): TuiNativeFocusableElement | null;
get focused(): boolean;
get allowDelete(): boolean;
get computedLink$(): Observable<PolymorpheusContent>;
get computedLabel$(): Observable<PolymorpheusContent>;
get fileDragged(): boolean;
get acceptArray(): readonly string[];
get arrayValue(): ReadonlyArray<TuiFileLike>;
get readyFiles(): ReadonlyArray<TuiFileLike>;
get computedLoading(): ReadonlyArray<TuiFileLike>;
get hasFiles(): boolean;
onHovered(hovered: boolean): void;
onFocused(focused: boolean): void;
onPressed(pressed: boolean): void;
onFilesSelected(input: HTMLInputElement, texts: Record<'maxSizeRejectionReason' | 'formatRejectionReason', string>, units: [string, string, string]): void;
onDropped(event: DataTransfer, texts: Record<'maxSizeRejectionReason' | 'formatRejectionReason', string>, units: [string, string, string]): void;
onDragOver(dataTransfer: DataTransfer | null): void;
removeFile(removedFile: TuiFileLike): void;
removeRejectedFile(removedFile: TuiFileLike): void;
getAppearance(mode: null | unknown): string;
private computeLink$;
private computeLabel$;
private getValueArray;
private getReadyFiles;
private getLoadingFiles;
private getAcceptArray;
private processSelectedFiles;
private isFormatAcceptable;
private updateRejectedFiles;
}