@sbb-esta/lyne-elements 0.52.0 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/core/mixins.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { property as l, state as
|
|
2
|
-
import { defaultConverter as
|
|
3
|
-
import { hostAttributes as
|
|
4
|
-
import { preventScrollOnSpacebarPress as
|
|
5
|
-
import { getLocalName as
|
|
1
|
+
import { property as l, state as g } from "lit/decorators.js";
|
|
2
|
+
import { defaultConverter as c, isServer as d, html as o, nothing as u } from "lit";
|
|
3
|
+
import { hostAttributes as y } from "./decorators.js";
|
|
4
|
+
import { preventScrollOnSpacebarPress as b, forwardEventToHost as S } from "./eventing.js";
|
|
5
|
+
import { getLocalName as p } from "./dom.js";
|
|
6
6
|
import "../screen-reader-only.js";
|
|
7
|
-
var
|
|
8
|
-
for (var e =
|
|
9
|
-
(n = a[i]) && (e = n(
|
|
10
|
-
return e &&
|
|
7
|
+
var _ = Object.defineProperty, E = Object.getOwnPropertyDescriptor, x = (a, s, r, t) => {
|
|
8
|
+
for (var e = E(s, r), i = a.length - 1, n; i >= 0; i--)
|
|
9
|
+
(n = a[i]) && (e = n(s, r, e) || e);
|
|
10
|
+
return e && _(s, r, e), e;
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
class
|
|
12
|
+
const C = (a) => {
|
|
13
|
+
class s extends a {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.
|
|
15
|
+
super(...arguments), this.a = !1;
|
|
16
16
|
}
|
|
17
17
|
set disabled(t) {
|
|
18
|
-
this.
|
|
18
|
+
this.a = !!t;
|
|
19
19
|
}
|
|
20
20
|
get disabled() {
|
|
21
|
-
return this.
|
|
21
|
+
return this.a || this.isDisabledExternally();
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Will be used as 'or' check to the current disabled state.
|
|
@@ -28,26 +28,26 @@ const y = (a) => {
|
|
|
28
28
|
return !1;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return x([
|
|
32
32
|
l({ reflect: !0, type: Boolean })
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
class
|
|
33
|
+
], s.prototype, "disabled"), s;
|
|
34
|
+
}, z = (a) => {
|
|
35
|
+
class s extends C(a) {
|
|
36
36
|
willUpdate(t) {
|
|
37
37
|
super.willUpdate(t), t.has("disabled") && (this.disabled ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0")));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return s;
|
|
41
41
|
};
|
|
42
|
-
var
|
|
43
|
-
for (var e = t > 1 ? void 0 : t ?
|
|
44
|
-
(n = a[i]) && (e = (t ? n(
|
|
45
|
-
return t && e &&
|
|
42
|
+
var w = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, h = (a, s, r, t) => {
|
|
43
|
+
for (var e = t > 1 ? void 0 : t ? $(s, r) : s, i = a.length - 1, n; i >= 0; i--)
|
|
44
|
+
(n = a[i]) && (e = (t ? n(s, r, e) : n(e)) || e);
|
|
45
|
+
return t && e && w(s, r, e), e;
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
const
|
|
47
|
+
const A = (a) => {
|
|
48
|
+
const r = class r extends a {
|
|
49
49
|
constructor() {
|
|
50
|
-
super(...arguments), this.
|
|
50
|
+
super(...arguments), this.a = null, this.internals = this.attachInternals(), this.formDisabled = !1;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Returns the form owner of internals target element.
|
|
@@ -66,10 +66,10 @@ const $ = (a) => {
|
|
|
66
66
|
return this.localName;
|
|
67
67
|
}
|
|
68
68
|
set value(e) {
|
|
69
|
-
this.
|
|
69
|
+
this.a = e, this.updateFormValue();
|
|
70
70
|
}
|
|
71
71
|
get value() {
|
|
72
|
-
return this.
|
|
72
|
+
return this.a;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Returns the ValidityState object for internals target element.
|
|
@@ -133,31 +133,31 @@ const $ = (a) => {
|
|
|
133
133
|
this.internals.setFormValue(this.value);
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
let
|
|
138
|
-
return
|
|
136
|
+
r.formAssociated = !0;
|
|
137
|
+
let s = r;
|
|
138
|
+
return h([
|
|
139
139
|
l()
|
|
140
|
-
],
|
|
140
|
+
], s.prototype, "name", 1), h([
|
|
141
141
|
l()
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
],
|
|
142
|
+
], s.prototype, "value", 1), h([
|
|
143
|
+
g()
|
|
144
|
+
], s.prototype, "formDisabled", 2), s;
|
|
145
145
|
};
|
|
146
|
-
var
|
|
147
|
-
for (var e =
|
|
148
|
-
(n = a[i]) && (e = n(
|
|
149
|
-
return e &&
|
|
146
|
+
var k = Object.defineProperty, P = Object.getOwnPropertyDescriptor, O = (a, s, r, t) => {
|
|
147
|
+
for (var e = P(s, r), i = a.length - 1, n; i >= 0; i--)
|
|
148
|
+
(n = a[i]) && (e = n(s, r, e) || e);
|
|
149
|
+
return e && k(s, r, e), e;
|
|
150
150
|
};
|
|
151
|
-
const
|
|
152
|
-
class
|
|
151
|
+
const L = (a) => {
|
|
152
|
+
class s extends a {
|
|
153
153
|
constructor() {
|
|
154
|
-
super(...arguments), this.
|
|
154
|
+
super(...arguments), this.a = !1;
|
|
155
155
|
}
|
|
156
156
|
set required(t) {
|
|
157
|
-
this.
|
|
157
|
+
this.a = !!t;
|
|
158
158
|
}
|
|
159
159
|
get required() {
|
|
160
|
-
return this.
|
|
160
|
+
return this.a || this.isRequiredExternally();
|
|
161
161
|
}
|
|
162
162
|
async willUpdate(t) {
|
|
163
163
|
super.willUpdate(t), t.has("required") && (this.internals.ariaRequired = `${this.required}`);
|
|
@@ -170,40 +170,40 @@ const O = (a) => {
|
|
|
170
170
|
return !1;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return O([
|
|
174
174
|
l({ reflect: !0, type: Boolean })
|
|
175
|
-
],
|
|
175
|
+
], s.prototype, "required"), s;
|
|
176
176
|
};
|
|
177
|
-
var
|
|
178
|
-
for (var e = t > 1 ? void 0 : t ?
|
|
179
|
-
(n = a[i]) && (e = (t ? n(
|
|
180
|
-
return t && e &&
|
|
177
|
+
var D = Object.defineProperty, R = Object.getOwnPropertyDescriptor, f = (a, s, r, t) => {
|
|
178
|
+
for (var e = t > 1 ? void 0 : t ? R(s, r) : s, i = a.length - 1, n; i >= 0; i--)
|
|
179
|
+
(n = a[i]) && (e = (t ? n(s, r, e) : n(e)) || e);
|
|
180
|
+
return t && e && D(s, r, e), e;
|
|
181
181
|
};
|
|
182
|
-
const
|
|
183
|
-
let
|
|
182
|
+
const J = (a) => {
|
|
183
|
+
let s = class extends C(L(A(a))) {
|
|
184
184
|
constructor() {
|
|
185
|
-
super(), this.
|
|
186
|
-
|
|
187
|
-
}, this.
|
|
188
|
-
var
|
|
189
|
-
this.disabled || ((
|
|
185
|
+
super(), this.a = !1, this.c = !1, this.d = (r) => {
|
|
186
|
+
r.key === " " && this.b();
|
|
187
|
+
}, this.b = () => {
|
|
188
|
+
var r;
|
|
189
|
+
this.disabled || ((r = this.withUserInteraction) == null || r.call(this), this.checked = !this.checked, this.a = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })), this.dispatchEvent(new CustomEvent("didChange", { bubbles: !0 })));
|
|
190
190
|
}, this.internals.role = "checkbox";
|
|
191
191
|
}
|
|
192
|
-
set checked(
|
|
193
|
-
const t = typeof
|
|
194
|
-
t && (
|
|
192
|
+
set checked(r) {
|
|
193
|
+
const t = typeof r == "object" ? r.attribute : !1;
|
|
194
|
+
t && (r = r.value), this.hasUpdated && !t && (this.a = !0), this.c = !!r, this.updateFormValue();
|
|
195
195
|
}
|
|
196
196
|
get checked() {
|
|
197
|
-
return this.
|
|
197
|
+
return this.c;
|
|
198
198
|
}
|
|
199
199
|
connectedCallback() {
|
|
200
|
-
super.connectedCallback(), this.addEventListener("click", this.
|
|
200
|
+
super.connectedCallback(), this.addEventListener("click", this.b), this.addEventListener("keydown", b), this.addEventListener("keyup", this.d);
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
super.disconnectedCallback(), this.removeEventListener("click", this.
|
|
203
|
+
super.disconnectedCallback(), this.removeEventListener("click", this.b), this.removeEventListener("keydown", b), this.removeEventListener("keyup", this.d);
|
|
204
204
|
}
|
|
205
|
-
attributeChangedCallback(
|
|
206
|
-
(
|
|
205
|
+
attributeChangedCallback(r, t, e) {
|
|
206
|
+
(r !== "checked" || !this.a) && super.attributeChangedCallback(r, t, e);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Is called whenever the form is being reset.
|
|
@@ -211,7 +211,7 @@ const z = (a) => {
|
|
|
211
211
|
* @internal
|
|
212
212
|
*/
|
|
213
213
|
formResetCallback() {
|
|
214
|
-
this.checked = this.hasAttribute("checked"), this.
|
|
214
|
+
this.checked = this.hasAttribute("checked"), this.a = !1;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
217
|
* Called when the browser is trying to restore element’s state to state in which case
|
|
@@ -222,8 +222,8 @@ const z = (a) => {
|
|
|
222
222
|
*
|
|
223
223
|
* @internal
|
|
224
224
|
*/
|
|
225
|
-
formStateRestoreCallback(
|
|
226
|
-
|
|
225
|
+
formStateRestoreCallback(r, t) {
|
|
226
|
+
r && (this.checked = r === "true");
|
|
227
227
|
}
|
|
228
228
|
updateFormValue() {
|
|
229
229
|
this.checked ? this.internals.setFormValue(this.value, `${this.checked}`) : this.internals.setFormValue(null);
|
|
@@ -233,30 +233,30 @@ const z = (a) => {
|
|
|
233
233
|
l({
|
|
234
234
|
type: Boolean,
|
|
235
235
|
converter: {
|
|
236
|
-
...
|
|
236
|
+
...c,
|
|
237
237
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
238
|
-
fromAttribute: (
|
|
238
|
+
fromAttribute: (r, t) => {
|
|
239
239
|
var i, n;
|
|
240
|
-
return { value: (n = (i =
|
|
240
|
+
return { value: (n = (i = c).fromAttribute) == null ? void 0 : n.call(i, r, t), attribute: !0 };
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
})
|
|
244
|
-
],
|
|
245
|
-
|
|
244
|
+
], s.prototype, "checked", 1), s = f([
|
|
245
|
+
y({
|
|
246
246
|
tabindex: "0"
|
|
247
247
|
})
|
|
248
|
-
],
|
|
249
|
-
}, U = "litElementHydrateSupport",
|
|
250
|
-
class
|
|
248
|
+
], s), s;
|
|
249
|
+
}, U = "litElementHydrateSupport", N = d || globalThis.testGroup === "ssr-non-hydrated", M = (a) => {
|
|
250
|
+
class s extends a {
|
|
251
251
|
constructor() {
|
|
252
|
-
super(...arguments), this.
|
|
253
|
-
(t) => this.
|
|
254
|
-
), this.
|
|
255
|
-
if (!this.
|
|
252
|
+
super(...arguments), this.a = !1, this.d = new Promise(
|
|
253
|
+
(t) => this.b = t
|
|
254
|
+
), this.c = (t) => {
|
|
255
|
+
if (!this.a)
|
|
256
256
|
return;
|
|
257
257
|
t.stopImmediatePropagation();
|
|
258
258
|
const e = t.target;
|
|
259
|
-
this.hydrationComplete.then(() =>
|
|
259
|
+
this.hydrationComplete.then(() => S(t, e));
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
@@ -268,21 +268,21 @@ const z = (a) => {
|
|
|
268
268
|
* @internal
|
|
269
269
|
*/
|
|
270
270
|
get hydrationComplete() {
|
|
271
|
-
return this.
|
|
271
|
+
return this.d;
|
|
272
272
|
}
|
|
273
273
|
createRenderRoot() {
|
|
274
274
|
var t, e;
|
|
275
|
-
if (this.
|
|
276
|
-
this.
|
|
275
|
+
if (this.a = !!this.shadowRoot && U in globalThis && (d || !N), !this.a)
|
|
276
|
+
this.b(!1);
|
|
277
277
|
else {
|
|
278
278
|
const i = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("slot");
|
|
279
279
|
i != null && i.length && (i.forEach(
|
|
280
|
-
(n) => n.addEventListener("slotchange", this.
|
|
280
|
+
(n) => n.addEventListener("slotchange", this.c, {
|
|
281
281
|
capture: !0
|
|
282
282
|
})
|
|
283
283
|
), this.hydrationComplete.then(
|
|
284
284
|
() => i.forEach(
|
|
285
|
-
(n) => n.removeEventListener("slotchange", this.
|
|
285
|
+
(n) => n.removeEventListener("slotchange", this.c)
|
|
286
286
|
)
|
|
287
287
|
)), (e = this.recoverSsrState) == null || e.call(this);
|
|
288
288
|
}
|
|
@@ -290,10 +290,10 @@ const z = (a) => {
|
|
|
290
290
|
}
|
|
291
291
|
willUpdate(t) {
|
|
292
292
|
var e;
|
|
293
|
-
super.willUpdate(t),
|
|
293
|
+
super.willUpdate(t), d && ((e = this.recoverSsrState) == null || e.call(this));
|
|
294
294
|
}
|
|
295
295
|
update(t) {
|
|
296
|
-
super.update(t), this.
|
|
296
|
+
super.update(t), this.a && (this.a = !1, this.b(!0));
|
|
297
297
|
}
|
|
298
298
|
/** Reads and removes an attribute with the given name. Either returns the attributte value or null. */
|
|
299
299
|
getAndRemoveAttribute(t) {
|
|
@@ -301,17 +301,17 @@ const z = (a) => {
|
|
|
301
301
|
return this.removeAttribute(t), e;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
return
|
|
304
|
+
return s;
|
|
305
305
|
};
|
|
306
|
-
var
|
|
306
|
+
var V = Object.defineProperty, j = (a, s, r, t) => {
|
|
307
307
|
for (var e = void 0, i = a.length - 1, n; i >= 0; i--)
|
|
308
|
-
(n = a[i]) && (e = n(
|
|
309
|
-
return e &&
|
|
308
|
+
(n = a[i]) && (e = n(s, r, e) || e);
|
|
309
|
+
return e && V(s, r, e), e;
|
|
310
310
|
};
|
|
311
|
-
const m = "data-ssr-child-count", v = "li",
|
|
312
|
-
class
|
|
311
|
+
const m = "data-ssr-child-count", v = "li", K = (a) => {
|
|
312
|
+
class s extends M(a) {
|
|
313
313
|
constructor() {
|
|
314
|
-
super(...arguments), this.listChildren = [], this.
|
|
314
|
+
super(...arguments), this.listChildren = [], this.a = () => {
|
|
315
315
|
const t = Array.from(this.children ?? []).filter(
|
|
316
316
|
(e) => this.listChildLocalNames.includes(e.localName)
|
|
317
317
|
);
|
|
@@ -322,11 +322,11 @@ const m = "data-ssr-child-count", v = "li", J = (a) => {
|
|
|
322
322
|
}
|
|
323
323
|
connectedCallback() {
|
|
324
324
|
var t;
|
|
325
|
-
super.connectedCallback(), (t = this.shadowRoot) == null || t.addEventListener("slotchange", this.
|
|
325
|
+
super.connectedCallback(), (t = this.shadowRoot) == null || t.addEventListener("slotchange", this.a, { passive: !0 });
|
|
326
326
|
}
|
|
327
327
|
disconnectedCallback() {
|
|
328
328
|
var t;
|
|
329
|
-
super.disconnectedCallback(), (t = this.shadowRoot) == null || t.removeEventListener("slotchange", this.
|
|
329
|
+
super.disconnectedCallback(), (t = this.shadowRoot) == null || t.removeEventListener("slotchange", this.a);
|
|
330
330
|
}
|
|
331
331
|
/**
|
|
332
332
|
* Renders list and list slots for slotted children or an amount of list slots
|
|
@@ -341,15 +341,15 @@ const m = "data-ssr-child-count", v = "li", J = (a) => {
|
|
|
341
341
|
const e = this.listSlotNames();
|
|
342
342
|
return e.length >= 2 ? o`
|
|
343
343
|
<ul
|
|
344
|
-
class=${t.class || (this.localName ??
|
|
345
|
-
aria-label=${t.ariaLabel ||
|
|
346
|
-
aria-labelledby=${t.ariaLabelledby ||
|
|
344
|
+
class=${t.class || (this.localName ?? p(this))}
|
|
345
|
+
aria-label=${t.ariaLabel || u}
|
|
346
|
+
aria-labelledby=${t.ariaLabelledby || u}
|
|
347
347
|
>
|
|
348
348
|
${e.map((i) => o`<li><slot name=${i}></slot></li>`)}
|
|
349
349
|
</ul>
|
|
350
350
|
${this.renderHiddenSlot()}
|
|
351
351
|
` : e.length === 1 ? o`<sbb-screen-reader-only>${t.ariaLabel}</sbb-screen-reader-only>
|
|
352
|
-
<span class=${t.class || (this.localName ??
|
|
352
|
+
<span class=${t.class || (this.localName ?? p(this))}>
|
|
353
353
|
<span><slot name=${e[0]}></slot></span>
|
|
354
354
|
</span>
|
|
355
355
|
${this.renderHiddenSlot()} ` : this.renderHiddenSlot();
|
|
@@ -375,51 +375,51 @@ const m = "data-ssr-child-count", v = "li", J = (a) => {
|
|
|
375
375
|
return o`<span hidden><slot></slot></span>`;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
],
|
|
378
|
+
return j([
|
|
379
|
+
g()
|
|
380
|
+
], s.prototype, "listChildren"), s;
|
|
381
381
|
};
|
|
382
|
-
var
|
|
382
|
+
var q = Object.defineProperty, H = (a, s, r, t) => {
|
|
383
383
|
for (var e = void 0, i = a.length - 1, n; i >= 0; i--)
|
|
384
|
-
(n = a[i]) && (e = n(
|
|
385
|
-
return e &&
|
|
384
|
+
(n = a[i]) && (e = n(s, r, e) || e);
|
|
385
|
+
return e && q(s, r, e), e;
|
|
386
386
|
};
|
|
387
387
|
const Q = (a) => {
|
|
388
|
-
class
|
|
388
|
+
class s extends a {
|
|
389
389
|
constructor() {
|
|
390
390
|
super(...arguments), this.negative = !1;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return H([
|
|
394
394
|
l({ reflect: !0, type: Boolean })
|
|
395
|
-
],
|
|
395
|
+
], s.prototype, "negative"), s;
|
|
396
396
|
}, W = (a) => {
|
|
397
|
-
class
|
|
397
|
+
class s extends a {
|
|
398
398
|
constructor() {
|
|
399
|
-
super(...arguments), this.
|
|
399
|
+
super(...arguments), this.a = Promise.resolve(), this.b = () => {
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
startUpdate() {
|
|
403
|
-
this.
|
|
403
|
+
this.a = new Promise((t) => this.b = t);
|
|
404
404
|
}
|
|
405
405
|
completeUpdate() {
|
|
406
|
-
this.
|
|
406
|
+
this.b();
|
|
407
407
|
}
|
|
408
408
|
async getUpdateComplete() {
|
|
409
409
|
const t = await super.getUpdateComplete();
|
|
410
|
-
return await this.
|
|
410
|
+
return await this.a, t;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return s;
|
|
414
414
|
};
|
|
415
415
|
export {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
416
|
+
C as SbbDisabledMixin,
|
|
417
|
+
z as SbbDisabledTabIndexActionMixin,
|
|
418
|
+
J as SbbFormAssociatedCheckboxMixin,
|
|
419
|
+
A as SbbFormAssociatedMixin,
|
|
420
420
|
M as SbbHydrationMixin,
|
|
421
|
-
|
|
421
|
+
K as SbbNamedSlotListMixin,
|
|
422
422
|
Q as SbbNegativeMixin,
|
|
423
|
-
|
|
423
|
+
L as SbbRequiredMixin,
|
|
424
424
|
W as SbbUpdateSchedulerMixin
|
|
425
425
|
};
|
|
@@ -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;AAK1C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CASrD;
|
|
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;AAK1C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CASrD;AA4DD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAyB9D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAqB3C;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,2BAA2B;QACnC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5B,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KAC7B;CACF"}
|
package/core/overlay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { html as
|
|
1
|
+
import { html as E } from "lit";
|
|
2
2
|
const x = ":is(sbb-dialog, sbb-navigation, sbb-menu, sbb-overlay)[data-state='opened']";
|
|
3
|
-
function
|
|
4
|
-
return
|
|
3
|
+
function $() {
|
|
4
|
+
return E`
|
|
5
5
|
<div class="sbb-gap-fix-wrapper">
|
|
6
6
|
<div class="sbb-gap-fix-corner" id="left"></div>
|
|
7
7
|
</div>
|
|
@@ -10,41 +10,46 @@ function R() {
|
|
|
10
10
|
</div>
|
|
11
11
|
`;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const O = (t, e) => {
|
|
14
14
|
let n = t.parentElement;
|
|
15
|
-
const
|
|
16
|
-
for (; n && (
|
|
15
|
+
const i = [];
|
|
16
|
+
for (; n && (i.push(n), n !== e); )
|
|
17
17
|
n = n.parentElement;
|
|
18
|
-
return
|
|
18
|
+
return i;
|
|
19
|
+
}, w = (t) => {
|
|
20
|
+
t.setAttribute(
|
|
21
|
+
"data-sbb-inert",
|
|
22
|
+
`${+(t.getAttribute("data-sbb-inert") ?? void 0) + 1 || 0}`
|
|
23
|
+
);
|
|
19
24
|
}, W = (t) => {
|
|
20
|
-
t.inert || (t.inert = !0, t.matches(x) ?
|
|
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));
|
|
21
26
|
}, y = (t) => {
|
|
22
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"));
|
|
23
28
|
};
|
|
24
|
-
function
|
|
29
|
+
function C(t) {
|
|
25
30
|
y(t);
|
|
26
31
|
const e = t.closest("body > *");
|
|
27
32
|
Array.from(document.querySelectorAll("body > *")).filter(
|
|
28
|
-
(
|
|
29
|
-
).forEach((
|
|
30
|
-
let
|
|
31
|
-
const a =
|
|
32
|
-
for (const
|
|
33
|
-
|
|
34
|
-
Array.from(
|
|
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(
|
|
35
40
|
(c) => c !== t && !a.includes(c)
|
|
36
41
|
)
|
|
37
|
-
),
|
|
38
|
-
|
|
42
|
+
), o.matches(x) && w(o);
|
|
43
|
+
i.forEach((o) => W(o));
|
|
39
44
|
}
|
|
40
|
-
function
|
|
45
|
+
function z() {
|
|
41
46
|
const t = Array.from(
|
|
42
47
|
document.documentElement.querySelectorAll(x)
|
|
43
48
|
);
|
|
44
49
|
if (t.length) {
|
|
45
50
|
t.forEach((e) => {
|
|
46
51
|
const n = +e.getAttribute("data-sbb-inert") - 1;
|
|
47
|
-
e.setAttribute("data-sbb-inert", `${n}`), n && n < 0 && (y(e), Array.from(e.children).forEach((
|
|
52
|
+
e.setAttribute("data-sbb-inert", `${n}`), n && n < 0 && (y(e), Array.from(e.children).forEach((i) => y(i)));
|
|
48
53
|
});
|
|
49
54
|
return;
|
|
50
55
|
}
|
|
@@ -52,9 +57,9 @@ function C() {
|
|
|
52
57
|
(e) => y(e)
|
|
53
58
|
);
|
|
54
59
|
}
|
|
55
|
-
function
|
|
56
|
-
const e = window.getComputedStyle(t), n = e.display,
|
|
57
|
-
if (n !== "none" &&
|
|
60
|
+
function S(t) {
|
|
61
|
+
const e = window.getComputedStyle(t), n = e.display, i = parseInt(e.maxHeight, 10).toString();
|
|
62
|
+
if (n !== "none" && i !== "0")
|
|
58
63
|
return {
|
|
59
64
|
scrollHeight: t.scrollHeight,
|
|
60
65
|
clientHeight: t.clientHeight,
|
|
@@ -64,21 +69,21 @@ function O(t) {
|
|
|
64
69
|
offsetWidth: t.offsetWidth
|
|
65
70
|
};
|
|
66
71
|
t.style.position = "absolute", t.style.visibility = "hidden", t.style.display = "block";
|
|
67
|
-
const a = t.scrollHeight,
|
|
68
|
-
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: a, clientHeight:
|
|
72
|
+
const a = t.scrollHeight, o = t.clientHeight, c = t.offsetHeight, u = t.scrollWidth, r = t.clientWidth, s = t.offsetWidth;
|
|
73
|
+
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: a, clientHeight: o, offsetHeight: c, scrollWidth: u, clientWidth: r, offsetWidth: s };
|
|
69
74
|
}
|
|
70
|
-
function
|
|
75
|
+
function B(t, e) {
|
|
71
76
|
if (!t || !e)
|
|
72
77
|
return !1;
|
|
73
78
|
const n = t.getBoundingClientRect();
|
|
74
79
|
return n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
|
|
75
80
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
let l = f, p = m + r.height +
|
|
81
|
+
function P(t, e, n, i) {
|
|
82
|
+
const o = (i == null ? void 0 : i.verticalOffset) || 0, c = (i == null ? void 0 : i.horizontalOffset) || 0, u = (i == null ? void 0 : i.responsiveHeight) || !1, r = e.getBoundingClientRect(), s = S(t), f = r.left, m = r.top, g = document.documentElement.clientWidth - (f + r.width), h = m - o, A = document.documentElement.clientHeight - (m + r.height + o);
|
|
83
|
+
let l = f, p = m + r.height + o, b = s.offsetWidth - r.width;
|
|
79
84
|
const d = { horizontal: "start", vertical: "below" };
|
|
80
|
-
let H = `${A -
|
|
81
|
-
|
|
85
|
+
let H = `${A - o}px`;
|
|
86
|
+
i != null && i.centered && f - 16 + r.width / 2 > s.offsetWidth / 2 && g - 16 > b / 2 && (l -= b /= 2, d.horizontal = "center"), g < b && f > b && (l = l - b, d.horizontal = "end"), c && d.horizontal !== "center" && r.width / 2 < c && (l += c * (d.horizontal === "start" ? -1 : 1)), (f < b && g < b || document.documentElement.clientWidth < s.offsetWidth) && (l = document.documentElement.clientWidth / 2 - s.offsetWidth / 2), (A - o < s.scrollHeight && h - o > (u ? s.clientHeight : s.scrollHeight) || h > A && A - o < s.clientHeight && !u) && (p = h < s.scrollHeight ? p - r.height - h - o : m - s.clientHeight - o, H = `${h - o}px`, d.vertical = "above");
|
|
82
87
|
const v = n.getBoundingClientRect();
|
|
83
88
|
return v.left < 0 && (l -= v.left), v.top < 0 && (p -= v.top), {
|
|
84
89
|
top: p,
|
|
@@ -87,35 +92,35 @@ function S(t, e, n, o) {
|
|
|
87
92
|
alignment: d
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
|
-
function
|
|
95
|
+
function I(t, e, n, i, a) {
|
|
91
96
|
if (!t || !e)
|
|
92
97
|
return;
|
|
93
98
|
a.style.setProperty("--sbb-options-panel-width", `${e.offsetWidth}px`), a.style.setProperty("--sbb-options-panel-origin-height", `${e.offsetHeight}px`);
|
|
94
|
-
const
|
|
95
|
-
a.style.setProperty("--sbb-options-panel-position-x", `${
|
|
99
|
+
const o = P(n, e, i);
|
|
100
|
+
a.style.setProperty("--sbb-options-panel-position-x", `${o.left}px`), a.style.setProperty("--sbb-options-panel-position-y", `${o.top}px`), a.style.setProperty("--sbb-options-panel-max-height", o.maxHeight), a.setAttribute("data-options-panel-position", o.alignment.vertical), e.setAttribute("data-options-panel-position", o.alignment.vertical);
|
|
96
101
|
}
|
|
97
|
-
function
|
|
98
|
-
t && (t.setAttribute("aria-haspopup", e), t.setAttribute("aria-controls", n), t.setAttribute("aria-expanded", `${
|
|
102
|
+
function Y(t, e, n, i) {
|
|
103
|
+
t && (t.setAttribute("aria-haspopup", e), t.setAttribute("aria-controls", n), t.setAttribute("aria-expanded", `${i === "opening" || i === "opened"}`));
|
|
99
104
|
}
|
|
100
|
-
function
|
|
105
|
+
function M(t) {
|
|
101
106
|
t && (t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"));
|
|
102
107
|
}
|
|
103
|
-
function
|
|
108
|
+
function X(t, e, n) {
|
|
104
109
|
t && (t.setAttribute("autocomplete", "off"), t.setAttribute("role", "combobox"), t.setAttribute("aria-autocomplete", "list"), t.setAttribute("aria-haspopup", "listbox"), t.setAttribute("aria-controls", e), t.setAttribute("aria-owns", e), t.setAttribute("aria-expanded", `${n}`));
|
|
105
110
|
}
|
|
106
|
-
function
|
|
111
|
+
function q(t) {
|
|
107
112
|
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"));
|
|
108
113
|
}
|
|
109
114
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
C as applyInertMechanism,
|
|
116
|
+
P as getElementPosition,
|
|
117
|
+
S as getElementRectangle,
|
|
118
|
+
B as isEventOnElement,
|
|
119
|
+
$ as overlayGapFixCorners,
|
|
120
|
+
q as removeAriaComboBoxAttributes,
|
|
121
|
+
M as removeAriaOverlayTriggerAttributes,
|
|
122
|
+
z as removeInertMechanism,
|
|
123
|
+
X as setAriaComboBoxAttributes,
|
|
124
|
+
Y as setAriaOverlayTriggerAttributes,
|
|
125
|
+
I as setOverlayPosition
|
|
121
126
|
};
|
|
@@ -0,0 +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;AAEtD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GAAG,eAAe,EAC3C,qBAAqB,SAAW,GAC/B,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
package/core/testing.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from './testing/event-spy.js';
|
|
|
2
2
|
export * from './testing/mocha-extensions.js';
|
|
3
3
|
export * from './testing/scroll.js';
|
|
4
4
|
export * from './testing/wait-for-condition.js';
|
|
5
|
+
export * from './testing/wait-for-image-ready.js';
|
|
5
6
|
export * from './testing/wait-for-render.js';
|
|
6
7
|
//# sourceMappingURL=testing.d.ts.map
|
package/core/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/elements/core/testing.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/elements/core/testing.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC"}
|