@sbb-esta/lyne-elements 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/autocomplete-base-element.d.ts +19 -21
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button.js +7 -7
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.d.ts +2 -2
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.d.ts.map +1 -1
- package/autocomplete.js +145 -136
- package/chip/chip/chip.d.ts +32 -0
- package/chip/chip/chip.d.ts.map +1 -0
- package/chip/chip-group/chip-group.d.ts +100 -0
- package/chip/chip-group/chip-group.d.ts.map +1 -0
- package/chip/chip-group.d.ts +2 -0
- package/chip/chip-group.d.ts.map +1 -0
- package/chip/chip-group.js +225 -0
- package/chip/chip.d.ts +2 -0
- package/chip/chip.d.ts.map +1 -0
- package/chip/chip.js +85 -0
- package/chip.d.ts +3 -0
- package/chip.d.ts.map +1 -0
- package/chip.js +2 -0
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +1 -1
- package/core/base-elements/button-base-element.d.ts +5 -0
- package/core/base-elements/button-base-element.d.ts.map +1 -1
- package/core/base-elements.js +94 -79
- package/core/controllers/id-observer-controller.d.ts +21 -0
- package/core/controllers/id-observer-controller.d.ts.map +1 -0
- package/core/controllers/media-matchers-controller.d.ts.map +1 -1
- package/core/controllers.d.ts +2 -1
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +135 -80
- package/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/core/datetime.js +8 -3
- package/core/dom/find-referenced-element.d.ts +1 -0
- package/core/dom/find-referenced-element.d.ts.map +1 -1
- package/core/dom/input-element.d.ts +3 -1
- package/core/dom/input-element.d.ts.map +1 -1
- package/core/dom/platform.d.ts +5 -0
- package/core/dom/platform.d.ts.map +1 -1
- package/core/dom.js +10 -9
- package/core/i18n/i18n.d.ts +3 -0
- package/core/i18n/i18n.d.ts.map +1 -1
- package/core/i18n.js +135 -117
- package/core/mixins/form-associated-input-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/core/mixins.js +71 -63
- package/core/overlay/overlay-trigger-attributes.d.ts +1 -1
- package/core/overlay/overlay-trigger-attributes.d.ts.map +1 -1
- package/core/overlay/position.d.ts +1 -1
- package/core/overlay/position.d.ts.map +1 -1
- package/core/styles/core.scss +89 -24
- package/core/styles/image.scss +1 -1
- package/core/styles/mixins/table.scss +63 -26
- package/core/styles/table.scss +16 -0
- package/core/testing/scroll.d.ts +1 -0
- package/core/testing/scroll.d.ts.map +1 -1
- package/core/testing/wait-for-image-ready.d.ts.map +1 -1
- package/core/testing.js +8 -5
- package/core.css +90 -34
- package/custom-elements.json +2568 -740
- package/datepicker/datepicker/datepicker.d.ts +4 -4
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +0 -3
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +30 -34
- package/datepicker/datepicker.js +103 -105
- package/development/autocomplete/autocomplete-base-element.d.ts +19 -21
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-button.js +3 -3
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.d.ts +2 -2
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-optgroup.js +1 -1
- package/development/autocomplete.js +104 -82
- package/development/chip/chip/chip.d.ts +32 -0
- package/development/chip/chip/chip.d.ts.map +1 -0
- package/development/chip/chip-group/chip-group.d.ts +100 -0
- package/development/chip/chip-group/chip-group.d.ts.map +1 -0
- package/development/chip/chip-group.d.ts +2 -0
- package/development/chip/chip-group.d.ts.map +1 -0
- package/development/chip/chip-group.js +349 -0
- package/development/chip/chip.d.ts +2 -0
- package/development/chip/chip.d.ts.map +1 -0
- package/development/chip/chip.js +212 -0
- package/development/chip.d.ts +3 -0
- package/development/chip.d.ts.map +1 -0
- package/development/chip.js +3 -0
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +5 -2
- package/development/core/base-elements/button-base-element.d.ts +5 -0
- package/development/core/base-elements/button-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +38 -10
- package/development/core/controllers/id-observer-controller.d.ts +21 -0
- package/development/core/controllers/id-observer-controller.d.ts.map +1 -0
- package/development/core/controllers/media-matchers-controller.d.ts.map +1 -1
- package/development/core/controllers.d.ts +2 -1
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +116 -44
- package/development/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/development/core/datetime.js +6 -2
- package/development/core/dom/find-referenced-element.d.ts +1 -0
- package/development/core/dom/find-referenced-element.d.ts.map +1 -1
- package/development/core/dom/input-element.d.ts +3 -1
- package/development/core/dom/input-element.d.ts.map +1 -1
- package/development/core/dom/platform.d.ts +5 -0
- package/development/core/dom/platform.d.ts.map +1 -1
- package/development/core/dom.js +3 -1
- package/development/core/i18n/i18n.d.ts +3 -0
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n.js +23 -2
- package/development/core/mixins/form-associated-input-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +19 -6
- package/development/core/overlay/overlay-trigger-attributes.d.ts +1 -1
- package/development/core/overlay/overlay-trigger-attributes.d.ts.map +1 -1
- package/development/core/overlay/position.d.ts +1 -1
- package/development/core/overlay/position.d.ts.map +1 -1
- package/development/core/overlay.js +1 -1
- package/development/core/testing/scroll.d.ts +1 -0
- package/development/core/testing/scroll.d.ts.map +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -1
- package/development/core/testing.js +6 -2
- package/development/datepicker/datepicker/datepicker.d.ts +4 -4
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +0 -3
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +4 -12
- package/development/datepicker/datepicker.js +46 -43
- package/development/dialog/dialog-title/dialog-title.d.ts +0 -1
- package/development/dialog/dialog-title/dialog-title.d.ts.map +1 -1
- package/development/dialog/dialog-title.js +2 -5
- package/development/expansion-panel/expansion-panel/expansion-panel.d.ts +0 -2
- package/development/expansion-panel/expansion-panel/expansion-panel.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel.js +2 -7
- package/development/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
- package/development/flip-card/flip-card-details.js +3 -3
- package/development/form-field/form-field/form-field.d.ts.map +1 -1
- package/development/form-field/form-field.js +13 -146
- package/development/header/header/header.d.ts +6 -7
- package/development/header/header/header.d.ts.map +1 -1
- package/development/header/header.js +45 -34
- package/development/menu/menu/menu.d.ts +7 -8
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +42 -41
- package/development/navigation/navigation/navigation.d.ts +7 -8
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation-marker/navigation-marker.d.ts.map +1 -1
- package/development/navigation/navigation-marker.js +3 -3
- package/development/navigation/navigation-section/navigation-section.d.ts +8 -9
- package/development/navigation/navigation-section/navigation-section.d.ts.map +1 -1
- package/development/navigation/navigation-section.js +50 -47
- package/development/navigation/navigation.js +42 -40
- package/development/option/optgroup/optgroup-base-element.d.ts.map +1 -1
- package/development/option/optgroup/optgroup.d.ts +2 -2
- package/development/option/optgroup/optgroup.d.ts.map +1 -1
- package/development/option/optgroup.js +3 -3
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option.js +3 -3
- package/development/paginator/paginator.js +12 -1
- package/development/popover/popover/popover.d.ts +8 -7
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +28 -35
- package/development/radio-button/radio-button-group/radio-button-group.d.ts +0 -1
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +3 -5
- package/development/select/select.d.ts +6 -3
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +20 -18
- package/development/selection-expansion-panel/selection-expansion-panel.d.ts +0 -2
- package/development/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -1
- package/development/selection-expansion-panel.js +2 -7
- package/development/sidebar/sidebar/sidebar.d.ts.map +1 -1
- package/development/sidebar/sidebar.js +3 -3
- package/development/stepper/step/step.d.ts +13 -1
- package/development/stepper/step/step.d.ts.map +1 -1
- package/development/stepper/step-label.js +2 -2
- package/development/stepper/step.js +21 -6
- package/development/stepper/stepper/stepper.d.ts +1 -0
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -1
- package/development/table/table-wrapper.js +2 -1
- package/development/time-input/time-input.d.ts +6 -8
- package/development/time-input/time-input.d.ts.map +1 -1
- package/development/time-input.js +42 -44
- package/dialog/dialog-title/dialog-title.d.ts +0 -1
- package/dialog/dialog-title/dialog-title.d.ts.map +1 -1
- package/dialog/dialog-title.js +18 -21
- package/expansion-panel/expansion-panel/expansion-panel.d.ts +0 -2
- package/expansion-panel/expansion-panel/expansion-panel.d.ts.map +1 -1
- package/expansion-panel/expansion-panel.js +53 -56
- package/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
- package/flip-card/flip-card-details.js +8 -8
- package/form-field/form-field/form-field.d.ts.map +1 -1
- package/form-field/form-field.js +103 -98
- package/header/header/header.d.ts +6 -7
- package/header/header/header.d.ts.map +1 -1
- package/header/header.js +72 -70
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/menu/menu/menu.d.ts +7 -8
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +73 -73
- package/navigation/navigation/navigation.d.ts +7 -8
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation-marker/navigation-marker.d.ts.map +1 -1
- package/navigation/navigation-marker.js +4 -4
- package/navigation/navigation-section/navigation-section.d.ts +8 -9
- package/navigation/navigation-section/navigation-section.d.ts.map +1 -1
- package/navigation/navigation-section.js +75 -77
- package/navigation/navigation.js +70 -70
- package/option/optgroup/optgroup-base-element.d.ts.map +1 -1
- package/option/optgroup/optgroup.d.ts +2 -2
- package/option/optgroup/optgroup.d.ts.map +1 -1
- package/option/optgroup.js +13 -13
- package/option/option/option-base-element.d.ts.map +1 -1
- package/option/option.js +2 -2
- package/package.json +16 -1
- package/paginator/paginator.js +44 -44
- package/popover/popover/popover.d.ts +8 -7
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +73 -73
- package/radio-button/radio-button-group/radio-button-group.d.ts +0 -1
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +8 -8
- package/select/select.d.ts +6 -3
- package/select/select.d.ts.map +1 -1
- package/select.js +73 -73
- package/selection-expansion-panel/selection-expansion-panel.d.ts +0 -2
- package/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -1
- package/selection-expansion-panel.js +10 -13
- package/sidebar/sidebar/sidebar.d.ts.map +1 -1
- package/sidebar/sidebar.js +2 -2
- package/standard-theme.css +166 -79
- package/stepper/step/step.d.ts +13 -1
- package/stepper/step/step.d.ts.map +1 -1
- package/stepper/step-label.js +1 -1
- package/stepper/step.js +34 -23
- package/stepper/stepper/stepper.d.ts +1 -0
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +19 -16
- package/table/table-wrapper.js +4 -4
- package/table.css +75 -44
- package/time-input/time-input.d.ts +6 -8
- package/time-input/time-input.d.ts.map +1 -1
- package/time-input.js +66 -73
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var
|
|
1
|
+
var U = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var m = (e,
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { ref as
|
|
10
|
-
import { setModalityOnNextFocus as P, getFirstFocusableElement as
|
|
11
|
-
import {
|
|
12
|
-
import { hostAttributes as
|
|
13
|
-
import { setOrRemoveAttribute as
|
|
14
|
-
import { i18nGoBack as
|
|
15
|
-
import { SbbUpdateSchedulerMixin as
|
|
16
|
-
import { removeAriaOverlayTriggerAttributes as
|
|
4
|
+
var Z = (e, n, s) => n.has(e) || U("Cannot " + s);
|
|
5
|
+
var m = (e, n, s) => (Z(e, n, "read from private field"), s ? s.call(e) : n.get(e)), _ = (e, n, s) => n.has(e) ? U("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, s), l = (e, n, s, r) => (Z(e, n, "write to private field"), r ? r.call(e, s) : n.set(e, s), s);
|
|
6
|
+
import { __esDecorate as p, __runInitializers as b } from "tslib";
|
|
7
|
+
import { css as H, LitElement as j, isServer as G, nothing as $, html as W } from "lit";
|
|
8
|
+
import { customElement as X, property as u } from "lit/decorators.js";
|
|
9
|
+
import { ref as q } from "lit/directives/ref.js";
|
|
10
|
+
import { setModalityOnNextFocus as P, getFirstFocusableElement as Y, getFocusableElements as M } from "../core/a11y.js";
|
|
11
|
+
import { SbbIdReferenceController as V, SbbLanguageController as J } from "../core/controllers.js";
|
|
12
|
+
import { hostAttributes as Q, slotState as tt, forceType as y, omitEmptyConverter as it } from "../core/decorators.js";
|
|
13
|
+
import { setOrRemoveAttribute as et, isZeroAnimationDuration as at, isBreakpoint as nt } from "../core/dom.js";
|
|
14
|
+
import { i18nGoBack as st } from "../core/i18n.js";
|
|
15
|
+
import { SbbUpdateSchedulerMixin as ot } from "../core/mixins.js";
|
|
16
|
+
import { removeAriaOverlayTriggerAttributes as rt, setAriaOverlayTriggerAttributes as lt } from "../core/overlay.js";
|
|
17
17
|
import "../button/transparent-button.js";
|
|
18
18
|
import "../divider.js";
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
var g, d,
|
|
22
|
-
let e = [
|
|
19
|
+
const bt = H`*,: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-duration, 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: 100dvw;--sbb-navigation-section-height: 100dvh;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))}@media (min-width: 64rem){:host{--sbb-navigation-section-column: 5 / 9;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-duration, 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)}.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)}}.sbb-navigation-section__wrapper{height:100%;padding-block:var(--sbb-navigation-section-padding-block);outline:none;overflow-y:auto}: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;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;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)}}`;
|
|
20
|
+
let ct = 0, Lt = (() => {
|
|
21
|
+
var c, g, d, h, o;
|
|
22
|
+
let e = [X("sbb-navigation-section"), Q({
|
|
23
23
|
slot: "navigation-section"
|
|
24
|
-
}),
|
|
25
|
-
return o = class extends
|
|
24
|
+
}), tt()], n, s = [], r, w = ot(j), k, E = [], x = [], C, L = [], A = [], S, N = [], z = [], B, T = [], I = [];
|
|
25
|
+
return o = class extends w {
|
|
26
26
|
constructor() {
|
|
27
27
|
var t;
|
|
28
28
|
super();
|
|
29
|
+
_(this, c);
|
|
29
30
|
_(this, g);
|
|
30
31
|
_(this, d);
|
|
31
|
-
_(this,
|
|
32
|
-
|
|
33
|
-
i.composedPath().filter((
|
|
32
|
+
_(this, h);
|
|
33
|
+
l(this, c, b(this, E, "")), l(this, g, (b(this, x), b(this, L, null))), l(this, d, (b(this, A), b(this, N, ""))), l(this, h, (b(this, z), b(this, T, ""))), this._firstLevelNavigation = (b(this, I), null), this._triggerElement = null, this._triggerIdReferenceController = new V(this, "trigger"), this._language = new J(this), this._handleNavigationSectionClose = (i) => {
|
|
34
|
+
i.composedPath().filter((v) => v instanceof window.HTMLElement).some((v) => this._isCloseElement(v)) && this.close();
|
|
34
35
|
}, (t = this.addEventListener) == null || t.call(this, "keydown", (i) => this._handleNavigationSectionFocus(i));
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* The label to be shown before the action list.
|
|
38
39
|
*/
|
|
39
40
|
get titleContent() {
|
|
40
|
-
return m(this,
|
|
41
|
+
return m(this, c);
|
|
41
42
|
}
|
|
42
43
|
set titleContent(t) {
|
|
43
|
-
|
|
44
|
+
l(this, c, t);
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
47
|
* The element that will trigger the navigation section.
|
|
47
|
-
* Accepts both a string (id of an element) or an
|
|
48
|
+
* Accepts both a string (id of an element) or an SbbNavigationButtonElement.
|
|
48
49
|
*/
|
|
49
|
-
set trigger(t) {
|
|
50
|
-
const i = this._trigger;
|
|
51
|
-
this._trigger = t, this._removeTriggerClickListener(this._trigger, i);
|
|
52
|
-
}
|
|
53
50
|
get trigger() {
|
|
54
|
-
return this
|
|
51
|
+
return m(this, g);
|
|
52
|
+
}
|
|
53
|
+
set trigger(t) {
|
|
54
|
+
l(this, g, t);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* This will be forwarded as aria-label to the nav element and is read as a title of the navigation-section.
|
|
@@ -60,22 +60,22 @@ let rt = 0, Et = (() => {
|
|
|
60
60
|
return m(this, d);
|
|
61
61
|
}
|
|
62
62
|
set accessibilityLabel(t) {
|
|
63
|
-
|
|
63
|
+
l(this, d, t);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* This will be forwarded as aria-label to the back button element.
|
|
67
67
|
*/
|
|
68
68
|
get accessibilityBackLabel() {
|
|
69
|
-
return m(this,
|
|
69
|
+
return m(this, h);
|
|
70
70
|
}
|
|
71
71
|
set accessibilityBackLabel(t) {
|
|
72
|
-
|
|
72
|
+
l(this, h, t);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* The state of the navigation section.
|
|
76
76
|
*/
|
|
77
77
|
set _state(t) {
|
|
78
|
-
this.setAttribute("data-state", t),
|
|
78
|
+
this.setAttribute("data-state", t), et(this, "aria-hidden", this._state !== "opened" ? "true" : null);
|
|
79
79
|
}
|
|
80
80
|
get _state() {
|
|
81
81
|
return this.getAttribute("data-state");
|
|
@@ -84,11 +84,11 @@ let rt = 0, Et = (() => {
|
|
|
84
84
|
* Opens the navigation section on trigger click.
|
|
85
85
|
*/
|
|
86
86
|
open() {
|
|
87
|
-
var t;
|
|
88
|
-
this._state !== "closed" || !this._navigationSection || (this.
|
|
87
|
+
var t, i, a;
|
|
88
|
+
this._state !== "closed" || !this._navigationSection || (this._isNavigationButton(this._triggerElement) && ((i = (t = this._triggerElement) == null ? void 0 : t.marker) == null || i.select(this._triggerElement)), this._closePreviousNavigationSection(), this._state = "opening", this.startUpdate(), this.inert = !0, (a = this._triggerElement) == null || a.setAttribute("aria-expanded", "true"), this._isZeroAnimationDuration() && this._handleOpening());
|
|
89
89
|
}
|
|
90
90
|
_isZeroAnimationDuration() {
|
|
91
|
-
return
|
|
91
|
+
return at(this, "--sbb-navigation-section-animation-duration");
|
|
92
92
|
}
|
|
93
93
|
_handleOpening() {
|
|
94
94
|
this._state = "opened", this.inert = !1, this._attachWindowEvents(), this._setNavigationInert(), this._setNavigationSectionFocus(), this._checkActiveAction(), this.completeUpdate();
|
|
@@ -97,10 +97,6 @@ let rt = 0, Et = (() => {
|
|
|
97
97
|
var t;
|
|
98
98
|
this._state = "closed", this._navigationSectionContainerElement.scrollTo(0, 0), (t = this._windowEventsController) == null || t.abort(), this._resetLists(), this._setNavigationInert(), this._isZeroToLargeBreakpoint() && this._triggerElement && (P(this._triggerElement), this._triggerElement.focus()), this.completeUpdate();
|
|
99
99
|
}
|
|
100
|
-
_setActiveNavigationAction() {
|
|
101
|
-
var t, i;
|
|
102
|
-
(i = (t = this._triggerElement) == null ? void 0 : t.marker) == null || i.select(this._triggerElement);
|
|
103
|
-
}
|
|
104
100
|
_closePreviousNavigationSection() {
|
|
105
101
|
var t, i;
|
|
106
102
|
(i = (t = this._firstLevelNavigation) == null ? void 0 : t.activeNavigationSection) == null || i.close();
|
|
@@ -112,18 +108,17 @@ let rt = 0, Et = (() => {
|
|
|
112
108
|
var t;
|
|
113
109
|
this._state === "opened" && (this._state = "closing", this.startUpdate(), this.inert = !0, (t = this._triggerElement) == null || t.setAttribute("aria-expanded", "false"), this._isZeroAnimationDuration() && this._handleClosing());
|
|
114
110
|
}
|
|
115
|
-
// Removes trigger click listener on trigger change.
|
|
116
|
-
_removeTriggerClickListener(t, i) {
|
|
117
|
-
var n, l;
|
|
118
|
-
t !== i && ((n = this._navigationSectionController) == null || n.abort(), (l = this._windowEventsController) == null || l.abort(), this._configure(this.trigger));
|
|
119
|
-
}
|
|
120
111
|
// Check if the trigger is valid and attach click event listeners.
|
|
121
|
-
|
|
112
|
+
_configureTrigger() {
|
|
122
113
|
var i;
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
const t = this.trigger instanceof HTMLElement ? this.trigger : this._triggerIdReferenceController.find();
|
|
115
|
+
t !== this._triggerElement && ((i = this._triggerAbortController) == null || i.abort(), rt(this._triggerElement), this._triggerElement = t, this._triggerElement && (lt(this._triggerElement, "menu", this.id, this._state), this._triggerAbortController = new AbortController(), this._isNavigationButton(this._triggerElement) && (this._triggerElement.connectedSection = this), this._triggerElement.addEventListener("click", () => this.open(), {
|
|
116
|
+
signal: this._triggerAbortController.signal
|
|
125
117
|
})));
|
|
126
118
|
}
|
|
119
|
+
_isNavigationButton(t) {
|
|
120
|
+
return (t == null ? void 0 : t.localName) === "sbb-navigation-button";
|
|
121
|
+
}
|
|
127
122
|
_setNavigationInert() {
|
|
128
123
|
this._firstLevelNavigation && (this._firstLevelNavigation.shadowRoot.querySelector(".sbb-navigation__content").inert = this._isZeroToLargeBreakpoint() && this._state !== "closed");
|
|
129
124
|
}
|
|
@@ -147,7 +142,7 @@ let rt = 0, Et = (() => {
|
|
|
147
142
|
return t.nodeName === "A" || !t.hasAttribute("disabled") && (t.hasAttribute("sbb-navigation-close") || t.hasAttribute("sbb-navigation-section-close"));
|
|
148
143
|
}
|
|
149
144
|
_isZeroToLargeBreakpoint() {
|
|
150
|
-
return
|
|
145
|
+
return nt("zero", "large") ?? !1;
|
|
151
146
|
}
|
|
152
147
|
// Closes the navigation on "Esc" key pressed.
|
|
153
148
|
_onKeydownEvent(t) {
|
|
@@ -155,7 +150,7 @@ let rt = 0, Et = (() => {
|
|
|
155
150
|
}
|
|
156
151
|
// Set focus on the first focusable element.
|
|
157
152
|
_setNavigationSectionFocus() {
|
|
158
|
-
const t =
|
|
153
|
+
const t = Y([this.shadowRoot.querySelector("#sbb-navigation-section-back-button")].concat(Array.from(this.children)).filter((i) => i instanceof window.HTMLElement));
|
|
159
154
|
t && (P(t), t.focus());
|
|
160
155
|
}
|
|
161
156
|
_checkActiveAction() {
|
|
@@ -165,31 +160,34 @@ let rt = 0, Et = (() => {
|
|
|
165
160
|
_handleNavigationSectionFocus(t) {
|
|
166
161
|
if (t.key !== "Tab" || this._isZeroToLargeBreakpoint())
|
|
167
162
|
return;
|
|
168
|
-
const i = Array.from(this.closest("sbb-navigation").shadowRoot.children),
|
|
169
|
-
filter: (
|
|
170
|
-
}),
|
|
171
|
-
|
|
163
|
+
const i = Array.from(this.closest("sbb-navigation").shadowRoot.children), a = M(i, {
|
|
164
|
+
filter: (K) => K.nodeName !== "SBB-NAVIGATION-SECTION"
|
|
165
|
+
}), v = Array.from(this.shadowRoot.children), f = M(v), F = f[0], O = f[f.length - 1], R = t.shiftKey ? this._triggerElement : a[a.indexOf(this._triggerElement) + 1], D = t.shiftKey ? F : O;
|
|
166
|
+
R && (F.getRootNode().activeElement === D || O.getRootNode().activeElement === D) && (R.focus(), t.preventDefault());
|
|
172
167
|
}
|
|
173
168
|
connectedCallback() {
|
|
174
169
|
var t, i;
|
|
175
|
-
super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${
|
|
170
|
+
super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${ct++}`), this._state || (this._state = "closed"), this._configureTrigger(), this._firstLevelNavigation = (i = (t = this._triggerElement) == null ? void 0 : t.closest) == null ? void 0 : i.call(t, "sbb-navigation");
|
|
176
171
|
}
|
|
177
172
|
disconnectedCallback() {
|
|
178
173
|
var t, i;
|
|
179
|
-
super.disconnectedCallback(), (t = this.
|
|
174
|
+
super.disconnectedCallback(), this._triggerElement = null, (t = this._triggerAbortController) == null || t.abort(), (i = this._windowEventsController) == null || i.abort();
|
|
175
|
+
}
|
|
176
|
+
requestUpdate(t, i, a) {
|
|
177
|
+
super.requestUpdate(t, i, a), !G && (!t || t === "trigger") && this.hasUpdated && this._configureTrigger();
|
|
180
178
|
}
|
|
181
179
|
render() {
|
|
182
|
-
return
|
|
180
|
+
return W`
|
|
183
181
|
<div
|
|
184
182
|
class="sbb-navigation-section__container"
|
|
185
|
-
${
|
|
183
|
+
${q((t) => this._navigationSectionContainerElement = t)}
|
|
186
184
|
>
|
|
187
185
|
<nav
|
|
188
186
|
@animationend=${this._onAnimationEnd}
|
|
189
187
|
class="sbb-navigation-section"
|
|
190
|
-
aria-labelledby=${this.accessibilityLabel ?
|
|
191
|
-
aria-label=${this.accessibilityLabel ? this.accessibilityLabel :
|
|
192
|
-
${
|
|
188
|
+
aria-labelledby=${this.accessibilityLabel ? $ : "title"}
|
|
189
|
+
aria-label=${this.accessibilityLabel ? this.accessibilityLabel : $}
|
|
190
|
+
${q((t) => this._navigationSection = t)}
|
|
193
191
|
>
|
|
194
192
|
<div class="sbb-navigation-section__wrapper">
|
|
195
193
|
<div class="sbb-navigation-section__content">
|
|
@@ -198,7 +196,7 @@ let rt = 0, Et = (() => {
|
|
|
198
196
|
<sbb-transparent-button
|
|
199
197
|
id="sbb-navigation-section-back-button"
|
|
200
198
|
class="sbb-navigation-section__back"
|
|
201
|
-
aria-label=${this.accessibilityBackLabel ||
|
|
199
|
+
aria-label=${this.accessibilityBackLabel || st[this._language.current]}
|
|
202
200
|
negative
|
|
203
201
|
size="m"
|
|
204
202
|
type="button"
|
|
@@ -217,19 +215,19 @@ let rt = 0, Et = (() => {
|
|
|
217
215
|
</div>
|
|
218
216
|
`;
|
|
219
217
|
}
|
|
220
|
-
}, g = new WeakMap(), d = new WeakMap(),
|
|
221
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
222
|
-
k = [
|
|
223
|
-
i.titleContent =
|
|
224
|
-
} }, metadata: t }, E, x),
|
|
225
|
-
i.trigger =
|
|
226
|
-
} }, metadata: t },
|
|
227
|
-
i.accessibilityLabel =
|
|
228
|
-
} }, metadata: t },
|
|
229
|
-
i.accessibilityBackLabel =
|
|
230
|
-
} }, metadata: t },
|
|
231
|
-
})(), o.styles =
|
|
218
|
+
}, c = new WeakMap(), g = new WeakMap(), d = new WeakMap(), h = new WeakMap(), r = o, (() => {
|
|
219
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(w[Symbol.metadata] ?? null) : void 0;
|
|
220
|
+
k = [y(), u({ attribute: "title-content", reflect: !0, converter: it })], C = [u()], S = [y(), u({ attribute: "accessibility-label" })], B = [y(), u({ attribute: "accessibility-back-label" })], p(o, null, k, { kind: "accessor", name: "titleContent", static: !1, private: !1, access: { has: (i) => "titleContent" in i, get: (i) => i.titleContent, set: (i, a) => {
|
|
221
|
+
i.titleContent = a;
|
|
222
|
+
} }, metadata: t }, E, x), p(o, null, C, { kind: "accessor", name: "trigger", static: !1, private: !1, access: { has: (i) => "trigger" in i, get: (i) => i.trigger, set: (i, a) => {
|
|
223
|
+
i.trigger = a;
|
|
224
|
+
} }, metadata: t }, L, A), p(o, null, S, { kind: "accessor", name: "accessibilityLabel", static: !1, private: !1, access: { has: (i) => "accessibilityLabel" in i, get: (i) => i.accessibilityLabel, set: (i, a) => {
|
|
225
|
+
i.accessibilityLabel = a;
|
|
226
|
+
} }, metadata: t }, N, z), p(o, null, B, { kind: "accessor", name: "accessibilityBackLabel", static: !1, private: !1, access: { has: (i) => "accessibilityBackLabel" in i, get: (i) => i.accessibilityBackLabel, set: (i, a) => {
|
|
227
|
+
i.accessibilityBackLabel = a;
|
|
228
|
+
} }, metadata: t }, T, I), p(null, n = { value: r }, e, { kind: "class", name: r.name, metadata: t }, null, s), r = n.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
229
|
+
})(), o.styles = bt, b(r, s), r;
|
|
232
230
|
})();
|
|
233
231
|
export {
|
|
234
|
-
|
|
232
|
+
Lt as SbbNavigationSectionElement
|
|
235
233
|
};
|
package/navigation/navigation.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
var
|
|
1
|
+
var z = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var h = (n, e, s) => (
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import { MutationController as
|
|
8
|
-
import { ResizeController as
|
|
9
|
-
import { css as
|
|
10
|
-
import { customElement as
|
|
11
|
-
import { ref as
|
|
12
|
-
import { SbbFocusHandler as
|
|
13
|
-
import { SbbOpenCloseBaseElement as
|
|
14
|
-
import { SbbLanguageController as
|
|
15
|
-
import { hostAttributes as
|
|
16
|
-
import { SbbScrollHandler as
|
|
17
|
-
import { i18nCloseNavigation as
|
|
18
|
-
import { SbbUpdateSchedulerMixin as
|
|
19
|
-
import { isEventOnElement as
|
|
4
|
+
var T = (n, e, s) => e.has(n) || z("Cannot " + s);
|
|
5
|
+
var h = (n, e, s) => (T(n, e, "read from private field"), s ? s.call(n) : e.get(n)), m = (n, e, s) => e.has(n) ? z("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, s), l = (n, e, s, r) => (T(n, e, "write to private field"), r ? r.call(n, s) : e.set(n, s), s);
|
|
6
|
+
import { __esDecorate as p, __runInitializers as c } from "tslib";
|
|
7
|
+
import { MutationController as R } from "@lit-labs/observers/mutation-controller.js";
|
|
8
|
+
import { ResizeController as B } from "@lit-labs/observers/resize-controller.js";
|
|
9
|
+
import { css as q, isServer as F, html as L } from "lit";
|
|
10
|
+
import { customElement as P, property as I, state as U } from "lit/decorators.js";
|
|
11
|
+
import { ref as D } from "lit/directives/ref.js";
|
|
12
|
+
import { SbbFocusHandler as M, setModalityOnNextFocus as H } from "../core/a11y.js";
|
|
13
|
+
import { SbbOpenCloseBaseElement as $ } from "../core/base-elements.js";
|
|
14
|
+
import { SbbIdReferenceController as X, SbbLanguageController as Z, SbbInertController as j, SbbEscapableOverlayController as G } from "../core/controllers.js";
|
|
15
|
+
import { hostAttributes as V, forceType as J } from "../core/decorators.js";
|
|
16
|
+
import { SbbScrollHandler as K, isZeroAnimationDuration as Q } from "../core/dom.js";
|
|
17
|
+
import { i18nCloseNavigation as W } from "../core/i18n.js";
|
|
18
|
+
import { SbbUpdateSchedulerMixin as Y } from "../core/mixins.js";
|
|
19
|
+
import { isEventOnElement as u, removeAriaOverlayTriggerAttributes as tt, setAriaOverlayTriggerAttributes as it } from "../core/overlay.js";
|
|
20
20
|
import "../button/transparent-button.js";
|
|
21
|
-
const
|
|
21
|
+
const at = q`*,:before,:after{box-sizing:border-box}:host{--sbb-navigation-grid-column: 1 / 5;--sbb-navigation-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-3x) );--sbb-navigation-animation-easing: ease-in;--sbb-navigation-padding-inline: var(--sbb-layout-base-offset-responsive);--sbb-navigation-padding-block-start: var(--sbb-spacing-responsive-l);--sbb-navigation-padding-block-end: var(--sbb-spacing-responsive-xl);--sbb-navigation-backdrop-visibility: hidden;--sbb-navigation-backdrop-pointer-events: none;--sbb-navigation-backdrop-color: transparent;--sbb-navigation-list-margin-block-start: var(--sbb-spacing-responsive-xxl);--sbb-navigation-inline-start: 0;--sbb-navigation-expanded-width: 100%;--sbb-navigation-inset: 0 auto auto 0;--sbb-navigation-transform: translateX(-100%);--sbb-navigation-content-transform: translateX(0);--sbb-navigation-width: 100%;--sbb-navigation-height: 100dvh;--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);display:none;position:fixed;inset:var(--sbb-navigation-inset);z-index:var(--sbb-navigation-z-index, var(--sbb-overlay-default-z-index));overflow:hidden}@media (min-width: 52.5rem){:host{--sbb-navigation-grid-column: 1 / 9}}@media (min-width: 64rem){:host{--sbb-navigation-grid-column: 1 / 5;--sbb-navigation-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-6x) );--sbb-navigation-padding-block-start: var(--sbb-spacing-responsive-xl);--sbb-navigation-padding-inline: var(--sbb-layout-base-offset-responsive) 0;--sbb-navigation-list-margin-block-start: var(--sbb-spacing-fixed-1x);--sbb-navigation-inline-start: calc(var(--sbb-layout-base-offset-responsive) * -1);--sbb-navigation-width: calc(100% + var(--sbb-layout-base-offset-responsive))}}@media (min-width: 90rem){:host{--sbb-navigation-grid-column: 1 / 6;--sbb-navigation-padding-block-start: var(--sbb-spacing-responsive-xxl)}}:host([data-state]:not([data-state=closed])){display:block}:host([data-state=opened]){--sbb-navigation-animation-easing: ease-out}:host(:is([data-state=opened],[data-state=opening])){--sbb-navigation-backdrop-visibility: visible;--sbb-navigation-backdrop-pointer-events: all;--sbb-navigation-backdrop-color: var(--sbb-color-black-alpha-70)}:host(:not([data-state=closed])){--sbb-navigation-inset: 0;--sbb-navigation-transform: translateX(0)}:host([data-has-navigation-section]){--sbb-navigation-content-transform: translateX(-100%)}@media (min-width: 64rem){:host([data-has-navigation-section]){--sbb-navigation-expanded-width: 100dvw;--sbb-navigation-content-transform: translateX(0%)}}:host([data-resize-disable-animation]){--sbb-disable-animation-duration: 0s}.sbb-navigation__container{display:grid;gap:var(--sbb-grid-base-gutter-responsive);grid-template-columns:repeat(var(--sbb-grid-base-columns),1fr);padding-inline:0;pointer-events:none;transform:var(--sbb-navigation-transform)}@media (min-width: 64rem){.sbb-navigation__container{padding-inline:var(--sbb-layout-base-offset-responsive)}.sbb-navigation__container:before{transition-duration:var(--sbb-navigation-animation-duration);transition-timing-function:var(--sbb-navigation-animation-easing);transition-property:background-color,visibility;content:"";visibility:var(--sbb-navigation-backdrop-visibility);pointer-events:var(--sbb-navigation-backdrop-pointer-events);position:fixed;inset:var(--sbb-navigation-inset);background-color:var(--sbb-navigation-backdrop-color)}}.sbb-navigation{transition-duration:var(--sbb-navigation-animation-duration);transition-timing-function:var(--sbb-navigation-animation-easing);transition-property:width;display:none;width:var(--sbb-navigation-width);grid-column:var(--sbb-navigation-grid-column);padding:0;margin:0;position:relative;inset-inline-start:var(--sbb-navigation-inline-start);inset-block-start:0;border:none;pointer-events:none;height:var(--sbb-navigation-height);color:var(--sbb-color-white);background-color:var(--sbb-color-midnight)}.sbb-navigation:before{transition-duration:var(--sbb-navigation-animation-duration);transition-timing-function:var(--sbb-navigation-animation-easing);transition-property:width;content:"";position:absolute;width:var(--sbb-navigation-expanded-width);height:var(--sbb-navigation-height);background:var(--sbb-color-midnight)}:host([data-state]:not([data-state=closed])) .sbb-navigation{display:block;pointer-events:all;animation-name:open;animation-duration:var(--sbb-navigation-animation-duration);animation-timing-function:var(--sbb-navigation-animation-easing)}:host([data-state][data-state=closing]) .sbb-navigation{pointer-events:none;animation-name:close}@media (forced-colors: active){.sbb-navigation{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-navigation__wrapper{outline:none}.sbb-navigation__header{transition-duration:var(--sbb-navigation-animation-duration);transition-timing-function:var(--sbb-navigation-animation-easing);transition-property:width;display:flex;justify-content:flex-end;position:absolute;width:var(--sbb-navigation-expanded-width);pointer-events:none;padding:var(--sbb-spacing-responsive-xs);z-index:calc(var(--sbb-navigation-z-index, var(--sbb-overlay-default-z-index)) + 1)}.sbb-navigation__close{pointer-events:all}.sbb-navigation__content{transition-duration:var(--sbb-navigation-animation-duration);transition-timing-function:var(--sbb-navigation-animation-easing);transition-property:transform;--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)}.sbb-navigation__content::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation__content::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation__content::-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__content::-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__content::-webkit-scrollbar-button,.sbb-navigation__content::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-navigation__content{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-navigation__content{display:flex;flex-direction:column;gap:var(--sbb-spacing-responsive-xxl);position:relative;height:var(--sbb-navigation-height);padding-inline:var(--sbb-navigation-padding-inline);padding-block:var(--sbb-navigation-padding-block-start) var(--sbb-navigation-padding-block-end);overflow-y:auto;transform:var(--sbb-navigation-content-transform)}::slotted(:first-child){margin-block-start:var(--sbb-navigation-list-margin-block-start)}@keyframes open{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes close{0%{transform:translate(0)}to{transform:translate(-100%)}}`, nt = {
|
|
22
22
|
subtree: !0,
|
|
23
23
|
attributeFilter: ["data-state"]
|
|
24
24
|
};
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
var
|
|
29
|
-
let n = [
|
|
25
|
+
let et = 0;
|
|
26
|
+
const ot = 150;
|
|
27
|
+
let Ct = (() => {
|
|
28
|
+
var g, v, d, b;
|
|
29
|
+
let n = [P("sbb-navigation"), V({
|
|
30
30
|
role: "navigation",
|
|
31
31
|
popover: "manual"
|
|
32
|
-
})], e, s = [], r,
|
|
33
|
-
return b = class extends
|
|
32
|
+
})], e, s = [], r, _ = Y($), f, k = [], w = [], y, C = [], x = [], S, E = [], N = [];
|
|
33
|
+
return b = class extends _ {
|
|
34
34
|
constructor() {
|
|
35
35
|
var t, i, a;
|
|
36
36
|
super();
|
|
37
|
-
m(this,
|
|
38
|
-
m(this,
|
|
39
|
-
|
|
37
|
+
m(this, g);
|
|
38
|
+
m(this, v);
|
|
39
|
+
m(this, d);
|
|
40
|
+
l(this, g, c(this, k, null)), l(this, v, (c(this, w), c(this, C, ""))), l(this, d, (c(this, x), c(this, E, null))), this._navigation = c(this, N), this._triggerElement = null, this._triggerIdReferenceController = new X(this, "trigger"), this._language = new Z(this), this._inertController = new j(this), this._escapableOverlayController = new G(this), this._focusHandler = new M(), this._scrollHandler = new K(), this._isPointerDownEventOnNavigation = !1, this._resizeObserverTimeout = null, this._navigationResizeObserver = new B(this, {
|
|
40
41
|
skipInitial: !0,
|
|
41
42
|
callback: () => this._onNavigationResize()
|
|
42
43
|
}), this._trapFocusFilter = (o) => o.nodeName !== "SBB-NAVIGATION-SECTION" || o.getAttribute("data-state") === "opened", this._pointerDownListener = (o) => {
|
|
43
|
-
var
|
|
44
|
-
this._isPointerDownEventOnNavigation =
|
|
44
|
+
var A, O;
|
|
45
|
+
this._isPointerDownEventOnNavigation = u(this._navigation, o) || u((O = (A = this.querySelector('sbb-navigation-section[data-state="opened"]')) == null ? void 0 : A.shadowRoot) == null ? void 0 : O.querySelector("nav.sbb-navigation-section"), o);
|
|
45
46
|
}, this._closeOnBackdropClick = (o) => {
|
|
46
|
-
!this._isPointerDownEventOnNavigation && !
|
|
47
|
-
}, (t = this.addEventListener) == null || t.call(this, "click", (o) => this._handleNavigationClose(o)), (i = this.addEventListener) == null || i.call(this, "pointerup", (o) => this._closeOnBackdropClick(o)), (a = this.addEventListener) == null || a.call(this, "pointerdown", (o) => this._pointerDownListener(o)), new
|
|
47
|
+
!this._isPointerDownEventOnNavigation && !u(this._navigation, o) && this.close();
|
|
48
|
+
}, (t = this.addEventListener) == null || t.call(this, "click", (o) => this._handleNavigationClose(o)), (i = this.addEventListener) == null || i.call(this, "pointerup", (o) => this._closeOnBackdropClick(o)), (a = this.addEventListener) == null || a.call(this, "pointerdown", (o) => this._pointerDownListener(o)), this.addController(new R(this, {
|
|
48
49
|
skipInitial: !0,
|
|
49
|
-
config:
|
|
50
|
+
config: nt,
|
|
50
51
|
callback: (o) => this._onNavigationSectionChange(o)
|
|
51
|
-
});
|
|
52
|
+
}));
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
55
|
* The element that will trigger the navigation.
|
|
55
56
|
* Accepts both a string (id of an element) or an HTML element.
|
|
56
57
|
*/
|
|
57
|
-
set trigger(t) {
|
|
58
|
-
const i = this._trigger;
|
|
59
|
-
this._trigger = t, this._removeTriggerClickListener(this._trigger, i);
|
|
60
|
-
}
|
|
61
58
|
get trigger() {
|
|
62
|
-
return this
|
|
59
|
+
return h(this, g);
|
|
60
|
+
}
|
|
61
|
+
set trigger(t) {
|
|
62
|
+
l(this, g, t);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* This will be forwarded as aria-label to the close button element.
|
|
66
66
|
*/
|
|
67
67
|
get accessibilityCloseLabel() {
|
|
68
|
-
return h(this,
|
|
68
|
+
return h(this, v);
|
|
69
69
|
}
|
|
70
70
|
set accessibilityCloseLabel(t) {
|
|
71
|
-
|
|
71
|
+
l(this, v, t);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Whether a navigation section is displayed.
|
|
75
75
|
*/
|
|
76
76
|
get _activeNavigationSection() {
|
|
77
|
-
return h(this,
|
|
77
|
+
return h(this, d);
|
|
78
78
|
}
|
|
79
79
|
set _activeNavigationSection(t) {
|
|
80
|
-
|
|
80
|
+
l(this, d, t);
|
|
81
81
|
}
|
|
82
82
|
get activeNavigationSection() {
|
|
83
83
|
return this._activeNavigationSection;
|
|
@@ -109,25 +109,22 @@ let kt = (() => {
|
|
|
109
109
|
this.state === "opened" && this.willClose.emit() && (this.state = "closing", this.startUpdate(), (t = this._triggerElement) == null || t.setAttribute("aria-expanded", "false"), this._isZeroAnimationDuration() && this._handleClosing());
|
|
110
110
|
}
|
|
111
111
|
_isZeroAnimationDuration() {
|
|
112
|
-
return
|
|
112
|
+
return Q(this, "--sbb-navigation-animation-duration");
|
|
113
113
|
}
|
|
114
114
|
_handleClosing() {
|
|
115
115
|
var t, i;
|
|
116
|
-
this.state = "closed", (t = this.hidePopover) == null || t.call(this), this._navigationContentElement.scrollTo(0, 0),
|
|
116
|
+
this.state = "closed", (t = this.hidePopover) == null || t.call(this), this._navigationContentElement.scrollTo(0, 0), H(this._triggerElement), this._inertController.deactivate(), (i = this._triggerElement) == null || i.focus(), this._escapableOverlayController.disconnect(), this.didClose.emit(), this._navigationResizeObserver.unobserve(this), this._resetMarkers(), this._focusHandler.disconnect(), this._scrollHandler.enableScroll(), this.completeUpdate();
|
|
117
117
|
}
|
|
118
118
|
_handleOpening() {
|
|
119
|
-
this.state = "opened", this._navigationResizeObserver.observe(this), this._inertController.activate(), this.
|
|
119
|
+
this.state = "opened", this._navigationResizeObserver.observe(this), this._inertController.activate(), this._escapableOverlayController.connect(), this._focusHandler.trap(this, { filter: this._trapFocusFilter }), this._setNavigationFocus(), this.completeUpdate(), this.didOpen.emit();
|
|
120
120
|
}
|
|
121
121
|
// Removes trigger click listener on trigger change.
|
|
122
|
-
_removeTriggerClickListener(t, i) {
|
|
123
|
-
var a;
|
|
124
|
-
t !== i && ((a = this._navigationController) == null || a.abort(), this._configure(this.trigger));
|
|
125
|
-
}
|
|
126
122
|
// Check if the trigger is valid and attach click event listeners.
|
|
127
|
-
|
|
123
|
+
_configureTrigger() {
|
|
128
124
|
var i;
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
const t = this.trigger instanceof HTMLElement ? this.trigger : this._triggerIdReferenceController.find();
|
|
126
|
+
t !== this._triggerElement && ((i = this._triggerAbortController) == null || i.abort(), tt(this._triggerElement), this._triggerElement = t, this._triggerElement && (it(this._triggerElement, "menu", this.id, this.state), this._triggerAbortController = new AbortController(), this._triggerElement.addEventListener("click", () => this.open(), {
|
|
127
|
+
signal: this._triggerAbortController.signal
|
|
131
128
|
})));
|
|
132
129
|
}
|
|
133
130
|
// In rare cases it can be that the animationEnd event is triggered twice.
|
|
@@ -151,7 +148,7 @@ let kt = (() => {
|
|
|
151
148
|
// Set focus on the first focusable element.
|
|
152
149
|
_setNavigationFocus() {
|
|
153
150
|
const t = this.shadowRoot.querySelector("#sbb-navigation-close-button");
|
|
154
|
-
|
|
151
|
+
H(t), t.focus();
|
|
155
152
|
}
|
|
156
153
|
// Observe changes on navigation section data-state.
|
|
157
154
|
_onNavigationSectionChange(t) {
|
|
@@ -159,21 +156,24 @@ let kt = (() => {
|
|
|
159
156
|
i.target.nodeName === "SBB-NAVIGATION-SECTION" && (this._activeNavigationSection = this.querySelector('sbb-navigation-section[data-state="opening"], sbb-navigation-section[data-state="opened"]'), this.toggleAttribute("data-has-navigation-section", !!this._activeNavigationSection));
|
|
160
157
|
}
|
|
161
158
|
_onNavigationResize() {
|
|
162
|
-
this.state === "opened" && (this._resizeObserverTimeout && clearTimeout(this._resizeObserverTimeout), this.toggleAttribute("data-resize-disable-animation", !0), this._resizeObserverTimeout = setTimeout(() => this.removeAttribute("data-resize-disable-animation"),
|
|
159
|
+
this.state === "opened" && (this._resizeObserverTimeout && clearTimeout(this._resizeObserverTimeout), this.toggleAttribute("data-resize-disable-animation", !0), this._resizeObserverTimeout = setTimeout(() => this.removeAttribute("data-resize-disable-animation"), ot));
|
|
163
160
|
}
|
|
164
161
|
connectedCallback() {
|
|
165
|
-
super.connectedCallback(), this.id || (this.id = `sbb-navigation-${
|
|
162
|
+
super.connectedCallback(), this.id || (this.id = `sbb-navigation-${et++}`), this._configureTrigger(), this.isOpen && this._inertController.activate();
|
|
166
163
|
}
|
|
167
164
|
disconnectedCallback() {
|
|
168
165
|
var t;
|
|
169
|
-
super.disconnectedCallback(), (t = this.
|
|
166
|
+
super.disconnectedCallback(), this._triggerElement = null, (t = this._triggerAbortController) == null || t.abort(), this._focusHandler.disconnect(), this._scrollHandler.enableScroll();
|
|
167
|
+
}
|
|
168
|
+
requestUpdate(t, i, a) {
|
|
169
|
+
super.requestUpdate(t, i, a), !F && (!t || t === "trigger") && this.hasUpdated && this._configureTrigger();
|
|
170
170
|
}
|
|
171
171
|
render() {
|
|
172
|
-
const t =
|
|
172
|
+
const t = L`
|
|
173
173
|
<sbb-transparent-button
|
|
174
174
|
id="sbb-navigation-close-button"
|
|
175
175
|
class="sbb-navigation__close"
|
|
176
|
-
aria-label=${this.accessibilityCloseLabel ||
|
|
176
|
+
aria-label=${this.accessibilityCloseLabel || W[this._language.current]}
|
|
177
177
|
aria-controls="sbb-navigation-overlay"
|
|
178
178
|
negative
|
|
179
179
|
size="m"
|
|
@@ -182,19 +182,19 @@ let kt = (() => {
|
|
|
182
182
|
sbb-navigation-close
|
|
183
183
|
></sbb-transparent-button>
|
|
184
184
|
`;
|
|
185
|
-
return
|
|
185
|
+
return L`
|
|
186
186
|
<div class="sbb-navigation__container">
|
|
187
187
|
<div
|
|
188
188
|
id="sbb-navigation-overlay"
|
|
189
189
|
@animationend=${this._onAnimationEnd}
|
|
190
190
|
class="sbb-navigation"
|
|
191
|
-
${
|
|
191
|
+
${D((i) => this._navigation = i)}
|
|
192
192
|
>
|
|
193
193
|
<div class="sbb-navigation__header">${t}</div>
|
|
194
194
|
<div class="sbb-navigation__wrapper">
|
|
195
195
|
<div
|
|
196
196
|
class="sbb-navigation__content"
|
|
197
|
-
${
|
|
197
|
+
${D((i) => this._navigationContentElement = i)}
|
|
198
198
|
>
|
|
199
199
|
<slot></slot>
|
|
200
200
|
</div>
|
|
@@ -204,17 +204,17 @@ let kt = (() => {
|
|
|
204
204
|
</div>
|
|
205
205
|
`;
|
|
206
206
|
}
|
|
207
|
-
},
|
|
208
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
209
|
-
f = [
|
|
207
|
+
}, g = new WeakMap(), v = new WeakMap(), d = new WeakMap(), r = b, (() => {
|
|
208
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(_[Symbol.metadata] ?? null) : void 0;
|
|
209
|
+
f = [I()], y = [J(), I({ attribute: "accessibility-close-label" })], S = [U()], p(b, null, f, { kind: "accessor", name: "trigger", static: !1, private: !1, access: { has: (i) => "trigger" in i, get: (i) => i.trigger, set: (i, a) => {
|
|
210
210
|
i.trigger = a;
|
|
211
|
-
} }, metadata: t },
|
|
211
|
+
} }, metadata: t }, k, w), p(b, null, y, { kind: "accessor", name: "accessibilityCloseLabel", static: !1, private: !1, access: { has: (i) => "accessibilityCloseLabel" in i, get: (i) => i.accessibilityCloseLabel, set: (i, a) => {
|
|
212
212
|
i.accessibilityCloseLabel = a;
|
|
213
|
-
} }, metadata: t },
|
|
213
|
+
} }, metadata: t }, C, x), p(b, null, S, { kind: "accessor", name: "_activeNavigationSection", static: !1, private: !1, access: { has: (i) => "_activeNavigationSection" in i, get: (i) => i._activeNavigationSection, set: (i, a) => {
|
|
214
214
|
i._activeNavigationSection = a;
|
|
215
|
-
} }, metadata: t },
|
|
216
|
-
})(), b.styles =
|
|
215
|
+
} }, metadata: t }, E, N), p(null, e = { value: r }, n, { kind: "class", name: r.name, metadata: t }, null, s), r = e.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
216
|
+
})(), b.styles = at, c(r, s), r;
|
|
217
217
|
})();
|
|
218
218
|
export {
|
|
219
|
-
|
|
219
|
+
Ct as SbbNavigationElement
|
|
220
220
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optgroup-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/option/optgroup/optgroup-base-element.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAIxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,kBAAkB,CAAC;;AAS1B,8BAEe,sBAAuB,SAAQ,2BAA+C;IAC3F,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,0BAA0B;IAC1B,SAEgB,KAAK,EAAE,MAAM,CAAM;IAE1B,SAAS,CAAC,QAAQ,CAAC,QAAQ,UAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAEnD,SAAS,CAAC,QAAQ,KAAK,OAAO,IAAI,oBAAoB,EAAE,CAAC;;
|
|
1
|
+
{"version":3,"file":"optgroup-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/option/optgroup/optgroup-base-element.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAIxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,kBAAkB,CAAC;;AAS1B,8BAEe,sBAAuB,SAAQ,2BAA+C;IAC3F,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,0BAA0B;IAC1B,SAEgB,KAAK,EAAE,MAAM,CAAM;IAE1B,SAAS,CAAC,QAAQ,CAAC,QAAQ,UAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAEnD,SAAS,CAAC,QAAQ,KAAK,OAAO,IAAI,oBAAoB,EAAE,CAAC;;IAwBzC,iBAAiB,IAAI,IAAI;cAMtB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAmB5E,SAAS,CAAC,QAAQ,CAAC,sBAAsB,IAAI,IAAI;IACjD,SAAS,CAAC,QAAQ,CAAC,qBAAqB,IAAI,0BAA0B,GAAG,IAAI;IAE7E,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,yBAAyB;IAkBjC,SAAS,CAAC,sBAAsB,IAAI,IAAI;IAMxC,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,iBAAiB;cAIN,MAAM,IAAI,cAAc;CAY5C"}
|