@graupl/graupl 1.0.0-beta.45 → 1.0.0-beta.47
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/css/component/carousel.css +1 -1
- package/dist/css/component/carousel.css.map +1 -1
- package/dist/css/component.css +1 -1
- package/dist/css/component.css.map +1 -1
- package/dist/css/graupl.css +1 -1
- package/dist/css/graupl.css.map +1 -1
- package/dist/js/breadcrumb.js +30 -30
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/carousel.js +266 -145
- package/dist/js/carousel.js.map +1 -1
- package/dist/js/component/breadcrumb.cjs.js +22 -22
- package/dist/js/component/breadcrumb.cjs.js.map +1 -1
- package/dist/js/component/breadcrumb.es.js +22 -22
- package/dist/js/component/breadcrumb.es.js.map +1 -1
- package/dist/js/component/breadcrumb.iife.js +24 -24
- package/dist/js/component/breadcrumb.iife.js.map +1 -1
- package/dist/js/component/carousel.cjs.js +246 -125
- package/dist/js/component/carousel.cjs.js.map +1 -1
- package/dist/js/component/carousel.es.js +246 -125
- package/dist/js/component/carousel.es.js.map +1 -1
- package/dist/js/component/carousel.iife.js +243 -122
- package/dist/js/component/carousel.iife.js.map +1 -1
- package/dist/js/component/disclosure.cjs.js +1 -1
- package/dist/js/component/disclosure.cjs.js.map +1 -1
- package/dist/js/component/disclosure.es.js +1 -1
- package/dist/js/component/disclosure.es.js.map +1 -1
- package/dist/js/component/disclosure.iife.js +1 -1
- package/dist/js/component/disclosure.iife.js.map +1 -1
- package/dist/js/disclosure.js +12 -12
- package/dist/js/disclosure.js.map +1 -1
- package/dist/js/generator/breadcrumb.cjs.js +24 -24
- package/dist/js/generator/breadcrumb.cjs.js.map +1 -1
- package/dist/js/generator/breadcrumb.es.js +40 -40
- package/dist/js/generator/breadcrumb.es.js.map +1 -1
- package/dist/js/generator/breadcrumb.iife.js +46 -46
- package/dist/js/generator/breadcrumb.iife.js.map +1 -1
- package/dist/js/generator/carousel.cjs.js +262 -141
- package/dist/js/generator/carousel.cjs.js.map +1 -1
- package/dist/js/generator/carousel.es.js +262 -141
- package/dist/js/generator/carousel.es.js.map +1 -1
- package/dist/js/generator/carousel.iife.js +263 -142
- package/dist/js/generator/carousel.iife.js.map +1 -1
- package/dist/js/generator/disclosure.cjs.js +13 -13
- package/dist/js/generator/disclosure.cjs.js.map +1 -1
- package/dist/js/generator/disclosure.es.js +13 -13
- package/dist/js/generator/disclosure.es.js.map +1 -1
- package/dist/js/generator/disclosure.iife.js +12 -12
- package/dist/js/generator/disclosure.iife.js.map +1 -1
- package/dist/js/graupl.js +565 -444
- package/dist/js/graupl.js.map +1 -1
- package/package.json +1 -1
package/dist/js/carousel.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function() {
|
|
2
|
-
function
|
|
2
|
+
function c(t, e) {
|
|
3
3
|
t === "" || t.length === 0 || (typeof t == "string" ? e.classList.add(t) : e.classList.add(...t));
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function m(t, e) {
|
|
6
6
|
t === "" || t.length === 0 || (typeof t == "string" ? e.classList.remove(t) : e.classList.remove(...t));
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function u(t) {
|
|
9
9
|
try {
|
|
10
10
|
const e = t.key || t.keyCode, r = {
|
|
11
11
|
Enter: e === "Enter" || e === 13,
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
return "";
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function l(t) {
|
|
30
30
|
t.preventDefault(), t.stopPropagation();
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function h(t, e, { shouldThrow: r = !0 } = {}) {
|
|
33
33
|
const s = {
|
|
34
34
|
status: !0,
|
|
35
35
|
errors: []
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
if (r && !s.status) throw s.errors[0];
|
|
70
70
|
return s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function I(t, { shouldThrow: e = !0 } = {}) {
|
|
73
73
|
const r = {
|
|
74
74
|
status: !0,
|
|
75
75
|
errors: []
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
if (e && !r.status) throw r.errors[0];
|
|
93
93
|
return r;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function d(t, { shouldThrow: e = !0 } = {}) {
|
|
96
96
|
const r = {
|
|
97
97
|
status: !0,
|
|
98
98
|
errors: []
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
else throw new TypeError(`${s} must be a string or an array of strings. "${i}" given.`);
|
|
108
108
|
else {
|
|
109
109
|
const o = {};
|
|
110
|
-
o[s] = t[s],
|
|
110
|
+
o[s] = t[s], I(o);
|
|
111
111
|
}
|
|
112
112
|
} catch (i) {
|
|
113
113
|
r.status = !1, r.errors.push(i);
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
if (e && !r.status) throw r.errors[0];
|
|
119
119
|
return r;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function x(t, { shouldThrow: e = !0 } = {}) {
|
|
122
122
|
const r = {
|
|
123
123
|
status: !0,
|
|
124
124
|
errors: []
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
if (e && !r.status) throw r.errors[0];
|
|
142
142
|
return r;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function D(t, { shouldThrow: e = !0 } = {}) {
|
|
145
145
|
const r = {
|
|
146
146
|
status: !0,
|
|
147
147
|
errors: []
|
|
@@ -165,13 +165,13 @@
|
|
|
165
165
|
if (e && !r.status) throw r.errors[0];
|
|
166
166
|
return r;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function S(t, e, { shouldThrow: r = !0 } = {}) {
|
|
169
169
|
const s = {
|
|
170
170
|
status: !0,
|
|
171
171
|
errors: []
|
|
172
172
|
};
|
|
173
173
|
try {
|
|
174
|
-
if (a("string", { tagName: t }, { shouldThrow: !0 }).status &&
|
|
174
|
+
if (a("string", { tagName: t }, { shouldThrow: !0 }).status && h(HTMLElement, e, { shouldThrow: !0 }).status) {
|
|
175
175
|
const i = t.toLowerCase();
|
|
176
176
|
for (const o in e) try {
|
|
177
177
|
if (e[o].tagName.toLowerCase() !== i) throw new TypeError(`${o} must be a <${i}> element. <${e[o].tagName.toLowerCase()}> given.`);
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
if (r && !s.status) throw s.errors[0];
|
|
186
186
|
return s;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function L(t, e, { shouldThrow: r = !0 } = {}) {
|
|
189
189
|
const s = {
|
|
190
190
|
status: !0,
|
|
191
191
|
errors: []
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
if (r && !s.status) throw s.errors[0];
|
|
199
199
|
return s;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function z(t, { shouldThrow: e = !0 } = {}) {
|
|
202
202
|
const r = {
|
|
203
203
|
status: !0,
|
|
204
204
|
errors: []
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
if (e && !r.status) throw r.errors[0];
|
|
212
212
|
return r;
|
|
213
213
|
}
|
|
214
|
-
var g = class
|
|
214
|
+
var g = class A {
|
|
215
215
|
_scope;
|
|
216
216
|
_type = "_default";
|
|
217
217
|
_storage = {};
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
}
|
|
222
222
|
initialize() {
|
|
223
223
|
try {
|
|
224
|
-
!this._crush && typeof window[this.scope] < "u" && (
|
|
224
|
+
!this._crush && typeof window[this.scope] < "u" && (h(A, { storage: window[this.scope] }, { shouldThrow: !1 }).status || typeof window[this.scope].storage < "u" && typeof window[this.scope].scope < "u" && typeof window[this.scope].type < "u") && (this._storage = window[this.scope].storage);
|
|
225
225
|
} catch {} finally {
|
|
226
226
|
window[this.scope] = this;
|
|
227
227
|
}
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
dispose() {
|
|
272
272
|
delete this._storage, delete this;
|
|
273
273
|
}
|
|
274
|
-
},
|
|
274
|
+
}, C = class {
|
|
275
275
|
_dom = {};
|
|
276
276
|
_rootDOMElement = "";
|
|
277
277
|
_protectedDOMElements = [];
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
if (!this._validate()) throw new Error(`Graupl ${this.name}: Cannot initialize component. The following errors have been found:
|
|
317
317
|
- ${this.errors.map((t) => t.message).join(`
|
|
318
318
|
- `)}`);
|
|
319
|
-
|
|
319
|
+
c(this.initializeClass, this.rootDOMElement), this._dispatchEvent("preinitialize", this.rootDOMElement), this._generateKey(), this._setDOMElements(), this._setIds(), this._setAriaAttributes(), this._setCustomProps(), this._createChildElements(), this._handleMediaMatch(), this._handleFocus(), this._handleHover(), this._handleClick(), this._handleKeydown(), this._handleKeyup(), this._dispatchEvent("initialize", this.rootDOMElement), this._store(), m(this.initializeClass, this.rootDOMElement), this._initialized = !0, this._dispatchEvent("postinitialize", this.rootDOMElement);
|
|
320
320
|
} catch (t) {
|
|
321
321
|
console.error(t);
|
|
322
322
|
}
|
|
@@ -361,19 +361,19 @@
|
|
|
361
361
|
return this._classes.initialize;
|
|
362
362
|
}
|
|
363
363
|
set initializeClass(t) {
|
|
364
|
-
|
|
364
|
+
d({ initializeClass: t }), this._classes.initialize !== t && (this._classes.initialize = t);
|
|
365
365
|
}
|
|
366
366
|
get focusState() {
|
|
367
367
|
return this._focusState;
|
|
368
368
|
}
|
|
369
369
|
set focusState(t) {
|
|
370
|
-
|
|
370
|
+
x({ focusState: t }), this._focusState !== t && (this._focusState = t);
|
|
371
371
|
}
|
|
372
372
|
get currentEvent() {
|
|
373
373
|
return this._currentEvent;
|
|
374
374
|
}
|
|
375
375
|
set currentEvent(t) {
|
|
376
|
-
|
|
376
|
+
D({ currentEvent: t }), this._currentEvent !== t && (this._currentEvent = t);
|
|
377
377
|
}
|
|
378
378
|
get shouldFocus() {
|
|
379
379
|
let t = !1;
|
|
@@ -414,25 +414,25 @@
|
|
|
414
414
|
}
|
|
415
415
|
_validate() {
|
|
416
416
|
this._dispatchEvent("prevalidate", this.rootDOMElement);
|
|
417
|
-
const t =
|
|
417
|
+
const t = z(this, { shouldThrow: !1 });
|
|
418
418
|
if (t.status || (this._errors = [...this._errors, ...t.errors], this._valid = !1), Object.keys(this._dom).length > 0) {
|
|
419
419
|
const s = {};
|
|
420
|
-
for (const o of Object.keys(this._dom)) Array.isArray(this._dom[o]) ? this._dom[o].forEach((n,
|
|
421
|
-
s[`${o}Element[${
|
|
420
|
+
for (const o of Object.keys(this._dom)) Array.isArray(this._dom[o]) ? this._dom[o].forEach((n, f) => {
|
|
421
|
+
s[`${o}Element[${f}]`] = n;
|
|
422
422
|
}) : this._dom[o] !== null && (s[`${o}Element`] = this._dom[o]);
|
|
423
|
-
const i =
|
|
423
|
+
const i = h(HTMLElement, s, { shouldThrow: !1 });
|
|
424
424
|
i.status || (this._errors = [...this._errors, ...i.errors], this._valid = !1);
|
|
425
425
|
}
|
|
426
426
|
if (Object.keys(this._selectors).length > 0) {
|
|
427
427
|
const s = {};
|
|
428
428
|
for (const o of Object.keys(this._selectors)) s[`${o}Selector`] = this._selectors[o];
|
|
429
|
-
const i =
|
|
429
|
+
const i = I(s, { shouldThrow: !1 });
|
|
430
430
|
i.status || (this._errors = [...this._errors, ...i.errors], this._valid = !1);
|
|
431
431
|
}
|
|
432
432
|
if (Object.keys(this._classes).length > 0) {
|
|
433
433
|
const s = {};
|
|
434
434
|
for (const o of Object.keys(this._classes)) this._classes[o] !== "" && (s[`${o}Class`] = this._classes[o]);
|
|
435
|
-
const i =
|
|
435
|
+
const i = d(s, { shouldThrow: !1 });
|
|
436
436
|
i.status || (this._errors = [...this._errors, ...i.errors], this._valid = !1);
|
|
437
437
|
}
|
|
438
438
|
if (Object.keys(this._durations).length > 0) {
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
_setDOMElementType(t, { context: e, overwrite: r = !0, strict: s = !1 } = {}) {
|
|
470
470
|
if (typeof this.selectors[t] != "string") throw new Error(`Graupl ${this.name}: "${t}" is not a valid element type.`);
|
|
471
471
|
if (this._rootDOMElement === t || this._protectedDOMElements.includes(t)) throw new Error(`Graupl ${this.name}: "${t}" element cannot be set through _setDOMElementType because it is a protected element.`);
|
|
472
|
-
|
|
472
|
+
h(HTMLElement, { context: e });
|
|
473
473
|
const i = Array.from(e.querySelectorAll(this.selectors[t])).filter((o) => s ? o.parentElement === e : !0);
|
|
474
474
|
Array.isArray(this._dom[t]) ? r ? this._dom[t] = i : this._dom[t] = [...this._dom[t], ...i] : this._dom[t] = i[0] || null;
|
|
475
475
|
}
|
|
@@ -489,14 +489,14 @@
|
|
|
489
489
|
_handleKeydown() {}
|
|
490
490
|
_handleKeyup() {}
|
|
491
491
|
_store() {
|
|
492
|
-
this._shouldStore && (
|
|
492
|
+
this._shouldStore && (h(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status || new g({ scope: "GrauplStorage" }), window.GrauplStorage.set({
|
|
493
493
|
key: this.id !== "" ? this.id : this.key,
|
|
494
494
|
type: this._storageKey,
|
|
495
495
|
data: this
|
|
496
496
|
}));
|
|
497
497
|
}
|
|
498
498
|
_unstore() {
|
|
499
|
-
this._shouldStore &&
|
|
499
|
+
this._shouldStore && h(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status && window.GrauplStorage.clear({
|
|
500
500
|
key: this.id !== "" ? this.id : this.key,
|
|
501
501
|
type: this._storageKey
|
|
502
502
|
});
|
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
_dispatchEvent(t, e) {
|
|
534
|
-
|
|
534
|
+
L(t, this), h(HTMLElement, { element: e }), e.dispatchEvent(this.events[t]);
|
|
535
535
|
}
|
|
536
536
|
_addEventListener(t, e, r, s = {}) {
|
|
537
537
|
e.addEventListener(t, r, s), this._listeners.push({
|
|
@@ -562,77 +562,96 @@
|
|
|
562
562
|
dispose() {
|
|
563
563
|
this._clearIntervals(), this._clearTimeouts(), this._removeEventListeners(), this._unstore(), delete this;
|
|
564
564
|
}
|
|
565
|
-
},
|
|
565
|
+
}, E = class extends C {
|
|
566
|
+
_rootDOMElement = "carouselItem";
|
|
567
|
+
_shouldStore = !1;
|
|
568
|
+
_storageKey = "carouselItems";
|
|
569
|
+
_name = "CarouselItem";
|
|
570
|
+
_busy = !1;
|
|
571
|
+
constructor({ carouselItemElement: t, tabElement: e = null, clone: r = null, parent: s, prefix: i = "graupl-", key: o = null, initializeClass: n = "initializing", initialize: f = !1 }) {
|
|
572
|
+
super({
|
|
573
|
+
prefix: i,
|
|
574
|
+
key: o,
|
|
575
|
+
initializeClass: n
|
|
576
|
+
}), this._dom.carouselItem = t, this._dom.tab = e, this._elements.clone = r ?? null, this._elements.parent = s, f && this.initialize();
|
|
577
|
+
}
|
|
578
|
+
activate({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
579
|
+
requestAnimationFrame(() => {
|
|
580
|
+
c(this.elements.parent.activeClass, this.dom.carouselItem), this.dom.carouselItem.removeAttribute("inert"), t && this.elements.parent.dom.carouselItemContainer.scrollTo({
|
|
581
|
+
left: this.dom.carouselItem.offsetLeft,
|
|
582
|
+
top: this.dom.carouselItem.offsetTop,
|
|
583
|
+
behavior: "smooth",
|
|
584
|
+
...e
|
|
585
|
+
}), this.dom.tab && requestAnimationFrame(() => {
|
|
586
|
+
c(this.elements.parent.activeClass, this.dom.tab), this.dom.tab.setAttribute("aria-selected", !0);
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
deactivate() {
|
|
591
|
+
requestAnimationFrame(() => {
|
|
592
|
+
m(this.elements.parent.activeClass, this.dom.carouselItem), this.dom.carouselItem.setAttribute("inert", !0), requestAnimationFrame(() => {
|
|
593
|
+
this.dom.tab && (m(this.elements.parent.activeClass, this.dom.tab), this.dom.tab.setAttribute("aria-selected", !1));
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}, P = class extends C {
|
|
566
598
|
_rootDOMElement = "carousel";
|
|
567
599
|
_currentItem = 0;
|
|
568
600
|
_autoplay = !0;
|
|
569
601
|
_playText = "Play";
|
|
570
602
|
_pauseText = "Pause";
|
|
571
|
-
_currentAction = "next";
|
|
572
603
|
_storageKey = "carousels";
|
|
573
604
|
_name = "Carousel";
|
|
574
|
-
|
|
605
|
+
_itemsPerPage = 1;
|
|
606
|
+
_loop = !0;
|
|
607
|
+
constructor({ carouselElement: t, carouselItemsSelector: e = ".carousel-item", carouselItemContainerSelector: r = ".carousel-item-container", carouselControlsSelector: s = ".carousel-control", carouselControlContainerSelector: i = ".carousel-control-container", carouselTabsSelector: o = ".carousel-tab", carouselTabContainerSelector: n = ".carousel-tab-container", autoplaySelector: f = ".autoplay", nextSelector: K = ".next", previousSelector: F = ".previous", activeClass: N = "active", playClass: q = "play", pauseClass: G = "pause", autoplay: H = !0, transitionDelay: R = 1e4, playText: U = "Play", pauseText: J = "Pause", itemsPerPage: B = 1, loop: Z = !0, prefix: W = "graupl-", key: X = null, initializeClass: Y = "initializing", initialize: tt = !1 }) {
|
|
575
608
|
super({
|
|
576
|
-
prefix:
|
|
577
|
-
key:
|
|
578
|
-
initializeClass:
|
|
579
|
-
}), this._dom.carousel = t, this._dom.carouselItems = [], this._dom.carouselItemContainer = null, this._dom.carouselControls = [], this._dom.carouselControlContainer = null, this._dom.carouselTabs = [], this._dom.carouselTabContainer = null, this._dom.autoplay = null, this._dom.next = null, this._dom.previous = null, this._selectors.carouselItems = e, this._selectors.carouselItemContainer = r, this._selectors.carouselControls = s, this._selectors.carouselControlContainer = i, this._selectors.carouselTabs = o, this._selectors.carouselTabContainer = n, this._selectors.autoplay =
|
|
580
|
-
this._handleAutoplay(), this.
|
|
581
|
-
y.setAttribute("inert", "true");
|
|
582
|
-
}), this.activateFirstItem();
|
|
609
|
+
prefix: W,
|
|
610
|
+
key: X,
|
|
611
|
+
initializeClass: Y
|
|
612
|
+
}), this._dom.carousel = t, this._dom.carouselItems = [], this._dom.carouselItemContainer = null, this._dom.carouselControls = [], this._dom.carouselControlContainer = null, this._dom.carouselTabs = [], this._dom.carouselTabContainer = null, this._dom.autoplay = null, this._dom.next = null, this._dom.previous = null, this._selectors.carouselItems = e, this._selectors.carouselItemContainer = r, this._selectors.carouselControls = s, this._selectors.carouselControlContainer = i, this._selectors.carouselTabs = o, this._selectors.carouselTabContainer = n, this._selectors.autoplay = f, this._selectors.next = K, this._selectors.previous = F, this._elements.carouselItems = [], this._classes.active = N || "", this._classes.play = q || "", this._classes.pause = G || "", this._autoplay = H, this._itemsPerPage = B, this._loop = Z, this._delays.transition = R, this._playText = U || "", this._pauseText = J || "", this._addEventListener("grauplComponentInitialize", this.rootDOMElement, () => {
|
|
613
|
+
this._handleAutoplay(), this.loop && this._handleLoop(), this._handleIntersection(), this.activateFirstItem({ scrollOptions: { behavior: "instant" } });
|
|
583
614
|
}), this._addEventListener("grauplComponentValidate", this.rootDOMElement, () => {
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
|
|
615
|
+
const $ = a("boolean", {
|
|
616
|
+
autoplay: this._autoplay,
|
|
617
|
+
loop: this._loop
|
|
618
|
+
}, { shouldThrow: !1 });
|
|
619
|
+
$.status || (this._errors = [...this._errors, ...$.errors], this._valid = !1);
|
|
620
|
+
const M = a("string", {
|
|
587
621
|
playText: this._playText,
|
|
588
622
|
pauseText: this._pauseText
|
|
589
623
|
}, { shouldThrow: !1 });
|
|
590
|
-
|
|
591
|
-
|
|
624
|
+
M.status || (this._errors = [...this._errors, ...M.errors], this._valid = !1);
|
|
625
|
+
const O = a("number", { itemsPerPage: this._itemsPerPage }, { shouldThrow: !1 });
|
|
626
|
+
O.status || (this._errors = [...this._errors, ...O.errors], this._valid = !1);
|
|
627
|
+
}), tt && this.initialize();
|
|
592
628
|
}
|
|
593
629
|
get activeClass() {
|
|
594
630
|
return this._classes.active;
|
|
595
631
|
}
|
|
596
632
|
set activeClass(t) {
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
get previousClass() {
|
|
600
|
-
return this._classes.previous;
|
|
601
|
-
}
|
|
602
|
-
set previousClass(t) {
|
|
603
|
-
c({ previousClass: t }), this._classes.previous !== t && (this._classes.previous = t);
|
|
604
|
-
}
|
|
605
|
-
get nextClass() {
|
|
606
|
-
return this._classes.next;
|
|
607
|
-
}
|
|
608
|
-
set nextClass(t) {
|
|
609
|
-
c({ nextClass: t }), this._classes.next !== t && (this._classes.next = t);
|
|
633
|
+
d({ activeClass: t }), this._classes.active !== t && (this._classes.active = t);
|
|
610
634
|
}
|
|
611
635
|
get playClass() {
|
|
612
636
|
return this._classes.play;
|
|
613
637
|
}
|
|
614
638
|
set playClass(t) {
|
|
615
|
-
|
|
639
|
+
d({ playClass: t }), this._classes.play !== t && (this._classes.play = t);
|
|
616
640
|
}
|
|
617
641
|
get pauseClass() {
|
|
618
642
|
return this._classes.pause;
|
|
619
643
|
}
|
|
620
644
|
set pauseClass(t) {
|
|
621
|
-
|
|
645
|
+
d({ pauseClass: t }), this._classes.pause !== t && (this._classes.pause = t);
|
|
622
646
|
}
|
|
623
647
|
get currentItem() {
|
|
624
648
|
return this._currentItem;
|
|
625
649
|
}
|
|
626
650
|
set currentItem(t) {
|
|
627
|
-
a("number", { currentItem: t }), t !== this.currentItem && (t < 0 ? this._currentItem = 0 : t >= this.dom.carouselItems.length ? this._currentItem = this.dom.carouselItems.length - 1 : this._currentItem = t
|
|
628
|
-
e.setAttribute("aria-selected", r === this._currentItem);
|
|
629
|
-
}));
|
|
651
|
+
a("number", { currentItem: t }), t !== this.currentItem && (t < 0 ? this._currentItem = 0 : t >= this.dom.carouselItems.length ? this._currentItem = this.dom.carouselItems.length - 1 : this._currentItem = t);
|
|
630
652
|
}
|
|
631
653
|
get currentCarouselItem() {
|
|
632
|
-
return this.
|
|
633
|
-
}
|
|
634
|
-
get currentCarouselTab() {
|
|
635
|
-
return this.dom.carouselTabs[this.currentItem];
|
|
654
|
+
return this.elements.carouselItems[this.currentItem];
|
|
636
655
|
}
|
|
637
656
|
get autoplay() {
|
|
638
657
|
return this._autoplay;
|
|
@@ -640,18 +659,18 @@
|
|
|
640
659
|
set autoplay(t) {
|
|
641
660
|
a("boolean", { autoplay: t }), this._autoplay !== t && (this._autoplay = t);
|
|
642
661
|
}
|
|
662
|
+
get itemsPerPage() {
|
|
663
|
+
return this._itemsPerPage;
|
|
664
|
+
}
|
|
665
|
+
get loop() {
|
|
666
|
+
return this._loop;
|
|
667
|
+
}
|
|
643
668
|
get transitionDelay() {
|
|
644
669
|
return this._delays.transition;
|
|
645
670
|
}
|
|
646
671
|
set transitionDelay(t) {
|
|
647
672
|
a("number", { transitionDelay: t }), t !== this.transitionDelay && t >= 0 && (this._delays.transition = t);
|
|
648
673
|
}
|
|
649
|
-
get transitionDuration() {
|
|
650
|
-
return this._durations.transition;
|
|
651
|
-
}
|
|
652
|
-
set transitionDuration(t) {
|
|
653
|
-
a("number", { transitionDuration: t }), this._durations.transition !== t && t >= 0 && (this._durations.transition = t, this._setTransitionDuration());
|
|
654
|
-
}
|
|
655
674
|
get playText() {
|
|
656
675
|
return this._playText;
|
|
657
676
|
}
|
|
@@ -664,12 +683,22 @@
|
|
|
664
683
|
set pauseText(t) {
|
|
665
684
|
a("string", { pauseText: t }), this._pauseText !== t && (this._pauseText = t);
|
|
666
685
|
}
|
|
667
|
-
get currentAction() {
|
|
668
|
-
return this._currentAction;
|
|
669
|
-
}
|
|
670
686
|
_setDOMElements() {
|
|
671
687
|
this._setDOMElementType("carouselItemContainer", { context: this.dom.carousel }), this._setDOMElementType("carouselControlContainer", { context: this.dom.carousel }), this._setDOMElementType("carouselTabContainer", { context: this.dom.carousel }), this.dom.carouselItemContainer && this._setDOMElementType("carouselItems", { context: this.dom.carouselItemContainer }), this.dom.carouselControlContainer && (this._setDOMElementType("carouselControls", { context: this.dom.carouselControlContainer }), this._setDOMElementType("autoplay", { context: this.dom.carouselControlContainer }), this._setDOMElementType("next", { context: this.dom.carouselControlContainer }), this._setDOMElementType("previous", { context: this.dom.carouselControlContainer })), this._dom.carouselTabContainer && this._setDOMElementType("carouselTabs", { context: this.dom.carouselTabContainer });
|
|
672
688
|
}
|
|
689
|
+
_createChildElements() {
|
|
690
|
+
this.dom.carouselItems.forEach((t, e) => {
|
|
691
|
+
const r = new E({
|
|
692
|
+
carouselItemElement: t,
|
|
693
|
+
tabElement: this.dom.carouselTabs ? this.dom.carouselTabs[e] : null,
|
|
694
|
+
parent: this,
|
|
695
|
+
prefix: this.prefix,
|
|
696
|
+
initializeClass: this.classes.initialize,
|
|
697
|
+
initialize: !0
|
|
698
|
+
});
|
|
699
|
+
this._elements.carouselItems.push(r);
|
|
700
|
+
});
|
|
701
|
+
}
|
|
673
702
|
_setIds() {
|
|
674
703
|
this.dom.carousel.id = this.dom.carousel.id || `carousel-${this.key}`, this.dom.carouselItems.forEach((t, e) => {
|
|
675
704
|
t.id = t.id || `carousel-item-${this.key}-${e}`;
|
|
@@ -678,15 +707,36 @@
|
|
|
678
707
|
}), this._id = this.dom.carousel.id;
|
|
679
708
|
}
|
|
680
709
|
_setAriaAttributes() {
|
|
681
|
-
!
|
|
682
|
-
|
|
710
|
+
!S("section", { carousel: this.dom.carousel }, { shouldThrow: !1 }).status && !this.dom.carousel.getAttribute("role") !== "region" && this.dom.carousel.setAttribute("role", "group"), this.dom.carouselItems.forEach((t) => {
|
|
711
|
+
t.setAttribute("inert", "true");
|
|
712
|
+
}), this.dom.carouselItemContainer && this.dom.carouselItemContainer.setAttribute("tabindex", "-1"), this._dom.carousel.setAttribute("aria-roledescription", "carousel"), this.dom.carouselTabContainer && this.dom.carouselTabContainer.setAttribute("role", "tablist"), this.dom.carouselTabs.forEach((t, e) => {
|
|
713
|
+
t.setAttribute("role", "tab"), t.setAttribute("aria-selected", e === 0), t.setAttribute("aria-controls", this.dom.carouselItems[e].id);
|
|
683
714
|
});
|
|
684
715
|
}
|
|
685
|
-
_setCustomProps() {
|
|
686
|
-
this.dom.carousel.style.setProperty(`--${this.prefix}carousel-transition-duration`, `${this.transitionDuration}ms`);
|
|
687
|
-
}
|
|
688
716
|
_handleAutoplay() {
|
|
689
|
-
this.autoplay ? (
|
|
717
|
+
this.autoplay ? (c(this.pauseClass, this.dom.autoplay), m(this.playClass, this.dom.autoplay), this.dom.autoplay.setAttribute("aria-label", this.pauseText), this.dom.carousel.setAttribute("aria-live", "off"), this._setInterval(() => this.activateNextItem(), this.transitionDelay)) : (c(this.playClass, this.dom.autoplay), m(this.pauseClass, this.dom.autoplay), this.dom.autoplay.setAttribute("aria-label", this.playText), this.dom.carousel.setAttribute("aria-live", "polite"), this._clearInterval());
|
|
718
|
+
}
|
|
719
|
+
_handleIntersection() {
|
|
720
|
+
const t = {
|
|
721
|
+
root: this.dom.carouselItemContainer,
|
|
722
|
+
rootMargin: "1px",
|
|
723
|
+
scrollMargin: "1px",
|
|
724
|
+
threshold: 1
|
|
725
|
+
}, e = new IntersectionObserver((r) => {
|
|
726
|
+
this.isInitialized && r.forEach((s) => {
|
|
727
|
+
if (!s.isIntersecting) return;
|
|
728
|
+
const i = this.dom.carouselItems.indexOf(s.target);
|
|
729
|
+
let o = i;
|
|
730
|
+
this.elements.carouselItems[i].elements.clone !== null && (o = this.dom.carouselItems.indexOf(this.elements.carouselItems[i].elements.clone.dom.carouselItem), (i === 0 || i === this.dom.carouselItems.length - 1) && this.dom.carouselItemContainer.scrollTo({
|
|
731
|
+
left: this.elements.carouselItems[i].elements.clone.dom.carouselItem.offsetLeft,
|
|
732
|
+
top: this.elements.carouselItems[i].elements.clone.dom.carouselItem.offsetTop,
|
|
733
|
+
behavior: "instant"
|
|
734
|
+
})), this.currentItem !== o && this.activateItem(o, { scroll: !1 });
|
|
735
|
+
});
|
|
736
|
+
}, t);
|
|
737
|
+
this.dom.carouselItems.forEach((r) => {
|
|
738
|
+
e.observe(r);
|
|
739
|
+
});
|
|
690
740
|
}
|
|
691
741
|
_handleFocus() {
|
|
692
742
|
this._addEventListener("focusin", this.dom.carousel, () => {
|
|
@@ -696,15 +746,15 @@
|
|
|
696
746
|
});
|
|
697
747
|
}
|
|
698
748
|
_handleClick() {
|
|
699
|
-
this._addEventListener("click", this.dom.next, () => {
|
|
700
|
-
this.activateNextItem();
|
|
701
|
-
}), this._addEventListener("click", this.dom.previous, () => {
|
|
702
|
-
this.activatePreviousItem();
|
|
703
|
-
}), this._addEventListener("click", this.dom.autoplay, () => {
|
|
704
|
-
this.toggleAutoplay();
|
|
705
|
-
}), this.
|
|
706
|
-
this._addEventListener("click", t, () => {
|
|
707
|
-
|
|
749
|
+
this._addEventListener("click", this.dom.next, (t) => {
|
|
750
|
+
t.button === 0 && (l(t), this.currentEvent = "mouse", this.activateNextItem());
|
|
751
|
+
}), this._addEventListener("click", this.dom.previous, (t) => {
|
|
752
|
+
t.button === 0 && (l(t), this.currentEvent = "mouse", this.activatePreviousItem());
|
|
753
|
+
}), this._addEventListener("click", this.dom.autoplay, (t) => {
|
|
754
|
+
t.button === 0 && (l(t), this.currentEvent = "mouse", this.toggleAutoplay());
|
|
755
|
+
}), this.elements.carouselItems.forEach((t) => {
|
|
756
|
+
t.dom.tab && this._addEventListener("click", t.dom.tab, (e) => {
|
|
757
|
+
e.button === 0 && (l(e), this.currentEvent = "mouse", this.activateItem(this.dom.carouselItems.indexOf(t.dom.carouselItem)));
|
|
708
758
|
});
|
|
709
759
|
});
|
|
710
760
|
}
|
|
@@ -718,19 +768,19 @@
|
|
|
718
768
|
_handleKeydown() {
|
|
719
769
|
this.dom.carouselControls.forEach((t) => {
|
|
720
770
|
this._addEventListener("keydown", t, (e) => {
|
|
721
|
-
switch (
|
|
771
|
+
switch (u(e)) {
|
|
722
772
|
case "Space":
|
|
723
773
|
case "Enter":
|
|
724
|
-
|
|
774
|
+
l(e);
|
|
725
775
|
break;
|
|
726
776
|
}
|
|
727
777
|
});
|
|
728
|
-
}), this.
|
|
729
|
-
this._addEventListener("keydown", t, (e) => {
|
|
730
|
-
switch (
|
|
778
|
+
}), this.elements.carouselItems.forEach((t) => {
|
|
779
|
+
t.dom.tab && this._addEventListener("keydown", t.dom.tab, (e) => {
|
|
780
|
+
switch (u(e)) {
|
|
731
781
|
case "Space":
|
|
732
782
|
case "Enter":
|
|
733
|
-
|
|
783
|
+
l(e);
|
|
734
784
|
break;
|
|
735
785
|
}
|
|
736
786
|
});
|
|
@@ -738,83 +788,154 @@
|
|
|
738
788
|
}
|
|
739
789
|
_handleKeyup() {
|
|
740
790
|
this._addEventListener("keyup", this.dom.next, (t) => {
|
|
741
|
-
switch (
|
|
791
|
+
switch (u(t)) {
|
|
742
792
|
case "Space":
|
|
743
793
|
case "Enter":
|
|
744
|
-
this.activateNextItem(),
|
|
794
|
+
this.activateNextItem(), l(t);
|
|
745
795
|
break;
|
|
746
796
|
}
|
|
747
797
|
}), this._addEventListener("keyup", this.dom.previous, (t) => {
|
|
748
|
-
switch (
|
|
798
|
+
switch (u(t)) {
|
|
749
799
|
case "Space":
|
|
750
800
|
case "Enter":
|
|
751
|
-
this.activatePreviousItem(),
|
|
801
|
+
this.activatePreviousItem(), l(t);
|
|
752
802
|
break;
|
|
753
803
|
}
|
|
754
804
|
}), this._addEventListener("keyup", this.dom.autoplay, (t) => {
|
|
755
|
-
switch (
|
|
805
|
+
switch (u(t)) {
|
|
756
806
|
case "Space":
|
|
757
807
|
case "Enter":
|
|
758
|
-
this.toggleAutoplay(),
|
|
808
|
+
this.toggleAutoplay(), l(t);
|
|
759
809
|
break;
|
|
760
810
|
}
|
|
761
|
-
}), this.
|
|
762
|
-
this._addEventListener("keyup", t, (
|
|
763
|
-
switch (
|
|
811
|
+
}), this.elements.carouselItems.forEach((t) => {
|
|
812
|
+
t.dom.tab && this._addEventListener("keyup", t.dom.tab, (e) => {
|
|
813
|
+
switch (u(e)) {
|
|
764
814
|
case "Space":
|
|
765
815
|
case "Enter":
|
|
766
|
-
this.activateItem(
|
|
816
|
+
this.activateItem(this.dom.carouselItems.indexOf(t.dom.carouselItem)), l(e);
|
|
767
817
|
break;
|
|
768
818
|
}
|
|
769
819
|
});
|
|
770
820
|
});
|
|
771
821
|
}
|
|
772
|
-
|
|
773
|
-
|
|
822
|
+
_handleLoop() {
|
|
823
|
+
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), r = this.dom.carouselItemContainer;
|
|
824
|
+
for (let s = 0; s < this.itemsPerPage; s++) t.set(this.dom.carouselItems[s], this.dom.carouselItems.indexOf(this.dom.carouselItems[s]));
|
|
825
|
+
for (let s = this.dom.carouselItems.length - this.itemsPerPage; s < this.dom.carouselItems.length; s++) e.set(this.dom.carouselItems[s], this.dom.carouselItems.indexOf(this.dom.carouselItems[s]));
|
|
826
|
+
t.forEach((s, i) => {
|
|
827
|
+
const o = i.cloneNode(!0);
|
|
828
|
+
o.setAttribute("aria-hidden", "true"), o.setAttribute("inert", "true"), o.setAttribute("id", `${i.id}-clone`), r.appendChild(o);
|
|
829
|
+
const n = new E({
|
|
830
|
+
carouselItemElement: o,
|
|
831
|
+
clone: this._elements.carouselItems[s],
|
|
832
|
+
parent: this,
|
|
833
|
+
prefix: this.prefix,
|
|
834
|
+
initializeClass: this.classes.initialize,
|
|
835
|
+
initialize: !0
|
|
836
|
+
});
|
|
837
|
+
this.dom.carouselItems.push(o), this._elements.carouselItems.push(n);
|
|
838
|
+
}), e.forEach((s, i) => {
|
|
839
|
+
const o = i.cloneNode(!0);
|
|
840
|
+
o.setAttribute("aria-hidden", "true"), o.setAttribute("inert", "true"), o.setAttribute("id", `${i.id}-clone`), r.insertBefore(o, r.firstChild);
|
|
841
|
+
const n = new E({
|
|
842
|
+
carouselItemElement: o,
|
|
843
|
+
clone: this._elements.carouselItems[s],
|
|
844
|
+
parent: this,
|
|
845
|
+
prefix: this.prefix,
|
|
846
|
+
initializeClass: this.classes.initialize,
|
|
847
|
+
initialize: !0
|
|
848
|
+
});
|
|
849
|
+
this.dom.carouselItems.unshift(o), this._elements.carouselItems.unshift(n);
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
activateCurrentItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
853
|
+
this.currentCarouselItem.activate({
|
|
854
|
+
scroll: t,
|
|
855
|
+
scrollOptions: e
|
|
856
|
+
});
|
|
774
857
|
}
|
|
775
|
-
deactivateCurrentItem() {
|
|
776
|
-
|
|
858
|
+
deactivateCurrentItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
859
|
+
this.currentCarouselItem.deactivate({
|
|
860
|
+
scroll: t,
|
|
861
|
+
scrollOptions: e
|
|
862
|
+
});
|
|
777
863
|
}
|
|
778
|
-
activateItem(t) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
});
|
|
864
|
+
activateItem(t, { scroll: e = !0, scrollOptions: r = {} } = {}) {
|
|
865
|
+
this.autoplay && this._clearInterval(), this.deactivateCurrentItem({
|
|
866
|
+
scroll: e,
|
|
867
|
+
scrollOptions: r
|
|
868
|
+
}), this.currentItem = t, this.activateCurrentItem({
|
|
869
|
+
scroll: e,
|
|
870
|
+
scrollOptions: r
|
|
786
871
|
}), this.autoplay && this._setInterval(() => this.activateNextItem(), this.transitionDelay);
|
|
787
872
|
}
|
|
788
|
-
activateFirstItem() {
|
|
789
|
-
this.
|
|
873
|
+
activateFirstItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
874
|
+
this.loop ? this.currentItem === this.dom.carouselItems.length - this.itemsPerPage - 1 ? this.activateNextItem({
|
|
875
|
+
scroll: t,
|
|
876
|
+
scrollOptions: e
|
|
877
|
+
}) : this.activateItem(this.itemsPerPage, {
|
|
878
|
+
scroll: t,
|
|
879
|
+
scrollOptions: e
|
|
880
|
+
}) : this.activateItem(0, {
|
|
881
|
+
scroll: t,
|
|
882
|
+
scrollOptions: e
|
|
883
|
+
});
|
|
790
884
|
}
|
|
791
|
-
activateLastItem() {
|
|
792
|
-
this.
|
|
885
|
+
activateLastItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
886
|
+
this.loop ? this.currentItem === this.itemsPerPage ? this.activatePreviousItem({
|
|
887
|
+
scroll: t,
|
|
888
|
+
scrollOptions: e
|
|
889
|
+
}) : this.activateItem(this.dom.carouselItems.length - this.itemsPerPage - 1, {
|
|
890
|
+
scroll: t,
|
|
891
|
+
scrollOptions: e
|
|
892
|
+
}) : this.activateItem(this.dom.carouselItems.length - 1, {
|
|
893
|
+
scroll: t,
|
|
894
|
+
scrollOptions: e
|
|
895
|
+
});
|
|
793
896
|
}
|
|
794
|
-
activateNextItem() {
|
|
795
|
-
this.
|
|
897
|
+
activateNextItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
898
|
+
this.loop ? this.activateItem(this.currentItem + 1, {
|
|
899
|
+
scroll: t,
|
|
900
|
+
scrollOptions: e
|
|
901
|
+
}) : this.currentItem + 1 >= this.dom.carouselItems.length ? this.activateFirstItem({
|
|
902
|
+
scroll: t,
|
|
903
|
+
scrollOptions: e
|
|
904
|
+
}) : this.activateItem(this.currentItem + 1, {
|
|
905
|
+
scroll: t,
|
|
906
|
+
scrollOptions: e
|
|
907
|
+
});
|
|
796
908
|
}
|
|
797
|
-
activatePreviousItem() {
|
|
798
|
-
this.
|
|
909
|
+
activatePreviousItem({ scroll: t = !0, scrollOptions: e = {} } = {}) {
|
|
910
|
+
this.loop ? this.activateItem(this.currentItem - 1, {
|
|
911
|
+
scroll: t,
|
|
912
|
+
scrollOptions: e
|
|
913
|
+
}) : this.currentItem - 1 < 0 || this.loop && this.currentItem - 1 < this.itemsPerPage ? this.activateLastItem({
|
|
914
|
+
scroll: t,
|
|
915
|
+
scrollOptions: e
|
|
916
|
+
}) : this.activateItem(this.currentItem - 1, {
|
|
917
|
+
scroll: t,
|
|
918
|
+
scrollOptions: e
|
|
919
|
+
});
|
|
799
920
|
}
|
|
800
921
|
toggleAutoplay() {
|
|
801
922
|
this.autoplay = !this.autoplay, this._handleAutoplay();
|
|
802
923
|
}
|
|
803
924
|
};
|
|
804
|
-
const
|
|
925
|
+
const T = /[\11\12\14\15\40]+/, v = "data-once", j = document;
|
|
805
926
|
function w(t, e, r) {
|
|
806
|
-
return t[`${e}Attribute`](
|
|
927
|
+
return t[`${e}Attribute`](v, r);
|
|
807
928
|
}
|
|
808
|
-
function
|
|
929
|
+
function _(t) {
|
|
809
930
|
if (typeof t != "string") throw new TypeError("once ID must be a string");
|
|
810
|
-
if (t === "" ||
|
|
811
|
-
return `[${
|
|
931
|
+
if (t === "" || T.test(t)) throw new RangeError("once ID must not be empty or contain spaces");
|
|
932
|
+
return `[${v}~="${t}"]`;
|
|
812
933
|
}
|
|
813
|
-
function
|
|
934
|
+
function Q(t) {
|
|
814
935
|
if (!(t instanceof Element)) throw new TypeError("The element must be an instance of Element");
|
|
815
936
|
return !0;
|
|
816
937
|
}
|
|
817
|
-
function
|
|
938
|
+
function p(t, e = j) {
|
|
818
939
|
let r = t;
|
|
819
940
|
if (t === null) r = [];
|
|
820
941
|
else if (t) if (e instanceof Document || e instanceof DocumentFragment || e instanceof Element) typeof t == "string" ? r = e.querySelectorAll(t) : t instanceof Element && (r = [t]);
|
|
@@ -822,28 +943,28 @@
|
|
|
822
943
|
else throw new TypeError("Selector must not be empty");
|
|
823
944
|
return Array.prototype.slice.call(r);
|
|
824
945
|
}
|
|
825
|
-
function
|
|
946
|
+
function b(t, e, r) {
|
|
826
947
|
return e.filter((s) => {
|
|
827
|
-
const i =
|
|
948
|
+
const i = Q(s) && s.matches(t);
|
|
828
949
|
return i && r && r(s), i;
|
|
829
950
|
});
|
|
830
951
|
}
|
|
831
952
|
function k(t, { add: e, remove: r }) {
|
|
832
953
|
const s = [];
|
|
833
|
-
w(t, "has") && w(t, "get").trim().split(
|
|
954
|
+
w(t, "has") && w(t, "get").trim().split(T).forEach((o) => {
|
|
834
955
|
s.indexOf(o) < 0 && o !== r && s.push(o);
|
|
835
956
|
}), e && s.push(e);
|
|
836
957
|
const i = s.join(" ");
|
|
837
958
|
w(t, i === "" ? "remove" : "set", i);
|
|
838
959
|
}
|
|
839
|
-
function
|
|
840
|
-
return
|
|
960
|
+
function y(t, e, r) {
|
|
961
|
+
return b(`:not(${_(t)})`, p(e, r), (s) => k(s, { add: t }));
|
|
841
962
|
}
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
|
|
963
|
+
y.remove = (t, e, r) => b(_(t), p(e, r), (s) => k(s, { remove: t })), y.filter = (t, e, r) => b(_(t), p(e, r)), y.find = (t, e) => p(t ? _(t) : `[${v}]`, e);
|
|
964
|
+
const V = (t = {}, e = document, r = ".carousel") => {
|
|
965
|
+
y("graupl-carousel-generator", r, e).forEach((s) => {
|
|
845
966
|
const i = s.dataset.grauplCarouselOptions ? JSON.parse(s.dataset.grauplCarouselOptions.replace(/'/g, "\"")) || {} : {};
|
|
846
|
-
new
|
|
967
|
+
new P({
|
|
847
968
|
carouselElement: s,
|
|
848
969
|
initialize: !0,
|
|
849
970
|
...t,
|
|
@@ -852,7 +973,7 @@
|
|
|
852
973
|
});
|
|
853
974
|
};
|
|
854
975
|
document.addEventListener("DOMContentLoaded", () => {
|
|
855
|
-
|
|
976
|
+
V();
|
|
856
977
|
});
|
|
857
978
|
})();
|
|
858
979
|
|