@sbb-esta/lyne-elements 0.52.1 → 0.52.2
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.js +60 -60
- 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 +86 -86
- package/core/controllers.js +40 -40
- package/core/datetime.js +32 -32
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/testing.js +29 -29
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- 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.js +87 -87
- 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.js +46 -46
- 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/train/train-formation.js +36 -36
- 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 _ } from "lit/decorators.js";
|
|
2
|
+
import { defaultConverter as u, isServer as h, html as o, nothing as c } from "lit";
|
|
3
|
+
import { hostAttributes as g } from "./decorators.js";
|
|
4
|
+
import { preventScrollOnSpacebarPress as p, forwardEventToHost as C } from "./eventing.js";
|
|
5
|
+
import { getLocalName as b } 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 S = Object.defineProperty, k = Object.getOwnPropertyDescriptor, E = (a, r, s, t) => {
|
|
8
|
+
for (var e = k(r, s), i = a.length - 1, n; i >= 0; i--)
|
|
9
|
+
(n = a[i]) && (e = n(r, s, e) || e);
|
|
10
|
+
return e && S(r, s, e), e;
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
class
|
|
12
|
+
const y = (a) => {
|
|
13
|
+
class r extends a {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.
|
|
15
|
+
super(...arguments), this._disabled = !1;
|
|
16
16
|
}
|
|
17
17
|
set disabled(t) {
|
|
18
|
-
this.
|
|
18
|
+
this._disabled = !!t;
|
|
19
19
|
}
|
|
20
20
|
get disabled() {
|
|
21
|
-
return this.
|
|
21
|
+
return this._disabled || this.isDisabledExternally();
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Will be used as 'or' check to the current disabled state.
|
|
@@ -28,26 +28,26 @@ const C = (a) => {
|
|
|
28
28
|
return !1;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return E([
|
|
32
32
|
l({ reflect: !0, type: Boolean })
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
class
|
|
33
|
+
], r.prototype, "disabled"), r;
|
|
34
|
+
}, X = (a) => {
|
|
35
|
+
class r extends y(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 r;
|
|
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 x = Object.defineProperty, w = Object.getOwnPropertyDescriptor, d = (a, r, s, t) => {
|
|
43
|
+
for (var e = t > 1 ? void 0 : t ? w(r, s) : r, i = a.length - 1, n; i >= 0; i--)
|
|
44
|
+
(n = a[i]) && (e = (t ? n(r, s, e) : n(e)) || e);
|
|
45
|
+
return t && e && x(r, s, e), e;
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
const
|
|
47
|
+
const $ = (a) => {
|
|
48
|
+
const s = class s extends a {
|
|
49
49
|
constructor() {
|
|
50
|
-
super(...arguments), this.
|
|
50
|
+
super(...arguments), this._value = 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 = (a) => {
|
|
|
66
66
|
return this.localName;
|
|
67
67
|
}
|
|
68
68
|
set value(e) {
|
|
69
|
-
this.
|
|
69
|
+
this._value = e, this.updateFormValue();
|
|
70
70
|
}
|
|
71
71
|
get value() {
|
|
72
|
-
return this.
|
|
72
|
+
return this._value;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Returns the ValidityState object for internals target element.
|
|
@@ -133,31 +133,31 @@ const A = (a) => {
|
|
|
133
133
|
this.internals.setFormValue(this.value);
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
let
|
|
138
|
-
return
|
|
136
|
+
s.formAssociated = !0;
|
|
137
|
+
let r = s;
|
|
138
|
+
return d([
|
|
139
139
|
l()
|
|
140
|
-
],
|
|
140
|
+
], r.prototype, "name", 1), d([
|
|
141
141
|
l()
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
],
|
|
142
|
+
], r.prototype, "value", 1), d([
|
|
143
|
+
_()
|
|
144
|
+
], r.prototype, "formDisabled", 2), r;
|
|
145
145
|
};
|
|
146
|
-
var
|
|
147
|
-
for (var e =
|
|
148
|
-
(n = a[i]) && (e = n(
|
|
149
|
-
return e &&
|
|
146
|
+
var R = Object.defineProperty, A = Object.getOwnPropertyDescriptor, P = (a, r, s, t) => {
|
|
147
|
+
for (var e = A(r, s), i = a.length - 1, n; i >= 0; i--)
|
|
148
|
+
(n = a[i]) && (e = n(r, s, e) || e);
|
|
149
|
+
return e && R(r, s, e), e;
|
|
150
150
|
};
|
|
151
|
-
const
|
|
152
|
-
class
|
|
151
|
+
const O = (a) => {
|
|
152
|
+
class r extends a {
|
|
153
153
|
constructor() {
|
|
154
|
-
super(...arguments), this.
|
|
154
|
+
super(...arguments), this._required = !1;
|
|
155
155
|
}
|
|
156
156
|
set required(t) {
|
|
157
|
-
this.
|
|
157
|
+
this._required = !!t;
|
|
158
158
|
}
|
|
159
159
|
get required() {
|
|
160
|
-
return this.
|
|
160
|
+
return this._required || 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 L = (a) => {
|
|
|
170
170
|
return !1;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return P([
|
|
174
174
|
l({ reflect: !0, type: Boolean })
|
|
175
|
-
],
|
|
175
|
+
], r.prototype, "required"), r;
|
|
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 q = Object.defineProperty, L = Object.getOwnPropertyDescriptor, f = (a, r, s, t) => {
|
|
178
|
+
for (var e = t > 1 ? void 0 : t ? L(r, s) : r, i = a.length - 1, n; i >= 0; i--)
|
|
179
|
+
(n = a[i]) && (e = (t ? n(r, s, e) : n(e)) || e);
|
|
180
|
+
return t && e && q(r, s, e), e;
|
|
181
181
|
};
|
|
182
|
-
const
|
|
183
|
-
let
|
|
182
|
+
const z = (a) => {
|
|
183
|
+
let r = class extends y(O($(a))) {
|
|
184
184
|
constructor() {
|
|
185
|
-
super(), this.
|
|
186
|
-
|
|
187
|
-
}, this.
|
|
188
|
-
var
|
|
189
|
-
this.disabled || ((
|
|
185
|
+
super(), this._attributeMutationBlocked = !1, this._checked = !1, this._handleKeyboardInteraction = (s) => {
|
|
186
|
+
s.key === " " && this._handleUserInteraction();
|
|
187
|
+
}, this._handleUserInteraction = () => {
|
|
188
|
+
var s;
|
|
189
|
+
this.disabled || ((s = this.withUserInteraction) == null || s.call(this), this.checked = !this.checked, this._attributeMutationBlocked = !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(s) {
|
|
193
|
+
const t = typeof s == "object" ? s.attribute : !1;
|
|
194
|
+
t && (s = s.value), this.hasUpdated && !t && (this._attributeMutationBlocked = !0), this._checked = !!s, this.updateFormValue();
|
|
195
195
|
}
|
|
196
196
|
get checked() {
|
|
197
|
-
return this.
|
|
197
|
+
return this._checked;
|
|
198
198
|
}
|
|
199
199
|
connectedCallback() {
|
|
200
|
-
super.connectedCallback(), this.addEventListener("click", this.
|
|
200
|
+
super.connectedCallback(), this.addEventListener("click", this._handleUserInteraction), this.addEventListener("keydown", p), this.addEventListener("keyup", this._handleKeyboardInteraction);
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
super.disconnectedCallback(), this.removeEventListener("click", this.
|
|
203
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleUserInteraction), this.removeEventListener("keydown", p), this.removeEventListener("keyup", this._handleKeyboardInteraction);
|
|
204
204
|
}
|
|
205
|
-
attributeChangedCallback(
|
|
206
|
-
(
|
|
205
|
+
attributeChangedCallback(s, t, e) {
|
|
206
|
+
(s !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(s, t, e);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Is called whenever the form is being reset.
|
|
@@ -211,7 +211,7 @@ const J = (a) => {
|
|
|
211
211
|
* @internal
|
|
212
212
|
*/
|
|
213
213
|
formResetCallback() {
|
|
214
|
-
this.checked = this.hasAttribute("checked"), this.
|
|
214
|
+
this.checked = this.hasAttribute("checked"), this._attributeMutationBlocked = !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 J = (a) => {
|
|
|
222
222
|
*
|
|
223
223
|
* @internal
|
|
224
224
|
*/
|
|
225
|
-
formStateRestoreCallback(
|
|
226
|
-
|
|
225
|
+
formStateRestoreCallback(s, t) {
|
|
226
|
+
s && (this.checked = s === "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 J = (a) => {
|
|
|
233
233
|
l({
|
|
234
234
|
type: Boolean,
|
|
235
235
|
converter: {
|
|
236
|
-
...
|
|
236
|
+
...u,
|
|
237
237
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
238
|
-
fromAttribute: (
|
|
238
|
+
fromAttribute: (s, t) => {
|
|
239
239
|
var i, n;
|
|
240
|
-
return { value: (n = (i =
|
|
240
|
+
return { value: (n = (i = u).fromAttribute) == null ? void 0 : n.call(i, s, t), attribute: !0 };
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
})
|
|
244
|
-
],
|
|
245
|
-
|
|
244
|
+
], r.prototype, "checked", 1), r = f([
|
|
245
|
+
g({
|
|
246
246
|
tabindex: "0"
|
|
247
247
|
})
|
|
248
|
-
],
|
|
249
|
-
}, U = "litElementHydrateSupport",
|
|
250
|
-
class
|
|
248
|
+
], r), r;
|
|
249
|
+
}, U = "litElementHydrateSupport", D = h || globalThis.testGroup === "ssr-non-hydrated", M = (a) => {
|
|
250
|
+
class r extends a {
|
|
251
251
|
constructor() {
|
|
252
|
-
super(...arguments), this.
|
|
253
|
-
(t) => this.
|
|
254
|
-
), this.
|
|
255
|
-
if (!this.
|
|
252
|
+
super(...arguments), this._hydrationRequired = !1, this._hydrationComplete = new Promise(
|
|
253
|
+
(t) => this._resolveHydration = t
|
|
254
|
+
), this._handleBeforeHydrationSlotchange = (t) => {
|
|
255
|
+
if (!this._hydrationRequired)
|
|
256
256
|
return;
|
|
257
257
|
t.stopImmediatePropagation();
|
|
258
258
|
const e = t.target;
|
|
259
|
-
this.hydrationComplete.then(() =>
|
|
259
|
+
this.hydrationComplete.then(() => C(t, e));
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
@@ -268,21 +268,21 @@ const J = (a) => {
|
|
|
268
268
|
* @internal
|
|
269
269
|
*/
|
|
270
270
|
get hydrationComplete() {
|
|
271
|
-
return this.
|
|
271
|
+
return this._hydrationComplete;
|
|
272
272
|
}
|
|
273
273
|
createRenderRoot() {
|
|
274
274
|
var t, e;
|
|
275
|
-
if (this.
|
|
276
|
-
this.
|
|
275
|
+
if (this._hydrationRequired = !!this.shadowRoot && U in globalThis && (h || !D), !this._hydrationRequired)
|
|
276
|
+
this._resolveHydration(!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._handleBeforeHydrationSlotchange, {
|
|
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._handleBeforeHydrationSlotchange)
|
|
286
286
|
)
|
|
287
287
|
)), (e = this.recoverSsrState) == null || e.call(this);
|
|
288
288
|
}
|
|
@@ -290,10 +290,10 @@ const J = (a) => {
|
|
|
290
290
|
}
|
|
291
291
|
willUpdate(t) {
|
|
292
292
|
var e;
|
|
293
|
-
super.willUpdate(t),
|
|
293
|
+
super.willUpdate(t), h && ((e = this.recoverSsrState) == null || e.call(this));
|
|
294
294
|
}
|
|
295
295
|
update(t) {
|
|
296
|
-
super.update(t), this.
|
|
296
|
+
super.update(t), this._hydrationRequired && (this._hydrationRequired = !1, this._resolveHydration(!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 J = (a) => {
|
|
|
301
301
|
return this.removeAttribute(t), e;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
return
|
|
304
|
+
return r;
|
|
305
305
|
};
|
|
306
|
-
var
|
|
306
|
+
var B = Object.defineProperty, H = (a, r, s, 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(r, s, e) || e);
|
|
309
|
+
return e && B(r, s, e), e;
|
|
310
310
|
};
|
|
311
|
-
const m = "data-ssr-child-count", v = "li",
|
|
312
|
-
class
|
|
311
|
+
const m = "data-ssr-child-count", v = "li", J = (a) => {
|
|
312
|
+
class r extends M(a) {
|
|
313
313
|
constructor() {
|
|
314
|
-
super(...arguments), this.listChildren = [], this.
|
|
314
|
+
super(...arguments), this.listChildren = [], this._handleSlotchange = () => {
|
|
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", K = (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._handleSlotchange, { 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._handleSlotchange);
|
|
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", K = (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 ?? b(this))}
|
|
345
|
+
aria-label=${t.ariaLabel || c}
|
|
346
|
+
aria-labelledby=${t.ariaLabelledby || c}
|
|
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 ?? b(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", K = (a) => {
|
|
|
375
375
|
return o`<span hidden><slot></slot></span>`;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
],
|
|
378
|
+
return H([
|
|
379
|
+
_()
|
|
380
|
+
], r.prototype, "listChildren"), r;
|
|
381
381
|
};
|
|
382
|
-
var
|
|
382
|
+
var I = Object.defineProperty, N = (a, r, s, 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(r, s, e) || e);
|
|
385
|
+
return e && I(r, s, e), e;
|
|
386
386
|
};
|
|
387
387
|
const Q = (a) => {
|
|
388
|
-
class
|
|
388
|
+
class r extends a {
|
|
389
389
|
constructor() {
|
|
390
390
|
super(...arguments), this.negative = !1;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return N([
|
|
394
394
|
l({ reflect: !0, type: Boolean })
|
|
395
|
-
],
|
|
395
|
+
], r.prototype, "negative"), r;
|
|
396
396
|
}, W = (a) => {
|
|
397
|
-
class
|
|
397
|
+
class r extends a {
|
|
398
398
|
constructor() {
|
|
399
|
-
super(...arguments), this.
|
|
399
|
+
super(...arguments), this._updatePromise = Promise.resolve(), this._updateResolve = () => {
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
startUpdate() {
|
|
403
|
-
this.
|
|
403
|
+
this._updatePromise = new Promise((t) => this._updateResolve = t);
|
|
404
404
|
}
|
|
405
405
|
completeUpdate() {
|
|
406
|
-
this.
|
|
406
|
+
this._updateResolve();
|
|
407
407
|
}
|
|
408
408
|
async getUpdateComplete() {
|
|
409
409
|
const t = await super.getUpdateComplete();
|
|
410
|
-
return await this.
|
|
410
|
+
return await this._updatePromise, t;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return r;
|
|
414
414
|
};
|
|
415
415
|
export {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
416
|
+
y as SbbDisabledMixin,
|
|
417
|
+
X as SbbDisabledTabIndexActionMixin,
|
|
418
|
+
z as SbbFormAssociatedCheckboxMixin,
|
|
419
|
+
$ as SbbFormAssociatedMixin,
|
|
420
420
|
M as SbbHydrationMixin,
|
|
421
|
-
|
|
421
|
+
J as SbbNamedSlotListMixin,
|
|
422
422
|
Q as SbbNegativeMixin,
|
|
423
|
-
|
|
423
|
+
O as SbbRequiredMixin,
|
|
424
424
|
W as SbbUpdateSchedulerMixin
|
|
425
425
|
};
|
package/core/testing.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
class u {
|
|
2
|
-
constructor(
|
|
3
|
-
this.
|
|
2
|
+
constructor(n, e = null) {
|
|
3
|
+
this._event = n, this._target = e, this._count = 0, this._events = [], this._target || (this._target = document), this._listenForEvent();
|
|
4
4
|
}
|
|
5
5
|
get count() {
|
|
6
|
-
return this.
|
|
6
|
+
return this._count;
|
|
7
7
|
}
|
|
8
8
|
get events() {
|
|
9
|
-
return this.
|
|
9
|
+
return this._events;
|
|
10
10
|
}
|
|
11
11
|
get firstEvent() {
|
|
12
12
|
return this.events.length ? this.events[0] : null;
|
|
@@ -14,60 +14,60 @@ class u {
|
|
|
14
14
|
get lastEvent() {
|
|
15
15
|
return this.events.length ? this.events[this.events.length - 1] : null;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
(
|
|
20
|
-
this.
|
|
17
|
+
_listenForEvent() {
|
|
18
|
+
var n;
|
|
19
|
+
(n = this._target) == null || n.addEventListener(this._event, (e) => {
|
|
20
|
+
this._events.push(e), this._count++;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const m = (t,
|
|
24
|
+
const m = (t, n, e) => {
|
|
25
25
|
if (t)
|
|
26
|
-
return Mocha.describe(
|
|
27
|
-
}, h = (t,
|
|
26
|
+
return Mocha.describe(n, e);
|
|
27
|
+
}, h = (t, n, e) => {
|
|
28
28
|
if (t)
|
|
29
|
-
return Mocha.test(
|
|
29
|
+
return Mocha.test(n, e);
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function v(t) {
|
|
32
32
|
window.scrollTo(t), document.dispatchEvent(new Event("scroll"));
|
|
33
33
|
}
|
|
34
|
-
async function
|
|
35
|
-
const
|
|
34
|
+
async function d(t, n = 30, e = 2 * 1e3) {
|
|
35
|
+
const i = /* @__PURE__ */ new Date();
|
|
36
36
|
let o = 0;
|
|
37
|
-
function
|
|
37
|
+
function r() {
|
|
38
38
|
return o++, t();
|
|
39
39
|
}
|
|
40
|
-
for (; !await
|
|
41
|
-
await new Promise((
|
|
42
|
-
return
|
|
43
|
-
`waitForCondition timeout: ${t.toString()}, attempts: ${o}, start: ${
|
|
40
|
+
for (; !await r() && i.getTime() + e >= (/* @__PURE__ */ new Date()).getTime(); )
|
|
41
|
+
await new Promise((s) => setTimeout(s, n));
|
|
42
|
+
return i.getTime() + e < (/* @__PURE__ */ new Date()).getTime() ? Promise.reject(
|
|
43
|
+
`waitForCondition timeout: ${t.toString()}, attempts: ${o}, start: ${i.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`
|
|
44
44
|
) : Promise.resolve(!0);
|
|
45
45
|
}
|
|
46
|
-
async function
|
|
47
|
-
t.complete || await new Promise((e,
|
|
48
|
-
const o = setTimeout(() =>
|
|
46
|
+
async function g(t, n = 2 * 1e3) {
|
|
47
|
+
t.complete || await new Promise((e, i) => {
|
|
48
|
+
const o = setTimeout(() => i("image loading timeout"), n);
|
|
49
49
|
t.addEventListener("load", () => {
|
|
50
50
|
clearTimeout(o), e();
|
|
51
51
|
}), t.addEventListener("error", () => {
|
|
52
|
-
clearTimeout(o),
|
|
52
|
+
clearTimeout(o), i("image error");
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
const a = (t) => !!t.updateComplete, c = Promise.resolve(), l = async (t) => {
|
|
57
|
-
const
|
|
57
|
+
const n = [t, ...t.querySelectorAll("*")].filter(a).map((e) => [
|
|
58
58
|
e.updateComplete,
|
|
59
59
|
e.hydrationComplete ?? c,
|
|
60
60
|
l(e.renderRoot)
|
|
61
61
|
]).flat(1 / 0);
|
|
62
|
-
await Promise.all(
|
|
62
|
+
await Promise.all(n);
|
|
63
63
|
};
|
|
64
64
|
export {
|
|
65
65
|
u as EventSpy,
|
|
66
66
|
m as describeIf,
|
|
67
67
|
a as isReactiveElement,
|
|
68
|
-
|
|
68
|
+
v as mockScrollTo,
|
|
69
69
|
h as testIf,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
d as waitForCondition,
|
|
71
|
+
g as waitForImageReady,
|
|
72
72
|
l as waitForLitRender
|
|
73
73
|
};
|