@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.
Files changed (71) hide show
  1. package/accordion.js +54 -54
  2. package/action-group.js +3 -3
  3. package/alert/alert-group.js +22 -22
  4. package/alert/alert.js +22 -22
  5. package/autocomplete.js +126 -126
  6. package/breadcrumb/breadcrumb-group.js +60 -60
  7. package/breadcrumb/breadcrumb.js +17 -17
  8. package/calendar.js +423 -423
  9. package/card/card-badge.js +17 -17
  10. package/card/card.js +2 -2
  11. package/card/common.js +30 -30
  12. package/checkbox/checkbox-group.js +17 -17
  13. package/checkbox/checkbox.js +34 -34
  14. package/clock.js +83 -83
  15. package/container/sticky-bar.js +16 -16
  16. package/core/a11y.js +91 -91
  17. package/core/base-elements.js +86 -86
  18. package/core/controllers.js +40 -40
  19. package/core/datetime.js +32 -32
  20. package/core/dom.js +26 -26
  21. package/core/eventing.js +33 -33
  22. package/core/mixins.js +122 -122
  23. package/core/testing.js +29 -29
  24. package/datepicker/common.js +55 -55
  25. package/datepicker/datepicker-toggle.js +94 -94
  26. package/datepicker/datepicker.js +144 -144
  27. package/dialog/dialog-title.js +20 -20
  28. package/dialog/dialog.js +66 -66
  29. package/expansion-panel/expansion-panel-header.js +20 -20
  30. package/expansion-panel/expansion-panel.js +60 -60
  31. package/file-selector.js +91 -91
  32. package/form-field/form-field-clear.js +12 -12
  33. package/form-field/form-field.js +111 -111
  34. package/header/header.js +53 -53
  35. package/icon.js +107 -107
  36. package/image.js +87 -87
  37. package/journey-header.js +29 -29
  38. package/map-container.js +23 -23
  39. package/menu/menu.js +91 -91
  40. package/navigation/common.js +16 -16
  41. package/navigation/navigation-marker.js +34 -34
  42. package/navigation/navigation-section.js +83 -83
  43. package/navigation/navigation.js +87 -87
  44. package/notification.js +52 -52
  45. package/option/optgroup.js +45 -45
  46. package/option/option.js +108 -108
  47. package/overlay.js +5 -5
  48. package/package.json +1 -1
  49. package/popover/popover.js +110 -110
  50. package/radio-button/radio-button-group.js +93 -93
  51. package/radio-button/radio-button.js +84 -84
  52. package/select.js +178 -178
  53. package/selection-panel.js +44 -44
  54. package/slider.js +58 -58
  55. package/status.js +6 -6
  56. package/stepper/step-label.js +19 -19
  57. package/stepper/step.js +31 -31
  58. package/stepper/stepper.js +46 -46
  59. package/tabs/tab-group.js +67 -67
  60. package/tag/tag-group.js +8 -8
  61. package/tag/tag.js +27 -27
  62. package/teaser-paid.js +12 -12
  63. package/time-input.js +73 -73
  64. package/timetable-occupancy-icon.js +26 -26
  65. package/timetable-occupancy.js +9 -9
  66. package/toast.js +38 -38
  67. package/toggle/toggle-option.js +33 -33
  68. package/toggle/toggle.js +46 -46
  69. package/train/train-formation.js +36 -36
  70. package/train/train-wagon.js +30 -30
  71. package/train/train.js +13 -13
