@bnsights/bbsf-controls 1.2.25 → 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.
@@ -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
  }
@@ -0,0 +1,33 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import { UtilityService } from '@bnsights/bbsf-utilities/ui';
4
+ import { ImageCroppedEvent, ImageTransform } from 'ngx-image-cropper';
5
+ import * as i0 from "@angular/core";
6
+ export declare class LogoCropperComponent implements OnInit {
7
+ activeModal: NgbActiveModal;
8
+ private utilityService;
9
+ imageFile: File;
10
+ isHorizontal: boolean;
11
+ aspectRatio: number;
12
+ maintainAspectRatio: boolean;
13
+ cropperStaticWidth: number;
14
+ cropperStaticHeight: number;
15
+ onlyScaleDown: boolean;
16
+ transform: ImageTransform;
17
+ croppedBlob: Blob | null;
18
+ private readonly minScale;
19
+ private readonly maxScale;
20
+ private readonly scaleStep;
21
+ constructor(activeModal: NgbActiveModal, utilityService: UtilityService);
22
+ ngOnInit(): void;
23
+ translate(key: string): string;
24
+ imageCropped(event: ImageCroppedEvent): void;
25
+ zoomIn(): void;
26
+ zoomOut(): void;
27
+ resetZoom(): void;
28
+ confirm(): void;
29
+ dismiss(): void;
30
+ private setScale;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<LogoCropperComponent, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<LogoCropperComponent, "BBSF-LogoCropper", never, { "imageFile": { "alias": "imageFile"; "required": false; }; "isHorizontal": { "alias": "isHorizontal"; "required": false; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; }; "maintainAspectRatio": { "alias": "maintainAspectRatio"; "required": false; }; "cropperStaticWidth": { "alias": "cropperStaticWidth"; "required": false; }; "cropperStaticHeight": { "alias": "cropperStaticHeight"; "required": false; }; "onlyScaleDown": { "alias": "onlyScaleDown"; "required": false; }; }, {}, never, never, true, never>;
33
+ }
@@ -9,6 +9,7 @@ import * as i7 from "@bnsights/bbsf-utilities";
9
9
  import * as i8 from "../controls/FileUpload/FileUpload.component";
10
10
  import * as i9 from "../controls/ImageUpload/ImageUpload.component";
11
11
  import * as i10 from "../controls/ProfileImageUploader/ProfileImageUploader.component";
12
+ import * as i11 from "../controls/LogoCropper/LogoCropper.component";
12
13
  /**
13
14
  * BBSF Uploads Module
14
15
  *
@@ -45,6 +46,6 @@ import * as i10 from "../controls/ProfileImageUploader/ProfileImageUploader.comp
45
46
  */
46
47
  export declare class BBSFUploadsModule {
47
48
  static ɵfac: i0.ɵɵFactoryDeclaration<BBSFUploadsModule, never>;
48
- static ɵmod: i0.ɵɵNgModuleDeclaration<BBSFUploadsModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.NgxDropzoneModule, typeof i4.AngularCropperjsModule, typeof i5.NgbModule, typeof i6.FileUploadModule, typeof i7.BBSFUtilitiesModule, typeof i8.FileUploadComponent, typeof i9.ImageUploaderComponent, typeof i10.ProfileImageUploaderComponent], [typeof i8.FileUploadComponent, typeof i9.ImageUploaderComponent, typeof i10.ProfileImageUploaderComponent]>;
49
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BBSFUploadsModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.NgxDropzoneModule, typeof i4.AngularCropperjsModule, typeof i5.NgbModule, typeof i6.FileUploadModule, typeof i7.BBSFUtilitiesModule, typeof i8.FileUploadComponent, typeof i9.ImageUploaderComponent, typeof i10.ProfileImageUploaderComponent, typeof i11.LogoCropperComponent], [typeof i8.FileUploadComponent, typeof i9.ImageUploaderComponent, typeof i10.ProfileImageUploaderComponent, typeof i11.LogoCropperComponent]>;
49
50
  static ɵinj: i0.ɵɵInjectorDeclaration<BBSFUploadsModule>;
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bnsights/bbsf-controls",
3
- "version": "1.2.25",
3
+ "version": "1.2.27",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^19.2.14",
6
6
  "@angular/cdk": "^19.2.19",
@@ -21,8 +21,8 @@
21
21
  "@fullcalendar/interaction": "6.1.19",
22
22
  "@fullcalendar/list": "6.1.19",
23
23
  "@fullcalendar/timegrid": "6.1.19",
24
- "@ng-bootstrap/ng-bootstrap": "18.0.0",
25
24
  "@kolkov/angular-editor": "3.0.0-beta.2",
25
+ "@ng-bootstrap/ng-bootstrap": "18.0.0",
26
26
  "@ng-select/ng-select": "14.9.0",
27
27
  "@ngrx/store": "19.2.1",
28
28
  "@ngrx/store-devtools": "19.2.1",
@@ -52,6 +52,7 @@
52
52
  "ng2-file-upload": "8.0.0",
53
53
  "ngx-bootstrap": "19.0.2",
54
54
  "ngx-dropzone": "3.1.0",
55
+ "ngx-image-cropper": "^9.1.6",
55
56
  "ngx-infinite-scroll": "19.0.0",
56
57
  "ngx-intl-tel-input": "17.0.0",
57
58
  "ngx-mask": "17.1.8",
package/public-api.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from './lib/controls/Toggleslide/Toggleslide.component';
24
24
  export * from './lib/controls/HtmlEditor/HtmlEditor.component';
25
25
  export * from './lib/controls/MultiLingualHtmlEditor/MultiLingualHtmlEditor.component';
26
26
  export * from './lib/controls/ImageUpload/ImageUpload.component';
27
+ export * from './lib/controls/LogoCropper/LogoCropper.component';
27
28
  export * from './lib/controls/ProfileImageUploader/ProfileImageUploader.component';
28
29
  export * from './lib/controls/Calendar/Calendar.component';
29
30
  export * from './lib/controls/MapAutoComplete/MapAutoComplete.component';
@@ -57,6 +58,7 @@ export * from './lib/Shared/Models/CustomValidation';
57
58
  export * from './lib/Shared/Models/DatePickerOptions';
58
59
  export * from './lib/Shared/Models/TextBoxOptions';
59
60
  export * from './lib/Shared/Models/FileUploadOptions';
61
+ export * from './lib/Shared/Models/FileUploadCropperOptions';
60
62
  export * from './lib/Shared/Models/FileUploadModel';
61
63
  export * from './lib/Shared/Models/MultipleFileUploadModel';
62
64
  export * from './lib/Shared/Models/MultiLingualTextBoxOptions';