@sbb-esta/lyne-elements 1.7.0 → 1.9.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/calendar/calendar.d.ts +5 -2
- package/calendar/calendar.d.ts.map +1 -1
- package/calendar.js +73 -66
- package/clock.js +5 -5
- package/container/container.js +18 -18
- package/core/base-elements/open-close-base-element.d.ts +10 -0
- package/core/base-elements/open-close-base-element.d.ts.map +1 -1
- package/core/base-elements.js +4 -0
- package/core/controllers/inert-controller.d.ts +18 -0
- package/core/controllers/inert-controller.d.ts.map +1 -0
- package/core/controllers.d.ts +1 -0
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +67 -23
- package/core/dom/platform.d.ts +2 -3
- package/core/dom/platform.d.ts.map +1 -1
- package/core/dom.js +38 -40
- package/core/overlay/overlay.d.ts +0 -13
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +36 -86
- package/core/styles/core.scss +6 -0
- package/core/styles/mixins/lists.scss +11 -1
- package/core/testing/wait-for-image-ready.d.ts.map +1 -1
- package/core/testing.js +61 -54
- package/core.css +5 -0
- package/custom-elements.json +492 -66
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +4 -0
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +52 -42
- package/development/calendar/calendar.d.ts +5 -2
- package/development/calendar/calendar.d.ts.map +1 -1
- package/development/calendar.js +35 -19
- package/development/clock.js +1 -1
- package/development/container/container.js +9 -5
- package/development/core/base-elements/open-close-base-element.d.ts +10 -0
- package/development/core/base-elements/open-close-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +5 -1
- package/development/core/controllers/inert-controller.d.ts +18 -0
- package/development/core/controllers/inert-controller.d.ts.map +1 -0
- package/development/core/controllers.d.ts +1 -0
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +90 -1
- package/development/core/dom/platform.d.ts +2 -3
- package/development/core/dom/platform.d.ts.map +1 -1
- package/development/core/dom.js +4 -5
- package/development/core/overlay/overlay.d.ts +0 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +1 -87
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -1
- package/development/core/testing.js +16 -2
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +4 -0
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +19 -4
- package/development/dialog/dialog/dialog.d.ts.map +1 -1
- package/development/dialog/dialog.js +3 -4
- package/development/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/development/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
- package/development/flip-card/flip-card-details.js +28 -9
- package/development/flip-card/flip-card-summary.js +6 -1
- package/development/flip-card/flip-card.js +43 -12
- package/development/form-field/form-field.js +4 -2
- package/development/lead-container.js +5 -1
- package/development/menu/menu/menu.d.ts +1 -0
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +6 -9
- package/development/navigation/navigation/navigation.d.ts +1 -0
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation.js +6 -9
- package/development/overlay/overlay-base-element.d.ts +2 -1
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay/overlay.d.ts.map +1 -1
- package/development/overlay.js +6 -17
- package/development/popover/popover.js +2 -2
- package/development/select/select.d.ts +3 -1
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +20 -6
- package/development/stepper/step-label.js +20 -2
- package/development/stepper/stepper/stepper.d.ts +3 -0
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +16 -1
- package/development/toggle/toggle/toggle.d.ts +2 -1
- package/development/toggle/toggle/toggle.d.ts.map +1 -1
- package/development/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/development/toggle/toggle-option.js +4 -2
- package/development/toggle/toggle.js +7 -7
- package/dialog/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog.js +11 -12
- package/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
- package/flip-card/flip-card-details.js +19 -17
- package/flip-card/flip-card-summary.js +13 -13
- package/flip-card/flip-card.js +26 -24
- package/form-field/form-field.js +1 -1
- package/lead-container.js +1 -1
- package/lists.css +9 -1
- package/menu/menu/menu.d.ts +1 -0
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +30 -30
- package/navigation/navigation/navigation.d.ts +1 -0
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation.js +37 -37
- package/overlay/overlay-base-element.d.ts +2 -1
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay/overlay.d.ts.map +1 -1
- package/overlay.js +44 -45
- package/package.json +1 -1
- package/popover/popover.js +1 -1
- package/select/select.d.ts +3 -1
- package/select/select.d.ts.map +1 -1
- package/select.js +61 -50
- package/standard-theme.css +14 -1
- package/stepper/step-label.js +10 -10
- package/stepper/stepper/stepper.d.ts +3 -0
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +34 -25
- package/toggle/toggle/toggle.d.ts +2 -1
- package/toggle/toggle/toggle.d.ts.map +1 -1
- package/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/toggle/toggle-option.js +9 -8
- package/toggle/toggle.js +20 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
|
package/core/controllers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isServer as
|
|
1
|
+
import { isServer as c } from "lit";
|
|
2
2
|
import { readConfig as u } from "./config.js";
|
|
3
3
|
import { AgnosticMutationObserver as _ } from "./observers.js";
|
|
4
|
-
class
|
|
4
|
+
class C {
|
|
5
5
|
constructor(t) {
|
|
6
6
|
this._host = t, this._abortController = new AbortController(), this._host.addController(this);
|
|
7
7
|
}
|
|
@@ -17,14 +17,57 @@ class b {
|
|
|
17
17
|
(t = this._abortController) == null || t.abort(), this._abortController = void 0;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
const b = ["script", "head", "template", "style"], f = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
|
|
21
|
+
class E {
|
|
22
|
+
constructor(t, i = f, r = g) {
|
|
23
|
+
var s, o;
|
|
24
|
+
this._host = t, this._inertElements = i, this._inertOverlays = r, (o = (s = this._host).addController) == null || o.call(s, this);
|
|
25
|
+
}
|
|
26
|
+
hostConnected() {
|
|
27
|
+
this._host.isOpen && this.activate();
|
|
28
|
+
}
|
|
29
|
+
hostDisconnected() {
|
|
30
|
+
this._inertOverlays.has(this._host) && this.deactivate();
|
|
31
|
+
}
|
|
32
|
+
/** Applies inert state to every other element on the page except the overlay. */
|
|
33
|
+
activate() {
|
|
34
|
+
this._inertOverlays.size && this._removeInertAttributes(), this._inertOverlays.add(this._host), this._addInertAttributes();
|
|
35
|
+
}
|
|
36
|
+
/** Removes inert state. */
|
|
37
|
+
deactivate() {
|
|
38
|
+
if (this._currentOverlay() !== this._host) {
|
|
39
|
+
this._inertOverlays.has(this._host) && this._inertOverlays.delete(this._host);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this._removeInertAttributes(), this._inertOverlays.delete(this._host), this._inertOverlays.size && this._addInertAttributes();
|
|
43
|
+
}
|
|
44
|
+
_currentOverlay() {
|
|
45
|
+
return [...this._inertOverlays].pop() ?? null;
|
|
46
|
+
}
|
|
47
|
+
_removeInertAttributes() {
|
|
48
|
+
this._inertElements.forEach((t) => {
|
|
49
|
+
t && (t.hasAttribute("data-sbb-inert") && (t.inert = !1, t.removeAttribute("data-sbb-inert")), t.hasAttribute("data-sbb-aria-hidden") && (t.removeAttribute("aria-hidden"), t.removeAttribute("data-sbb-aria-hidden")));
|
|
50
|
+
}), this._inertElements.clear();
|
|
51
|
+
}
|
|
52
|
+
_addInertAttributes() {
|
|
53
|
+
var i, r;
|
|
54
|
+
let t = this._currentOverlay();
|
|
55
|
+
for (; t !== document.documentElement && t !== null; )
|
|
56
|
+
Array.from(((i = (t == null ? void 0 : t.parentElement) ?? (t == null ? void 0 : t.getRootNode())) == null ? void 0 : i.childNodes) ?? []).filter(
|
|
57
|
+
(s) => s !== t && s instanceof window.HTMLElement && !b.includes(s.localName)
|
|
58
|
+
).forEach((s) => {
|
|
59
|
+
this._inertElements.add(s), s.inert || (s.inert = !0, s.toggleAttribute("data-sbb-inert", !0)), s.hasAttribute("aria-hidden") || (s.setAttribute("aria-hidden", "true"), s.toggleAttribute("data-sbb-aria-hidden", !0));
|
|
60
|
+
}), t = (t == null ? void 0 : t.parentElement) ?? ((r = t == null ? void 0 : t.getRootNode()) == null ? void 0 : r.host) ?? null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
20
63
|
const e = class e {
|
|
21
64
|
constructor(t) {
|
|
22
65
|
this._host = t, this._handlers = [], this._host.addController(this);
|
|
23
66
|
}
|
|
24
67
|
/** Get the current language. */
|
|
25
68
|
static get current() {
|
|
26
|
-
const
|
|
27
|
-
return e._supportedLocales.includes(
|
|
69
|
+
const i = ((u().language ?? (c ? e._defaultLanguage : document.documentElement.getAttribute("lang"))) || e._defaultLanguage).split("-")[0];
|
|
70
|
+
return e._supportedLocales.includes(i) ? i : e._defaultLanguage;
|
|
28
71
|
}
|
|
29
72
|
/** Get the current language. */
|
|
30
73
|
get current() {
|
|
@@ -44,20 +87,20 @@ const e = class e {
|
|
|
44
87
|
this._previousLanguage = this.current, e._listeners.delete(this), e._listeners.size || e._observer.disconnect();
|
|
45
88
|
}
|
|
46
89
|
_callHandlers(t = !0) {
|
|
47
|
-
this._handlers.forEach((
|
|
90
|
+
this._handlers.forEach((i) => i()), t && this._host.requestUpdate();
|
|
48
91
|
}
|
|
49
92
|
};
|
|
50
93
|
e._defaultLanguage = "en", e._supportedLocales = ["en", "de", "fr", "it"], e._listeners = /* @__PURE__ */ new Set(), e._observer = new _((t) => {
|
|
51
|
-
t[0].oldValue !== document.documentElement.getAttribute("lang") && e._listeners.forEach((
|
|
94
|
+
t[0].oldValue !== document.documentElement.getAttribute("lang") && e._listeners.forEach((i) => i._callHandlers());
|
|
52
95
|
}), e._observerConfig = {
|
|
53
96
|
attributeFilter: ["lang"],
|
|
54
97
|
attributeOldValue: !0
|
|
55
98
|
};
|
|
56
|
-
let
|
|
57
|
-
class
|
|
58
|
-
constructor(t,
|
|
59
|
-
this._host = t, this._onChangeCallback =
|
|
60
|
-
this._syncSlots(
|
|
99
|
+
let d = e;
|
|
100
|
+
class p {
|
|
101
|
+
constructor(t, i = null) {
|
|
102
|
+
this._host = t, this._onChangeCallback = i, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (r) => {
|
|
103
|
+
this._syncSlots(r.target);
|
|
61
104
|
}, this._host.addController(this);
|
|
62
105
|
}
|
|
63
106
|
hostConnected() {
|
|
@@ -69,20 +112,21 @@ class C {
|
|
|
69
112
|
(t = this._host.shadowRoot) == null || t.removeEventListener("slotchange", this._slotchangeHandler);
|
|
70
113
|
}
|
|
71
114
|
_syncSlots(...t) {
|
|
72
|
-
var
|
|
73
|
-
for (const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
return "tagName" in
|
|
78
|
-
}) ? this.slots.add(
|
|
115
|
+
var s;
|
|
116
|
+
for (const o of t) {
|
|
117
|
+
const a = o.name || "unnamed";
|
|
118
|
+
o.assignedNodes().some((h) => {
|
|
119
|
+
var l;
|
|
120
|
+
return "tagName" in h || ((l = h.textContent) == null ? void 0 : l.trim());
|
|
121
|
+
}) ? this.slots.add(a) : this.slots.delete(a);
|
|
79
122
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
123
|
+
const i = this._host.getAttribute("data-slot-names"), r = [...this.slots].sort().join(" ");
|
|
124
|
+
r ? this._host.getAttribute("data-slot-names") !== r && this._host.setAttribute("data-slot-names", r) : this._host.removeAttribute("data-slot-names"), r !== i && ((s = this._onChangeCallback) == null || s.call(this));
|
|
82
125
|
}
|
|
83
126
|
}
|
|
84
127
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
128
|
+
C as SbbConnectedAbortController,
|
|
129
|
+
E as SbbInertController,
|
|
130
|
+
d as SbbLanguageController,
|
|
131
|
+
p as SbbSlotStateController
|
|
88
132
|
};
|
package/core/dom/platform.d.ts
CHANGED
|
@@ -15,10 +15,9 @@ export declare const isAndroid: boolean;
|
|
|
15
15
|
/** Whether the current browser is Safari. */
|
|
16
16
|
export declare const isSafari: boolean;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData
|
|
18
|
+
* We just check for the blink engine.
|
|
20
19
|
*/
|
|
21
|
-
export declare const isChromium:
|
|
20
|
+
export declare const isChromium: boolean;
|
|
22
21
|
/** Whether the application is being rendered in a Next.js environment. */
|
|
23
22
|
export declare const isNextjs: () => boolean;
|
|
24
23
|
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/platform.ts"],"names":[],"mappings":"AAmBA,qDAAqD;AACrD,eAAO,MAAM,MAAM,SAAmD,CAAC;AAEvE,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAA2D,CAAC;AAGlF,qDAAqD;AACrD,eAAO,MAAM,OAAO,SAKR,CAAC;AAIb,sDAAsD;AACtD,eAAO,MAAM,QAAQ,SACuE,CAAC;AAE7F,iDAAiD;AACjD,eAAO,MAAM,KAAK,SACoE,CAAC;AAMvF,8CAA8C;AAC9C,eAAO,MAAM,SAAS,SAAgE,CAAC;AAEvF,+CAA+C;AAE/C,eAAO,MAAM,SAAS,SAAkE,CAAC;AAKzF,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,SAA+D,CAAC;AAErF
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/platform.ts"],"names":[],"mappings":"AAmBA,qDAAqD;AACrD,eAAO,MAAM,MAAM,SAAmD,CAAC;AAEvE,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAA2D,CAAC;AAGlF,qDAAqD;AACrD,eAAO,MAAM,OAAO,SAKR,CAAC;AAIb,sDAAsD;AACtD,eAAO,MAAM,QAAQ,SACuE,CAAC;AAE7F,iDAAiD;AACjD,eAAO,MAAM,KAAK,SACoE,CAAC;AAMvF,8CAA8C;AAC9C,eAAO,MAAM,SAAS,SAAgE,CAAC;AAEvF,+CAA+C;AAE/C,eAAO,MAAM,SAAS,SAAkE,CAAC;AAKzF,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,SAA+D,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,CAAC;AAElC,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,QAAO,OAAmD,CAAC"}
|
package/core/dom.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { isServer as e } from "lit";
|
|
2
|
-
const
|
|
3
|
-
function
|
|
2
|
+
const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
|
|
3
|
+
function E(t, n, o) {
|
|
4
4
|
if (e)
|
|
5
5
|
return !1;
|
|
6
|
-
const i = getComputedStyle(document.documentElement),
|
|
6
|
+
const i = getComputedStyle(document.documentElement), s = t ? i.getPropertyValue(`--sbb-breakpoint-${t}-min`) : "", r = n ? `${parseFloat(
|
|
7
7
|
i.getPropertyValue(
|
|
8
8
|
`--sbb-breakpoint-${n}-${o != null && o.includeMaxBreakpoint ? "max" : "min"}`
|
|
9
9
|
)
|
|
10
|
-
) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "",
|
|
11
|
-
return window.matchMedia(`${
|
|
10
|
+
) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", m = s && `(min-width: ${s})`, f = r && `(max-width: ${r})`, y = s && r && " and ";
|
|
11
|
+
return window.matchMedia(`${m}${y}${f}`).matches;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function g(t) {
|
|
14
14
|
return e ? null : typeof t == "string" ? document.getElementById(t) : t instanceof window.Element ? t : null;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const A = () => !e && document.documentElement.getAttribute("dir") || "ltr";
|
|
17
|
+
function S(t, n) {
|
|
18
18
|
if (e)
|
|
19
19
|
return null;
|
|
20
20
|
for (n = n.parentElement ?? n.getRootNode().host; n && n !== document && n !== window; ) {
|
|
@@ -25,16 +25,16 @@ function x(t, n) {
|
|
|
25
25
|
}
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
function
|
|
28
|
+
const p = "a,button,sbb-teaser-hero,sbb-teaser";
|
|
29
|
+
function x(t, n) {
|
|
30
30
|
var o;
|
|
31
31
|
if (!n) {
|
|
32
32
|
const i = (o = t.closest) == null ? void 0 : o.call(t, "sbb-form-field");
|
|
33
33
|
return i == null ? void 0 : i.querySelector("input");
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return g(n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function k(t, n, o) {
|
|
38
38
|
o ? t.setAttribute(n, o) : t.removeAttribute(n);
|
|
39
39
|
}
|
|
40
40
|
let a;
|
|
@@ -43,26 +43,24 @@ try {
|
|
|
43
43
|
} catch {
|
|
44
44
|
a = !1;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const C = !e && ((b = (l = navigator.userAgentData) == null ? void 0 : l.brands) == null ? void 0 : b.some((t) => t.brand == "Chromium")), N = () => !!globalThis.next;
|
|
49
|
-
function u() {
|
|
46
|
+
const u = !e && /(edge)/i.test(navigator.userAgent), c = !e && /(msie|trident)/i.test(navigator.userAgent), b = !e && !!(window.chrome || a) && typeof CSS < "u" && !u && !c, h = !e && /AppleWebKit/i.test(navigator.userAgent) && !b && !u && !c, I = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), $ = !e && /(firefox|minefield)/i.test(navigator.userAgent), M = !e && /android/i.test(navigator.userAgent) && !c, _ = !e && /safari/i.test(navigator.userAgent) && h, W = b, B = () => !!globalThis.next;
|
|
47
|
+
function l() {
|
|
50
48
|
return document.body.hasAttribute("data-sbb-scroll-disabled");
|
|
51
49
|
}
|
|
52
|
-
class
|
|
50
|
+
class N {
|
|
53
51
|
disableScroll() {
|
|
54
|
-
if (
|
|
52
|
+
if (l())
|
|
55
53
|
return;
|
|
56
54
|
this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
|
|
57
55
|
const n = window.innerWidth - document.documentElement.clientWidth;
|
|
58
56
|
document.body.style.overflow = "hidden", document.body.style.position = "relative", document.body.style.marginInlineEnd = `${n}px`, document.body.style.setProperty("--sbb-scrollbar-width", `${n}px`), document.body.toggleAttribute("data-sbb-scroll-disabled", !0);
|
|
59
57
|
}
|
|
60
58
|
enableScroll() {
|
|
61
|
-
|
|
59
|
+
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"));
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
const d = /* @__PURE__ */ new Map();
|
|
65
|
-
function
|
|
63
|
+
function P(t) {
|
|
66
64
|
if (d.has(t.constructor))
|
|
67
65
|
return d.get(t.constructor);
|
|
68
66
|
const n = (
|
|
@@ -75,25 +73,25 @@ function R(t) {
|
|
|
75
73
|
throw new Error(`Given element ${t.constructor.name} has not been registered yet.`);
|
|
76
74
|
}
|
|
77
75
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
76
|
+
p as ACTION_ELEMENTS,
|
|
77
|
+
N as SbbScrollHandler,
|
|
78
|
+
v as breakpoints,
|
|
79
|
+
x as findInput,
|
|
80
|
+
g as findReferencedElement,
|
|
81
|
+
A as getDocumentWritingMode,
|
|
82
|
+
P as getLocalName,
|
|
83
|
+
S as hostContext,
|
|
84
|
+
M as isAndroid,
|
|
85
|
+
b as isBlink,
|
|
86
|
+
E as isBreakpoint,
|
|
87
|
+
W as isChromium,
|
|
88
|
+
u as isEdge,
|
|
89
|
+
$ as isFirefox,
|
|
90
|
+
I as isIOS,
|
|
91
|
+
B as isNextjs,
|
|
92
|
+
_ as isSafari,
|
|
95
93
|
c as isTrident,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
h as isWebkit,
|
|
95
|
+
l as pageScrollDisabled,
|
|
96
|
+
k as setOrRemoveAttribute
|
|
99
97
|
};
|
|
@@ -4,17 +4,4 @@ import { TemplateResult } from 'lit';
|
|
|
4
4
|
* Works in conjunction with the 'overlayGapFixCorners()' function in 'overlay.ts'
|
|
5
5
|
*/
|
|
6
6
|
export declare function overlayGapFixCorners(): TemplateResult;
|
|
7
|
-
/**
|
|
8
|
-
* Applies inert to every other element on the page except the overlay.
|
|
9
|
-
*/
|
|
10
|
-
export declare function applyInertMechanism(overlay: HTMLElement): void;
|
|
11
|
-
export declare function removeInertMechanism(): void;
|
|
12
|
-
declare global {
|
|
13
|
-
interface GlobalEventHandlersEventMap {
|
|
14
|
-
willOpen: CustomEvent<void>;
|
|
15
|
-
willClose: CustomEvent<void>;
|
|
16
|
-
didOpen: CustomEvent<void>;
|
|
17
|
-
didClose: CustomEvent<void>;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
7
|
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CASrD"}
|
package/core/overlay.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { html as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return E`
|
|
1
|
+
import { html as H } from "lit";
|
|
2
|
+
function O() {
|
|
3
|
+
return H`
|
|
5
4
|
<div class="sbb-gap-fix-wrapper">
|
|
6
5
|
<div class="sbb-gap-fix-corner" id="left"></div>
|
|
7
6
|
</div>
|
|
@@ -10,54 +9,7 @@ function $() {
|
|
|
10
9
|
</div>
|
|
11
10
|
`;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
let n = t.parentElement;
|
|
15
|
-
const i = [];
|
|
16
|
-
for (; n && (i.push(n), n !== e); )
|
|
17
|
-
n = n.parentElement;
|
|
18
|
-
return i;
|
|
19
|
-
}, w = (t) => {
|
|
20
|
-
t.setAttribute(
|
|
21
|
-
"data-sbb-inert",
|
|
22
|
-
`${+(t.getAttribute("data-sbb-inert") ?? void 0) + 1 || 0}`
|
|
23
|
-
);
|
|
24
|
-
}, W = (t) => {
|
|
25
|
-
t.inert || (t.inert = !0, t.matches(x) ? w(t) : t.toggleAttribute("data-sbb-inert", !0)), t.hasAttribute("aria-hidden") || (t.setAttribute("aria-hidden", "true"), t.toggleAttribute("data-sbb-aria-hidden", !0));
|
|
26
|
-
}, y = (t) => {
|
|
27
|
-
t.hasAttribute("data-sbb-inert") && (t.inert = !1, t.removeAttribute("data-sbb-inert")), t.hasAttribute("data-sbb-aria-hidden") && (t.removeAttribute("aria-hidden"), t.removeAttribute("data-sbb-aria-hidden"));
|
|
28
|
-
};
|
|
29
|
-
function C(t) {
|
|
30
|
-
y(t);
|
|
31
|
-
const e = t.closest("body > *");
|
|
32
|
-
Array.from(document.querySelectorAll("body > *")).filter(
|
|
33
|
-
(o) => o !== e
|
|
34
|
-
).forEach((o) => W(o));
|
|
35
|
-
let i = [];
|
|
36
|
-
const a = O(t, e);
|
|
37
|
-
for (const o of a)
|
|
38
|
-
i = i.concat(
|
|
39
|
-
Array.from(o.children).filter(
|
|
40
|
-
(c) => c !== t && !a.includes(c)
|
|
41
|
-
)
|
|
42
|
-
), o.matches(x) && w(o);
|
|
43
|
-
i.forEach((o) => W(o));
|
|
44
|
-
}
|
|
45
|
-
function z() {
|
|
46
|
-
const t = Array.from(
|
|
47
|
-
document.documentElement.querySelectorAll(x)
|
|
48
|
-
);
|
|
49
|
-
if (t.length) {
|
|
50
|
-
t.forEach((e) => {
|
|
51
|
-
const n = +e.getAttribute("data-sbb-inert") - 1;
|
|
52
|
-
e.setAttribute("data-sbb-inert", `${n}`), n && n < 0 && (y(e), Array.from(e.children).forEach((i) => y(i)));
|
|
53
|
-
});
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
Array.from(document.documentElement.querySelectorAll("[data-sbb-inert]")).forEach(
|
|
57
|
-
(e) => y(e)
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
function S(t) {
|
|
12
|
+
function W(t) {
|
|
61
13
|
const e = window.getComputedStyle(t), n = e.display, i = parseInt(e.maxHeight, 10).toString();
|
|
62
14
|
if (n !== "none" && i !== "0")
|
|
63
15
|
return {
|
|
@@ -69,58 +21,56 @@ function S(t) {
|
|
|
69
21
|
offsetWidth: t.offsetWidth
|
|
70
22
|
};
|
|
71
23
|
t.style.position = "absolute", t.style.visibility = "hidden", t.style.display = "block";
|
|
72
|
-
const
|
|
73
|
-
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight:
|
|
24
|
+
const l = t.scrollHeight, o = t.clientHeight, r = t.offsetHeight, b = t.scrollWidth, a = t.clientWidth, s = t.offsetWidth;
|
|
25
|
+
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: l, clientHeight: o, offsetHeight: r, scrollWidth: b, clientWidth: a, offsetWidth: s };
|
|
74
26
|
}
|
|
75
|
-
function
|
|
27
|
+
function P(t, e) {
|
|
76
28
|
if (!t || !e)
|
|
77
29
|
return !1;
|
|
78
30
|
const n = t.getBoundingClientRect();
|
|
79
31
|
return n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
|
|
80
32
|
}
|
|
81
|
-
function
|
|
82
|
-
const o = (i == null ? void 0 : i.verticalOffset) || 0,
|
|
83
|
-
let
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
i != null && i.centered &&
|
|
87
|
-
const
|
|
88
|
-
return
|
|
89
|
-
top:
|
|
90
|
-
left:
|
|
91
|
-
maxHeight:
|
|
92
|
-
alignment:
|
|
33
|
+
function g(t, e, n, i) {
|
|
34
|
+
const o = (i == null ? void 0 : i.verticalOffset) || 0, r = (i == null ? void 0 : i.horizontalOffset) || 0, b = (i == null ? void 0 : i.responsiveHeight) || !1, a = e.getBoundingClientRect(), s = W(t), d = a.left, m = a.top, x = document.documentElement.clientWidth - (d + a.width), u = m - o, p = document.documentElement.clientHeight - (m + a.height + o);
|
|
35
|
+
let c = d, v = m + a.height + o, f = s.offsetWidth - a.width;
|
|
36
|
+
const h = { horizontal: "start", vertical: "below" };
|
|
37
|
+
let y = `${p - o}px`;
|
|
38
|
+
i != null && i.centered && d - 16 + a.width / 2 > s.offsetWidth / 2 && x - 16 > f / 2 && (c -= f /= 2, h.horizontal = "center"), x < f && d > f && (c = c - f, h.horizontal = "end"), r && h.horizontal !== "center" && a.width / 2 < r && (c += r * (h.horizontal === "start" ? -1 : 1)), (d < f && x < f || document.documentElement.clientWidth < s.offsetWidth) && (c = document.documentElement.clientWidth / 2 - s.offsetWidth / 2), (p - o < s.scrollHeight && u - o > (b ? s.clientHeight : s.scrollHeight) || u > p && p - o < s.clientHeight && !b) && (v = u < s.scrollHeight ? v - a.height - u - o : m - s.clientHeight - o, y = `${u - o}px`, h.vertical = "above");
|
|
39
|
+
const A = n.getBoundingClientRect();
|
|
40
|
+
return A.left < 0 && (c -= A.left), A.top < 0 && (v -= A.top), {
|
|
41
|
+
top: v,
|
|
42
|
+
left: c,
|
|
43
|
+
maxHeight: y,
|
|
44
|
+
alignment: h
|
|
93
45
|
};
|
|
94
46
|
}
|
|
95
|
-
function
|
|
47
|
+
function R(t, e, n, i, l) {
|
|
96
48
|
if (!t || !e)
|
|
97
49
|
return;
|
|
98
|
-
|
|
99
|
-
const o =
|
|
100
|
-
|
|
50
|
+
l.style.setProperty("--sbb-options-panel-width", `${e.offsetWidth}px`), l.style.setProperty("--sbb-options-panel-origin-height", `${e.offsetHeight}px`);
|
|
51
|
+
const o = g(n, e, i);
|
|
52
|
+
l.style.setProperty("--sbb-options-panel-position-x", `${o.left}px`), l.style.setProperty("--sbb-options-panel-position-y", `${o.top}px`), l.style.setProperty("--sbb-options-panel-max-height", o.maxHeight), l.setAttribute("data-options-panel-position", o.alignment.vertical), e.setAttribute("data-options-panel-position", o.alignment.vertical);
|
|
101
53
|
}
|
|
102
|
-
function
|
|
54
|
+
function $(t, e, n, i) {
|
|
103
55
|
t && (t.setAttribute("aria-haspopup", e), t.setAttribute("aria-controls", n), t.setAttribute("aria-expanded", `${i === "opening" || i === "opened"}`));
|
|
104
56
|
}
|
|
105
|
-
function
|
|
57
|
+
function z(t) {
|
|
106
58
|
t && (t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"));
|
|
107
59
|
}
|
|
108
|
-
function
|
|
60
|
+
function C(t, e, n, i = "listbox") {
|
|
109
61
|
t && (t.setAttribute("autocomplete", "off"), t.setAttribute("role", "combobox"), t.setAttribute("aria-autocomplete", "list"), t.setAttribute("aria-haspopup", i), t.setAttribute("aria-controls", e), t.setAttribute("aria-owns", e), t.setAttribute("aria-expanded", `${n}`));
|
|
110
62
|
}
|
|
111
|
-
function
|
|
63
|
+
function B(t) {
|
|
112
64
|
t && (t.removeAttribute("autocomplete"), t.removeAttribute("role"), t.removeAttribute("aria-autocomplete"), t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-owns"), t.removeAttribute("aria-expanded"));
|
|
113
65
|
}
|
|
114
66
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Y as setAriaOverlayTriggerAttributes,
|
|
125
|
-
I as setOverlayPosition
|
|
67
|
+
g as getElementPosition,
|
|
68
|
+
W as getElementRectangle,
|
|
69
|
+
P as isEventOnElement,
|
|
70
|
+
O as overlayGapFixCorners,
|
|
71
|
+
B as removeAriaComboBoxAttributes,
|
|
72
|
+
z as removeAriaOverlayTriggerAttributes,
|
|
73
|
+
C as setAriaComboBoxAttributes,
|
|
74
|
+
$ as setAriaOverlayTriggerAttributes,
|
|
75
|
+
R as setOverlayPosition
|
|
126
76
|
};
|
package/core/styles/core.scss
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
// Time Input
|
|
29
29
|
--sbb-time-input-max-width: #{functions.px-to-rem-build(58)};
|
|
30
|
+
--sbb-time-input-s-max-width: #{functions.px-to-rem-build(51)};
|
|
30
31
|
|
|
31
32
|
// Overlay
|
|
32
33
|
--sbb-overlay-default-z-index: 1000;
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
|
|
42
43
|
// Time Input
|
|
43
44
|
--sbb-time-input-max-width: #{functions.px-to-rem-build(65)};
|
|
45
|
+
--sbb-time-input-s-max-width: #{functions.px-to-rem-build(58)};
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -123,4 +125,8 @@ sbb-title + p {
|
|
|
123
125
|
|
|
124
126
|
input[data-sbb-time-input] {
|
|
125
127
|
max-width: var(--sbb-time-input-max-width);
|
|
128
|
+
|
|
129
|
+
sbb-form-field[size='s'] & {
|
|
130
|
+
max-width: var(--sbb-time-input-s-max-width);
|
|
131
|
+
}
|
|
126
132
|
}
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
--sbb-step-list-padding-block: var(--sbb-spacing-fixed-3x);
|
|
82
82
|
--sbb-step-list-padding-inline: var(--sbb-spacing-responsive-xxs);
|
|
83
83
|
--sbb-step-list-marker-to-text-gap: var(--sbb-spacing-responsive-xxxs);
|
|
84
|
+
--sbb-step-list-border-radius: var(--sbb-border-radius-4x);
|
|
84
85
|
|
|
85
86
|
// Additional space from overall li padding to the text because text
|
|
86
87
|
// has to be centered to marker number.
|
|
@@ -117,7 +118,6 @@
|
|
|
117
118
|
position: relative;
|
|
118
119
|
counter-increment: steps;
|
|
119
120
|
background-color: var(--sbb-color-milk);
|
|
120
|
-
border-radius: var(--sbb-border-radius-4x);
|
|
121
121
|
padding-block: calc(
|
|
122
122
|
var(--sbb-step-list-padding-block) + var(--sbb-step-list-text-to-marker-block-offset)
|
|
123
123
|
)
|
|
@@ -131,6 +131,16 @@
|
|
|
131
131
|
var(--sbb-step-list-marker-dimensions) + 2 * var(--sbb-step-list-padding-block)
|
|
132
132
|
);
|
|
133
133
|
|
|
134
|
+
&:first-of-type {
|
|
135
|
+
border-start-start-radius: var(--sbb-step-list-border-radius);
|
|
136
|
+
border-start-end-radius: var(--sbb-step-list-border-radius);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:last-of-type {
|
|
140
|
+
border-end-start-radius: var(--sbb-step-list-border-radius);
|
|
141
|
+
border-end-end-radius: var(--sbb-step-list-border-radius);
|
|
142
|
+
}
|
|
143
|
+
|
|
134
144
|
&::before {
|
|
135
145
|
@include typo.text-xxs--bold;
|
|
136
146
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-image-ready.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/wait-for-image-ready.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"wait-for-image-ready.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/wait-for-image-ready.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GAAG,eAAe,EAC3C,qBAAqB,SAAW,GAC/B,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|