@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
package/dist/esm/index.js
CHANGED
package/dist/esm/loader.js
CHANGED
|
@@ -3,7 +3,7 @@ export { s as setNonce } from './index-e848c048.js';
|
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
|
-
return bootstrapLazy([["content-split-block",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32]}]]],["content-tabs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"
|
|
6
|
+
return bootstrapLazy([["content-split-block",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32],"skipAccessibilityMessage":[32],"hasOpenButton":[32],"hasCloseButton":[32],"openButton":[32],"closeButton":[32],"contentSlot":[32]}]]],["content-tabs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"open","contentBlockActivationHandler"]]],[4,"content-image",{"classes":[1537],"lazyLoad":[4,"lazy-load"],"src":[1025],"alt":[1537],"width":[1025],"height":[1025],"aspectRatio":[1025,"aspect-ratio"],"type":[1],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[32],"pictureImageSrc":[32]},null,{"lazyLoadIsComplete":["watchLazyLoadIsComplete"]}],[4,"content-line",{"tag":[1],"textAlign":[1,"text-align"],"classes":[8],"maxWidth":[1,"max-width"],"classString":[32],"inlineStyle":[32]}],[4,"content-overlay",{"target":[1],"open":[1537],"fullScreen":[1537,"full-screen"],"classes":[1],"horizontal":[1537],"vertical":[1537],"closeTitle":[1,"close-title"],"position":[1537],"isActive":[32],"activeClass":[32],"classString":[32],"contentSlot":[32],"isFullScreen":[32],"hasCloseButton":[32],"originalMarkup":[32],"openOverlay":[64],"closeOverlay":[64]},[[0,"toggle","onContentBlockToggle"],[0,"open","onContentBlockActivated"],[0,"close","onContentBlockDeactivated"]]],[4,"content-spacer",{"classes":[1],"maxWidth":[1,"max-width"],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"horizontal":[1537],"vertical":[1537],"topOffset":[1,"top-offset"],"bottomOffset":[1,"bottom-offset"],"leftOffset":[1,"left-offset"],"rightOffset":[1,"right-offset"],"classString":[32],"inlineStyle":[32]}],[4,"content-text-block",{"classes":[1],"minHeight":[1537,"min-height"],"vertical":[1537],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"classString":[32],"inlineStyle":[32]}],[4,"content-tout-block",{"hover":[1537],"classes":[1],"classString":[32],"hasHoverContent":[32]}],[4,"content-video",{"method":[1],"autoplay":[4],"src":[1],"width":[2],"height":[2],"type":[1],"playButtonAriaLabel":[1,"play-button-aria-label"],"classes":[1537],"controls":[4],"preload":[1],"fitContainer":[1537,"fit-container"],"classString":[32],"isLoaded":[32],"hasPoster":[32],"isPlayed":[32]}],[4,"content-grid-formatter",{"classes":[1],"type":[1537],"flexGrow":[1537,"flex-grow"],"flexShrink":[1537,"flex-shrink"],"vertical":[1537],"horizontal":[1537],"columns":[1537],"columnGap":[1537,"column-gap"],"rowGap":[1537,"row-gap"],"classString":[32],"activeClassString":[32],"inlineStyle":[32]}]]]], options);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { defineCustomElements };
|
|
@@ -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 './utils-075121ec.js';
|
|
403
2
|
|
|
404
3
|
let support;
|
|
405
4
|
function calcSupport() {
|
|
@@ -4280,4 +3879,4 @@ Swiper.use([Resize, Observer]);
|
|
|
4280
3879
|
export default Swiper;
|
|
4281
3880
|
export { Swiper };
|
|
4282
3881
|
|
|
4283
|
-
//# sourceMappingURL=swiper-
|
|
3882
|
+
//# sourceMappingURL=swiper-3394f7fd.js.map
|