UNPKG

@progress/kendo-angular-upload

Version:

Kendo UI Angular Upload Component

53 lines (52 loc) 2.4 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component } from '@angular/core'; import { UploadService } from '../upload.service'; import { fileHasValidationErrors, filesHaveValidationErrors, getTotalFilesSizeMessage } from '../common/util'; import * as i0 from "@angular/core"; import * as i1 from "../upload.service"; /** * @hidden */ export class FileListItemBase { uploadService; progressComplete = 0; localization; uploadProgressSubscription; constructor(uploadService) { this.uploadService = uploadService; } subscribeUploadProgress(uploadProgressHandler) { this.uploadProgressSubscription = this.uploadService.uploadProgressEvent.subscribe(uploadProgressHandler); } fileHasValidationErrors(file) { return fileHasValidationErrors(file); } filesHaveValidationErrors(files) { return filesHaveValidationErrors(files); } ngOnDestroy() { this.uploadProgressSubscription.unsubscribe(); } getFileValidationMessage(file) { let validationMessage; if (file.validationErrors && file.validationErrors.length > 0) { validationMessage = this.localization.get(file.validationErrors[0]); } return validationMessage; } getTotalFilesSizeMessage(files) { return getTotalFilesSizeMessage(files); } textFor(key) { return this.localization.get(key); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileListItemBase, deps: [{ token: i1.UploadService }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileListItemBase, selector: "ng-component", ngImport: i0, template: '', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileListItemBase, decorators: [{ type: Component, args: [{ template: '' }] }], ctorParameters: function () { return [{ type: i1.UploadService }]; } });