@sbb-esta/lyne-elements 2.1.0 → 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/action-group.js +3 -3
- package/autocomplete/autocomplete-base-element.d.ts +4 -0
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-cell.js +3 -3
- package/autocomplete-grid/autocomplete-grid-row.js +3 -3
- package/autocomplete.js +25 -19
- package/breadcrumb/breadcrumb-group.js +1 -1
- package/button/common.js +15 -15
- package/card/card-badge.js +3 -3
- package/card/card.js +3 -3
- package/chip-label.js +3 -3
- package/clock.js +3 -3
- package/container/container.js +3 -3
- 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 +124 -113
- package/core/controllers.js +2 -2
- package/core/dom/scroll.d.ts +1 -0
- package/core/dom/scroll.d.ts.map +1 -1
- package/core/dom.js +31 -31
- package/core/images.d.ts.map +1 -1
- package/core/styles/core.scss +2 -0
- package/core.css +2 -0
- package/custom-elements.json +465 -4
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +11 -14
- package/datepicker/datepicker.js +4 -4
- 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-row.js +1 -1
- package/development/autocomplete.js +14 -1
- package/development/breadcrumb/breadcrumb-group.js +3 -3
- package/development/button/common.js +69 -72
- 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.js +1 -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/dom/scroll.d.ts +1 -0
- package/development/core/dom/scroll.d.ts.map +1 -1
- package/development/core/dom.js +5 -2
- package/development/core/images.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +12 -5
- package/development/datepicker/datepicker.js +1 -1
- package/development/dialog/dialog-content.js +1 -1
- package/development/dialog/dialog.js +1 -1
- 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/message.js +1 -1
- package/development/notification.js +1 -1
- package/development/option/optgroup.js +1 -1
- package/development/option/option.js +1 -1
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay.js +2 -2
- package/development/paginator/paginator.js +1 -1
- 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/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/toggle/toggle.js +1 -1
- package/development/train/train-blocked-passage.js +1 -1
- package/dialog/dialog-content.js +3 -3
- package/dialog/dialog.js +1 -1
- package/expansion-panel/expansion-panel-content.js +3 -3
- package/flip-card/flip-card-details.js +3 -3
- package/flip-card/flip-card-summary.js +3 -3
- package/icon.js +1 -1
- package/image.js +16 -16
- package/lead-container.js +3 -3
- package/link-list/link-list-anchor.js +3 -3
- package/link-list/link-list.js +3 -3
- package/loading-indicator-circle.js +3 -3
- package/loading-indicator.js +3 -3
- package/map-container.js +3 -3
- package/message.js +3 -3
- package/notification.js +3 -3
- package/option/optgroup.js +3 -3
- package/option/option.js +3 -3
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.js +1 -1
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +1 -1
- package/{sbb-tokens-Dx20OtVg.js → sbb-tokens-BgDF8jIh.js} +14 -14
- package/screen-reader-only.js +3 -3
- package/signet.js +1 -1
- package/standard-theme.css +2 -0
- package/stepper/step.js +3 -3
- package/tabs/tab.js +3 -3
- package/time-input.js +3 -3
- package/title/title-base.d.ts.map +1 -1
- package/title.js +41 -42
- package/toggle/toggle.js +3 -3
- package/train/train-blocked-passage.js +3 -3
package/core/a11y.js
CHANGED
|
@@ -125,10 +125,10 @@ const I = typeof getComputedStyle > "u" || getComputedStyle(document.documentEle
|
|
|
125
125
|
"select",
|
|
126
126
|
"textarea",
|
|
127
127
|
"details",
|
|
128
|
-
"summary
|
|
128
|
+
"summary",
|
|
129
129
|
"[tabindex]"
|
|
130
|
-
].map((t) => `${t}:not([disabled],[tabindex="-1"],[inert])`).
|
|
131
|
-
function
|
|
130
|
+
].map((t) => `${t}:not([disabled],:disabled,[tabindex="-1"],[inert])`).join(",");
|
|
131
|
+
function g(t, e) {
|
|
132
132
|
const n = /* @__PURE__ */ new Set();
|
|
133
133
|
function s(r, c) {
|
|
134
134
|
var i;
|
|
@@ -149,7 +149,7 @@ function b(t, e) {
|
|
|
149
149
|
return s(t, e == null ? void 0 : e.filter), [...n];
|
|
150
150
|
}
|
|
151
151
|
function X(t, e) {
|
|
152
|
-
const n =
|
|
152
|
+
const n = g(t, {
|
|
153
153
|
filter: e,
|
|
154
154
|
findFirstFocusable: !0
|
|
155
155
|
});
|
|
@@ -169,13 +169,13 @@ class j {
|
|
|
169
169
|
e.addEventListener("keydown", (s) => {
|
|
170
170
|
if (s.key !== "Tab")
|
|
171
171
|
return;
|
|
172
|
-
const r = Array.from(e.shadowRoot.children || []), i =
|
|
172
|
+
const r = Array.from(e.shadowRoot.children || []), i = g(r, {
|
|
173
173
|
filter: n == null ? void 0 : n.filter
|
|
174
174
|
}).filter((n == null ? void 0 : n.postFilter) ?? (() => !0));
|
|
175
175
|
if (!i.length)
|
|
176
176
|
return;
|
|
177
|
-
const o = i[0], u = i[i.length - 1], [h,
|
|
178
|
-
(o.getRootNode().activeElement === h || u.getRootNode().activeElement === h) && (
|
|
177
|
+
const o = i[0], u = i[i.length - 1], [h, b] = s.shiftKey ? [o, u] : [u, o];
|
|
178
|
+
(o.getRootNode().activeElement === h || u.getRootNode().activeElement === h) && (b.focus(), s.preventDefault());
|
|
179
179
|
}, { signal: this._controller.signal });
|
|
180
180
|
}
|
|
181
181
|
disconnect() {
|
|
@@ -188,7 +188,7 @@ export {
|
|
|
188
188
|
j as SbbFocusHandler,
|
|
189
189
|
W as SbbFocusVisibleWithinController,
|
|
190
190
|
X as getFirstFocusableElement,
|
|
191
|
-
|
|
191
|
+
g as getFocusableElements,
|
|
192
192
|
Y as getNextElementIndex,
|
|
193
193
|
F as hasGeometry,
|
|
194
194
|
I as interactivityChecker,
|
|
@@ -15,6 +15,8 @@ export declare abstract class SbbLinkBaseElement extends SbbActionBaseElement {
|
|
|
15
15
|
accessor download: boolean;
|
|
16
16
|
/** This will be forwarded as aria-label to the inner anchor element. */
|
|
17
17
|
accessor accessibilityLabel: string;
|
|
18
|
+
/** This will be forwarded as aria-current to the inner anchor element. */
|
|
19
|
+
accessor accessibilityCurrent: string;
|
|
18
20
|
protected language: SbbLanguageController;
|
|
19
21
|
constructor();
|
|
20
22
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/base-elements/link-base-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,6BAA6B,CAAC;AAErC,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErE,uBAAuB;AACvB,8BAIe,kBAAmB,SAAQ,oBAAoB;IAC5D,0CAA0C;IAC1C,SAEgB,IAAI,EAAE,MAAM,CAAM;IAElC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,cAAc,GAAG,MAAM,CAAM;IAErD,wEAAwE;IACxE,SAEgB,GAAG,EAAE,MAAM,CAAM;IAEjC,kEAAkE;IAClE,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,wEAAwE;IACxE,SAEgB,kBAAkB,EAAE,MAAM,CAAM;IAEhD,SAAS,CAAC,QAAQ,wBAAmC;;IASrD,gBAAgB;IACA,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAI/D,gBAAgB;IACA,IAAI,IAAI,IAAI;IAI5B,gBAAgB;IACA,KAAK,IAAI,IAAI;IAI7B,OAAO,CAAC,qBAAqB,CAE3B;IAEF,mHAAmH;cAChG,MAAM,IAAI,cAAc;IAI3C,SAAS,CAAC,UAAU,CAAC,aAAa,EAAE,cAAc,GAAG,cAAc;
|
|
1
|
+
{"version":3,"file":"link-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/base-elements/link-base-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,6BAA6B,CAAC;AAErC,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErE,uBAAuB;AACvB,8BAIe,kBAAmB,SAAQ,oBAAoB;IAC5D,0CAA0C;IAC1C,SAEgB,IAAI,EAAE,MAAM,CAAM;IAElC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,cAAc,GAAG,MAAM,CAAM;IAErD,wEAAwE;IACxE,SAEgB,GAAG,EAAE,MAAM,CAAM;IAEjC,kEAAkE;IAClE,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,wEAAwE;IACxE,SAEgB,kBAAkB,EAAE,MAAM,CAAM;IAEhD,0EAA0E;IAC1E,SAEgB,oBAAoB,EAAE,MAAM,CAAM;IAElD,SAAS,CAAC,QAAQ,wBAAmC;;IASrD,gBAAgB;IACA,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAI/D,gBAAgB;IACA,IAAI,IAAI,IAAI;IAI5B,gBAAgB;IACA,KAAK,IAAI,IAAI;IAI7B,OAAO,CAAC,qBAAqB,CAE3B;IAEF,mHAAmH;cAChG,MAAM,IAAI,cAAc;IAI3C,SAAS,CAAC,UAAU,CAAC,aAAa,EAAE,cAAc,GAAG,cAAc;CAsBpE"}
|
package/core/base-elements.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
1
|
+
var V = (l) => {
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import {
|
|
8
|
-
import { hostAttributes as
|
|
4
|
+
var W = (l, r, n) => r.has(l) || V("Cannot " + n);
|
|
5
|
+
var v = (l, r, n) => (W(l, r, "read from private field"), n ? n.call(l) : r.get(l)), k = (l, r, n) => r.has(l) ? V("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(l) : r.set(l, n), h = (l, r, n, i) => (W(l, r, "write to private field"), i ? i.call(l, n) : r.set(l, n), n);
|
|
6
|
+
import { __esDecorate as _, __runInitializers as o } from "tslib";
|
|
7
|
+
import { LitElement as J, html as B, isServer as Q, nothing as y } from "lit";
|
|
8
|
+
import { hostAttributes as T, forceType as D } from "./decorators.js";
|
|
9
9
|
import { property as g } from "lit/decorators.js";
|
|
10
|
-
import { isEventPrevented as
|
|
11
|
-
import { SbbFormAssociatedMixin as
|
|
12
|
-
import { SbbLanguageController as
|
|
13
|
-
import { i18nTargetOpensInNewWindow as
|
|
10
|
+
import { isEventPrevented as X, EventEmitter as A } from "./eventing.js";
|
|
11
|
+
import { SbbFormAssociatedMixin as Y } from "./mixins.js";
|
|
12
|
+
import { SbbLanguageController as Z } from "./controllers.js";
|
|
13
|
+
import { i18nTargetOpensInNewWindow as ee } from "./i18n.js";
|
|
14
14
|
import "../screen-reader-only.js";
|
|
15
|
-
let
|
|
16
|
-
var
|
|
17
|
-
let l = [
|
|
15
|
+
let U = (() => {
|
|
16
|
+
var u;
|
|
17
|
+
let l = [T({
|
|
18
18
|
"data-action": ""
|
|
19
|
-
})], r, n = [], i,
|
|
20
|
-
return
|
|
19
|
+
})], r, n = [], i, f = J;
|
|
20
|
+
return u = class extends f {
|
|
21
21
|
get maybeDisabled() {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
22
|
+
const d = this;
|
|
23
|
+
return d.disabled || d.formDisabled;
|
|
24
24
|
}
|
|
25
25
|
get maybeDisabledInteractive() {
|
|
26
26
|
return this.disabledInteractive;
|
|
@@ -31,8 +31,8 @@ let W = (() => {
|
|
|
31
31
|
setupBaseEventHandlers() {
|
|
32
32
|
this.addEventListener(
|
|
33
33
|
"click",
|
|
34
|
-
(
|
|
35
|
-
this.maybeDisabled && !this.maybeDisabledInteractive && (
|
|
34
|
+
(d) => {
|
|
35
|
+
this.maybeDisabled && !this.maybeDisabledInteractive && (d.preventDefault(), d.stopImmediatePropagation());
|
|
36
36
|
},
|
|
37
37
|
// capture is necessary here, as this event handler needs to be executed before any other
|
|
38
38
|
// in order to stop immediate propagation in the disabled case.
|
|
@@ -45,19 +45,19 @@ let W = (() => {
|
|
|
45
45
|
}
|
|
46
46
|
/** Default render method for button-like components. */
|
|
47
47
|
render() {
|
|
48
|
-
return
|
|
48
|
+
return B`<span class="sbb-action-base ${this.localName}">${this.renderTemplate()}</span>`;
|
|
49
49
|
}
|
|
50
|
-
}, i =
|
|
51
|
-
const
|
|
52
|
-
|
|
50
|
+
}, i = u, (() => {
|
|
51
|
+
const d = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
52
|
+
_(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: d }, null, n), i = r.value, d && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: d }), o(i, n);
|
|
53
53
|
})(), i;
|
|
54
|
-
})(),
|
|
55
|
-
var
|
|
56
|
-
let l = [
|
|
54
|
+
})(), he = (() => {
|
|
55
|
+
var m;
|
|
56
|
+
let l = [T({
|
|
57
57
|
tabindex: "0",
|
|
58
58
|
"data-button": ""
|
|
59
|
-
})], r, n = [], i,
|
|
60
|
-
return
|
|
59
|
+
})], r, n = [], i, f = Y(U), u = [], O, d;
|
|
60
|
+
return m = class extends f {
|
|
61
61
|
/**
|
|
62
62
|
* The type attribute to use for the button.
|
|
63
63
|
* @default 'button'
|
|
@@ -73,19 +73,19 @@ let W = (() => {
|
|
|
73
73
|
this._formId = e;
|
|
74
74
|
}
|
|
75
75
|
get form() {
|
|
76
|
-
var e,
|
|
77
|
-
return this._formId ? ((
|
|
76
|
+
var e, s;
|
|
77
|
+
return this._formId ? ((s = (e = this.ownerDocument) == null ? void 0 : e.querySelector) == null ? void 0 : s.call(e, `form#${this._formId}`)) ?? null : this.internals.form;
|
|
78
78
|
}
|
|
79
79
|
constructor() {
|
|
80
|
-
if (super(), this._formId = (
|
|
81
|
-
if (this.type === "button" || await
|
|
80
|
+
if (super(), this._formId = (o(this, u), ""), this._handleButtonClick = async (e) => {
|
|
81
|
+
if (this.type === "button" || await X(e))
|
|
82
82
|
return;
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
83
|
+
const s = this.form;
|
|
84
|
+
if (s)
|
|
85
85
|
if (this.type === "submit") {
|
|
86
86
|
const c = document.createElement("button");
|
|
87
|
-
c.inert = !0, c.hidden = !0, c.name = this.name, c.value = this.value ?? "",
|
|
88
|
-
} else this.type === "reset" &&
|
|
87
|
+
c.inert = !0, c.hidden = !0, c.name = this.name, c.value = this.value ?? "", s.append(c), s.requestSubmit(c), c.remove();
|
|
88
|
+
} else this.type === "reset" && s.reset();
|
|
89
89
|
else return;
|
|
90
90
|
}, this._preventScrollOnSpaceKeydown = (e) => {
|
|
91
91
|
e.key === " " && (e.preventDefault(), e.target.toggleAttribute("data-active", !0));
|
|
@@ -94,29 +94,29 @@ let W = (() => {
|
|
|
94
94
|
}, this._dispatchClickEventOnSpaceKeyup = (e) => {
|
|
95
95
|
e.key === " " && (this._removeActiveMarker(e), this._dispatchClickEvent(e));
|
|
96
96
|
}, this._dispatchClickEvent = (e) => {
|
|
97
|
-
const { altKey:
|
|
97
|
+
const { altKey: s, ctrlKey: c, metaKey: z, shiftKey: $ } = e;
|
|
98
98
|
e.target.dispatchEvent(new PointerEvent("click", {
|
|
99
99
|
bubbles: !0,
|
|
100
100
|
cancelable: !0,
|
|
101
101
|
composed: !0,
|
|
102
102
|
pointerId: -1,
|
|
103
103
|
pointerType: "",
|
|
104
|
-
altKey:
|
|
104
|
+
altKey: s,
|
|
105
105
|
ctrlKey: c,
|
|
106
|
-
metaKey:
|
|
107
|
-
shiftKey:
|
|
106
|
+
metaKey: z,
|
|
107
|
+
shiftKey: $
|
|
108
108
|
}));
|
|
109
|
-
}, this.internals.role = "button", !
|
|
109
|
+
}, this.internals.role = "button", !Q) {
|
|
110
110
|
this.setupBaseEventHandlers();
|
|
111
111
|
const e = { passive: !0 };
|
|
112
|
-
this.addEventListener("click", this._handleButtonClick), this.addEventListener("keydown", this._preventScrollOnSpaceKeydown), this.addEventListener("keyup", this._dispatchClickEventOnSpaceKeyup, e), this.addEventListener("blur", this._removeActiveMarker, e), this.addEventListener("keypress", (
|
|
113
|
-
(
|
|
114
|
-
`) && this._dispatchClickEvent(
|
|
112
|
+
this.addEventListener("click", this._handleButtonClick), this.addEventListener("keydown", this._preventScrollOnSpaceKeydown), this.addEventListener("keyup", this._dispatchClickEventOnSpaceKeyup, e), this.addEventListener("blur", this._removeActiveMarker, e), this.addEventListener("keypress", (s) => {
|
|
113
|
+
(s.key === "Enter" || s.key === `
|
|
114
|
+
`) && this._dispatchClickEvent(s);
|
|
115
115
|
}, e);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
attributeChangedCallback(e,
|
|
119
|
-
(!["name", "value"].includes(e) ||
|
|
118
|
+
attributeChangedCallback(e, s, c) {
|
|
119
|
+
(!["name", "value"].includes(e) || s !== c) && super.attributeChangedCallback(e, s, c);
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Intentionally empty, as buttons are not targeted by form reset
|
|
@@ -128,7 +128,7 @@ let W = (() => {
|
|
|
128
128
|
* Intentionally empty, as buttons are not targeted by form restore
|
|
129
129
|
* @internal
|
|
130
130
|
*/
|
|
131
|
-
formStateRestoreCallback(e,
|
|
131
|
+
formStateRestoreCallback(e, s) {
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Intentionally empty, as button does not write its data in form.
|
|
@@ -137,85 +137,93 @@ let W = (() => {
|
|
|
137
137
|
*/
|
|
138
138
|
updateFormValue() {
|
|
139
139
|
}
|
|
140
|
-
}, i =
|
|
141
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
} }, metadata: e }, null,
|
|
145
|
-
|
|
146
|
-
} }, metadata: e }, null,
|
|
140
|
+
}, i = m, (() => {
|
|
141
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
142
|
+
O = [g()], d = [g()], _(m, null, O, { kind: "setter", name: "type", static: !1, private: !1, access: { has: (s) => "type" in s, set: (s, c) => {
|
|
143
|
+
s.type = c;
|
|
144
|
+
} }, metadata: e }, null, u), _(m, null, d, { kind: "setter", name: "form", static: !1, private: !1, access: { has: (s) => "form" in s, set: (s, c) => {
|
|
145
|
+
s.form = c;
|
|
146
|
+
} }, metadata: e }, null, u), _(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: e }, null, n), i = r.value, e && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e }), o(i, n);
|
|
147
147
|
})(), i;
|
|
148
|
-
})(),
|
|
149
|
-
var
|
|
150
|
-
let l = [
|
|
148
|
+
})(), be = (() => {
|
|
149
|
+
var C, S, E, I, L, x, b;
|
|
150
|
+
let l = [T({
|
|
151
151
|
"data-link": ""
|
|
152
|
-
})], r, n = [], i,
|
|
153
|
-
return b = class extends
|
|
152
|
+
})], r, n = [], i, f = U, u, O = [], d = [], m, K = [], e = [], s, c = [], z = [], $, R = [], j = [], P, q = [], M = [], H, N = [], F = [];
|
|
153
|
+
return b = class extends f {
|
|
154
154
|
constructor() {
|
|
155
155
|
super();
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
k(this, C);
|
|
157
|
+
k(this, S);
|
|
158
|
+
k(this, E);
|
|
159
|
+
k(this, I);
|
|
160
|
+
k(this, L);
|
|
161
|
+
k(this, x);
|
|
162
|
+
h(this, C, o(this, O, "")), h(this, S, (o(this, d), o(this, K, ""))), h(this, E, (o(this, e), o(this, c, ""))), h(this, I, (o(this, z), o(this, R, !1))), h(this, L, (o(this, j), o(this, q, ""))), h(this, x, (o(this, M), o(this, N, ""))), this.language = (o(this, F), new Z(this)), this._evaluateRelAttribute = () => this.rel ? this.rel : this.target === "_blank" ? "external noopener nofollow" : y, Q || this.setupBaseEventHandlers();
|
|
162
163
|
}
|
|
163
164
|
/** The href value you want to link to. */
|
|
164
165
|
get href() {
|
|
165
|
-
return
|
|
166
|
+
return v(this, C);
|
|
166
167
|
}
|
|
167
|
-
set href(
|
|
168
|
-
|
|
168
|
+
set href(a) {
|
|
169
|
+
h(this, C, a);
|
|
169
170
|
}
|
|
170
171
|
/** Where to display the linked URL. */
|
|
171
172
|
get target() {
|
|
172
|
-
return
|
|
173
|
+
return v(this, S);
|
|
173
174
|
}
|
|
174
|
-
set target(
|
|
175
|
-
|
|
175
|
+
set target(a) {
|
|
176
|
+
h(this, S, a);
|
|
176
177
|
}
|
|
177
178
|
/** The relationship of the linked URL as space-separated link types. */
|
|
178
179
|
get rel() {
|
|
179
|
-
return
|
|
180
|
+
return v(this, E);
|
|
180
181
|
}
|
|
181
|
-
set rel(
|
|
182
|
-
|
|
182
|
+
set rel(a) {
|
|
183
|
+
h(this, E, a);
|
|
183
184
|
}
|
|
184
185
|
/** Whether the browser will show the download dialog on click. */
|
|
185
186
|
get download() {
|
|
186
|
-
return
|
|
187
|
+
return v(this, I);
|
|
187
188
|
}
|
|
188
|
-
set download(
|
|
189
|
-
|
|
189
|
+
set download(a) {
|
|
190
|
+
h(this, I, a);
|
|
190
191
|
}
|
|
191
192
|
/** This will be forwarded as aria-label to the inner anchor element. */
|
|
192
193
|
get accessibilityLabel() {
|
|
193
|
-
return
|
|
194
|
+
return v(this, L);
|
|
195
|
+
}
|
|
196
|
+
set accessibilityLabel(a) {
|
|
197
|
+
h(this, L, a);
|
|
198
|
+
}
|
|
199
|
+
/** This will be forwarded as aria-current to the inner anchor element. */
|
|
200
|
+
get accessibilityCurrent() {
|
|
201
|
+
return v(this, x);
|
|
194
202
|
}
|
|
195
|
-
set
|
|
196
|
-
|
|
203
|
+
set accessibilityCurrent(a) {
|
|
204
|
+
h(this, x, a);
|
|
197
205
|
}
|
|
198
206
|
/** @internal */
|
|
199
|
-
focus(
|
|
207
|
+
focus(a) {
|
|
200
208
|
var t;
|
|
201
|
-
(t = this.shadowRoot.querySelector("a")) == null || t.focus(
|
|
209
|
+
(t = this.shadowRoot.querySelector("a")) == null || t.focus(a);
|
|
202
210
|
}
|
|
203
211
|
/** @internal */
|
|
204
212
|
blur() {
|
|
205
|
-
var
|
|
206
|
-
(
|
|
213
|
+
var a;
|
|
214
|
+
(a = this.shadowRoot.querySelector("a")) == null || a.blur();
|
|
207
215
|
}
|
|
208
216
|
/** @internal */
|
|
209
217
|
click() {
|
|
210
|
-
var
|
|
211
|
-
(
|
|
218
|
+
var a;
|
|
219
|
+
(a = this.shadowRoot.querySelector("a")) == null || a.click();
|
|
212
220
|
}
|
|
213
221
|
/** Default render method for link-like components. Can be overridden if the LinkRenderVariables are not needed. */
|
|
214
222
|
render() {
|
|
215
223
|
return this.renderLink(this.renderTemplate());
|
|
216
224
|
}
|
|
217
|
-
renderLink(
|
|
218
|
-
return
|
|
225
|
+
renderLink(a) {
|
|
226
|
+
return B`
|
|
219
227
|
<a
|
|
220
228
|
class="sbb-action-base ${this.localName}"
|
|
221
229
|
href=${this.href || y}
|
|
@@ -223,36 +231,39 @@ let W = (() => {
|
|
|
223
231
|
target=${this.target || y}
|
|
224
232
|
rel=${this._evaluateRelAttribute()}
|
|
225
233
|
aria-label=${this.accessibilityLabel || y}
|
|
234
|
+
aria-current=${this.accessibilityCurrent || y}
|
|
226
235
|
tabindex=${this.maybeDisabled && !this.maybeDisabledInteractive ? "-1" : y}
|
|
227
236
|
aria-disabled=${this.maybeDisabled ? "true" : y}
|
|
228
237
|
>
|
|
229
|
-
${
|
|
230
|
-
${this.href && this.target === "_blank" ?
|
|
231
|
-
>. ${
|
|
238
|
+
${a}
|
|
239
|
+
${this.href && this.target === "_blank" ? B`<sbb-screen-reader-only
|
|
240
|
+
>. ${ee[this.language.current]}</sbb-screen-reader-only
|
|
232
241
|
>` : y}
|
|
233
242
|
</a>
|
|
234
243
|
`;
|
|
235
244
|
}
|
|
236
|
-
},
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
t.href =
|
|
240
|
-
} }, metadata:
|
|
241
|
-
t.target =
|
|
242
|
-
} }, metadata:
|
|
243
|
-
t.rel =
|
|
244
|
-
} }, metadata:
|
|
245
|
-
t.download =
|
|
246
|
-
} }, metadata:
|
|
247
|
-
t.accessibilityLabel =
|
|
248
|
-
} }, metadata:
|
|
245
|
+
}, C = new WeakMap(), S = new WeakMap(), E = new WeakMap(), I = new WeakMap(), L = new WeakMap(), x = new WeakMap(), i = b, (() => {
|
|
246
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
247
|
+
u = [D(), g()], m = [D(), g()], s = [D(), g()], $ = [D(), g({ type: Boolean })], P = [D(), g({ attribute: "accessibility-label" })], H = [D(), g({ attribute: "accessibility-current" })], _(b, null, u, { kind: "accessor", name: "href", static: !1, private: !1, access: { has: (t) => "href" in t, get: (t) => t.href, set: (t, p) => {
|
|
248
|
+
t.href = p;
|
|
249
|
+
} }, metadata: a }, O, d), _(b, null, m, { kind: "accessor", name: "target", static: !1, private: !1, access: { has: (t) => "target" in t, get: (t) => t.target, set: (t, p) => {
|
|
250
|
+
t.target = p;
|
|
251
|
+
} }, metadata: a }, K, e), _(b, null, s, { kind: "accessor", name: "rel", static: !1, private: !1, access: { has: (t) => "rel" in t, get: (t) => t.rel, set: (t, p) => {
|
|
252
|
+
t.rel = p;
|
|
253
|
+
} }, metadata: a }, c, z), _(b, null, $, { kind: "accessor", name: "download", static: !1, private: !1, access: { has: (t) => "download" in t, get: (t) => t.download, set: (t, p) => {
|
|
254
|
+
t.download = p;
|
|
255
|
+
} }, metadata: a }, R, j), _(b, null, P, { kind: "accessor", name: "accessibilityLabel", static: !1, private: !1, access: { has: (t) => "accessibilityLabel" in t, get: (t) => t.accessibilityLabel, set: (t, p) => {
|
|
256
|
+
t.accessibilityLabel = p;
|
|
257
|
+
} }, metadata: a }, q, M), _(b, null, H, { kind: "accessor", name: "accessibilityCurrent", static: !1, private: !1, access: { has: (t) => "accessibilityCurrent" in t, get: (t) => t.accessibilityCurrent, set: (t, p) => {
|
|
258
|
+
t.accessibilityCurrent = p;
|
|
259
|
+
} }, metadata: a }, N, F), _(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: a }, null, n), i = r.value, a && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a }), o(i, n);
|
|
249
260
|
})(), i;
|
|
250
261
|
})();
|
|
251
|
-
const
|
|
262
|
+
const w = class w extends J {
|
|
252
263
|
constructor() {
|
|
253
|
-
super(...arguments), this.willOpen = new
|
|
264
|
+
super(...arguments), this.willOpen = new A(this, w.events.willOpen, { cancelable: !0 }), this.didOpen = new A(this, w.events.didOpen, {
|
|
254
265
|
cancelable: !0
|
|
255
|
-
}), this.willClose = new
|
|
266
|
+
}), this.willClose = new A(this, w.events.willClose, { cancelable: !0 }), this.didClose = new A(this, w.events.didClose, { cancelable: !0 });
|
|
256
267
|
}
|
|
257
268
|
/** The state of the component. */
|
|
258
269
|
set state(r) {
|
|
@@ -269,16 +280,16 @@ const v = class v extends F {
|
|
|
269
280
|
super.connectedCallback(), this.state || (this.state = "closed");
|
|
270
281
|
}
|
|
271
282
|
};
|
|
272
|
-
|
|
283
|
+
w.events = {
|
|
273
284
|
willOpen: "willOpen",
|
|
274
285
|
didOpen: "didOpen",
|
|
275
286
|
willClose: "willClose",
|
|
276
287
|
didClose: "didClose"
|
|
277
288
|
};
|
|
278
|
-
let
|
|
289
|
+
let G = w;
|
|
279
290
|
export {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
291
|
+
U as SbbActionBaseElement,
|
|
292
|
+
he as SbbButtonBaseElement,
|
|
293
|
+
be as SbbLinkBaseElement,
|
|
294
|
+
G as SbbOpenCloseBaseElement
|
|
284
295
|
};
|
package/core/controllers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isServer as n } from "lit";
|
|
2
2
|
import { readConfig as b } from "./config.js";
|
|
3
|
-
import { S as f,
|
|
3
|
+
import { S as f, i as m, h as g } from "../sbb-tokens-BgDF8jIh.js";
|
|
4
4
|
class S {
|
|
5
5
|
get signal() {
|
|
6
6
|
var t;
|
|
@@ -92,7 +92,7 @@ r._defaultLanguage = "en", r._supportedLocales = ["en", "de", "fr", "it"], r._li
|
|
|
92
92
|
attributeOldValue: !0
|
|
93
93
|
};
|
|
94
94
|
let u = r;
|
|
95
|
-
const _ = (a) => a / f, w = "(forced-colors: active)", M = "(any-hover: hover)", N = "(pointer: coarse)", Q = `(min-width: ${_(
|
|
95
|
+
const _ = (a) => a / f, w = "(forced-colors: active)", M = "(any-hover: hover)", N = "(pointer: coarse)", Q = `(min-width: ${_(g)}rem)`, H = `(max-width: ${_(m)}rem)`, l = /* @__PURE__ */ new Map();
|
|
96
96
|
class L {
|
|
97
97
|
constructor(t, e) {
|
|
98
98
|
this._queries = e, t.addController(this);
|
package/core/dom/scroll.d.ts
CHANGED
package/core/dom/scroll.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/scroll.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,gBAAgB,CAAU;IAE3B,aAAa,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/scroll.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,gBAAgB,CAAU;IAE3B,aAAa,IAAI,IAAI;IAsBrB,YAAY,IAAI,IAAI;CAc5B"}
|
package/core/dom.js
CHANGED
|
@@ -5,17 +5,17 @@ function w(n, t) {
|
|
|
5
5
|
const e = getComputedStyle(n).getPropertyValue(t);
|
|
6
6
|
return parseFloat(e) === 0;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
8
|
+
const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
|
|
9
|
+
function p(n, t, e) {
|
|
10
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}-${e != null && e.includeMaxBreakpoint ? "max" : "min"}`)) - (e != null && e.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", b = s && `(min-width: ${s})`, m = r && `(max-width: ${r})`,
|
|
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
|
|
15
|
+
function h(n) {
|
|
16
16
|
return o ? null : typeof n == "string" ? document.getElementById(n) : n instanceof window.Element ? n : null;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function A(n, t) {
|
|
19
19
|
if (o)
|
|
20
20
|
return null;
|
|
21
21
|
for (t = t.parentElement ?? t.getRootNode().host; t && t !== document && t !== window; ) {
|
|
@@ -26,19 +26,19 @@ function v(n, t) {
|
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
29
|
+
const S = "a,button,sbb-teaser-hero,sbb-teaser";
|
|
30
|
+
function E(n, t) {
|
|
31
31
|
var e;
|
|
32
32
|
if (!t) {
|
|
33
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
|
-
function
|
|
38
|
+
function x() {
|
|
39
39
|
return !o && document.documentElement.classList.contains("sbb-lean");
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function I(n, t, e) {
|
|
42
42
|
e ? n.setAttribute(t, e) : n.removeAttribute(t);
|
|
43
43
|
}
|
|
44
44
|
let d;
|
|
@@ -47,42 +47,42 @@ try {
|
|
|
47
47
|
} catch {
|
|
48
48
|
d = !1;
|
|
49
49
|
}
|
|
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,
|
|
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._height = document.body.style.height, 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.height = "
|
|
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.height = this._height || "", 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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
S as ACTION_ELEMENTS,
|
|
68
|
+
W as SbbScrollHandler,
|
|
69
|
+
v as breakpoints,
|
|
70
|
+
E as findInput,
|
|
71
|
+
h as findReferencedElement,
|
|
72
|
+
A as hostContext,
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
k as isIOS,
|
|
80
|
+
x as isLean,
|
|
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
|
|
88
88
|
};
|
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/styles/core.scss
CHANGED
package/core.css
CHANGED