UNPKG

@ngx-file-upload/ui

Version:

Angular 16 file upload components for @ngx-file-upload/core

65 lines (64 loc) 2.49 kB
import { TemplateRef, OnDestroy, AfterViewInit, OnInit } from "@angular/core"; import { NgxFileUploadState, NgxFileUploadControl, INgxFileUploadRequestData, INgxFileUploadRequest } from "@ngx-file-upload/core"; import { NgxFileUploadUiI18nProvider, NgxFileUploadUiI18nItem } from "../../i18n"; import * as i0 from "@angular/core"; export interface FileUploadItemContext { data: INgxFileUploadRequestData; ctrl: NgxFileUploadControl; } /** * view for upload */ export declare class UploadItemComponent implements AfterViewInit, OnInit, OnDestroy { private i18nProvider; uploadState: typeof NgxFileUploadState; /** * template context which is bound to rendered template */ context: FileUploadItemContext | undefined; /** * file upload which should bound to this view */ private fileUpload; /** * save subscription here, since we have only 1 sub * i think takeUntil and Subject will be to much so we could * unsubscribe directly */ private destroyed; i18n: NgxFileUploadUiI18nItem | undefined; /** * set template which should be used for upload items, if no TemplateRef is passed * it will fallback to [defaultUploadItem]{@link #template} */ itemTpl: TemplateRef<FileUploadItemContext> | undefined; set template(tpl: TemplateRef<FileUploadItemContext>); /** * sets upload we want to bind with current view */ set upload(request: INgxFileUploadRequest); constructor(i18nProvider: NgxFileUploadUiI18nProvider); /** * ensure all click events will canceled * so we dont affect anything other */ onItemClick(event: MouseEvent): void; /** * register on upload change event to get current informations from upload * and pass to template context to render them * * @inheritdoc */ ngAfterViewInit(): void; ngOnInit(): void; /** * if component gets destroyed remove change subscription */ ngOnDestroy(): void; /** * just to disable sort for keyvalue pipe */ returnZero(): number; static ɵfac: i0.ɵɵFactoryDeclaration<UploadItemComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<UploadItemComponent, "ngx-file-upload-ui--item", never, { "template": { "alias": "template"; "required": false; }; "upload": { "alias": "upload"; "required": false; }; }, {}, never, never, false, never>; }