@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.
Files changed (66) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/CONTRIBUTING.md +3 -3
  3. package/LICENSE +1 -1
  4. package/README.md +9 -6
  5. package/fesm2022/ks89-angular-modal-gallery.mjs +1497 -1534
  6. package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
  7. package/index.d.ts +2475 -3
  8. package/package.json +9 -9
  9. package/lib/components/accessibility-default.d.ts +0 -5
  10. package/lib/components/accessible.component.d.ts +0 -50
  11. package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -195
  12. package/lib/components/carousel/carousel.component.d.ts +0 -276
  13. package/lib/components/components.d.ts +0 -15
  14. package/lib/components/current-image/current-image.component.d.ts +0 -282
  15. package/lib/components/current-image/loading-spinner/loading-spinner.component.d.ts +0 -55
  16. package/lib/components/dots/dots.component.d.ts +0 -81
  17. package/lib/components/modal-gallery/attach-to-overlay.service.d.ts +0 -20
  18. package/lib/components/modal-gallery/modal-gallery-ref.d.ts +0 -64
  19. package/lib/components/modal-gallery/modal-gallery.component.d.ts +0 -246
  20. package/lib/components/modal-gallery/modal-gallery.service.d.ts +0 -100
  21. package/lib/components/modal-gallery/modal-gallery.tokens.d.ts +0 -3
  22. package/lib/components/plain-gallery/plain-gallery.component.d.ts +0 -135
  23. package/lib/components/previews/previews.component.d.ts +0 -155
  24. package/lib/components/upper-buttons/upper-buttons-default.d.ts +0 -29
  25. package/lib/components/upper-buttons/upper-buttons.component.d.ts +0 -132
  26. package/lib/directives/a-tag-bg-image.directive.d.ts +0 -38
  27. package/lib/directives/click-outside.directive.d.ts +0 -24
  28. package/lib/directives/description.directive.d.ts +0 -33
  29. package/lib/directives/direction.directive.d.ts +0 -36
  30. package/lib/directives/directives.d.ts +0 -15
  31. package/lib/directives/fallback-image.directive.d.ts +0 -16
  32. package/lib/directives/keyboard-navigation.directive.d.ts +0 -24
  33. package/lib/directives/margin.directive.d.ts +0 -44
  34. package/lib/directives/max-size.directive.d.ts +0 -33
  35. package/lib/directives/size.directive.d.ts +0 -33
  36. package/lib/directives/swipe.directive.d.ts +0 -35
  37. package/lib/directives/wrap.directive.d.ts +0 -36
  38. package/lib/modal-gallery.module.d.ts +0 -32
  39. package/lib/model/accessibility.interface.d.ts +0 -40
  40. package/lib/model/action.enum.d.ts +0 -11
  41. package/lib/model/buttons-config.interface.d.ts +0 -57
  42. package/lib/model/carousel-config.interface.d.ts +0 -11
  43. package/lib/model/carousel-image-config.interface.d.ts +0 -8
  44. package/lib/model/carousel-preview-config.interface.d.ts +0 -22
  45. package/lib/model/current-image-config.interface.d.ts +0 -12
  46. package/lib/model/description.interface.d.ts +0 -39
  47. package/lib/model/dots-config.interface.d.ts +0 -6
  48. package/lib/model/image-internal.class.d.ts +0 -9
  49. package/lib/model/image.class.d.ts +0 -64
  50. package/lib/model/interaction-event.interface.d.ts +0 -6
  51. package/lib/model/keyboard-config.interface.d.ts +0 -8
  52. package/lib/model/keyboard.enum.d.ts +0 -13
  53. package/lib/model/lib-config.interface.d.ts +0 -39
  54. package/lib/model/loading-config.interface.d.ts +0 -19
  55. package/lib/model/max-size.interface.d.ts +0 -8
  56. package/lib/model/modal-gallery-config.interface.d.ts +0 -16
  57. package/lib/model/plain-gallery-config.interface.d.ts +0 -57
  58. package/lib/model/play-config.interface.d.ts +0 -8
  59. package/lib/model/preview-config.interface.d.ts +0 -12
  60. package/lib/model/size.interface.d.ts +0 -8
  61. package/lib/model/slide-config.interface.d.ts +0 -17
  62. package/lib/services/config.service.d.ts +0 -39
  63. package/lib/services/id-validator.service.d.ts +0 -25
  64. package/lib/utils/image.util.d.ts +0 -10
  65. package/lib/utils/user-input.util.d.ts +0 -80
  66. package/public-api.d.ts +0 -36
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ks89/angular-modal-gallery",
3
- "version": "13.0.0",
3
+ "version": "15.0.0-alpha.1",
4
4
  "description": "Image gallery for Angular",
