@bnsights/bbsf-controls 1.2.26 → 1.2.27
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 +8 -0
- package/fesm2022/bnsights-bbsf-controls.mjs +208 -101
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/Shared/Models/FileUploadCropperOptions.d.ts +18 -0
- package/lib/Shared/Models/FileUploadOptions.d.ts +3 -0
- package/lib/Shared/Models/index.d.ts +1 -0
- package/lib/controls/FileUpload/FileUpload.component.d.ts +11 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class FileUploadCropperPreset {
|
|
2
|
+
aspectRatio: number;
|
|
3
|
+
cropperStaticWidth: number;
|
|
4
|
+
cropperStaticHeight: number;
|
|
5
|
+
constructor(aspectRatio: number, cropperStaticWidth: number, cropperStaticHeight: number);
|
|
6
|
+
}
|
|
7
|
+
export declare class FileUploadCropperOptions {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
orientationControlName?: string;
|
|
10
|
+
defaultIsHorizontal: boolean;
|
|
11
|
+
modalSize: 'sm' | 'lg' | 'xl';
|
|
12
|
+
backdrop: boolean | 'static';
|
|
13
|
+
maintainAspectRatio: boolean;
|
|
14
|
+
onlyScaleDown: boolean;
|
|
15
|
+
cancelBehavior: 'clear' | 'keep';
|
|
16
|
+
horizontal: FileUploadCropperPreset;
|
|
17
|
+
vertical: FileUploadCropperPreset;
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileType } from '../Enums/FileType';
|
|
2
2
|
import { ControlOptionsBase } from './ControlOptionsBase';
|
|
3
|
+
import { FileUploadCropperOptions } from './FileUploadCropperOptions';
|
|
3
4
|
export declare class FileUploadOptions extends ControlOptionsBase {
|
|
4
5
|
value: any;
|
|
5
6
|
/** Ability to set FileInput required */
|
|
@@ -32,4 +33,6 @@ export declare class FileUploadOptions extends ControlOptionsBase {
|
|
|
32
33
|
maxSumFilesSizeLbl?: string;
|
|
33
34
|
/** Label before the max file count; overrides "MaxFileCountValidationKey" text when set. */
|
|
34
35
|
maxFileCountLbl?: string;
|
|
36
|
+
/** Optional image cropper configuration for single-file, non-async uploads. */
|
|
37
|
+
cropperOptions?: FileUploadCropperOptions;
|
|
35
38
|
}
|
|
@@ -19,6 +19,7 @@ export * from './EditPersonalImage';
|
|
|
19
19
|
export * from './EnglishArabicDTO';
|
|
20
20
|
export * from './FileDTO';
|
|
21
21
|
export * from './FileOptions';
|
|
22
|
+
export * from './FileUploadCropperOptions';
|
|
22
23
|
export * from './FileUploadModel';
|
|
23
24
|
export * from './FileUploadOptions';
|
|
24
25
|
export * from './filter-options';
|
|
@@ -2,6 +2,7 @@ import { OnInit, AfterViewInit, ElementRef, EventEmitter, OnDestroy } from '@ang
|
|
|
2
2
|
import { FormGroup, AbstractControl, ControlContainer, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { FileUploader, FileLikeObject, FileItem } from 'ng2-file-upload';
|
|
4
4
|
import { ControlValidationService, UtilityService } from '@bnsights/bbsf-utilities/ui';
|
|
5
|
+
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
5
6
|
import { FileDTO, FileUploadModel, FileUploadOptions, MultipleFileUploadModel } from '../../Shared/Models';
|
|
6
7
|
import { ControlUtility, FileUploadService, GlobalSettings } from '../../Shared/services';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
@@ -13,6 +14,7 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
13
14
|
private controlValidationService;
|
|
14
15
|
private globalSettings;
|
|
15
16
|
private fileUploadService;
|
|
17
|
+
private modalService;
|
|
16
18
|
static controlContainerStatic: any;
|
|
17
19
|
fileInput: ElementRef;
|
|
18
20
|
isSubmitted: boolean;
|
|
@@ -41,7 +43,7 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
41
43
|
maxFilesValidationMsg: string;
|
|
42
44
|
headerLabel: string;
|
|
43
45
|
dropHeaderLabel: string;
|
|
44
|
-
constructor(controlContainer: ControlContainer, MultipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
46
|
+
constructor(controlContainer: ControlContainer, MultipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService, modalService: NgbModal);
|
|
45
47
|
ngOnInit(): void;
|
|
46
48
|
ngAfterViewInit(): void;
|
|
47
49
|
resetError: () => void;
|
|
@@ -50,6 +52,13 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
50
52
|
fileOverAnother(event: any): void;
|
|
51
53
|
isHideInput(): boolean;
|
|
52
54
|
onFileChange(): void;
|
|
55
|
+
private applySingleFileUpload;
|
|
56
|
+
private shouldCropAddedFile;
|
|
57
|
+
private resolveCropperOptions;
|
|
58
|
+
private resolveCropperOrientation;
|
|
59
|
+
private readCroppedFile;
|
|
60
|
+
private commitSingleFileUpload;
|
|
61
|
+
private clearSingleFileUpload;
|
|
53
62
|
removeFromControlValue(item: FileItem): void;
|
|
54
63
|
removeRequiredValidation: () => void;
|
|
55
64
|
addRequiredValidation: () => void;
|
|
@@ -66,6 +75,6 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
66
75
|
private isFileTypeAccepted;
|
|
67
76
|
private setValuePreservingErrors;
|
|
68
77
|
private emitPatchedChange;
|
|
69
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null]>;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null, null]>;
|
|
70
79
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "BBSF-FileUpload", never, { "group": { "alias": "group"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "OnChange": "OnChange"; "isUploadComplete": "isUploadComplete"; }, never, never, true, never>;
|
|
71
80
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './lib/Shared/Models/CustomValidation';
|
|
|
58
58
|
export * from './lib/Shared/Models/DatePickerOptions';
|
|
59
59
|
export * from './lib/Shared/Models/TextBoxOptions';
|
|
60
60
|
export * from './lib/Shared/Models/FileUploadOptions';
|
|
61
|
+
export * from './lib/Shared/Models/FileUploadCropperOptions';
|
|
61
62
|
export * from './lib/Shared/Models/FileUploadModel';
|
|
62
63
|
export * from './lib/Shared/Models/MultipleFileUploadModel';
|
|
63
64
|
export * from './lib/Shared/Models/MultiLingualTextBoxOptions';
|