@ks89/angular-modal-gallery 8.0.1 → 9.0.0
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 +44 -0
- package/CONTRIBUTING.md +3 -3
- package/README.md +19 -25
- package/{esm2015/ks89-angular-modal-gallery.js → esm2020/ks89-angular-modal-gallery.mjs} +0 -0
- package/{esm2015/lib/components/accessibility-default.js → esm2020/lib/components/accessibility-default.mjs} +0 -0
- package/{esm2015/lib/components/accessible.component.js → esm2020/lib/components/accessible.component.mjs} +6 -6
- package/esm2020/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +462 -0
- package/esm2020/lib/components/carousel/carousel.component.mjs +747 -0
- package/{esm2015/lib/components/components.js → esm2020/lib/components/components.mjs} +0 -0
- package/esm2020/lib/components/current-image/current-image.component.mjs +616 -0
- package/esm2020/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +80 -0
- package/esm2020/lib/components/dots/dots.component.mjs +127 -0
- package/{esm2015/lib/components/modal-gallery/modal-gallery-ref.js → esm2020/lib/components/modal-gallery/modal-gallery-ref.mjs} +0 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery.component.mjs +523 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery.service.mjs +187 -0
- package/{esm2015/lib/components/modal-gallery/modal-gallery.tokens.js → esm2020/lib/components/modal-gallery/modal-gallery.tokens.mjs} +0 -0
- package/esm2020/lib/components/plain-gallery/plain-gallery.component.mjs +249 -0
- package/esm2020/lib/components/previews/previews.component.mjs +332 -0
- package/{esm2015/lib/components/upper-buttons/upper-buttons-default.js → esm2020/lib/components/upper-buttons/upper-buttons-default.mjs} +0 -0
- package/esm2020/lib/components/upper-buttons/upper-buttons.component.mjs +249 -0
- package/{esm2015/lib/directives/a-tag-bg-image.directive.js → esm2020/lib/directives/a-tag-bg-image.directive.mjs} +3 -3
- package/{esm2015/lib/directives/click-outside.directive.js → esm2020/lib/directives/click-outside.directive.mjs} +3 -3
- package/{esm2015/lib/directives/description.directive.js → esm2020/lib/directives/description.directive.mjs} +3 -3
- package/{esm2015/lib/directives/direction.directive.js → esm2020/lib/directives/direction.directive.mjs} +3 -3
- package/{esm2015/lib/directives/directives.js → esm2020/lib/directives/directives.mjs} +0 -0
- package/{esm2015/lib/directives/fallback-image.directive.js → esm2020/lib/directives/fallback-image.directive.mjs} +3 -3
- package/{esm2015/lib/directives/keyboard-navigation.directive.js → esm2020/lib/directives/keyboard-navigation.directive.mjs} +5 -5
- package/{esm2015/lib/directives/margin.directive.js → esm2020/lib/directives/margin.directive.mjs} +3 -3
- package/{esm2015/lib/directives/max-size.directive.js → esm2020/lib/directives/max-size.directive.mjs} +3 -3
- package/{esm2015/lib/directives/size.directive.js → esm2020/lib/directives/size.directive.mjs} +3 -3
- package/{esm2015/lib/directives/wrap.directive.js → esm2020/lib/directives/wrap.directive.mjs} +3 -3
- package/{esm2015/lib/modal-gallery.module.js → esm2020/lib/modal-gallery.module.mjs} +7 -7
- package/{esm2015/lib/model/accessibility.interface.js → esm2020/lib/model/accessibility.interface.mjs} +0 -0
- package/{esm2015/lib/model/action.enum.js → esm2020/lib/model/action.enum.mjs} +0 -0
- package/{esm2015/lib/model/buttons-config.interface.js → esm2020/lib/model/buttons-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/carousel-config.interface.js → esm2020/lib/model/carousel-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/carousel-image-config.interface.js → esm2020/lib/model/carousel-image-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/carousel-preview-config.interface.js → esm2020/lib/model/carousel-preview-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/current-image-config.interface.js → esm2020/lib/model/current-image-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/description.interface.js → esm2020/lib/model/description.interface.mjs} +0 -0
- package/{esm2015/lib/model/dots-config.interface.js → esm2020/lib/model/dots-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/image-internal.class.js → esm2020/lib/model/image-internal.class.mjs} +0 -0
- package/{esm2015/lib/model/image.class.js → esm2020/lib/model/image.class.mjs} +0 -0
- package/{esm2015/lib/model/interaction-event.interface.js → esm2020/lib/model/interaction-event.interface.mjs} +0 -0
- package/{esm2015/lib/model/keyboard-config.interface.js → esm2020/lib/model/keyboard-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/keyboard-service-config.interface.js → esm2020/lib/model/keyboard-service-config.interface.mjs} +0 -0
- package/esm2020/lib/model/keyboard.enum.mjs +35 -0
- package/{esm2015/lib/model/lib-config.interface.js → esm2020/lib/model/lib-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/loading-config.interface.js → esm2020/lib/model/loading-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/max-size.interface.js → esm2020/lib/model/max-size.interface.mjs} +0 -0
- package/{esm2015/lib/model/modal-gallery-config.interface.js → esm2020/lib/model/modal-gallery-config.interface.mjs} +1 -1
- package/esm2020/lib/model/plain-gallery-config.interface.mjs +55 -0
- package/{esm2015/lib/model/play-config.interface.js → esm2020/lib/model/play-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/preview-config.interface.js → esm2020/lib/model/preview-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/size.interface.js → esm2020/lib/model/size.interface.mjs} +0 -0
- package/{esm2015/lib/model/slide-config.interface.js → esm2020/lib/model/slide-config.interface.mjs} +0 -0
- package/esm2020/lib/services/config.service.mjs +396 -0
- package/{esm2015/lib/services/id-validator.service.js → esm2020/lib/services/id-validator.service.mjs} +3 -3
- package/{esm2015/lib/services/keyboard.service.js → esm2020/lib/services/keyboard.service.mjs} +3 -3
- package/{esm2015/lib/utils/image.util.js → esm2020/lib/utils/image.util.mjs} +0 -0
- package/esm2020/lib/utils/user-input.util.mjs +104 -0
- package/esm2020/public-api.mjs +42 -0
- package/fesm2015/ks89-angular-modal-gallery.mjs +5782 -0
- package/fesm2015/ks89-angular-modal-gallery.mjs.map +1 -0
- package/{fesm2015/ks89-angular-modal-gallery.js → fesm2020/ks89-angular-modal-gallery.mjs} +264 -432
- package/fesm2020/ks89-angular-modal-gallery.mjs.map +1 -0
- package/lib/components/accessible.component.d.ts +2 -2
- package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -7
- package/lib/components/carousel/carousel.component.d.ts +25 -67
- package/lib/components/current-image/current-image.component.d.ts +3 -3
- package/lib/components/modal-gallery/modal-gallery.component.d.ts +3 -20
- package/lib/components/modal-gallery/modal-gallery.service.d.ts +1 -0
- package/lib/components/plain-gallery/plain-gallery.component.d.ts +6 -10
- package/lib/directives/keyboard-navigation.directive.d.ts +1 -1
- package/lib/model/carousel-config.interface.d.ts +0 -1
- package/lib/model/keyboard-config.interface.d.ts +4 -4
- package/lib/model/keyboard.enum.d.ts +11 -8
- package/lib/model/lib-config.interface.d.ts +20 -7
- package/lib/model/modal-gallery-config.interface.d.ts +2 -2
- package/lib/model/plain-gallery-config.interface.d.ts +1 -9
- package/lib/utils/user-input.util.d.ts +35 -26
- package/package.json +26 -13
- package/public-api.d.ts +2 -2
- package/bundles/ks89-angular-modal-gallery.umd.js +0 -6221
- package/bundles/ks89-angular-modal-gallery.umd.js.map +0 -1
- package/esm2015/lib/components/carousel/carousel-previews/carousel-previews.component.js +0 -480
- package/esm2015/lib/components/carousel/carousel.component.js +0 -800
- package/esm2015/lib/components/current-image/current-image.component.js +0 -621
- package/esm2015/lib/components/current-image/loading-spinner/loading-spinner.component.js +0 -93
- package/esm2015/lib/components/dots/dots.component.js +0 -132
- package/esm2015/lib/components/modal-gallery/modal-gallery.component.js +0 -576
- package/esm2015/lib/components/modal-gallery/modal-gallery.service.js +0 -186
- package/esm2015/lib/components/plain-gallery/plain-gallery.component.js +0 -259
- package/esm2015/lib/components/previews/previews.component.js +0 -337
- package/esm2015/lib/components/upper-buttons/upper-buttons.component.js +0 -254
- package/esm2015/lib/model/keyboard.enum.js +0 -35
- package/esm2015/lib/model/plain-gallery-config.interface.js +0 -64
- package/esm2015/lib/services/config.service.js +0 -395
- package/esm2015/lib/utils/user-input.util.js +0 -95
- package/esm2015/public-api.js +0 -42
- package/fesm2015/ks89-angular-modal-gallery.js.map +0 -1
|
@@ -15,13 +15,13 @@ export declare class AccessibleComponent {
|
|
|
15
15
|
handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number;
|
|
16
16
|
/**
|
|
17
17
|
* Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
|
|
18
|
-
* @param KeyboardEvent | MouseEvent
|
|
18
|
+
* @param event KeyboardEvent | MouseEvent payload
|
|
19
19
|
* @returns number 1 for NEXT and 0 for NOTHING
|
|
20
20
|
*/
|
|
21
21
|
handleImageEvent(event: KeyboardEvent | MouseEvent): number;
|
|
22
22
|
/**
|
|
23
23
|
* Private method to handle keyboard events over an image.
|
|
24
|
-
* @param KeyboardEvent
|
|
24
|
+
* @param event KeyboardEvent payload
|
|
25
25
|
* @returns number 1 for NEXT and 0 for NOTHING
|
|
26
26
|
*/
|
|
27
27
|
private handleImageKeyboardEvent;
|
|
@@ -156,13 +156,6 @@ export declare class CarouselPreviewsComponent extends AccessibleComponent imple
|
|
|
156
156
|
* @returns a SafeStyle object that can be used in template without problems.
|
|
157
157
|
*/
|
|
158
158
|
sanitizeUrlBgStyle(unsafeStyle: string | SafeResourceUrl, unsafeStyleFallback: string | SafeResourceUrl): SafeStyle;
|
|
159
|
-
/**
|
|
160
|
-
* Method to get the background-size value when IE11LegacyMode is enabled.
|
|
161
|
-
* This prevent weired behaviour on IE11 when previews are really small, but original images (.png/.jgp/...) are big.
|
|
162
|
-
* Using 'cover' it's not enough, because it's causing empty background in some cases.
|
|
163
|
-
* After some experiments, I decided to use the double of the height and auto as width.
|
|
164
|
-
*/
|
|
165
|
-
getIE11LegacyBgSize(): string;
|
|
166
159
|
/**
|
|
167
160
|
* Method to cleanup resources. In fact, it cleans breakpointSubscription.
|
|
168
161
|
* This is an Angular's lifecycle hook that is called when this component is destroyed.
|
|
@@ -4,13 +4,11 @@ import { AccessibilityConfig } from '../../model/accessibility.interface';
|
|
|
4
4
|
import { Image, ImageEvent } from '../../model/image.class';
|
|
5
5
|
import { Action } from '../../model/action.enum';
|
|
6
6
|
import { DotsConfig } from '../../model/dots-config.interface';
|
|
7
|
-
import { PlayConfig } from '../../model/play-config.interface';
|
|
8
7
|
import { CarouselConfig } from '../../model/carousel-config.interface';
|
|
9
8
|
import { CarouselImageConfig } from '../../model/carousel-image-config.interface';
|
|
10
|
-
import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
|
|
11
|
-
import { CarouselPreviewConfig } from '../../model/carousel-preview-config.interface';
|
|
12
9
|
import { ConfigService } from '../../services/config.service';
|
|
13
10
|
import { ModalGalleryService } from '../modal-gallery/modal-gallery.service';
|
|
11
|
+
import { CarouselLibConfig } from '../../model/lib-config.interface';
|
|
14
12
|
import * as i0 from "@angular/core";
|
|
15
13
|
/**
|
|
16
14
|
* Component with configurable inline/plain carousel.
|
|
@@ -21,7 +19,6 @@ export declare class CarouselComponent extends AccessibleComponent implements On
|
|
|
21
19
|
private modalGalleryService;
|
|
22
20
|
private configService;
|
|
23
21
|
private ref;
|
|
24
|
-
private sanitizer;
|
|
25
22
|
/**
|
|
26
23
|
* Attribute to set ariaLabel of the host component
|
|
27
24
|
*/
|
|
@@ -37,47 +34,17 @@ export declare class CarouselComponent extends AccessibleComponent implements On
|
|
|
37
34
|
*/
|
|
38
35
|
images: Image[];
|
|
39
36
|
/**
|
|
40
|
-
*
|
|
41
|
-
* For instance, it contains parameters to change the style, how it navigates and so on.
|
|
42
|
-
*/
|
|
43
|
-
carouselConfig: CarouselConfig | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Object of type `PlayConfig` to init CarouselComponent's features about auto-play.
|
|
46
|
-
* For instance, it contains parameters to enable/disable autoPlay, interval and so on.
|
|
47
|
-
*/
|
|
48
|
-
playConfig: PlayConfig | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Interface to configure current image in carousel.
|
|
51
|
-
* For instance you can change the description.
|
|
52
|
-
*/
|
|
53
|
-
carouselImageConfig: CarouselImageConfig | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.
|
|
56
|
-
* For instance, it contains a param to show/hide previews, change sizes and so on.
|
|
57
|
-
*/
|
|
58
|
-
previewConfig: CarouselPreviewConfig | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Object of type `DotsConfig` to init DotsComponent's features.
|
|
61
|
-
* For instance, it contains a param to show/hide this component.
|
|
62
|
-
*/
|
|
63
|
-
dotsConfig: DotsConfig | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* boolean to enable/disable infinite sliding. Enabled by default.
|
|
66
|
-
*/
|
|
67
|
-
infinite: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* TODO add description
|
|
37
|
+
* CarouselLibConfig object to configure carousel.
|
|
70
38
|
*/
|
|
71
|
-
|
|
39
|
+
config: CarouselLibConfig | undefined;
|
|
72
40
|
/**
|
|
73
|
-
*
|
|
74
|
-
* For instance, it contains titles, alt texts, aria-labels and so on.
|
|
41
|
+
* Output to emit an event when an image is clicked.
|
|
75
42
|
*/
|
|
76
|
-
|
|
43
|
+
clickImage: EventEmitter<number>;
|
|
77
44
|
/**
|
|
78
|
-
* Output to emit an event when
|
|
45
|
+
* Output to emit an event when current image is changed.
|
|
79
46
|
*/
|
|
80
|
-
|
|
47
|
+
changeImage: EventEmitter<ImageEvent>;
|
|
81
48
|
/**
|
|
82
49
|
* Output to emit an event when the current image is the first one.
|
|
83
50
|
*/
|
|
@@ -87,29 +54,28 @@ export declare class CarouselComponent extends AccessibleComponent implements On
|
|
|
87
54
|
*/
|
|
88
55
|
lastImage: EventEmitter<ImageEvent>;
|
|
89
56
|
/**
|
|
90
|
-
* Object
|
|
91
|
-
|
|
92
|
-
configCarousel: CarouselConfig | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* Object use in template
|
|
57
|
+
* Object of type `CarouselConfig` to init CarouselComponent's features.
|
|
58
|
+
* For instance, it contains parameters to change the style, how it navigates and so on.
|
|
95
59
|
*/
|
|
96
|
-
|
|
60
|
+
carouselConfig: CarouselConfig | undefined;
|
|
97
61
|
/**
|
|
98
|
-
* Object
|
|
62
|
+
* Object of type `DotsConfig` to init DotsComponent's features.
|
|
63
|
+
* For instance, it contains a param to show/hide this component.
|
|
99
64
|
*/
|
|
100
|
-
|
|
65
|
+
carouselDotsConfig: DotsConfig | undefined;
|
|
101
66
|
/**
|
|
102
|
-
* Object
|
|
67
|
+
* Object of type `AccessibilityConfig` to init custom accessibility features.
|
|
68
|
+
* For instance, it contains titles, alt texts, aria-labels and so on.
|
|
103
69
|
*/
|
|
104
|
-
|
|
70
|
+
accessibilityConfig: AccessibilityConfig | undefined;
|
|
105
71
|
/**
|
|
106
|
-
* Object
|
|
72
|
+
* Object of type `CarouselImageConfig` to configure the current image of the carousel.
|
|
107
73
|
*/
|
|
108
|
-
|
|
74
|
+
carouselImageConfig: CarouselImageConfig | undefined;
|
|
109
75
|
/**
|
|
110
|
-
*
|
|
76
|
+
* Enable/disable infinite sliding.
|
|
111
77
|
*/
|
|
112
|
-
|
|
78
|
+
carouselSlideInfinite: boolean | undefined;
|
|
113
79
|
/**
|
|
114
80
|
* Enum of type `Action` that represents a mouse click on a button.
|
|
115
81
|
* Declared here to be used inside the template.
|
|
@@ -162,18 +128,10 @@ export declare class CarouselComponent extends AccessibleComponent implements On
|
|
|
162
128
|
* Listener to navigate carousel images with keyboard (right).
|
|
163
129
|
*/
|
|
164
130
|
onKeyDownLRight(): void;
|
|
165
|
-
constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef
|
|
166
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
131
|
+
constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef);
|
|
167
132
|
ngOnInit(): void;
|
|
133
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
168
134
|
ngAfterContentInit(): void;
|
|
169
|
-
/**
|
|
170
|
-
* Method used in template to sanitize an url when you need legacyIE11Mode.
|
|
171
|
-
* In this way you can set an url as background of a div.
|
|
172
|
-
* @param unsafeStyle is a string and represents the url to sanitize.
|
|
173
|
-
* @param unsafeStyleFallback is a string and represents the fallback url to sanitize.
|
|
174
|
-
* @returns a SafeStyle object that can be used in template without problems.
|
|
175
|
-
*/
|
|
176
|
-
sanitizeUrlBgStyle(unsafeStyle: string, unsafeStyleFallback: string): SafeStyle;
|
|
177
135
|
/**
|
|
178
136
|
* Method called when a dot is clicked and used to update the current image.
|
|
179
137
|
* @param number index of the clicked dot
|
|
@@ -308,14 +266,14 @@ export declare class CarouselComponent extends AccessibleComponent implements On
|
|
|
308
266
|
private emitBoundaryEvent;
|
|
309
267
|
/**
|
|
310
268
|
* Private method to check if next/prev actions should be blocked.
|
|
311
|
-
* It checks if
|
|
269
|
+
* It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.
|
|
312
270
|
* If yes, it returns true to say that sliding should be blocked, otherwise not.
|
|
313
271
|
* @param number boundaryIndex that could be either the beginning index (0) or the last index
|
|
314
272
|
* of images (this.images.length - 1).
|
|
315
|
-
* @returns boolean true if
|
|
273
|
+
* @returns boolean true if carouselSlideInfinite === false and the current index is
|
|
316
274
|
* either the first or the last one.
|
|
317
275
|
*/
|
|
318
276
|
private isPreventSliding;
|
|
319
277
|
static ɵfac: i0.ɵɵFactoryDeclaration<CarouselComponent, never>;
|
|
320
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": "id"; "images": "images"; "
|
|
278
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": "id"; "images": "images"; "config": "config"; }, { "clickImage": "clickImage"; "changeImage": "changeImage"; "firstImage": "firstImage"; "lastImage": "lastImage"; }, never, ["*"]>;
|
|
321
279
|
}
|
|
@@ -144,11 +144,11 @@ export declare class CurrentImageComponent extends AccessibleComponent implement
|
|
|
144
144
|
*/
|
|
145
145
|
ngAfterContentInit(): void;
|
|
146
146
|
/**
|
|
147
|
-
* Method to handle keypress based on the `keyboardConfig` input. It gets the
|
|
147
|
+
* Method to handle keypress based on the `keyboardConfig` input. It gets the code of
|
|
148
148
|
* the key that triggered the keypress event to navigate between images or to close the modal gallery.
|
|
149
|
-
* @param
|
|
149
|
+
* @param code string of the key that triggered the keypress event
|
|
150
150
|
*/
|
|
151
|
-
onKeyPress(
|
|
151
|
+
onKeyPress(code: string): void;
|
|
152
152
|
/**
|
|
153
153
|
* Method to get the image description based on input params.
|
|
154
154
|
* If you provide a full description this will be the visible description, otherwise,
|
|
@@ -150,9 +150,8 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
|
|
|
150
150
|
* It also reset the `keyboardService` to prevent multiple listeners.
|
|
151
151
|
* @param action Action action type. `Action.NORMAL` by default
|
|
152
152
|
* @param clickOutside boolean that is true if called clicking on the modal background. False by default.
|
|
153
|
-
* @param isCalledByService boolean isCalledByService is true if called by gallery.service, otherwise false. False by default.
|
|
154
153
|
*/
|
|
155
|
-
closeGallery(action?: Action, clickOutside?: boolean
|
|
154
|
+
closeGallery(action?: Action, clickOutside?: boolean): void;
|
|
156
155
|
/**
|
|
157
156
|
* Method called when the image changes and used to update the `currentImage` object.
|
|
158
157
|
* @param event ImageModalEvent event payload
|
|
@@ -192,10 +191,9 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
|
|
|
192
191
|
* will be destroyed or when the gallery is closed invoking the `closeGallery` method.
|
|
193
192
|
* @private
|
|
194
193
|
*/
|
|
195
|
-
private
|
|
194
|
+
private registerKeyboardService;
|
|
196
195
|
/**
|
|
197
196
|
* Method to download the current image, only if `downloadable` is true.
|
|
198
|
-
* It contains also a logic to enable downloading features also for IE11.
|
|
199
197
|
* @private
|
|
200
198
|
*/
|
|
201
199
|
private downloadImage;
|
|
@@ -208,16 +206,10 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
|
|
|
208
206
|
*/
|
|
209
207
|
private base64toBlob;
|
|
210
208
|
/**
|
|
211
|
-
* Private method to download the current image for all browsers
|
|
209
|
+
* Private method to download the current image for all browsers.
|
|
212
210
|
* @private
|
|
213
211
|
*/
|
|
214
212
|
private downloadImageAllBrowsers;
|
|
215
|
-
/**
|
|
216
|
-
* Private method to download the current image only for IE11 using
|
|
217
|
-
* custom javascript's methods available only on IE.
|
|
218
|
-
* @private
|
|
219
|
-
*/
|
|
220
|
-
private downloadImageOnlyIEorEdge;
|
|
221
213
|
/**
|
|
222
214
|
* Private method to get the `ButtonEvent` to emit, merging the input `ButtonEvent`
|
|
223
215
|
* with the current image.
|
|
@@ -251,15 +243,6 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
|
|
|
251
243
|
* @private
|
|
252
244
|
*/
|
|
253
245
|
private emitBoundaryEvent;
|
|
254
|
-
/**
|
|
255
|
-
* Private method to check if this library is running on
|
|
256
|
-
* Microsoft browsers or not (i.e. it detects both IE11 and Edge)
|
|
257
|
-
* supporting also Server-Side Rendering.
|
|
258
|
-
* Inspired by https://msdn.microsoft.com/it-it/library/hh779016(v=vs.85).aspx
|
|
259
|
-
* @returns boolean true if IE11 or Edge, false otherwise
|
|
260
|
-
* @private
|
|
261
|
-
*/
|
|
262
|
-
private isIEorEdge;
|
|
263
246
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModalGalleryComponent, never>;
|
|
264
247
|
static ɵcmp: i0.ɵɵComponentDeclaration<ModalGalleryComponent, "ks-modal-gallery", never, {}, {}, never, never>;
|
|
265
248
|
}
|
|
@@ -23,6 +23,7 @@ export declare class ModalGalleryService {
|
|
|
23
23
|
/**
|
|
24
24
|
* Method to close a modal gallery previously opened.
|
|
25
25
|
* @param id Unique identifier of the modal gallery
|
|
26
|
+
* @param clickOutside boolean is true if closed clicking on the modal backdrop, false otherwise.
|
|
26
27
|
*/
|
|
27
28
|
close(id: number, clickOutside: boolean): void;
|
|
28
29
|
/**
|
|
@@ -5,7 +5,7 @@ import { Size } from '../../model/size.interface';
|
|
|
5
5
|
import { PlainGalleryConfig } from '../../model/plain-gallery-config.interface';
|
|
6
6
|
import { ConfigService } from '../../services/config.service';
|
|
7
7
|
import { AccessibleComponent } from '../accessible.component';
|
|
8
|
-
import {
|
|
8
|
+
import { PlainLibConfig } from '../../model/lib-config.interface';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
11
|
* Component with the gallery of thumbs.
|
|
@@ -26,17 +26,13 @@ export declare class PlainGalleryComponent extends AccessibleComponent implement
|
|
|
26
26
|
*/
|
|
27
27
|
images: Image[];
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* PlainLibConfig object to configure plain-gallery.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
config: PlainLibConfig | undefined;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
config: LibConfig | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Output to emit an event when an image is changed.
|
|
33
|
+
* Output to emit an event when an image is clicked.
|
|
38
34
|
*/
|
|
39
|
-
|
|
35
|
+
clickImage: EventEmitter<number>;
|
|
40
36
|
/**
|
|
41
37
|
* Object of type `PlainGalleryConfig` to configure the plain gallery.
|
|
42
38
|
*/
|
|
@@ -135,5 +131,5 @@ export declare class PlainGalleryComponent extends AccessibleComponent implement
|
|
|
135
131
|
*/
|
|
136
132
|
private initImageGrid;
|
|
137
133
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlainGalleryComponent, never>;
|
|
138
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PlainGalleryComponent, "ks-plain-gallery", never, { "id": "id"; "images": "images"; "
|
|
134
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PlainGalleryComponent, "ks-plain-gallery", never, { "id": "id"; "images": "images"; "config": "config"; }, { "clickImage": "clickImage"; }, never, never>;
|
|
139
135
|
}
|
|
@@ -2,7 +2,7 @@ import { EventEmitter } from '@angular/core';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class KeyboardNavigationDirective {
|
|
4
4
|
isOpen: boolean | undefined;
|
|
5
|
-
keyboardNavigation: EventEmitter<
|
|
5
|
+
keyboardNavigation: EventEmitter<string>;
|
|
6
6
|
/**
|
|
7
7
|
* Listener to catch keyboard's events and call the right method based on the key.
|
|
8
8
|
* For instance, pressing esc, this will call `closeGallery(Action.KEYBOARD)` and so on.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Interface `KeyboardConfig` to assign custom
|
|
2
|
+
* Interface `KeyboardConfig` to assign custom codes to ESC, RIGHT and LEFT keyboard's actions.
|
|
3
3
|
*/
|
|
4
4
|
export interface KeyboardConfig {
|
|
5
|
-
esc?:
|
|
6
|
-
right?:
|
|
7
|
-
left?:
|
|
5
|
+
esc?: string;
|
|
6
|
+
right?: string;
|
|
7
|
+
left?: string;
|
|
8
8
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Enum `Keyboard` with keys and their relative
|
|
2
|
+
* Enum `Keyboard` with keys and their relative codes.
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { DOWN_ARROW_CODE, ESC_CODE, LEFT_ARROW_CODE, RIGHT_ARROW_CODE, UP_ARROW_CODE } from '../utils/user-input.util';
|
|
5
|
+
declare type Keyboard = Readonly<{
|
|
6
|
+
ESC: typeof ESC_CODE;
|
|
7
|
+
LEFT_ARROW: typeof LEFT_ARROW_CODE;
|
|
8
|
+
RIGHT_ARROW: typeof RIGHT_ARROW_CODE;
|
|
9
|
+
UP_ARROW: typeof UP_ARROW_CODE;
|
|
10
|
+
DOWN_ARROW: typeof DOWN_ARROW_CODE;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const Keyboard: Keyboard;
|
|
13
|
+
export {};
|
|
@@ -11,20 +11,33 @@ import { CarouselImageConfig } from './carousel-image-config.interface';
|
|
|
11
11
|
import { CarouselPreviewConfig } from './carousel-preview-config.interface';
|
|
12
12
|
import { PlayConfig } from './play-config.interface';
|
|
13
13
|
import { KeyboardServiceConfig } from './keyboard-service-config.interface';
|
|
14
|
-
export interface
|
|
15
|
-
slideConfig?: SlideConfig;
|
|
14
|
+
export interface AccessibleLibConfig {
|
|
16
15
|
accessibilityConfig?: AccessibilityConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface CommonLibConfig {
|
|
17
18
|
previewConfig?: PreviewConfig;
|
|
18
|
-
buttonsConfig?: ButtonsConfig;
|
|
19
19
|
dotsConfig?: DotsConfig;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
slideConfig?: SlideConfig;
|
|
21
|
+
}
|
|
22
|
+
export interface KeyboardServiceLibConfig {
|
|
23
|
+
keyboardServiceConfig?: KeyboardServiceConfig;
|
|
24
|
+
}
|
|
25
|
+
export interface CarouselLibConfig extends CommonLibConfig, AccessibleLibConfig, KeyboardServiceLibConfig {
|
|
23
26
|
carouselConfig?: CarouselConfig;
|
|
24
27
|
carouselImageConfig?: CarouselImageConfig;
|
|
25
28
|
carouselPreviewsConfig?: CarouselPreviewConfig;
|
|
26
29
|
carouselPlayConfig?: PlayConfig;
|
|
27
30
|
carouselDotsConfig?: DotsConfig;
|
|
31
|
+
carouselSlideInfinite?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ModalLibConfig extends CommonLibConfig, AccessibleLibConfig, KeyboardServiceLibConfig {
|
|
28
34
|
enableCloseOutside?: boolean;
|
|
29
|
-
|
|
35
|
+
keyboardConfig?: KeyboardConfig;
|
|
36
|
+
currentImageConfig?: CurrentImageConfig;
|
|
37
|
+
buttonsConfig?: ButtonsConfig;
|
|
38
|
+
}
|
|
39
|
+
export interface PlainLibConfig extends AccessibleLibConfig {
|
|
40
|
+
plainGalleryConfig?: PlainGalleryConfig;
|
|
41
|
+
}
|
|
42
|
+
export interface LibConfig extends ModalLibConfig, PlainLibConfig, CarouselLibConfig {
|
|
30
43
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Image } from './image.class';
|
|
2
|
-
import {
|
|
2
|
+
import { ModalLibConfig } from './lib-config.interface';
|
|
3
3
|
export interface ModalGalleryConfig {
|
|
4
4
|
id: number;
|
|
5
5
|
images: Image[];
|
|
6
6
|
currentImage: Image;
|
|
7
|
-
libConfig?:
|
|
7
|
+
libConfig?: ModalLibConfig;
|
|
8
8
|
}
|
|
@@ -9,7 +9,7 @@ export interface PlainGalleryConfig {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Interface `PlainGalleryLayout` to configure the layout. This interface isn't used directly, instead
|
|
12
|
-
* refers to either `LineLayout`, `GridLayout
|
|
12
|
+
* refers to either `LineLayout`, `GridLayout`.
|
|
13
13
|
*/
|
|
14
14
|
export interface PlainGalleryLayout {
|
|
15
15
|
}
|
|
@@ -30,14 +30,6 @@ export declare class GridLayout implements PlainGalleryLayout {
|
|
|
30
30
|
size: Size;
|
|
31
31
|
constructor(size: Size, breakConfig: BreakConfig);
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Class `AdvancedLayout` to configure a fully custom plain gallery.
|
|
35
|
-
*/
|
|
36
|
-
export declare class AdvancedLayout implements PlainGalleryLayout {
|
|
37
|
-
modalOpenerByIndex: number;
|
|
38
|
-
hideDefaultPlainGallery: boolean;
|
|
39
|
-
constructor(modalOpenerByIndex: number, hideDefaultPlainGallery: boolean);
|
|
40
|
-
}
|
|
41
33
|
/**
|
|
42
34
|
* Enum `PlainGalleryStrategy` to choose the behaviour of the plain gallery.
|
|
43
35
|
*/
|
|
@@ -1,52 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Key of the keyboard's key `enter`
|
|
3
3
|
*/
|
|
4
|
-
export declare const ENTER_KEY
|
|
4
|
+
export declare const ENTER_KEY: string;
|
|
5
5
|
/**
|
|
6
6
|
* Code of the keyboard's key `enter`
|
|
7
7
|
*/
|
|
8
|
-
export declare const ENTER_CODE
|
|
8
|
+
export declare const ENTER_CODE: string;
|
|
9
|
+
/**
|
|
10
|
+
* Key of the keyboard's key `esc`
|
|
11
|
+
*/
|
|
12
|
+
export declare const ESC_KEY: string;
|
|
13
|
+
/**
|
|
14
|
+
* Code of the keyboard's key `esc`
|
|
15
|
+
*/
|
|
16
|
+
export declare const ESC_CODE: string;
|
|
9
17
|
/**
|
|
10
18
|
* Key of the keyboard's key 'right arrow'
|
|
11
19
|
*/
|
|
12
|
-
export declare const RIGHT_ARROW_KEY
|
|
20
|
+
export declare const RIGHT_ARROW_KEY: string;
|
|
13
21
|
/**
|
|
14
22
|
* Code of the keyboard's key 'right arrow'
|
|
15
23
|
*/
|
|
16
|
-
export declare const RIGHT_ARROW_CODE
|
|
24
|
+
export declare const RIGHT_ARROW_CODE: string;
|
|
17
25
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Used in unit tests only
|
|
26
|
+
* Key of the keyboard's key 'left arrow'
|
|
20
27
|
*/
|
|
21
|
-
export declare const
|
|
28
|
+
export declare const LEFT_ARROW_KEY: string;
|
|
29
|
+
/**
|
|
30
|
+
* Code of the keyboard's key 'left arrow'
|
|
31
|
+
*/
|
|
32
|
+
export declare const LEFT_ARROW_CODE: string;
|
|
22
33
|
/**
|
|
23
34
|
* Key of the keyboard's key 'left arrow'
|
|
24
35
|
*/
|
|
25
|
-
export declare const
|
|
36
|
+
export declare const UP_ARROW_KEY: string;
|
|
26
37
|
/**
|
|
27
38
|
* Code of the keyboard's key 'left arrow'
|
|
28
39
|
*/
|
|
29
|
-
export declare const
|
|
40
|
+
export declare const UP_ARROW_CODE: string;
|
|
41
|
+
/**
|
|
42
|
+
* Key of the keyboard's key 'left arrow'
|
|
43
|
+
*/
|
|
44
|
+
export declare const DOWN_ARROW_KEY: string;
|
|
30
45
|
/**
|
|
31
|
-
*
|
|
32
|
-
* Used in unit tests only
|
|
46
|
+
* Code of the keyboard's key 'left arrow'
|
|
33
47
|
*/
|
|
34
|
-
export declare const
|
|
48
|
+
export declare const DOWN_ARROW_CODE: string;
|
|
35
49
|
/**
|
|
36
50
|
* Key of the keyboard's key `space`
|
|
37
51
|
*/
|
|
38
|
-
export declare const SPACE_KEY
|
|
52
|
+
export declare const SPACE_KEY: string;
|
|
39
53
|
/**
|
|
40
54
|
* Code of the keyboard's key `space`
|
|
41
55
|
*/
|
|
42
|
-
export declare const SPACE_CODE
|
|
56
|
+
export declare const SPACE_CODE: string;
|
|
57
|
+
/**
|
|
58
|
+
* Const to represent the right direction
|
|
59
|
+
*/
|
|
60
|
+
export declare const DIRECTION_RIGHT: string;
|
|
43
61
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Used in unit tests only
|
|
62
|
+
* Const to represent the left direction
|
|
46
63
|
*/
|
|
47
|
-
export declare const
|
|
64
|
+
export declare const DIRECTION_LEFT: string;
|
|
48
65
|
/**
|
|
49
|
-
*
|
|
66
|
+
* Keycode of the main mouse button
|
|
50
67
|
*/
|
|
51
68
|
export declare const MOUSE_MAIN_BUTTON_CLICK = 0;
|
|
52
69
|
/**
|
|
@@ -61,11 +78,3 @@ export declare const PREV = -1;
|
|
|
61
78
|
* Const NOTHING to represents a situation when it isn't both NEXT and PREV
|
|
62
79
|
*/
|
|
63
80
|
export declare const NOTHING = 0;
|
|
64
|
-
/**
|
|
65
|
-
* Const to represent the right direction
|
|
66
|
-
*/
|
|
67
|
-
export declare const DIRECTION_RIGHT = "right";
|
|
68
|
-
/**
|
|
69
|
-
* Const to represent the left direction
|
|
70
|
-
*/
|
|
71
|
-
export declare const DIRECTION_LEFT = "left";
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ks89/angular-modal-gallery",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Image gallery for Angular",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Stefano Cappa",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=16.3.0",
|
|
9
9
|
"npm": ">=7.16.0"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://ks89.github.io/angular-modal-gallery-2020-v8.github.io/",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"tslib": ">=2.
|
|
13
|
+
"tslib": ">=2.3.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@angular/platform-browser": ">=
|
|
17
|
-
"@angular/common": ">=
|
|
18
|
-
"@angular/core": ">=
|
|
19
|
-
"@angular/cdk": ">=
|
|
16
|
+
"@angular/platform-browser": ">=13.0.0",
|
|
17
|
+
"@angular/common": ">=13.0.0",
|
|
18
|
+
"@angular/core": ">=13.0.0",
|
|
19
|
+
"@angular/cdk": ">=13.0.0",
|
|
20
20
|
"hammerjs": ">=2.0.8",
|
|
21
21
|
"mousetrap": ">=1.6.5",
|
|
22
|
-
"rxjs": ">=
|
|
22
|
+
"rxjs": ">=7.4.0"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"angular-modal-gallery",
|
|
@@ -54,11 +54,24 @@
|
|
|
54
54
|
"bugs": {
|
|
55
55
|
"url": "https://github.com/Ks89/angular-modal-gallery/issues"
|
|
56
56
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"fesm2015": "fesm2015/ks89-angular-modal-gallery.
|
|
57
|
+
"module": "fesm2015/ks89-angular-modal-gallery.mjs",
|
|
58
|
+
"es2020": "fesm2020/ks89-angular-modal-gallery.mjs",
|
|
59
|
+
"esm2020": "esm2020/ks89-angular-modal-gallery.mjs",
|
|
60
|
+
"fesm2020": "fesm2020/ks89-angular-modal-gallery.mjs",
|
|
61
|
+
"fesm2015": "fesm2015/ks89-angular-modal-gallery.mjs",
|
|
62
62
|
"typings": "ks89-angular-modal-gallery.d.ts",
|
|
63
|
+
"exports": {
|
|
64
|
+
"./package.json": {
|
|
65
|
+
"default": "./package.json"
|
|
66
|
+
},
|
|
67
|
+
".": {
|
|
68
|
+
"types": "./ks89-angular-modal-gallery.d.ts",
|
|
69
|
+
"esm2020": "./esm2020/ks89-angular-modal-gallery.mjs",
|
|
70
|
+
"es2020": "./fesm2020/ks89-angular-modal-gallery.mjs",
|
|
71
|
+
"es2015": "./fesm2015/ks89-angular-modal-gallery.mjs",
|
|
72
|
+
"node": "./fesm2015/ks89-angular-modal-gallery.mjs",
|
|
73
|
+
"default": "./fesm2020/ks89-angular-modal-gallery.mjs"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
63
76
|
"sideEffects": false
|
|
64
77
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -16,14 +16,14 @@ export { PlayConfig } from './lib/model/play-config.interface';
|
|
|
16
16
|
export { CarouselImageConfig } from './lib/model/carousel-image-config.interface';
|
|
17
17
|
export { Size } from './lib/model/size.interface';
|
|
18
18
|
export { ButtonsConfig, ButtonsStrategy, ButtonType, ButtonEvent } from './lib/model/buttons-config.interface';
|
|
19
|
-
export {
|
|
19
|
+
export { ModalLibConfig, PlainLibConfig, CarouselLibConfig } from './lib/model/lib-config.interface';
|
|
20
20
|
export { ModalGalleryConfig } from './lib/model/modal-gallery-config.interface';
|
|
21
21
|
export { CurrentImageConfig } from './lib/model/current-image-config.interface';
|
|
22
22
|
export { LoadingConfig, LoadingType } from './lib/model/loading-config.interface';
|
|
23
23
|
export { InteractionEvent } from './lib/model/interaction-event.interface';
|
|
24
24
|
export { KS_DEFAULT_ACCESSIBILITY_CONFIG } from './lib/components/accessibility-default';
|
|
25
25
|
export { KS_DEFAULT_BTN_FULL_SCREEN, KS_DEFAULT_BTN_CLOSE, KS_DEFAULT_BTN_DELETE, KS_DEFAULT_BTN_DOWNLOAD, KS_DEFAULT_BTN_EXTURL, KS_DEFAULT_SIZE } from './lib/components/upper-buttons/upper-buttons-default';
|
|
26
|
-
export { PlainGalleryConfig, PlainGalleryLayout, LineLayout, GridLayout,
|
|
26
|
+
export { PlainGalleryConfig, PlainGalleryLayout, LineLayout, GridLayout, PlainGalleryStrategy, BreakConfig } from './lib/model/plain-gallery-config.interface';
|
|
27
27
|
export { ModalGalleryComponent } from './lib/components/modal-gallery/modal-gallery.component';
|
|
28
28
|
export { PlainGalleryComponent } from './lib/components/plain-gallery/plain-gallery.component';
|
|
29
29
|
export { CarouselComponent } from './lib/components/carousel/carousel.component';
|