UNPKG

@tapsellorg/angular-material-library

Version:

Angular library for Tapsell

80 lines (79 loc) 5.14 kB
import { ChangeDetectorRef, ElementRef, OnDestroy } from '@angular/core'; import { ControlValueAccessor, NgControl } from '@angular/forms'; import { MatFormField } from '@angular/material/form-field'; import { Subject } from 'rxjs'; import { FocusMonitor } from '@angular/cdk/a11y'; import { PghDragDropFileComponent } from '../drag-drop-file/drag-drop-file.component'; import { ThemePalette } from '@angular/material/core'; import { PghLoader } from '@tapsellorg/angular-material-library/src/lib/loader'; import { PghConfirmDialogComponent, PghDialogData } from '@tapsellorg/angular-material-library/confirm-dialog'; import { MatDialog } from '@angular/material/dialog'; import { PghValidationFileInput } from '../drag-drop.model'; import * as i0 from "@angular/core"; declare const PghFileInputComponent_base: (new (...args: any[]) => { _destroyed$: Subject<unknown>; ngOnDestroy(): void; }) & (new (...args: any[]) => {}); export declare class PghFileInputComponent extends PghFileInputComponent_base implements ControlValueAccessor, OnDestroy { private confirmDialog; private changeDetectorRef; private _elementRef; private cdkFocusMonitor; ngControl: NgControl | null; private _formField?; static nextId: number; id: string; placeholder: import("@angular/core").InputSignal<string>; color: import("@angular/core").InputSignal<ThemePalette>; hasPreviewPicture: import("@angular/core").InputSignal<boolean>; loader: import("@angular/core").InputSignal<PghLoader | undefined>; disableDeleteButton: import("@angular/core").InputSignal<boolean>; showDeleteConfirmDialog: import("@angular/core").InputSignal<boolean>; deleteFileDialogConfig: import("@angular/core").InputSignal<PghDialogData>; filename: import("@angular/core").InputSignal<string>; dragDropFileComponent?: PghDragDropFileComponent; canReUploadFile: import("@angular/core").InputSignal<boolean>; afterFileRemovedEmitter: Subject<void>; afterFileRemoved: import("@angular/core").OutputRef<void>; afterFileChangedEmitter: Subject<any>; afterFileChanged: import("@angular/core").OutputRef<any>; validation: import("@angular/core").InputSignal<PghValidationFileInput>; controlOnTouch: import("@angular/core").WritableSignal<() => void>; stateChanges: Subject<void>; focused: boolean; shouldLabelFloat: boolean; controlType: string; private controlOnChange?; private _value; constructor(confirmDialog: MatDialog, changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, cdkFocusMonitor: FocusMonitor, ngControl: NgControl | null, _formField?: MatFormField | undefined); fileChange(files: File[]): void; deleteFileConfirmDialog(): void; deleteFile(): void; setConfigOfDeleteFileConfirmDialog(): import("@angular/material/dialog.d-B5HZULyo").M<PghConfirmDialogComponent, any>; downloadFile(): void; /** This method makes sure that the contents of the variable (in here it's this.value) * which gets filled by selecting a file or patching/setting the formControl * will always have both **fileUrl (Base64)** and **file (File)**. In other words, if a field is missing, it will be computed based on the other field. */ writeValue(newValue: Partial<PghFile> | File | Blob | string | null | undefined): void; private writeValueFromObject; private valueIsPartialPghFile; private valueIsUrl; registerOnChange(fn: (newValue: any) => void): void; registerOnTouched(fn: () => void): void; get value(): PghFile | null; set value(value: PghFile | null); ngOnDestroy(): void; get empty(): boolean; get errorState(): boolean; describedBy: string; setDescribedByIds(ids: string[]): void; onContainerClick(_event: MouseEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration<PghFileInputComponent, [null, null, null, null, { optional: true; self: true; }, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration<PghFileInputComponent, "pgh-file-input", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "hasPreviewPicture": { "alias": "hasPreviewPicture"; "required": false; "isSignal": true; }; "loader": { "alias": "loader"; "required": false; "isSignal": true; }; "disableDeleteButton": { "alias": "disableDeleteButton"; "required": false; "isSignal": true; }; "showDeleteConfirmDialog": { "alias": "showDeleteConfirmDialog"; "required": false; "isSignal": true; }; "deleteFileDialogConfig": { "alias": "deleteFileDialogConfig"; "required": false; "isSignal": true; }; "filename": { "alias": "filename"; "required": false; "isSignal": true; }; "canReUploadFile": { "alias": "canReUploadFile"; "required": false; "isSignal": true; }; "validation": { "alias": "validation"; "required": false; "isSignal": true; }; }, { "afterFileRemoved": "afterFileRemoved"; "afterFileChanged": "afterFileChanged"; }, never, ["[pgh-file-preview]", "[pgh-file-preview]"], false, never>; } interface PghFile { fileUrl: string; file: File; } export {};