5
5
  "license": "MIT",
6
6
  "author": "Stefano Cappa",
@@ -8,17 +8,18 @@
8
8
  "node": ">=20.0.0",
9
9
  "npm": ">=10.0.0"
10
10
  },
11
- "homepage": "https://ks89.github.io/angular-modal-gallery-2024-v13.github.io/",
11
+ "homepage": "https://ks89.github.io/angular-modal-gallery-2025-v14.github.io/",
12
12
  "dependencies": {
13
13
  "tslib": ">=2.3.0"
14
14
  },
15
15
  "peerDependencies": {
16
- "@angular/platform-browser": ">=19.0.0",
17
- "@angular/common": ">=19.0.0",
18
- "@angular/core": ">=19.0.0",
19
- "@angular/cdk": ">=19.0.0",
16
+ "@angular/platform-browser": ">=20.0.0",
17
+ "@angular/common": ">=20.0.0",
18
+ "@angular/core": ">=20.0.0",
19
+ "@angular/cdk": ">=20.0.0",
20
20
  "rxjs": ">=7.8.0"
21
21
  },
22
+ "sideEffects": false,
22
23
  "keywords": [
23
24
  "angular-modal-gallery",
24
25
  "ngx-gallery",
@@ -47,7 +48,7 @@
47
48
  ],
48
49
  "repository": {
49
50
  "type": "git",
50
- "url": "https://github.com/Ks89/angular-modal-gallery.git"
51
+ "url": "git+https://github.com/Ks89/angular-modal-gallery.git"
51
52
  },
52
53
  "bugs": {
53
54
  "url": "https://github.com/Ks89/angular-modal-gallery/issues"
@@ -62,6 +63,5 @@
62
63
  "types": "./index.d.ts",
63
64
  "default": "./fesm2022/ks89-angular-modal-gallery.mjs"
64
65
  }
65
- },
66
- "sideEffects": false
66
+ }
67
67
  }
