@bnsights/bbsf-controls 1.2.25 → 1.2.26

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 CHANGED
@@ -407,6 +407,9 @@ If the issue persists, consider using a different HTML editor component that's c
407
407
  - Added explicit package exports for controls SCSS assets so Angular browser and application builders can resolve deep style imports from consuming packages.
408
408
  - Kept backward compatibility for extensionless Sass imports such as `@bnsights/bbsf-controls/src/lib/assets/sass/variables`.
409
409
  - Marked CSS, SCSS, and packaged assets as side-effectful so published global styles are preserved by consumers.
410
+ - Added `LogoCropperComponent` as a standalone upload modal component exported from `@bnsights/bbsf-controls`.
411
+ - Re-exported `LogoCropperComponent` through `BBSFUploadsModule` and the package public API.
412
+ - Added `ngx-image-cropper` dependency for logo cropping support with Angular 19-compatible peer dependencies.
410
413
 
411
414
  ## 1.2.25 / 15-06-2026
412
415
 
@@ -55,6 +55,7 @@ import { AngularCropperjsModule } from 'angular-cropperjs';
55
55
  import * as i5$2 from 'ng2-file-upload';
56
56
  import { FileUploader, FileUploadModule } from 'ng2-file-upload';
57
57
  import { takeUntil, switchMap, map, tap } from 'rxjs/operators';
58
+ import { ImageCropperComponent } from 'ngx-image-cropper';
58
59
  import * as i7$4 from '@fullcalendar/angular';
59
60
  import { FullCalendarModule } from '@fullcalendar/angular';
60
61
  import * as i8$1 from '@angular/google-maps';
@@ -8828,6 +8829,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
8828
8829
  args: ['angularCropper', { static: false }]
8829
8830
  }] } });
8830
8831
 
