nextalys-carousel 0.0.52 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/bundles/nextalys-carousel.umd.js +142 -228
- package/bundles/nextalys-carousel.umd.js.map +1 -1
- package/bundles/nextalys-carousel.umd.min.js +2 -2
- package/bundles/nextalys-carousel.umd.min.js.map +1 -1
- package/esm2015/lib/nxs-carousel/nxs-carousel-types.js +1 -1
- package/esm2015/lib/nxs-carousel/nxs-carousel.component.js +119 -194
- package/esm2015/lib/nxs-carousel/nxs-carousel.module.js +6 -3
- package/esm2015/lib/nxs-carousel/swiper-directives.js +9 -0
- package/esm2015/nextalys-carousel.js +3 -2
- package/fesm2015/nextalys-carousel.js +127 -196
- package/fesm2015/nextalys-carousel.js.map +1 -1
- package/lib/nxs-carousel/nxs-carousel-types.d.ts +2 -56
- package/lib/nxs-carousel/nxs-carousel-types.d.ts.map +1 -1
- package/lib/nxs-carousel/nxs-carousel.component.d.ts +17 -17
- package/lib/nxs-carousel/nxs-carousel.component.d.ts.map +1 -1
- package/lib/nxs-carousel/nxs-carousel.module.d.ts.map +1 -1
- package/lib/nxs-carousel/swiper-directives.d.ts +3 -0
- package/lib/nxs-carousel/swiper-directives.d.ts.map +1 -0
- package/nextalys-carousel.d.ts +2 -1
- package/nextalys-carousel.d.ts.map +1 -1
- package/nextalys-carousel.metadata.json +1 -1
- package/package.json +3 -13
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
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.
|
|
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,118 +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
|
-
|
|
83
|
-
|
|
84
|
-
// changes.forEach(change => console.log(change.target));
|
|
85
|
-
}
|
|
86
|
-
initSlides() {
|
|
88
|
+
destroy() {
|
|
89
|
+
var _a;
|
|
87
90
|
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
91
|
return;
|
|
94
92
|
}
|
|
95
|
-
this.
|
|
96
|
-
this.zone.runOutsideAngular(() => {
|
|
97
|
-
if (!this.hasHtmlContent && this.images) {
|
|
98
|
-
this.nxsSlidesWrapper.nativeElement.innerHTML = '';
|
|
99
|
-
for (let i = 0; i < this.images.length; i++) {
|
|
100
|
-
const div = document.createElement('div');
|
|
101
|
-
div.className = 'swiper-slide';
|
|
102
|
-
div.style.backgroundImage = 'url(' + this.images[i].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 (let i = 0; i < this.images.length; i++) {
|
|
111
|
-
const div = document.createElement('div');
|
|
112
|
-
div.className = 'swiper-slide';
|
|
113
|
-
div.style.backgroundImage = 'url(' + this.images[i].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
|
-
for (let i = 0; i < this.nxsSlidesWrapper.nativeElement.children.length; i++) {
|
|
122
|
-
const child = this.nxsSlidesWrapper.nativeElement.children[i];
|
|
123
|
-
if (!child.className)
|
|
124
|
-
child.className = 'swiper-slide';
|
|
125
|
-
else if (child.className.indexOf('swiper-slide') === -1) {
|
|
126
|
-
child.className += ' swiper-slide';
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
this.slidesCount = this.nxsSlidesWrapper.nativeElement.children.length;
|
|
130
|
-
this.log('initSlides - html content - slides count => ', this.slidesCount);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
93
|
+
(_a = this.eventsCollector) === null || _a === void 0 ? void 0 : _a.unsubscribeAll();
|
|
133
94
|
}
|
|
134
95
|
ngOnDestroy() {
|
|
135
|
-
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
this.eventsCollector.unsubscribeAll();
|
|
139
|
-
if (this.mutationObserver)
|
|
140
|
-
this.mutationObserver.disconnect();
|
|
141
|
-
if (this.sliderInstance)
|
|
142
|
-
this.sliderInstance.destroy();
|
|
143
|
-
}
|
|
144
|
-
subscribeToSlideChanged() {
|
|
145
|
-
if (!this.hasHtmlContent) {
|
|
146
|
-
this.log('subscribeToSlideChanged cannot be subscribed : has no html content');
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (!this.nxsSlidesWrapper || !this.nxsSlidesWrapper.nativeElement) {
|
|
150
|
-
this.log('subscribeToSlideChanged error : nxsSlidesWrapper is not defined');
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (typeof MutationObserver === 'undefined') {
|
|
154
|
-
this.log('cannot use mutation observer');
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (this.mutationObserver)
|
|
158
|
-
this.mutationObserver.disconnect();
|
|
159
|
-
this.log('subscribe to mutation observer');
|
|
160
|
-
this.mutationObserver = new MutationObserver((mutationsList) => {
|
|
161
|
-
// console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> mutationsList", mutationsList);
|
|
162
|
-
// console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> MutationObserver");
|
|
163
|
-
this.log('mutation observer - html content has changed');
|
|
164
|
-
if (mutationsList.length === 0)
|
|
165
|
-
return;
|
|
166
|
-
let mustUpdate = false;
|
|
167
|
-
for (const mutation of mutationsList) {
|
|
168
|
-
if (mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0) {
|
|
169
|
-
mustUpdate = true;
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (mustUpdate) {
|
|
174
|
-
this.initSlides();
|
|
175
|
-
this.createSlider(true);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
this.mutationObserver.observe(this.nxsSlidesWrapper.nativeElement, { childList: true, attributes: false, });
|
|
96
|
+
this.destroy();
|
|
179
97
|
}
|
|
180
98
|
ngAfterViewInit() {
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
99
|
+
// console.log('thi.contents', this.contents);
|
|
100
|
+
// this.initSlides();
|
|
101
|
+
// this.createSlider(true);
|
|
183
102
|
}
|
|
184
103
|
getMainSliderHeight() {
|
|
185
104
|
if (!this.options)
|
|
@@ -197,10 +116,18 @@ class NxsCarouselComponent {
|
|
|
197
116
|
setDefaultOptions(options, forDialog) {
|
|
198
117
|
var _a;
|
|
199
118
|
if (!options && forDialog) {
|
|
200
|
-
options = {
|
|
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
|
+
};
|
|
201
130
|
}
|
|
202
|
-
else if (!options)
|
|
203
|
-
options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {} };
|
|
204
131
|
if (options.nxsCarouselDialogOptions) {
|
|
205
132
|
if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')
|
|
206
133
|
options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };
|
|
@@ -236,8 +163,37 @@ class NxsCarouselComponent {
|
|
|
236
163
|
options.nxsfullscreenOnClick = false;
|
|
237
164
|
if (options.nxsThumbnails.onMainSlider)
|
|
238
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);
|
|
239
173
|
return options;
|
|
240
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
|
+
}
|
|
241
197
|
showFullScreenCarousel(images, wrapperClass) {
|
|
242
198
|
this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);
|
|
243
199
|
const data = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };
|
|
@@ -249,98 +205,72 @@ class NxsCarouselComponent {
|
|
|
249
205
|
disableClose: !this.options.nxsCarouselDialogExitable,
|
|
250
206
|
});
|
|
251
207
|
}
|
|
252
|
-
createSlider(forceRecreate) {
|
|
253
|
-
if (!this.isBrowser) {
|
|
254
|
-
this.log('prevent createSlider : platform is server');
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (!this.nxsSliderContainer) {
|
|
258
|
-
this.log('can not createSlider : nxsSliderContainer is not defined !');
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
this.log('createSlider', this.nxsSliderContainer.nativeElement);
|
|
262
|
-
if (this.slidesCount === 0) {
|
|
263
|
-
this.log('can not createSlider : slidesCount === 0');
|
|
264
|
-
this.subscribeToSlideChanged();
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
if (this.sliderInstance && !forceRecreate) {
|
|
268
|
-
this.log('can re create slider => slider is already created.');
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
this.zone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
|
|
272
|
-
if (this.sliderInstance)
|
|
273
|
-
this.sliderInstance.destroy();
|
|
274
|
-
this.options.pagination = {
|
|
275
|
-
el: '.nxs-carousel-pagination',
|
|
276
|
-
clickable: true,
|
|
277
|
-
type: 'bullets',
|
|
278
|
-
};
|
|
279
|
-
this.options.navigation = {
|
|
280
|
-
nextEl: '.nxs-carousel-button-next',
|
|
281
|
-
prevEl: '.nxs-carousel-button-prev',
|
|
282
|
-
};
|
|
283
|
-
if (!this.swiperLibrary)
|
|
284
|
-
this.swiperLibrary = yield import('swiper');
|
|
285
|
-
const Swiper = this.swiperLibrary.default;
|
|
286
|
-
if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
|
|
287
|
-
const thumbnailsOptions = {
|
|
288
|
-
slidesPerView: this.options.nxsThumbnails.perView,
|
|
289
|
-
loop: false,
|
|
290
|
-
freeMode: true,
|
|
291
|
-
watchSlidesVisibility: true,
|
|
292
|
-
watchSlidesProgress: true,
|
|
293
|
-
breakpoints: this.options.nxsThumbnails.breakpoints,
|
|
294
|
-
// spaceBetween: 10,
|
|
295
|
-
};
|
|
296
|
-
this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
|
|
297
|
-
this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
|
|
298
|
-
}
|
|
299
|
-
this.sliderInstance = new Swiper(this.nxsSliderContainer.nativeElement, this.options);
|
|
300
|
-
this.log('sliderInstance has been created', this.sliderInstance);
|
|
301
|
-
this.sliderInstance.on('slideChange', () => {
|
|
302
|
-
this.zone.run(() => {
|
|
303
|
-
this.currentSlide = this.sliderInstance.realIndex;
|
|
304
|
-
this.log("slideChange", this.currentSlide);
|
|
305
|
-
this.slideChange.next(this.currentSlide);
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
this.sliderInstance.on('click', (evt) => {
|
|
309
|
-
const target = evt.target;
|
|
310
|
-
if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
|
|
311
|
-
return;
|
|
312
|
-
this.zone.run(() => {
|
|
313
|
-
this.slideClick.next(evt);
|
|
314
|
-
if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
|
|
315
|
-
this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
this.subscribeToSlideChanged();
|
|
320
|
-
}));
|
|
321
|
-
}
|
|
322
208
|
goToSlide(index, speed) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this.sliderInstance.slideTo(index, speed);
|
|
209
|
+
var _a;
|
|
210
|
+
(_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideTo(index, speed);
|
|
326
211
|
}
|
|
327
212
|
next() {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
this.sliderInstance.slideNext();
|
|
213
|
+
var _a;
|
|
214
|
+
(_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideNext();
|
|
331
215
|
}
|
|
332
216
|
previous() {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
+
});
|
|
336
266
|
}
|
|
337
267
|
}
|
|
338
268
|
NxsCarouselComponent.decorators = [
|
|
339
269
|
{ type: Component, args: [{
|
|
340
270
|
selector: 'nxs-carousel',
|
|
341
|
-
template: "<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>",
|
|
342
272
|
encapsulation: ViewEncapsulation.None,
|
|
343
|
-
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
|
|
273
|
+
styles: ["@import \"~swiper/swiper.min.css\";@import \"~swiper/modules/navigation/navigation.min.css\";@import \"~swiper/modules/pagination/pagination.min.css\";@import \"~swiper/modules/lazy/lazy.min.css\";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}"]
|
|
344
274
|
},] }
|
|
345
275
|
];
|
|
346
276
|
NxsCarouselComponent.ctorParameters = () => [
|
|
@@ -350,12 +280,11 @@ NxsCarouselComponent.ctorParameters = () => [
|
|
|
350
280
|
{ type: NxsCarouselModuleConfig, decorators: [{ type: Optional }] }
|
|
351
281
|
];
|
|
352
282
|
NxsCarouselComponent.propDecorators = {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
283
|
+
contents: [{ type: ContentChildren, args: [NxsSwiperTemplateDirective, { read: TemplateRef },] }],
|
|
284
|
+
swiperComponent: [{ type: ViewChild, args: ['swiper', { static: false },] }],
|
|
285
|
+
lazy: [{ type: Input }],
|
|
286
|
+
images: [{ type: Input }],
|
|
357
287
|
setOptions: [{ type: Input, args: ['options',] }],
|
|
358
|
-
setImages: [{ type: Input, args: ['images',] }],
|
|
359
288
|
hasHtmlContent: [{ type: Input }],
|
|
360
289
|
slideChange: [{ type: Output }],
|
|
361
290
|
slideClick: [{ type: Output }]
|
|
@@ -376,16 +305,18 @@ NxsCarouselModule.decorators = [
|
|
|
376
305
|
declarations: [
|
|
377
306
|
NxsCarouselComponent,
|
|
378
307
|
NxsCarouselDialogComponent,
|
|
308
|
+
NxsSwiperTemplateDirective,
|
|
379
309
|
],
|
|
380
310
|
imports: [
|
|
381
311
|
CommonModule,
|
|
382
312
|
MatIconModule,
|
|
383
313
|
MatButtonModule,
|
|
384
314
|
MatDialogModule,
|
|
385
|
-
|
|
315
|
+
SwiperModule,
|
|
386
316
|
],
|
|
387
317
|
exports: [
|
|
388
318
|
NxsCarouselComponent,
|
|
319
|
+
NxsSwiperTemplateDirective,
|
|
389
320
|
],
|
|
390
321
|
},] }
|
|
391
322
|
];
|
|
@@ -394,5 +325,5 @@ NxsCarouselModule.decorators = [
|
|
|
394
325
|
* Generated bundle index. Do not edit.
|
|
395
326
|
*/
|
|
396
327
|
|
|
397
|
-
export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig,
|
|
328
|
+
export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig, NxsSwiperTemplateDirective as ɵa, NxsCarouselDialogComponent as ɵb };
|
|
398
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 for (let i = 0; i < this.images.length; i++) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n div.style.backgroundImage = 'url(' + this.images[i].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 (let i = 0; i < this.images.length; i++) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n div.style.backgroundImage = 'url(' + this.images[i].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 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 ngOnDestroy(): void {\n if (!this.isBrowser) {\n return;\n }\n this.eventsCollector.unsubscribeAll();\n if (this.mutationObserver)\n this.mutationObserver.disconnect();\n if (this.sliderInstance)\n this.sliderInstance.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 if (this.sliderInstance)\n this.sliderInstance.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,EACxB,MAAgC;QAH5C,cAAS,GAAT,SAAS,CAAW;QACpB,SAAI,GAAJ,IAAI,CAAQ;QACS,eAAU,GAAV,UAAU,CAAK;QACxB,WAAM,GAAN,MAAM,CAA0B;QA7ChD,qBAAgB,GAA4B,IAAI,CAAC;QACzD,6BAAwB,GAAG,KAAK,CAAC;QACzB,oBAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAchD,YAAO,GAAuB,EAAE,CAAC;QAYjC,mBAAc,GAAG,KAAK,CAAC;QACvB,gBAAW,GAAW,CAAC,CAAC;QAKxB,gBAAW,GAAG,IAAI,YAAY,EAAU,CAAC;QAClC,iBAAY,GAAG,CAAC,CAAC;QAExB,eAAU,GAAG,IAAI,YAA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AMd,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,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;;;MCIzB,0BAA0B;;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t?: string;
|
|
3
4
|
src: string;
|
|
4
5
|
}
|
|
5
|
-
export interface
|
|
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?: {
|