@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,103 +1,103 @@
1
- import { css as n, LitElement as d, html as g } from "lit";
2
- import { property as c, state as v, customElement as u } from "lit/decorators.js";
1
+ import { css as n, LitElement as d, html as c } from "lit";
2
+ import { property as g, state as u, customElement as v } from "lit/decorators.js";
3
3
  import { hostAttributes as h } from "../core/decorators.js";
4
4
  import { setOrRemoveAttribute as f, isSafari as x } from "../core/dom.js";
5
- import { SbbDisabledMixin as _, SbbHydrationMixin as m } from "../core/mixins.js";
6
- import { AgnosticMutationObserver as y } from "../core/observers.js";
5
+ import { SbbDisabledMixin as m, SbbHydrationMixin as y } from "../core/mixins.js";
6
+ import { AgnosticMutationObserver as _ } from "../core/observers.js";
7
7
  import "../divider.js";
8
- const O = n`*,:before,:after{box-sizing:border-box}:host{--sbb-optgroup-divider-display: block;--sbb-optgroup-divider-spacing: 0;--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-padding-inline: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-font-size: var(--sbb-typo-scale-0-75x);--sbb-optgroup-label-color: var(--sbb-color-metal);display:block}:host(:first-child){--sbb-optgroup-divider-display: none;--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-2x)}:host([data-variant=select]){--sbb-optgroup-divider-spacing: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-padding-inline: var(--sbb-spacing-responsive-xxxs);--sbb-optgroup-label-padding-start: 0;--sbb-optgroup-label-font-size: inherit}:host([data-variant=select]:first-child){--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-4x)}:host([data-negative]){--sbb-optgroup-label-color: var(--sbb-color-smoke)}.sbb-optgroup{margin-block:var(--sbb-spacing-fixed-4x);margin-inline:var(--sbb-spacing-fixed-4x)}.sbb-optgroup__label{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;column-gap:var(--sbb-spacing-responsive-xxxs);color:var(--sbb-optgroup-label-color);-webkit-text-fill-color:var(--sbb-optgroup-label-color);padding-inline:var(--sbb-optgroup-label-padding-inline);padding-block:var(--sbb-optgroup-label-padding-start) var(--sbb-spacing-fixed-2x)}:host([data-variant=select][data-multiple]) .sbb-optgroup__label{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);padding-inline-start:calc(var(--sbb-spacing-responsive-xxxs) + var(--sbb-spacing-fixed-8x))}.sbb-optgroup__divider{display:var(--sbb-optgroup-divider-display);padding-block:var(--sbb-optgroup-divider-spacing)}.sbb-optgroup__icon-space{display:var(--sbb-option-icon-container-display, none);min-width:var(--sbb-size-icon-ui-small)}`;
9
- var A = Object.defineProperty, z = Object.getOwnPropertyDescriptor, p = (t, e, i, o) => {
10
- for (var s = o > 1 ? void 0 : o ? z(e, i) : e, r = t.length - 1, b; r >= 0; r--)
11
- (b = t[r]) && (s = (o ? b(e, i, s) : b(s)) || s);
12
- return o && s && A(e, i, s), s;
8
+ const A = n`*,:before,:after{box-sizing:border-box}:host{--sbb-optgroup-divider-display: block;--sbb-optgroup-divider-spacing: 0;--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-padding-inline: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-font-size: var(--sbb-typo-scale-0-75x);--sbb-optgroup-label-color: var(--sbb-color-metal);display:block}:host(:first-child){--sbb-optgroup-divider-display: none;--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-2x)}:host([data-variant=select]){--sbb-optgroup-divider-spacing: var(--sbb-spacing-fixed-4x);--sbb-optgroup-label-padding-inline: var(--sbb-spacing-responsive-xxxs);--sbb-optgroup-label-padding-start: 0;--sbb-optgroup-label-font-size: inherit}:host([data-variant=select]:first-child){--sbb-optgroup-label-padding-start: var(--sbb-spacing-fixed-4x)}:host([data-negative]){--sbb-optgroup-label-color: var(--sbb-color-smoke)}.sbb-optgroup{margin-block:var(--sbb-spacing-fixed-4x);margin-inline:var(--sbb-spacing-fixed-4x)}.sbb-optgroup__label{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;column-gap:var(--sbb-spacing-responsive-xxxs);color:var(--sbb-optgroup-label-color);-webkit-text-fill-color:var(--sbb-optgroup-label-color);padding-inline:var(--sbb-optgroup-label-padding-inline);padding-block:var(--sbb-optgroup-label-padding-start) var(--sbb-spacing-fixed-2x)}:host([data-variant=select][data-multiple]) .sbb-optgroup__label{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);padding-inline-start:calc(var(--sbb-spacing-responsive-xxxs) + var(--sbb-spacing-fixed-8x))}.sbb-optgroup__divider{display:var(--sbb-optgroup-divider-display);padding-block:var(--sbb-optgroup-divider-spacing)}.sbb-optgroup__icon-space{display:var(--sbb-option-icon-container-display, none);min-width:var(--sbb-size-icon-ui-small)}`;
9
+ var z = Object.defineProperty, w = Object.getOwnPropertyDescriptor, p = (t, e, s, a) => {
10
+ for (var i = a > 1 ? void 0 : a ? w(e, s) : e, o = t.length - 1, r; o >= 0; o--)
11
+ (r = t[o]) && (i = (a ? r(e, s, i) : r(i)) || i);
12
+ return a && i && z(e, s, i), i;
13
13
  };
14
14
  const l = x;
15
- let a = class extends _(m(d)) {
15
+ let b = class extends m(y(d)) {
16
16
  constructor() {
17
- super(...arguments), this._negative = !1, this._negativeObserver = new y(() => this._onNegativeChange());
17
+ super(...arguments), this.a = !1, this.c = new _(() => this.f());
18
18
  }
19
- get _options() {
19
+ get b() {
20
20
  var t;
21
21
  return Array.from(((t = this.querySelectorAll) == null ? void 0 : t.call(this, "sbb-option")) ?? []);
22
22
  }
23
23
  connectedCallback() {
24
24
  var t, e;
25
- super.connectedCallback(), (t = this._negativeObserver) == null || t.disconnect(), this._negative = !!((e = this.closest) != null && e.call(
25
+ super.connectedCallback(), (t = this.c) == null || t.disconnect(), this.a = !!((e = this.closest) != null && e.call(
26
26
  this,
27
27
  ":is(sbb-autocomplete, sbb-select, sbb-form-field)[negative]"
28
- )), this.toggleAttribute("data-negative", this._negative), this._negativeObserver.observe(this, {
28
+ )), this.toggleAttribute("data-negative", this.a), this.c.observe(this, {
29
29
  attributes: !0,
30
30
  attributeFilter: ["data-negative"]
31
- }), this._setVariantByContext(), this._proxyGroupLabelToOptions(), this.toggleAttribute("data-multiple", !!this.closest("sbb-select[multiple]"));
31
+ }), this.g(), this.d(), this.toggleAttribute("data-multiple", !!this.closest("sbb-select[multiple]"));
32
32
  }
33
33
  willUpdate(t) {
34
- super.willUpdate(t), t.has("disabled") && (l || this.setAttribute("aria-disabled", this.disabled.toString()), this._proxyDisabledToOptions()), t.has("label") && this._proxyGroupLabelToOptions();
34
+ super.willUpdate(t), t.has("disabled") && (l || this.setAttribute("aria-disabled", this.disabled.toString()), this.e()), t.has("label") && this.d();
35
35
  }
36
36
  disconnectedCallback() {
37
37
  var t;
38
- super.disconnectedCallback(), (t = this._negativeObserver) == null || t.disconnect();
38
+ super.disconnectedCallback(), (t = this.c) == null || t.disconnect();
39
39
  }
40
- _setVariantByContext() {
40
+ g() {
41
41
  var t, e;
42
42
  (t = this.closest) != null && t.call(this, "sbb-autocomplete") ? this.setAttribute("data-variant", "autocomplete") : (e = this.closest) != null && e.call(this, "sbb-select") && this.setAttribute("data-variant", "select");
43
43
  }
44
- _handleSlotchange() {
45
- this._proxyDisabledToOptions(), this._proxyGroupLabelToOptions(), this._highlightOptions();
44
+ h() {
45
+ this.e(), this.d(), this.i();
46
46
  }
47
- _proxyGroupLabelToOptions() {
47
+ d() {
48
48
  var t, e;
49
49
  if (l)
50
50
  if (this.label) {
51
51
  this.removeAttribute("aria-label");
52
- for (const i of this._options)
53
- i.setAttribute("data-group-label", this.label), (t = i.requestUpdate) == null || t.call(i);
52
+ for (const s of this.b)
53
+ s.setAttribute("data-group-label", this.label), (t = s.requestUpdate) == null || t.call(s);
54
54
  } else
55
- for (const i of this._options)
56
- i.removeAttribute("data-group-label"), (e = i.requestUpdate) == null || e.call(i);
55
+ for (const s of this.b)
56
+ s.removeAttribute("data-group-label"), (e = s.requestUpdate) == null || e.call(s);
57
57
  else {
58
58
  f(this, "aria-label", this.label);
59
59
  return;
60
60
  }
61
61
  }
62
- _proxyDisabledToOptions() {
63
- for (const t of this._options)
62
+ e() {
63
+ for (const t of this.b)
64
64
  t.toggleAttribute("data-group-disabled", this.disabled);
65
65
  }
66
- _highlightOptions() {
67
- var i;
66
+ i() {
67
+ var s;
68
68
  const t = this.closest("sbb-autocomplete");
69
69
  if (!t)
70
70
  return;
71
- const e = (i = t.triggerElement) == null ? void 0 : i.value;
72
- e && this._options.forEach((o) => o.highlight(e));
71
+ const e = (s = t.triggerElement) == null ? void 0 : s.value;
72
+ e && this.b.forEach((a) => a.highlight(e));
73
73
  }
74
- _onNegativeChange() {
75
- this._negative = this.hasAttribute("data-negative");
74
+ f() {
75
+ this.a = this.hasAttribute("data-negative");
76
76
  }
77
77
  render() {
78
- return g`
78
+ return c`
79
79
  <div class="sbb-optgroup__divider">
80
- <sbb-divider ?negative=${this._negative}></sbb-divider>
80
+ <sbb-divider ?negative=${this.a}></sbb-divider>
81
81
  </div>
82
82
  <div class="sbb-optgroup__label" aria-hidden="true">
83
83
  <div class="sbb-optgroup__icon-space"></div>
84
84
  <span>${this.label}</span>
85
85
  </div>
86
- <slot @slotchange=${this._handleSlotchange}></slot>
86
+ <slot @slotchange=${this.h}></slot>
87
87
  `;
88
88
  }
89
89
  };
90
- a.styles = O;
90
+ b.styles = A;
91
91
  p([
92
- c()
93
- ], a.prototype, "label", 2);
92
+ g()
93
+ ], b.prototype, "label", 2);
94
94
  p([
95
- v()
96
- ], a.prototype, "_negative", 2);
97
- a = p([
98
- u("sbb-optgroup"),
95
+ u()
96
+ ], b.prototype, "a", 2);
97
+ b = p([
98
+ v("sbb-optgroup"),
99
99
  h({ role: l ? null : "group" })
100
- ], a);
100
+ ], b);
101
101
  export {
102
- a as SbbOptGroupElement
102
+ b as SbbOptGroupElement
103
103
  };
package/option/option.js CHANGED
@@ -1,36 +1,36 @@
1
- import { css as u, LitElement as v, html as l, nothing as b } from "lit";
2
- import { property as h, state as n, customElement as _ } from "lit/decorators.js";
3
- import { SbbConnectedAbortController as f, SbbSlotStateController as m } from "../core/controllers.js";
4
- import { hostAttributes as x } from "../core/decorators.js";
5
- import { setOrRemoveAttribute as p, isAndroid as y, isSafari as k } from "../core/dom.js";
6
- import { EventEmitter as g } from "../core/eventing.js";
7
- import { SbbDisabledMixin as A } from "../core/mixins.js";
8
- import { AgnosticMutationObserver as S } from "../core/observers.js";
1
+ import { css as g, LitElement as v, html as b, nothing as n } from "lit";
2
+ import { property as h, state as l, customElement as f } from "lit/decorators.js";
3
+ import { SbbConnectedAbortController as m, SbbSlotStateController as x } from "../core/controllers.js";
4
+ import { hostAttributes as k } from "../core/decorators.js";
5
+ import { setOrRemoveAttribute as p, isAndroid as y, isSafari as _ } from "../core/dom.js";
6
+ import { EventEmitter as u } from "../core/eventing.js";
7
+ import { SbbDisabledMixin as w } from "../core/mixins.js";
8
+ import { AgnosticMutationObserver as A } from "../core/observers.js";
9
9
  import { SbbIconNameMixin as C } from "../icon.js";
10
10
  import "../screen-reader-only.js";
11
11
  import "../visual-checkbox.js";
12
- const w = u`*,:before,:after{box-sizing:border-box}:host{--sbb-option-color: var(--sbb-color-charcoal);--sbb-option-background-color: inherit;--sbb-option-background-color-hover: var(--sbb-color-milk);--sbb-option-background-color-active: var(--sbb-color-cloud);--sbb-option-disabled-border-color: var(--sbb-color-graphite);--sbb-option-disabled-background-color: var(--sbb-color-milk);--sbb-option-padding-inline: var(--sbb-spacing-responsive-xxxs);--sbb-option-padding-block: calc(var(--sbb-spacing-fixed-2x) + var(--sbb-border-width-2x));--sbb-option-column-gap: var(--sbb-spacing-responsive-xxxs);--sbb-option-justify-content: start;--sbb-option-cursor: pointer;--sbb-option-border-radius: var(--sbb-border-radius-4x);--sbb-option-icon-color: var(--sbb-color-metal);display:block}:host([data-negative]){--sbb-option-color: var(--sbb-color-milk);--sbb-option-icon-color: var(--sbb-color-smoke);--sbb-option-background-color-hover: var(--sbb-color-charcoal);--sbb-option-background-color-active: var(--sbb-color-iron);--sbb-option-disabled-border-color: var(--sbb-color-smoke);--sbb-option-disabled-background-color: var(--sbb-color-charcoal);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark)}:host([active]){--sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x))}@media (any-hover: hover){:host(:hover:not([disabled],[data-group-disabled])){--sbb-option-background-color: var(--sbb-option-background-color-hover)}}:host(:active:not([disabled],[data-group-disabled])){--sbb-option-background-color: var(--sbb-option-background-color-active)}:host(:not([data-disable-highlight])) .sbb-option__label slot{display:none}:host(:is([data-group-disabled],[disabled])){--sbb-option-cursor: default}@media (forced-colors: active){:host(:is([data-group-disabled],[disabled])){--sbb-option-color: GrayText}}:host([data-variant=select]){--sbb-option-column-gap: var(--sbb-spacing-fixed-2x);--sbb-option-justify-content: space-between}:host([data-variant=select][data-multiple]){--sbb-option-justify-content: start}:host(:not(:is([disabled],[data-group-disabled]))) .sbb-option__label--highlight{font-weight:700}@media (forced-colors: active){:host(:not(:is([disabled],[data-group-disabled]))) .sbb-option__label--highlight{color:Highlight}}.sbb-option__container{background-color:var(--sbb-option-background-color)}.sbb-option{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;column-gap:var(--sbb-option-column-gap);padding-inline:var(--sbb-option-padding-inline);padding-block:var(--sbb-option-padding-block);justify-content:var(--sbb-option-justify-content);color:var(--sbb-option-color);background-color:var(--sbb-option-background-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color)}:host([active]) .sbb-option{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-option-border-radius)}:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option{position:relative;z-index:0}:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option:before{content:"";display:block;position:absolute;top:.375rem;right:.375rem;bottom:.375rem;left:.375rem;border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-border-radius-2x);background-color:var(--sbb-option-disabled-background-color);z-index:-1}@media (forced-colors: active){:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option:before{border-color:GrayText}}.sbb-option__icon{display:flex;min-width:var(--sbb-size-icon-ui-small);min-height:var(--sbb-size-icon-ui-small);color:var(--sbb-option-icon-color)}:host(:not([data-slot-names~=icon],[icon-name])) .sbb-option__icon{display:var(--sbb-option-icon-container-display, none)}.sbb-option__label{white-space:initial}`;
13
- var $ = Object.defineProperty, O = Object.getOwnPropertyDescriptor, r = (t, i, e, s) => {
14
- for (var a = s > 1 ? void 0 : s ? O(i, e) : i, d = t.length - 1, c; d >= 0; d--)
15
- (c = t[d]) && (a = (s ? c(i, e, a) : c(a)) || a);
16
- return s && a && $(i, e, a), a;
12
+ const $ = g`*,:before,:after{box-sizing:border-box}:host{--sbb-option-color: var(--sbb-color-charcoal);--sbb-option-background-color: inherit;--sbb-option-background-color-hover: var(--sbb-color-milk);--sbb-option-background-color-active: var(--sbb-color-cloud);--sbb-option-disabled-border-color: var(--sbb-color-graphite);--sbb-option-disabled-background-color: var(--sbb-color-milk);--sbb-option-padding-inline: var(--sbb-spacing-responsive-xxxs);--sbb-option-padding-block: calc(var(--sbb-spacing-fixed-2x) + var(--sbb-border-width-2x));--sbb-option-column-gap: var(--sbb-spacing-responsive-xxxs);--sbb-option-justify-content: start;--sbb-option-cursor: pointer;--sbb-option-border-radius: var(--sbb-border-radius-4x);--sbb-option-icon-color: var(--sbb-color-metal);display:block}:host([data-negative]){--sbb-option-color: var(--sbb-color-milk);--sbb-option-icon-color: var(--sbb-color-smoke);--sbb-option-background-color-hover: var(--sbb-color-charcoal);--sbb-option-background-color-active: var(--sbb-color-iron);--sbb-option-disabled-border-color: var(--sbb-color-smoke);--sbb-option-disabled-background-color: var(--sbb-color-charcoal);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark)}:host([active]){--sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x))}@media (any-hover: hover){:host(:hover:not([disabled],[data-group-disabled])){--sbb-option-background-color: var(--sbb-option-background-color-hover)}}:host(:active:not([disabled],[data-group-disabled])){--sbb-option-background-color: var(--sbb-option-background-color-active)}:host(:not([data-disable-highlight])) .sbb-option__label slot{display:none}:host(:is([data-group-disabled],[disabled])){--sbb-option-cursor: default}@media (forced-colors: active){:host(:is([data-group-disabled],[disabled])){--sbb-option-color: GrayText}}:host([data-variant=select]){--sbb-option-column-gap: var(--sbb-spacing-fixed-2x);--sbb-option-justify-content: space-between}:host([data-variant=select][data-multiple]){--sbb-option-justify-content: start}:host(:not(:is([disabled],[data-group-disabled]))) .sbb-option__label--highlight{font-weight:700}@media (forced-colors: active){:host(:not(:is([disabled],[data-group-disabled]))) .sbb-option__label--highlight{color:Highlight}}.sbb-option__container{background-color:var(--sbb-option-background-color)}.sbb-option{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;column-gap:var(--sbb-option-column-gap);padding-inline:var(--sbb-option-padding-inline);padding-block:var(--sbb-option-padding-block);justify-content:var(--sbb-option-justify-content);color:var(--sbb-option-color);background-color:var(--sbb-option-background-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color)}:host([active]) .sbb-option{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-option-border-radius)}:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option{position:relative;z-index:0}:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option:before{content:"";display:block;position:absolute;top:.375rem;right:.375rem;bottom:.375rem;left:.375rem;border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-border-radius-2x);background-color:var(--sbb-option-disabled-background-color);z-index:-1}@media (forced-colors: active){:host(:is([data-group-disabled],[disabled]):not([data-multiple])) .sbb-option:before{border-color:GrayText}}.sbb-option__icon{display:flex;min-width:var(--sbb-size-icon-ui-small);min-height:var(--sbb-size-icon-ui-small);color:var(--sbb-option-icon-color)}:host(:not([data-slot-names~=icon],[icon-name])) .sbb-option__icon{display:var(--sbb-option-icon-container-display, none)}.sbb-option__label{white-space:initial}`;
13
+ var S = Object.defineProperty, j = Object.getOwnPropertyDescriptor, r = (t, e, o, s) => {
14
+ for (var a = s > 1 ? void 0 : s ? j(e, o) : e, c = t.length - 1, d; c >= 0; c--)
15
+ (d = t[c]) && (a = (s ? d(e, o, a) : d(a)) || a);
16
+ return s && a && S(e, o, a), a;
17
17
  };
18
- const H = k;
19
- let D = 0;
20
- const G = {
18
+ const E = _;
19
+ let O = 0;
20
+ const z = {
21
21
  attributeFilter: ["data-group-disabled", "data-negative"]
22
22
  };
23
- let o = class extends A(C(v)) {
23
+ let i = class extends w(C(v)) {
24
24
  constructor() {
25
- super(), this._selectionChange = new g(
25
+ super(), this.n = new u(
26
26
  this,
27
- o.events.selectionChange
28
- ), this._optionSelected = new g(
27
+ i.events.selectionChange
28
+ ), this.o = new u(
29
29
  this,
30
- o.events.optionSelected
31
- ), this._negative = !1, this._disabledFromGroup = !1, this._highlightString = null, this._disableLabelHighlight = !1, this._abort = new f(this), this._optionAttributeObserver = new S(
32
- (t) => this._onOptionAttributesChange(t)
33
- ), new m(this);
30
+ i.events.optionSelected
31
+ ), this.e = !1, this.c = !1, this.b = null, this.i = !1, this.p = new m(this), this.j = new A(
32
+ (t) => this.q(t)
33
+ ), new x(this);
34
34
  }
35
35
  set value(t) {
36
36
  this.setAttribute("value", `${t}`);
@@ -39,29 +39,29 @@ let o = class extends A(C(v)) {
39
39
  return this.getAttribute("value") ?? "";
40
40
  }
41
41
  set selected(t) {
42
- this.toggleAttribute("selected", t), this._updateAriaSelected();
42
+ this.toggleAttribute("selected", t), this.h();
43
43
  }
44
44
  get selected() {
45
45
  return this.hasAttribute("selected");
46
46
  }
47
- set _variant(t) {
47
+ set d(t) {
48
48
  this.setAttribute("data-variant", t);
49
49
  }
50
- get _variant() {
50
+ get d() {
51
51
  return this.getAttribute("data-variant");
52
52
  }
53
- get _isAutocomplete() {
54
- return this._variant === "autocomplete";
53
+ get k() {
54
+ return this.d === "autocomplete";
55
55
  }
56
- get _isSelect() {
57
- return this._variant === "select";
56
+ get r() {
57
+ return this.d === "select";
58
58
  }
59
- get _isMultiple() {
59
+ get f() {
60
60
  var t;
61
61
  return !!((t = this.closest) != null && t.call(this, "sbb-select[multiple]"));
62
62
  }
63
- attributeChangedCallback(t, i, e) {
64
- (t !== "value" || i !== e) && super.attributeChangedCallback(t, i, e);
63
+ attributeChangedCallback(t, e, o) {
64
+ (t !== "value" || e !== o) && super.attributeChangedCallback(t, e, o);
65
65
  }
66
66
  /**
67
67
  * Highlight the label of the option
@@ -69,162 +69,162 @@ let o = class extends A(C(v)) {
69
69
  * @internal
70
70
  */
71
71
  highlight(t) {
72
- this._highlightString = t;
72
+ this.b = t;
73
73
  }
74
74
  /**
75
75
  * @internal
76
76
  */
77
77
  setSelectedViaUserInteraction(t) {
78
- this.selected = t, this._selectionChange.emit(), this.selected && this._optionSelected.emit();
78
+ this.selected = t, this.n.emit(), this.selected && this.o.emit();
79
79
  }
80
- _updateDisableHighlight(t) {
81
- this._disableLabelHighlight = t, this.toggleAttribute("data-disable-highlight", t);
80
+ l(t) {
81
+ this.i = t, this.toggleAttribute("data-disable-highlight", t);
82
82
  }
83
- _selectByClick(t) {
84
- if (this.disabled || this._disabledFromGroup) {
83
+ s(t) {
84
+ if (this.disabled || this.c) {
85
85
  t.stopPropagation();
86
86
  return;
87
87
  }
88
- this._isMultiple ? (t.stopPropagation(), this.setSelectedViaUserInteraction(!this.selected)) : this.setSelectedViaUserInteraction(!0);
88
+ this.f ? (t.stopPropagation(), this.setSelectedViaUserInteraction(!this.selected)) : this.setSelectedViaUserInteraction(!0);
89
89
  }
90
90
  connectedCallback() {
91
- var e, s;
92
- super.connectedCallback(), this.id || (this.id = `sbb-option-${D++}`);
93
- const t = this._abort.signal, i = (e = this.closest) == null ? void 0 : e.call(this, "sbb-optgroup");
94
- i && (this._disabledFromGroup = i.disabled, this._updateAriaDisabled()), this._optionAttributeObserver.observe(this, G), this._negative = !!((s = this.closest) != null && s.call(
91
+ var o, s;
92
+ super.connectedCallback(), this.id || (this.id = `sbb-option-${O++}`);
93
+ const t = this.p.signal, e = (o = this.closest) == null ? void 0 : o.call(this, "sbb-optgroup");
94
+ e && (this.c = e.disabled, this.g()), this.j.observe(this, z), this.e = !!((s = this.closest) != null && s.call(
95
95
  this,
96
96
  // :is() selector not possible due to test environment
97
97
  "sbb-autocomplete[negative],sbb-select[negative],sbb-form-field[negative]"
98
- )), this.toggleAttribute("data-negative", this._negative), this._setVariantByContext(), this._handleHighlightState(), this.toggleAttribute("data-multiple", this._isMultiple), this.addEventListener("click", (a) => this._selectByClick(a), {
98
+ )), this.toggleAttribute("data-negative", this.e), this.t(), this.m(), this.toggleAttribute("data-multiple", this.f), this.addEventListener("click", (a) => this.s(a), {
99
99
  signal: t,
100
100
  passive: !0
101
101
  });
102
102
  }
103
103
  willUpdate(t) {
104
- super.willUpdate(t), t.has("disabled") && (p(this, "tabindex", y && !this.disabled && 0), this._updateAriaDisabled());
104
+ super.willUpdate(t), t.has("disabled") && (p(this, "tabindex", y && !this.disabled && 0), this.g());
105
105
  }
106
106
  firstUpdated(t) {
107
- super.firstUpdated(t), this._updateAriaSelected();
107
+ super.firstUpdated(t), this.h();
108
108
  }
109
- _updateAriaDisabled() {
109
+ g() {
110
110
  p(
111
111
  this,
112
112
  "aria-disabled",
113
- this.disabled || this._disabledFromGroup ? "true" : null
113
+ this.disabled || this.c ? "true" : null
114
114
  );
115
115
  }
116
- _updateAriaSelected() {
116
+ h() {
117
117
  this.setAttribute("aria-selected", `${this.selected}`);
118
118
  }
119
119
  disconnectedCallback() {
120
- super.disconnectedCallback(), this._optionAttributeObserver.disconnect();
120
+ super.disconnectedCallback(), this.j.disconnect();
121
121
  }
122
- _setVariantByContext() {
123
- var t, i;
124
- (t = this.closest) != null && t.call(this, "sbb-autocomplete") ? this._variant = "autocomplete" : (i = this.closest) != null && i.call(this, "sbb-select") && (this._variant = "select");
122
+ t() {
123
+ var t, e;
124
+ (t = this.closest) != null && t.call(this, "sbb-autocomplete") ? this.d = "autocomplete" : (e = this.closest) != null && e.call(this, "sbb-select") && (this.d = "select");
125
125
  }
126
126
  /** Observe changes on data attributes and set the appropriate values. */
127
- _onOptionAttributesChange(t) {
128
- for (const i of t)
129
- i.attributeName === "data-group-disabled" ? (this._disabledFromGroup = this.hasAttribute("data-group-disabled"), this._updateAriaDisabled()) : i.attributeName === "data-negative" && (this._negative = this.hasAttribute("data-negative"));
127
+ q(t) {
128
+ for (const e of t)
129
+ e.attributeName === "data-group-disabled" ? (this.c = this.hasAttribute("data-group-disabled"), this.g()) : e.attributeName === "data-negative" && (this.e = this.hasAttribute("data-negative"));
130
130
  }
131
- _handleHighlightState() {
132
- if (!this._isAutocomplete) {
133
- this._updateDisableHighlight(!0);
131
+ m() {
132
+ if (!this.k) {
133
+ this.l(!0);
134
134
  return;
135
135
  }
136
136
  const t = Array.from(this.childNodes ?? []).filter(
137
- (e) => !(e instanceof Element) || e.slot !== "icon"
138
- ), i = t.filter((e) => e.nodeType === Node.TEXT_NODE);
139
- if (i.length === 0 || t.filter((e) => !(e instanceof Element) || e.localName !== "template").length !== i.length) {
140
- this._updateDisableHighlight(!0);
137
+ (o) => !(o instanceof Element) || o.slot !== "icon"
138
+ ), e = t.filter((o) => o.nodeType === Node.TEXT_NODE);
139
+ if (e.length === 0 || t.filter((o) => !(o instanceof Element) || o.localName !== "template").length !== e.length) {
140
+ this.l(!0);
141
141
  return;
142
142
  }
143
- this._label = i.map((e) => e.wholeText).filter((e) => e.trim()).join();
143
+ this.a = e.map((o) => o.wholeText).filter((o) => o.trim()).join();
144
144
  }
145
- _getHighlightedLabel() {
146
- if (!this._highlightString || !this._highlightString.trim())
147
- return l`${this._label}`;
148
- const t = this._label.toLowerCase().indexOf(this._highlightString.toLowerCase());
145
+ u() {
146
+ if (!this.b || !this.b.trim())
147
+ return b`${this.a}`;
148
+ const t = this.a.toLowerCase().indexOf(this.b.toLowerCase());
149
149
  if (t === -1)
150
- return l`${this._label}`;
151
- const i = this._label.substring(0, t), e = this._label.substring(
150
+ return b`${this.a}`;
151
+ const e = this.a.substring(0, t), o = this.a.substring(
152
152
  t,
153
- t + this._highlightString.length
154
- ), s = this._label.substring(t + this._highlightString.length);
155
- return l`
156
- <span class="sbb-option__label--highlight">${i}</span><span>${e}</span
153
+ t + this.b.length
154
+ ), s = this.a.substring(t + this.b.length);
155
+ return b`
156
+ <span class="sbb-option__label--highlight">${e}</span><span>${o}</span
157
157
  ><span class="sbb-option__label--highlight">${s}</span>
158
158
  `;
