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