@ks89/angular-modal-gallery 12.0.0 → 14.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/CONTRIBUTING.md +8 -11
  3. package/LICENSE +1 -1
  4. package/README.md +10 -6
  5. package/fesm2022/ks89-angular-modal-gallery.mjs +832 -909
  6. package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
  7. package/index.d.ts +2528 -3
  8. package/package.json +8 -10
  9. package/esm2022/ks89-angular-modal-gallery.mjs +0 -5
  10. package/esm2022/lib/components/accessibility-default.mjs +0 -41
  11. package/esm2022/lib/components/accessible.component.mjs +0 -130
  12. package/esm2022/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +0 -456
  13. package/esm2022/lib/components/carousel/carousel.component.mjs +0 -738
  14. package/esm2022/lib/components/components.mjs +0 -50
  15. package/esm2022/lib/components/current-image/current-image.component.mjs +0 -607
  16. package/esm2022/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +0 -80
  17. package/esm2022/lib/components/dots/dots.component.mjs +0 -124
  18. package/esm2022/lib/components/modal-gallery/attach-to-overlay.service.mjs +0 -42
  19. package/esm2022/lib/components/modal-gallery/modal-gallery-ref.mjs +0 -103
  20. package/esm2022/lib/components/modal-gallery/modal-gallery.component.mjs +0 -499
  21. package/esm2022/lib/components/modal-gallery/modal-gallery.service.mjs +0 -168
  22. package/esm2022/lib/components/modal-gallery/modal-gallery.tokens.mjs +0 -26
  23. package/esm2022/lib/components/plain-gallery/plain-gallery.component.mjs +0 -249
  24. package/esm2022/lib/components/previews/previews.component.mjs +0 -263
  25. package/esm2022/lib/components/upper-buttons/upper-buttons-default.mjs +0 -76
  26. package/esm2022/lib/components/upper-buttons/upper-buttons.component.mjs +0 -243
  27. package/esm2022/lib/directives/a-tag-bg-image.directive.mjs +0 -78
  28. package/esm2022/lib/directives/click-outside.directive.mjs +0 -91
  29. package/esm2022/lib/directives/description.directive.mjs +0 -98
  30. package/esm2022/lib/directives/direction.directive.mjs +0 -73
  31. package/esm2022/lib/directives/directives.mjs +0 -51
  32. package/esm2022/lib/directives/fallback-image.directive.mjs +0 -59
  33. package/esm2022/lib/directives/keyboard-navigation.directive.mjs +0 -64
  34. package/esm2022/lib/directives/margin.directive.mjs +0 -84
  35. package/esm2022/lib/directives/max-size.directive.mjs +0 -75
  36. package/esm2022/lib/directives/size.directive.mjs +0 -76
  37. package/esm2022/lib/directives/swipe.directive.mjs +0 -116
  38. package/esm2022/lib/directives/wrap.directive.mjs +0 -74
  39. package/esm2022/lib/modal-gallery.module.mjs +0 -88
  40. package/esm2022/lib/model/accessibility.interface.mjs +0 -25
  41. package/esm2022/lib/model/action.enum.mjs +0 -36
  42. package/esm2022/lib/model/buttons-config.interface.mjs +0 -62
  43. package/esm2022/lib/model/carousel-config.interface.mjs +0 -25
  44. package/esm2022/lib/model/carousel-image-config.interface.mjs +0 -25
  45. package/esm2022/lib/model/carousel-preview-config.interface.mjs +0 -25
  46. package/esm2022/lib/model/current-image-config.interface.mjs +0 -25
  47. package/esm2022/lib/model/description.interface.mjs +0 -33
  48. package/esm2022/lib/model/dots-config.interface.mjs +0 -25
  49. package/esm2022/lib/model/image-internal.class.mjs +0 -35
  50. package/esm2022/lib/model/image.class.mjs +0 -56
  51. package/esm2022/lib/model/interaction-event.interface.mjs +0 -2
  52. package/esm2022/lib/model/keyboard-config.interface.mjs +0 -25
  53. package/esm2022/lib/model/keyboard.enum.mjs +0 -35
  54. package/esm2022/lib/model/lib-config.interface.mjs +0 -25
  55. package/esm2022/lib/model/loading-config.interface.mjs +0 -37
  56. package/esm2022/lib/model/max-size.interface.mjs +0 -25
  57. package/esm2022/lib/model/modal-gallery-config.interface.mjs +0 -25
  58. package/esm2022/lib/model/plain-gallery-config.interface.mjs +0 -55
  59. package/esm2022/lib/model/play-config.interface.mjs +0 -25
  60. package/esm2022/lib/model/preview-config.interface.mjs +0 -25
  61. package/esm2022/lib/model/size.interface.mjs +0 -25
  62. package/esm2022/lib/model/slide-config.interface.mjs +0 -25
  63. package/esm2022/lib/services/config.service.mjs +0 -388
  64. package/esm2022/lib/services/id-validator.service.mjs +0 -71
  65. package/esm2022/lib/utils/image.util.mjs +0 -48
  66. package/esm2022/lib/utils/user-input.util.mjs +0 -104
  67. package/esm2022/public-api.mjs +0 -42
  68. package/lib/components/accessibility-default.d.ts +0 -5
  69. package/lib/components/accessible.component.d.ts +0 -50
  70. package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -195
  71. package/lib/components/carousel/carousel.component.d.ts +0 -276
  72. package/lib/components/components.d.ts +0 -15
  73. package/lib/components/current-image/current-image.component.d.ts +0 -282
  74. package/lib/components/current-image/loading-spinner/loading-spinner.component.d.ts +0 -55
  75. package/lib/components/dots/dots.component.d.ts +0 -81
  76. package/lib/components/modal-gallery/attach-to-overlay.service.d.ts +0 -20
  77. package/lib/components/modal-gallery/modal-gallery-ref.d.ts +0 -64
  78. package/lib/components/modal-gallery/modal-gallery.component.d.ts +0 -246
  79. package/lib/components/modal-gallery/modal-gallery.service.d.ts +0 -100
  80. package/lib/components/modal-gallery/modal-gallery.tokens.d.ts +0 -3
  81. package/lib/components/plain-gallery/plain-gallery.component.d.ts +0 -135
  82. package/lib/components/previews/previews.component.d.ts +0 -155
  83. package/lib/components/upper-buttons/upper-buttons-default.d.ts +0 -29
  84. package/lib/components/upper-buttons/upper-buttons.component.d.ts +0 -132
  85. package/lib/directives/a-tag-bg-image.directive.d.ts +0 -38
  86. package/lib/directives/click-outside.directive.d.ts +0 -24
  87. package/lib/directives/description.directive.d.ts +0 -33
  88. package/lib/directives/direction.directive.d.ts +0 -36
  89. package/lib/directives/directives.d.ts +0 -15
  90. package/lib/directives/fallback-image.directive.d.ts +0 -16
  91. package/lib/directives/keyboard-navigation.directive.d.ts +0 -24
  92. package/lib/directives/margin.directive.d.ts +0 -44
  93. package/lib/directives/max-size.directive.d.ts +0 -33
  94. package/lib/directives/size.directive.d.ts +0 -33
  95. package/lib/directives/swipe.directive.d.ts +0 -35
  96. package/lib/directives/wrap.directive.d.ts +0 -36
  97. package/lib/modal-gallery.module.d.ts +0 -32
  98. package/lib/model/accessibility.interface.d.ts +0 -40
  99. package/lib/model/action.enum.d.ts +0 -11
  100. package/lib/model/buttons-config.interface.d.ts +0 -57
  101. package/lib/model/carousel-config.interface.d.ts +0 -11
  102. package/lib/model/carousel-image-config.interface.d.ts +0 -8
  103. package/lib/model/carousel-preview-config.interface.d.ts +0 -22
  104. package/lib/model/current-image-config.interface.d.ts +0 -12
  105. package/lib/model/description.interface.d.ts +0 -39
  106. package/lib/model/dots-config.interface.d.ts +0 -6
  107. package/lib/model/image-internal.class.d.ts +0 -9
  108. package/lib/model/image.class.d.ts +0 -64
  109. package/lib/model/interaction-event.interface.d.ts +0 -6
  110. package/lib/model/keyboard-config.interface.d.ts +0 -8
  111. package/lib/model/keyboard.enum.d.ts +0 -13
  112. package/lib/model/lib-config.interface.d.ts +0 -39
  113. package/lib/model/loading-config.interface.d.ts +0 -19
  114. package/lib/model/max-size.interface.d.ts +0 -8
  115. package/lib/model/modal-gallery-config.interface.d.ts +0 -16
  116. package/lib/model/plain-gallery-config.interface.d.ts +0 -57
  117. package/lib/model/play-config.interface.d.ts +0 -8
  118. package/lib/model/preview-config.interface.d.ts +0 -12
  119. package/lib/model/size.interface.d.ts +0 -8
  120. package/lib/model/slide-config.interface.d.ts +0 -17
  121. package/lib/services/config.service.d.ts +0 -39
  122. package/lib/services/id-validator.service.d.ts +0 -25
  123. package/lib/utils/image.util.d.ts +0 -10
  124. package/lib/utils/user-input.util.d.ts +0 -80
  125. package/public-api.d.ts +0 -31
package/index.d.ts CHANGED
@@ -1,5 +1,2530 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, OnChanges, EventEmitter, SimpleChanges, TemplateRef, AfterContentInit, OnDestroy, NgZone, ChangeDetectorRef, Renderer2, ElementRef } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import * as i2 from '@angular/cdk/overlay';
5
+ import { OverlayRef, Overlay } from '@angular/cdk/overlay';
6
+ import { SafeResourceUrl, DomSanitizer, SafeStyle } from '@angular/platform-browser';
7
+ import * as rxjs from 'rxjs';
8
+ import { BreakpointObserver } from '@angular/cdk/layout';
9
+
1
10
  /**
2
- * Generated bundle index. Do not edit.
11
+ * Interface `Accessibility` to config titles, alt texts, aria labels and so on
3
12
  */
