@sbb-esta/lyne-elements 0.52.1 → 0.52.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.
Files changed (71) hide show
  1. package/accordion.js +54 -54
  2. package/action-group.js +3 -3
  3. package/alert/alert-group.js +22 -22
  4. package/alert/alert.js +22 -22
  5. package/autocomplete.js +126 -126
  6. package/breadcrumb/breadcrumb-group.js +60 -60
  7. package/breadcrumb/breadcrumb.js +17 -17
  8. package/calendar.js +423 -423
  9. package/card/card-badge.js +17 -17
  10. package/card/card.js +2 -2
  11. package/card/common.js +30 -30
  12. package/checkbox/checkbox-group.js +17 -17
  13. package/checkbox/checkbox.js +34 -34
  14. package/clock.js +83 -83
  15. package/container/sticky-bar.js +16 -16
  16. package/core/a11y.js +91 -91
  17. package/core/base-elements.js +86 -86
  18. package/core/controllers.js +40 -40
  19. package/core/datetime.js +32 -32
  20. package/core/dom.js +26 -26
  21. package/core/eventing.js +33 -33
  22. package/core/mixins.js +122 -122
  23. package/core/testing.js +29 -29
  24. package/datepicker/common.js +55 -55
  25. package/datepicker/datepicker-toggle.js +94 -94
  26. package/datepicker/datepicker.js +144 -144
  27. package/dialog/dialog-title.js +20 -20
  28. package/dialog/dialog.js +66 -66
  29. package/expansion-panel/expansion-panel-header.js +20 -20
  30. package/expansion-panel/expansion-panel.js +60 -60
  31. package/file-selector.js +91 -91
  32. package/form-field/form-field-clear.js +12 -12
  33. package/form-field/form-field.js +111 -111
  34. package/header/header.js +53 -53
  35. package/icon.js +107 -107
  36. package/image.js +87 -87
  37. package/journey-header.js +29 -29
  38. package/map-container.js +23 -23
  39. package/menu/menu.js +91 -91
  40. package/navigation/common.js +16 -16
  41. package/navigation/navigation-marker.js +34 -34
  42. package/navigation/navigation-section.js +83 -83
  43. package/navigation/navigation.js +87 -87
  44. package/notification.js +52 -52
  45. package/option/optgroup.js +45 -45
  46. package/option/option.js +108 -108
  47. package/overlay.js +5 -5
  48. package/package.json +1 -1
  49. package/popover/popover.js +110 -110
  50. package/radio-button/radio-button-group.js +93 -93
  51. package/radio-button/radio-button.js +84 -84
  52. package/select.js +178 -178
  53. package/selection-panel.js +44 -44
  54. package/slider.js +58 -58
  55. package/status.js +6 -6
  56. package/stepper/step-label.js +19 -19
  57. package/stepper/step.js +31 -31
  58. package/stepper/stepper.js +46 -46
  59. package/tabs/tab-group.js +67 -67
  60. package/tag/tag-group.js +8 -8
  61. package/tag/tag.js +27 -27
  62. package/teaser-paid.js +12 -12
  63. package/time-input.js +73 -73
  64. package/timetable-occupancy-icon.js +26 -26
  65. package/timetable-occupancy.js +9 -9
  66. package/toast.js +38 -38
  67. package/toggle/toggle-option.js +33 -33
  68. package/toggle/toggle.js +46 -46
  69. package/train/train-formation.js +36 -36
  70. package/train/train-wagon.js +30 -30
  71. package/train/train.js +13 -13
@@ -1,30 +1,30 @@
1
- import { isServer as l } from "lit";
1
+ import { isServer as d } from "lit";
2
2
  import { readConfig as u } from "./config.js";