@@ -1,5 +0,0 @@
1
- import { AccessibilityConfig } from '../model/accessibility.interface';
2
- /**
3
- * Default accessibility configuration.
4
- */
5
- export declare const KS_DEFAULT_ACCESSIBILITY_CONFIG: AccessibilityConfig;
@@ -1,50 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- /**
3
- * Provides some useful methods to add accessibility features to subclasses.
4
- * In particular, it exposes a method to handle navigation event with both Keyboard and Mouse
5
- * and another with also the direction (right or left).
6
- */
7
- export declare class AccessibleComponent {
8
- constructor();
9
- /**
10
- * Method to handle navigation events with both Keyboard and Mouse.
11
- * @param string direction of the navigation that can be either 'next' or 'prev'
12
- * @param KeyboardEvent | MouseEvent event payload
13
- * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
14
- */
15
- handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number;
16
- /**
17
- * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
18
- * @param event KeyboardEvent | MouseEvent payload
19
- * @returns number 1 for NEXT and 0 for NOTHING
20
- */
21
- handleImageEvent(event: KeyboardEvent | MouseEvent): number;
22
- /**
23
- * Private method to handle keyboard events over an image.
24
- * @param event KeyboardEvent payload
25
- * @returns number 1 for NEXT and 0 for NOTHING
26
- */
27
- private handleImageKeyboardEvent;
28
- /**
29
- * Private method to handle mouse events over an image.
30
- * @param MouseEvent event payload
31
- * @returns number 1 for NEXT and 0 for NOTHING
32
- */
33
- private handleImageMouseEvent;
34
- /**
35
- * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
36
- * @param string direction of the navigation that can be either 'next' or 'prev'
37
- * @param KeyboardEvent event payload
38
- * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
39
- */
40
- private handleKeyboardNavigationEvent;
41
- /**
42
- * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
43
- * @param string direction of the navigation that can be either 'next' or 'prev'
44
- * @param MouseEvent event payload
45
- * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING
46
- */
47
- private handleMouseNavigationEvent;
48
- static ɵfac: i0.ɵɵFactoryDeclaration<AccessibleComponent, never>;
49
- static ɵcmp: i0.ɵɵComponentDeclaration<AccessibleComponent, "ks-accessible", never, {}, {}, never, never, false, never>;
50
- }
@@ -1,195 +0,0 @@
1
- import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { DomSanitizer, SafeResourceUrl, SafeStyle } from '@angular/platform-browser';
3
- import { BreakpointObserver } from '@angular/cdk/layout';
4
- import { AccessibleComponent } from '../../accessible.component';
5
- import { AccessibilityConfig } from '../../../model/accessibility.interface';
6
- import { Image, ImageEvent } from '../../../model/image.class';
7
- import { InternalLibImage } from '../../../model/image-internal.class';
8
- import { CarouselPreviewConfig } from '../../../model/carousel-preview-config.interface';
9
- import { CarouselConfig } from '../../../model/carousel-config.interface';
10
- import { Action } from '../../../model/action.enum';
11
- import { ConfigService } from '../../../services/config.service';
12
- import * as i0 from "@angular/core";
13
- /**
14
- * Component with image previews for carousel
15
- */
16
- export declare class CarouselPreviewsComponent extends AccessibleComponent implements OnInit, OnChanges, OnDestroy {
17
- private ref;
18
- private breakpointObserver;
19
- private sanitizer;
20
- private configService;
21
- /**
22
- * Variable to change the max-width of the host component
23
- */
24
- hostMaxWidth: string;
25
- /**
26
- * Variable to set aria-label of the host component
27
- */
28
- ariaLabel: string;
29
- /**
30
- * TODO write doc
31
- */
32
- id: number;
33
- /**
34
- * Object of type `InternalLibImage` that represent the visible image.
35
- */
36
- currentImage: InternalLibImage;
37
- /**
38
- * Array of `InternalLibImage` that represent the model of this library with all images,
39
- * thumbs and so on.
40
- */
41
- images: InternalLibImage[];
42
- /**
43
- * Output to emit the clicked preview. The payload contains the `InternalLibImage` associated to the clicked preview.
44
- */
45
- clickPreview: EventEmitter<ImageEvent>;
46
- /**
47
- * Object of type `CarouselConfig` to init CarouselComponent's features.
48
- * For instance, it contains parameters to change the style, how it navigates and so on.
49
- */
50
- carouselConfig: CarouselConfig | undefined;
51
- /**
52
- * Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.
53
- * For instance, it contains a param to show/hide this component, sizes.
54
- */
55
- previewConfig: CarouselPreviewConfig | undefined;
56
- /**
57
- * Object of type `AccessibilityConfig` to init custom accessibility features.
58
- * For instance, it contains titles, alt texts, aria-labels and so on.
59
- */
60
- accessibilityConfig: AccessibilityConfig | undefined;
61
- /**
62
- * Enum of type `Action` that represents a mouse click on a button.
63
- * Declared here to be used inside the template.
64
- */
65
- clickAction: Action;
66
- /**
67
- * Enum of type `Action` that represents a keyboard action.
68
- * Declared here to be used inside the template.
69
- */
70
- keyboardAction: Action;
71
- /**
72
- * Array of `InternalLibImage` exposed to the template. This field is initialized
73
- * applying transformations, default values and so on to the input of the same type.
74
- */
75
- previews: InternalLibImage[];
76
- /**
77
- * Variable with the preview's maxHeight
78
- */
79
- previewMaxHeight: string;
80
- /**
81
- * Start index (inclusive) of the input images used to display previews.
82
- */
83
- start: number;
84
- /**
85
- * End index (non inclusive) of the input images used to display previews.
86
- */
87
- end: number;
88
- private readonly breakpointSubscription;
89
- constructor(ref: ChangeDetectorRef, breakpointObserver: BreakpointObserver, sanitizer: DomSanitizer, configService: ConfigService);
90
- /**
91
- * Method to update the height of previews, passing the desired height as input.
92
- * @param configBreakpointHeight is a number that represent the desired height to set.
93
- */
94
- private updateHeight;
95
- /**
96
- * Method ´ngOnInit´ to build `configPreview` applying a default value and also to
97
- * init the `previews` array.
98
- * This is an angular lifecycle hook, so its called automatically by Angular itself.
99
- * In particular, it's called only one time!!!
100
- */
101
- ngOnInit(): void;
102
- /**
103
- * Method to check if an image is active (i.e. a preview image).
104
- * @param InternalLibImage preview is an image to check if it's active or not
105
- * @returns boolean true if is active, false otherwise
106
- */
107
- isActive(preview: InternalLibImage): boolean;
108
- /**
109
- * Method ´ngOnChanges´ to update `previews` array.
110
- * Also, both `start` and `end` local variables will be updated accordingly.
111
- * This is an angular lifecycle hook, so its called automatically by Angular itself.
112
- * In particular, it's called when any data-bound property of a directive changes!!!
113
- */
114
- ngOnChanges(changes: SimpleChanges): void;
115
- /**
116
- * Method called by events from both keyboard and mouse on a preview.
117
- * This will trigger the `clickpreview` output with the input preview as its payload.
118
- * @param InternalLibImage preview that triggered this method
119
- * @param KeyboardEvent | MouseEvent event payload
120
- * @param Action that triggered this event (Action.NORMAL by default)
121
- */
122
- onImageEvent(preview: InternalLibImage, event: KeyboardEvent | MouseEvent, action?: Action): void;
123
- /**
124
- * Method called by events from both keyboard and mouse on a navigation arrow.
125
- * @param string direction of the navigation that can be either 'next' or 'prev'
126
- * @param KeyboardEvent | MouseEvent event payload
127
- */
128
- onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): void;
129
- /**
130
- * Method to get aria-label text for a preview image.
131
- * @param Image is the preview
132
- */
133
- getAriaLabel(preview: Image): string;
134
- /**
135
- * Method to get title text for a preview image.
136
- * @param Image is the preview
137
- */
138
- getTitle(preview: Image): string;
139
- /**
140
- * Method to get alt text for a preview image.
141
- * @param Image is the preview
142
- */
143
- getAlt(preview: Image): string;
144
- /**
145
- * Method used in the template to track ids in ngFor.
146
- * @param number index of the array
147
- * @param Image item of the array
148
- * @returns number the id of the item
149
- */
150
- trackById(index: number, item: Image): number;
151
- /**
152
- * Method used in template to sanitize an url when you need legacyIE11Mode.
153
- * In this way you can set an url as background of a div.
154
- * @param unsafeStyle is a string or a SafeResourceUrl that represents the url to sanitize.
155
- * @param unsafeStyleFallback is a string or a SafeResourceUrl that represents the fallback url to sanitize.
156
- * @returns a SafeStyle object that can be used in template without problems.
157
- */
158
- sanitizeUrlBgStyle(unsafeStyle: string | SafeResourceUrl, unsafeStyleFallback: string | SafeResourceUrl): SafeStyle;
159
- /**
160
- * Method to cleanup resources. In fact, it cleans breakpointSubscription.
161
- * This is an angular lifecycle hook that is called when this component is destroyed.
162
- */
163
- ngOnDestroy(): void;
164
- /**
165
- * Private method to init previews based on the currentImage and the full array of images.
166
- * The current image in mandatory to show always the current preview (as highlighted).
167
- * @param InternalLibImage currentImage to decide how to show previews, because I always want to see the current image as highlighted
168
- * @param InternalLibImage[] images is the array of all images.
169
- */
170
- private initPreviews;
171
- /**
172
- * Private method to init both `start` and `end` to the beginning.
173
- */
174
- private setBeginningIndexesPreviews;
175
- /**
176
- * Private method to init both `start` and `end` to the end.
177
- */
178
- private setEndIndexesPreviews;
179
- /**
180
- * Private method to update the visible previews navigating to the right (next).
181
- */
182
- private next;
183
- /**
184
- * Private method to update the visible previews navigating to the left (previous).
185
- */
186
- private previous;
187
- /**
188
- * Private method to block/permit sliding between previews.
189
- * @param number boundaryIndex is the first or the last index of `images` input array
190
- * @returns boolean if true block sliding, otherwise not
191
- */
192
- private isPreventSliding;
193
- static ɵfac: i0.ɵɵFactoryDeclaration<CarouselPreviewsComponent, never>;
194
- static ɵcmp: i0.ɵɵComponentDeclaration<CarouselPreviewsComponent, "ks-carousel-previews", never, { "id": { "alias": "id"; "required": false; }; "currentImage": { "alias": "currentImage"; "required": false; }; "images": { "alias": "images"; "required": false; }; }, { "clickPreview": "clickPreview"; }, never, never, false, never>;
195
- }
@@ -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)[];