@sbb-esta/lyne-elements 0.52.0 → 0.52.1

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 (220) 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/breadcrumb-group.d.ts.map +1 -1
  7. package/breadcrumb/breadcrumb-group.js +70 -69
  8. package/breadcrumb/breadcrumb.js +17 -17
  9. package/calendar.js +423 -423
  10. package/card/card-badge.js +17 -17
  11. package/card/card.js +2 -2
  12. package/card/common.js +30 -30
  13. package/checkbox/checkbox-group.js +17 -17
  14. package/checkbox/checkbox.js +34 -34
  15. package/clock.js +83 -83
  16. package/container/sticky-bar.js +16 -16
  17. package/core/a11y.js +91 -91
  18. package/core/base-elements.js +87 -88
  19. package/core/controllers.js +40 -40
  20. package/core/datetime.js +34 -36
  21. package/core/dom.js +26 -26
  22. package/core/eventing.js +33 -33
  23. package/core/mixins.js +122 -122
  24. package/core/overlay/overlay.d.ts.map +1 -1
  25. package/core/overlay.js +55 -50
  26. package/core/testing/event-spy.d.ts +1 -1
  27. package/core/testing/wait-for-image-ready.d.ts +4 -0
  28. package/core/testing/wait-for-image-ready.d.ts.map +1 -0
  29. package/core/testing.d.ts +1 -0
  30. package/core/testing.d.ts.map +1 -1
  31. package/core/testing.js +42 -31
  32. package/custom-elements.json +70 -4
  33. package/datepicker/common.js +55 -55
  34. package/datepicker/datepicker-toggle.js +94 -94
  35. package/datepicker/datepicker.js +144 -144
  36. package/development/accordion.js +2 -3
  37. package/development/action-group.js +2 -3
  38. package/development/alert/alert-group.js +2 -3
  39. package/development/alert/alert.js +2 -3
  40. package/development/autocomplete.js +2 -3
  41. package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
  42. package/development/breadcrumb/breadcrumb-group.js +5 -5
  43. package/development/breadcrumb/breadcrumb.js +2 -3
  44. package/development/button/button-link.js +2 -3
  45. package/development/button/button-static.js +2 -3
  46. package/development/button/button.js +2 -3
  47. package/development/button/common.js +2 -3
  48. package/development/button/mini-button.js +2 -3
  49. package/development/button/secondary-button-link.js +2 -3
  50. package/development/button/secondary-button-static.js +2 -3
  51. package/development/button/secondary-button.js +2 -3
  52. package/development/button/tertiary-button-link.js +2 -3
  53. package/development/button/tertiary-button-static.js +2 -3
  54. package/development/button/tertiary-button.js +2 -3
  55. package/development/button/transparent-button-link.js +2 -3
  56. package/development/button/transparent-button-static.js +2 -3
  57. package/development/button/transparent-button.js +2 -3
  58. package/development/calendar.js +2 -3
  59. package/development/card/card-badge.js +2 -3
  60. package/development/card/card-button.js +2 -3
  61. package/development/card/card-link.js +2 -3
  62. package/development/card/card.js +2 -3
  63. package/development/card/common.js +2 -3
  64. package/development/checkbox/checkbox-group.js +2 -3
  65. package/development/checkbox/checkbox.js +2 -3
  66. package/development/chip.js +2 -3
  67. package/development/clock.js +2 -3
  68. package/development/container/container.js +2 -3
  69. package/development/container/sticky-bar.js +2 -3
  70. package/development/core/base-elements.js +4 -7
  71. package/development/core/mixins.js +7 -13
  72. package/development/core/overlay/overlay.d.ts.map +1 -1
  73. package/development/core/overlay.js +9 -3
  74. package/development/core/testing/event-spy.d.ts +1 -1
  75. package/development/core/testing/wait-for-image-ready.d.ts +4 -0
  76. package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
  77. package/development/core/testing.d.ts +1 -0
  78. package/development/core/testing.d.ts.map +1 -1
  79. package/development/core/testing.js +17 -1
  80. package/development/datepicker/common.js +2 -3
  81. package/development/datepicker/datepicker-next-day.js +2 -3
  82. package/development/datepicker/datepicker-previous-day.js +2 -3
  83. package/development/datepicker/datepicker-toggle.js +2 -3
  84. package/development/datepicker/datepicker.js +2 -3
  85. package/development/dialog/dialog-actions.js +2 -3
  86. package/development/dialog/dialog-content.js +2 -3
  87. package/development/dialog/dialog-title.js +2 -3
  88. package/development/dialog/dialog.js +2 -3
  89. package/development/divider.js +2 -3
  90. package/development/expansion-panel/expansion-panel-content.js +2 -3
  91. package/development/expansion-panel/expansion-panel-header.js +2 -3
  92. package/development/expansion-panel/expansion-panel.js +2 -3
  93. package/development/file-selector.js +2 -3
  94. package/development/footer.js +2 -3
  95. package/development/form-error.js +2 -3
  96. package/development/form-field/form-field-clear.js +2 -3
  97. package/development/form-field/form-field.js +2 -3
  98. package/development/header/common.js +2 -3
  99. package/development/header/header-button.js +2 -3
  100. package/development/header/header-link.js +2 -3
  101. package/development/header/header.js +2 -3
  102. package/development/icon.js +4 -7
  103. package/development/image/image.d.ts +12 -3
  104. package/development/image/image.d.ts.map +1 -1
  105. package/development/image.js +41 -24
  106. package/development/journey-header.js +2 -3
  107. package/development/lead-container.js +2 -3
  108. package/development/link/block-link-button.js +2 -3
  109. package/development/link/block-link-static.js +2 -3
  110. package/development/link/block-link.js +2 -3
  111. package/development/link/common.js +3 -5
  112. package/development/link/link-button.js +2 -3
  113. package/development/link/link-static.js +2 -3
  114. package/development/link/link.js +2 -3
  115. package/development/link-list.js +2 -3
  116. package/development/loading-indicator.js +2 -3
  117. package/development/logo.js +2 -3
  118. package/development/map-container.js +2 -3
  119. package/development/menu/common.js +2 -3
  120. package/development/menu/menu-button.js +2 -3
  121. package/development/menu/menu-link.js +2 -3
  122. package/development/menu/menu.js +2 -3
  123. package/development/message.js +2 -3
  124. package/development/navigation/common.js +2 -3
  125. package/development/navigation/navigation-button.js +2 -3
  126. package/development/navigation/navigation-link.js +2 -3
  127. package/development/navigation/navigation-list.js +2 -3
  128. package/development/navigation/navigation-marker.js +2 -3
  129. package/development/navigation/navigation-section.js +2 -3
  130. package/development/navigation/navigation.js +2 -3
  131. package/development/notification.js +2 -3
  132. package/development/option/optgroup.js +2 -3
  133. package/development/option/option.js +2 -3
  134. package/development/overlay.js +3 -5
  135. package/development/popover/popover-trigger.js +2 -3
  136. package/development/popover/popover.js +2 -3
  137. package/development/radio-button/radio-button-group.js +2 -3
  138. package/development/radio-button/radio-button.js +2 -3
  139. package/development/screen-reader-only.js +2 -3
  140. package/development/select.js +2 -3
  141. package/development/selection-panel.js +2 -3
  142. package/development/signet.js +2 -3
  143. package/development/skiplink-list.js +2 -3
  144. package/development/slider.js +2 -3
  145. package/development/status.js +2 -3
  146. package/development/stepper/step-label.js +2 -3
  147. package/development/stepper/step.js +2 -3
  148. package/development/stepper/stepper/stepper.d.ts +1 -1
  149. package/development/stepper/stepper/stepper.d.ts.map +1 -1
  150. package/development/stepper/stepper.js +5 -6
  151. package/development/tabs/tab-group.js +2 -3
  152. package/development/tabs/tab-title.js +2 -3
  153. package/development/tag/tag-group.js +2 -3
  154. package/development/tag/tag.js +2 -3
  155. package/development/teaser-hero.js +2 -3
  156. package/development/teaser-paid.js +2 -3
  157. package/development/teaser.js +2 -3
  158. package/development/time-input.js +2 -3
  159. package/development/timetable-occupancy-icon.js +2 -3
  160. package/development/timetable-occupancy.js +2 -3
  161. package/development/title.js +3 -5
  162. package/development/toast.js +2 -3
  163. package/development/toggle/toggle-option.js +3 -5
  164. package/development/toggle/toggle.js +2 -3
  165. package/development/toggle-check.js +10 -3
  166. package/development/train/train-blocked-passage.js +2 -3
  167. package/development/train/train-formation.js +2 -3
  168. package/development/train/train-wagon.js +2 -3
  169. package/development/train/train.js +2 -3
  170. package/development/visual-checkbox.js +2 -3
  171. package/dialog/dialog-title.js +20 -20
  172. package/dialog/dialog.js +66 -66
  173. package/expansion-panel/expansion-panel-header.js +20 -20
  174. package/expansion-panel/expansion-panel.js +60 -60
  175. package/file-selector.js +91 -91
  176. package/form-field/form-field-clear.js +12 -12
  177. package/form-field/form-field.js +111 -111
  178. package/header/header.js +53 -53
  179. package/icon.js +107 -107
  180. package/image/image.d.ts +12 -3
  181. package/image/image.d.ts.map +1 -1
  182. package/image.js +118 -105
  183. package/journey-header.js +29 -29
  184. package/map-container.js +23 -23
  185. package/menu/menu.js +91 -91
  186. package/navigation/common.js +16 -16
  187. package/navigation/navigation-marker.js +34 -34
  188. package/navigation/navigation-section.js +83 -83
  189. package/navigation/navigation.js +87 -87
  190. package/notification.js +52 -52
  191. package/option/optgroup.js +45 -45
  192. package/option/option.js +108 -108
  193. package/overlay.js +5 -5
  194. package/package.json +1 -1
  195. package/popover/popover.js +110 -110
  196. package/radio-button/radio-button-group.js +93 -93
  197. package/radio-button/radio-button.js +84 -84
  198. package/select.js +178 -178
  199. package/selection-panel.js +44 -44
  200. package/slider.js +58 -58
  201. package/status.js +6 -6
  202. package/stepper/step-label.js +19 -19
  203. package/stepper/step.js +31 -31
  204. package/stepper/stepper/stepper.d.ts +1 -1
  205. package/stepper/stepper/stepper.d.ts.map +1 -1
  206. package/stepper/stepper.js +48 -48
  207. package/tabs/tab-group.js +67 -67
  208. package/tag/tag-group.js +8 -8
  209. package/tag/tag.js +27 -27
  210. package/teaser-paid.js +12 -12
  211. package/time-input.js +73 -73
  212. package/timetable-occupancy-icon.js +26 -26
  213. package/timetable-occupancy.js +9 -9
  214. package/toast.js +38 -38
  215. package/toggle/toggle-option.js +33 -33
  216. package/toggle/toggle.js +46 -46
  217. package/toggle-check.js +14 -14
  218. package/train/train-formation.js +36 -37
  219. package/train/train-wagon.js +30 -30
  220. package/train/train.js +13 -13
