@bigbinary/neeto-site-blocks 2.1.0 → 2.2.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 +468 -469
- 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 +468 -469
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -15,14 +15,9 @@ 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');
|
|
19
18
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
20
19
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
21
20
|
var axios = require('axios');
|
|
22
|
-
require('swiper/scss/pagination');
|
|
23
|
-
require('swiper/scss/autoplay');
|
|
24
|
-
require('swiper/scss/thumbs');
|
|
25
|
-
require('swiper/scss/history');
|
|
26
21
|
|
|
27
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
23
|
|
|
@@ -7191,32 +7186,76 @@ var Button = function Button(_ref) {
|
|
|
7191
7186
|
"aria-label": label
|
|
7192
7187
|
};
|
|
7193
7188
|
React.useEffect(function () {
|
|
7194
|
-
if (!popupCode
|
|
7189
|
+
if (!popupCode) return;
|
|
7190
|
+
var isActive = true;
|
|
7191
|
+
var appendedNodes = [];
|
|
7195
7192
|
try {
|
|
7196
7193
|
var tempDiv = document.createElement("div");
|
|
7197
7194
|
tempDiv.innerHTML = popupCode;
|
|
7198
7195
|
var nodes = Array.from(tempDiv.childNodes);
|
|
7199
|
-
if (ramda.isEmpty(nodes))
|
|
7200
|
-
|
|
7201
|
-
var
|
|
7202
|
-
|
|
7203
|
-
var
|
|
7204
|
-
if (node.
|
|
7205
|
-
|
|
7206
|
-
|
|
7196
|
+
if (!ramda.isEmpty(nodes)) {
|
|
7197
|
+
var externalScriptNodes = [];
|
|
7198
|
+
var inlineScriptNodes = [];
|
|
7199
|
+
nodes.forEach(function () {
|
|
7200
|
+
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7201
|
+
if (node.tagName === "SCRIPT") {
|
|
7202
|
+
if (node.src) {
|
|
7203
|
+
externalScriptNodes.push(node);
|
|
7204
|
+
} else {
|
|
7205
|
+
inlineScriptNodes.push(node);
|
|
7206
|
+
}
|
|
7207
7207
|
} else {
|
|
7208
|
-
|
|
7208
|
+
document.body.appendChild(node);
|
|
7209
|
+
appendedNodes.push(node);
|
|
7209
7210
|
}
|
|
7210
|
-
|
|
7211
|
+
});
|
|
7212
|
+
var appendInlineScripts = function appendInlineScripts() {
|
|
7213
|
+
if (!isActive) return;
|
|
7214
|
+
inlineScriptNodes.forEach(function (node) {
|
|
7215
|
+
try {
|
|
7216
|
+
var script = document.createElement("script");
|
|
7217
|
+
// Wrap content in try/catch so runtime errors are suppressed even
|
|
7218
|
+
// when the browser executes the script asynchronously (e.g. Safari).
|
|
7219
|
+
script.textContent = "try{".concat(node.textContent, "}catch(e){}");
|
|
7220
|
+
document.body.appendChild(script);
|
|
7221
|
+
appendedNodes.push(script);
|
|
7222
|
+
} catch (_unused) {
|
|
7223
|
+
// NOTE: Errors from inline embed scripts are ignored since these
|
|
7224
|
+
// cannot be handled by NeetoSite.
|
|
7225
|
+
}
|
|
7226
|
+
});
|
|
7227
|
+
};
|
|
7228
|
+
if (externalScriptNodes.length === 0) {
|
|
7229
|
+
appendInlineScripts();
|
|
7211
7230
|
} else {
|
|
7212
|
-
|
|
7231
|
+
var settledCount = 0;
|
|
7232
|
+
externalScriptNodes.forEach(function (node) {
|
|
7233
|
+
var script = document.createElement("script");
|
|
7234
|
+
script.src = node.src;
|
|
7235
|
+
script.async = node.async || false;
|
|
7236
|
+
appendedNodes.push(script);
|
|
7237
|
+
var onSettled = function onSettled() {
|
|
7238
|
+
settledCount++;
|
|
7239
|
+
if (settledCount === externalScriptNodes.length) appendInlineScripts();
|
|
7240
|
+
};
|
|
7241
|
+
script.onload = onSettled;
|
|
7242
|
+
script.onerror = onSettled;
|
|
7243
|
+
document.body.appendChild(script);
|
|
7244
|
+
});
|
|
7213
7245
|
}
|
|
7214
|
-
}
|
|
7215
|
-
} catch (
|
|
7246
|
+
}
|
|
7247
|
+
} catch (_unused2) {
|
|
7216
7248
|
// NOTE: An error can occur while the user is typing out the embed code.
|
|
7217
7249
|
// It could also throw an error if the embed code is invalid. These errors
|
|
7218
7250
|
// are ignored since these cannot be handled by NeetoSite.
|
|
7219
7251
|
}
|
|
7252
|
+
return function () {
|
|
7253
|
+
isActive = false;
|
|
7254
|
+
appendedNodes.forEach(function (node) {
|
|
7255
|
+
var _node$parentNode;
|
|
7256
|
+
return (_node$parentNode = node.parentNode) === null || _node$parentNode === void 0 ? void 0 : _node$parentNode.removeChild(node);
|
|
7257
|
+
});
|
|
7258
|
+
};
|
|
7220
7259
|
}, [popupCode]);
|
|
7221
7260
|
if (action === "external") {
|
|
7222
7261
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {
|
|
@@ -7928,23 +7967,28 @@ var CardsClassic = function CardsClassic(_ref) {
|
|
|
7928
7967
|
};
|
|
7929
7968
|
|
|
7930
7969
|
/**
|
|
7931
|
-
* SSR Window
|
|
7970
|
+
* SSR Window 4.0.2
|
|
7932
7971
|
* Better handling for window object in SSR environment
|
|
7933
7972
|
* https://github.com/nolimits4web/ssr-window
|
|
7934
7973
|
*
|
|
7935
|
-
* Copyright
|
|
7974
|
+
* Copyright 2021, Vladimir Kharlampidi
|
|
7936
7975
|
*
|
|
7937
7976
|
* Licensed under MIT
|
|
7938
7977
|
*
|
|
7939
|
-
* Released on:
|
|
7978
|
+
* Released on: December 13, 2021
|
|
7940
7979
|
*/
|
|
7941
7980
|
/* eslint-disable no-param-reassign */
|
|
7942
7981
|
function isObject$2(obj) {
|
|
7943
7982
|
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
7944
7983
|
}
|
|
7945
|
-
function extend$2(target
|
|
7946
|
-
|
|
7947
|
-
|
|
7984
|
+
function extend$2(target, src) {
|
|
7985
|
+
if (target === void 0) {
|
|
7986
|
+
target = {};
|
|
7987
|
+
}
|
|
7988
|
+
if (src === void 0) {
|
|
7989
|
+
src = {};
|
|
7990
|
+
}
|
|
7991
|
+
Object.keys(src).forEach(key => {
|
|
7948
7992
|
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
7993
|
extend$2(target[key], src[key]);
|
|
7950
7994
|
}
|
|
@@ -8066,7 +8110,10 @@ function getWindow() {
|
|
|
8066
8110
|
return win;
|
|
8067
8111
|
}
|
|
8068
8112
|
|
|
8069
|
-
function classesToTokens(classes
|
|
8113
|
+
function classesToTokens(classes) {
|
|
8114
|
+
if (classes === void 0) {
|
|
8115
|
+
classes = '';
|
|
8116
|
+
}
|
|
8070
8117
|
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
8071
8118
|
}
|
|
8072
8119
|
|
|
@@ -8085,7 +8132,10 @@ function deleteProps(obj) {
|
|
|
8085
8132
|
}
|
|
8086
8133
|
});
|
|
8087
8134
|
}
|
|
8088
|
-
function nextTick(callback, delay
|
|
8135
|
+
function nextTick(callback, delay) {
|
|
8136
|
+
if (delay === void 0) {
|
|
8137
|
+
delay = 0;
|
|
8138
|
+
}
|
|
8089
8139
|
return setTimeout(callback, delay);
|
|
8090
8140
|
}
|
|
8091
8141
|
function now() {
|
|
@@ -8105,7 +8155,10 @@ function getComputedStyle$1(el) {
|
|
|
8105
8155
|
}
|
|
8106
8156
|
return style;
|
|
8107
8157
|
}
|
|
8108
|
-
function getTranslate(el, axis
|
|
8158
|
+
function getTranslate(el, axis) {
|
|
8159
|
+
if (axis === void 0) {
|
|
8160
|
+
axis = 'x';
|
|
8161
|
+
}
|
|
8109
8162
|
const window = getWindow();
|
|
8110
8163
|
let matrix;
|
|
8111
8164
|
let curTransform;
|
|
@@ -8151,12 +8204,13 @@ function isNode(node) {
|
|
|
8151
8204
|
}
|
|
8152
8205
|
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
8153
8206
|
}
|
|
8154
|
-
function extend$1(
|
|
8155
|
-
const to = Object(
|
|
8156
|
-
|
|
8157
|
-
|
|
8207
|
+
function extend$1() {
|
|
8208
|
+
const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
|
|
8209
|
+
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
8210
|
+
for (let i = 1; i < arguments.length; i += 1) {
|
|
8211
|
+
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
8158
8212
|
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
8159
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key => key
|
|
8213
|
+
const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
|
|
8160
8214
|
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
8161
8215
|
const nextKey = keysArray[nextIndex];
|
|
8162
8216
|
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
@@ -8186,11 +8240,12 @@ function extend$1(...args) {
|
|
|
8186
8240
|
function setCSSProperty(el, varName, varValue) {
|
|
8187
8241
|
el.style.setProperty(varName, varValue);
|
|
8188
8242
|
}
|
|
8189
|
-
function animateCSSModeScroll({
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8243
|
+
function animateCSSModeScroll(_ref) {
|
|
8244
|
+
let {
|
|
8245
|
+
swiper,
|
|
8246
|
+
targetPosition,
|
|
8247
|
+
side
|
|
8248
|
+
} = _ref;
|
|
8194
8249
|
const window = getWindow();
|
|
8195
8250
|
const startPosition = -swiper.translate;
|
|
8196
8251
|
let startTime = null;
|
|
@@ -8232,39 +8287,11 @@ function animateCSSModeScroll({
|
|
|
8232
8287
|
};
|
|
8233
8288
|
animate();
|
|
8234
8289
|
}
|
|
8235
|
-
function elementChildren(element, selector
|
|
8236
|
-
|
|
8237
|
-
|
|
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() : []));
|
|
8255
|
-
}
|
|
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
|
-
}
|
|
8290
|
+
function elementChildren(element, selector) {
|
|
8291
|
+
if (selector === void 0) {
|
|
8292
|
+
selector = '';
|
|
8266
8293
|
}
|
|
8267
|
-
return
|
|
8294
|
+
return [...element.children].filter(el => el.matches(selector));
|
|
8268
8295
|
}
|
|
8269
8296
|
function showWarning(text) {
|
|
8270
8297
|
try {
|
|
@@ -8274,7 +8301,10 @@ function showWarning(text) {
|
|
|
8274
8301
|
// err
|
|
8275
8302
|
}
|
|
8276
8303
|
}
|
|
8277
|
-
function createElement(tag, classes
|
|
8304
|
+
function createElement(tag, classes) {
|
|
8305
|
+
if (classes === void 0) {
|
|
8306
|
+
classes = [];
|
|
8307
|
+
}
|
|
8278
8308
|
const el = document.createElement(tag);
|
|
8279
8309
|
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
8280
8310
|
return el;
|
|
@@ -8352,15 +8382,6 @@ function elementOuterSize(el, size, includeMargins) {
|
|
|
8352
8382
|
}
|
|
8353
8383
|
return el.offsetWidth;
|
|
8354
8384
|
}
|
|
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
|
-
}
|
|
8364
8385
|
|
|
8365
8386
|
let support;
|
|
8366
8387
|
function calcSupport() {
|
|
@@ -8379,9 +8400,10 @@ function getSupport() {
|
|
|
8379
8400
|
}
|
|
8380
8401
|
|
|
8381
8402
|
let deviceCached;
|
|
8382
|
-
function calcDevice({
|
|
8383
|
-
|
|
8384
|
-
|
|
8403
|
+
function calcDevice(_temp) {
|
|
8404
|
+
let {
|
|
8405
|
+
userAgent
|
|
8406
|
+
} = _temp === void 0 ? {} : _temp;
|
|
8385
8407
|
const support = getSupport();
|
|
8386
8408
|
const window = getWindow();
|
|
8387
8409
|
const platform = window.navigator.platform;
|
|
@@ -8393,7 +8415,7 @@ function calcDevice({
|
|
|
8393
8415
|
const screenWidth = window.screen.width;
|
|
8394
8416
|
const screenHeight = window.screen.height;
|
|
8395
8417
|
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
|
8396
|
-
let ipad = ua.match(/(iPad)
|
|
8418
|
+
let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
8397
8419
|
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
8398
8420
|
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
|
8399
8421
|
const windows = platform === 'Win32';
|
|
@@ -8420,7 +8442,10 @@ function calcDevice({
|
|
|
8420
8442
|
// Export object
|
|
8421
8443
|
return device;
|
|
8422
8444
|
}
|
|
8423
|
-
function getDevice(overrides
|
|
8445
|
+
function getDevice(overrides) {
|
|
8446
|
+
if (overrides === void 0) {
|
|
8447
|
+
overrides = {};
|
|
8448
|
+
}
|
|
8424
8449
|
if (!deviceCached) {
|
|
8425
8450
|
deviceCached = calcDevice(overrides);
|
|
8426
8451
|
}
|
|
@@ -8460,11 +8485,12 @@ function getBrowser() {
|
|
|
8460
8485
|
return browser;
|
|
8461
8486
|
}
|
|
8462
8487
|
|
|
8463
|
-
function Resize({
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8488
|
+
function Resize(_ref) {
|
|
8489
|
+
let {
|
|
8490
|
+
swiper,
|
|
8491
|
+
on,
|
|
8492
|
+
emit
|
|
8493
|
+
} = _ref;
|
|
8468
8494
|
const window = getWindow();
|
|
8469
8495
|
let observer = null;
|
|
8470
8496
|
let animationFrame = null;
|
|
@@ -8483,11 +8509,12 @@ function Resize({
|
|
|
8483
8509
|
} = swiper;
|
|
8484
8510
|
let newWidth = width;
|
|
8485
8511
|
let newHeight = height;
|
|
8486
|
-
entries.forEach(
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8512
|
+
entries.forEach(_ref2 => {
|
|
8513
|
+
let {
|
|
8514
|
+
contentBoxSize,
|
|
8515
|
+
contentRect,
|
|
8516
|
+
target
|
|
8517
|
+
} = _ref2;
|
|
8491
8518
|
if (target && target !== swiper.el) return;
|
|
8492
8519
|
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
|
8493
8520
|
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
|
@@ -8527,15 +8554,19 @@ function Resize({
|
|
|
8527
8554
|
});
|
|
8528
8555
|
}
|
|
8529
8556
|
|
|
8530
|
-
function Observer({
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8557
|
+
function Observer(_ref) {
|
|
8558
|
+
let {
|
|
8559
|
+
swiper,
|
|
8560
|
+
extendParams,
|
|
8561
|
+
on,
|
|
8562
|
+
emit
|
|
8563
|
+
} = _ref;
|
|
8536
8564
|
const observers = [];
|
|
8537
8565
|
const window = getWindow();
|
|
8538
|
-
const attach = (target, options
|
|
8566
|
+
const attach = function (target, options) {
|
|
8567
|
+
if (options === void 0) {
|
|
8568
|
+
options = {};
|
|
8569
|
+
}
|
|
8539
8570
|
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
|
8540
8571
|
const observer = new ObserverFunc(mutations => {
|
|
8541
8572
|
// The observerUpdate event should only be triggered
|
|
@@ -8557,7 +8588,7 @@ function Observer({
|
|
|
8557
8588
|
});
|
|
8558
8589
|
observer.observe(target, {
|
|
8559
8590
|
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
|
8560
|
-
childList:
|
|
8591
|
+
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
|
8561
8592
|
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
|
8562
8593
|
});
|
|
8563
8594
|
observers.push(observer);
|
|
@@ -8613,11 +8644,14 @@ var eventsEmitter = {
|
|
|
8613
8644
|
const self = this;
|
|
8614
8645
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8615
8646
|
if (typeof handler !== 'function') return self;
|
|
8616
|
-
function onceHandler(
|
|
8647
|
+
function onceHandler() {
|
|
8617
8648
|
self.off(events, onceHandler);
|
|
8618
8649
|
if (onceHandler.__emitterProxy) {
|
|
8619
8650
|
delete onceHandler.__emitterProxy;
|
|
8620
8651
|
}
|
|
8652
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8653
|
+
args[_key] = arguments[_key];
|
|
8654
|
+
}
|
|
8621
8655
|
handler.apply(self, args);
|
|
8622
8656
|
}
|
|
8623
8657
|
onceHandler.__emitterProxy = handler;
|
|
@@ -8660,13 +8694,16 @@ var eventsEmitter = {
|
|
|
8660
8694
|
});
|
|
8661
8695
|
return self;
|
|
8662
8696
|
},
|
|
8663
|
-
emit(
|
|
8697
|
+
emit() {
|
|
8664
8698
|
const self = this;
|
|
8665
8699
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8666
8700
|
if (!self.eventsListeners) return self;
|
|
8667
8701
|
let events;
|
|
8668
8702
|
let data;
|
|
8669
8703
|
let context;
|
|
8704
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8705
|
+
args[_key2] = arguments[_key2];
|
|
8706
|
+
}
|
|
8670
8707
|
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
|
8671
8708
|
events = args[0];
|
|
8672
8709
|
data = args.slice(1, args.length);
|
|
@@ -8734,6 +8771,7 @@ function updateSlides() {
|
|
|
8734
8771
|
const {
|
|
8735
8772
|
wrapperEl,
|
|
8736
8773
|
slidesEl,
|
|
8774
|
+
size: swiperSize,
|
|
8737
8775
|
rtlTranslate: rtl,
|
|
8738
8776
|
wrongRTL
|
|
8739
8777
|
} = swiper;
|
|
@@ -8754,7 +8792,6 @@ function updateSlides() {
|
|
|
8754
8792
|
}
|
|
8755
8793
|
const previousSnapGridLength = swiper.snapGrid.length;
|
|
8756
8794
|
const previousSlidesGridLength = swiper.slidesGrid.length;
|
|
8757
|
-
const swiperSize = swiper.size - offsetBefore - offsetAfter;
|
|
8758
8795
|
let spaceBetween = params.spaceBetween;
|
|
8759
8796
|
let slidePosition = -offsetBefore;
|
|
8760
8797
|
let prevSlideSize = 0;
|
|
@@ -8767,7 +8804,7 @@ function updateSlides() {
|
|
|
8767
8804
|
} else if (typeof spaceBetween === 'string') {
|
|
8768
8805
|
spaceBetween = parseFloat(spaceBetween);
|
|
8769
8806
|
}
|
|
8770
|
-
swiper.virtualSize = -spaceBetween
|
|
8807
|
+
swiper.virtualSize = -spaceBetween;
|
|
8771
8808
|
|
|
8772
8809
|
// reset margins
|
|
8773
8810
|
slides.forEach(slideEl => {
|
|
@@ -8785,12 +8822,6 @@ function updateSlides() {
|
|
|
8785
8822
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
8786
8823
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
8787
8824
|
}
|
|
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
|
-
}
|
|
8794
8825
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
8795
8826
|
if (gridEnabled) {
|
|
8796
8827
|
swiper.grid.initSlides(slides);
|
|
@@ -8805,25 +8836,16 @@ function updateSlides() {
|
|
|
8805
8836
|
}).length > 0;
|
|
8806
8837
|
for (let i = 0; i < slidesLength; i += 1) {
|
|
8807
8838
|
slideSize = 0;
|
|
8808
|
-
|
|
8809
|
-
if (
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
}
|
|
8813
|
-
if (elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8839
|
+
let slide;
|
|
8840
|
+
if (slides[i]) slide = slides[i];
|
|
8841
|
+
if (gridEnabled) {
|
|
8842
|
+
swiper.grid.updateSlide(i, slide, slides);
|
|
8814
8843
|
}
|
|
8844
|
+
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8815
8845
|
|
|
8816
|
-
if (
|
|
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') {
|
|
8846
|
+
if (params.slidesPerView === 'auto') {
|
|
8825
8847
|
if (shouldResetSlideSize) {
|
|
8826
|
-
|
|
8848
|
+
slides[i].style[swiper.getDirectionLabel('width')] = ``;
|
|
8827
8849
|
}
|
|
8828
8850
|
const slideStyles = getComputedStyle(slide);
|
|
8829
8851
|
const currentTransform = slide.style.transform;
|
|
@@ -8864,12 +8886,12 @@ function updateSlides() {
|
|
|
8864
8886
|
} else {
|
|
8865
8887
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
8866
8888
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8867
|
-
if (
|
|
8868
|
-
|
|
8889
|
+
if (slides[i]) {
|
|
8890
|
+
slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8869
8891
|
}
|
|
8870
8892
|
}
|
|
8871
|
-
if (
|
|
8872
|
-
|
|
8893
|
+
if (slides[i]) {
|
|
8894
|
+
slides[i].swiperSlideSize = slideSize;
|
|
8873
8895
|
}
|
|
8874
8896
|
slidesSizesGrid.push(slideSize);
|
|
8875
8897
|
if (params.centeredSlides) {
|
|
@@ -8903,52 +8925,17 @@ function updateSlides() {
|
|
|
8903
8925
|
|
|
8904
8926
|
// Remove last grid elements depending on width
|
|
8905
8927
|
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
|
-
}
|
|
8932
8928
|
const newSlidesGrid = [];
|
|
8933
8929
|
for (let i = 0; i < snapGrid.length; i += 1) {
|
|
8934
8930
|
let slidesGridItem = snapGrid[i];
|
|
8935
8931
|
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
|
8936
|
-
if (
|
|
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
|
|
8932
|
+
if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
8943
8933
|
newSlidesGrid.push(slidesGridItem);
|
|
8944
8934
|
}
|
|
8945
8935
|
}
|
|
8946
8936
|
snapGrid = newSlidesGrid;
|
|
8947
8937
|
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
|
8948
|
-
|
|
8949
|
-
if (!shouldSnapToSlideEdge) {
|
|
8950
|
-
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8951
|
-
}
|
|
8938
|
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8952
8939
|
}
|
|
8953
8940
|
}
|
|
8954
8941
|
if (isVirtual && params.loop) {
|
|
@@ -8987,7 +8974,7 @@ function updateSlides() {
|
|
|
8987
8974
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8988
8975
|
});
|
|
8989
8976
|
allSlidesSize -= spaceBetween;
|
|
8990
|
-
const maxSnap = allSlidesSize
|
|
8977
|
+
const maxSnap = allSlidesSize - swiperSize;
|
|
8991
8978
|
snapGrid = snapGrid.map(snap => {
|
|
8992
8979
|
if (snap <= 0) return -offsetBefore;
|
|
8993
8980
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -9000,8 +8987,9 @@ function updateSlides() {
|
|
|
9000
8987
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
9001
8988
|
});
|
|
9002
8989
|
allSlidesSize -= spaceBetween;
|
|
9003
|
-
|
|
9004
|
-
|
|
8990
|
+
const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
|
|
8991
|
+
if (allSlidesSize + offsetSize < swiperSize) {
|
|
8992
|
+
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
9005
8993
|
snapGrid.forEach((snap, snapIndex) => {
|
|
9006
8994
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
9007
8995
|
});
|
|
@@ -9112,7 +9100,10 @@ const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
|
9112
9100
|
slideEl.classList.remove(className);
|
|
9113
9101
|
}
|
|
9114
9102
|
};
|
|
9115
|
-
function updateSlidesProgress(translate
|
|
9103
|
+
function updateSlidesProgress(translate) {
|
|
9104
|
+
if (translate === void 0) {
|
|
9105
|
+
translate = this && this.translate || 0;
|
|
9106
|
+
}
|
|
9116
9107
|
const swiper = this;
|
|
9117
9108
|
const params = swiper.params;
|
|
9118
9109
|
const {
|
|
@@ -9252,9 +9243,9 @@ function updateSlidesClasses() {
|
|
|
9252
9243
|
}
|
|
9253
9244
|
} else {
|
|
9254
9245
|
if (gridEnabled) {
|
|
9255
|
-
activeSlide = slides.
|
|
9256
|
-
nextSlide = slides.
|
|
9257
|
-
prevSlide = slides.
|
|
9246
|
+
activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
9247
|
+
nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0];
|
|
9248
|
+
prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0];
|
|
9258
9249
|
} else {
|
|
9259
9250
|
activeSlide = slides[activeIndex];
|
|
9260
9251
|
}
|
|
@@ -9296,13 +9287,12 @@ const processLazyPreloader = (swiper, imageEl) => {
|
|
|
9296
9287
|
requestAnimationFrame(() => {
|
|
9297
9288
|
if (slideEl.shadowRoot) {
|
|
9298
9289
|
lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
|
|
9299
|
-
if (lazyEl
|
|
9290
|
+
if (lazyEl) lazyEl.remove();
|
|
9300
9291
|
}
|
|
9301
9292
|
});
|
|
9302
9293
|
}
|
|
9303
9294
|
}
|
|
9304
|
-
|
|
9305
|
-
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9295
|
+
if (lazyEl) lazyEl.remove();
|
|
9306
9296
|
}
|
|
9307
9297
|
};
|
|
9308
9298
|
const unlazy = (swiper, index) => {
|
|
@@ -9417,14 +9407,10 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
9417
9407
|
|
|
9418
9408
|
// Get real index
|
|
9419
9409
|
let realIndex;
|
|
9420
|
-
if (swiper.virtual && params.virtual.enabled) {
|
|
9421
|
-
|
|
9422
|
-
realIndex = getVirtualRealIndex(activeIndex);
|
|
9423
|
-
} else {
|
|
9424
|
-
realIndex = activeIndex;
|
|
9425
|
-
}
|
|
9410
|
+
if (swiper.virtual && params.virtual.enabled && params.loop) {
|
|
9411
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
9426
9412
|
} else if (gridEnabled) {
|
|
9427
|
-
const firstSlideInColumn = swiper.slides.
|
|
9413
|
+
const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
9428
9414
|
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
9429
9415
|
if (Number.isNaN(activeSlideIndex)) {
|
|
9430
9416
|
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
@@ -9512,7 +9498,10 @@ var update = {
|
|
|
9512
9498
|
updateClickedSlide
|
|
9513
9499
|
};
|
|
9514
9500
|
|
|
9515
|
-
function getSwiperTranslate(axis
|
|
9501
|
+
function getSwiperTranslate(axis) {
|
|
9502
|
+
if (axis === void 0) {
|
|
9503
|
+
axis = this.isHorizontal() ? 'x' : 'y';
|
|
9504
|
+
}
|
|
9516
9505
|
const swiper = this;
|
|
9517
9506
|
const {
|
|
9518
9507
|
params,
|
|
@@ -9587,7 +9576,19 @@ function maxTranslate() {
|
|
|
9587
9576
|
return -this.snapGrid[this.snapGrid.length - 1];
|
|
9588
9577
|
}
|
|
9589
9578
|
|
|
9590
|
-
function translateTo(translate
|
|
9579
|
+
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
9580
|
+
if (translate === void 0) {
|
|
9581
|
+
translate = 0;
|
|
9582
|
+
}
|
|
9583
|
+
if (speed === void 0) {
|
|
9584
|
+
speed = this.params.speed;
|
|
9585
|
+
}
|
|
9586
|
+
if (runCallbacks === void 0) {
|
|
9587
|
+
runCallbacks = true;
|
|
9588
|
+
}
|
|
9589
|
+
if (translateBounds === void 0) {
|
|
9590
|
+
translateBounds = true;
|
|
9591
|
+
}
|
|
9591
9592
|
const swiper = this;
|
|
9592
9593
|
const {
|
|
9593
9594
|
params,
|
|
@@ -9675,12 +9676,13 @@ function setTransition(duration, byController) {
|
|
|
9675
9676
|
swiper.emit('setTransition', duration, byController);
|
|
9676
9677
|
}
|
|
9677
9678
|
|
|
9678
|
-
function transitionEmit({
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9679
|
+
function transitionEmit(_ref) {
|
|
9680
|
+
let {
|
|
9681
|
+
swiper,
|
|
9682
|
+
runCallbacks,
|
|
9683
|
+
direction,
|
|
9684
|
+
step
|
|
9685
|
+
} = _ref;
|
|
9684
9686
|
const {
|
|
9685
9687
|
activeIndex,
|
|
9686
9688
|
previousIndex
|
|
@@ -9690,9 +9692,11 @@ function transitionEmit({
|
|
|
9690
9692
|
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
|
|
9691
9693
|
}
|
|
9692
9694
|
swiper.emit(`transition${step}`);
|
|
9693
|
-
if (runCallbacks &&
|
|
9694
|
-
|
|
9695
|
-
|
|
9695
|
+
if (runCallbacks && activeIndex !== previousIndex) {
|
|
9696
|
+
if (dir === 'reset') {
|
|
9697
|
+
swiper.emit(`slideResetTransition${step}`);
|
|
9698
|
+
return;
|
|
9699
|
+
}
|
|
9696
9700
|
swiper.emit(`slideChangeTransition${step}`);
|
|
9697
9701
|
if (dir === 'next') {
|
|
9698
9702
|
swiper.emit(`slideNextTransition${step}`);
|
|
@@ -9702,7 +9706,10 @@ function transitionEmit({
|
|
|
9702
9706
|
}
|
|
9703
9707
|
}
|
|
9704
9708
|
|
|
9705
|
-
function transitionStart(runCallbacks
|
|
9709
|
+
function transitionStart(runCallbacks, direction) {
|
|
9710
|
+
if (runCallbacks === void 0) {
|
|
9711
|
+
runCallbacks = true;
|
|
9712
|
+
}
|
|
9706
9713
|
const swiper = this;
|
|
9707
9714
|
const {
|
|
9708
9715
|
params
|
|
@@ -9719,7 +9726,10 @@ function transitionStart(runCallbacks = true, direction) {
|
|
|
9719
9726
|
});
|
|
9720
9727
|
}
|
|
9721
9728
|
|
|
9722
|
-
function transitionEnd(runCallbacks
|
|
9729
|
+
function transitionEnd(runCallbacks, direction) {
|
|
9730
|
+
if (runCallbacks === void 0) {
|
|
9731
|
+
runCallbacks = true;
|
|
9732
|
+
}
|
|
9723
9733
|
const swiper = this;
|
|
9724
9734
|
const {
|
|
9725
9735
|
params
|
|
@@ -9741,7 +9751,13 @@ var transition = {
|
|
|
9741
9751
|
transitionEnd
|
|
9742
9752
|
};
|
|
9743
9753
|
|
|
9744
|
-
function slideTo(index
|
|
9754
|
+
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
9755
|
+
if (index === void 0) {
|
|
9756
|
+
index = 0;
|
|
9757
|
+
}
|
|
9758
|
+
if (runCallbacks === void 0) {
|
|
9759
|
+
runCallbacks = true;
|
|
9760
|
+
}
|
|
9745
9761
|
if (typeof index === 'string') {
|
|
9746
9762
|
index = parseInt(index, 10);
|
|
9747
9763
|
}
|
|
@@ -9805,11 +9821,8 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9805
9821
|
let direction;
|
|
9806
9822
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
9807
9823
|
|
|
9808
|
-
// initial virtual
|
|
9809
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9810
|
-
const isInitialVirtual = isVirtual && initial;
|
|
9811
9824
|
// Update Index
|
|
9812
|
-
if (
|
|
9825
|
+
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
9813
9826
|
swiper.updateActiveIndex(slideIndex);
|
|
9814
9827
|
// Update Height
|
|
9815
9828
|
if (params.autoHeight) {
|
|
@@ -9829,6 +9842,7 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9829
9842
|
const isH = swiper.isHorizontal();
|
|
9830
9843
|
const t = rtl ? translate : -translate;
|
|
9831
9844
|
if (speed === 0) {
|
|
9845
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9832
9846
|
if (isVirtual) {
|
|
9833
9847
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
9834
9848
|
swiper._immediateVirtual = true;
|
|
@@ -9863,11 +9877,6 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9863
9877
|
}
|
|
9864
9878
|
return true;
|
|
9865
9879
|
}
|
|
9866
|
-
const browser = getBrowser();
|
|
9867
|
-
const isSafari = browser.isSafari;
|
|
9868
|
-
if (isVirtual && !initial && isSafari && swiper.isElement) {
|
|
9869
|
-
swiper.virtual.update(false, false, slideIndex);
|
|
9870
|
-
}
|
|
9871
9880
|
swiper.setTransition(speed);
|
|
9872
9881
|
swiper.setTranslate(translate);
|
|
9873
9882
|
swiper.updateActiveIndex(slideIndex);
|
|
@@ -9893,7 +9902,13 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9893
9902
|
return true;
|
|
9894
9903
|
}
|
|
9895
9904
|
|
|
9896
|
-
function slideToLoop(index
|
|
9905
|
+
function slideToLoop(index, speed, runCallbacks, internal) {
|
|
9906
|
+
if (index === void 0) {
|
|
9907
|
+
index = 0;
|
|
9908
|
+
}
|
|
9909
|
+
if (runCallbacks === void 0) {
|
|
9910
|
+
runCallbacks = true;
|
|
9911
|
+
}
|
|
9897
9912
|
if (typeof index === 'string') {
|
|
9898
9913
|
const indexAsNumber = parseInt(index, 10);
|
|
9899
9914
|
index = indexAsNumber;
|
|
@@ -9913,35 +9928,32 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9913
9928
|
let targetSlideIndex;
|
|
9914
9929
|
if (gridEnabled) {
|
|
9915
9930
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9916
|
-
targetSlideIndex = swiper.slides.
|
|
9931
|
+
targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
9917
9932
|
} else {
|
|
9918
9933
|
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
9919
9934
|
}
|
|
9920
9935
|
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
9921
9936
|
const {
|
|
9922
|
-
centeredSlides
|
|
9923
|
-
slidesOffsetBefore,
|
|
9924
|
-
slidesOffsetAfter
|
|
9937
|
+
centeredSlides
|
|
9925
9938
|
} = swiper.params;
|
|
9926
|
-
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
9927
9939
|
let slidesPerView = swiper.params.slidesPerView;
|
|
9928
9940
|
if (slidesPerView === 'auto') {
|
|
9929
9941
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
9930
9942
|
} else {
|
|
9931
9943
|
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
9932
|
-
if (
|
|
9944
|
+
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
9933
9945
|
slidesPerView = slidesPerView + 1;
|
|
9934
9946
|
}
|
|
9935
9947
|
}
|
|
9936
9948
|
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
9937
|
-
if (
|
|
9949
|
+
if (centeredSlides) {
|
|
9938
9950
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
9939
9951
|
}
|
|
9940
|
-
if (internal &&
|
|
9952
|
+
if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
9941
9953
|
needLoopFix = false;
|
|
9942
9954
|
}
|
|
9943
9955
|
if (needLoopFix) {
|
|
9944
|
-
const direction =
|
|
9956
|
+
const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
9945
9957
|
swiper.loopFix({
|
|
9946
9958
|
direction,
|
|
9947
9959
|
slideTo: true,
|
|
@@ -9951,7 +9963,7 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9951
9963
|
}
|
|
9952
9964
|
if (gridEnabled) {
|
|
9953
9965
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9954
|
-
newIndex = swiper.slides.
|
|
9966
|
+
newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
9955
9967
|
} else {
|
|
9956
9968
|
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
9957
9969
|
}
|
|
@@ -9964,7 +9976,10 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9964
9976
|
}
|
|
9965
9977
|
|
|
9966
9978
|
/* eslint no-unused-vars: "off" */
|
|
9967
|
-
function slideNext(speed, runCallbacks
|
|
9979
|
+
function slideNext(speed, runCallbacks, internal) {
|
|
9980
|
+
if (runCallbacks === void 0) {
|
|
9981
|
+
runCallbacks = true;
|
|
9982
|
+
}
|
|
9968
9983
|
const swiper = this;
|
|
9969
9984
|
const {
|
|
9970
9985
|
enabled,
|
|
@@ -10002,7 +10017,10 @@ function slideNext(speed, runCallbacks = true, internal) {
|
|
|
10002
10017
|
}
|
|
10003
10018
|
|
|
10004
10019
|
/* eslint no-unused-vars: "off" */
|
|
10005
|
-
function slidePrev(speed, runCallbacks
|
|
10020
|
+
function slidePrev(speed, runCallbacks, internal) {
|
|
10021
|
+
if (runCallbacks === void 0) {
|
|
10022
|
+
runCallbacks = true;
|
|
10023
|
+
}
|
|
10006
10024
|
const swiper = this;
|
|
10007
10025
|
const {
|
|
10008
10026
|
params,
|
|
@@ -10032,9 +10050,8 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10032
10050
|
}
|
|
10033
10051
|
const normalizedTranslate = normalize(translate);
|
|
10034
10052
|
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
|
10035
|
-
const isFreeMode = params.freeMode && params.freeMode.enabled;
|
|
10036
10053
|
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
|
10037
|
-
if (typeof prevSnap === 'undefined' &&
|
|
10054
|
+
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
|
10038
10055
|
let prevSnapIndex;
|
|
10039
10056
|
snapGrid.forEach((snap, snapIndex) => {
|
|
10040
10057
|
if (normalizedTranslate >= snap) {
|
|
@@ -10043,7 +10060,7 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10043
10060
|
}
|
|
10044
10061
|
});
|
|
10045
10062
|
if (typeof prevSnapIndex !== 'undefined') {
|
|
10046
|
-
prevSnap =
|
|
10063
|
+
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10047
10064
|
}
|
|
10048
10065
|
}
|
|
10049
10066
|
let prevIndex = 0;
|
|
@@ -10068,7 +10085,10 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10068
10085
|
}
|
|
10069
10086
|
|
|
10070
10087
|
/* eslint no-unused-vars: "off" */
|
|
10071
|
-
function slideReset(speed, runCallbacks
|
|
10088
|
+
function slideReset(speed, runCallbacks, internal) {
|
|
10089
|
+
if (runCallbacks === void 0) {
|
|
10090
|
+
runCallbacks = true;
|
|
10091
|
+
}
|
|
10072
10092
|
const swiper = this;
|
|
10073
10093
|
if (swiper.destroyed) return;
|
|
10074
10094
|
if (typeof speed === 'undefined') {
|
|
@@ -10078,7 +10098,13 @@ function slideReset(speed, runCallbacks = true, internal) {
|
|
|
10078
10098
|
}
|
|
10079
10099
|
|
|
10080
10100
|
/* eslint no-unused-vars: "off" */
|
|
10081
|
-
function slideToClosest(speed, runCallbacks
|
|
10101
|
+
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
10102
|
+
if (runCallbacks === void 0) {
|
|
10103
|
+
runCallbacks = true;
|
|
10104
|
+
}
|
|
10105
|
+
if (threshold === void 0) {
|
|
10106
|
+
threshold = 0.5;
|
|
10107
|
+
}
|
|
10082
10108
|
const swiper = this;
|
|
10083
10109
|
if (swiper.destroyed) return;
|
|
10084
10110
|
if (typeof speed === 'undefined') {
|
|
@@ -10118,16 +10144,23 @@ function slideToClickedSlide() {
|
|
|
10118
10144
|
slidesEl
|
|
10119
10145
|
} = swiper;
|
|
10120
10146
|
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
10121
|
-
let slideToIndex = swiper.
|
|
10147
|
+
let slideToIndex = swiper.clickedIndex;
|
|
10122
10148
|
let realIndex;
|
|
10123
10149
|
const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
|
|
10124
|
-
const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
10125
10150
|
if (params.loop) {
|
|
10126
10151
|
if (swiper.animating) return;
|
|
10127
10152
|
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
10128
10153
|
if (params.centeredSlides) {
|
|
10129
|
-
swiper.
|
|
10130
|
-
|
|
10154
|
+
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
|
|
10155
|
+
swiper.loopFix();
|
|
10156
|
+
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10157
|
+
nextTick(() => {
|
|
10158
|
+
swiper.slideTo(slideToIndex);
|
|
10159
|
+
});
|
|
10160
|
+
} else {
|
|
10161
|
+
swiper.slideTo(slideToIndex);
|
|
10162
|
+
}
|
|
10163
|
+
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
10131
10164
|
swiper.loopFix();
|
|
10132
10165
|
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10133
10166
|
nextTick(() => {
|
|
@@ -10151,7 +10184,7 @@ var slide = {
|
|
|
10151
10184
|
slideToClickedSlide
|
|
10152
10185
|
};
|
|
10153
10186
|
|
|
10154
|
-
function loopCreate(slideRealIndex
|
|
10187
|
+
function loopCreate(slideRealIndex) {
|
|
10155
10188
|
const swiper = this;
|
|
10156
10189
|
const {
|
|
10157
10190
|
params,
|
|
@@ -10164,20 +10197,7 @@ function loopCreate(slideRealIndex, initial) {
|
|
|
10164
10197
|
el.setAttribute('data-swiper-slide-index', index);
|
|
10165
10198
|
});
|
|
10166
10199
|
};
|
|
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
|
-
};
|
|
10177
10200
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10178
|
-
if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
|
|
10179
|
-
clearBlankSlides();
|
|
10180
|
-
}
|
|
10181
10201
|
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
10182
10202
|
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
10183
10203
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
@@ -10210,24 +10230,22 @@ function loopCreate(slideRealIndex, initial) {
|
|
|
10210
10230
|
} else {
|
|
10211
10231
|
initSlides();
|
|
10212
10232
|
}
|
|
10213
|
-
const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
|
|
10214
10233
|
swiper.loopFix({
|
|
10215
10234
|
slideRealIndex,
|
|
10216
|
-
direction:
|
|
10217
|
-
initial
|
|
10235
|
+
direction: params.centeredSlides ? undefined : 'next'
|
|
10218
10236
|
});
|
|
10219
10237
|
}
|
|
10220
10238
|
|
|
10221
|
-
function loopFix({
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
} = {}
|
|
10239
|
+
function loopFix(_temp) {
|
|
10240
|
+
let {
|
|
10241
|
+
slideRealIndex,
|
|
10242
|
+
slideTo = true,
|
|
10243
|
+
direction,
|
|
10244
|
+
setTranslate,
|
|
10245
|
+
activeSlideIndex,
|
|
10246
|
+
byController,
|
|
10247
|
+
byMousewheel
|
|
10248
|
+
} = _temp === void 0 ? {} : _temp;
|
|
10231
10249
|
const swiper = this;
|
|
10232
10250
|
if (!swiper.params.loop) return;
|
|
10233
10251
|
swiper.emit('beforeLoopFix');
|
|
@@ -10239,19 +10257,15 @@ function loopFix({
|
|
|
10239
10257
|
params
|
|
10240
10258
|
} = swiper;
|
|
10241
10259
|
const {
|
|
10242
|
-
centeredSlides
|
|
10243
|
-
slidesOffsetBefore,
|
|
10244
|
-
slidesOffsetAfter,
|
|
10245
|
-
initialSlide
|
|
10260
|
+
centeredSlides
|
|
10246
10261
|
} = params;
|
|
10247
|
-
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
10248
10262
|
swiper.allowSlidePrev = true;
|
|
10249
10263
|
swiper.allowSlideNext = true;
|
|
10250
10264
|
if (swiper.virtual && params.virtual.enabled) {
|
|
10251
10265
|
if (slideTo) {
|
|
10252
|
-
if (!
|
|
10266
|
+
if (!params.centeredSlides && swiper.snapIndex === 0) {
|
|
10253
10267
|
swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
|
|
10254
|
-
} else if (
|
|
10268
|
+
} else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
|
|
10255
10269
|
swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
|
|
10256
10270
|
} else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
|
|
10257
10271
|
swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
|
|
@@ -10267,30 +10281,28 @@ function loopFix({
|
|
|
10267
10281
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
10268
10282
|
} else {
|
|
10269
10283
|
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
10270
|
-
if (
|
|
10284
|
+
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
10271
10285
|
slidesPerView = slidesPerView + 1;
|
|
10272
10286
|
}
|
|
10273
10287
|
}
|
|
10274
10288
|
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
10275
|
-
let loopedSlides =
|
|
10289
|
+
let loopedSlides = slidesPerGroup;
|
|
10276
10290
|
if (loopedSlides % slidesPerGroup !== 0) {
|
|
10277
10291
|
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
10278
10292
|
}
|
|
10279
10293
|
loopedSlides += params.loopAdditionalSlides;
|
|
10280
10294
|
swiper.loopedSlides = loopedSlides;
|
|
10281
10295
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10282
|
-
if (slides.length < slidesPerView + loopedSlides
|
|
10283
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled
|
|
10296
|
+
if (slides.length < slidesPerView + loopedSlides) {
|
|
10297
|
+
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
|
|
10284
10298
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
10285
10299
|
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
10286
10300
|
}
|
|
10287
10301
|
const prependSlidesIndexes = [];
|
|
10288
10302
|
const appendSlidesIndexes = [];
|
|
10289
|
-
|
|
10290
|
-
const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
|
|
10291
|
-
let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
|
|
10303
|
+
let activeIndex = swiper.activeIndex;
|
|
10292
10304
|
if (typeof activeSlideIndex === 'undefined') {
|
|
10293
|
-
activeSlideIndex = swiper.getSlideIndex(slides.
|
|
10305
|
+
activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
|
|
10294
10306
|
} else {
|
|
10295
10307
|
activeIndex = activeSlideIndex;
|
|
10296
10308
|
}
|
|
@@ -10298,8 +10310,9 @@ function loopFix({
|
|
|
10298
10310
|
const isPrev = direction === 'prev' || !direction;
|
|
10299
10311
|
let slidesPrepended = 0;
|
|
10300
10312
|
let slidesAppended = 0;
|
|
10313
|
+
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10301
10314
|
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
10302
|
-
const activeColIndexWithShift = activeColIndex + (
|
|
10315
|
+
const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
10303
10316
|
// prepend last slides before start
|
|
10304
10317
|
if (activeColIndexWithShift < loopedSlides) {
|
|
10305
10318
|
slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
|
|
@@ -10319,9 +10332,6 @@ function loopFix({
|
|
|
10319
10332
|
}
|
|
10320
10333
|
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
10321
10334
|
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
10322
|
-
if (isInitialOverflow) {
|
|
10323
|
-
slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
|
|
10324
|
-
}
|
|
10325
10335
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
10326
10336
|
const index = i - Math.floor(i / cols) * cols;
|
|
10327
10337
|
if (gridEnabled) {
|
|
@@ -10337,14 +10347,6 @@ function loopFix({
|
|
|
10337
10347
|
requestAnimationFrame(() => {
|
|
10338
10348
|
swiper.__preventObserver__ = false;
|
|
10339
10349
|
});
|
|
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
|
-
}
|
|
10348
10350
|
if (isPrev) {
|
|
10349
10351
|
prependSlidesIndexes.forEach(index => {
|
|
10350
10352
|
slides[index].swiperLoopMoveDOM = true;
|
|
@@ -10445,7 +10447,7 @@ function loopDestroy() {
|
|
|
10445
10447
|
params,
|
|
10446
10448
|
slidesEl
|
|
10447
10449
|
} = swiper;
|
|
10448
|
-
if (!params.loop ||
|
|
10450
|
+
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10449
10451
|
swiper.recalcSlides();
|
|
10450
10452
|
const newSlidesOrder = [];
|
|
10451
10453
|
swiper.slides.forEach(slideEl => {
|
|
@@ -10506,7 +10508,10 @@ var grabCursor = {
|
|
|
10506
10508
|
};
|
|
10507
10509
|
|
|
10508
10510
|
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
10509
|
-
function closestElement(selector, base
|
|
10511
|
+
function closestElement(selector, base) {
|
|
10512
|
+
if (base === void 0) {
|
|
10513
|
+
base = this;
|
|
10514
|
+
}
|
|
10510
10515
|
function __closestFrom(el) {
|
|
10511
10516
|
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
10512
10517
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
@@ -10568,7 +10573,7 @@ function onTouchStart(event) {
|
|
|
10568
10573
|
}
|
|
10569
10574
|
let targetEl = e.target;
|
|
10570
10575
|
if (params.touchEventsTarget === 'wrapper') {
|
|
10571
|
-
if (!
|
|
10576
|
+
if (!swiper.wrapperEl.contains(targetEl)) return;
|
|
10572
10577
|
}
|
|
10573
10578
|
if ('which' in e && e.which === 3) return;
|
|
10574
10579
|
if ('button' in e && e.button > 0) return;
|
|
@@ -10623,7 +10628,7 @@ function onTouchStart(event) {
|
|
|
10623
10628
|
data.isTouched = false;
|
|
10624
10629
|
}
|
|
10625
10630
|
}
|
|
10626
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl
|
|
10631
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
|
|
10627
10632
|
document.activeElement.blur();
|
|
10628
10633
|
}
|
|
10629
10634
|
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
@@ -10657,7 +10662,7 @@ function onTouchMove(event) {
|
|
|
10657
10662
|
}
|
|
10658
10663
|
let targetTouch;
|
|
10659
10664
|
if (e.type === 'touchmove') {
|
|
10660
|
-
targetTouch = [...e.changedTouches].
|
|
10665
|
+
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
10661
10666
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10662
10667
|
} else {
|
|
10663
10668
|
targetTouch = e;
|
|
@@ -10698,15 +10703,10 @@ function onTouchMove(event) {
|
|
|
10698
10703
|
data.isMoved = false;
|
|
10699
10704
|
return;
|
|
10700
10705
|
}
|
|
10701
|
-
} else if (
|
|
10702
|
-
return;
|
|
10703
|
-
} else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
10706
|
+
} else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
|
|
10704
10707
|
return;
|
|
10705
10708
|
}
|
|
10706
10709
|
}
|
|
10707
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
|
|
10708
|
-
document.activeElement.blur();
|
|
10709
|
-
}
|
|
10710
10710
|
if (document.activeElement) {
|
|
10711
10711
|
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
10712
10712
|
data.isMoved = true;
|
|
@@ -10802,7 +10802,7 @@ function onTouchMove(event) {
|
|
|
10802
10802
|
}
|
|
10803
10803
|
let loopFixed;
|
|
10804
10804
|
new Date().getTime();
|
|
10805
|
-
if (
|
|
10805
|
+
if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10806
10806
|
Object.assign(touches, {
|
|
10807
10807
|
startX: pageX,
|
|
10808
10808
|
startY: pageY,
|
|
@@ -10823,7 +10823,7 @@ function onTouchMove(event) {
|
|
|
10823
10823
|
resistanceRatio = 0;
|
|
10824
10824
|
}
|
|
10825
10825
|
if (diff > 0) {
|
|
10826
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1]
|
|
10826
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {
|
|
10827
10827
|
swiper.loopFix({
|
|
10828
10828
|
direction: 'prev',
|
|
10829
10829
|
setTranslate: true,
|
|
@@ -10837,7 +10837,7 @@ function onTouchMove(event) {
|
|
|
10837
10837
|
}
|
|
10838
10838
|
}
|
|
10839
10839
|
} else if (diff < 0) {
|
|
10840
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1]
|
|
10840
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {
|
|
10841
10841
|
swiper.loopFix({
|
|
10842
10842
|
direction: 'next',
|
|
10843
10843
|
setTranslate: true,
|
|
@@ -10910,7 +10910,7 @@ function onTouchEnd(event) {
|
|
|
10910
10910
|
if (e.pointerId !== data.pointerId) return;
|
|
10911
10911
|
targetTouch = e;
|
|
10912
10912
|
} else {
|
|
10913
|
-
targetTouch = [...e.changedTouches].
|
|
10913
|
+
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
10914
10914
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10915
10915
|
}
|
|
10916
10916
|
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
|
|
@@ -11284,12 +11284,9 @@ function setBreakpoint() {
|
|
|
11284
11284
|
} = swiper;
|
|
11285
11285
|
const breakpoints = params.breakpoints;
|
|
11286
11286
|
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
|
|
11287
|
-
const document = getDocument();
|
|
11288
11287
|
|
|
11289
|
-
// Get breakpoint for window
|
|
11290
|
-
const
|
|
11291
|
-
const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
|
|
11292
|
-
const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
|
|
11288
|
+
// Get breakpoint for window width and update parameters
|
|
11289
|
+
const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
|
|
11293
11290
|
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
|
11294
11291
|
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
|
11295
11292
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
@@ -11362,7 +11359,10 @@ function setBreakpoint() {
|
|
|
11362
11359
|
swiper.emit('breakpoint', breakpointParams);
|
|
11363
11360
|
}
|
|
11364
11361
|
|
|
11365
|
-
function getBreakpoint(breakpoints, base
|
|
11362
|
+
function getBreakpoint(breakpoints, base, containerEl) {
|
|
11363
|
+
if (base === void 0) {
|
|
11364
|
+
base = 'window';
|
|
11365
|
+
}
|
|
11366
11366
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
11367
11367
|
let breakpoint = false;
|
|
11368
11368
|
const window = getWindow();
|
|
@@ -11557,7 +11557,6 @@ var defaults = {
|
|
|
11557
11557
|
// in px
|
|
11558
11558
|
normalizeSlideIndex: true,
|
|
11559
11559
|
centerInsufficientSlides: false,
|
|
11560
|
-
snapToSlideEdge: false,
|
|
11561
11560
|
// Disable swiper and hide navigation when container not overflow
|
|
11562
11561
|
watchOverflow: true,
|
|
11563
11562
|
// Round length
|
|
@@ -11628,7 +11627,10 @@ var defaults = {
|
|
|
11628
11627
|
};
|
|
11629
11628
|
|
|
11630
11629
|
function moduleExtendParams(params, allModulesParams) {
|
|
11631
|
-
return function extendParams(obj
|
|
11630
|
+
return function extendParams(obj) {
|
|
11631
|
+
if (obj === void 0) {
|
|
11632
|
+
obj = {};
|
|
11633
|
+
}
|
|
11632
11634
|
const moduleParamName = Object.keys(obj)[0];
|
|
11633
11635
|
const moduleParams = obj[moduleParamName];
|
|
11634
11636
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
@@ -11676,9 +11678,12 @@ const prototypes = {
|
|
|
11676
11678
|
};
|
|
11677
11679
|
const extendedDefaults = {};
|
|
11678
11680
|
class Swiper$1 {
|
|
11679
|
-
constructor(
|
|
11681
|
+
constructor() {
|
|
11680
11682
|
let el;
|
|
11681
11683
|
let params;
|
|
11684
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11685
|
+
args[_key] = arguments[_key];
|
|
11686
|
+
}
|
|
11682
11687
|
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
|
11683
11688
|
params = args[0];
|
|
11684
11689
|
} else {
|
|
@@ -11712,11 +11717,7 @@ class Swiper$1 {
|
|
|
11712
11717
|
swiper.eventsAnyListeners = [];
|
|
11713
11718
|
swiper.modules = [...swiper.__modules__];
|
|
11714
11719
|
if (params.modules && Array.isArray(params.modules)) {
|
|
11715
|
-
|
|
11716
|
-
if (typeof mod === 'function' && swiper.modules.indexOf(mod) < 0) {
|
|
11717
|
-
swiper.modules.push(mod);
|
|
11718
|
-
}
|
|
11719
|
-
});
|
|
11720
|
+
swiper.modules.push(...params.modules);
|
|
11720
11721
|
}
|
|
11721
11722
|
const allModulesParams = {};
|
|
11722
11723
|
swiper.modules.forEach(mod => {
|
|
@@ -11861,17 +11862,7 @@ class Swiper$1 {
|
|
|
11861
11862
|
return elementIndex(slideEl) - firstSlideIndex;
|
|
11862
11863
|
}
|
|
11863
11864
|
getSlideIndexByData(index) {
|
|
11864
|
-
return this.getSlideIndex(this.slides.
|
|
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;
|
|
11865
|
+
return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);
|
|
11875
11866
|
}
|
|
11876
11867
|
recalcSlides() {
|
|
11877
11868
|
const swiper = this;
|
|
@@ -11938,7 +11929,13 @@ class Swiper$1 {
|
|
|
11938
11929
|
});
|
|
11939
11930
|
swiper.emit('_slideClasses', updates);
|
|
11940
11931
|
}
|
|
11941
|
-
slidesPerViewDynamic(view
|
|
11932
|
+
slidesPerViewDynamic(view, exact) {
|
|
11933
|
+
if (view === void 0) {
|
|
11934
|
+
view = 'current';
|
|
11935
|
+
}
|
|
11936
|
+
if (exact === void 0) {
|
|
11937
|
+
exact = false;
|
|
11938
|
+
}
|
|
11942
11939
|
const swiper = this;
|
|
11943
11940
|
const {
|
|
11944
11941
|
params,
|
|
@@ -12037,7 +12034,10 @@ class Swiper$1 {
|
|
|
12037
12034
|
}
|
|
12038
12035
|
swiper.emit('update');
|
|
12039
12036
|
}
|
|
12040
|
-
changeDirection(newDirection, needUpdate
|
|
12037
|
+
changeDirection(newDirection, needUpdate) {
|
|
12038
|
+
if (needUpdate === void 0) {
|
|
12039
|
+
needUpdate = true;
|
|
12040
|
+
}
|
|
12041
12041
|
const swiper = this;
|
|
12042
12042
|
const currentDirection = swiper.params.direction;
|
|
12043
12043
|
if (!newDirection) {
|
|
@@ -12163,7 +12163,7 @@ class Swiper$1 {
|
|
|
12163
12163
|
|
|
12164
12164
|
// Create loop
|
|
12165
12165
|
if (swiper.params.loop) {
|
|
12166
|
-
swiper.loopCreate(
|
|
12166
|
+
swiper.loopCreate();
|
|
12167
12167
|
}
|
|
12168
12168
|
|
|
12169
12169
|
// Attach events
|
|
@@ -12192,7 +12192,13 @@ class Swiper$1 {
|
|
|
12192
12192
|
swiper.emit('afterInit');
|
|
12193
12193
|
return swiper;
|
|
12194
12194
|
}
|
|
12195
|
-
destroy(deleteInstance
|
|
12195
|
+
destroy(deleteInstance, cleanStyles) {
|
|
12196
|
+
if (deleteInstance === void 0) {
|
|
12197
|
+
deleteInstance = true;
|
|
12198
|
+
}
|
|
12199
|
+
if (cleanStyles === void 0) {
|
|
12200
|
+
cleanStyles = true;
|
|
12201
|
+
}
|
|
12196
12202
|
const swiper = this;
|
|
12197
12203
|
const {
|
|
12198
12204
|
params,
|
|
@@ -12281,7 +12287,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
12281
12287
|
Swiper$1.use([Resize, Observer]);
|
|
12282
12288
|
|
|
12283
12289
|
/* underscore in name -> watch for changes */
|
|
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', '
|
|
12290
|
+
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',
|
|
12285
12291
|
// modules
|
|
12286
12292
|
'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
|
|
12287
12293
|
|
|
@@ -12298,16 +12304,28 @@ function extend(target, src) {
|
|
|
12298
12304
|
}
|
|
12299
12305
|
});
|
|
12300
12306
|
}
|
|
12301
|
-
function needsNavigation(params
|
|
12307
|
+
function needsNavigation(params) {
|
|
12308
|
+
if (params === void 0) {
|
|
12309
|
+
params = {};
|
|
12310
|
+
}
|
|
12302
12311
|
return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';
|
|
12303
12312
|
}
|
|
12304
|
-
function needsPagination(params
|
|
12313
|
+
function needsPagination(params) {
|
|
12314
|
+
if (params === void 0) {
|
|
12315
|
+
params = {};
|
|
12316
|
+
}
|
|
12305
12317
|
return params.pagination && typeof params.pagination.el === 'undefined';
|
|
12306
12318
|
}
|
|
12307
|
-
function needsScrollbar(params
|
|
12319
|
+
function needsScrollbar(params) {
|
|
12320
|
+
if (params === void 0) {
|
|
12321
|
+
params = {};
|
|
12322
|
+
}
|
|
12308
12323
|
return params.scrollbar && typeof params.scrollbar.el === 'undefined';
|
|
12309
12324
|
}
|
|
12310
|
-
function uniqueClasses(classNames
|
|
12325
|
+
function uniqueClasses(classNames) {
|
|
12326
|
+
if (classNames === void 0) {
|
|
12327
|
+
classNames = '';
|
|
12328
|
+
}
|
|
12311
12329
|
const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);
|
|
12312
12330
|
const unique = [];
|
|
12313
12331
|
classes.forEach(c => {
|
|
@@ -12315,22 +12333,26 @@ function uniqueClasses(classNames = '') {
|
|
|
12315
12333
|
});
|
|
12316
12334
|
return unique.join(' ');
|
|
12317
12335
|
}
|
|
12318
|
-
function wrapperClass(className
|
|
12336
|
+
function wrapperClass(className) {
|
|
12337
|
+
if (className === void 0) {
|
|
12338
|
+
className = '';
|
|
12339
|
+
}
|
|
12319
12340
|
if (!className) return 'swiper-wrapper';
|
|
12320
12341
|
if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;
|
|
12321
12342
|
return className;
|
|
12322
12343
|
}
|
|
12323
12344
|
|
|
12324
|
-
function updateSwiper({
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12345
|
+
function updateSwiper(_ref) {
|
|
12346
|
+
let {
|
|
12347
|
+
swiper,
|
|
12348
|
+
slides,
|
|
12349
|
+
passedParams,
|
|
12350
|
+
changedParams,
|
|
12351
|
+
nextEl,
|
|
12352
|
+
prevEl,
|
|
12353
|
+
scrollbarEl,
|
|
12354
|
+
paginationEl
|
|
12355
|
+
} = _ref;
|
|
12334
12356
|
const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');
|
|
12335
12357
|
const {
|
|
12336
12358
|
params: currentParams,
|
|
@@ -12348,7 +12370,7 @@ function updateSwiper({
|
|
|
12348
12370
|
let loopNeedDestroy;
|
|
12349
12371
|
let loopNeedEnable;
|
|
12350
12372
|
let loopNeedReloop;
|
|
12351
|
-
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper &&
|
|
12373
|
+
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {
|
|
12352
12374
|
needThumbsInit = true;
|
|
12353
12375
|
}
|
|
12354
12376
|
if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {
|
|
@@ -12458,14 +12480,14 @@ function updateSwiper({
|
|
|
12458
12480
|
if (!nextEl || typeof nextEl === 'string') {
|
|
12459
12481
|
nextEl = document.createElement('div');
|
|
12460
12482
|
nextEl.classList.add('swiper-button-next');
|
|
12461
|
-
|
|
12483
|
+
nextEl.innerHTML = swiper.hostEl.constructor.nextButtonSvg;
|
|
12462
12484
|
nextEl.part.add('button-next');
|
|
12463
12485
|
swiper.el.appendChild(nextEl);
|
|
12464
12486
|
}
|
|
12465
12487
|
if (!prevEl || typeof prevEl === 'string') {
|
|
12466
12488
|
prevEl = document.createElement('div');
|
|
12467
12489
|
prevEl.classList.add('swiper-button-prev');
|
|
12468
|
-
|
|
12490
|
+
prevEl.innerHTML = swiper.hostEl.constructor.prevButtonSvg;
|
|
12469
12491
|
prevEl.part.add('button-prev');
|
|
12470
12492
|
swiper.el.appendChild(prevEl);
|
|
12471
12493
|
}
|
|
@@ -12493,7 +12515,13 @@ function updateSwiper({
|
|
|
12493
12515
|
swiper.update();
|
|
12494
12516
|
}
|
|
12495
12517
|
|
|
12496
|
-
function getParams(obj
|
|
12518
|
+
function getParams(obj, splitEvents) {
|
|
12519
|
+
if (obj === void 0) {
|
|
12520
|
+
obj = {};
|
|
12521
|
+
}
|
|
12522
|
+
if (splitEvents === void 0) {
|
|
12523
|
+
splitEvents = true;
|
|
12524
|
+
}
|
|
12497
12525
|
const params = {
|
|
12498
12526
|
on: {}
|
|
12499
12527
|
};
|
|
@@ -12539,14 +12567,15 @@ function getParams(obj = {}, splitEvents = true) {
|
|
|
12539
12567
|
};
|
|
12540
12568
|
}
|
|
12541
12569
|
|
|
12542
|
-
function mountSwiper({
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12570
|
+
function mountSwiper(_ref, swiperParams) {
|
|
12571
|
+
let {
|
|
12572
|
+
el,
|
|
12573
|
+
nextEl,
|
|
12574
|
+
prevEl,
|
|
12575
|
+
paginationEl,
|
|
12576
|
+
scrollbarEl,
|
|
12577
|
+
swiper
|
|
12578
|
+
} = _ref;
|
|
12550
12579
|
if (needsNavigation(swiperParams) && nextEl && prevEl) {
|
|
12551
12580
|
swiper.params.navigation.nextEl = nextEl;
|
|
12552
12581
|
swiper.originalParams.navigation.nextEl = nextEl;
|
|
@@ -12607,22 +12636,21 @@ const updateOnVirtualData = swiper => {
|
|
|
12607
12636
|
swiper.updateSlides();
|
|
12608
12637
|
swiper.updateProgress();
|
|
12609
12638
|
swiper.updateSlidesClasses();
|
|
12610
|
-
swiper.emit('_virtualUpdated');
|
|
12611
12639
|
if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
|
|
12612
12640
|
swiper.parallax.setTranslate();
|
|
12613
12641
|
}
|
|
12614
12642
|
};
|
|
12615
12643
|
|
|
12616
12644
|
/**
|
|
12617
|
-
* Swiper React
|
|
12645
|
+
* Swiper React 11.1.4
|
|
12618
12646
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
12619
12647
|
* https://swiperjs.com
|
|
12620
12648
|
*
|
|
12621
|
-
* Copyright 2014-
|
|
12649
|
+
* Copyright 2014-2024 Vladimir Kharlampidi
|
|
12622
12650
|
*
|
|
12623
12651
|
* Released under the MIT License
|
|
12624
12652
|
*
|
|
12625
|
-
* Released on:
|
|
12653
|
+
* Released on: May 30, 2024
|
|
12626
12654
|
*/
|
|
12627
12655
|
|
|
12628
12656
|
function _extends() {
|
|
@@ -12731,14 +12759,15 @@ function useIsomorphicLayoutEffect(callback, deps) {
|
|
|
12731
12759
|
const SwiperSlideContext = /*#__PURE__*/React.createContext(null);
|
|
12732
12760
|
const SwiperContext = /*#__PURE__*/React.createContext(null);
|
|
12733
12761
|
|
|
12734
|
-
const Swiper = /*#__PURE__*/React.forwardRef(({
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12762
|
+
const Swiper = /*#__PURE__*/React.forwardRef(function (_temp, externalElRef) {
|
|
12763
|
+
let {
|
|
12764
|
+
className,
|
|
12765
|
+
tag: Tag = 'div',
|
|
12766
|
+
wrapperTag: WrapperTag = 'div',
|
|
12767
|
+
children,
|
|
12768
|
+
onSwiper,
|
|
12769
|
+
...rest
|
|
12770
|
+
} = _temp === void 0 ? {} : _temp;
|
|
12742
12771
|
let eventsAssigned = false;
|
|
12743
12772
|
const [containerClasses, setContainerClasses] = React.useState('swiper');
|
|
12744
12773
|
const [virtualData, setVirtualData] = React.useState(null);
|
|
@@ -12914,17 +12943,18 @@ const Swiper = /*#__PURE__*/React.forwardRef(({
|
|
|
12914
12943
|
});
|
|
12915
12944
|
Swiper.displayName = 'Swiper';
|
|
12916
12945
|
|
|
12917
|
-
const SwiperSlide = /*#__PURE__*/React.forwardRef(({
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12946
|
+
const SwiperSlide = /*#__PURE__*/React.forwardRef(function (_temp, externalRef) {
|
|
12947
|
+
let {
|
|
12948
|
+
tag: Tag = 'div',
|
|
12949
|
+
children,
|
|
12950
|
+
className = '',
|
|
12951
|
+
swiper,
|
|
12952
|
+
zoom,
|
|
12953
|
+
lazy,
|
|
12954
|
+
virtualIndex,
|
|
12955
|
+
swiperSlideIndex,
|
|
12956
|
+
...rest
|
|
12957
|
+
} = _temp === void 0 ? {} : _temp;
|
|
12928
12958
|
const slideElRef = React.useRef(null);
|
|
12929
12959
|
const [slideClasses, setSlideClasses] = React.useState('swiper-slide');
|
|
12930
12960
|
const [lazyLoaded, setLazyLoaded] = React.useState(false);
|
|
@@ -12984,17 +13014,11 @@ const SwiperSlide = /*#__PURE__*/React.forwardRef(({
|
|
|
12984
13014
|
className: "swiper-zoom-container",
|
|
12985
13015
|
"data-swiper-zoom": typeof zoom === 'number' ? zoom : undefined
|
|
12986
13016
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12987
|
-
className: "swiper-lazy-preloader"
|
|
12988
|
-
ref: node => {
|
|
12989
|
-
if (node) node.lazyPreloaderManaged = true;
|
|
12990
|
-
}
|
|
13017
|
+
className: "swiper-lazy-preloader"
|
|
12991
13018
|
}))), !zoom && /*#__PURE__*/React__default["default"].createElement(SwiperSlideContext.Provider, {
|
|
12992
13019
|
value: slideData
|
|
12993
13020
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12994
|
-
className: "swiper-lazy-preloader"
|
|
12995
|
-
ref: node => {
|
|
12996
|
-
if (node) node.lazyPreloaderManaged = true;
|
|
12997
|
-
}
|
|
13021
|
+
className: "swiper-lazy-preloader"
|
|
12998
13022
|
})));
|
|
12999
13023
|
});
|
|
13000
13024
|
SwiperSlide.displayName = 'SwiperSlide';
|
|
@@ -15337,12 +15361,13 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
15337
15361
|
};
|
|
15338
15362
|
|
|
15339
15363
|
/* eslint-disable consistent-return */
|
|
15340
|
-
function Keyboard({
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
|
|
15364
|
+
function Keyboard(_ref) {
|
|
15365
|
+
let {
|
|
15366
|
+
swiper,
|
|
15367
|
+
extendParams,
|
|
15368
|
+
on,
|
|
15369
|
+
emit
|
|
15370
|
+
} = _ref;
|
|
15346
15371
|
const document = getDocument();
|
|
15347
15372
|
const window = getWindow();
|
|
15348
15373
|
swiper.keyboard = {
|
|
@@ -15352,8 +15377,7 @@ function Keyboard({
|
|
|
15352
15377
|
keyboard: {
|
|
15353
15378
|
enabled: false,
|
|
15354
15379
|
onlyInViewport: true,
|
|
15355
|
-
pageUpDown: true
|
|
15356
|
-
speed: undefined
|
|
15380
|
+
pageUpDown: true
|
|
15357
15381
|
}
|
|
15358
15382
|
});
|
|
15359
15383
|
function handle(event) {
|
|
@@ -15381,7 +15405,7 @@ function Keyboard({
|
|
|
15381
15405
|
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
|
15382
15406
|
return undefined;
|
|
15383
15407
|
}
|
|
15384
|
-
if (document.activeElement &&
|
|
15408
|
+
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
|
15385
15409
|
return undefined;
|
|
15386
15410
|
}
|
|
15387
15411
|
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
|
|
@@ -15407,19 +15431,18 @@ function Keyboard({
|
|
|
15407
15431
|
}
|
|
15408
15432
|
if (!inView) return undefined;
|
|
15409
15433
|
}
|
|
15410
|
-
const speed = swiper.params.keyboard.speed;
|
|
15411
15434
|
if (swiper.isHorizontal()) {
|
|
15412
15435
|
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
|
|
15413
15436
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15414
15437
|
}
|
|
15415
|
-
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(
|
|
15416
|
-
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(
|
|
15438
|
+
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
|
|
15439
|
+
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
|
|
15417
15440
|
} else {
|
|
15418
15441
|
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
|
|
15419
15442
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15420
15443
|
}
|
|
15421
|
-
if (isPageDown || isArrowDown) swiper.slideNext(
|
|
15422
|
-
if (isPageUp || isArrowUp) swiper.slidePrev(
|
|
15444
|
+
if (isPageDown || isArrowDown) swiper.slideNext();
|
|
15445
|
+
if (isPageUp || isArrowUp) swiper.slidePrev();
|
|
15423
15446
|
}
|
|
15424
15447
|
emit('keyPress', kc);
|
|
15425
15448
|
return undefined;
|
|
@@ -15450,11 +15473,12 @@ function Keyboard({
|
|
|
15450
15473
|
});
|
|
15451
15474
|
}
|
|
15452
15475
|
|
|
15453
|
-
function History({
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15476
|
+
function History(_ref) {
|
|
15477
|
+
let {
|
|
15478
|
+
swiper,
|
|
15479
|
+
extendParams,
|
|
15480
|
+
on
|
|
15481
|
+
} = _ref;
|
|
15458
15482
|
extendParams({
|
|
15459
15483
|
history: {
|
|
15460
15484
|
enabled: false,
|
|
@@ -15590,13 +15614,14 @@ function History({
|
|
|
15590
15614
|
|
|
15591
15615
|
/* eslint no-underscore-dangle: "off" */
|
|
15592
15616
|
/* eslint no-use-before-define: "off" */
|
|
15593
|
-
function Autoplay({
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
|
|
15598
|
-
|
|
15599
|
-
|
|
15617
|
+
function Autoplay(_ref) {
|
|
15618
|
+
let {
|
|
15619
|
+
swiper,
|
|
15620
|
+
extendParams,
|
|
15621
|
+
on,
|
|
15622
|
+
emit,
|
|
15623
|
+
params
|
|
15624
|
+
} = _ref;
|
|
15600
15625
|
swiper.autoplay = {
|
|
15601
15626
|
running: false,
|
|
15602
15627
|
paused: false,
|
|
@@ -15623,6 +15648,7 @@ function Autoplay({
|
|
|
15623
15648
|
let isTouched;
|
|
15624
15649
|
let pausedByTouch;
|
|
15625
15650
|
let touchStartTimeout;
|
|
15651
|
+
let slideChanged;
|
|
15626
15652
|
let pausedByInteraction;
|
|
15627
15653
|
let pausedByPointerEnter;
|
|
15628
15654
|
function onTransitionEnd(e) {
|
|
@@ -15652,7 +15678,7 @@ function Autoplay({
|
|
|
15652
15678
|
const getSlideDelay = () => {
|
|
15653
15679
|
let activeSlideEl;
|
|
15654
15680
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
|
15655
|
-
activeSlideEl = swiper.slides.
|
|
15681
|
+
activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
|
|
15656
15682
|
} else {
|
|
15657
15683
|
activeSlideEl = swiper.slides[swiper.activeIndex];
|
|
15658
15684
|
}
|
|
@@ -15660,23 +15686,18 @@ function Autoplay({
|
|
|
15660
15686
|
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
|
15661
15687
|
return currentSlideDelay;
|
|
15662
15688
|
};
|
|
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
|
-
};
|
|
15671
15689
|
const run = delayForce => {
|
|
15672
15690
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15673
15691
|
cancelAnimationFrame(raf);
|
|
15674
15692
|
calcTimeLeft();
|
|
15675
|
-
let delay = delayForce;
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15693
|
+
let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
|
|
15694
|
+
autoplayDelayTotal = swiper.params.autoplay.delay;
|
|
15695
|
+
autoplayDelayCurrent = swiper.params.autoplay.delay;
|
|
15696
|
+
const currentSlideDelay = getSlideDelay();
|
|
15697
|
+
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
|
|
15698
|
+
delay = currentSlideDelay;
|
|
15699
|
+
autoplayDelayTotal = currentSlideDelay;
|
|
15700
|
+
autoplayDelayCurrent = currentSlideDelay;
|
|
15680
15701
|
}
|
|
15681
15702
|
autoplayTimeLeft = delay;
|
|
15682
15703
|
const speed = swiper.params.speed;
|
|
@@ -15748,6 +15769,10 @@ function Autoplay({
|
|
|
15748
15769
|
};
|
|
15749
15770
|
swiper.autoplay.paused = true;
|
|
15750
15771
|
if (reset) {
|
|
15772
|
+
if (slideChanged) {
|
|
15773
|
+
autoplayTimeLeft = swiper.params.autoplay.delay;
|
|
15774
|
+
}
|
|
15775
|
+
slideChanged = false;
|
|
15751
15776
|
proceed();
|
|
15752
15777
|
return;
|
|
15753
15778
|
}
|
|
@@ -15878,10 +15903,7 @@ function Autoplay({
|
|
|
15878
15903
|
});
|
|
15879
15904
|
on('slideChange', () => {
|
|
15880
15905
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15881
|
-
|
|
15882
|
-
autoplayTimeLeft = getTotalDelay();
|
|
15883
|
-
autoplayDelayTotal = getTotalDelay();
|
|
15884
|
-
}
|
|
15906
|
+
slideChanged = true;
|
|
15885
15907
|
});
|
|
15886
15908
|
Object.assign(swiper.autoplay, {
|
|
15887
15909
|
start,
|
|
@@ -15891,11 +15913,12 @@ function Autoplay({
|
|
|
15891
15913
|
});
|
|
15892
15914
|
}
|
|
15893
15915
|
|
|
15894
|
-
function Thumb({
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15916
|
+
function Thumb(_ref) {
|
|
15917
|
+
let {
|
|
15918
|
+
swiper,
|
|
15919
|
+
extendParams,
|
|
15920
|
+
on
|
|
15921
|
+
} = _ref;
|
|
15899
15922
|
extendParams({
|
|
15900
15923
|
thumbs: {
|
|
15901
15924
|
swiper: null,
|
|
@@ -15910,11 +15933,6 @@ function Thumb({
|
|
|
15910
15933
|
swiper.thumbs = {
|
|
15911
15934
|
swiper: null
|
|
15912
15935
|
};
|
|
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
|
-
}
|
|
15918
15936
|
function onThumbClick() {
|
|
15919
15937
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15920
15938
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
@@ -15942,10 +15960,6 @@ function Thumb({
|
|
|
15942
15960
|
initialized = true;
|
|
15943
15961
|
const SwiperClass = swiper.constructor;
|
|
15944
15962
|
if (thumbsParams.swiper instanceof SwiperClass) {
|
|
15945
|
-
if (thumbsParams.swiper.destroyed) {
|
|
15946
|
-
initialized = false;
|
|
15947
|
-
return false;
|
|
15948
|
-
}
|
|
15949
15963
|
swiper.thumbs.swiper = thumbsParams.swiper;
|
|
15950
15964
|
Object.assign(swiper.thumbs.swiper.originalParams, {
|
|
15951
15965
|
watchSlidesProgress: true,
|
|
@@ -15967,18 +15981,12 @@ function Thumb({
|
|
|
15967
15981
|
}
|
|
15968
15982
|
swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
|
|
15969
15983
|
swiper.thumbs.swiper.on('tap', onThumbClick);
|
|
15970
|
-
if (isVirtualEnabled()) {
|
|
15971
|
-
swiper.thumbs.swiper.on('virtualUpdate', () => {
|
|
15972
|
-
update(false, {
|
|
15973
|
-
autoScroll: false
|
|
15974
|
-
});
|
|
15975
|
-
});
|
|
15976
|
-
}
|
|
15977
15984
|
return true;
|
|
15978
15985
|
}
|
|
15979
|
-
function update(initial
|
|
15986
|
+
function update(initial) {
|
|
15980
15987
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15981
15988
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15989
|
+
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15982
15990
|
|
|
15983
15991
|
// Activate thumbs
|
|
15984
15992
|
let thumbsToActivate = 1;
|
|
@@ -15991,7 +15999,7 @@ function Thumb({
|
|
|
15991
15999
|
}
|
|
15992
16000
|
thumbsToActivate = Math.floor(thumbsToActivate);
|
|
15993
16001
|
thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
|
|
15994
|
-
if (thumbsSwiper.params.loop ||
|
|
16002
|
+
if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
|
|
15995
16003
|
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
15996
16004
|
elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
|
|
15997
16005
|
slideEl.classList.add(thumbActiveClass);
|
|
@@ -16004,14 +16012,6 @@ function Thumb({
|
|
|
16004
16012
|
}
|
|
16005
16013
|
}
|
|
16006
16014
|
}
|
|
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;
|
|
16015
16015
|
const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
|
|
16016
16016
|
const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
|
|
16017
16017
|
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
|
|
@@ -16019,7 +16019,7 @@ function Thumb({
|
|
|
16019
16019
|
let newThumbsIndex;
|
|
16020
16020
|
let direction;
|
|
16021
16021
|
if (thumbsSwiper.params.loop) {
|
|
16022
|
-
const newThumbsSlide = thumbsSwiper.slides.
|
|
16022
|
+
const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];
|
|
16023
16023
|
newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
|
|
16024
16024
|
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
16025
16025
|
} else {
|
|
@@ -16037,7 +16037,7 @@ function Thumb({
|
|
|
16037
16037
|
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
|
16038
16038
|
}
|
|
16039
16039
|
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
|
|
16040
|
-
thumbsSwiper.slideTo(newThumbsIndex,
|
|
16040
|
+
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
|
|
16041
16041
|
}
|
|
16042
16042
|
}
|
|
16043
16043
|
}
|
|
@@ -16055,16 +16055,15 @@ function Thumb({
|
|
|
16055
16055
|
init();
|
|
16056
16056
|
update(true);
|
|
16057
16057
|
} else if (thumbsElement) {
|
|
16058
|
-
const eventName = `${swiper.params.eventsPrefix}init`;
|
|
16059
16058
|
const onThumbsSwiper = e => {
|
|
16060
16059
|
thumbs.swiper = e.detail[0];
|
|
16061
|
-
thumbsElement.removeEventListener(
|
|
16060
|
+
thumbsElement.removeEventListener('init', onThumbsSwiper);
|
|
16062
16061
|
init();
|
|
16063
16062
|
update(true);
|
|
16064
16063
|
thumbs.swiper.update();
|
|
16065
16064
|
swiper.update();
|
|
16066
16065
|
};
|
|
16067
|
-
thumbsElement.addEventListener(
|
|
16066
|
+
thumbsElement.addEventListener('init', onThumbsSwiper);
|
|
16068
16067
|
}
|
|
16069
16068
|
return thumbsElement;
|
|
16070
16069
|
};
|