@sbb-esta/lyne-elements-experimental 4.0.2 → 4.0.4

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 (48) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +2 -0
  2. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  3. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +12 -15
  4. package/core/datetime/date-helper.js +3 -3
  5. package/custom-elements.json +143 -99
  6. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +2 -0
  7. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  8. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +12 -13
  9. package/development/core/datetime/date-helper.js +3 -3
  10. package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-B0dawX-5.js} +2 -2
  11. package/development/{format-BQfaa1ZT.js → format-BMkeaqaF.js} +3 -3
  12. package/development/{isValid-DvieCZVi.js → isValid-BYRch7pV.js} +2 -2
  13. package/development/journey-summary/journey-summary.component.js +2 -2
  14. package/development/pearl-chain/pearl-chain.component.js +2 -2
  15. package/development/pearl-chain-time/pearl-chain-time.component.js +1 -1
  16. package/development/seat-reservation/common/mapper/mapper.d.ts +2 -2
  17. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  18. package/development/seat-reservation/common/mapper/mapper.js +19 -6
  19. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  20. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  21. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +970 -1
  22. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  23. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +3 -1
  24. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  25. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +26 -24
  26. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -2
  27. package/development/timetable-row/timetable-row.component.js +1 -1
  28. package/development/{toDate-D_Vjps95.js → toDate-BWb6Z1JD.js} +2 -2
  29. package/{differenceInMinutes-CP_C5onR.js → differenceInMinutes-COvvdYsJ.js} +1 -1
  30. package/{format-lqeCzmzS.js → format-CmKROkbc.js} +2 -41
  31. package/{isValid-Ceq2O0NQ.js → isValid-m3_OsPaB.js} +1 -1
  32. package/journey-summary/journey-summary.component.js +2 -2
  33. package/package.json +3 -3
  34. package/pearl-chain/pearl-chain.component.js +2 -2
  35. package/pearl-chain-time/pearl-chain-time.component.js +1 -1
  36. package/seat-reservation/common/mapper/mapper.d.ts +2 -2
  37. package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  38. package/seat-reservation/common/mapper/mapper.js +41 -38
  39. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  40. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  41. package/seat-reservation/common/mapper/seat-reservation-sample-data.js +968 -1
  42. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  43. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +130 -130
  44. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  45. package/seat-reservation/seat-reservation/seat-reservation.component.js +88 -85
  46. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +1 -1
  47. package/timetable-row/timetable-row.component.js +1 -1
  48. package/{toDate-BCXKL_wM.js → toDate-Bw2KTWeq.js} +1 -1
@@ -7,6 +7,8 @@ import { SbbAutocompleteGridOptionElement } from '../autocomplete-grid-option.ts
7
7
  * @cssprop [--sbb-autocomplete-z-index=var(--sbb-overlay-default-z-index)] - To specify a custom stack order,
8
8
  * the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the
