@sbb-esta/lyne-elements 0.52.1 → 0.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/accordion.js +54 -54
  2. package/action-group.js +3 -3
  3. package/alert/alert-group.js +22 -22
  4. package/alert/alert.js +22 -22
  5. package/autocomplete.js +126 -126
  6. package/breadcrumb/breadcrumb-group.js +60 -60
  7. package/breadcrumb/breadcrumb.js +17 -17
  8. package/calendar.js +423 -423
  9. package/card/card-badge.js +17 -17
  10. package/card/card.js +2 -2
  11. package/card/common.js +30 -30
  12. package/checkbox/checkbox-group.js +17 -17
  13. package/checkbox/checkbox.js +34 -34
  14. package/clock.js +83 -83
  15. package/container/sticky-bar.js +16 -16
  16. package/core/a11y.js +91 -91
  17. package/core/base-elements.js +86 -86
  18. package/core/controllers.js +40 -40
  19. package/core/datetime.js +32 -32
  20. package/core/dom.js +26 -26
  21. package/core/eventing.js +33 -33
  22. package/core/mixins.js +122 -122
  23. package/core/testing.js +29 -29
  24. package/datepicker/common.js +55 -55
  25. package/datepicker/datepicker-toggle.js +94 -94
  26. package/datepicker/datepicker.js +144 -144
  27. package/dialog/dialog-title.js +20 -20
  28. package/dialog/dialog.js +66 -66
  29. package/expansion-panel/expansion-panel-header.js +20 -20
  30. package/expansion-panel/expansion-panel.js +60 -60
  31. package/file-selector.js +91 -91
  32. package/form-field/form-field-clear.js +12 -12
  33. package/form-field/form-field.js +111 -111
  34. package/header/header.js +53 -53
  35. package/icon.js +107 -107
  36. package/image.js +87 -87
  37. package/journey-header.js +29 -29
  38. package/map-container.js +23 -23
  39. package/menu/menu.js +91 -91
  40. package/navigation/common.js +16 -16
  41. package/navigation/navigation-marker.js +34 -34
  42. package/navigation/navigation-section.js +83 -83
  43. package/navigation/navigation.js +87 -87
  44. package/notification.js +52 -52
  45. package/option/optgroup.js +45 -45
  46. package/option/option.js +108 -108
  47. package/overlay.js +5 -5
  48. package/package.json +1 -1
  49. package/popover/popover.js +110 -110
  50. package/radio-button/radio-button-group.js +93 -93
  51. package/radio-button/radio-button.js +84 -84
  52. package/select.js +178 -178
  53. package/selection-panel.js +44 -44
  54. package/slider.js +58 -58
  55. package/status.js +6 -6
  56. package/stepper/step-label.js +19 -19
  57. package/stepper/step.js +31 -31
  58. package/stepper/stepper.js +46 -46
  59. package/tabs/tab-group.js +67 -67
  60. package/tag/tag-group.js +8 -8
  61. package/tag/tag.js +27 -27
  62. package/teaser-paid.js +12 -12
  63. package/time-input.js +73 -73
  64. package/timetable-occupancy-icon.js +26 -26
  65. package/timetable-occupancy.js +9 -9
  66. package/toast.js +38 -38
  67. package/toggle/toggle-option.js +33 -33
  68. package/toggle/toggle.js +46 -46
  69. package/train/train-formation.js +36 -36
  70. package/train/train-wagon.js +30 -30
  71. package/train/train.js +13 -13
