nextalys-carousel 0.0.53 → 0.0.56

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.
@@ -1,11 +1,11 @@
1
- import { __awaiter } from 'tslib';
2
- import { Component, ViewEncapsulation, Inject, EventEmitter, NgZone, PLATFORM_ID, Optional, ViewChild, Input, Output, NgModule } from '@angular/core';
1
+ import { Component, ViewEncapsulation, Inject, Directive, EventEmitter, NgZone, PLATFORM_ID, Optional, ContentChildren, TemplateRef, ViewChild, Input, Output, NgModule } from '@angular/core';
3
2
  import { MAT_DIALOG_DATA, MatDialogRef, MatDialog, MatDialogModule } from '@angular/material/dialog';
4
3
  import { isPlatformBrowser, CommonModule } from '@angular/common';
5
4
  import { EventsCollector } from 'nextalys-js-helpers/dist/events';
5
+ import SwiperCore, { Navigation, Pagination, Autoplay, Lazy, Thumbs } from 'swiper';
6
+ import { SwiperModule } from 'swiper/angular';
6
7
  import { MatButtonModule } from '@angular/material/button';
7
8
  import { MatIconModule } from '@angular/material/icon';
8
- import { ObserversModule } from '@angular/cdk/observers';
9
9
 
10
10
  class NxsCarouselModuleConfig {
11
11
  constructor() {
@@ -44,16 +44,26 @@ NxsCarouselDialogComponent.ctorParameters = () => [
44
44
  { type: MatDialogRef }
45
45
  ];
46
46
 
47
+ class NxsSwiperTemplateDirective {
48
+ }
49
+ NxsSwiperTemplateDirective.decorators = [
50
+ { type: Directive, args: [{
51
+ selector: '[nxsSwiperTemplate]',
52
+ },] }
53
+ ];
54
+
55
+ // install Swiper modules
56
+ SwiperCore.use([Navigation, Pagination, Autoplay, Lazy, Thumbs]);
47
57
  class NxsCarouselComponent {
48
58
  constructor(matDialog, zone, platformId, config) {
49
59
  this.matDialog = matDialog;
50
60
  this.zone = zone;
51
61
  this.platformId = platformId;
52
62
  this.config = config;
53
- this.mutationObserver = null;
54
- this.recreateSliderSubscribed = false;
63
+ this.lazy = true;
55
64
  this.eventsCollector = new EventsCollector();
56
- this.options = {};
65
+ this.options = null;
66
+ this.thumbnailsOptions = null;
57
67
  this.hasHtmlContent = false;
58
68
  this.slidesCount = 0;
59
69
  this.slideChange = new EventEmitter();
@@ -68,121 +78,27 @@ class NxsCarouselComponent {
68
78
  }
69
79
  set setOptions(val) {
70
80
  this.options = this.setDefaultOptions(val, false);
71
- }
72
- set setImages(val) {
73
- this.images = val;
74
- this.initSlides();
75
- this.createSlider(true);
81
+ this.setThumbnailsOptions();
76
82
  }
77
83
  log(...args) {
78
84
  if (!this.config.debug)
79
85
  return;
80
86
  console.log('[NxsCarousel]', ...args);
81
87
  }
82
- onContentChange(changes) {
83
- // console.log("Log: NxsCarouselComponent -> onContentChange -> changes", changes);
84
- // changes.forEach(change => console.log(change.target));
85
- }
86
- initSlides() {
87
- if (!this.isBrowser) {
88
- this.log('prevent initSlides on platform server');
89
- return;
90
- }
91
- if (!this.nxsSlidesWrapper) {
92
- this.log('can not initSlides : nxsSlidesWrapper is not defined !');
93
- return;
94
- }
95
- this.log('initSlides begins');
96
- this.zone.runOutsideAngular(() => {
97
- if (!this.hasHtmlContent && this.images) {
98
- this.nxsSlidesWrapper.nativeElement.innerHTML = '';
99
- for (const cImage of this.images) {
100
- const div = document.createElement('div');
101
- div.className = 'swiper-slide';
102
- div.style.backgroundImage = 'url(' + cImage.src + ')';
103
- if (this.options.nxsCarouselImageBackgroundSize)
104
- div.style.backgroundSize = this.options.nxsCarouselImageBackgroundSize;
105
- this.nxsSlidesWrapper.nativeElement.appendChild(div);
106
- }
107
- this.slidesCount = this.images.length;
108
- if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
109
- this.nxsThumbnailsSlidesWrapper.nativeElement.innerHTML = '';
110
- for (const cImage of this.images) {
111
- const div = document.createElement('div');
112
- div.className = 'swiper-slide';
113
- div.style.backgroundImage = 'url(' + cImage.src + ')';
114
- this.nxsThumbnailsSlidesWrapper.nativeElement.appendChild(div);
115
- }
116
- }
117
- this.log('initSlides - images are defined - slides count => ', this.slidesCount);
118
- }
119
- else if (this.hasHtmlContent) {
120
- this.log('initSlides - html content - slides length => ', this.nxsSlidesWrapper.nativeElement.children.length);
121
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
122
- for (let i = 0; i < this.nxsSlidesWrapper.nativeElement.children.length; i++) {
123
- const child = this.nxsSlidesWrapper.nativeElement.children[i];
124
- if (!child.className)
125
- child.className = 'swiper-slide';
126
- else if (child.className.indexOf('swiper-slide') === -1) {
127
- child.className += ' swiper-slide';
128
- }
129
- }
130
- this.slidesCount = this.nxsSlidesWrapper.nativeElement.children.length;
131
- this.log('initSlides - html content - slides count => ', this.slidesCount);
132
- }
133
- });
134
- }
135
88
  destroy() {
136
- var _a, _b, _c;
89
+ var _a;
137
90
  if (!this.isBrowser) {
138
91
  return;
139
92
  }
140
93
  (_a = this.eventsCollector) === null || _a === void 0 ? void 0 : _a.unsubscribeAll();
141
- (_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
142
- (_c = this.sliderInstance) === null || _c === void 0 ? void 0 : _c.destroy();
143
94
  }
144
95
  ngOnDestroy() {
145
96
  this.destroy();
146
97
  }
147
- subscribeToSlideChanged() {
148
- if (!this.hasHtmlContent) {
149
- this.log('subscribeToSlideChanged cannot be subscribed : has no html content');
150
- return;
151
- }
152
- if (!this.nxsSlidesWrapper || !this.nxsSlidesWrapper.nativeElement) {
153
- this.log('subscribeToSlideChanged error : nxsSlidesWrapper is not defined');
154
- return;
155
- }
156
- if (typeof MutationObserver === 'undefined') {
157
- this.log('cannot use mutation observer');
158
- return;
159
- }
160
- if (this.mutationObserver)
161
- this.mutationObserver.disconnect();
162
- this.log('subscribe to mutation observer');
163
- this.mutationObserver = new MutationObserver((mutationsList) => {
164
- // console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> mutationsList", mutationsList);
165
- // console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> MutationObserver");
166
- this.log('mutation observer - html content has changed');
167
- if (mutationsList.length === 0)
168
- return;
169
- let mustUpdate = false;
170
- for (const mutation of mutationsList) {
171
- if (mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0) {
172
- mustUpdate = true;
173
- break;
174
- }
175
- }
176
- if (mustUpdate) {
177
- this.initSlides();
178
- this.createSlider(true);
179
- }
180
- });
181
- this.mutationObserver.observe(this.nxsSlidesWrapper.nativeElement, { childList: true, attributes: false, });
182
- }
183
98
  ngAfterViewInit() {
184
- this.initSlides();
185
- this.createSlider(true);
99
+ // console.log('thi.contents', this.contents);
100
+ // this.initSlides();
101
+ // this.createSlider(true);
186
102
  }
187
103
  getMainSliderHeight() {
188
104
  if (!this.options)
@@ -200,10 +116,18 @@ class NxsCarouselComponent {
200
116
  setDefaultOptions(options, forDialog) {
201
117
  var _a;
202
118
  if (!options && forDialog) {
203
- options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true };
119
+ options = {
120
+ nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true,
121
+ lazy: true,
122
+ };
123
+ }
124
+ else if (!options) {
125
+ options = {
126
+ nxsShowNavigationBullets: true, loop: true,
127
+ nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {},
128
+ lazy: true,
129
+ };
204
130
  }
205
- else if (!options)
206
- options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {} };
207
131
  if (options.nxsCarouselDialogOptions) {
208
132
  if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')
209
133
  options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };
@@ -239,8 +163,37 @@ class NxsCarouselComponent {
239
163
  options.nxsfullscreenOnClick = false;
240
164
  if (options.nxsThumbnails.onMainSlider)
241
165
  options.nxsShowNavigationBullets = false;
166
+ if (typeof options.lazy === 'undefined')
167
+ options.lazy = true;
168
+ if (typeof options.navigation === 'undefined')
169
+ options.navigation = true;
170
+ if (typeof options.pagination === 'undefined')
171
+ options.pagination = { clickable: true };
172
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 272 ~ NxsCarouselComponent ~ setDefaultOptions ~ options", options);
242
173
  return options;
243
174
  }
175
+ setThumbnailsOptions() {
176
+ var _a, _b;
177
+ if (!!((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.nxsThumbnails) === null || _b === void 0 ? void 0 : _b.show)) {
178
+ this.thumbnailsOptions = {
179
+ slidesPerView: this.options.nxsThumbnails.perView,
180
+ loop: false,
181
+ freeMode: true,
182
+ // watchSlidesVisibility: true,
183
+ watchSlidesProgress: true,
184
+ breakpoints: this.options.nxsThumbnails.breakpoints,
185
+ // spaceBetween: 10,
186
+ };
187
+ if (this.lazy) {
188
+ // Disable preloading of all images
189
+ this.thumbnailsOptions.preloadImages = false;
190
+ // Enable lazy loading
191
+ this.thumbnailsOptions.lazy = true;
192
+ }
193
+ // this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
194
+ // this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
195
+ }
196
+ }
244
197
  showFullScreenCarousel(images, wrapperClass) {
245
198
  this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);
246
199
  const data = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };
@@ -252,97 +205,72 @@ class NxsCarouselComponent {
252
205
  disableClose: !this.options.nxsCarouselDialogExitable,
253
206
  });
254
207
  }
255
- createSlider(forceRecreate) {
256
- if (!this.isBrowser) {
257
- this.log('prevent createSlider : platform is server');
258
- return;
259
- }
260
- if (!this.nxsSliderContainer) {
261
- this.log('can not createSlider : nxsSliderContainer is not defined !');
262
- return;
263
- }
264
- this.log('createSlider', this.nxsSliderContainer.nativeElement);
265
- if (this.slidesCount === 0) {
266
- this.log('can not createSlider : slidesCount === 0');
267
- this.subscribeToSlideChanged();
268
- return;
269
- }
270
- if (this.sliderInstance && !forceRecreate) {
271
- this.log('can re create slider => slider is already created.');
272
- return;
273
- }
274
- this.zone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
275
- this.destroy();
276
- this.options.pagination = {
277
- el: '.nxs-carousel-pagination',
278
- clickable: true,
279
- type: 'bullets',
280
- };
281
- this.options.navigation = {
282
- nextEl: '.nxs-carousel-button-next',
283
- prevEl: '.nxs-carousel-button-prev',
284
- };
285
- if (!this.swiperLibrary)
286
- this.swiperLibrary = yield import('swiper');
287
- const Swiper = this.swiperLibrary.default;
288
- if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
289
- const thumbnailsOptions = {
290
- slidesPerView: this.options.nxsThumbnails.perView,
291
- loop: false,
292
- freeMode: true,
293
- watchSlidesVisibility: true,
294
- watchSlidesProgress: true,
295
- breakpoints: this.options.nxsThumbnails.breakpoints,
296
- // spaceBetween: 10,
297
- };
298
- this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
299
- this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
300
- }
301
- this.sliderInstance = new Swiper(this.nxsSliderContainer.nativeElement, this.options);
302
- this.log('sliderInstance has been created', this.sliderInstance);
303
- this.sliderInstance.on('slideChange', () => {
304
- this.zone.run(() => {
305
- this.currentSlide = this.sliderInstance.realIndex;
306
- this.log("slideChange", this.currentSlide);
307
- this.slideChange.next(this.currentSlide);
308
- });
309
- });
310
- this.sliderInstance.on('click', (evt) => {
311
- const target = evt.target;
312
- if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
313
- return;
314
- this.zone.run(() => {
315
- this.slideClick.next(evt);
316
- if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
317
- this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
318
- }
319
- });
320
- });
321
- this.subscribeToSlideChanged();
322
- }));
323
- }
324
208
  goToSlide(index, speed) {
325
- if (!this.sliderInstance)
326
- return;
327
- this.sliderInstance.slideTo(index, speed);
209
+ var _a;
210
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideTo(index, speed);
328
211
  }
