@bigbinary/neeto-site-blocks 1.10.7 → 1.11.0-beta2
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/dist/index.cjs.js +189 -491
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +189 -491
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -17460,13 +17460,6 @@ function getWindow() {
|
|
|
17460
17460
|
return win;
|
|
17461
17461
|
}
|
|
17462
17462
|
|
|
17463
|
-
function classesToTokens(classes) {
|
|
17464
|
-
if (classes === void 0) {
|
|
17465
|
-
classes = '';
|
|
17466
|
-
}
|
|
17467
|
-
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
17468
|
-
}
|
|
17469
|
-
|
|
17470
17463
|
function deleteProps(obj) {
|
|
17471
17464
|
const object = obj;
|
|
17472
17465
|
Object.keys(object).forEach(key => {
|
|
@@ -17643,20 +17636,12 @@ function elementChildren(element, selector) {
|
|
|
17643
17636
|
}
|
|
17644
17637
|
return [...element.children].filter(el => el.matches(selector));
|
|
17645
17638
|
}
|
|
17646
|
-
function showWarning(text) {
|
|
17647
|
-
try {
|
|
17648
|
-
console.warn(text);
|
|
17649
|
-
return;
|
|
17650
|
-
} catch (err) {
|
|
17651
|
-
// err
|
|
17652
|
-
}
|
|
17653
|
-
}
|
|
17654
17639
|
function createElement(tag, classes) {
|
|
17655
17640
|
if (classes === void 0) {
|
|
17656
17641
|
classes = [];
|
|
17657
17642
|
}
|
|
17658
17643
|
const el = document.createElement(tag);
|
|
17659
|
-
el.classList.add(...(Array.isArray(classes) ? classes :
|
|
17644
|
+
el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
|
|
17660
17645
|
return el;
|
|
17661
17646
|
}
|
|
17662
17647
|
function elementOffset(el) {
|
|
@@ -17805,7 +17790,6 @@ function getDevice(overrides) {
|
|
|
17805
17790
|
let browser$1;
|
|
17806
17791
|
function calcBrowser() {
|
|
17807
17792
|
const window = getWindow();
|
|
17808
|
-
const device = getDevice();
|
|
17809
17793
|
let needPerspectiveFix = false;
|
|
17810
17794
|
function isSafari() {
|
|
17811
17795
|
const ua = window.navigator.userAgent.toLowerCase();
|
|
@@ -17818,14 +17802,10 @@ function calcBrowser() {
|
|
|
17818
17802
|
needPerspectiveFix = major < 16 || major === 16 && minor < 2;
|
|
17819
17803
|
}
|
|
17820
17804
|
}
|
|
17821
|
-
const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent);
|
|
17822
|
-
const isSafariBrowser = isSafari();
|
|
17823
|
-
const need3dFix = isSafariBrowser || isWebView && device.ios;
|
|
17824
17805
|
return {
|
|
17825
|
-
isSafari: needPerspectiveFix ||
|
|
17806
|
+
isSafari: needPerspectiveFix || isSafari(),
|
|
17826
17807
|
needPerspectiveFix,
|
|
17827
|
-
|
|
17828
|
-
isWebView
|
|
17808
|
+
isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
|
|
17829
17809
|
};
|
|
17830
17810
|
}
|
|
17831
17811
|
function getBrowser() {
|
|
@@ -18114,8 +18094,24 @@ function updateSize() {
|
|
|
18114
18094
|
|
|
18115
18095
|
function updateSlides() {
|
|
18116
18096
|
const swiper = this;
|
|
18097
|
+
function getDirectionLabel(property) {
|
|
18098
|
+
if (swiper.isHorizontal()) {
|
|
18099
|
+
return property;
|
|
18100
|
+
}
|
|
18101
|
+
// prettier-ignore
|
|
18102
|
+
return {
|
|
18103
|
+
'width': 'height',
|
|
18104
|
+
'margin-top': 'margin-left',
|
|
18105
|
+
'margin-bottom ': 'margin-right',
|
|
18106
|
+
'margin-left': 'margin-top',
|
|
18107
|
+
'margin-right': 'margin-bottom',
|
|
18108
|
+
'padding-left': 'padding-top',
|
|
18109
|
+
'padding-right': 'padding-bottom',
|
|
18110
|
+
'marginRight': 'marginBottom'
|
|
18111
|
+
}[property];
|
|
18112
|
+
}
|
|
18117
18113
|
function getDirectionPropertyValue(node, label) {
|
|
18118
|
-
return parseFloat(node.getPropertyValue(
|
|
18114
|
+
return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
|
|
18119
18115
|
}
|
|
18120
18116
|
const params = swiper.params;
|
|
18121
18117
|
const {
|
|
@@ -18174,9 +18170,7 @@ function updateSlides() {
|
|
|
18174
18170
|
}
|
|
18175
18171
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
18176
18172
|
if (gridEnabled) {
|
|
18177
|
-
swiper.grid.initSlides(
|
|
18178
|
-
} else if (swiper.grid) {
|
|
18179
|
-
swiper.grid.unsetSlides();
|
|
18173
|
+
swiper.grid.initSlides(slidesLength);
|
|
18180
18174
|
}
|
|
18181
18175
|
|
|
18182
18176
|
// Calc slides
|
|
@@ -18189,13 +18183,13 @@ function updateSlides() {
|
|
|
18189
18183
|
let slide;
|
|
18190
18184
|
if (slides[i]) slide = slides[i];
|
|
18191
18185
|
if (gridEnabled) {
|
|
18192
|
-
swiper.grid.updateSlide(i, slide,
|
|
18186
|
+
swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
|
|
18193
18187
|
}
|
|
18194
18188
|
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
18195
18189
|
|
|
18196
18190
|
if (params.slidesPerView === 'auto') {
|
|
18197
18191
|
if (shouldResetSlideSize) {
|
|
18198
|
-
slides[i].style[
|
|
18192
|
+
slides[i].style[getDirectionLabel('width')] = ``;
|
|
18199
18193
|
}
|
|
18200
18194
|
const slideStyles = getComputedStyle(slide);
|
|
18201
18195
|
const currentTransform = slide.style.transform;
|
|
@@ -18237,7 +18231,7 @@ function updateSlides() {
|
|
|
18237
18231
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
18238
18232
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
18239
18233
|
if (slides[i]) {
|
|
18240
|
-
slides[i].style[
|
|
18234
|
+
slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
|
|
18241
18235
|
}
|
|
18242
18236
|
}
|
|
18243
18237
|
if (slides[i]) {
|
|
@@ -18267,10 +18261,10 @@ function updateSlides() {
|
|
|
18267
18261
|
wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
|
|
18268
18262
|
}
|
|
18269
18263
|
if (params.setWrapperSize) {
|
|
18270
|
-
wrapperEl.style[
|
|
18264
|
+
wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
|
|
18271
18265
|
}
|
|
18272
18266
|
if (gridEnabled) {
|
|
18273
|
-
swiper.grid.updateWrapperSize(slideSize, snapGrid);
|
|
18267
|
+
swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
|
|
18274
18268
|
}
|
|
18275
18269
|
|
|
18276
18270
|
// Remove last grid elements depending on width
|
|
@@ -18307,7 +18301,7 @@ function updateSlides() {
|
|
|
18307
18301
|
}
|
|
18308
18302
|
if (snapGrid.length === 0) snapGrid = [0];
|
|
18309
18303
|
if (spaceBetween !== 0) {
|
|
18310
|
-
const key = swiper.isHorizontal() && rtl ? 'marginLeft' :
|
|
18304
|
+
const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
|
|
18311
18305
|
slides.filter((_, slideIndex) => {
|
|
18312
18306
|
if (!params.cssMode || params.loop) return true;
|
|
18313
18307
|
if (slideIndex === slides.length - 1) {
|
|
@@ -18337,9 +18331,8 @@ function updateSlides() {
|
|
|
18337
18331
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
18338
18332
|
});
|
|
18339
18333
|
allSlidesSize -= spaceBetween;
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
18334
|
+
if (allSlidesSize < swiperSize) {
|
|
18335
|
+
const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
|
18343
18336
|
snapGrid.forEach((snap, snapIndex) => {
|
|
18344
18337
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
18345
18338
|
});
|
|
@@ -18375,7 +18368,6 @@ function updateSlides() {
|
|
|
18375
18368
|
if (params.watchSlidesProgress) {
|
|
18376
18369
|
swiper.updateSlidesOffset();
|
|
18377
18370
|
}
|
|
18378
|
-
swiper.emit('slidesUpdated');
|
|
18379
18371
|
if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
|
|
18380
18372
|
const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
|
|
18381
18373
|
const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
|
|
@@ -18443,13 +18435,6 @@ function updateSlidesOffset() {
|
|
|
18443
18435
|
}
|
|
18444
18436
|
}
|
|
18445
18437
|
|
|
18446
|
-
const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
18447
|
-
if (condition && !slideEl.classList.contains(className)) {
|
|
18448
|
-
slideEl.classList.add(className);
|
|
18449
|
-
} else if (!condition && slideEl.classList.contains(className)) {
|
|
18450
|
-
slideEl.classList.remove(className);
|
|
18451
|
-
}
|
|
18452
|
-
};
|
|
18453
18438
|
function updateSlidesProgress(translate) {
|
|
18454
18439
|
if (translate === void 0) {
|
|
18455
18440
|
translate = this && this.translate || 0;
|
|
@@ -18465,6 +18450,11 @@ function updateSlidesProgress(translate) {
|
|
|
18465
18450
|
if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
|
|
18466
18451
|
let offsetCenter = -translate;
|
|
18467
18452
|
if (rtl) offsetCenter = translate;
|
|
18453
|
+
|
|
18454
|
+
// Visible Slides
|
|
18455
|
+
slides.forEach(slideEl => {
|
|
18456
|
+
slideEl.classList.remove(params.slideVisibleClass);
|
|
18457
|
+
});
|
|
18468
18458
|
swiper.visibleSlidesIndexes = [];
|
|
18469
18459
|
swiper.visibleSlides = [];
|
|
18470
18460
|
let spaceBetween = params.spaceBetween;
|
|
@@ -18483,14 +18473,12 @@ function updateSlidesProgress(translate) {
|
|
|
18483
18473
|
const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
|
|
18484
18474
|
const slideBefore = -(offsetCenter - slideOffset);
|
|
18485
18475
|
const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
|
|
18486
|
-
const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i];
|
|
18487
18476
|
const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
|
|
18488
18477
|
if (isVisible) {
|
|
18489
18478
|
swiper.visibleSlides.push(slide);
|
|
18490
18479
|
swiper.visibleSlidesIndexes.push(i);
|
|
18480
|
+
slides[i].classList.add(params.slideVisibleClass);
|
|
18491
18481
|
}
|
|
18492
|
-
toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
|
|
18493
|
-
toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
|
|
18494
18482
|
slide.progress = rtl ? -slideProgress : slideProgress;
|
|
18495
18483
|
slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
|
|
18496
18484
|
}
|
|
@@ -18559,13 +18547,6 @@ function updateProgress(translate) {
|
|
|
18559
18547
|
swiper.emit('progress', progress);
|
|
18560
18548
|
}
|
|
18561
18549
|
|
|
18562
|
-
const toggleSlideClasses = (slideEl, condition, className) => {
|
|
18563
|
-
if (condition && !slideEl.classList.contains(className)) {
|
|
18564
|
-
slideEl.classList.add(className);
|
|
18565
|
-
} else if (!condition && slideEl.classList.contains(className)) {
|
|
18566
|
-
slideEl.classList.remove(className);
|
|
18567
|
-
}
|
|
18568
|
-
};
|
|
18569
18550
|
function updateSlidesClasses() {
|
|
18570
18551
|
const swiper = this;
|
|
18571
18552
|
const {
|
|
@@ -18575,13 +18556,13 @@ function updateSlidesClasses() {
|
|
|
18575
18556
|
activeIndex
|
|
18576
18557
|
} = swiper;
|
|
18577
18558
|
const isVirtual = swiper.virtual && params.virtual.enabled;
|
|
18578
|
-
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
18579
18559
|
const getFilteredSlide = selector => {
|
|
18580
18560
|
return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
|
|
18581
18561
|
};
|
|
18562
|
+
slides.forEach(slideEl => {
|
|
18563
|
+
slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
|
|
18564
|
+
});
|
|
18582
18565
|
let activeSlide;
|
|
18583
|
-
let prevSlide;
|
|
18584
|
-
let nextSlide;
|
|
18585
18566
|
if (isVirtual) {
|
|
18586
18567
|
if (params.loop) {
|
|
18587
18568
|
let slideIndex = activeIndex - swiper.virtual.slidesBefore;
|
|
@@ -18592,34 +18573,29 @@ function updateSlidesClasses() {
|
|
|
18592
18573
|
activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
|
|
18593
18574
|
}
|
|
18594
18575
|
} else {
|
|
18595
|
-
|
|
18596
|
-
activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
18597
|
-
nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0];
|
|
18598
|
-
prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0];
|
|
18599
|
-
} else {
|
|
18600
|
-
activeSlide = slides[activeIndex];
|
|
18601
|
-
}
|
|
18576
|
+
activeSlide = slides[activeIndex];
|
|
18602
18577
|
}
|
|
18603
18578
|
if (activeSlide) {
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
18607
|
-
if (params.loop && !nextSlide) {
|
|
18608
|
-
nextSlide = slides[0];
|
|
18609
|
-
}
|
|
18579
|
+
// Active classes
|
|
18580
|
+
activeSlide.classList.add(params.slideActiveClass);
|
|
18610
18581
|
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
|
|
18582
|
+
// Next Slide
|
|
18583
|
+
let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
18584
|
+
if (params.loop && !nextSlide) {
|
|
18585
|
+
nextSlide = slides[0];
|
|
18586
|
+
}
|
|
18587
|
+
if (nextSlide) {
|
|
18588
|
+
nextSlide.classList.add(params.slideNextClass);
|
|
18589
|
+
}
|
|
18590
|
+
// Prev Slide
|
|
18591
|
+
let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
18592
|
+
if (params.loop && !prevSlide === 0) {
|
|
18593
|
+
prevSlide = slides[slides.length - 1];
|
|
18594
|
+
}
|
|
18595
|
+
if (prevSlide) {
|
|
18596
|
+
prevSlide.classList.add(params.slidePrevClass);
|
|
18616
18597
|
}
|
|
18617
18598
|
}
|
|
18618
|
-
slides.forEach(slideEl => {
|
|
18619
|
-
toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
|
|
18620
|
-
toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
|
|
18621
|
-
toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
|
|
18622
|
-
});
|
|
18623
18599
|
swiper.emitSlidesClasses();
|
|
18624
18600
|
}
|
|
18625
18601
|
|
|
@@ -18742,37 +18718,22 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
18742
18718
|
snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
|
|
18743
18719
|
}
|
|
18744
18720
|
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
|
18745
|
-
if (activeIndex === previousIndex
|
|
18721
|
+
if (activeIndex === previousIndex) {
|
|
18746
18722
|
if (snapIndex !== previousSnapIndex) {
|
|
18747
18723
|
swiper.snapIndex = snapIndex;
|
|
18748
18724
|
swiper.emit('snapIndexChange');
|
|
18749
18725
|
}
|
|
18726
|
+
if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
|
|
18727
|
+
swiper.realIndex = getVirtualRealIndex(activeIndex);
|
|
18728
|
+
}
|
|
18750
18729
|
return;
|
|
18751
18730
|
}
|
|
18752
|
-
if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
|
|
18753
|
-
swiper.realIndex = getVirtualRealIndex(activeIndex);
|
|
18754
|
-
return;
|
|
18755
|
-
}
|
|
18756
|
-
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
18757
|
-
|
|
18758
18731
|
// Get real index
|
|
18759
18732
|
let realIndex;
|
|
18760
18733
|
if (swiper.virtual && params.virtual.enabled && params.loop) {
|
|
18761
18734
|
realIndex = getVirtualRealIndex(activeIndex);
|
|
18762
|
-
} else if (gridEnabled) {
|
|
18763
|
-
const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
18764
|
-
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
18765
|
-
if (Number.isNaN(activeSlideIndex)) {
|
|
18766
|
-
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
18767
|
-
}
|
|
18768
|
-
realIndex = Math.floor(activeSlideIndex / params.grid.rows);
|
|
18769
18735
|
} else if (swiper.slides[activeIndex]) {
|
|
18770
|
-
|
|
18771
|
-
if (slideIndex) {
|
|
18772
|
-
realIndex = parseInt(slideIndex, 10);
|
|
18773
|
-
} else {
|
|
18774
|
-
realIndex = activeIndex;
|
|
18775
|
-
}
|
|
18736
|
+
realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10);
|
|
18776
18737
|
} else {
|
|
18777
18738
|
realIndex = activeIndex;
|
|
18778
18739
|
}
|
|
@@ -18997,7 +18958,6 @@ function translateTo(translate, speed, runCallbacks, translateBounds, internal)
|
|
|
18997
18958
|
swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
|
18998
18959
|
swiper.onTranslateToWrapperTransitionEnd = null;
|
|
18999
18960
|
delete swiper.onTranslateToWrapperTransitionEnd;
|
|
19000
|
-
swiper.animating = false;
|
|
19001
18961
|
if (runCallbacks) {
|
|
19002
18962
|
swiper.emit('transitionEnd');
|
|
19003
18963
|
}
|
|
@@ -19105,6 +19065,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
19105
19065
|
if (index === void 0) {
|
|
19106
19066
|
index = 0;
|
|
19107
19067
|
}
|
|
19068
|
+
if (speed === void 0) {
|
|
19069
|
+
speed = this.params.speed;
|
|
19070
|
+
}
|
|
19108
19071
|
if (runCallbacks === void 0) {
|
|
19109
19072
|
runCallbacks = true;
|
|
19110
19073
|
}
|
|
@@ -19124,12 +19087,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
19124
19087
|
wrapperEl,
|
|
19125
19088
|
enabled
|
|
19126
19089
|
} = swiper;
|
|
19127
|
-
if (!enabled && !internal && !initial
|
|
19090
|
+
if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
|
|
19128
19091
|
return false;
|
|
19129
19092
|
}
|
|
19130
|
-
if (typeof speed === 'undefined') {
|
|
19131
|
-
speed = swiper.params.speed;
|
|
19132
|
-
}
|
|
19133
19093
|
const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
|
19134
19094
|
let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
|
19135
19095
|
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
|
@@ -19256,6 +19216,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
19256
19216
|
if (index === void 0) {
|
|
19257
19217
|
index = 0;
|
|
19258
19218
|
}
|
|
19219
|
+
if (speed === void 0) {
|
|
19220
|
+
speed = this.params.speed;
|
|
19221
|
+
}
|
|
19259
19222
|
if (runCallbacks === void 0) {
|
|
19260
19223
|
runCallbacks = true;
|
|
19261
19224
|
}
|
|
@@ -19264,69 +19227,23 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
19264
19227
|
index = indexAsNumber;
|
|
19265
19228
|
}
|
|
19266
19229
|
const swiper = this;
|
|
19267
|
-
if (swiper.destroyed) return;
|
|
19268
|
-
if (typeof speed === 'undefined') {
|
|
19269
|
-
speed = swiper.params.speed;
|
|
19270
|
-
}
|
|
19271
|
-
const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
19272
19230
|
let newIndex = index;
|
|
19273
19231
|
if (swiper.params.loop) {
|
|
19274
19232
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
|
19275
19233
|
// eslint-disable-next-line
|
|
19276
19234
|
newIndex = newIndex + swiper.virtual.slidesBefore;
|
|
19277
19235
|
} else {
|
|
19278
|
-
|
|
19279
|
-
if (gridEnabled) {
|
|
19280
|
-
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
19281
|
-
targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
19282
|
-
} else {
|
|
19283
|
-
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
19284
|
-
}
|
|
19285
|
-
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
19286
|
-
const {
|
|
19287
|
-
centeredSlides
|
|
19288
|
-
} = swiper.params;
|
|
19289
|
-
let slidesPerView = swiper.params.slidesPerView;
|
|
19290
|
-
if (slidesPerView === 'auto') {
|
|
19291
|
-
slidesPerView = swiper.slidesPerViewDynamic();
|
|
19292
|
-
} else {
|
|
19293
|
-
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
19294
|
-
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
19295
|
-
slidesPerView = slidesPerView + 1;
|
|
19296
|
-
}
|
|
19297
|
-
}
|
|
19298
|
-
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
19299
|
-
if (centeredSlides) {
|
|
19300
|
-
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
19301
|
-
}
|
|
19302
|
-
if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
19303
|
-
needLoopFix = false;
|
|
19304
|
-
}
|
|
19305
|
-
if (needLoopFix) {
|
|
19306
|
-
const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
19307
|
-
swiper.loopFix({
|
|
19308
|
-
direction,
|
|
19309
|
-
slideTo: true,
|
|
19310
|
-
activeSlideIndex: direction === 'next' ? targetSlideIndex + 1 : targetSlideIndex - cols + 1,
|
|
19311
|
-
slideRealIndex: direction === 'next' ? swiper.realIndex : undefined
|
|
19312
|
-
});
|
|
19313
|
-
}
|
|
19314
|
-
if (gridEnabled) {
|
|
19315
|
-
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
19316
|
-
newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
19317
|
-
} else {
|
|
19318
|
-
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
19319
|
-
}
|
|
19236
|
+
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
19320
19237
|
}
|
|
19321
19238
|
}
|
|
19322
|
-
|
|
19323
|
-
swiper.slideTo(newIndex, speed, runCallbacks, internal);
|
|
19324
|
-
});
|
|
19325
|
-
return swiper;
|
|
19239
|
+
return swiper.slideTo(newIndex, speed, runCallbacks, internal);
|
|
19326
19240
|
}
|
|
19327
19241
|
|
|
19328
19242
|
/* eslint no-unused-vars: "off" */
|
|
19329
19243
|
function slideNext(speed, runCallbacks, internal) {
|
|
19244
|
+
if (speed === void 0) {
|
|
19245
|
+
speed = this.params.speed;
|
|
19246
|
+
}
|
|
19330
19247
|
if (runCallbacks === void 0) {
|
|
19331
19248
|
runCallbacks = true;
|
|
19332
19249
|
}
|
|
@@ -19336,10 +19253,7 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
19336
19253
|
params,
|
|
19337
19254
|
animating
|
|
19338
19255
|
} = swiper;
|
|
19339
|
-
if (!enabled
|
|
19340
|
-
if (typeof speed === 'undefined') {
|
|
19341
|
-
speed = swiper.params.speed;
|
|
19342
|
-
}
|
|
19256
|
+
if (!enabled) return swiper;
|
|
19343
19257
|
let perGroup = params.slidesPerGroup;
|
|
19344
19258
|
if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
|
|
19345
19259
|
perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
|
|
@@ -19355,7 +19269,7 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
19355
19269
|
swiper._clientLeft = swiper.wrapperEl.clientLeft;
|
|
19356
19270
|
if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {
|
|
19357
19271
|
requestAnimationFrame(() => {
|
|
19358
|
-
swiper.slideTo(swiper.activeIndex + increment
|
|
19272
|
+
swiper.slideTo(swiper.activeIndex + increment);
|
|
19359
19273
|
});
|
|
19360
19274
|
return true;
|
|
19361
19275
|
}
|
|
@@ -19363,11 +19277,14 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
19363
19277
|
if (params.rewind && swiper.isEnd) {
|
|
19364
19278
|
return swiper.slideTo(0, speed, runCallbacks, internal);
|
|
19365
19279
|
}
|
|
19366
|
-
return swiper.slideTo(swiper.activeIndex + increment
|
|
19280
|
+
return swiper.slideTo(swiper.activeIndex + increment);
|
|
19367
19281
|
}
|
|
19368
19282
|
|
|
19369
19283
|
/* eslint no-unused-vars: "off" */
|
|
19370
19284
|
function slidePrev(speed, runCallbacks, internal) {
|
|
19285
|
+
if (speed === void 0) {
|
|
19286
|
+
speed = this.params.speed;
|
|
19287
|
+
}
|
|
19371
19288
|
if (runCallbacks === void 0) {
|
|
19372
19289
|
runCallbacks = true;
|
|
19373
19290
|
}
|
|
@@ -19380,10 +19297,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
19380
19297
|
enabled,
|
|
19381
19298
|
animating
|
|
19382
19299
|
} = swiper;
|
|
19383
|
-
if (!enabled
|
|
19384
|
-
if (typeof speed === 'undefined') {
|
|
19385
|
-
speed = swiper.params.speed;
|
|
19386
|
-
}
|
|
19300
|
+
if (!enabled) return swiper;
|
|
19387
19301
|
const isVirtual = swiper.virtual && params.virtual.enabled;
|
|
19388
19302
|
if (params.loop) {
|
|
19389
19303
|
if (animating && !isVirtual && params.loopPreventsSliding) return false;
|
|
@@ -19436,19 +19350,21 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
19436
19350
|
|
|
19437
19351
|
/* eslint no-unused-vars: "off" */
|
|
19438
19352
|
function slideReset(speed, runCallbacks, internal) {
|
|
19353
|
+
if (speed === void 0) {
|
|
19354
|
+
speed = this.params.speed;
|
|
19355
|
+
}
|
|
19439
19356
|
if (runCallbacks === void 0) {
|
|
19440
19357
|
runCallbacks = true;
|
|
19441
19358
|
}
|
|
19442
19359
|
const swiper = this;
|
|
19443
|
-
if (swiper.destroyed) return;
|
|
19444
|
-
if (typeof speed === 'undefined') {
|
|
19445
|
-
speed = swiper.params.speed;
|
|
19446
|
-
}
|
|
19447
19360
|
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
|
|
19448
19361
|
}
|
|
19449
19362
|
|
|
19450
19363
|
/* eslint no-unused-vars: "off" */
|
|
19451
19364
|
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
19365
|
+
if (speed === void 0) {
|
|
19366
|
+
speed = this.params.speed;
|
|
19367
|
+
}
|
|
19452
19368
|
if (runCallbacks === void 0) {
|
|
19453
19369
|
runCallbacks = true;
|
|
19454
19370
|
}
|
|
@@ -19456,10 +19372,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
|
19456
19372
|
threshold = 0.5;
|
|
19457
19373
|
}
|
|
19458
19374
|
const swiper = this;
|
|
19459
|
-
if (swiper.destroyed) return;
|
|
19460
|
-
if (typeof speed === 'undefined') {
|
|
19461
|
-
speed = swiper.params.speed;
|
|
19462
|
-
}
|
|
19463
19375
|
let index = swiper.activeIndex;
|
|
19464
19376
|
const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
|
|
19465
19377
|
const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
|
|
@@ -19488,7 +19400,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
|
19488
19400
|
|
|
19489
19401
|
function slideToClickedSlide() {
|
|
19490
19402
|
const swiper = this;
|
|
19491
|
-
if (swiper.destroyed) return;
|
|
19492
19403
|
const {
|
|
19493
19404
|
params,
|
|
19494
19405
|
slidesEl
|
|
@@ -19541,45 +19452,10 @@ function loopCreate(slideRealIndex) {
|
|
|
19541
19452
|
slidesEl
|
|
19542
19453
|
} = swiper;
|
|
19543
19454
|
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
19544
|
-
const
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
});
|
|
19549
|
-
};
|
|
19550
|
-
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
19551
|
-
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
19552
|
-
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
19553
|
-
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
19554
|
-
const addBlankSlides = amountOfSlides => {
|
|
19555
|
-
for (let i = 0; i < amountOfSlides; i += 1) {
|
|
19556
|
-
const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]);
|
|
19557
|
-
swiper.slidesEl.append(slideEl);
|
|
19558
|
-
}
|
|
19559
|
-
};
|
|
19560
|
-
if (shouldFillGroup) {
|
|
19561
|
-
if (params.loopAddBlankSlides) {
|
|
19562
|
-
const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup;
|
|
19563
|
-
addBlankSlides(slidesToAdd);
|
|
19564
|
-
swiper.recalcSlides();
|
|
19565
|
-
swiper.updateSlides();
|
|
19566
|
-
} else {
|
|
19567
|
-
showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
19568
|
-
}
|
|
19569
|
-
initSlides();
|
|
19570
|
-
} else if (shouldFillGrid) {
|
|
19571
|
-
if (params.loopAddBlankSlides) {
|
|
19572
|
-
const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows;
|
|
19573
|
-
addBlankSlides(slidesToAdd);
|
|
19574
|
-
swiper.recalcSlides();
|
|
19575
|
-
swiper.updateSlides();
|
|
19576
|
-
} else {
|
|
19577
|
-
showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
19578
|
-
}
|
|
19579
|
-
initSlides();
|
|
19580
|
-
} else {
|
|
19581
|
-
initSlides();
|
|
19582
|
-
}
|
|
19455
|
+
const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
19456
|
+
slides.forEach((el, index) => {
|
|
19457
|
+
el.setAttribute('data-swiper-slide-index', index);
|
|
19458
|
+
});
|
|
19583
19459
|
swiper.loopFix({
|
|
19584
19460
|
slideRealIndex,
|
|
19585
19461
|
direction: params.centeredSlides ? undefined : 'next'
|
|
@@ -19606,9 +19482,6 @@ function loopFix(_temp) {
|
|
|
19606
19482
|
slidesEl,
|
|
19607
19483
|
params
|
|
19608
19484
|
} = swiper;
|
|
19609
|
-
const {
|
|
19610
|
-
centeredSlides
|
|
19611
|
-
} = params;
|
|
19612
19485
|
swiper.allowSlidePrev = true;
|
|
19613
19486
|
swiper.allowSlideNext = true;
|
|
19614
19487
|
if (swiper.virtual && params.virtual.enabled) {
|
|
@@ -19626,33 +19499,17 @@ function loopFix(_temp) {
|
|
|
19626
19499
|
swiper.emit('loopFix');
|
|
19627
19500
|
return;
|
|
19628
19501
|
}
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
19634
|
-
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
19635
|
-
slidesPerView = slidesPerView + 1;
|
|
19636
|
-
}
|
|
19637
|
-
}
|
|
19638
|
-
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
19639
|
-
let loopedSlides = slidesPerGroup;
|
|
19640
|
-
if (loopedSlides % slidesPerGroup !== 0) {
|
|
19641
|
-
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
19502
|
+
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
19503
|
+
let loopedSlides = params.loopedSlides || slidesPerView;
|
|
19504
|
+
if (loopedSlides % params.slidesPerGroup !== 0) {
|
|
19505
|
+
loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
|
|
19642
19506
|
}
|
|
19643
|
-
loopedSlides += params.loopAdditionalSlides;
|
|
19644
19507
|
swiper.loopedSlides = loopedSlides;
|
|
19645
|
-
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
19646
|
-
if (slides.length < slidesPerView + loopedSlides) {
|
|
19647
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
|
|
19648
|
-
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
19649
|
-
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
19650
|
-
}
|
|
19651
19508
|
const prependSlidesIndexes = [];
|
|
19652
19509
|
const appendSlidesIndexes = [];
|
|
19653
19510
|
let activeIndex = swiper.activeIndex;
|
|
19654
19511
|
if (typeof activeSlideIndex === 'undefined') {
|
|
19655
|
-
activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
|
|
19512
|
+
activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
|
|
19656
19513
|
} else {
|
|
19657
19514
|
activeIndex = activeSlideIndex;
|
|
19658
19515
|
}
|
|
@@ -19660,64 +19517,37 @@ function loopFix(_temp) {
|
|
|
19660
19517
|
const isPrev = direction === 'prev' || !direction;
|
|
19661
19518
|
let slidesPrepended = 0;
|
|
19662
19519
|
let slidesAppended = 0;
|
|
19663
|
-
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
19664
|
-
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
19665
|
-
const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
19666
19520
|
// prepend last slides before start
|
|
19667
|
-
if (
|
|
19668
|
-
slidesPrepended = Math.max(loopedSlides -
|
|
19669
|
-
for (let i = 0; i < loopedSlides -
|
|
19670
|
-
const index = i - Math.floor(i /
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
}
|
|
19676
|
-
// slides.forEach((slide, slideIndex) => {
|
|
19677
|
-
// if (slide.column === colIndexToPrepend) prependSlidesIndexes.push(slideIndex);
|
|
19678
|
-
// });
|
|
19679
|
-
} else {
|
|
19680
|
-
prependSlidesIndexes.push(cols - index - 1);
|
|
19681
|
-
}
|
|
19682
|
-
}
|
|
19683
|
-
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
19684
|
-
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
19521
|
+
if (activeSlideIndex < loopedSlides) {
|
|
19522
|
+
slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
|
|
19523
|
+
for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
|
|
19524
|
+
const index = i - Math.floor(i / slides.length) * slides.length;
|
|
19525
|
+
prependSlidesIndexes.push(slides.length - index - 1);
|
|
19526
|
+
}
|
|
19527
|
+
} else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) {
|
|
19528
|
+
slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
|
|
19685
19529
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
19686
|
-
const index = i - Math.floor(i /
|
|
19687
|
-
|
|
19688
|
-
slides.forEach((slide, slideIndex) => {
|
|
19689
|
-
if (slide.column === index) appendSlidesIndexes.push(slideIndex);
|
|
19690
|
-
});
|
|
19691
|
-
} else {
|
|
19692
|
-
appendSlidesIndexes.push(index);
|
|
19693
|
-
}
|
|
19530
|
+
const index = i - Math.floor(i / slides.length) * slides.length;
|
|
19531
|
+
appendSlidesIndexes.push(index);
|
|
19694
19532
|
}
|
|
19695
19533
|
}
|
|
19696
|
-
swiper.__preventObserver__ = true;
|
|
19697
|
-
requestAnimationFrame(() => {
|
|
19698
|
-
swiper.__preventObserver__ = false;
|
|
19699
|
-
});
|
|
19700
19534
|
if (isPrev) {
|
|
19701
19535
|
prependSlidesIndexes.forEach(index => {
|
|
19702
|
-
slides[index].swiperLoopMoveDOM = true;
|
|
19703
|
-
slidesEl.prepend(slides[index]);
|
|
19704
|
-
slides[index].swiperLoopMoveDOM = false;
|
|
19536
|
+
swiper.slides[index].swiperLoopMoveDOM = true;
|
|
19537
|
+
slidesEl.prepend(swiper.slides[index]);
|
|
19538
|
+
swiper.slides[index].swiperLoopMoveDOM = false;
|
|
19705
19539
|
});
|
|
19706
19540
|
}
|
|
19707
19541
|
if (isNext) {
|
|
19708
19542
|
appendSlidesIndexes.forEach(index => {
|
|
19709
|
-
slides[index].swiperLoopMoveDOM = true;
|
|
19710
|
-
slidesEl.append(slides[index]);
|
|
19711
|
-
slides[index].swiperLoopMoveDOM = false;
|
|
19543
|
+
swiper.slides[index].swiperLoopMoveDOM = true;
|
|
19544
|
+
slidesEl.append(swiper.slides[index]);
|
|
19545
|
+
swiper.slides[index].swiperLoopMoveDOM = false;
|
|
19712
19546
|
});
|
|
19713
19547
|
}
|
|
19714
19548
|
swiper.recalcSlides();
|
|
19715
19549
|
if (params.slidesPerView === 'auto') {
|
|
19716
19550
|
swiper.updateSlides();
|
|
19717
|
-
} else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) {
|
|
19718
|
-
swiper.slides.forEach((slide, slideIndex) => {
|
|
19719
|
-
swiper.grid.updateSlide(slideIndex, slide, swiper.slides);
|
|
19720
|
-
});
|
|
19721
19551
|
}
|
|
19722
19552
|
if (params.watchSlidesProgress) {
|
|
19723
19553
|
swiper.updateSlidesOffset();
|
|
@@ -19731,16 +19561,15 @@ function loopFix(_temp) {
|
|
|
19731
19561
|
if (byMousewheel) {
|
|
19732
19562
|
swiper.setTranslate(swiper.translate - diff);
|
|
19733
19563
|
} else {
|
|
19734
|
-
swiper.slideTo(activeIndex +
|
|
19564
|
+
swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
|
|
19735
19565
|
if (setTranslate) {
|
|
19736
|
-
swiper.
|
|
19737
|
-
swiper.touchEventsData.currentTranslate = swiper.
|
|
19566
|
+
swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
|
|
19567
|
+
swiper.touchEventsData.currentTranslate = swiper.translate;
|
|
19738
19568
|
}
|
|
19739
19569
|
}
|
|
19740
19570
|
} else {
|
|
19741
19571
|
if (setTranslate) {
|
|
19742
|
-
|
|
19743
|
-
swiper.slideTo(swiper.activeIndex + shift, 0, false, true);
|
|
19572
|
+
swiper.slideToLoop(slideRealIndex, 0, false, true);
|
|
19744
19573
|
swiper.touchEventsData.currentTranslate = swiper.translate;
|
|
19745
19574
|
}
|
|
19746
19575
|
}
|
|
@@ -19754,13 +19583,12 @@ function loopFix(_temp) {
|
|
|
19754
19583
|
} else {
|
|
19755
19584
|
swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
|
|
19756
19585
|
if (setTranslate) {
|
|
19757
|
-
swiper.
|
|
19758
|
-
swiper.touchEventsData.currentTranslate = swiper.
|
|
19586
|
+
swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
|
|
19587
|
+
swiper.touchEventsData.currentTranslate = swiper.translate;
|
|
19759
19588
|
}
|
|
19760
19589
|
}
|
|
19761
19590
|
} else {
|
|
19762
|
-
|
|
19763
|
-
swiper.slideTo(swiper.activeIndex - shift, 0, false, true);
|
|
19591
|
+
swiper.slideToLoop(slideRealIndex, 0, false, true);
|
|
19764
19592
|
}
|
|
19765
19593
|
}
|
|
19766
19594
|
}
|
|
@@ -19873,54 +19701,27 @@ function closestElement(selector, base) {
|
|
|
19873
19701
|
}
|
|
19874
19702
|
return __closestFrom(base);
|
|
19875
19703
|
}
|
|
19876
|
-
function preventEdgeSwipe(swiper, event, startX) {
|
|
19877
|
-
const window = getWindow();
|
|
19878
|
-
const {
|
|
19879
|
-
params
|
|
19880
|
-
} = swiper;
|
|
19881
|
-
const edgeSwipeDetection = params.edgeSwipeDetection;
|
|
19882
|
-
const edgeSwipeThreshold = params.edgeSwipeThreshold;
|
|
19883
|
-
if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
|
|
19884
|
-
if (edgeSwipeDetection === 'prevent') {
|
|
19885
|
-
event.preventDefault();
|
|
19886
|
-
return true;
|
|
19887
|
-
}
|
|
19888
|
-
return false;
|
|
19889
|
-
}
|
|
19890
|
-
return true;
|
|
19891
|
-
}
|
|
19892
19704
|
function onTouchStart(event) {
|
|
19893
19705
|
const swiper = this;
|
|
19894
19706
|
const document = getDocument();
|
|
19895
|
-
|
|
19896
|
-
if (e.originalEvent) e = e.originalEvent;
|
|
19707
|
+
const window = getWindow();
|
|
19897
19708
|
const data = swiper.touchEventsData;
|
|
19898
|
-
|
|
19899
|
-
if (data.pointerId !== null && data.pointerId !== e.pointerId) {
|
|
19900
|
-
return;
|
|
19901
|
-
}
|
|
19902
|
-
data.pointerId = e.pointerId;
|
|
19903
|
-
} else if (e.type === 'touchstart' && e.targetTouches.length === 1) {
|
|
19904
|
-
data.touchId = e.targetTouches[0].identifier;
|
|
19905
|
-
}
|
|
19906
|
-
if (e.type === 'touchstart') {
|
|
19907
|
-
// don't proceed touch event
|
|
19908
|
-
preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);
|
|
19909
|
-
return;
|
|
19910
|
-
}
|
|
19709
|
+
data.evCache.push(event);
|
|
19911
19710
|
const {
|
|
19912
19711
|
params,
|
|
19913
19712
|
touches,
|
|
19914
19713
|
enabled
|
|
19915
19714
|
} = swiper;
|
|
19916
19715
|
if (!enabled) return;
|
|
19917
|
-
if (!params.simulateTouch &&
|
|
19716
|
+
if (!params.simulateTouch && event.pointerType === 'mouse') return;
|
|
19918
19717
|
if (swiper.animating && params.preventInteractionOnTransition) {
|
|
19919
19718
|
return;
|
|
19920
19719
|
}
|
|
19921
19720
|
if (!swiper.animating && params.cssMode && params.loop) {
|
|
19922
19721
|
swiper.loopFix();
|
|
19923
19722
|
}
|
|
19723
|
+
let e = event;
|
|
19724
|
+
if (e.originalEvent) e = e.originalEvent;
|
|
19924
19725
|
let targetEl = e.target;
|
|
19925
19726
|
if (params.touchEventsTarget === 'wrapper') {
|
|
19926
19727
|
if (!swiper.wrapperEl.contains(targetEl)) return;
|
|
@@ -19932,7 +19733,7 @@ function onTouchStart(event) {
|
|
|
19932
19733
|
// change target el for shadow root component
|
|
19933
19734
|
const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
|
|
19934
19735
|
// eslint-disable-next-line
|
|
19935
|
-
const eventPath =
|
|
19736
|
+
const eventPath = event.composedPath ? event.composedPath() : event.path;
|
|
19936
19737
|
if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
|
|
19937
19738
|
targetEl = eventPath[0];
|
|
19938
19739
|
}
|
|
@@ -19954,8 +19755,14 @@ function onTouchStart(event) {
|
|
|
19954
19755
|
|
|
19955
19756
|
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
|
|
19956
19757
|
|
|
19957
|
-
|
|
19958
|
-
|
|
19758
|
+
const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
|
|
19759
|
+
const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
|
|
19760
|
+
if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
|
|
19761
|
+
if (edgeSwipeDetection === 'prevent') {
|
|
19762
|
+
event.preventDefault();
|
|
19763
|
+
} else {
|
|
19764
|
+
return;
|
|
19765
|
+
}
|
|
19959
19766
|
}
|
|
19960
19767
|
Object.assign(data, {
|
|
19961
19768
|
isTouched: true,
|
|
@@ -20005,24 +19812,15 @@ function onTouchMove(event) {
|
|
|
20005
19812
|
if (!params.simulateTouch && event.pointerType === 'mouse') return;
|
|
20006
19813
|
let e = event;
|
|
20007
19814
|
if (e.originalEvent) e = e.originalEvent;
|
|
20008
|
-
if (e.type === 'pointermove') {
|
|
20009
|
-
if (data.touchId !== null) return; // return from pointer if we use touch
|
|
20010
|
-
const id = e.pointerId;
|
|
20011
|
-
if (id !== data.pointerId) return;
|
|
20012
|
-
}
|
|
20013
|
-
let targetTouch;
|
|
20014
|
-
if (e.type === 'touchmove') {
|
|
20015
|
-
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
20016
|
-
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
20017
|
-
} else {
|
|
20018
|
-
targetTouch = e;
|
|
20019
|
-
}
|
|
20020
19815
|
if (!data.isTouched) {
|
|
20021
19816
|
if (data.startMoving && data.isScrolling) {
|
|
20022
19817
|
swiper.emit('touchMoveOpposite', e);
|
|
20023
19818
|
}
|
|
20024
19819
|
return;
|
|
20025
19820
|
}
|
|
19821
|
+
const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
|
|
19822
|
+
if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
|
|
19823
|
+
const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
|
|
20026
19824
|
const pageX = targetTouch.pageX;
|
|
20027
19825
|
const pageY = targetTouch.pageY;
|
|
20028
19826
|
if (e.preventedByNestedSwiper) {
|
|
@@ -20038,6 +19836,8 @@ function onTouchMove(event) {
|
|
|
20038
19836
|
Object.assign(touches, {
|
|
20039
19837
|
startX: pageX,
|
|
20040
19838
|
startY: pageY,
|
|
19839
|
+
prevX: swiper.touches.currentX,
|
|
19840
|
+
prevY: swiper.touches.currentY,
|
|
20041
19841
|
currentX: pageX,
|
|
20042
19842
|
currentY: pageY
|
|
20043
19843
|
});
|
|
@@ -20067,8 +19867,7 @@ function onTouchMove(event) {
|
|
|
20067
19867
|
if (data.allowTouchCallbacks) {
|
|
20068
19868
|
swiper.emit('touchMove', e);
|
|
20069
19869
|
}
|
|
20070
|
-
|
|
20071
|
-
touches.previousY = touches.currentY;
|
|
19870
|
+
if (e.targetTouches && e.targetTouches.length > 1) return;
|
|
20072
19871
|
touches.currentX = pageX;
|
|
20073
19872
|
touches.currentY = pageY;
|
|
20074
19873
|
const diffX = touches.currentX - touches.startX;
|
|
@@ -20094,7 +19893,7 @@ function onTouchMove(event) {
|
|
|
20094
19893
|
data.startMoving = true;
|
|
20095
19894
|
}
|
|
20096
19895
|
}
|
|
20097
|
-
if (data.isScrolling ||
|
|
19896
|
+
if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
|
|
20098
19897
|
data.isTouched = false;
|
|
20099
19898
|
return;
|
|
20100
19899
|
}
|
|
@@ -20124,7 +19923,7 @@ function onTouchMove(event) {
|
|
|
20124
19923
|
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
|
20125
19924
|
swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
|
|
20126
19925
|
const isLoop = swiper.params.loop && !params.cssMode;
|
|
20127
|
-
const allowLoopFix = swiper.
|
|
19926
|
+
const allowLoopFix = swiper.swipeDirection === 'next' && swiper.allowSlideNext || swiper.swipeDirection === 'prev' && swiper.allowSlidePrev;
|
|
20128
19927
|
if (!data.isMoved) {
|
|
20129
19928
|
if (isLoop && allowLoopFix) {
|
|
20130
19929
|
swiper.loopFix({
|
|
@@ -20136,10 +19935,7 @@ function onTouchMove(event) {
|
|
|
20136
19935
|
if (swiper.animating) {
|
|
20137
19936
|
const evt = new window.CustomEvent('transitionend', {
|
|
20138
19937
|
bubbles: true,
|
|
20139
|
-
cancelable: true
|
|
20140
|
-
detail: {
|
|
20141
|
-
bySwiperTouchMove: true
|
|
20142
|
-
}
|
|
19938
|
+
cancelable: true
|
|
20143
19939
|
});
|
|
20144
19940
|
swiper.wrapperEl.dispatchEvent(evt);
|
|
20145
19941
|
}
|
|
@@ -20151,18 +19947,13 @@ function onTouchMove(event) {
|
|
|
20151
19947
|
swiper.emit('sliderFirstMove', e);
|
|
20152
19948
|
}
|
|
20153
19949
|
let loopFixed;
|
|
20154
|
-
|
|
20155
|
-
|
|
20156
|
-
|
|
20157
|
-
|
|
20158
|
-
|
|
20159
|
-
currentX: pageX,
|
|
20160
|
-
currentY: pageY,
|
|
20161
|
-
startTranslate: data.currentTranslate
|
|
19950
|
+
if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
19951
|
+
// need another loop fix
|
|
19952
|
+
swiper.loopFix({
|
|
19953
|
+
direction: swiper.swipeDirection,
|
|
19954
|
+
setTranslate: true
|
|
20162
19955
|
});
|
|
20163
|
-
|
|
20164
|
-
data.startTranslate = data.currentTranslate;
|
|
20165
|
-
return;
|
|
19956
|
+
loopFixed = true;
|
|
20166
19957
|
}
|
|
20167
19958
|
swiper.emit('sliderMove', e);
|
|
20168
19959
|
data.isMoved = true;
|
|
@@ -20173,7 +19964,7 @@ function onTouchMove(event) {
|
|
|
20173
19964
|
resistanceRatio = 0;
|
|
20174
19965
|
}
|
|
20175
19966
|
if (diff > 0) {
|
|
20176
|
-
if (isLoop && allowLoopFix && !loopFixed && data.
|
|
19967
|
+
if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
|
|
20177
19968
|
swiper.loopFix({
|
|
20178
19969
|
direction: 'prev',
|
|
20179
19970
|
setTranslate: true,
|
|
@@ -20187,7 +19978,7 @@ function onTouchMove(event) {
|
|
|
20187
19978
|
}
|
|
20188
19979
|
}
|
|
20189
19980
|
} else if (diff < 0) {
|
|
20190
|
-
if (isLoop && allowLoopFix && !loopFixed && data.
|
|
19981
|
+
if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
|
|
20191
19982
|
swiper.loopFix({
|
|
20192
19983
|
direction: 'next',
|
|
20193
19984
|
setTranslate: true,
|
|
@@ -20251,26 +20042,16 @@ function onTouchMove(event) {
|
|
|
20251
20042
|
function onTouchEnd(event) {
|
|
20252
20043
|
const swiper = this;
|
|
20253
20044
|
const data = swiper.touchEventsData;
|
|
20254
|
-
|
|
20255
|
-
if (
|
|
20256
|
-
|
|
20257
|
-
const isTouchEvent = e.type === 'touchend' || e.type === 'touchcancel';
|
|
20258
|
-
if (!isTouchEvent) {
|
|
20259
|
-
if (data.touchId !== null) return; // return from pointer if we use touch
|
|
20260
|
-
if (e.pointerId !== data.pointerId) return;
|
|
20261
|
-
targetTouch = e;
|
|
20262
|
-
} else {
|
|
20263
|
-
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
20264
|
-
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
20045
|
+
const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
|
|
20046
|
+
if (pointerIndex >= 0) {
|
|
20047
|
+
data.evCache.splice(pointerIndex, 1);
|
|
20265
20048
|
}
|
|
20266
|
-
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(
|
|
20267
|
-
const proceed = ['pointercancel', 'contextmenu'].includes(
|
|
20049
|
+
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(event.type)) {
|
|
20050
|
+
const proceed = ['pointercancel', 'contextmenu'].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
|
|
20268
20051
|
if (!proceed) {
|
|
20269
20052
|
return;
|
|
20270
20053
|
}
|
|
20271
20054
|
}
|
|
20272
|
-
data.pointerId = null;
|
|
20273
|
-
data.touchId = null;
|
|
20274
20055
|
const {
|
|
20275
20056
|
params,
|
|
20276
20057
|
touches,
|
|
@@ -20279,7 +20060,9 @@ function onTouchEnd(event) {
|
|
|
20279
20060
|
enabled
|
|
20280
20061
|
} = swiper;
|
|
20281
20062
|
if (!enabled) return;
|
|
20282
|
-
if (!params.simulateTouch &&
|
|
20063
|
+
if (!params.simulateTouch && event.pointerType === 'mouse') return;
|
|
20064
|
+
let e = event;
|
|
20065
|
+
if (e.originalEvent) e = e.originalEvent;
|
|
20283
20066
|
if (data.allowTouchCallbacks) {
|
|
20284
20067
|
swiper.emit('touchEnd', e);
|
|
20285
20068
|
}
|
|
@@ -20292,7 +20075,6 @@ function onTouchEnd(event) {
|
|
|
20292
20075
|
data.startMoving = false;
|
|
20293
20076
|
return;
|
|
20294
20077
|
}
|
|
20295
|
-
|
|
20296
20078
|
// Return Grab Cursor
|
|
20297
20079
|
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
|
20298
20080
|
swiper.setGrabCursor(false);
|
|
@@ -20315,7 +20097,7 @@ function onTouchEnd(event) {
|
|
|
20315
20097
|
nextTick(() => {
|
|
20316
20098
|
if (!swiper.destroyed) swiper.allowClick = true;
|
|
20317
20099
|
});
|
|
20318
|
-
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0
|
|
20100
|
+
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
|
|
20319
20101
|
data.isTouched = false;
|
|
20320
20102
|
data.isMoved = false;
|
|
20321
20103
|
data.startMoving = false;
|
|
@@ -20341,17 +20123,16 @@ function onTouchEnd(event) {
|
|
|
20341
20123
|
}
|
|
20342
20124
|
|
|
20343
20125
|
// Find current slide
|
|
20344
|
-
const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop;
|
|
20345
20126
|
let stopIndex = 0;
|
|
20346
20127
|
let groupSize = swiper.slidesSizesGrid[0];
|
|
20347
20128
|
for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
|
|
20348
20129
|
const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
|
|
20349
20130
|
if (typeof slidesGrid[i + increment] !== 'undefined') {
|
|
20350
|
-
if (
|
|
20131
|
+
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
|
|
20351
20132
|
stopIndex = i;
|
|
20352
20133
|
groupSize = slidesGrid[i + increment] - slidesGrid[i];
|
|
20353
20134
|
}
|
|
20354
|
-
} else if (
|
|
20135
|
+
} else if (currentPos >= slidesGrid[i]) {
|
|
20355
20136
|
stopIndex = i;
|
|
20356
20137
|
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
|
|
20357
20138
|
}
|
|
@@ -20513,15 +20294,8 @@ function onLoad(e) {
|
|
|
20513
20294
|
swiper.update();
|
|
20514
20295
|
}
|
|
20515
20296
|
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
if (swiper.documentTouchHandlerProceeded) return;
|
|
20519
|
-
swiper.documentTouchHandlerProceeded = true;
|
|
20520
|
-
if (swiper.params.touchReleaseOnEdges) {
|
|
20521
|
-
swiper.el.style.touchAction = 'auto';
|
|
20522
|
-
}
|
|
20523
|
-
}
|
|
20524
|
-
|
|
20297
|
+
let dummyEventAttached = false;
|
|
20298
|
+
function dummyEventListener() {}
|
|
20525
20299
|
const events = (swiper, method) => {
|
|
20526
20300
|
const document = getDocument();
|
|
20527
20301
|
const {
|
|
@@ -20533,39 +20307,21 @@ const events = (swiper, method) => {
|
|
|
20533
20307
|
const capture = !!params.nested;
|
|
20534
20308
|
const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
|
|
20535
20309
|
const swiperMethod = method;
|
|
20536
|
-
if (!el || typeof el === 'string') return;
|
|
20537
20310
|
|
|
20538
20311
|
// Touch Events
|
|
20539
|
-
document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
|
|
20540
|
-
passive: false,
|
|
20541
|
-
capture
|
|
20542
|
-
});
|
|
20543
|
-
el[domMethod]('touchstart', swiper.onTouchStart, {
|
|
20544
|
-
passive: false
|
|
20545
|
-
});
|
|
20546
20312
|
el[domMethod]('pointerdown', swiper.onTouchStart, {
|
|
20547
20313
|
passive: false
|
|
20548
20314
|
});
|
|
20549
|
-
document[domMethod]('touchmove', swiper.onTouchMove, {
|
|
20550
|
-
passive: false,
|
|
20551
|
-
capture
|
|
20552
|
-
});
|
|
20553
20315
|
document[domMethod]('pointermove', swiper.onTouchMove, {
|
|
20554
20316
|
passive: false,
|
|
20555
20317
|
capture
|
|
20556
20318
|
});
|
|
20557
|
-
document[domMethod]('touchend', swiper.onTouchEnd, {
|
|
20558
|
-
passive: true
|
|
20559
|
-
});
|
|
20560
20319
|
document[domMethod]('pointerup', swiper.onTouchEnd, {
|
|
20561
20320
|
passive: true
|
|
20562
20321
|
});
|
|
20563
20322
|
document[domMethod]('pointercancel', swiper.onTouchEnd, {
|
|
20564
20323
|
passive: true
|
|
20565
20324
|
});
|
|
20566
|
-
document[domMethod]('touchcancel', swiper.onTouchEnd, {
|
|
20567
|
-
passive: true
|
|
20568
|
-
});
|
|
20569
20325
|
document[domMethod]('pointerout', swiper.onTouchEnd, {
|
|
20570
20326
|
passive: true
|
|
20571
20327
|
});
|
|
@@ -20598,18 +20354,22 @@ const events = (swiper, method) => {
|
|
|
20598
20354
|
};
|
|
20599
20355
|
function attachEvents() {
|
|
20600
20356
|
const swiper = this;
|
|
20357
|
+
const document = getDocument();
|
|
20601
20358
|
const {
|
|
20602
20359
|
params
|
|
20603
20360
|
} = swiper;
|
|
20604
20361
|
swiper.onTouchStart = onTouchStart.bind(swiper);
|
|
20605
20362
|
swiper.onTouchMove = onTouchMove.bind(swiper);
|
|
20606
20363
|
swiper.onTouchEnd = onTouchEnd.bind(swiper);
|
|
20607
|
-
swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper);
|
|
20608
20364
|
if (params.cssMode) {
|
|
20609
20365
|
swiper.onScroll = onScroll.bind(swiper);
|
|
20610
20366
|
}
|
|
20611
20367
|
swiper.onClick = onClick.bind(swiper);
|
|
20612
20368
|
swiper.onLoad = onLoad.bind(swiper);
|
|
20369
|
+
if (!dummyEventAttached) {
|
|
20370
|
+
document.addEventListener('touchstart', dummyEventListener);
|
|
20371
|
+
dummyEventAttached = true;
|
|
20372
|
+
}
|
|
20613
20373
|
events(swiper, 'on');
|
|
20614
20374
|
}
|
|
20615
20375
|
function detachEvents() {
|
|
@@ -20642,8 +20402,6 @@ function setBreakpoint() {
|
|
|
20642
20402
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
20643
20403
|
const wasMultiRow = isGridEnabled(swiper, params);
|
|
20644
20404
|
const isMultiRow = isGridEnabled(swiper, breakpointParams);
|
|
20645
|
-
const wasGrabCursor = swiper.params.grabCursor;
|
|
20646
|
-
const isGrabCursor = breakpointParams.grabCursor;
|
|
20647
20405
|
const wasEnabled = params.enabled;
|
|
20648
20406
|
if (wasMultiRow && !isMultiRow) {
|
|
20649
20407
|
el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
|
|
@@ -20655,11 +20413,6 @@ function setBreakpoint() {
|
|
|
20655
20413
|
}
|
|
20656
20414
|
swiper.emitContainerClasses();
|
|
20657
20415
|
}
|
|
20658
|
-
if (wasGrabCursor && !isGrabCursor) {
|
|
20659
|
-
swiper.unsetGrabCursor();
|
|
20660
|
-
} else if (!wasGrabCursor && isGrabCursor) {
|
|
20661
|
-
swiper.setGrabCursor();
|
|
20662
|
-
}
|
|
20663
20416
|
|
|
20664
20417
|
// Toggle navigation, pagination, scrollbar
|
|
20665
20418
|
['navigation', 'pagination', 'scrollbar'].forEach(prop => {
|
|
@@ -20810,7 +20563,6 @@ function removeClasses() {
|
|
|
20810
20563
|
el,
|
|
20811
20564
|
classNames
|
|
20812
20565
|
} = swiper;
|
|
20813
|
-
if (!el || typeof el === 'string') return;
|
|
20814
20566
|
el.classList.remove(...classNames);
|
|
20815
20567
|
swiper.emitContainerClasses();
|
|
20816
20568
|
}
|
|
@@ -20857,7 +20609,6 @@ var defaults$4 = {
|
|
|
20857
20609
|
init: true,
|
|
20858
20610
|
direction: 'horizontal',
|
|
20859
20611
|
oneWayMovement: false,
|
|
20860
|
-
swiperElementNodeName: 'SWIPER-CONTAINER',
|
|
20861
20612
|
touchEventsTarget: 'wrapper',
|
|
20862
20613
|
initialSlide: 0,
|
|
20863
20614
|
speed: 300,
|
|
@@ -20866,7 +20617,6 @@ var defaults$4 = {
|
|
|
20866
20617
|
resizeObserver: true,
|
|
20867
20618
|
nested: false,
|
|
20868
20619
|
createElements: false,
|
|
20869
|
-
eventsPrefix: 'swiper',
|
|
20870
20620
|
enabled: true,
|
|
20871
20621
|
focusableElements: 'input, select, option, textarea, button, video, label',
|
|
20872
20622
|
// Overrides
|
|
@@ -20941,8 +20691,7 @@ var defaults$4 = {
|
|
|
20941
20691
|
slideToClickedSlide: false,
|
|
20942
20692
|
// loop
|
|
20943
20693
|
loop: false,
|
|
20944
|
-
|
|
20945
|
-
loopAdditionalSlides: 0,
|
|
20694
|
+
loopedSlides: null,
|
|
20946
20695
|
loopPreventsSliding: true,
|
|
20947
20696
|
// rewind
|
|
20948
20697
|
rewind: false,
|
|
@@ -20961,10 +20710,8 @@ var defaults$4 = {
|
|
|
20961
20710
|
containerModifierClass: 'swiper-',
|
|
20962
20711
|
// NEW
|
|
20963
20712
|
slideClass: 'swiper-slide',
|
|
20964
|
-
slideBlankClass: 'swiper-slide-blank',
|
|
20965
20713
|
slideActiveClass: 'swiper-slide-active',
|
|
20966
20714
|
slideVisibleClass: 'swiper-slide-visible',
|
|
20967
|
-
slideFullyVisibleClass: 'swiper-slide-fully-visible',
|
|
20968
20715
|
slideNextClass: 'swiper-slide-next',
|
|
20969
20716
|
slidePrevClass: 'swiper-slide-prev',
|
|
20970
20717
|
wrapperClass: 'swiper-wrapper',
|
|
@@ -21157,8 +20904,7 @@ class Swiper$1 {
|
|
|
21157
20904
|
velocities: [],
|
|
21158
20905
|
allowMomentumBounce: undefined,
|
|
21159
20906
|
startMoving: undefined,
|
|
21160
|
-
|
|
21161
|
-
touchId: null
|
|
20907
|
+
evCache: []
|
|
21162
20908
|
},
|
|
21163
20909
|
// Clicks
|
|
21164
20910
|
allowClick: true,
|
|
@@ -21186,22 +20932,6 @@ class Swiper$1 {
|
|
|
21186
20932
|
// eslint-disable-next-line no-constructor-return
|
|
21187
20933
|
return swiper;
|
|
21188
20934
|
}
|
|
21189
|
-
getDirectionLabel(property) {
|
|
21190
|
-
if (this.isHorizontal()) {
|
|
21191
|
-
return property;
|
|
21192
|
-
}
|
|
21193
|
-
// prettier-ignore
|
|
21194
|
-
return {
|
|
21195
|
-
'width': 'height',
|
|
21196
|
-
'margin-top': 'margin-left',
|
|
21197
|
-
'margin-bottom ': 'margin-right',
|
|
21198
|
-
'margin-left': 'margin-top',
|
|
21199
|
-
'margin-right': 'margin-bottom',
|
|
21200
|
-
'padding-left': 'padding-top',
|
|
21201
|
-
'padding-right': 'padding-bottom',
|
|
21202
|
-
'marginRight': 'marginBottom'
|
|
21203
|
-
}[property];
|
|
21204
|
-
}
|
|
21205
20935
|
getSlideIndex(slideEl) {
|
|
21206
20936
|
const {
|
|
21207
20937
|
slidesEl,
|
|
@@ -21298,11 +21028,11 @@ class Swiper$1 {
|
|
|
21298
21028
|
let spv = 1;
|
|
21299
21029
|
if (typeof params.slidesPerView === 'number') return params.slidesPerView;
|
|
21300
21030
|
if (params.centeredSlides) {
|
|
21301
|
-
let slideSize = slides[activeIndex] ?
|
|
21031
|
+
let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;
|
|
21302
21032
|
let breakLoop;
|
|
21303
21033
|
for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
|
21304
21034
|
if (slides[i] && !breakLoop) {
|
|
21305
|
-
slideSize +=
|
|
21035
|
+
slideSize += slides[i].swiperSlideSize;
|
|
21306
21036
|
spv += 1;
|
|
21307
21037
|
if (slideSize > swiperSize) breakLoop = true;
|
|
21308
21038
|
}
|
|
@@ -21439,7 +21169,7 @@ class Swiper$1 {
|
|
|
21439
21169
|
return false;
|
|
21440
21170
|
}
|
|
21441
21171
|
el.swiper = swiper;
|
|
21442
|
-
if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName ===
|
|
21172
|
+
if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === 'SWIPER-CONTAINER') {
|
|
21443
21173
|
swiper.isElement = true;
|
|
21444
21174
|
}
|
|
21445
21175
|
const getWrapperSelector = () => {
|
|
@@ -21575,15 +21305,11 @@ class Swiper$1 {
|
|
|
21575
21305
|
// Cleanup styles
|
|
21576
21306
|
if (cleanStyles) {
|
|
21577
21307
|
swiper.removeClasses();
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
}
|
|
21581
|
-
if (wrapperEl) {
|
|
21582
|
-
wrapperEl.removeAttribute('style');
|
|
21583
|
-
}
|
|
21308
|
+
el.removeAttribute('style');
|
|
21309
|
+
wrapperEl.removeAttribute('style');
|
|
21584
21310
|
if (slides && slides.length) {
|
|
21585
21311
|
slides.forEach(slideEl => {
|
|
21586
|
-
slideEl.classList.remove(params.slideVisibleClass, params.
|
|
21312
|
+
slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
|
|
21587
21313
|
slideEl.removeAttribute('style');
|
|
21588
21314
|
slideEl.removeAttribute('data-swiper-slide-index');
|
|
21589
21315
|
});
|
|
@@ -21596,9 +21322,7 @@ class Swiper$1 {
|
|
|
21596
21322
|
swiper.off(eventName);
|
|
21597
21323
|
});
|
|
21598
21324
|
if (deleteInstance !== false) {
|
|
21599
|
-
|
|
21600
|
-
swiper.el.swiper = null;
|
|
21601
|
-
}
|
|
21325
|
+
swiper.el.swiper = null;
|
|
21602
21326
|
deleteProps(swiper);
|
|
21603
21327
|
}
|
|
21604
21328
|
swiper.destroyed = true;
|
|
@@ -21637,7 +21361,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
21637
21361
|
Swiper$1.use([Resize, Observer]);
|
|
21638
21362
|
|
|
21639
21363
|
/* underscore in name -> watch for changes */
|
|
21640
|
-
const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', '
|
|
21364
|
+
const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopedSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideNextClass', 'slidePrevClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
|
|
21641
21365
|
// modules
|
|
21642
21366
|
'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
|
|
21643
21367
|
|
|
@@ -21766,7 +21490,7 @@ function updateSwiper(_ref) {
|
|
|
21766
21490
|
}
|
|
21767
21491
|
updateParams.forEach(key => {
|
|
21768
21492
|
if (isObject$1(currentParams[key]) && isObject$1(passedParams[key])) {
|
|
21769
|
-
|
|
21493
|
+
extend$1(currentParams[key], passedParams[key]);
|
|
21770
21494
|
if ((key === 'navigation' || key === 'pagination' || key === 'scrollbar') && 'enabled' in passedParams[key] && !passedParams[key].enabled) {
|
|
21771
21495
|
destroyModule(key);
|
|
21772
21496
|
}
|
|
@@ -21787,9 +21511,6 @@ function updateSwiper(_ref) {
|
|
|
21787
21511
|
if (changedParams.includes('children') && slides && virtual && currentParams.virtual.enabled) {
|
|
21788
21512
|
virtual.slides = slides;
|
|
21789
21513
|
virtual.update(true);
|
|
21790
|
-
} else if (changedParams.includes('virtual') && virtual && currentParams.virtual.enabled) {
|
|
21791
|
-
if (slides) virtual.slides = slides;
|
|
21792
|
-
virtual.update(true);
|
|
21793
21514
|
}
|
|
21794
21515
|
if (changedParams.includes('children') && slides && currentParams.loop) {
|
|
21795
21516
|
loopNeedReloop = true;
|
|
@@ -21992,15 +21713,15 @@ const updateOnVirtualData = swiper => {
|
|
|
21992
21713
|
};
|
|
21993
21714
|
|
|
21994
21715
|
/**
|
|
21995
|
-
* Swiper React
|
|
21716
|
+
* Swiper React 10.3.0
|
|
21996
21717
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
21997
21718
|
* https://swiperjs.com
|
|
21998
21719
|
*
|
|
21999
|
-
* Copyright 2014-
|
|
21720
|
+
* Copyright 2014-2023 Vladimir Kharlampidi
|
|
22000
21721
|
*
|
|
22001
21722
|
* Released under the MIT License
|
|
22002
21723
|
*
|
|
22003
|
-
* Released on:
|
|
21724
|
+
* Released on: September 21, 2023
|
|
22004
21725
|
*/
|
|
22005
21726
|
|
|
22006
21727
|
function _extends() {
|
|
@@ -22095,7 +21816,7 @@ function renderVirtual(swiper, slides, virtualData) {
|
|
|
22095
21816
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
22096
21817
|
swiper,
|
|
22097
21818
|
style,
|
|
22098
|
-
key:
|
|
21819
|
+
key: `slide-${index}`
|
|
22099
21820
|
});
|
|
22100
21821
|
});
|
|
22101
21822
|
}
|
|
@@ -22221,7 +21942,7 @@ const Swiper = /*#__PURE__*/React.forwardRef(function (_temp, externalElRef) {
|
|
|
22221
21942
|
scrollbarEl: scrollbarElRef.current,
|
|
22222
21943
|
swiper: swiperRef.current
|
|
22223
21944
|
}, swiperParams);
|
|
22224
|
-
if (onSwiper
|
|
21945
|
+
if (onSwiper) onSwiper(swiperRef.current);
|
|
22225
21946
|
// eslint-disable-next-line
|
|
22226
21947
|
return () => {
|
|
22227
21948
|
if (swiperRef.current && !swiperRef.current.destroyed) {
|
|
@@ -41839,7 +41560,7 @@ function History(_ref) {
|
|
|
41839
41560
|
} else {
|
|
41840
41561
|
location = window.location;
|
|
41841
41562
|
}
|
|
41842
|
-
const slide = swiper.
|
|
41563
|
+
const slide = swiper.slides[index];
|
|
41843
41564
|
let value = slugify(slide.getAttribute('data-history'));
|
|
41844
41565
|
if (swiper.params.history.root.length > 0) {
|
|
41845
41566
|
let root = swiper.params.history.root;
|
|
@@ -41952,7 +41673,7 @@ function Autoplay(_ref) {
|
|
|
41952
41673
|
enabled: false,
|
|
41953
41674
|
delay: 3000,
|
|
41954
41675
|
waitForTransition: true,
|
|
41955
|
-
disableOnInteraction:
|
|
41676
|
+
disableOnInteraction: true,
|
|
41956
41677
|
stopOnLastSlide: false,
|
|
41957
41678
|
reverseDirection: false,
|
|
41958
41679
|
pauseOnMouseEnter: false
|
|
@@ -41963,21 +41684,17 @@ function Autoplay(_ref) {
|
|
|
41963
41684
|
let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
|
|
41964
41685
|
let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
|
|
41965
41686
|
let autoplayTimeLeft;
|
|
41966
|
-
let autoplayStartTime = new Date().getTime
|
|
41687
|
+
let autoplayStartTime = new Date().getTime;
|
|
41967
41688
|
let wasPaused;
|
|
41968
41689
|
let isTouched;
|
|
41969
41690
|
let pausedByTouch;
|
|
41970
41691
|
let touchStartTimeout;
|
|
41971
41692
|
let slideChanged;
|
|
41972
41693
|
let pausedByInteraction;
|
|
41973
|
-
let pausedByPointerEnter;
|
|
41974
41694
|
function onTransitionEnd(e) {
|
|
41975
41695
|
if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
|
|
41976
41696
|
if (e.target !== swiper.wrapperEl) return;
|
|
41977
41697
|
swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
|
|
41978
|
-
if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
|
|
41979
|
-
return;
|
|
41980
|
-
}
|
|
41981
41698
|
resume();
|
|
41982
41699
|
}
|
|
41983
41700
|
const calcTimeLeft = () => {
|
|
@@ -42062,7 +41779,6 @@ function Autoplay(_ref) {
|
|
|
42062
41779
|
return delay;
|
|
42063
41780
|
};
|
|
42064
41781
|
const start = () => {
|
|
42065
|
-
autoplayStartTime = new Date().getTime();
|
|
42066
41782
|
swiper.autoplay.running = true;
|
|
42067
41783
|
run();
|
|
42068
41784
|
emit('autoplayStart');
|
|
@@ -42128,13 +41844,11 @@ function Autoplay(_ref) {
|
|
|
42128
41844
|
const onPointerEnter = e => {
|
|
42129
41845
|
if (e.pointerType !== 'mouse') return;
|
|
42130
41846
|
pausedByInteraction = true;
|
|
42131
|
-
pausedByPointerEnter = true;
|
|
42132
41847
|
if (swiper.animating || swiper.autoplay.paused) return;
|
|
42133
41848
|
pause(true);
|
|
42134
41849
|
};
|
|
42135
41850
|
const onPointerLeave = e => {
|
|
42136
41851
|
if (e.pointerType !== 'mouse') return;
|
|
42137
|
-
pausedByPointerEnter = false;
|
|
42138
41852
|
if (swiper.autoplay.paused) {
|
|
42139
41853
|
resume();
|
|
42140
41854
|
}
|
|
@@ -42146,10 +41860,8 @@ function Autoplay(_ref) {
|
|
|
42146
41860
|
}
|
|
42147
41861
|
};
|
|
42148
41862
|
const detachMouseEvents = () => {
|
|
42149
|
-
|
|
42150
|
-
|
|
42151
|
-
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
|
42152
|
-
}
|
|
41863
|
+
swiper.el.removeEventListener('pointerenter', onPointerEnter);
|
|
41864
|
+
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
|
42153
41865
|
};
|
|
42154
41866
|
const attachDocumentEvents = () => {
|
|
42155
41867
|
const document = getDocument();
|
|
@@ -42163,6 +41875,7 @@ function Autoplay(_ref) {
|
|
|
42163
41875
|
if (swiper.params.autoplay.enabled) {
|
|
42164
41876
|
attachMouseEvents();
|
|
42165
41877
|
attachDocumentEvents();
|
|
41878
|
+
autoplayStartTime = new Date().getTime();
|
|
42166
41879
|
start();
|
|
42167
41880
|
}
|
|
42168
41881
|
});
|
|
@@ -42173,18 +41886,6 @@ function Autoplay(_ref) {
|
|
|
42173
41886
|
stop();
|
|
42174
41887
|
}
|
|
42175
41888
|
});
|
|
42176
|
-
on('_freeModeStaticRelease', () => {
|
|
42177
|
-
if (pausedByTouch || pausedByInteraction) {
|
|
42178
|
-
resume();
|
|
42179
|
-
}
|
|
42180
|
-
});
|
|
42181
|
-
on('_freeModeNoMomentumRelease', () => {
|
|
42182
|
-
if (!swiper.params.autoplay.disableOnInteraction) {
|
|
42183
|
-
pause(true, true);
|
|
42184
|
-
} else {
|
|
42185
|
-
stop();
|
|
42186
|
-
}
|
|
42187
|
-
});
|
|
42188
41889
|
on('beforeTransitionStart', (_s, speed, internal) => {
|
|
42189
41890
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
42190
41891
|
if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
|
@@ -43278,9 +42979,6 @@ var HeroWithGallery = function HeroWithGallery(_ref) {
|
|
|
43278
42979
|
media: media,
|
|
43279
42980
|
index: index
|
|
43280
42981
|
}));
|
|
43281
|
-
}), /*#__PURE__*/React__default["default"].createElement(Pagination, {
|
|
43282
|
-
swiper: swiper,
|
|
43283
|
-
className: "!relative"
|
|
43284
42982
|
})), /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
|
|
43285
42983
|
Icon: ArrowRightS$1,
|
|
43286
42984
|
className: "hidden sm:flex",
|