@content-blocks/js 0.7.0 → 0.7.2
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 +45 -1545
- 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 +41 -24
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- 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/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/window-resize-service-ac5c2012.js.map +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 -13
- 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 +11 -6
- package/dist/collection/components/content-overlay/content-overlay.js +69 -34
- package/dist/collection/components/content-overlay/content-overlay.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/formatters/content-grid-formatter/content-grid-formatter.css +4 -3
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +37 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.css +3 -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/components/content-carousel.js +5 -4
- package/dist/components/content-carousel.js.map +1 -1
- package/dist/components/content-grid-formatter2.js +9 -1
- package/dist/components/content-grid-formatter2.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 +32 -1538
- 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/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/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/p-75ac85e9.js +2 -0
- package/dist/content-blocks/p-75ac85e9.js.map +1 -0
- package/dist/content-blocks/p-7ff352fe.entry.js +2 -0
- package/dist/content-blocks/p-7ff352fe.entry.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-cfb4593f.js.map +1 -1
- package/dist/content-blocks/p-e2907508.js +2 -0
- package/dist/content-blocks/p-e2907508.js.map +1 -0
- package/dist/content-blocks/p-ef45f146.entry.js +2 -0
- package/dist/content-blocks/p-ef45f146.entry.js.map +1 -0
- package/dist/esm/content-accordion_11.entry.js +45 -1545
- 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 +41 -24
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- 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/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/window-resize-service-f40ec51c.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 +9 -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/package.json +2 -2
- package/dist/cjs/swiper-4fade542.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/esm/swiper-3e7be625.js.map +0 -1
|
@@ -1,405 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* SSR Window 4.0.2
|
|
3
|
-
* Better handling for window object in SSR environment
|
|
4
|
-
* https://github.com/nolimits4web/ssr-window
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2021, Vladimir Kharlampidi
|
|
7
|
-
*
|
|
8
|
-
* Licensed under MIT
|
|
9
|
-
*
|
|
10
|
-
* Released on: December 13, 2021
|
|
11
|
-
*/
|
|
12
|
-
/* eslint-disable no-param-reassign */
|
|
13
|
-
function isObject$1(obj) {
|
|
14
|
-
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
|
|
15
|
-
}
|
|
16
|
-
function extend$1(target, src) {
|
|
17
|
-
if (target === void 0) {
|
|
18
|
-
target = {};
|
|
19
|
-
}
|
|
20
|
-
if (src === void 0) {
|
|
21
|
-
src = {};
|
|
22
|
-
}
|
|
23
|
-
Object.keys(src).forEach(key => {
|
|
24
|
-
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) {
|
|
25
|
-
extend$1(target[key], src[key]);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const ssrDocument = {
|
|
30
|
-
body: {},
|
|
31
|
-
addEventListener() {},
|
|
32
|
-
removeEventListener() {},
|
|
33
|
-
activeElement: {
|
|
34
|
-
blur() {},
|
|
35
|
-
nodeName: ''
|
|
36
|
-
},
|
|
37
|
-
querySelector() {
|
|
38
|
-
return null;
|
|
39
|
-
},
|
|
40
|
-
querySelectorAll() {
|
|
41
|
-
return [];
|
|
42
|
-
},
|
|
43
|
-
getElementById() {
|
|
44
|
-
return null;
|
|
45
|
-
},
|
|
46
|
-
createEvent() {
|
|
47
|
-
return {
|
|
48
|
-
initEvent() {}
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
createElement() {
|
|
52
|
-
return {
|
|
53
|
-
children: [],
|
|
54
|
-
childNodes: [],
|
|
55
|
-
style: {},
|
|
56
|
-
setAttribute() {},
|
|
57
|
-
getElementsByTagName() {
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
createElementNS() {
|
|
63
|
-
return {};
|
|
64
|
-
},
|
|
65
|
-
importNode() {
|
|
66
|
-
return null;
|
|
67
|
-
},
|
|
68
|
-
location: {
|
|
69
|
-
hash: '',
|
|
70
|
-
host: '',
|
|
71
|
-
hostname: '',
|
|
72
|
-
href: '',
|
|
73
|
-
origin: '',
|
|
74
|
-
pathname: '',
|
|
75
|
-
protocol: '',
|
|
76
|
-
search: ''
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
function getDocument() {
|
|
80
|
-
const doc = typeof document !== 'undefined' ? document : {};
|
|
81
|
-
extend$1(doc, ssrDocument);
|
|
82
|
-
return doc;
|
|
83
|
-
}
|
|
84
|
-
const ssrWindow = {
|
|
85
|
-
document: ssrDocument,
|
|
86
|
-
navigator: {
|
|
87
|
-
userAgent: ''
|
|
88
|
-
},
|
|
89
|
-
location: {
|
|
90
|
-
hash: '',
|
|
91
|
-
host: '',
|
|
92
|
-
hostname: '',
|
|
93
|
-
href: '',
|
|
94
|
-
origin: '',
|
|
95
|
-
pathname: '',
|
|
96
|
-
protocol: '',
|
|
97
|
-
search: ''
|
|
98
|
-
},
|
|
99
|
-
history: {
|
|
100
|
-
replaceState() {},
|
|
101
|
-
pushState() {},
|
|
102
|
-
go() {},
|
|
103
|
-
back() {}
|
|
104
|
-
},
|
|
105
|
-
CustomEvent: function CustomEvent() {
|
|
106
|
-
return this;
|
|
107
|
-
},
|
|
108
|
-
addEventListener() {},
|
|
109
|
-
removeEventListener() {},
|
|
110
|
-
getComputedStyle() {
|
|
111
|
-
return {
|
|
112
|
-
getPropertyValue() {
|
|
113
|
-
return '';
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
Image() {},
|
|
118
|
-
Date() {},
|
|
119
|
-
screen: {},
|
|
120
|
-
setTimeout() {},
|
|
121
|
-
clearTimeout() {},
|
|
122
|
-
matchMedia() {
|
|
123
|
-
return {};
|
|
124
|
-
},
|
|
125
|
-
requestAnimationFrame(callback) {
|
|
126
|
-
if (typeof setTimeout === 'undefined') {
|
|
127
|
-
callback();
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
return setTimeout(callback, 0);
|
|
131
|
-
},
|
|
132
|
-
cancelAnimationFrame(id) {
|
|
133
|
-
if (typeof setTimeout === 'undefined') {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
clearTimeout(id);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
function getWindow() {
|
|
140
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
141
|
-
extend$1(win, ssrWindow);
|
|
142
|
-
return win;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function classesToTokens(classes) {
|
|
146
|
-
if (classes === void 0) {
|
|
147
|
-
classes = '';
|
|
148
|
-
}
|
|
149
|
-
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function deleteProps(obj) {
|
|
153
|
-
const object = obj;
|
|
154
|
-
Object.keys(object).forEach(key => {
|
|
155
|
-
try {
|
|
156
|
-
object[key] = null;
|
|
157
|
-
} catch (e) {
|
|
158
|
-
// no getter for object
|
|
159
|
-
}
|
|
160
|
-
try {
|
|
161
|
-
delete object[key];
|
|
162
|
-
} catch (e) {
|
|
163
|
-
// something got wrong
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
function nextTick(callback, delay) {
|
|
168
|
-
if (delay === void 0) {
|
|
169
|
-
delay = 0;
|
|
170
|
-
}
|
|
171
|
-
return setTimeout(callback, delay);
|
|
172
|
-
}
|
|
173
|
-
function now() {
|
|
174
|
-
return Date.now();
|
|
175
|
-
}
|
|
176
|
-
function getComputedStyle$1(el) {
|
|
177
|
-
const window = getWindow();
|
|
178
|
-
let style;
|
|
179
|
-
if (window.getComputedStyle) {
|
|
180
|
-
style = window.getComputedStyle(el, null);
|
|
181
|
-
}
|
|
182
|
-
if (!style && el.currentStyle) {
|
|
183
|
-
style = el.currentStyle;
|
|
184
|
-
}
|
|
185
|
-
if (!style) {
|
|
186
|
-
style = el.style;
|
|
187
|
-
}
|
|
188
|
-
return style;
|
|
189
|
-
}
|
|
190
|
-
function getTranslate(el, axis) {
|
|
191
|
-
if (axis === void 0) {
|
|
192
|
-
axis = 'x';
|
|
193
|
-
}
|
|
194
|
-
const window = getWindow();
|
|
195
|
-
let matrix;
|
|
196
|
-
let curTransform;
|
|
197
|
-
let transformMatrix;
|
|
198
|
-
const curStyle = getComputedStyle$1(el);
|
|
199
|
-
if (window.WebKitCSSMatrix) {
|
|
200
|
-
curTransform = curStyle.transform || curStyle.webkitTransform;
|
|
201
|
-
if (curTransform.split(',').length > 6) {
|
|
202
|
-
curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
|
|
203
|
-
}
|
|
204
|
-
// Some old versions of Webkit choke when 'none' is passed; pass
|
|
205
|
-
// empty string instead in this case
|
|
206
|
-
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
|
207
|
-
} else {
|
|
208
|
-
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
|
209
|
-
matrix = transformMatrix.toString().split(',');
|
|
210
|
-
}
|
|
211
|
-
if (axis === 'x') {
|
|
212
|
-
// Latest Chrome and webkits Fix
|
|
213
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
|
|
214
|
-
// Crazy IE10 Matrix
|
|
215
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
|
|
216
|
-
// Normal Browsers
|
|
217
|
-
else curTransform = parseFloat(matrix[4]);
|
|
218
|
-
}
|
|
219
|
-
if (axis === 'y') {
|
|
220
|
-
// Latest Chrome and webkits Fix
|
|
221
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
|
|
222
|
-
// Crazy IE10 Matrix
|
|
223
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
|
|
224
|
-
// Normal Browsers
|
|
225
|
-
else curTransform = parseFloat(matrix[5]);
|
|
226
|
-
}
|
|
227
|
-
return curTransform || 0;
|
|
228
|
-
}
|
|
229
|
-
function isObject(o) {
|
|
230
|
-
return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
|
|
231
|
-
}
|
|
232
|
-
function isNode(node) {
|
|
233
|
-
// eslint-disable-next-line
|
|
234
|
-
if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
|
|
235
|
-
return node instanceof HTMLElement;
|
|
236
|
-
}
|
|
237
|
-
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
238
|
-
}
|
|
239
|
-
function extend() {
|
|
240
|
-
const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
|
|
241
|
-
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
|
242
|
-
for (let i = 1; i < arguments.length; i += 1) {
|
|
243
|
-
const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
244
|
-
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
245
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
|
|
246
|
-
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
247
|
-
const nextKey = keysArray[nextIndex];
|
|
248
|
-
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
249
|
-
if (desc !== undefined && desc.enumerable) {
|
|
250
|
-
if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
251
|
-
if (nextSource[nextKey].__swiper__) {
|
|
252
|
-
to[nextKey] = nextSource[nextKey];
|
|
253
|
-
} else {
|
|
254
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
255
|
-
}
|
|
256
|
-
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
257
|
-
to[nextKey] = {};
|
|
258
|
-
if (nextSource[nextKey].__swiper__) {
|
|
259
|
-
to[nextKey] = nextSource[nextKey];
|
|
260
|
-
} else {
|
|
261
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
262
|
-
}
|
|
263
|
-
} else {
|
|
264
|
-
to[nextKey] = nextSource[nextKey];
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return to;
|
|
271
|
-
}
|
|
272
|
-
function setCSSProperty(el, varName, varValue) {
|
|
273
|
-
el.style.setProperty(varName, varValue);
|
|
274
|
-
}
|
|
275
|
-
function animateCSSModeScroll(_ref) {
|
|
276
|
-
let {
|
|
277
|
-
swiper,
|
|
278
|
-
targetPosition,
|
|
279
|
-
side
|
|
280
|
-
} = _ref;
|
|
281
|
-
const window = getWindow();
|
|
282
|
-
const startPosition = -swiper.translate;
|
|
283
|
-
let startTime = null;
|
|
284
|
-
let time;
|
|
285
|
-
const duration = swiper.params.speed;
|
|
286
|
-
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
287
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
288
|
-
const dir = targetPosition > startPosition ? 'next' : 'prev';
|
|
289
|
-
const isOutOfBound = (current, target) => {
|
|
290
|
-
return dir === 'next' && current >= target || dir === 'prev' && current <= target;
|
|
291
|
-
};
|
|
292
|
-
const animate = () => {
|
|
293
|
-
time = new Date().getTime();
|
|
294
|
-
if (startTime === null) {
|
|
295
|
-
startTime = time;
|
|
296
|
-
}
|
|
297
|
-
const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
|
|
298
|
-
const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
|
|
299
|
-
let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
|
|
300
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
301
|
-
currentPosition = targetPosition;
|
|
302
|
-
}
|
|
303
|
-
swiper.wrapperEl.scrollTo({
|
|
304
|
-
[side]: currentPosition
|
|
305
|
-
});
|
|
306
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
307
|
-
swiper.wrapperEl.style.overflow = 'hidden';
|
|
308
|
-
swiper.wrapperEl.style.scrollSnapType = '';
|
|
309
|
-
setTimeout(() => {
|
|
310
|
-
swiper.wrapperEl.style.overflow = '';
|
|
311
|
-
swiper.wrapperEl.scrollTo({
|
|
312
|
-
[side]: currentPosition
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
swiper.cssModeFrameID = window.requestAnimationFrame(animate);
|
|
319
|
-
};
|
|
320
|
-
animate();
|
|
321
|
-
}
|
|
322
|
-
function elementChildren(element, selector) {
|
|
323
|
-
if (selector === void 0) {
|
|
324
|
-
selector = '';
|
|
325
|
-
}
|
|
326
|
-
return [...element.children].filter(el => el.matches(selector));
|
|
327
|
-
}
|
|
328
|
-
function showWarning(text) {
|
|
329
|
-
try {
|
|
330
|
-
console.warn(text);
|
|
331
|
-
return;
|
|
332
|
-
} catch (err) {
|
|
333
|
-
// err
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
function createElement(tag, classes) {
|
|
337
|
-
if (classes === void 0) {
|
|
338
|
-
classes = [];
|
|
339
|
-
}
|
|
340
|
-
const el = document.createElement(tag);
|
|
341
|
-
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
342
|
-
return el;
|
|
343
|
-
}
|
|
344
|
-
function elementPrevAll(el, selector) {
|
|
345
|
-
const prevEls = [];
|
|
346
|
-
while (el.previousElementSibling) {
|
|
347
|
-
const prev = el.previousElementSibling; // eslint-disable-line
|
|
348
|
-
if (selector) {
|
|
349
|
-
if (prev.matches(selector)) prevEls.push(prev);
|
|
350
|
-
} else prevEls.push(prev);
|
|
351
|
-
el = prev;
|
|
352
|
-
}
|
|
353
|
-
return prevEls;
|
|
354
|
-
}
|
|
355
|
-
function elementNextAll(el, selector) {
|
|
356
|
-
const nextEls = [];
|
|
357
|
-
while (el.nextElementSibling) {
|
|
358
|
-
const next = el.nextElementSibling; // eslint-disable-line
|
|
359
|
-
if (selector) {
|
|
360
|
-
if (next.matches(selector)) nextEls.push(next);
|
|
361
|
-
} else nextEls.push(next);
|
|
362
|
-
el = next;
|
|
363
|
-
}
|
|
364
|
-
return nextEls;
|
|
365
|
-
}
|
|
366
|
-
function elementStyle(el, prop) {
|
|
367
|
-
const window = getWindow();
|
|
368
|
-
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
|
369
|
-
}
|
|
370
|
-
function elementIndex(el) {
|
|
371
|
-
let child = el;
|
|
372
|
-
let i;
|
|
373
|
-
if (child) {
|
|
374
|
-
i = 0;
|
|
375
|
-
// eslint-disable-next-line
|
|
376
|
-
while ((child = child.previousSibling) !== null) {
|
|
377
|
-
if (child.nodeType === 1) i += 1;
|
|
378
|
-
}
|
|
379
|
-
return i;
|
|
380
|
-
}
|
|
381
|
-
return undefined;
|
|
382
|
-
}
|
|
383
|
-
function elementParents(el, selector) {
|
|
384
|
-
const parents = []; // eslint-disable-line
|
|
385
|
-
let parent = el.parentElement; // eslint-disable-line
|
|
386
|
-
while (parent) {
|
|
387
|
-
if (selector) {
|
|
388
|
-
if (parent.matches(selector)) parents.push(parent);
|
|
389
|
-
} else {
|
|
390
|
-
parents.push(parent);
|
|
391
|
-
}
|
|
392
|
-
parent = parent.parentElement;
|
|
393
|
-
}
|
|
394
|
-
return parents;
|
|
395
|
-
}
|
|
396
|
-
function elementOuterSize(el, size, includeMargins) {
|
|
397
|
-
const window = getWindow();
|
|
398
|
-
if (includeMargins) {
|
|
399
|
-
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'));
|
|
400
|
-
}
|
|
401
|
-
return el.offsetWidth;
|
|
402
|
-
}
|
|
1
|
+
import { e as extend, g as getDocument, a as elementChildren, b as elementIndex, c as createElement, d as elementStyle, f as deleteProps, h as getWindow, i as elementParents, s as setCSSProperty, j as elementOuterSize, k as elementNextAll, l as elementPrevAll, m as getTranslate, n as animateCSSModeScroll, o as nextTick, p as showWarning, q as now } from './utils2.js';
|
|
403
2
|
|
|
404
3
|
let support;
|
|
405
4
|
function calcSupport() {
|