@ks89/angular-modal-gallery 8.0.0-rc.1 → 9.0.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 (113) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/CONTRIBUTING.md +3 -3
  3. package/README.md +26 -34
  4. package/{esm2015/ks89-angular-modal-gallery.js → esm2020/ks89-angular-modal-gallery.mjs} +0 -0
  5. package/{esm2015/lib/components/accessibility-default.js → esm2020/lib/components/accessibility-default.mjs} +0 -0
  6. package/{esm2015/lib/components/accessible.component.js → esm2020/lib/components/accessible.component.mjs} +6 -6
  7. package/esm2020/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +462 -0
  8. package/esm2020/lib/components/carousel/carousel.component.mjs +747 -0
  9. package/{esm2015/lib/components/components.js → esm2020/lib/components/components.mjs} +0 -0
  10. package/esm2020/lib/components/current-image/current-image.component.mjs +616 -0
  11. package/esm2020/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +80 -0
  12. package/esm2020/lib/components/dots/dots.component.mjs +127 -0
  13. package/esm2020/lib/components/modal-gallery/modal-gallery-ref.mjs +103 -0
  14. package/esm2020/lib/components/modal-gallery/modal-gallery.component.mjs +523 -0
  15. package/esm2020/lib/components/modal-gallery/modal-gallery.service.mjs +187 -0
  16. package/esm2020/lib/components/modal-gallery/modal-gallery.tokens.mjs +26 -0
  17. package/esm2020/lib/components/plain-gallery/plain-gallery.component.mjs +249 -0
  18. package/esm2020/lib/components/previews/previews.component.mjs +332 -0
  19. package/{esm2015/lib/components/upper-buttons/upper-buttons-default.js → esm2020/lib/components/upper-buttons/upper-buttons-default.mjs} +0 -0
  20. package/esm2020/lib/components/upper-buttons/upper-buttons.component.mjs +249 -0
  21. package/{esm2015/lib/directives/a-tag-bg-image.directive.js → esm2020/lib/directives/a-tag-bg-image.directive.mjs} +3 -3
  22. package/{esm2015/lib/directives/click-outside.directive.js → esm2020/lib/directives/click-outside.directive.mjs} +3 -3
  23. package/{esm2015/lib/directives/description.directive.js → esm2020/lib/directives/description.directive.mjs} +3 -3
  24. package/{esm2015/lib/directives/direction.directive.js → esm2020/lib/directives/direction.directive.mjs} +3 -3
  25. package/{esm2015/lib/directives/directives.js → esm2020/lib/directives/directives.mjs} +0 -0
  26. package/esm2020/lib/directives/fallback-image.directive.mjs +59 -0
  27. package/{esm2015/lib/directives/keyboard-navigation.directive.js → esm2020/lib/directives/keyboard-navigation.directive.mjs} +5 -5
  28. package/{esm2015/lib/directives/margin.directive.js → esm2020/lib/directives/margin.directive.mjs} +3 -3
  29. package/{esm2015/lib/directives/max-size.directive.js → esm2020/lib/directives/max-size.directive.mjs} +3 -3
  30. package/{esm2015/lib/directives/size.directive.js → esm2020/lib/directives/size.directive.mjs} +3 -3
  31. package/{esm2015/lib/directives/wrap.directive.js → esm2020/lib/directives/wrap.directive.mjs} +6 -6
  32. package/{esm2015/lib/modal-gallery.module.js → esm2020/lib/modal-gallery.module.mjs} +10 -13
  33. package/{esm2015/lib/model/accessibility.interface.js → esm2020/lib/model/accessibility.interface.mjs} +0 -0
  34. package/{esm2015/lib/model/action.enum.js → esm2020/lib/model/action.enum.mjs} +0 -0
  35. package/esm2020/lib/model/buttons-config.interface.mjs +62 -0
  36. package/{esm2015/lib/model/carousel-config.interface.js → esm2020/lib/model/carousel-config.interface.mjs} +1 -1
  37. package/{esm2015/lib/model/carousel-image-config.interface.js → esm2020/lib/model/carousel-image-config.interface.mjs} +0 -0
  38. package/{esm2015/lib/model/carousel-preview-config.interface.js → esm2020/lib/model/carousel-preview-config.interface.mjs} +0 -0
  39. package/{esm2015/lib/model/current-image-config.interface.js → esm2020/lib/model/current-image-config.interface.mjs} +0 -0
  40. package/{esm2015/lib/model/description.interface.js → esm2020/lib/model/description.interface.mjs} +0 -0
  41. package/{esm2015/lib/model/dots-config.interface.js → esm2020/lib/model/dots-config.interface.mjs} +0 -0
  42. package/{esm2015/lib/model/image-internal.class.js → esm2020/lib/model/image-internal.class.mjs} +0 -0
  43. package/{esm2015/lib/model/image.class.js → esm2020/lib/model/image.class.mjs} +0 -0
  44. package/{esm2015/lib/model/interaction-event.interface.js → esm2020/lib/model/interaction-event.interface.mjs} +0 -0
  45. package/{esm2015/lib/model/keyboard-config.interface.js → esm2020/lib/model/keyboard-config.interface.mjs} +1 -1
  46. package/{esm2015/lib/model/keyboard-service-config.interface.js → esm2020/lib/model/keyboard-service-config.interface.mjs} +0 -0
  47. package/esm2020/lib/model/keyboard.enum.mjs +35 -0
  48. package/{esm2015/lib/model/lib-config.interface.js → esm2020/lib/model/lib-config.interface.mjs} +1 -1
  49. package/{esm2015/lib/model/loading-config.interface.js → esm2020/lib/model/loading-config.interface.mjs} +0 -0
  50. package/{esm2015/lib/model/max-size.interface.js → esm2020/lib/model/max-size.interface.mjs} +0 -0
  51. package/{esm2015/lib/model/modal-gallery-config.interface.js → esm2020/lib/model/modal-gallery-config.interface.mjs} +1 -1
  52. package/esm2020/lib/model/plain-gallery-config.interface.mjs +55 -0
  53. package/{esm2015/lib/model/play-config.interface.js → esm2020/lib/model/play-config.interface.mjs} +0 -0
  54. package/{esm2015/lib/model/preview-config.interface.js → esm2020/lib/model/preview-config.interface.mjs} +0 -0
  55. package/{esm2015/lib/model/size.interface.js → esm2020/lib/model/size.interface.mjs} +0 -0
  56. package/{esm2015/lib/model/slide-config.interface.js → esm2020/lib/model/slide-config.interface.mjs} +0 -0
  57. package/esm2020/lib/services/config.service.mjs +396 -0
  58. package/esm2020/lib/services/id-validator.service.mjs +71 -0
  59. package/{esm2015/lib/services/keyboard.service.js → esm2020/lib/services/keyboard.service.mjs} +3 -3
  60. package/{esm2015/lib/utils/image.util.js → esm2020/lib/utils/image.util.mjs} +0 -0
  61. package/esm2020/lib/utils/user-input.util.mjs +104 -0
  62. package/esm2020/public-api.mjs +42 -0
  63. package/fesm2015/ks89-angular-modal-gallery.mjs +5782 -0
  64. package/fesm2015/ks89-angular-modal-gallery.mjs.map +1 -0
  65. package/{fesm2015/ks89-angular-modal-gallery.js → fesm2020/ks89-angular-modal-gallery.mjs} +521 -544
  66. package/fesm2020/ks89-angular-modal-gallery.mjs.map +1 -0
  67. package/lib/components/accessible.component.d.ts +2 -2
  68. package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -7
  69. package/lib/components/carousel/carousel.component.d.ts +25 -67
  70. package/lib/components/current-image/current-image.component.d.ts +6 -3
  71. package/lib/components/dots/dots.component.d.ts +4 -0
  72. package/lib/components/modal-gallery/modal-gallery-ref.d.ts +35 -0
  73. package/lib/components/modal-gallery/modal-gallery.component.d.ts +53 -49
  74. package/lib/components/modal-gallery/modal-gallery.service.d.ts +57 -1
  75. package/lib/components/plain-gallery/plain-gallery.component.d.ts +16 -10
  76. package/lib/components/previews/previews.component.d.ts +6 -0
  77. package/lib/components/upper-buttons/upper-buttons.component.d.ts +5 -1
  78. package/lib/directives/fallback-image.directive.d.ts +3 -0
  79. package/lib/directives/keyboard-navigation.directive.d.ts +1 -1
  80. package/lib/directives/wrap.directive.d.ts +1 -1
  81. package/lib/model/carousel-config.interface.d.ts +0 -1
  82. package/lib/model/keyboard-config.interface.d.ts +4 -4
  83. package/lib/model/keyboard.enum.d.ts +11 -8
  84. package/lib/model/lib-config.interface.d.ts +20 -7
  85. package/lib/model/modal-gallery-config.interface.d.ts +2 -2
  86. package/lib/model/plain-gallery-config.interface.d.ts +1 -9
  87. package/lib/services/id-validator.service.d.ts +2 -1
  88. package/lib/utils/user-input.util.d.ts +35 -26
  89. package/package.json +27 -14
  90. package/public-api.d.ts +2 -2
  91. package/bundles/ks89-angular-modal-gallery.umd.js +0 -6067
  92. package/bundles/ks89-angular-modal-gallery.umd.js.map +0 -1
  93. package/esm2015/lib/components/carousel/carousel-previews/carousel-previews.component.js +0 -480
  94. package/esm2015/lib/components/carousel/carousel.component.js +0 -800
  95. package/esm2015/lib/components/current-image/current-image.component.js +0 -618
  96. package/esm2015/lib/components/current-image/loading-spinner/loading-spinner.component.js +0 -93
  97. package/esm2015/lib/components/dots/dots.component.js +0 -132
  98. package/esm2015/lib/components/modal-gallery/modal-gallery-ref.js +0 -45
  99. package/esm2015/lib/components/modal-gallery/modal-gallery.component.js +0 -558
  100. package/esm2015/lib/components/modal-gallery/modal-gallery.service.js +0 -131
  101. package/esm2015/lib/components/modal-gallery/modal-gallery.tokens.js +0 -3
  102. package/esm2015/lib/components/plain-gallery/plain-gallery.component.js +0 -253
  103. package/esm2015/lib/components/previews/previews.component.js +0 -338
  104. package/esm2015/lib/components/upper-buttons/upper-buttons.component.js +0 -266
  105. package/esm2015/lib/directives/fallback-image.directive.js +0 -56
  106. package/esm2015/lib/model/buttons-config.interface.js +0 -66
  107. package/esm2015/lib/model/keyboard.enum.js +0 -35
  108. package/esm2015/lib/model/plain-gallery-config.interface.js +0 -64
  109. package/esm2015/lib/services/config.service.js +0 -395
  110. package/esm2015/lib/services/id-validator.service.js +0 -73
  111. package/esm2015/lib/utils/user-input.util.js +0 -95
  112. package/esm2015/public-api.js +0 -46
  113. package/fesm2015/ks89-angular-modal-gallery.js.map +0 -1