@@ -1,30 +1,30 @@
1
- import { isServer as d } from "lit";
1
+ import { isServer as l } from "lit";
2
2
  import { readConfig as u } from "./config.js";
3
- import { AgnosticMutationObserver as _ } from "./observers.js";
4
- class b {
3
+ import { AgnosticMutationObserver as m } from "./observers.js";
4
+ class A {
5
5
  constructor(t) {
6
- this._host = t, this._abortController = new AbortController(), this._host.addController(this);
6
+ this.b = t, this.a = new AbortController(), this.b.addController(this);
7
7
  }
8
8
  get signal() {
9
9
  var t;
10
- return (t = this._abortController) == null ? void 0 : t.signal;
10
+ return (t = this.a) == null ? void 0 : t.signal;
11
11
  }
12
12
  hostConnected() {
13
- this._abortController || (this._abortController = new AbortController());
13
+ this.a || (this.a = new AbortController());
14
14
  }
15
15
  hostDisconnected() {
16
16
  var t;
17
- (t = this._abortController) == null || t.abort(), this._abortController = void 0;
17
+ (t = this.a) == null || t.abort(), this.a = void 0;
18
18
  }
19
19
  }
20
20
  const e = class e {
21
21
  constructor(t) {
22
- this._host = t, this._handlers = [], this._host.addController(this);
22
+ this.g = t, this.f = [], this.g.addController(this);
23
23
  }
24
24
  /** Get the current language. */
25
25
  static get current() {
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;
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;
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._handlers.unshift(t), this;
35
+ return this.f.unshift(t), this;
36
36
  }
37
37
  hostConnected() {
38
- e._listeners.size || e._observer.observe(
38
+ e.a.size || e.d.observe(
39
39
  document.documentElement,
40
- e._observerConfig
41
- ), e._listeners.add(this), this._previousLanguage !== this.current && this._callHandlers(this._previousLanguage !== void 0);
40
+ e.i
41
+ ), e.a.add(this), this.c !== this.current && this.e(this.c !== void 0);
42
42
  }
43
43
  hostDisconnected() {
44
- this._previousLanguage = this.current, e._listeners.delete(this), e._listeners.size || e._observer.disconnect();
44
+ this.c = this.current, e.a.delete(this), e.a.size || e.d.disconnect();
45
45
  }
46
- _callHandlers(t = !0) {
47
- this._handlers.forEach((s) => s()), t && this._host.requestUpdate();
46
+ e(t = !0) {
47
+ this.f.forEach((s) => s()), t && this.g.requestUpdate();
48
48
  }
49
49
  };
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 = {
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 = {
53
53
  attributeFilter: ["lang"],
54
54
  attributeOldValue: !0
55
55
  };
56
- let h = e;
57
- class C {
56
+ let c = e;
57
+ class v {
58
58
  constructor(t, s = null) {
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);
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);
62
62
  }
63
63
  hostConnected() {
64
64
  var t;
65
- this._syncSlots(...this._host.querySelectorAll("slot")), (t = this._host.shadowRoot) == null || t.addEventListener("slotchange", this._slotchangeHandler);
65
+ this.c(...this.a.querySelectorAll("slot")), (t = this.a.shadowRoot) == null || t.addEventListener("slotchange", this.b);
66
66
  }
67
67
  hostDisconnected() {
68
68
  var t;
69
- (t = this._host.shadowRoot) == null || t.removeEventListener("slotchange", this._slotchangeHandler);
69
+ (t = this.a.shadowRoot) == null || t.removeEventListener("slotchange", this.b);
70
70
  }
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);
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);
79
79
  }
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));
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));
82
82
  }
