@content-blocks/js 0.7.1 → 0.7.3
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/cjs/content-accordion_11.cjs.entry.js +69 -1556
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +1 -1
- package/dist/cjs/content-carousel.cjs.entry.js +6 -5
- package/dist/cjs/content-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js +43 -26
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- package/dist/cjs/content-split-block.cjs.entry.js +2 -2
- package/dist/cjs/content-tabs.cjs.entry.js +2 -2
- package/dist/cjs/focus-trap.esm-a1e3774c.js +1509 -0
- package/dist/cjs/focus-trap.esm-a1e3774c.js.map +1 -0
- package/dist/cjs/index-f38d389e.js +5224 -0
- package/dist/cjs/index-f38d389e.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{swiper-4fade542.js → swiper-e5a68ae2.js} +68 -469
- package/dist/cjs/swiper-e5a68ae2.js.map +1 -0
- package/dist/cjs/utils-c04e978e.js +457 -0
- package/dist/cjs/utils-c04e978e.js.map +1 -0
- package/dist/cjs/{utils-db61cd70.js → utils-f8ccab0a.js} +35 -29
- package/dist/cjs/utils-f8ccab0a.js.map +1 -0
- package/dist/cjs/{window-resize-service-ac5c2012.js → window-resize-service-bc8cf256.js} +2 -2
- package/dist/cjs/{window-resize-service-ac5c2012.js.map → window-resize-service-bc8cf256.js.map} +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +1 -1
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +1 -1
- package/dist/collection/components/content-carousel/content-carousel.js +5 -4
- package/dist/collection/components/content-carousel/content-carousel.js.map +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +55 -14
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +51 -24
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
- package/dist/collection/components/content-overlay/content-overlay.css +23 -10
- package/dist/collection/components/content-overlay/content-overlay.js +100 -39
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
- package/dist/collection/elements/content-button/content-button.js +3 -3
- package/dist/collection/elements/content-button/content-button.js.map +1 -1
- package/dist/collection/elements/content-image/content-image.js +4 -4
- package/dist/collection/elements/content-image/content-image.js.map +1 -1
- package/dist/collection/elements/content-video/content-video.css +1 -19
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +5 -4
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +36 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.css +6 -4
- package/dist/collection/formatters/content-spacer/content-spacer.js +13 -5
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
- package/dist/collection/services/window-resize-service.js.map +1 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js +1 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js.map +1 -1
- package/dist/collection/stories/ContentTextBlock.stories.js +5 -5
- package/dist/collection/stories/ContentTextBlock.stories.js.map +1 -1
- package/dist/collection/stories/FullPageExample.stories.js +164 -214
- package/dist/collection/stories/FullPageExample.stories.js.map +1 -1
- package/dist/collection/utils/utils.js +31 -25
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/collection/utils/utils.spec.js +28 -3
- package/dist/collection/utils/utils.spec.js.map +1 -1
- package/dist/components/content-button.js +3 -3
- package/dist/components/content-button.js.map +1 -1
- package/dist/components/content-carousel.js +5 -4
- package/dist/components/content-carousel.js.map +1 -1
- package/dist/components/content-grid-formatter2.js +8 -1
- package/dist/components/content-grid-formatter2.js.map +1 -1
- package/dist/components/content-hero-block.js +1 -1
- package/dist/components/content-hero-block.js.map +1 -1
- package/dist/components/content-image.js +4 -4
- package/dist/components/content-image.js.map +1 -1
- package/dist/components/content-navigation-block.js +48 -25
- package/dist/components/content-navigation-block.js.map +1 -1
- package/dist/components/content-overlay.js +51 -1543
- package/dist/components/content-overlay.js.map +1 -1
- package/dist/components/content-spacer.js +3 -3
- package/dist/components/content-spacer.js.map +1 -1
- package/dist/components/content-tout-block.js +1 -1
- package/dist/components/content-tout-block.js.map +1 -1
- package/dist/components/content-video.js +1 -1
- package/dist/components/content-video.js.map +1 -1
- package/dist/components/focus-trap.esm.js +1507 -0
- package/dist/components/focus-trap.esm.js.map +1 -0
- package/dist/components/index2.js +5200 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/swiper.js +1 -402
- package/dist/components/swiper.js.map +1 -1
- package/dist/components/utils.js +34 -28
- package/dist/components/utils.js.map +1 -1
- package/dist/components/utils2.js +433 -0
- package/dist/components/utils2.js.map +1 -0
- package/dist/components/window-resize-service.js.map +1 -1
- package/dist/content-blocks/content-blocks.esm.js +1 -1
- package/dist/content-blocks/content-blocks.esm.js.map +1 -1
- package/dist/content-blocks/index.esm.js +1 -1
- package/dist/content-blocks/p-0131bfdf.entry.js +2 -0
- package/dist/content-blocks/p-0131bfdf.entry.js.map +1 -0
- package/dist/content-blocks/{p-4bfbd7ef.entry.js → p-1b448306.entry.js} +2 -2
- package/dist/content-blocks/p-39788531.entry.js +2 -0
- package/dist/content-blocks/p-39788531.entry.js.map +1 -0
- package/dist/content-blocks/{p-8cc22c1e.entry.js → p-3bd97960.entry.js} +2 -2
- package/dist/content-blocks/{p-cfb4593f.js → p-3fe594af.js} +2 -2
- package/dist/content-blocks/{p-cfb4593f.js.map → p-3fe594af.js.map} +1 -1
- package/dist/content-blocks/p-75ac85e9.js +2 -0
- package/dist/content-blocks/p-75ac85e9.js.map +1 -0
- package/dist/content-blocks/p-878dc806.js +10 -0
- package/dist/content-blocks/p-878dc806.js.map +1 -0
- package/dist/content-blocks/p-97c4ca9d.js +2 -0
- package/dist/content-blocks/p-97c4ca9d.js.map +1 -0
- package/dist/content-blocks/{p-271fb304.entry.js → p-cbc1dd73.entry.js} +2 -2
- package/dist/content-blocks/p-cbc1dd73.entry.js.map +1 -0
- package/dist/content-blocks/p-cc7397cf.js +2 -0
- package/dist/content-blocks/p-cc7397cf.js.map +1 -0
- package/dist/content-blocks/p-e2907508.js +2 -0
- package/dist/content-blocks/p-e2907508.js.map +1 -0
- package/dist/esm/content-accordion_11.entry.js +69 -1556
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +1 -1
- package/dist/esm/content-carousel.entry.js +6 -5
- package/dist/esm/content-carousel.entry.js.map +1 -1
- package/dist/esm/content-navigation-block.entry.js +43 -26
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- package/dist/esm/content-split-block.entry.js +2 -2
- package/dist/esm/content-tabs.entry.js +2 -2
- package/dist/esm/focus-trap.esm-49c9613c.js +1507 -0
- package/dist/esm/focus-trap.esm-49c9613c.js.map +1 -0
- package/dist/esm/index-d9f353de.js +5200 -0
- package/dist/esm/index-d9f353de.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{swiper-3e7be625.js → swiper-3394f7fd.js} +2 -403
- package/dist/esm/swiper-3394f7fd.js.map +1 -0
- package/dist/esm/utils-075121ec.js +433 -0
- package/dist/esm/utils-075121ec.js.map +1 -0
- package/dist/esm/{utils-4f78228e.js → utils-9a901aa9.js} +35 -29
- package/dist/esm/utils-9a901aa9.js.map +1 -0
- package/dist/esm/{window-resize-service-f40ec51c.js → window-resize-service-a6537000.js} +2 -2
- package/dist/esm/{window-resize-service-f40ec51c.js.map → window-resize-service-a6537000.js.map} +1 -1
- package/dist/types/components/content-carousel/content-carousel.d.ts +3 -3
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +11 -0
- package/dist/types/components/content-overlay/content-overlay.d.ts +11 -0
- package/dist/types/components.d.ts +34 -2
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +8 -1
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +2 -1
- package/dist/types/stories/ContentNavigationBlock.stories.d.ts +1 -3
- package/dist/types/stories/ContentTextBlock.stories.d.ts +1 -7
- package/dist/types/utils/utils.d.ts +8 -3
- package/package.json +2 -2
- package/dist/cjs/swiper-4fade542.js.map +0 -1
- package/dist/cjs/utils-db61cd70.js.map +0 -1
- package/dist/content-blocks/p-10819bfa.js +0 -2
- package/dist/content-blocks/p-10819bfa.js.map +0 -1
- package/dist/content-blocks/p-24657e66.entry.js +0 -10
- package/dist/content-blocks/p-24657e66.entry.js.map +0 -1
- package/dist/content-blocks/p-271fb304.entry.js.map +0 -1
- package/dist/content-blocks/p-6a177aef.entry.js +0 -2
- package/dist/content-blocks/p-6a177aef.entry.js.map +0 -1
- package/dist/content-blocks/p-b04fe808.js +0 -2
- package/dist/content-blocks/p-b04fe808.js.map +0 -1
- package/dist/esm/swiper-3e7be625.js.map +0 -1
- package/dist/esm/utils-4f78228e.js.map +0 -1
- /package/dist/content-blocks/{p-4bfbd7ef.entry.js.map → p-1b448306.entry.js.map} +0 -0
- /package/dist/content-blocks/{p-8cc22c1e.entry.js.map → p-3bd97960.entry.js.map} +0 -0
|
@@ -1,412 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* SSR Window 4.0.2
|
|
5
|
-
* Better handling for window object in SSR environment
|
|
6
|
-
* https://github.com/nolimits4web/ssr-window
|
|
7
|
-
*
|
|
8
|
-
* Copyright 2021, Vladimir Kharlampidi
|
|
9
|
-
*
|
|
10
|
-
* Licensed under MIT
|
|
11
|
-
*
|
|
12
|
-
* Released on: December 13, 2021
|
|
13
|
-
*/
|
|
14
|
-
/* eslint-disable no-param-reassign */
|
|
15
|
-
function isObject$1(obj) {
|
|
16
|
-
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
17
|
-
}
|
|
18
|
-
function extend$1(target, src) {
|
|
19
|
-
if (target === void 0) {
|
|
20
|
-
target = {};
|
|
21
|
-
}
|
|
22
|
-
if (src === void 0) {
|
|
23
|
-
src = {};
|
|
24
|
-
}
|
|
25
|
-
Object.keys(src).forEach(key => {
|
|
26
|
-
if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) {
|
|
27
|
-
extend$1(target[key], src[key]);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const ssrDocument = {
|
|
32
|
-
body: {},
|
|
33
|
-
addEventListener() {},
|
|
34
|
-
removeEventListener() {},
|
|
35
|
-
activeElement: {
|
|
36
|
-
blur() {},
|
|
37
|
-
nodeName: ''
|
|
38
|
-
},
|
|
39
|
-
querySelector() {
|
|
40
|
-
return null;
|
|
41
|
-
},
|
|
42
|
-
querySelectorAll() {
|
|
43
|
-
return [];
|
|
44
|
-
},
|
|
45
|
-
getElementById() {
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
createEvent() {
|
|
49
|
-
return {
|
|
50
|
-
initEvent() {}
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
createElement() {
|
|
54
|
-
return {
|
|
55
|
-
children: [],
|
|
56
|
-
childNodes: [],
|
|
57
|
-
style: {},
|
|
58
|
-
setAttribute() {},
|
|
59
|
-
getElementsByTagName() {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
createElementNS() {
|
|
65
|
-
return {};
|
|
66
|
-
},
|
|
67
|
-
importNode() {
|
|
68
|
-
return null;
|
|
69
|
-
},
|
|
70
|
-
location: {
|
|
71
|
-
hash: '',
|
|
72
|
-
host: '',
|
|
73
|
-
hostname: '',
|
|
74
|
-
href: '',
|
|
75
|
-
origin: '',
|
|
76
|
-
pathname: '',
|
|
77
|
-
protocol: '',
|
|
78
|
-
search: ''
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
function getDocument() {
|
|
82
|
-
const doc = typeof document !== 'undefined' ? document : {};
|
|
83
|
-
extend$1(doc, ssrDocument);
|
|
84
|
-
return doc;
|
|
85
|
-
}
|
|
86
|
-
const ssrWindow = {
|
|
87
|
-
document: ssrDocument,
|
|
88
|
-
navigator: {
|
|
89
|
-
userAgent: ''
|
|
90
|
-
},
|
|
91
|
-
location: {
|
|
92
|
-
hash: '',
|
|
93
|
-
host: '',
|
|
94
|
-
hostname: '',
|
|
95
|
-
href: '',
|
|
96
|
-
origin: '',
|
|
97
|
-
pathname: '',
|
|
98
|
-
protocol: '',
|
|
99
|
-
search: ''
|
|
100
|
-
},
|
|
101
|
-
history: {
|
|
102
|
-
replaceState() {},
|
|
103
|
-
pushState() {},
|
|
104
|
-
go() {},
|
|
105
|
-
back() {}
|
|
106
|
-
},
|
|
107
|
-
CustomEvent: function CustomEvent() {
|
|
108
|
-
return this;
|
|
109
|
-
},
|
|
110
|
-
addEventListener() {},
|
|
111
|
-
removeEventListener() {},
|
|
112
|
-
getComputedStyle() {
|
|
113
|
-
return {
|
|
114
|
-
getPropertyValue() {
|
|
115
|
-
return '';
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
Image() {},
|
|
120
|
-
Date() {},
|
|
121
|
-
screen: {},
|
|
122
|
-
setTimeout() {},
|
|
123
|
-
clearTimeout() {},
|
|
124
|
-
matchMedia() {
|
|
125
|
-
return {};
|
|
126
|
-
},
|
|
127
|
-
requestAnimationFrame(callback) {
|
|
128
|
-
if (typeof setTimeout === 'undefined') {
|
|
129
|
-
callback();
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
return setTimeout(callback, 0);
|
|
133
|
-
},
|
|
134
|
-
cancelAnimationFrame(id) {
|
|
135
|
-
if (typeof setTimeout === 'undefined') {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
clearTimeout(id);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
function getWindow() {
|
|
142
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
143
|
-
extend$1(win, ssrWindow);
|
|
144
|
-
return win;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function classesToTokens(classes) {
|
|
148
|
-
if (classes === void 0) {
|
|
149
|
-
classes = '';
|
|
150
|
-
}
|
|
151
|
-
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function deleteProps(obj) {
|
|
155
|
-
const object = obj;
|
|
156
|
-
Object.keys(object).forEach(key => {
|
|
157
|
-
try {
|
|
158
|
-
object[key] = null;
|
|
159
|
-
} catch (e) {
|
|
160
|
-
// no getter for object
|
|
161
|
-
}
|
|
162
|
-
try {
|
|
163
|
-
delete object[key];
|
|
164
|
-
} catch (e) {
|
|
165
|
-
// something got wrong
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
function nextTick(callback, delay) {
|
|
170
|
-
if (delay === void 0) {
|
|
171
|
-
delay = 0;
|
|
172
|
-
}
|
|
173
|
-
return setTimeout(callback, delay);
|
|
174
|
-
}
|
|
175
|
-
function now() {
|
|
176
|
-
return Date.now();
|
|
177
|
-
}
|
|
178
|
-
function getComputedStyle$1(el) {
|
|
179
|
-
const window = getWindow();
|
|
180
|
-
let style;
|
|
181
|
-
if (window.getComputedStyle) {
|
|
182
|
-
style = window.getComputedStyle(el, null);
|
|
183
|
-
}
|
|
184
|
-
if (!style && el.currentStyle) {
|
|
185
|
-
style = el.currentStyle;
|
|
186
|
-
}
|
|
187
|
-
if (!style) {
|
|
188
|
-
style = el.style;
|
|
189
|
-
}
|
|
190
|
-
return style;
|
|
191
|
-
}
|
|
192
|
-
function getTranslate(el, axis) {
|
|
193
|
-
if (axis === void 0) {
|
|
194
|
-
axis = 'x';
|
|
195
|
-
}
|
|
196
|
-
const window = getWindow();
|
|
197
|
-
let matrix;
|
|
198
|
-
let curTransform;
|
|
199
|
-
let transformMatrix;
|
|
200
|
-
const curStyle = getComputedStyle$1(el);
|
|
201
|
-
if (window.WebKitCSSMatrix) {
|
|
202
|
-
curTransform = curStyle.transform || curStyle.webkitTransform;
|
|
203
|
-
if (curTransform.split(',').length > 6) {
|
|
204
|
-
curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
|
|
205
|
-
}
|
|
206
|
-
// Some old versions of Webkit choke when 'none' is passed; pass
|
|
207
|
-
// empty string instead in this case
|
|
208
|
-
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
|
209
|
-
} else {
|
|
210
|
-
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
|
211
|
-
matrix = transformMatrix.toString().split(',');
|
|
212
|
-
}
|
|
213
|
-
if (axis === 'x') {
|
|
214
|
-
// Latest Chrome and webkits Fix
|
|
215
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
|
|
216
|
-
// Crazy IE10 Matrix
|
|
217
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
|
|
218
|
-
// Normal Browsers
|
|
219
|
-
else curTransform = parseFloat(matrix[4]);
|
|
220
|
-
}
|
|
221
|
-
if (axis === 'y') {
|
|
222
|
-
// Latest Chrome and webkits Fix
|
|
223
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
|
|
224
|
-
// Crazy IE10 Matrix
|
|
225
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
|
|
226
|
-
// Normal Browsers
|
|
227
|
-
else curTransform = parseFloat(matrix[5]);
|
|
228
|
-
}
|
|
229
|
-
return curTransform || 0;
|
|
230
|
-
}
|
|
231
|
-
function isObject(o) {
|
|
232
|
-
return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
|
|
233
|
-
}
|
|
234
|
-
function isNode(node) {
|
|
235
|
-
// eslint-disable-next-line
|
|
236
|
-
if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
|
|
237
|
-
return node instanceof HTMLElement;
|
|
238
|
-
}
|
|
239
|
-
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
240
|
-
}
|
|
241
|
-
function extend() {
|
|
242
|
-
const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
|
|
243
|
-
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
244
|
-
for (let i = 1; i < arguments.length; i += 1) {
|
|
245
|
-
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
246
|
-
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
247
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
|
|
248
|
-
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
249
|
-
const nextKey = keysArray[nextIndex];
|
|
250
|
-
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
251
|
-
if (desc !== undefined && desc.enumerable) {
|
|
252
|
-
if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
253
|
-
if (nextSource[nextKey].__swiper__) {
|
|
254
|
-
to[nextKey] = nextSource[nextKey];
|
|
255
|
-
} else {
|
|
256
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
257
|
-
}
|
|
258
|
-
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
259
|
-
to[nextKey] = {};
|
|
260
|
-
if (nextSource[nextKey].__swiper__) {
|
|
261
|
-
to[nextKey] = nextSource[nextKey];
|
|
262
|
-
} else {
|
|
263
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
to[nextKey] = nextSource[nextKey];
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return to;
|
|
273
|
-
}
|
|
274
|
-
function setCSSProperty(el, varName, varValue) {
|
|
275
|
-
el.style.setProperty(varName, varValue);
|
|
276
|
-
}
|
|
277
|
-
function animateCSSModeScroll(_ref) {
|
|
278
|
-
let {
|
|
279
|
-
swiper,
|
|
280
|
-
targetPosition,
|
|
281
|
-
side
|
|
282
|
-
} = _ref;
|
|
283
|
-
const window = getWindow();
|
|
284
|
-
const startPosition = -swiper.translate;
|
|
285
|
-
let startTime = null;
|
|
286
|
-
let time;
|
|
287
|
-
const duration = swiper.params.speed;
|
|
288
|
-
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
289
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
290
|
-
const dir = targetPosition > startPosition ? 'next' : 'prev';
|
|
291
|
-
const isOutOfBound = (current, target) => {
|
|
292
|
-
return dir === 'next' && current >= target || dir === 'prev' && current <= target;
|
|
293
|
-
};
|
|
294
|
-
const animate = () => {
|
|
295
|
-
time = new Date().getTime();
|
|
296
|
-
if (startTime === null) {
|
|
297
|
-
startTime = time;
|
|
298
|
-
}
|
|
299
|
-
const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
|
|
300
|
-
const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
|
|
301
|
-
let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
|
|
302
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
303
|
-
currentPosition = targetPosition;
|
|
304
|
-
}
|
|
305
|
-
swiper.wrapperEl.scrollTo({
|
|
306
|
-
[side]: currentPosition
|
|
307
|
-
});
|
|
308
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
309
|
-
swiper.wrapperEl.style.overflow = 'hidden';
|
|
310
|
-
swiper.wrapperEl.style.scrollSnapType = '';
|
|
311
|
-
setTimeout(() => {
|
|
312
|
-
swiper.wrapperEl.style.overflow = '';
|
|
313
|
-
swiper.wrapperEl.scrollTo({
|
|
314
|
-
[side]: currentPosition
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
swiper.cssModeFrameID = window.requestAnimationFrame(animate);
|
|
321
|
-
};
|
|
322
|
-
animate();
|
|
323
|
-
}
|
|
324
|
-
function elementChildren(element, selector) {
|
|
325
|
-
if (selector === void 0) {
|
|
326
|
-
selector = '';
|
|
327
|
-
}
|
|
328
|
-
return [...element.children].filter(el => el.matches(selector));
|
|
329
|
-
}
|
|
330
|
-
function showWarning(text) {
|
|
331
|
-
try {
|
|
332
|
-
console.warn(text);
|
|
333
|
-
return;
|
|
334
|
-
} catch (err) {
|
|
335
|
-
// err
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
function createElement(tag, classes) {
|
|
339
|
-
if (classes === void 0) {
|
|
340
|
-
classes = [];
|
|
341
|
-
}
|
|
342
|
-
const el = document.createElement(tag);
|
|
343
|
-
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
344
|
-
return el;
|
|
345
|
-
}
|
|
346
|
-
function elementPrevAll(el, selector) {
|
|
347
|
-
const prevEls = [];
|
|
348
|
-
while (el.previousElementSibling) {
|
|
349
|
-
const prev = el.previousElementSibling; // eslint-disable-line
|
|
350
|
-
if (selector) {
|
|
351
|
-
if (prev.matches(selector)) prevEls.push(prev);
|
|
352
|
-
} else prevEls.push(prev);
|
|
353
|
-
el = prev;
|
|
354
|
-
}
|
|
355
|
-
return prevEls;
|
|
356
|
-
}
|
|
357
|
-
function elementNextAll(el, selector) {
|
|
358
|
-
const nextEls = [];
|
|
359
|
-
while (el.nextElementSibling) {
|
|
360
|
-
const next = el.nextElementSibling; // eslint-disable-line
|
|
361
|
-
if (selector) {
|
|
362
|
-
if (next.matches(selector)) nextEls.push(next);
|
|
363
|
-
} else nextEls.push(next);
|
|
364
|
-
el = next;
|
|
365
|
-
}
|
|
366
|
-
return nextEls;
|
|
367
|
-
}
|
|
368
|
-
function elementStyle(el, prop) {
|
|
369
|
-
const window = getWindow();
|
|
370
|
-
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
|
371
|
-
}
|
|
372
|
-
function elementIndex(el) {
|
|
373
|
-
let child = el;
|
|
374
|
-
let i;
|
|
375
|
-
if (child) {
|
|
376
|
-
i = 0;
|
|
377
|
-
// eslint-disable-next-line
|
|
378
|
-
while ((child = child.previousSibling) !== null) {
|
|
379
|
-
if (child.nodeType === 1) i += 1;
|
|
380
|
-
}
|
|
381
|
-
return i;
|
|
382
|
-
}
|
|
383
|
-
return undefined;
|
|
384
|
-
}
|
|
385
|
-
function elementParents(el, selector) {
|
|
386
|
-
const parents = []; // eslint-disable-line
|
|
387
|
-
let parent = el.parentElement; // eslint-disable-line
|
|
388
|
-
while (parent) {
|
|
389
|
-
if (selector) {
|
|
390
|
-
if (parent.matches(selector)) parents.push(parent);
|
|
391
|
-
} else {
|
|
392
|
-
parents.push(parent);
|
|
393
|
-
}
|
|
394
|
-
parent = parent.parentElement;
|
|
395
|
-
}
|
|
396
|
-
return parents;
|
|
397
|
-
}
|
|
398
|
-
function elementOuterSize(el, size, includeMargins) {
|
|
399
|
-
const window = getWindow();
|
|
400
|
-
if (includeMargins) {
|
|
401
|
-
return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));
|
|
402
|
-
}
|
|
403
|
-
return el.offsetWidth;
|
|
404
|
-
}
|
|
3
|
+
const utils = require('./utils-c04e978e.js');
|
|
405
4
|
|
|
406
5
|
let support;
|
|
407
6
|
function calcSupport() {
|
|
408
|
-
const window = getWindow();
|
|
409
|
-
const document = getDocument();
|
|
7
|
+
const window = utils.getWindow();
|
|
8
|
+
const document = utils.getDocument();
|
|
410
9
|
return {
|
|
411
10
|
smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,
|
|
412
11
|
touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)
|
|
@@ -425,7 +24,7 @@ function calcDevice(_temp) {
|
|
|
425
24
|
userAgent
|
|
426
25
|
} = _temp === void 0 ? {} : _temp;
|
|
427
26
|
const support = getSupport();
|
|
428
|
-
const window = getWindow();
|
|
27
|
+
const window = utils.getWindow();
|
|
429
28
|
const platform = window.navigator.platform;
|
|
430
29
|
const ua = userAgent || window.navigator.userAgent;
|
|
431
30
|
const device = {
|
|
@@ -474,7 +73,7 @@ function getDevice(overrides) {
|
|
|
474
73
|
|
|
475
74
|
let browser;
|
|
476
75
|
function calcBrowser() {
|
|
477
|
-
const window = getWindow();
|
|
76
|
+
const window = utils.getWindow();
|
|
478
77
|
let needPerspectiveFix = false;
|
|
479
78
|
function isSafari() {
|
|
480
79
|
const ua = window.navigator.userAgent.toLowerCase();
|
|
@@ -506,7 +105,7 @@ function Resize(_ref) {
|
|
|
506
105
|
on,
|
|
507
106
|
emit
|
|
508
107
|
} = _ref;
|
|
509
|
-
const window = getWindow();
|
|
108
|
+
const window = utils.getWindow();
|
|
510
109
|
let observer = null;
|
|
511
110
|
let animationFrame = null;
|
|
512
111
|
const resizeHandler = () => {
|
|
@@ -577,7 +176,7 @@ function Observer(_ref) {
|
|
|
577
176
|
emit
|
|
578
177
|
} = _ref;
|
|
579
178
|
const observers = [];
|
|
580
|
-
const window = getWindow();
|
|
179
|
+
const window = utils.getWindow();
|
|
581
180
|
const attach = function (target, options) {
|
|
582
181
|
if (options === void 0) {
|
|
583
182
|
options = {};
|
|
@@ -611,7 +210,7 @@ function Observer(_ref) {
|
|
|
611
210
|
const init = () => {
|
|
612
211
|
if (!swiper.params.observer) return;
|
|
613
212
|
if (swiper.params.observeParents) {
|
|
614
|
-
const containerParents = elementParents(swiper.hostEl);
|
|
213
|
+
const containerParents = utils.elementParents(swiper.hostEl);
|
|
615
214
|
for (let i = 0; i < containerParents.length; i += 1) {
|
|
616
215
|
attach(containerParents[i]);
|
|
617
216
|
}
|
|
@@ -766,8 +365,8 @@ function updateSize() {
|
|
|
766
365
|
}
|
|
767
366
|
|
|
768
367
|
// Subtract paddings
|
|
769
|
-
width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10);
|
|
770
|
-
height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10);
|
|
368
|
+
width = width - parseInt(utils.elementStyle(el, 'padding-left') || 0, 10) - parseInt(utils.elementStyle(el, 'padding-right') || 0, 10);
|
|
369
|
+
height = height - parseInt(utils.elementStyle(el, 'padding-top') || 0, 10) - parseInt(utils.elementStyle(el, 'padding-bottom') || 0, 10);
|
|
771
370
|
if (Number.isNaN(width)) width = 0;
|
|
772
371
|
if (Number.isNaN(height)) height = 0;
|
|
773
372
|
Object.assign(swiper, {
|
|
@@ -792,7 +391,7 @@ function updateSlides() {
|
|
|
792
391
|
} = swiper;
|
|
793
392
|
const isVirtual = swiper.virtual && params.virtual.enabled;
|
|
794
393
|
const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
|
|
795
|
-
const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
|
|
394
|
+
const slides = utils.elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
|
|
796
395
|
const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
|
|
797
396
|
let snapGrid = [];
|
|
798
397
|
const slidesGrid = [];
|
|
@@ -834,8 +433,8 @@ function updateSlides() {
|
|
|
834
433
|
|
|
835
434
|
// reset cssMode offsets
|
|
836
435
|
if (params.centeredSlides && params.cssMode) {
|
|
837
|
-
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
838
|
-
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
436
|
+
utils.setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
437
|
+
utils.setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
839
438
|
}
|
|
840
439
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
841
440
|
if (gridEnabled) {
|
|
@@ -856,7 +455,7 @@ function updateSlides() {
|
|
|
856
455
|
if (gridEnabled) {
|
|
857
456
|
swiper.grid.updateSlide(i, slide, slides);
|
|
858
457
|
}
|
|
859
|
-
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
458
|
+
if (slides[i] && utils.elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
860
459
|
|
|
861
460
|
if (params.slidesPerView === 'auto') {
|
|
862
461
|
if (shouldResetSlideSize) {
|
|
@@ -872,7 +471,7 @@ function updateSlides() {
|
|
|
872
471
|
slide.style.webkitTransform = 'none';
|
|
873
472
|
}
|
|
874
473
|
if (params.roundLengths) {
|
|
875
|
-
slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width', true) : elementOuterSize(slide, 'height', true);
|
|
474
|
+
slideSize = swiper.isHorizontal() ? utils.elementOuterSize(slide, 'width', true) : utils.elementOuterSize(slide, 'height', true);
|
|
876
475
|
} else {
|
|
877
476
|
// eslint-disable-next-line
|
|
878
477
|
const width = getDirectionPropertyValue(slideStyles, 'width');
|
|
@@ -1019,8 +618,8 @@ function updateSlides() {
|
|
|
1019
618
|
slidesSizesGrid
|
|
1020
619
|
});
|
|
1021
620
|
if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
|
|
1022
|
-
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
|
|
1023
|
-
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
|
|
621
|
+
utils.setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
|
|
622
|
+
utils.setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
|
|
1024
623
|
const addToSnapGrid = -swiper.snapGrid[0];
|
|
1025
624
|
const addToSlidesGrid = -swiper.slidesGrid[0];
|
|
1026
625
|
swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
|
|
@@ -1234,7 +833,7 @@ function updateSlidesClasses() {
|
|
|
1234
833
|
const isVirtual = swiper.virtual && params.virtual.enabled;
|
|
1235
834
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
1236
835
|
const getFilteredSlide = selector => {
|
|
1237
|
-
return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
|
|
836
|
+
return utils.elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
|
|
1238
837
|
};
|
|
1239
838
|
slides.forEach(slideEl => {
|
|
1240
839
|
slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
|
|
@@ -1272,7 +871,7 @@ function updateSlidesClasses() {
|
|
|
1272
871
|
}
|
|
1273
872
|
} else {
|
|
1274
873
|
// Next Slide
|
|
1275
|
-
nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
874
|
+
nextSlide = utils.elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
1276
875
|
if (params.loop && !nextSlide) {
|
|
1277
876
|
nextSlide = slides[0];
|
|
1278
877
|
}
|
|
@@ -1281,7 +880,7 @@ function updateSlidesClasses() {
|
|
|
1281
880
|
}
|
|
1282
881
|
|
|
1283
882
|
// Prev Slide
|
|
1284
|
-
prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
883
|
+
prevSlide = utils.elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
1285
884
|
if (params.loop && !prevSlide === 0) {
|
|
1286
885
|
prevSlide = slides[slides.length - 1];
|
|
1287
886
|
}
|
|
@@ -1535,7 +1134,7 @@ function getSwiperTranslate(axis) {
|
|
|
1535
1134
|
if (params.cssMode) {
|
|
1536
1135
|
return translate;
|
|
1537
1136
|
}
|
|
1538
|
-
let currentTranslate = getTranslate(wrapperEl, axis);
|
|
1137
|
+
let currentTranslate = utils.getTranslate(wrapperEl, axis);
|
|
1539
1138
|
currentTranslate += swiper.cssOverflowAdjustment();
|
|
1540
1139
|
if (rtl) currentTranslate = -currentTranslate;
|
|
1541
1140
|
return currentTranslate || 0;
|
|
@@ -1630,7 +1229,7 @@ function translateTo(translate, speed, runCallbacks, translateBounds, internal)
|
|
|
1630
1229
|
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
|
1631
1230
|
} else {
|
|
1632
1231
|
if (!swiper.support.smoothScroll) {
|
|
1633
|
-
animateCSSModeScroll({
|
|
1232
|
+
utils.animateCSSModeScroll({
|
|
1634
1233
|
swiper,
|
|
1635
1234
|
targetPosition: -newTranslate,
|
|
1636
1235
|
side: isH ? 'left' : 'top'
|
|
@@ -1882,7 +1481,7 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
1882
1481
|
}
|
|
1883
1482
|
} else {
|
|
1884
1483
|
if (!swiper.support.smoothScroll) {
|
|
1885
|
-
animateCSSModeScroll({
|
|
1484
|
+
utils.animateCSSModeScroll({
|
|
1886
1485
|
swiper,
|
|
1887
1486
|
targetPosition: t,
|
|
1888
1487
|
side: isH ? 'left' : 'top'
|
|
@@ -2165,8 +1764,8 @@ function slideToClickedSlide() {
|
|
|
2165
1764
|
if (params.centeredSlides) {
|
|
2166
1765
|
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
|
|
2167
1766
|
swiper.loopFix();
|
|
2168
|
-
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
2169
|
-
nextTick(() => {
|
|
1767
|
+
slideToIndex = swiper.getSlideIndex(utils.elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
1768
|
+
utils.nextTick(() => {
|
|
2170
1769
|
swiper.slideTo(slideToIndex);
|
|
2171
1770
|
});
|
|
2172
1771
|
} else {
|
|
@@ -2174,8 +1773,8 @@ function slideToClickedSlide() {
|
|
|
2174
1773
|
}
|
|
2175
1774
|
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
2176
1775
|
swiper.loopFix();
|
|
2177
|
-
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
2178
|
-
nextTick(() => {
|
|
1776
|
+
slideToIndex = swiper.getSlideIndex(utils.elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
1777
|
+
utils.nextTick(() => {
|
|
2179
1778
|
swiper.slideTo(slideToIndex);
|
|
2180
1779
|
});
|
|
2181
1780
|
} else {
|
|
@@ -2204,7 +1803,7 @@ function loopCreate(slideRealIndex) {
|
|
|
2204
1803
|
} = swiper;
|
|
2205
1804
|
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
2206
1805
|
const initSlides = () => {
|
|
2207
|
-
const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
1806
|
+
const slides = utils.elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
2208
1807
|
slides.forEach((el, index) => {
|
|
2209
1808
|
el.setAttribute('data-swiper-slide-index', index);
|
|
2210
1809
|
});
|
|
@@ -2215,7 +1814,7 @@ function loopCreate(slideRealIndex) {
|
|
|
2215
1814
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
2216
1815
|
const addBlankSlides = amountOfSlides => {
|
|
2217
1816
|
for (let i = 0; i < amountOfSlides; i += 1) {
|
|
2218
|
-
const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]);
|
|
1817
|
+
const slideEl = swiper.isElement ? utils.createElement('swiper-slide', [params.slideBlankClass]) : utils.createElement('div', [params.slideClass, params.slideBlankClass]);
|
|
2219
1818
|
swiper.slidesEl.append(slideEl);
|
|
2220
1819
|
}
|
|
2221
1820
|
};
|
|
@@ -2226,7 +1825,7 @@ function loopCreate(slideRealIndex) {
|
|
|
2226
1825
|
swiper.recalcSlides();
|
|
2227
1826
|
swiper.updateSlides();
|
|
2228
1827
|
} else {
|
|
2229
|
-
showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
1828
|
+
utils.showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
2230
1829
|
}
|
|
2231
1830
|
initSlides();
|
|
2232
1831
|
} else if (shouldFillGrid) {
|
|
@@ -2236,7 +1835,7 @@ function loopCreate(slideRealIndex) {
|
|
|
2236
1835
|
swiper.recalcSlides();
|
|
2237
1836
|
swiper.updateSlides();
|
|
2238
1837
|
} else {
|
|
2239
|
-
showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
1838
|
+
utils.showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
|
|
2240
1839
|
}
|
|
2241
1840
|
initSlides();
|
|
2242
1841
|
} else {
|
|
@@ -2306,9 +1905,9 @@ function loopFix(_temp) {
|
|
|
2306
1905
|
swiper.loopedSlides = loopedSlides;
|
|
2307
1906
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
2308
1907
|
if (slides.length < slidesPerView + loopedSlides) {
|
|
2309
|
-
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');
|
|
1908
|
+
utils.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');
|
|
2310
1909
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
2311
|
-
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
1910
|
+
utils.showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
2312
1911
|
}
|
|
2313
1912
|
const prependSlidesIndexes = [];
|
|
2314
1913
|
const appendSlidesIndexes = [];
|
|
@@ -2525,7 +2124,7 @@ function closestElement(selector, base) {
|
|
|
2525
2124
|
base = this;
|
|
2526
2125
|
}
|
|
2527
2126
|
function __closestFrom(el) {
|
|
2528
|
-
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
2127
|
+
if (!el || el === utils.getDocument() || el === utils.getWindow()) return null;
|
|
2529
2128
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
2530
2129
|
const found = el.closest(selector);
|
|
2531
2130
|
if (!found && !el.getRootNode) {
|
|
@@ -2536,7 +2135,7 @@ function closestElement(selector, base) {
|
|
|
2536
2135
|
return __closestFrom(base);
|
|
2537
2136
|
}
|
|
2538
2137
|
function preventEdgeSwipe(swiper, event, startX) {
|
|
2539
|
-
const window = getWindow();
|
|
2138
|
+
const window = utils.getWindow();
|
|
2540
2139
|
const {
|
|
2541
2140
|
params
|
|
2542
2141
|
} = swiper;
|
|
@@ -2553,7 +2152,7 @@ function preventEdgeSwipe(swiper, event, startX) {
|
|
|
2553
2152
|
}
|
|
2554
2153
|
function onTouchStart(event) {
|
|
2555
2154
|
const swiper = this;
|
|
2556
|
-
const document = getDocument();
|
|
2155
|
+
const document = utils.getDocument();
|
|
2557
2156
|
let e = event;
|
|
2558
2157
|
if (e.originalEvent) e = e.originalEvent;
|
|
2559
2158
|
const data = swiper.touchEventsData;
|
|
@@ -2628,7 +2227,7 @@ function onTouchStart(event) {
|
|
|
2628
2227
|
});
|
|
2629
2228
|
touches.startX = startX;
|
|
2630
2229
|
touches.startY = startY;
|
|
2631
|
-
data.touchStartTime = now();
|
|
2230
|
+
data.touchStartTime = utils.now();
|
|
2632
2231
|
swiper.allowClick = true;
|
|
2633
2232
|
swiper.updateSize();
|
|
2634
2233
|
swiper.swipeDirection = undefined;
|
|
@@ -2654,7 +2253,7 @@ function onTouchStart(event) {
|
|
|
2654
2253
|
}
|
|
2655
2254
|
|
|
2656
2255
|
function onTouchMove(event) {
|
|
2657
|
-
const document = getDocument();
|
|
2256
|
+
const document = utils.getDocument();
|
|
2658
2257
|
const swiper = this;
|
|
2659
2258
|
const data = swiper.touchEventsData;
|
|
2660
2259
|
const {
|
|
@@ -2703,7 +2302,7 @@ function onTouchMove(event) {
|
|
|
2703
2302
|
currentX: pageX,
|
|
2704
2303
|
currentY: pageY
|
|
2705
2304
|
});
|
|
2706
|
-
data.touchStartTime = now();
|
|
2305
|
+
data.touchStartTime = utils.now();
|
|
2707
2306
|
}
|
|
2708
2307
|
return;
|
|
2709
2308
|
}
|
|
@@ -2958,7 +2557,7 @@ function onTouchEnd(event) {
|
|
|
2958
2557
|
}
|
|
2959
2558
|
|
|
2960
2559
|
// Time diff
|
|
2961
|
-
const touchEndTime = now();
|
|
2560
|
+
const touchEndTime = utils.now();
|
|
2962
2561
|
const timeDiff = touchEndTime - data.touchStartTime;
|
|
2963
2562
|
|
|
2964
2563
|
// Tap, doubleTap, Click
|
|
@@ -2970,8 +2569,8 @@ function onTouchEnd(event) {
|
|
|
2970
2569
|
swiper.emit('doubleTap doubleClick', e);
|
|
2971
2570
|
}
|
|
2972
2571
|
}
|
|
2973
|
-
data.lastClickTime = now();
|
|
2974
|
-
nextTick(() => {
|
|
2572
|
+
data.lastClickTime = utils.now();
|
|
2573
|
+
utils.nextTick(() => {
|
|
2975
2574
|
if (!swiper.destroyed) swiper.allowClick = true;
|
|
2976
2575
|
});
|
|
2977
2576
|
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) {
|
|
@@ -3182,7 +2781,7 @@ function onDocumentTouchStart() {
|
|
|
3182
2781
|
}
|
|
3183
2782
|
|
|
3184
2783
|
const events = (swiper, method) => {
|
|
3185
|
-
const document = getDocument();
|
|
2784
|
+
const document = utils.getDocument();
|
|
3186
2785
|
const {
|
|
3187
2786
|
params,
|
|
3188
2787
|
el,
|
|
@@ -3330,7 +2929,7 @@ function setBreakpoint() {
|
|
|
3330
2929
|
if (directionChanged && initialized) {
|
|
3331
2930
|
swiper.changeDirection();
|
|
3332
2931
|
}
|
|
3333
|
-
extend(swiper.params, breakpointParams);
|
|
2932
|
+
utils.extend(swiper.params, breakpointParams);
|
|
3334
2933
|
const isEnabled = swiper.params.enabled;
|
|
3335
2934
|
const hasLoop = swiper.params.loop;
|
|
3336
2935
|
Object.assign(swiper, {
|
|
@@ -3366,7 +2965,7 @@ function getBreakpoint(breakpoints, base, containerEl) {
|
|
|
3366
2965
|
}
|
|
3367
2966
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
3368
2967
|
let breakpoint = false;
|
|
3369
|
-
const window = getWindow();
|
|
2968
|
+
const window = utils.getWindow();
|
|
3370
2969
|
const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
|
|
3371
2970
|
const points = Object.keys(breakpoints).map(point => {
|
|
3372
2971
|
if (typeof point === 'string' && point.indexOf('@') === 0) {
|
|
@@ -3633,7 +3232,7 @@ function moduleExtendParams(params, allModulesParams) {
|
|
|
3633
3232
|
const moduleParamName = Object.keys(obj)[0];
|
|
3634
3233
|
const moduleParams = obj[moduleParamName];
|
|
3635
3234
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
3636
|
-
extend(allModulesParams, obj);
|
|
3235
|
+
utils.extend(allModulesParams, obj);
|
|
3637
3236
|
return;
|
|
3638
3237
|
}
|
|
3639
3238
|
if (params[moduleParamName] === true) {
|
|
@@ -3648,7 +3247,7 @@ function moduleExtendParams(params, allModulesParams) {
|
|
|
3648
3247
|
params[moduleParamName].auto = true;
|
|
3649
3248
|
}
|
|
3650
3249
|
if (!(moduleParamName in params && 'enabled' in moduleParams)) {
|
|
3651
|
-
extend(allModulesParams, obj);
|
|
3250
|
+
utils.extend(allModulesParams, obj);
|
|
3652
3251
|
return;
|
|
3653
3252
|
}
|
|
3654
3253
|
if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
|
|
@@ -3657,7 +3256,7 @@ function moduleExtendParams(params, allModulesParams) {
|
|
|
3657
3256
|
if (!params[moduleParamName]) params[moduleParamName] = {
|
|
3658
3257
|
enabled: false
|
|
3659
3258
|
};
|
|
3660
|
-
extend(allModulesParams, obj);
|
|
3259
|
+
utils.extend(allModulesParams, obj);
|
|
3661
3260
|
};
|
|
3662
3261
|
}
|
|
3663
3262
|
|
|
@@ -3689,13 +3288,13 @@ class Swiper {
|
|
|
3689
3288
|
[el, params] = args;
|
|
3690
3289
|
}
|
|
3691
3290
|
if (!params) params = {};
|
|
3692
|
-
params = extend({}, params);
|
|
3291
|
+
params = utils.extend({}, params);
|
|
3693
3292
|
if (el && !params.el) params.el = el;
|
|
3694
|
-
const document = getDocument();
|
|
3293
|
+
const document = utils.getDocument();
|
|
3695
3294
|
if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {
|
|
3696
3295
|
const swipers = [];
|
|
3697
3296
|
document.querySelectorAll(params.el).forEach(containerEl => {
|
|
3698
|
-
const newParams = extend({}, params, {
|
|
3297
|
+
const newParams = utils.extend({}, params, {
|
|
3699
3298
|
el: containerEl
|
|
3700
3299
|
});
|
|
3701
3300
|
swipers.push(new Swiper(newParams));
|
|
@@ -3732,12 +3331,12 @@ class Swiper {
|
|
|
3732
3331
|
});
|
|
3733
3332
|
|
|
3734
3333
|
// Extend defaults with modules params
|
|
3735
|
-
const swiperParams = extend({}, defaults, allModulesParams);
|
|
3334
|
+
const swiperParams = utils.extend({}, defaults, allModulesParams);
|
|
3736
3335
|
|
|
3737
3336
|
// Extend defaults with passed params
|
|
3738
|
-
swiper.params = extend({}, swiperParams, extendedDefaults, params);
|
|
3739
|
-
swiper.originalParams = extend({}, swiper.params);
|
|
3740
|
-
swiper.passedParams = extend({}, params);
|
|
3337
|
+
swiper.params = utils.extend({}, swiperParams, extendedDefaults, params);
|
|
3338
|
+
swiper.originalParams = utils.extend({}, swiper.params);
|
|
3339
|
+
swiper.passedParams = utils.extend({}, params);
|
|
3741
3340
|
|
|
3742
3341
|
// add event listeners
|
|
3743
3342
|
if (swiper.params && swiper.params.on) {
|
|
@@ -3856,9 +3455,9 @@ class Swiper {
|
|
|
3856
3455
|
slidesEl,
|
|
3857
3456
|
params
|
|
3858
3457
|
} = this;
|
|
3859
|
-
const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
3860
|
-
const firstSlideIndex = elementIndex(slides[0]);
|
|
3861
|
-
return elementIndex(slideEl) - firstSlideIndex;
|
|
3458
|
+
const slides = utils.elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
3459
|
+
const firstSlideIndex = utils.elementIndex(slides[0]);
|
|
3460
|
+
return utils.elementIndex(slideEl) - firstSlideIndex;
|
|
3862
3461
|
}
|
|
3863
3462
|
getSlideIndexByData(index) {
|
|
3864
3463
|
return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);
|
|
@@ -3869,7 +3468,7 @@ class Swiper {
|
|
|
3869
3468
|
slidesEl,
|
|
3870
3469
|
params
|
|
3871
3470
|
} = swiper;
|
|
3872
|
-
swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
3471
|
+
swiper.slides = utils.elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
|
|
3873
3472
|
}
|
|
3874
3473
|
enable() {
|
|
3875
3474
|
const swiper = this;
|
|
@@ -4100,14 +3699,14 @@ class Swiper {
|
|
|
4100
3699
|
// Children needs to return slot items
|
|
4101
3700
|
return res;
|
|
4102
3701
|
}
|
|
4103
|
-
return elementChildren(el, getWrapperSelector())[0];
|
|
3702
|
+
return utils.elementChildren(el, getWrapperSelector())[0];
|
|
4104
3703
|
};
|
|
4105
3704
|
// Find Wrapper
|
|
4106
3705
|
let wrapperEl = getWrapper();
|
|
4107
3706
|
if (!wrapperEl && swiper.params.createElements) {
|
|
4108
|
-
wrapperEl = createElement('div', swiper.params.wrapperClass);
|
|
3707
|
+
wrapperEl = utils.createElement('div', swiper.params.wrapperClass);
|
|
4109
3708
|
el.append(wrapperEl);
|
|
4110
|
-
elementChildren(el, `.${swiper.params.slideClass}`).forEach(slideEl => {
|
|
3709
|
+
utils.elementChildren(el, `.${swiper.params.slideClass}`).forEach(slideEl => {
|
|
4111
3710
|
wrapperEl.append(slideEl);
|
|
4112
3711
|
});
|
|
4113
3712
|
}
|
|
@@ -4118,9 +3717,9 @@ class Swiper {
|
|
|
4118
3717
|
hostEl: swiper.isElement ? el.parentNode.host : el,
|
|
4119
3718
|
mounted: true,
|
|
4120
3719
|
// RTL
|
|
4121
|
-
rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl',
|
|
4122
|
-
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'),
|
|
4123
|
-
wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box'
|
|
3720
|
+
rtl: el.dir.toLowerCase() === 'rtl' || utils.elementStyle(el, 'direction') === 'rtl',
|
|
3721
|
+
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || utils.elementStyle(el, 'direction') === 'rtl'),
|
|
3722
|
+
wrongRTL: utils.elementStyle(wrapperEl, 'display') === '-webkit-box'
|
|
4124
3723
|
});
|
|
4125
3724
|
return true;
|
|
4126
3725
|
}
|
|
@@ -4242,13 +3841,13 @@ class Swiper {
|
|
|
4242
3841
|
});
|
|
4243
3842
|
if (deleteInstance !== false) {
|
|
4244
3843
|
swiper.el.swiper = null;
|
|
4245
|
-
deleteProps(swiper);
|
|
3844
|
+
utils.deleteProps(swiper);
|
|
4246
3845
|
}
|
|
4247
3846
|
swiper.destroyed = true;
|
|
4248
3847
|
return null;
|
|
4249
3848
|
}
|
|
4250
3849
|
static extendDefaults(newDefaults) {
|
|
4251
|
-
extend(extendedDefaults, newDefaults);
|
|
3850
|
+
utils.extend(extendedDefaults, newDefaults);
|
|
4252
3851
|
}
|
|
4253
3852
|
static get extendedDefaults() {
|
|
4254
3853
|
return extendedDefaults;
|
|
@@ -4282,4 +3881,4 @@ Swiper.use([Resize, Observer]);
|
|
|
4282
3881
|
exports.Swiper = Swiper;
|
|
4283
3882
|
exports.default = Swiper;
|
|
4284
3883
|
|
|
4285
|
-
//# sourceMappingURL=swiper-
|
|
3884
|
+
//# sourceMappingURL=swiper-e5a68ae2.js.map
|