@ks89/angular-modal-gallery 12.0.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/CONTRIBUTING.md +8 -11
  3. package/LICENSE +1 -1
  4. package/README.md +10 -6
  5. package/fesm2022/ks89-angular-modal-gallery.mjs +832 -909
  6. package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
  7. package/index.d.ts +2528 -3
  8. package/package.json +8 -10
  9. package/esm2022/ks89-angular-modal-gallery.mjs +0 -5
  10. package/esm2022/lib/components/accessibility-default.mjs +0 -41
  11. package/esm2022/lib/components/accessible.component.mjs +0 -130
  12. package/esm2022/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +0 -456
  13. package/esm2022/lib/components/carousel/carousel.component.mjs +0 -738
  14. package/esm2022/lib/components/components.mjs +0 -50
  15. package/esm2022/lib/components/current-image/current-image.component.mjs +0 -607
  16. package/esm2022/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +0 -80
  17. package/esm2022/lib/components/dots/dots.component.mjs +0 -124
  18. package/esm2022/lib/components/modal-gallery/attach-to-overlay.service.mjs +0 -42
  19. package/esm2022/lib/components/modal-gallery/modal-gallery-ref.mjs +0 -103
  20. package/esm2022/lib/components/modal-gallery/modal-gallery.component.mjs +0 -499
  21. package/esm2022/lib/components/modal-gallery/modal-gallery.service.mjs +0 -168
  22. package/esm2022/lib/components/modal-gallery/modal-gallery.tokens.mjs +0 -26
  23. package/esm2022/lib/components/plain-gallery/plain-gallery.component.mjs +0 -249
  24. package/esm2022/lib/components/previews/previews.component.mjs +0 -263
  25. package/esm2022/lib/components/upper-buttons/upper-buttons-default.mjs +0 -76
  26. package/esm2022/lib/components/upper-buttons/upper-buttons.component.mjs +0 -243
  27. package/esm2022/lib/directives/a-tag-bg-image.directive.mjs +0 -78
  28. package/esm2022/lib/directives/click-outside.directive.mjs +0 -91
  29. package/esm2022/lib/directives/description.directive.mjs +0 -98
  30. package/esm2022/lib/directives/direction.directive.mjs +0 -73
  31. package/esm2022/lib/directives/directives.mjs +0 -51
  32. package/esm2022/lib/directives/fallback-image.directive.mjs +0 -59
  33. package/esm2022/lib/directives/keyboard-navigation.directive.mjs +0 -64
  34. package/esm2022/lib/directives/margin.directive.mjs +0 -84
  35. package/esm2022/lib/directives/max-size.directive.mjs +0 -75
  36. package/esm2022/lib/directives/size.directive.mjs +0 -76
  37. package/esm2022/lib/directives/swipe.directive.mjs +0 -116
  38. package/esm2022/lib/directives/wrap.directive.mjs +0 -74
  39. package/esm2022/lib/modal-gallery.module.mjs +0 -88
  40. package/esm2022/lib/model/accessibility.interface.mjs +0 -25
  41. package/esm2022/lib/model/action.enum.mjs +0 -36
  42. package/esm2022/lib/model/buttons-config.interface.mjs +0 -62
  43. package/esm2022/lib/model/carousel-config.interface.mjs +0 -25
  44. package/esm2022/lib/model/carousel-image-config.interface.mjs +0 -25
  45. package/esm2022/lib/model/carousel-preview-config.interface.mjs +0 -25
  46. package/esm2022/lib/model/current-image-config.interface.mjs +0 -25
  47. package/esm2022/lib/model/description.interface.mjs +0 -33
  48. package/esm2022/lib/model/dots-config.interface.mjs +0 -25
  49. package/esm2022/lib/model/image-internal.class.mjs +0 -35
  50. package/esm2022/lib/model/image.class.mjs +0 -56
  51. package/esm2022/lib/model/interaction-event.interface.mjs +0 -2
  52. package/esm2022/lib/model/keyboard-config.interface.mjs +0 -25
  53. package/esm2022/lib/model/keyboard.enum.mjs +0 -35
  54. package/esm2022/lib/model/lib-config.interface.mjs +0 -25
  55. package/esm2022/lib/model/loading-config.interface.mjs +0 -37
  56. package/esm2022/lib/model/max-size.interface.mjs +0 -25
  57. package/esm2022/lib/model/modal-gallery-config.interface.mjs +0 -25
  58. package/esm2022/lib/model/plain-gallery-config.interface.mjs +0 -55
  59. package/esm2022/lib/model/play-config.interface.mjs +0 -25
  60. package/esm2022/lib/model/preview-config.interface.mjs +0 -25
  61. package/esm2022/lib/model/size.interface.mjs +0 -25
  62. package/esm2022/lib/model/slide-config.interface.mjs +0 -25
  63. package/esm2022/lib/services/config.service.mjs +0 -388
  64. package/esm2022/lib/services/id-validator.service.mjs +0 -71
  65. package/esm2022/lib/utils/image.util.mjs +0 -48
  66. package/esm2022/lib/utils/user-input.util.mjs +0 -104
  67. package/esm2022/public-api.mjs +0 -42
  68. package/lib/components/accessibility-default.d.ts +0 -5
  69. package/lib/components/accessible.component.d.ts +0 -50
  70. package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -195
  71. package/lib/components/carousel/carousel.component.d.ts +0 -276
  72. package/lib/components/components.d.ts +0 -15
  73. package/lib/components/current-image/current-image.component.d.ts +0 -282
  74. package/lib/components/current-image/loading-spinner/loading-spinner.component.d.ts +0 -55
  75. package/lib/components/dots/dots.component.d.ts +0 -81
  76. package/lib/components/modal-gallery/attach-to-overlay.service.d.ts +0 -20
  77. package/lib/components/modal-gallery/modal-gallery-ref.d.ts +0 -64
  78. package/lib/components/modal-gallery/modal-gallery.component.d.ts +0 -246
  79. package/lib/components/modal-gallery/modal-gallery.service.d.ts +0 -100
  80. package/lib/components/modal-gallery/modal-gallery.tokens.d.ts +0 -3
  81. package/lib/components/plain-gallery/plain-gallery.component.d.ts +0 -135
  82. package/lib/components/previews/previews.component.d.ts +0 -155
  83. package/lib/components/upper-buttons/upper-buttons-default.d.ts +0 -29
  84. package/lib/components/upper-buttons/upper-buttons.component.d.ts +0 -132
  85. package/lib/directives/a-tag-bg-image.directive.d.ts +0 -38
  86. package/lib/directives/click-outside.directive.d.ts +0 -24
  87. package/lib/directives/description.directive.d.ts +0 -33
  88. package/lib/directives/direction.directive.d.ts +0 -36
  89. package/lib/directives/directives.d.ts +0 -15
  90. package/lib/directives/fallback-image.directive.d.ts +0 -16
  91. package/lib/directives/keyboard-navigation.directive.d.ts +0 -24
  92. package/lib/directives/margin.directive.d.ts +0 -44
  93. package/lib/directives/max-size.directive.d.ts +0 -33
  94. package/lib/directives/size.directive.d.ts +0 -33
  95. package/lib/directives/swipe.directive.d.ts +0 -35
  96. package/lib/directives/wrap.directive.d.ts +0 -36
  97. package/lib/modal-gallery.module.d.ts +0 -32
  98. package/lib/model/accessibility.interface.d.ts +0 -40
  99. package/lib/model/action.enum.d.ts +0 -11
  100. package/lib/model/buttons-config.interface.d.ts +0 -57
  101. package/lib/model/carousel-config.interface.d.ts +0 -11
  102. package/lib/model/carousel-image-config.interface.d.ts +0 -8
  103. package/lib/model/carousel-preview-config.interface.d.ts +0 -22
  104. package/lib/model/current-image-config.interface.d.ts +0 -12
  105. package/lib/model/description.interface.d.ts +0 -39
  106. package/lib/model/dots-config.interface.d.ts +0 -6
  107. package/lib/model/image-internal.class.d.ts +0 -9
  108. package/lib/model/image.class.d.ts +0 -64
  109. package/lib/model/interaction-event.interface.d.ts +0 -6
  110. package/lib/model/keyboard-config.interface.d.ts +0 -8
  111. package/lib/model/keyboard.enum.d.ts +0 -13
  112. package/lib/model/lib-config.interface.d.ts +0 -39
  113. package/lib/model/loading-config.interface.d.ts +0 -19
  114. package/lib/model/max-size.interface.d.ts +0 -8
  115. package/lib/model/modal-gallery-config.interface.d.ts +0 -16
  116. package/lib/model/plain-gallery-config.interface.d.ts +0 -57
  117. package/lib/model/play-config.interface.d.ts +0 -8
  118. package/lib/model/preview-config.interface.d.ts +0 -12
  119. package/lib/model/size.interface.d.ts +0 -8
  120. package/lib/model/slide-config.interface.d.ts +0 -17
  121. package/lib/services/config.service.d.ts +0 -39
  122. package/lib/services/id-validator.service.d.ts +0 -25
  123. package/lib/utils/image.util.d.ts +0 -10
  124. package/lib/utils/user-input.util.d.ts +0 -80
  125. package/public-api.d.ts +0 -31