@@ -15,13 +15,13 @@ export declare class AccessibleComponent {
15
15
  handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number;
16
16
  /**
17
17
  * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
18
- * @param KeyboardEvent | MouseEvent event payload
18
+ * @param event KeyboardEvent | MouseEvent payload
19
19
  * @returns number 1 for NEXT and 0 for NOTHING
20
20
  */
21
21
  handleImageEvent(event: KeyboardEvent | MouseEvent): number;
22
22
  /**
23
23
  * Private method to handle keyboard events over an image.
24
- * @param KeyboardEvent event payload
24
+ * @param event KeyboardEvent payload
25
25
  * @returns number 1 for NEXT and 0 for NOTHING
26
26
  */
27
27
  private handleImageKeyboardEvent;
@@ -156,13 +156,6 @@ export declare class CarouselPreviewsComponent extends AccessibleComponent imple
156
156
  * @returns a SafeStyle object that can be used in template without problems.
157
157
  */
158
158
  sanitizeUrlBgStyle(unsafeStyle: string | SafeResourceUrl, unsafeStyleFallback: string | SafeResourceUrl): SafeStyle;
159
- /**
160
- * Method to get the background-size value when IE11LegacyMode is enabled.
161
- * This prevent weired behaviour on IE11 when previews are really small, but original images (.png/.jgp/...) are big.
162
- * Using 'cover' it's not enough, because it's causing empty background in some cases.
163
- * After some experiments, I decided to use the double of the height and auto as width.
164
- */
165
- getIE11LegacyBgSize(): string;
166
159
  /**
167
160
  * Method to cleanup resources. In fact, it cleans breakpointSubscription.
168
161
  * This is an Angular's lifecycle hook that is called when this component is destroyed.
@@ -4,13 +4,11 @@ import { AccessibilityConfig } from '../../model/accessibility.interface';
4
4
  import { Image, ImageEvent } from '../../model/image.class';
5
5
  import { Action } from '../../model/action.enum';
6
6
  import { DotsConfig } from '../../model/dots-config.interface';
7
- import { PlayConfig } from '../../model/play-config.interface';
8
7
  import { CarouselConfig } from '../../model/carousel-config.interface';
9
8
  import { CarouselImageConfig } from '../../model/carousel-image-config.interface';
10
- import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
11
- import { CarouselPreviewConfig } from '../../model/carousel-preview-config.interface';
12
9
  import { ConfigService } from '../../services/config.service';
13
10
  import { ModalGalleryService } from '../modal-gallery/modal-gallery.service';
11
+ import { CarouselLibConfig } from '../../model/lib-config.interface';
14
12
  import * as i0 from "@angular/core";
15
13
  /**
16
14
  * Component with configurable inline/plain carousel.
@@ -21,7 +19,6 @@ export declare class CarouselComponent extends AccessibleComponent implements On
21
19
  private modalGalleryService;
22
20
  private configService;
23
21
  private ref;
24
- private sanitizer;
25
22
  /**
26
23
  * Attribute to set ariaLabel of the host component
27
24
  */
@@ -37,47 +34,17 @@ export declare class CarouselComponent extends AccessibleComponent implements On
37
34
  */
38
35
  images: Image[];
39
36
  /**
40
- * Object of type `CarouselConfig` to init CarouselComponent's features.
41
- * For instance, it contains parameters to change the style, how it navigates and so on.
42
- */
43
- carouselConfig: CarouselConfig | undefined;
44
- /**
45
- * Object of type `PlayConfig` to init CarouselComponent's features about auto-play.
46
- * For instance, it contains parameters to enable/disable autoPlay, interval and so on.
47
- */
48
- playConfig: PlayConfig | undefined;
49
- /**
50
- * Interface to configure current image in carousel.
51
- * For instance you can change the description.
52
- */
53
- carouselImageConfig: CarouselImageConfig | undefined;
54
- /**
55
- * Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.
56
- * For instance, it contains a param to show/hide previews, change sizes and so on.
57
- */
58
- previewConfig: CarouselPreviewConfig | undefined;
59
- /**
60
- * Object of type `DotsConfig` to init DotsComponent's features.
61
- * For instance, it contains a param to show/hide this component.
62
- */
63
- dotsConfig: DotsConfig | undefined;
64
- /**
65
- * boolean to enable/disable infinite sliding. Enabled by default.
66
- */
67
- infinite: boolean;
68
- /**
69
- * TODO add description
37
+ * CarouselLibConfig object to configure carousel.
70
38
  */
71
- disableSsrWorkaround: boolean;
39
+ config: CarouselLibConfig | undefined;
72
40
  /**
73
- * Object of type `AccessibilityConfig` to init custom accessibility features.
74
- * For instance, it contains titles, alt texts, aria-labels and so on.
41
+ * Output to emit an event when an image is clicked.
75
42
  */
76
- accessibilityConfig: AccessibilityConfig | undefined;
43
+ clickImage: EventEmitter<number>;
77
44
  /**
78
- * Output to emit an event when an image is changed.
45
+ * Output to emit an event when current image is changed.
79
46
  */
80
- showImage: EventEmitter<ImageEvent>;
47
+ changeImage: EventEmitter<ImageEvent>;
81
48
  /**
82
49
  * Output to emit an event when the current image is the first one.
83
50
  */
@@ -87,29 +54,28 @@ export declare class CarouselComponent extends AccessibleComponent implements On
87
54
  */
88
55
  lastImage: EventEmitter<ImageEvent>;
89
56
  /**
90
- * Object use in template
91
- */
92
- configCarousel: CarouselConfig | undefined;
93
- /**
94
- * Object use in template
57
+ * Object of type `CarouselConfig` to init CarouselComponent's features.
58
+ * For instance, it contains parameters to change the style, how it navigates and so on.
95
59
  */
96
- configPlay: PlayConfig | undefined;
60
+ carouselConfig: CarouselConfig | undefined;
97
61
  /**
98
- * Object use in template
62
+ * Object of type `DotsConfig` to init DotsComponent's features.
63
+ * For instance, it contains a param to show/hide this component.
99
64
  */
100
- configCarouselImage: CarouselImageConfig | undefined;
65
+ carouselDotsConfig: DotsConfig | undefined;
101
66
  /**
102
- * Object use in template
67
+ * Object of type `AccessibilityConfig` to init custom accessibility features.
68
+ * For instance, it contains titles, alt texts, aria-labels and so on.
103
69
  */
104
- configPreview: CarouselPreviewConfig | undefined;
70
+ accessibilityConfig: AccessibilityConfig | undefined;
105
71
  /**
106
- * Object use in template
72
+ * Object of type `CarouselImageConfig` to configure the current image of the carousel.
107
73
  */
108
- configDots: DotsConfig | undefined;
74
+ carouselImageConfig: CarouselImageConfig | undefined;
109
75
  /**
110
- * Object use in template
76
+ * Enable/disable infinite sliding.
111
77
  */
112
- configAccessibility: AccessibilityConfig;
78
+ carouselSlideInfinite: boolean | undefined;
113
79
  /**
114
80
  * Enum of type `Action` that represents a mouse click on a button.
115
81
  * Declared here to be used inside the template.
@@ -162,18 +128,10 @@ export declare class CarouselComponent extends AccessibleComponent implements On
162
128
  * Listener to navigate carousel images with keyboard (right).
163
129
  */
164
130
  onKeyDownLRight(): void;
165
- constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef, sanitizer: DomSanitizer);
166
- ngOnChanges(changes: SimpleChanges): void;
131
+ constructor(platformId: any, ngZone: NgZone, modalGalleryService: ModalGalleryService, configService: ConfigService, ref: ChangeDetectorRef);
167
132
  ngOnInit(): void;
