@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.
Files changed (51) hide show
  1. package/dist/css/component/carousel.css +1 -1
  2. package/dist/css/component/carousel.css.map +1 -1
  3. package/dist/css/component.css +1 -1
  4. package/dist/css/component.css.map +1 -1
  5. package/dist/css/graupl.css +1 -1
  6. package/dist/css/graupl.css.map +1 -1
  7. package/dist/js/breadcrumb.js +30 -30
  8. package/dist/js/breadcrumb.js.map +1 -1
  9. package/dist/js/carousel.js +266 -145
  10. package/dist/js/carousel.js.map +1 -1
  11. package/dist/js/component/breadcrumb.cjs.js +22 -22
  12. package/dist/js/component/breadcrumb.cjs.js.map +1 -1
  13. package/dist/js/component/breadcrumb.es.js +22 -22
  14. package/dist/js/component/breadcrumb.es.js.map +1 -1
  15. package/dist/js/component/breadcrumb.iife.js +24 -24
  16. package/dist/js/component/breadcrumb.iife.js.map +1 -1
  17. package/dist/js/component/carousel.cjs.js +246 -125
  18. package/dist/js/component/carousel.cjs.js.map +1 -1
  19. package/dist/js/component/carousel.es.js +246 -125
  20. package/dist/js/component/carousel.es.js.map +1 -1
  21. package/dist/js/component/carousel.iife.js +243 -122
  22. package/dist/js/component/carousel.iife.js.map +1 -1
  23. package/dist/js/component/disclosure.cjs.js +1 -1
  24. package/dist/js/component/disclosure.cjs.js.map +1 -1
  25. package/dist/js/component/disclosure.es.js +1 -1
  26. package/dist/js/component/disclosure.es.js.map +1 -1
  27. package/dist/js/component/disclosure.iife.js +1 -1
  28. package/dist/js/component/disclosure.iife.js.map +1 -1
  29. package/dist/js/disclosure.js +12 -12
  30. package/dist/js/disclosure.js.map +1 -1
  31. package/dist/js/generator/breadcrumb.cjs.js +24 -24
  32. package/dist/js/generator/breadcrumb.cjs.js.map +1 -1
  33. package/dist/js/generator/breadcrumb.es.js +40 -40
  34. package/dist/js/generator/breadcrumb.es.js.map +1 -1
  35. package/dist/js/generator/breadcrumb.iife.js +46 -46
  36. package/dist/js/generator/breadcrumb.iife.js.map +1 -1
  37. package/dist/js/generator/carousel.cjs.js +262 -141
  38. package/dist/js/generator/carousel.cjs.js.map +1 -1
  39. package/dist/js/generator/carousel.es.js +262 -141
  40. package/dist/js/generator/carousel.es.js.map +1 -1
  41. package/dist/js/generator/carousel.iife.js +263 -142
  42. package/dist/js/generator/carousel.iife.js.map +1 -1
  43. package/dist/js/generator/disclosure.cjs.js +13 -13
  44. package/dist/js/generator/disclosure.cjs.js.map +1 -1
  45. package/dist/js/generator/disclosure.es.js +13 -13
  46. package/dist/js/generator/disclosure.es.js.map +1 -1
  47. package/dist/js/generator/disclosure.iife.js +12 -12
  48. package/dist/js/generator/disclosure.iife.js.map +1 -1
  49. package/dist/js/graupl.js +565 -444
  50. package/dist/js/graupl.js.map +1 -1
  51. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  var BreadcrumbGenerator = (function() {
2
- function u(t, e, { shouldThrow: s = !0 } = {}) {
2
+ function c(t, e, { shouldThrow: s = !0 } = {}) {
3
3
  const i = {
4
4
  status: !0,
5
5
  errors: []
@@ -62,7 +62,7 @@ var BreadcrumbGenerator = (function() {
62
62
  if (e && !s.status) throw s.errors[0];
63
63
  return s;
64
64
  }
65
- function c(t, { shouldThrow: e = !0 } = {}) {
65
+ function u(t, { shouldThrow: e = !0 } = {}) {
66
66
  const s = {
67
67
  status: !0,
68
68
  errors: []
@@ -141,7 +141,7 @@ var BreadcrumbGenerator = (function() {
141
141
  errors: []
142
142
  };
143
143
  try {
144
- if (n("string", { tagName: t }, { shouldThrow: !0 }).status && u(HTMLElement, e, { shouldThrow: !0 }).status) {
144
+ if (n("string", { tagName: t }, { shouldThrow: !0 }).status && c(HTMLElement, e, { shouldThrow: !0 }).status) {
145
145
  const r = t.toLowerCase();
146
146
  for (const o in e) try {
147
147
  if (e[o].tagName.toLowerCase() !== r) throw new TypeError(`${o} must be a <${r}> element. <${e[o].tagName.toLowerCase()}> given.`);
@@ -168,7 +168,7 @@ var BreadcrumbGenerator = (function() {
168
168
  if (s && !i.status) throw i.errors[0];
169
169
  return i;
170
170
  }
171
- function Q(t, { shouldThrow: e = !0 } = {}) {
171
+ function x(t, { shouldThrow: e = !0 } = {}) {
172
172
  const s = {
173
173
  status: !0,
174
174
  errors: []
@@ -211,7 +211,7 @@ var BreadcrumbGenerator = (function() {
211
211
  function d(t) {
212
212
  t.preventDefault(), t.stopPropagation();
213
213
  }
214
- var B = class {
214
+ var T = class {
215
215
  _equals = Object.is;
216
216
  _current;
217
217
  _committed;
@@ -249,7 +249,7 @@ var BreadcrumbGenerator = (function() {
249
249
  }
250
250
  initialize() {
251
251
  try {
252
- !this._crush && typeof window[this.scope] < "u" && (u(L, { 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);
252
+ !this._crush && typeof window[this.scope] < "u" && (c(L, { 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);
253
253
  } catch {} finally {
254
254
  window[this.scope] = this;
255
255
  }
@@ -389,7 +389,7 @@ var BreadcrumbGenerator = (function() {
389
389
  return this._classes.initialize;
390
390
  }
391
391
  set initializeClass(t) {
392
- c({ initializeClass: t }), this._classes.initialize !== t && (this._classes.initialize = t);
392
+ u({ initializeClass: t }), this._classes.initialize !== t && (this._classes.initialize = t);
393
393
  }
394
394
  get focusState() {
395
395
  return this._focusState;
@@ -442,13 +442,13 @@ var BreadcrumbGenerator = (function() {
442
442
  }
443
443
  _validate() {
444
444
  this._dispatchEvent("prevalidate", this.rootDOMElement);
445
- const t = Q(this, { shouldThrow: !1 });
445
+ const t = x(this, { shouldThrow: !1 });
446
446
  if (t.status || (this._errors = [...this._errors, ...t.errors], this._valid = !1), Object.keys(this._dom).length > 0) {
447
447
  const i = {};
448
448
  for (const o of Object.keys(this._dom)) Array.isArray(this._dom[o]) ? this._dom[o].forEach((a, w) => {
449
449
  i[`${o}Element[${w}]`] = a;
450
450
  }) : this._dom[o] !== null && (i[`${o}Element`] = this._dom[o]);
451
- const r = u(HTMLElement, i, { shouldThrow: !1 });
451
+ const r = c(HTMLElement, i, { shouldThrow: !1 });
452
452
  r.status || (this._errors = [...this._errors, ...r.errors], this._valid = !1);
453
453
  }
454
454
  if (Object.keys(this._selectors).length > 0) {
@@ -460,7 +460,7 @@ var BreadcrumbGenerator = (function() {
460
460
  if (Object.keys(this._classes).length > 0) {
461
461
  const i = {};
462
462
  for (const o of Object.keys(this._classes)) this._classes[o] !== "" && (i[`${o}Class`] = this._classes[o]);
463
- const r = c(i, { shouldThrow: !1 });
463
+ const r = u(i, { shouldThrow: !1 });
464
464
  r.status || (this._errors = [...this._errors, ...r.errors], this._valid = !1);
465
465
  }
466
466
  if (Object.keys(this._durations).length > 0) {
@@ -497,7 +497,7 @@ var BreadcrumbGenerator = (function() {
497
497
  _setDOMElementType(t, { context: e, overwrite: s = !0, strict: i = !1 } = {}) {
498
498
  if (typeof this.selectors[t] != "string") throw new Error(`Graupl ${this.name}: "${t}" is not a valid element type.`);
499
499
  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.`);
500
- u(HTMLElement, { context: e });
500
+ c(HTMLElement, { context: e });
501
501
  const r = Array.from(e.querySelectorAll(this.selectors[t])).filter((o) => i ? o.parentElement === e : !0);
502
502
  Array.isArray(this._dom[t]) ? s ? this._dom[t] = r : this._dom[t] = [...this._dom[t], ...r] : this._dom[t] = r[0] || null;
503
503
  }
@@ -517,14 +517,14 @@ var BreadcrumbGenerator = (function() {
517
517
  _handleKeydown() {}
518
518
  _handleKeyup() {}
519
519
  _store() {
520
- this._shouldStore && (u(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status || new g({ scope: "GrauplStorage" }), window.GrauplStorage.set({
520
+ this._shouldStore && (c(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status || new g({ scope: "GrauplStorage" }), window.GrauplStorage.set({
521
521
  key: this.id !== "" ? this.id : this.key,
522
522
  type: this._storageKey,
523
523
  data: this
524
524
  }));
525
525
  }
526
526
  _unstore() {
527
- this._shouldStore && u(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status && window.GrauplStorage.clear({
527
+ this._shouldStore && c(g, { storage: window.GrauplStorage }, { shouldThrow: !1 }).status && window.GrauplStorage.clear({
528
528
  key: this.id !== "" ? this.id : this.key,
529
529
  type: this._storageKey
530
530
  });
@@ -559,7 +559,7 @@ var BreadcrumbGenerator = (function() {
559
559
  });
560
560
  }
561
561
  _dispatchEvent(t, e) {
562
- F(t, this), u(HTMLElement, { element: e }), e.dispatchEvent(this.events[t]);
562
+ F(t, this), c(HTMLElement, { element: e }), e.dispatchEvent(this.events[t]);
563
563
  }
564
564
  _addEventListener(t, e, s, i = {}) {
565
565
  e.addEventListener(t, s, i), this._listeners.push({
@@ -590,7 +590,7 @@ var BreadcrumbGenerator = (function() {
590
590
  dispose() {
591
591
  this._clearIntervals(), this._clearTimeouts(), this._removeEventListeners(), this._unstore(), delete this;
592
592
  }
593
- }, x = class extends v {
593
+ }, Q = class extends v {
594
594
  _rootDOMElement = "item";
595
595
  _protectedDOMElements = ["link"];
596
596
  _storageKey = "breadcrumbItems";
@@ -619,8 +619,8 @@ var BreadcrumbGenerator = (function() {
619
619
  }, q = class extends v {
620
620
  _rootDOMElement = "breadcrumb";
621
621
  _currentChild = 0;
622
- _open = new B(!1);
623
- _locked = new B(!1);
622
+ _open = new T(!1);
623
+ _locked = new T(!1);
624
624
  _openInsideBreakpoint = !1;
625
625
  _openOutsideBreakpoint = !0;
626
626
  _closeInsideBreakpoint = !0;
@@ -666,31 +666,31 @@ var BreadcrumbGenerator = (function() {
666
666
  return this._classes.locked;
667
667
  }
668
668
  set lockedClass(t) {
669
- c({ lockedClass: t }), this._classes.locked !== t && (this._classes.locked = t);
669
+ u({ lockedClass: t }), this._classes.locked !== t && (this._classes.locked = t);
670
670
  }
671
671
  get unlockedClass() {
672
672
  return this._classes.unlocked;
673
673
  }
674
674
  set unlockedClass(t) {
675
- c({ unlockedClass: t }), this._classes.unlocked !== t && (this._classes.unlocked = t);
675
+ u({ unlockedClass: t }), this._classes.unlocked !== t && (this._classes.unlocked = t);
676
676
  }
677
677
  get openClass() {
678
678
  return this._classes.open;
679
679
  }
680
680
  set openClass(t) {
681
- c({ openClass: t }), this._classes.open !== t && (this._classes.open = t);
681
+ u({ openClass: t }), this._classes.open !== t && (this._classes.open = t);
682
682
  }
683
683
  get closeClass() {
684
684
  return this._classes.close;
685
685
  }
686
686
  set closeClass(t) {
687
- c({ closeClass: t }), this._classes.close !== t && (this._classes.close = t);
687
+ u({ closeClass: t }), this._classes.close !== t && (this._classes.close = t);
688
688
  }
689
689
  get transitionClass() {
690
690
  return this._classes.transition;
691
691
  }
692
692
  set transitionClass(t) {
693
- c({ transitionClass: t }), this._classes.transition !== t && (this._classes.transition = t);
693
+ u({ transitionClass: t }), this._classes.transition !== t && (this._classes.transition = t);
694
694
  }
695
695
  get transitionDuration() {
696
696
  return this._durations.transition;
@@ -793,7 +793,7 @@ var BreadcrumbGenerator = (function() {
793
793
  }
794
794
  _createChildElements() {
795
795
  this.dom.breadcrumbItems.forEach((t) => {
796
- const e = t.querySelector(this.selectors.breadcrumbLinks), s = t.querySelector(this.selectors.breadcrumbToggle) !== null, i = new x({
796
+ const e = t.querySelector(this.selectors.breadcrumbLinks), s = t.querySelector(this.selectors.breadcrumbToggle) !== null, i = new Q({
797
797
  breadcrumbItemElement: t,
798
798
  breadcrumbLinkElement: e,
799
799
  parentBreadcrumb: this,
@@ -803,7 +803,7 @@ var BreadcrumbGenerator = (function() {
803
803
  });
804
804
  }
805
805
  _reveal({ emit: t = this.isInitialized, transition: e = this.isInitialized } = {}) {
806
- this.dom.breadcrumbToggle.setAttribute("aria-expanded", "true"), e && this.transitionlass !== "" ? (h(this.transitionClass, this.dom.breadcrumb), requestAnimationFrame(() => {
806
+ this.dom.breadcrumbToggle && this.dom.breadcrumbToggle.setAttribute("aria-expanded", "true"), e && this.transitionlass !== "" ? (h(this.transitionClass, this.dom.breadcrumb), requestAnimationFrame(() => {
807
807
  l(this.closeClass, this.dom.breadcrumb), requestAnimationFrame(() => {
808
808
  h(this.openClass, this.dom.breadcrumb), requestAnimationFrame(() => {
809
809
  setTimeout(() => {
@@ -811,10 +811,10 @@ var BreadcrumbGenerator = (function() {
811
811
  }, this.openDuration);
812
812
  });
813
813
  });
814
- })) : (h(this.openClass, this.dom.breadcrumb), l(this.closeClass, this.dom.breadcrumb)), t && this._dispatchEvent("expand", this.dom.breadcrumbToggle);
814
+ })) : (h(this.openClass, this.dom.breadcrumb), l(this.closeClass, this.dom.breadcrumb)), t && (this.dom.breadcrumbToggle ? this._dispatchEvent("expand", this.dom.breadcrumbToggle) : this._dispatchEvent("expand", this.dom.breadcrumb));
815
815
  }
816
816
  _conceal({ emit: t = this.isInitialized, transition: e = this.isInitialized } = {}) {
817
- this.dom.breadcrumbToggle.setAttribute("aria-expanded", "false"), e && this.transitionClass !== "" ? (h(this.transitionClass, this.dom.breadcrumb), requestAnimationFrame(() => {
817
+ this.dom.breadcrumbToggle && this.dom.breadcrumbToggle.setAttribute("aria-expanded", "false"), e && this.transitionClass !== "" ? (h(this.transitionClass, this.dom.breadcrumb), requestAnimationFrame(() => {
818
818
  l(this.openClass, this.dom.breadcrumb), requestAnimationFrame(() => {
819
819
  h(this.closeClass, this.dom.breadcrumb), requestAnimationFrame(() => {
820
820
  setTimeout(() => {
@@ -822,13 +822,13 @@ var BreadcrumbGenerator = (function() {
822
822
  }, this.closeDuration);
823
823
  });
824
824
  });
825
- })) : (h(this.closeClass, this.dom.breadcrumb), l(this.openClass, this.dom.breadcrumb)), t && this._dispatchEvent("collapse", this.dom.breadcrumbToggle);
825
+ })) : (h(this.closeClass, this.dom.breadcrumb), l(this.openClass, this.dom.breadcrumb)), t && (this.dom.breadcrumbToggle ? this._dispatchEvent("collapse", this.dom.breadcrumbToggle) : this._dispatchEvent("collapse", this.dom.breadcrumb));
826
826
  }
827
827
  _lock({ emit: t = this.isInitialized } = {}) {
828
- h(this.lockedClass, this.dom.breadcrumb), l(this.unlockedClass, this.dom.breadcrumb), this.dom.breadcrumbToggle.setAttribute("disabled", "true"), t && this._dispatchEvent("lock", this.dom.breadcrumbToggle);
828
+ h(this.lockedClass, this.dom.breadcrumb), l(this.unlockedClass, this.dom.breadcrumb), this.dom.breadcrumbToggle && this.dom.breadcrumbToggle.setAttribute("disabled", "true"), t && (this.dom.breadcrumbToggle ? this._dispatchEvent("lock", this.dom.breadcrumbToggle) : this._dispatchEvent("lock", this.dom.breadcrumb));
829
829
  }
830
830
  _unlock({ emit: t = this.isInitialized } = {}) {
831
- h(this.unlockedClass, this.dom.breadcrumb), l(this.lockedClass, this.dom.breadcrumb), this.dom.breadcrumbToggle.removeAttribute("disabled"), t && this._dispatchEvent("unlock", this.dom.breadcrumbToggle);
831
+ h(this.unlockedClass, this.dom.breadcrumb), l(this.lockedClass, this.dom.breadcrumb), this.dom.breadcrumbToggle && this.dom.breadcrumbToggle.removeAttribute("disabled"), t && (this.dom.breadcrumbToggle ? this._dispatchEvent("unlock", this.dom.breadcrumbToggle) : this._dispatchEvent("unlock", this.dom.breadcrumb));
832
832
  }
833
833
  _handleFocus() {
834
834
  this.elements.breadcrumbItems.forEach((t, e) => {
@@ -840,26 +840,30 @@ var BreadcrumbGenerator = (function() {
840
840
  });
841
841
  }
842
842
  _handleClick() {
843
- this.dom.breadcrumbToggle && (this._addEventListener("click", this.dom.breadcrumbToggle, (t) => {
844
- this.currentEvent = "mouse", t.button === 0 && (d(t), this.toggle());
845
- }), this._addEventListener("click", document, (t) => {
843
+ this._addEventListener("click", document, (t) => {
846
844
  this.focusState !== "self" || !this.closeOnBlur || (this.currentEvent = "mouse", !this.dom.breadcrumb.contains(t.target) && this.dom.breadcrumbToggle !== t.target && this.close());
847
- }));
845
+ }), this.dom.breadcrumbToggle && this._addEventListener("click", this.dom.breadcrumbToggle, (t) => {
846
+ this.currentEvent = "mouse", t.button === 0 && (d(t), this.toggle());
847
+ });
848
848
  }
849
849
  _handleKeydown() {
850
- this.dom.breadcrumbToggle && (this._addEventListener("keydown", this.dom.breadcrumbToggle, (t) => {
850
+ this._addEventListener("keydown", this.dom.breadcrumb, (t) => {
851
+ this.currentEvent = "keyboard", m(t) === "Escape" && d(t);
852
+ }), this.dom.breadcrumbToggle && this._addEventListener("keydown", this.dom.breadcrumbToggle, (t) => {
851
853
  switch (this.currentEvent = "keyboard", m(t)) {
852
854
  case "Space":
853
855
  case "Enter":
854
856
  d(t);
855
857
  break;
856
858
  }
857
- }), this._addEventListener("keydown", this.dom.breadcrumb, (t) => {
858
- this.currentEvent = "keyboard", m(t) === "Escape" && d(t);
859
- }));
859
+ });
860
860
  }
861
861
  _handleKeyup() {
862
- this.dom.breadcrumbToggle && (this._addEventListener("keyup", this.dom.breadcrumbToggle, (t) => {
862
+ this._addEventListener("keyup", this.dom.breadcrumb, (t) => {
863
+ this.currentEvent = "keyboard", m(t) === "Escape" && (d(t), this.close(), this.currentChild > this.elements.breadcrumbItems.indexOf(this.elements.breadcrumbToggle) && requestAnimationFrame(() => {
864
+ this.focusToggle();
865
+ }));
866
+ }), this.dom.breadcrumbToggle && this._addEventListener("keyup", this.dom.breadcrumbToggle, (t) => {
863
867
  switch (this.currentEvent = "keyboard", m(t)) {
864
868
  case "Space":
865
869
  case "Enter":
@@ -873,11 +877,7 @@ var BreadcrumbGenerator = (function() {
873
877
  }));
874
878
  break;
875
879
  }
876
- }), this._addEventListener("keyup", this.dom.breadcrumb, (t) => {
877
- this.currentEvent = "keyboard", m(t) === "Escape" && (d(t), this.close(), this.currentChild > this.elements.breadcrumbItems.indexOf(this.elements.breadcrumbToggle) && requestAnimationFrame(() => {
878
- this.focusToggle();
879
- }));
880
- }));
880
+ });
881
881
  }
882
882
  open({ force: t = !1, emit: e = this.isInitialized, transition: s = this.isInitialized, preserveState: i = !1 } = {}) {
883
883
  this.isOpen && !t || this.isLocked && !t || (this.focusState = "self", this._reveal({
@@ -952,13 +952,13 @@ var BreadcrumbGenerator = (function() {
952
952
  this.focusState = "self", this.elements.breadcrumbToggle !== null && (this.currentChild = this.elements.breadcrumbItems.indexOf(this.elements.breadcrumbToggle) || 0, this.elements.breadcrumbToggle.focus());
953
953
  }
954
954
  };
955
- const T = /[\11\12\14\15\40]+/, k = "data-once", V = document;
955
+ const B = /[\11\12\14\15\40]+/, k = "data-once", V = document;
956
956
  function y(t, e, s) {
957
957
  return t[`${e}Attribute`](k, s);
958
958
  }
959
959
  function f(t) {
960
960
  if (typeof t != "string") throw new TypeError("once ID must be a string");
961
- if (t === "" || T.test(t)) throw new RangeError("once ID must not be empty or contain spaces");
961
+ if (t === "" || B.test(t)) throw new RangeError("once ID must not be empty or contain spaces");
962
962
  return `[${k}~="${t}"]`;
963
963
  }
964
964
  function P(t) {
@@ -981,7 +981,7 @@ var BreadcrumbGenerator = (function() {
981
981
  }
982
982
  function I(t, { add: e, remove: s }) {
983
983
  const i = [];
984
- y(t, "has") && y(t, "get").trim().split(T).forEach((o) => {
984
+ y(t, "has") && y(t, "get").trim().split(B).forEach((o) => {
985
985
  i.indexOf(o) < 0 && o !== s && i.push(o);
986
986
  }), e && i.push(e);
987
987
  const r = i.join(" ");