@sbb-esta/lyne-elements 2.0.3 → 2.2.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/accordion/accordion.d.ts.map +1 -1
- package/accordion.js +6 -6
- package/action-group.js +3 -3
- package/alert/alert.js +8 -8
- package/autocomplete/autocomplete-base-element.d.ts +4 -0
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button.js +4 -4
- package/autocomplete-grid/autocomplete-grid-cell.js +3 -3
- package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -4
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-option.js +10 -10
- package/autocomplete-grid/autocomplete-grid-row.js +5 -5
- package/autocomplete.js +99 -90
- package/breadcrumb/breadcrumb-group.js +5 -5
- package/button/accent-button-link.js +9 -9
- package/button/accent-button-static.js +6 -6
- package/button/accent-button.js +6 -6
- package/button/button-link.js +7 -7
- package/button/button-static.js +7 -7
- package/button/button.js +8 -8
- package/button/common.js +15 -15
- package/button/mini-button-group.js +8 -8
- package/button/secondary-button-link.js +7 -7
- package/button/secondary-button-static.js +7 -7
- package/button/secondary-button.js +3 -3
- package/button/transparent-button-link.js +6 -6
- package/button/transparent-button-static.js +5 -5
- package/button/transparent-button.js +6 -6
- package/card/card-badge.js +11 -11
- package/card/card-button.js +5 -5
- package/card/card-link.js +7 -7
- package/card/card.js +3 -3
- package/checkbox/checkbox-panel.js +16 -16
- package/checkbox/checkbox.js +15 -15
- package/checkbox/common.js +3 -3
- package/chip-label.js +3 -3
- package/clock.js +10 -10
- package/container/container/container.d.ts +1 -1
- package/container/container/container.d.ts.map +1 -1
- package/container/container.js +23 -23
- package/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/container/sticky-bar.js +4 -4
- package/core/a11y/focus.d.ts.map +1 -1
- package/core/a11y.js +8 -8
- package/core/base-elements/link-base-element.d.ts +2 -0
- package/core/base-elements/link-base-element.d.ts.map +1 -1
- package/core/base-elements.js +125 -114
- package/core/controllers.js +4 -4
- package/core/datetime/date-adapter.d.ts +1 -1
- package/core/datetime/date-adapter.d.ts.map +1 -1
- package/core/datetime/native-date-adapter.d.ts +1 -1
- package/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/core/datetime.js +6 -6
- package/core/dom/scroll.d.ts +1 -0
- package/core/dom/scroll.d.ts.map +1 -1
- package/core/dom.js +35 -35
- package/core/eventing.js +4 -4
- package/core/images.d.ts.map +1 -1
- package/core/mixins.js +18 -18
- package/core/styles/core.scss +23 -2
- package/core/testing.js +14 -14
- package/core.css +20 -2
- package/custom-elements.json +828 -431
- package/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/datepicker/common/datepicker-button.d.ts +17 -9
- package/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/datepicker/common.d.ts +1 -0
- package/datepicker/common.d.ts.map +1 -1
- package/datepicker/common.js +130 -92
- package/datepicker/datepicker/datepicker.d.ts +19 -4
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +106 -113
- package/datepicker/datepicker.js +95 -80
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +1 -1
- package/development/action-group.js +1 -1
- package/development/autocomplete/autocomplete-base-element.d.ts +4 -0
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-cell.js +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option.js +3 -3
- package/development/autocomplete-grid/autocomplete-grid-row.js +1 -1
- package/development/autocomplete.js +37 -8
- package/development/breadcrumb/breadcrumb-group.js +3 -3
- package/development/button/common.js +69 -70
- package/development/calendar.js +1 -1
- package/development/card/card-badge.js +1 -1
- package/development/card/card.js +1 -1
- package/development/chip-label.js +1 -1
- package/development/clock.js +1 -1
- package/development/container/container/container.d.ts +1 -1
- package/development/container/container/container.d.ts.map +1 -1
- package/development/container/container.js +18 -2
- package/development/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/development/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/development/container/sticky-bar.js +9 -1
- package/development/core/a11y/focus.d.ts.map +1 -1
- package/development/core/a11y.js +3 -3
- package/development/core/base-elements/link-base-element.d.ts +2 -0
- package/development/core/base-elements/link-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +22 -5
- package/development/core/controllers.js +1 -1
- package/development/core/datetime/date-adapter.d.ts +1 -1
- package/development/core/datetime/date-adapter.d.ts.map +1 -1
- package/development/core/datetime/native-date-adapter.d.ts +1 -1
- package/development/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/development/core/datetime.js +1 -1
- package/development/core/dom/scroll.d.ts +1 -0
- package/development/core/dom/scroll.d.ts.map +1 -1
- package/development/core/dom.js +4 -1
- package/development/core/images.d.ts.map +1 -1
- package/development/core/mixins.js +1 -1
- package/development/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/development/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/development/datepicker/common/datepicker-button.d.ts +17 -9
- package/development/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/development/datepicker/common.d.ts +1 -0
- package/development/datepicker/common.d.ts.map +1 -1
- package/development/datepicker/common.js +139 -90
- package/development/datepicker/datepicker/datepicker.d.ts +19 -4
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +76 -73
- package/development/datepicker/datepicker.js +55 -37
- package/development/dialog/dialog/dialog.d.ts +2 -0
- package/development/dialog/dialog/dialog.d.ts.map +1 -1
- package/development/dialog/dialog-content.js +1 -1
- package/development/dialog/dialog.js +38 -12
- package/development/expansion-panel/expansion-panel-content.js +1 -1
- package/development/flip-card/flip-card-details.js +1 -1
- package/development/flip-card/flip-card-summary.js +1 -1
- package/development/icon.js +1 -1
- package/development/image.js +2 -2
- package/development/lead-container.js +1 -1
- package/development/link-list/link-list-anchor.js +1 -1
- package/development/link-list/link-list.js +1 -1
- package/development/loading-indicator-circle.js +1 -1
- package/development/loading-indicator.js +1 -1
- package/development/map-container.js +1 -1
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +35 -12
- package/development/message.js +1 -1
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation.js +15 -8
- package/development/notification.js +1 -1
- package/development/option/optgroup.js +1 -1
- package/development/option/option/option-base-element.d.ts +3 -2
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option.js +16 -9
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay/overlay.d.ts.map +1 -1
- package/development/overlay.js +29 -13
- package/development/paginator/paginator.js +1 -1
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +16 -13
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +2 -2
- package/development/{sbb-tokens-BdGhUJjM.js → sbb-tokens-CSAKTXUi.js} +15 -15
- package/development/screen-reader-only.js +1 -1
- package/development/select/select.d.ts +11 -0
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +60 -9
- package/development/signet.js +1 -1
- package/development/stepper/step.js +1 -1
- package/development/tabs/tab.js +1 -1
- package/development/time-input.js +1 -1
- package/development/title/title-base.d.ts.map +1 -1
- package/development/title.js +4 -5
- package/development/toast/toast.d.ts.map +1 -1
- package/development/toast.js +14 -8
- package/development/toggle/toggle.js +2 -2
- package/development/train/train-blocked-passage.js +1 -1
- package/development/train/train-wagon.js +1 -1
- package/dialog/dialog/dialog.d.ts +2 -0
- package/dialog/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog-content.js +4 -4
- package/dialog/dialog-title.js +8 -8
- package/dialog/dialog.js +59 -49
- package/divider.js +12 -12
- package/expansion-panel/expansion-panel-content.js +3 -3
- package/file-selector/file-selector-dropzone.js +5 -5
- package/file-selector/file-selector.js +6 -6
- package/flip-card/flip-card-details.js +7 -7
- package/flip-card/flip-card-summary.js +12 -12
- package/header/header-button.js +5 -5
- package/header/header-link.js +5 -5
- package/icon.js +37 -37
- package/image.js +16 -16
- package/lead-container.js +3 -3
- package/link/block-link-button.js +4 -4
- package/link/block-link-static.js +9 -9
- package/link/block-link.js +4 -4
- package/link/common.js +16 -16
- package/link/link-button.js +7 -7
- package/link/link-static.js +7 -7
- package/link/link.js +4 -4
- package/link-list/common.js +12 -12
- package/link-list/link-list-anchor.js +3 -3
- package/link-list/link-list.js +3 -3
- package/loading-indicator-circle.js +14 -14
- package/loading-indicator.js +3 -3
- package/map-container.js +6 -6
- package/menu/common.js +7 -7
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu-button.js +8 -8
- package/menu/menu-link.js +6 -6
- package/menu/menu.js +64 -42
- package/message.js +3 -3
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation-button.js +4 -4
- package/navigation/navigation-link.js +7 -7
- package/navigation/navigation-list.js +4 -4
- package/navigation/navigation-marker.js +3 -3
- package/navigation/navigation.js +21 -20
- package/notification.js +19 -19
- package/option/optgroup.js +14 -14
- package/option/option/option-base-element.d.ts +3 -2
- package/option/option/option-base-element.d.ts.map +1 -1
- package/option/option.js +115 -103
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay/overlay.d.ts.map +1 -1
- package/overlay.js +87 -84
- package/package.json +1 -1
- package/paginator/common.js +6 -6
- package/paginator/paginator.js +1 -1
- 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.map +1 -1
- package/radio-button/radio-button-group.js +1 -1
- package/radio-button/radio-button-panel.js +5 -5
- package/{sbb-tokens-Dx20OtVg.js → sbb-tokens-BgDF8jIh.js} +14 -14
- package/screen-reader-only.js +8 -8
- package/select/select.d.ts +11 -0
- package/select/select.d.ts.map +1 -1
- package/select.js +111 -83
- package/signet.js +1 -1
- package/slider.js +8 -8
- package/standard-theme.css +20 -2
- package/status.js +3 -3
- package/stepper/step-label.js +4 -4
- package/stepper/step.js +3 -3
- package/table/table-wrapper.js +4 -4
- package/tabs/tab-group.js +24 -24
- package/tabs/tab.js +4 -4
- package/tag/tag-group.js +7 -7
- package/teaser-product/common.js +5 -5
- package/teaser-product/teaser-product-static.js +2 -2
- package/time-input.js +3 -3
- package/timetable-occupancy-icon.js +3 -3
- package/timetable-occupancy.js +6 -6
- package/title/title-base.d.ts.map +1 -1
- package/title.js +41 -42
- package/toast/toast.d.ts.map +1 -1
- package/toast.js +58 -54
- package/toggle/toggle-option.js +11 -11
- package/toggle/toggle.js +3 -3
- package/toggle-check.js +5 -5
- package/train/train-blocked-passage.js +3 -3
- package/train/train.js +28 -28
package/core/dom.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { isServer as
|
|
1
|
+
import { isServer as o } from "lit";
|
|
2
2
|
function w(n, t) {
|
|
3
|
-
if (
|
|
3
|
+
if (o)
|
|
4
4
|
return !0;
|
|
5
|
-
const
|
|
6
|
-
return parseFloat(
|
|
5
|
+
const e = getComputedStyle(n).getPropertyValue(t);
|
|
6
|
+
return parseFloat(e) === 0;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
8
|
+
const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
|
|
9
|
+
function p(n, t, e) {
|
|
10
|
+
if (o)
|
|
11
11
|
return null;
|
|
12
|
-
const i = getComputedStyle(document.documentElement), s = n ? i.getPropertyValue(`--sbb-breakpoint-${n}-min`) : "", r = t ? `${parseFloat(i.getPropertyValue(`--sbb-breakpoint-${t}-${
|
|
13
|
-
return window.matchMedia(`${b}${
|
|
12
|
+
const i = getComputedStyle(document.documentElement), s = n ? i.getPropertyValue(`--sbb-breakpoint-${n}-min`) : "", r = t ? `${parseFloat(i.getPropertyValue(`--sbb-breakpoint-${t}-${e != null && e.includeMaxBreakpoint ? "max" : "min"}`)) - (e != null && e.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", b = s && `(min-width: ${s})`, m = r && `(max-width: ${r})`, y = s && r && " and ";
|
|
13
|
+
return window.matchMedia(`${b}${y}${m}`).matches;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function h(n) {
|
|
16
|
+
return o ? null : typeof n == "string" ? document.getElementById(n) : n instanceof window.Element ? n : null;
|
|
17
17
|
}
|
|
18
18
|
function A(n, t) {
|
|
19
|
-
if (
|
|
19
|
+
if (o)
|
|
20
20
|
return null;
|
|
21
21
|
for (t = t.parentElement ?? t.getRootNode().host; t && t !== document && t !== window; ) {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
22
|
+
const e = t.closest(n);
|
|
23
|
+
if (e)
|
|
24
|
+
return e;
|
|
25
25
|
t = t.getRootNode().host;
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
const S = "a,button,sbb-teaser-hero,sbb-teaser";
|
|
30
30
|
function E(n, t) {
|
|
31
|
-
var
|
|
31
|
+
var e;
|
|
32
32
|
if (!t) {
|
|
33
|
-
const i = (
|
|
33
|
+
const i = (e = n.closest) == null ? void 0 : e.call(n, "sbb-form-field");
|
|
34
34
|
return i == null ? void 0 : i.querySelector("input");
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return h(t);
|
|
37
37
|
}
|
|
38
38
|
function x() {
|
|
39
|
-
return !
|
|
39
|
+
return !o && document.documentElement.classList.contains("sbb-lean");
|
|
40
40
|
}
|
|
41
|
-
function I(n, t,
|
|
42
|
-
|
|
41
|
+
function I(n, t, e) {
|
|
42
|
+
e ? n.setAttribute(t, e) : n.removeAttribute(t);
|
|
43
43
|
}
|
|
44
44
|
let d;
|
|
45
45
|
try {
|
|
@@ -47,41 +47,41 @@ try {
|
|
|
47
47
|
} catch {
|
|
48
48
|
d = !1;
|
|
49
49
|
}
|
|
50
|
-
const u = !
|
|
50
|
+
const u = !o && /(edge)/i.test(navigator.userAgent), a = !o && /(msie|trident)/i.test(navigator.userAgent), c = !o && !!(window.chrome || d) && typeof CSS < "u" && !u && !a, f = !o && /AppleWebKit/i.test(navigator.userAgent) && !c && !u && !a, k = !o && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), $ = !o && /(firefox|minefield)/i.test(navigator.userAgent), _ = !o && /android/i.test(navigator.userAgent) && !a, P = !o && /safari/i.test(navigator.userAgent) && f, B = c, M = () => !!globalThis.next;
|
|
51
51
|
function l() {
|
|
52
52
|
return document.body.hasAttribute("data-sbb-scroll-disabled");
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class W {
|
|
55
55
|
disableScroll() {
|
|
56
56
|
if (l())
|
|
57
57
|
return;
|
|
58
|
-
this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
|
|
58
|
+
this._height = document.body.style.height, this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
|
|
59
59
|
const t = window.innerWidth - document.documentElement.clientWidth;
|
|
60
|
-
document.body.style.overflow = "hidden", document.body.style.position = "relative", document.body.style.marginInlineEnd = `${t}px`, document.body.style.setProperty("--sbb-scrollbar-width", `${t}px`), document.body.toggleAttribute("data-sbb-scroll-disabled", !0);
|
|
60
|
+
document.body.style.overflow = "hidden", document.body.style.height = "100dvh", document.body.style.position = "relative", document.body.style.marginInlineEnd = `${t}px`, document.body.style.setProperty("--sbb-scrollbar-width", `${t}px`), document.body.toggleAttribute("data-sbb-scroll-disabled", !0);
|
|
61
61
|
}
|
|
62
62
|
enableScroll() {
|
|
63
|
-
l() && (document.body.style.position = this._position || "", document.body.style.overflow = this._overflow || "", document.body.style.marginInlineEnd = this._marginInlineEnd || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
|
|
63
|
+
l() && (document.body.style.height = this._height || "", document.body.style.position = this._position || "", document.body.style.overflow = this._overflow || "", document.body.style.marginInlineEnd = this._marginInlineEnd || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
export {
|
|
67
67
|
S as ACTION_ELEMENTS,
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
W as SbbScrollHandler,
|
|
69
|
+
v as breakpoints,
|
|
70
70
|
E as findInput,
|
|
71
|
-
|
|
71
|
+
h as findReferencedElement,
|
|
72
72
|
A as hostContext,
|
|
73
|
-
|
|
73
|
+
_ as isAndroid,
|
|
74
74
|
c as isBlink,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
p as isBreakpoint,
|
|
76
|
+
B as isChromium,
|
|
77
77
|
u as isEdge,
|
|
78
78
|
$ as isFirefox,
|
|
79
79
|
k as isIOS,
|
|
80
80
|
x as isLean,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
M as isNextjs,
|
|
82
|
+
P as isSafari,
|
|
83
83
|
a as isTrident,
|
|
84
|
-
|
|
84
|
+
f as isWebkit,
|
|
85
85
|
w as isZeroAnimationDuration,
|
|
86
86
|
l as pageScrollDisabled,
|
|
87
87
|
I as setOrRemoveAttribute
|
package/core/eventing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(t, n, e = null) {
|
|
2
2
|
const o = t.composedPath();
|
|
3
3
|
let s = o.findIndex((r) => r === e);
|
|
4
4
|
return s === -1 && (s = void 0), o.slice(0, s).find((r) => r instanceof window.HTMLElement && r.hasAttribute(n));
|
|
@@ -8,7 +8,7 @@ const i = {
|
|
|
8
8
|
cancelable: !0,
|
|
9
9
|
composed: !0
|
|
10
10
|
};
|
|
11
|
-
class
|
|
11
|
+
class a {
|
|
12
12
|
constructor(n, e, o = i) {
|
|
13
13
|
this._element = n, this._eventName = e, this._options = o;
|
|
14
14
|
}
|
|
@@ -46,8 +46,8 @@ const m = (t, n) => {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
a as EventEmitter,
|
|
50
|
+
u as composedPathHasAttribute,
|
|
51
51
|
c as forwardEvent,
|
|
52
52
|
f as forwardEventToHost,
|
|
53
53
|
d as getEventTarget,
|
package/core/images.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/elements/core/images.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/elements/core/images.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,EAAE,MAAM,EAWzB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/core/mixins.js
CHANGED
|
@@ -2,7 +2,7 @@ var D = (l) => {
|
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
4
|
var M = (l, p, o) => p.has(l) || D("Cannot " + o);
|
|
5
|
-
var k = (l, p, o) => (M(l, p, "read from private field"), o ? o.call(l) : p.get(l)), x = (l, p, o) => p.has(l) ? D("Cannot add the same private member more than once") : p instanceof WeakSet ? p.add(l) : p.set(l, o),
|
|
5
|
+
var k = (l, p, o) => (M(l, p, "read from private field"), o ? o.call(l) : p.get(l)), x = (l, p, o) => p.has(l) ? D("Cannot add the same private member more than once") : p instanceof WeakSet ? p.add(l) : p.set(l, o), v = (l, p, o, r) => (M(l, p, "write to private field"), r ? r.call(l, o) : p.set(l, o), o);
|
|
6
6
|
import { __esDecorate as y, __runInitializers as f } from "tslib";
|
|
7
7
|
import { property as S, state as F } from "lit/decorators.js";
|
|
8
8
|
import { forceType as w, getOverride as N, hostAttributes as j } from "./decorators.js";
|
|
@@ -25,7 +25,7 @@ const I = (l) => (() => {
|
|
|
25
25
|
return k(this, u);
|
|
26
26
|
}
|
|
27
27
|
set disabled(t) {
|
|
28
|
-
|
|
28
|
+
v(this, u, t);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Will be used as 'or' check to the current disabled state.
|
|
@@ -54,7 +54,7 @@ const I = (l) => (() => {
|
|
|
54
54
|
return k(this, u);
|
|
55
55
|
}
|
|
56
56
|
set disabledInteractive(t) {
|
|
57
|
-
|
|
57
|
+
v(this, u, t);
|
|
58
58
|
}
|
|
59
59
|
}, u = new WeakMap(), (() => {
|
|
60
60
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
@@ -76,7 +76,7 @@ const I = (l) => (() => {
|
|
|
76
76
|
constructor() {
|
|
77
77
|
super(...arguments);
|
|
78
78
|
x(this, d);
|
|
79
|
-
this._value = (f(this, r), null), this.internals = this.attachInternals(),
|
|
79
|
+
this._value = (f(this, r), null), this.internals = this.attachInternals(), v(this, d, f(this, e, !1)), f(this, n);
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Returns the form owner of the internals of the target element.
|
|
@@ -138,7 +138,7 @@ const I = (l) => (() => {
|
|
|
138
138
|
return k(this, d);
|
|
139
139
|
}
|
|
140
140
|
set formDisabled(c) {
|
|
141
|
-
|
|
141
|
+
v(this, d, c);
|
|
142
142
|
}
|
|
143
143
|
attributeChangedCallback(c, b, m) {
|
|
144
144
|
(c !== "name" || b !== m) && super.attributeChangedCallback(c, b, m);
|
|
@@ -457,7 +457,7 @@ const I = (l) => (() => {
|
|
|
457
457
|
constructor() {
|
|
458
458
|
super(...arguments);
|
|
459
459
|
x(this, u);
|
|
460
|
-
|
|
460
|
+
v(this, u, f(this, h, [])), this._handleSlotchange = (f(this, a), () => {
|
|
461
461
|
const t = Array.from(this.children ?? []).filter((s) => this.listChildLocalNames.includes(s.localName));
|
|
462
462
|
t.length === this.listChildren.length && this.listChildren.every((s, i) => t[i] === s) || (this.listChildren.filter((s) => !t.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = t, this.listChildren.forEach((s, i) => s.setAttribute("slot", `${q}-${i}`)), this.removeAttribute(z));
|
|
463
463
|
});
|
|
@@ -471,7 +471,7 @@ const I = (l) => (() => {
|
|
|
471
471
|
return k(this, u);
|
|
472
472
|
}
|
|
473
473
|
set listChildren(t) {
|
|
474
|
-
|
|
474
|
+
v(this, u, t);
|
|
475
475
|
}
|
|
476
476
|
connectedCallback() {
|
|
477
477
|
var t;
|
|
@@ -557,7 +557,7 @@ const I = (l) => (() => {
|
|
|
557
557
|
return k(this, u);
|
|
558
558
|
}
|
|
559
559
|
set negative(t) {
|
|
560
|
-
|
|
560
|
+
v(this, u, t);
|
|
561
561
|
}
|
|
562
562
|
}, u = new WeakMap(), (() => {
|
|
563
563
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
@@ -574,40 +574,40 @@ const I = (l) => (() => {
|
|
|
574
574
|
x(this, i);
|
|
575
575
|
x(this, c);
|
|
576
576
|
x(this, b);
|
|
577
|
-
|
|
577
|
+
v(this, i, f(this, h, "white")), v(this, c, (f(this, a), f(this, e, !1))), v(this, b, (f(this, n), f(this, t, ""))), this._panelConnected = (f(this, s), new P(this, m.events.panelConnected, { bubbles: !0 }));
|
|
578
578
|
}
|
|
579
579
|
/** The background color of the panel. */
|
|
580
580
|
get color() {
|
|
581
581
|
return k(this, i);
|
|
582
582
|
}
|
|
583
583
|
set color(g) {
|
|
584
|
-
|
|
584
|
+
v(this, i, g);
|
|
585
585
|
}
|
|
586
586
|
/** Whether the unselected panel has a border. */
|
|
587
587
|
get borderless() {
|
|
588
588
|
return k(this, c);
|
|
589
589
|
}
|
|
590
590
|
set borderless(g) {
|
|
591
|
-
|
|
591
|
+
v(this, c, g);
|
|
592
592
|
}
|
|
593
593
|
/** @internal used for accessibility label when in expansion panel */
|
|
594
594
|
get expansionState() {
|
|
595
595
|
return k(this, b);
|
|
596
596
|
}
|
|
597
597
|
set expansionState(g) {
|
|
598
|
-
|
|
598
|
+
v(this, b, g);
|
|
599
599
|
}
|
|
600
600
|
connectedCallback() {
|
|
601
601
|
super.connectedCallback(), this._panelConnected.emit();
|
|
602
602
|
}
|
|
603
603
|
}, i = new WeakMap(), c = new WeakMap(), b = new WeakMap(), (() => {
|
|
604
604
|
const g = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
605
|
-
r = [S()], u = [w(), S({ reflect: !0, type: Boolean })], d = [w(), S()], y(m, null, r, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (
|
|
606
|
-
|
|
607
|
-
} }, metadata: g }, h, a), y(m, null, u, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (
|
|
608
|
-
|
|
609
|
-
} }, metadata: g }, e, n), y(m, null, d, { kind: "accessor", name: "expansionState", static: !1, private: !1, access: { has: (
|
|
610
|
-
|
|
605
|
+
r = [S()], u = [w(), S({ reflect: !0, type: Boolean })], d = [w(), S()], y(m, null, r, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (_) => "color" in _, get: (_) => _.color, set: (_, C) => {
|
|
606
|
+
_.color = C;
|
|
607
|
+
} }, metadata: g }, h, a), y(m, null, u, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (_) => "borderless" in _, get: (_) => _.borderless, set: (_, C) => {
|
|
608
|
+
_.borderless = C;
|
|
609
|
+
} }, metadata: g }, e, n), y(m, null, d, { kind: "accessor", name: "expansionState", static: !1, private: !1, access: { has: (_) => "expansionState" in _, get: (_) => _.expansionState, set: (_, C) => {
|
|
610
|
+
_.expansionState = C;
|
|
611
611
|
} }, metadata: g }, t, s), g && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: g });
|
|
612
612
|
})(), m.events = {
|
|
613
613
|
panelConnected: "panelConnected"
|
package/core/styles/core.scss
CHANGED
|
@@ -103,14 +103,35 @@ sbb-form-field {
|
|
|
103
103
|
sbb-navigation,
|
|
104
104
|
sbb-navigation-section,
|
|
105
105
|
sbb-overlay,
|
|
106
|
+
sbb-popover,
|
|
106
107
|
sbb-select,
|
|
107
108
|
sbb-skiplink-list,
|
|
108
|
-
sbb-toast
|
|
109
|
-
sbb-popover
|
|
109
|
+
sbb-toast
|
|
110
110
|
):not(:defined) {
|
|
111
111
|
display: none;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// Hide popover artifacts
|
|
115
|
+
[popover]:where(
|
|
116
|
+
sbb-autocomplete,
|
|
117
|
+
sbb-autocomplete-grid,
|
|
118
|
+
sbb-dialog,
|
|
119
|
+
sbb-menu,
|
|
120
|
+
sbb-navigation,
|
|
121
|
+
sbb-overlay,
|
|
122
|
+
sbb-popover,
|
|
123
|
+
sbb-toast
|
|
124
|
+
) {
|
|
125
|
+
margin: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
border: none;
|
|
128
|
+
width: auto;
|
|
129
|
+
height: auto;
|
|
130
|
+
background-color: transparent;
|
|
131
|
+
color: inherit;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
114
135
|
// Ensure stable breadcrumb height during hydrating
|
|
115
136
|
sbb-breadcrumb-group:not(:defined) {
|
|
116
137
|
display: block;
|
package/core/testing.js
CHANGED
|
@@ -27,14 +27,14 @@ class p {
|
|
|
27
27
|
return this._promiseEventMap.get(e).promise;
|
|
28
28
|
{
|
|
29
29
|
let r, s;
|
|
30
|
-
const
|
|
30
|
+
const o = {
|
|
31
31
|
promise: new Promise((a, l) => {
|
|
32
32
|
r = a, s = l;
|
|
33
33
|
}),
|
|
34
34
|
resolve: r,
|
|
35
35
|
reject: s
|
|
36
36
|
};
|
|
37
|
-
return this._promiseEventMap.set(e,
|
|
37
|
+
return this._promiseEventMap.set(e, o), this._wrapPromiseWithTimeout(o, e, i);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
_wrapPromiseWithTimeout(e, i, r) {
|
|
@@ -62,11 +62,11 @@ function w(t) {
|
|
|
62
62
|
async function f(t, e = 30, i = 2 * 1e3) {
|
|
63
63
|
const r = /* @__PURE__ */ new Date();
|
|
64
64
|
let s = 0;
|
|
65
|
-
function
|
|
65
|
+
function n() {
|
|
66
66
|
return s++, t();
|
|
67
67
|
}
|
|
68
|
-
for (; !await
|
|
69
|
-
await new Promise((
|
|
68
|
+
for (; !await n() && r.getTime() + i >= (/* @__PURE__ */ new Date()).getTime(); )
|
|
69
|
+
await new Promise((o) => setTimeout(o, e));
|
|
70
70
|
return r.getTime() + i < (/* @__PURE__ */ new Date()).getTime() ? Promise.reject(`waitForCondition timeout: ${t.toString()}, attempts: ${s}, start: ${r.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`) : Promise.resolve(!0);
|
|
71
71
|
}
|
|
72
72
|
async function _(t, e = 2 * 1e3) {
|
|
@@ -74,25 +74,25 @@ async function _(t, e = 2 * 1e3) {
|
|
|
74
74
|
const i = t.localName === "sbb-image" ? ((r = t.shadowRoot) == null ? void 0 : r.querySelector(".sbb-image__img")) ?? null : t;
|
|
75
75
|
if (!i)
|
|
76
76
|
throw new Error("img tag not found");
|
|
77
|
-
t.complete ? await i.decode() : await new Promise((s,
|
|
78
|
-
const
|
|
77
|
+
t.complete ? await i.decode() : await new Promise((s, n) => {
|
|
78
|
+
const o = setTimeout(() => n("image loading timeout"), e);
|
|
79
79
|
t.addEventListener("load", () => {
|
|
80
|
-
clearTimeout(
|
|
80
|
+
clearTimeout(o), i.decode().then(() => {
|
|
81
81
|
m && t.localName === "sbb-image" ? setTimeout(s, 100) : s();
|
|
82
82
|
});
|
|
83
83
|
}), t.addEventListener("error", () => {
|
|
84
|
-
clearTimeout(
|
|
84
|
+
clearTimeout(o), n("image error");
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
const c = (t) => !!t.updateComplete, u = Promise.resolve(), h = async (t) => {
|
|
89
89
|
var r, s;
|
|
90
90
|
const e = await t;
|
|
91
|
-
(s = (r = e.parentElement ?? e).querySelectorAll) == null || s.call(r, "[defer-hydration]").forEach((
|
|
92
|
-
const i = [e, ...e.querySelectorAll("*")].filter(c).map((
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
h(
|
|
91
|
+
(s = (r = e.parentElement ?? e).querySelectorAll) == null || s.call(r, "[defer-hydration]").forEach((n) => n.removeAttribute("defer-hydration"));
|
|
92
|
+
const i = [e, ...e.querySelectorAll("*")].filter(c).map((n) => [
|
|
93
|
+
n.updateComplete,
|
|
94
|
+
n.hydrationComplete ?? u,
|
|
95
|
+
h(n.renderRoot)
|
|
96
96
|
]).flat(1 / 0);
|
|
97
97
|
return await Promise.all(i), e;
|
|
98
98
|
};
|
package/core.css
CHANGED
|
@@ -1253,13 +1253,31 @@ sbb-menu,
|
|
|
1253
1253
|
sbb-navigation,
|
|
1254
1254
|
sbb-navigation-section,
|
|
1255
1255
|
sbb-overlay,
|
|
1256
|
+
sbb-popover,
|
|
1256
1257
|
sbb-select,
|
|
1257
1258
|
sbb-skiplink-list,
|
|
1258
|
-
sbb-toast
|
|
1259
|
-
sbb-popover):not(:defined) {
|
|
1259
|
+
sbb-toast):not(:defined) {
|
|
1260
1260
|
display: none;
|
|
1261
1261
|
}
|
|
1262
1262
|
|
|
1263
|
+
[popover]:where(sbb-autocomplete,
|
|
1264
|
+
sbb-autocomplete-grid,
|
|
1265
|
+
sbb-dialog,
|
|
1266
|
+
sbb-menu,
|
|
1267
|
+
sbb-navigation,
|
|
1268
|
+
sbb-overlay,
|
|
1269
|
+
sbb-popover,
|
|
1270
|
+
sbb-toast) {
|
|
1271
|
+
margin: 0;
|
|
1272
|
+
padding: 0;
|
|
1273
|
+
border: none;
|
|
1274
|
+
width: auto;
|
|
1275
|
+
height: auto;
|
|
1276
|
+
background-color: transparent;
|
|
1277
|
+
color: inherit;
|
|
1278
|
+
pointer-events: none;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1263
1281
|
sbb-breadcrumb-group:not(:defined) {
|
|
1264
1282
|
display: block;
|
|
1265
1283
|
height: calc(var(--sbb-typo-line-height-body-text) * var(--sbb-font-size-text-xs));
|