329
212
  next() {
330
- if (!this.sliderInstance)
331
- return;
332
- this.sliderInstance.slideNext();
213
+ var _a;
214
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideNext();
333
215
  }
334
216
  previous() {
335
- if (!this.sliderInstance)
336
- return;
337
- this.sliderInstance.slidePrev();
217
+ var _a;
218
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slidePrev();
219
+ }
220
+ onSwiperThumbnails(instance) {
221
+ var _a, _b;
222
+ if ((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.nxsThumbnails) === null || _b === void 0 ? void 0 : _b.show)
223
+ this.thumbnailsSwiperInstance = instance;
224
+ else
225
+ this.thumbnailsSwiperInstance = null;
226
+ // if (this.options?.nxsThumbnails?.show) {
227
+ // const optionsClone = MainHelpers.cloneObject(this.options);
228
+ // optionsClone.thumbs = { swiper: this.thumbnailsSwiperInstance };
229
+ // // this.options = optionsClone;
230
+ // // this.options = { ...this.options, thumbs: { swiper: this.thumbnailsSwiperInstance } };
231
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 416 ~ NxsCarouselComponent ~ onSwiperThumbnails ~ this.options ", this.options);
232
+ // this.options.thumbs = { swiper: this.thumbnailsSwiperInstance };
233
+ // }
234
+ }
235
+ onSwiper(instance) {
236
+ this.log('swiper ready - instance', instance);
237
+ this.swiperInstance = instance;
238
+ this.swiperInstance.on('click', (swiperInstance, evt) => {
239
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 392 ~ NxsCarouselComponent ~ this.swiperInstance.on ~ evt", evt);
240
+ const target = evt.target;
241
+ if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
242
+ return;
243
+ this.runInZone(() => {
244
+ this.slideClick.next(evt);
245
+ if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
246
+ this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
247
+ }
248
+ });
249
+ });
250
+ }
251
+ runInZone(callback, ...args) {
252
+ if (!this.zone) {
253
+ callback(args);
254
+ }
255
+ return this.zone.run(() => callback(args));
256
+ }
257
+ onSlideChange(instances) {
258
+ // this.swiperInstance = instance;
259
+ // this.log('slide change - instance', instance);
260
+ this.runInZone(() => {
261
+ var _a;
262
+ this.currentSlide = ((_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.realIndex) || 0;
263
+ this.log('slide change - currentSlide', this.currentSlide);
264
+ this.slideChange.next(this.currentSlide);
265
+ });
338
266
  }
339
267
  }
