@bnsights/bbsf-controls 1.0.180 → 1.0.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/esm2022/lib/controls/FileUpload/FileUpload.component.mjs +443 -949
- package/fesm2022/bnsights-bbsf-controls.mjs +442 -948
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/controls/FileUpload/FileUpload.component.d.ts +14 -114
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnInit, AfterViewInit,
|
|
2
|
-
import { FormGroup, AbstractControl, ControlContainer, FormGroupDirective
|
|
1
|
+
import { OnInit, AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormGroup, AbstractControl, ControlContainer, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { FileUploadOptions } from '../../Shared/Models/FileUploadOptions';
|
|
4
4
|
import { ControlUtility } from '../../Shared/services/ControlUtility';
|
|
5
5
|
import { FileUploader, FileLikeObject, FileItem } from 'ng2-file-upload';
|
|
@@ -10,27 +10,21 @@ import { GlobalSettings } from '../../Shared/services/GlobalSettings.service';
|
|
|
10
10
|
import { FileDTO } from '../../Shared/Models/FileDTO';
|
|
11
11
|
import { FileUploadService } from '../../Shared/services/file-upload.service';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class FileUploadComponent implements OnInit, AfterViewInit
|
|
13
|
+
export declare class FileUploadComponent implements OnInit, AfterViewInit {
|
|
14
14
|
private controlContainer;
|
|
15
|
-
|
|
15
|
+
MultipleFileUplaodControlHost: FormGroupDirective;
|
|
16
16
|
private controlUtility;
|
|
17
|
-
|
|
17
|
+
UtilityService: UtilityService;
|
|
18
18
|
private controlValidationService;
|
|
19
19
|
private globalSettings;
|
|
20
20
|
private fileUploadService;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
private readonly PROGRESS_COMPLETE;
|
|
24
|
-
private readonly PROGRESS_NEAR_COMPLETE;
|
|
25
|
-
private readonly ERROR_DISPLAY_DURATION;
|
|
26
|
-
private readonly MAX_MEMORY_USAGE;
|
|
27
|
-
private currentMemoryUsage;
|
|
28
|
-
fileInput: ElementRef<HTMLInputElement>;
|
|
21
|
+
static controlContainerstatic: any;
|
|
22
|
+
fileInput: ElementRef;
|
|
29
23
|
isSubmitted: boolean;
|
|
30
24
|
group: FormGroup;
|
|
31
25
|
options: FileUploadOptions;
|
|
32
26
|
OnChange: EventEmitter<any>;
|
|
33
|
-
isUploadComplete: EventEmitter<
|
|
27
|
+
isUploadComplete: EventEmitter<any>;
|
|
34
28
|
fileUploadFormControl: AbstractControl;
|
|
35
29
|
validationMessage: string;
|
|
36
30
|
validationCountMessage: string;
|
|
@@ -41,122 +35,28 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
41
35
|
toolTipTypeArray: string[];
|
|
42
36
|
fileLikeObject: FileLikeObject;
|
|
43
37
|
markAllAsTouched: boolean;
|
|
44
|
-
validationRules:
|
|
45
|
-
|
|
38
|
+
validationRules: any[];
|
|
39
|
+
validationRulesasync: any[];
|
|
46
40
|
fileUploadModel: FileUploadModel;
|
|
47
41
|
multipleFileUploadModel: MultipleFileUploadModel;
|
|
48
|
-
file:
|
|
42
|
+
file: any;
|
|
49
43
|
deletedFiles: FileDTO[];
|
|
50
|
-
|
|
51
|
-
constructor(controlContainer: ControlContainer, multipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, utilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
52
|
-
private initializeUploader;
|
|
44
|
+
constructor(controlContainer: ControlContainer, MultipleFileUplaodControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
53
45
|
ngOnInit(): void;
|
|
54
|
-
private initializeModels;
|
|
55
|
-
private setViewType;
|
|
56
|
-
private processInitialValue;
|
|
57
|
-
private processMultipleFileValue;
|
|
58
|
-
private processSingleFileValue;
|
|
59
|
-
private createFileLikeObject;
|
|
60
|
-
private setupLabels;
|
|
61
|
-
private setupFileTypeValidation;
|
|
62
|
-
private processAcceptedTypes;
|
|
63
|
-
private getMimeTypeMap;
|
|
64
|
-
private buildValidationMessage;
|
|
65
|
-
private setupFormControl;
|
|
66
|
-
private setupValidators;
|
|
67
|
-
private setupCountMessage;
|
|
68
|
-
private applyValidatorsAndState;
|
|
69
|
-
private setupSubscriptions;
|
|
70
46
|
ngAfterViewInit(): void;
|
|
71
|
-
private applyAttributes;
|
|
72
47
|
resetError: () => void;
|
|
73
48
|
showGlobalError(): void;
|
|
74
|
-
getErrorValidation(
|
|
49
|
+
getErrorValidation(ErrorList: any): string;
|
|
75
50
|
fileOverAnother(event: any): void;
|
|
76
51
|
isHideInput(): boolean;
|
|
77
52
|
onFileChange(): void;
|
|
78
|
-
private processNewlyAddedFiles;
|
|
79
|
-
private getNewlyAddedFiles;
|
|
80
|
-
private validateFilesInQueue;
|
|
81
|
-
private validateSingleFile;
|
|
82
|
-
private createFileSizeErrorMessage;
|
|
83
|
-
private createFileTypeErrorMessage;
|
|
84
|
-
private createDuplicateFileErrorMessage;
|
|
85
|
-
private handleFileValidationResults;
|
|
86
|
-
private processValidFilesForUpload;
|
|
87
|
-
private shouldUseAsyncUpload;
|
|
88
|
-
private validateFileConstraints;
|
|
89
|
-
private validateMinFileCount;
|
|
90
|
-
private validateMaxFileCount;
|
|
91
|
-
private showFileCountError;
|
|
92
|
-
private clearFileCountError;
|
|
93
|
-
private validateTotalFileSize;
|
|
94
|
-
private showTotalSizeError;
|
|
95
|
-
private validateFileSize;
|
|
96
|
-
private validateFileType;
|
|
97
|
-
private validateIndividualFileSize;
|
|
98
|
-
private validateIndividualFileType;
|
|
99
|
-
private validateDuplicateFileName;
|
|
100
|
-
private removeInvalidFiles;
|
|
101
|
-
private showValidationErrors;
|
|
102
|
-
private setValidationError;
|
|
103
|
-
private clearInvalidFilesError;
|
|
104
|
-
private setFormControlError;
|
|
105
|
-
private handleAsyncFileUpload;
|
|
106
|
-
private handleUploadProgress;
|
|
107
|
-
private handleUploadComplete;
|
|
108
|
-
private updateElementWithFileInfo;
|
|
109
|
-
private createFileDTO;
|
|
110
|
-
private handleSyncFileUpload;
|
|
111
|
-
private updateQueueItemForSync;
|
|
112
|
-
private findQueueItemByFile;
|
|
113
|
-
private preserveFileReference;
|
|
114
|
-
private createSyncFileDTO;
|
|
115
|
-
private getExistingFileGUID;
|
|
116
|
-
private updateFormValue;
|
|
117
|
-
private setupMultipleFileModel;
|
|
118
|
-
private updateFormControl;
|
|
119
|
-
private preserveErrorsAndUpdateValue;
|
|
120
|
-
private handlePatchAndEmit;
|
|
121
53
|
removeFromControlValue(item: FileItem): void;
|
|
122
|
-
private handleAsyncFileDeletion;
|
|
123
|
-
private handleSingleFileRemoval;
|
|
124
|
-
private handleMultipleFileRemoval;
|
|
125
|
-
private processFileRemovalFromExisting;
|
|
126
|
-
private resetDeletedFiles;
|
|
127
|
-
private handleExistingFileRemoval;
|
|
128
|
-
private removeFromUploadedFiles;
|
|
129
|
-
private validateRemainingFiles;
|
|
130
|
-
private updateMultipleFileModel;
|
|
131
54
|
removeRequiredValidation: () => void;
|
|
132
55
|
addRequiredValidation: () => void;
|
|
133
56
|
removeCustomValidation: (customValidation: any) => void;
|
|
134
57
|
addCustomValidation: (customValidation: any) => void;
|
|
135
|
-
isValid: () =>
|
|
58
|
+
isValid: () => void;
|
|
136
59
|
convertSizeToMB(size: number): number;
|
|
137
|
-
trackByFunction(index: number, item: FileItem): any;
|
|
138
|
-
shouldShowFileList(): boolean;
|
|
139
|
-
isDownloadEnabled(): boolean;
|
|
140
|
-
isRemoveEnabled(): boolean;
|
|
141
|
-
getFileDownloadUrl(item: FileItem): string | null;
|
|
142
|
-
private getExistingFileUrl;
|
|
143
|
-
private createFileUrl;
|
|
144
|
-
private createBlobUrlWithFilename;
|
|
145
|
-
private constructDownloadUrl;
|
|
146
|
-
getFileName(item: FileItem): string;
|
|
147
|
-
downloadFile(item: FileItem): void;
|
|
148
|
-
private prepareFileDownload;
|
|
149
|
-
private handleDownloadError;
|
|
150
|
-
private executeFileDownload;
|
|
151
|
-
private createDownloadLink;
|
|
152
|
-
private triggerDownload;
|
|
153
|
-
private cleanupBlobUrl;
|
|
154
|
-
private trackMemoryUsage;
|
|
155
|
-
private cleanupOldFiles;
|
|
156
|
-
private cleanupEventListeners;
|
|
157
|
-
private cleanupUploaderQueue;
|
|
158
|
-
ngOnDestroy(): void;
|
|
159
|
-
private checkAndClearMaxFileCountValidation;
|
|
160
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null]>;
|
|
161
61
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "BBSF-FileUpload", never, { "group": { "alias": "group"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "OnChange": "OnChange"; "isUploadComplete": "isUploadComplete"; }, never, never, false, never>;
|
|
162
62
|
}
|