@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.
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +2 -0
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +12 -15
- package/core/datetime/date-helper.js +3 -3
- package/custom-elements.json +143 -99
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +2 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +12 -13
- package/development/core/datetime/date-helper.js +3 -3
- package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-B0dawX-5.js} +2 -2
- package/development/{format-BQfaa1ZT.js → format-BMkeaqaF.js} +3 -3
- package/development/{isValid-DvieCZVi.js → isValid-BYRch7pV.js} +2 -2
- package/development/journey-summary/journey-summary.component.js +2 -2
- package/development/pearl-chain/pearl-chain.component.js +2 -2
- package/development/pearl-chain-time/pearl-chain-time.component.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.d.ts +2 -2
- package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +19 -6
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +970 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +3 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +26 -24
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -2
- package/development/timetable-row/timetable-row.component.js +1 -1
- package/development/{toDate-D_Vjps95.js → toDate-BWb6Z1JD.js} +2 -2
- package/{differenceInMinutes-CP_C5onR.js → differenceInMinutes-COvvdYsJ.js} +1 -1
- package/{format-lqeCzmzS.js → format-CmKROkbc.js} +2 -41
- package/{isValid-Ceq2O0NQ.js → isValid-m3_OsPaB.js} +1 -1
- package/journey-summary/journey-summary.component.js +2 -2
- package/package.json +3 -3
- package/pearl-chain/pearl-chain.component.js +2 -2
- package/pearl-chain-time/pearl-chain-time.component.js +1 -1
- package/seat-reservation/common/mapper/mapper.d.ts +2 -2
- package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/seat-reservation/common/mapper/mapper.js +41 -38
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
- package/seat-reservation/common/mapper/seat-reservation-sample-data.js +968 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +130 -130
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +88 -85
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +1 -1
- package/timetable-row/timetable-row.component.js +1 -1
- 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
|
|
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
|
|
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
|
|
8
|
+
import { SbbAutocompleteGridOptionElement as m } from "../autocomplete-grid-option.js";
|
|
9
9
|
let y = 0;
|
|
10
|
-
const
|
|
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.
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
72
|
-
s instanceof
|
|
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
|
|
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,
|
|
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 =
|
|
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-
|
|
3
|
-
import { n as I, d as y, i as U } from "../../isValid-
|
|
4
|
-
import { g as C, a as Y, d as F } from "../../differenceInMinutes-
|
|
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);
|