@@ -1,41 +1,41 @@
1
- import { css as u, LitElement as f, html as w, nothing as g } from "lit";
2
- import { property as l, customElement as y } from "lit/decorators.js";
3
- import { ref as h } from "lit/directives/ref.js";
4
- import { setModalityOnNextFocus as v, getFirstFocusableElement as _, getFocusableElements as p } from "../core/a11y.js";
5
- import { SbbLanguageController as k, SbbSlotStateController as x } from "../core/controllers.js";
6
- import { hostAttributes as A } from "../core/decorators.js";
7
- import { setOrRemoveAttribute as E, findReferencedElement as z, isBreakpoint as S } from "../core/dom.js";
8
- import { i18nGoBack as C } from "../core/i18n.js";
1
+ import { css as _, LitElement as u, html as f, nothing as v } from "lit";
2
+ import { property as l, customElement as w } from "lit/decorators.js";
3
+ import { ref as d } from "lit/directives/ref.js";
4
+ import { setModalityOnNextFocus as h, getFirstFocusableElement as y, getFocusableElements as m } from "../core/a11y.js";
5
+ import { SbbLanguageController as k, SbbSlotStateController as E } from "../core/controllers.js";
6
+ import { hostAttributes as x } from "../core/decorators.js";
7
+ import { setOrRemoveAttribute as C, findReferencedElement as A, isBreakpoint as S } from "../core/dom.js";
8
+ import { i18nGoBack as N } from "../core/i18n.js";
9
9
  import { SbbUpdateSchedulerMixin as L } from "../core/mixins.js";
10
- import { removeAriaOverlayTriggerAttributes as N, setAriaOverlayTriggerAttributes as O } from "../core/overlay.js";
10
+ import { removeAriaOverlayTriggerAttributes as z, setAriaOverlayTriggerAttributes as T } from "../core/overlay.js";
11
11
  import "../button/transparent-button.js";
12
12
  import "../divider.js";