3
- import { AgnosticMutationObserver as m } from "./observers.js";
4
- class A {
3
+ import { AgnosticMutationObserver as _ } from "./observers.js";
4
+ class b {
5
5
  constructor(t) {
6
- this.b = t, this.a = new AbortController(), this.b.addController(this);
6
+ this._host = t, this._abortController = new AbortController(), this._host.addController(this);
7
7
  }
8
8
  get signal() {
9
9
  var t;
10
- return (t = this.a) == null ? void 0 : t.signal;
10
+ return (t = this._abortController) == null ? void 0 : t.signal;
11
11
  }
12
12
  hostConnected() {
13
- this.a || (this.a = new AbortController());
13
+ this._abortController || (this._abortController = new AbortController());
14
14
  }
15
15
  hostDisconnected() {
16
16
  var t;
17
- (t = this.a) == null || t.abort(), this.a = void 0;
17
+ (t = this._abortController) == null || t.abort(), this._abortController = void 0;
18
18
  }
19
19
  }
20
20
  const e = class e {
21
21
  constructor(t) {
22
- this.g = t, this.f = [], this.g.addController(this);
22
+ this._host = t, this._handlers = [], this._host.addController(this);
23
23
  }
24
24
  /** Get the current language. */
25
25
  static get current() {
26
- const s = ((u().language ?? (l ? e.b : document.documentElement.getAttribute("lang"))) || e.b).split("-")[0];
27
- return e.h.includes(s) ? s : e.b;
26
+ const s = ((u().language ?? (d ? e._defaultLanguage : document.documentElement.getAttribute("lang"))) || e._defaultLanguage).split("-")[0];
27
+ return e._supportedLocales.includes(s) ? s : e._defaultLanguage;
28
28
  }
29
29
  /** Get the current language. */
30
30
  get current() {
@@ -32,57 +32,57 @@ const e = class e {
32
32
  }
33
33
  /** Add a language change handler. */
34
34
  withHandler(t) {
35
- return this.f.unshift(t), this;
35
+ return this._handlers.unshift(t), this;
36
36
  }
37
37
  hostConnected() {
38
- e.a.size || e.d.observe(
38
+ e._listeners.size || e._observer.observe(
39
39
  document.documentElement,
40
- e.i
41
- ), e.a.add(this), this.c !== this.current && this.e(this.c !== void 0);
40
+ e._observerConfig
41
+ ), e._listeners.add(this), this._previousLanguage !== this.current && this._callHandlers(this._previousLanguage !== void 0);
42
42
  }
43
43
  hostDisconnected() {
44
- this.c = this.current, e.a.delete(this), e.a.size || e.d.disconnect();
44
+ this._previousLanguage = this.current, e._listeners.delete(this), e._listeners.size || e._observer.disconnect();
45
45
  }
46
- e(t = !0) {
47
- this.f.forEach((s) => s()), t && this.g.requestUpdate();
46
+ _callHandlers(t = !0) {
47
+ this._handlers.forEach((s) => s()), t && this._host.requestUpdate();
48
48
  }
49
49
  };
50
- e.b = "en", e.h = ["en", "de", "fr", "it"], e.a = /* @__PURE__ */ new Set(), e.d = new m((t) => {
51
- t[0].oldValue !== document.documentElement.getAttribute("lang") && e.a.forEach((s) => s.e());
52
- }), e.i = {
50
+ e._defaultLanguage = "en", e._supportedLocales = ["en", "de", "fr", "it"], e._listeners = /* @__PURE__ */ new Set(), e._observer = new _((t) => {
51
+ t[0].oldValue !== document.documentElement.getAttribute("lang") && e._listeners.forEach((s) => s._callHandlers());
52
+ }), e._observerConfig = {
53
53
  attributeFilter: ["lang"],
54
54
  attributeOldValue: !0
55
55
  };
56
- let c = e;
57
- class v {
56
+ let h = e;
57
+ class C {
58
58
  constructor(t, s = null) {
59
- this.a = t, this.d = s, this.slots = /* @__PURE__ */ new Set(), this.b = (i) => {
60
- this.c(i.target);
61
- }, this.a.addController(this);
59
+ this._host = t, this._onChangeCallback = s, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (o) => {
60
+ this._syncSlots(o.target);
61
+ }, this._host.addController(this);
62
62
  }
63
63
  hostConnected() {
64
64
  var t;
65
- this.c(...this.a.querySelectorAll("slot")), (t = this.a.shadowRoot) == null || t.addEventListener("slotchange", this.b);
65
+ this._syncSlots(...this._host.querySelectorAll("slot")), (t = this._host.shadowRoot) == null || t.addEventListener("slotchange", this._slotchangeHandler);
66
66
  }
67
67
  hostDisconnected() {
68
68
  var t;
69
- (t = this.a.shadowRoot) == null || t.removeEventListener("slotchange", this.b);
69
+ (t = this._host.shadowRoot) == null || t.removeEventListener("slotchange", this._slotchangeHandler);
70
70
  }
71
- c(...t) {
72
- var o;
73
- for (const n of t) {
74
- const a = n.name || "unnamed";
75
- n.assignedNodes().some((r) => {
76
- var h;
77
- return "tagName" in r || ((h = r.textContent) == null ? void 0 : h.trim());
78
- }) ? this.slots.add(a) : this.slots.delete(a);
71
+ _syncSlots(...t) {
72
+ var n;
73
+ for (const r of t) {
74
+ const i = r.name || "unnamed";
75
+ r.assignedNodes().some((l) => {
76
+ var a;
77
+ return "tagName" in l || ((a = l.textContent) == null ? void 0 : a.trim());
78
+ }) ? this.slots.add(i) : this.slots.delete(i);
79
79
  }
80
- const s = this.a.getAttribute("data-slot-names"), i = [...this.slots].sort().join(" ");
81
- i ? this.a.getAttribute("data-slot-names") !== i && this.a.setAttribute("data-slot-names", i) : this.a.removeAttribute("data-slot-names"), i !== s && ((o = this.d) == null || o.call(this));
80
+ const s = this._host.getAttribute("data-slot-names"), o = [...this.slots].sort().join(" ");
81
+ o ? this._host.getAttribute("data-slot-names") !== o && this._host.setAttribute("data-slot-names", o) : this._host.removeAttribute("data-slot-names"), o !== s && ((n = this._onChangeCallback) == null || n.call(this));
82
82
  }
83
83
  }
84
84
  export {
85
- A as SbbConnectedAbortController,
86
- c as SbbLanguageController,
87
- v as SbbSlotStateController
85
+ b as SbbConnectedAbortController,
86
+ h as SbbLanguageController,
87
+ C as SbbSlotStateController
88
88
  };
package/core/datetime.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SbbLanguageController as i } from "./controllers.js";
2
- const o = 7, m = 4, d = 4, f = 24, u = /(^0?[1-9]?|[12]?[0-9]?|3?[01]?)[.,\\/\-\s](0?[1-9]?|1?[0-2]?)?[.,\\/\-\s](\d{1,4}$)?/;
2
+ const o = 7, f = 4, m = 4, d = 24, u = /(^0?[1-9]?|[12]?[0-9]?|3?[01]?)[.,\\/\-\s](0?[1-9]?|1?[0-2]?)?[.,\\/\-\s](\d{1,4}$)?/;
3
3
  class l {
4
4
  /**
5
5
  * Attempts to deserialize a value to a valid date object. This is different from parsing in that
@@ -16,7 +16,7 @@ class l {
16
16
  * @param date The date to convert to ISO String.
17
17
  */
18
18
  toIso8601(t) {
19
- const e = (r, n = 2) => `${r}`.padStart(n, "0");
19
+ const e = (r, a = 2) => `${r}`.padStart(a, "0");
20
20
  return `${e(this.getYear(t), 4)}-${e(this.getMonth(t))}-${e(this.getDate(t))}`;
21
21
  }
22
22
  /**
@@ -54,8 +54,8 @@ class l {
54
54
  */
55
55
  sameDate(t, e) {
56
56
  if (t && e) {
57
- const r = this.isValid(t), n = this.isValid(e);
58
- return r && n ? !this.compareDate(t, e) : r == n;
57
+ const r = this.isValid(t), a = this.isValid(e);
58
+ return r && a ? !this.compareDate(t, e) : r == a;
59
59
  }
60
60
  return t == e;
61
61
  }
@@ -74,7 +74,7 @@ class l {
74
74
  const D = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
75
75
  class c extends l {
76
76
  constructor(t = 15) {
77
- super(), this.b = t;
77
+ super(), this._cutoffYearOffset = t;
78
78
  }
79
79
  /** Gets the year of the input date. */
80
80
  getYear(t) {
@@ -108,12 +108,12 @@ class c extends l {
108
108
  */
109
109
  getMonthNames(t) {
110
110
  const e = new Intl.DateTimeFormat(i.current, { month: t });
111
- return this.a(12, (r) => e.format(new Date(2017, r, 1)));
111
+ return this._range(12, (r) => e.format(new Date(2017, r, 1)));
112
112
  }
113
113
  /** Creates a string array with length = 31, filled with the days in a month, starting from 1. */
114
114
  getDateNames() {
115
115
  const t = new Intl.DateTimeFormat(i.current, { day: "numeric" });
116
- return this.a(31, (e) => t.format(new Date(2017, 0, e + 1)));
116
+ return this._range(31, (e) => t.format(new Date(2017, 0, e + 1)));
117
117
  }
118
118
  /**
119
119
  * Creates a string array with length = 7, filled with the name of the days in a week starting from Sunday, in the document language.
@@ -122,7 +122,7 @@ class c extends l {
122
122
  */
123
123
  getDayOfWeekNames(t) {
124
124
  const e = new Intl.DateTimeFormat(i.current, { weekday: t });
125
- return this.a(7, (r) => e.format(new Date(2017, 0, r + 1)));
125
+ return this._range(7, (r) => e.format(new Date(2017, 0, r + 1)));
126
126
  }
127
127
  /* Defines which is the first day of the week (0: sunday; 1: monday; etc.). */
128
128
  getFirstDayOfWeek() {
@@ -130,7 +130,7 @@ class c extends l {
130
130
  }
131
131
  /** Calculates the number of days in a month given the year and the month. */
132
132
  getNumDaysInMonth(t) {
133
- return this.getDate(this.c(this.getYear(t), this.getMonth(t), 0));
133
+ return this.getDate(this._createDateWithOverflow(this.getYear(t), this.getMonth(t), 0));
134
134
  }
135
135
  /** Creates today's date. */
136
136
  today() {
@@ -142,10 +142,10 @@ class c extends l {
142
142
  throw Error(`Invalid month index "${e}". Month index has to be between 1 and 12.`);
143
143
  if (r < 1)
144
144
  throw Error(`Invalid date "${r}". Date has to be greater than 0.`);
145
- const n = this.c(t, e - 1, r);
146
- if (n.getMonth() + 1 !== e)
145
+ const a = this._createDateWithOverflow(t, e - 1, r);
146
+ if (a.getMonth() + 1 !== e)
147
147
  throw Error(`Invalid date "${r}" for month with index "${e}".`);
148
- return n;
148
+ return a;
149
149
  }
150
150
  /** Checks whether the given `obj` is a Date. */
151
151
  isDateInstance(t) {
@@ -173,8 +173,8 @@ class c extends l {
173
173
  * E.g., with `date` = new Date(2022, 0, 31) and `months` = 1, it returns new Date(2022, 1, 28).
174
174
  */
175
175
  addCalendarMonths(t, e) {
176
- const r = t.getMonth() + e, n = new Date(t.getFullYear(), r, 1, 0, 0, 0, 0), a = this.getNumDaysInMonth(n);
177
- return new Date(this.clone(t).setMonth(r, Math.min(a, t.getDate())));
176
+ const r = t.getMonth() + e, a = new Date(t.getFullYear(), r, 1, 0, 0, 0, 0), n = this.getNumDaysInMonth(a);
177
+ return new Date(this.clone(t).setMonth(r, Math.min(n, t.getDate())));
178
178
  }
179
179
  /** Creates a new date by adding the number of provided `days` to the provided `date`. */
180
180
  addCalendarDays(t, e) {
@@ -198,15 +198,15 @@ class c extends l {
198
198
  parse(t, e) {
199
199
  if (!t)
200
200
  return;
201
- const r = t.replace(/\D/g, " ").trim(), n = r == null ? void 0 : r.match(u);
202
- if (!n || n.index !== 0 || n.length <= 2 || n.some((s) => s === void 0) || !this.isValid(this.createDate(+n[3], +n[2], +n[1])))
201
+ const r = t.replace(/\D/g, " ").trim(), a = r == null ? void 0 : r.match(u);
202
+ if (!a || a.index !== 0 || a.length <= 2 || a.some((s) => s === void 0) || !this.isValid(this.createDate(+a[3], +a[2], +a[1])))
203
203
  return;
204
- let a = +n[3];
205
- if (typeof a == "number" && a < 100 && a >= 0) {
206
- const s = e.getFullYear() - 2e3 + this.b;
207
- a = a <= s ? 2e3 + a : 1900 + a;
204
+ let n = +a[3];
205
+ if (typeof n == "number" && n < 100 && n >= 0) {
206
+ const s = e.getFullYear() - 2e3 + this._cutoffYearOffset;
207
+ n = n <= s ? 2e3 + n : 1900 + n;
208
208
  }
209
- return new Date(a, +n[2] - 1, +n[1]);
209
+ return new Date(n, +a[2] - 1, +a[1]);
210
210
  }
211
211
  format(t) {
212
212
  if (!t)
@@ -216,10 +216,10 @@ class c extends l {
216
216
  month: "2-digit",
217
217
  year: "numeric"
218
218
  });
219
- let a = new Intl.DateTimeFormat(e, {
219
+ let n = new Intl.DateTimeFormat(e, {
220
220
  weekday: "short"
221
221
  }).format(t);
222
- return a = a.charAt(0).toUpperCase() + a.charAt(1), `${a}, ${r.format(t)}`;
222
+ return n = n.charAt(0).toUpperCase() + n.charAt(1), `${n}, ${r.format(t)}`;
223
223
  }
224
224
  invalid() {
225
225
  return /* @__PURE__ */ new Date(NaN);
@@ -229,16 +229,16 @@ class c extends l {
229
229
  * @param length The length of the array to be created.
230
230
  * @param valueFunction The function of array's index used to fill the array.
231
231
  */
232
- a(t, e) {
232
+ _range(t, e) {
233
233
  const r = Array(t);
234
- for (let n = 0; n < t; n++)
235
- r[n] = e(n);
234
+ for (let a = 0; a < t; a++)
235
+ r[a] = e(a);
236
236
  return r;
237
237
  }
238
238
  /** Creates a date but allows the month and date to overflow. */
239
- c(t, e, r) {
240
- const n = new Date(t, e, r);
241
- return t >= 0 && t < 100 && n.setFullYear(this.getYear(n) - 1900), n;
239
+ _createDateWithOverflow(t, e, r) {
240
+ const a = new Date(t, e, r);
241
+ return t >= 0 && t < 100 && a.setFullYear(this.getYear(a) - 1900), a;
242
242
  }
243
243
  }
244
244
  const w = new c();
@@ -246,9 +246,9 @@ export {
246
246
  o as DAYS_PER_ROW,
247
247
  l as DateAdapter,
248
248
  u as FORMAT_DATE,
249
- m as MONTHS_PER_ROW,
249
+ f as MONTHS_PER_ROW,
250
250
  c as NativeDateAdapter,
251
- f as YEARS_PER_PAGE,
252
- d as YEARS_PER_ROW,
251
+ d as YEARS_PER_PAGE,
252
+ m as YEARS_PER_ROW,
253
253
  w as defaultDateAdapter
254
254
  };
package/core/dom.js CHANGED
@@ -7,14 +7,14 @@ function S(t, n, o) {
7
7
  i.getPropertyValue(
8
8
  `--sbb-breakpoint-${n}-${o != null && o.includeMaxBreakpoint ? "max" : "min"}`
9
9
  )
10
- ) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", f = r && `(min-width: ${r})`, y = s && `(max-width: ${s})`, g = r && s && " and ";
11
- return window.matchMedia(`${f}${g}${y}`).matches;
10
+ ) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", f = r && `(min-width: ${r})`, g = s && `(max-width: ${s})`, y = r && s && " and ";
11
+ return window.matchMedia(`${f}${y}${g}`).matches;
12
12
  }
13
13
  function h(t) {
14
14
  return e ? null : typeof t == "string" ? document.getElementById(t) : t instanceof window.Element ? t : null;
15
15
  }
16
- const x = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
- function k(t, n) {
16
+ const p = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
+ function x(t, n) {
18
18
  if (e)
19
19
  return null;
20
20
  for (n = n.parentElement ?? n.getRootNode().host; n && n !== document && n !== window; ) {
@@ -25,8 +25,8 @@ function k(t, n) {
25
25
  }
26
26
  return null;
27
27
  }
28
- const p = "a,button,sbb-teaser-hero,sbb-teaser";
29
- function $(t, n) {
28
+ const k = "a,button,sbb-teaser-hero,sbb-teaser";
29
+ function I(t, n) {
30
30
  var o;
31
31
  if (!n) {
32
32
  const i = (o = t.closest) == null ? void 0 : o.call(t, "sbb-form-field");
@@ -34,7 +34,7 @@ function $(t, n) {
34
34
  }
35
35
  return h(n);
36
36
  }
37
- function I(t, n, o) {
37
+ function $(t, n, o) {
38
38
  o ? t.setAttribute(n, o) : t.removeAttribute(n);
39
39
  }
40
40
  let a;
@@ -43,31 +43,31 @@ try {
43
43
  } catch {
44
44
  a = !1;
45
45
  }
46
- const m = !e && /(edge)/i.test(navigator.userAgent), c = !e && /(msie|trident)/i.test(navigator.userAgent), w = !e && !!(window.chrome || a) && typeof CSS < "u" && !m && !c, v = !e && /AppleWebKit/i.test(navigator.userAgent) && !w && !m && !c, M = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), W = !e && /(firefox|minefield)/i.test(navigator.userAgent), B = !e && /android/i.test(navigator.userAgent) && !c, C = !e && /safari/i.test(navigator.userAgent) && v;
46
+ const m = !e && /(edge)/i.test(navigator.userAgent), c = !e && /(msie|trident)/i.test(navigator.userAgent), w = !e && !!(window.chrome || a) && typeof CSS < "u" && !m && !c, v = !e && /AppleWebKit/i.test(navigator.userAgent) && !w && !m && !c, M = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), _ = !e && /(firefox|minefield)/i.test(navigator.userAgent), W = !e && /android/i.test(navigator.userAgent) && !c, B = !e && /safari/i.test(navigator.userAgent) && v;
47
47
  var l, b;
48
- const N = !e && ((b = (l = navigator.userAgentData) == null ? void 0 : l.brands) == null ? void 0 : b.some((t) => t.brand == "Chromium")), P = () => !!globalThis.next;
48
+ const C = !e && ((b = (l = navigator.userAgentData) == null ? void 0 : l.brands) == null ? void 0 : b.some((t) => t.brand == "Chromium")), N = () => !!globalThis.next;
49
49
  function u() {
50
50
  return document.body.hasAttribute("data-sbb-scroll-disabled");
51
51
  }
52
- class R {
52
+ class P {
53
53
  disableScroll() {
54
54
  if (u())
55
55
  return;
56
- this.a = document.body.style.position, this.b = document.body.style.overflow, this.c = document.body.style.marginInlineEnd;
56
+ this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
57
57
  const n = window.innerWidth - document.documentElement.clientWidth;
58
58
  document.body.style.overflow = "hidden", document.body.style.position = "relative", document.body.style.marginInlineEnd = `${n}px`, document.body.style.setProperty("--sbb-scrollbar-width", `${n}px`), document.body.toggleAttribute("data-sbb-scroll-disabled", !0);
59
59
  }
60
60
  enableScroll() {
61
- u() && (document.body.style.position = this.a || "", document.body.style.overflow = this.b || "", document.body.style.marginInlineEnd = this.c || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
61
+ u() && (document.body.style.position = this._position || "", document.body.style.overflow = this._overflow || "", document.body.style.marginInlineEnd = this._marginInlineEnd || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
62
62
  }
63
63
  }
64
64
  const d = /* @__PURE__ */ new Map();
65
- function T(t) {
65
+ function R(t) {
66
66
  if (d.has(t.constructor))
67
67
  return d.get(t.constructor);
68
68
  const n = (
69
69
  // eslint-disable-next-line @typescript-eslint/naming-convention
70
- customElements.a
70
+ customElements.__definitions
71
71
  );
72
72
  for (const [o, i] of n)
73
73
  if (i.ctor === t.constructor)
@@ -75,25 +75,25 @@ function T(t) {
75
75
  throw new Error(`Given element ${t.constructor.name} has not been registered yet.`);
76
76
  }
77
77
  export {
78
- p as ACTION_ELEMENTS,
79
- R as SbbScrollHandler,
78
+ k as ACTION_ELEMENTS,
79
+ P as SbbScrollHandler,
80
80
  E as breakpoints,
81
- $ as findInput,
81
+ I as findInput,
82
82
  h as findReferencedElement,
83
- x as getDocumentWritingMode,
84
- T as getLocalName,
85
- k as hostContext,
86
- B as isAndroid,
83
+ p as getDocumentWritingMode,
84
+ R as getLocalName,
85
+ x as hostContext,
86
+ W as isAndroid,
87
87
  w as isBlink,
88
88
  S as isBreakpoint,
89
- N as isChromium,
89
+ C as isChromium,
90
90
  m as isEdge,
91
- W as isFirefox,
91
+ _ as isFirefox,
92
92
  M as isIOS,
93
- P as isNextjs,
94
- C as isSafari,
93
+ N as isNextjs,
94
+ B as isSafari,
95
95
  c as isTrident,
96
96
  v as isWebkit,
97
97
  u as pageScrollDisabled,
98
- I as setOrRemoveAttribute
98
+ $ as setOrRemoveAttribute
99
99
  };
package/core/eventing.js CHANGED
@@ -1,16 +1,16 @@
1
- function a(t, e, n = null) {
2
- const o = t.composedPath();
3
- let s = o.findIndex((r) => r === n);
4
- return s === -1 && (s = void 0), o.slice(0, s).find((r) => r instanceof window.HTMLElement && r.hasAttribute(e));
1
+ function a(t, e, o = null) {
2
+ const n = t.composedPath();
3
+ let s = n.findIndex((r) => r === o);
4
+ return s === -1 && (s = void 0), n.slice(0, s).find((r) => r instanceof window.HTMLElement && r.hasAttribute(e));
5
5
  }
6
6
  const c = {
7
7
  bubbles: !0,
8
8
  cancelable: !0,
9
9
  composed: !0
10
10
  };
11
- class u {
12
- constructor(e, n, o = c) {
13
- this.a = e, this.b = n, this.c = o;
11
+ class l {
12
+ constructor(e, o, n = c) {
13
+ this._element = e, this._eventName = o, this._options = n;
14
14
  }
15
15
  /**
16
16
  * Dispatches an event.
@@ -19,61 +19,61 @@ class u {
19
19
  * if preventDefault() was called. Always returns true in SSR.
20
20
  */
21
21
  emit(e) {
22
- var n, o;
23
- return ((o = (n = this.a).dispatchEvent) == null ? void 0 : o.call(
24
- n,
25
- new CustomEvent(this.b, { ...this.c, detail: e })
22
+ var o, n;
23
+ return ((n = (o = this._element).dispatchEvent) == null ? void 0 : n.call(
24
+ o,
25
+ new CustomEvent(this._eventName, { ...this._options, detail: e })
26
26
  )) ?? !0;
27
27
  }
28
28
  }
29
- function d(t) {
29
+ function u(t) {
30
30
  return t.composedPath ? t.composedPath()[0] : t.target;
31
31
  }
32
32
  function i(t) {
33
33
  t.key === " " && t.preventDefault();
34
34
  }
35
- const l = ({ host: t, signal: e }) => {
35
+ const d = ({ host: t, signal: e }) => {
36
36
  t.addEventListener("keydown", i, { signal: e });
37
37
  };
38
38
  function h(t, e) {
39
- const n = Object.getPrototypeOf(t).constructor, o = new n(t.type, t);
40
- e.dispatchEvent(o);
39
+ const o = Object.getPrototypeOf(t).constructor, n = new o(t.type, t);
40
+ e.dispatchEvent(n);
41
41
  }
42
- class f {
43
- constructor(e, ...n) {
44
- this.c = e, this.b = n;
42
+ class p {
43
+ constructor(e, ...o) {
44
+ this._host = e, this._aspects = o;
45
45
  }
46
46
  connect() {
47
- var n;
48
- (n = this.a) == null || n.abort(), this.a = new AbortController();
49
- const e = { host: this.c, signal: this.a.signal };
50
- for (const o of this.b)
51
- o(e);
47
+ var o;
48
+ (o = this._controller) == null || o.abort(), this._controller = new AbortController();
49
+ const e = { host: this._host, signal: this._controller.signal };
50
+ for (const n of this._aspects)
51
+ n(e);
52
52
  }
53
53
  disconnect() {
54
54
  var e;
55
- (e = this.a) == null || e.abort();
55
+ (e = this._controller) == null || e.abort();
56
56
  }
57
57
  }
58
- async function p(t) {
58
+ async function f(t) {
59
59
  return await new Promise((e) => setTimeout(e)), t.defaultPrevented;
60
60
  }
61
61
  const m = (t, e) => {
62
- let n = !1;
62
+ let o = !1;
63
63
  return (...s) => {
64
- n || (t(...s), n = !0, setTimeout(() => {
65
- n = !1;
64
+ o || (t(...s), o = !0, setTimeout(() => {
65
+ o = !1;
66
66
  }, e));
67
67
  };
68
68
  };
69
69
  export {
70
- u as EventEmitter,
71
- f as HandlerRepository,
70
+ l as EventEmitter,
71
+ p as HandlerRepository,
72
72
  a as composedPathHasAttribute,
73
- l as formElementHandlerAspect,
73
+ d as formElementHandlerAspect,
74
74
  h as forwardEventToHost,
75
- d as getEventTarget,
76
- p as isEventPrevented,
75
+ u as getEventTarget,
76
+ f as isEventPrevented,
77
77
  i as preventScrollOnSpacebarPress,
78
78
  m as throttle
79
79
  };