@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.
- package/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as l, customElement as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { setModalityOnNextFocus as
|
|
5
|
-
import { SbbLanguageController as k, SbbSlotStateController as
|
|
6
|
-
import { hostAttributes as
|
|
7
|
-
import { setOrRemoveAttribute as
|
|
8
|
-
import { i18nGoBack as
|
|
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";
|
|
9
9
|
import { SbbUpdateSchedulerMixin as L } from "../core/mixins.js";
|
|
10
|
-
import { removeAriaOverlayTriggerAttributes as
|
|
10
|
+
import { removeAriaOverlayTriggerAttributes as N, setAriaOverlayTriggerAttributes as O } from "../core/overlay.js";
|
|
11
11
|
import "../button/transparent-button.js";
|
|
12
12
|
import "../divider.js";
|
|
13
|
-
const F =
|
|
14
|
-
var
|
|
15
|
-
for (var
|
|
16
|
-
(r = t[
|
|
17
|
-
return
|
|
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;
|
|
18
18
|
};
|
|
19
|
-
let
|
|
19
|
+
let $ = 0, e = class extends L(f) {
|
|
20
20
|
constructor() {
|
|
21
|
-
super(), this.
|
|
22
|
-
t.composedPath().filter((
|
|
23
|
-
}, new
|
|
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);
|
|
24
24
|
}
|
|
25
25
|
set trigger(t) {
|
|
26
|
-
const i = this.
|
|
27
|
-
this.
|
|
26
|
+
const i = this.e;
|
|
27
|
+
this.e = t, this.l(this.e, i);
|
|
28
28
|
}
|
|
29
29
|
get trigger() {
|
|
30
|
-
return this.
|
|
30
|
+
return this.e;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* The state of the navigation section.
|
|
34
34
|
*/
|
|
35
|
-
set
|
|
36
|
-
this.setAttribute("data-state", t),
|
|
35
|
+
set b(t) {
|
|
36
|
+
this.setAttribute("data-state", t), E(this, "aria-hidden", this.b !== "opened" ? "true" : null);
|
|
37
37
|
}
|
|
38
|
-
get
|
|
38
|
+
get b() {
|
|
39
39
|
return this.getAttribute("data-state");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -43,115 +43,115 @@ let P = 0, o = class extends L(u) {
|
|
|
43
43
|
*/
|
|
44
44
|
open() {
|
|
45
45
|
var t;
|
|
46
|
-
this.
|
|
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"));
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
n() {
|
|
49
49
|
var t, i;
|
|
50
|
-
(i = (t = this.
|
|
50
|
+
(i = (t = this.a) == null ? void 0 : t.marker) == null || i.select(this.a);
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
o() {
|
|
53
53
|
var t, i;
|
|
54
|
-
(i = (t = this.
|
|
54
|
+
(i = (t = this.f) == 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.
|
|
61
|
+
this.b === "opened" && (this.b = "closing", this.startUpdate(), this.inert = !0, (t = this.a) == null || t.setAttribute("aria-expanded", "false"));
|
|
62
62
|
}
|
|
63
63
|
// Removes trigger click listener on trigger change.
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
t !== i && ((
|
|
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));
|
|
67
67
|
}
|
|
68
68
|
// Check if the trigger is valid and attach click event listeners.
|
|
69
|
-
|
|
69
|
+
j(t) {
|
|
70
70
|
var i;
|
|
71
|
-
|
|
72
|
-
signal: this.
|
|
73
|
-
}), this.addEventListener("keydown", (
|
|
74
|
-
signal: this.
|
|
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
|
|
75
75
|
})));
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
77
|
+
k() {
|
|
78
|
+
this.f && (this.f.shadowRoot.querySelector(
|
|
79
79
|
".sbb-navigation__content"
|
|
80
|
-
).inert = this.
|
|
80
|
+
).inert = this.g() && this.b !== "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
|
-
|
|
84
|
+
q(t) {
|
|
85
85
|
var i;
|
|
86
|
-
t.animationName === "open" && this.
|
|
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();
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
u() {
|
|
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
|
-
|
|
95
|
-
this.
|
|
96
|
-
signal: this.
|
|
97
|
-
}), window.addEventListener("click", this.
|
|
98
|
-
signal: this.
|
|
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
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
x(t) {
|
|
102
102
|
return t.nodeName === "A" || !t.hasAttribute("disabled") && (t.hasAttribute("sbb-navigation-close") || t.hasAttribute("sbb-navigation-section-close"));
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
g() {
|
|
105
105
|
return S("zero", "large");
|
|
106
106
|
}
|
|
107
107
|
// Closes the navigation on "Esc" key pressed.
|
|
108
|
-
|
|
109
|
-
this.
|
|
108
|
+
v(t) {
|
|
109
|
+
this.b === "opened" && t.key === "Escape" && this.close();
|
|
110
110
|
}
|
|
111
111
|
// Set focus on the first focusable element.
|
|
112
|
-
|
|
113
|
-
const t =
|
|
112
|
+
s() {
|
|
113
|
+
const t = _(
|
|
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 && (
|
|
116
|
+
t && (v(t), t.focus());
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
t() {
|
|
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
|
-
|
|
125
|
-
if (t.key !== "Tab" || this.
|
|
124
|
+
p(t) {
|
|
125
|
+
if (t.key !== "Tab" || this.g())
|
|
126
126
|
return;
|
|
127
127
|
const i = Array.from(
|
|
128
128
|
this.closest("sbb-navigation").shadowRoot.children
|
|
129
|
-
),
|
|
130
|
-
filter: (
|
|
131
|
-
}),
|
|
132
|
-
c && (
|
|
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());
|
|
133
133
|
}
|
|
134
134
|
connectedCallback() {
|
|
135
135
|
var t, i;
|
|
136
|
-
super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${
|
|
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");
|
|
137
137
|
}
|
|
138
138
|
disconnectedCallback() {
|
|
139
139
|
var t, i;
|
|
140
|
-
super.disconnectedCallback(), (t = this.
|
|
140
|
+
super.disconnectedCallback(), (t = this.c) == null || t.abort(), (i = this.d) == null || i.abort();
|
|
141
141
|
}
|
|
142
142
|
render() {
|
|
143
|
-
return
|
|
143
|
+
return w`
|
|
144
144
|
<div
|
|
145
145
|
class="sbb-navigation-section__container"
|
|
146
|
-
${
|
|
146
|
+
${h((t) => this.i = t)}
|
|
147
147
|
>
|
|
148
148
|
<nav
|
|
149
|
-
@animationend=${(t) => this.
|
|
149
|
+
@animationend=${(t) => this.q(t)}
|
|
150
150
|
class="sbb-navigation-section"
|
|
151
|
-
aria-labelledby=${this.accessibilityLabel ?
|
|
152
|
-
aria-label=${this.accessibilityLabel ? this.accessibilityLabel :
|
|
153
|
-
${
|
|
154
|
-
(t) => this.
|
|
151
|
+
aria-labelledby=${this.accessibilityLabel ? g : "title"}
|
|
152
|
+
aria-label=${this.accessibilityLabel ? this.accessibilityLabel : g}
|
|
153
|
+
${h(
|
|
154
|
+
(t) => this.h = t
|
|
155
155
|
)}
|
|
156
156
|
>
|
|
157
157
|
<div class="sbb-navigation-section__wrapper">
|
|
@@ -161,7 +161,7 @@ let P = 0, o = class extends L(u) {
|
|
|
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 ||
|
|
164
|
+
aria-label=${this.accessibilityBackLabel || C[this.m.current]}
|
|
165
165
|
negative
|
|
166
166
|
size="m"
|
|
167
167
|
type="button"
|
|
@@ -181,25 +181,25 @@ let P = 0, o = class extends L(u) {
|
|
|
181
181
|
`;
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
-
|
|
184
|
+
e.styles = F;
|
|
185
185
|
b([
|
|
186
186
|
l({ attribute: "title-content", reflect: !0 })
|
|
187
|
-
],
|
|
187
|
+
], e.prototype, "titleContent", 2);
|
|
188
188
|
b([
|
|
189
189
|
l()
|
|
190
|
-
],
|
|
190
|
+
], e.prototype, "trigger", 1);
|
|
191
191
|
b([
|
|
192
192
|
l({ attribute: "accessibility-label" })
|
|
193
|
-
],
|
|
193
|
+
], e.prototype, "accessibilityLabel", 2);
|
|
194
194
|
b([
|
|
195
195
|
l({ attribute: "accessibility-back-label" })
|
|
196
|
-
],
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
], e.prototype, "accessibilityBackLabel", 2);
|
|
197
|
+
e = b([
|
|
198
|
+
y("sbb-navigation-section"),
|
|
199
|
+
A({
|
|
200
200
|
slot: "navigation-section"
|
|
201
201
|
})
|
|
202
|
-
],
|
|
202
|
+
], e);
|
|
203
203
|
export {
|
|
204
|
-
|
|
204
|
+
e as SbbNavigationSectionElement
|
|
205
205
|
};
|