@bigbinary/neeto-site-blocks 2.0.10 → 3.0.0
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 +456 -411
- 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 +456 -411
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -11,9 +11,14 @@ import { isNotPresent, isPresent, isNotEmpty, existsBy } from '@bigbinary/neeto-
|
|
|
11
11
|
import Frame, { useFrame } from 'react-frame-component';
|
|
12
12
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
13
13
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
14
|
+
import 'swiper/scss';
|
|
14
15
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
15
16
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
16
17
|
import axios from 'axios';
|
|
18
|
+
import 'swiper/scss/pagination';
|
|
19
|
+
import 'swiper/scss/autoplay';
|
|
20
|
+
import 'swiper/scss/thumbs';
|
|
21
|
+
import 'swiper/scss/history';
|
|
17
22
|
|
|
18
23
|
var ArrowButton = function ArrowButton(_ref) {
|
|
19
24
|
var Icon = _ref.Icon,
|
|
@@ -5563,7 +5568,7 @@ var StyledWrapper = styled.div.attrs(function (props) {
|
|
|
5563
5568
|
position: "absolute",
|
|
5564
5569
|
top: 0,
|
|
5565
5570
|
left: 0,
|
|
5566
|
-
backgroundImage: "url(".concat(backgroundImage.src, ")"),
|
|
5571
|
+
backgroundImage: "url(\"".concat(backgroundImage.src, "\")"),
|
|
5567
5572
|
width: "100%",
|
|
5568
5573
|
height: "100%",
|
|
5569
5574
|
zIndex: -1,
|
|
@@ -7904,28 +7909,23 @@ var CardsClassic = function CardsClassic(_ref) {
|
|
|
7904
7909
|
};
|
|
7905
7910
|
|
|
7906
7911
|
/**
|
|
7907
|
-
* SSR Window
|
|
7912
|
+
* SSR Window 5.0.1
|
|
7908
7913
|
* Better handling for window object in SSR environment
|
|
7909
7914
|
* https://github.com/nolimits4web/ssr-window
|
|
7910
7915
|
*
|
|
7911
|
-
* Copyright
|
|
7916
|
+
* Copyright 2025, Vladimir Kharlampidi
|
|
7912
7917
|
*
|
|
7913
7918
|
* Licensed under MIT
|
|
7914
7919
|
*
|
|
7915
|
-
* Released on:
|
|
7920
|
+
* Released on: June 27, 2025
|
|
7916
7921
|
*/
|
|
7917
7922
|
/* eslint-disable no-param-reassign */
|
|
7918
7923
|
function isObject$2(obj) {
|
|
7919
7924
|
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
7920
7925
|
}
|
|
7921
|
-
function extend$2(target, src) {
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
}
|
|
7925
|
-
if (src === void 0) {
|
|
7926
|
-
src = {};
|
|
7927
|
-
}
|
|
7928
|
-
Object.keys(src).forEach(key => {
|
|
7926
|
+
function extend$2(target = {}, src = {}) {
|
|
7927
|
+
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
7928
|
+
Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {
|
|
7929
7929
|
if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$2(src[key]) && isObject$2(target[key]) && Object.keys(src[key]).length > 0) {
|
|
7930
7930
|
extend$2(target[key], src[key]);
|
|
7931
7931
|
}
|
|
@@ -8047,10 +8047,7 @@ function getWindow() {
|
|
|
8047
8047
|
return win;
|
|
8048
8048
|
}
|
|
8049
8049
|
|
|
8050
|
-
function classesToTokens(classes) {
|
|
8051
|
-
if (classes === void 0) {
|
|
8052
|
-
classes = '';
|
|
8053
|
-
}
|
|
8050
|
+
function classesToTokens(classes = '') {
|
|
8054
8051
|
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
8055
8052
|
}
|
|
8056
8053
|
|
|
@@ -8069,10 +8066,7 @@ function deleteProps(obj) {
|
|
|
8069
8066
|
}
|
|
8070
8067
|
});
|
|
8071
8068
|
}
|
|
8072
|
-
function nextTick(callback, delay) {
|
|
8073
|
-
if (delay === void 0) {
|
|
8074
|
-
delay = 0;
|
|
8075
|
-
}
|
|
8069
|
+
function nextTick(callback, delay = 0) {
|
|
8076
8070
|
return setTimeout(callback, delay);
|
|
8077
8071
|
}
|
|
8078
8072
|
function now() {
|
|
@@ -8092,10 +8086,7 @@ function getComputedStyle$1(el) {
|
|
|
8092
8086
|
}
|
|
8093
8087
|
return style;
|
|
8094
8088
|
}
|
|
8095
|
-
function getTranslate(el, axis) {
|
|
8096
|
-
if (axis === void 0) {
|
|
8097
|
-
axis = 'x';
|
|
8098
|
-
}
|
|
8089
|
+
function getTranslate(el, axis = 'x') {
|
|
8099
8090
|
const window = getWindow();
|
|
8100
8091
|
let matrix;
|
|
8101
8092
|
let curTransform;
|
|
@@ -8141,13 +8132,12 @@ function isNode(node) {
|
|
|
8141
8132
|
}
|
|
8142
8133
|
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
8143
8134
|
}
|
|
8144
|
-
function extend$1() {
|
|
8145
|
-
const to = Object(
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
8135
|
+
function extend$1(...args) {
|
|
8136
|
+
const to = Object(args[0]);
|
|
8137
|
+
for (let i = 1; i < args.length; i += 1) {
|
|
8138
|
+
const nextSource = args[i];
|
|
8149
8139
|
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
8150
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key =>
|
|
8140
|
+
const keysArray = Object.keys(Object(nextSource)).filter(key => key !== '__proto__' && key !== 'constructor' && key !== 'prototype');
|
|
8151
8141
|
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
8152
8142
|
const nextKey = keysArray[nextIndex];
|
|
8153
8143
|
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
@@ -8177,12 +8167,11 @@ function extend$1() {
|
|
|
8177
8167
|
function setCSSProperty(el, varName, varValue) {
|
|
8178
8168
|
el.style.setProperty(varName, varValue);
|
|
8179
8169
|
}
|
|
8180
|
-
function animateCSSModeScroll(
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
} = _ref;
|
|
8170
|
+
function animateCSSModeScroll({
|
|
8171
|
+
swiper,
|
|
8172
|
+
targetPosition,
|
|
8173
|
+
side
|
|
8174
|
+
}) {
|
|
8186
8175
|
const window = getWindow();
|
|
8187
8176
|
const startPosition = -swiper.translate;
|
|
8188
8177
|
let startTime = null;
|
|
@@ -8224,11 +8213,39 @@ function animateCSSModeScroll(_ref) {
|
|
|
8224
8213
|
};
|
|
8225
8214
|
animate();
|
|
8226
8215
|
}
|
|
8227
|
-
function elementChildren(element, selector) {
|
|
8228
|
-
|
|
8229
|
-
|
|
8216
|
+
function elementChildren(element, selector = '') {
|
|
8217
|
+
const window = getWindow();
|
|
8218
|
+
const children = [...element.children];
|
|
8219
|
+
if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {
|
|
8220
|
+
children.push(...element.assignedElements());
|
|
8221
|
+
}
|
|
8222
|
+
if (!selector) {
|
|
8223
|
+
return children;
|
|
8224
|
+
}
|
|
8225
|
+
return children.filter(el => el.matches(selector));
|
|
8226
|
+
}
|
|
8227
|
+
function elementIsChildOfSlot(el, slot) {
|
|
8228
|
+
// Breadth-first search through all parent's children and assigned elements
|
|
8229
|
+
const elementsQueue = [slot];
|
|
8230
|
+
while (elementsQueue.length > 0) {
|
|
8231
|
+
const elementToCheck = elementsQueue.shift();
|
|
8232
|
+
if (el === elementToCheck) {
|
|
8233
|
+
return true;
|
|
8234
|
+
}
|
|
8235
|
+
elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));
|
|
8230
8236
|
}
|
|
8231
|
-
|
|
8237
|
+
}
|
|
8238
|
+
function elementIsChildOf(el, parent) {
|
|
8239
|
+
const window = getWindow();
|
|
8240
|
+
let isChild = parent.contains(el);
|
|
8241
|
+
if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {
|
|
8242
|
+
const children = [...parent.assignedElements()];
|
|
8243
|
+
isChild = children.includes(el);
|
|
8244
|
+
if (!isChild) {
|
|
8245
|
+
isChild = elementIsChildOfSlot(el, parent);
|
|
8246
|
+
}
|
|
8247
|
+
}
|
|
8248
|
+
return isChild;
|
|
8232
8249
|
}
|
|
8233
8250
|
function showWarning(text) {
|
|
8234
8251
|
try {
|
|
@@ -8238,10 +8255,7 @@ function showWarning(text) {
|
|
|
8238
8255
|
// err
|
|
8239
8256
|
}
|
|
8240
8257
|
}
|
|
8241
|
-
function createElement(tag, classes) {
|
|
8242
|
-
if (classes === void 0) {
|
|
8243
|
-
classes = [];
|
|
8244
|
-
}
|
|
8258
|
+
function createElement(tag, classes = []) {
|
|
8245
8259
|
const el = document.createElement(tag);
|
|
8246
8260
|
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
8247
8261
|
return el;
|
|
@@ -8319,6 +8333,15 @@ function elementOuterSize(el, size, includeMargins) {
|
|
|
8319
8333
|
}
|
|
8320
8334
|
return el.offsetWidth;
|
|
8321
8335
|
}
|
|
8336
|
+
function setInnerHTML(el, html = '') {
|
|
8337
|
+
if (typeof trustedTypes !== 'undefined') {
|
|
8338
|
+
el.innerHTML = trustedTypes.createPolicy('html', {
|
|
8339
|
+
createHTML: s => s
|
|
8340
|
+
}).createHTML(html);
|
|
8341
|
+
} else {
|
|
8342
|
+
el.innerHTML = html;
|
|
8343
|
+
}
|
|
8344
|
+
}
|
|
8322
8345
|
|
|
8323
8346
|
let support;
|
|
8324
8347
|
function calcSupport() {
|
|
@@ -8337,10 +8360,9 @@ function getSupport() {
|
|
|
8337
8360
|
}
|
|
8338
8361
|
|
|
8339
8362
|
let deviceCached;
|
|
8340
|
-
function calcDevice(
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
} = _temp === void 0 ? {} : _temp;
|
|
8363
|
+
function calcDevice({
|
|
8364
|
+
userAgent
|
|
8365
|
+
} = {}) {
|
|
8344
8366
|
const support = getSupport();
|
|
8345
8367
|
const window = getWindow();
|
|
8346
8368
|
const platform = window.navigator.platform;
|
|
@@ -8352,7 +8374,7 @@ function calcDevice(_temp) {
|
|
|
8352
8374
|
const screenWidth = window.screen.width;
|
|
8353
8375
|
const screenHeight = window.screen.height;
|
|
8354
8376
|
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
|
8355
|
-
let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
8377
|
+
let ipad = ua.match(/(iPad)(?!\1).*OS\s([\d_]+)/);
|
|
8356
8378
|
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
8357
8379
|
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
|
8358
8380
|
const windows = platform === 'Win32';
|
|
@@ -8379,10 +8401,7 @@ function calcDevice(_temp) {
|
|
|
8379
8401
|
// Export object
|
|
8380
8402
|
return device;
|
|
8381
8403
|
}
|
|
8382
|
-
function getDevice(overrides) {
|
|
8383
|
-
if (overrides === void 0) {
|
|
8384
|
-
overrides = {};
|
|
8385
|
-
}
|
|
8404
|
+
function getDevice(overrides = {}) {
|
|
8386
8405
|
if (!deviceCached) {
|
|
8387
8406
|
deviceCached = calcDevice(overrides);
|
|
8388
8407
|
}
|
|
@@ -8422,12 +8441,11 @@ function getBrowser() {
|
|
|
8422
8441
|
return browser;
|
|
8423
8442
|
}
|
|
8424
8443
|
|
|
8425
|
-
function Resize(
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
} = _ref;
|
|
8444
|
+
function Resize({
|
|
8445
|
+
swiper,
|
|
8446
|
+
on,
|
|
8447
|
+
emit
|
|
8448
|
+
}) {
|
|
8431
8449
|
const window = getWindow();
|
|
8432
8450
|
let observer = null;
|
|
8433
8451
|
let animationFrame = null;
|
|
@@ -8446,12 +8464,11 @@ function Resize(_ref) {
|
|
|
8446
8464
|
} = swiper;
|
|
8447
8465
|
let newWidth = width;
|
|
8448
8466
|
let newHeight = height;
|
|
8449
|
-
entries.forEach(
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
} = _ref2;
|
|
8467
|
+
entries.forEach(({
|
|
8468
|
+
contentBoxSize,
|
|
8469
|
+
contentRect,
|
|
8470
|
+
target
|
|
8471
|
+
}) => {
|
|
8455
8472
|
if (target && target !== swiper.el) return;
|
|
8456
8473
|
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
|
8457
8474
|
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
|
@@ -8491,19 +8508,15 @@ function Resize(_ref) {
|
|
|
8491
8508
|
});
|
|
8492
8509
|
}
|
|
8493
8510
|
|
|
8494
|
-
function Observer(
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
} = _ref;
|
|
8511
|
+
function Observer({
|
|
8512
|
+
swiper,
|
|
8513
|
+
extendParams,
|
|
8514
|
+
on,
|
|
8515
|
+
emit
|
|
8516
|
+
}) {
|
|
8501
8517
|
const observers = [];
|
|
8502
8518
|
const window = getWindow();
|
|
8503
|
-
const attach =
|
|
8504
|
-
if (options === void 0) {
|
|
8505
|
-
options = {};
|
|
8506
|
-
}
|
|
8519
|
+
const attach = (target, options = {}) => {
|
|
8507
8520
|
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
|
8508
8521
|
const observer = new ObserverFunc(mutations => {
|
|
8509
8522
|
// The observerUpdate event should only be triggered
|
|
@@ -8525,7 +8538,7 @@ function Observer(_ref) {
|
|
|
8525
8538
|
});
|
|
8526
8539
|
observer.observe(target, {
|
|
8527
8540
|
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
|
8528
|
-
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
|
8541
|
+
childList: swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,
|
|
8529
8542
|
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
|
8530
8543
|
});
|
|
8531
8544
|
observers.push(observer);
|
|
@@ -8581,14 +8594,11 @@ var eventsEmitter = {
|
|
|
8581
8594
|
const self = this;
|
|
8582
8595
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8583
8596
|
if (typeof handler !== 'function') return self;
|
|
8584
|
-
function onceHandler() {
|
|
8597
|
+
function onceHandler(...args) {
|
|
8585
8598
|
self.off(events, onceHandler);
|
|
8586
8599
|
if (onceHandler.__emitterProxy) {
|
|
8587
8600
|
delete onceHandler.__emitterProxy;
|
|
8588
8601
|
}
|
|
8589
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8590
|
-
args[_key] = arguments[_key];
|
|
8591
|
-
}
|
|
8592
8602
|
handler.apply(self, args);
|
|
8593
8603
|
}
|
|
8594
8604
|
onceHandler.__emitterProxy = handler;
|
|
@@ -8631,16 +8641,13 @@ var eventsEmitter = {
|
|
|
8631
8641
|
});
|
|
8632
8642
|
return self;
|
|
8633
8643
|
},
|
|
8634
|
-
emit() {
|
|
8644
|
+
emit(...args) {
|
|
8635
8645
|
const self = this;
|
|
8636
8646
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8637
8647
|
if (!self.eventsListeners) return self;
|
|
8638
8648
|
let events;
|
|
8639
8649
|
let data;
|
|
8640
8650
|
let context;
|
|
8641
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8642
|
-
args[_key2] = arguments[_key2];
|
|
8643
|
-
}
|
|
8644
8651
|
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
|
8645
8652
|
events = args[0];
|
|
8646
8653
|
data = args.slice(1, args.length);
|
|
@@ -8708,7 +8715,6 @@ function updateSlides() {
|
|
|
8708
8715
|
const {
|
|
8709
8716
|
wrapperEl,
|
|
8710
8717
|
slidesEl,
|
|
8711
|
-
size: swiperSize,
|
|
8712
8718
|
rtlTranslate: rtl,
|
|
8713
8719
|
wrongRTL
|
|
8714
8720
|
} = swiper;
|
|
@@ -8729,6 +8735,7 @@ function updateSlides() {
|
|
|
8729
8735
|
}
|
|
8730
8736
|
const previousSnapGridLength = swiper.snapGrid.length;
|
|
8731
8737
|
const previousSlidesGridLength = swiper.slidesGrid.length;
|
|
8738
|
+
const swiperSize = swiper.size - offsetBefore - offsetAfter;
|
|
8732
8739
|
let spaceBetween = params.spaceBetween;
|
|
8733
8740
|
let slidePosition = -offsetBefore;
|
|
8734
8741
|
let prevSlideSize = 0;
|
|
@@ -8741,7 +8748,7 @@ function updateSlides() {
|
|
|
8741
8748
|
} else if (typeof spaceBetween === 'string') {
|
|
8742
8749
|
spaceBetween = parseFloat(spaceBetween);
|
|
8743
8750
|
}
|
|
8744
|
-
swiper.virtualSize = -spaceBetween;
|
|
8751
|
+
swiper.virtualSize = -spaceBetween - offsetBefore - offsetAfter;
|
|
8745
8752
|
|
|
8746
8753
|
// reset margins
|
|
8747
8754
|
slides.forEach(slideEl => {
|
|
@@ -8759,6 +8766,12 @@ function updateSlides() {
|
|
|
8759
8766
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
8760
8767
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
8761
8768
|
}
|
|
8769
|
+
|
|
8770
|
+
// set cssMode offsets
|
|
8771
|
+
if (params.cssMode) {
|
|
8772
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-before', `${offsetBefore}px`);
|
|
8773
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-after', `${offsetAfter}px`);
|
|
8774
|
+
}
|
|
8762
8775
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
8763
8776
|
if (gridEnabled) {
|
|
8764
8777
|
swiper.grid.initSlides(slides);
|
|
@@ -8773,16 +8786,25 @@ function updateSlides() {
|
|
|
8773
8786
|
}).length > 0;
|
|
8774
8787
|
for (let i = 0; i < slidesLength; i += 1) {
|
|
8775
8788
|
slideSize = 0;
|
|
8776
|
-
|
|
8777
|
-
if (
|
|
8778
|
-
|
|
8779
|
-
|
|
8789
|
+
const slide = slides[i];
|
|
8790
|
+
if (slide) {
|
|
8791
|
+
if (gridEnabled) {
|
|
8792
|
+
swiper.grid.updateSlide(i, slide, slides);
|
|
8793
|
+
}
|
|
8794
|
+
if (elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8780
8795
|
}
|
|
8781
|
-
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8782
8796
|
|
|
8783
|
-
if (params.slidesPerView === 'auto') {
|
|
8797
|
+
if (isVirtual && params.slidesPerView === 'auto') {
|
|
8798
|
+
if (params.virtual.slidesPerViewAutoSlideSize) {
|
|
8799
|
+
slideSize = params.virtual.slidesPerViewAutoSlideSize;
|
|
8800
|
+
}
|
|
8801
|
+
if (slideSize && slide) {
|
|
8802
|
+
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8803
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8804
|
+
}
|
|
8805
|
+
} else if (params.slidesPerView === 'auto') {
|
|
8784
8806
|
if (shouldResetSlideSize) {
|
|
8785
|
-
|
|
8807
|
+
slide.style[swiper.getDirectionLabel('width')] = ``;
|
|
8786
8808
|
}
|
|
8787
8809
|
const slideStyles = getComputedStyle(slide);
|
|
8788
8810
|
const currentTransform = slide.style.transform;
|
|
@@ -8823,12 +8845,12 @@ function updateSlides() {
|
|
|
8823
8845
|
} else {
|
|
8824
8846
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
8825
8847
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8826
|
-
if (
|
|
8827
|
-
|
|
8848
|
+
if (slide) {
|
|
8849
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8828
8850
|
}
|
|
8829
8851
|
}
|
|
8830
|
-
if (
|
|
8831
|
-
|
|
8852
|
+
if (slide) {
|
|
8853
|
+
slide.swiperSlideSize = slideSize;
|
|
8832
8854
|
}
|
|
8833
8855
|
slidesSizesGrid.push(slideSize);
|
|
8834
8856
|
if (params.centeredSlides) {
|
|
@@ -8862,17 +8884,52 @@ function updateSlides() {
|
|
|
8862
8884
|
|
|
8863
8885
|
// Remove last grid elements depending on width
|
|
8864
8886
|
if (!params.centeredSlides) {
|
|
8887
|
+
// Check if snapToSlideEdge should be applied
|
|
8888
|
+
const isFractionalSlidesPerView = params.slidesPerView !== 'auto' && params.slidesPerView % 1 !== 0;
|
|
8889
|
+
const shouldSnapToSlideEdge = params.snapToSlideEdge && !params.loop && (params.slidesPerView === 'auto' || isFractionalSlidesPerView);
|
|
8890
|
+
|
|
8891
|
+
// Calculate the last allowed snap index when snapToSlideEdge is enabled
|
|
8892
|
+
// This ensures minimum slides are visible at the end
|
|
8893
|
+
let lastAllowedSnapIndex = snapGrid.length;
|
|
8894
|
+
if (shouldSnapToSlideEdge) {
|
|
8895
|
+
let minVisibleSlides;
|
|
8896
|
+
if (params.slidesPerView === 'auto') {
|
|
8897
|
+
// For 'auto' mode, calculate how many slides fit based on actual sizes
|
|
8898
|
+
minVisibleSlides = 1;
|
|
8899
|
+
let accumulatedSize = 0;
|
|
8900
|
+
for (let i = slidesSizesGrid.length - 1; i >= 0; i -= 1) {
|
|
8901
|
+
accumulatedSize += slidesSizesGrid[i] + (i < slidesSizesGrid.length - 1 ? spaceBetween : 0);
|
|
8902
|
+
if (accumulatedSize <= swiperSize) {
|
|
8903
|
+
minVisibleSlides = slidesSizesGrid.length - i;
|
|
8904
|
+
} else {
|
|
8905
|
+
break;
|
|
8906
|
+
}
|
|
8907
|
+
}
|
|
8908
|
+
} else {
|
|
8909
|
+
minVisibleSlides = Math.floor(params.slidesPerView);
|
|
8910
|
+
}
|
|
8911
|
+
lastAllowedSnapIndex = Math.max(slidesLength - minVisibleSlides, 0);
|
|
8912
|
+
}
|
|
8865
8913
|
const newSlidesGrid = [];
|
|
8866
8914
|
for (let i = 0; i < snapGrid.length; i += 1) {
|
|
8867
8915
|
let slidesGridItem = snapGrid[i];
|
|
8868
8916
|
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
|
8869
|
-
if (
|
|
8917
|
+
if (shouldSnapToSlideEdge) {
|
|
8918
|
+
// When snapToSlideEdge is enabled, only keep snaps up to lastAllowedSnapIndex
|
|
8919
|
+
if (i <= lastAllowedSnapIndex) {
|
|
8920
|
+
newSlidesGrid.push(slidesGridItem);
|
|
8921
|
+
}
|
|
8922
|
+
} else if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
8923
|
+
// When snapToSlideEdge is disabled, keep snaps that fit within scrollable area
|
|
8870
8924
|
newSlidesGrid.push(slidesGridItem);
|
|
8871
8925
|
}
|
|
8872
8926
|
}
|
|
8873
8927
|
snapGrid = newSlidesGrid;
|
|
8874
8928
|
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
|
8875
|
-
|
|
8929
|
+
// Only add edge-aligned snap if snapToSlideEdge is not enabled
|
|
8930
|
+
if (!shouldSnapToSlideEdge) {
|
|
8931
|
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8932
|
+
}
|
|
8876
8933
|
}
|
|
8877
8934
|
}
|
|
8878
8935
|
if (isVirtual && params.loop) {
|
|
@@ -8911,7 +8968,7 @@ function updateSlides() {
|
|
|
8911
8968
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8912
8969
|
});
|
|
8913
8970
|
allSlidesSize -= spaceBetween;
|
|
8914
|
-
const maxSnap = allSlidesSize - swiperSize;
|
|
8971
|
+
const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
|
|
8915
8972
|
snapGrid = snapGrid.map(snap => {
|
|
8916
8973
|
if (snap <= 0) return -offsetBefore;
|
|
8917
8974
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -8924,9 +8981,8 @@ function updateSlides() {
|
|
|
8924
8981
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8925
8982
|
});
|
|
8926
8983
|
allSlidesSize -= spaceBetween;
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
8984
|
+
if (allSlidesSize < swiperSize) {
|
|
8985
|
+
const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
|
8930
8986
|
snapGrid.forEach((snap, snapIndex) => {
|
|
8931
8987
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
8932
8988
|
});
|
|
@@ -9037,10 +9093,7 @@ const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
|
9037
9093
|
slideEl.classList.remove(className);
|
|
9038
9094
|
}
|
|
9039
9095
|
};
|
|
9040
|
-
function updateSlidesProgress(translate) {
|
|
9041
|
-
if (translate === void 0) {
|
|
9042
|
-
translate = this && this.translate || 0;
|
|
9043
|
-
}
|
|
9096
|
+
function updateSlidesProgress(translate = this && this.translate || 0) {
|
|
9044
9097
|
const swiper = this;
|
|
9045
9098
|
const params = swiper.params;
|
|
9046
9099
|
const {
|
|
@@ -9180,9 +9233,9 @@ function updateSlidesClasses() {
|
|
|
9180
9233
|
}
|
|
9181
9234
|
} else {
|
|
9182
9235
|
if (gridEnabled) {
|
|
9183
|
-
activeSlide = slides.
|
|
9184
|
-
nextSlide = slides.
|
|
9185
|
-
prevSlide = slides.
|
|
9236
|
+
activeSlide = slides.find(slideEl => slideEl.column === activeIndex);
|
|
9237
|
+
nextSlide = slides.find(slideEl => slideEl.column === activeIndex + 1);
|
|
9238
|
+
prevSlide = slides.find(slideEl => slideEl.column === activeIndex - 1);
|
|
9186
9239
|
} else {
|
|
9187
9240
|
activeSlide = slides[activeIndex];
|
|
9188
9241
|
}
|
|
@@ -9224,12 +9277,13 @@ const processLazyPreloader = (swiper, imageEl) => {
|
|
|
9224
9277
|
requestAnimationFrame(() => {
|
|
9225
9278
|
if (slideEl.shadowRoot) {
|
|
9226
9279
|
lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
|
|
9227
|
-
if (lazyEl) lazyEl.remove();
|
|
9280
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9228
9281
|
}
|
|
9229
9282
|
});
|
|
9230
9283
|
}
|
|
9231
9284
|
}
|
|
9232
|
-
if
|
|
9285
|
+
// Skip removal if managed by React/Vue component
|
|
9286
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9233
9287
|
}
|
|
9234
9288
|
};
|
|
9235
9289
|
const unlazy = (swiper, index) => {
|
|
@@ -9344,10 +9398,14 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
9344
9398
|
|
|
9345
9399
|
// Get real index
|
|
9346
9400
|
let realIndex;
|
|
9347
|
-
if (swiper.virtual && params.virtual.enabled
|
|
9348
|
-
|
|
9401
|
+
if (swiper.virtual && params.virtual.enabled) {
|
|
9402
|
+
if (params.loop) {
|
|
9403
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
9404
|
+
} else {
|
|
9405
|
+
realIndex = activeIndex;
|
|
9406
|
+
}
|
|
9349
9407
|
} else if (gridEnabled) {
|
|
9350
|
-
const firstSlideInColumn = swiper.slides.
|
|
9408
|
+
const firstSlideInColumn = swiper.slides.find(slideEl => slideEl.column === activeIndex);
|
|
9351
9409
|
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
9352
9410
|
if (Number.isNaN(activeSlideIndex)) {
|
|
9353
9411
|
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
@@ -9435,10 +9493,7 @@ var update = {
|
|
|
9435
9493
|
updateClickedSlide
|
|
9436
9494
|
};
|
|
9437
9495
|
|
|
9438
|
-
function getSwiperTranslate(axis) {
|
|
9439
|
-
if (axis === void 0) {
|
|
9440
|
-
axis = this.isHorizontal() ? 'x' : 'y';
|
|
9441
|
-
}
|
|
9496
|
+
function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
|
|
9442
9497
|
const swiper = this;
|
|
9443
9498
|
const {
|
|
9444
9499
|
params,
|
|
@@ -9513,19 +9568,7 @@ function maxTranslate() {
|
|
|
9513
9568
|
return -this.snapGrid[this.snapGrid.length - 1];
|
|
9514
9569
|
}
|
|
9515
9570
|
|
|
9516
|
-
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
9517
|
-
if (translate === void 0) {
|
|
9518
|
-
translate = 0;
|
|
9519
|
-
}
|
|
9520
|
-
if (speed === void 0) {
|
|
9521
|
-
speed = this.params.speed;
|
|
9522
|
-
}
|
|
9523
|
-
if (runCallbacks === void 0) {
|
|
9524
|
-
runCallbacks = true;
|
|
9525
|
-
}
|
|
9526
|
-
if (translateBounds === void 0) {
|
|
9527
|
-
translateBounds = true;
|
|
9528
|
-
}
|
|
9571
|
+
function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
|
|
9529
9572
|
const swiper = this;
|
|
9530
9573
|
const {
|
|
9531
9574
|
params,
|
|
@@ -9613,13 +9656,12 @@ function setTransition(duration, byController) {
|
|
|
9613
9656
|
swiper.emit('setTransition', duration, byController);
|
|
9614
9657
|
}
|
|
9615
9658
|
|
|
9616
|
-
function transitionEmit(
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
} = _ref;
|
|
9659
|
+
function transitionEmit({
|
|
9660
|
+
swiper,
|
|
9661
|
+
runCallbacks,
|
|
9662
|
+
direction,
|
|
9663
|
+
step
|
|
9664
|
+
}) {
|
|
9623
9665
|
const {
|
|
9624
9666
|
activeIndex,
|
|
9625
9667
|
previousIndex
|
|
@@ -9629,11 +9671,9 @@ function transitionEmit(_ref) {
|
|
|
9629
9671
|
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
|
|
9630
9672
|
}
|
|
9631
9673
|
swiper.emit(`transition${step}`);
|
|
9632
|
-
if (runCallbacks &&
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
return;
|
|
9636
|
-
}
|
|
9674
|
+
if (runCallbacks && dir === 'reset') {
|
|
9675
|
+
swiper.emit(`slideResetTransition${step}`);
|
|
9676
|
+
} else if (runCallbacks && activeIndex !== previousIndex) {
|
|
9637
9677
|
swiper.emit(`slideChangeTransition${step}`);
|
|
9638
9678
|
if (dir === 'next') {
|
|
9639
9679
|
swiper.emit(`slideNextTransition${step}`);
|
|
@@ -9643,10 +9683,7 @@ function transitionEmit(_ref) {
|
|
|
9643
9683
|
}
|
|
9644
9684
|
}
|
|
9645
9685
|
|
|
9646
|
-
function transitionStart(runCallbacks, direction) {
|
|
9647
|
-
if (runCallbacks === void 0) {
|
|
9648
|
-
runCallbacks = true;
|
|
9649
|
-
}
|
|
9686
|
+
function transitionStart(runCallbacks = true, direction) {
|
|
9650
9687
|
const swiper = this;
|
|
9651
9688
|
const {
|
|
9652
9689
|
params
|
|
@@ -9663,10 +9700,7 @@ function transitionStart(runCallbacks, direction) {
|
|
|
9663
9700
|
});
|
|
9664
9701
|
}
|
|
9665
9702
|
|
|
9666
|
-
function transitionEnd(runCallbacks, direction) {
|
|
9667
|
-
if (runCallbacks === void 0) {
|
|
9668
|
-
runCallbacks = true;
|
|
9669
|
-
}
|
|
9703
|
+
function transitionEnd(runCallbacks = true, direction) {
|
|
9670
9704
|
const swiper = this;
|
|
9671
9705
|
const {
|
|
9672
9706
|
params
|
|
@@ -9688,13 +9722,7 @@ var transition = {
|
|
|
9688
9722
|
transitionEnd
|
|
9689
9723
|
};
|
|
9690
9724
|
|
|
9691
|
-
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
9692
|
-
if (index === void 0) {
|
|
9693
|
-
index = 0;
|
|
9694
|
-
}
|
|
9695
|
-
if (runCallbacks === void 0) {
|
|
9696
|
-
runCallbacks = true;
|
|
9697
|
-
}
|
|
9725
|
+
function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
9698
9726
|
if (typeof index === 'string') {
|
|
9699
9727
|
index = parseInt(index, 10);
|
|
9700
9728
|
}
|
|
@@ -9758,8 +9786,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9758
9786
|
let direction;
|
|
9759
9787
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
9760
9788
|
|
|
9789
|
+
// initial virtual
|
|
9790
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9791
|
+
const isInitialVirtual = isVirtual && initial;
|
|
9761
9792
|
// Update Index
|
|
9762
|
-
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
9793
|
+
if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) {
|
|
9763
9794
|
swiper.updateActiveIndex(slideIndex);
|
|
9764
9795
|
// Update Height
|
|
9765
9796
|
if (params.autoHeight) {
|
|
@@ -9779,7 +9810,6 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9779
9810
|
const isH = swiper.isHorizontal();
|
|
9780
9811
|
const t = rtl ? translate : -translate;
|
|
9781
9812
|
if (speed === 0) {
|
|
9782
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9783
9813
|
if (isVirtual) {
|
|
9784
9814
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
9785
9815
|
swiper._immediateVirtual = true;
|
|
@@ -9814,6 +9844,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9814
9844
|
}
|
|
9815
9845
|
return true;
|
|
9816
9846
|
}
|
|
9847
|
+
const browser = getBrowser();
|
|
9848
|
+
const isSafari = browser.isSafari;
|
|
9849
|
+
if (isVirtual && !initial && isSafari && swiper.isElement) {
|
|
9850
|
+
swiper.virtual.update(false, false, slideIndex);
|
|
9851
|
+
}
|
|
9817
9852
|
swiper.setTransition(speed);
|
|
9818
9853
|
swiper.setTranslate(translate);
|
|
9819
9854
|
swiper.updateActiveIndex(slideIndex);
|
|
@@ -9839,13 +9874,7 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9839
9874
|
return true;
|
|
9840
9875
|
}
|
|
9841
9876
|
|
|
9842
|
-
function slideToLoop(index, speed, runCallbacks, internal) {
|
|
9843
|
-
if (index === void 0) {
|
|
9844
|
-
index = 0;
|
|
9845
|
-
}
|
|
9846
|
-
if (runCallbacks === void 0) {
|
|
9847
|
-
runCallbacks = true;
|
|
9848
|
-
}
|
|
9877
|
+
function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
9849
9878
|
if (typeof index === 'string') {
|
|
9850
9879
|
const indexAsNumber = parseInt(index, 10);
|
|
9851
9880
|
index = indexAsNumber;
|
|
@@ -9865,32 +9894,35 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9865
9894
|
let targetSlideIndex;
|
|
9866
9895
|
if (gridEnabled) {
|
|
9867
9896
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9868
|
-
targetSlideIndex = swiper.slides.
|
|
9897
|
+
targetSlideIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
9869
9898
|
} else {
|
|
9870
9899
|
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
9871
9900
|
}
|
|
9872
9901
|
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
9873
9902
|
const {
|
|
9874
|
-
centeredSlides
|
|
9903
|
+
centeredSlides,
|
|
9904
|
+
slidesOffsetBefore,
|
|
9905
|
+
slidesOffsetAfter
|
|
9875
9906
|
} = swiper.params;
|
|
9907
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
9876
9908
|
let slidesPerView = swiper.params.slidesPerView;
|
|
9877
9909
|
if (slidesPerView === 'auto') {
|
|
9878
9910
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
9879
9911
|
} else {
|
|
9880
9912
|
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
9881
|
-
if (
|
|
9913
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
9882
9914
|
slidesPerView = slidesPerView + 1;
|
|
9883
9915
|
}
|
|
9884
9916
|
}
|
|
9885
9917
|
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
9886
|
-
if (
|
|
9918
|
+
if (bothDirections) {
|
|
9887
9919
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
9888
9920
|
}
|
|
9889
|
-
if (internal &&
|
|
9921
|
+
if (internal && bothDirections && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
9890
9922
|
needLoopFix = false;
|
|
9891
9923
|
}
|
|
9892
9924
|
if (needLoopFix) {
|
|
9893
|
-
const direction =
|
|
9925
|
+
const direction = bothDirections ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
9894
9926
|
swiper.loopFix({
|
|
9895
9927
|
direction,
|
|
9896
9928
|
slideTo: true,
|
|
@@ -9900,7 +9932,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9900
9932
|
}
|
|
9901
9933
|
if (gridEnabled) {
|
|
9902
9934
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9903
|
-
newIndex = swiper.slides.
|
|
9935
|
+
newIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
9904
9936
|
} else {
|
|
9905
9937
|
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
9906
9938
|
}
|
|
@@ -9913,10 +9945,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9913
9945
|
}
|
|
9914
9946
|
|
|
9915
9947
|
/* eslint no-unused-vars: "off" */
|
|
9916
|
-
function slideNext(speed, runCallbacks, internal) {
|
|
9917
|
-
if (runCallbacks === void 0) {
|
|
9918
|
-
runCallbacks = true;
|
|
9919
|
-
}
|
|
9948
|
+
function slideNext(speed, runCallbacks = true, internal) {
|
|
9920
9949
|
const swiper = this;
|
|
9921
9950
|
const {
|
|
9922
9951
|
enabled,
|
|
@@ -9954,10 +9983,7 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
9954
9983
|
}
|
|
9955
9984
|
|
|
9956
9985
|
/* eslint no-unused-vars: "off" */
|
|
9957
|
-
function slidePrev(speed, runCallbacks, internal) {
|
|
9958
|
-
if (runCallbacks === void 0) {
|
|
9959
|
-
runCallbacks = true;
|
|
9960
|
-
}
|
|
9986
|
+
function slidePrev(speed, runCallbacks = true, internal) {
|
|
9961
9987
|
const swiper = this;
|
|
9962
9988
|
const {
|
|
9963
9989
|
params,
|
|
@@ -9987,8 +10013,9 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
9987
10013
|
}
|
|
9988
10014
|
const normalizedTranslate = normalize(translate);
|
|
9989
10015
|
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
|
10016
|
+
const isFreeMode = params.freeMode && params.freeMode.enabled;
|
|
9990
10017
|
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
|
9991
|
-
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
|
10018
|
+
if (typeof prevSnap === 'undefined' && (params.cssMode || isFreeMode)) {
|
|
9992
10019
|
let prevSnapIndex;
|
|
9993
10020
|
snapGrid.forEach((snap, snapIndex) => {
|
|
9994
10021
|
if (normalizedTranslate >= snap) {
|
|
@@ -9997,7 +10024,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
9997
10024
|
}
|
|
9998
10025
|
});
|
|
9999
10026
|
if (typeof prevSnapIndex !== 'undefined') {
|
|
10000
|
-
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10027
|
+
prevSnap = isFreeMode ? snapGrid[prevSnapIndex] : snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10001
10028
|
}
|
|
10002
10029
|
}
|
|
10003
10030
|
let prevIndex = 0;
|
|
@@ -10022,10 +10049,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
10022
10049
|
}
|
|
10023
10050
|
|
|
10024
10051
|
/* eslint no-unused-vars: "off" */
|
|
10025
|
-
function slideReset(speed, runCallbacks, internal) {
|
|
10026
|
-
if (runCallbacks === void 0) {
|
|
10027
|
-
runCallbacks = true;
|
|
10028
|
-
}
|
|
10052
|
+
function slideReset(speed, runCallbacks = true, internal) {
|
|
10029
10053
|
const swiper = this;
|
|
10030
10054
|
if (swiper.destroyed) return;
|
|
10031
10055
|
if (typeof speed === 'undefined') {
|
|
@@ -10035,13 +10059,7 @@ function slideReset(speed, runCallbacks, internal) {
|
|
|
10035
10059
|
}
|
|
10036
10060
|
|
|
10037
10061
|
/* eslint no-unused-vars: "off" */
|
|
10038
|
-
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
10039
|
-
if (runCallbacks === void 0) {
|
|
10040
|
-
runCallbacks = true;
|
|
10041
|
-
}
|
|
10042
|
-
if (threshold === void 0) {
|
|
10043
|
-
threshold = 0.5;
|
|
10044
|
-
}
|
|
10062
|
+
function slideToClosest(speed, runCallbacks = true, internal, threshold = 0.5) {
|
|
10045
10063
|
const swiper = this;
|
|
10046
10064
|
if (swiper.destroyed) return;
|
|
10047
10065
|
if (typeof speed === 'undefined') {
|
|
@@ -10081,23 +10099,16 @@ function slideToClickedSlide() {
|
|
|
10081
10099
|
slidesEl
|
|
10082
10100
|
} = swiper;
|
|
10083
10101
|
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
10084
|
-
let slideToIndex = swiper.clickedIndex;
|
|
10102
|
+
let slideToIndex = swiper.getSlideIndexWhenGrid(swiper.clickedIndex);
|
|
10085
10103
|
let realIndex;
|
|
10086
10104
|
const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
|
|
10105
|
+
const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
10087
10106
|
if (params.loop) {
|
|
10088
10107
|
if (swiper.animating) return;
|
|
10089
10108
|
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
10090
10109
|
if (params.centeredSlides) {
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10094
|
-
nextTick(() => {
|
|
10095
|
-
swiper.slideTo(slideToIndex);
|
|
10096
|
-
});
|
|
10097
|
-
} else {
|
|
10098
|
-
swiper.slideTo(slideToIndex);
|
|
10099
|
-
}
|
|
10100
|
-
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
10110
|
+
swiper.slideToLoop(realIndex);
|
|
10111
|
+
} else if (slideToIndex > (isGrid ? (swiper.slides.length - slidesPerView) / 2 - (swiper.params.grid.rows - 1) : swiper.slides.length - slidesPerView)) {
|
|
10101
10112
|
swiper.loopFix();
|
|
10102
10113
|
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10103
10114
|
nextTick(() => {
|
|
@@ -10121,7 +10132,7 @@ var slide = {
|
|
|
10121
10132
|
slideToClickedSlide
|
|
10122
10133
|
};
|
|
10123
10134
|
|
|
10124
|
-
function loopCreate(slideRealIndex) {
|
|
10135
|
+
function loopCreate(slideRealIndex, initial) {
|
|
10125
10136
|
const swiper = this;
|
|
10126
10137
|
const {
|
|
10127
10138
|
params,
|
|
@@ -10134,7 +10145,20 @@ function loopCreate(slideRealIndex) {
|
|
|
10134
10145
|
el.setAttribute('data-swiper-slide-index', index);
|
|
10135
10146
|
});
|
|
10136
10147
|
};
|
|
10148
|
+
const clearBlankSlides = () => {
|
|
10149
|
+
const slides = elementChildren(slidesEl, `.${params.slideBlankClass}`);
|
|
10150
|
+
slides.forEach(el => {
|
|
10151
|
+
el.remove();
|
|
10152
|
+
});
|
|
10153
|
+
if (slides.length > 0) {
|
|
10154
|
+
swiper.recalcSlides();
|
|
10155
|
+
swiper.updateSlides();
|
|
10156
|
+
}
|
|
10157
|
+
};
|
|
10137
10158
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10159
|
+
if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
|
|
10160
|
+
clearBlankSlides();
|
|
10161
|
+
}
|
|
10138
10162
|
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
10139
10163
|
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
10140
10164
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
@@ -10167,22 +10191,24 @@ function loopCreate(slideRealIndex) {
|
|
|
10167
10191
|
} else {
|
|
10168
10192
|
initSlides();
|
|
10169
10193
|
}
|
|
10194
|
+
const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
|
|
10170
10195
|
swiper.loopFix({
|
|
10171
10196
|
slideRealIndex,
|
|
10172
|
-
direction:
|
|
10197
|
+
direction: bothDirections ? undefined : 'next',
|
|
10198
|
+
initial
|
|
10173
10199
|
});
|
|
10174
10200
|
}
|
|
10175
10201
|
|
|
10176
|
-
function loopFix(
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10202
|
+
function loopFix({
|
|
10203
|
+
slideRealIndex,
|
|
10204
|
+
slideTo = true,
|
|
10205
|
+
direction,
|
|
10206
|
+
setTranslate,
|
|
10207
|
+
activeSlideIndex,
|
|
10208
|
+
initial,
|
|
10209
|
+
byController,
|
|
10210
|
+
byMousewheel
|
|
10211
|
+
} = {}) {
|
|
10186
10212
|
const swiper = this;
|
|
10187
10213
|
if (!swiper.params.loop) return;
|
|
10188
10214
|
swiper.emit('beforeLoopFix');
|
|
@@ -10194,15 +10220,19 @@ function loopFix(_temp) {
|
|
|
10194
10220
|
params
|
|
10195
10221
|
} = swiper;
|
|
10196
10222
|
const {
|
|
10197
|
-
centeredSlides
|
|
10223
|
+
centeredSlides,
|
|
10224
|
+
slidesOffsetBefore,
|
|
10225
|
+
slidesOffsetAfter,
|
|
10226
|
+
initialSlide
|
|
10198
10227
|
} = params;
|
|
10228
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
10199
10229
|
swiper.allowSlidePrev = true;
|
|
10200
10230
|
swiper.allowSlideNext = true;
|
|
10201
10231
|
if (swiper.virtual && params.virtual.enabled) {
|
|
10202
10232
|
if (slideTo) {
|
|
10203
|
-
if (!
|
|
10233
|
+
if (!bothDirections && swiper.snapIndex === 0) {
|
|
10204
10234
|
swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
|
|
10205
|
-
} else if (
|
|
10235
|
+
} else if (bothDirections && swiper.snapIndex < params.slidesPerView) {
|
|
10206
10236
|
swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
|
|
10207
10237
|
} else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
|
|
10208
10238
|
swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
|
|
@@ -10218,28 +10248,30 @@ function loopFix(_temp) {
|
|
|
10218
10248
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
10219
10249
|
} else {
|
|
10220
10250
|
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
10221
|
-
if (
|
|
10251
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
10222
10252
|
slidesPerView = slidesPerView + 1;
|
|
10223
10253
|
}
|
|
10224
10254
|
}
|
|
10225
10255
|
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
10226
|
-
let loopedSlides = slidesPerGroup;
|
|
10256
|
+
let loopedSlides = bothDirections ? Math.max(slidesPerGroup, Math.ceil(slidesPerView / 2)) : slidesPerGroup;
|
|
10227
10257
|
if (loopedSlides % slidesPerGroup !== 0) {
|
|
10228
10258
|
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
10229
10259
|
}
|
|
10230
10260
|
loopedSlides += params.loopAdditionalSlides;
|
|
10231
10261
|
swiper.loopedSlides = loopedSlides;
|
|
10232
10262
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10233
|
-
if (slides.length < slidesPerView + loopedSlides) {
|
|
10234
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled
|
|
10263
|
+
if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
10264
|
+
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
|
|
10235
10265
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
10236
10266
|
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
10237
10267
|
}
|
|
10238
10268
|
const prependSlidesIndexes = [];
|
|
10239
10269
|
const appendSlidesIndexes = [];
|
|
10240
|
-
|
|
10270
|
+
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10271
|
+
const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
|
|
10272
|
+
let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
|
|
10241
10273
|
if (typeof activeSlideIndex === 'undefined') {
|
|
10242
|
-
activeSlideIndex = swiper.getSlideIndex(slides.
|
|
10274
|
+
activeSlideIndex = swiper.getSlideIndex(slides.find(el => el.classList.contains(params.slideActiveClass)));
|
|
10243
10275
|
} else {
|
|
10244
10276
|
activeIndex = activeSlideIndex;
|
|
10245
10277
|
}
|
|
@@ -10247,9 +10279,8 @@ function loopFix(_temp) {
|
|
|
10247
10279
|
const isPrev = direction === 'prev' || !direction;
|
|
10248
10280
|
let slidesPrepended = 0;
|
|
10249
10281
|
let slidesAppended = 0;
|
|
10250
|
-
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10251
10282
|
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
10252
|
-
const activeColIndexWithShift = activeColIndex + (
|
|
10283
|
+
const activeColIndexWithShift = activeColIndex + (bothDirections && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
10253
10284
|
// prepend last slides before start
|
|
10254
10285
|
if (activeColIndexWithShift < loopedSlides) {
|
|
10255
10286
|
slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
|
|
@@ -10269,6 +10300,9 @@ function loopFix(_temp) {
|
|
|
10269
10300
|
}
|
|
10270
10301
|
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
10271
10302
|
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
10303
|
+
if (isInitialOverflow) {
|
|
10304
|
+
slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
|
|
10305
|
+
}
|
|
10272
10306
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
10273
10307
|
const index = i - Math.floor(i / cols) * cols;
|
|
10274
10308
|
if (gridEnabled) {
|
|
@@ -10284,6 +10318,14 @@ function loopFix(_temp) {
|
|
|
10284
10318
|
requestAnimationFrame(() => {
|
|
10285
10319
|
swiper.__preventObserver__ = false;
|
|
10286
10320
|
});
|
|
10321
|
+
if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
10322
|
+
if (appendSlidesIndexes.includes(activeSlideIndex)) {
|
|
10323
|
+
appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10324
|
+
}
|
|
10325
|
+
if (prependSlidesIndexes.includes(activeSlideIndex)) {
|
|
10326
|
+
prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10327
|
+
}
|
|
10328
|
+
}
|
|
10287
10329
|
if (isPrev) {
|
|
10288
10330
|
prependSlidesIndexes.forEach(index => {
|
|
10289
10331
|
slides[index].swiperLoopMoveDOM = true;
|
|
@@ -10384,7 +10426,7 @@ function loopDestroy() {
|
|
|
10384
10426
|
params,
|
|
10385
10427
|
slidesEl
|
|
10386
10428
|
} = swiper;
|
|
10387
|
-
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10429
|
+
if (!params.loop || !slidesEl || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10388
10430
|
swiper.recalcSlides();
|
|
10389
10431
|
const newSlidesOrder = [];
|
|
10390
10432
|
swiper.slides.forEach(slideEl => {
|
|
@@ -10445,10 +10487,7 @@ var grabCursor = {
|
|
|
10445
10487
|
};
|
|
10446
10488
|
|
|
10447
10489
|
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
10448
|
-
function closestElement(selector, base) {
|
|
10449
|
-
if (base === void 0) {
|
|
10450
|
-
base = this;
|
|
10451
|
-
}
|
|
10490
|
+
function closestElement(selector, base = this) {
|
|
10452
10491
|
function __closestFrom(el) {
|
|
10453
10492
|
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
10454
10493
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
@@ -10510,7 +10549,7 @@ function onTouchStart(event) {
|
|
|
10510
10549
|
}
|
|
10511
10550
|
let targetEl = e.target;
|
|
10512
10551
|
if (params.touchEventsTarget === 'wrapper') {
|
|
10513
|
-
if (!swiper.wrapperEl
|
|
10552
|
+
if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return;
|
|
10514
10553
|
}
|
|
10515
10554
|
if ('which' in e && e.which === 3) return;
|
|
10516
10555
|
if ('button' in e && e.button > 0) return;
|
|
@@ -10565,7 +10604,7 @@ function onTouchStart(event) {
|
|
|
10565
10604
|
data.isTouched = false;
|
|
10566
10605
|
}
|
|
10567
10606
|
}
|
|
10568
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
|
|
10607
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl && (e.pointerType === 'mouse' || e.pointerType !== 'mouse' && !targetEl.matches(data.focusableElements))) {
|
|
10569
10608
|
document.activeElement.blur();
|
|
10570
10609
|
}
|
|
10571
10610
|
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
@@ -10599,7 +10638,7 @@ function onTouchMove(event) {
|
|
|
10599
10638
|
}
|
|
10600
10639
|
let targetTouch;
|
|
10601
10640
|
if (e.type === 'touchmove') {
|
|
10602
|
-
targetTouch = [...e.changedTouches].
|
|
10641
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
10603
10642
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10604
10643
|
} else {
|
|
10605
10644
|
targetTouch = e;
|
|
@@ -10640,10 +10679,15 @@ function onTouchMove(event) {
|
|
|
10640
10679
|
data.isMoved = false;
|
|
10641
10680
|
return;
|
|
10642
10681
|
}
|
|
10643
|
-
} else if (pageX
|
|
10682
|
+
} else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
|
|
10683
|
+
return;
|
|
10684
|
+
} else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
10644
10685
|
return;
|
|
10645
10686
|
}
|
|
10646
10687
|
}
|
|
10688
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
|
|
10689
|
+
document.activeElement.blur();
|
|
10690
|
+
}
|
|
10647
10691
|
if (document.activeElement) {
|
|
10648
10692
|
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
10649
10693
|
data.isMoved = true;
|
|
@@ -10739,7 +10783,7 @@ function onTouchMove(event) {
|
|
|
10739
10783
|
}
|
|
10740
10784
|
let loopFixed;
|
|
10741
10785
|
new Date().getTime();
|
|
10742
|
-
if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10786
|
+
if (params._loopSwapReset !== false && data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10743
10787
|
Object.assign(touches, {
|
|
10744
10788
|
startX: pageX,
|
|
10745
10789
|
startY: pageY,
|
|
@@ -10760,7 +10804,7 @@ function onTouchMove(event) {
|
|
|
10760
10804
|
resistanceRatio = 0;
|
|
10761
10805
|
}
|
|
10762
10806
|
if (diff > 0) {
|
|
10763
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {
|
|
10807
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] - (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.activeIndex + 1] + swiper.params.spaceBetween : 0) - swiper.params.spaceBetween : swiper.minTranslate())) {
|
|
10764
10808
|
swiper.loopFix({
|
|
10765
10809
|
direction: 'prev',
|
|
10766
10810
|
setTranslate: true,
|
|
@@ -10774,7 +10818,7 @@ function onTouchMove(event) {
|
|
|
10774
10818
|
}
|
|
10775
10819
|
}
|
|
10776
10820
|
} else if (diff < 0) {
|
|
10777
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {
|
|
10821
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween + (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween : 0) : swiper.maxTranslate())) {
|
|
10778
10822
|
swiper.loopFix({
|
|
10779
10823
|
direction: 'next',
|
|
10780
10824
|
setTranslate: true,
|
|
@@ -10847,7 +10891,7 @@ function onTouchEnd(event) {
|
|
|
10847
10891
|
if (e.pointerId !== data.pointerId) return;
|
|
10848
10892
|
targetTouch = e;
|
|
10849
10893
|
} else {
|
|
10850
|
-
targetTouch = [...e.changedTouches].
|
|
10894
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
10851
10895
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10852
10896
|
}
|
|
10853
10897
|
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
|
|
@@ -11221,9 +11265,12 @@ function setBreakpoint() {
|
|
|
11221
11265
|
} = swiper;
|
|
11222
11266
|
const breakpoints = params.breakpoints;
|
|
11223
11267
|
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
|
|
11268
|
+
const document = getDocument();
|
|
11224
11269
|
|
|
11225
|
-
// Get breakpoint for window width and update parameters
|
|
11226
|
-
const
|
|
11270
|
+
// Get breakpoint for window/container width and update parameters
|
|
11271
|
+
const breakpointsBase = params.breakpointsBase === 'window' || !params.breakpointsBase ? params.breakpointsBase : 'container';
|
|
11272
|
+
const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
|
|
11273
|
+
const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
|
|
11227
11274
|
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
|
11228
11275
|
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
|
11229
11276
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
@@ -11296,10 +11343,7 @@ function setBreakpoint() {
|
|
|
11296
11343
|
swiper.emit('breakpoint', breakpointParams);
|
|
11297
11344
|
}
|
|
11298
11345
|
|
|
11299
|
-
function getBreakpoint(breakpoints, base, containerEl) {
|
|
11300
|
-
if (base === void 0) {
|
|
11301
|
-
base = 'window';
|
|
11302
|
-
}
|
|
11346
|
+
function getBreakpoint(breakpoints, base = 'window', containerEl) {
|
|
11303
11347
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
11304
11348
|
let breakpoint = false;
|
|
11305
11349
|
const window = getWindow();
|
|
@@ -11494,6 +11538,7 @@ var defaults = {
|
|
|
11494
11538
|
// in px
|
|
11495
11539
|
normalizeSlideIndex: true,
|
|
11496
11540
|
centerInsufficientSlides: false,
|
|
11541
|
+
snapToSlideEdge: false,
|
|
11497
11542
|
// Disable swiper and hide navigation when container not overflow
|
|
11498
11543
|
watchOverflow: true,
|
|
11499
11544
|
// Round length
|
|
@@ -11564,10 +11609,7 @@ var defaults = {
|
|
|
11564
11609
|
};
|
|
11565
11610
|
|
|
11566
11611
|
function moduleExtendParams(params, allModulesParams) {
|
|
11567
|
-
return function extendParams(obj) {
|
|
11568
|
-
if (obj === void 0) {
|
|
11569
|
-
obj = {};
|
|
11570
|
-
}
|
|
11612
|
+
return function extendParams(obj = {}) {
|
|
11571
11613
|
const moduleParamName = Object.keys(obj)[0];
|
|
11572
11614
|
const moduleParams = obj[moduleParamName];
|
|
11573
11615
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
@@ -11615,12 +11657,9 @@ const prototypes = {
|
|
|
11615
11657
|
};
|
|
11616
11658
|
const extendedDefaults = {};
|
|
11617
11659
|
class Swiper$1 {
|
|
11618
|
-
constructor() {
|
|
11660
|
+
constructor(...args) {
|
|
11619
11661
|
let el;
|
|
11620
11662
|
let params;
|
|
11621
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11622
|
-
args[_key] = arguments[_key];
|
|
11623
|
-
}
|
|
11624
11663
|
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
|
11625
11664
|
params = args[0];
|
|
11626
11665
|
} else {
|
|
@@ -11654,7 +11693,11 @@ class Swiper$1 {
|
|
|
11654
11693
|
swiper.eventsAnyListeners = [];
|
|
11655
11694
|
swiper.modules = [...swiper.__modules__];
|
|
11656
11695
|
if (params.modules && Array.isArray(params.modules)) {
|
|
11657
|
-
|
|
11696
|
+
params.modules.forEach(mod => {
|
|
11697
|
+
if (typeof mod === 'function' && swiper.modules.indexOf(mod) < 0) {
|
|
11698
|
+
swiper.modules.push(mod);
|
|
11699
|
+
}
|
|
11700
|
+
});
|
|
11658
11701
|
}
|
|
11659
11702
|
const allModulesParams = {};
|
|
11660
11703
|
swiper.modules.forEach(mod => {
|
|
@@ -11799,7 +11842,17 @@ class Swiper$1 {
|
|
|
11799
11842
|
return elementIndex(slideEl) - firstSlideIndex;
|
|
11800
11843
|
}
|
|
11801
11844
|
getSlideIndexByData(index) {
|
|
11802
|
-
return this.getSlideIndex(this.slides.
|
|
11845
|
+
return this.getSlideIndex(this.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index));
|
|
11846
|
+
}
|
|
11847
|
+
getSlideIndexWhenGrid(index) {
|
|
11848
|
+
if (this.grid && this.params.grid && this.params.grid.rows > 1) {
|
|
11849
|
+
if (this.params.grid.fill === 'column') {
|
|
11850
|
+
index = Math.floor(index / this.params.grid.rows);
|
|
11851
|
+
} else if (this.params.grid.fill === 'row') {
|
|
11852
|
+
index = index % Math.ceil(this.slides.length / this.params.grid.rows);
|
|
11853
|
+
}
|
|
11854
|
+
}
|
|
11855
|
+
return index;
|
|
11803
11856
|
}
|
|
11804
11857
|
recalcSlides() {
|
|
11805
11858
|
const swiper = this;
|
|
@@ -11866,13 +11919,7 @@ class Swiper$1 {
|
|
|
11866
11919
|
});
|
|
11867
11920
|
swiper.emit('_slideClasses', updates);
|
|
11868
11921
|
}
|
|
11869
|
-
slidesPerViewDynamic(view, exact) {
|
|
11870
|
-
if (view === void 0) {
|
|
11871
|
-
view = 'current';
|
|
11872
|
-
}
|
|
11873
|
-
if (exact === void 0) {
|
|
11874
|
-
exact = false;
|
|
11875
|
-
}
|
|
11922
|
+
slidesPerViewDynamic(view = 'current', exact = false) {
|
|
11876
11923
|
const swiper = this;
|
|
11877
11924
|
const {
|
|
11878
11925
|
params,
|
|
@@ -11971,10 +12018,7 @@ class Swiper$1 {
|
|
|
11971
12018
|
}
|
|
11972
12019
|
swiper.emit('update');
|
|
11973
12020
|
}
|
|
11974
|
-
changeDirection(newDirection, needUpdate) {
|
|
11975
|
-
if (needUpdate === void 0) {
|
|
11976
|
-
needUpdate = true;
|
|
11977
|
-
}
|
|
12021
|
+
changeDirection(newDirection, needUpdate = true) {
|
|
11978
12022
|
const swiper = this;
|
|
11979
12023
|
const currentDirection = swiper.params.direction;
|
|
11980
12024
|
if (!newDirection) {
|
|
@@ -12100,7 +12144,7 @@ class Swiper$1 {
|
|
|
12100
12144
|
|
|
12101
12145
|
// Create loop
|
|
12102
12146
|
if (swiper.params.loop) {
|
|
12103
|
-
swiper.loopCreate();
|
|
12147
|
+
swiper.loopCreate(undefined, true);
|
|
12104
12148
|
}
|
|
12105
12149
|
|
|
12106
12150
|
// Attach events
|
|
@@ -12129,13 +12173,7 @@ class Swiper$1 {
|
|
|
12129
12173
|
swiper.emit('afterInit');
|
|
12130
12174
|
return swiper;
|
|
12131
12175
|
}
|
|
12132
|
-
destroy(deleteInstance, cleanStyles) {
|
|
12133
|
-
if (deleteInstance === void 0) {
|
|
12134
|
-
deleteInstance = true;
|
|
12135
|
-
}
|
|
12136
|
-
if (cleanStyles === void 0) {
|
|
12137
|
-
cleanStyles = true;
|
|
12138
|
-
}
|
|
12176
|
+
destroy(deleteInstance = true, cleanStyles = true) {
|
|
12139
12177
|
const swiper = this;
|
|
12140
12178
|
const {
|
|
12141
12179
|
params,
|
|
@@ -12224,7 +12262,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
12224
12262
|
Swiper$1.use([Resize, Observer]);
|
|
12225
12263
|
|
|
12226
12264
|
/* underscore in name -> watch for changes */
|
|
12227
|
-
const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', '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', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
|
|
12265
|
+
const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', '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', '_snapToSlideEdge', '_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', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
|
|
12228
12266
|
// modules
|
|
12229
12267
|
'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
|
|
12230
12268
|
|
|
@@ -12241,28 +12279,16 @@ function extend(target, src) {
|
|
|
12241
12279
|
}
|
|
12242
12280
|
});
|
|
12243
12281
|
}
|
|
12244
|
-
function needsNavigation(params) {
|
|
12245
|
-
if (params === void 0) {
|
|
12246
|
-
params = {};
|
|
12247
|
-
}
|
|
12282
|
+
function needsNavigation(params = {}) {
|
|
12248
12283
|
return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';
|
|
12249
12284
|
}
|
|
12250
|
-
function needsPagination(params) {
|
|
12251
|
-
if (params === void 0) {
|
|
12252
|
-
params = {};
|
|
12253
|
-
}
|
|
12285
|
+
function needsPagination(params = {}) {
|
|
12254
12286
|
return params.pagination && typeof params.pagination.el === 'undefined';
|
|
12255
12287
|
}
|
|
12256
|
-
function needsScrollbar(params) {
|
|
12257
|
-
if (params === void 0) {
|
|
12258
|
-
params = {};
|
|
12259
|
-
}
|
|
12288
|
+
function needsScrollbar(params = {}) {
|
|
12260
12289
|
return params.scrollbar && typeof params.scrollbar.el === 'undefined';
|
|
12261
12290
|
}
|
|
12262
|
-
function uniqueClasses(classNames) {
|
|
12263
|
-
if (classNames === void 0) {
|
|
12264
|
-
classNames = '';
|
|
12265
|
-
}
|
|
12291
|
+
function uniqueClasses(classNames = '') {
|
|
12266
12292
|
const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);
|
|
12267
12293
|
const unique = [];
|
|
12268
12294
|
classes.forEach(c => {
|
|
@@ -12270,26 +12296,22 @@ function uniqueClasses(classNames) {
|
|
|
12270
12296
|
});
|
|
12271
12297
|
return unique.join(' ');
|
|
12272
12298
|
}
|
|
12273
|
-
function wrapperClass(className) {
|
|
12274
|
-
if (className === void 0) {
|
|
12275
|
-
className = '';
|
|
12276
|
-
}
|
|
12299
|
+
function wrapperClass(className = '') {
|
|
12277
12300
|
if (!className) return 'swiper-wrapper';
|
|
12278
12301
|
if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;
|
|
12279
12302
|
return className;
|
|
12280
12303
|
}
|
|
12281
12304
|
|
|
12282
|
-
function updateSwiper(
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
} = _ref;
|
|
12305
|
+
function updateSwiper({
|
|
12306
|
+
swiper,
|
|
12307
|
+
slides,
|
|
12308
|
+
passedParams,
|
|
12309
|
+
changedParams,
|
|
12310
|
+
nextEl,
|
|
12311
|
+
prevEl,
|
|
12312
|
+
scrollbarEl,
|
|
12313
|
+
paginationEl
|
|
12314
|
+
}) {
|
|
12293
12315
|
const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');
|
|
12294
12316
|
const {
|
|
12295
12317
|
params: currentParams,
|
|
@@ -12307,7 +12329,7 @@ function updateSwiper(_ref) {
|
|
|
12307
12329
|
let loopNeedDestroy;
|
|
12308
12330
|
let loopNeedEnable;
|
|
12309
12331
|
let loopNeedReloop;
|
|
12310
|
-
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {
|
|
12332
|
+
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && !passedParams.thumbs.swiper.destroyed && currentParams.thumbs && (!currentParams.thumbs.swiper || currentParams.thumbs.swiper.destroyed)) {
|
|
12311
12333
|
needThumbsInit = true;
|
|
12312
12334
|
}
|
|
12313
12335
|
if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {
|
|
@@ -12417,14 +12439,14 @@ function updateSwiper(_ref) {
|
|
|
12417
12439
|
if (!nextEl || typeof nextEl === 'string') {
|
|
12418
12440
|
nextEl = document.createElement('div');
|
|
12419
12441
|
nextEl.classList.add('swiper-button-next');
|
|
12420
|
-
nextEl
|
|
12442
|
+
setInnerHTML(nextEl, swiper.navigation.arrowSvg);
|
|
12421
12443
|
nextEl.part.add('button-next');
|
|
12422
12444
|
swiper.el.appendChild(nextEl);
|
|
12423
12445
|
}
|
|
12424
12446
|
if (!prevEl || typeof prevEl === 'string') {
|
|
12425
12447
|
prevEl = document.createElement('div');
|
|
12426
12448
|
prevEl.classList.add('swiper-button-prev');
|
|
12427
|
-
prevEl
|
|
12449
|
+
setInnerHTML(prevEl, swiper.navigation.arrowSvg);
|
|
12428
12450
|
prevEl.part.add('button-prev');
|
|
12429
12451
|
swiper.el.appendChild(prevEl);
|
|
12430
12452
|
}
|
|
@@ -12452,13 +12474,7 @@ function updateSwiper(_ref) {
|
|
|
12452
12474
|
swiper.update();
|
|
12453
12475
|
}
|
|
12454
12476
|
|
|
12455
|
-
function getParams(obj, splitEvents) {
|
|
12456
|
-
if (obj === void 0) {
|
|
12457
|
-
obj = {};
|
|
12458
|
-
}
|
|
12459
|
-
if (splitEvents === void 0) {
|
|
12460
|
-
splitEvents = true;
|
|
12461
|
-
}
|
|
12477
|
+
function getParams(obj = {}, splitEvents = true) {
|
|
12462
12478
|
const params = {
|
|
12463
12479
|
on: {}
|
|
12464
12480
|
};
|
|
@@ -12504,15 +12520,14 @@ function getParams(obj, splitEvents) {
|
|
|
12504
12520
|
};
|
|
12505
12521
|
}
|
|
12506
12522
|
|
|
12507
|
-
function mountSwiper(
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
} = _ref;
|
|
12523
|
+
function mountSwiper({
|
|
12524
|
+
el,
|
|
12525
|
+
nextEl,
|
|
12526
|
+
prevEl,
|
|
12527
|
+
paginationEl,
|
|
12528
|
+
scrollbarEl,
|
|
12529
|
+
swiper
|
|
12530
|
+
}, swiperParams) {
|
|
12516
12531
|
if (needsNavigation(swiperParams) && nextEl && prevEl) {
|
|
12517
12532
|
swiper.params.navigation.nextEl = nextEl;
|
|
12518
12533
|
swiper.originalParams.navigation.nextEl = nextEl;
|
|
@@ -12573,21 +12588,22 @@ const updateOnVirtualData = swiper => {
|
|
|
12573
12588
|
swiper.updateSlides();
|
|
12574
12589
|
swiper.updateProgress();
|
|
12575
12590
|
swiper.updateSlidesClasses();
|
|
12591
|
+
swiper.emit('_virtualUpdated');
|
|
12576
12592
|
if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
|
|
12577
12593
|
swiper.parallax.setTranslate();
|
|
12578
12594
|
}
|
|
12579
12595
|
};
|
|
12580
12596
|
|
|
12581
12597
|
/**
|
|
12582
|
-
* Swiper React
|
|
12598
|
+
* Swiper React 12.1.2
|
|
12583
12599
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
12584
12600
|
* https://swiperjs.com
|
|
12585
12601
|
*
|
|
12586
|
-
* Copyright 2014-
|
|
12602
|
+
* Copyright 2014-2026 Vladimir Kharlampidi
|
|
12587
12603
|
*
|
|
12588
12604
|
* Released under the MIT License
|
|
12589
12605
|
*
|
|
12590
|
-
* Released on:
|
|
12606
|
+
* Released on: February 18, 2026
|
|
12591
12607
|
*/
|
|
12592
12608
|
|
|
12593
12609
|
function _extends() {
|
|
@@ -12696,15 +12712,14 @@ function useIsomorphicLayoutEffect(callback, deps) {
|
|
|
12696
12712
|
const SwiperSlideContext = /*#__PURE__*/createContext(null);
|
|
12697
12713
|
const SwiperContext = /*#__PURE__*/createContext(null);
|
|
12698
12714
|
|
|
12699
|
-
const Swiper = /*#__PURE__*/forwardRef(
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12707
|
-
} = _temp === void 0 ? {} : _temp;
|
|
12715
|
+
const Swiper = /*#__PURE__*/forwardRef(({
|
|
12716
|
+
className,
|
|
12717
|
+
tag: Tag = 'div',
|
|
12718
|
+
wrapperTag: WrapperTag = 'div',
|
|
12719
|
+
children,
|
|
12720
|
+
onSwiper,
|
|
12721
|
+
...rest
|
|
12722
|
+
} = {}, externalElRef) => {
|
|
12708
12723
|
let eventsAssigned = false;
|
|
12709
12724
|
const [containerClasses, setContainerClasses] = useState('swiper');
|
|
12710
12725
|
const [virtualData, setVirtualData] = useState(null);
|
|
@@ -12880,18 +12895,17 @@ const Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {
|
|
|
12880
12895
|
});
|
|
12881
12896
|
Swiper.displayName = 'Swiper';
|
|
12882
12897
|
|
|
12883
|
-
const SwiperSlide = /*#__PURE__*/forwardRef(
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
} = _temp === void 0 ? {} : _temp;
|
|
12898
|
+
const SwiperSlide = /*#__PURE__*/forwardRef(({
|
|
12899
|
+
tag: Tag = 'div',
|
|
12900
|
+
children,
|
|
12901
|
+
className = '',
|
|
12902
|
+
swiper,
|
|
12903
|
+
zoom,
|
|
12904
|
+
lazy,
|
|
12905
|
+
virtualIndex,
|
|
12906
|
+
swiperSlideIndex,
|
|
12907
|
+
...rest
|
|
12908
|
+
} = {}, externalRef) => {
|
|
12895
12909
|
const slideElRef = useRef(null);
|
|
12896
12910
|
const [slideClasses, setSlideClasses] = useState('swiper-slide');
|
|
12897
12911
|
const [lazyLoaded, setLazyLoaded] = useState(false);
|
|
@@ -12951,11 +12965,17 @@ const SwiperSlide = /*#__PURE__*/forwardRef(function (_temp, externalRef) {
|
|
|
12951
12965
|
className: "swiper-zoom-container",
|
|
12952
12966
|
"data-swiper-zoom": typeof zoom === 'number' ? zoom : undefined
|
|
12953
12967
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
12954
|
-
className: "swiper-lazy-preloader"
|
|
12968
|
+
className: "swiper-lazy-preloader",
|
|
12969
|
+
ref: node => {
|
|
12970
|
+
if (node) node.lazyPreloaderManaged = true;
|
|
12971
|
+
}
|
|
12955
12972
|
}))), !zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {
|
|
12956
12973
|
value: slideData
|
|
12957
12974
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
12958
|
-
className: "swiper-lazy-preloader"
|
|
12975
|
+
className: "swiper-lazy-preloader",
|
|
12976
|
+
ref: node => {
|
|
12977
|
+
if (node) node.lazyPreloaderManaged = true;
|
|
12978
|
+
}
|
|
12959
12979
|
})));
|
|
12960
12980
|
});
|
|
12961
12981
|
SwiperSlide.displayName = 'SwiperSlide';
|
|
@@ -15298,13 +15318,12 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
15298
15318
|
};
|
|
15299
15319
|
|
|
15300
15320
|
/* eslint-disable consistent-return */
|
|
15301
|
-
function Keyboard(
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
} = _ref;
|
|
15321
|
+
function Keyboard({
|
|
15322
|
+
swiper,
|
|
15323
|
+
extendParams,
|
|
15324
|
+
on,
|
|
15325
|
+
emit
|
|
15326
|
+
}) {
|
|
15308
15327
|
const document = getDocument();
|
|
15309
15328
|
const window = getWindow();
|
|
15310
15329
|
swiper.keyboard = {
|
|
@@ -15314,7 +15333,8 @@ function Keyboard(_ref) {
|
|
|
15314
15333
|
keyboard: {
|
|
15315
15334
|
enabled: false,
|
|
15316
15335
|
onlyInViewport: true,
|
|
15317
|
-
pageUpDown: true
|
|
15336
|
+
pageUpDown: true,
|
|
15337
|
+
speed: undefined
|
|
15318
15338
|
}
|
|
15319
15339
|
});
|
|
15320
15340
|
function handle(event) {
|
|
@@ -15342,7 +15362,7 @@ function Keyboard(_ref) {
|
|
|
15342
15362
|
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
|
15343
15363
|
return undefined;
|
|
15344
15364
|
}
|
|
15345
|
-
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
|
15365
|
+
if (document.activeElement && (document.activeElement.isContentEditable || document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea'))) {
|
|
15346
15366
|
return undefined;
|
|
15347
15367
|
}
|
|
15348
15368
|
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
|
|
@@ -15368,18 +15388,19 @@ function Keyboard(_ref) {
|
|
|
15368
15388
|
}
|
|
15369
15389
|
if (!inView) return undefined;
|
|
15370
15390
|
}
|
|
15391
|
+
const speed = swiper.params.keyboard.speed;
|
|
15371
15392
|
if (swiper.isHorizontal()) {
|
|
15372
15393
|
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
|
|
15373
15394
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15374
15395
|
}
|
|
15375
|
-
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
|
|
15376
|
-
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
|
|
15396
|
+
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(speed);
|
|
15397
|
+
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(speed);
|
|
15377
15398
|
} else {
|
|
15378
15399
|
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
|
|
15379
15400
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15380
15401
|
}
|
|
15381
|
-
if (isPageDown || isArrowDown) swiper.slideNext();
|
|
15382
|
-
if (isPageUp || isArrowUp) swiper.slidePrev();
|
|
15402
|
+
if (isPageDown || isArrowDown) swiper.slideNext(speed);
|
|
15403
|
+
if (isPageUp || isArrowUp) swiper.slidePrev(speed);
|
|
15383
15404
|
}
|
|
15384
15405
|
emit('keyPress', kc);
|
|
15385
15406
|
return undefined;
|
|
@@ -15410,12 +15431,11 @@ function Keyboard(_ref) {
|
|
|
15410
15431
|
});
|
|
15411
15432
|
}
|
|
15412
15433
|
|
|
15413
|
-
function History(
|
|
15414
|
-
|
|
15415
|
-
|
|
15416
|
-
|
|
15417
|
-
|
|
15418
|
-
} = _ref;
|
|
15434
|
+
function History({
|
|
15435
|
+
swiper,
|
|
15436
|
+
extendParams,
|
|
15437
|
+
on
|
|
15438
|
+
}) {
|
|
15419
15439
|
extendParams({
|
|
15420
15440
|
history: {
|
|
15421
15441
|
enabled: false,
|
|
@@ -15551,14 +15571,13 @@ function History(_ref) {
|
|
|
15551
15571
|
|
|
15552
15572
|
/* eslint no-underscore-dangle: "off" */
|
|
15553
15573
|
/* eslint no-use-before-define: "off" */
|
|
15554
|
-
function Autoplay(
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
} = _ref;
|
|
15574
|
+
function Autoplay({
|
|
15575
|
+
swiper,
|
|
15576
|
+
extendParams,
|
|
15577
|
+
on,
|
|
15578
|
+
emit,
|
|
15579
|
+
params
|
|
15580
|
+
}) {
|
|
15562
15581
|
swiper.autoplay = {
|
|
15563
15582
|
running: false,
|
|
15564
15583
|
paused: false,
|
|
@@ -15585,7 +15604,6 @@ function Autoplay(_ref) {
|
|
|
15585
15604
|
let isTouched;
|
|
15586
15605
|
let pausedByTouch;
|
|
15587
15606
|
let touchStartTimeout;
|
|
15588
|
-
let slideChanged;
|
|
15589
15607
|
let pausedByInteraction;
|
|
15590
15608
|
let pausedByPointerEnter;
|
|
15591
15609
|
function onTransitionEnd(e) {
|
|
@@ -15615,7 +15633,7 @@ function Autoplay(_ref) {
|
|
|
15615
15633
|
const getSlideDelay = () => {
|
|
15616
15634
|
let activeSlideEl;
|
|
15617
15635
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
|
15618
|
-
activeSlideEl = swiper.slides.
|
|
15636
|
+
activeSlideEl = swiper.slides.find(slideEl => slideEl.classList.contains('swiper-slide-active'));
|
|
15619
15637
|
} else {
|
|
15620
15638
|
activeSlideEl = swiper.slides[swiper.activeIndex];
|
|
15621
15639
|
}
|
|
@@ -15623,18 +15641,23 @@ function Autoplay(_ref) {
|
|
|
15623
15641
|
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
|
15624
15642
|
return currentSlideDelay;
|
|
15625
15643
|
};
|
|
15644
|
+
const getTotalDelay = () => {
|
|
15645
|
+
let totalDelay = swiper.params.autoplay.delay;
|
|
15646
|
+
const currentSlideDelay = getSlideDelay();
|
|
15647
|
+
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0) {
|
|
15648
|
+
totalDelay = currentSlideDelay;
|
|
15649
|
+
}
|
|
15650
|
+
return totalDelay;
|
|
15651
|
+
};
|
|
15626
15652
|
const run = delayForce => {
|
|
15627
15653
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15628
15654
|
cancelAnimationFrame(raf);
|
|
15629
15655
|
calcTimeLeft();
|
|
15630
|
-
let delay =
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
delay = currentSlideDelay;
|
|
15636
|
-
autoplayDelayTotal = currentSlideDelay;
|
|
15637
|
-
autoplayDelayCurrent = currentSlideDelay;
|
|
15656
|
+
let delay = delayForce;
|
|
15657
|
+
if (typeof delay === 'undefined') {
|
|
15658
|
+
delay = getTotalDelay();
|
|
15659
|
+
autoplayDelayTotal = delay;
|
|
15660
|
+
autoplayDelayCurrent = delay;
|
|
15638
15661
|
}
|
|
15639
15662
|
autoplayTimeLeft = delay;
|
|
15640
15663
|
const speed = swiper.params.speed;
|
|
@@ -15706,10 +15729,6 @@ function Autoplay(_ref) {
|
|
|
15706
15729
|
};
|
|
15707
15730
|
swiper.autoplay.paused = true;
|
|
15708
15731
|
if (reset) {
|
|
15709
|
-
if (slideChanged) {
|
|
15710
|
-
autoplayTimeLeft = swiper.params.autoplay.delay;
|
|
15711
|
-
}
|
|
15712
|
-
slideChanged = false;
|
|
15713
15732
|
proceed();
|
|
15714
15733
|
return;
|
|
15715
15734
|
}
|
|
@@ -15840,7 +15859,10 @@ function Autoplay(_ref) {
|
|
|
15840
15859
|
});
|
|
15841
15860
|
on('slideChange', () => {
|
|
15842
15861
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15843
|
-
|
|
15862
|
+
if (swiper.autoplay.paused) {
|
|
15863
|
+
autoplayTimeLeft = getTotalDelay();
|
|
15864
|
+
autoplayDelayTotal = getTotalDelay();
|
|
15865
|
+
}
|
|
15844
15866
|
});
|
|
15845
15867
|
Object.assign(swiper.autoplay, {
|
|
15846
15868
|
start,
|
|
@@ -15850,12 +15872,11 @@ function Autoplay(_ref) {
|
|
|
15850
15872
|
});
|
|
15851
15873
|
}
|
|
15852
15874
|
|
|
15853
|
-
function Thumb(
|
|
15854
|
-
|
|
15855
|
-
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
} = _ref;
|
|
15875
|
+
function Thumb({
|
|
15876
|
+
swiper,
|
|
15877
|
+
extendParams,
|
|
15878
|
+
on
|
|
15879
|
+
}) {
|
|
15859
15880
|
extendParams({
|
|
15860
15881
|
thumbs: {
|
|
15861
15882
|
swiper: null,
|
|
@@ -15870,6 +15891,11 @@ function Thumb(_ref) {
|
|
|
15870
15891
|
swiper.thumbs = {
|
|
15871
15892
|
swiper: null
|
|
15872
15893
|
};
|
|
15894
|
+
function isVirtualEnabled() {
|
|
15895
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15896
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return false;
|
|
15897
|
+
return thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled;
|
|
15898
|
+
}
|
|
15873
15899
|
function onThumbClick() {
|
|
15874
15900
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15875
15901
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
@@ -15897,6 +15923,10 @@ function Thumb(_ref) {
|
|
|
15897
15923
|
initialized = true;
|
|
15898
15924
|
const SwiperClass = swiper.constructor;
|
|
15899
15925
|
if (thumbsParams.swiper instanceof SwiperClass) {
|
|
15926
|
+
if (thumbsParams.swiper.destroyed) {
|
|
15927
|
+
initialized = false;
|
|
15928
|
+
return false;
|
|
15929
|
+
}
|
|
15900
15930
|
swiper.thumbs.swiper = thumbsParams.swiper;
|
|
15901
15931
|
Object.assign(swiper.thumbs.swiper.originalParams, {
|
|
15902
15932
|
watchSlidesProgress: true,
|
|
@@ -15918,12 +15948,18 @@ function Thumb(_ref) {
|
|
|
15918
15948
|
}
|
|
15919
15949
|
swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
|
|
15920
15950
|
swiper.thumbs.swiper.on('tap', onThumbClick);
|
|
15951
|
+
if (isVirtualEnabled()) {
|
|
15952
|
+
swiper.thumbs.swiper.on('virtualUpdate', () => {
|
|
15953
|
+
update(false, {
|
|
15954
|
+
autoScroll: false
|
|
15955
|
+
});
|
|
15956
|
+
});
|
|
15957
|
+
}
|
|
15921
15958
|
return true;
|
|
15922
15959
|
}
|
|
15923
|
-
function update(initial) {
|
|
15960
|
+
function update(initial, p) {
|
|
15924
15961
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15925
15962
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15926
|
-
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15927
15963
|
|
|
15928
15964
|
// Activate thumbs
|
|
15929
15965
|
let thumbsToActivate = 1;
|
|
@@ -15936,7 +15972,7 @@ function Thumb(_ref) {
|
|
|
15936
15972
|
}
|
|
15937
15973
|
thumbsToActivate = Math.floor(thumbsToActivate);
|
|
15938
15974
|
thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
|
|
15939
|
-
if (thumbsSwiper.params.loop ||
|
|
15975
|
+
if (thumbsSwiper.params.loop || isVirtualEnabled()) {
|
|
15940
15976
|
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
15941
15977
|
elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
|
|
15942
15978
|
slideEl.classList.add(thumbActiveClass);
|
|
@@ -15949,6 +15985,14 @@ function Thumb(_ref) {
|
|
|
15949
15985
|
}
|
|
15950
15986
|
}
|
|
15951
15987
|
}
|
|
15988
|
+
if (p?.autoScroll ?? true) {
|
|
15989
|
+
autoScroll(initial ? 0 : undefined);
|
|
15990
|
+
}
|
|
15991
|
+
}
|
|
15992
|
+
function autoScroll(slideSpeed) {
|
|
15993
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15994
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15995
|
+
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15952
15996
|
const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
|
|
15953
15997
|
const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
|
|
15954
15998
|
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
|
|
@@ -15956,7 +16000,7 @@ function Thumb(_ref) {
|
|
|
15956
16000
|
let newThumbsIndex;
|
|
15957
16001
|
let direction;
|
|
15958
16002
|
if (thumbsSwiper.params.loop) {
|
|
15959
|
-
const newThumbsSlide = thumbsSwiper.slides.
|
|
16003
|
+
const newThumbsSlide = thumbsSwiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`);
|
|
15960
16004
|
newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
|
|
15961
16005
|
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
15962
16006
|
} else {
|
|
@@ -15974,7 +16018,7 @@ function Thumb(_ref) {
|
|
|
15974
16018
|
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
|
15975
16019
|
}
|
|
15976
16020
|
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
|
|
15977
|
-
thumbsSwiper.slideTo(newThumbsIndex,
|
|
16021
|
+
thumbsSwiper.slideTo(newThumbsIndex, slideSpeed);
|
|
15978
16022
|
}
|
|
15979
16023
|
}
|
|
15980
16024
|
}
|
|
@@ -15992,15 +16036,16 @@ function Thumb(_ref) {
|
|
|
15992
16036
|
init();
|
|
15993
16037
|
update(true);
|
|
15994
16038
|
} else if (thumbsElement) {
|
|
16039
|
+
const eventName = `${swiper.params.eventsPrefix}init`;
|
|
15995
16040
|
const onThumbsSwiper = e => {
|
|
15996
16041
|
thumbs.swiper = e.detail[0];
|
|
15997
|
-
thumbsElement.removeEventListener(
|
|
16042
|
+
thumbsElement.removeEventListener(eventName, onThumbsSwiper);
|
|
15998
16043
|
init();
|
|
15999
16044
|
update(true);
|
|
16000
16045
|
thumbs.swiper.update();
|
|
16001
16046
|
swiper.update();
|
|
16002
16047
|
};
|
|
16003
|
-
thumbsElement.addEventListener(
|
|
16048
|
+
thumbsElement.addEventListener(eventName, onThumbsSwiper);
|
|
16004
16049
|
}
|
|
16005
16050
|
return thumbsElement;
|
|
16006
16051
|
};
|