@sbb-esta/lyne-elements 0.52.1 → 0.53.0

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 (242) 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/checkbox.d.ts +3 -46
  13. package/checkbox/checkbox/checkbox.d.ts.map +1 -1
  14. package/checkbox/checkbox-group/checkbox-group.d.ts +4 -2
  15. package/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
  16. package/checkbox/checkbox-group.js +26 -23
  17. package/checkbox/checkbox-panel/checkbox-panel.d.ts +41 -0
  18. package/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -0
  19. package/checkbox/checkbox-panel.d.ts +2 -0
  20. package/checkbox/checkbox-panel.d.ts.map +1 -0
  21. package/checkbox/checkbox-panel.js +67 -0
  22. package/checkbox/checkbox.js +27 -104
  23. package/checkbox/common/checkbox-common.d.ts +13 -0
  24. package/checkbox/common/checkbox-common.d.ts.map +1 -0
  25. package/checkbox/common.d.ts +2 -0
  26. package/checkbox/common.d.ts.map +1 -0
  27. package/checkbox/common.js +52 -0
  28. package/checkbox.d.ts +2 -0
  29. package/checkbox.d.ts.map +1 -1
  30. package/checkbox.js +2 -0
  31. package/clock.js +83 -83
  32. package/container/sticky-bar.js +16 -16
  33. package/core/a11y.js +91 -91
  34. package/core/base-elements.js +86 -86
  35. package/core/controllers.js +40 -40
  36. package/core/datetime.js +32 -32
  37. package/core/dom.js +26 -26
  38. package/core/eventing.js +33 -33
  39. package/core/mixins/panel-mixin.d.ts +13 -0
  40. package/core/mixins/panel-mixin.d.ts.map +1 -0
  41. package/core/mixins.d.ts +1 -0
  42. package/core/mixins.d.ts.map +1 -1
  43. package/core/mixins.js +170 -139
  44. package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +1 -1
  45. package/core/testing.js +29 -29
  46. package/core.css +1 -1
  47. package/custom-elements.json +8862 -6904
  48. package/datepicker/common.js +55 -55
  49. package/datepicker/datepicker-toggle.js +94 -94
  50. package/datepicker/datepicker.js +144 -144
  51. package/development/checkbox/checkbox/checkbox.d.ts +3 -46
  52. package/development/checkbox/checkbox/checkbox.d.ts.map +1 -1
  53. package/development/checkbox/checkbox-group/checkbox-group.d.ts +4 -2
  54. package/development/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
  55. package/development/checkbox/checkbox-group.js +43 -13
  56. package/development/checkbox/checkbox-panel/checkbox-panel.d.ts +41 -0
  57. package/development/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -0
  58. package/development/checkbox/checkbox-panel.d.ts +2 -0
  59. package/development/checkbox/checkbox-panel.d.ts.map +1 -0
  60. package/development/checkbox/checkbox-panel.js +86 -0
  61. package/development/checkbox/checkbox.js +19 -239
  62. package/development/checkbox/common/checkbox-common.d.ts +13 -0
  63. package/development/checkbox/common/checkbox-common.d.ts.map +1 -0
  64. package/development/checkbox/common.d.ts +2 -0
  65. package/development/checkbox/common.d.ts.map +1 -0
  66. package/development/checkbox/common.js +156 -0
  67. package/development/checkbox.d.ts +2 -0
  68. package/development/checkbox.d.ts.map +1 -1
  69. package/development/checkbox.js +3 -1
  70. package/development/core/mixins/panel-mixin.d.ts +13 -0
  71. package/development/core/mixins/panel-mixin.d.ts.map +1 -0
  72. package/development/core/mixins.d.ts +1 -0
  73. package/development/core/mixins.d.ts.map +1 -1
  74. package/development/core/mixins.js +187 -31
  75. package/development/image.js +1 -1
  76. package/development/radio-button/common/radio-button-common.d.ts +22 -0
  77. package/development/radio-button/common/radio-button-common.d.ts.map +1 -0
  78. package/development/radio-button/common.d.ts +2 -0
  79. package/development/radio-button/common.d.ts.map +1 -0
  80. package/development/radio-button/common.js +294 -0
  81. package/development/radio-button/radio-button/radio-button.d.ts +2 -81
  82. package/development/radio-button/radio-button/radio-button.d.ts.map +1 -1
  83. package/development/radio-button/radio-button-group/radio-button-group.d.ts +6 -4
  84. package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
  85. package/development/radio-button/radio-button-group.js +55 -23
  86. package/development/radio-button/radio-button-panel/index.d.ts +2 -0
  87. package/development/radio-button/radio-button-panel/index.d.ts.map +1 -0
  88. package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +29 -0
  89. package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -0
  90. package/development/radio-button/radio-button-panel.d.ts +2 -0
  91. package/development/radio-button/radio-button-panel.d.ts.map +1 -0
  92. package/development/radio-button/radio-button-panel.js +69 -0
  93. package/development/radio-button/radio-button.js +10 -324
  94. package/development/radio-button.d.ts +2 -0
  95. package/development/radio-button.d.ts.map +1 -1
  96. package/development/radio-button.js +3 -1
  97. package/{selection-panel/selection-panel.d.ts → development/selection-expansion-panel/selection-expansion-panel.d.ts} +9 -7
  98. package/development/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -0
  99. package/development/selection-expansion-panel.d.ts +2 -0
  100. package/development/selection-expansion-panel.d.ts.map +1 -0
  101. package/development/selection-expansion-panel.js +340 -0
  102. package/development/tabs/tab/index.d.ts +2 -0
  103. package/development/tabs/tab/index.d.ts.map +1 -0
  104. package/development/tabs/tab/tab.d.ts +24 -0
  105. package/development/tabs/tab/tab.d.ts.map +1 -0
  106. package/development/tabs/tab-group/tab-group.d.ts +20 -15
  107. package/development/tabs/tab-group/tab-group.d.ts.map +1 -1
  108. package/development/tabs/tab-group.js +24 -14
  109. package/development/tabs/{tab-title/tab-title.d.ts → tab-label/tab-label.d.ts} +4 -4
  110. package/development/tabs/{tab-title/tab-title.d.ts.map → tab-label/tab-label.d.ts.map} +1 -1
  111. package/development/tabs/tab-label.d.ts +2 -0
  112. package/development/tabs/tab-label.d.ts.map +1 -0
  113. package/development/tabs/{tab-title.js → tab-label.js} +86 -86
  114. package/development/tabs/tab.d.ts +2 -0
  115. package/development/tabs/tab.d.ts.map +1 -0
  116. package/development/tabs/tab.js +71 -0
  117. package/development/tabs.d.ts +2 -1
  118. package/development/tabs.d.ts.map +1 -1
  119. package/development/tabs.js +3 -2
  120. package/development/train/train-formation/train-formation.d.ts.map +1 -1
  121. package/development/train/train-formation.js +12 -12
  122. package/dialog/dialog-title.js +20 -20
  123. package/dialog/dialog.js +66 -66
  124. package/expansion-panel/expansion-panel-header.js +20 -20
  125. package/expansion-panel/expansion-panel.js +60 -60
  126. package/file-selector.js +91 -91
  127. package/form-field/form-field-clear.js +12 -12
  128. package/form-field/form-field.js +111 -111
  129. package/header/header.js +53 -53
  130. package/icon.js +107 -107
  131. package/image.js +87 -87
  132. package/index.d.ts +10 -8
  133. package/index.js +10 -8
  134. package/journey-header.js +29 -29
  135. package/map-container.js +23 -23
  136. package/menu/menu.js +91 -91
  137. package/navigation/common.js +16 -16
  138. package/navigation/navigation-marker.js +34 -34
  139. package/navigation/navigation-section.js +83 -83
  140. package/navigation/navigation.js +87 -87
  141. package/notification.js +52 -52
  142. package/option/optgroup.js +45 -45
  143. package/option/option.js +108 -108
  144. package/overlay.js +5 -5
  145. package/package.json +34 -19
  146. package/popover/popover.js +110 -110
  147. package/radio-button/common/radio-button-common.d.ts +22 -0
  148. package/radio-button/common/radio-button-common.d.ts.map +1 -0
  149. package/radio-button/common.d.ts +2 -0
  150. package/radio-button/common.d.ts.map +1 -0
  151. package/radio-button/common.js +105 -0
  152. package/radio-button/radio-button/radio-button.d.ts +2 -81
  153. package/radio-button/radio-button/radio-button.d.ts.map +1 -1
  154. package/radio-button/radio-button-group/radio-button-group.d.ts +6 -4
  155. package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
  156. package/radio-button/radio-button-group.js +86 -80
  157. package/radio-button/radio-button-panel/index.d.ts +2 -0
  158. package/radio-button/radio-button-panel/index.d.ts.map +1 -0
  159. package/radio-button/radio-button-panel/radio-button-panel.d.ts +29 -0
  160. package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -0
  161. package/radio-button/radio-button-panel.d.ts +2 -0
  162. package/radio-button/radio-button-panel.d.ts.map +1 -0
  163. package/radio-button/radio-button-panel.js +59 -0
  164. package/radio-button/radio-button.js +20 -143
  165. package/radio-button.d.ts +2 -0
  166. package/radio-button.d.ts.map +1 -1
  167. package/radio-button.js +2 -0
  168. package/select.js +178 -178
  169. package/{development/selection-panel/selection-panel.d.ts → selection-expansion-panel/selection-expansion-panel.d.ts} +9 -7
  170. package/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -0
  171. package/selection-expansion-panel.d.ts +2 -0
  172. package/selection-expansion-panel.d.ts.map +1 -0
  173. package/selection-expansion-panel.js +146 -0
  174. package/slider.js +58 -58
  175. package/standard-theme.css +1 -1
  176. package/status.js +6 -6
  177. package/stepper/step-label.js +19 -19
  178. package/stepper/step.js +31 -31
  179. package/stepper/stepper.js +46 -46
  180. package/tabs/tab/index.d.ts +2 -0
  181. package/tabs/tab/index.d.ts.map +1 -0
  182. package/tabs/tab/tab.d.ts +24 -0
  183. package/tabs/tab/tab.d.ts.map +1 -0
  184. package/tabs/tab-group/tab-group.d.ts +20 -15
  185. package/tabs/tab-group/tab-group.d.ts.map +1 -1
  186. package/tabs/tab-group.js +85 -75
  187. package/tabs/{tab-title/tab-title.d.ts → tab-label/tab-label.d.ts} +4 -4
  188. package/tabs/{tab-title/tab-title.d.ts.map → tab-label/tab-label.d.ts.map} +1 -1
  189. package/tabs/tab-label.d.ts +2 -0
  190. package/tabs/tab-label.d.ts.map +1 -0
  191. package/tabs/tab-label.js +51 -0
  192. package/tabs/tab.d.ts +2 -0
  193. package/tabs/tab.d.ts.map +1 -0
  194. package/tabs/tab.js +41 -0
  195. package/tabs.d.ts +2 -1
  196. package/tabs.d.ts.map +1 -1
  197. package/tabs.js +2 -1
  198. package/tag/tag-group.js +8 -8
  199. package/tag/tag.js +27 -27
  200. package/time-input.js +73 -73
  201. package/timetable-occupancy-icon.js +26 -26
  202. package/timetable-occupancy.js +9 -9
  203. package/toast.js +38 -38
  204. package/toggle/toggle-option.js +33 -33
  205. package/toggle/toggle.js +46 -46
  206. package/train/train-formation/train-formation.d.ts.map +1 -1
  207. package/train/train-formation.js +51 -51
  208. package/train/train-wagon.js +30 -30
  209. package/train/train.js +13 -13
  210. package/development/selection-panel/selection-panel.d.ts.map +0 -1
  211. package/development/selection-panel.d.ts +0 -2
  212. package/development/selection-panel.d.ts.map +0 -1
  213. package/development/selection-panel.js +0 -376
  214. package/development/tabs/tab-title.d.ts +0 -2
  215. package/development/tabs/tab-title.d.ts.map +0 -1
  216. package/development/teaser-hero/teaser-hero.d.ts +0 -26
  217. package/development/teaser-hero/teaser-hero.d.ts.map +0 -1
  218. package/development/teaser-hero.d.ts +0 -2
  219. package/development/teaser-hero.d.ts.map +0 -1
  220. package/development/teaser-hero.js +0 -181
  221. package/development/teaser-paid/teaser-paid.d.ts +0 -20
  222. package/development/teaser-paid/teaser-paid.d.ts.map +0 -1
  223. package/development/teaser-paid.d.ts +0 -2
  224. package/development/teaser-paid.d.ts.map +0 -1
  225. package/development/teaser-paid.js +0 -91
  226. package/selection-panel/selection-panel.d.ts.map +0 -1
  227. package/selection-panel.d.ts +0 -2
  228. package/selection-panel.d.ts.map +0 -1
  229. package/selection-panel.js +0 -138
  230. package/tabs/tab-title.d.ts +0 -2
  231. package/tabs/tab-title.d.ts.map +0 -1
  232. package/tabs/tab-title.js +0 -51
  233. package/teaser-hero/teaser-hero.d.ts +0 -26
  234. package/teaser-hero/teaser-hero.d.ts.map +0 -1
  235. package/teaser-hero.d.ts +0 -2
  236. package/teaser-hero.d.ts.map +0 -1
  237. package/teaser-hero.js +0 -51
  238. package/teaser-paid/teaser-paid.d.ts +0 -20
  239. package/teaser-paid/teaser-paid.d.ts.map +0 -1
  240. package/teaser-paid.d.ts +0 -2
  241. package/teaser-paid.d.ts.map +0 -1
  242. package/teaser-paid.js +0 -28
