@ks89/angular-modal-gallery 11.1.0 → 11.1.2

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -15
  3. package/esm2022/lib/components/accessible.component.mjs +6 -7
  4. package/esm2022/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +6 -7
  5. package/esm2022/lib/components/carousel/carousel.component.mjs +7 -8
  6. package/esm2022/lib/components/current-image/current-image.component.mjs +7 -8
  7. package/esm2022/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +5 -6
  8. package/esm2022/lib/components/dots/dots.component.mjs +6 -7
  9. package/esm2022/lib/components/modal-gallery/attach-to-overlay.service.mjs +42 -0
  10. package/esm2022/lib/components/modal-gallery/modal-gallery.component.mjs +7 -8
  11. package/esm2022/lib/components/modal-gallery/modal-gallery.service.mjs +15 -35
  12. package/esm2022/lib/components/plain-gallery/plain-gallery.component.mjs +7 -8
  13. package/esm2022/lib/components/previews/previews.component.mjs +6 -7
  14. package/esm2022/lib/components/upper-buttons/upper-buttons.component.mjs +6 -7
  15. package/esm2022/lib/directives/a-tag-bg-image.directive.mjs +6 -7
  16. package/esm2022/lib/directives/click-outside.directive.mjs +5 -6
  17. package/esm2022/lib/directives/description.directive.mjs +6 -7
  18. package/esm2022/lib/directives/direction.directive.mjs +6 -7
  19. package/esm2022/lib/directives/fallback-image.directive.mjs +6 -7
  20. package/esm2022/lib/directives/keyboard-navigation.directive.mjs +5 -6
  21. package/esm2022/lib/directives/margin.directive.mjs +6 -7
  22. package/esm2022/lib/directives/max-size.directive.mjs +6 -7
  23. package/esm2022/lib/directives/size.directive.mjs +6 -7
  24. package/esm2022/lib/directives/swipe.directive.mjs +5 -6
  25. package/esm2022/lib/directives/wrap.directive.mjs +6 -7
  26. package/esm2022/lib/modal-gallery.module.mjs +27 -8
  27. package/esm2022/lib/services/config.service.mjs +5 -6
  28. package/esm2022/lib/services/id-validator.service.mjs +5 -6
  29. package/fesm2022/ks89-angular-modal-gallery.mjs +3211 -3173
  30. package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
  31. package/lib/components/components.d.ts +1 -1
  32. package/lib/components/modal-gallery/attach-to-overlay.service.d.ts +20 -0
  33. package/lib/components/modal-gallery/modal-gallery.service.d.ts +23 -12
  34. package/package.json +1 -1
@@ -12,4 +12,4 @@ import { ModalGalleryComponent } from './modal-gallery/modal-gallery.component';
12
12
  /**
13
13
  * Array of all components.
14
14
  */
15
- export declare const COMPONENTS: (typeof AccessibleComponent | typeof CurrentImageComponent | typeof ModalGalleryComponent | typeof CarouselComponent | typeof CarouselPreviewsComponent | typeof UpperButtonsComponent | typeof DotsComponent | typeof PreviewsComponent | typeof LoadingSpinnerComponent | typeof PlainGalleryComponent)[];
15
+ export declare const COMPONENTS: (typeof CarouselPreviewsComponent | typeof AccessibleComponent | typeof LoadingSpinnerComponent | typeof PlainGalleryComponent | typeof CarouselComponent | typeof UpperButtonsComponent | typeof DotsComponent | typeof PreviewsComponent | typeof CurrentImageComponent | typeof ModalGalleryComponent)[];
@@ -0,0 +1,20 @@
1
+ import { Injector } from '@angular/core';
2
+ import { ModalGalleryService } from './modal-gallery.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class AttachToOverlayService {
5
+ private injector;
6
+ private modalGalleryService;
7
+ constructor(injector: Injector, modalGalleryService: ModalGalleryService);
8
+ /**
9
+ * To be called by a provider with the APP_INITIALIZER token.
10
+ */
11
+ initialize(): void;
12
+ /**
13
+ * Private method to attach ModalGalleryComponent to the overlay.
14
+ * @param payload {@link AttachToOverlayPayload} with all necessary information
15
+ * @private
16
+ */
17
+ private attachToOverlay;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<AttachToOverlayService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<AttachToOverlayService>;
20
+ }
@@ -1,19 +1,38 @@
1
- import { Injector } from '@angular/core';
2
- import { Overlay } from '@angular/cdk/overlay';
1
+ import { EventEmitter } from '@angular/core';
2
+ import { Overlay, OverlayRef } from '@angular/cdk/overlay';
3
3
  import { ModalGalleryRef } from './modal-gallery-ref';
4
4
  import { Image, ImageModalEvent } from '../../model/image.class';
5
5
  import { ConfigService } from '../../services/config.service';
6
6
  import { ButtonEvent } from '../../model/buttons-config.interface';
7
7
  import { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';
8
8
  import * as i0 from "@angular/core";
9
+ /**
10
+ * Payload to be emitted via {@link triggerAttachToOverlay} to enable {@link AttachToOverlayService}
11
+ * to attach the {@link ModalGalleryComponent} to the overlay
12
+ */
13
+ export interface AttachToOverlayPayload {
14
+ /**
15
+ * Overlay object created using Angular CDK APIs
16
+ */
17
+ overlayRef: OverlayRef;
18
+ /**
19
+ * Dialog data to be injected into the {@link ModalGalleryComponent}
20
+ * contains: id, array of images, current image and optionally the configuration object
21
+ */
22
+ config: ModalGalleryConfig;
23
+ /**
24
+ * Object to control the dialog instance
25
+ */
26
+ dialogRef: ModalGalleryRef;
27
+ }
9
28
  export declare class ModalGalleryService {
10
- private injector;
11
29
  private overlay;
12
30
  private configService;
13
31
  private updateImages;
14
32
  updateImages$: import("rxjs").Observable<Image[]>;
15
33
  private dialogRef;
16
- constructor(injector: Injector, overlay: Overlay, configService: ConfigService);
34
+ triggerAttachToOverlay: EventEmitter<AttachToOverlayPayload>;
35
+ constructor(overlay: Overlay, configService: ConfigService);
17
36
  /**
18
37
  * Method to open modal gallery passing the configuration
19
38
  * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object
@@ -71,14 +90,6 @@ export declare class ModalGalleryService {
71
90
  * @private
72
91
  */
73
92
  private createOverlay;
74
- /**
75
- * Private method to attach ModalGalleryComponent to the overlay.
76
- * @param overlayRef OverlayRef is the Overlay object created using Angular CDK APIs
77
- * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object
78
- * @param dialogRef ModalGalleryRef is the object to control the dialog instance
79
- * @private
80
- */
81
- private attachDialogContainer;
82
93
  /**
83
94
  * Private method to create an OverlayConfig instance
84
95
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ks89/angular-modal-gallery",
3
- "version": "11.1.0",
3
+ "version": "11.1.2",
4
4
  "description": "Image gallery for Angular",
5
5
  "license": "MIT",
6
6
  "author": "Stefano Cappa",