340
268
  NxsCarouselComponent.decorators = [
341
269
  { type: Component, args: [{
342
270
  selector: 'nxs-carousel',
343
- template: "<div #nxsSliderContainer\n \u00A0[ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <div class=\"swiper-wrapper\" #nxsSlidesWrapper>\n <ng-content>\n\n </ng-content>\n </div>\n <!-- (cdkObserveContent)=\"onContentChange($event)\" -->\n <!-- If we need pagination -->\n <div class=\"swiper-pagination nxs-carousel-pagination\"\n [style.display]=\"slidesCount>0 && options && options.nxsShowNavigationBullets ? '':'none'\"></div>\n\n <!-- If we need navigation buttons -->\n <ng-container *ngIf=\"options.nxsShowNavigationArrows\">\n <div class=\"nxs-carousel-button-prev swiper-button-prev\"></div>\n <div class=\"nxs-carousel-button-next swiper-button-next\"></div>\n </ng-container>\n\n <ng-container *ngIf=\"images && options.nxsShowImagesCount\">\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{images.length}}\n </div>\n </ng-container>\n\n</div>\n\n<div #nxsThumbnailsSliderContainer\n [style.display]=\"(images && !!options.nxsThumbnails && options.nxsThumbnails.show) ?'':'none'\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <div class=\"swiper-wrapper\" #nxsThumbnailsSlidesWrapper>\n\n </div>\n\n</div>",
271
+ template: "<div *ngIf=\"options\"\n [ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <swiper [config]=\"options\" (swiper)=\"onSwiper($event)\" (slideChange)=\"onSlideChange($event)\"\n [thumbs]=\"{ swiper: thumbnailsSwiperInstance }\">\n <ng-container *ngIf=\"hasHtmlContent\">\n <ng-template *ngFor=\"let slide of contents\" swiperSlide>\n <ng-template [ngTemplateOutlet]=\"slide\" [ngTemplateOutletContext]=\"{\n $implicit: slide\n }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!hasHtmlContent && images?.length\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img class=\"nxs-image-slide swiper-lazy\" [attr.data-src]=\"slideImage.src\" />\n <div class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </ng-container>\n </swiper>\n <ng-container *ngIf=\"images && options.nxsShowImagesCount\">\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{images.length}}\n </div>\n </ng-container>\n</div>\n\n<div *ngIf=\"thumbnailsOptions && images?.length\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <swiper [config]=\"thumbnailsOptions\" (swiper)=\"onSwiperThumbnails($event)\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img class=\"nxs-image-slide swiper-lazy\" [attr.data-src]=\"slideImage.src\" />\n <div class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </swiper>\n</div>",
344
272
  encapsulation: ViewEncapsulation.None,
345
- styles: ["nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color:#fff;--swiper-theme-color:#fff}nxs-carousel .swiper-container{width:100%;display:block;position:relative;height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:100%;min-height:50px;background-size:cover;background-position:50%;background-repeat:no-repeat}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid #add8e6}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}"]
273
+ styles: ["nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color:#fff;--swiper-pagination-color:#fff;--swiper-theme-color:#fff}nxs-carousel .swiper-container{width:100%;height:100%;display:block;position:relative}nxs-carousel .swiper-container swiper{height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:100%;min-height:50px;background-size:cover;background-position:50%;background-repeat:no-repeat}nxs-carousel .swiper-container .nxs-image-slide{height:100%;-o-object-fit:cover;object-fit:cover;width:100%;-o-object-position:center;object-position:center}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid #add8e6}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}"]
346
274
  },] }
347
275
  ];
348
276
  NxsCarouselComponent.ctorParameters = () => [
@@ -352,12 +280,11 @@ NxsCarouselComponent.ctorParameters = () => [
352
280
  { type: NxsCarouselModuleConfig, decorators: [{ type: Optional }] }
353
281
  ];
354
282
  NxsCarouselComponent.propDecorators = {
355
- nxsSliderContainer: [{ type: ViewChild, args: ['nxsSliderContainer', { static: true },] }],
356
- nxsSlidesWrapper: [{ type: ViewChild, args: ['nxsSlidesWrapper', { static: true },] }],
357
- nxsThumbnailsSliderContainer: [{ type: ViewChild, args: ['nxsThumbnailsSliderContainer', { static: true },] }],
358
- nxsThumbnailsSlidesWrapper: [{ type: ViewChild, args: ['nxsThumbnailsSlidesWrapper', { static: true },] }],
283
+ contents: [{ type: ContentChildren, args: [NxsSwiperTemplateDirective, { read: TemplateRef },] }],
284
+ swiperComponent: [{ type: ViewChild, args: ['swiper', { static: false },] }],
285
+ lazy: [{ type: Input }],
286
+ images: [{ type: Input }],
359
287
  setOptions: [{ type: Input, args: ['options',] }],
360
- setImages: [{ type: Input, args: ['images',] }],
361
288
  hasHtmlContent: [{ type: Input }],
362
289
  slideChange: [{ type: Output }],
363
290
  slideClick: [{ type: Output }]
@@ -378,16 +305,18 @@ NxsCarouselModule.decorators = [
378
305
  declarations: [
379
306
  NxsCarouselComponent,
380
307
  NxsCarouselDialogComponent,
308
+ NxsSwiperTemplateDirective,
381
309
  ],
382
310
  imports: [
383
311
  CommonModule,
384
312
  MatIconModule,
385
313
  MatButtonModule,
386
314
  MatDialogModule,
387
- ObserversModule,
315
+ SwiperModule,
388
316
  ],
389
317
  exports: [
390
318
  NxsCarouselComponent,
319
+ NxsSwiperTemplateDirective,
391
320
  ],
392
321
  },] }
