@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.js
CHANGED
|
@@ -11,14 +11,9 @@ import { isNotPresent, isPresent, isNotEmpty, existsBy } from '@bigbinary/neeto-
|
|
|
11
11
|
import Frame, { useFrame } from 'react-frame-component';
|
|
12
12
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
13
13
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
14
|
-
import 'swiper/scss';
|
|
15
14
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
16
15
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
17
16
|
import axios from 'axios';
|
|
18
|
-
import 'swiper/scss/pagination';
|
|
19
|
-
import 'swiper/scss/autoplay';
|
|
20
|
-
import 'swiper/scss/thumbs';
|
|
21
|
-
import 'swiper/scss/history';
|
|
22
17
|
|
|
23
18
|
var ArrowButton = function ArrowButton(_ref) {
|
|
24
19
|
var Icon = _ref.Icon,
|
|
@@ -7172,32 +7167,76 @@ var Button = function Button(_ref) {
|
|
|
7172
7167
|
"aria-label": label
|
|
7173
7168
|
};
|
|
7174
7169
|
useEffect(function () {
|
|
7175
|
-
if (!popupCode
|
|
7170
|
+
if (!popupCode) return;
|
|
7171
|
+
var isActive = true;
|
|
7172
|
+
var appendedNodes = [];
|
|
7176
7173
|
try {
|
|
7177
7174
|
var tempDiv = document.createElement("div");
|
|
7178
7175
|
tempDiv.innerHTML = popupCode;
|
|
7179
7176
|
var nodes = Array.from(tempDiv.childNodes);
|
|
7180
|
-
if (isEmpty(nodes))
|
|
7181
|
-
|
|
7182
|
-
var
|
|
7183
|
-
|
|
7184
|
-
var
|
|
7185
|
-
if (node.
|
|
7186
|
-
|
|
7187
|
-
|
|
7177
|
+
if (!isEmpty(nodes)) {
|
|
7178
|
+
var externalScriptNodes = [];
|
|
7179
|
+
var inlineScriptNodes = [];
|
|
7180
|
+
nodes.forEach(function () {
|
|
7181
|
+
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7182
|
+
if (node.tagName === "SCRIPT") {
|
|
7183
|
+
if (node.src) {
|
|
7184
|
+
externalScriptNodes.push(node);
|
|
7185
|
+
} else {
|
|
7186
|
+
inlineScriptNodes.push(node);
|
|
7187
|
+
}
|
|
7188
7188
|
} else {
|
|
7189
|
-
|
|
7189
|
+
document.body.appendChild(node);
|
|
7190
|
+
appendedNodes.push(node);
|
|
7190
7191
|
}
|
|
7191
|
-
|
|
7192
|
+
});
|
|
7193
|
+
var appendInlineScripts = function appendInlineScripts() {
|
|
7194
|
+
if (!isActive) return;
|
|
7195
|
+
inlineScriptNodes.forEach(function (node) {
|
|
7196
|
+
try {
|
|
7197
|
+
var script = document.createElement("script");
|
|
7198
|
+
// Wrap content in try/catch so runtime errors are suppressed even
|
|
7199
|
+
// when the browser executes the script asynchronously (e.g. Safari).
|
|
7200
|
+
script.textContent = "try{".concat(node.textContent, "}catch(e){}");
|
|
7201
|
+
document.body.appendChild(script);
|
|
7202
|
+
appendedNodes.push(script);
|
|
7203
|
+
} catch (_unused) {
|
|
7204
|
+
// NOTE: Errors from inline embed scripts are ignored since these
|
|
7205
|
+
// cannot be handled by NeetoSite.
|
|
7206
|
+
}
|
|
7207
|
+
});
|
|
7208
|
+
};
|
|
7209
|
+
if (externalScriptNodes.length === 0) {
|
|
7210
|
+
appendInlineScripts();
|
|
7192
7211
|
} else {
|
|
7193
|
-
|
|
7212
|
+
var settledCount = 0;
|
|
7213
|
+
externalScriptNodes.forEach(function (node) {
|
|
7214
|
+
var script = document.createElement("script");
|
|
7215
|
+
script.src = node.src;
|
|
7216
|
+
script.async = node.async || false;
|
|
7217
|
+
appendedNodes.push(script);
|
|
7218
|
+
var onSettled = function onSettled() {
|
|
7219
|
+
settledCount++;
|
|
7220
|
+
if (settledCount === externalScriptNodes.length) appendInlineScripts();
|
|
7221
|
+
};
|
|
7222
|
+
script.onload = onSettled;
|
|
7223
|
+
script.onerror = onSettled;
|
|
7224
|
+
document.body.appendChild(script);
|
|
7225
|
+
});
|
|
7194
7226
|
}
|
|
7195
|
-
}
|
|
7196
|
-
} catch (
|
|
7227
|
+
}
|
|
7228
|
+
} catch (_unused2) {
|
|
7197
7229
|
// NOTE: An error can occur while the user is typing out the embed code.
|
|
7198
7230
|
// It could also throw an error if the embed code is invalid. These errors
|
|
7199
7231
|
// are ignored since these cannot be handled by NeetoSite.
|
|
7200
7232
|
}
|
|
7233
|
+
return function () {
|
|
7234
|
+
isActive = false;
|
|
7235
|
+
appendedNodes.forEach(function (node) {
|
|
7236
|
+
var _node$parentNode;
|
|
7237
|
+
return (_node$parentNode = node.parentNode) === null || _node$parentNode === void 0 ? void 0 : _node$parentNode.removeChild(node);
|
|
7238
|
+
});
|
|
7239
|
+
};
|
|
7201
7240
|
}, [popupCode]);
|
|
7202
7241
|
if (action === "external") {
|
|
7203
7242
|
return /*#__PURE__*/jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {
|
|
@@ -7909,23 +7948,28 @@ var CardsClassic = function CardsClassic(_ref) {
|
|
|
7909
7948
|
};
|
|
7910
7949
|
|
|
7911
7950
|
/**
|
|
7912
|
-
* SSR Window
|
|
7951
|
+
* SSR Window 4.0.2
|
|
7913
7952
|
* Better handling for window object in SSR environment
|
|
7914
7953
|
* https://github.com/nolimits4web/ssr-window
|
|
7915
7954
|
*
|
|
7916
|
-
* Copyright
|
|
7955
|
+
* Copyright 2021, Vladimir Kharlampidi
|
|
7917
7956
|
*
|
|
7918
7957
|
* Licensed under MIT
|
|
7919
7958
|
*
|
|
7920
|
-
* Released on:
|
|
7959
|
+
* Released on: December 13, 2021
|
|
7921
7960
|
*/
|
|
7922
7961
|
/* eslint-disable no-param-reassign */
|
|
7923
7962
|
function isObject$2(obj) {
|
|
7924
7963
|
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
7925
7964
|
}
|
|
7926
|
-
function extend$2(target
|
|
7927
|
-
|
|
7928
|
-
|
|
7965
|
+
function extend$2(target, src) {
|
|
7966
|
+
if (target === void 0) {
|
|
7967
|
+
target = {};
|
|
7968
|
+
}
|
|
7969
|
+
if (src === void 0) {
|
|
7970
|
+
src = {};
|
|
7971
|
+
}
|
|
7972
|
+
Object.keys(src).forEach(key => {
|
|
7929
7973
|
if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$2(src[key]) && isObject$2(target[key]) && Object.keys(src[key]).length > 0) {
|
|
7930
7974
|
extend$2(target[key], src[key]);
|
|
7931
7975
|
}
|
|
@@ -8047,7 +8091,10 @@ function getWindow() {
|
|
|
8047
8091
|
return win;
|
|
8048
8092
|
}
|
|
8049
8093
|
|
|
8050
|
-
function classesToTokens(classes
|
|
8094
|
+
function classesToTokens(classes) {
|
|
8095
|
+
if (classes === void 0) {
|
|
8096
|
+
classes = '';
|
|
8097
|
+
}
|
|
8051
8098
|
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
8052
8099
|
}
|
|
8053
8100
|
|
|
@@ -8066,7 +8113,10 @@ function deleteProps(obj) {
|
|
|
8066
8113
|
}
|
|
8067
8114
|
});
|
|
8068
8115
|
}
|
|
8069
|
-
function nextTick(callback, delay
|
|
8116
|
+
function nextTick(callback, delay) {
|
|
8117
|
+
if (delay === void 0) {
|
|
8118
|
+
delay = 0;
|
|
8119
|
+
}
|
|
8070
8120
|
return setTimeout(callback, delay);
|
|
8071
8121
|
}
|
|
8072
8122
|
function now() {
|
|
@@ -8086,7 +8136,10 @@ function getComputedStyle$1(el) {
|
|
|
8086
8136
|
}
|
|
8087
8137
|
return style;
|
|
8088
8138
|
}
|
|
8089
|
-
function getTranslate(el, axis
|
|
8139
|
+
function getTranslate(el, axis) {
|
|
8140
|
+
if (axis === void 0) {
|
|
8141
|
+
axis = 'x';
|
|
8142
|
+
}
|
|
8090
8143
|
const window = getWindow();
|
|
8091
8144
|
let matrix;
|
|
8092
8145
|
let curTransform;
|
|
@@ -8132,12 +8185,13 @@ function isNode(node) {
|
|
|
8132
8185
|
}
|
|
8133
8186
|
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
8134
8187
|
}
|
|
8135
|
-
function extend$1(
|
|
8136
|
-
const to = Object(
|
|
8137
|
-
|
|
8138
|
-
|
|
8188
|
+
function extend$1() {
|
|
8189
|
+
const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
|
|
8190
|
+
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
8191
|
+
for (let i = 1; i < arguments.length; i += 1) {
|
|
8192
|
+
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
8139
8193
|
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
8140
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key => key
|
|
8194
|
+
const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
|
|
8141
8195
|
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
8142
8196
|
const nextKey = keysArray[nextIndex];
|
|
8143
8197
|
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
@@ -8167,11 +8221,12 @@ function extend$1(...args) {
|
|
|
8167
8221
|
function setCSSProperty(el, varName, varValue) {
|
|
8168
8222
|
el.style.setProperty(varName, varValue);
|
|
8169
8223
|
}
|
|
8170
|
-
function animateCSSModeScroll({
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8224
|
+
function animateCSSModeScroll(_ref) {
|
|
8225
|
+
let {
|
|
8226
|
+
swiper,
|
|
8227
|
+
targetPosition,
|
|
8228
|
+
side
|
|
8229
|
+
} = _ref;
|
|
8175
8230
|
const window = getWindow();
|
|
8176
8231
|
const startPosition = -swiper.translate;
|
|
8177
8232
|
let startTime = null;
|
|
@@ -8213,39 +8268,11 @@ function animateCSSModeScroll({
|
|
|
8213
8268
|
};
|
|
8214
8269
|
animate();
|
|
8215
8270
|
}
|
|
8216
|
-
function elementChildren(element, selector
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {
|
|
8220
|
-
children.push(...element.assignedElements());
|
|
8221
|
-
}
|
|
8222
|
-
if (!selector) {
|
|
8223
|
-
return children;
|
|
8224
|
-
}
|
|
8225
|
-
return children.filter(el => el.matches(selector));
|
|
8226
|
-
}
|
|
8227
|
-
function elementIsChildOfSlot(el, slot) {
|
|
8228
|
-
// Breadth-first search through all parent's children and assigned elements
|
|
8229
|
-
const elementsQueue = [slot];
|
|
8230
|
-
while (elementsQueue.length > 0) {
|
|
8231
|
-
const elementToCheck = elementsQueue.shift();
|
|
8232
|
-
if (el === elementToCheck) {
|
|
8233
|
-
return true;
|
|
8234
|
-
}
|
|
8235
|
-
elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));
|
|
8236
|
-
}
|
|
8237
|
-
}
|
|
8238
|
-
function elementIsChildOf(el, parent) {
|
|
8239
|
-
const window = getWindow();
|
|
8240
|
-
let isChild = parent.contains(el);
|
|
8241
|
-
if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {
|
|
8242
|
-
const children = [...parent.assignedElements()];
|
|
8243
|
-
isChild = children.includes(el);
|
|
8244
|
-
if (!isChild) {
|
|
8245
|
-
isChild = elementIsChildOfSlot(el, parent);
|
|
8246
|
-
}
|
|
8271
|
+
function elementChildren(element, selector) {
|
|
8272
|
+
if (selector === void 0) {
|
|
8273
|
+
selector = '';
|
|
8247
8274
|
}
|
|
8248
|
-
return
|
|
8275
|
+
return [...element.children].filter(el => el.matches(selector));
|
|
8249
8276
|
}
|
|
8250
8277
|
function showWarning(text) {
|
|
8251
8278
|
try {
|
|
@@ -8255,7 +8282,10 @@ function showWarning(text) {
|
|
|
8255
8282
|
// err
|
|
8256
8283
|
}
|
|
8257
8284
|
}
|
|
8258
|
-
function createElement(tag, classes
|
|
8285
|
+
function createElement(tag, classes) {
|
|
8286
|
+
if (classes === void 0) {
|
|
8287
|
+
classes = [];
|
|
8288
|
+
}
|
|
8259
8289
|
const el = document.createElement(tag);
|
|
8260
8290
|
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
8261
8291
|
return el;
|
|
@@ -8333,15 +8363,6 @@ function elementOuterSize(el, size, includeMargins) {
|
|
|
8333
8363
|
}
|
|
8334
8364
|
return el.offsetWidth;
|
|
8335
8365
|
}
|
|
8336
|
-
function setInnerHTML(el, html = '') {
|
|
8337
|
-
if (typeof trustedTypes !== 'undefined') {
|
|
8338
|
-
el.innerHTML = trustedTypes.createPolicy('html', {
|
|
8339
|
-
createHTML: s => s
|
|
8340
|
-
}).createHTML(html);
|
|
8341
|
-
} else {
|
|
8342
|
-
el.innerHTML = html;
|
|
8343
|
-
}
|
|
8344
|
-
}
|
|
8345
8366
|
|
|
8346
8367
|
let support;
|
|
8347
8368
|
function calcSupport() {
|
|
@@ -8360,9 +8381,10 @@ function getSupport() {
|
|
|
8360
8381
|
}
|
|
8361
8382
|
|
|
8362
8383
|
let deviceCached;
|
|
8363
|
-
function calcDevice({
|
|
8364
|
-
|
|
8365
|
-
|
|
8384
|
+
function calcDevice(_temp) {
|
|
8385
|
+
let {
|
|
8386
|
+
userAgent
|
|
8387
|
+
} = _temp === void 0 ? {} : _temp;
|
|
8366
8388
|
const support = getSupport();
|
|
8367
8389
|
const window = getWindow();
|
|
8368
8390
|
const platform = window.navigator.platform;
|
|
@@ -8374,7 +8396,7 @@ function calcDevice({
|
|
|
8374
8396
|
const screenWidth = window.screen.width;
|
|
8375
8397
|
const screenHeight = window.screen.height;
|
|
8376
8398
|
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
|
8377
|
-
let ipad = ua.match(/(iPad)
|
|
8399
|
+
let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
8378
8400
|
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
8379
8401
|
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
|
8380
8402
|
const windows = platform === 'Win32';
|
|
@@ -8401,7 +8423,10 @@ function calcDevice({
|
|
|
8401
8423
|
// Export object
|
|
8402
8424
|
return device;
|
|
8403
8425
|
}
|
|
8404
|
-
function getDevice(overrides
|
|
8426
|
+
function getDevice(overrides) {
|
|
8427
|
+
if (overrides === void 0) {
|
|
8428
|
+
overrides = {};
|
|
8429
|
+
}
|
|
8405
8430
|
if (!deviceCached) {
|
|
8406
8431
|
deviceCached = calcDevice(overrides);
|
|
8407
8432
|
}
|
|
@@ -8441,11 +8466,12 @@ function getBrowser() {
|
|
|
8441
8466
|
return browser;
|
|
8442
8467
|
}
|
|
8443
8468
|
|
|
8444
|
-
function Resize({
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8469
|
+
function Resize(_ref) {
|
|
8470
|
+
let {
|
|
8471
|
+
swiper,
|
|
8472
|
+
on,
|
|
8473
|
+
emit
|
|
8474
|
+
} = _ref;
|
|
8449
8475
|
const window = getWindow();
|
|
8450
8476
|
let observer = null;
|
|
8451
8477
|
let animationFrame = null;
|
|
@@ -8464,11 +8490,12 @@ function Resize({
|
|
|
8464
8490
|
} = swiper;
|
|
8465
8491
|
let newWidth = width;
|
|
8466
8492
|
let newHeight = height;
|
|
8467
|
-
entries.forEach(
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8493
|
+
entries.forEach(_ref2 => {
|
|
8494
|
+
let {
|
|
8495
|
+
contentBoxSize,
|
|
8496
|
+
contentRect,
|
|
8497
|
+
target
|
|
8498
|
+
} = _ref2;
|
|
8472
8499
|
if (target && target !== swiper.el) return;
|
|
8473
8500
|
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
|
8474
8501
|
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
|
@@ -8508,15 +8535,19 @@ function Resize({
|
|
|
8508
8535
|
});
|
|
8509
8536
|
}
|
|
8510
8537
|
|
|
8511
|
-
function Observer({
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8538
|
+
function Observer(_ref) {
|
|
8539
|
+
let {
|
|
8540
|
+
swiper,
|
|
8541
|
+
extendParams,
|
|
8542
|
+
on,
|
|
8543
|
+
emit
|
|
8544
|
+
} = _ref;
|
|
8517
8545
|
const observers = [];
|
|
8518
8546
|
const window = getWindow();
|
|
8519
|
-
const attach = (target, options
|
|
8547
|
+
const attach = function (target, options) {
|
|
8548
|
+
if (options === void 0) {
|
|
8549
|
+
options = {};
|
|
8550
|
+
}
|
|
8520
8551
|
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
|
8521
8552
|
const observer = new ObserverFunc(mutations => {
|
|
8522
8553
|
// The observerUpdate event should only be triggered
|
|
@@ -8538,7 +8569,7 @@ function Observer({
|
|
|
8538
8569
|
});
|
|
8539
8570
|
observer.observe(target, {
|
|
8540
8571
|
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
|
8541
|
-
childList:
|
|
8572
|
+
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
|
8542
8573
|
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
|
8543
8574
|
});
|
|
8544
8575
|
observers.push(observer);
|
|
@@ -8594,11 +8625,14 @@ var eventsEmitter = {
|
|
|
8594
8625
|
const self = this;
|
|
8595
8626
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8596
8627
|
if (typeof handler !== 'function') return self;
|
|
8597
|
-
function onceHandler(
|
|
8628
|
+
function onceHandler() {
|
|
8598
8629
|
self.off(events, onceHandler);
|
|
8599
8630
|
if (onceHandler.__emitterProxy) {
|
|
8600
8631
|
delete onceHandler.__emitterProxy;
|
|
8601
8632
|
}
|
|
8633
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8634
|
+
args[_key] = arguments[_key];
|
|
8635
|
+
}
|
|
8602
8636
|
handler.apply(self, args);
|
|
8603
8637
|
}
|
|
8604
8638
|
onceHandler.__emitterProxy = handler;
|
|
@@ -8641,13 +8675,16 @@ var eventsEmitter = {
|
|
|
8641
8675
|
});
|
|
8642
8676
|
return self;
|
|
8643
8677
|
},
|
|
8644
|
-
emit(
|
|
8678
|
+
emit() {
|
|
8645
8679
|
const self = this;
|
|
8646
8680
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
8647
8681
|
if (!self.eventsListeners) return self;
|
|
8648
8682
|
let events;
|
|
8649
8683
|
let data;
|
|
8650
8684
|
let context;
|
|
8685
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8686
|
+
args[_key2] = arguments[_key2];
|
|
8687
|
+
}
|
|
8651
8688
|
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
|
8652
8689
|
events = args[0];
|
|
8653
8690
|
data = args.slice(1, args.length);
|
|
@@ -8715,6 +8752,7 @@ function updateSlides() {
|
|
|
8715
8752
|
const {
|
|
8716
8753
|
wrapperEl,
|
|
8717
8754
|
slidesEl,
|
|
8755
|
+
size: swiperSize,
|
|
8718
8756
|
rtlTranslate: rtl,
|
|
8719
8757
|
wrongRTL
|
|
8720
8758
|
} = swiper;
|
|
@@ -8735,7 +8773,6 @@ function updateSlides() {
|
|
|
8735
8773
|
}
|
|
8736
8774
|
const previousSnapGridLength = swiper.snapGrid.length;
|
|
8737
8775
|
const previousSlidesGridLength = swiper.slidesGrid.length;
|
|
8738
|
-
const swiperSize = swiper.size - offsetBefore - offsetAfter;
|
|
8739
8776
|
let spaceBetween = params.spaceBetween;
|
|
8740
8777
|
let slidePosition = -offsetBefore;
|
|
8741
8778
|
let prevSlideSize = 0;
|
|
@@ -8748,7 +8785,7 @@ function updateSlides() {
|
|
|
8748
8785
|
} else if (typeof spaceBetween === 'string') {
|
|
8749
8786
|
spaceBetween = parseFloat(spaceBetween);
|
|
8750
8787
|
}
|
|
8751
|
-
swiper.virtualSize = -spaceBetween
|
|
8788
|
+
swiper.virtualSize = -spaceBetween;
|
|
8752
8789
|
|
|
8753
8790
|
// reset margins
|
|
8754
8791
|
slides.forEach(slideEl => {
|
|
@@ -8766,12 +8803,6 @@ function updateSlides() {
|
|
|
8766
8803
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
8767
8804
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
8768
8805
|
}
|
|
8769
|
-
|
|
8770
|
-
// set cssMode offsets
|
|
8771
|
-
if (params.cssMode) {
|
|
8772
|
-
setCSSProperty(wrapperEl, '--swiper-slides-offset-before', `${offsetBefore}px`);
|
|
8773
|
-
setCSSProperty(wrapperEl, '--swiper-slides-offset-after', `${offsetAfter}px`);
|
|
8774
|
-
}
|
|
8775
8806
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
8776
8807
|
if (gridEnabled) {
|
|
8777
8808
|
swiper.grid.initSlides(slides);
|
|
@@ -8786,25 +8817,16 @@ function updateSlides() {
|
|
|
8786
8817
|
}).length > 0;
|
|
8787
8818
|
for (let i = 0; i < slidesLength; i += 1) {
|
|
8788
8819
|
slideSize = 0;
|
|
8789
|
-
|
|
8790
|
-
if (
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
}
|
|
8794
|
-
if (elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8820
|
+
let slide;
|
|
8821
|
+
if (slides[i]) slide = slides[i];
|
|
8822
|
+
if (gridEnabled) {
|
|
8823
|
+
swiper.grid.updateSlide(i, slide, slides);
|
|
8795
8824
|
}
|
|
8825
|
+
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
8796
8826
|
|
|
8797
|
-
if (
|
|
8798
|
-
if (params.virtual.slidesPerViewAutoSlideSize) {
|
|
8799
|
-
slideSize = params.virtual.slidesPerViewAutoSlideSize;
|
|
8800
|
-
}
|
|
8801
|
-
if (slideSize && slide) {
|
|
8802
|
-
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8803
|
-
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8804
|
-
}
|
|
8805
|
-
} else if (params.slidesPerView === 'auto') {
|
|
8827
|
+
if (params.slidesPerView === 'auto') {
|
|
8806
8828
|
if (shouldResetSlideSize) {
|
|
8807
|
-
|
|
8829
|
+
slides[i].style[swiper.getDirectionLabel('width')] = ``;
|
|
8808
8830
|
}
|
|
8809
8831
|
const slideStyles = getComputedStyle(slide);
|
|
8810
8832
|
const currentTransform = slide.style.transform;
|
|
@@ -8845,12 +8867,12 @@ function updateSlides() {
|
|
|
8845
8867
|
} else {
|
|
8846
8868
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
8847
8869
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
8848
|
-
if (
|
|
8849
|
-
|
|
8870
|
+
if (slides[i]) {
|
|
8871
|
+
slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
8850
8872
|
}
|
|
8851
8873
|
}
|
|
8852
|
-
if (
|
|
8853
|
-
|
|
8874
|
+
if (slides[i]) {
|
|
8875
|
+
slides[i].swiperSlideSize = slideSize;
|
|
8854
8876
|
}
|
|
8855
8877
|
slidesSizesGrid.push(slideSize);
|
|
8856
8878
|
if (params.centeredSlides) {
|
|
@@ -8884,52 +8906,17 @@ function updateSlides() {
|
|
|
8884
8906
|
|
|
8885
8907
|
// Remove last grid elements depending on width
|
|
8886
8908
|
if (!params.centeredSlides) {
|
|
8887
|
-
// Check if snapToSlideEdge should be applied
|
|
8888
|
-
const isFractionalSlidesPerView = params.slidesPerView !== 'auto' && params.slidesPerView % 1 !== 0;
|
|
8889
|
-
const shouldSnapToSlideEdge = params.snapToSlideEdge && !params.loop && (params.slidesPerView === 'auto' || isFractionalSlidesPerView);
|
|
8890
|
-
|
|
8891
|
-
// Calculate the last allowed snap index when snapToSlideEdge is enabled
|
|
8892
|
-
// This ensures minimum slides are visible at the end
|
|
8893
|
-
let lastAllowedSnapIndex = snapGrid.length;
|
|
8894
|
-
if (shouldSnapToSlideEdge) {
|
|
8895
|
-
let minVisibleSlides;
|
|
8896
|
-
if (params.slidesPerView === 'auto') {
|
|
8897
|
-
// For 'auto' mode, calculate how many slides fit based on actual sizes
|
|
8898
|
-
minVisibleSlides = 1;
|
|
8899
|
-
let accumulatedSize = 0;
|
|
8900
|
-
for (let i = slidesSizesGrid.length - 1; i >= 0; i -= 1) {
|
|
8901
|
-
accumulatedSize += slidesSizesGrid[i] + (i < slidesSizesGrid.length - 1 ? spaceBetween : 0);
|
|
8902
|
-
if (accumulatedSize <= swiperSize) {
|
|
8903
|
-
minVisibleSlides = slidesSizesGrid.length - i;
|
|
8904
|
-
} else {
|
|
8905
|
-
break;
|
|
8906
|
-
}
|
|
8907
|
-
}
|
|
8908
|
-
} else {
|
|
8909
|
-
minVisibleSlides = Math.floor(params.slidesPerView);
|
|
8910
|
-
}
|
|
8911
|
-
lastAllowedSnapIndex = Math.max(slidesLength - minVisibleSlides, 0);
|
|
8912
|
-
}
|
|
8913
8909
|
const newSlidesGrid = [];
|
|
8914
8910
|
for (let i = 0; i < snapGrid.length; i += 1) {
|
|
8915
8911
|
let slidesGridItem = snapGrid[i];
|
|
8916
8912
|
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
|
8917
|
-
if (
|
|
8918
|
-
// When snapToSlideEdge is enabled, only keep snaps up to lastAllowedSnapIndex
|
|
8919
|
-
if (i <= lastAllowedSnapIndex) {
|
|
8920
|
-
newSlidesGrid.push(slidesGridItem);
|
|
8921
|
-
}
|
|
8922
|
-
} else if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
8923
|
-
// When snapToSlideEdge is disabled, keep snaps that fit within scrollable area
|
|
8913
|
+
if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
8924
8914
|
newSlidesGrid.push(slidesGridItem);
|
|
8925
8915
|
}
|
|
8926
8916
|
}
|
|
8927
8917
|
snapGrid = newSlidesGrid;
|
|
8928
8918
|
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
|
8929
|
-
|
|
8930
|
-
if (!shouldSnapToSlideEdge) {
|
|
8931
|
-
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8932
|
-
}
|
|
8919
|
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
8933
8920
|
}
|
|
8934
8921
|
}
|
|
8935
8922
|
if (isVirtual && params.loop) {
|
|
@@ -8968,7 +8955,7 @@ function updateSlides() {
|
|
|
8968
8955
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8969
8956
|
});
|
|
8970
8957
|
allSlidesSize -= spaceBetween;
|
|
8971
|
-
const maxSnap = allSlidesSize
|
|
8958
|
+
const maxSnap = allSlidesSize - swiperSize;
|
|
8972
8959
|
snapGrid = snapGrid.map(snap => {
|
|
8973
8960
|
if (snap <= 0) return -offsetBefore;
|
|
8974
8961
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -8981,8 +8968,9 @@ function updateSlides() {
|
|
|
8981
8968
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
8982
8969
|
});
|
|
8983
8970
|
allSlidesSize -= spaceBetween;
|
|
8984
|
-
|
|
8985
|
-
|
|
8971
|
+
const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
|
|
8972
|
+
if (allSlidesSize + offsetSize < swiperSize) {
|
|
8973
|
+
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
8986
8974
|
snapGrid.forEach((snap, snapIndex) => {
|
|
8987
8975
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
8988
8976
|
});
|
|
@@ -9093,7 +9081,10 @@ const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
|
9093
9081
|
slideEl.classList.remove(className);
|
|
9094
9082
|
}
|
|
9095
9083
|
};
|
|
9096
|
-
function updateSlidesProgress(translate
|
|
9084
|
+
function updateSlidesProgress(translate) {
|
|
9085
|
+
if (translate === void 0) {
|
|
9086
|
+
translate = this && this.translate || 0;
|
|
9087
|
+
}
|
|
9097
9088
|
const swiper = this;
|
|
9098
9089
|
const params = swiper.params;
|
|
9099
9090
|
const {
|
|
@@ -9233,9 +9224,9 @@ function updateSlidesClasses() {
|
|
|
9233
9224
|
}
|
|
9234
9225
|
} else {
|
|
9235
9226
|
if (gridEnabled) {
|
|
9236
|
-
activeSlide = slides.
|
|
9237
|
-
nextSlide = slides.
|
|
9238
|
-
prevSlide = slides.
|
|
9227
|
+
activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
9228
|
+
nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0];
|
|
9229
|
+
prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0];
|
|
9239
9230
|
} else {
|
|
9240
9231
|
activeSlide = slides[activeIndex];
|
|
9241
9232
|
}
|
|
@@ -9277,13 +9268,12 @@ const processLazyPreloader = (swiper, imageEl) => {
|
|
|
9277
9268
|
requestAnimationFrame(() => {
|
|
9278
9269
|
if (slideEl.shadowRoot) {
|
|
9279
9270
|
lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
|
|
9280
|
-
if (lazyEl
|
|
9271
|
+
if (lazyEl) lazyEl.remove();
|
|
9281
9272
|
}
|
|
9282
9273
|
});
|
|
9283
9274
|
}
|
|
9284
9275
|
}
|
|
9285
|
-
|
|
9286
|
-
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
9276
|
+
if (lazyEl) lazyEl.remove();
|
|
9287
9277
|
}
|
|
9288
9278
|
};
|
|
9289
9279
|
const unlazy = (swiper, index) => {
|
|
@@ -9398,14 +9388,10 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
9398
9388
|
|
|
9399
9389
|
// Get real index
|
|
9400
9390
|
let realIndex;
|
|
9401
|
-
if (swiper.virtual && params.virtual.enabled) {
|
|
9402
|
-
|
|
9403
|
-
realIndex = getVirtualRealIndex(activeIndex);
|
|
9404
|
-
} else {
|
|
9405
|
-
realIndex = activeIndex;
|
|
9406
|
-
}
|
|
9391
|
+
if (swiper.virtual && params.virtual.enabled && params.loop) {
|
|
9392
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
9407
9393
|
} else if (gridEnabled) {
|
|
9408
|
-
const firstSlideInColumn = swiper.slides.
|
|
9394
|
+
const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0];
|
|
9409
9395
|
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
9410
9396
|
if (Number.isNaN(activeSlideIndex)) {
|
|
9411
9397
|
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
@@ -9493,7 +9479,10 @@ var update = {
|
|
|
9493
9479
|
updateClickedSlide
|
|
9494
9480
|
};
|
|
9495
9481
|
|
|
9496
|
-
function getSwiperTranslate(axis
|
|
9482
|
+
function getSwiperTranslate(axis) {
|
|
9483
|
+
if (axis === void 0) {
|
|
9484
|
+
axis = this.isHorizontal() ? 'x' : 'y';
|
|
9485
|
+
}
|
|
9497
9486
|
const swiper = this;
|
|
9498
9487
|
const {
|
|
9499
9488
|
params,
|
|
@@ -9568,7 +9557,19 @@ function maxTranslate() {
|
|
|
9568
9557
|
return -this.snapGrid[this.snapGrid.length - 1];
|
|
9569
9558
|
}
|
|
9570
9559
|
|
|
9571
|
-
function translateTo(translate
|
|
9560
|
+
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
9561
|
+
if (translate === void 0) {
|
|
9562
|
+
translate = 0;
|
|
9563
|
+
}
|
|
9564
|
+
if (speed === void 0) {
|
|
9565
|
+
speed = this.params.speed;
|
|
9566
|
+
}
|
|
9567
|
+
if (runCallbacks === void 0) {
|
|
9568
|
+
runCallbacks = true;
|
|
9569
|
+
}
|
|
9570
|
+
if (translateBounds === void 0) {
|
|
9571
|
+
translateBounds = true;
|
|
9572
|
+
}
|
|
9572
9573
|
const swiper = this;
|
|
9573
9574
|
const {
|
|
9574
9575
|
params,
|
|
@@ -9656,12 +9657,13 @@ function setTransition(duration, byController) {
|
|
|
9656
9657
|
swiper.emit('setTransition', duration, byController);
|
|
9657
9658
|
}
|
|
9658
9659
|
|
|
9659
|
-
function transitionEmit({
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9660
|
+
function transitionEmit(_ref) {
|
|
9661
|
+
let {
|
|
9662
|
+
swiper,
|
|
9663
|
+
runCallbacks,
|
|
9664
|
+
direction,
|
|
9665
|
+
step
|
|
9666
|
+
} = _ref;
|
|
9665
9667
|
const {
|
|
9666
9668
|
activeIndex,
|
|
9667
9669
|
previousIndex
|
|
@@ -9671,9 +9673,11 @@ function transitionEmit({
|
|
|
9671
9673
|
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
|
|
9672
9674
|
}
|
|
9673
9675
|
swiper.emit(`transition${step}`);
|
|
9674
|
-
if (runCallbacks &&
|
|
9675
|
-
|
|
9676
|
-
|
|
9676
|
+
if (runCallbacks && activeIndex !== previousIndex) {
|
|
9677
|
+
if (dir === 'reset') {
|
|
9678
|
+
swiper.emit(`slideResetTransition${step}`);
|
|
9679
|
+
return;
|
|
9680
|
+
}
|
|
9677
9681
|
swiper.emit(`slideChangeTransition${step}`);
|
|
9678
9682
|
if (dir === 'next') {
|
|
9679
9683
|
swiper.emit(`slideNextTransition${step}`);
|
|
@@ -9683,7 +9687,10 @@ function transitionEmit({
|
|
|
9683
9687
|
}
|
|
9684
9688
|
}
|
|
9685
9689
|
|
|
9686
|
-
function transitionStart(runCallbacks
|
|
9690
|
+
function transitionStart(runCallbacks, direction) {
|
|
9691
|
+
if (runCallbacks === void 0) {
|
|
9692
|
+
runCallbacks = true;
|
|
9693
|
+
}
|
|
9687
9694
|
const swiper = this;
|
|
9688
9695
|
const {
|
|
9689
9696
|
params
|
|
@@ -9700,7 +9707,10 @@ function transitionStart(runCallbacks = true, direction) {
|
|
|
9700
9707
|
});
|
|
9701
9708
|
}
|
|
9702
9709
|
|
|
9703
|
-
function transitionEnd(runCallbacks
|
|
9710
|
+
function transitionEnd(runCallbacks, direction) {
|
|
9711
|
+
if (runCallbacks === void 0) {
|
|
9712
|
+
runCallbacks = true;
|
|
9713
|
+
}
|
|
9704
9714
|
const swiper = this;
|
|
9705
9715
|
const {
|
|
9706
9716
|
params
|
|
@@ -9722,7 +9732,13 @@ var transition = {
|
|
|
9722
9732
|
transitionEnd
|
|
9723
9733
|
};
|
|
9724
9734
|
|
|
9725
|
-
function slideTo(index
|
|
9735
|
+
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
9736
|
+
if (index === void 0) {
|
|
9737
|
+
index = 0;
|
|
9738
|
+
}
|
|
9739
|
+
if (runCallbacks === void 0) {
|
|
9740
|
+
runCallbacks = true;
|
|
9741
|
+
}
|
|
9726
9742
|
if (typeof index === 'string') {
|
|
9727
9743
|
index = parseInt(index, 10);
|
|
9728
9744
|
}
|
|
@@ -9786,11 +9802,8 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9786
9802
|
let direction;
|
|
9787
9803
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
9788
9804
|
|
|
9789
|
-
// initial virtual
|
|
9790
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9791
|
-
const isInitialVirtual = isVirtual && initial;
|
|
9792
9805
|
// Update Index
|
|
9793
|
-
if (
|
|
9806
|
+
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
9794
9807
|
swiper.updateActiveIndex(slideIndex);
|
|
9795
9808
|
// Update Height
|
|
9796
9809
|
if (params.autoHeight) {
|
|
@@ -9810,6 +9823,7 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9810
9823
|
const isH = swiper.isHorizontal();
|
|
9811
9824
|
const t = rtl ? translate : -translate;
|
|
9812
9825
|
if (speed === 0) {
|
|
9826
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
9813
9827
|
if (isVirtual) {
|
|
9814
9828
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
9815
9829
|
swiper._immediateVirtual = true;
|
|
@@ -9844,11 +9858,6 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9844
9858
|
}
|
|
9845
9859
|
return true;
|
|
9846
9860
|
}
|
|
9847
|
-
const browser = getBrowser();
|
|
9848
|
-
const isSafari = browser.isSafari;
|
|
9849
|
-
if (isVirtual && !initial && isSafari && swiper.isElement) {
|
|
9850
|
-
swiper.virtual.update(false, false, slideIndex);
|
|
9851
|
-
}
|
|
9852
9861
|
swiper.setTransition(speed);
|
|
9853
9862
|
swiper.setTranslate(translate);
|
|
9854
9863
|
swiper.updateActiveIndex(slideIndex);
|
|
@@ -9874,7 +9883,13 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
|
9874
9883
|
return true;
|
|
9875
9884
|
}
|
|
9876
9885
|
|
|
9877
|
-
function slideToLoop(index
|
|
9886
|
+
function slideToLoop(index, speed, runCallbacks, internal) {
|
|
9887
|
+
if (index === void 0) {
|
|
9888
|
+
index = 0;
|
|
9889
|
+
}
|
|
9890
|
+
if (runCallbacks === void 0) {
|
|
9891
|
+
runCallbacks = true;
|
|
9892
|
+
}
|
|
9878
9893
|
if (typeof index === 'string') {
|
|
9879
9894
|
const indexAsNumber = parseInt(index, 10);
|
|
9880
9895
|
index = indexAsNumber;
|
|
@@ -9894,35 +9909,32 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9894
9909
|
let targetSlideIndex;
|
|
9895
9910
|
if (gridEnabled) {
|
|
9896
9911
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9897
|
-
targetSlideIndex = swiper.slides.
|
|
9912
|
+
targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
9898
9913
|
} else {
|
|
9899
9914
|
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
9900
9915
|
}
|
|
9901
9916
|
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
9902
9917
|
const {
|
|
9903
|
-
centeredSlides
|
|
9904
|
-
slidesOffsetBefore,
|
|
9905
|
-
slidesOffsetAfter
|
|
9918
|
+
centeredSlides
|
|
9906
9919
|
} = swiper.params;
|
|
9907
|
-
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
9908
9920
|
let slidesPerView = swiper.params.slidesPerView;
|
|
9909
9921
|
if (slidesPerView === 'auto') {
|
|
9910
9922
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
9911
9923
|
} else {
|
|
9912
9924
|
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
9913
|
-
if (
|
|
9925
|
+
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
9914
9926
|
slidesPerView = slidesPerView + 1;
|
|
9915
9927
|
}
|
|
9916
9928
|
}
|
|
9917
9929
|
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
9918
|
-
if (
|
|
9930
|
+
if (centeredSlides) {
|
|
9919
9931
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
9920
9932
|
}
|
|
9921
|
-
if (internal &&
|
|
9933
|
+
if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
9922
9934
|
needLoopFix = false;
|
|
9923
9935
|
}
|
|
9924
9936
|
if (needLoopFix) {
|
|
9925
|
-
const direction =
|
|
9937
|
+
const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
9926
9938
|
swiper.loopFix({
|
|
9927
9939
|
direction,
|
|
9928
9940
|
slideTo: true,
|
|
@@ -9932,7 +9944,7 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9932
9944
|
}
|
|
9933
9945
|
if (gridEnabled) {
|
|
9934
9946
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
9935
|
-
newIndex = swiper.slides.
|
|
9947
|
+
newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
|
|
9936
9948
|
} else {
|
|
9937
9949
|
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
9938
9950
|
}
|
|
@@ -9945,7 +9957,10 @@ function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
|
9945
9957
|
}
|
|
9946
9958
|
|
|
9947
9959
|
/* eslint no-unused-vars: "off" */
|
|
9948
|
-
function slideNext(speed, runCallbacks
|
|
9960
|
+
function slideNext(speed, runCallbacks, internal) {
|
|
9961
|
+
if (runCallbacks === void 0) {
|
|
9962
|
+
runCallbacks = true;
|
|
9963
|
+
}
|
|
9949
9964
|
const swiper = this;
|
|
9950
9965
|
const {
|
|
9951
9966
|
enabled,
|
|
@@ -9983,7 +9998,10 @@ function slideNext(speed, runCallbacks = true, internal) {
|
|
|
9983
9998
|
}
|
|
9984
9999
|
|
|
9985
10000
|
/* eslint no-unused-vars: "off" */
|
|
9986
|
-
function slidePrev(speed, runCallbacks
|
|
10001
|
+
function slidePrev(speed, runCallbacks, internal) {
|
|
10002
|
+
if (runCallbacks === void 0) {
|
|
10003
|
+
runCallbacks = true;
|
|
10004
|
+
}
|
|
9987
10005
|
const swiper = this;
|
|
9988
10006
|
const {
|
|
9989
10007
|
params,
|
|
@@ -10013,9 +10031,8 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10013
10031
|
}
|
|
10014
10032
|
const normalizedTranslate = normalize(translate);
|
|
10015
10033
|
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
|
10016
|
-
const isFreeMode = params.freeMode && params.freeMode.enabled;
|
|
10017
10034
|
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
|
10018
|
-
if (typeof prevSnap === 'undefined' &&
|
|
10035
|
+
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
|
10019
10036
|
let prevSnapIndex;
|
|
10020
10037
|
snapGrid.forEach((snap, snapIndex) => {
|
|
10021
10038
|
if (normalizedTranslate >= snap) {
|
|
@@ -10024,7 +10041,7 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10024
10041
|
}
|
|
10025
10042
|
});
|
|
10026
10043
|
if (typeof prevSnapIndex !== 'undefined') {
|
|
10027
|
-
prevSnap =
|
|
10044
|
+
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
10028
10045
|
}
|
|
10029
10046
|
}
|
|
10030
10047
|
let prevIndex = 0;
|
|
@@ -10049,7 +10066,10 @@ function slidePrev(speed, runCallbacks = true, internal) {
|
|
|
10049
10066
|
}
|
|
10050
10067
|
|
|
10051
10068
|
/* eslint no-unused-vars: "off" */
|
|
10052
|
-
function slideReset(speed, runCallbacks
|
|
10069
|
+
function slideReset(speed, runCallbacks, internal) {
|
|
10070
|
+
if (runCallbacks === void 0) {
|
|
10071
|
+
runCallbacks = true;
|
|
10072
|
+
}
|
|
10053
10073
|
const swiper = this;
|
|
10054
10074
|
if (swiper.destroyed) return;
|
|
10055
10075
|
if (typeof speed === 'undefined') {
|
|
@@ -10059,7 +10079,13 @@ function slideReset(speed, runCallbacks = true, internal) {
|
|
|
10059
10079
|
}
|
|
10060
10080
|
|
|
10061
10081
|
/* eslint no-unused-vars: "off" */
|
|
10062
|
-
function slideToClosest(speed, runCallbacks
|
|
10082
|
+
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
10083
|
+
if (runCallbacks === void 0) {
|
|
10084
|
+
runCallbacks = true;
|
|
10085
|
+
}
|
|
10086
|
+
if (threshold === void 0) {
|
|
10087
|
+
threshold = 0.5;
|
|
10088
|
+
}
|
|
10063
10089
|
const swiper = this;
|
|
10064
10090
|
if (swiper.destroyed) return;
|
|
10065
10091
|
if (typeof speed === 'undefined') {
|
|
@@ -10099,16 +10125,23 @@ function slideToClickedSlide() {
|
|
|
10099
10125
|
slidesEl
|
|
10100
10126
|
} = swiper;
|
|
10101
10127
|
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
10102
|
-
let slideToIndex = swiper.
|
|
10128
|
+
let slideToIndex = swiper.clickedIndex;
|
|
10103
10129
|
let realIndex;
|
|
10104
10130
|
const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
|
|
10105
|
-
const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
10106
10131
|
if (params.loop) {
|
|
10107
10132
|
if (swiper.animating) return;
|
|
10108
10133
|
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
10109
10134
|
if (params.centeredSlides) {
|
|
10110
|
-
swiper.
|
|
10111
|
-
|
|
10135
|
+
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
|
|
10136
|
+
swiper.loopFix();
|
|
10137
|
+
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10138
|
+
nextTick(() => {
|
|
10139
|
+
swiper.slideTo(slideToIndex);
|
|
10140
|
+
});
|
|
10141
|
+
} else {
|
|
10142
|
+
swiper.slideTo(slideToIndex);
|
|
10143
|
+
}
|
|
10144
|
+
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
10112
10145
|
swiper.loopFix();
|
|
10113
10146
|
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
10114
10147
|
nextTick(() => {
|
|
@@ -10132,7 +10165,7 @@ var slide = {
|
|
|
10132
10165
|
slideToClickedSlide
|
|
10133
10166
|
};
|
|
10134
10167
|
|
|
10135
|
-
function loopCreate(slideRealIndex
|
|
10168
|
+
function loopCreate(slideRealIndex) {
|
|
10136
10169
|
const swiper = this;
|
|
10137
10170
|
const {
|
|
10138
10171
|
params,
|
|
@@ -10145,20 +10178,7 @@ function loopCreate(slideRealIndex, initial) {
|
|
|
10145
10178
|
el.setAttribute('data-swiper-slide-index', index);
|
|
10146
10179
|
});
|
|
10147
10180
|
};
|
|
10148
|
-
const clearBlankSlides = () => {
|
|
10149
|
-
const slides = elementChildren(slidesEl, `.${params.slideBlankClass}`);
|
|
10150
|
-
slides.forEach(el => {
|
|
10151
|
-
el.remove();
|
|
10152
|
-
});
|
|
10153
|
-
if (slides.length > 0) {
|
|
10154
|
-
swiper.recalcSlides();
|
|
10155
|
-
swiper.updateSlides();
|
|
10156
|
-
}
|
|
10157
|
-
};
|
|
10158
10181
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10159
|
-
if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
|
|
10160
|
-
clearBlankSlides();
|
|
10161
|
-
}
|
|
10162
10182
|
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
10163
10183
|
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
10164
10184
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
@@ -10191,24 +10211,22 @@ function loopCreate(slideRealIndex, initial) {
|
|
|
10191
10211
|
} else {
|
|
10192
10212
|
initSlides();
|
|
10193
10213
|
}
|
|
10194
|
-
const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
|
|
10195
10214
|
swiper.loopFix({
|
|
10196
10215
|
slideRealIndex,
|
|
10197
|
-
direction:
|
|
10198
|
-
initial
|
|
10216
|
+
direction: params.centeredSlides ? undefined : 'next'
|
|
10199
10217
|
});
|
|
10200
10218
|
}
|
|
10201
10219
|
|
|
10202
|
-
function loopFix({
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
} = {}
|
|
10220
|
+
function loopFix(_temp) {
|
|
10221
|
+
let {
|
|
10222
|
+
slideRealIndex,
|
|
10223
|
+
slideTo = true,
|
|
10224
|
+
direction,
|
|
10225
|
+
setTranslate,
|
|
10226
|
+
activeSlideIndex,
|
|
10227
|
+
byController,
|
|
10228
|
+
byMousewheel
|
|
10229
|
+
} = _temp === void 0 ? {} : _temp;
|
|
10212
10230
|
const swiper = this;
|
|
10213
10231
|
if (!swiper.params.loop) return;
|
|
10214
10232
|
swiper.emit('beforeLoopFix');
|
|
@@ -10220,19 +10238,15 @@ function loopFix({
|
|
|
10220
10238
|
params
|
|
10221
10239
|
} = swiper;
|
|
10222
10240
|
const {
|
|
10223
|
-
centeredSlides
|
|
10224
|
-
slidesOffsetBefore,
|
|
10225
|
-
slidesOffsetAfter,
|
|
10226
|
-
initialSlide
|
|
10241
|
+
centeredSlides
|
|
10227
10242
|
} = params;
|
|
10228
|
-
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
10229
10243
|
swiper.allowSlidePrev = true;
|
|
10230
10244
|
swiper.allowSlideNext = true;
|
|
10231
10245
|
if (swiper.virtual && params.virtual.enabled) {
|
|
10232
10246
|
if (slideTo) {
|
|
10233
|
-
if (!
|
|
10247
|
+
if (!params.centeredSlides && swiper.snapIndex === 0) {
|
|
10234
10248
|
swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
|
|
10235
|
-
} else if (
|
|
10249
|
+
} else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
|
|
10236
10250
|
swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
|
|
10237
10251
|
} else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
|
|
10238
10252
|
swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
|
|
@@ -10248,30 +10262,28 @@ function loopFix({
|
|
|
10248
10262
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
10249
10263
|
} else {
|
|
10250
10264
|
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
10251
|
-
if (
|
|
10265
|
+
if (centeredSlides && slidesPerView % 2 === 0) {
|
|
10252
10266
|
slidesPerView = slidesPerView + 1;
|
|
10253
10267
|
}
|
|
10254
10268
|
}
|
|
10255
10269
|
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
10256
|
-
let loopedSlides =
|
|
10270
|
+
let loopedSlides = slidesPerGroup;
|
|
10257
10271
|
if (loopedSlides % slidesPerGroup !== 0) {
|
|
10258
10272
|
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
10259
10273
|
}
|
|
10260
10274
|
loopedSlides += params.loopAdditionalSlides;
|
|
10261
10275
|
swiper.loopedSlides = loopedSlides;
|
|
10262
10276
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
10263
|
-
if (slides.length < slidesPerView + loopedSlides
|
|
10264
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled
|
|
10277
|
+
if (slides.length < slidesPerView + loopedSlides) {
|
|
10278
|
+
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');
|
|
10265
10279
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
10266
10280
|
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
10267
10281
|
}
|
|
10268
10282
|
const prependSlidesIndexes = [];
|
|
10269
10283
|
const appendSlidesIndexes = [];
|
|
10270
|
-
|
|
10271
|
-
const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
|
|
10272
|
-
let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
|
|
10284
|
+
let activeIndex = swiper.activeIndex;
|
|
10273
10285
|
if (typeof activeSlideIndex === 'undefined') {
|
|
10274
|
-
activeSlideIndex = swiper.getSlideIndex(slides.
|
|
10286
|
+
activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
|
|
10275
10287
|
} else {
|
|
10276
10288
|
activeIndex = activeSlideIndex;
|
|
10277
10289
|
}
|
|
@@ -10279,8 +10291,9 @@ function loopFix({
|
|
|
10279
10291
|
const isPrev = direction === 'prev' || !direction;
|
|
10280
10292
|
let slidesPrepended = 0;
|
|
10281
10293
|
let slidesAppended = 0;
|
|
10294
|
+
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
10282
10295
|
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
10283
|
-
const activeColIndexWithShift = activeColIndex + (
|
|
10296
|
+
const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
10284
10297
|
// prepend last slides before start
|
|
10285
10298
|
if (activeColIndexWithShift < loopedSlides) {
|
|
10286
10299
|
slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
|
|
@@ -10300,9 +10313,6 @@ function loopFix({
|
|
|
10300
10313
|
}
|
|
10301
10314
|
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
10302
10315
|
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
10303
|
-
if (isInitialOverflow) {
|
|
10304
|
-
slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
|
|
10305
|
-
}
|
|
10306
10316
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
10307
10317
|
const index = i - Math.floor(i / cols) * cols;
|
|
10308
10318
|
if (gridEnabled) {
|
|
@@ -10318,14 +10328,6 @@ function loopFix({
|
|
|
10318
10328
|
requestAnimationFrame(() => {
|
|
10319
10329
|
swiper.__preventObserver__ = false;
|
|
10320
10330
|
});
|
|
10321
|
-
if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
10322
|
-
if (appendSlidesIndexes.includes(activeSlideIndex)) {
|
|
10323
|
-
appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10324
|
-
}
|
|
10325
|
-
if (prependSlidesIndexes.includes(activeSlideIndex)) {
|
|
10326
|
-
prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
10327
|
-
}
|
|
10328
|
-
}
|
|
10329
10331
|
if (isPrev) {
|
|
10330
10332
|
prependSlidesIndexes.forEach(index => {
|
|
10331
10333
|
slides[index].swiperLoopMoveDOM = true;
|
|
@@ -10426,7 +10428,7 @@ function loopDestroy() {
|
|
|
10426
10428
|
params,
|
|
10427
10429
|
slidesEl
|
|
10428
10430
|
} = swiper;
|
|
10429
|
-
if (!params.loop ||
|
|
10431
|
+
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
10430
10432
|
swiper.recalcSlides();
|
|
10431
10433
|
const newSlidesOrder = [];
|
|
10432
10434
|
swiper.slides.forEach(slideEl => {
|
|
@@ -10487,7 +10489,10 @@ var grabCursor = {
|
|
|
10487
10489
|
};
|
|
10488
10490
|
|
|
10489
10491
|
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
10490
|
-
function closestElement(selector, base
|
|
10492
|
+
function closestElement(selector, base) {
|
|
10493
|
+
if (base === void 0) {
|
|
10494
|
+
base = this;
|
|
10495
|
+
}
|
|
10491
10496
|
function __closestFrom(el) {
|
|
10492
10497
|
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
10493
10498
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
@@ -10549,7 +10554,7 @@ function onTouchStart(event) {
|
|
|
10549
10554
|
}
|
|
10550
10555
|
let targetEl = e.target;
|
|
10551
10556
|
if (params.touchEventsTarget === 'wrapper') {
|
|
10552
|
-
if (!
|
|
10557
|
+
if (!swiper.wrapperEl.contains(targetEl)) return;
|
|
10553
10558
|
}
|
|
10554
10559
|
if ('which' in e && e.which === 3) return;
|
|
10555
10560
|
if ('button' in e && e.button > 0) return;
|
|
@@ -10604,7 +10609,7 @@ function onTouchStart(event) {
|
|
|
10604
10609
|
data.isTouched = false;
|
|
10605
10610
|
}
|
|
10606
10611
|
}
|
|
10607
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl
|
|
10612
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
|
|
10608
10613
|
document.activeElement.blur();
|
|
10609
10614
|
}
|
|
10610
10615
|
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
@@ -10638,7 +10643,7 @@ function onTouchMove(event) {
|
|
|
10638
10643
|
}
|
|
10639
10644
|
let targetTouch;
|
|
10640
10645
|
if (e.type === 'touchmove') {
|
|
10641
|
-
targetTouch = [...e.changedTouches].
|
|
10646
|
+
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
10642
10647
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10643
10648
|
} else {
|
|
10644
10649
|
targetTouch = e;
|
|
@@ -10679,15 +10684,10 @@ function onTouchMove(event) {
|
|
|
10679
10684
|
data.isMoved = false;
|
|
10680
10685
|
return;
|
|
10681
10686
|
}
|
|
10682
|
-
} else if (
|
|
10683
|
-
return;
|
|
10684
|
-
} else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
10687
|
+
} else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
|
|
10685
10688
|
return;
|
|
10686
10689
|
}
|
|
10687
10690
|
}
|
|
10688
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
|
|
10689
|
-
document.activeElement.blur();
|
|
10690
|
-
}
|
|
10691
10691
|
if (document.activeElement) {
|
|
10692
10692
|
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
10693
10693
|
data.isMoved = true;
|
|
@@ -10783,7 +10783,7 @@ function onTouchMove(event) {
|
|
|
10783
10783
|
}
|
|
10784
10784
|
let loopFixed;
|
|
10785
10785
|
new Date().getTime();
|
|
10786
|
-
if (
|
|
10786
|
+
if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
10787
10787
|
Object.assign(touches, {
|
|
10788
10788
|
startX: pageX,
|
|
10789
10789
|
startY: pageY,
|
|
@@ -10804,7 +10804,7 @@ function onTouchMove(event) {
|
|
|
10804
10804
|
resistanceRatio = 0;
|
|
10805
10805
|
}
|
|
10806
10806
|
if (diff > 0) {
|
|
10807
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1]
|
|
10807
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {
|
|
10808
10808
|
swiper.loopFix({
|
|
10809
10809
|
direction: 'prev',
|
|
10810
10810
|
setTranslate: true,
|
|
@@ -10818,7 +10818,7 @@ function onTouchMove(event) {
|
|
|
10818
10818
|
}
|
|
10819
10819
|
}
|
|
10820
10820
|
} else if (diff < 0) {
|
|
10821
|
-
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1]
|
|
10821
|
+
if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {
|
|
10822
10822
|
swiper.loopFix({
|
|
10823
10823
|
direction: 'next',
|
|
10824
10824
|
setTranslate: true,
|
|
@@ -10891,7 +10891,7 @@ function onTouchEnd(event) {
|
|
|
10891
10891
|
if (e.pointerId !== data.pointerId) return;
|
|
10892
10892
|
targetTouch = e;
|
|
10893
10893
|
} else {
|
|
10894
|
-
targetTouch = [...e.changedTouches].
|
|
10894
|
+
targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
|
|
10895
10895
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
10896
10896
|
}
|
|
10897
10897
|
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
|
|
@@ -11265,12 +11265,9 @@ function setBreakpoint() {
|
|
|
11265
11265
|
} = swiper;
|
|
11266
11266
|
const breakpoints = params.breakpoints;
|
|
11267
11267
|
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
|
|
11268
|
-
const document = getDocument();
|
|
11269
11268
|
|
|
11270
|
-
// Get breakpoint for window
|
|
11271
|
-
const
|
|
11272
|
-
const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
|
|
11273
|
-
const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
|
|
11269
|
+
// Get breakpoint for window width and update parameters
|
|
11270
|
+
const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
|
|
11274
11271
|
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
|
11275
11272
|
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
|
11276
11273
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
@@ -11343,7 +11340,10 @@ function setBreakpoint() {
|
|
|
11343
11340
|
swiper.emit('breakpoint', breakpointParams);
|
|
11344
11341
|
}
|
|
11345
11342
|
|
|
11346
|
-
function getBreakpoint(breakpoints, base
|
|
11343
|
+
function getBreakpoint(breakpoints, base, containerEl) {
|
|
11344
|
+
if (base === void 0) {
|
|
11345
|
+
base = 'window';
|
|
11346
|
+
}
|
|
11347
11347
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
11348
11348
|
let breakpoint = false;
|
|
11349
11349
|
const window = getWindow();
|
|
@@ -11538,7 +11538,6 @@ var defaults = {
|
|
|
11538
11538
|
// in px
|
|
11539
11539
|
normalizeSlideIndex: true,
|
|
11540
11540
|
centerInsufficientSlides: false,
|
|
11541
|
-
snapToSlideEdge: false,
|
|
11542
11541
|
// Disable swiper and hide navigation when container not overflow
|
|
11543
11542
|
watchOverflow: true,
|
|
11544
11543
|
// Round length
|
|
@@ -11609,7 +11608,10 @@ var defaults = {
|
|
|
11609
11608
|
};
|
|
11610
11609
|
|
|
11611
11610
|
function moduleExtendParams(params, allModulesParams) {
|
|
11612
|
-
return function extendParams(obj
|
|
11611
|
+
return function extendParams(obj) {
|
|
11612
|
+
if (obj === void 0) {
|
|
11613
|
+
obj = {};
|
|
11614
|
+
}
|
|
11613
11615
|
const moduleParamName = Object.keys(obj)[0];
|
|
11614
11616
|
const moduleParams = obj[moduleParamName];
|
|
11615
11617
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
@@ -11657,9 +11659,12 @@ const prototypes = {
|
|
|
11657
11659
|
};
|
|
11658
11660
|
const extendedDefaults = {};
|
|
11659
11661
|
class Swiper$1 {
|
|
11660
|
-
constructor(
|
|
11662
|
+
constructor() {
|
|
11661
11663
|
let el;
|
|
11662
11664
|
let params;
|
|
11665
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11666
|
+
args[_key] = arguments[_key];
|
|
11667
|
+
}
|
|
11663
11668
|
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
|
11664
11669
|
params = args[0];
|
|
11665
11670
|
} else {
|
|
@@ -11693,11 +11698,7 @@ class Swiper$1 {
|
|
|
11693
11698
|
swiper.eventsAnyListeners = [];
|
|
11694
11699
|
swiper.modules = [...swiper.__modules__];
|
|
11695
11700
|
if (params.modules && Array.isArray(params.modules)) {
|
|
11696
|
-
|
|
11697
|
-
if (typeof mod === 'function' && swiper.modules.indexOf(mod) < 0) {
|
|
11698
|
-
swiper.modules.push(mod);
|
|
11699
|
-
}
|
|
11700
|
-
});
|
|
11701
|
+
swiper.modules.push(...params.modules);
|
|
11701
11702
|
}
|
|
11702
11703
|
const allModulesParams = {};
|
|
11703
11704
|
swiper.modules.forEach(mod => {
|
|
@@ -11842,17 +11843,7 @@ class Swiper$1 {
|
|
|
11842
11843
|
return elementIndex(slideEl) - firstSlideIndex;
|
|
11843
11844
|
}
|
|
11844
11845
|
getSlideIndexByData(index) {
|
|
11845
|
-
return this.getSlideIndex(this.slides.
|
|
11846
|
-
}
|
|
11847
|
-
getSlideIndexWhenGrid(index) {
|
|
11848
|
-
if (this.grid && this.params.grid && this.params.grid.rows > 1) {
|
|
11849
|
-
if (this.params.grid.fill === 'column') {
|
|
11850
|
-
index = Math.floor(index / this.params.grid.rows);
|
|
11851
|
-
} else if (this.params.grid.fill === 'row') {
|
|
11852
|
-
index = index % Math.ceil(this.slides.length / this.params.grid.rows);
|
|
11853
|
-
}
|
|
11854
|
-
}
|
|
11855
|
-
return index;
|
|
11846
|
+
return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);
|
|
11856
11847
|
}
|
|
11857
11848
|
recalcSlides() {
|
|
11858
11849
|
const swiper = this;
|
|
@@ -11919,7 +11910,13 @@ class Swiper$1 {
|
|
|
11919
11910
|
});
|
|
11920
11911
|
swiper.emit('_slideClasses', updates);
|
|
11921
11912
|
}
|
|
11922
|
-
slidesPerViewDynamic(view
|
|
11913
|
+
slidesPerViewDynamic(view, exact) {
|
|
11914
|
+
if (view === void 0) {
|
|
11915
|
+
view = 'current';
|
|
11916
|
+
}
|
|
11917
|
+
if (exact === void 0) {
|
|
11918
|
+
exact = false;
|
|
11919
|
+
}
|
|
11923
11920
|
const swiper = this;
|
|
11924
11921
|
const {
|
|
11925
11922
|
params,
|
|
@@ -12018,7 +12015,10 @@ class Swiper$1 {
|
|
|
12018
12015
|
}
|
|
12019
12016
|
swiper.emit('update');
|
|
12020
12017
|
}
|
|
12021
|
-
changeDirection(newDirection, needUpdate
|
|
12018
|
+
changeDirection(newDirection, needUpdate) {
|
|
12019
|
+
if (needUpdate === void 0) {
|
|
12020
|
+
needUpdate = true;
|
|
12021
|
+
}
|
|
12022
12022
|
const swiper = this;
|
|
12023
12023
|
const currentDirection = swiper.params.direction;
|
|
12024
12024
|
if (!newDirection) {
|
|
@@ -12144,7 +12144,7 @@ class Swiper$1 {
|
|
|
12144
12144
|
|
|
12145
12145
|
// Create loop
|
|
12146
12146
|
if (swiper.params.loop) {
|
|
12147
|
-
swiper.loopCreate(
|
|
12147
|
+
swiper.loopCreate();
|
|
12148
12148
|
}
|
|
12149
12149
|
|
|
12150
12150
|
// Attach events
|
|
@@ -12173,7 +12173,13 @@ class Swiper$1 {
|
|
|
12173
12173
|
swiper.emit('afterInit');
|
|
12174
12174
|
return swiper;
|
|
12175
12175
|
}
|
|
12176
|
-
destroy(deleteInstance
|
|
12176
|
+
destroy(deleteInstance, cleanStyles) {
|
|
12177
|
+
if (deleteInstance === void 0) {
|
|
12178
|
+
deleteInstance = true;
|
|
12179
|
+
}
|
|
12180
|
+
if (cleanStyles === void 0) {
|
|
12181
|
+
cleanStyles = true;
|
|
12182
|
+
}
|
|
12177
12183
|
const swiper = this;
|
|
12178
12184
|
const {
|
|
12179
12185
|
params,
|
|
@@ -12262,7 +12268,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
12262
12268
|
Swiper$1.use([Resize, Observer]);
|
|
12263
12269
|
|
|
12264
12270
|
/* underscore in name -> watch for changes */
|
|
12265
|
-
const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '
|
|
12271
|
+
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',
|
|
12266
12272
|
// modules
|
|
12267
12273
|
'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
|
|
12268
12274
|
|
|
@@ -12279,16 +12285,28 @@ function extend(target, src) {
|
|
|
12279
12285
|
}
|
|
12280
12286
|
});
|
|
12281
12287
|
}
|
|
12282
|
-
function needsNavigation(params
|
|
12288
|
+
function needsNavigation(params) {
|
|
12289
|
+
if (params === void 0) {
|
|
12290
|
+
params = {};
|
|
12291
|
+
}
|
|
12283
12292
|
return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';
|
|
12284
12293
|
}
|
|
12285
|
-
function needsPagination(params
|
|
12294
|
+
function needsPagination(params) {
|
|
12295
|
+
if (params === void 0) {
|
|
12296
|
+
params = {};
|
|
12297
|
+
}
|
|
12286
12298
|
return params.pagination && typeof params.pagination.el === 'undefined';
|
|
12287
12299
|
}
|
|
12288
|
-
function needsScrollbar(params
|
|
12300
|
+
function needsScrollbar(params) {
|
|
12301
|
+
if (params === void 0) {
|
|
12302
|
+
params = {};
|
|
12303
|
+
}
|
|
12289
12304
|
return params.scrollbar && typeof params.scrollbar.el === 'undefined';
|
|
12290
12305
|
}
|
|
12291
|
-
function uniqueClasses(classNames
|
|
12306
|
+
function uniqueClasses(classNames) {
|
|
12307
|
+
if (classNames === void 0) {
|
|
12308
|
+
classNames = '';
|
|
12309
|
+
}
|
|
12292
12310
|
const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);
|
|
12293
12311
|
const unique = [];
|
|
12294
12312
|
classes.forEach(c => {
|
|
@@ -12296,22 +12314,26 @@ function uniqueClasses(classNames = '') {
|
|
|
12296
12314
|
});
|
|
12297
12315
|
return unique.join(' ');
|
|
12298
12316
|
}
|
|
12299
|
-
function wrapperClass(className
|
|
12317
|
+
function wrapperClass(className) {
|
|
12318
|
+
if (className === void 0) {
|
|
12319
|
+
className = '';
|
|
12320
|
+
}
|
|
12300
12321
|
if (!className) return 'swiper-wrapper';
|
|
12301
12322
|
if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;
|
|
12302
12323
|
return className;
|
|
12303
12324
|
}
|
|
12304
12325
|
|
|
12305
|
-
function updateSwiper({
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12313
|
-
|
|
12314
|
-
|
|
12326
|
+
function updateSwiper(_ref) {
|
|
12327
|
+
let {
|
|
12328
|
+
swiper,
|
|
12329
|
+
slides,
|
|
12330
|
+
passedParams,
|
|
12331
|
+
changedParams,
|
|
12332
|
+
nextEl,
|
|
12333
|
+
prevEl,
|
|
12334
|
+
scrollbarEl,
|
|
12335
|
+
paginationEl
|
|
12336
|
+
} = _ref;
|
|
12315
12337
|
const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');
|
|
12316
12338
|
const {
|
|
12317
12339
|
params: currentParams,
|
|
@@ -12329,7 +12351,7 @@ function updateSwiper({
|
|
|
12329
12351
|
let loopNeedDestroy;
|
|
12330
12352
|
let loopNeedEnable;
|
|
12331
12353
|
let loopNeedReloop;
|
|
12332
|
-
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper &&
|
|
12354
|
+
if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {
|
|
12333
12355
|
needThumbsInit = true;
|
|
12334
12356
|
}
|
|
12335
12357
|
if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {
|
|
@@ -12439,14 +12461,14 @@ function updateSwiper({
|
|
|
12439
12461
|
if (!nextEl || typeof nextEl === 'string') {
|
|
12440
12462
|
nextEl = document.createElement('div');
|
|
12441
12463
|
nextEl.classList.add('swiper-button-next');
|
|
12442
|
-
|
|
12464
|
+
nextEl.innerHTML = swiper.hostEl.constructor.nextButtonSvg;
|
|
12443
12465
|
nextEl.part.add('button-next');
|
|
12444
12466
|
swiper.el.appendChild(nextEl);
|
|
12445
12467
|
}
|
|
12446
12468
|
if (!prevEl || typeof prevEl === 'string') {
|
|
12447
12469
|
prevEl = document.createElement('div');
|
|
12448
12470
|
prevEl.classList.add('swiper-button-prev');
|
|
12449
|
-
|
|
12471
|
+
prevEl.innerHTML = swiper.hostEl.constructor.prevButtonSvg;
|
|
12450
12472
|
prevEl.part.add('button-prev');
|
|
12451
12473
|
swiper.el.appendChild(prevEl);
|
|
12452
12474
|
}
|
|
@@ -12474,7 +12496,13 @@ function updateSwiper({
|
|
|
12474
12496
|
swiper.update();
|
|
12475
12497
|
}
|
|
12476
12498
|
|
|
12477
|
-
function getParams(obj
|
|
12499
|
+
function getParams(obj, splitEvents) {
|
|
12500
|
+
if (obj === void 0) {
|
|
12501
|
+
obj = {};
|
|
12502
|
+
}
|
|
12503
|
+
if (splitEvents === void 0) {
|
|
12504
|
+
splitEvents = true;
|
|
12505
|
+
}
|
|
12478
12506
|
const params = {
|
|
12479
12507
|
on: {}
|
|
12480
12508
|
};
|
|
@@ -12520,14 +12548,15 @@ function getParams(obj = {}, splitEvents = true) {
|
|
|
12520
12548
|
};
|
|
12521
12549
|
}
|
|
12522
12550
|
|
|
12523
|
-
function mountSwiper({
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12551
|
+
function mountSwiper(_ref, swiperParams) {
|
|
12552
|
+
let {
|
|
12553
|
+
el,
|
|
12554
|
+
nextEl,
|
|
12555
|
+
prevEl,
|
|
12556
|
+
paginationEl,
|
|
12557
|
+
scrollbarEl,
|
|
12558
|
+
swiper
|
|
12559
|
+
} = _ref;
|
|
12531
12560
|
if (needsNavigation(swiperParams) && nextEl && prevEl) {
|
|
12532
12561
|
swiper.params.navigation.nextEl = nextEl;
|
|
12533
12562
|
swiper.originalParams.navigation.nextEl = nextEl;
|
|
@@ -12588,22 +12617,21 @@ const updateOnVirtualData = swiper => {
|
|
|
12588
12617
|
swiper.updateSlides();
|
|
12589
12618
|
swiper.updateProgress();
|
|
12590
12619
|
swiper.updateSlidesClasses();
|
|
12591
|
-
swiper.emit('_virtualUpdated');
|
|
12592
12620
|
if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
|
|
12593
12621
|
swiper.parallax.setTranslate();
|
|
12594
12622
|
}
|
|
12595
12623
|
};
|
|
12596
12624
|
|
|
12597
12625
|
/**
|
|
12598
|
-
* Swiper React
|
|
12626
|
+
* Swiper React 11.1.4
|
|
12599
12627
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
12600
12628
|
* https://swiperjs.com
|
|
12601
12629
|
*
|
|
12602
|
-
* Copyright 2014-
|
|
12630
|
+
* Copyright 2014-2024 Vladimir Kharlampidi
|
|
12603
12631
|
*
|
|
12604
12632
|
* Released under the MIT License
|
|
12605
12633
|
*
|
|
12606
|
-
* Released on:
|
|
12634
|
+
* Released on: May 30, 2024
|
|
12607
12635
|
*/
|
|
12608
12636
|
|
|
12609
12637
|
function _extends() {
|
|
@@ -12712,14 +12740,15 @@ function useIsomorphicLayoutEffect(callback, deps) {
|
|
|
12712
12740
|
const SwiperSlideContext = /*#__PURE__*/createContext(null);
|
|
12713
12741
|
const SwiperContext = /*#__PURE__*/createContext(null);
|
|
12714
12742
|
|
|
12715
|
-
const Swiper = /*#__PURE__*/forwardRef(({
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12743
|
+
const Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {
|
|
12744
|
+
let {
|
|
12745
|
+
className,
|
|
12746
|
+
tag: Tag = 'div',
|
|
12747
|
+
wrapperTag: WrapperTag = 'div',
|
|
12748
|
+
children,
|
|
12749
|
+
onSwiper,
|
|
12750
|
+
...rest
|
|
12751
|
+
} = _temp === void 0 ? {} : _temp;
|
|
12723
12752
|
let eventsAssigned = false;
|
|
12724
12753
|
const [containerClasses, setContainerClasses] = useState('swiper');
|
|
12725
12754
|
const [virtualData, setVirtualData] = useState(null);
|
|
@@ -12895,17 +12924,18 @@ const Swiper = /*#__PURE__*/forwardRef(({
|
|
|
12895
12924
|
});
|
|
12896
12925
|
Swiper.displayName = 'Swiper';
|
|
12897
12926
|
|
|
12898
|
-
const SwiperSlide = /*#__PURE__*/forwardRef(({
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12927
|
+
const SwiperSlide = /*#__PURE__*/forwardRef(function (_temp, externalRef) {
|
|
12928
|
+
let {
|
|
12929
|
+
tag: Tag = 'div',
|
|
12930
|
+
children,
|
|
12931
|
+
className = '',
|
|
12932
|
+
swiper,
|
|
12933
|
+
zoom,
|
|
12934
|
+
lazy,
|
|
12935
|
+
virtualIndex,
|
|
12936
|
+
swiperSlideIndex,
|
|
12937
|
+
...rest
|
|
12938
|
+
} = _temp === void 0 ? {} : _temp;
|
|
12909
12939
|
const slideElRef = useRef(null);
|
|
12910
12940
|
const [slideClasses, setSlideClasses] = useState('swiper-slide');
|
|
12911
12941
|
const [lazyLoaded, setLazyLoaded] = useState(false);
|
|
@@ -12965,17 +12995,11 @@ const SwiperSlide = /*#__PURE__*/forwardRef(({
|
|
|
12965
12995
|
className: "swiper-zoom-container",
|
|
12966
12996
|
"data-swiper-zoom": typeof zoom === 'number' ? zoom : undefined
|
|
12967
12997
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
12968
|
-
className: "swiper-lazy-preloader"
|
|
12969
|
-
ref: node => {
|
|
12970
|
-
if (node) node.lazyPreloaderManaged = true;
|
|
12971
|
-
}
|
|
12998
|
+
className: "swiper-lazy-preloader"
|
|
12972
12999
|
}))), !zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {
|
|
12973
13000
|
value: slideData
|
|
12974
13001
|
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
12975
|
-
className: "swiper-lazy-preloader"
|
|
12976
|
-
ref: node => {
|
|
12977
|
-
if (node) node.lazyPreloaderManaged = true;
|
|
12978
|
-
}
|
|
13002
|
+
className: "swiper-lazy-preloader"
|
|
12979
13003
|
})));
|
|
12980
13004
|
});
|
|
12981
13005
|
SwiperSlide.displayName = 'SwiperSlide';
|
|
@@ -15318,12 +15342,13 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
15318
15342
|
};
|
|
15319
15343
|
|
|
15320
15344
|
/* eslint-disable consistent-return */
|
|
15321
|
-
function Keyboard({
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15345
|
+
function Keyboard(_ref) {
|
|
15346
|
+
let {
|
|
15347
|
+
swiper,
|
|
15348
|
+
extendParams,
|
|
15349
|
+
on,
|
|
15350
|
+
emit
|
|
15351
|
+
} = _ref;
|
|
15327
15352
|
const document = getDocument();
|
|
15328
15353
|
const window = getWindow();
|
|
15329
15354
|
swiper.keyboard = {
|
|
@@ -15333,8 +15358,7 @@ function Keyboard({
|
|
|
15333
15358
|
keyboard: {
|
|
15334
15359
|
enabled: false,
|
|
15335
15360
|
onlyInViewport: true,
|
|
15336
|
-
pageUpDown: true
|
|
15337
|
-
speed: undefined
|
|
15361
|
+
pageUpDown: true
|
|
15338
15362
|
}
|
|
15339
15363
|
});
|
|
15340
15364
|
function handle(event) {
|
|
@@ -15362,7 +15386,7 @@ function Keyboard({
|
|
|
15362
15386
|
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
|
15363
15387
|
return undefined;
|
|
15364
15388
|
}
|
|
15365
|
-
if (document.activeElement &&
|
|
15389
|
+
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
|
15366
15390
|
return undefined;
|
|
15367
15391
|
}
|
|
15368
15392
|
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
|
|
@@ -15388,19 +15412,18 @@ function Keyboard({
|
|
|
15388
15412
|
}
|
|
15389
15413
|
if (!inView) return undefined;
|
|
15390
15414
|
}
|
|
15391
|
-
const speed = swiper.params.keyboard.speed;
|
|
15392
15415
|
if (swiper.isHorizontal()) {
|
|
15393
15416
|
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
|
|
15394
15417
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15395
15418
|
}
|
|
15396
|
-
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(
|
|
15397
|
-
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(
|
|
15419
|
+
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
|
|
15420
|
+
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
|
|
15398
15421
|
} else {
|
|
15399
15422
|
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
|
|
15400
15423
|
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
15401
15424
|
}
|
|
15402
|
-
if (isPageDown || isArrowDown) swiper.slideNext(
|
|
15403
|
-
if (isPageUp || isArrowUp) swiper.slidePrev(
|
|
15425
|
+
if (isPageDown || isArrowDown) swiper.slideNext();
|
|
15426
|
+
if (isPageUp || isArrowUp) swiper.slidePrev();
|
|
15404
15427
|
}
|
|
15405
15428
|
emit('keyPress', kc);
|
|
15406
15429
|
return undefined;
|
|
@@ -15431,11 +15454,12 @@ function Keyboard({
|
|
|
15431
15454
|
});
|
|
15432
15455
|
}
|
|
15433
15456
|
|
|
15434
|
-
function History({
|
|
15435
|
-
|
|
15436
|
-
|
|
15437
|
-
|
|
15438
|
-
|
|
15457
|
+
function History(_ref) {
|
|
15458
|
+
let {
|
|
15459
|
+
swiper,
|
|
15460
|
+
extendParams,
|
|
15461
|
+
on
|
|
15462
|
+
} = _ref;
|
|
15439
15463
|
extendParams({
|
|
15440
15464
|
history: {
|
|
15441
15465
|
enabled: false,
|
|
@@ -15571,13 +15595,14 @@ function History({
|
|
|
15571
15595
|
|
|
15572
15596
|
/* eslint no-underscore-dangle: "off" */
|
|
15573
15597
|
/* eslint no-use-before-define: "off" */
|
|
15574
|
-
function Autoplay({
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15598
|
+
function Autoplay(_ref) {
|
|
15599
|
+
let {
|
|
15600
|
+
swiper,
|
|
15601
|
+
extendParams,
|
|
15602
|
+
on,
|
|
15603
|
+
emit,
|
|
15604
|
+
params
|
|
15605
|
+
} = _ref;
|
|
15581
15606
|
swiper.autoplay = {
|
|
15582
15607
|
running: false,
|
|
15583
15608
|
paused: false,
|
|
@@ -15604,6 +15629,7 @@ function Autoplay({
|
|
|
15604
15629
|
let isTouched;
|
|
15605
15630
|
let pausedByTouch;
|
|
15606
15631
|
let touchStartTimeout;
|
|
15632
|
+
let slideChanged;
|
|
15607
15633
|
let pausedByInteraction;
|
|
15608
15634
|
let pausedByPointerEnter;
|
|
15609
15635
|
function onTransitionEnd(e) {
|
|
@@ -15633,7 +15659,7 @@ function Autoplay({
|
|
|
15633
15659
|
const getSlideDelay = () => {
|
|
15634
15660
|
let activeSlideEl;
|
|
15635
15661
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
|
15636
|
-
activeSlideEl = swiper.slides.
|
|
15662
|
+
activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
|
|
15637
15663
|
} else {
|
|
15638
15664
|
activeSlideEl = swiper.slides[swiper.activeIndex];
|
|
15639
15665
|
}
|
|
@@ -15641,23 +15667,18 @@ function Autoplay({
|
|
|
15641
15667
|
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
|
15642
15668
|
return currentSlideDelay;
|
|
15643
15669
|
};
|
|
15644
|
-
const getTotalDelay = () => {
|
|
15645
|
-
let totalDelay = swiper.params.autoplay.delay;
|
|
15646
|
-
const currentSlideDelay = getSlideDelay();
|
|
15647
|
-
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0) {
|
|
15648
|
-
totalDelay = currentSlideDelay;
|
|
15649
|
-
}
|
|
15650
|
-
return totalDelay;
|
|
15651
|
-
};
|
|
15652
15670
|
const run = delayForce => {
|
|
15653
15671
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15654
15672
|
cancelAnimationFrame(raf);
|
|
15655
15673
|
calcTimeLeft();
|
|
15656
|
-
let delay = delayForce;
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
|
|
15660
|
-
|
|
15674
|
+
let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
|
|
15675
|
+
autoplayDelayTotal = swiper.params.autoplay.delay;
|
|
15676
|
+
autoplayDelayCurrent = swiper.params.autoplay.delay;
|
|
15677
|
+
const currentSlideDelay = getSlideDelay();
|
|
15678
|
+
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
|
|
15679
|
+
delay = currentSlideDelay;
|
|
15680
|
+
autoplayDelayTotal = currentSlideDelay;
|
|
15681
|
+
autoplayDelayCurrent = currentSlideDelay;
|
|
15661
15682
|
}
|
|
15662
15683
|
autoplayTimeLeft = delay;
|
|
15663
15684
|
const speed = swiper.params.speed;
|
|
@@ -15729,6 +15750,10 @@ function Autoplay({
|
|
|
15729
15750
|
};
|
|
15730
15751
|
swiper.autoplay.paused = true;
|
|
15731
15752
|
if (reset) {
|
|
15753
|
+
if (slideChanged) {
|
|
15754
|
+
autoplayTimeLeft = swiper.params.autoplay.delay;
|
|
15755
|
+
}
|
|
15756
|
+
slideChanged = false;
|
|
15732
15757
|
proceed();
|
|
15733
15758
|
return;
|
|
15734
15759
|
}
|
|
@@ -15859,10 +15884,7 @@ function Autoplay({
|
|
|
15859
15884
|
});
|
|
15860
15885
|
on('slideChange', () => {
|
|
15861
15886
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
|
15862
|
-
|
|
15863
|
-
autoplayTimeLeft = getTotalDelay();
|
|
15864
|
-
autoplayDelayTotal = getTotalDelay();
|
|
15865
|
-
}
|
|
15887
|
+
slideChanged = true;
|
|
15866
15888
|
});
|
|
15867
15889
|
Object.assign(swiper.autoplay, {
|
|
15868
15890
|
start,
|
|
@@ -15872,11 +15894,12 @@ function Autoplay({
|
|
|
15872
15894
|
});
|
|
15873
15895
|
}
|
|
15874
15896
|
|
|
15875
|
-
function Thumb({
|
|
15876
|
-
|
|
15877
|
-
|
|
15878
|
-
|
|
15879
|
-
|
|
15897
|
+
function Thumb(_ref) {
|
|
15898
|
+
let {
|
|
15899
|
+
swiper,
|
|
15900
|
+
extendParams,
|
|
15901
|
+
on
|
|
15902
|
+
} = _ref;
|
|
15880
15903
|
extendParams({
|
|
15881
15904
|
thumbs: {
|
|
15882
15905
|
swiper: null,
|
|
@@ -15891,11 +15914,6 @@ function Thumb({
|
|
|
15891
15914
|
swiper.thumbs = {
|
|
15892
15915
|
swiper: null
|
|
15893
15916
|
};
|
|
15894
|
-
function isVirtualEnabled() {
|
|
15895
|
-
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15896
|
-
if (!thumbsSwiper || thumbsSwiper.destroyed) return false;
|
|
15897
|
-
return thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled;
|
|
15898
|
-
}
|
|
15899
15917
|
function onThumbClick() {
|
|
15900
15918
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15901
15919
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
@@ -15923,10 +15941,6 @@ function Thumb({
|
|
|
15923
15941
|
initialized = true;
|
|
15924
15942
|
const SwiperClass = swiper.constructor;
|
|
15925
15943
|
if (thumbsParams.swiper instanceof SwiperClass) {
|
|
15926
|
-
if (thumbsParams.swiper.destroyed) {
|
|
15927
|
-
initialized = false;
|
|
15928
|
-
return false;
|
|
15929
|
-
}
|
|
15930
15944
|
swiper.thumbs.swiper = thumbsParams.swiper;
|
|
15931
15945
|
Object.assign(swiper.thumbs.swiper.originalParams, {
|
|
15932
15946
|
watchSlidesProgress: true,
|
|
@@ -15948,18 +15962,12 @@ function Thumb({
|
|
|
15948
15962
|
}
|
|
15949
15963
|
swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
|
|
15950
15964
|
swiper.thumbs.swiper.on('tap', onThumbClick);
|
|
15951
|
-
if (isVirtualEnabled()) {
|
|
15952
|
-
swiper.thumbs.swiper.on('virtualUpdate', () => {
|
|
15953
|
-
update(false, {
|
|
15954
|
-
autoScroll: false
|
|
15955
|
-
});
|
|
15956
|
-
});
|
|
15957
|
-
}
|
|
15958
15965
|
return true;
|
|
15959
15966
|
}
|
|
15960
|
-
function update(initial
|
|
15967
|
+
function update(initial) {
|
|
15961
15968
|
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15962
15969
|
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15970
|
+
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15963
15971
|
|
|
15964
15972
|
// Activate thumbs
|
|
15965
15973
|
let thumbsToActivate = 1;
|
|
@@ -15972,7 +15980,7 @@ function Thumb({
|
|
|
15972
15980
|
}
|
|
15973
15981
|
thumbsToActivate = Math.floor(thumbsToActivate);
|
|
15974
15982
|
thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
|
|
15975
|
-
if (thumbsSwiper.params.loop ||
|
|
15983
|
+
if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
|
|
15976
15984
|
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
15977
15985
|
elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
|
|
15978
15986
|
slideEl.classList.add(thumbActiveClass);
|
|
@@ -15985,14 +15993,6 @@ function Thumb({
|
|
|
15985
15993
|
}
|
|
15986
15994
|
}
|
|
15987
15995
|
}
|
|
15988
|
-
if (p?.autoScroll ?? true) {
|
|
15989
|
-
autoScroll(initial ? 0 : undefined);
|
|
15990
|
-
}
|
|
15991
|
-
}
|
|
15992
|
-
function autoScroll(slideSpeed) {
|
|
15993
|
-
const thumbsSwiper = swiper.thumbs.swiper;
|
|
15994
|
-
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
15995
|
-
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
15996
15996
|
const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
|
|
15997
15997
|
const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
|
|
15998
15998
|
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
|
|
@@ -16000,7 +16000,7 @@ function Thumb({
|
|
|
16000
16000
|
let newThumbsIndex;
|
|
16001
16001
|
let direction;
|
|
16002
16002
|
if (thumbsSwiper.params.loop) {
|
|
16003
|
-
const newThumbsSlide = thumbsSwiper.slides.
|
|
16003
|
+
const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];
|
|
16004
16004
|
newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
|
|
16005
16005
|
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
16006
16006
|
} else {
|
|
@@ -16018,7 +16018,7 @@ function Thumb({
|
|
|
16018
16018
|
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
|
16019
16019
|
}
|
|
16020
16020
|
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
|
|
16021
|
-
thumbsSwiper.slideTo(newThumbsIndex,
|
|
16021
|
+
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
|
|
16022
16022
|
}
|
|
16023
16023
|
}
|
|
16024
16024
|
}
|
|
@@ -16036,16 +16036,15 @@ function Thumb({
|
|
|
16036
16036
|
init();
|
|
16037
16037
|
update(true);
|
|
16038
16038
|
} else if (thumbsElement) {
|
|
16039
|
-
const eventName = `${swiper.params.eventsPrefix}init`;
|
|
16040
16039
|
const onThumbsSwiper = e => {
|
|
16041
16040
|
thumbs.swiper = e.detail[0];
|
|
16042
|
-
thumbsElement.removeEventListener(
|
|
16041
|
+
thumbsElement.removeEventListener('init', onThumbsSwiper);
|
|
16043
16042
|
init();
|
|
16044
16043
|
update(true);
|
|
16045
16044
|
thumbs.swiper.update();
|
|
16046
16045
|
swiper.update();
|
|
16047
16046
|
};
|
|
16048
|
-
thumbsElement.addEventListener(
|
|
16047
|
+
thumbsElement.addEventListener('init', onThumbsSwiper);
|
|
16049
16048
|
}
|
|
16050
16049
|
return thumbsElement;
|
|
16051
16050
|
};
|