13
- const F = u`*,:before,:after{box-sizing:border-box}:host{--sbb-navigation-section-display: none;--sbb-navigation-section-column: 1 / 5;--sbb-navigation-section-position: fixed;--sbb-navigation-section-pointer-events: none;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-3x) );--sbb-navigation-section-animation-easing: ease-out;--sbb-navigation-section-padding-inline: var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-l);--sbb-navigation-section-transform: translateX(100%);--sbb-navigation-section-content-padding-inline-start: var(--sbb-spacing-fixed-12x);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-navigation-section-width: 100vw;--sbb-navigation-section-height: 100vh;display:var(--sbb-navigation-section-display);position:var(--sbb-navigation-section-position);grid-column:var(--sbb-navigation-section-column);inset-inline-start:0;inset-block-start:0;width:var(--sbb-navigation-section-width);height:var(--sbb-navigation-section-height);z-index:var(--sbb-navigation-z-index, var(--sbb-overlay-default-z-index))}@supports (width: 100dvw){:host{--sbb-navigation-section-width: 100dvw}}@supports (height: 100dvh){:host{--sbb-navigation-section-height: 100dvh}}@media (min-width: 64rem){:host{--sbb-navigation-section-column: 5 / 9;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xl);--sbb-navigation-section-padding-inline: var(--sbb-spacing-fixed-8x) var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-position: relative;--sbb-navigation-section-transform: translateX(0%);--sbb-navigation-section-content-padding-inline-start: 0;--sbb-navigation-section-width: calc( 100% + var(--sbb-layout-base-offset-responsive) + var(--sbb-grid-base-gutter-responsive) );transform:translate(calc(var(--sbb-grid-base-gutter-responsive) * -1))}}@media (min-width: 80rem){:host{--sbb-navigation-section-column: 5 / 13}}@media (min-width: 90rem){:host{--sbb-navigation-section-column: 6 / 17;--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xxl) var(--sbb-spacing-responsive-l)}}:host([data-state=opened]){--sbb-navigation-section-pointer-events: all}:host([data-state=opening]){--sbb-navigation-section-position: absolute}:host(:is([data-state=opening],[data-state=closing])){--sbb-navigation-section-pointer-events: none}:host([data-state]:not([data-state=closed])){--sbb-navigation-section-display: block}::slotted(*){padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}::slotted([data-sbb-button]){grid-column-start:1}.sbb-navigation-section__container{pointer-events:var(--sbb-navigation-section-pointer-events);height:var(--sbb-navigation-section-height)}.sbb-navigation-section{display:none;border:none;margin:0;width:100%;height:100%;color:var(--sbb-color-white);background-color:transparent;padding:0;overflow:hidden}:host([data-state]:not([data-state=closed])) .sbb-navigation-section{display:block;animation-name:open;animation-duration:var(--sbb-navigation-section-animation-duration);animation-timing-function:var(--sbb-navigation-section-animation-easing)}:host([data-state][data-state=closing]) .sbb-navigation-section{animation-name:close}@media (forced-colors: active){.sbb-navigation-section{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-navigation-section__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-white-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-white-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x);height:100%;padding-block:var(--sbb-navigation-section-padding-block);outline:none;overflow-y:auto}.sbb-navigation-section__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-navigation-section__wrapper::-webkit-scrollbar-button,.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-navigation-section__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}:host(:is([data-state=opening],[data-state=closing])) .sbb-navigation-section__wrapper{--sbb-scrollbar-color: transparent;scrollbar-color:transparent transparent}.sbb-navigation-section__header{position:relative;display:flex;align-items:center;gap:var(--sbb-spacing-fixed-1x);margin-block-start:var(--sbb-spacing-responsive-xxl);padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}@media (min-width: 64rem){.sbb-navigation-section__header{margin-block-start:0;padding-inline-start:0}}@media (min-width: 80rem){.sbb-navigation-section__header{grid-column:1/4}}:host(:not([data-slot-names~=title],[title-content])) .sbb-navigation-section__header{display:none}.sbb-navigation-section__back{position:absolute;transform:translate(calc((100% + var(--sbb-spacing-fixed-1x)) * -1))}@media (min-width: 64rem){.sbb-navigation-section__back{display:none}}.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-4)}@media (min-width: 64rem){.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-2)}}.sbb-navigation-section__content{display:grid;grid-template-columns:1fr;grid-gap:var(--sbb-spacing-responsive-l) var(--sbb-grid-base-gutter-responsive);padding-inline:var(--sbb-navigation-section-padding-inline)}@media (min-width: 64rem){.sbb-navigation-section__content{opacity:0;transform:translateY(var(--sbb-spacing-fixed-3x));transition-duration:var(--sbb-navigation-section-animation-duration);transition-delay:var(--sbb-navigation-section-animation-duration);transition-timing-function:var(--sbb-navigation-section-animation-easing);transition-property:opacity,transform}:host([data-state=opened]) .sbb-navigation-section__content{opacity:1;transform:translateY(0)}}@media (min-width: 80rem){.sbb-navigation-section__content{grid-template-columns:repeat(3,1fr)}}:host([data-state=closing]) .sbb-navigation-section__content{transition-delay:0s}@keyframes open{0%{transform:var(--sbb-navigation-section-transform)}to{transform:translate(0)}}@keyframes close{0%{transform:translate(0)}to{transform:var(--sbb-navigation-section-transform)}}`;
14
- var T = Object.defineProperty, R = Object.getOwnPropertyDescriptor, b = (t, i, a, s) => {
15
- for (var n = s > 1 ? void 0 : s ? R(i, a) : i, o = t.length - 1, r; o >= 0; o--)
16
- (r = t[o]) && (n = (s ? r(i, a, n) : r(n)) || n);
17
- return s && n && T(i, a, n), n;
13
+ const F = _`*,:before,:after{box-sizing:border-box}:host{--sbb-navigation-section-display: none;--sbb-navigation-section-column: 1 / 5;--sbb-navigation-section-position: fixed;--sbb-navigation-section-pointer-events: none;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-3x) );--sbb-navigation-section-animation-easing: ease-out;--sbb-navigation-section-padding-inline: var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-l);--sbb-navigation-section-transform: translateX(100%);--sbb-navigation-section-content-padding-inline-start: var(--sbb-spacing-fixed-12x);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-navigation-section-width: 100vw;--sbb-navigation-section-height: 100vh;display:var(--sbb-navigation-section-display);position:var(--sbb-navigation-section-position);grid-column:var(--sbb-navigation-section-column);inset-inline-start:0;inset-block-start:0;width:var(--sbb-navigation-section-width);height:var(--sbb-navigation-section-height);z-index:var(--sbb-navigation-z-index, var(--sbb-overlay-default-z-index))}@supports (width: 100dvw){:host{--sbb-navigation-section-width: 100dvw}}@supports (height: 100dvh){:host{--sbb-navigation-section-height: 100dvh}}@media (min-width: 64rem){:host{--sbb-navigation-section-column: 5 / 9;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xl);--sbb-navigation-section-padding-inline: var(--sbb-spacing-fixed-8x) var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-position: relative;--sbb-navigation-section-transform: translateX(0%);--sbb-navigation-section-content-padding-inline-start: 0;--sbb-navigation-section-width: calc( 100% + var(--sbb-layout-base-offset-responsive) + var(--sbb-grid-base-gutter-responsive) );transform:translate(calc(var(--sbb-grid-base-gutter-responsive) * -1))}}@media (min-width: 80rem){:host{--sbb-navigation-section-column: 5 / 13}}@media (min-width: 90rem){:host{--sbb-navigation-section-column: 6 / 17;--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xxl) var(--sbb-spacing-responsive-l)}}:host([data-state=opened]){--sbb-navigation-section-pointer-events: all}:host([data-state=opening]){--sbb-navigation-section-position: absolute}:host(:is([data-state=opening],[data-state=closing])){--sbb-navigation-section-pointer-events: none}:host([data-state]:not([data-state=closed])){--sbb-navigation-section-display: block}::slotted(*){padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}::slotted([data-sbb-button]){grid-column-start:1}.sbb-navigation-section__container{pointer-events:var(--sbb-navigation-section-pointer-events);height:var(--sbb-navigation-section-height)}.sbb-navigation-section{display:none;border:none;margin:0;width:100%;height:100%;color:var(--sbb-color-white);background-color:transparent;padding:0;overflow:hidden}:host([data-state]:not([data-state=closed])) .sbb-navigation-section{display:block;animation-name:open;animation-duration:var(--sbb-navigation-section-animation-duration);animation-timing-function:var(--sbb-navigation-section-animation-easing)}:host([data-state][data-state=closing]) .sbb-navigation-section{animation-name:close}@media (forced-colors: active){.sbb-navigation-section{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-navigation-section__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-white-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-white-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x);height:100%;padding-block:var(--sbb-navigation-section-padding-block);outline:none;overflow-y:auto}.sbb-navigation-section__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-navigation-section__wrapper::-webkit-scrollbar-button,.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-navigation-section__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}:host(:is([data-state=opening],[data-state=closing])) .sbb-navigation-section__wrapper{--sbb-scrollbar-color: transparent;scrollbar-color:transparent transparent}.sbb-navigation-section__header{position:relative;display:flex;align-items:center;gap:var(--sbb-spacing-fixed-1x);margin-block-start:var(--sbb-spacing-responsive-xxl);padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}@media (min-width: 64rem){.sbb-navigation-section__header{margin-block-start:0;padding-inline-start:0}}@media (min-width: 80rem){.sbb-navigation-section__header{grid-column:1/4}}:host(:not([data-slot-names~=title],[title-content])) .sbb-navigation-section__header{display:none}.sbb-navigation-section__back{position:absolute;transform:translate(calc((100% + var(--sbb-spacing-fixed-1x)) * -1))}@media (min-width: 64rem){.sbb-navigation-section__back{display:none}}.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-4)}@media (min-width: 64rem){.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-2)}}.sbb-navigation-section__content{display:grid;grid-template-columns:1fr;grid-gap:var(--sbb-spacing-responsive-l) var(--sbb-grid-base-gutter-responsive);padding-inline:var(--sbb-navigation-section-padding-inline)}@media (min-width: 64rem){.sbb-navigation-section__content{opacity:0;transform:translateY(var(--sbb-spacing-fixed-3x));transition-duration:var(--sbb-navigation-section-animation-duration);transition-delay:var(--sbb-navigation-section-animation-duration);transition-timing-function:var(--sbb-navigation-section-animation-easing);transition-property:opacity,transform}:host([data-state=opened]) .sbb-navigation-section__content{opacity:1;transform:translateY(0)}}@media (min-width: 80rem){.sbb-navigation-section__content{grid-template-columns:repeat(3,1fr)}}:host([data-state=closing]) .sbb-navigation-section__content{transition-delay:0s}@keyframes open{0%{transform:var(--sbb-navigation-section-transform)}to{transform:translate(0)}}@keyframes close{0%{transform:translate(0)}to{transform:var(--sbb-navigation-section-transform)}}`;
14
+ var B = Object.defineProperty, O = Object.getOwnPropertyDescriptor, b = (t, i, n, a) => {
15
+ for (var e = a > 1 ? void 0 : a ? O(i, n) : i, s = t.length - 1, r; s >= 0; s--)
16
+ (r = t[s]) && (e = (a ? r(i, n, e) : r(e)) || e);
17
+ return a && e && B(i, n, e), e;
18
18
  };
19
- let $ = 0, e = class extends L(f) {
19
+ let P = 0, o = class extends L(u) {
20
20
  constructor() {
21
- super(), this.e = null, this.f = null, this.a = null, this.m = new k(this), this.w = (t) => {
22
- t.composedPath().filter((a) => a instanceof window.HTMLElement).some((a) => this.x(a)) && this.close();
23
- }, new x(this);
21
+ super(), this._trigger = null, this._firstLevelNavigation = null, this._triggerElement = null, this._language = new k(this), this._handleNavigationSectionClose = (t) => {
22
+ t.composedPath().filter((n) => n instanceof window.HTMLElement).some((n) => this._isCloseElement(n)) && this.close();
23
+ }, new E(this);
24
24
  }
25
25
  set trigger(t) {
26
- const i = this.e;
27
- this.e = t, this.l(this.e, i);
26
+ const i = this._trigger;
27
+ this._trigger = t, this._removeTriggerClickListener(this._trigger, i);
28
28
  }
29
29
  get trigger() {
30
- return this.e;
30
+ return this._trigger;
31
31
  }
32
32
  /**
33
33
  * The state of the navigation section.
34
34
  */
35
- set b(t) {
36
- this.setAttribute("data-state", t), E(this, "aria-hidden", this.b !== "opened" ? "true" : null);
35
+ set _state(t) {
36
+ this.setAttribute("data-state", t), C(this, "aria-hidden", this._state !== "opened" ? "true" : null);
37
37
  }
38
- get b() {
38
+ get _state() {
39
39
  return this.getAttribute("data-state");
40
40
  }
41
41
  /**
@@ -43,115 +43,115 @@ let $ = 0, e = class extends L(f) {
43
43
  */
44
44
  open() {
45
45
  var t;
46
- this.b !== "closed" || !this.h || (this.n(), this.o(), this.b = "opening", this.startUpdate(), this.inert = !0, (t = this.a) == null || t.setAttribute("aria-expanded", "true"));
46
+ this._state !== "closed" || !this._navigationSection || (this._setActiveNavigationAction(), this._closePreviousNavigationSection(), this._state = "opening", this.startUpdate(), this.inert = !0, (t = this._triggerElement) == null || t.setAttribute("aria-expanded", "true"));
47
47
  }
48
- n() {
48
+ _setActiveNavigationAction() {
49
49
  var t, i;
50
- (i = (t = this.a) == null ? void 0 : t.marker) == null || i.select(this.a);
50
+ (i = (t = this._triggerElement) == null ? void 0 : t.marker) == null || i.select(this._triggerElement);
51
51
  }
52
- o() {
52
+ _closePreviousNavigationSection() {
53
53
  var t, i;
54
- (i = (t = this.f) == null ? void 0 : t.activeNavigationSection) == null || i.close();
54
+ (i = (t = this._firstLevelNavigation) == null ? void 0 : t.activeNavigationSection) == null || i.close();
55
55
  }
56
56
  /**
57
57
  * Closes the navigation section.
58
58
  */
59
59
  close() {
60
60
  var t;
61
- this.b === "opened" && (this.b = "closing", this.startUpdate(), this.inert = !0, (t = this.a) == null || t.setAttribute("aria-expanded", "false"));
61
+ this._state === "opened" && (this._state = "closing", this.startUpdate(), this.inert = !0, (t = this._triggerElement) == null || t.setAttribute("aria-expanded", "false"));
62
62
  }
63
63
  // Removes trigger click listener on trigger change.
64
- l(t, i) {
65
- var a, s;
66
- t !== i && ((a = this.c) == null || a.abort(), (s = this.d) == null || s.abort(), this.j(this.trigger));
64
+ _removeTriggerClickListener(t, i) {
65
+ var n, a;
66
+ t !== i && ((n = this._navigationSectionController) == null || n.abort(), (a = this._windowEventsController) == null || a.abort(), this._configure(this.trigger));
67
67
  }
68
68
  // Check if the trigger is valid and attach click event listeners.
69
- j(t) {
69
+ _configure(t) {
70
70
  var i;
71
- N(this.a), t && (this.a = z(t), this.a && (O(this.a, "menu", this.id, this.b), (i = this.c) == null || i.abort(), this.c = new AbortController(), this.a.connectedSection = this, this.a.addEventListener("click", () => this.open(), {
72
- signal: this.c.signal
73
- }), this.addEventListener("keydown", (a) => this.p(a), {
74
- signal: this.c.signal
71
+ z(this._triggerElement), t && (this._triggerElement = A(t), this._triggerElement && (T(this._triggerElement, "menu", this.id, this._state), (i = this._navigationSectionController) == null || i.abort(), this._navigationSectionController = new AbortController(), this._triggerElement.connectedSection = this, this._triggerElement.addEventListener("click", () => this.open(), {
72
+ signal: this._navigationSectionController.signal
73
+ }), this.addEventListener("keydown", (n) => this._handleNavigationSectionFocus(n), {
74
+ signal: this._navigationSectionController.signal
75
75
  })));
76
76
  }
77
- k() {
78
- this.f && (this.f.shadowRoot.querySelector(
77
+ _setNavigationInert() {
78
+ this._firstLevelNavigation && (this._firstLevelNavigation.shadowRoot.querySelector(
79
79
  ".sbb-navigation__content"
80
- ).inert = this.g() && this.b !== "closed");
80
+ ).inert = this._isZeroToLargeBreakpoint() && this._state !== "closed");
81
81
  }
82
82
  // In rare cases it can be that the animationEnd event is triggered twice.
83
83
  // To avoid entering a corrupt state, exit when state is not expected.
84
- q(t) {
84
+ _onAnimationEnd(t) {
85
85
  var i;
86
- t.animationName === "open" && this.b === "opening" ? (this.b = "opened", this.inert = !1, this.r(), this.k(), this.s(), this.t()) : t.animationName === "close" && this.b === "closing" && (this.b = "closed", this.i.scrollTo(0, 0), (i = this.d) == null || i.abort(), this.u(), this.k(), this.g() && this.a && (v(this.a), this.a.focus())), this.completeUpdate();
86
+ t.animationName === "open" && this._state === "opening" ? (this._state = "opened", this.inert = !1, this._attachWindowEvents(), this._setNavigationInert(), this._setNavigationSectionFocus(), this._checkActiveAction()) : t.animationName === "close" && this._state === "closing" && (this._state = "closed", this._navigationSectionContainerElement.scrollTo(0, 0), (i = this._windowEventsController) == null || i.abort(), this._resetLists(), this._setNavigationInert(), this._isZeroToLargeBreakpoint() && this._triggerElement && (h(this._triggerElement), this._triggerElement.focus())), this.completeUpdate();
87
87
  }
88
- u() {
88
+ _resetLists() {
89
89
  const t = Array.from(
90
90
  this.querySelectorAll("[data-section-action][data-action-active]")
91
91
  );
92
92
  t == null || t.forEach((i) => i.removeAttribute("data-action-active"));
93
93
  }
94
- r() {
95
- this.d = new AbortController(), window.addEventListener("keydown", (t) => this.v(t), {
96
- signal: this.d.signal
97
- }), window.addEventListener("click", this.w, {
98
- signal: this.d.signal
94
+ _attachWindowEvents() {
95
+ this._windowEventsController = new AbortController(), window.addEventListener("keydown", (t) => this._onKeydownEvent(t), {
96
+ signal: this._windowEventsController.signal
97
+ }), window.addEventListener("click", this._handleNavigationSectionClose, {
98
+ signal: this._windowEventsController.signal
99
99
  });
100
100
  }
101
- x(t) {
101
+ _isCloseElement(t) {
102
102
  return t.nodeName === "A" || !t.hasAttribute("disabled") && (t.hasAttribute("sbb-navigation-close") || t.hasAttribute("sbb-navigation-section-close"));
103
103
  }
104
- g() {
104
+ _isZeroToLargeBreakpoint() {
105
105
  return S("zero", "large");
106
106
  }
107
107
  // Closes the navigation on "Esc" key pressed.
108
- v(t) {
109
- this.b === "opened" && t.key === "Escape" && this.close();
108
+ _onKeydownEvent(t) {
109
+ this._state === "opened" && t.key === "Escape" && this.close();
110
110
  }
111
111
  // Set focus on the first focusable element.
112
- s() {
113
- const t = _(
112
+ _setNavigationSectionFocus() {
113
+ const t = y(
114
114
  [this.shadowRoot.querySelector("#sbb-navigation-section-back-button")].concat(Array.from(this.children)).filter((i) => i instanceof window.HTMLElement)
115
115
  );
116
- t && (v(t), t.focus());
116
+ t && (h(t), t.focus());
117
117
  }
118
- t() {
118
+ _checkActiveAction() {
119
119
  var t;
120
120
  (t = this.querySelector(
121
121
  ":is(sbb-navigation-button, sbb-navigation-link).sbb-active"
122
122
  )) == null || t.toggleAttribute("data-action-active", !0);
123
123
  }
124
- p(t) {
125
- if (t.key !== "Tab" || this.g())
124
+ _handleNavigationSectionFocus(t) {
125
+ if (t.key !== "Tab" || this._isZeroToLargeBreakpoint())
126
126
  return;
127
127
  const i = Array.from(
128
128
  this.closest("sbb-navigation").shadowRoot.children
129
- ), a = p(i, {
130
- filter: (m) => m.nodeName !== "SBB-NAVIGATION-SECTION"
131
- }), s = Array.from(this.shadowRoot.children), n = p(s), o = n[0], r = n[n.length - 1], c = t.shiftKey ? this.a : a[a.indexOf(this.a) + 1], d = t.shiftKey ? o : r;
132
- c && (o.getRootNode().activeElement === d || r.getRootNode().activeElement === d) && (c.focus(), t.preventDefault());
129
+ ), n = m(i, {
130
+ filter: (p) => p.nodeName !== "SBB-NAVIGATION-SECTION"
131
+ }), a = Array.from(this.shadowRoot.children), e = m(a), s = e[0], r = e[e.length - 1], c = t.shiftKey ? this._triggerElement : n[n.indexOf(this._triggerElement) + 1], g = t.shiftKey ? s : r;
132
+ c && (s.getRootNode().activeElement === g || r.getRootNode().activeElement === g) && (c.focus(), t.preventDefault());
133
133
  }
134
134
  connectedCallback() {
135
135
  var t, i;
136
- super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${$++}`), this.b || (this.b = "closed"), this.j(this.trigger), this.f = (i = (t = this.a) == null ? void 0 : t.closest) == null ? void 0 : i.call(t, "sbb-navigation");
136
+ super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${P++}`), this._state || (this._state = "closed"), this._configure(this.trigger), this._firstLevelNavigation = (i = (t = this._triggerElement) == null ? void 0 : t.closest) == null ? void 0 : i.call(t, "sbb-navigation");
137
137
  }
138
138
  disconnectedCallback() {
139
139
  var t, i;
140
- super.disconnectedCallback(), (t = this.c) == null || t.abort(), (i = this.d) == null || i.abort();
140
+ super.disconnectedCallback(), (t = this._navigationSectionController) == null || t.abort(), (i = this._windowEventsController) == null || i.abort();
141
141
  }
142
142
  render() {
143
- return w`
143
+ return f`
144
144
  <div
145
145
  class="sbb-navigation-section__container"
146
- ${h((t) => this.i = t)}
146
+ ${d((t) => this._navigationSectionContainerElement = t)}
147
147
  >
148
148
  <nav
149
- @animationend=${(t) => this.q(t)}
149
+ @animationend=${(t) => this._onAnimationEnd(t)}
150
150
  class="sbb-navigation-section"
151
- aria-labelledby=${this.accessibilityLabel ? g : "title"}
152
- aria-label=${this.accessibilityLabel ? this.accessibilityLabel : g}
153
- ${h(
154
- (t) => this.h = t
151
+ aria-labelledby=${this.accessibilityLabel ? v : "title"}
152
+ aria-label=${this.accessibilityLabel ? this.accessibilityLabel : v}
153
+ ${d(
154
+ (t) => this._navigationSection = t
155
155
  )}
156
156
  >
157
157
  <div class="sbb-navigation-section__wrapper">
@@ -161,7 +161,7 @@ let $ = 0, e = class extends L(f) {
161
161
  <sbb-transparent-button
162
162
  id="sbb-navigation-section-back-button"
163
163
  class="sbb-navigation-section__back"
164
- aria-label=${this.accessibilityBackLabel || C[this.m.current]}
164
+ aria-label=${this.accessibilityBackLabel || N[this._language.current]}
165
165
  negative
166
166
  size="m"
167
167
  type="button"
@@ -181,25 +181,25 @@ let $ = 0, e = class extends L(f) {
181
181
  `;
182
182
  }
183
183
  };
184
- e.styles = F;
184
+ o.styles = F;
185
185
  b([
186
186
  l({ attribute: "title-content", reflect: !0 })
187
- ], e.prototype, "titleContent", 2);
187
+ ], o.prototype, "titleContent", 2);
188
188
  b([
189
189
  l()
190
- ], e.prototype, "trigger", 1);
190
+ ], o.prototype, "trigger", 1);
191
191
  b([
192
192
  l({ attribute: "accessibility-label" })
193
- ], e.prototype, "accessibilityLabel", 2);
193
+ ], o.prototype, "accessibilityLabel", 2);
194
194
  b([
195
195
  l({ attribute: "accessibility-back-label" })
196
- ], e.prototype, "accessibilityBackLabel", 2);
197
- e = b([
198
- y("sbb-navigation-section"),
199
- A({
196
+ ], o.prototype, "accessibilityBackLabel", 2);
197
+ o = b([
198
+ w("sbb-navigation-section"),
199
+ x({
200
200
  slot: "navigation-section"
201
201
  })
202
- ], e);
202
+ ], o);
203
203
  export {
204
- e as SbbNavigationSectionElement
204
+ o as SbbNavigationSectionElement
205
205
  };