4
- /// <amd-module name="@ks89/angular-modal-gallery" />
5
- export * from './public-api';
13
+ interface AccessibilityConfig {
14
+ backgroundAriaLabel: string;
15
+ backgroundTitle: string;
16
+ plainGalleryContentAriaLabel: string;
17
+ plainGalleryContentTitle: string;
18
+ modalGalleryContentAriaLabel: string;
19
+ modalGalleryContentTitle: string;
20
+ loadingSpinnerAriaLabel: string;
21
+ loadingSpinnerTitle: string;
22
+ mainContainerAriaLabel: string;
23
+ mainContainerTitle: string;
24
+ mainPrevImageAriaLabel: string;
25
+ mainPrevImageTitle: string;
26
+ mainNextImageAriaLabel: string;
27
+ mainNextImageTitle: string;
28
+ dotsContainerAriaLabel: string;
29
+ dotsContainerTitle: string;
30
+ dotAriaLabel: string;
31
+ previewsContainerAriaLabel: string;
32
+ previewsContainerTitle: string;
33
+ previewScrollPrevAriaLabel: string;
34
+ previewScrollPrevTitle: string;
35
+ previewScrollNextAriaLabel: string;
36
+ previewScrollNextTitle: string;
37
+ carouselContainerAriaLabel: string;
38
+ carouselContainerTitle: string;
39
+ carouselPrevImageAriaLabel: string;
40
+ carouselPrevImageTitle: string;
41
+ carouselNextImageAriaLabel: string;
42
+ carouselNextImageTitle: string;
43
+ carouselPreviewsContainerAriaLabel: string;
44
+ carouselPreviewsContainerTitle: string;
45
+ carouselPreviewScrollPrevAriaLabel: string;
46
+ carouselPreviewScrollPrevTitle: string;
47
+ carouselPreviewScrollNextAriaLabel: string;
48
+ carouselPreviewScrollNextTitle: string;
49
+ }
50
+
51
+ /**
52
+ * Enum `Action` with a list of possible actions, based on the source of the action.
53
+ */
54
+ declare enum Action {
55
+ NORMAL = 0,// default value
56
+ CLICK = 1,// mouse click
57
+ KEYBOARD = 2,
58
+ SWIPE = 3,
59
+ LOAD = 4,
60
+ AUTOPLAY = 5
61
+ }
62
+
63
+ /**
64
+ * Interface `Size` to configure the size based on width and height.
65
+ * They can be pixels, percentages or also 'auto'.
66
+ */
67
+ interface Size {
68
+ width: string;
69
+ height: string;
70
+ }
71
+
72
+ /**
73
+ * Class `Image` that represents an image with both `modal` and `plain` configurations.
74
+ * Both image `id` and `modal` are mandatory, instead `plain` is optional.
75
+ */
76
+ declare class Image {
77
+ id: number;
78
+ loading: 'eager' | 'lazy';
79
+ fetchpriority: 'high' | 'low' | 'auto';
80
+ modal: ModalImage;
81
+ plain?: PlainImage;
82
+ constructor(id: number, modal: ModalImage, plain?: PlainImage, loading?: 'eager' | 'lazy', fetchpriority?: 'high' | 'low' | 'auto');
83
+ }
84
+ /**
85
+ * Interface `ImageData` to configure an image, but it isn't used directly.
86
+ * Please, refers to `PlainImage` or `ModalImage`.
87
+ */
88
+ interface ImageData {
89
+ img: string | SafeResourceUrl;
90
+ description?: string;
91
+ title?: string;
92
+ alt?: string;
93
+ ariaLabel?: string;
94
+ fallbackImg?: string | SafeResourceUrl;
95
+ }
96
+ /**
97
+ * Interface `ModalImage` to configure the modal image.
98
+ */
99
+ interface ModalImage extends ImageData {
100
+ extUrl?: string;
101
+ downloadFileName?: string;
102
+ sources?: Source[];
103
+ }
104
+ /**
105
+ * Interface `PlainImage` to configure the plain image.
106
+ */
107
+ interface PlainImage extends ImageData {
108
+ size?: Size;
109
+ }
110
+ /**
111
+ * Class `ImageEvent` that represents the event payload with the result and the triggered action.
112
+ * It also contains the source id of the gallery that emitted this event
113
+ */
114
+ declare class ImageEvent {
115
+ galleryId: number;
116
+ action: Action;
117
+ result: number | boolean;
118
+ constructor(galleryId: number, action: Action, result: number | boolean);
119
+ }
120
+ /**
121
+ * Class `ImageModalEvent` that represents the event payload with galleryId, result and the triggered action.
122
+ */
123
+ declare class ImageModalEvent extends ImageEvent {
124
+ constructor(galleryId: number, action: Action, result: number | boolean);
125
+ }
126
+ /**
127
+ * Interface `Source` to configure sources of picture element.
128
+ */
129
+ interface Source {
130
+ srcset: string;
131
+ media: string;
132
+ }
133
+
134
+ /**
135
+ * Interface `PlainGalleryConfig` to configure plain-gallery features.
136
+ */
137
+ interface PlainGalleryConfig {
138
+ strategy: PlainGalleryStrategy;
139
+ layout: PlainGalleryLayout;
140
+ advanced?: AdvancedConfig;
141
+ }
142
+ /**
143
+ * Interface `PlainGalleryLayout` to configure the layout. This interface isn't used directly, instead
144
+ * refers to either `LineLayout`, `GridLayout`.
145
+ */
146
+ interface PlainGalleryLayout {
147
+ }
148
+ /**
149
+ * Class `LineLayout` to configure a linear plain gallery.
150
+ */
151
+ declare class LineLayout implements PlainGalleryLayout {
152
+ breakConfig: BreakConfig;
153
+ justify: string;
154
+ size: Size;
155
+ constructor(size: Size, breakConfig: BreakConfig, justify: string);
156
+ }
157
+ /**
158
+ * Class `GridLayout` to configure a grid plain gallery.
159
+ */
160
+ declare class GridLayout implements PlainGalleryLayout {
161
+ breakConfig: BreakConfig;
162
+ size: Size;
163
+ constructor(size: Size, breakConfig: BreakConfig);
164
+ }
165
+ /**
166
+ * Enum `PlainGalleryStrategy` to choose the behaviour of the plain gallery.
167
+ */
168
+ declare enum PlainGalleryStrategy {
169
+ ROW = 1,
170
+ COLUMN = 2,
171
+ GRID = 3,
172
+ CUSTOM = 4
173
+ }
174
+ /**
175
+ * Interface `BreakConfig` to limit the number of items of the plain gallery or to force it to fill other lines.
176
+ */
177
+ interface BreakConfig {
178
+ length: number;
179
+ wrap: boolean;
180
+ }
181
+ /**
182
+ * Interface `AdvancedConfig` to use `<a>` tags instead of `<img>`.
183
+ * It also contains a string property to customize the css background property.
184
+ * For more info check here https://www.w3schools.com/cssref/css3_pr_background.asp
185
+ */
186
+ interface AdvancedConfig {
187
+ aTags: boolean;
188
+ additionalBackground: string;
189
+ }
190
+
191
+ /**
192
+ * Interface `PlayConfig` to change the behaviour about auto-navigation for both modal gallery and carousel.
193
+ */
194
+ interface PlayConfig {
195
+ autoPlay: boolean;
196
+ interval: number;
197
+ pauseOnHover: boolean;
198
+ }
199
+
200
+ /**
201
+ * Interface `SlideConfig` to configure sliding features of modal gallery.
202
+ */
203
+ interface SlideConfig {
204
+ infinite?: boolean;
205
+ playConfig?: PlayConfig;
206
+ sidePreviews?: SidePreviewsConfig;
207
+ }
208
+ /**
209
+ * Interface `SidePreviewsConfig` to configure sliding features of previews in modal gallery.
210
+ */
211
+ interface SidePreviewsConfig {
212
+ show: boolean;
213
+ size: Size;
214
+ }
215
+
216
+ /**
217
+ * Interface `PreviewConfig` to configure previews in modal gallery.
218
+ */
219
+ interface PreviewConfig {
220
+ visible: boolean;
221
+ mobileVisible?: boolean;
222
+ number?: number;
223
+ arrows?: boolean;
224
+ clickable?: boolean;
225
+ size?: Size;
226
+ }
227
+
228
+ /**
229
+ * Interface `LoadingConfig` to configure loading icon.
230
+ */
231
+ interface LoadingConfig {
232
+ enable: boolean;
233
+ type: LoadingType;
234
+ }
235
+ /**
236
+ * Enum `LoadingType` with a list of possible types.
237
+ */
238
+ declare enum LoadingType {
239
+ STANDARD = 1,
240
+ CIRCULAR = 2,
241
+ BARS = 3,
242
+ DOTS = 4,
243
+ CUBE_FLIPPING = 5,
244
+ CIRCLES = 6,
245
+ EXPLOSING_SQUARES = 7
246
+ }
247
+
248
+ /**
249
+ * Interface `Description` to change the description, either with a full custom
250
+ * description or with a small and simple customization.
251
+ * Also, you could change margins, background style and so on.
252
+ */
253
+ interface Description {
254
+ strategy: DescriptionStrategy;
255
+ customFullDescription?: string;
256
+ imageText?: string;
257
+ numberSeparator?: string;
258
+ beforeTextDescription?: string;
259
+ style?: DescriptionStyle;
260
+ }
261
+ /**
262
+ * Enum `DescriptionStrategy` with keys and their relative key codes.
263
+ */
264
+ declare enum DescriptionStrategy {
265
+ ALWAYS_HIDDEN = 1,
266
+ ALWAYS_VISIBLE = 2,
267
+ HIDE_IF_EMPTY = 3
268
+ }
269
+ /**
270
+ * Interface to change css properties.
271
+ */
272
+ interface DescriptionStyle {
273
+ bgColor?: string;
274
+ textColor?: string;
275
+ width?: string;
276
+ height?: string;
277
+ position?: string;
278
+ top?: string;
279
+ bottom?: string;
280
+ left?: string;
281
+ right?: string;
282
+ marginTop?: string;
283
+ marginBottom?: string;
284
+ marginRight?: string;
285
+ marginLeft?: string;
286
+ }
287
+
288
+ /**
289
+ * Interface `CurrentImageConfig` to change current image behaviour in modal-gallery.
290
+ */
291
+ interface CurrentImageConfig {
292
+ navigateOnClick?: boolean;
293
+ downloadable?: boolean;
294
+ loadingConfig?: LoadingConfig;
295
+ description?: Description;
296
+ invertSwipe?: boolean;
297
+ }
298
+
299
+ /**
300
+ * Interface `CarouselConfig` to change the style of the carousel and some additional features.
301
+ */
302
+ interface CarouselConfig {
303
+ maxWidth: string;
304
+ maxHeight: string;
305
+ showArrows: boolean;
306
+ objectFit: string;
307
+ keyboardEnable: boolean;
308
+ modalGalleryEnable: boolean;
309
+ }
310
+
311
+ /**
312
+ * Interface `CarouselImageConfig` to change current image behaviour in carousel.
313
+ */
314
+ interface CarouselImageConfig {
315
+ description?: Description;
316
+ invertSwipe?: boolean;
317
+ }
318
+
319
+ /**
320
+ * Interface `BreakpointsConfig` to configure responsive breakpoints as numbers to express pixels
321
+ */
322
+ interface BreakpointsConfig {
323
+ xSmall: number;
324
+ small: number;
325
+ medium: number;
326
+ large: number;
327
+ xLarge: number;
328
+ }
329
+ /**
330
+ * Interface `CarouselPreviewConfig` to configure carousel's previews
331
+ */
332
+ interface CarouselPreviewConfig {
333
+ visible: boolean;
334
+ number?: number;
335
+ arrows?: boolean;
336
+ clickable?: boolean;
337
+ width?: string;
338
+ maxHeight?: string;
339
+ breakpoints?: BreakpointsConfig;
340
+ }
341
+
342
+ /**
343
+ * Internal representation of an image adding other fields
344
+ * to the public `Image` class.
345
+ */
346
+ declare class InternalLibImage extends Image {
347
+ previouslyLoaded: boolean;
348
+ constructor(id: number, modal: ModalImage, plain?: PlainImage, previouslyLoaded?: boolean);
349
+ }
350
+
351
+ /**
352
+ * Interface `ButtonsConfig` to add buttons, show/hide their, and to add the strategy.
353
+ */
354
+ interface ButtonsConfig {
355
+ visible: boolean;
356
+ strategy: ButtonsStrategy;
357
+ buttons?: ButtonConfig[];
358
+ }
359
+ /**
360
+ * Interface `ButtonConfig` to configure a single button.
361
+ */
362
+ interface ButtonConfig {
363
+ className?: string;
364
+ size?: Size;
365
+ fontSize?: string;
366
+ type: ButtonType;
367
+ title?: string;
368
+ ariaLabel?: string;
369
+ extUrlInNewTab?: boolean;
370
+ }
371
+ /**
372
+ * Interface `ButtonEvent` to represent the event payload when a button is clicked.
373
+ */
374
+ interface ButtonEvent {
375
+ button: ButtonConfig;
376
+ image: InternalLibImage | null;
377
+ action: Action;
378
+ galleryId: number;
379
+ }
380
+ /**
381
+ * Enum `ButtonsStrategy` to configure the logic of a button.
382
+ */
383
+ declare enum ButtonsStrategy {
384
+ DEFAULT = 1,
385
+ SIMPLE = 2,
386
+ ADVANCED = 3,
387
+ FULL = 4,
388
+ CUSTOM = 5
389
+ }
390
+ /**
391
+ * Enum `ButtonType` is the type of a button.
392
+ */
393
+ declare enum ButtonType {
394
+ DELETE = 1,
395
+ EXTURL = 2,
396
+ DOWNLOAD = 3,
397
+ CLOSE = 4,
398
+ CUSTOM = 5,
399
+ FULLSCREEN = 6
400
+ }
401
+
402
+ /**
403
+ * Interface `DotsConfig` to show/hide dots.
404
+ */
405
+ interface DotsConfig {
406
+ visible: boolean;
407
+ }
408
+
409
+ /**
410
+ * Interface `KeyboardConfig` to assign custom codes to ESC, RIGHT and LEFT keyboard's actions.
411
+ */
412
+ interface KeyboardConfig {
413
+ esc?: string;
414
+ right?: string;
415
+ left?: string;
416
+ }
417
+
418
+ interface AccessibleLibConfig {
419
+ accessibilityConfig?: AccessibilityConfig;
420
+ }
421
+ interface CommonLibConfig {
422
+ previewConfig?: PreviewConfig;
423
+ dotsConfig?: DotsConfig;
424
+ slideConfig?: SlideConfig;
425
+ }
426
+ interface CarouselLibConfig extends CommonLibConfig, AccessibleLibConfig {
427
+ carouselConfig?: CarouselConfig;
428
+ carouselImageConfig?: CarouselImageConfig;
429
+ carouselPreviewsConfig?: CarouselPreviewConfig;
430
+ carouselPlayConfig?: PlayConfig;
431
+ carouselDotsConfig?: DotsConfig;
432
+ carouselSlideInfinite?: boolean;
433
+ }
434
+ interface ModalLibConfig extends CommonLibConfig, AccessibleLibConfig {
435
+ enableCloseOutside?: boolean;
436
+ keyboardConfig?: KeyboardConfig;
437
+ currentImageConfig?: CurrentImageConfig;
438
+ buttonsConfig?: ButtonsConfig;
439
+ }
440
+ interface PlainLibConfig extends AccessibleLibConfig {
441
+ plainGalleryConfig?: PlainGalleryConfig;
442
+ }
443
+ interface LibConfig extends ModalLibConfig, PlainLibConfig, CarouselLibConfig {
444
+ }
445
+
446
+ /**
447
+ * Service to handle library configuration in a unique place
448
+ */
449
+ declare class ConfigService {
450
+ configMap: Map<number, LibConfig>;
451
+ getConfig(id: number): LibConfig | undefined;
452
+ setConfig(id: number, obj: LibConfig | undefined): void;
453
+ private initIfNotExists;
454
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigService, never>;
455
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConfigService>;
456
+ }
457
+
458
+ /**
459
+ * Provides some useful methods to add accessibility features to subclasses.
460
+ * In particular, it exposes a method to handle navigation event with both Keyboard and Mouse
461
+ * and another with also the direction (right or left).
462
+ */
463
+ declare class AccessibleComponent {
464
+ constructor();
465
+ /**
466
+ * Method to handle navigation events with both Keyboard and Mouse.
467
+ * @param direction string of the navigation that can be either 'next' or 'prev'
468
+ * @param event KeyboardEvent | MouseEvent payload
469
+ * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
470
+ */
471
+ handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number;
472
+ /**
473
+ * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
474
+ * @param event KeyboardEvent | MouseEvent payload
475
+ * @returns number 1 for NEXT and 0 for NOTHING
476
+ */
477
+ handleImageEvent(event: KeyboardEvent | MouseEvent): number;
478
+ /**
479
+ * Private method to handle keyboard events over an image.
480
+ * @param event KeyboardEvent payload
481
+ * @returns number 1 for NEXT and 0 for NOTHING
482
+ */
483
+ private handleImageKeyboardEvent;
484
+ /**
485
+ * Private method to handle mouse events over an image.
486
+ * @param event MouseEvent payload
487
+ * @returns number 1 for NEXT and 0 for NOTHING
488
+ */
489
+ private handleImageMouseEvent;
490
+ /**
491
+ * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
492
+ * @param direction string of the navigation that can be either 'next' or 'prev'
493
+ * @param event KeyboardEvent payload
494
+ * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
495
+ */
496
+ private handleKeyboardNavigationEvent;
497
+ /**
498
+ * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
499
+ * @param direction string of the navigation that can be either 'next' or 'prev'
500
+ * @param event MouseEvent payload
501
+ * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
502
+ */
503
+ private handleMouseNavigationEvent;
504
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccessibleComponent, never>;
505
+ static ɵcmp: i0.ɵɵComponentDeclaration<AccessibleComponent, "ks-accessible", never, {}, {}, never, never, true, never>;
506
+ }
507
+
508
+ /**
509
+ * Component with the gallery of thumbs.
510
+ * In receives an array of Images, a boolean to show/hide
511
+ * the gallery (feature used by imagePointer) and a config
512
+ * object to customize the behaviour of this component.
513
+ * Also, it emits click events as outputs.
514
+ */
515
+ declare class PlainGalleryComponent extends AccessibleComponent implements OnInit, OnChanges {
516
+ private configService;
517
+ /**
518
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
519
+ * the service to call modal gallery.
520
+ */
521
+ id: number | undefined;
522
+ /**
523
+ * Array of `Image` that represent the model of this library with all images, thumbs and so on.
524
+ */
525
+ images: Image[];
526
+ /**
527
+ * PlainLibConfig object to configure plain-gallery.
528
+ */
529
+ config: PlainLibConfig | undefined;
530
+ /**
531
+ * Output to emit an event when an image is clicked.
532
+ */
533
+ clickImage: EventEmitter<number>;
534
+ /**
535
+ * Object of type `PlainGalleryConfig` to configure the plain gallery.
536
+ */
537
+ plainGalleryConfig: PlainGalleryConfig | undefined;
538
+ /**
539
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
540
+ * For instance, it contains titles, alt texts, aria-labels and so on.
541
+ */
542
+ accessibilityConfig: AccessibilityConfig | undefined;
543
+ /**
544
+ * Bi-dimensional array of `Image` object to store images to display as plain gallery.
545
+ * [] by default.
546
+ */
547
+ imageGrid: Image[][];
548
+ /**
549
+ * Size object used in the template to resize images.
550
+ */
551
+ size: Size | undefined;
552
+ /**
553
+ * Boolean passed as input to `ks-wrap` directive to configure flex-wrap css property.
554
+ * However, it's not enough, because you need to limit the width using `widthStyle` public variable.
555
+ * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-wrap
556
+ */
557
+ wrapStyle: boolean;
558
+ /**
559
+ * String passed as input to `ks-wrap` directive to set width to be able to force overflow.
560
+ * In this way, `wrapStyle` (flex-wrap css property) will be used as requested.
561
+ */
562
+ widthStyle: string;
563
+ /**
564
+ * String passed as input to `ks-direction` directive to set the flex-direction css property.
565
+ * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-direction
566
+ */
567
+ directionStyle: string | undefined;
568
+ /**
569
+ * String passed as input to `ks-direction` directive to set the justify-content css property.
570
+ * For more info check https://developer.mozilla.org/it/docs/Web/CSS/justify-content
571
+ */
572
+ justifyStyle: string | undefined;
573
+ constructor(configService: ConfigService);
574
+ /**
575
+ * Method ´ngOnInit´ to init both `configPlainGallery` calling `initPlainGalleryConfig()`
576
+ * and `imageGrid invoking `initImageGrid()`.
577
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
578
+ * In particular, it's called only one time!!!
579
+ */
580
+ ngOnInit(): void;
581
+ /**
582
+ * Method ´ngOnChanges´ to update both `imageGrid` and`plainGalleryConfig`.
583
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
584
+ * In particular, it's called when any data-bound property of a directive changes!!!
585
+ */
586
+ ngOnChanges(changes: SimpleChanges): void;
587
+ /**
588
+ * Method called when you click on an image of the plain (or inline) gallery.
589
+ * This will emit the show event with the image as payload.
590
+ * @param img is the Image to show
591
+ */
592
+ showModalGalleryByImage(img: Image): void;
593
+ /**
594
+ * Method called when you navigate between images.
595
+ * This will emit the show event with the image as payload.
596
+ * @param event KeyboardEvent that triggered the navigation
597
+ * @param img is the Image to show
598
+ */
599
+ onNavigationEvent(event: KeyboardEvent, img: Image): void;
600
+ /**
601
+ * Method to get `alt attribute`.
602
+ * `alt` specifies an alternate text for an image, if the image cannot be displayed.
603
+ * @param image to get its alt description.
604
+ * @returns string alt description of the image
605
+ */
606
+ getAltPlainDescriptionByImage(image: Image): string;
607
+ /**
608
+ * Method to get the title for an image.
609
+ * @param image to get its title
610
+ * @returns string the title of the input image
611
+ */
612
+ getTitleDisplay(image: Image): string;
613
+ /**
614
+ * Method called when you click on an image of the plain (or inline) gallery.
615
+ * This will emit the show event with the index number as payload.
616
+ * @param index number of the clicked image
617
+ */
618
+ private showModalGallery;
619
+ /**
620
+ * Private method to init both `imageGrid` and other style variables,
621
+ * based on the layout type.
622
+ */
623
+ private initImageGrid;
624
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlainGalleryComponent, never>;
625
+ static ɵcmp: i0.ɵɵComponentDeclaration<PlainGalleryComponent, "ks-plain-gallery", never, { "id": { "alias": "id"; "required": false; }; "images": { "alias": "images"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "clickImage": "clickImage"; }, never, never, true, never>;
626
+ }
627
+
628
+ /**
629
+ * Class that represents the modal dialog instance.
630
+ * It is returned by the open method.
631
+ */
632
+ declare class ModalGalleryRef {
633
+ private overlayRef;
634
+ private close;
635
+ close$: rxjs.Observable<ImageModalEvent>;
636
+ private show;
637
+ show$: rxjs.Observable<ImageModalEvent>;
638
+ private firstImage;
639
+ firstImage$: rxjs.Observable<ImageModalEvent>;
640
+ private lastImage;
641
+ lastImage$: rxjs.Observable<ImageModalEvent>;
642
+ private hasData;
643
+ hasData$: rxjs.Observable<ImageModalEvent>;
644
+ private buttonBeforeHook;
645
+ buttonBeforeHook$: rxjs.Observable<ButtonEvent>;
646
+ private buttonAfterHook;
647
+ buttonAfterHook$: rxjs.Observable<ButtonEvent>;
648
+ constructor(overlayRef: OverlayRef);
649
+ /**
650
+ * Close modal dialog, disposing the Overlay.
651
+ */
652
+ closeModal(): void;
653
+ /**
654
+ * Method to emit close event.
655
+ * @param event ImageModalEvent event payload
656
+ */
657
+ emitClose(event: ImageModalEvent): void;
658
+ /**
659
+ * Method to emit show event.
660
+ * @param event ImageModalEvent event payload
661
+ */
662
+ emitShow(event: ImageModalEvent): void;
663
+ /**
664
+ * Method to emit firstImage event.
665
+ * @param event ImageModalEvent event payload
666
+ */
667
+ emitFirstImage(event: ImageModalEvent): void;
668
+ /**
669
+ * Method to emit lastImage event.
670
+ * @param event ImageModalEvent event payload
671
+ */
672
+ emitLastImage(event: ImageModalEvent): void;
673
+ /**
674
+ * Method to emit hasData event.
675
+ * @param event ImageModalEvent event payload
676
+ */
677
+ emitHasData(event: ImageModalEvent): void;
678
+ /**
679
+ * Method to emit buttonBeforeHook event.
680
+ * @param event ImageModalEvent event payload
681
+ */
682
+ emitButtonBeforeHook(event: ButtonEvent): void;
683
+ /**
684
+ * Method to emit buttonAfterHook event.
685
+ * @param event ImageModalEvent event payload
686
+ */
687
+ emitButtonAfterHook(event: ButtonEvent): void;
688
+ }
689
+
690
+ interface ModalGalleryConfig {
691
+ id: number;
692
+ images: Image[];
693
+ currentImage: Image;
694
+ libConfig?: ModalLibConfig;
695
+ /**
696
+ * Optional template reference for the rendering of previews.
697
+ * Template may access following context variables:
698
+ * - "preview": the `Image` object of the preview
699
+ * - "defaultTemplate": the template used by default to render the preview (in case the need is to augment it)
700
+ */
701
+ previewsTemplate?: TemplateRef<HTMLElement>;
702
+ }
703
+
704
+ /**
705
+ * Payload to be emitted via {@link triggerAttachToOverlay} to enable {@link AttachToOverlayService}
706
+ * to attach the {@link ModalGalleryComponent} to the overlay
707
+ */
708
+ interface AttachToOverlayPayload {
709
+ /**
710
+ * Overlay object created using Angular CDK APIs
711
+ */
712
+ overlayRef: OverlayRef;
713
+ /**
714
+ * Dialog data to be injected into the {@link ModalGalleryComponent}
715
+ * contains: id, array of images, current image and optionally the configuration object
716
+ */
717
+ config: ModalGalleryConfig;
718
+ /**
719
+ * Object to control the dialog instance
720
+ */
721
+ dialogRef: ModalGalleryRef;
722
+ }
723
+ declare class ModalGalleryService {
724
+ private overlay;
725
+ private configService;
726
+ private updateImages;
727
+ updateImages$: rxjs.Observable<Image[]>;
728
+ private dialogRef;
729
+ triggerAttachToOverlay: EventEmitter<AttachToOverlayPayload>;
730
+ constructor(overlay: Overlay, configService: ConfigService);
731
+ /**
732
+ * Method to open modal gallery passing the configuration
733
+ * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object
734
+ * @return ModalGalleryRef | undefined is the object used to listen for events.
735
+ */
736
+ open(config: ModalGalleryConfig): ModalGalleryRef | undefined;
737
+ /**
738
+ * Method to close a modal gallery previously opened.
739
+ * @param id Unique identifier of the modal gallery
740
+ * @param clickOutside boolean is true if closed clicking on the modal backdrop, false otherwise.
741
+ */
742
+ close(id: number, clickOutside: boolean): void;
743
+ /**
744
+ * Method to update images array.
745
+ * @param images Image[] updated array of images
746
+ */
747
+ updateModalImages(images: Image[]): void;
748
+ /**
749
+ * Method to emit close event.
750
+ * @param event ImageModalEvent is the event payload
751
+ */
752
+ emitClose(event: ImageModalEvent): void;
753
+ /**
754
+ * Method to emit show event.
755
+ * @param event ImageModalEvent is the event payload
756
+ */
757
+ emitShow(event: ImageModalEvent): void;
758
+ /**
759
+ * Method to emit firstImage event.
760
+ * @param event ImageModalEvent is the event payload
761
+ */
762
+ emitFirstImage(event: ImageModalEvent): void;
763
+ /**
764
+ * Method to emit lastImage event.
765
+ * @param event ImageModalEvent is the event payload
766
+ */
767
+ emitLastImage(event: ImageModalEvent): void;
768
+ /**
769
+ * Method to emit hasData event.
770
+ * @param event ImageModalEvent is the event payload
771
+ */
772
+ emitHasData(event: ImageModalEvent): void;
773
+ /**
774
+ * Method to emit buttonBeforeHook event.
775
+ * @param event ButtonEvent is the event payload
776
+ */
777
+ emitButtonBeforeHook(event: ButtonEvent): void;
778
+ /**
779
+ * Method to emit buttonAfterHook event.
780
+ * @param event ButtonEvent is the event payload
781
+ */
782
+ emitButtonAfterHook(event: ButtonEvent): void;
783
+ /**
784
+ * Private method to create an Overlay using Angular CDK APIs
785
+ * @private
786
+ */
787
+ private createOverlay;
788
+ /**
789
+ * Private method to create an OverlayConfig instance
790
+ * @private
791
+ */
792
+ private getOverlayConfig;
793
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalGalleryService, never>;
794
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModalGalleryService>;
795
+ }
796
+
797
+ /**
798
+ * Component with configurable inline/plain carousel.
799
+ */
800
+ declare class CarouselComponent extends AccessibleComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {
801
+ private platformId;
802
+ private ngZone;
803
+ private modalGalleryService;
804
+ private configService;
805
+ private ref;
806
+ /**
807
+ * Attribute to set ariaLabel of the host component
808
+ */
809
+ ariaLabel: string;
810
+ /**
811
+ * Unique id (>=0) of the current instance of the carousel. This is useful when you are using
812
+ * the carousel's feature to open modal gallery.
813
+ */
814
+ id: number | undefined;
815
+ /**
816
+ * Array of `InternalLibImage` that represent the model of this library with all images,
817
+ * thumbs and so on.
818
+ */
819
+ images: Image[];
820
+ /**
821
+ * CarouselLibConfig object to configure carousel.
822
+ */
823
+ config: CarouselLibConfig | undefined;
824
+ /**
825
+ * Output to emit an event when an image is clicked.
826
+ */
827
+ clickImage: EventEmitter<number>;
828
+ /**
829
+ * Output to emit an event when current image is changed.
830
+ */
831
+ changeImage: EventEmitter<ImageEvent>;
832
+ /**
833
+ * Output to emit an event when the current image is the first one.
834
+ */
835
+ firstImage: EventEmitter<ImageEvent>;
836
+ /**
837
+ * Output to emit an event when the current image is the last one.
838
+ */
839
+ lastImage: EventEmitter<ImageEvent>;
840
+ /**
841
+ * Object of type `CarouselConfig` to init CarouselComponent's features.
842
+ * For instance, it contains parameters to change the style, how it navigates and so on.
843
+ */
844
+ carouselConfig: CarouselConfig | undefined;
845
+ /**
846
+ * Object of type `DotsConfig` to init DotsComponent's features.
847
+ * For instance, it contains a param to show/hide this component.
848
+ */
849
+ carouselDotsConfig: DotsConfig | undefined;
850
+ /**
851
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
852
+ * For instance, it contains titles, alt texts, aria-labels and so on.
853
+ */
854
+ accessibilityConfig: AccessibilityConfig | undefined;
855
+ /**
856
+ * Object of type `CarouselImageConfig` to configure the current image of the carousel.
857
+ */
858
+ carouselImageConfig: CarouselImageConfig | undefined;
859
+ /**
860
+ * Enable/disable infinite sliding.
861
+ */
862
+ carouselSlideInfinite: boolean | undefined;
863
+ /**
864
+ * Enum of type `Action` that represents a mouse click on a button.
865
+ * Declared here to be used inside the template.
866
+ */
867
+ clickAction: Action;
868
+ /**
869
+ * Enum of type `Action` that represents a keyboard action.
870
+ * Declared here to be used inside the template.
871
+ */
872
+ keyboardAction: Action;
873
+ /**
874
+ * `Image` that is visible right now.
875
+ */
876
+ currentImage: InternalLibImage | undefined;
877
+ /**
878
+ * Boolean that it's true when you are watching the first image (currently visible).
879
+ * False by default
880
+ */
881
+ isFirstImage: boolean;
882
+ /**
883
+ * Boolean that it's true when you are watching the last image (currently visible).
884
+ * False by default
885
+ */
886
+ isLastImage: boolean;
887
+ /**
888
+ * Subject to play the carousel.
889
+ */
890
+ private start$;
891
+ /**
892
+ * Subject to stop the carousel.
893
+ */
894
+ private stop$;
895
+ /**
896
+ * Listener to stop the gallery when the mouse pointer is over the current image.
897
+ */
898
+ onMouseEnter(): void;
899
+ /**
900
+ * Listener to play the gallery when the mouse pointer leave the current image.
901
+ */
902
+ onMouseLeave(): void;
903
+ /**
904
+ * Listener to navigate carousel images with keyboard (left).
905
+ */
906
+ onKeyDownLeft(): void;
907
+ /**
908
+ * Listener to navigate carousel images with keyboard (right).
909
+ */
910
+ onKeyDownLRight(): void;
911
+ constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef);
912
+ ngOnInit(): void;
913
+ ngOnChanges(changes: SimpleChanges): void;
914
+ ngAfterContentInit(): void;
915
+ /**
916
+ * Method called when a dot is clicked and used to update the current image.
917
+ * @param index number of the clicked dot
918
+ */
919
+ onClickDot(index: number): void;
920
+ /**
921
+ * Method called by events from both keyboard and mouse on a navigation arrow.
922
+ * @param direction string of the navigation that can be either 'next' or 'prev'
923
+ * @param event KeyboardEvent | MouseEvent payload
924
+ * @param action Action that triggered the event or `Action.NORMAL` if not provided
925
+ */
926
+ onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action): void;
927
+ /**
928
+ * Method triggered when you click on the current image.
929
+ * Also, if modalGalleryEnable is true, you can open the modal-gallery.
930
+ */
931
+ onClickCurrentImage(): void;
932
+ /**
933
+ * Method to get the image description based on input params.
934
+ * If you provide a full description this will be the visible description, otherwise,
935
+ * it will be built using the `Description` object, concatenating its fields.
936
+ * @param image Image to get its description. If not provided it will be the current image
937
+ * @returns String description of the image (or the current image if not provided)
938
+ * @throws an Error if description isn't available
939
+ */
940
+ getDescriptionToDisplay(image?: Image | undefined): string;
941
+ /**
942
+ * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).
943
+ * @param action String that represent the direction of the swipe action. 'swiperight' by default.
944
+ */
945
+ swipe(action?: string): void;
946
+ /**
947
+ * Method to go back to the previous image.
948
+ * @param action Enum of type `Action` that represents the source
949
+ * action that moved back to the previous image. `Action.NORMAL` by default.
950
+ */
951
+ prevImage(action?: Action): void;
952
+ /**
953
+ * Method to go back to the previous image.
954
+ * @param action Enum of type `Action` that represents the source
955
+ * action that moved to the next image. `Action.NORMAL` by default.
956
+ */
957
+ nextImage(action?: Action): void;
958
+ /**
959
+ * Method called when an image preview is clicked and used to update the current image.
960
+ * @param event an ImageEvent object with the relative action and the index of the clicked preview.
961
+ */
962
+ onClickPreview(event: ImageEvent): void;
963
+ /**
964
+ * Method to play carousel.
965
+ */
966
+ playCarousel(): void;
967
+ /**
968
+ * Stops the carousel from cycling through items.
969
+ */
970
+ stopCarousel(): void;
971
+ /**
972
+ * Method to get `alt attribute`.
973
+ * `alt` specifies an alternate text for an image, if the image cannot be displayed.
974
+ * @param image Image to get its alt description. If not provided it will be the current image
975
+ * @returns String alt description of the image (or the current image if not provided)
976
+ */
977
+ getAltDescriptionByImage(image?: Image | undefined): string;
978
+ /**
979
+ * Method to get the title attributes based on descriptions.
980
+ * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,
981
+ * it prevents an empty string as title.
982
+ * @param image Image to get its description. If not provided it will be the current image
983
+ * @returns String title of the image based on descriptions
984
+ * @throws an Error if description isn't available
985
+ */
986
+ getTitleToDisplay(image?: Image | undefined): string;
987
+ /**
988
+ * Method to reset carousel (force image with index 0 to be the current image and re-init also previews)
989
+ */
990
+ /**
991
+ * Method to clean up resources. In fact, this will stop the carousel.
992
+ * This is an angular lifecycle hook that is called when this component is destroyed.
993
+ */
994
+ ngOnDestroy(): void;
995
+ /**
996
+ * Method to change the current image, receiving the new image as input the relative action.
997
+ * @param image an Image object that represents the new image to set as current.
998
+ * @param action Enum of type `Action` that represents the source action that triggered the change.
999
+ */
1000
+ private changeCurrentImage;
1001
+ /**
1002
+ * Private method to get the next index.
1003
+ * This is necessary because at the end, when you call next again, you'll go to the first image.
1004
+ * That happens because all modal images are shown like in a circle.
1005
+ */
1006
+ private getNextImage;
1007
+ /**
1008
+ * Private method to get the previous index.
1009
+ * This is necessary because at index 0, when you call prev again, you'll go to the last image.
1010
+ * That happens because all modal images are shown like in a circle.
1011
+ */
1012
+ private getPrevImage;
1013
+ /**
1014
+ * Private method to build a text description.
1015
+ * This is used also to create titles.
1016
+ * @param image Image to get its description. If not provided it will be the current image.
1017
+ * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.
1018
+ * @returns String description built concatenating image fields with a specific logic.
1019
+ */
1020
+ private buildTextDescription;
1021
+ /**
1022
+ * Private method to update both `isFirstImage` and `isLastImage` based on
1023
+ * the index of the current image.
1024
+ * @param currentIndex number is the index of the current image
1025
+ */
1026
+ private handleBoundaries;
1027
+ /**
1028
+ * Private method to manage boundary arrows and sliding.
1029
+ * This is based on the slideConfig input to enable/disable 'infinite sliding'.
1030
+ */
1031
+ private manageSlideConfig;
1032
+ /**
1033
+ * Private method to emit events when either the last or the first image are visible.
1034
+ * @param action Enum of type Action that represents the source of the event that changed the
1035
+ * current image to the first one or the last one.
1036
+ * @param indexToCheck is the index number of the image (the first or the last one).
1037
+ */
1038
+ private emitBoundaryEvent;
1039
+ /**
1040
+ * Private method to check if next/prev actions should be blocked.
1041
+ * It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.
1042
+ * If yes, it returns true to say that sliding should be blocked, otherwise not.
1043
+ * @param boundaryIndex number that could be either the beginning index (0) or the last index
1044
+ * of images (this.images.length - 1).
1045
+ * @returns boolean true if carouselSlideInfinite === false and the current index is
1046
+ * either the first or the last one.
1047
+ */
1048
+ private isPreventSliding;
1049
+ static ɵfac: i0.ɵɵFactoryDeclaration<CarouselComponent, never>;
1050
+ static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": { "alias": "id"; "required": false; }; "images": { "alias": "images"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "clickImage": "clickImage"; "changeImage": "changeImage"; "firstImage": "firstImage"; "lastImage": "lastImage"; }, never, ["*"], true, never>;
1051
+ }
1052
+
1053
+ /**
1054
+ * Component with image previews for carousel
1055
+ */
1056
+ declare class CarouselPreviewsComponent extends AccessibleComponent implements OnInit, OnChanges, OnDestroy {
1057
+ private ref;
1058
+ private breakpointObserver;
1059
+ private sanitizer;
1060
+ private configService;
1061
+ /**
1062
+ * Variable to change the max-width of the host component
1063
+ */
1064
+ hostMaxWidth: string;
1065
+ /**
1066
+ * Variable to set aria-label of the host component
1067
+ */
1068
+ ariaLabel: string;
1069
+ /**
1070
+ * TODO write doc
1071
+ */
1072
+ id: number;
1073
+ /**
1074
+ * Object of type `InternalLibImage` that represent the visible image.
1075
+ */
1076
+ currentImage: InternalLibImage;
1077
+ /**
1078
+ * Array of `InternalLibImage` that represent the model of this library with all images,
1079
+ * thumbs and so on.
1080
+ */
1081
+ images: InternalLibImage[];
1082
+ /**
1083
+ * Output to emit the clicked preview. The payload contains the `InternalLibImage` associated to the clicked preview.
1084
+ */
1085
+ clickPreview: EventEmitter<ImageEvent>;
1086
+ /**
1087
+ * Object of type `CarouselConfig` to init CarouselComponent's features.
1088
+ * For instance, it contains parameters to change the style, how it navigates and so on.
1089
+ */
1090
+ carouselConfig: CarouselConfig | undefined;
1091
+ /**
1092
+ * Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.
1093
+ * For instance, it contains a param to show/hide this component, sizes.
1094
+ */
1095
+ previewConfig: CarouselPreviewConfig | undefined;
1096
+ /**
1097
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1098
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1099
+ */
1100
+ accessibilityConfig: AccessibilityConfig | undefined;
1101
+ /**
1102
+ * Enum of type `Action` that represents a mouse click on a button.
1103
+ * Declared here to be used inside the template.
1104
+ */
1105
+ clickAction: Action;
1106
+ /**
1107
+ * Enum of type `Action` that represents a keyboard action.
1108
+ * Declared here to be used inside the template.
1109
+ */
1110
+ keyboardAction: Action;
1111
+ /**
1112
+ * Array of `InternalLibImage` exposed to the template. This field is initialized
1113
+ * applying transformations, default values and so on to the input of the same type.
1114
+ */
1115
+ previews: InternalLibImage[];
1116
+ /**
1117
+ * Variable with the preview's maxHeight
1118
+ */
1119
+ previewMaxHeight: string;
1120
+ /**
1121
+ * Start index (inclusive) of the input images used to display previews.
1122
+ */
1123
+ start: number;
1124
+ /**
1125
+ * End index (non inclusive) of the input images used to display previews.
1126
+ */
1127
+ end: number;
1128
+ private readonly breakpointSubscription;
1129
+ constructor(ref: ChangeDetectorRef, breakpointObserver: BreakpointObserver, sanitizer: DomSanitizer, configService: ConfigService);
1130
+ /**
1131
+ * Method to update the height of previews, passing the desired height as input.
1132
+ * @param configBreakpointHeight is a number that represent the desired height to set.
1133
+ */
1134
+ private updateHeight;
1135
+ /**
1136
+ * Method ´ngOnInit´ to build `configPreview` applying a default value and also to
1137
+ * init the `previews` array.
1138
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1139
+ * In particular, it's called only one time!!!
1140
+ */
1141
+ ngOnInit(): void;
1142
+ /**
1143
+ * Method to check if an image is active (i.e. a preview image).
1144
+ * @param preview InternalLibImage is an image to check if it's active or not
1145
+ * @returns boolean true if is active, false otherwise
1146
+ */
1147
+ isActive(preview: InternalLibImage): boolean;
1148
+ /**
1149
+ * Method ´ngOnChanges´ to update `previews` array.
1150
+ * Also, both `start` and `end` local variables will be updated accordingly.
1151
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1152
+ * In particular, it's called when any data-bound property of a directive changes!!!
1153
+ */
1154
+ ngOnChanges(changes: SimpleChanges): void;
1155
+ /**
1156
+ * Method called by events from both keyboard and mouse on a preview.
1157
+ * This will trigger the `clickpreview` output with the input preview as its payload.
1158
+ * @param preview InternalLibImage that triggered this method
1159
+ * @param event KeyboardEvent | MouseEvent payload
1160
+ * @param action Action that triggered this event (Action.NORMAL by default)
1161
+ */
1162
+ onImageEvent(preview: InternalLibImage, event: KeyboardEvent | MouseEvent, action?: Action): void;
1163
+ /**
1164
+ * Method called by events from both keyboard and mouse on a navigation arrow.
1165
+ * @param direction string of the navigation that can be either 'next' or 'prev'
1166
+ * @param event KeyboardEvent | MouseEvent payload
1167
+ */
1168
+ onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): void;
1169
+ /**
1170
+ * Method to get aria-label text for a preview image.
1171
+ * @param preview Image is the preview
1172
+ */
1173
+ getAriaLabel(preview: Image): string;
1174
+ /**
1175
+ * Method to get title text for a preview image.
1176
+ * @param preview Image is the preview
1177
+ */
1178
+ getTitle(preview: Image): string;
1179
+ /**
1180
+ * Method to get alt text for a preview image.
1181
+ * @param preview Image is the preview
1182
+ */
1183
+ getAlt(preview: Image): string;
1184
+ /**
1185
+ * Method used in template to sanitize an url when you need legacyIE11Mode.
1186
+ * In this way you can set an url as background of a div.
1187
+ * @param unsafeStyle is a string or a SafeResourceUrl that represents the url to sanitize.
1188
+ * @param unsafeStyleFallback is a string or a SafeResourceUrl that represents the fallback url to sanitize.
1189
+ * @returns a SafeStyle object that can be used in template without problems.
1190
+ */
1191
+ sanitizeUrlBgStyle(unsafeStyle: string | SafeResourceUrl, unsafeStyleFallback: string | SafeResourceUrl): SafeStyle;
1192
+ /**
1193
+ * Method to cleanup resources. In fact, it cleans breakpointSubscription.
1194
+ * This is an angular lifecycle hook that is called when this component is destroyed.
1195
+ */
1196
+ ngOnDestroy(): void;
1197
+ /**
1198
+ * Private method to init previews based on the currentImage and the full array of images.
1199
+ * The current image in mandatory to show always the current preview (as highlighted).
1200
+ * @param currentImage InternalLibImage to decide how to show previews, because I always want to see the current image as highlighted
1201
+ * @param images InternalLibImage[] is the array of all images.
1202
+ */
1203
+ private initPreviews;
1204
+ /**
1205
+ * Private method to init both `start` and `end` to the beginning.
1206
+ */
1207
+ private setBeginningIndexesPreviews;
1208
+ /**
1209
+ * Private method to init both `start` and `end` to the end.
1210
+ */
1211
+ private setEndIndexesPreviews;
1212
+ /**
1213
+ * Private method to update the visible previews navigating to the right (next).
1214
+ */
1215
+ private next;
1216
+ /**
1217
+ * Private method to update the visible previews navigating to the left (previous).
1218
+ */
1219
+ private previous;
1220
+ /**
1221
+ * Private method to block/permit sliding between previews.
1222
+ * @param boundaryIndex number is the first or the last index of `images` input array
1223
+ * @returns boolean if true block sliding, otherwise not
1224
+ */
1225
+ private isPreventSliding;
1226
+ static ɵfac: i0.ɵɵFactoryDeclaration<CarouselPreviewsComponent, never>;
1227
+ static ɵcmp: i0.ɵɵComponentDeclaration<CarouselPreviewsComponent, "ks-carousel-previews", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; }, { "clickPreview": "clickPreview"; }, never, never, true, never>;
1228
+ }
1229
+
1230
+ /**
1231
+ * Internal representation of `ButtonConfig` with an optional `id` field, used by trackId to improve performances.
1232
+ */
1233
+ interface InternalButtonConfig extends ButtonConfig {
1234
+ id?: number;
1235
+ }
1236
+ /**
1237
+ * Component with all upper buttons.
1238
+ * Also it emits click events as outputs.
1239
+ */
1240
+ declare class UpperButtonsComponent extends AccessibleComponent implements OnInit {
1241
+ private configService;
1242
+ /**
1243
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
1244
+ * the service to call modal gallery.
1245
+ */
1246
+ id: number;
1247
+ /**
1248
+ * Object of type `Image` that represent the visible image.
1249
+ */
1250
+ currentImage: Image;
1251
+ /**
1252
+ * Output to emit clicks on refresh button. The payload contains a `ButtonEvent`.
1253
+ */
1254
+ refresh: EventEmitter<ButtonEvent>;
1255
+ /**
1256
+ * Output to emit clicks on delete button. The payload contains a `ButtonEvent`.
1257
+ */
1258
+ delete: EventEmitter<ButtonEvent>;
1259
+ /**
1260
+ * Output to emit clicks on navigate button. The payload contains a `ButtonEvent`.
1261
+ */
1262
+ navigate: EventEmitter<ButtonEvent>;
1263
+ /**
1264
+ * Output to emit clicks on download button. The payload contains a `ButtonEvent`.
1265
+ */
1266
+ download: EventEmitter<ButtonEvent>;
1267
+ /**
1268
+ * Output to emit clicks on close button. The payload contains a `ButtonEvent`.
1269
+ */
1270
+ closeButton: EventEmitter<ButtonEvent>;
1271
+ /**
1272
+ * Output to emit clicks on full-screen button. The payload contains a `ButtonEvent`.
1273
+ */
1274
+ fullscreen: EventEmitter<ButtonEvent>;
1275
+ /**
1276
+ * Output to emit clicks on all custom buttons. The payload contains a `ButtonEvent`.
1277
+ */
1278
+ customEmit: EventEmitter<ButtonEvent>;
1279
+ /**
1280
+ * Object of type `ButtonsConfig` to init UpperButtonsComponent's features.
1281
+ * For instance, it contains an array of buttons.
1282
+ */
1283
+ buttonsConfig: ButtonsConfig | undefined;
1284
+ /**
1285
+ * Array of `InternalButtonConfig` exposed to the template. This field is initialized
1286
+ * applying transformations, default values and so on to the input of the same type.
1287
+ */
1288
+ buttons: InternalButtonConfig[] | undefined;
1289
+ /**
1290
+ * Default buttons array for standard configuration
1291
+ */
1292
+ private defaultButtonsDefault;
1293
+ /**
1294
+ * Default buttons array for simple configuration
1295
+ */
1296
+ private simpleButtonsDefault;
1297
+ /**
1298
+ * Default buttons array for advanced configuration
1299
+ */
1300
+ private advancedButtonsDefault;
1301
+ /**
1302
+ * Default buttons array for full configuration
1303
+ */
1304
+ private fullButtonsDefault;
1305
+ constructor(configService: ConfigService);
1306
+ /**
1307
+ * Method ´ngOnInit´ to build `configButtons` applying a default value and also to
1308
+ * init the `buttons` array.
1309
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1310
+ * In particular, it's called only one time!!!
1311
+ */
1312
+ ngOnInit(): void;
1313
+ /**
1314
+ * Method called by events from both keyboard and mouse on a button.
1315
+ * This will call a private method to trigger an output with the right payload.
1316
+ * @param button InternalButtonConfig that called this method
1317
+ * @param event KeyboardEvent | MouseEvent payload
1318
+ * @param action Action that triggered the source event or `Action.CLICK` if not specified
1319
+ * @throws an error if the button type is unknown
1320
+ */
1321
+ onEvent(button: InternalButtonConfig, event: KeyboardEvent | MouseEvent, action?: Action): void;
1322
+ /**
1323
+ * Method used in the template to track ids in @for.
1324
+ * @param index number of the array
1325
+ * @param item Image of the array
1326
+ * @returns number the id of the item or undefined if the item is not valid
1327
+ */
1328
+ trackById(index: number, item: InternalButtonConfig): number | undefined;
1329
+ /**
1330
+ * Private method to emit an event using the specified output as an `EventEmitter`.
1331
+ * @param emitter EventEmitter<ButtonEvent> is the output to emit the `ButtonEvent`
1332
+ * @param event KeyboardEvent | MouseEvent is the source that triggered this method
1333
+ * @param dataToEmit ButtonEvent payload to emit
1334
+ */
1335
+ private triggerOnMouseAndKeyboard;
1336
+ /**
1337
+ * Private method to add ids to the array of buttons.
1338
+ * It adds ids in a reverse way, to be sure that the last button will always have id = 0.
1339
+ * This is really useful in unit testing to be sure that close button always have id = 0, download 1 and so on...
1340
+ * It's totally transparent to the user.
1341
+ * @param buttons ButtonConfig[] config array
1342
+ * @returns ButtonConfig[] the input array with incremental numeric ids
1343
+ */
1344
+ private addButtonIds;
1345
+ /**
1346
+ * Private method to validate custom buttons received as input.
1347
+ * @param buttons ButtonConfig[] config array. [] by default.
1348
+ * @returns ButtonConfig[] the same input buttons config array
1349
+ * @throws an error is exists a button with an unknown type
1350
+ */
1351
+ private validateCustomButtons;
1352
+ static ɵfac: i0.ɵɵFactoryDeclaration<UpperButtonsComponent, never>;
1353
+ static ɵcmp: i0.ɵɵComponentDeclaration<UpperButtonsComponent, "ks-upper-buttons", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; }, { "refresh": "refresh"; "delete": "delete"; "navigate": "navigate"; "download": "download"; "closeButton": "closeButton"; "fullscreen": "fullscreen"; "customEmit": "customEmit"; }, never, never, true, never>;
1354
+ }
1355
+
1356
+ /**
1357
+ * Component with clickable dots (small circles) to navigate between images inside the modal gallery.
1358
+ */
1359
+ declare class DotsComponent extends AccessibleComponent implements OnInit, OnChanges {
1360
+ private configService;
1361
+ /**
1362
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
1363
+ * the service to call modal gallery.
1364
+ */
1365
+ id: number;
1366
+ /**
1367
+ * Object of type `InternalLibImage` that represent the visible image.
1368
+ */
1369
+ currentImage: InternalLibImage | undefined;
1370
+ /**
1371
+ * Array of `InternalLibImage` that represent the model of this library with all images,
1372
+ * thumbs and so on.
1373
+ */
1374
+ images: InternalLibImage[] | undefined;
1375
+ /**
1376
+ * Object of type `DotsConfig` to init DotsComponent's features.
1377
+ * For instance, it contains a param to show/hide this component.
1378
+ */
1379
+ dotsConfig: DotsConfig;
1380
+ /**
1381
+ * Output to emit clicks on dots. The payload contains a number that represent
1382
+ * the index of the clicked dot.
1383
+ */
1384
+ clickDot: EventEmitter<number>;
1385
+ /**
1386
+ * Object of type `DotsConfig` used in template.
1387
+ */
1388
+ configDots: DotsConfig | undefined;
1389
+ /**
1390
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1391
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1392
+ */
1393
+ accessibilityConfig: AccessibilityConfig | undefined;
1394
+ constructor(configService: ConfigService);
1395
+ /**
1396
+ * Method ´ngOnInit´ to build `configDots` applying a default value.
1397
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1398
+ * In particular, it's called only one time!!!
1399
+ */
1400
+ ngOnInit(): void;
1401
+ /**
1402
+ * Method ´ngOnChanges´ to change `configDots` if the input dotsConfig is changed.
1403
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1404
+ */
1405
+ ngOnChanges(changes: SimpleChanges): void;
1406
+ /**
1407
+ * Method to check if an image is active (i.e. the current image).
1408
+ * It checks currentImage and images to prevent errors.
1409
+ * @param index number of the image to check if it's active or not
1410
+ * @returns boolean true if is active (and input params are valid), false otherwise
1411
+ */
1412
+ isActive(index: number): boolean;
1413
+ /**
1414
+ * Method called by events from keyboard and mouse.
1415
+ * @param index number of the dot
1416
+ * @param event KeyboardEvent | MouseEvent payload
1417
+ */
1418
+ onDotEvent(index: number, event: KeyboardEvent | MouseEvent): void;
1419
+ static ɵfac: i0.ɵɵFactoryDeclaration<DotsComponent, never>;
1420
+ static ɵcmp: i0.ɵɵComponentDeclaration<DotsComponent, "ks-dots", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; "dotsConfig": { "alias": "dotsConfig"; "required": false; }; }, { "clickDot": "clickDot"; }, never, never, true, never>;
1421
+ }
1422
+
1423
+ /**
1424
+ * Component with image previews
1425
+ */
1426
+ declare class PreviewsComponent extends AccessibleComponent implements OnInit, OnChanges {
1427
+ private configService;
1428
+ /**
1429
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
1430
+ * the service to call modal-gallery.
1431
+ */
1432
+ id: number;
1433
+ /**
1434
+ * Object of type `InternalLibImage` that represent the visible image.
1435
+ */
1436
+ currentImage: InternalLibImage;
1437
+ /**
1438
+ * Array of `InternalLibImage` that represent the model of this library with all images,
1439
+ * thumbs and so on.
1440
+ */
1441
+ images: InternalLibImage[];
1442
+ /**
1443
+ * Optional template reference for the rendering of previews.
1444
+ * Template may access the following context variables:
1445
+ * - preview: the `Image` object
1446
+ * - defaultTemplate: the template used by default to render the preview (in case the need is to wrap it)
1447
+ */
1448
+ customTemplate?: TemplateRef<HTMLElement>;
1449
+ /**
1450
+ * Output to emit the clicked preview. The payload contains the `ImageEvent` associated to the clicked preview.
1451
+ */
1452
+ clickPreview: EventEmitter<ImageEvent>;
1453
+ /**
1454
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1455
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1456
+ */
1457
+ accessibilityConfig: AccessibilityConfig | undefined;
1458
+ /**
1459
+ * Object of type `SlideConfig` to get `infinite sliding`.
1460
+ */
1461
+ slideConfig: SlideConfig | undefined;
1462
+ /**
1463
+ * Object of type `PreviewConfig` to init PreviewsComponent's features.
1464
+ * For instance, it contains a param to show/hide this component, sizes.
1465
+ */
1466
+ previewConfig: PreviewConfig | undefined;
1467
+ /**
1468
+ * Enum of type `Action` that represents a mouse click on a button.
1469
+ * Declared here to be used inside the template.
1470
+ */
1471
+ clickAction: Action;
1472
+ /**
1473
+ * Enum of type `Action` that represents a keyboard action.
1474
+ * Declared here to be used inside the template.
1475
+ */
1476
+ keyboardAction: Action;
1477
+ /**
1478
+ * Array of `InternalLibImage` exposed to the template. This field is initialized
1479
+ * applying transformations, default values and so on to the input of the same type.
1480
+ */
1481
+ previews: InternalLibImage[];
1482
+ /**
1483
+ * Start index (included) of the input images used to display previews.
1484
+ */
1485
+ start: number;
1486
+ /**
1487
+ * End index (excluded) of the input images used to display previews.
1488
+ */
1489
+ end: number;
1490
+ defaultPreviewSize: Size;
1491
+ constructor(configService: ConfigService);
1492
+ /**
1493
+ * Method ´ngOnInit´ to build `configPreview` applying a default value and also to
1494
+ * init the `previews` array.
1495
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1496
+ * In particular, it's called only one time!!!
1497
+ */
1498
+ ngOnInit(): void;
1499
+ /**
1500
+ * Method to check if an image is active (i.e. a preview image).
1501
+ * @param preview InternalLibImage is an image to check if it's active or not
1502
+ * @returns boolean true if is active, false otherwise
1503
+ */
1504
+ isActive(preview: InternalLibImage): boolean;
1505
+ /**
1506
+ * Method ´ngOnChanges´ to update `previews` array.
1507
+ * Also, both `start` and `end` local variables will be updated accordingly.
1508
+ * This is an angular lifecycle hook, so it's called automatically by Angular itself.
1509
+ * In particular, it's called when any data-bound property of a directive changes!!!
1510
+ */
1511
+ ngOnChanges(changes: SimpleChanges): void;
1512
+ /**
1513
+ * Method called by events from both keyboard and mouse on a preview.
1514
+ * This will trigger the `clickpreview` output with the input preview as its payload.
1515
+ * @param preview InternalLibImage that triggered this method
1516
+ * @param event KeyboardEvent | MouseEvent payload
1517
+ * @param action Action that triggered the source event or `Action.NORMAL` if not specified
1518
+ */
1519
+ onImageEvent(preview: InternalLibImage, event: KeyboardEvent | MouseEvent, action?: Action): void;
1520
+ /**
1521
+ * Method called by events from both keyboard and mouse on a navigation arrow.
1522
+ * It also emits an event to specify which arrow.
1523
+ * @param direction string of the navigation that can be either 'next' or 'prev'
1524
+ * @param event KeyboardEvent | MouseEvent payload
1525
+ * @param action Action that triggered the source event or `Action.NORMAL` if not specified
1526
+ */
1527
+ onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action): void;
1528
+ /**
1529
+ * Indicates if the previews 'left arrow' should be displayed or not.
1530
+ * @returns
1531
+ */
1532
+ isDisplayLeftPreviewsArrow(): boolean;
1533
+ /**
1534
+ * Indicates if the previews 'right arrow' should be displayed or not.
1535
+ * @returns
1536
+ */
1537
+ isDisplayRightPreviewsArrow(): boolean;
1538
+ /**
1539
+ * Private method to init previews based on the currentImage and the full array of images.
1540
+ * The current image in mandatory to show always the current preview (as highlighted).
1541
+ * @param currentImage InternalLibImage to decide how to show previews, because I always want to see the current image as highlighted
1542
+ * @param images InternalLibImage[] is the array of all images.
1543
+ */
1544
+ private initPreviews;
1545
+ /**
1546
+ * Private method to update both `start` and `end` based on the currentImage.
1547
+ */
1548
+ private setIndexesPreviews;
1549
+ /**
1550
+ * Private method to update the visible previews navigating to the right (next).
1551
+ */
1552
+ private next;
1553
+ /**
1554
+ * Private method to update the visible previews navigating to the left (previous).
1555
+ */
1556
+ private previous;
1557
+ static ɵfac: i0.ɵɵFactoryDeclaration<PreviewsComponent, never>;
1558
+ static ɵcmp: i0.ɵɵComponentDeclaration<PreviewsComponent, "ks-previews", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; "customTemplate": { "alias": "customTemplate"; "required": false; }; }, { "clickPreview": "clickPreview"; }, never, never, true, never>;
1559
+ }
1560
+
1561
+ /**
1562
+ * Interface to describe the Load Event, used to
1563
+ * emit an event when the image is finally loaded and the spinner has gone.
1564
+ */
1565
+ interface ImageLoadEvent {
1566
+ status: boolean;
1567
+ index: number;
1568
+ id: number;
1569
+ }
1570
+ /**
1571
+ * Component with the current image with some additional elements like arrows and side previews.
1572
+ */
1573
+ declare class CurrentImageComponent extends AccessibleComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {
1574
+ private platformId;
1575
+ private ngZone;
1576
+ ref: ChangeDetectorRef;
1577
+ private configService;
1578
+ /**
1579
+ * Unique id (>=0) of the current instance of this library. This is useful when you are using
1580
+ * the service to call modal gallery without open it manually.
1581
+ */
1582
+ id: number;
1583
+ /**
1584
+ * Object of type `InternalLibImage` that represent the visible image.
1585
+ */
1586
+ currentImage: InternalLibImage;
1587
+ /**
1588
+ * Array of `InternalLibImage` that represent the model of this library with all images,
1589
+ * thumbs and so on.
1590
+ */
1591
+ images: InternalLibImage[];
1592
+ /**
1593
+ * Boolean that it is true if the modal gallery is visible.
1594
+ * If yes, also this component should be visible.
1595
+ */
1596
+ isOpen: boolean;
1597
+ /**
1598
+ * Output to emit an event when images are loaded. The payload contains an `ImageLoadEvent`.
1599
+ */
1600
+ loadImage: EventEmitter<ImageLoadEvent>;
1601
+ /**
1602
+ * Output to emit any changes of the current image. The payload contains an `ImageModalEvent`.
1603
+ */
1604
+ changeImage: EventEmitter<ImageModalEvent>;
1605
+ /**
1606
+ * Output to emit an event when the modal gallery is closed. The payload contains an `ImageModalEvent`.
1607
+ */
1608
+ closeGallery: EventEmitter<ImageModalEvent>;
1609
+ /**
1610
+ * Subject to play modal-gallery.
1611
+ */
1612
+ private start$;
1613
+ /**
1614
+ * Subject to stop modal-gallery.
1615
+ */
1616
+ private stop$;
1617
+ /**
1618
+ * Enum of type `Action` that represents a normal action.
1619
+ * Declared here to be used inside the template.
1620
+ */
1621
+ normalAction: Action;
1622
+ /**
1623
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1624
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1625
+ */
1626
+ accessibilityConfig: AccessibilityConfig | undefined;
1627
+ /**
1628
+ * Object of type `SlideConfig` to get `infinite sliding`.
1629
+ */
1630
+ slideConfig: SlideConfig | undefined;
1631
+ /**
1632
+ * Object to configure current image in modal-gallery.
1633
+ * For instance you can disable navigation on click on current image (enabled by default).
1634
+ */
1635
+ currentImageConfig: CurrentImageConfig | undefined;
1636
+ /**
1637
+ * Object of type `KeyboardConfig` to assign custom keys to both ESC, RIGHT and LEFT keyboard's actions.
1638
+ */
1639
+ keyboardConfig: KeyboardConfig | undefined;
1640
+ /**
1641
+ * Enum of type `Action` that represents a mouse click on a button.
1642
+ * Declared here to be used inside the template.
1643
+ */
1644
+ clickAction: Action;
1645
+ /**
1646
+ * Enum of type `Action` that represents a keyboard action.
1647
+ * Declared here to be used inside the template.
1648
+ */
1649
+ keyboardAction: Action;
1650
+ /**
1651
+ * Boolean that it's true when you are watching the first image (currently visible).
1652
+ * False by default
1653
+ */
1654
+ isFirstImage: boolean;
1655
+ /**
1656
+ * Boolean that it's true when you are watching the last image (currently visible).
1657
+ * False by default
1658
+ */
1659
+ isLastImage: boolean;
1660
+ /**
1661
+ * Boolean that it's true if an image of the modal gallery is still loading.
1662
+ * True by default
1663
+ */
1664
+ loading: boolean;
1665
+ constructor(platformId: any, ngZone: NgZone, ref: ChangeDetectorRef, configService: ConfigService);
1666
+ /**
1667
+ * Listener to stop the gallery when the mouse pointer is over the current image.
1668
+ */
1669
+ onMouseEnter(): void;
1670
+ /**
1671
+ * Listener to play the gallery when the mouse pointer leave the current image.
1672
+ */
1673
+ onMouseLeave(): void;
1674
+ /**
1675
+ * Method ´ngOnInit´ to init configuration.
1676
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1677
+ * In particular, it's called only one time!!!
1678
+ */
1679
+ ngOnInit(): void;
1680
+ /**
1681
+ * Method ´ngOnChanges´ to update `loading` status and emit events.
1682
+ * If the gallery is open, then it will also manage boundary arrows and sliding.
1683
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1684
+ * In particular, it's called when any data-bound property of a directive changes!!!
1685
+ */
1686
+ ngOnChanges(changes: SimpleChanges): void;
1687
+ /**
1688
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
1689
+ */
1690
+ ngAfterContentInit(): void;
1691
+ /**
1692
+ * Method to handle keypress based on the `keyboardConfig` input. It gets the code of
1693
+ * the key that triggered the keypress event to navigate between images or to close the modal gallery.
1694
+ * @param code string of the key that triggered the keypress event
1695
+ */
1696
+ onKeyPress(code: string): void;
1697
+ /**
1698
+ * Method to get the image description based on input params.
1699
+ * If you provide a full description this will be the visible description, otherwise,
1700
+ * it will be built using the `Description` object, concatenating its fields.
1701
+ * @param image image to get its description. If not provided it will be the current image
1702
+ * @returns String description of the image (or the current image if not provided)
1703
+ * @throws an Error if description isn't available
1704
+ */
1705
+ getDescriptionToDisplay(image?: Image): string;
1706
+ /**
1707
+ * Method to get `alt attribute`.
1708
+ * `alt` specifies an alternate text for an image, if the image cannot be displayed.
1709
+ * @param image Image to get its alt description. If not provided it will be the current image
1710
+ * @returns String alt description of the image (or the current image if not provided)
1711
+ */
1712
+ getAltDescriptionByImage(image?: Image): string;
1713
+ /**
1714
+ * Method to get the title attributes based on descriptions.
1715
+ * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,
1716
+ * it prevents an empty string as title.
1717
+ * @param image Image to get its description. If not provided it will be the current image
1718
+ * @returns String title of the image based on descriptions
1719
+ * @throws an Error if description isn't available
1720
+ */
1721
+ getTitleToDisplay(image?: Image): string;
1722
+ /**
1723
+ * Method to get the left side preview image.
1724
+ * @returns Image the image to show as size preview on the left
1725
+ */
1726
+ getLeftPreviewImage(): Image;
1727
+ /**
1728
+ * Method to get the right side preview image.
1729
+ * @returns Image the image to show as size preview on the right
1730
+ */
1731
+ getRightPreviewImage(): Image;
1732
+ /**
1733
+ * Method called by events from both keyboard and mouse on an image.
1734
+ * This will invoke the nextImage method.
1735
+ * @param event keyboardEvent | MouseEvent payload
1736
+ * @param action action that triggered the event or `Action.NORMAL` if not provided
1737
+ */
1738
+ onImageEvent(event: KeyboardEvent | MouseEvent, action?: Action): void;
1739
+ /**
1740
+ * Method called by events from both keyboard and mouse on a navigation arrow.
1741
+ * @param direction string of the navigation that can be either 'next' or 'prev'
1742
+ * @param event KeyboardEvent | MouseEvent payload
1743
+ * @param action Action that triggered the event or `Action.NORMAL` if not provided
1744
+ * @param disable boolean to disable navigation
1745
+ */
1746
+ onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action, disable?: boolean): void;
1747
+ /**
1748
+ * Method to go back to the previous image.
1749
+ * @param action Enum of type `Action` that represents the source
1750
+ * action that moved back to the previous image. `Action.NORMAL` by default.
1751
+ */
1752
+ prevImage(action?: Action): void;
1753
+ /**
1754
+ * Method to go back to the previous image.
1755
+ * @param action Enum of type `Action` that represents the source
1756
+ * action that moved to the next image. `Action.NORMAL` by default.
1757
+ */
1758
+ nextImage(action?: Action): void;
1759
+ /**
1760
+ * Method to emit an event as loadImage output to say that the requested image if loaded.
1761
+ * This method is invoked by the javascript's 'load' event on an img tag.
1762
+ * @param event event that triggered the load
1763
+ */
1764
+ onImageLoad(event: Event): void;
1765
+ /**
1766
+ * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).
1767
+ * @param action String that represent the direction of the swipe action. 'swiperight' by default.
1768
+ */
1769
+ swipe(action?: string): void;
1770
+ /**
1771
+ * Method used in `modal-gallery.component` to get the index of an image to delete.
1772
+ * @param image image to get the index, or the visible image, if not passed
1773
+ * @returns number the index of the image
1774
+ */
1775
+ getIndexToDelete(image?: Image): number;
1776
+ /**
1777
+ * Method to play modal gallery.
1778
+ */
1779
+ playCarousel(): void;
1780
+ /**
1781
+ * Stops modal gallery from cycling through items.
1782
+ */
1783
+ stopCarousel(): void;
1784
+ /**
1785
+ * Method to cleanup resources. In fact, this will stop the modal gallery.
1786
+ * This is an angular lifecycle hook that is called when this component is destroyed.
1787
+ */
1788
+ ngOnDestroy(): void;
1789
+ /**
1790
+ * Private method to update both `isFirstImage` and `isLastImage` based on
1791
+ * the index of the current image.
1792
+ * @param currentIndex number is the index of the current image
1793
+ */
1794
+ private handleBoundaries;
1795
+ /**
1796
+ * Private method to check if next/prev actions should be blocked.
1797
+ * It checks if slideConfig.infinite === false and if the image index is equals to the input parameter.
1798
+ * If yes, it returns true to say that sliding should be blocked, otherwise not.
1799
+ * @param boundaryIndex number that could be either the beginning index (0) or the last index
1800
+ * of images (this.images.length - 1).
1801
+ * @returns boolean true if slideConfig.infinite === false and the current index is
1802
+ * either the first or the last one.
1803
+ */
1804
+ private isPreventSliding;
1805
+ /**
1806
+ * Private method to get the next index.
1807
+ * This is necessary because at the end, when you call next again, you'll go to the first image.
1808
+ * That happens because all modal images are shown like in a circle.
1809
+ */
1810
+ private getNextImage;
1811
+ /**
1812
+ * Private method to get the previous index.
1813
+ * This is necessary because at index 0, when you call prev again, you'll go to the last image.
1814
+ * That happens because all modal images are shown like in a circle.
1815
+ */
1816
+ private getPrevImage;
1817
+ /**
1818
+ * Private method to build a text description.
1819
+ * This is used also to create titles.
1820
+ * @param image Image to get its description. If not provided it will be the current image.
1821
+ * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.
1822
+ * @returns String description built concatenating image fields with a specific logic.
1823
+ */
1824
+ private buildTextDescription;
1825
+ /**
1826
+ * Private method to call handleBoundaries when ngOnChanges is called.
1827
+ */
1828
+ private updateIndexes;
1829
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrentImageComponent, never>;
1830
+ static ɵcmp: i0.ɵɵComponentDeclaration<CurrentImageComponent, "ks-current-image", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "loadImage": "loadImage"; "changeImage": "changeImage"; "closeGallery": "closeGallery"; }, never, never, true, never>;
1831
+ }
1832
+
1833
+ /**
1834
+ * Component with the loading spinner
1835
+ */
1836
+ declare class LoadingSpinnerComponent {
1837
+ /**
1838
+ * Object of type `LoadingConfig` exposed to the template.
1839
+ * It contains a field to choose a loading spinner.
1840
+ */
1841
+ loadingConfig: LoadingConfig;
1842
+ /**
1843
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1844
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1845
+ */
1846
+ accessibilityConfig: AccessibilityConfig;
1847
+ /**
1848
+ * Enum of type `LoadingType` to choose the standard loading spinner.
1849
+ * Declared here to be used inside the template.
1850
+ */
1851
+ loadingStandard: LoadingType;
1852
+ /**
1853
+ * Enum of type `LoadingType` to choose the bars loading spinner.
1854
+ * Declared here to be used inside the template.
1855
+ */
1856
+ loadingBars: LoadingType;
1857
+ /**
1858
+ * Enum of type `LoadingType` to choose the circular loading spinner.
1859
+ * Declared here to be used inside the template.
1860
+ */
1861
+ loadingCircular: LoadingType;
1862
+ /**
1863
+ * Enum of type `LoadingType` to choose the dots loading spinner.
1864
+ * Declared here to be used inside the template.
1865
+ */
1866
+ loadingDots: LoadingType;
1867
+ /**
1868
+ * Enum of type `LoadingType` to choose the cube flipping loading spinner.
1869
+ * Declared here to be used inside the template.
1870
+ */
1871
+ loadingCubeFlipping: LoadingType;
1872
+ /**
1873
+ * Enum of type `LoadingType` to choose the circles loading spinner.
1874
+ * Declared here to be used inside the template.
1875
+ */
1876
+ loadingCircles: LoadingType;
1877
+ /**
1878
+ * Enum of type `LoadingType` to choose the explosing squares loading spinner.
1879
+ * Declared here to be used inside the template.
1880
+ */
1881
+ loadingExplosingSquares: LoadingType;
1882
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingSpinnerComponent, never>;
1883
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoadingSpinnerComponent, "ks-loading-spinner", never, { "loadingConfig": { "alias": "loadingConfig"; "required": false; }; "accessibilityConfig": { "alias": "accessibilityConfig"; "required": false; }; }, {}, never, never, true, never>;
1884
+ }
1885
+
1886
+ /**
1887
+ * Service to check if the provided id is unique
1888
+ */
1889
+ declare class IdValidatorService {
1890
+ ids: Map<any, any>;
1891
+ /**
1892
+ * Method to check and reserve an id for the current instance of the library.
1893
+ * In this way, no other instances can use the same id.
1894
+ * @param galleryId number or undefined that represents the unique id of the gallery.
1895
+ * @return boolean true if success. false is never returned, instead an exception is thrown
1896
+ * @throws a error with a message if galleryId is neither unique, < 0 or an integer
1897
+ */
1898
+ checkAndAdd(galleryId: number | undefined): boolean;
1899
+ /**
1900
+ * Method to remove a reserved id. In this way you are able to use the id again for another instance of the library.
1901
+ * @param galleryId number or undefined that represents the unique id of the gallery.
1902
+ * @return boolean true if success. false is never returned, instead an exception is thrown*
1903
+ * @throws a error with a message if galleryId is neither integer or < 0
1904
+ * * this should be improved without return true, because it doesn't make sense! :(
1905
+ */
1906
+ remove(galleryId: number | undefined): boolean;
1907
+ static ɵfac: i0.ɵɵFactoryDeclaration<IdValidatorService, never>;
1908
+ static ɵprov: i0.ɵɵInjectableDeclaration<IdValidatorService>;
1909
+ }
1910
+
1911
+ declare class ModalGalleryComponent implements OnInit, OnDestroy {
1912
+ private dialogContent;
1913
+ private modalGalleryService;
1914
+ private platformId;
1915
+ private changeDetectorRef;
1916
+ private idValidatorService;
1917
+ private configService;
1918
+ private sanitizer;
1919
+ /**
1920
+ * Reference to the CurrentImageComponent to invoke methods on it.
1921
+ */
1922
+ currentImageComponent: CurrentImageComponent | undefined;
1923
+ /**
1924
+ * Unique id (>=0) of the current instance of this library. This is useful when you are using
1925
+ * the service to call modal gallery without open it manually.
1926
+ */
1927
+ id: number;
1928
+ /**
1929
+ * Object of type `ButtonsConfig` to show/hide buttons.
1930
+ */
1931
+ buttonsConfig: ButtonsConfig | undefined;
1932
+ /**
1933
+ * Boolean to enable modal-gallery close behaviour when clicking
1934
+ * on the semi-transparent background. Enabled by default.
1935
+ */
1936
+ enableCloseOutside: boolean;
1937
+ /**
1938
+ * Object of type `DotsConfig` to init DotsComponent's features.
1939
+ * For instance, it contains a param to show/hide dots.
1940
+ */
1941
+ dotsConfig: DotsConfig;
1942
+ /**
1943
+ * Object of type `PreviewConfig` to init PreviewsComponent's features.
1944
+ * For instance, it contains a param to show/hide previews.
1945
+ */
1946
+ previewConfig: PreviewConfig | undefined;
1947
+ /**
1948
+ * Object of type `SlideConfig` to init side previews and `infinite sliding`.
1949
+ */
1950
+ slideConfig: SlideConfig | undefined;
1951
+ /**
1952
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
1953
+ * For instance, it contains titles, alt texts, aria-labels and so on.
1954
+ */
1955
+ accessibilityConfig: AccessibilityConfig;
1956
+ /**
1957
+ * Object of type `KeyboardConfig` to assign custom keys to ESC, RIGHT and LEFT keyboard's actions.
1958
+ */
1959
+ keyboardConfig: KeyboardConfig | undefined;
1960
+ /**
1961
+ * Object of type `PlainGalleryConfig` to configure the plain gallery.
1962
+ */
1963
+ plainGalleryConfig: PlainGalleryConfig | undefined;
1964
+ /**
1965
+ * Array of `InternalLibImage` representing the model of this library with all images, thumbs and so on.
1966
+ */
1967
+ images: InternalLibImage[];
1968
+ /**
1969
+ * Optional template reference to use to render previews.
1970
+ */
1971
+ customPreviewsTemplate?: TemplateRef<HTMLElement>;
1972
+ /**
1973
+ * `Image` that is visible right now.
1974
+ */
1975
+ currentImage: InternalLibImage;
1976
+ /**
1977
+ * Boolean to open the modal gallery. False by default.
1978
+ */
1979
+ showGallery: boolean;
1980
+ /**
1981
+ * Object to configure this component.
1982
+ */
1983
+ libConfig: LibConfig | undefined;
1984
+ private updateImagesSubscription;
1985
+ /**
1986
+ * HostListener to catch the browser back button and destroy the gallery.
1987
+ * This prevents unexpected behavior about scrolling.
1988
+ * Added to fix this issue: https://github.com/Ks89/angular-modal-gallery/issues/159
1989
+ */
1990
+ onPopState(): void;
1991
+ /**
1992
+ * HostListener to catch ctrl+s/meta+s and download the current image.
1993
+ * Inspired by https://netbasal.com/add-keyboard-shortcuts-to-your-angular-app-9bf2e89862b3
1994
+ */
1995
+ onSaveListener(event: KeyboardEvent): void;
1996
+ constructor(dialogContent: ModalGalleryConfig, modalGalleryService: ModalGalleryService, platformId: Object, changeDetectorRef: ChangeDetectorRef, idValidatorService: IdValidatorService, configService: ConfigService, sanitizer: DomSanitizer);
1997
+ /**
1998
+ * Method ´ngOnInit´ to init images calling `initImages()`.
1999
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2000
+ * In particular, it's called only one time!!!
2001
+ */
2002
+ ngOnInit(): void;
2003
+ /**
2004
+ * Method called by custom upper buttons.
2005
+ * @param event ButtonEvent event payload
2006
+ */
2007
+ onCustomEmit(event: ButtonEvent): void;
2008
+ /**
2009
+ * Method called by the full-screen upper button.
2010
+ * @param event ButtonEvent event payload
2011
+ */
2012
+ onFullScreen(event: ButtonEvent): void;
2013
+ /**
2014
+ * Method called by the delete upper button.
2015
+ * @param event ButtonEvent event payload
2016
+ */
2017
+ onDelete(event: ButtonEvent): void;
2018
+ /**
2019
+ * Method called by the navigate upper button.
2020
+ * @param event ButtonEvent event payload
2021
+ */
2022
+ onNavigate(event: ButtonEvent): void;
2023
+ /**
2024
+ * This method is defined to be spied and replaced in unit testing with a fake method call.
2025
+ * It must be public to be able to use jasmine spyOn method.
2026
+ * @param newHref string new url
2027
+ */
2028
+ updateLocationHref(newHref: string): void;
2029
+ /**
2030
+ * Method called by the download upper button.
2031
+ * @param event ButtonEvent event payload
2032
+ */
2033
+ onDownload(event: ButtonEvent): void;
2034
+ /**
2035
+ * Method called by the close upper button.
2036
+ * @param event ButtonEvent event payload
2037
+ * @param action Action that triggered the close method. `Action.NORMAL` by default
2038
+ */
2039
+ onCloseGalleryButton(event: ButtonEvent, action?: Action): void;
2040
+ /**
2041
+ * Method called by CurrentImageComponent.
2042
+ * @param event ImageModalEvent event payload
2043
+ * @param action Action that triggered the close method. `Action.NORMAL` by default
2044
+ */
2045
+ onCloseGallery(event: ImageModalEvent, action?: Action): void;
2046
+ /**
2047
+ * Method to close the modal gallery specifying the action.
2048
+ * @param action Action action type. `Action.NORMAL` by default
2049
+ * @param clickOutside boolean that is true if called clicking on the modal background. False by default.
2050
+ */
2051
+ closeGallery(action?: Action, clickOutside?: boolean): void;
2052
+ /**
2053
+ * Method called when the image changes and used to update the `currentImage` object.
2054
+ * @param event ImageModalEvent event payload
2055
+ */
2056
+ onChangeCurrentImage(event: ImageModalEvent): void;
2057
+ /**
2058
+ * Method called when you click 'outside' (i.e. on the semi-transparent background)
2059
+ * to close the modal gallery if `enableCloseOutside` is true.
2060
+ * @param event boolean that is true to close the modal gallery, false otherwise
2061
+ */
2062
+ onClickOutside(event: boolean): void;
2063
+ /**
2064
+ * Method called when an image is loaded and the loading spinner has gone.
2065
+ * It sets the previouslyLoaded flag inside the Image to hide loading spinner when displayed again.
2066
+ * @param event ImageLoadEvent event payload
2067
+ */
2068
+ onImageLoad(event: ImageLoadEvent): void;
2069
+ /**
2070
+ * Method called when a dot is clicked and used to update the current image.
2071
+ * @param index number index of the clicked dot
2072
+ */
2073
+ onClickDot(index: number): void;
2074
+ /**
2075
+ * Method called when an image preview is clicked and used to update the current image.
2076
+ * @param event ImageModalEvent preview image
2077
+ */
2078
+ onClickPreview(event: ImageModalEvent): void;
2079
+ /**
2080
+ * Method to cleanup resources.
2081
+ * This is an angular lifecycle hook that is called when this component is destroyed.
2082
+ */
2083
+ ngOnDestroy(): void;
2084
+ /**
2085
+ * Method to download the current image, only if `downloadable` is true.
2086
+ * @private
2087
+ */
2088
+ private downloadImage;
2089
+ /**
2090
+ * Method to convert a base64 to a Blob
2091
+ * @param base64Data string with base64 data
2092
+ * @param contentType string with the MIME type
2093
+ * @return Blob converted from the input base64Data
2094
+ * @private
2095
+ */
2096
+ private base64toBlob;
2097
+ /**
2098
+ * Private method to download the current image for all browsers.
2099
+ * @private
2100
+ */
2101
+ private downloadImageAllBrowsers;
2102
+ /**
2103
+ * Private method to get the `ButtonEvent` to emit, merging the input `ButtonEvent`
2104
+ * with the current image.
2105
+ * @param event ButtonEvent event payload to return
2106
+ * @returns ButtonEvent event payload with the current image included
2107
+ * @private
2108
+ */
2109
+ private getButtonEventToEmit;
2110
+ /**
2111
+ * Private method to get the file name from an input path.
2112
+ * This is used either to get the image's name from its path or from the Image itself,
2113
+ * if specified as 'downloadFileName' by the user.
2114
+ * @param image Image image to extract its file name
2115
+ * @param isBase64 boolean to set if the image is a base64 file or not. False by default.
2116
+ * @param base64Extension string to force the extension of the base64 image. Empty string by default.
2117
+ * @returns string string file name of the input image.
2118
+ * @private
2119
+ */
2120
+ private getFileName;
2121
+ /**
2122
+ * Private method to initialize `images` as array of `Image`s.
2123
+ * Also, it will emit ImageModalEvent to say that images are loaded.
2124
+ * @private
2125
+ */
2126
+ private initImages;
2127
+ /**
2128
+ * Private method to emit events when either the last or the first image are visible.
2129
+ * @param action Action Enum of type Action that represents the source of the event that changed the
2130
+ * current image to the first one or the last one.
2131
+ * @param indexToCheck number is the index number of the image (the first or the last one).
2132
+ * @private
2133
+ */
2134
+ private emitBoundaryEvent;
2135
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalGalleryComponent, never>;
2136
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalGalleryComponent, "ks-modal-gallery", never, {}, {}, never, never, true, never>;
2137
+ }
2138
+
2139
+ /**
2140
+ * Directive to close the modal gallery clicking on the semi-transparent background.
2141
+ * In fact, it listens for a click on all elements that aren't 'inside' and it emits
2142
+ * an event using `@Output clickOutside`.
2143
+ */
2144
+ declare class ClickOutsideDirective {
2145
+ /**
2146
+ * Boolean to enable this directive.
2147
+ */
2148
+ clickOutsideEnable: boolean | undefined;
2149
+ /**
2150
+ * Output to emit an event if the clicked element class doesn't contain 'inside' or it is 'hidden'. The payload is a boolean.
2151
+ */
2152
+ clickOutside: EventEmitter<boolean>;
2153
+ /**
2154
+ * Method called by Angular itself every click thanks to `@HostListener`.
2155
+ * @param event MouseEvent
2156
+ */
2157
+ onClick(event: MouseEvent): void;
2158
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClickOutsideDirective, never>;
2159
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ClickOutsideDirective, "[ksClickOutside]", never, { "clickOutsideEnable": { "alias": "clickOutsideEnable"; "required": false; }; }, { "clickOutside": "clickOutside"; }, never, never, true, never>;
2160
+ }
2161
+
2162
+ /**
2163
+ * Directive to change the size of an element.
2164
+ */
2165
+ declare class SizeDirective implements OnInit, OnChanges {
2166
+ private renderer;
2167
+ private el;
2168
+ /**
2169
+ * Object of type `Size` to resize the element.
2170
+ */
2171
+ sizeConfig: Size | undefined;
2172
+ constructor(renderer: Renderer2, el: ElementRef);
2173
+ /**
2174
+ * Method ´ngOnInit´ to apply the style of this directive.
2175
+ * This is an Angular lifecycle hook, so its called automatically by Angular itself.
2176
+ * In particular, it's called only one time!!!
2177
+ */
2178
+ ngOnInit(): void;
2179
+ /**
2180
+ * Method ´ngOnChanges´ to apply the style of this directive.
2181
+ * This is an Angular lifecycle hook, so its called automatically by Angular itself.
2182
+ * In particular, it's called when any data-bound property of a directive changes!!!
2183
+ */
2184
+ ngOnChanges(): void;
2185
+ /**
2186
+ * Private method to change both width and height of an element.
2187
+ */
2188
+ private applyStyle;
2189
+ static ɵfac: i0.ɵɵFactoryDeclaration<SizeDirective, never>;
2190
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SizeDirective, "[ksSize]", never, { "sizeConfig": { "alias": "sizeConfig"; "required": false; }; }, {}, never, never, true, never>;
2191
+ }
2192
+
2193
+ /**
2194
+ * Directive to manage keyboard navigation.
2195
+ */
2196
+ declare class KeyboardNavigationDirective {
2197
+ /**
2198
+ * Boolean input to skip keyboard navigation.
2199
+ */
2200
+ isOpen: boolean | undefined;
2201
+ /**
2202
+ * Output to emit keyboard `code` of the pressed key (keydown).
2203
+ */
2204
+ keyboardNavigation: EventEmitter<string>;
2205
+ /**
2206
+ * Listener to catch keyboard's events and call the right method based on the key.
2207
+ * For instance, pressing esc, this will call `closeGallery(Action.KEYBOARD)` and so on.
2208
+ * If you passed a valid `keyboardConfig` esc, right and left buttons will be customized based on your data.
2209
+ * @param e KeyboardEvent caught by the listener.
2210
+ */
2211
+ onKeyDown(e: KeyboardEvent): void;
2212
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeyboardNavigationDirective, never>;
2213
+ static ɵdir: i0.ɵɵDirectiveDeclaration<KeyboardNavigationDirective, "[ksKeyboardNavigation]", never, { "isOpen": { "alias": "isOpen"; "required": false; }; }, { "keyboardNavigation": "keyboardNavigation"; }, never, never, true, never>;
2214
+ }
2215
+
2216
+ /**
2217
+ * Directive to change the flex-wrap css property of an element.
2218
+ */
2219
+ declare class WrapDirective implements OnInit, OnChanges {
2220
+ private renderer;
2221
+ private el;
2222
+ /**
2223
+ * Boolean input that it's true to add 'flex-wrap: wrap', 'flex-wrap: nowrap' otherwise.
2224
+ */
2225
+ wrap: boolean | undefined;
2226
+ /**
2227
+ * String input to force the width of the element to be able to see wrapping.
2228
+ */
2229
+ width: string | undefined;
2230
+ constructor(renderer: Renderer2, el: ElementRef);
2231
+ /**
2232
+ * Method ´ngOnInit´ to apply the style of this directive.
2233
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2234
+ * In particular, it's called only one time!!!
2235
+ */
2236
+ ngOnInit(): void;
2237
+ /**
2238
+ * Method ´ngOnChanges´ to apply the style of this directive.
2239
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2240
+ * In particular, it's called when any data-bound property of a directive changes!!!
2241
+ */
2242
+ ngOnChanges(): void;
2243
+ /**
2244
+ * Private method to change both width and flex-wrap css properties.
2245
+ */
2246
+ private applyStyle;
2247
+ static ɵfac: i0.ɵɵFactoryDeclaration<WrapDirective, never>;
2248
+ static ɵdir: i0.ɵɵDirectiveDeclaration<WrapDirective, "[ksWrap]", never, { "wrap": { "alias": "wrap"; "required": false; }; "width": { "alias": "width"; "required": false; }; }, {}, never, never, true, never>;
2249
+ }
2250
+
2251
+ /**
2252
+ * Directive to change the flex-direction of an element, based on two inputs (`direction` and `justify`).
2253
+ */
2254
+ declare class DirectionDirective implements OnInit, OnChanges {
2255
+ private renderer;
2256
+ private el;
2257
+ /**
2258
+ * String input to set the css flex-direction of an element.
2259
+ */
2260
+ direction: string | undefined;
2261
+ /**
2262
+ * String input to set the css justify-content of an element.
2263
+ */
2264
+ justify: string | undefined;
2265
+ constructor(renderer: Renderer2, el: ElementRef);
2266
+ /**
2267
+ * Method ´ngOnInit´ to apply the style of this directive.
2268
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2269
+ * In particular, it's called only one time!!!
2270
+ */
2271
+ ngOnInit(): void;
2272
+ /**
2273
+ * Method ´ngOnChanges´ to apply the style of this directive.
2274
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2275
+ * In particular, it's called when any data-bound property of a directive changes!!!
2276
+ */
2277
+ ngOnChanges(): void;
2278
+ /**
2279
+ * Private method to change both direction and justify of an element.
2280
+ */
2281
+ private applyStyle;
2282
+ static ɵfac: i0.ɵɵFactoryDeclaration<DirectionDirective, never>;
2283
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DirectionDirective, "[ksDirection]", never, { "direction": { "alias": "direction"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; }, {}, never, never, true, never>;
2284
+ }
2285
+
2286
+ /**
2287
+ * Directive to add an image to an `<a>` tag with some additional custom properties.
2288
+ */
2289
+ declare class ATagBgImageDirective implements OnInit, OnChanges {
2290
+ private renderer;
2291
+ private el;
2292
+ /**
2293
+ * Object of type `Image` that represents the image to add to the `<a>` tag.
2294
+ */
2295
+ image: Image | undefined;
2296
+ /**
2297
+ * Additional style to customize the background attribute.
2298
+ * Empty string by default.
2299
+ */
2300
+ style: string | undefined;
2301
+ constructor(renderer: Renderer2, el: ElementRef);
2302
+ /**
2303
+ * Method ´ngOnInit´ to apply the style of this directive.
2304
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2305
+ * In particular, it's called only one time!!!
2306
+ */
2307
+ ngOnInit(): void;
2308
+ /**
2309
+ * Method ´ngOnChanges´ to apply the style of this directive.
2310
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2311
+ * In particular, it's called when any data-bound property of a directive changes!!!
2312
+ */
2313
+ ngOnChanges(): void;
2314
+ /**
2315
+ * Private method to add an image as background of an `<a>` tag.
2316
+ */
2317
+ private applyStyle;
2318
+ static ɵfac: i0.ɵɵFactoryDeclaration<ATagBgImageDirective, never>;
2319
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ATagBgImageDirective, "[ksATagBgImage]", never, { "image": { "alias": "image"; "required": false; }; "style": { "alias": "style"; "required": false; }; }, {}, never, never, true, never>;
2320
+ }
2321
+
2322
+ /**
2323
+ * Directive to customize the description.
2324
+ */
2325
+ declare class DescriptionDirective implements OnInit, OnChanges {
2326
+ private renderer;
2327
+ private el;
2328
+ /**
2329
+ * Object of type `Description` to resize the element.
2330
+ */
2331
+ description: Description | undefined;
2332
+ constructor(renderer: Renderer2, el: ElementRef);
2333
+ /**
2334
+ * Method ´ngOnInit´ to apply the style of this directive.
2335
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2336
+ * In particular, it's called only one time!!!
2337
+ */
2338
+ ngOnInit(): void;
2339
+ /**
2340
+ * Method ´ngOnChanges´ to apply the style of this directive.
2341
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2342
+ * In particular, it's called when any data-bound property of a directive changes!!!
2343
+ */
2344
+ ngOnChanges(): void;
2345
+ /**
2346
+ * Private method to change description's style.
2347
+ */
2348
+ private applyStyle;
2349
+ static ɵfac: i0.ɵɵFactoryDeclaration<DescriptionDirective, never>;
2350
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DescriptionDirective, "[ksDescription]", never, { "description": { "alias": "description"; "required": false; }; }, {}, never, never, true, never>;
2351
+ }
2352
+
2353
+ /**
2354
+ * Directive to change margins of an element.
2355
+ */
2356
+ declare class MarginDirective implements OnInit, OnChanges {
2357
+ private renderer;
2358
+ private el;
2359
+ /**
2360
+ * String to set the margin of an element.
2361
+ */
2362
+ marginLeft: string | undefined;
2363
+ /**
2364
+ * String to set the margin of an element.
2365
+ */
2366
+ marginRight: string | undefined;
2367
+ /**
2368
+ * String to set the margin of an element.
2369
+ */
2370
+ marginTop: string | undefined;
2371
+ /**
2372
+ * String to set the margin of an element.
2373
+ */
2374
+ marginBottom: string | undefined;
2375
+ constructor(renderer: Renderer2, el: ElementRef);
2376
+ /**
2377
+ * Method ´ngOnInit´ to apply the style of this directive.
2378
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2379
+ * In particular, it's called only one time!!!
2380
+ */
2381
+ ngOnInit(): void;
2382
+ /**
2383
+ * Method ´ngOnChanges´ to apply the style of this directive.
2384
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2385
+ * In particular, it's called when any data-bound property of a directive changes!!!
2386
+ */
2387
+ ngOnChanges(): void;
2388
+ /**
2389
+ * Private method to change both width and height of an element.
2390
+ */
2391
+ private applyStyle;
2392
+ static ɵfac: i0.ɵɵFactoryDeclaration<MarginDirective, never>;
2393
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MarginDirective, "[ksMargin]", never, { "marginLeft": { "alias": "marginLeft"; "required": false; }; "marginRight": { "alias": "marginRight"; "required": false; }; "marginTop": { "alias": "marginTop"; "required": false; }; "marginBottom": { "alias": "marginBottom"; "required": false; }; }, {}, never, never, true, never>;
2394
+ }
2395
+
2396
+ /**
2397
+ * Interface `MaxSize` to configure the size based on max-width and max-height.
2398
+ * They can be pixels, percentages.
2399
+ */
2400
+ interface MaxSize {
2401
+ maxWidth?: string;
2402
+ maxHeight?: string;
2403
+ }
2404
+
2405
+ /**
2406
+ * Directive to change the max size of an element.
2407
+ */
2408
+ declare class MaxSizeDirective implements OnInit, OnChanges {
2409
+ private renderer;
2410
+ private el;
2411
+ /**
2412
+ * Object of type `MaxSize` to resize the element.
2413
+ */
2414
+ maxSizeConfig: MaxSize | undefined;
2415
+ constructor(renderer: Renderer2, el: ElementRef);
2416
+ /**
2417
+ * Method ´ngOnInit´ to apply the style of this directive.
2418
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2419
+ * In particular, it's called only one time!!!
2420
+ */
2421
+ ngOnInit(): void;
2422
+ /**
2423
+ * Method ´ngOnChanges´ to apply the style of this directive.
2424
+ * This is an angular lifecycle hook, so its called automatically by Angular itself.
2425
+ * In particular, it's called when any data-bound property of a directive changes!!!
2426
+ */
2427
+ ngOnChanges(): void;
2428
+ /**
2429
+ * Private method to change both max-width and max-height of an element.
2430
+ */
2431
+ private applyStyle;
2432
+ static ɵfac: i0.ɵɵFactoryDeclaration<MaxSizeDirective, never>;
2433
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MaxSizeDirective, "[ksMaxSize]", never, { "maxSizeConfig": { "alias": "maxSizeConfig"; "required": false; }; }, {}, never, never, true, never>;
2434
+ }
2435
+
2436
+ /**
2437
+ * Directive to add fallback image if the original one is not reachable.
2438
+ */
2439
+ declare class FallbackImageDirective {
2440
+ private renderer;
2441
+ private el;
2442
+ fallbackImg: string | SafeResourceUrl | undefined;
2443
+ fallbackApplied: EventEmitter<boolean>;
2444
+ constructor(renderer: Renderer2, el: ElementRef);
2445
+ onError(): void;
2446
+ static ɵfac: i0.ɵɵFactoryDeclaration<FallbackImageDirective, never>;
2447
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FallbackImageDirective, "[ksFallbackImage]", never, { "fallbackImg": { "alias": "fallbackImg"; "required": false; }; }, { "fallbackApplied": "fallbackApplied"; }, never, never, true, never>;
2448
+ }
2449
+
2450
+ /**
2451
+ * Directive to manage swipe events on touch devices.
2452
+ */
2453
+ declare class SwipeDirective {
2454
+ defaultTouch: {
2455
+ x: number;
2456
+ y: number;
2457
+ time: number;
2458
+ };
2459
+ /**
2460
+ * Output to emit swipe left event. Payload is empty.
2461
+ */
2462
+ swipeLeft: EventEmitter<void>;
2463
+ /**
2464
+ * Output to emit swipe right event. Payload is empty.
2465
+ */
2466
+ swipeRight: EventEmitter<void>;
2467
+ /**
2468
+ * Output to emit swipe up event. Payload is empty.
2469
+ */
2470
+ swipeUp: EventEmitter<void>;
2471
+ /**
2472
+ * Output to emit swipe down event. Payload is empty.
2473
+ */
2474
+ swipeDown: EventEmitter<void>;
2475
+ /**
2476
+ * Method called by Angular itself every click thanks to `@HostListener`.
2477
+ * @param event TouchEvent payload received on touch
2478
+ */
2479
+ handleTouch(event: TouchEvent): void;
2480
+ static ɵfac: i0.ɵɵFactoryDeclaration<SwipeDirective, never>;
2481
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SwipeDirective, "[ksSwipe]", never, {}, { "swipeLeft": "swipeLeft"; "swipeRight": "swipeRight"; "swipeUp": "swipeUp"; "swipeDown": "swipeDown"; }, never, never, true, never>;
2482
+ }
2483
+
2484
+ /**
2485
+ * Module to import it in the root module of your application.
2486
+ */
2487
+ declare class GalleryModule {
2488
+ static ɵfac: i0.ɵɵFactoryDeclaration<GalleryModule, never>;
2489
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GalleryModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof PlainGalleryComponent, typeof CarouselComponent, typeof CarouselPreviewsComponent, typeof UpperButtonsComponent, typeof DotsComponent, typeof PreviewsComponent, typeof CurrentImageComponent, typeof LoadingSpinnerComponent, typeof AccessibleComponent, typeof ModalGalleryComponent, typeof ClickOutsideDirective, typeof SizeDirective, typeof KeyboardNavigationDirective, typeof WrapDirective, typeof DirectionDirective, typeof ATagBgImageDirective, typeof DescriptionDirective, typeof MarginDirective, typeof MaxSizeDirective, typeof FallbackImageDirective, typeof SwipeDirective], [typeof PlainGalleryComponent, typeof CarouselComponent]>;
2490
+ static ɵinj: i0.ɵɵInjectorDeclaration<GalleryModule>;
2491
+ }
2492
+
2493
+ interface InteractionEvent {
2494
+ source: string;
2495
+ action: Action;
2496
+ payload: any;
2497
+ }
2498
+
2499
+ /**
2500
+ * Default accessibility configuration.
2501
+ */
2502
+ declare const KS_DEFAULT_ACCESSIBILITY_CONFIG: AccessibilityConfig;
2503
+
2504
+ /**
2505
+ * Default button size object
2506
+ */
2507
+ declare const KS_DEFAULT_SIZE: Size;
2508
+ /**
2509
+ * Default close button object
2510
+ */
2511
+ declare const KS_DEFAULT_BTN_CLOSE: ButtonConfig;
2512
+ /**
2513
+ * Default download button object
2514
+ */
2515
+ declare const KS_DEFAULT_BTN_DOWNLOAD: ButtonConfig;
2516
+ /**
2517
+ * Default exturl button object
2518
+ */
2519
+ declare const KS_DEFAULT_BTN_EXTURL: ButtonConfig;
2520
+ /**
2521
+ * Default delete button object
2522
+ */
2523
+ declare const KS_DEFAULT_BTN_DELETE: ButtonConfig;
2524
+ /**
2525
+ * Default full-screen button object
2526
+ */
2527
+ declare const KS_DEFAULT_BTN_FULL_SCREEN: ButtonConfig;
2528
+
2529
+ export { Action, ButtonType, ButtonsStrategy, CarouselComponent, DescriptionStrategy, GalleryModule, GridLayout, Image, ImageEvent, ImageModalEvent, KS_DEFAULT_ACCESSIBILITY_CONFIG, KS_DEFAULT_BTN_CLOSE, KS_DEFAULT_BTN_DELETE, KS_DEFAULT_BTN_DOWNLOAD, KS_DEFAULT_BTN_EXTURL, KS_DEFAULT_BTN_FULL_SCREEN, KS_DEFAULT_SIZE, LineLayout, LoadingType, ModalGalleryComponent, ModalGalleryRef, ModalGalleryService, PlainGalleryComponent, PlainGalleryStrategy };
2530
+ export type { AccessibilityConfig, BreakConfig, BreakpointsConfig, ButtonConfig, ButtonEvent, ButtonsConfig, CarouselConfig, CarouselImageConfig, CarouselLibConfig, CarouselPreviewConfig, CurrentImageConfig, Description, DotsConfig, InteractionEvent, KeyboardConfig, LoadingConfig, ModalGalleryConfig, ModalImage, ModalLibConfig, PlainGalleryConfig, PlainGalleryLayout, PlainImage, PlainLibConfig, PlayConfig, PreviewConfig, SidePreviewsConfig, Size, SlideConfig };