@@ -1,276 +0,0 @@
1
- import { AfterContentInit, ChangeDetectorRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { AccessibleComponent } from '../accessible.component';
3
- import { AccessibilityConfig } from '../../model/accessibility.interface';
4
- import { Image, ImageEvent } from '../../model/image.class';
5
- import { Action } from '../../model/action.enum';
6
- import { DotsConfig } from '../../model/dots-config.interface';
7
- import { CarouselConfig } from '../../model/carousel-config.interface';
8
- import { CarouselImageConfig } from '../../model/carousel-image-config.interface';
9
- import { ConfigService } from '../../services/config.service';
10
- import { ModalGalleryService } from '../modal-gallery/modal-gallery.service';
11
- import { CarouselLibConfig } from '../../model/lib-config.interface';
12
- import { InternalLibImage } from '../../model/image-internal.class';
13
- import * as i0 from "@angular/core";
14
- /**
15
- * Component with configurable inline/plain carousel.
16
- */
17
- export declare class CarouselComponent extends AccessibleComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {
18
- private platformId;
19
- private ngZone;
20
- private modalGalleryService;
21
- private configService;
22
- private ref;
23
- /**
24
- * Attribute to set ariaLabel of the host component
25
- */
26
- ariaLabel: string;
27
- /**
28
- * Unique id (>=0) of the current instance of the carousel. This is useful when you are using
29
- * the carousel's feature to open modal gallery.
30
- */
31
- id: number | undefined;
32
- /**
33
- * Array of `InternalLibImage` that represent the model of this library with all images,
34
- * thumbs and so on.
35
- */
36
- images: Image[];
37
- /**
38
- * CarouselLibConfig object to configure carousel.
39
- */
40
- config: CarouselLibConfig | undefined;
41
- /**
42
- * Output to emit an event when an image is clicked.
43
- */
44
- clickImage: EventEmitter<number>;
45
- /**
46
- * Output to emit an event when current image is changed.
47
- */
48
- changeImage: EventEmitter<ImageEvent>;
49
- /**
50
- * Output to emit an event when the current image is the first one.
51
- */
52
- firstImage: EventEmitter<ImageEvent>;
53
- /**
54
- * Output to emit an event when the current image is the last one.
55
- */
56
- lastImage: EventEmitter<ImageEvent>;
57
- /**
58
- * Object of type `CarouselConfig` to init CarouselComponent's features.
59
- * For instance, it contains parameters to change the style, how it navigates and so on.
60
- */
61
- carouselConfig: CarouselConfig | undefined;
62
- /**
63
- * Object of type `DotsConfig` to init DotsComponent's features.
64
- * For instance, it contains a param to show/hide this component.
65
- */
66
- carouselDotsConfig: DotsConfig | undefined;
67
- /**
68
- * Object of type `AccessibilityConfig` to init custom accessibility features.
69
- * For instance, it contains titles, alt texts, aria-labels and so on.
70
- */
71
- accessibilityConfig: AccessibilityConfig | undefined;
72
- /**
73
- * Object of type `CarouselImageConfig` to configure the current image of the carousel.
74
- */
75
- carouselImageConfig: CarouselImageConfig | undefined;
76
- /**
77
- * Enable/disable infinite sliding.
78
- */
79
- carouselSlideInfinite: boolean | undefined;
80
- /**
81
- * Enum of type `Action` that represents a mouse click on a button.
82
- * Declared here to be used inside the template.
83
- */
84
- clickAction: Action;
85
- /**
86
- * Enum of type `Action` that represents a keyboard action.
87
- * Declared here to be used inside the template.
88
- */
89
- keyboardAction: Action;
90
- /**
91
- * `Image` that is visible right now.
92
- */
93
- currentImage: InternalLibImage | undefined;
94
- /**
95
- * Boolean that it's true when you are watching the first image (currently visible).
96
- * False by default
97
- */
98
- isFirstImage: boolean;
99
- /**
100
- * Boolean that it's true when you are watching the last image (currently visible).
101
- * False by default
102
- */
103
- isLastImage: boolean;
104
- /**
105
- * Subject to play the carousel.
106
- */
107
- private start$;
108
- /**
109
- * Subject to stop the carousel.
110
- */
111
- private stop$;
112
- /**
113
- * Listener to stop the gallery when the mouse pointer is over the current image.
114
- */
115
- onMouseEnter(): void;
116
- /**
117
- * Listener to play the gallery when the mouse pointer leave the current image.
118
- */
119
- onMouseLeave(): void;
120
- /**
121
- * Listener to navigate carousel images with keyboard (left).
122
- */
123
- onKeyDownLeft(): void;
124
- /**
125
- * Listener to navigate carousel images with keyboard (right).
126
- */
127
- onKeyDownLRight(): void;
128
- constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef);
129
- ngOnInit(): void;
130
- ngOnChanges(changes: SimpleChanges): void;
131
- ngAfterContentInit(): void;
132
- /**
133
- * Method called when a dot is clicked and used to update the current image.
134
- * @param number index of the clicked dot
135
- */
136
- onClickDot(index: number): void;
137
- /**
138
- * Method called by events from both keyboard and mouse on a navigation arrow.
139
- * @param string direction of the navigation that can be either 'next' or 'prev'
140
- * @param KeyboardEvent | MouseEvent event payload
141
- * @param Action action that triggered the event or `Action.NORMAL` if not provided
142
- */
143
- onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action): void;
144
- /**
145
- * Method triggered when you click on the current image.
146
- * Also, if modalGalleryEnable is true, you can open the modal-gallery.
147
- */
148
- onClickCurrentImage(): void;
149
- /**
150
- * Method to get the image description based on input params.
151
- * If you provide a full description this will be the visible description, otherwise,
152
- * it will be built using the `Description` object, concatenating its fields.
153
- * @param Image image to get its description. If not provided it will be the current image
154
- * @returns String description of the image (or the current image if not provided)
155
- * @throws an Error if description isn't available
156
- */
157
- getDescriptionToDisplay(image?: Image | undefined): string;
158
- /**
159
- * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).
160
- * @param action String that represent the direction of the swipe action. 'swiperight' by default.
161
- */
162
- swipe(action?: string): void;
163
- /**
164
- * Method to go back to the previous image.
165
- * @param action Enum of type `Action` that represents the source
166
- * action that moved back to the previous image. `Action.NORMAL` by default.
167
- */
168
- prevImage(action?: Action): void;
169
- /**
170
- * Method to go back to the previous image.
171
- * @param action Enum of type `Action` that represents the source
172
- * action that moved to the next image. `Action.NORMAL` by default.
173
- */
174
- nextImage(action?: Action): void;
175
- /**
176
- * Method used in the template to track ids in ngFor.
177
- * @param number index of the array
178
- * @param Image item of the array
179
- * @returns number the id of the item
180
- */
181
- trackById(index: number, item: Image): number;
182
- /**
183
- * Method called when an image preview is clicked and used to update the current image.
184
- * @param event an ImageEvent object with the relative action and the index of the clicked preview.
185
- */
186
- onClickPreview(event: ImageEvent): void;
187
- /**
188
- * Method to play carousel.
189
- */
190
- playCarousel(): void;
191
- /**
192
- * Stops the carousel from cycling through items.
193
- */
194
- stopCarousel(): void;
195
- /**
196
- * Method to get `alt attribute`.
197
- * `alt` specifies an alternate text for an image, if the image cannot be displayed.
198
- * @param Image image to get its alt description. If not provided it will be the current image
199
- * @returns String alt description of the image (or the current image if not provided)
200
- */
201
- getAltDescriptionByImage(image?: Image | undefined): string;
202
- /**
203
- * Method to get the title attributes based on descriptions.
204
- * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,
205
- * it prevents an empty string as title.
206
- * @param Image image to get its description. If not provided it will be the current image
207
- * @returns String title of the image based on descriptions
208
- * @throws an Error if description isn't available
209
- */
210
- getTitleToDisplay(image?: Image | undefined): string;
211
- /**
212
- * Method to reset carousel (force image with index 0 to be the current image and re-init also previews)
213
- */
214
- /**
215
- * Method to cleanup resources. In fact, this will stop the carousel.
216
- * This is an angular lifecycle hook that is called when this component is destroyed.
217
- */
218
- ngOnDestroy(): void;
219
- /**
220
- * Method to change the current image, receiving the new image as input the relative action.
221
- * @param image an Image object that represents the new image to set as current.
222
- * @param action Enum of type `Action` that represents the source action that triggered the change.
223
- */
224
- private changeCurrentImage;
225
- /**
226
- * Private method to get the next index.
227
- * This is necessary because at the end, when you call next again, you'll go to the first image.
228
- * That happens because all modal images are shown like in a circle.
229
- */
230
- private getNextImage;
231
- /**
232
- * Private method to get the previous index.
233
- * This is necessary because at index 0, when you call prev again, you'll go to the last image.
234
- * That happens because all modal images are shown like in a circle.
235
- */
236
- private getPrevImage;
237
- /**
238
- * Private method to build a text description.
239
- * This is used also to create titles.
240
- * @param Image image to get its description. If not provided it will be the current image.
241
- * @param boolean imageWithoutDescription is a boolean that it's true if the image hasn't a 'modal' description.
242
- * @returns String description built concatenating image fields with a specific logic.
243
- */
244
- private buildTextDescription;
245
- /**
246
- * Private method to update both `isFirstImage` and `isLastImage` based on
247
- * the index of the current image.
248
- * @param number currentIndex is the index of the current image
249
- */
250
- private handleBoundaries;
251
- /**
252
- * Private method to manage boundary arrows and sliding.
253
- * This is based on the slideConfig input to enable/disable 'infinite sliding'.
254
- * @param number index of the visible image
255
- */
256
- private manageSlideConfig;
257
- /**
258
- * Private method to emit events when either the last or the first image are visible.
259
- * @param action Enum of type Action that represents the source of the event that changed the
260
- * current image to the first one or the last one.
261
- * @param indexToCheck is the index number of the image (the first or the last one).
262
- */
263
- private emitBoundaryEvent;
264
- /**
265
- * Private method to check if next/prev actions should be blocked.
266
- * It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.
267
- * If yes, it returns true to say that sliding should be blocked, otherwise not.
268
- * @param number boundaryIndex that could be either the beginning index (0) or the last index
269
- * of images (this.images.length - 1).
270
- * @returns boolean true if carouselSlideInfinite === false and the current index is
271
- * either the first or the last one.
272
- */
273
- private isPreventSliding;
274
- static ɵfac: i0.ɵɵFactoryDeclaration<CarouselComponent, never>;
275
- static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": { "alias": "id"; "required": false; }; "images": { "alias": "images"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "clickImage": "clickImage"; "changeImage": "changeImage"; "firstImage": "firstImage"; "lastImage": "lastImage"; }, never, ["*"], false, never>;
276
- }
@@ -1,15 +0,0 @@
1
- import { CarouselComponent } from './carousel/carousel.component';
2
- import { CarouselPreviewsComponent } from './carousel/carousel-previews/carousel-previews.component';
3
- import { UpperButtonsComponent } from './upper-buttons/upper-buttons.component';
4
- import { DotsComponent } from './dots/dots.component';
5
- import { PreviewsComponent } from './previews/previews.component';
6
- import { CurrentImageComponent } from './current-image/current-image.component';
7
- import { LoadingSpinnerComponent } from './current-image/loading-spinner/loading-spinner.component';
8
- import { AccessibleComponent } from './accessible.component';
9
- import { PlainGalleryComponent } from './plain-gallery/plain-gallery.component';
10
- export { CarouselComponent } from './carousel/carousel.component';
11
- import { ModalGalleryComponent } from './modal-gallery/modal-gallery.component';
12
- /**
13
- * Array of all components.
14
- */
15
- export declare const COMPONENTS: (typeof AccessibleComponent | typeof CarouselComponent | typeof CarouselPreviewsComponent | typeof UpperButtonsComponent | typeof DotsComponent | typeof PreviewsComponent | typeof CurrentImageComponent | typeof LoadingSpinnerComponent | typeof PlainGalleryComponent | typeof ModalGalleryComponent)[];
@@ -1,282 +0,0 @@
1
- import { AfterContentInit, ChangeDetectorRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { AccessibleComponent } from '../accessible.component';
3
- import { AccessibilityConfig } from '../../model/accessibility.interface';
4
- import { Action } from '../../model/action.enum';
5
- import { Image, ImageModalEvent } from '../../model/image.class';
6
- import { InternalLibImage } from '../../model/image-internal.class';
7
- import { KeyboardConfig } from '../../model/keyboard-config.interface';
8
- import { SlideConfig } from '../../model/slide-config.interface';
9
- import { CurrentImageConfig } from '../../model/current-image-config.interface';
10
- import { ConfigService } from '../../services/config.service';
11
- import * as i0 from "@angular/core";
12
- /**
13
- * Interface to describe the Load Event, used to
14
- * emit an event when the image is finally loaded and the spinner has gone.
15
- */
16
- export interface ImageLoadEvent {
17
- status: boolean;
18
- index: number;
19
- id: number;
20
- }
21
- /**
22
- * Component with the current image with some additional elements like arrows and side previews.
23
- */
24
- export declare class CurrentImageComponent extends AccessibleComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {
25
- private platformId;
26
- private ngZone;
27
- ref: ChangeDetectorRef;
28
- private configService;
29
- /**
30
- * Unique id (>=0) of the current instance of this library. This is useful when you are using
31
- * the service to call modal gallery without open it manually.
32
- */
33
- id: number;
34
- /**
35
- * Object of type `InternalLibImage` that represent the visible image.
36
- */
37
- currentImage: InternalLibImage;
38
- /**
39
- * Array of `InternalLibImage` that represent the model of this library with all images,
40
- * thumbs and so on.
41
- */
42
- images: InternalLibImage[];
43
- /**
44
- * Boolean that it is true if the modal gallery is visible.
45
- * If yes, also this component should be visible.
46
- */
47
- isOpen: boolean;
48
- /**
49
- * Output to emit an event when images are loaded. The payload contains an `ImageLoadEvent`.
50
- */
51
- loadImage: EventEmitter<ImageLoadEvent>;
52
- /**
53
- * Output to emit any changes of the current image. The payload contains an `ImageModalEvent`.
54
- */
55
- changeImage: EventEmitter<ImageModalEvent>;
56
- /**
57
- * Output to emit an event when the modal gallery is closed. The payload contains an `ImageModalEvent`.
58
- */
59
- closeGallery: EventEmitter<ImageModalEvent>;
60
- /**
61
- * Subject to play modal-gallery.
62
- */
63
- private start$;
64
- /**
65
- * Subject to stop modal-gallery.
66
- */
67
- private stop$;
68
- /**
69
- * Enum of type `Action` that represents a normal action.
70
- * Declared here to be used inside the template.
71
- */
72
- normalAction: Action;
73
- /**
74
- * Object of type `AccessibilityConfig` to init custom accessibility features.
75
- * For instance, it contains titles, alt texts, aria-labels and so on.
76
- */
77
- accessibilityConfig: AccessibilityConfig | undefined;
78
- /**
79
- * Object of type `SlideConfig` to get `infinite sliding`.
80
- */
81
- slideConfig: SlideConfig | undefined;
82
- /**
83
- * Object to configure current image in modal-gallery.
84
- * For instance you can disable navigation on click on current image (enabled by default).
85
- */
86
- currentImageConfig: CurrentImageConfig | undefined;
87
- /**
88
- * Object of type `KeyboardConfig` to assign custom keys to both ESC, RIGHT and LEFT keyboard's actions.
89
- */
90
- keyboardConfig: KeyboardConfig | undefined;
91
- /**
92
- * Enum of type `Action` that represents a mouse click on a button.
93
- * Declared here to be used inside the template.
94
- */
95
- clickAction: Action;
96
- /**
97
- * Enum of type `Action` that represents a keyboard action.
98
- * Declared here to be used inside the template.
99
- */
100
- keyboardAction: Action;
101
- /**
102
- * Boolean that it's true when you are watching the first image (currently visible).
103
- * False by default
104
- */
105
- isFirstImage: boolean;
106
- /**
107
- * Boolean that it's true when you are watching the last image (currently visible).
108
- * False by default
109
- */
110
- isLastImage: boolean;
111
- /**
112
- * Boolean that it's true if an image of the modal gallery is still loading.
113
- * True by default
114
- */
115
- loading: boolean;
116
- constructor(platformId: any, ngZone: NgZone, ref: ChangeDetectorRef, configService: ConfigService);
117
- /**
118
- * Listener to stop the gallery when the mouse pointer is over the current image.
119
- */
120
- onMouseEnter(): void;
121
- /**
122
- * Listener to play the gallery when the mouse pointer leave the current image.
123
- */
124
- onMouseLeave(): void;
125
- /**
126
- * Method ´ngOnInit´ to init configuration.
127
- * This is an angular lifecycle hook, so its called automatically by Angular itself.
128
- * In particular, it's called only one time!!!
129
- */
130
- ngOnInit(): void;
131
- /**
132
- * Method ´ngOnChanges´ to update `loading` status and emit events.
133
- * If the gallery is open, then it will also manage boundary arrows and sliding.
134
- * This is an angular lifecycle hook, so its called automatically by Angular itself.
135
- * In particular, it's called when any data-bound property of a directive changes!!!
136
- */
137
- ngOnChanges(changes: SimpleChanges): void;
138
- /**
139
- * This is an angular lifecycle hook, so its called automatically by Angular itself.
140
- */
141
- ngAfterContentInit(): void;
142
- /**
143
- * Method to handle keypress based on the `keyboardConfig` input. It gets the code of
144
- * the key that triggered the keypress event to navigate between images or to close the modal gallery.
145
- * @param code string of the key that triggered the keypress event
146
- */
147
- onKeyPress(code: string): void;
148
- /**
149
- * Method to get the image description based on input params.
150
- * If you provide a full description this will be the visible description, otherwise,
151
- * it will be built using the `Description` object, concatenating its fields.
152
- * @param Image image to get its description. If not provided it will be the current image
153
- * @returns String description of the image (or the current image if not provided)
154
- * @throws an Error if description isn't available
155
- */
156
- getDescriptionToDisplay(image?: Image): string;
157
- /**
158
- * Method to get `alt attribute`.
159
- * `alt` specifies an alternate text for an image, if the image cannot be displayed.
160
- * @param Image image to get its alt description. If not provided it will be the current image
161
- * @returns String alt description of the image (or the current image if not provided)
162
- */
163
- getAltDescriptionByImage(image?: Image): string;
164
- /**
165
- * Method to get the title attributes based on descriptions.
166
- * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,
167
- * it prevents an empty string as title.
168
- * @param Image image to get its description. If not provided it will be the current image
169
- * @returns String title of the image based on descriptions
170
- * @throws an Error if description isn't available
171
- */
172
- getTitleToDisplay(image?: Image): string;
173
- /**
174
- * Method to get the left side preview image.
175
- * @returns Image the image to show as size preview on the left
176
- */
177
- getLeftPreviewImage(): Image;
178
- /**
179
- * Method to get the right side preview image.
180
- * @returns Image the image to show as size preview on the right
181
- */
182
- getRightPreviewImage(): Image;
183
- /**
184
- * Method called by events from both keyboard and mouse on an image.
185
- * This will invoke the nextImage method.
186
- * @param KeyboardEvent | MouseEvent event payload
187
- * @param Action action that triggered the event or `Action.NORMAL` if not provided
188
- */
189
- onImageEvent(event: KeyboardEvent | MouseEvent, action?: Action): void;
190
- /**
191
- * Method called by events from both keyboard and mouse on a navigation arrow.
192
- * @param string direction of the navigation that can be either 'next' or 'prev'
193
- * @param KeyboardEvent | MouseEvent event payload
194
- * @param Action action that triggered the event or `Action.NORMAL` if not provided
195
- * @param boolean disable to disable navigation
196
- */
197
- onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action, disable?: boolean): void;
198
- /**
199
- * Method to go back to the previous image.
200
- * @param action Enum of type `Action` that represents the source
201
- * action that moved back to the previous image. `Action.NORMAL` by default.
202
- */
203
- prevImage(action?: Action): void;
204
- /**
205
- * Method to go back to the previous image.
206
- * @param action Enum of type `Action` that represents the source
207
- * action that moved to the next image. `Action.NORMAL` by default.
208
- */
209
- nextImage(action?: Action): void;
210
- /**
211
- * Method to emit an event as loadImage output to say that the requested image if loaded.
212
- * This method is invoked by the javascript's 'load' event on an img tag.
213
- * @param Event event that triggered the load
214
- */
215
- onImageLoad(event: Event): void;
216
- /**
217
- * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).
218
- * @param action String that represent the direction of the swipe action. 'swiperight' by default.
219
- */
220
- swipe(action?: string): void;
221
- /**
222
- * Method used in `modal-gallery.component` to get the index of an image to delete.
223
- * @param Image image to get the index, or the visible image, if not passed
224
- * @returns number the index of the image
225
- */
226
- getIndexToDelete(image?: Image): number;
227
- /**
228
- * Method to play modal gallery.
229
- */
230
- playCarousel(): void;
231
- /**
232
- * Stops modal gallery from cycling through items.
233
- */
234
- stopCarousel(): void;
235
- /**
236
- * Method to cleanup resources. In fact, this will stop the modal gallery.
237
- * This is an angular lifecycle hook that is called when this component is destroyed.
238
- */
239
- ngOnDestroy(): void;
240
- /**
241
- * Private method to update both `isFirstImage` and `isLastImage` based on
242
- * the index of the current image.
243
- * @param number currentIndex is the index of the current image
244
- */
245
- private handleBoundaries;
246
- /**
247
- * Private method to check if next/prev actions should be blocked.
248
- * It checks if slideConfig.infinite === false and if the image index is equals to the input parameter.
249
- * If yes, it returns true to say that sliding should be blocked, otherwise not.
250
- * @param number boundaryIndex that could be either the beginning index (0) or the last index
251
- * of images (this.images.length - 1).
252
- * @returns boolean true if slideConfig.infinite === false and the current index is
253
- * either the first or the last one.
254
- */
255
- private isPreventSliding;
256
- /**
257
- * Private method to get the next index.
258
- * This is necessary because at the end, when you call next again, you'll go to the first image.
259
- * That happens because all modal images are shown like in a circle.
260
- */
261
- private getNextImage;
262
- /**
263
- * Private method to get the previous index.
264
- * This is necessary because at index 0, when you call prev again, you'll go to the last image.
265
- * That happens because all modal images are shown like in a circle.
266
- */
267
- private getPrevImage;
268
- /**
269
- * Private method to build a text description.
270
- * This is used also to create titles.
271
- * @param Image image to get its description. If not provided it will be the current image.
272
- * @param boolean imageWithoutDescription is a boolean that it's true if the image hasn't a 'modal' description.
273
- * @returns String description built concatenating image fields with a specific logic.
274
- */
275
- private buildTextDescription;
276
- /**
277
- * Private method to call handleBoundaries when ngOnChanges is called.
278
- */
279
- private updateIndexes;
280
- static ɵfac: i0.ɵɵFactoryDeclaration<CurrentImageComponent, never>;
281
- static ɵcmp: i0.ɵɵComponentDeclaration<CurrentImageComponent, "ks-current-image", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "loadImage": "loadImage"; "changeImage": "changeImage"; "closeGallery": "closeGallery"; }, never, never, false, never>;
282
- }
@@ -1,55 +0,0 @@
1
- import { AccessibilityConfig } from '../../../model/accessibility.interface';
2
- import { LoadingConfig, LoadingType } from '../../../model/loading-config.interface';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Component with the loading spinner
6
- */
7
- export declare class LoadingSpinnerComponent {
8
- /**
9
- * Object of type `LoadingConfig` exposed to the template.
10
- * It contains a field to choose a loading spinner.
11
- */
12
- loadingConfig: LoadingConfig;
13
- /**
14
- * Object of type `AccessibilityConfig` to init custom accessibility features.
15
- * For instance, it contains titles, alt texts, aria-labels and so on.
16
- */
17
- accessibilityConfig: AccessibilityConfig;
18
- /**
19
- * Enum of type `LoadingType` to choose the standard loading spinner.
20
- * Declared here to be used inside the template.
21
- */
22
- loadingStandard: LoadingType;
23
- /**
24
- * Enum of type `LoadingType` to choose the bars loading spinner.
25
- * Declared here to be used inside the template.
26
- */
27
- loadingBars: LoadingType;
28
- /**
29
- * Enum of type `LoadingType` to choose the circular loading spinner.
30
- * Declared here to be used inside the template.
31
- */
32
- loadingCircular: LoadingType;
33
- /**
34
- * Enum of type `LoadingType` to choose the dots loading spinner.
35
- * Declared here to be used inside the template.
36
- */
37
- loadingDots: LoadingType;
38
- /**
39
- * Enum of type `LoadingType` to choose the cube flipping loading spinner.
40
- * Declared here to be used inside the template.
41
- */
42
- loadingCubeFlipping: LoadingType;
43
- /**
44
- * Enum of type `LoadingType` to choose the circles loading spinner.
45
- * Declared here to be used inside the template.
46
- */
47
- loadingCircles: LoadingType;
48
- /**
49
- * Enum of type `LoadingType` to choose the explosing squares loading spinner.
50
- * Declared here to be used inside the template.
51
- */
52
- loadingExplosingSquares: LoadingType;
53
- static ɵfac: i0.ɵɵFactoryDeclaration<LoadingSpinnerComponent, never>;
54
- static ɵcmp: i0.ɵɵComponentDeclaration<LoadingSpinnerComponent, "ks-loading-spinner", never, { "loadingConfig": { "alias": "loadingConfig"; "required": false; }; "accessibilityConfig": { "alias": "accessibilityConfig"; "required": false; }; }, {}, never, never, false, never>;
55
- }