133
+ ngOnChanges(changes: SimpleChanges): void;
168
134
  ngAfterContentInit(): void;
169
- /**
170
- * Method used in template to sanitize an url when you need legacyIE11Mode.
171
- * In this way you can set an url as background of a div.
172
- * @param unsafeStyle is a string and represents the url to sanitize.
173
- * @param unsafeStyleFallback is a string and represents the fallback url to sanitize.
174
- * @returns a SafeStyle object that can be used in template without problems.
175
- */
176
- sanitizeUrlBgStyle(unsafeStyle: string, unsafeStyleFallback: string): SafeStyle;
177
135
  /**
178
136
  * Method called when a dot is clicked and used to update the current image.
179
137
  * @param number index of the clicked dot
@@ -308,14 +266,14 @@ export declare class CarouselComponent extends AccessibleComponent implements On
308
266
  private emitBoundaryEvent;
309
267
  /**
310
268
  * Private method to check if next/prev actions should be blocked.
311
- * It checks if slideConfig.infinite === false and if the image index is equals to the input parameter.
269
+ * It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.
312
270
  * If yes, it returns true to say that sliding should be blocked, otherwise not.
313
271
  * @param number boundaryIndex that could be either the beginning index (0) or the last index
314
272
  * of images (this.images.length - 1).
315
- * @returns boolean true if slideConfig.infinite === false and the current index is
273
+ * @returns boolean true if carouselSlideInfinite === false and the current index is
316
274
  * either the first or the last one.
317
275
  */