83
83
  }
84
84
  export {
85
- b as SbbConnectedAbortController,
86
- h as SbbLanguageController,
87
- C as SbbSlotStateController
85
+ A as SbbConnectedAbortController,
86
+ c as SbbLanguageController,
87
+ v 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, 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}$)?/;
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}$)?/;
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, a = 2) => `${r}`.padStart(a, "0");
19
+ const e = (r, n = 2) => `${r}`.padStart(n, "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), a = this.isValid(e);
58
- return r && a ? !this.compareDate(t, e) : r == a;
57
+ const r = this.isValid(t), n = this.isValid(e);
58
+ return r && n ? !this.compareDate(t, e) : r == n;
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._cutoffYearOffset = t;
77
+ super(), this.b = 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._range(12, (r) => e.format(new Date(2017, r, 1)));
111
+ return this.a(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._range(31, (e) => t.format(new Date(2017, 0, e + 1)));
116
+ return this.a(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._range(7, (r) => e.format(new Date(2017, 0, r + 1)));
125
+ return this.a(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._createDateWithOverflow(this.getYear(t), this.getMonth(t), 0));
133
+ return this.getDate(this.c(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 a = this._createDateWithOverflow(t, e - 1, r);
146
- if (a.getMonth() + 1 !== e)
145
+ const n = this.c(t, e - 1, r);
146
+ if (n.getMonth() + 1 !== e)
147
147
  throw Error(`Invalid date "${r}" for month with index "${e}".`);
148
- return a;
148
+ return n;
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, 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())));
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())));
178
178
  }
