@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.cjs.js
CHANGED
|
@@ -15,9 +15,14 @@ var neetoCist = require('@bigbinary/neeto-cist');
|
|
|
15
15
|
var Frame = require('react-frame-component');
|
|
16
16
|
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
17
17
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
18
|
+
require('swiper/scss');
|
|
18
19
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
19
20
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
20
21
|
var axios = require('axios');
|
|
22
|
+
require('swiper/scss/pagination');
|
|
23
|
+
require('swiper/scss/autoplay');
|
|
24
|
+
require('swiper/scss/thumbs');
|
|
25
|
+
require('swiper/scss/history');
|
|
21
26
|
|
|
22
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
28
|
|
|
@@ -5582,7 +5587,7 @@ var StyledWrapper = styled__default["default"].div.attrs(function (props) {
|
|
|
5582
5587
|
position: "absolute",
|
|
5583
5588
|
top: 0,
|
|
5584
5589
|
left: 0,
|
|
5585
|
-
backgroundImage: "url(".concat(backgroundImage.src, ")"),
|
|
5590
|
+
backgroundImage: "url(\"".concat(backgroundImage.src, "\")"),
|
|
5586
5591
|
width: "100%",
|
|
5587
5592
|
height: "100%",
|
|
5588
5593
|
zIndex: -1,
|
|
@@ -7923,28 +7928,23 @@ var CardsClassic = function CardsClassic(_ref) {
|
|
|
7923
7928
|
};
|
|
7924
7929
|
|
|
7925
7930
|
/**
|
|
7926
|
-
* SSR Window
|
|
7931
|
+
* SSR Window 5.0.1
|
|
7927
7932
|
* Better handling for window object in SSR environment
|
|
7928
7933
|
* https://github.com/nolimits4web/ssr-window
|
|
7929
7934
|
*
|
|
7930
|
-
* Copyright
|
|
7935
|
+
* Copyright 2025, Vladimir Kharlampidi
|
|
7931
7936
|
*
|
|
7932
7937
|
* Licensed under MIT
|
|
7933
7938
|
*
|
|
7934
|
-
* Released on:
|
|
7939
|
+
* Released on: June 27, 2025
|
|
7935
7940
|
*/
|
|
7936
7941
|
/* eslint-disable no-param-reassign */
|
|
7937
7942
|
function isObject$2(obj) {
|
|
7938
7943
|
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
7939
7944
|
}
|
|
7940
|
-
function extend$2(target, src) {
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
}
|
|
7944
|
-
if (src === void 0) {
|
|
7945
|
-
src = {};
|
|
7946
|
-
}
|
|
7947
|
-
Object.keys(src).forEach(key => {
|
|
7945
|
+
function extend$2(target = {}, src = {}) {
|
|
7946
|
+
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
7947
|
+
Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {
|
|
7948
7948
|
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) {
|
|
7949
7949
|
extend$2(target[key], src[key]);
|
|
7950
7950
|
}
|
|
@@ -8066,10 +8066,7 @@ function getWindow() {
|
|
|
8066
8066
|
return win;
|
|
8067
8067
|
}
|
|
8068
8068
|
|
|
8069
|
-
function classesToTokens(classes) {
|
|
8070
|
-
if (classes === void 0) {
|
|
8071
|
-
classes = '';
|
|
8072
|
-
}
|
|
8069
|
+
function classesToTokens(classes = '') {
|
|
8073
8070
|
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
8074
8071
|
}
|
|
8075
8072
|
|
|
@@ -8088,10 +8085,7 @@ function deleteProps(obj) {
|
|
|
8088
8085
|
}
|
|
8089
8086
|
});
|
|
8090
8087
|
}
|
|
8091
|
-
function nextTick(callback, delay) {
|
|
8092
|
-
if (delay === void 0) {
|
|
8093
|
-
delay = 0;
|
|
8094
|
-
}
|
|
8088
|
+
function nextTick(callback, delay = 0) {
|
|
8095
8089
|
return setTimeout(callback, delay);
|
|
8096
8090
|
}
|
|
8097
8091
|
function now() {
|
|
@@ -8111,10 +8105,7 @@ function getComputedStyle$1(el) {
|
|
|
8111
8105
|
}
|
|
8112
8106
|
return style;
|
|
8113
8107
|
}
|
|
8114
|
-
function getTranslate(el, axis) {
|
|
8115
|
-
if (axis === void 0) {
|
|
8116
|
-
axis = 'x';
|
|
8117
|
-
}
|
|
8108
|
+
function getTranslate(el, axis = 'x') {
|
|
8118
8109
|
const window = getWindow();
|
|
8119
8110
|
let matrix;
|
|
8120
8111
|
let curTransform;
|
|
@@ -8160,13 +8151,12 @@ function isNode(node) {
|
|
|
8160
8151
|
}
|
|
8161
8152
|
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
8162
8153
|
}
|
|
8163
|
-
function extend$1() {
|
|
8164
|
-
const to = Object(
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
8154
|
+
function extend$1(...args) {
|
|
8155
|
+
const to = Object(args[0]);
|
|
8156
|
+
for (let i = 1; i < args.length; i += 1) {
|
|
8157
|
+
const nextSource = args[i];
|
|
8168
8158
|
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
8169
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key =>
|
|
8159
|
+
const keysArray = Object.keys(Object(nextSource)).filter(key => key !== '__proto__' && key !== 'constructor' && key !== 'prototype');
|
|
8170
8160
|
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
8171
8161
|
const nextKey = keysArray[nextIndex];
|
|
8172
8162
|
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
@@ -8196,12 +8186,11 @@ function extend$1() {
|
|
|
8196
8186
|
function setCSSProperty(el, varName, varValue) {
|
|
8197
8187
|
el.style.setProperty(varName, varValue);
|
|
8198
8188
|
}
|
|
8199
|
-
function animateCSSModeScroll(
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
} = _ref;
|
|
8189
|
+
function animateCSSModeScroll({
|
|
8190
|
+
swiper,
|
|
8191
|
+
targetPosition,
|
|
8192
|
+
side
|
|
8193
|
+
}) {
|
|
8205
8194
|
const window = getWindow();
|
|
8206
8195
|
const startPosition = -swiper.translate;
|
|
8207
8196
|
let startTime = null;
|
|
@@ -8243,11 +8232,39 @@ function animateCSSModeScroll(_ref) {
|
|
|
8243
8232
|
};
|
|
8244
8233
|
animate();
|
|
8245
8234
|
}
|
|
8246
|
-
function elementChildren(element, selector) {
|
|
8247
|
-
|
|
8248
|
-
|
|
8235
|
+
function elementChildren(element, selector = '') {
|
|
8236
|
+
const window = getWindow();
|
|
8237
|
+
const children = [...element.children];
|
|
8238
|
+
if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {
|
|
8239
|
+
children.push(...element.assignedElements());
|
|
8240
|
+
}
|
|
8241
|
+
if (!selector) {
|
|
8242
|
+
return children;
|
|
8243
|
+
}
|
|
8244
|
+
return children.filter(el => el.matches(selector));
|
|
8245
|
+
}
|
|
8246
|
+
function elementIsChildOfSlot(el, slot) {
|
|
8247
|
+
// Breadth-first search through all parent's children and assigned elements
|
|
8248
|
+
const elementsQueue = [slot];
|
|
8249
|
+
while (elementsQueue.length > 0) {
|
|
8250
|
+
const elementToCheck = elementsQueue.shift();
|
|
8251
|
+
if (el === elementToCheck) {
|
|
8252
|
+
return true;
|
|
8253
|
+
}
|
|
8254
|
+
elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));
|
|
8249
8255
|
}
|
|
8250
|
-
|
|
8256
|
+
}
|
|
8257
|
+
function elementIsChildOf(el, parent) {
|
|
8258
|
+
const window = getWindow();
|
|
8259
|
+
let isChild = parent.contains(el);
|
|
8260
|
+
if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {
|
|
8261
|
+
const children = [...parent.assignedElements()];
|
|
8262
|
+
isChild = children.includes(el);
|
|
8263
|
+
if (!isChild) {
|
|
8264
|
+
isChild = elementIsChildOfSlot(el, parent);
|
|
8265
|
+
}
|
|
8266
|
+
}
|
|
8267
|
+
return isChild;
|
|
8251
8268
|
}
|
|
8252
8269
|
function showWarning(text) {
|
|
8253
8270
|
try {
|
|
@@ -8257,10 +8274,7 @@ function showWarning(text) {
|
|
|
8257
8274
|
// err
|
|
8258
8275
|
}
|
|
8259
8276
|
}
|
|
8260
|
-
function createElement(tag, classes) {
|
|
8261
|
-
if (classes === void 0) {
|
|
8262
|
-
classes = [];
|
|
8263
|
-
}
|
|
8277
|
+
function createElement(tag, classes = []) {
|
|
8264
8278
|
const el = document.createElement(tag);
|
|
8265
8279
|
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
8266
8280
|
return el;
|
|
@@ -8338,6 +8352,15 @@ function elementOuterSize(el, size, includeMargins) {
|
|
|
8338
8352
|
}
|
|
8339
8353
|
return el.offsetWidth;
|
|
8340
8354
|
}
|
|
8355
|
+
function setInnerHTML(el, html = '') {
|
|
8356
|
+
if (typeof trustedTypes !== 'undefined') {
|
|
8357
|
+
el.innerHTML = trustedTypes.createPolicy('html', {
|
|
8358
|
+
createHTML: s => s
|
|
8359
|
+
}).createHTML(html);
|
|
8360
|
+
} else {
|
|
8361
|
+
el.innerHTML = html;
|
|
8362
|
+
}
|
|
8363
|
+
}
|
|
8341
8364
|
|
|
8342
8365
|
let support;
|
|
8343
8366
|
function calcSupport() {
|
|
@@ -8356,10 +8379,9 @@ function getSupport() {
|
|
|
8356
8379
|
}
|
|
8357
8380
|
|
|
8358
8381
|
let deviceCached;
|
|
8359
|
-
function calcDevice(
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
} = _temp === void 0 ? {} : _temp;
|
|
8382
|
+
function calcDevice({
|
|
8383
|
+
userAgent
|
|
8384
|
+
} = {}) {
|
|
8363
8385
|
const support = getSupport();
|
|
8364
8386
|
const window = getWindow();
|
|
8365
8387
|
const platform = window.navigator.platform;
|
|
@@ -8371,7 +8393,7 @@ function calcDevice(_temp) {
|
|
|
8371
8393
|
const screenWidth = window.screen.width;
|
|
8372
8394
|
const screenHeight = window.screen.height;
|
|
8373
8395
|
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
|
8374
|
-
let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
8396
|
+
let ipad = ua.match(/(iPad)(?!\1).*OS\s([\d_]+)/);
|
|
8375
8397
|
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
8376
8398
|
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
|
8377
8399
|
const windows = platform === 'Win32';
|
|
@@ -8398,10 +8420,7 @@ function calcDevice(_temp) {
|
|
|
8398
8420
|
// Export object
|
|
8399
8421
|
return device;
|
|
8400
8422
|
}
|
|
8401
|
-
function getDevice(overrides) {
|
|
8402
|
-
if (overrides === void 0) {
|
|
8403
|
-
overrides = {};
|
|
8404
|
-
}
|
|
8423
|
+
function getDevice(overrides = {}) {
|
|
8405
8424
|
if (!deviceCached) {
|
|
8406
8425
|
deviceCached = calcDevice(overrides);
|
|
8407
8426
|
}
|
|
@@ -8441,12 +8460,11 @@ function getBrowser() {
|
|
|
8441
8460
|
return browser;
|
|
8442
8461
|
}
|
|
8443
8462
|
|
|
8444
|
-
function Resize(
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
} = _ref;
|
|
8463
|
+
function Resize({
|
|
8464
|
+
swiper,
|
|
8465
|
+
on,
|
|
8466
|
+
emit
|
|
8467
|
+
}) {
|
|
8450
8468
|
const window = getWindow();
|
|
8451
8469
|
let observer = null;
|
|
8452
8470
|
let animationFrame = null;
|
|
@@ -8465,12 +8483,11 @@ function Resize(_ref) {
|
|
|
8465
8483
|
} = swiper;
|
|
8466
8484
|
let newWidth = width;
|
|
8467
8485
|
let newHeight = height;
|
|
8468
|
-
entries.forEach(
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
} = _ref2;
|
|
8486
|
+
entries.forEach(({
|
|
8487
|
+
contentBoxSize,
|
|
8488
|
+
contentRect,
|
|
8489
|
+
target
|
|
8490
|
+
}) => {
|
|
8474
8491
|
if (target && target !== swiper.el) return;
|
|
8475
8492
|
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
|
8476
8493
|
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
|
@@ -8510,19 +8527,15 @@ function Resize(_ref) {
|
|
|
8510
8527
|
});
|
|
8511
8528
|
}
|
|
8512
8529
|
|
|
8513
|
-
function Observer(
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
} = _ref;
|
|
8530
|
+
function Observer({
|
|
8531
|
+
swiper,
|
|
8532
|
+
extendParams,
|
|
8533
|
+
on,
|
|
8534
|
+
emit
|
|
8535
|
+
}) {
|
|
8520
8536
|
const observers = [];
|
|
8521
8537
|
const window = getWindow();
|
|
8522
|
-
const attach =
|
|
8523
|
-
if (options === void 0) {
|
|
8524
|
-
options = {};
|
|
8525
|
-
}
|
|
8538
|
+
const attach = (target, options = {}) => {
|
|
8526
8539
|
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
|
8527
8540
|
const observer = new ObserverFunc(mutations => {
|
|
8528
8541
|
// The observerUpdate event should only be triggered
|
|
@@ -8544,7 +8557,7 @@ function Observer(_ref) {
|
|
|
8544
8557
|
});
|
|
8545
8558
|
observer.observe(target, {
|
|
8546
8559
|
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
|
8547
|
-
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
|
8560
|
+
childList: swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,
|
|
8548
8561
|
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
|
8549
8562
|
});
|
|
8550
8563
|
observers.push(observer);
|
|
@@ -8600,14 +8613,11 @@ var eventsEmitter = {
|
|
|
8600
8613
|
const self = this;
|
|
8601
8614
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8602
8615
|
if (typeof handler !== 'function') return self;
|
|
8603
|
-
function onceHandler() {
|
|
8616
|
+
function onceHandler(...args) {
|
|
8604
8617
|
self.off(events, onceHandler);
|
|
8605
8618
|
if (onceHandler.__emitterProxy) {
|
|
8606
8619
|
delete onceHandler.__emitterProxy;
|
|
8607
8620
|
}
|
|
8608
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8609
|
-
args[_key] = arguments[_key];
|
|
8610
|
-
}
|
|
8611
8621
|
handler.apply(self, args);
|
|
8612
8622
|
}
|
|
8613
8623
|
onceHandler.__emitterProxy = handler;
|
|
@@ -8650,16 +8660,13 @@ var eventsEmitter = {
|
|
|
8650
8660
|
});
|
|
8651
8661
|
return self;
|
|
8652
8662
|
},
|
|
8653
|
-
emit() {
|
|
8663
|
+
emit(...args) {
|
|
8654
8664
|
const self = this;
|
|
8655
8665
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8656
8666
|
if (!self.eventsListeners) return self;
|
|
8657
8667
|
let events;
|
|
8658
8668
|
let data;
|
|
8659
8669
|
let context;
|
|
8660
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8661
|
-
args[_key2] = arguments[_key2];
|
|
8662
|
-
}
|
|
8663
8670
|
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
|
8664
8671
|
events = args[0];
|
|
8665
8672
|
data = args.slice(1, args.length);
|
|
@@ -8727,7 +8734,6 @@ function updateSlides() {
|
|
|
8727
8734
|
const {
|
|
8728
8735
|
wrapperEl,
|
|
8729
8736
|
slidesEl,
|
|
8730
|
-
size: swiperSize,
|
|
8731
8737
|
rtlTranslate: rtl,
|
|
8732
8738
|
wrongRTL
|
|
8733
8739
|
} = swiper;
|
|
@@ -8748,6 +8754,7 @@ function updateSlides() {
|
|
|
8748
8754
|
}
|
|
8749
8755
|
const previousSnapGridLength = swiper.snapGrid.length;
|
|
8750
8756
|
const previousSlidesGridLength = swiper.slidesGrid.length;
|
|
8757
|
+
const swiperSize = swiper.size - offsetBefore - offsetAfter;
|
|
8751
8758
|
let spaceBetween = params.spaceBetween;
|
|
8752
8759
|
let slidePosition = -offsetBefore;
|
|
8753
8760
|
let prevSlideSize = 0;
|
|
@@ -8760,7 +8767,7 @@ function updateSlides() {
|
|
|
8760
8767
|
} else if (typeof spaceBetween === 'string') {
|
|
8761
8768
|
spaceBetween = parseFloat(spaceBetween);
|
|
8762
8769
|
}
|
|
8763
|
-
swiper.virtualSize = -spaceBetween;
|
|
8770
|
+
swiper.virtualSize = -spaceBetween - offsetBefore - offsetAfter;
|
|
8764
8771
|
|
|
8765
8772
|
// reset margins
|
|
8766
8773
|
slides.forEach(slideEl => {
|
|
@@ -8778,6 +8785,12 @@ function updateSlides() {
|
|
|
8778
8785
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
8779
8786
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
8780
8787
|
}
|
|
8788
|
+
|
|
8789
|
+
// set cssMode offsets
|
|
8790
|
+
if (params.cssMode) {
|
|
8791
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-before', `${offsetBefore}px`);
|
|
8792
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-after', `${offsetAfter}px`);
|
|
8793
|
+
}
|
|
8781
8794
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
8782
8795
|
if (gridEnabled) {
|
|
8783
8796
|
swiper.grid.initSlides(slides);
|
|
@@ -8792,16 +8805,25 @@ function updateSlides() {
|
|
|
8792
8805
|
}).length > 0;
|
|
8793
8806
|
for (let i = 0; i < slidesLength; i += 1) {
|
|
8794
8807
|
slideSize = 0;
|
|
8795
|
-
|
|
8796
|
-
if (
|
|
8797
|
-
|
|
8798
|
-
|
|
8808
|
+
const slide = slides[i];
|
|
8809
|
+
if (slide) {
|
|
8810
|
+
if (gridEnabled) {
|
|
8811
|
+
swiper.grid.updateSlide(i, slide, slides);
|
|
8812
|
+
}
|
|
8813
|
+
if (elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8799
8814
|
}
|
|
8800
|
-
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8801
8815
|
|
|
8802
|
-
if (params.slidesPerView === 'auto') {
|
|
8816
|
+
if (isVirtual && params.slidesPerView === 'auto') {
|
|
8817
|
+
if (params.virtual.slidesPerViewAutoSlideSize) {
|
|
8818
|
+
slideSize = params.virtual.slidesPerViewAutoSlideSize;
|
|
8819
|
+
}
|
|
8820
|
+
if (slideSize && slide) {
|
|
8821
|
+
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8822
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8823
|
+
}
|
|
8824
|
+
} else if (params.slidesPerView === 'auto') {
|
|
8803
8825
|
if (shouldResetSlideSize) {
|
|
8804
|
-
|
|
8826
|
+
slide.style[swiper.getDirectionLabel('width')] = ``;
|
|
8805
8827
|
}
|
|
8806
8828
|
const slideStyles = getComputedStyle(slide);
|
|
8807
8829
|
const currentTransform = slide.style.transform;
|
|
@@ -8842,12 +8864,12 @@ function updateSlides() {
|
|
|
8842
8864
|
} else {
|
|
8843
8865
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
8844
8866
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8845
|
-
if (
|
|
8846
|
-
|
|
8867
|
+
if (slide) {
|
|
8868
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8847
8869
|
}
|
|
8848
8870
|
}
|
|
8849
|
-
if (
|
|
8850
|
-
|
|
8871
|
+
if (slide) {
|
|
8872
|
+
slide.swiperSlideSize = slideSize;
|
|
8851
8873
|
}
|
|
8852
8874
|
slidesSizesGrid.push(slideSize);
|
|
8853
8875
|
if (params.centeredSlides) {
|
|
@@ -8881,17 +8903,52 @@ function updateSlides() {
|
|
|
8881
8903
|
|
|
8882
8904
|
// Remove last grid elements depending on width
|
|
8883
8905
|
if (!params.centeredSlides) {
|
|
8906
|
+
// Check if snapToSlideEdge should be applied
|
|
8907
|
+
const isFractionalSlidesPerView = params.slidesPerView !== 'auto' && params.slidesPerView % 1 !== 0;
|
|
8908
|
+
const shouldSnapToSlideEdge = params.snapToSlideEdge && !params.loop && (params.slidesPerView === 'auto' || isFractionalSlidesPerView);
|
|
8909
|
+
|
|
8910
|
+
// Calculate the last allowed snap index when snapToSlideEdge is enabled
|
|
8911
|
+
// This ensures minimum slides are visible at the end
|
|
8912
|
+
let lastAllowedSnapIndex = snapGrid.length;
|
|
8913
|
+
if (shouldSnapToSlideEdge) {
|
|
8914
|
+
let minVisibleSlides;
|
|
8915
|
+
if (params.slidesPerView === 'auto') {
|
|
8916
|
+
// For 'auto' mode, calculate how many slides fit based on actual sizes
|
|
8917
|
+
minVisibleSlides = 1;
|
|
8918
|
+
let accumulatedSize = 0;
|
|
8919
|
+
for (let i = slidesSizesGrid.length - 1; i >= 0; i -= 1) {
|
|
8920
|
+
accumulatedSize += slidesSizesGrid[i] + (i < slidesSizesGrid.length - 1 ? spaceBetween : 0);
|
|
8921
|
+
if (accumulatedSize <= swiperSize) {
|
|
8922
|
+
minVisibleSlides = slidesSizesGrid.length - i;
|
|
8923
|
+
} else {
|
|
8924
|
+
break;
|
|
8925
|
+
}
|
|
8926
|
+
}
|
|
8927
|
+
} else {
|
|
8928
|
+
minVisibleSlides = Math.floor(params.slidesPerView);
|
|
8929
|
+
}
|
|
8930
|
+
lastAllowedSnapIndex = Math.max(slidesLength - minVisibleSlides, 0);
|
|
8931
|
+
}
|
|
8884
8932
|
const newSlidesGrid = [];
|
|
8885
8933
|
for (let i = 0; i < snapGrid.length; i += 1) {
|
|
8886
8934
|
let slidesGridItem = snapGrid[i];
|
|
8887
8935
|
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
|
8888
|
-
if (
|
|
8936
|
+
if (shouldSnapToSlideEdge) {
|
|
8937
|
+
// When snapToSlideEdge is enabled, only keep snaps up to lastAllowedSnapIndex
|
|
8938
|
+
if (i <= lastAllowedSnapIndex) {
|
|
8939
|
+
newSlidesGrid.push(slidesGridItem);
|
|
8940
|
+
}
|
|
8941
|
+
} else if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
8942
|
+
// When snapToSlideEdge is disabled, keep snaps that fit within scrollable area
|
|
8889
8943
|
newSlidesGrid.push(slidesGridItem);
|
|
8890
8944
|
}
|
|
8891
8945
|
}
|
|
8892
8946
|
snapGrid = newSlidesGrid;
|
|
8893
8947
|
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
|
8894
|
-
|
|
8948
|
+
// Only add edge-aligned snap if snapToSlideEdge is not enabled
|
|
8949
|
+
if (!shouldSnapToSlideEdge) {
|
|
8950
|
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8951
|
+
}
|
|
8895
8952
|
}
|
|
8896
8953
|
}
|
|
8897
8954
|
if (isVirtual && params.loop) {
|
|
@@ -8930,7 +8987,7 @@ function updateSlides() {
|
|
|
8930
8987
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8931
8988
|
});
|
|
8932
8989
|
allSlidesSize -= spaceBetween;
|
|
8933
|
-
const maxSnap = allSlidesSize - swiperSize;
|
|
8990
|
+
const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
|
|
8934
8991
|
snapGrid = snapGrid.map(snap => {
|
|
8935
8992
|
if (snap <= 0) return -offsetBefore;
|
|
8936
8993
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -8943,9 +9000,8 @@ function updateSlides() {
|
|
|
8943
9000
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8944
9001
|
});
|
|
8945
9002
|
allSlidesSize -= spaceBetween;
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
9003
|
+
if (allSlidesSize < swiperSize) {
|
|
9004
|
+
const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
|
8949
9005
|
snapGrid.forEach((snap, snapIndex) => {
|
|
8950
9006
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
8951
9007
|
});
|
|
@@ -9056,10 +9112,7 @@ const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
|
9056
9112
|
slideEl.classList.remove(className);
|
|
9057
9113
|
}
|
|
9058
9114
|
};
|
|
9059
|
-
function updateSlidesProgress(translate) {
|
|
9060
|
-
if (translate === void 0) {
|
|
9061
|
-
translate = this && this.translate || 0;
|
|
9062
|
-
}
|
|
9115
|
+
function updateSlidesProgress(translate = this && this.translate || 0) {
|
|
9063
9116
|
const swiper = this;
|
|
9064
9117
|
const params = swiper.params;
|
|
9065
9118
|
const {
|
|
@@ -9199,9 +9252,9 @@ function updateSlidesClasses() {
|
|
|
9199
9252
|
}
|
|
9200
9253
|
} else {
|
|
9201
9254
|
if (gridEnabled) {
|
|
9202
|
-
activeSlide = slides.
|
|
9203
|
-
nextSlide = slides.
|
|
9204
|
-
prevSlide = slides.
|
|
9255
|
+
activeSlide = slides.find(slideEl => slideEl.column === activeIndex);
|
|
9256
|
+
nextSlide = slides.find(slideEl => slideEl.column === activeIndex + 1);
|
|
9257
|
+
prevSlide = slides.find(slideEl => slideEl.column === activeIndex - 1);
|
|
9205
9258
|
} else {
|
|
9206
9259
|
activeSlide = slides[activeIndex];
|
|
9207
9260
|
}
|
|
@@ -9243,12 +9296,13 @@ const processLazyPreloader = (swiper, imageEl) => {
|
|
|
9243
9296
|
requestAnimationFrame(() => {
|
|
9244
9297
|
if (slideEl.shadowRoot) {
|
|
9245
9298
|
lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
|
|
9246
|
-
if (lazyEl) lazyEl.remove();
|
|
9299
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9247
9300
|
}
|
|
9248
9301
|
});
|
|
9249
9302
|
}
|
|
9250
9303
|
}
|
|
9251
|
-
if
|
|
9304
|
+
// Skip removal if managed by React/Vue component
|
|
9305
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9252
9306
|
}
|
|
9253
9307
|
};
|
|
9254
9308
|
const unlazy = (swiper, index) => {
|
|
@@ -9363,10 +9417,14 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
9363
9417
|
|
|
9364
9418
|
// Get real index
|
|
9365
9419
|
let realIndex;
|
|
9366
|
-
if (swiper.virtual && params.virtual.enabled
|
|
9367
|
-
|
|
9420
|
+
if (swiper.virtual && params.virtual.enabled) {
|
|
9421
|
+
if (params.loop) {
|
|
9422
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
9423
|
+
} else {
|
|
9424
|
+
realIndex = activeIndex;
|
|
9425
|
+
}
|
|
9368
9426
|
} else if (gridEnabled) {
|
|
9369
|
-
const firstSlideInColumn = swiper.slides.
|
|
9427
|
+
const firstSlideInColumn = swiper.slides.find(slideEl => slideEl.column === activeIndex);
|
|
9370
9428
|
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
9371
9429
|
if (Number.isNaN(activeSlideIndex)) {
|
|
9372
9430
|
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
@@ -9454,10 +9512,7 @@ var update = {
|
|
|
9454
9512
|
updateClickedSlide
|
|
9455
9513
|
};
|
|
9456
9514
|
|
|
9457
|
-
function getSwiperTranslate(axis) {
|
|
9458
|
-
if (axis === void 0) {
|
|
9459
|
-
axis = this.isHorizontal() ? 'x' : 'y';
|
|
9460
|
-
}
|
|
9515
|
+
function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
|
|
9461
9516
|
const swiper = this;
|
|
9462
9517
|
const {
|
|
9463
9518
|
params,
|
|
@@ -9532,19 +9587,7 @@ function maxTranslate() {
|
|
|
9532
9587
|
return -this.snapGrid[this.snapGrid.length - 1];
|
|
9533
9588
|
}
|
|
9534
9589
|
|
|
9535
|
-
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
9536
|
-
if (translate === void 0) {
|
|
9537
|
-
translate = 0;
|
|
9538
|
-
}
|
|
9539
|
-
if (speed === void 0) {
|
|
9540
|
-
speed = this.params.speed;
|
|
9541
|
-
}
|
|
9542
|
-
if (runCallbacks === void 0) {
|
|
9543
|
-
runCallbacks = true;
|
|
9544
|
-
}
|
|
9545
|
-
if (translateBounds === void 0) {
|
|
9546
|
-
translateBounds = true;
|
|
9547
|
-
}
|
|
9590
|
+
function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
|
|
9548
9591
|
const swiper = this;
|
|
9549
9592
|
const {
|
|
9550
9593
|
params,
|
|
@@ -9632,13 +9675,12 @@ function setTransition(duration, byController) {
|
|
|
9632
9675
|
swiper.emit('setTransition', duration, byController);
|
|
9633
9676
|
}
|
|
9634
9677
|
|
|
9635
|
-
function transitionEmit(
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
} = _ref;
|
|
9678
|
+
function transitionEmit({
|
|
9679
|
+
swiper,
|
|
9680
|
+
runCallbacks,
|
|
9681
|
+
direction,
|
|
9682
|
+
step
|
|
9683
|
+
}) {
|
|
9642
9684
|
const {
|
|
9643
9685
|
activeIndex,
|
|
9644
9686
|
previousIndex
|
|
@@ -9648,11 +9690,9 @@ function transitionEmit(_ref) {
|
|
|
9648
9690
|
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
|
|
9649
9691
|
}
|
|
9650
9692
|
swiper.emit(`transition${step}`);
|
|
9651
|
-
if (runCallbacks &&
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
return;
|
|
9655
|
-
}
|
|
9693
|
+
if (runCallbacks && dir === 'reset') {
|
|
9694
|
+
swiper.emit(`slideResetTransition${step}`);
|
|
9695
|
+
} else if (runCallbacks && activeIndex !== previousIndex) {
|
|
9656
9696
|
swiper.emit(`slideChangeTransition${step}`);
|
|
9657
9697
|
if (dir === 'next') {
|
|
9658
9698
|
swiper.emit(`slideNextTransition${step}`);
|
|
@@ -9662,10 +9702,7 @@ function transitionEmit(_ref) {
|
|
|
9662
9702
|
}
|
|
9663
9703
|
}
|
|
9664
9704
|
|
|
9665
|
-
function transitionStart(runCallbacks, direction) {
|
|
9666
|
-
if (runCallbacks === void 0) {
|
|
9667
|
-
runCallbacks = true;
|
|
9668
|
-
}
|
|
9705
|
+
function transitionStart(runCallbacks = true, direction) {
|
|
9669
9706
|
const swiper = this;
|
|
9670
9707
|
const {
|
|
9671
9708
|
params
|
|
@@ -9682,10 +9719,7 @@ function transitionStart(runCallbacks, direction) {
|
|
|
9682
9719
|
});
|
|
9683
9720
|
}
|
|
9684
9721
|
|
|
9685
|
-
function transitionEnd(runCallbacks, direction) {
|
|
9686
|
-
if (runCallbacks === void 0) {
|
|
9687
|
-
runCallbacks = true;
|
|
9688
|
-
}
|
|
9722
|
+
function transitionEnd(runCallbacks = true, direction) {
|
|
9689
9723
|
const swiper = this;
|
|
9690
9724
|
const {
|
|
9691
9725
|
params
|
|
@@ -9707,13 +9741,7 @@ var transition = {
|
|
|
9707
9741
|
transitionEnd
|
|
9708
9742
|
};
|
|
9709
9743
|
|
|
9710
|
-
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
9711
|
-
if (index === void 0) {
|
|
9712
|
-
index = 0;
|
|
9713
|
-
}
|
|
9714
|
-
if (runCallbacks === void 0) {
|
|
9715
|
-
runCallbacks = true;
|
|
9716
|
-
}
|
|
9744
|
+
function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
9717
9745
|
if (typeof index === 'string') {
|
|
9718
9746
|
index = parseInt(index, 10);
|
|
9719
9747
|
}
|
|
@@ -9777,8 +9805,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9777
9805
|
let direction;
|
|
9778
9806
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
9779
9807
|
|
|
9808
|
+
// initial virtual
|
|
9809
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9810
|
+
const isInitialVirtual = isVirtual && initial;
|
|
9780
9811
|
// Update Index
|
|
9781
|
-
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
9812
|
+
if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) {
|
|
9782
9813
|
swiper.updateActiveIndex(slideIndex);
|
|
9783
9814
|
// Update Height
|
|
9784
9815
|
if (params.autoHeight) {
|
|
@@ -9798,7 +9829,6 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9798
9829
|
const isH = swiper.isHorizontal();
|
|
9799
9830
|
const t = rtl ? translate : -translate;
|
|
9800
9831
|
if (speed === 0) {
|
|
9801
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9802
9832
|
if (isVirtual) {
|
|
9803
9833
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
9804
9834
|
swiper._immediateVirtual = true;
|
|
@@ -9833,6 +9863,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9833
9863
|
}
|
|
9834
9864
|
return true;
|
|
9835
9865
|
}
|
|
9866
|
+
const browser = getBrowser();
|
|
9867
|
+
const isSafari = browser.isSafari;
|
|
9868
|
+
if (isVirtual && !initial && isSafari && swiper.isElement) {
|
|
9869
|
+
swiper.virtual.update(false, false, slideIndex);
|
|
9870
|
+
}
|
|
9836
9871
|
swiper.setTransition(speed);
|
|
9837
9872
|
swiper.setTranslate(translate);
|
|
9838
9873
|
swiper.updateActiveIndex(slideIndex);
|
|
@@ -9858,13 +9893,7 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
9858
9893
|
return true;
|
|
9859
9894
|
}
|
|
9860
9895
|
|
|
9861
|
-
function slideToLoop(index, speed, runCallbacks, internal) {
|
|
9862
|
-
if (index === void 0) {
|
|
9863
|
-
index = 0;
|
|
9864
|
-
}
|
|
9865
|
-
if (runCallbacks === void 0) {
|
|
9866
|
-
runCallbacks = true;
|
|
9867
|
-
}
|
|
9896
|
+
function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
9868
9897
|
if (typeof index === 'string') {
|
|
9869
9898
|
const indexAsNumber = parseInt(index, 10);
|
|
9870
9899
|
index = indexAsNumber;
|
|
@@ -9884,32 +9913,35 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9884
9913
|
let targetSlideIndex;
|
|
9885
9914
|
if (gridEnabled) {
|
|
9886
9915
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9887
|
-
targetSlideIndex = swiper.slides.
|
|
9916
|
+
targetSlideIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
9888
9917
|
} else {
|
|
9889
9918
|
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
9890
9919
|
}
|
|
9891
9920
|
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
9892
9921
|
const {
|
|
9893
|
-
centeredSlides
|
|
9922
|
+
centeredSlides,
|
|
9923
|
+
slidesOffsetBefore,
|
|
9924
|
+
slidesOffsetAfter
|
|
9894
9925
|
} = swiper.params;
|
|
9926
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
9895
9927
|
let slidesPerView = swiper.params.slidesPerView;
|
|
9896
9928
|
if (slidesPerView === 'auto') {
|
|
9897
9929
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
9898
9930
|
} else {
|
|
9899
9931
|
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
9900
|
-
if (
|
|
9932
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
9901
9933
|
slidesPerView = slidesPerView + 1;
|
|
9902
9934
|
}
|
|
9903
9935
|
}
|
|
9904
9936
|
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
9905
|
-
if (
|
|
9937
|
+
if (bothDirections) {
|
|
9906
9938
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
9907
9939
|
}
|
|
9908
|
-
if (internal &&
|
|
9940
|
+
if (internal && bothDirections && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
9909
9941
|
needLoopFix = false;
|
|
9910
9942
|
}
|
|
9911
9943
|
if (needLoopFix) {
|
|
9912
|
-
const direction =
|
|
9944
|
+
const direction = bothDirections ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
9913
9945
|
swiper.loopFix({
|
|
9914
9946
|
direction,
|
|
9915
9947
|
slideTo: true,
|
|
@@ -9919,7 +9951,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9919
9951
|
}
|
|
9920
9952
|
if (gridEnabled) {
|
|
9921
9953
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9922
|
-
newIndex = swiper.slides.
|
|
9954
|
+
newIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
9923
9955
|
} else {
|
|
9924
9956
|
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
9925
9957
|
}
|
|
@@ -9932,10 +9964,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
9932
9964
|
}
|
|
9933
9965
|
|
|
9934
9966
|
/* eslint no-unused-vars: "off" */
|
|
9935
|
-
function slideNext(speed, runCallbacks, internal) {
|
|
9936
|
-
if (runCallbacks === void 0) {
|
|
9937
|
-
runCallbacks = true;
|
|
9938
|
-
}
|
|
9967
|
+
function slideNext(speed, runCallbacks = true, internal) {
|
|
9939
9968
|
const swiper = this;
|
|
9940
9969
|
const {
|
|
9941
9970
|
enabled,
|
|
@@ -9973,10 +10002,7 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
9973
10002
|
}
|
|
9974
10003
|
|
|
9975
10004
|
/* eslint no-unused-vars: "off" */
|
|
9976
|
-
function slidePrev(speed, runCallbacks, internal) {
|
|
9977
|
-
if (runCallbacks === void 0) {
|
|
9978
|
-
runCallbacks = true;
|
|
9979
|
-
}
|
|
10005
|
+
function slidePrev(speed, runCallbacks = true, internal) {
|
|
9980
10006
|
const swiper = this;
|
|
9981
10007
|
const {
|
|
9982
10008
|
params,
|
|
@@ -10006,8 +10032,9 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
10006
10032
|
}
|
|
10007
10033
|
const normalizedTranslate = normalize(translate);
|
|
10008
10034
|
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
|
10035
|
+
const isFreeMode = params.freeMode && params.freeMode.enabled;
|
|
10009
10036
|
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
|
10010
|
-
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
|
10037
|
+
if (typeof prevSnap === 'undefined' && (params.cssMode || isFreeMode)) {
|
|
10011
10038
|
let prevSnapIndex;
|
|
10012
10039
|
snapGrid.forEach((snap, snapIndex) => {
|
|
10013
10040
|
if (normalizedTranslate >= snap) {
|
|
@@ -10016,7 +10043,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
10016
10043
|
}
|
|
10017
10044
|
});
|
|
10018
10045
|
if (typeof prevSnapIndex !== 'undefined') {
|
|
10019
|
-
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10046
|
+
prevSnap = isFreeMode ? snapGrid[prevSnapIndex] : snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10020
10047
|
}
|
|
10021
10048
|
}
|
|
10022
10049
|
let prevIndex = 0;
|
|
@@ -10041,10 +10068,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
10041
10068
|
}
|
|
10042
10069
|
|
|
10043
10070
|
/* eslint no-unused-vars: "off" */
|
|
10044
|
-
function slideReset(speed, runCallbacks, internal) {
|
|
10045
|
-
if (runCallbacks === void 0) {
|
|
10046
|
-
runCallbacks = true;
|
|
10047
|
-
}
|
|
10071
|
+
function slideReset(speed, runCallbacks = true, internal) {
|
|
10048
10072
|
const swiper = this;
|
|
10049
10073
|
if (swiper.destroyed) return;
|
|
10050
10074
|
if (typeof speed === 'undefined') {
|
|
@@ -10054,13 +10078,7 @@ function slideReset(speed, runCallbacks, internal) {
|
|
|
10054
10078
|
}
|
|
10055
10079
|
|
|
10056
10080
|
/* eslint no-unused-vars: "off" */
|
|
10057
|
-
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
10058
|
-
if (runCallbacks === void 0) {
|
|
10059
|
-
runCallbacks = true;
|
|
10060
|
-
}
|
|
10061
|
-
if (threshold === void 0) {
|
|
10062
|
-
threshold = 0.5;
|
|
10063
|
-
}
|
|
10081
|
+
function slideToClosest(speed, runCallbacks = true, internal, threshold = 0.5) {
|
|
10064
10082
|
const swiper = this;
|
|
10065
10083
|
if (swiper.destroyed) return;
|
|
10066
10084
|
if (typeof speed === 'undefined') {
|
|
@@ -10100,23 +10118,16 @@ function slideToClickedSlide() {
|
|
|
10100
10118
|
slidesEl
|
|
10101
10119
|
} = swiper;
|
|
10102
10120
|
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
10103
|
-
let slideToIndex = swiper.clickedIndex;
|
|
10121
|
+
let slideToIndex = swiper.getSlideIndexWhenGrid(swiper.clickedIndex);
|
|
10104
10122
|
let realIndex;
|
|
10105
10123
|
const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
|
|
10124
|
+
const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
10106
10125
|
if (params.loop) {
|
|
10107
10126
|
if (swiper.animating) return;
|
|
10108
10127
|
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
10109
10128
|
if (params.centeredSlides) {
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10113
|
-
nextTick(() => {
|
|
10114
|
-
swiper.slideTo(slideToIndex);
|
|
10115
|
-
});
|
|
10116
|
-
} else {
|
|
10117
|
-
swiper.slideTo(slideToIndex);
|
|
10118
|
-
}
|
|
10119
|
-
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
10129
|
+
swiper.slideToLoop(realIndex);
|
|
10130
|
+
} else if (slideToIndex > (isGrid ? (swiper.slides.length - slidesPerView) / 2 - (swiper.params.grid.rows - 1) : swiper.slides.length - slidesPerView)) {
|
|
10120
10131
|
swiper.loopFix();
|
|
10121
10132
|
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10122
10133
|
nextTick(() => {
|
|
@@ -10140,7 +10151,7 @@ var slide = {
|
|
|
10140
10151
|
slideToClickedSlide
|
|
10141
10152
|
};
|
|
10142
10153
|
|
|
10143
|
-
function loopCreate(slideRealIndex) {
|
|
10154
|
+
function loopCreate(slideRealIndex, initial) {
|
|
10144
10155
|
const swiper = this;
|
|
10145
10156
|
const {
|
|
10146
10157
|
params,
|
|
@@ -10153,7 +10164,20 @@ function loopCreate(slideRealIndex) {
|
|
|
10153
10164
|
el.setAttribute('data-swiper-slide-index', index);
|
|
10154
10165
|
});
|
|
10155
10166
|
};
|
|
10167
|
+
const clearBlankSlides = () => {
|
|
10168
|
+
const slides = elementChildren(slidesEl, `.${params.slideBlankClass}`);
|
|
10169
|
+
slides.forEach(el => {
|
|
10170
|
+
el.remove();
|
|
10171
|
+
});
|
|
10172
|
+
if (slides.length > 0) {
|
|
10173
|
+
swiper.recalcSlides();
|
|
10174
|
+
swiper.updateSlides();
|
|
10175
|
+
}
|
|
10176
|
+
};
|
|
10156
10177
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10178
|
+
if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
|
|
10179
|
+
clearBlankSlides();
|
|
10180
|
+
}
|
|
10157
10181
|
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
10158
10182
|
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
10159
10183
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
@@ -10186,22 +10210,24 @@ function loopCreate(slideRealIndex) {
|
|
|
10186
10210
|
} else {
|
|
10187
10211
|
initSlides();
|
|
10188
10212
|
}
|
|
10213
|
+
const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
|
|
10189
10214
|
swiper.loopFix({
|
|
10190
10215
|
slideRealIndex,
|
|
10191
|
-
direction:
|
|
10216
|
+
direction: bothDirections ? undefined : 'next',
|
|
10217
|
+
initial
|
|
10192
10218
|
});
|
|
10193
10219
|
}
|
|
10194
10220
|
|
|
10195
|
-
function loopFix(
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10221
|
+
function loopFix({
|
|
10222
|
+
slideRealIndex,
|
|
10223
|
+
slideTo = true,
|
|
10224
|
+
direction,
|
|
10225
|
+
setTranslate,
|
|
10226
|
+
activeSlideIndex,
|
|
10227
|
+
initial,
|
|
10228
|
+
byController,
|
|
10229
|
+
byMousewheel
|
|
10230
|
+
} = {}) {
|
|
10205
10231
|
const swiper = this;
|
|
10206
10232
|
if (!swiper.params.loop) return;
|
|
10207
10233
|
swiper.emit('beforeLoopFix');
|
|
@@ -10213,15 +10239,19 @@ function loopFix(_temp) {
|
|
|
10213
10239
|
params
|
|
10214
10240
|
} = swiper;
|
|
10215
10241
|
const {
|
|
10216
|
-
centeredSlides
|
|
10242
|
+
centeredSlides,
|
|
10243
|
+
slidesOffsetBefore,
|
|
10244
|
+
slidesOffsetAfter,
|
|
10245
|
+
initialSlide
|
|
10217
10246
|
} = params;
|
|
10247
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
10218
10248
|
swiper.allowSlidePrev = true;
|
|
10219
10249
|
swiper.allowSlideNext = true;
|
|
10220
10250
|
if (swiper.virtual && params.virtual.enabled) {
|
|
10221
10251
|
if (slideTo) {
|
|
10222
|
-
if (!
|
|
10252
|
+
if (!bothDirections && swiper.snapIndex === 0) {
|
|
10223
10253
|
swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
|
|
10224
|
-
} else if (
|
|
10254
|
+
} else if (bothDirections && swiper.snapIndex < params.slidesPerView) {
|
|
10225
10255
|
swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
|
|
10226
10256
|
} else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
|
|
10227
10257
|
swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
|
|
@@ -10237,28 +10267,30 @@ function loopFix(_temp) {
|
|
|
10237
10267
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
10238
10268
|
} else {
|
|
10239
10269
|
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
10240
|
-
if (
|
|
10270
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
10241
10271
|
slidesPerView = slidesPerView + 1;
|
|
10242
10272
|
}
|
|
10243
10273
|
}
|
|
10244
10274
|
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
10245
|
-
let loopedSlides = slidesPerGroup;
|
|
10275
|
+
let loopedSlides = bothDirections ? Math.max(slidesPerGroup, Math.ceil(slidesPerView / 2)) : slidesPerGroup;
|
|
10246
10276
|
if (loopedSlides % slidesPerGroup !== 0) {
|
|
10247
10277
|
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
10248
10278
|
}
|
|
10249
10279
|
loopedSlides += params.loopAdditionalSlides;
|
|
10250
10280
|
swiper.loopedSlides = loopedSlides;
|
|
10251
10281
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10252
|
-
if (slides.length < slidesPerView + loopedSlides) {
|
|
10253
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled
|
|
10282
|
+
if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
10283
|
+
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');
|
|
10254
10284
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
10255
10285
|
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
10256
10286
|
}
|
|
10257
10287
|
const prependSlidesIndexes = [];
|
|
10258
10288
|
const appendSlidesIndexes = [];
|
|
10259
|
-
|
|
10289
|
+
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10290
|
+
const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
|
|
10291
|
+
let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
|
|
10260
10292
|
if (typeof activeSlideIndex === 'undefined') {
|
|
10261
|
-
activeSlideIndex = swiper.getSlideIndex(slides.
|
|
10293
|
+
activeSlideIndex = swiper.getSlideIndex(slides.find(el => el.classList.contains(params.slideActiveClass)));
|
|
10262
10294
|
} else {
|
|
10263
10295
|
activeIndex = activeSlideIndex;
|
|
10264
10296
|
}
|
|
@@ -10266,9 +10298,8 @@ function loopFix(_temp) {
|
|
|
10266
10298
|
const isPrev = direction === 'prev' || !direction;
|
|
10267
10299
|
let slidesPrepended = 0;
|
|
10268
10300
|
let slidesAppended = 0;
|
|
10269
|
-
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10270
10301
|
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
10271
|
-
const activeColIndexWithShift = activeColIndex + (
|
|
10302
|
+
const activeColIndexWithShift = activeColIndex + (bothDirections && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
10272
10303
|
// prepend last slides before start
|
|
10273
10304
|
if (activeColIndexWithShift < loopedSlides) {
|
|
10274
10305
|
slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
|
|
@@ -10288,6 +10319,9 @@ function loopFix(_temp) {
|
|
|
10288
10319
|
}
|
|
10289
10320
|
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
10290
10321
|
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
10322
|
+
if (isInitialOverflow) {
|
|
10323
|
+
slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
|
|
10324
|
+
}
|
|
10291
10325
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
10292
10326
|
const index = i - Math.floor(i / cols) * cols;
|
|
10293
10327
|
if (gridEnabled) {
|
|
@@ -10303,6 +10337,14 @@ function loopFix(_temp) {
|
|
|
10303
10337
|
requestAnimationFrame(() => {
|
|
10304
10338
|
swiper.__preventObserver__ = false;
|
|
10305
10339
|
});
|
|
10340
|
+
if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
10341
|
+
if (appendSlidesIndexes.includes(activeSlideIndex)) {
|
|
10342
|
+
appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10343
|
+
}
|
|
10344
|
+
if (prependSlidesIndexes.includes(activeSlideIndex)) {
|
|
10345
|
+
prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10346
|
+
}
|
|
10347
|
+
}
|
|
10306
10348
|
if (isPrev) {
|
|
10307
10349
|
prependSlidesIndexes.forEach(index => {
|
|
10308
10350
|
slides[index].swiperLoopMoveDOM = true;
|
|
@@ -10403,7 +10445,7 @@ function loopDestroy() {
|
|
|
10403
10445
|
params,
|
|
10404
10446
|
slidesEl
|
|
10405
10447
|
} = swiper;
|
|
10406
|
-
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10448
|
+
if (!params.loop || !slidesEl || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10407
10449
|
swiper.recalcSlides();
|
|
10408
10450
|
const newSlidesOrder = [];
|
|
10409
10451
|
swiper.slides.forEach(slideEl => {
|
|
@@ -10464,10 +10506,7 @@ var grabCursor = {
|
|
|
10464
10506
|
};
|
|
10465
10507
|
|
|
10466
10508
|
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
10467
|
-
function closestElement(selector, base) {
|
|
10468
|
-
if (base === void 0) {
|
|
10469
|
-
base = this;
|
|
10470
|
-
}
|
|
10509
|
+
function closestElement(selector, base = this) {
|
|
10471
10510
|
function __closestFrom(el) {
|
|
10472
10511
|
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
10473
10512
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
@@ -10529,7 +10568,7 @@ function onTouchStart(event) {
|
|
|
10529
10568
|
}
|
|
10530
10569
|
let targetEl = e.target;
|
|
10531
10570
|
if (params.touchEventsTarget === 'wrapper') {
|
|
10532
|
-
if (!swiper.wrapperEl
|
|
10571
|
+
if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return;
|
|
10533
10572
|
}
|
|
10534
10573
|
if ('which' in e && e.which === 3) return;
|
|
10535
10574
|
if ('button' in e && e.button > 0) return;
|
|
@@ -10584,7 +10623,7 @@ function onTouchStart(event) {
|
|
|
10584
10623
|
data.isTouched = false;
|
|
10585
10624
|
}
|
|
10586
10625
|
}
|
|
10587
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
|
|
10626
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl && (e.pointerType === 'mouse' || e.pointerType !== 'mouse' && !targetEl.matches(data.focusableElements))) {
|
|
10588
10627
|
document.activeElement.blur();
|
|
10589
10628
|
}
|
|
10590
10629
|
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
@@ -10618,7 +10657,7 @@ function onTouchMove(event) {
|
|
|
10618
10657
|
}
|
|
10619
10658
|
let targetTouch;
|
|
10620
10659
|
if (e.type === 'touchmove') {
|
|
10621
|
-
targetTouch = [...e.changedTouches].
|
|
10660
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
10622
10661
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10623
10662
|
} else {
|
|
10624
10663
|
targetTouch = e;
|
|
@@ -10659,10 +10698,15 @@ function onTouchMove(event) {
|
|
|
10659
10698
|
data.isMoved = false;
|
|
10660
10699
|
return;
|
|
10661
10700
|
}
|
|
10662
|
-
} else if (pageX
|
|
10701
|
+
} else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
|
|
10702
|
+
return;
|
|
10703
|
+
} else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
10663
10704
|
return;
|
|
10664
10705
|
}
|
|
10665
10706
|
}
|
|
10707
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
|
|
10708
|
+
document.activeElement.blur();
|
|
10709
|
+
}
|
|
10666
10710
|
if (document.activeElement) {
|
|
10667
10711
|
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
10668
10712
|
data.isMoved = true;
|
|
@@ -10758,7 +10802,7 @@ function onTouchMove(event) {
|
|
|
10758
10802
|
}
|
|
10759
10803
|
let loopFixed;
|
|
10760
10804
|
new Date().getTime();
|
|
10761
|
-
if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10805
|
+
if (params._loopSwapReset !== false && data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10762
10806
|
Object.assign(touches, {
|
|
10763
10807
|
startX: pageX,
|
|
10764
10808
|
startY: pageY,
|
|
@@ -10779,7 +10823,7 @@ function onTouchMove(event) {
|
|
|
10779
10823
|
resistanceRatio = 0;
|
|
10780
10824
|
}
|
|
10781
10825
|
if (diff > 0) {
|
|
10782
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {
|
|
10826
|
+
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())) {
|
|
10783
10827
|
swiper.loopFix({
|
|
10784
10828
|
direction: 'prev',
|
|
10785
10829
|
setTranslate: true,
|
|
@@ -10793,7 +10837,7 @@ function onTouchMove(event) {
|
|
|
10793
10837
|
}
|
|
10794
10838
|
}
|
|
10795
10839
|
} else if (diff < 0) {
|
|
10796
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {
|
|
10840
|
+
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())) {
|
|
10797
10841
|
swiper.loopFix({
|
|
10798
10842
|
direction: 'next',
|
|
10799
10843
|
setTranslate: true,
|
|
@@ -10866,7 +10910,7 @@ function onTouchEnd(event) {
|
|
|
10866
10910
|
if (e.pointerId !== data.pointerId) return;
|
|
10867
10911
|
targetTouch = e;
|
|
10868
10912
|
} else {
|
|
10869
|
-
targetTouch = [...e.changedTouches].
|
|
10913
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
10870
10914
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10871
10915
|
}
|
|
10872
10916
|
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
|
|
@@ -11240,9 +11284,12 @@ function setBreakpoint() {
|
|
|
11240
11284
|
} = swiper;
|
|
11241
11285
|
const breakpoints = params.breakpoints;
|
|
11242
11286
|
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
|
|
11287
|
+
const document = getDocument();
|
|
11243
11288
|
|
|
11244
|
-
// Get breakpoint for window width and update parameters
|
|
11245
|
-
const
|
|
11289
|
+
// Get breakpoint for window/container width and update parameters
|
|
11290
|
+
const breakpointsBase = params.breakpointsBase === 'window' || !params.breakpointsBase ? params.breakpointsBase : 'container';
|
|
11291
|
+
const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
|
|
11292
|
+
const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
|
|
11246
11293
|
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
|
11247
11294
|
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
|
11248
11295
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
@@ -11315,10 +11362,7 @@ function setBreakpoint() {
|
|
|
11315
11362
|
swiper.emit('breakpoint', breakpointParams);
|
|
11316
11363
|
}
|
|
11317
11364
|
|
|
11318
|
-
function getBreakpoint(breakpoints, base, containerEl) {
|
|
11319
|
-
if (base === void 0) {
|
|
11320
|
-
base = 'window';
|
|
11321
|
-
}
|
|
11365
|
+
function getBreakpoint(breakpoints, base = 'window', containerEl) {
|
|
11322
11366
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
11323
11367
|
let breakpoint = false;
|
|
11324
11368
|
const window = getWindow();
|
|
@@ -11513,6 +11557,7 @@ var defaults = {
|
|
|
11513
11557
|
// in px
|
|
11514
11558
|
normalizeSlideIndex: true,
|
|
11515
11559
|
centerInsufficientSlides: false,
|
|
11560
|
+
snapToSlideEdge: false,
|
|
11516
11561
|
// Disable swiper and hide navigation when container not overflow
|
|
11517
11562
|
watchOverflow: true,
|
|
11518
11563
|
// Round length
|
|
@@ -11583,10 +11628,7 @@ var defaults = {
|
|
|
11583
11628
|
};
|
|
11584
11629
|
|
|
11585
11630
|
function moduleExtendParams(params, allModulesParams) {
|
|
11586
|
-
return function extendParams(obj) {
|
|
11587
|
-
if (obj === void 0) {
|
|
11588
|
-
obj = {};
|
|
11589
|
-
}
|
|
11631
|
+
return function extendParams(obj = {}) {
|
|
11590
11632
|
const moduleParamName = Object.keys(obj)[0];
|
|
11591
11633
|
const moduleParams = obj[moduleParamName];
|
|
11592
11634
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
@@ -11634,12 +11676,9 @@ const prototypes = {
|
|
|
11634
11676
|
};
|
|
11635
11677
|
const extendedDefaults = {};
|
|
11636
11678
|
class Swiper$1 {
|
|
11637
|
-
constructor() {
|
|
11679
|
+
constructor(...args) {
|
|
11638
11680
|
let el;
|
|
11639
11681
|
let params;
|
|
11640
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11641
|
-
args[_key] = arguments[_key];
|
|
11642
|
-
}
|
|
11643
11682
|
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
|
11644
11683
|
params = args[0];
|
|
11645
11684
|
} else {
|
|
@@ -11673,7 +11712,11 @@ class Swiper$1 {
|
|
|
11673
11712
|
swiper.eventsAnyListeners = [];
|
|
11674
11713
|
swiper.modules = [...swiper.__modules__];
|
|
11675
11714
|
if (params.modules && Array.isArray(params.modules)) {
|
|
11676
|
-
|
|
11715
|
+
params.modules.forEach(mod => {
|
|
11716
|
+
if (typeof mod === 'function' && swiper.modules.indexOf(mod) < 0) {
|
|
11717
|
+
swiper.modules.push(mod);
|
|
11718
|
+
}
|
|
11719
|
+
});
|
|
11677
11720
|
}
|
|
11678
11721
|
const allModulesParams = {};
|
|
11679
11722
|
swiper.modules.forEach(mod => {
|
|
@@ -11818,7 +11861,17 @@ class Swiper$1 {
|
|
|
11818
11861
|
return elementIndex(slideEl) - firstSlideIndex;
|
|
11819
11862
|
}
|
|
11820
11863
|
getSlideIndexByData(index) {
|
|
11821
|
-
return this.getSlideIndex(this.slides.
|
|
11864
|
+
return this.getSlideIndex(this.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index));
|
|
11865
|
+
}
|
|
11866
|
+
getSlideIndexWhenGrid(index) {
|
|
11867
|
+
if (this.grid && this.params.grid && this.params.grid.rows > 1) {
|
|
11868
|
+
if (this.params.grid.fill === 'column') {
|
|
11869
|
+
index = Math.floor(index / this.params.grid.rows);
|
|
11870
|
+
} else if (this.params.grid.fill === 'row') {
|
|
11871
|
+
index = index % Math.ceil(this.slides.length / this.params.grid.rows);
|
|
11872
|
+
}
|
|
11873
|
+
}
|
|
11874
|
+
return index;
|
|
11822
11875
|
}
|
|
11823
11876
|
recalcSlides() {
|
|
11824
11877
|
const swiper = this;
|
|
@@ -11885,13 +11938,7 @@ class Swiper$1 {
|
|
|
11885
11938
|
});
|
|
11886
11939
|
swiper.emit('_slideClasses', updates);
|
|
11887
11940
|
}
|
|
11888
|
-
slidesPerViewDynamic(view, exact) {
|
|
11889
|
-
if (view === void 0) {
|
|
11890
|
-
view = 'current';
|
|
11891
|
-
}
|
|
11892
|
-
if (exact === void 0) {
|
|
11893
|
-
exact = false;
|
|
11894
|
-
}
|
|
11941
|
+
slidesPerViewDynamic(view = 'current', exact = false) {
|
|
11895
11942
|
const swiper = this;
|
|
11896
11943
|
const {
|
|
11897
11944
|
params,
|
|
@@ -11990,10 +12037,7 @@ class Swiper$1 {
|
|
|
11990
12037
|
}
|
|
11991
12038
|
swiper.emit('update');
|
|
11992
12039
|
}
|
|
11993
|
-
changeDirection(newDirection, needUpdate) {
|
|
11994
|
-
if (needUpdate === void 0) {
|
|
11995
|
-
needUpdate = true;
|
|
11996
|
-
}
|
|
12040
|
+
changeDirection(newDirection, needUpdate = true) {
|
|
11997
12041
|
const swiper = this;
|
|
11998
12042
|
const currentDirection = swiper.params.direction;
|
|
11999
12043
|
if (!newDirection) {
|
|
@@ -12119,7 +12163,7 @@ class Swiper$1 {
|
|
|
12119
12163
|
|
|
12120
12164
|
// Create loop
|
|
12121
12165
|
if (swiper.params.loop) {
|
|
12122
|
-
swiper.loopCreate();
|
|
12166
|
+
swiper.loopCreate(undefined, true);
|
|
12123
12167
|
}
|
|
12124
12168
|
|
|
12125
12169
|
// Attach events
|
|
@@ -12148,13 +12192,7 @@ class Swiper$1 {
|
|
|
12148
12192
|
swiper.emit('afterInit');
|
|
12149
12193
|
return swiper;
|
|
12150
12194
|
}
|
|
12151
|
-
destroy(deleteInstance, cleanStyles) {
|
|
12152
|
-
if (deleteInstance === void 0) {
|
|
12153
|
-
deleteInstance = true;
|
|
12154
|
-
}
|
|
12155
|
-
if (cleanStyles === void 0) {
|
|
12156
|
-
cleanStyles = true;
|
|
12157
|
-
}
|
|
12195
|
+
destroy(deleteInstance = true, cleanStyles = true) {
|
|
12158
12196
|
const swiper = this;
|
|
12159
12197
|
const {
|
|
12160
12198
|
params,
|
|
@@ -12243,7 +12281,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
12243
12281
|
Swiper$1.use([Resize, Observer]);
|
|
12244
12282
|
|
|
12245
12283
|
/* underscore in name -> watch for changes */
|
|
12246
|
-
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',
|
|
12284
|
+
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',
|
|
12247
12285
|
// modules
|
|
12248
12286
|
'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
|
|
12249
12287
|
|
|
@@ -12260,28 +12298,16 @@ function extend(target, src) {
|
|
|
12260
12298
|
}
|
|
12261
12299
|
});
|
|
12262
12300
|
}
|
|
12263
|
-
function needsNavigation(params) {
|
|
12264
|
-
if (params === void 0) {
|
|
12265
|
-
params = {};
|
|
12266
|
-
}
|
|
12301
|
+
function needsNavigation(params = {}) {
|
|
12267
12302
|
return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';
|
|
12268
12303
|
}
|
|
12269
|
-
function needsPagination(params) {
|
|
12270
|
-
if (params === void 0) {
|
|
12271
|
-
params = {};
|
|
12272
|
-
}
|
|
12304
|
+
function needsPagination(params = {}) {
|
|
12273
12305
|
return params.pagination && typeof params.pagination.el === 'undefined';
|
|
12274
12306
|
}
|
|
12275
|
-
function needsScrollbar(params) {
|
|
12276
|
-
if (params === void 0) {
|
|
12277
|
-
params = {};
|
|
12278
|
-
}
|
|
12307
|
+
function needsScrollbar(params = {}) {
|
|
12279
12308
|
return params.scrollbar && typeof params.scrollbar.el === 'undefined';
|
|
12280
12309
|
}
|
|
12281
|
-
function uniqueClasses(classNames) {
|
|
12282
|
-
if (classNames === void 0) {
|
|
12283
|
-
classNames = '';
|
|
12284
|
-
}
|
|
12310
|
+
function uniqueClasses(classNames = '') {
|
|
12285
12311
|
const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);
|
|
12286
12312
|
const unique = [];
|
|
12287
12313
|
classes.forEach(c => {
|
|
@@ -12289,26 +12315,22 @@ function uniqueClasses(classNames) {
|
|
|
12289
12315
|
});
|
|
12290
12316
|
return unique.join(' ');
|
|
12291
12317
|
}
|
|
12292
|
-
function wrapperClass(className) {
|
|
12293
|
-
if (className === void 0) {
|
|
12294
|
-
className = '';
|
|
12295
|
-
}
|
|
12318
|
+
function wrapperClass(className = '') {
|
|
12296
12319
|
if (!className) return 'swiper-wrapper';
|
|
12297
12320
|
if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;
|
|
12298
12321
|
return className;
|
|
12299
12322
|
}
|
|
12300
12323
|
|
|
12301
|
-
function updateSwiper(
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
} = _ref;
|
|
12324
|
+
function updateSwiper({
|
|
12325
|
+
swiper,
|
|
12326
|
+
slides,
|
|
12327
|
+
passedParams,
|
|
12328
|
+
changedParams,
|
|
12329
|
+
nextEl,
|
|
12330
|
+
prevEl,
|
|
12331
|
+
scrollbarEl,
|
|
12332
|
+
paginationEl
|
|
12333
|
+
}) {
|
|
12312
12334
|
const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');
|
|
12313
12335
|
const {
|
|
12314
12336
|
params: currentParams,
|
|
@@ -12326,7 +12348,7 @@ function updateSwiper(_ref) {
|
|
|
12326
12348
|
let loopNeedDestroy;
|
|
12327
12349
|
let loopNeedEnable;
|
|
12328
12350
|
let loopNeedReloop;
|
|
12329
|
-
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {
|
|
12351
|
+
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && !passedParams.thumbs.swiper.destroyed && currentParams.thumbs && (!currentParams.thumbs.swiper || currentParams.thumbs.swiper.destroyed)) {
|
|
12330
12352
|
needThumbsInit = true;
|
|
12331
12353
|
}
|
|
12332
12354
|
if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {
|
|
@@ -12436,14 +12458,14 @@ function updateSwiper(_ref) {
|
|
|
12436
12458
|
if (!nextEl || typeof nextEl === 'string') {
|
|
12437
12459
|
nextEl = document.createElement('div');
|
|
12438
12460
|
nextEl.classList.add('swiper-button-next');
|
|
12439
|
-
nextEl
|
|
12461
|
+
setInnerHTML(nextEl, swiper.navigation.arrowSvg);
|
|
12440
12462
|
nextEl.part.add('button-next');
|
|
12441
12463
|
swiper.el.appendChild(nextEl);
|
|
12442
12464
|
}
|
|
12443
12465
|
if (!prevEl || typeof prevEl === 'string') {
|
|
12444
12466
|
prevEl = document.createElement('div');
|
|
12445
12467
|
prevEl.classList.add('swiper-button-prev');
|
|
12446
|
-
prevEl
|
|
12468
|
+
setInnerHTML(prevEl, swiper.navigation.arrowSvg);
|
|
12447
12469
|
prevEl.part.add('button-prev');
|
|
12448
12470
|
swiper.el.appendChild(prevEl);
|
|
12449
12471
|
}
|
|
@@ -12471,13 +12493,7 @@ function updateSwiper(_ref) {
|
|
|
12471
12493
|
swiper.update();
|
|
12472
12494
|
}
|
|
12473
12495
|
|
|
12474
|
-
function getParams(obj, splitEvents) {
|
|
12475
|
-
if (obj === void 0) {
|
|
12476
|
-
obj = {};
|
|
12477
|
-
}
|
|
12478
|
-
if (splitEvents === void 0) {
|
|
12479
|
-
splitEvents = true;
|
|
12480
|
-
}
|
|
12496
|
+
function getParams(obj = {}, splitEvents = true) {
|
|
12481
12497
|
const params = {
|
|
12482
12498
|
on: {}
|
|
12483
12499
|
};
|
|
@@ -12523,15 +12539,14 @@ function getParams(obj, splitEvents) {
|
|
|
12523
12539
|
};
|
|
12524
12540
|
}
|
|
12525
12541
|
|
|
12526
|
-
function mountSwiper(
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
} = _ref;
|
|
12542
|
+
function mountSwiper({
|
|
12543
|
+
el,
|
|
12544
|
+
nextEl,
|
|
12545
|
+
prevEl,
|
|
12546
|
+
paginationEl,
|
|
12547
|
+
scrollbarEl,
|
|
12548
|
+
swiper
|
|
12549
|
+
}, swiperParams) {
|
|
12535
12550
|
if (needsNavigation(swiperParams) && nextEl && prevEl) {
|
|
12536
12551
|
swiper.params.navigation.nextEl = nextEl;
|
|
12537
12552
|
swiper.originalParams.navigation.nextEl = nextEl;
|
|
@@ -12592,21 +12607,22 @@ const updateOnVirtualData = swiper => {
|
|
|
12592
12607
|
swiper.updateSlides();
|
|
12593
12608
|
swiper.updateProgress();
|
|
12594
12609
|
swiper.updateSlidesClasses();
|
|
12610
|
+
swiper.emit('_virtualUpdated');
|
|
12595
12611
|
if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
|
|
12596
12612
|
swiper.parallax.setTranslate();
|
|
12597
12613
|
}
|
|
12598
12614
|
};
|
|
12599
12615
|
|
|
12600
12616
|
/**
|
|
12601
|
-
* Swiper React
|
|
12617
|
+
* Swiper React 12.1.2
|
|
12602
12618
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
12603
12619
|
* https://swiperjs.com
|
|
12604
12620
|
*
|
|
12605
|
-
* Copyright 2014-
|
|
12621
|
+
* Copyright 2014-2026 Vladimir Kharlampidi
|
|
12606
12622
|
*
|
|
12607
12623
|
* Released under the MIT License
|
|
12608
12624
|
*
|
|
12609
|
-
* Released on:
|
|
12625
|
+
* Released on: February 18, 2026
|
|
12610
12626
|
*/
|
|
12611
12627
|
|
|
12612
12628
|
function _extends() {
|
|
@@ -12715,15 +12731,14 @@ function useIsomorphicLayoutEffect(callback, deps) {
|
|
|
12715
12731
|
const SwiperSlideContext = /*#__PURE__*/React.createContext(null);
|
|
12716
12732
|
const SwiperContext = /*#__PURE__*/React.createContext(null);
|
|
12717
12733
|
|
|
12718
|
-
const Swiper = /*#__PURE__*/React.forwardRef(
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
} = _temp === void 0 ? {} : _temp;
|
|
12734
|
+
const Swiper = /*#__PURE__*/React.forwardRef(({
|
|
12735
|
+
className,
|
|
12736
|
+
tag: Tag = 'div',
|
|
12737
|
+
wrapperTag: WrapperTag = 'div',
|
|
12738
|
+
children,
|
|
12739
|
+
onSwiper,
|
|
12740
|
+
...rest
|
|
12741
|
+
} = {}, externalElRef) => {
|
|
12727
12742
|
let eventsAssigned = false;
|
|
12728
12743
|
const [containerClasses, setContainerClasses] = React.useState('swiper');
|
|
12729
12744
|
const [virtualData, setVirtualData] = React.useState(null);
|
|
@@ -12899,18 +12914,17 @@ const Swiper = /*#__PURE__*/React.forwardRef(function (_temp, externalElRef) {
|
|
|
12899
12914
|
});
|
|
12900
12915
|
Swiper.displayName = 'Swiper';
|
|
12901
12916
|
|
|
12902
|
-
const SwiperSlide = /*#__PURE__*/React.forwardRef(
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
} = _temp === void 0 ? {} : _temp;
|
|
12917
|
+
const SwiperSlide = /*#__PURE__*/React.forwardRef(({
|
|
12918
|
+
tag: Tag = 'div',
|
|
12919
|
+
children,
|
|
12920
|
+
className = '',
|
|
12921
|
+
swiper,
|
|
12922
|
+
zoom,
|
|
12923
|
+
lazy,
|
|
12924
|
+
virtualIndex,
|
|
12925
|
+
swiperSlideIndex,
|
|
12926
|
+
...rest
|
|
12927
|
+
} = {}, externalRef) => {
|
|
12914
12928
|
const slideElRef = React.useRef(null);
|
|
12915
12929
|
const [slideClasses, setSlideClasses] = React.useState('swiper-slide');
|
|
12916
12930
|
const [lazyLoaded, setLazyLoaded] = React.useState(false);
|
|
@@ -12970,11 +12984,17 @@ const SwiperSlide = /*#__PURE__*/React.forwardRef(function (_temp, externalRef)
|
|
|
12970
12984
|
className: "swiper-zoom-container",
|
|
12971
12985
|
"data-swiper-zoom": typeof zoom === 'number' ? zoom : undefined
|
|
12972
12986
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12973
|
-
className: "swiper-lazy-preloader"
|
|
12987
|
+
className: "swiper-lazy-preloader",
|
|
12988
|
+
ref: node => {
|
|
12989
|
+
if (node) node.lazyPreloaderManaged = true;
|
|
12990
|
+
}
|
|
12974
12991
|
}))), !zoom && /*#__PURE__*/React__default["default"].createElement(SwiperSlideContext.Provider, {
|
|
12975
12992
|
value: slideData
|
|
12976
12993
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12977
|
-
className: "swiper-lazy-preloader"
|
|
12994
|
+
className: "swiper-lazy-preloader",
|
|
12995
|
+
ref: node => {
|
|
12996
|
+
if (node) node.lazyPreloaderManaged = true;
|
|
12997
|
+
}
|
|
12978
12998
|
})));
|
|
12979
12999
|
});
|
|
12980
13000
|
SwiperSlide.displayName = 'SwiperSlide';
|
|
@@ -15317,13 +15337,12 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
15317
15337
|
};
|
|
15318
15338
|
|
|
15319
15339
|
/* eslint-disable consistent-return */
|
|
15320
|
-
function Keyboard(
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
} = _ref;
|
|
15340
|
+
function Keyboard({
|
|
15341
|
+
swiper,
|
|
15342
|
+
extendParams,
|
|
15343
|
+
on,
|
|
15344
|
+
emit
|
|
15345
|
+
}) {
|
|
15327
15346
|
const document = getDocument();
|
|
15328
15347
|
const window = getWindow();
|
|
15329
15348
|
swiper.keyboard = {
|
|
@@ -15333,7 +15352,8 @@ function Keyboard(_ref) {
|
|
|
15333
15352
|
keyboard: {
|
|
15334
15353
|
enabled: false,
|
|
15335
15354
|
onlyInViewport: true,
|
|
15336
|
-
pageUpDown: true
|
|
15355
|
+
pageUpDown: true,
|
|
15356
|
+
speed: undefined
|
|
15337
15357
|
}
|
|
15338
15358
|
});
|
|
15339
15359
|
function handle(event) {
|
|
@@ -15361,7 +15381,7 @@ function Keyboard(_ref) {
|
|
|
15361
15381
|
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
|
15362
15382
|
return undefined;
|
|
15363
15383
|
}
|
|
15364
|
-
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
|
15384
|
+
if (document.activeElement && (document.activeElement.isContentEditable || document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea'))) {
|
|
15365
15385
|
return undefined;
|
|
15366
15386
|
}
|
|
15367
15387
|
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
|
|
@@ -15387,18 +15407,19 @@ function Keyboard(_ref) {
|
|
|
15387
15407
|
}
|
|
15388
15408
|
if (!inView) return undefined;
|
|
15389
15409
|
}
|
|
15410
|
+
const speed = swiper.params.keyboard.speed;
|
|
15390
15411
|
if (swiper.isHorizontal()) {
|
|
15391
15412
|
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
|
|
15392
15413
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15393
15414
|
}
|
|
15394
|
-
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
|
|
15395
|
-
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
|
|
15415
|
+
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(speed);
|
|
15416
|
+
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(speed);
|
|
15396
15417
|
} else {
|
|
15397
15418
|
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
|
|
15398
15419
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15399
15420
|
}
|
|
15400
|
-
if (isPageDown || isArrowDown) swiper.slideNext();
|
|
15401
|
-
if (isPageUp || isArrowUp) swiper.slidePrev();
|
|
15421
|
+
if (isPageDown || isArrowDown) swiper.slideNext(speed);
|
|
15422
|
+
if (isPageUp || isArrowUp) swiper.slidePrev(speed);
|
|
15402
15423
|
}
|
|
15403
15424
|
emit('keyPress', kc);
|
|
15404
15425
|
return undefined;
|
|
@@ -15429,12 +15450,11 @@ function Keyboard(_ref) {
|
|
|
15429
15450
|
});
|
|
15430
15451
|
}
|
|
15431
15452
|
|
|
15432
|
-
function History(
|
|
15433
|
-
|
|
15434
|
-
|
|
15435
|
-
|
|
15436
|
-
|
|
15437
|
-
} = _ref;
|
|
15453
|
+
function History({
|
|
15454
|
+
swiper,
|
|
15455
|
+
extendParams,
|
|
15456
|
+
on
|
|
15457
|
+
}) {
|
|
15438
15458
|
extendParams({
|
|
15439
15459
|
history: {
|
|
15440
15460
|
enabled: false,
|
|
@@ -15570,14 +15590,13 @@ function History(_ref) {
|
|
|
15570
15590
|
|
|
15571
15591
|
/* eslint no-underscore-dangle: "off" */
|
|
15572
15592
|
/* eslint no-use-before-define: "off" */
|
|
15573
|
-
function Autoplay(
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
} = _ref;
|
|
15593
|
+
function Autoplay({
|
|
15594
|
+
swiper,
|
|
15595
|
+
extendParams,
|
|
15596
|
+
on,
|
|
15597
|
+
emit,
|
|
15598
|
+
params
|
|
15599
|
+
}) {
|
|
15581
15600
|
swiper.autoplay = {
|
|
15582
15601
|
running: false,
|
|
15583
15602
|
paused: false,
|
|
@@ -15604,7 +15623,6 @@ function Autoplay(_ref) {
|
|
|
15604
15623
|
let isTouched;
|
|
15605
15624
|
let pausedByTouch;
|
|
15606
15625
|
let touchStartTimeout;
|
|
15607
|
-
let slideChanged;
|
|
15608
15626
|
let pausedByInteraction;
|
|
15609
15627
|
let pausedByPointerEnter;
|
|
15610
15628
|
function onTransitionEnd(e) {
|
|
@@ -15634,7 +15652,7 @@ function Autoplay(_ref) {
|
|
|
15634
15652
|
const getSlideDelay = () => {
|
|
15635
15653
|
let activeSlideEl;
|
|
15636
15654
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
|
15637
|
-
activeSlideEl = swiper.slides.
|
|
15655
|
+
activeSlideEl = swiper.slides.find(slideEl => slideEl.classList.contains('swiper-slide-active'));
|
|
15638
15656
|
} else {
|
|
15639
15657
|
activeSlideEl = swiper.slides[swiper.activeIndex];
|
|
15640
15658
|
}
|
|
@@ -15642,18 +15660,23 @@ function Autoplay(_ref) {
|
|
|
15642
15660
|
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
|
15643
15661
|
return currentSlideDelay;
|
|
15644
15662
|
};
|
|
15663
|
+
const getTotalDelay = () => {
|
|
15664
|
+
let totalDelay = swiper.params.autoplay.delay;
|
|
15665
|
+
const currentSlideDelay = getSlideDelay();
|
|
15666
|
+
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0) {
|
|
15667
|
+
totalDelay = currentSlideDelay;
|
|
15668
|
+
}
|
|
15669
|
+
return totalDelay;
|
|
15670
|
+
};
|
|
15645
15671
|
const run = delayForce => {
|
|
15646
15672
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15647
15673
|
cancelAnimationFrame(raf);
|
|
15648
15674
|
calcTimeLeft();
|
|
15649
|
-
let delay =
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
delay = currentSlideDelay;
|
|
15655
|
-
autoplayDelayTotal = currentSlideDelay;
|
|
15656
|
-
autoplayDelayCurrent = currentSlideDelay;
|
|
15675
|
+
let delay = delayForce;
|
|
15676
|
+
if (typeof delay === 'undefined') {
|
|
15677
|
+
delay = getTotalDelay();
|
|
15678
|
+
autoplayDelayTotal = delay;
|
|
15679
|
+
autoplayDelayCurrent = delay;
|
|
15657
15680
|
}
|
|
15658
15681
|
autoplayTimeLeft = delay;
|
|
15659
15682
|
const speed = swiper.params.speed;
|
|
@@ -15725,10 +15748,6 @@ function Autoplay(_ref) {
|
|
|
15725
15748
|
};
|
|
15726
15749
|
swiper.autoplay.paused = true;
|
|
15727
15750
|
if (reset) {
|
|
15728
|
-
if (slideChanged) {
|
|
15729
|
-
autoplayTimeLeft = swiper.params.autoplay.delay;
|
|
15730
|
-
}
|
|
15731
|
-
slideChanged = false;
|
|
15732
15751
|
proceed();
|
|
15733
15752
|
return;
|
|
15734
15753
|
}
|
|
@@ -15859,7 +15878,10 @@ function Autoplay(_ref) {
|
|
|
15859
15878
|
});
|
|
15860
15879
|
on('slideChange', () => {
|
|
15861
15880
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15862
|
-
|
|
15881
|
+
if (swiper.autoplay.paused) {
|
|
15882
|
+
autoplayTimeLeft = getTotalDelay();
|
|
15883
|
+
autoplayDelayTotal = getTotalDelay();
|
|
15884
|
+
}
|
|
15863
15885
|
});
|
|
15864
15886
|
Object.assign(swiper.autoplay, {
|
|
15865
15887
|
start,
|
|
@@ -15869,12 +15891,11 @@ function Autoplay(_ref) {
|
|
|
15869
15891
|
});
|
|
15870
15892
|
}
|
|
15871
15893
|
|
|
15872
|
-
function Thumb(
|
|
15873
|
-
|
|
15874
|
-
|
|
15875
|
-
|
|
15876
|
-
|
|
15877
|
-
} = _ref;
|
|
15894
|
+
function Thumb({
|
|
15895
|
+
swiper,
|
|
15896
|
+
extendParams,
|
|
15897
|
+
on
|
|
15898
|
+
}) {
|
|
15878
15899
|
extendParams({
|
|
15879
15900
|
thumbs: {
|
|
15880
15901
|
swiper: null,
|
|
@@ -15889,6 +15910,11 @@ function Thumb(_ref) {
|
|
|
15889
15910
|
swiper.thumbs = {
|
|
15890
15911
|
swiper: null
|
|
15891
15912
|
};
|
|
15913
|
+
function isVirtualEnabled() {
|
|
15914
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15915
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return false;
|
|
15916
|
+
return thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled;
|
|
15917
|
+
}
|
|
15892
15918
|
function onThumbClick() {
|
|
15893
15919
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15894
15920
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
@@ -15916,6 +15942,10 @@ function Thumb(_ref) {
|
|
|
15916
15942
|
initialized = true;
|
|
15917
15943
|
const SwiperClass = swiper.constructor;
|
|
15918
15944
|
if (thumbsParams.swiper instanceof SwiperClass) {
|
|
15945
|
+
if (thumbsParams.swiper.destroyed) {
|
|
15946
|
+
initialized = false;
|
|
15947
|
+
return false;
|
|
15948
|
+
}
|
|
15919
15949
|
swiper.thumbs.swiper = thumbsParams.swiper;
|
|
15920
15950
|
Object.assign(swiper.thumbs.swiper.originalParams, {
|
|
15921
15951
|
watchSlidesProgress: true,
|
|
@@ -15937,12 +15967,18 @@ function Thumb(_ref) {
|
|
|
15937
15967
|
}
|
|
15938
15968
|
swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
|
|
15939
15969
|
swiper.thumbs.swiper.on('tap', onThumbClick);
|
|
15970
|
+
if (isVirtualEnabled()) {
|
|
15971
|
+
swiper.thumbs.swiper.on('virtualUpdate', () => {
|
|
15972
|
+
update(false, {
|
|
15973
|
+
autoScroll: false
|
|
15974
|
+
});
|
|
15975
|
+
});
|
|
15976
|
+
}
|
|
15940
15977
|
return true;
|
|
15941
15978
|
}
|
|
15942
|
-
function update(initial) {
|
|
15979
|
+
function update(initial, p) {
|
|
15943
15980
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15944
15981
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15945
|
-
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15946
15982
|
|
|
15947
15983
|
// Activate thumbs
|
|
15948
15984
|
let thumbsToActivate = 1;
|
|
@@ -15955,7 +15991,7 @@ function Thumb(_ref) {
|
|
|
15955
15991
|
}
|
|
15956
15992
|
thumbsToActivate = Math.floor(thumbsToActivate);
|
|
15957
15993
|
thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
|
|
15958
|
-
if (thumbsSwiper.params.loop ||
|
|
15994
|
+
if (thumbsSwiper.params.loop || isVirtualEnabled()) {
|
|
15959
15995
|
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
15960
15996
|
elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
|
|
15961
15997
|
slideEl.classList.add(thumbActiveClass);
|
|
@@ -15968,6 +16004,14 @@ function Thumb(_ref) {
|
|
|
15968
16004
|
}
|
|
15969
16005
|
}
|
|
15970
16006
|
}
|
|
16007
|
+
if (p?.autoScroll ?? true) {
|
|
16008
|
+
autoScroll(initial ? 0 : undefined);
|
|
16009
|
+
}
|
|
16010
|
+
}
|
|
16011
|
+
function autoScroll(slideSpeed) {
|
|
16012
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
16013
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
16014
|
+
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15971
16015
|
const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
|
|
15972
16016
|
const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
|
|
15973
16017
|
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
|
|
@@ -15975,7 +16019,7 @@ function Thumb(_ref) {
|
|
|
15975
16019
|
let newThumbsIndex;
|
|
15976
16020
|
let direction;
|
|
15977
16021
|
if (thumbsSwiper.params.loop) {
|
|
15978
|
-
const newThumbsSlide = thumbsSwiper.slides.
|
|
16022
|
+
const newThumbsSlide = thumbsSwiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`);
|
|
15979
16023
|
newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
|
|
15980
16024
|
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
15981
16025
|
} else {
|
|
@@ -15993,7 +16037,7 @@ function Thumb(_ref) {
|
|
|
15993
16037
|
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
|
15994
16038
|
}
|
|
15995
16039
|
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
|
|
15996
|
-
thumbsSwiper.slideTo(newThumbsIndex,
|
|
16040
|
+
thumbsSwiper.slideTo(newThumbsIndex, slideSpeed);
|
|
15997
16041
|
}
|
|
15998
16042
|
}
|
|
15999
16043
|
}
|
|
@@ -16011,15 +16055,16 @@ function Thumb(_ref) {
|
|
|
16011
16055
|
init();
|
|
16012
16056
|
update(true);
|
|
16013
16057
|
} else if (thumbsElement) {
|
|
16058
|
+
const eventName = `${swiper.params.eventsPrefix}init`;
|
|
16014
16059
|
const onThumbsSwiper = e => {
|
|
16015
16060
|
thumbs.swiper = e.detail[0];
|
|
16016
|
-
thumbsElement.removeEventListener(
|
|
16061
|
+
thumbsElement.removeEventListener(eventName, onThumbsSwiper);
|
|
16017
16062
|
init();
|
|
16018
16063
|
update(true);
|
|
16019
16064
|
thumbs.swiper.update();
|
|
16020
16065
|
swiper.update();
|
|
16021
16066
|
};
|
|
16022
|
-
thumbsElement.addEventListener(
|
|
16067
|
+
thumbsElement.addEventListener(eventName, onThumbsSwiper);
|
|
16023
16068
|
}
|
|
16024
16069
|
return thumbsElement;
|
|
16025
16070
|
};
|