@ks89/angular-modal-gallery 11.1.0-rc.1 → 11.1.1
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/CHANGELOG.md +26 -0
- package/README.md +7 -15
- package/esm2022/lib/components/modal-gallery/attach-to-overlay.service.mjs +43 -0
- package/esm2022/lib/components/modal-gallery/modal-gallery.service.mjs +12 -31
- package/esm2022/lib/directives/keyboard-navigation.directive.mjs +7 -1
- package/esm2022/lib/directives/swipe.directive.mjs +6 -4
- package/esm2022/lib/modal-gallery.module.mjs +23 -3
- package/fesm2022/ks89-angular-modal-gallery.mjs +3417 -3371
- package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
- package/lib/components/components.d.ts +1 -1
- package/lib/components/modal-gallery/attach-to-overlay.service.d.ts +20 -0
- package/lib/components/modal-gallery/modal-gallery.service.d.ts +23 -12
- package/lib/directives/keyboard-navigation.directive.d.ts +9 -0
- package/lib/directives/swipe.directive.d.ts +5 -3
- 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
|
|
15
|
+
export declare const COMPONENTS: (typeof AccessibleComponent | typeof CarouselComponent | typeof CarouselPreviewsComponent | typeof UpperButtonsComponent | typeof DotsComponent | typeof PreviewsComponent | typeof CurrentImageComponent | typeof LoadingSpinnerComponent | typeof PlainGalleryComponent | 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 {
|
|
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
|
-
|
|
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
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Directive to manage keyboard navigation.
|
|
5
|
+
*/
|
|
3
6
|
export declare class KeyboardNavigationDirective {
|
|
7
|
+
/**
|
|
8
|
+
* Boolean input to skip keyboard navigation.
|
|
9
|
+
*/
|
|
4
10
|
isOpen: boolean | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Output to emit keyboard `code` of the pressed key (keydown).
|
|
13
|
+
*/
|
|
5
14
|
keyboardNavigation: EventEmitter<string>;
|
|
6
15
|
/**
|
|
7
16
|
* Listener to catch keyboard's events and call the right method based on the key.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
/**
|
|
4
|
-
* Directive to
|
|
5
|
-
* In fact, it listens for a click on all elements that aren't 'inside' and it emits
|
|
6
|
-
* an event using `@Output clickOutside`.
|
|
4
|
+
* Directive to manage swipe events on touch devices.
|
|
7
5
|
*/
|
|
8
6
|
export declare class SwipeDirective {
|
|
9
7
|
defaultTouch: {
|
|
@@ -12,15 +10,19 @@ export declare class SwipeDirective {
|
|
|
12
10
|
time: number;
|
|
13
11
|
};
|
|
14
12
|
/**
|
|
13
|
+
* Output to emit swipe left event. Payload is empty.
|
|
15
14
|
*/
|
|
16
15
|
swipeLeft: EventEmitter<void>;
|
|
17
16
|
/**
|
|
17
|
+
* Output to emit swipe right event. Payload is empty.
|
|
18
18
|
*/
|
|
19
19
|
swipeRight: EventEmitter<void>;
|
|
20
20
|
/**
|
|
21
|
+
* Output to emit swipe up event. Payload is empty.
|
|
21
22
|
*/
|
|
22
23
|
swipeUp: EventEmitter<void>;
|
|
23
24
|
/**
|
|
25
|
+
* Output to emit swipe down event. Payload is empty.
|
|
24
26
|
*/
|
|
25
27
|
swipeDown: EventEmitter<void>;
|
|
26
28
|
/**
|