@@ -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
  };
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ import { AbstractConstructor } from './constructor.js';
3
+
4
+ export declare class SbbPanelMixinType {
5
+ color: 'white' | 'milk';
6
+ borderless: boolean;
7
+ expansionState?: string;
8
+ }
9
+ /**
10
+ * Mixin for common panel behaviors
11
+ */
12
+ export declare const SbbPanelMixin: <T extends AbstractConstructor<LitElement>>(superClass: T) => AbstractConstructor<SbbPanelMixinType> & T;
13
+ //# sourceMappingURL=panel-mixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/panel-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAC7B,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AAEH,eAAO,MAAM,aAAa,0DACZ,CAAC,KACZ,oBAAoB,iBAAiB,CAAC,GAAG,CAiC3C,CAAC"}
package/core/mixins.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './mixins/form-associated-mixin.js';
5
5
  export * from './mixins/hydration-mixin.js';
6
6
  export * from './mixins/named-slot-list-mixin.js';
7
7
  export * from './mixins/negative-mixin.js';
8
+ export * from './mixins/panel-mixin.js';
8
9
  export * from './mixins/required-mixin.js';
9
10
  export * from './mixins/update-scheduler-mixin.js';
10
11
  //# sourceMappingURL=mixins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../../src/elements/core/mixins.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../../src/elements/core/mixins.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AAEnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC"}