318
276
  private isPreventSliding;
319
277
  static ɵfac: i0.ɵɵFactoryDeclaration<CarouselComponent, never>;
320
- static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": "id"; "images": "images"; "carouselConfig": "carouselConfig"; "playConfig": "playConfig"; "carouselImageConfig": "carouselImageConfig"; "previewConfig": "previewConfig"; "dotsConfig": "dotsConfig"; "infinite": "infinite"; "disableSsrWorkaround": "disableSsrWorkaround"; "accessibilityConfig": "accessibilityConfig"; }, { "showImage": "showImage"; "firstImage": "firstImage"; "lastImage": "lastImage"; }, never, ["*"]>;
278
+ static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ks-carousel", never, { "id": "id"; "images": "images"; "config": "config"; }, { "clickImage": "clickImage"; "changeImage": "changeImage"; "firstImage": "firstImage"; "lastImage": "lastImage"; }, never, ["*"]>;
321
279
  }
@@ -139,13 +139,16 @@ export declare class CurrentImageComponent extends AccessibleComponent implement
139
139
  * In particular, it's called when any data-bound property of a directive changes!!!
140
140
  */
141
141
  ngOnChanges(changes: SimpleChanges): void;
142
+ /**
143
+ * This is an Angular's lifecycle hook, so its called automatically by Angular itself.
144
+ */
142
145
  ngAfterContentInit(): void;