8832
+ class LogoCropperComponent {
8833
+ constructor(activeModal, utilityService) {
8834
+ this.activeModal = activeModal;
8835
+ this.utilityService = utilityService;
8836
+ this.isHorizontal = true;
8837
+ this.aspectRatio = 3 / 1;
8838
+ this.maintainAspectRatio = true;
8839
+ this.cropperStaticWidth = 0;
8840
+ this.cropperStaticHeight = 0;
8841
+ this.onlyScaleDown = true;
8842
+ this.transform = { scale: 1 };
8843
+ this.croppedBlob = null;
8844
+ this.minScale = 1;
8845
+ this.maxScale = 4;
8846
+ this.scaleStep = 0.1;
8847
+ }
8848
+ ngOnInit() { }
8849
+ translate(key) {
8850
+ return this.utilityService.getResourceValue(key);
8851
+ }
8852
+ imageCropped(event) {
8853
+ this.croppedBlob = event.blob ?? null;
8854
+ }
8855
+ zoomIn() {
8856
+ this.setScale((this.transform.scale ?? 1) + this.scaleStep);
8857
+ }
8858
+ zoomOut() {
8859
+ this.setScale((this.transform.scale ?? 1) - this.scaleStep);
8860
+ }
8861
+ resetZoom() {
8862
+ this.setScale(1);
8863
+ }
8864
+ confirm() {
8865
+ if (!this.croppedBlob)
8866
+ return;
8867
+ const croppedFile = new File([this.croppedBlob], this.imageFile?.name ?? 'logo.png', { type: 'image/png' });
8868
+ this.activeModal.close(croppedFile);
8869
+ }
8870
+ dismiss() {
8871
+ this.activeModal.dismiss();
8872
+ }
8873
+ setScale(scale) {
8874
+ const clamped = Math.min(this.maxScale, Math.max(this.minScale, scale));
8875
+ this.transform = { ...this.transform, scale: clamped };
8876
+ }
8877
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LogoCropperComponent, deps: [{ token: i3$2.NgbActiveModal }, { token: i3.UtilityService }], target: i0.ɵɵFactoryTarget.Component }); }
8878
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: LogoCropperComponent, isStandalone: true, selector: "BBSF-LogoCropper", inputs: { imageFile: "imageFile", isHorizontal: "isHorizontal", aspectRatio: "aspectRatio", maintainAspectRatio: "maintainAspectRatio", cropperStaticWidth: "cropperStaticWidth", cropperStaticHeight: "cropperStaticHeight", onlyScaleDown: "onlyScaleDown" }, ngImport: i0, template: "<div class=\"bbsf-logo-cropper\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">{{ translate(\"CropImage\") }}</h5>\n <button type=\"button\" class=\"btn-close\" (click)=\"dismiss()\"></button>\n </div>\n\n <div class=\"modal-body d-flex flex-column justify-content-center align-items-center py-0\" style=\"min-height: 200px;\">\n <image-cropper [class.crop-horizontal]=\"isHorizontal\" [class.crop-vertical]=\"!isHorizontal\" [imageFile]=\"imageFile\"\n [maintainAspectRatio]=\"maintainAspectRatio\" [aspectRatio]=\"aspectRatio\"\n [cropperStaticWidth]=\"cropperStaticWidth\" [cropperStaticHeight]=\"cropperStaticHeight\"\n [onlyScaleDown]=\"onlyScaleDown\" [transform]=\"transform\" format=\"png\" (imageCropped)=\"imageCropped($event)\">\n </image-cropper>\n\n <div class=\"d-flex justify-content-center align-items-center gap-2 mt-3\">\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"zoomOut()\"\n [title]=\"translate('ZoomOut')\">\n <i class=\"fa fa-search-minus\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"resetZoom()\"\n [title]=\"translate('ResetZoom')\">\n <i class=\"fa fa-undo\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"zoomIn()\" [title]=\"translate('ZoomIn')\">\n <i class=\"fa fa-search-plus\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-sm btn-light\" (click)=\"dismiss()\"> Cancel </button>\n <button type=\"button\" class=\"btn btn-sm btn-brand\" [disabled]=\"!croppedBlob\" (click)=\"confirm()\">\n {{ translate(\"Crop\") }}\n </button>\n </div>\n</div>\n", styles: [".bbsf-logo-cropper image-cropper.crop-horizontal .ngx-ic-source-image{max-height:45px!important;max-width:none!important}.bbsf-logo-cropper image-cropper.crop-vertical .ngx-ic-source-image{max-width:200px!important;max-height:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }], encapsulation: i0.ViewEncapsulation.None }); }
8879
+ }
8880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: LogoCropperComponent, decorators: [{
8881
+ type: Component,
8882
+ args: [{ selector: 'BBSF-LogoCropper', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
8883
+ CommonModule,
8884
+ ImageCropperComponent
8885
+ ], template: "<div class=\"bbsf-logo-cropper\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">{{ translate(\"CropImage\") }}</h5>\n <button type=\"button\" class=\"btn-close\" (click)=\"dismiss()\"></button>\n </div>\n\n <div class=\"modal-body d-flex flex-column justify-content-center align-items-center py-0\" style=\"min-height: 200px;\">\n <image-cropper [class.crop-horizontal]=\"isHorizontal\" [class.crop-vertical]=\"!isHorizontal\" [imageFile]=\"imageFile\"\n [maintainAspectRatio]=\"maintainAspectRatio\" [aspectRatio]=\"aspectRatio\"\n [cropperStaticWidth]=\"cropperStaticWidth\" [cropperStaticHeight]=\"cropperStaticHeight\"\n [onlyScaleDown]=\"onlyScaleDown\" [transform]=\"transform\" format=\"png\" (imageCropped)=\"imageCropped($event)\">\n </image-cropper>\n\n <div class=\"d-flex justify-content-center align-items-center gap-2 mt-3\">\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"zoomOut()\"\n [title]=\"translate('ZoomOut')\">\n <i class=\"fa fa-search-minus\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"resetZoom()\"\n [title]=\"translate('ResetZoom')\">\n <i class=\"fa fa-undo\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"zoomIn()\" [title]=\"translate('ZoomIn')\">\n <i class=\"fa fa-search-plus\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-sm btn-light\" (click)=\"dismiss()\"> Cancel </button>\n <button type=\"button\" class=\"btn btn-sm btn-brand\" [disabled]=\"!croppedBlob\" (click)=\"confirm()\">\n {{ translate(\"Crop\") }}\n </button>\n </div>\n</div>\n", styles: [".bbsf-logo-cropper image-cropper.crop-horizontal .ngx-ic-source-image{max-height:45px!important;max-width:none!important}.bbsf-logo-cropper image-cropper.crop-vertical .ngx-ic-source-image{max-width:200px!important;max-height:none!important}\n"] }]
8886
+ }], ctorParameters: () => [{ type: i3$2.NgbActiveModal }, { type: i3.UtilityService }], propDecorators: { imageFile: [{
8887
+ type: Input
8888
+ }], isHorizontal: [{
8889
+ type: Input
8890
+ }], aspectRatio: [{
8891
+ type: Input
8892
+ }], maintainAspectRatio: [{
8893
+ type: Input
8894
+ }], cropperStaticWidth: [{
8895
+ type: Input
8896
+ }], cropperStaticHeight: [{
8897
+ type: Input
8898
+ }], onlyScaleDown: [{
8899
+ type: Input
8900
+ }] } });
8901
+
8831
8902
  /**
8832
8903
  * BBSF Uploads Module
8833
8904
  *
@@ -8875,11 +8946,13 @@ class BBSFUploadsModule {
8875
8946
  // Import standalone components
8876
8947
  FileUploadComponent,
8877
8948
  ImageUploaderComponent,
8878
- ProfileImageUploaderComponent], exports: [
8949
+ ProfileImageUploaderComponent,
8950
+ LogoCropperComponent], exports: [
8879
8951
  // Re-export standalone components
8880
8952
  FileUploadComponent,
8881
8953
  ImageUploaderComponent,
8882
- ProfileImageUploaderComponent] }); }
8954
+ ProfileImageUploaderComponent,
8955
+ LogoCropperComponent] }); }
8883
8956
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: BBSFUploadsModule, imports: [CommonModule,
8884
8957
  FormsModule,
8885
8958
  ReactiveFormsModule,
@@ -8891,7 +8964,8 @@ class BBSFUploadsModule {
8891
8964
  // Import standalone components
8892
8965
  FileUploadComponent,
8893
8966
  ImageUploaderComponent,
8894
- ProfileImageUploaderComponent] }); }
8967
+ ProfileImageUploaderComponent,
8968
+ LogoCropperComponent] }); }
8895
8969
  }
8896
8970
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: BBSFUploadsModule, decorators: [{
8897
8971
  type: NgModule,
@@ -8909,14 +8983,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
8909
8983
  // Import standalone components
8910
8984
  FileUploadComponent,
8911
8985
  ImageUploaderComponent,
8912
- ProfileImageUploaderComponent
8986
+ ProfileImageUploaderComponent,
8987
+ LogoCropperComponent
8913
8988
  ],
8914
8989
  schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
8915
8990
  exports: [
8916
8991
  // Re-export standalone components
8917
8992
  FileUploadComponent,
8918
8993
  ImageUploaderComponent,
8919
- ProfileImageUploaderComponent
8994
+ ProfileImageUploaderComponent,
8995
+ LogoCropperComponent
8920
8996
  ]
8921
8997
  }]
8922
8998
  }] });
@@ -12065,5 +12141,5 @@ var ToolbarButtons;
12065
12141
  * Generated bundle index. Do not edit.
12066
12142
  */
12067
12143
 
12068
- export { AddButton, AppBaseComponent, Attribute, AutocompleteDTO, AutocompleteOptions, AutocompleteTextBoxComponent, BBSFControlsModule, BBSFCoreModule, BBSFDatePipe, BBSFDateTimeModule, BBSFDateTimePipe, BBSFDropdownModule, BBSFEditorsModule, BBSFFormsBasicModule, BBSFMultilingualModule, BBSFPhoneModule, BBSFSpecializedModule, BBSFUploadsModule, BBSFUtilityModule, BBSF_DATE_TIME_FORMATS, BTagsInputComponent, BreadCrumb, BreadCrumbModel, CalendarComponent, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxComponent, CheckBoxOptions, ConfirmationModalComponent, ConfirmationModalOptions, ControlFilterItem, ControlLayout, ControlOptionsBase, ControlUtility, Country, CustomValidation, CustomValidator, DataType, DateInputComponent, DatePickerOptions, DefaultIntl, DeleteButton, DropdownActionItem, DropdownActions, DropdownListComponent, DropdownListItem, DropdownOptions, EditButton, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, ExportButton, FileDTO, FileType, FileUploadComponent, FileUploadModel, FileUploadOptions, FilterItem, FilterOptions, FilterType, FiltersButton, FontSize, ForceDirection, FormComponent, FormOptions, GlobalSettings, GridViewModel, HtmlEditorComponent, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, ImageUploaderComponent, InputType, Insert, JwPaginationComponent, LanguageMode, LanguageValidation, MapAutoCompleteComponent, MapAutoCompleteOptions, MapAutocompleteDTO, MapSearchTypes, MapZoomLevel, MarkDownIcons, MarkdownEditorComponent, MarkdownEditorOptions, MarkdownMode, MenuListType, Misc, MultiLingualHtmlEditorComponent, MultiLingualHtmlEditorOptions, MultiLingualTextAreaComponent, MultiLingualTextAreaOptions, MultiLingualTextBoxComponent, MultiLingualTextBoxOptions, MultilingualControlOptionsBase, MultipleFileUploadModel, NgTemplateNameDirective, OnPagingFiltersChangeService, PageHeaderComponentComponent, PageHeaderOptions, PagingActionMode, PagingComponent, PagingDTO, PagingOptions, Para, PermissionSets, PhoneComponent, PhoneOptions, PickerType, PreventDoubleClickDirective, ProfileImageUploadOptions, ProfileImageUploaderComponent, ProfilePictureDTO, RadioButtonComponent, RadioButtonItem, RadioButtonOptions, RangeNumber, RecaptchaComponent, RecaptchaModel, RecaptchaOptions, RenderComponentService, RepeaterComponent, RepeaterField, RepeaterFieldBuilderComponent, RepeaterItemFieldComponent, RepeaterOptions, RepeaterTableComponent, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagInputView, TagsInputComponent, TagsInputDTO, TagsInputOptions, TextAreaComponent, TextAreaOptions, TextBoxModel, TextBoxOptions, TextboxComponent, ToggleSlideOptions, ToggleslideComponent, ToolbarButtons, UploadPersonalImage, environment, options };
12144
+ export { AddButton, AppBaseComponent, Attribute, AutocompleteDTO, AutocompleteOptions, AutocompleteTextBoxComponent, BBSFControlsModule, BBSFCoreModule, BBSFDatePipe, BBSFDateTimeModule, BBSFDateTimePipe, BBSFDropdownModule, BBSFEditorsModule, BBSFFormsBasicModule, BBSFMultilingualModule, BBSFPhoneModule, BBSFSpecializedModule, BBSFUploadsModule, BBSFUtilityModule, BBSF_DATE_TIME_FORMATS, BTagsInputComponent, BreadCrumb, BreadCrumbModel, CalendarComponent, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxComponent, CheckBoxOptions, ConfirmationModalComponent, ConfirmationModalOptions, ControlFilterItem, ControlLayout, ControlOptionsBase, ControlUtility, Country, CustomValidation, CustomValidator, DataType, DateInputComponent, DatePickerOptions, DefaultIntl, DeleteButton, DropdownActionItem, DropdownActions, DropdownListComponent, DropdownListItem, DropdownOptions, EditButton, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, ExportButton, FileDTO, FileType, FileUploadComponent, FileUploadModel, FileUploadOptions, FilterItem, FilterOptions, FilterType, FiltersButton, FontSize, ForceDirection, FormComponent, FormOptions, GlobalSettings, GridViewModel, HtmlEditorComponent, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, ImageUploaderComponent, InputType, Insert, JwPaginationComponent, LanguageMode, LanguageValidation, LogoCropperComponent, MapAutoCompleteComponent, MapAutoCompleteOptions, MapAutocompleteDTO, MapSearchTypes, MapZoomLevel, MarkDownIcons, MarkdownEditorComponent, MarkdownEditorOptions, MarkdownMode, MenuListType, Misc, MultiLingualHtmlEditorComponent, MultiLingualHtmlEditorOptions, MultiLingualTextAreaComponent, MultiLingualTextAreaOptions, MultiLingualTextBoxComponent, MultiLingualTextBoxOptions, MultilingualControlOptionsBase, MultipleFileUploadModel, NgTemplateNameDirective, OnPagingFiltersChangeService, PageHeaderComponentComponent, PageHeaderOptions, PagingActionMode, PagingComponent, PagingDTO, PagingOptions, Para, PermissionSets, PhoneComponent, PhoneOptions, PickerType, PreventDoubleClickDirective, ProfileImageUploadOptions, ProfileImageUploaderComponent, ProfilePictureDTO, RadioButtonComponent, RadioButtonItem, RadioButtonOptions, RangeNumber, RecaptchaComponent, RecaptchaModel, RecaptchaOptions, RenderComponentService, RepeaterComponent, RepeaterField, RepeaterFieldBuilderComponent, RepeaterItemFieldComponent, RepeaterOptions, RepeaterTableComponent, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagInputView, TagsInputComponent, TagsInputDTO, TagsInputOptions, TextAreaComponent, TextAreaOptions, TextBoxModel, TextBoxOptions, TextboxComponent, ToggleSlideOptions, ToggleslideComponent, ToolbarButtons, UploadPersonalImage, environment, options };
12069
12145
  //# sourceMappingURL=bnsights-bbsf-controls.mjs.map