@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
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { sbbInputModalityDetector as
|
|
5
|
-
import { SbbLanguageController as
|
|
6
|
-
import { hostAttributes as
|
|
7
|
-
import { i18nShowCalendar as
|
|
8
|
-
import { SbbNegativeMixin as
|
|
9
|
-
import { getDatePicker as
|
|
1
|
+
import { css as c, LitElement as g, isServer as b, html as p, nothing as f } from "lit";
|
|
2
|
+
import { property as m, state as n, customElement as u } from "lit/decorators.js";
|
|
3
|
+
import { ref as d } from "lit/directives/ref.js";
|
|
4
|
+
import { sbbInputModalityDetector as v } from "../core/a11y.js";
|
|
5
|
+
import { SbbLanguageController as w } from "../core/controllers.js";
|
|
6
|
+
import { hostAttributes as y } from "../core/decorators.js";
|
|
7
|
+
import { i18nShowCalendar as k } from "../core/i18n.js";
|
|
8
|
+
import { SbbNegativeMixin as $, SbbHydrationMixin as x } from "../core/mixins.js";
|
|
9
|
+
import { getDatePicker as P, datepickerControlRegisteredEventFactory as C } from "./datepicker.js";
|
|
10
10
|
import "../calendar.js";
|
|
11
11
|
import "../popover.js";
|
|
12
|
-
const
|
|
13
|
-
var
|
|
14
|
-
for (var
|
|
15
|
-
(
|
|
16
|
-
return
|
|
12
|
+
const D = c`*,:before,:after{box-sizing:border-box}:host{--sbb-datepicker-control-radius: var(--sbb-border-radius-4x);--sbb-datepicker-control-color: var(--sbb-color-black);display:inline-flex}sbb-popover-trigger{--sbb-button-display: flex;color:var(--sbb-datepicker-control-color);height:unset}sbb-icon{color:var(--sbb-color-graphite)}`;
|
|
13
|
+
var E = Object.defineProperty, S = Object.getOwnPropertyDescriptor, h = (t, e, i, o) => {
|
|
14
|
+
for (var r = o > 1 ? void 0 : o ? S(e, i) : e, l = t.length - 1, s; l >= 0; l--)
|
|
15
|
+
(s = t[l]) && (r = (o ? s(e, i, r) : s(r)) || r);
|
|
16
|
+
return o && r && E(e, i, r), r;
|
|
17
17
|
};
|
|
18
|
-
let
|
|
18
|
+
let a = class extends $(x(g)) {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(), this.
|
|
20
|
+
super(), this.f = !1, this.g = null, this.h = null, this.i = !1, this.m = new w(this), b || this.hydrationComplete.then(() => this.i = !0);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Opens the calendar.
|
|
24
24
|
*/
|
|
25
25
|
open() {
|
|
26
|
-
this.
|
|
26
|
+
this.d || (this.d = this.shadowRoot.querySelector("sbb-popover-trigger")), this.d.click();
|
|
27
27
|
}
|
|
28
28
|
connectedCallback() {
|
|
29
|
-
var
|
|
30
|
-
super.connectedCallback(), this.datePicker || this.
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
var e, i;
|
|
30
|
+
super.connectedCallback(), this.datePicker || this.e();
|
|
31
|
+
const t = ((e = this.closest) == null ? void 0 : e.call(this, "sbb-form-field")) ?? ((i = this.closest) == null ? void 0 : i.call(this, "[data-form-field]"));
|
|
32
|
+
t && (this.negative = t.hasAttribute("negative"));
|
|
33
33
|
}
|
|
34
|
-
willUpdate(
|
|
35
|
-
super.willUpdate(
|
|
34
|
+
willUpdate(t) {
|
|
35
|
+
super.willUpdate(t), t.has("datePicker") && this.e(this.datePicker);
|
|
36
36
|
}
|
|
37
37
|
disconnectedCallback() {
|
|
38
|
-
var
|
|
39
|
-
super.disconnectedCallback(), (
|
|
38
|
+
var t;
|
|
39
|
+
super.disconnectedCallback(), (t = this.c) == null || t.abort();
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
if ((
|
|
41
|
+
e(t) {
|
|
42
|
+
var e, i, o, r, l;
|
|
43
|
+
if ((e = this.c) == null || e.abort(), this.c = new AbortController(), this.a = P(this, t), !this.a) {
|
|
44
44
|
(i = this.parentElement) == null || i.addEventListener(
|
|
45
45
|
"inputUpdated",
|
|
46
|
-
(
|
|
47
|
-
{ once: !0, signal: this.
|
|
46
|
+
(s) => this.e(s.target),
|
|
47
|
+
{ once: !0, signal: this.c.signal }
|
|
48
48
|
);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
(
|
|
51
|
+
(o = this.a) == null || o.addEventListener(
|
|
52
52
|
"inputUpdated",
|
|
53
|
-
(
|
|
54
|
-
this.
|
|
53
|
+
(s) => {
|
|
54
|
+
this.a = s.target, this.f = !!(s.detail.disabled || s.detail.readonly), this.g = s.detail.min, this.h = s.detail.max;
|
|
55
55
|
},
|
|
56
|
-
{ signal: this.
|
|
57
|
-
), (
|
|
56
|
+
{ signal: this.c.signal }
|
|
57
|
+
), (r = this.a) == null || r.addEventListener(
|
|
58
58
|
"change",
|
|
59
|
-
(
|
|
59
|
+
(s) => this.n(s),
|
|
60
60
|
{
|
|
61
|
-
signal: this.
|
|
61
|
+
signal: this.c.signal
|
|
62
62
|
}
|
|
63
|
-
), (l = this.
|
|
63
|
+
), (l = this.a) == null || l.addEventListener(
|
|
64
64
|
"datePickerUpdated",
|
|
65
|
-
(
|
|
66
|
-
{ signal: this.
|
|
67
|
-
), this.
|
|
65
|
+
(s) => this.k(this.b, s.target),
|
|
66
|
+
{ signal: this.c.signal }
|
|
67
|
+
), this.a.dispatchEvent(C());
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
!
|
|
69
|
+
k(t, e) {
|
|
70
|
+
!t || !e || (t.wide = e.wide, t.now = this.l(), t.dateFilter = e.dateFilter);
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
this.
|
|
72
|
+
n(t) {
|
|
73
|
+
this.a = t.target, this.b.selected = this.a.getValueAsDate();
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
this.
|
|
75
|
+
o(t) {
|
|
76
|
+
var e;
|
|
77
|
+
this.b && this.b === t || (this.b = t, !(!this.a || !this.a.getValueAsDate || !((e = this.b) != null && e.resetPosition)) && (this.b.selected = this.a.getValueAsDate(), this.k(this.b, this.a), this.b.resetPosition()));
|
|
78
78
|
}
|
|
79
|
-
updated(
|
|
80
|
-
super.updated(
|
|
79
|
+
updated(t) {
|
|
80
|
+
super.updated(t), this.j.trigger = this.d;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
return (
|
|
82
|
+
l() {
|
|
83
|
+
var t;
|
|
84
|
+
return (t = this.a) != null && t.hasCustomNow() ? this.a.now : void 0;
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
var
|
|
88
|
-
return
|
|
87
|
+
var t, e;
|
|
88
|
+
return p`
|
|
89
89
|
<sbb-popover-trigger
|
|
90
90
|
icon-name="calendar-small"
|
|
91
|
-
aria-label=${
|
|
92
|
-
?disabled=${!
|
|
91
|
+
aria-label=${k[this.m.current]}
|
|
92
|
+
?disabled=${!b && (!this.a || this.f)}
|
|
93
93
|
?negative=${this.negative}
|
|
94
94
|
data-icon-small
|
|
95
|
-
${
|
|
95
|
+
${d((i) => this.d = i)}
|
|
96
96
|
></sbb-popover-trigger>
|
|
97
97
|
<sbb-popover
|
|
98
|
-
@willOpen=${() => this.
|
|
98
|
+
@willOpen=${() => this.b.resetPosition()}
|
|
99
99
|
@didOpen=${() => {
|
|
100
|
-
|
|
100
|
+
v.mostRecentModality === "keyboard" && this.b.focus();
|
|
101
101
|
}}
|
|
102
|
-
.trigger=${this.
|
|
102
|
+
.trigger=${this.d}
|
|
103
103
|
hide-close-button
|
|
104
|
-
${
|
|
104
|
+
${d((i) => this.j = i)}
|
|
105
105
|
>
|
|
106
|
-
${this.
|
|
107
|
-
.min=${this.
|
|
108
|
-
.max=${this.
|
|
109
|
-
.now=${this.
|
|
110
|
-
?wide=${(
|
|
111
|
-
.dateFilter=${(
|
|
106
|
+
${this.i ? p`<sbb-calendar
|
|
107
|
+
.min=${this.g}
|
|
108
|
+
.max=${this.h}
|
|
109
|
+
.now=${this.l()}
|
|
110
|
+
?wide=${(t = this.a) == null ? void 0 : t.wide}
|
|
111
|
+
.dateFilter=${(e = this.a) == null ? void 0 : e.dateFilter}
|
|
112
112
|
@dateSelected=${(i) => {
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
this.
|
|
113
|
+
var r;
|
|
114
|
+
const o = new Date(i.detail);
|
|
115
|
+
this.b.selected = o, (r = this.a) == null || r.setValueAsDate(o);
|
|
116
116
|
}}
|
|
117
|
-
${
|
|
118
|
-
></sbb-calendar>` :
|
|
117
|
+
${d((i) => this.o(i))}
|
|
118
|
+
></sbb-calendar>` : f}
|
|
119
119
|
</sbb-popover>
|
|
120
120
|
`;
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
],
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
],
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
123
|
+
a.styles = D;
|
|
124
|
+
h([
|
|
125
|
+
m({ attribute: "date-picker" })
|
|
126
|
+
], a.prototype, "datePicker", 2);
|
|
127
|
+
h([
|
|
128
|
+
n()
|
|
129
|
+
], a.prototype, "f", 2);
|
|
130
|
+
h([
|
|
131
|
+
n()
|
|
132
|
+
], a.prototype, "g", 2);
|
|
133
|
+
h([
|
|
134
|
+
n()
|
|
135
|
+
], a.prototype, "h", 2);
|
|
136
|
+
h([
|
|
137
|
+
n()
|
|
138
|
+
], a.prototype, "i", 2);
|
|
139
|
+
a = h([
|
|
140
|
+
u("sbb-datepicker-toggle"),
|
|
141
|
+
y({
|
|
142
142
|
slot: "prefix"
|
|
143
143
|
})
|
|
144
|
-
],
|
|
144
|
+
], a);
|
|
145
145
|
export {
|
|
146
|
-
|
|
146
|
+
a as SbbDatepickerToggleElement
|
|
147
147
|
};
|