@bnsights/bbsf-controls 1.0.179 → 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 +2 -3
- package/esm2022/lib/controls/FileUpload/FileUpload.component.mjs +439 -1091
- package/fesm2022/bnsights-bbsf-controls.mjs +441 -1093
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/controls/FileUpload/FileUpload.component.d.ts +14 -123
- package/package.json +2 -2
|
@@ -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,28 +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
|
-
private hasClearedRequiredError;
|
|
29
|
-
fileInput: ElementRef<HTMLInputElement>;
|
|
21
|
+
static controlContainerstatic: any;
|
|
22
|
+
fileInput: ElementRef;
|
|
30
23
|
isSubmitted: boolean;
|
|
31
24
|
group: FormGroup;
|
|
32
25
|
options: FileUploadOptions;
|
|
33
26
|
OnChange: EventEmitter<any>;
|
|
34
|
-
isUploadComplete: EventEmitter<
|
|
27
|
+
isUploadComplete: EventEmitter<any>;
|
|
35
28
|
fileUploadFormControl: AbstractControl;
|
|
36
29
|
validationMessage: string;
|
|
37
30
|
validationCountMessage: string;
|
|
@@ -42,130 +35,28 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
42
35
|
toolTipTypeArray: string[];
|
|
43
36
|
fileLikeObject: FileLikeObject;
|
|
44
37
|
markAllAsTouched: boolean;
|
|
45
|
-
validationRules:
|
|
46
|
-
|
|
38
|
+
validationRules: any[];
|
|
39
|
+
validationRulesasync: any[];
|
|
47
40
|
fileUploadModel: FileUploadModel;
|
|
48
41
|
multipleFileUploadModel: MultipleFileUploadModel;
|
|
49
|
-
file:
|
|
42
|
+
file: any;
|
|
50
43
|
deletedFiles: FileDTO[];
|
|
51
|
-
|
|
52
|
-
constructor(controlContainer: ControlContainer, multipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, utilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
53
|
-
private initializeUploader;
|
|
44
|
+
constructor(controlContainer: ControlContainer, MultipleFileUplaodControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
54
45
|
ngOnInit(): void;
|
|
55
|
-
private initializeModels;
|
|
56
|
-
private setViewType;
|
|
57
|
-
private processInitialValue;
|
|
58
|
-
private processMultipleFileValue;
|
|
59
|
-
private processSingleFileValue;
|
|
60
|
-
private createFileLikeObject;
|
|
61
|
-
private setupLabels;
|
|
62
|
-
private setupFileTypeValidation;
|
|
63
|
-
private processAcceptedTypes;
|
|
64
|
-
private getMimeTypeMap;
|
|
65
|
-
private buildValidationMessage;
|
|
66
|
-
private setupFormControl;
|
|
67
|
-
private setupValidators;
|
|
68
|
-
private setupCountMessage;
|
|
69
|
-
private applyValidatorsAndState;
|
|
70
|
-
private setupSubscriptions;
|
|
71
46
|
ngAfterViewInit(): void;
|
|
72
|
-
private applyAttributes;
|
|
73
47
|
resetError: () => void;
|
|
74
48
|
showGlobalError(): void;
|
|
75
|
-
getErrorValidation(
|
|
49
|
+
getErrorValidation(ErrorList: any): string;
|
|
76
50
|
fileOverAnother(event: any): void;
|
|
77
51
|
isHideInput(): boolean;
|
|
78
52
|
onFileChange(): void;
|
|
79
|
-
private processNewlyAddedFiles;
|
|
80
|
-
private getNewlyAddedFiles;
|
|
81
|
-
private validateFilesInQueue;
|
|
82
|
-
private validateSingleFile;
|
|
83
|
-
private createFileSizeErrorMessage;
|
|
84
|
-
private createFileTypeErrorMessage;
|
|
85
|
-
private createDuplicateFileErrorMessage;
|
|
86
|
-
private handleFileValidationResults;
|
|
87
|
-
private processValidFilesForUpload;
|
|
88
|
-
private shouldUseAsyncUpload;
|
|
89
|
-
private validateFileConstraints;
|
|
90
|
-
private validateMinFileCount;
|
|
91
|
-
private validateMaxFileCount;
|
|
92
|
-
private showFileCountError;
|
|
93
|
-
private forceValidationErrorDisplay;
|
|
94
|
-
private clearFileCountError;
|
|
95
|
-
private validateTotalFileSize;
|
|
96
|
-
private showTotalSizeError;
|
|
97
|
-
private validateFileSize;
|
|
98
|
-
private validateFileType;
|
|
99
|
-
private validateIndividualFileSize;
|
|
100
|
-
private validateIndividualFileType;
|
|
101
|
-
private validateDuplicateFileName;
|
|
102
|
-
private removeInvalidFiles;
|
|
103
|
-
private showValidationErrors;
|
|
104
|
-
private setValidationError;
|
|
105
|
-
private clearInvalidFilesError;
|
|
106
|
-
private setFormControlError;
|
|
107
|
-
private handleAsyncFileUpload;
|
|
108
|
-
private handleUploadProgress;
|
|
109
|
-
private handleUploadComplete;
|
|
110
|
-
private updateElementWithFileInfo;
|
|
111
|
-
private createFileDTO;
|
|
112
|
-
private handleSyncFileUpload;
|
|
113
|
-
private updateQueueItemForSync;
|
|
114
|
-
private findQueueItemByFile;
|
|
115
|
-
private preserveFileReference;
|
|
116
|
-
private createSyncFileDTO;
|
|
117
|
-
private getExistingFileGUID;
|
|
118
|
-
private updateFormValue;
|
|
119
|
-
private setupMultipleFileModel;
|
|
120
|
-
private updateFormControl;
|
|
121
|
-
private preserveErrorsAndUpdateValue;
|
|
122
|
-
private hasValidFileValue;
|
|
123
|
-
private handlePatchAndEmit;
|
|
124
53
|
removeFromControlValue(item: FileItem): void;
|
|
125
|
-
private handleAsyncFileDeletion;
|
|
126
|
-
private handleSingleFileRemoval;
|
|
127
|
-
private handleMultipleFileRemoval;
|
|
128
|
-
private processFileRemovalFromExisting;
|
|
129
|
-
private resetDeletedFiles;
|
|
130
|
-
private handleExistingFileRemoval;
|
|
131
|
-
private removeFromUploadedFiles;
|
|
132
|
-
private validateRemainingFiles;
|
|
133
|
-
private reEvaluateAllValidations;
|
|
134
|
-
private clearObsoleteValidationErrors;
|
|
135
|
-
private reValidateFileCountConstraints;
|
|
136
|
-
private reValidateTotalFileSize;
|
|
137
|
-
private reValidateIndividualFiles;
|
|
138
|
-
private updateMultipleFileModel;
|
|
139
54
|
removeRequiredValidation: () => void;
|
|
140
|
-
removeRequiredValidatorOnly: () => void;
|
|
141
55
|
addRequiredValidation: () => void;
|
|
142
56
|
removeCustomValidation: (customValidation: any) => void;
|
|
143
57
|
addCustomValidation: (customValidation: any) => void;
|
|
144
|
-
isValid: () =>
|
|
58
|
+
isValid: () => void;
|
|
145
59
|
convertSizeToMB(size: number): number;
|
|
146
|
-
trackByFunction(index: number, item: FileItem): any;
|
|
147
|
-
shouldShowFileList(): boolean;
|
|
148
|
-
isDownloadEnabled(): boolean;
|
|
149
|
-
isRemoveEnabled(): boolean;
|
|
150
|
-
getFileDownloadUrl(item: FileItem): string | null;
|
|
151
|
-
private getExistingFileUrl;
|
|
152
|
-
private createFileUrl;
|
|
153
|
-
private createBlobUrlWithFilename;
|
|
154
|
-
private constructDownloadUrl;
|
|
155
|
-
getFileName(item: FileItem): string;
|
|
156
|
-
downloadFile(item: FileItem): void;
|
|
157
|
-
private prepareFileDownload;
|
|
158
|
-
private handleDownloadError;
|
|
159
|
-
private executeFileDownload;
|
|
160
|
-
private createDownloadLink;
|
|
161
|
-
private triggerDownload;
|
|
162
|
-
private cleanupBlobUrl;
|
|
163
|
-
private trackMemoryUsage;
|
|
164
|
-
private cleanupOldFiles;
|
|
165
|
-
private cleanupEventListeners;
|
|
166
|
-
private cleanupUploaderQueue;
|
|
167
|
-
ngOnDestroy(): void;
|
|
168
|
-
private checkAndClearMaxFileCountValidation;
|
|
169
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null]>;
|
|
170
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>;
|
|
171
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnsights/bbsf-controls",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.181",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^17.0.5",
|
|
6
6
|
"@angular/cdk": "^17.0.2",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@angular/google-maps": "^17.0.3",
|
|
16
|
-
"@bnsights/bbsf-utilities": "^1.0.
|
|
16
|
+
"@bnsights/bbsf-utilities": "^1.0.64",
|
|
17
17
|
"@danielmoncada/angular-datetime-picker": "^17.0.0",
|
|
18
18
|
"@fullcalendar/angular": "^6.1.10",
|
|
19
19
|
"@fullcalendar/core": "^6.1.10",
|