159
159
  }
160
160
  render() {
161
- const t = this._isMultiple;
162
- return l`
161
+ const t = this.f;
162
+ return b`
163
163
  <div class="sbb-option__container">
164
164
  <div class="sbb-option">
165
165
  <!-- Icon -->
166
- ${t ? b : l` <span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}
166
+ ${t ? n : b` <span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}
167
167
 
168
168
  <!-- Checkbox -->
169
- ${t ? l` <sbb-visual-checkbox
169
+ ${t ? b` <sbb-visual-checkbox
170
170
  ?checked=${this.selected}
171
- ?disabled=${this.disabled || this._disabledFromGroup}
172
- ?negative=${this._negative}
173
- ></sbb-visual-checkbox>` : b}
171
+ ?disabled=${this.disabled || this.c}
172
+ ?negative=${this.e}
173
+ ></sbb-visual-checkbox>` : n}
174
174
 
175
175
  <!-- Label -->
176
176
  <span class="sbb-option__label">
177
- <slot @slotchange=${this._handleHighlightState}></slot>
177
+ <slot @slotchange=${this.m}></slot>
178
178
 
179
179
  <!-- Search highlight -->
180
- ${this._isAutocomplete && this._label && !this._disableLabelHighlight ? this._getHighlightedLabel() : b}
181
- ${H && this.getAttribute("data-group-label") ? l` <sbb-screen-reader-only>
180
+ ${this.k && this.a && !this.i ? this.u() : n}
181
+ ${E && this.getAttribute("data-group-label") ? b` <sbb-screen-reader-only>
182
182
  (${this.getAttribute("data-group-label")})</sbb-screen-reader-only
183
- >` : b}
183
+ >` : n}
184
184
  </span>
185
185
 
186
186
  <!-- Selected tick -->
187
- ${this._isSelect && !t && this.selected ? l`<sbb-icon name="tick-small"></sbb-icon>` : b}
187
+ ${this.r && !t && this.selected ? b`<sbb-icon name="tick-small"></sbb-icon>` : n}
188
188
  </div>
189
189
  </div>
190
190
  `;
191
191
  }
192
192
  };
193
- o.styles = w;
194
- o.events = {
193
+ i.styles = $;
194
+ i.events = {
195
195
  selectionChange: "optionSelectionChange",
196
196
  optionSelected: "optionSelected"
197
197
  };
198
198
  r([
199
199
  h()
200
- ], o.prototype, "value", 1);
200
+ ], i.prototype, "value", 1);
201
201
  r([
202
202
  h({ reflect: !0, type: Boolean })
203
- ], o.prototype, "active", 2);
203
+ ], i.prototype, "active", 2);
204
204
  r([
205
205
  h({ type: Boolean })
206
- ], o.prototype, "selected", 1);
206
+ ], i.prototype, "selected", 1);
207
207
  r([
208
- n()
209
- ], o.prototype, "_negative", 2);
208
+ l()
209
+ ], i.prototype, "e", 2);
210
210
  r([
211
- n()
212
- ], o.prototype, "_disabledFromGroup", 2);
211
+ l()
212
+ ], i.prototype, "c", 2);
213
213
  r([
214
- n()
215
- ], o.prototype, "_label", 2);
214
+ l()
215
+ ], i.prototype, "a", 2);
216
216
  r([
217
- n()
218
- ], o.prototype, "_highlightString", 2);
217
+ l()
218
+ ], i.prototype, "b", 2);
219
219
  r([
220
- n()
221
- ], o.prototype, "_disableLabelHighlight", 2);
222
- o = r([
223
- _("sbb-option"),
224
- x({
220
+ l()
221
+ ], i.prototype, "i", 2);
222
+ i = r([
223
+ f("sbb-option"),
224
+ k({
225
225
  role: "option"
226
226
  })
227
- ], o);
227
+ ], i);
228
228
  export {
229
- o as SbbOptionElement
229
+ i as SbbOptionElement
230
230
  };
package/overlay.js CHANGED
@@ -98,15 +98,15 @@ var z = Object.defineProperty, M = Object.getOwnPropertyDescriptor, c = (t, e, o
98
98
  };
99
99
  let s = class extends H {
100
100
  constructor() {
101
- super(...arguments), this.expanded = !1, this.backButton = !1, this.closeAttribute = "sbb-overlay-close", this._backClick = new p(
101
+ super(...arguments), this.expanded = !1, this.backButton = !1, this.closeAttribute = "sbb-overlay-close", this.b = new p(
102
102
  this,
103
103
  s.events.backClick
104
- ), this._overlayContentElement = null;
104
+ ), this.a = null;
105
105
  }
106
106
  /** Opens the component. */
107
107
  open() {
108
108
  var t;
109
- this.state === "closed" && (this.lastFocusedElement = document.activeElement, this._overlayContentElement = (t = this.shadowRoot) == null ? void 0 : t.querySelector(
109
+ this.state === "closed" && (this.lastFocusedElement = document.activeElement, this.a = (t = this.shadowRoot) == null ? void 0 : t.querySelector(
110
110
  ".sbb-overlay__content"
111
111
  ), this.willOpen.emit() && (this.state = "opening", l.push(this), this.scrollHandler.disableScroll()));
112
112
  }
@@ -115,7 +115,7 @@ let s = class extends H {
115
115
  // To avoid entering a corrupt state, exit when state is not expected.
116
116
  onOverlayAnimationEnd(t) {
117
117
  var e, o, a;
118
- t.animationName === "open" && this.state === "opening" ? (this.state = "opened", this.didOpen.emit(), y(this), this.attachOpenOverlayEvents(), this.setOverlayFocus(), setTimeout(() => this.setAriaLiveRefContent(this.accessibilityLabel)), this.focusHandler.trap(this)) : t.animationName === "close" && this.state === "closing" && ((e = this._overlayContentElement) == null || e.scrollTo(0, 0), this.state = "closed", m(), h(this.lastFocusedElement), (o = this.lastFocusedElement) == null || o.focus(), (a = this.openOverlayController) == null || a.abort(), this.focusHandler.disconnect(), this.removeInstanceFromGlobalCollection(), !l.length && this.scrollHandler.enableScroll(), this.didClose.emit({
118
+ t.animationName === "open" && this.state === "opening" ? (this.state = "opened", this.didOpen.emit(), y(this), this.attachOpenOverlayEvents(), this.setOverlayFocus(), setTimeout(() => this.setAriaLiveRefContent(this.accessibilityLabel)), this.focusHandler.trap(this)) : t.animationName === "close" && this.state === "closing" && ((e = this.a) == null || e.scrollTo(0, 0), this.state = "closed", m(), h(this.lastFocusedElement), (o = this.lastFocusedElement) == null || o.focus(), (a = this.openOverlayController) == null || a.abort(), this.focusHandler.disconnect(), this.removeInstanceFromGlobalCollection(), !l.length && this.scrollHandler.enableScroll(), this.didClose.emit({
119
119
  returnValue: this.returnValue,
120
120
  closeTarget: this.overlayCloseElement
121
121
  }));
@@ -148,7 +148,7 @@ let s = class extends H {
148
148
  size="m"
149
149
  type="button"
150
150
  icon-name="chevron-small-left-small"
151
- @click=${() => this._backClick.emit()}
151
+ @click=${() => this.b.emit()}
152
152
  ></${v(t)}>
153
153
  `;
154
154
  return d`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements",
3
- "version": "0.52.0",
3
+ "version": "0.52.1",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",