179
179
  /** Creates a new date by adding the number of provided `days` to the provided `date`. */
180
180
  addCalendarDays(t, e) {
@@ -188,10 +188,8 @@ class c extends l {
188
188
  if (Number.isNaN(+t)) {
189
189
  if (D.test(t))
190
190
  return this.getValidDateOrNull(new Date(t));
191
- } else
192
- return this.getValidDateOrNull(new Date(+t * 1e3));
193
- else
194
- return null;
191
+ } else return this.getValidDateOrNull(new Date(+t * 1e3));
192
+ else return null;
195
193
  else if (typeof t == "number")
196
194
  return this.getValidDateOrNull(new Date(t * 1e3));
197
195
  return super.deserialize(t);
@@ -200,15 +198,15 @@ class c extends l {
200
198
  parse(t, e) {
201
199
  if (!t)
202
200
  return;
203
- const r = t.replace(/\D/g, " ").trim(), a = r == null ? void 0 : r.match(u);
204
- if (!a || a.index !== 0 || a.length <= 2 || a.some((s) => s === void 0) || !this.isValid(this.createDate(+a[3], +a[2], +a[1])))
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])))
205
203
  return;
206
- let n = +a[3];
207
- if (typeof n == "number" && n < 100 && n >= 0) {
208
- const s = e.getFullYear() - 2e3 + this._cutoffYearOffset;
209
- n = n <= s ? 2e3 + n : 1900 + n;
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;
210
208
  }