393
322
  ];
@@ -396,5 +325,5 @@ NxsCarouselModule.decorators = [
396
325
  * Generated bundle index. Do not edit.
397
326
  */
398
327
 
399
- export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig, NxsCarouselDialogComponent as ɵa };
328
+ export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig, NxsSwiperTemplateDirective as ɵa, NxsCarouselDialogComponent as ɵb };
400
329
  //# sourceMappingURL=nextalys-carousel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nextalys-carousel.js","sources":["../../src/lib/nxs-carousel/nxs-carousel-types.ts","../../src/lib/nxs-carousel/nxs-carousel-dialog.component.ts","../../src/lib/nxs-carousel/nxs-carousel.component.ts","../../src/lib/nxs-carousel/nxs-carousel.module.ts","../../src/nextalys-carousel.ts"],"sourcesContent":["export interface NxsCarouselImage {\n alt?: string;\n src: string;\n}\nexport interface SwiperInstance {\n realIndex: number;\n activeIndex: number;\n on: (evt: 'slideChange' | 'click', cb: (data: any) => void) => void;\n destroy: (deleteInstance?: boolean, cleanStyles?: boolean) => void;\n slideTo: (index: number, speed?: number, runCallbacks?: boolean) => void;\n slideNext: (speed?: number, runCallbacks?: boolean) => void;\n slidePrev: (speed?: number, runCallbacks?: boolean) => void;\n}\nexport interface NxsCarouselOptions {\n watchSlidesVisibility?: boolean;\n watchSlidesProgress?: boolean;\n freeMode?: boolean;\n effect?: \"slide\" | \"fade\" | \"cube\" | \"coverflow\" | \"flip\";\n autoplay?: { delay: number; stopOnLastSlide?: boolean; disableOnInteraction?: boolean; reverseDirection?: boolean; waitForTransition?: boolean };\n roundLengths?: boolean;\n init?: boolean;\n initialSlide?: number;\n updateOnWindowResize?: boolean;\n direction?: 'horizontal' | 'vertical';\n slidesPerView?: number | 'auto';\n centeredSlides?: boolean;\n centeredSlidesBounds?: boolean;\n loop?: boolean;\n coverflowEffect?: {\n rotate: number;\n stretch: number;\n depth?: number;\n modifier?: number;\n slideShadows?: boolean;\n };\n pagination?: {\n el: string;\n clickable: boolean;\n type?: \"bullets\" | \"fraction\" | \"progressbar\" | \"custom\";\n };\n navigation?: {\n nextEl: string;\n prevEl: string;\n };\n spaceBetween?: number;\n breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n thumbs?: { swiper: SwiperInstance };\n nxsShowNavigationBullets?: boolean;\n nxsShowNavigationArrows?: boolean;\n nxsThumbnails?: {\n show: boolean; onMainSlider?: boolean; percentHeight?: number; perView?: number; breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n };\n nxsShowImagesCount?: boolean;\n nxsfullscreenOnClick?: boolean;\n /**\n * background mode : cover, contain, auto, etc...\n * default => cover\n */\n nxsCarouselImageBackgroundSize?: string;\n nxsCarouselDialogOptions?: NxsCarouselOptions;\n nxsCarouselDialogExitable?: boolean;\n nxsCarouselDialogSize?: { width: string; height: string; };\n}\nexport class NxsCarouselModuleConfig {\n debug?: boolean = false;\n}","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { NxsCarouselImage, NxsCarouselOptions } from './nxs-carousel-types';\n\nexport interface NxsCarouselDialogData {\n images: NxsCarouselImage[];\n options?: NxsCarouselOptions;\n wrapperClass?: string;\n}\n@Component({\n selector: 'nxs-carousel-dialog',\n template: `\n <div class=\"nxs-carousel-dialog-flex-wrapper\">\n <div class=\"nxs-carousel-dialog-header\">\n <button (click)=\"dialogRef.close()\" mat-icon-button><mat-icon>close</mat-icon></button>\n </div>\n <div [class]=\"wrapperClass\">\n <nxs-carousel [options]=\"data.options\" [images]=\"data.images\"></nxs-carousel>\n </div>\n</div>\n `,\n styleUrls: ['./nxs-carousel-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselDialogComponent {\n public wrapperClass: string = 'nxs-carousel-wrapper';\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: NxsCarouselDialogData,\n public dialogRef: MatDialogRef<NxsCarouselDialogComponent>,\n ) {\n if (data.wrapperClass)\n this.wrapperClass += ' ' + data.wrapperClass;\n }\n\n}\n","import { Component, ViewEncapsulation, Input, ViewChild, ElementRef, Output, EventEmitter, PLATFORM_ID, Inject, Optional, NgZone, SimpleChanges } from '@angular/core';\nimport { NxsCarouselOptions, NxsCarouselImage, SwiperInstance, NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { NxsCarouselDialogData, NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatDialog } from '@angular/material/dialog';\nimport { isPlatformBrowser } from '@angular/common';\nimport { EventsCollector } from 'nextalys-js-helpers/dist/events';\n@Component({\n selector: 'nxs-carousel',\n templateUrl: './nxs-carousel.component.html',\n styleUrls: ['./nxs-carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselComponent {\n private mutationObserver: MutationObserver | null = null;\n recreateSliderSubscribed = false;\n private eventsCollector = new EventsCollector();\n public images: NxsCarouselImage[];\n\n @ViewChild('nxsSliderContainer', { static: true })\n nxsSliderContainer: ElementRef<HTMLDivElement>;\n\n @ViewChild('nxsSlidesWrapper', { static: true })\n nxsSlidesWrapper: ElementRef<HTMLDivElement>;\n\n //thumbnails\n @ViewChild('nxsThumbnailsSliderContainer', { static: true })\n nxsThumbnailsSliderContainer: ElementRef<HTMLDivElement>;\n @ViewChild('nxsThumbnailsSlidesWrapper', { static: true })\n nxsThumbnailsSlidesWrapper: ElementRef<HTMLDivElement>;\n options: NxsCarouselOptions = {};\n @Input('options')\n set setOptions(val: NxsCarouselOptions) {\n this.options = this.setDefaultOptions(val, false);\n }\n @Input('images')\n set setImages(val: NxsCarouselImage[]) {\n this.images = val;\n this.initSlides();\n this.createSlider(true);\n }\n @Input()\n hasHtmlContent = false;\n slidesCount: number = 0;\n public sliderInstance: SwiperInstance;\n public thumbnailsSliderInstance: SwiperInstance;\n\n @Output()\n slideChange = new EventEmitter<number>();\n public currentSlide = 0;\n @Output()\n slideClick = new EventEmitter<MouseEvent>();\n isBrowser = false;\n private swiperLibrary: any;\n\n constructor(\n private matDialog: MatDialog,\n private zone: NgZone,\n @Inject(PLATFORM_ID) private platformId: any,\n @Optional() private config?: NxsCarouselModuleConfig,\n ) {\n if (!this.config)\n this.config = { debug: false };\n this.isBrowser = isPlatformBrowser(this.platformId);\n this.log('constructor - isBrowser', this.isBrowser);\n this.options = this.setDefaultOptions(undefined, false);\n }\n private log(...args: any[]) {\n if (!this.config.debug)\n return;\n console.log('[NxsCarousel]', ...args);\n }\n\n onContentChange(changes: MutationRecord[]) {\n // console.log(\"Log: NxsCarouselComponent -> onContentChange -> changes\", changes);\n // changes.forEach(change => console.log(change.target));\n }\n initSlides() {\n if (!this.isBrowser) {\n this.log('prevent initSlides on platform server');\n return;\n }\n if (!this.nxsSlidesWrapper) {\n this.log('can not initSlides : nxsSlidesWrapper is not defined !');\n return;\n }\n this.log('initSlides begins');\n this.zone.runOutsideAngular(() => {\n if (!this.hasHtmlContent && this.images) {\n this.nxsSlidesWrapper.nativeElement.innerHTML = '';\n\n for (const cImage of this.images) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n div.style.backgroundImage = 'url(' + cImage.src + ')';\n if (this.options.nxsCarouselImageBackgroundSize)\n div.style.backgroundSize = this.options.nxsCarouselImageBackgroundSize;\n this.nxsSlidesWrapper.nativeElement.appendChild(div);\n }\n this.slidesCount = this.images.length;\n if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n this.nxsThumbnailsSlidesWrapper.nativeElement.innerHTML = '';\n for (const cImage of this.images) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n div.style.backgroundImage = 'url(' + cImage.src + ')';\n this.nxsThumbnailsSlidesWrapper.nativeElement.appendChild(div);\n }\n }\n this.log('initSlides - images are defined - slides count => ', this.slidesCount);\n }\n else if (this.hasHtmlContent) {\n this.log('initSlides - html content - slides length => ', this.nxsSlidesWrapper.nativeElement.children.length);\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < this.nxsSlidesWrapper.nativeElement.children.length; i++) {\n const child = this.nxsSlidesWrapper.nativeElement.children[i];\n if (!child.className)\n child.className = 'swiper-slide';\n else if (child.className.indexOf('swiper-slide') === -1) {\n child.className += ' swiper-slide';\n }\n }\n this.slidesCount = this.nxsSlidesWrapper.nativeElement.children.length;\n this.log('initSlides - html content - slides count => ', this.slidesCount);\n }\n });\n\n }\n\n private destroy() {\n if (!this.isBrowser) {\n return;\n }\n this.eventsCollector?.unsubscribeAll();\n this.mutationObserver?.disconnect();\n this.sliderInstance?.destroy();\n }\n ngOnDestroy(): void {\n this.destroy();\n }\n private subscribeToSlideChanged() {\n if (!this.hasHtmlContent) {\n this.log('subscribeToSlideChanged cannot be subscribed : has no html content');\n return;\n }\n if (!this.nxsSlidesWrapper || !this.nxsSlidesWrapper.nativeElement) {\n this.log('subscribeToSlideChanged error : nxsSlidesWrapper is not defined');\n return;\n }\n if (typeof MutationObserver === 'undefined') {\n this.log('cannot use mutation observer');\n return;\n }\n\n if (this.mutationObserver)\n this.mutationObserver.disconnect();\n\n this.log('subscribe to mutation observer');\n this.mutationObserver = new MutationObserver((mutationsList) => {\n // console.log(\"Log: NxsCarouselComponent -> subscribeToSlideChanged -> mutationsList\", mutationsList);\n // console.log(\"Log: NxsCarouselComponent -> subscribeToSlideChanged -> MutationObserver\");\n this.log('mutation observer - html content has changed');\n if (mutationsList.length === 0)\n return;\n let mustUpdate = false;\n for (const mutation of mutationsList) {\n if (mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0) {\n mustUpdate = true;\n break;\n }\n }\n if (mustUpdate) {\n this.initSlides();\n this.createSlider(true);\n }\n\n });\n this.mutationObserver.observe(this.nxsSlidesWrapper.nativeElement, { childList: true, attributes: false, });\n }\n ngAfterViewInit(): void {\n this.initSlides();\n this.createSlider(true);\n }\n getMainSliderHeight() {\n if (!this.options)\n return '';\n if (this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n if (this.options.nxsThumbnails.onMainSlider) {\n return '100%';\n }\n else if (this.options.nxsThumbnails.percentHeight) {\n return (100 - this.options.nxsThumbnails.percentHeight) + '%';\n }\n }\n return '';\n }\n private setDefaultOptions(options: NxsCarouselOptions, forDialog: boolean) {\n if (!options && forDialog) {\n options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true };\n }\n else if (!options)\n options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {} };\n if (options.nxsCarouselDialogOptions) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };\n if (typeof options.nxsCarouselDialogOptions.effect === 'undefined')\n options.nxsCarouselDialogOptions.effect = 'slide';\n if (typeof options.nxsCarouselDialogOptions.nxsShowNavigationArrows === 'undefined')\n options.nxsCarouselDialogOptions.nxsShowNavigationArrows = true;\n\n if (!!options.nxsCarouselDialogOptions.nxsThumbnails?.show) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight = 20;\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.perView === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.perView = 10;\n options.nxsCarouselDialogOptions.nxsThumbnails.breakpoints = {\n 640: {\n slidesPerView: 5,\n },\n 768: {\n slidesPerView: 7,\n },\n 1024: {\n slidesPerView: 8,\n },\n };\n }\n }\n if (!options.nxsThumbnails)\n options.nxsThumbnails = { show: false };\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.percentHeight === 'undefined')\n options.nxsThumbnails.percentHeight = 20;\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.perView === 'undefined')\n options.nxsThumbnails.perView = 10;\n\n\n if (forDialog)\n options.nxsfullscreenOnClick = false;\n if (options.nxsThumbnails.onMainSlider)\n options.nxsShowNavigationBullets = false;\n return options;\n }\n public showFullScreenCarousel(images: NxsCarouselImage[], wrapperClass?: string) {\n this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);\n const data: NxsCarouselDialogData = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };\n this.matDialog.open(NxsCarouselDialogComponent, {\n data,\n panelClass: 'nxs-carousel-dialog',\n width: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.width : undefined,\n height: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.height : undefined,\n disableClose: !this.options.nxsCarouselDialogExitable,\n });\n }\n private createSlider(forceRecreate: boolean) {\n if (!this.isBrowser) {\n this.log('prevent createSlider : platform is server');\n return;\n }\n if (!this.nxsSliderContainer) {\n this.log('can not createSlider : nxsSliderContainer is not defined !');\n return;\n }\n this.log('createSlider', this.nxsSliderContainer.nativeElement);\n if (this.slidesCount === 0) {\n this.log('can not createSlider : slidesCount === 0');\n this.subscribeToSlideChanged();\n return;\n }\n if (this.sliderInstance && !forceRecreate) {\n this.log('can re create slider => slider is already created.');\n return;\n }\n this.zone.runOutsideAngular(async () => {\n this.destroy();\n this.options.pagination = {\n el: '.nxs-carousel-pagination',\n clickable: true,\n type: 'bullets',\n };\n this.options.navigation = {\n nextEl: '.nxs-carousel-button-next',\n prevEl: '.nxs-carousel-button-prev',\n };\n if (!this.swiperLibrary)\n this.swiperLibrary = await import(\"swiper\");\n const Swiper = this.swiperLibrary.default;\n if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n const thumbnailsOptions: NxsCarouselOptions = {\n slidesPerView: this.options.nxsThumbnails.perView,\n loop: false,\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n breakpoints: this.options.nxsThumbnails.breakpoints,\n // spaceBetween: 10,\n };\n this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);\n this.options.thumbs = { swiper: this.thumbnailsSliderInstance };\n }\n this.sliderInstance = new Swiper(this.nxsSliderContainer.nativeElement, this.options);\n this.log('sliderInstance has been created', this.sliderInstance);\n this.sliderInstance.on('slideChange', () => {\n this.zone.run(() => {\n this.currentSlide = this.sliderInstance.realIndex;\n this.log(\"slideChange\", this.currentSlide);\n this.slideChange.next(this.currentSlide);\n });\n });\n this.sliderInstance.on('click', (evt: MouseEvent) => {\n const target = evt.target as HTMLElement;\n if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)\n return;\n this.zone.run(() => {\n this.slideClick.next(evt);\n if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {\n this.showFullScreenCarousel(this.images, 'fullscreen-carousel');\n }\n });\n\n });\n this.subscribeToSlideChanged();\n });\n }\n\n goToSlide(index: number, speed?: number) {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slideTo(index, speed);\n }\n next() {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slideNext();\n }\n previous() {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slidePrev();\n }\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { NxsCarouselComponent } from './nxs-carousel.component';\nimport { NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { ObserversModule } from '@angular/cdk/observers';\n\n@NgModule({\n declarations: [\n NxsCarouselComponent,\n NxsCarouselDialogComponent,\n ],\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatDialogModule,\n ObserversModule,\n ],\n exports: [\n NxsCarouselComponent,\n ],\n})\nexport class NxsCarouselModule {\n public static forRoot(config?: NxsCarouselModuleConfig): ModuleWithProviders<NxsCarouselModule> {\n return {\n ngModule: NxsCarouselModule,\n providers: [\n { provide: NxsCarouselModuleConfig, useValue: config },\n ]\n };\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {NxsCarouselDialogComponent as ɵa} from './lib/nxs-carousel/nxs-carousel-dialog.component';"],"names":[],"mappings":";;;;;;;;;MAyEa,uBAAuB;IAApC;QACI,UAAK,GAAa,KAAK,CAAC;KAC3B;;;MCnDY,0BAA0B;IAEnC,YACoC,IAA2B,EACpD,SAAmD;QAD1B,SAAI,GAAJ,IAAI,CAAuB;QACpD,cAAS,GAAT,SAAS,CAA0C;QAHvD,iBAAY,GAAW,sBAAsB,CAAC;QAKjD,IAAI,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,YAAY,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC;KACpD;;;YAvBJ,SAAS,SAAC;gBACP,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE;;;;;;;;;KAST;gBAED,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACxC;;;4CAIQ,MAAM,SAAC,eAAe;YA1BL,YAAY;;;MCWzB,oBAAoB;IA0C7B,YACY,SAAoB,EACpB,IAAY,EACS,UAAe,EAC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AGhD,SAAS,SAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;2CAI9C,SAAS,SAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;yCAE1D,SAAS,SAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;yBAGxD,KAAK,SAAC,SAAS;wBAIf,KAAK,SAAC,QAAQ;6BAMd,KAAK;0BAML,MAAM;yBAGN,MAAM;;;MCvBE,iBAAiB;IACnB,OAAO,OAAO,CAAC,MAAgC;QAClD,OAAO;YACH,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE;gBACP,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAE;aACzD;SACJ,CAAC;KACL;;;YAxBJ,QAAQ,SAAC;gBACN,YAAY,EAAE;oBACV,oBAAoB;oBACpB,0BAA0B;iBAC7B;gBACD,OAAO,EAAE;oBACL,YAAY;oBACZ,aAAa;oBACb,eAAe;oBACf,eAAe;oBACf,eAAe;iBAClB;gBACD,OAAO,EAAE;oBACL,oBAAoB;iBACvB;aACJ;;;ACzBD;;;;;;"}