package/core/mixins.js CHANGED
@@ -1,24 +1,24 @@
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";
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 _ = 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;
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 C = (a) => {
13
- class s extends a {
12
+ const y = (a) => {
13
+ class r extends a {
14
14
  constructor() {
15
- super(...arguments), this.a = !1;
15
+ super(...arguments), this._disabled = !1;
16
16
  }
17
17
  set disabled(t) {
18
- this.a = !!t;
18
+ this._disabled = !!t;
19
19
  }
20
20
  get disabled() {
21
- return this.a || this.isDisabledExternally();
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 x([
31
+ return E([
32
32
  l({ reflect: !0, type: Boolean })
33
- ], s.prototype, "disabled"), s;
34
- }, z = (a) => {
35
- class s extends C(a) {
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 s;
40
+ return r;
41
41
  };
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;
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 A = (a) => {
48
- const r = class r extends a {
47
+ const $ = (a) => {
48
+ const s = class s extends a {
49
49
  constructor() {
50
- super(...arguments), this.a = null, this.internals = this.attachInternals(), this.formDisabled = !1;
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.a = e, this.updateFormValue();
69
+ this._value = e, this.updateFormValue();
70
70
  }
71
71
  get value() {
72
- return this.a;
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
- r.formAssociated = !0;
137
- let s = r;
138
- return h([
136
+ s.formAssociated = !0;
137
+ let r = s;
138
+ return d([
139
139
  l()
140
- ], s.prototype, "name", 1), h([
140
+ ], r.prototype, "name", 1), d([
141
141
  l()
142
- ], s.prototype, "value", 1), h([
143
- g()
144
- ], s.prototype, "formDisabled", 2), s;
142
+ ], r.prototype, "value", 1), d([
143
+ _()
144
+ ], r.prototype, "formDisabled", 2), r;
145
145
  };
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;
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 L = (a) => {
152
- class s extends a {
151
+ const O = (a) => {
152
+ class r extends a {
153
153
  constructor() {
154
- super(...arguments), this.a = !1;
154
+ super(...arguments), this._required = !1;
155
155
  }
156
156
  set required(t) {
157
- this.a = !!t;
157
+ this._required = !!t;
158
158
  }
159
159
  get required() {
160
- return this.a || this.isRequiredExternally();
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 O([
173
+ return P([
174
174
  l({ reflect: !0, type: Boolean })
175
- ], s.prototype, "required"), s;
175
+ ], r.prototype, "required"), r;
176
176
  };
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;
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 J = (a) => {
183
- let s = class extends C(L(A(a))) {
182
+ const z = (a) => {
183
+ let r = class extends y(O($(a))) {
184
184
  constructor() {
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 })));
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(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();
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.c;
197
+ return this._checked;
198
198
  }
199
199
  connectedCallback() {
200
- super.connectedCallback(), this.addEventListener("click", this.b), this.addEventListener("keydown", b), this.addEventListener("keyup", this.d);
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.b), this.removeEventListener("keydown", b), this.removeEventListener("keyup", this.d);
203
+ super.disconnectedCallback(), this.removeEventListener("click", this._handleUserInteraction), this.removeEventListener("keydown", p), this.removeEventListener("keyup", this._handleKeyboardInteraction);
204
204
  }
205
- attributeChangedCallback(r, t, e) {
206
- (r !== "checked" || !this.a) && super.attributeChangedCallback(r, t, e);
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.a = !1;
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(r, t) {
226
- r && (this.checked = r === "true");
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
- ...c,
236
+ ...u,
237
237
  // We need to pass information to the setter so that we know it was called by attribute change.
238
- fromAttribute: (r, t) => {
238
+ fromAttribute: (s, t) => {
239
239
  var i, n;
240
- return { value: (n = (i = c).fromAttribute) == null ? void 0 : n.call(i, r, t), attribute: !0 };
240
+ return { value: (n = (i = u).fromAttribute) == null ? void 0 : n.call(i, s, t), attribute: !0 };
241
241
  }
242
242
  }
243
243
  })
244
- ], s.prototype, "checked", 1), s = f([
245
- y({
244
+ ], r.prototype, "checked", 1), r = f([
245
+ g({
246
246
  tabindex: "0"
247
247
  })
248
- ], s), s;
249
- }, U = "litElementHydrateSupport", N = d || globalThis.testGroup === "ssr-non-hydrated", M = (a) => {
250
- class s extends a {
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.a = !1, this.d = new Promise(
253
- (t) => this.b = t
254
- ), this.c = (t) => {
255
- if (!this.a)
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(() => S(t, e));
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.d;
271
+ return this._hydrationComplete;
272
272
  }
273
273
  createRenderRoot() {
274
274
  var t, e;
275
- if (this.a = !!this.shadowRoot && U in globalThis && (d || !N), !this.a)
276
- this.b(!1);
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.c, {
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.c)
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), d && ((e = this.recoverSsrState) == null || e.call(this));
293
+ super.willUpdate(t), h && ((e = this.recoverSsrState) == null || e.call(this));
294
294
  }
295
295
  update(t) {
296
- super.update(t), this.a && (this.a = !1, this.b(!0));
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 s;
304
+ return r;
305
305
  };
306
- var V = Object.defineProperty, j = (a, s, r, t) => {
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(s, r, e) || e);
309
- return e && V(s, r, e), 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", K = (a) => {
312
- class s extends M(a) {
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.a = () => {
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.a, { passive: !0 });
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.a);
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 ?? p(this))}
345
- aria-label=${t.ariaLabel || u}
346
- aria-labelledby=${t.ariaLabelledby || u}
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 ?? p(this))}>
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 j([
379
- g()
380
- ], s.prototype, "listChildren"), s;
378
+ return H([
379
+ _()
380
+ ], r.prototype, "listChildren"), r;
381
381
  };
382
- var q = Object.defineProperty, H = (a, s, r, t) => {
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(s, r, e) || e);
385
- return e && q(s, r, e), 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 s extends a {
388
+ class r extends a {
389
389
  constructor() {
390
390
  super(...arguments), this.negative = !1;
391
391
  }
392
392
  }
393
- return H([
393
+ return N([
394
394
  l({ reflect: !0, type: Boolean })
395
- ], s.prototype, "negative"), s;
395
+ ], r.prototype, "negative"), r;
396
396
  }, W = (a) => {
397
- class s extends a {
397
+ class r extends a {
398
398
  constructor() {
399
- super(...arguments), this.a = Promise.resolve(), this.b = () => {
399
+ super(...arguments), this._updatePromise = Promise.resolve(), this._updateResolve = () => {
400
400
  };
401
401
  }
402
402
  startUpdate() {
403
- this.a = new Promise((t) => this.b = t);
403
+ this._updatePromise = new Promise((t) => this._updateResolve = t);
404
404
  }
405
405
  completeUpdate() {
406
- this.b();
406
+ this._updateResolve();
407
407
  }
408
408
  async getUpdateComplete() {
409
409
  const t = await super.getUpdateComplete();
410
- return await this.a, t;
410
+ return await this._updatePromise, t;
411
411
  }
412
412
  }
413
- return s;
413
+ return r;
414
414
  };
415
415
  export {
416
- C as SbbDisabledMixin,
417
- z as SbbDisabledTabIndexActionMixin,
418
- J as SbbFormAssociatedCheckboxMixin,
419
- A as SbbFormAssociatedMixin,
416
+ y as SbbDisabledMixin,
417
+ X as SbbDisabledTabIndexActionMixin,
418
+ z as SbbFormAssociatedCheckboxMixin,
419
+ $ as SbbFormAssociatedMixin,
420
420
  M as SbbHydrationMixin,
421
- K as SbbNamedSlotListMixin,
421
+ J as SbbNamedSlotListMixin,
422
422
  Q as SbbNegativeMixin,
423
- L as SbbRequiredMixin,
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(i, e = null) {
3
- this.e = i, this.a = e, this.b = 0, this.c = [], this.a || (this.a = document), this.d();
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.b;
6
+ return this._count;
7
7
  }
8
8
  get events() {
9
- return this.c;
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
- d() {
18
- var i;
19
- (i = this.a) == null || i.addEventListener(this.e, (e) => {
20
- this.c.push(e), this.b++;
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, i, e) => {
24
+ const m = (t, n, e) => {
25
25
  if (t)
26
- return Mocha.describe(i, e);
27
- }, h = (t, i, e) => {
26
+ return Mocha.describe(n, e);
27
+ }, h = (t, n, e) => {
28
28
  if (t)
29
- return Mocha.test(i, e);
29
+ return Mocha.test(n, e);
30
30
  };
31
- function d(t) {
31
+ function v(t) {
32
32
  window.scrollTo(t), document.dispatchEvent(new Event("scroll"));
33
33
  }
34
- async function g(t, i = 30, e = 2 * 1e3) {
35
- const n = /* @__PURE__ */ new Date();
34
+ async function d(t, n = 30, e = 2 * 1e3) {
35
+ const i = /* @__PURE__ */ new Date();
36
36
  let o = 0;
37
- function s() {
37
+ function r() {
38
38
  return o++, t();
39
39
  }
40
- for (; !await s() && n.getTime() + e >= (/* @__PURE__ */ new Date()).getTime(); )
41
- await new Promise((r) => setTimeout(r, i));
42
- return n.getTime() + e < (/* @__PURE__ */ new Date()).getTime() ? Promise.reject(
43
- `waitForCondition timeout: ${t.toString()}, attempts: ${o}, start: ${n.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`
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 w(t, i = 2 * 1e3) {
47
- t.complete || await new Promise((e, n) => {
48
- const o = setTimeout(() => n("image loading timeout"), i);
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), n("image error");
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 i = [t, ...t.querySelectorAll("*")].filter(a).map((e) => [
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(i);
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
- d as mockScrollTo,
68
+ v as mockScrollTo,
69
69
  h as testIf,
70
- g as waitForCondition,
71
- w as waitForImageReady,
70
+ d as waitForCondition,
71
+ g as waitForImageReady,
72
72
  l as waitForLitRender
73
73
  };