9
9
  * component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`.
10
+ * @cssprop [--sbb-options-panel-max-height] - Maximum height of the options panel.
11
+ * If the calculated remaining space is smaller, the value gets ignored.
10
12
  */
11
13
  export declare class SbbAutocompleteGridElement<T = string> extends SbbAutocompleteBaseElement<T> {
12
14
  static readonly role: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAUrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAUlF;;;;;;;GAOG;AACH,qBAEM,0BAA0B,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,0BAA0B,CAAC,CAAC,CAAC;IAChF,gBAAgC,IAAI,gBAAkC;IACtE,SAAS,CAAC,SAAS,SAAuC;IAC1D,SAAS,CAAC,SAAS,SAAU;IAC7B,OAAO,CAAC,kBAAkB,CAAK;IAE/B,SAAS,KAAK,OAAO,IAAI,gCAAgC,CAAC,CAAC,CAAC,EAAE,CAM7D;;IAOD,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B,SAAS,CAAC,8BAA8B,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IA0BpE;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAgBtD,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI;IA+B1D,OAAO,CAAC,+BAA+B;IAqCvC,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAapC,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;CAGhE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,uBAAuB,EAAE,0BAA0B,CAAC;KACrD;CACF"}
1
+ {"version":3,"file":"autocomplete-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAUrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAUlF;;;;;;;;;GASG;AACH,qBAEM,0BAA0B,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,0BAA0B,CAAC,CAAC,CAAC;IAChF,gBAAgC,IAAI,gBAAkC;IACtE,SAAS,CAAC,SAAS,SAAuC;IAC1D,SAAS,CAAC,SAAS,SAAU;IAC7B,OAAO,CAAC,kBAAkB,CAAK;IAE/B,SAAS,KAAK,OAAO,IAAI,gCAAgC,CAAC,CAAC,CAAC,EAAE,CAM7D;;IAOD,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B,SAAS,CAAC,8BAA8B,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAqBpE;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAmBtD,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI;IA+B1D,OAAO,CAAC,+BAA+B;IAqCvC,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAapC,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;CAGhE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,uBAAuB,EAAE,0BAA0B,CAAC;KACrD;CACF"}
@@ -1,13 +1,13 @@
1
1
  import { __esDecorate as v, __runInitializers as f } from "tslib";
2
2
  import { SbbAutocompleteBaseElement as g } from "@sbb-esta/lyne-elements/autocomplete.js";
3
- import { getNextElementIndex as b } from "@sbb-esta/lyne-elements/core/a11y.js";
3
+ import { getNextElementIndex as d } from "@sbb-esta/lyne-elements/core/a11y.js";
4
4
  import { isSafari as A } from "@sbb-esta/lyne-elements/core/dom.js";
5
5
  import { ɵstateController as a } from "@sbb-esta/lyne-elements/core/mixins.js";
6
6
  import { setAriaComboBoxAttributes as O } from "@sbb-esta/lyne-elements/core/overlay.js";
7
7
  import { customElement as x } from "lit/decorators.js";
8
- import { SbbAutocompleteGridOptionElement as d } from "../autocomplete-grid-option.js";
8
+ import { SbbAutocompleteGridOptionElement as m } from "../autocomplete-grid-option.js";
9
9
  let y = 0;
10
- const m = A;
10
+ const b = A;
11
11
  let N = (() => {
12
12
  var o;
13
13
  let p = [x("sbb-autocomplete-grid")], n, c = [], i, u = g;
@@ -22,11 +22,8 @@ let N = (() => {
22
22
  this.querySelectorAll?.("sbb-divider, sbb-autocomplete-grid-button, sbb-option-hint").forEach((t) => t.negative = this.negative), this.querySelectorAll?.("sbb-autocomplete-grid-row, sbb-autocomplete-grid-option, sbb-autocomplete-grid-optgroup").forEach((t) => a(t).toggle("negative", this.negative));
23
23
  }
24
24
  openedPanelKeyboardInteraction(t) {
25
- if (this.state === "opened")
25
+ if (this.isOpen)
26
26
  switch (t.key) {
27
- case "Tab":
28
- this.close();
29
- break;
30
27
  case "Enter":
31
28
  this.selectByKeyboard(t);
32
29
  break;
@@ -48,10 +45,10 @@ let N = (() => {
48
45
  * would always return a `SbbAutocompleteGridButtonElement`.
49
46
  */
50
47
  selectByKeyboard(t) {
51
- t.preventDefault(), this._activeColumnIndex !== 0 ? this.activeOption?.closest("sbb-autocomplete-grid-row")?.querySelectorAll("sbb-autocomplete-grid-button")[
48
+ this.activeOption && (t.preventDefault(), this._activeColumnIndex !== 0 ? this.activeOption.closest("sbb-autocomplete-grid-row")?.querySelectorAll("sbb-autocomplete-grid-button")[
52
49
  // We ignore the option in the selector. Therefore, we have to shift the activeColumnIndex by one.
53
50
  this._activeColumnIndex - 1
54
- ]?.click() : this.activeOption?.selectViaUserInteraction(!0);
51
+ ]?.click() : this.activeOption.selectViaUserInteraction(!0));
55
52
  }
56
53
  setNextActiveOption(t) {
57
54
  const e = this.options.filter((r) => !r.matches(":is(:state(disabled),[state--disabled])"));
@@ -59,7 +56,7 @@ let N = (() => {
59
56
  this.activeOption = null;
60
57
  return;
61
58
  }
62
- const l = this.activeOption ? e.indexOf(this.activeOption) : -1, s = b(t, l, e.length);
59
+ const l = this.activeOption ? e.indexOf(this.activeOption) : -1, s = d(t, l, e.length);
63
60
  this.activeOption = e[s], this.activeOption.setActive(!0), this.triggerElement?.setAttribute("aria-activedescendant", this.activeOption.id), this.activeOption.scrollIntoView({ block: "nearest" }), this.autoSelectActiveOption && this.onOptionArrowsSelected(this.activeOption);
64
61
  }
65
62
  _setNextHorizontalActiveElement(t) {
@@ -68,21 +65,21 @@ let N = (() => {
68
65
  const e = Array.from(this.activeOption?.closest("sbb-autocomplete-grid-row")?.querySelectorAll("sbb-autocomplete-grid-option, sbb-autocomplete-grid-button") ?? [])?.filter((h) => !h.matches(":is(:state(disabled),[state--disabled])"));
69
66
  if (!e.length)
70
67
  return;
71
- const l = b(t, this._activeColumnIndex, e.length), s = e[l];
72
- s instanceof d ? s.setActive(!0) : a(s).add("focus-visible");
68
+ const l = d(t, this._activeColumnIndex, e.length), s = e[l];
69
+ s instanceof m ? s.setActive(!0) : a(s).add("focus-visible");
73
70
  const r = e[this._activeColumnIndex];
74
- r instanceof d ? r.setActive(!1) : a(r).delete("focus-visible"), this.triggerElement?.setAttribute("aria-activedescendant", s.id), s.scrollIntoView({ block: "nearest" }), this._activeColumnIndex = l;
71
+ r instanceof m ? r.setActive(!1) : a(r).delete("focus-visible"), this.triggerElement?.setAttribute("aria-activedescendant", s.id), s.scrollIntoView({ block: "nearest" }), this._activeColumnIndex = l;
75
72
  }
76
73
  resetActiveElement() {
77
74
  this._activeColumnIndex !== 0 && this.activeOption?.closest("sbb-autocomplete-grid-row")?.querySelectorAll("sbb-autocomplete-grid-button").forEach((t) => a(t).delete("focus-visible")), this.activeOption?.setActive(!1), this.activeOption = null, this._activeColumnIndex = 0, this.triggerElement?.removeAttribute("aria-activedescendant");
78
75
  }
79
76
  setTriggerAttributes(t) {
80
- O(t, m ? this.id : this.overlayId, !1, "grid");
77
+ O(t, b ? this.id : this.overlayId, !1, "grid");
81
78
  }
82
79
  }, i = o, (() => {
83
80
  const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
84
81
  v(null, n = { value: i }, p, { kind: "class", name: i.name, metadata: t }, null, c), i = n.value, t && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
85
- })(), o.role = m ? "grid" : null, f(i, c), i;
82
+ })(), o.role = b ? "grid" : null, f(i, c), i;
86
83
  })();
87
84
  export {
88
85
  N as SbbAutocompleteGridElement
@@ -1,7 +1,7 @@
1
1
  import { i18nDurationDay as N, i18nDurationHour as h, i18nDurationMinute as T } from "@sbb-esta/lyne-elements/core/i18n.js";
2
- import { t as d, c as g, b as m, m as w } from "../../toDate-BCXKL_wM.js";
3
- import { n as I, d as y, i as U } from "../../isValid-Ceq2O0NQ.js";
4
- import { g as C, a as Y, d as F } from "../../differenceInMinutes-CP_C5onR.js";
2
+ import { t as d, c as g, b as m, m as w } from "../../toDate-Bw2KTWeq.js";
3
+ import { n as I, d as y, i as U } from "../../isValid-m3_OsPaB.js";
4
+ import { g as C, a as Y, d as F } from "../../differenceInMinutes-COvvdYsJ.js";
5
5
  function x(e, t, n) {
6
6
  const i = d(e, n?.in);
7
7
  return isNaN(t) ? g(e, NaN) : (t && i.setDate(i.getDate() + t), i);