1
+ {"version":3,"file":"nextalys-carousel.js","sources":["../../src/lib/nxs-carousel/nxs-carousel-types.ts","../../src/lib/nxs-carousel/nxs-carousel-dialog.component.ts","../../src/lib/nxs-carousel/swiper-directives.ts","../../src/lib/nxs-carousel/nxs-carousel.component.ts","../../src/lib/nxs-carousel/nxs-carousel.module.ts","../../src/nextalys-carousel.ts"],"sourcesContent":["import { SwiperOptions } from \"swiper\";\n\nexport interface NxsCarouselImage {\n alt?: string;\n src: string;\n}\nexport interface NxsCarouselOptions extends SwiperOptions {\n nxsShowNavigationBullets?: boolean;\n nxsShowNavigationArrows?: boolean;\n nxsThumbnails?: {\n show: boolean; onMainSlider?: boolean; percentHeight?: number; perView?: number; breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n };\n nxsShowImagesCount?: boolean;\n nxsfullscreenOnClick?: boolean;\n /**\n * background mode : cover, contain, auto, etc...\n * default => cover\n */\n nxsCarouselImageBackgroundSize?: string;\n nxsCarouselDialogOptions?: NxsCarouselOptions;\n nxsCarouselDialogExitable?: boolean;\n nxsCarouselDialogSize?: { width: string; height: string; };\n}\nexport class NxsCarouselModuleConfig {\n debug?: boolean = false;\n}","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { NxsCarouselImage, NxsCarouselOptions } from './nxs-carousel-types';\n\nexport interface NxsCarouselDialogData {\n images: NxsCarouselImage[];\n options?: NxsCarouselOptions;\n wrapperClass?: string;\n}\n@Component({\n selector: 'nxs-carousel-dialog',\n template: `\n <div class=\"nxs-carousel-dialog-flex-wrapper\">\n <div class=\"nxs-carousel-dialog-header\">\n <button (click)=\"dialogRef.close()\" mat-icon-button><mat-icon>close</mat-icon></button>\n </div>\n <div [class]=\"wrapperClass\">\n <nxs-carousel [options]=\"data.options\" [images]=\"data.images\"></nxs-carousel>\n </div>\n</div>\n `,\n styleUrls: ['./nxs-carousel-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselDialogComponent {\n public wrapperClass: string = 'nxs-carousel-wrapper';\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: NxsCarouselDialogData,\n public dialogRef: MatDialogRef<NxsCarouselDialogComponent>,\n ) {\n if (data.wrapperClass)\n this.wrapperClass += ' ' + data.wrapperClass;\n }\n\n}\n","import { Directive } from \"@angular/core\";\n\n@Directive({\n selector: '[nxsSwiperTemplate]',\n})\nexport class NxsSwiperTemplateDirective { }\n","import { Component, ViewEncapsulation, Input, ViewChild, Output, EventEmitter, PLATFORM_ID, Inject, Optional, NgZone, ContentChildren, TemplateRef } from '@angular/core';\nimport { NxsCarouselOptions, NxsCarouselImage, NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { NxsCarouselDialogData, NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatDialog } from '@angular/material/dialog';\nimport { isPlatformBrowser } from '@angular/common';\nimport { EventsCollector } from 'nextalys-js-helpers/dist/events';\n// import Swiper core and required modules\nimport SwiperCore, { Navigation, Pagination, Autoplay, Lazy, Swiper, SwiperOptions, Thumbs } from 'swiper';\n//Virtual,Scrollbar,A11y\nimport { SwiperComponent } from 'swiper/angular';\nimport { NxsSwiperTemplateDirective } from './swiper-directives';\n\n// install Swiper modules\nSwiperCore.use([Navigation, Pagination, Autoplay, Lazy, Thumbs]);\n@Component({\n selector: 'nxs-carousel',\n templateUrl: './nxs-carousel.component.html',\n styleUrls: ['./nxs-carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselComponent {\n @ContentChildren(NxsSwiperTemplateDirective, { read: TemplateRef })\n contents!: TemplateRef<HTMLElement>;\n @ViewChild('swiper', { static: false })\n swiperComponent?: SwiperComponent;\n @Input()\n lazy = true;\n private eventsCollector = new EventsCollector();\n\n @Input()\n public images: NxsCarouselImage[];\n options: NxsCarouselOptions = null;\n thumbnailsOptions: SwiperOptions = null;\n @Input('options')\n set setOptions(val: NxsCarouselOptions) {\n this.options = this.setDefaultOptions(val, false);\n this.setThumbnailsOptions();\n }\n @Input()\n hasHtmlContent = false;\n slidesCount: number = 0;\n private swiperInstance: Swiper;\n thumbnailsSwiperInstance: Swiper;\n\n @Output()\n slideChange = new EventEmitter<number>();\n public currentSlide = 0;\n @Output()\n slideClick = new EventEmitter<MouseEvent | TouchEvent | PointerEvent>();\n isBrowser = false;\n\n constructor(\n private matDialog: MatDialog,\n private zone: NgZone,\n @Inject(PLATFORM_ID) private platformId: any,\n @Optional() private config?: NxsCarouselModuleConfig,\n ) {\n if (!this.config)\n this.config = { debug: false };\n this.isBrowser = isPlatformBrowser(this.platformId);\n this.log('constructor - isBrowser', this.isBrowser);\n this.options = this.setDefaultOptions(undefined, false);\n }\n private log(...args: any[]) {\n if (!this.config.debug)\n return;\n console.log('[NxsCarousel]', ...args);\n }\n private destroy() {\n if (!this.isBrowser) {\n return;\n }\n this.eventsCollector?.unsubscribeAll();\n }\n ngOnDestroy(): void {\n this.destroy();\n }\n ngAfterViewInit(): void {\n // console.log('thi.contents', this.contents);\n // this.initSlides();\n // this.createSlider(true);\n }\n getMainSliderHeight() {\n if (!this.options)\n return '';\n if (this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n if (this.options.nxsThumbnails.onMainSlider) {\n return '100%';\n }\n else if (this.options.nxsThumbnails.percentHeight) {\n return (100 - this.options.nxsThumbnails.percentHeight) + '%';\n }\n }\n return '';\n }\n private setDefaultOptions(options: NxsCarouselOptions, forDialog: boolean) {\n if (!options && forDialog) {\n options = {\n nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true,\n lazy: true,\n };\n }\n else if (!options) {\n options = {\n nxsShowNavigationBullets: true, loop: true,\n nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {},\n lazy: true,\n };\n }\n if (options.nxsCarouselDialogOptions) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };\n if (typeof options.nxsCarouselDialogOptions.effect === 'undefined')\n options.nxsCarouselDialogOptions.effect = 'slide';\n if (typeof options.nxsCarouselDialogOptions.nxsShowNavigationArrows === 'undefined')\n options.nxsCarouselDialogOptions.nxsShowNavigationArrows = true;\n\n if (!!options.nxsCarouselDialogOptions.nxsThumbnails?.show) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight = 20;\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.perView === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.perView = 10;\n options.nxsCarouselDialogOptions.nxsThumbnails.breakpoints = {\n 640: {\n slidesPerView: 5,\n },\n 768: {\n slidesPerView: 7,\n },\n 1024: {\n slidesPerView: 8,\n },\n };\n }\n }\n if (!options.nxsThumbnails)\n options.nxsThumbnails = { show: false };\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.percentHeight === 'undefined')\n options.nxsThumbnails.percentHeight = 20;\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.perView === 'undefined')\n options.nxsThumbnails.perView = 10;\n\n\n if (forDialog)\n options.nxsfullscreenOnClick = false;\n if (options.nxsThumbnails.onMainSlider)\n options.nxsShowNavigationBullets = false;\n\n if (typeof options.lazy === 'undefined')\n options.lazy = true;\n\n if (typeof options.navigation === 'undefined')\n options.navigation = true;\n if (typeof options.pagination === 'undefined')\n options.pagination = { clickable: true };\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 272 ~ NxsCarouselComponent ~ setDefaultOptions ~ options\", options);\n\n return options;\n }\n\n private setThumbnailsOptions() {\n if (!!this.options?.nxsThumbnails?.show) {\n this.thumbnailsOptions = {\n slidesPerView: this.options.nxsThumbnails.perView,\n loop: false,\n freeMode: true,\n // watchSlidesVisibility: true,\n watchSlidesProgress: true,\n breakpoints: this.options.nxsThumbnails.breakpoints,\n // spaceBetween: 10,\n };\n if (this.lazy) {\n // Disable preloading of all images\n this.thumbnailsOptions.preloadImages = false;\n // Enable lazy loading\n this.thumbnailsOptions.lazy = true;\n }\n // this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);\n // this.options.thumbs = { swiper: this.thumbnailsSliderInstance };\n }\n }\n public showFullScreenCarousel(images: NxsCarouselImage[], wrapperClass?: string) {\n this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);\n const data: NxsCarouselDialogData = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };\n this.matDialog.open(NxsCarouselDialogComponent, {\n data,\n panelClass: 'nxs-carousel-dialog',\n width: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.width : undefined,\n height: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.height : undefined,\n disableClose: !this.options.nxsCarouselDialogExitable,\n });\n }\n goToSlide(index: number, speed?: number) {\n this.swiperInstance?.slideTo(index, speed);\n }\n next() {\n this.swiperInstance?.slideNext();\n }\n previous() {\n this.swiperInstance?.slidePrev();\n }\n onSwiperThumbnails(instance: Swiper) {\n if (this.options?.nxsThumbnails?.show)\n this.thumbnailsSwiperInstance = instance;\n else\n this.thumbnailsSwiperInstance = null;\n\n // if (this.options?.nxsThumbnails?.show) {\n // const optionsClone = MainHelpers.cloneObject(this.options);\n // optionsClone.thumbs = { swiper: this.thumbnailsSwiperInstance };\n // // this.options = optionsClone;\n // // this.options = { ...this.options, thumbs: { swiper: this.thumbnailsSwiperInstance } };\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 416 ~ NxsCarouselComponent ~ onSwiperThumbnails ~ this.options \", this.options);\n // this.options.thumbs = { swiper: this.thumbnailsSwiperInstance };\n // }\n }\n onSwiper(instance: Swiper) {\n this.log('swiper ready - instance', instance);\n this.swiperInstance = instance;\n this.swiperInstance.on('click', (swiperInstance, evt) => {\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 392 ~ NxsCarouselComponent ~ this.swiperInstance.on ~ evt\", evt);\n const target = evt.target as HTMLElement;\n if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)\n return;\n this.runInZone(() => {\n this.slideClick.next(evt);\n if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {\n this.showFullScreenCarousel(this.images, 'fullscreen-carousel');\n }\n });\n\n });\n }\n private runInZone<T extends (...args: any[]) => void>(callback: T, ...args: any[]) {\n if (!this.zone) {\n callback(args);\n }\n return this.zone.run(() => callback(args));\n }\n\n onSlideChange(instances: Swiper[]) {\n // this.swiperInstance = instance;\n // this.log('slide change - instance', instance);\n this.runInZone(() => {\n this.currentSlide = this.swiperInstance?.realIndex || 0;\n this.log('slide change - currentSlide', this.currentSlide);\n this.slideChange.next(this.currentSlide);\n });\n }\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { NxsCarouselComponent } from './nxs-carousel.component';\nimport { NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { SwiperModule } from 'swiper/angular';\nimport { NxsSwiperTemplateDirective } from './swiper-directives';\n\n@NgModule({\n declarations: [\n NxsCarouselComponent,\n NxsCarouselDialogComponent,\n NxsSwiperTemplateDirective,\n ],\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatDialogModule,\n SwiperModule,\n ],\n exports: [\n NxsCarouselComponent,\n NxsSwiperTemplateDirective,\n ],\n})\nexport class NxsCarouselModule {\n public static forRoot(config?: NxsCarouselModuleConfig): ModuleWithProviders<NxsCarouselModule> {\n return {\n ngModule: NxsCarouselModule,\n providers: [\n { provide: NxsCarouselModuleConfig, useValue: config },\n ]\n };\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {NxsCarouselDialogComponent as ɵb} from './lib/nxs-carousel/nxs-carousel-dialog.component';\nexport {NxsSwiperTemplateDirective as ɵa} from './lib/nxs-carousel/swiper-directives';"],"names":[],"mappings":";;;;;;;;;MA4Ba,uBAAuB;IAApC;QACI,UAAK,GAAa,KAAK,CAAC;KAC3B;;;MCNY,0BAA0B;IAEnC,YACoC,IAA2B,EACpD,SAAmD;QAD1B,SAAI,GAAJ,IAAI,CAAuB;QACpD,cAAS,GAAT,SAAS,CAA0C;QAHvD,iBAAY,GAAW,sBAAsB,CAAC;QAKjD,IAAI,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,YAAY,I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Y;oBACZ,aAAa;oBACb,eAAe;oBACf,eAAe;oBACf,YAAY;iBACf;gBACD,OAAO,EAAE;oBACL,oBAAoB;oBACpB,0BAA0B;iBAC7B;aACJ;;;AC5BD;;;;;;"}
@@ -1,63 +1,9 @@
1
+ import { SwiperOptions } from "swiper";
1
2
  export interface NxsCarouselImage {
2
3
  alt?: string;
3
4
  src: string;
4
5
  }