143
146
  /**
144
- * Method to handle keypress based on the `keyboardConfig` input. It gets the keyCode of
147
+ * Method to handle keypress based on the `keyboardConfig` input. It gets the code of
145
148
  * the key that triggered the keypress event to navigate between images or to close the modal gallery.
146
- * @param number keyCode of the key that triggered the keypress event
149
+ * @param code string of the key that triggered the keypress event
147
150
  */
148
- onKeyPress(keyCode: number): void;
151
+ onKeyPress(code: string): void;
149
152
  /**
150
153
  * Method to get the image description based on input params.
151
154
  * If you provide a full description this will be the visible description, otherwise,
@@ -11,6 +11,10 @@ import * as i0 from "@angular/core";
11
11
  */
12
12
  export declare class DotsComponent extends AccessibleComponent implements OnInit, OnChanges {
13
13
  private configService;
14
+ /**
15
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
16
+ * the service to call modal gallery.
17
+ */
14
18
  id: number | undefined;
15
19
  /**
16
20
  * Object of type `InternalLibImage` that represent the visible image.
@@ -1,6 +1,10 @@
1
1
  import { OverlayRef } from '@angular/cdk/overlay';
2
2
  import { ImageModalEvent } from '../../model/image.class';
3
3
  import { ButtonEvent } from '../../model/buttons-config.interface';
4
+ /**
5
+ * Class that represents the modal dialog instance.
6
+ * It is returned by the open method.
7
+ */
4
8
  export declare class ModalGalleryRef {
5
9
  private overlayRef;
6
10
  private close;
@@ -18,12 +22,43 @@ export declare class ModalGalleryRef {
18
22
  private buttonAfterHook;
19
23
  buttonAfterHook$: import("rxjs").Observable<ButtonEvent>;
20
24
  constructor(overlayRef: OverlayRef);
25
+ /**
26
+ * Close modal dialog, disposing the Overlay.
27
+ */
21
28
  closeModal(): void;
29
+ /**
30
+ * Method to emit close event.
31
+ * @param event ImageModalEvent event payload
32
+ */
22
33
  emitClose(event: ImageModalEvent): void;
34
+ /**
35
+ * Method to emit show event.
36
+ * @param event ImageModalEvent event payload
37
+ */
23
38
  emitShow(event: ImageModalEvent): void;
39
+ /**
40
+ * Method to emit firstImage event.
41
+ * @param event ImageModalEvent event payload
42
+ */
24
43
  emitFirstImage(event: ImageModalEvent): void;
44
+ /**
45
+ * Method to emit lastImage event.
46
+ * @param event ImageModalEvent event payload
47
+ */
25
48
  emitLastImage(event: ImageModalEvent): void;
49
+ /**
50
+ * Method to emit hasData event.
51
+ * @param event ImageModalEvent event payload
52
+ */
26
53
  emitHasData(event: ImageModalEvent): void;
54
+ /**
55
+ * Method to emit buttonBeforeHook event.
56
+ * @param event ImageModalEvent event payload
57
+ */
27
58
  emitButtonBeforeHook(event: ButtonEvent): void;
59
+ /**
60
+ * Method to emit buttonAfterHook event.
61
+ * @param event ImageModalEvent event payload
62
+ */
28
63
  emitButtonAfterHook(event: ButtonEvent): void;
29
64
  }
@@ -85,7 +85,7 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
85
85
  */
86
86
  showGallery: boolean;
87
87
  /**
88
- * TODO write doc
88
+ * Object to configure this component.
89
89
  */
90
90
  libConfig: LibConfig | undefined;
91
91
  private updateImagesSubscription;
@@ -104,141 +104,145 @@ export declare class ModalGalleryComponent implements OnInit, OnDestroy {
104
104
  ngOnInit(): void;
105
105
  /**
106
106
  * Method called by custom upper buttons.
107
- * @param event ButtonEvent payload
107
+ * @param event ButtonEvent event payload
108
108
  */
109
109
  onCustomEmit(event: ButtonEvent): void;
110
110
  /**
111
111
  * Method called by the full-screen upper button.
112
- * @param ButtonEvent event payload
112
+ * @param event ButtonEvent event payload
113
113
  */
114
114
  onFullScreen(event: ButtonEvent): void;
115
115
  /**
116
116
  * Method called by the delete upper button.
117
- * @param ButtonEvent event payload
117
+ * @param event ButtonEvent event payload
118
118
  */
119
119
  onDelete(event: ButtonEvent): void;
120
120
  /**
121
121
  * Method called by the navigate upper button.
122
- * @param ButtonEvent event payload
122
+ * @param event ButtonEvent event payload
123
123
  */
124
124
  onNavigate(event: ButtonEvent): void;
125
+ /**
126
+ * This method is defined to be spied and replaced in unit testing with a fake method call.
127
+ * It must be public to be able to use jasmine spyOn method.
128
+ * @param newHref string new url
129
+ */
130
+ updateLocationHref(newHref: string): void;
125
131
  /**
126
132
  * Method called by the download upper button.
127
- * @param ButtonEvent event payload
133
+ * @param event ButtonEvent event payload
128
134
  */
129
135
  onDownload(event: ButtonEvent): void;
130
136
  /**
131
137
  * Method called by the close upper button.
132
- * @param ButtonEvent event payload
133
- * @param Action action that triggered the close method. `Action.NORMAL` by default
138
+ * @param event ButtonEvent event payload
139
+ * @param action Action that triggered the close method. `Action.NORMAL` by default
134
140
  */
135
141
  onCloseGalleryButton(event: ButtonEvent, action?: Action): void;
142
+ /**
143
+ * Method called by CurrentImageComponent and triggered via KeyboardService.
144
+ * @param event ImageModalEvent event payload
145
+ * @param action Action that triggered the close method. `Action.NORMAL` by default
146
+ */
136
147
  onCloseGallery(event: ImageModalEvent, action?: Action): void;
137
148
  /**
138
149
  * Method to close the modal gallery specifying the action.
139
150
  * It also reset the `keyboardService` to prevent multiple listeners.
140
- * @param Action action type. `Action.NORMAL` by default
141
- * @param boolean isCalledByService is true if called by gallery.service, otherwise false
142
- */
143
- closeGallery(action?: Action, clickOutside?: boolean, isCalledByService?: boolean): void;
144
- /**
145
- * Method to show the modal gallery displaying the image with
146
- * the index specified as input parameter.
147
- * It will also register a new `keyboardService` to catch keyboard's events to download the current
148
- * image with keyboard's shortcuts. This service, will be removed either when modal gallery component
149
- * will be destroyed or when the gallery is closed invoking the `closeGallery` method.
150
- * @param number index of the image to show
151
+ * @param action Action action type. `Action.NORMAL` by default
152
+ * @param clickOutside boolean that is true if called clicking on the modal background. False by default.
151
153
  */
152
- showModalGallery(): void;
154
+ closeGallery(action?: Action, clickOutside?: boolean): void;
153
155
  /**
154
156
  * Method called when the image changes and used to update the `currentImage` object.
155
- * @param ImageModalEvent event payload
157
+ * @param event ImageModalEvent event payload
156
158
  */
157
159
  onChangeCurrentImage(event: ImageModalEvent): void;
158
160
  /**
159
161
  * Method called when you click 'outside' (i.e. on the semi-transparent background)
160
162
  * to close the modal gallery if `enableCloseOutside` is true.
161
- * @param boolean event payload. True to close the modal gallery, false otherwise
163
+ * @param event boolean that is true to close the modal gallery, false otherwise
162
164
  */
163
165
  onClickOutside(event: boolean): void;
164
166
  /**
165
167
  * Method called when an image is loaded and the loading spinner has gone.
166
168
  * It sets the previouslyLoaded flag inside the Image to hide loading spinner when displayed again.
167
- * @param ImageLoadEvent event payload
169
+ * @param event ImageLoadEvent event payload
168
170
  */
169
171
  onImageLoad(event: ImageLoadEvent): void;
170
172
  /**
171
173
  * Method called when a dot is clicked and used to update the current image.
172
- * @param number index of the clicked dot
174
+ * @param index number index of the clicked dot
173
175
  */
174
176
  onClickDot(index: number): void;
175
177
  /**
176
178
  * Method called when an image preview is clicked and used to update the current image.
177
- * @param Image preview image
179
+ * @param event ImageModalEvent preview image
178
180
  */
179
181
  onClickPreview(event: ImageModalEvent): void;
180
- /**
181
- * Method to download the current image, only if `downloadable` is true.
182
- * It contains also a logic to enable downloading features also for IE11.
183
- */
184
- downloadImage(): void;
185
182
  /**
186
183
  * Method to cleanup resources. In fact, this will reset keyboard's service.
187
184
  * This is an Angular's lifecycle hook that is called when this component is destroyed.
188
185
  */
189
186
  ngOnDestroy(): void;
187
+ /**
188
+ * Method to show the modal gallery displaying the currentImage.
189
+ * It will also register a new `keyboardService` to catch keyboard's events to download the current
190
+ * image with keyboard's shortcuts. This service, will be removed either when modal gallery component
191
+ * will be destroyed or when the gallery is closed invoking the `closeGallery` method.
192
+ * @private
193
+ */
194
+ private registerKeyboardService;
195
+ /**
196
+ * Method to download the current image, only if `downloadable` is true.
197
+ * @private
198
+ */
199
+ private downloadImage;
190
200
  /**
191
201
  * Method to convert a base64 to a Blob
192
202
  * @param base64Data string with base64 data
193
203
  * @param contentType string with the MIME type
204
+ * @return Blob converted from the input base64Data
205
+ * @private
194
206
  */
195
207
  private base64toBlob;
196
208
  /**
197
- * Private method to download the current image for all browsers except for IE11.
209
+ * Private method to download the current image for all browsers.
210
+ * @private
198
211
  */
199
212
  private downloadImageAllBrowsers;
200
- /**
201
- * Private method to download the current image only for IE11 using
202
- * custom javascript's methods available only on IE.
203
- */
204
- private downloadImageOnlyIEorEdge;
205
213
  /**
206
214
  * Private method to get the `ButtonEvent` to emit, merging the input `ButtonEvent`
207
215
  * with the current image.
208
- * @param ButtonEvent event payload to return
216
+ * @param event ButtonEvent event payload to return
209
217
  * @returns ButtonEvent event payload with the current image included
218
+ * @private
210
219
  */
211
220
  private getButtonEventToEmit;
212
221
  /**
213
222
  * Private method to get the file name from an input path.
214
223
  * This is used either to get the image's name from its path or from the Image itself,
215
224
  * if specified as 'downloadFileName' by the user.
216
- * @param Image image to extract its file name
225
+ * @param image Image image to extract its file name
217
226
  * @param isBase64 boolean to set if the image is a base64 file or not. False by default.
218
227
  * @param base64Extension string to force the extension of the base64 image. Empty string by default.
219
228
  * @returns string string file name of the input image.
229
+ * @private
220
230
  */
221
231
  private getFileName;
222
232
  /**
223
233
  * Private method to initialize `images` as array of `Image`s.
224
- * Also, it will emit ImageowmodaModalEvent to say that images are loaded.
234
+ * Also, it will emit ImageModalEvent to say that images are loaded.
235
+ * @private
225
236
  */
226
237
  private initImages;
227
238
  /**
228
239
  * Private method to emit events when either the last or the first image are visible.
229
- * @param action Enum of type Action that represents the source of the event that changed the
240
+ * @param action Action Enum of type Action that represents the source of the event that changed the
230
241
  * current image to the first one or the last one.
231
- * @param indexToCheck is the index number of the image (the first or the last one).
242
+ * @param indexToCheck number is the index number of the image (the first or the last one).
243
+ * @private
232
244
  */
233
245
  private emitBoundaryEvent;
234
- /**
235
- * Private method to check if this library is running on
236
- * Microsoft browsers or not (i.e. it detects both IE11 and Edge)
237
- * supporting also Server-Side Rendering.
238
- * Inspired by https://msdn.microsoft.com/it-it/library/hh779016(v=vs.85).aspx
239
- * @returns any the result
240
- */
241
- private isIEorEdge;
242
246
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalGalleryComponent, never>;
243
247
  static ɵcmp: i0.ɵɵComponentDeclaration<ModalGalleryComponent, "ks-modal-gallery", never, {}, {}, never, never>;
244
248
  }
@@ -14,19 +14,75 @@ export declare class ModalGalleryService {
14
14
  updateImages$: import("rxjs").Observable<Image[]>;
15
15
  private dialogRef;
16
16
  constructor(injector: Injector, overlay: Overlay, configService: ConfigService);
17
+ /**
18
+ * Method to open modal gallery passing the configuration
19
+ * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object
20
+ * @return ModalGalleryRef | undefined is the object used to listen for events.
21
+ */
17
22
  open(config: ModalGalleryConfig): ModalGalleryRef | undefined;
23
+ /**
24
+ * Method to close a modal gallery previously opened.
25
+ * @param id Unique identifier of the modal gallery
26
+ * @param clickOutside boolean is true if closed clicking on the modal backdrop, false otherwise.
27
+ */
18
28
  close(id: number, clickOutside: boolean): void;
29
+ /**
30
+ * Method to update images array.
31
+ * @param images Image[] updated array of images
32
+ */
19
33
  updateModalImages(images: Image[]): void;
34
+ /**
35
+ * Method to emit close event.
36
+ * @param event ImageModalEvent is the event payload
37
+ */
20
38
  emitClose(event: ImageModalEvent): void;
39
+ /**
40
+ * Method to emit show event.
41
+ * @param event ImageModalEvent is the event payload
42
+ */
21
43
  emitShow(event: ImageModalEvent): void;
44
+ /**
45
+ * Method to emit firstImage event.
46
+ * @param event ImageModalEvent is the event payload
47
+ */
22
48
  emitFirstImage(event: ImageModalEvent): void;
49
+ /**
50
+ * Method to emit lastImage event.
51
+ * @param event ImageModalEvent is the event payload
52
+ */
23
53
  emitLastImage(event: ImageModalEvent): void;
54
+ /**
55
+ * Method to emit hasData event.
56
+ * @param event ImageModalEvent is the event payload
57
+ */
24
58
  emitHasData(event: ImageModalEvent): void;
59
+ /**
60
+ * Method to emit buttonBeforeHook event.
61
+ * @param event ButtonEvent is the event payload
62
+ */
25
63
  emitButtonBeforeHook(event: ButtonEvent): void;
64
+ /**
65
+ * Method to emit buttonAfterHook event.
66
+ * @param event ButtonEvent is the event payload
67
+ */
26
68
  emitButtonAfterHook(event: ButtonEvent): void;
69
+ /**
70
+ * Private method to create an Overlay using Angular CDK APIs
71
+ * @private
72
+ */
27
73
  private createOverlay;
74
+ /**
75
+ * Private method to attach ModalGalleryComponent to the overlay.
76
+ * @param overlayRef OverlayRef is the Overlay object created using Angular CDK APIs
77
+ * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object
78
+ * @param dialogRef ModalGalleryRef is the object to control the dialog instance
79
+ * @private
80
+ */
28
81
  private attachDialogContainer;
29
- private createInjector;
82
+ /**
83
+ * Private method to create an OverlayConfig instance
84
+ * @private
85
+ */
30
86
  private getOverlayConfig;
31
87
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalGalleryService, never>;
32
88
  static ɵprov: i0.ɵɵInjectableDeclaration<ModalGalleryService>;
@@ -5,7 +5,7 @@ import { Size } from '../../model/size.interface';
5
5
  import { PlainGalleryConfig } from '../../model/plain-gallery-config.interface';
6
6
  import { ConfigService } from '../../services/config.service';
7
7
  import { AccessibleComponent } from '../accessible.component';
8
- import { LibConfig } from '../../model/lib-config.interface';
8
+ import { PlainLibConfig } from '../../model/lib-config.interface';
9
9
  import * as i0 from "@angular/core";
10
10
  /**
11
11
  * Component with the gallery of thumbs.
@@ -16,23 +16,23 @@ import * as i0 from "@angular/core";
16
16
  */
17
17
  export declare class PlainGalleryComponent extends AccessibleComponent implements OnInit, OnChanges {
18
18
  private configService;
19
+ /**
20
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
21
+ * the service to call modal gallery.
22
+ */
19
23
  id: number | undefined;
20
24
  /**
21
25
  * Array of `Image` that represent the model of this library with all images, thumbs and so on.
22
26
  */
23
27
  images: Image[];
24
28
  /**
25
- * Boolean to show/hide plain gallery. If true the plain gallery will be visible, false otherwise.
26
- */
27
- showGallery: boolean | undefined;
28
- /**
29
- * Array of `Image` that represent the model of this library with all images, thumbs and so on.
29
+ * PlainLibConfig object to configure plain-gallery.
30
30
  */
31
- config: LibConfig | undefined;
31
+ config: PlainLibConfig | undefined;
32
32
  /**
33
- * Output to emit an event when an image is changed.
33
+ * Output to emit an event when an image is clicked.
34
34
  */
35
- showImage: EventEmitter<number>;
35
+ clickImage: EventEmitter<number>;
36
36
  /**
37
37
  * Object of type `PlainGalleryConfig` to configure the plain gallery.
38
38
  */
@@ -92,6 +92,12 @@ export declare class PlainGalleryComponent extends AccessibleComponent implement
92
92
  * @param Image img is the Image to show
93
93
  */
94
94
  showModalGalleryByImage(img: Image): void;
95
+ /**
96
+ * Method called when you navigate between images.
97
+ * This will emit the show event with the image as payload.
98
+ * @param KeyboardEvent event that triggered the navigation
99
+ * @param Image img is the Image to show
100
+ */
95
101
  onNavigationEvent(event: KeyboardEvent, img: Image): void;
96
102
  /**
97
103
  * Method to get `alt attribute`.
@@ -125,5 +131,5 @@ export declare class PlainGalleryComponent extends AccessibleComponent implement
125
131
  */
126
132
  private initImageGrid;
127
133
  static ɵfac: i0.ɵɵFactoryDeclaration<PlainGalleryComponent, never>;
128
- static ɵcmp: i0.ɵɵComponentDeclaration<PlainGalleryComponent, "ks-plain-gallery", never, { "id": "id"; "images": "images"; "showGallery": "showGallery"; "config": "config"; }, { "showImage": "showImage"; }, never, never>;
134
+ static ɵcmp: i0.ɵɵComponentDeclaration<PlainGalleryComponent, "ks-plain-gallery", never, { "id": "id"; "images": "images"; "config": "config"; }, { "clickImage": "clickImage"; }, never, never>;
129
135
  }
@@ -14,6 +14,10 @@ import * as i0 from "@angular/core";
14
14
  */
15
15
  export declare class PreviewsComponent extends AccessibleComponent implements OnInit, OnChanges {
16
16
  private configService;
17
+ /**
18
+ * Unique id (>=0) of the current instance of this library. This is required when you are using
19
+ * the service to call modal gallery.
20
+ */
17
21
  id: number | undefined;
18
22
  /**
19
23
  * Object of type `InternalLibImage` that represent the visible image.
@@ -92,6 +96,7 @@ export declare class PreviewsComponent extends AccessibleComponent implements On
92
96
  * This will trigger the `clickpreview` output with the input preview as its payload.
93
97
  * @param InternalLibImage preview that triggered this method
94
98
  * @param KeyboardEvent | MouseEvent event payload
99
+ * @param Action action that triggered the source event or `Action.NORMAL` if not specified
95
100
  */
96
101
  onImageEvent(preview: InternalLibImage, event: KeyboardEvent | MouseEvent, action?: Action): void;
97
102
  /**
@@ -99,6 +104,7 @@ export declare class PreviewsComponent extends AccessibleComponent implements On
99
104
  * It also emits an event to specify which arrow.
100
105
  * @param string direction of the navigation that can be either 'next' or 'prev'
101
106
  * @param KeyboardEvent | MouseEvent event payload
107
+ * @param Action action that triggered the source event or `Action.NORMAL` if not specified
102
108
  */
103
109
  onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action?: Action): void;
104
110
  /**