211
- return new Date(n, +a[2] - 1, +a[1]);
209
+ return new Date(a, +n[2] - 1, +n[1]);
212
210
  }
213
211
  format(t) {
214
212
  if (!t)
@@ -218,10 +216,10 @@ class c extends l {
218
216
  month: "2-digit",
219
217
  year: "numeric"
220
218
  });
221
- let n = new Intl.DateTimeFormat(e, {
219
+ let a = new Intl.DateTimeFormat(e, {
222
220
  weekday: "short"
223
221
  }).format(t);
224
- return n = n.charAt(0).toUpperCase() + n.charAt(1), `${n}, ${r.format(t)}`;
222
+ return a = a.charAt(0).toUpperCase() + a.charAt(1), `${a}, ${r.format(t)}`;
225
223
  }
226
224
  invalid() {
227
225
  return /* @__PURE__ */ new Date(NaN);
@@ -231,16 +229,16 @@ class c extends l {
231
229
  * @param length The length of the array to be created.
232
230
  * @param valueFunction The function of array's index used to fill the array.
233
231
  */
234
- _range(t, e) {
232
+ a(t, e) {
235
233
  const r = Array(t);
236
- for (let a = 0; a < t; a++)
237
- r[a] = e(a);
234
+ for (let n = 0; n < t; n++)
235
+ r[n] = e(n);
238
236
  return r;
239
237
  }
240
238
  /** Creates a date but allows the month and date to overflow. */
241
- _createDateWithOverflow(t, e, r) {
242
- const a = new Date(t, e, r);
243
- return t >= 0 && t < 100 && a.setFullYear(this.getYear(a) - 1900), a;
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;
244
242
  }
245
243
  }
246
244
  const w = new c();
@@ -248,9 +246,9 @@ export {
248
246
  o as DAYS_PER_ROW,
249
247
  l as DateAdapter,
250
248
  u as FORMAT_DATE,
251
- f as MONTHS_PER_ROW,
249
+ m as MONTHS_PER_ROW,
252
250
  c as NativeDateAdapter,
253
- d as YEARS_PER_PAGE,
254
- m as YEARS_PER_ROW,
251
+ f as YEARS_PER_PAGE,
252
+ d as YEARS_PER_ROW,
255
253
  w as defaultDateAdapter
256
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})`, g = s && `(max-width: ${s})`, y = r && s && " and ";
11
- return window.matchMedia(`${f}${y}${g}`).matches;
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;
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 p = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
- function x(t, n) {
16
+ const x = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
+ function k(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 x(t, n) {
25
25
  }
26
26
  return null;
27
27
  }
28
- const k = "a,button,sbb-teaser-hero,sbb-teaser";
29
- function I(t, n) {
28
+ const p = "a,button,sbb-teaser-hero,sbb-teaser";
29
+ function $(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 I(t, n) {
34
34
  }
35
35
  return h(n);
36
36
  }
37
- function $(t, n, o) {
37
+ function I(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), _ = !e && /(firefox|minefield)/i.test(navigator.userAgent), W = !e && /android/i.test(navigator.userAgent) && !c, B = !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), W = !e && /(firefox|minefield)/i.test(navigator.userAgent), B = !e && /android/i.test(navigator.userAgent) && !c, C = !e && /safari/i.test(navigator.userAgent) && v;
47
47
  var l, b;
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;
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;
49
49
  function u() {
50
50
  return document.body.hasAttribute("data-sbb-scroll-disabled");
51
51
  }
52
- class P {
52
+ class R {
53
53
  disableScroll() {
54
54
  if (u())
55
55
  return;
56
- this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
56
+ this.a = document.body.style.position, this.b = document.body.style.overflow, this.c = 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._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"));
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"));
62
62
  }
63
63
  }
64
64
  const d = /* @__PURE__ */ new Map();
65
- function R(t) {
65
+ function T(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.__definitions
70
+ customElements.a
71
71
  );
72
72
  for (const [o, i] of n)
73
73
  if (i.ctor === t.constructor)
@@ -75,25 +75,25 @@ function R(t) {
75
75
  throw new Error(`Given element ${t.constructor.name} has not been registered yet.`);
76
76
  }
77
77
  export {
78
- k as ACTION_ELEMENTS,
79
- P as SbbScrollHandler,
78
+ p as ACTION_ELEMENTS,
79
+ R as SbbScrollHandler,
80
80
  E as breakpoints,
81
- I as findInput,
81
+ $ as findInput,
82
82
  h as findReferencedElement,
83
- p as getDocumentWritingMode,
84
- R as getLocalName,
85
- x as hostContext,
86
- W as isAndroid,
83
+ x as getDocumentWritingMode,
84
+ T as getLocalName,
85
+ k as hostContext,
86
+ B as isAndroid,
87
87
  w as isBlink,
88
88
  S as isBreakpoint,
89
- C as isChromium,
89
+ N as isChromium,
90
90
  m as isEdge,
91
- _ as isFirefox,
91
+ W as isFirefox,
92
92
  M as isIOS,
93
- N as isNextjs,
94
- B as isSafari,
93
+ P as isNextjs,
94
+ C as isSafari,
95
95
  c as isTrident,
96
96
  v as isWebkit,
97
97
  u as pageScrollDisabled,
98
- $ as setOrRemoveAttribute
98
+ I as setOrRemoveAttribute
99
99
  };
package/core/eventing.js CHANGED
@@ -1,16 +1,16 @@
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));
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));
5
5
  }
6
6
  const c = {
7
7
  bubbles: !0,
8
8
  cancelable: !0,
9
9
  composed: !0
10
10
  };
11
- class l {
12
- constructor(e, o, n = c) {
13
- this._element = e, this._eventName = o, this._options = n;
11
+ class u {
12
+ constructor(e, n, o = c) {
13
+ this.a = e, this.b = n, this.c = o;
14
14
  }
15
15
  /**
16
16
  * Dispatches an event.
@@ -19,61 +19,61 @@ class l {
19
19
  * if preventDefault() was called. Always returns true in SSR.
20
20
  */
21
21
  emit(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 })
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 })
26
26
  )) ?? !0;
27
27
  }
28
28
  }
29
- function u(t) {
29
+ function d(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 d = ({ host: t, signal: e }) => {
35
+ const l = ({ host: t, signal: e }) => {
36
36
  t.addEventListener("keydown", i, { signal: e });
37
37
  };
38
38
  function h(t, e) {
39
- const o = Object.getPrototypeOf(t).constructor, n = new o(t.type, t);
40
- e.dispatchEvent(n);
39
+ const n = Object.getPrototypeOf(t).constructor, o = new n(t.type, t);
40
+ e.dispatchEvent(o);
41
41
  }
42
- class p {
43
- constructor(e, ...o) {
44
- this._host = e, this._aspects = o;
42
+ class f {
43
+ constructor(e, ...n) {
44
+ this.c = e, this.b = n;
45
45
  }
46
46
  connect() {
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);
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);
52
52
  }
53
53
  disconnect() {
54
54
  var e;
55
- (e = this._controller) == null || e.abort();
55
+ (e = this.a) == null || e.abort();
56
56
  }
57
57
  }
58
- async function f(t) {
58
+ async function p(t) {
59
59
  return await new Promise((e) => setTimeout(e)), t.defaultPrevented;
60
60
  }
61
61
  const m = (t, e) => {
62
- let o = !1;
62
+ let n = !1;
63
63
  return (...s) => {
64
- o || (t(...s), o = !0, setTimeout(() => {
65
- o = !1;
64
+ n || (t(...s), n = !0, setTimeout(() => {
65
+ n = !1;
66
66
  }, e));
67
67
  };
68
68
  };
69
69
  export {
70
- l as EventEmitter,
71
- p as HandlerRepository,
70
+ u as EventEmitter,
71
+ f as HandlerRepository,
72
72
  a as composedPathHasAttribute,
73
- d as formElementHandlerAspect,
73
+ l as formElementHandlerAspect,
74
74
  h as forwardEventToHost,
75
- u as getEventTarget,
76
- f as isEventPrevented,
75
+ d as getEventTarget,
76
+ p as isEventPrevented,
77
77
  i as preventScrollOnSpacebarPress,
78
78
  m as throttle
79
79
  };