5
- export interface SwiperInstance {
6
- realIndex: number;
7
- activeIndex: number;
8
- on: (evt: 'slideChange' | 'click', cb: (data: any) => void) => void;
9
- destroy: (deleteInstance?: boolean, cleanStyles?: boolean) => void;
10
- slideTo: (index: number, speed?: number, runCallbacks?: boolean) => void;
11
- slideNext: (speed?: number, runCallbacks?: boolean) => void;
12
- slidePrev: (speed?: number, runCallbacks?: boolean) => void;
13
- }
14
- export interface NxsCarouselOptions {
15
- watchSlidesVisibility?: boolean;
16
- watchSlidesProgress?: boolean;
17
- freeMode?: boolean;
18
- effect?: "slide" | "fade" | "cube" | "coverflow" | "flip";
19
- autoplay?: {
20
- delay: number;
21
- stopOnLastSlide?: boolean;
22
- disableOnInteraction?: boolean;
23
- reverseDirection?: boolean;
24
- waitForTransition?: boolean;
25
- };
26
- roundLengths?: boolean;
27
- init?: boolean;
28
- initialSlide?: number;
29
- updateOnWindowResize?: boolean;
30
- direction?: 'horizontal' | 'vertical';
31
- slidesPerView?: number | 'auto';
32
- centeredSlides?: boolean;
33
- centeredSlidesBounds?: boolean;
34
- loop?: boolean;
35
- coverflowEffect?: {
36
- rotate: number;
37
- stretch: number;
38
- depth?: number;
39
- modifier?: number;
40
- slideShadows?: boolean;
41
- };
42
- pagination?: {
43
- el: string;
44
- clickable: boolean;
45
- type?: "bullets" | "fraction" | "progressbar" | "custom";
46
- };
47
- navigation?: {
48
- nextEl: string;
49
- prevEl: string;
50
- };
51
- spaceBetween?: number;
52
- breakpoints?: {
53
- [size: number]: {
54
- spaceBetween?: number;
55
- slidesPerView: number | 'auto';
56
- };
57
- };
58
- thumbs?: {
59
- swiper: SwiperInstance;
60
- };
6
+ export interface NxsCarouselOptions extends SwiperOptions {
61
7
  nxsShowNavigationBullets?: boolean;
62
8
  nxsShowNavigationArrows?: boolean;
63
9
  nxsThumbnails?: {