@bnsights/bbsf-controls 1.0.175 → 1.0.177
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 +6 -1
- package/esm2022/lib/Shared/Models/FileDTO.mjs +2 -1
- package/esm2022/lib/controls/FileUpload/FileUpload.component.mjs +1048 -0
- package/esm2022/lib/controls/Repeater/repeater-field-builder/repeater-field-builder.component.mjs +2 -2
- package/esm2022/lib/controls/bbsf-controls.module.mjs +5 -3
- package/esm2022/public-api.mjs +2 -2
- package/fesm2022/bnsights-bbsf-controls.mjs +909 -446
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/Shared/Models/FileDTO.d.ts +1 -0
- package/lib/controls/FileUpload/FileUpload.component.d.ts +162 -0
- package/lib/controls/bbsf-controls.module.d.ts +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -1
- package/esm2022/lib/controls/FileUplaod/FileUplaod.component.mjs +0 -588
- package/lib/controls/FileUplaod/FileUplaod.component.d.ts +0 -62
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { OnInit, AfterViewInit, OnDestroy, ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormGroup, AbstractControl, ControlContainer, FormGroupDirective, ValidatorFn } from '@angular/forms';
|
|
3
|
+
import { FileUploadOptions } from '../../Shared/Models/FileUploadOptions';
|
|
4
|
+
import { ControlUtility } from '../../Shared/services/ControlUtility';
|
|
5
|
+
import { FileUploader, FileLikeObject, FileItem } from 'ng2-file-upload';
|
|
6
|
+
import { FileUploadModel } from '../../Shared/Models/FileUploadModel';
|
|
7
|
+
import { MultipleFileUploadModel } from '../../Shared/Models/MultipleFileUploadModel';
|
|
8
|
+
import { ControlValidationService, UtilityService } from '@bnsights/bbsf-utilities';
|
|
9
|
+
import { GlobalSettings } from '../../Shared/services/GlobalSettings.service';
|
|
10
|
+
import { FileDTO } from '../../Shared/Models/FileDTO';
|
|
11
|
+
import { FileUploadService } from '../../Shared/services/file-upload.service';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
14
|
+
private controlContainer;
|
|
15
|
+
multipleFileUploadControlHost: FormGroupDirective;
|
|
16
|
+
private controlUtility;
|
|
17
|
+
utilityService: UtilityService;
|
|
18
|
+
private controlValidationService;
|
|
19
|
+
private globalSettings;
|
|
20
|
+
private fileUploadService;
|
|
21
|
+
private static controlContainerStatic;
|
|
22
|
+
private readonly BYTES_TO_MB;
|
|
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>;
|
|
29
|
+
isSubmitted: boolean;
|
|
30
|
+
group: FormGroup;
|
|
31
|
+
options: FileUploadOptions;
|
|
32
|
+
OnChange: EventEmitter<any>;
|
|
33
|
+
isUploadComplete: EventEmitter<boolean>;
|
|
34
|
+
fileUploadFormControl: AbstractControl;
|
|
35
|
+
validationMessage: string;
|
|
36
|
+
validationCountMessage: string;
|
|
37
|
+
uploader: FileUploader;
|
|
38
|
+
hasAnotherDropZoneOver: boolean;
|
|
39
|
+
acceptedType: string;
|
|
40
|
+
acceptedTypeArray: string[];
|
|
41
|
+
toolTipTypeArray: string[];
|
|
42
|
+
fileLikeObject: FileLikeObject;
|
|
43
|
+
markAllAsTouched: boolean;
|
|
44
|
+
validationRules: ValidatorFn[];
|
|
45
|
+
validationRulesAsync: ValidatorFn[];
|
|
46
|
+
fileUploadModel: FileUploadModel;
|
|
47
|
+
multipleFileUploadModel: MultipleFileUploadModel;
|
|
48
|
+
file: FileDTO | null;
|
|
49
|
+
deletedFiles: FileDTO[];
|
|
50
|
+
private subscriptions;
|
|
51
|
+
constructor(controlContainer: ControlContainer, multipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, utilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
52
|
+
private initializeUploader;
|
|
53
|
+
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
|
+
ngAfterViewInit(): void;
|
|
71
|
+
private applyAttributes;
|
|
72
|
+
resetError: () => void;
|
|
73
|
+
showGlobalError(): void;
|
|
74
|
+
getErrorValidation(errorList: any): string;
|
|
75
|
+
fileOverAnother(event: any): void;
|
|
76
|
+
isHideInput(): boolean;
|
|
77
|
+
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
|
+
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
|
+
removeRequiredValidation: () => void;
|
|
132
|
+
addRequiredValidation: () => void;
|
|
133
|
+
removeCustomValidation: (customValidation: any) => void;
|
|
134
|
+
addCustomValidation: (customValidation: any) => void;
|
|
135
|
+
isValid: () => boolean;
|
|
136
|
+
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
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null]>;
|
|
161
|
+
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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IConfig } from 'ngx-mask';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "./DateTimePicker/DateTimePicker.component";
|
|
4
|
-
import * as i2 from "./
|
|
4
|
+
import * as i2 from "./FileUpload/FileUpload.component";
|
|
5
5
|
import * as i3 from "./MultiLingualTextBox/MultiLingualTextBox.component";
|
|
6
6
|
import * as i4 from "./TextBox/TextBox.component";
|
|
7
7
|
import * as i5 from "./TextArea/TextArea.component";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnsights/bbsf-controls",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.177",
|
|
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.62",
|
|
17
17
|
"@danielmoncada/angular-datetime-picker": "^17.0.0",
|
|
18
18
|
"@fullcalendar/angular": "^6.1.10",
|
|
19
19
|
"@fullcalendar/core": "^6.1.10",
|
package/public-api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './lib/controls/bbsf-controls.module';
|
|
2
2
|
export * from './lib/controls/TextBox/TextBox.component';
|
|
3
3
|
export * from './lib/controls/DateTimePicker/DateTimePicker.component';
|
|
4
|
-
export * from './lib/controls/
|
|
4
|
+
export * from './lib/controls/FileUpload/FileUpload.component';
|
|
5
5
|
export * from './lib/controls/MultiLingualTextBox/MultiLingualTextBox.component';
|
|
6
6
|
export * from './lib/controls/TextArea/TextArea.component';
|
|
7
7
|
export * from './lib/controls/MultiLingualTextArea/MultiLingualTextArea.component';
|