@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
@@ -1,261 +1,261 @@
1
- import { css as m, LitElement as f, html as v } from "lit";
2
- import { property as l, state as w, customElement as g } from "lit/decorators.js";
3
- import { readConfig as y } from "../core/config.js";
4
- import { SbbConnectedAbortController as D, SbbLanguageController as C } from "../core/controllers.js";
5
- import { defaultDateAdapter as p } from "../core/datetime.js";
6
- import { findReferencedElement as x, findInput as u } from "../core/dom.js";
1
+ import { css as c, LitElement as b, html as f } from "lit";
2
+ import { property as u, state as E, customElement as g } from "lit/decorators.js";
3
+ import { readConfig as v } from "../core/config.js";
4
+ import { SbbConnectedAbortController as C, SbbLanguageController as w } from "../core/controllers.js";
5
+ import { defaultDateAdapter as m } from "../core/datetime.js";
6
+ import { findReferencedElement as D, findInput as h } from "../core/dom.js";
7
7
  import { EventEmitter as d } from "../core/eventing.js";
8
- import { i18nDatePickerPlaceholder as c, i18nDateChangedTo as E } from "../core/i18n.js";
9
- import { AgnosticMutationObserver as V } from "../core/observers.js";
10
- const k = m`:host{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
11
- var A = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (t, e, s, a) => {
12
- for (var i = a > 1 ? void 0 : a ? O(e, s) : e, r = t.length - 1, h; r >= 0; r--)
13
- (h = t[r]) && (i = (a ? h(e, s, i) : h(i)) || i);
14
- return a && i && A(e, s, i), i;
8
+ import { i18nDatePickerPlaceholder as p, i18nDateChangedTo as A } from "../core/i18n.js";
9
+ import { AgnosticMutationObserver as y } from "../core/observers.js";
10
+ const V = c`:host{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
11
+ var x = Object.defineProperty, P = Object.getOwnPropertyDescriptor, l = (t, e, n, a) => {
12
+ for (var i = a > 1 ? void 0 : a ? P(e, n) : e, s = t.length - 1, o; s >= 0; s--)
13
+ (o = t[s]) && (i = (a ? o(e, n, i) : o(i)) || i);
14
+ return a && i && x(e, n, i), i;
15
15
  };
16
16
  const U = /(^0?[1-9]?|[12]?[0-9]?|3?[01]?)[.,\\/\-\s](0?[1-9]?|1?[0-2]?)?[.,\\/\-\s](\d{1,4}$)?/;
17
- function S(t, e) {
18
- var s;
17
+ function N(t, e) {
18
+ var n;
19
19
  if (!e) {
20
- const a = (s = t.closest) == null ? void 0 : s.call(t, "sbb-form-field");
20
+ const a = (n = t.closest) == null ? void 0 : n.call(t, "sbb-form-field");
21
21
  return a == null ? void 0 : a.querySelector("sbb-datepicker");
22
22
  }
23
- return x(e);
23
+ return D(e);
24
24
  }
25
- function b(t, e, s, a) {
25
+ function _(t, e, n, a) {
26
26
  let i = a.addCalendarDays(t, e);
27
- if (s)
28
- for (; !s(i); )
27
+ if (n)
28
+ for (; !n(i); )
29
29
  i = a.addCalendarDays(i, e);
30
30
  return i;
31
31
  }
32
- function $(t, e, s, a) {
33
- const i = b(t, -1, e, s), r = s.deserialize(a);
34
- return !r || s.isValid(r) && s.compareDate(i, r) >= 0 ? i : t;
32
+ function $(t, e, n, a) {
33
+ const i = _(t, -1, e, n), s = n.deserialize(a);
34
+ return !s || n.isValid(s) && n.compareDate(i, s) >= 0 ? i : t;
35
35
  }
36
- function q(t, e, s, a) {
37
- const i = b(t, 1, e, s), r = s.deserialize(a);
38
- return !r || s.isValid(r) && s.compareDate(i, r) <= 0 ? i : t;
36
+ function H(t, e, n, a) {
37
+ const i = _(t, 1, e, n), s = n.deserialize(a);
38
+ return !s || n.isValid(s) && n.compareDate(i, s) <= 0 ? i : t;
39
39
  }
40
- function F(t, e, s, a) {
41
- const i = p, r = i.deserialize(s), h = i.deserialize(a);
42
- return i.isValid(r) && i.compareDate(t, r) < 0 || i.isValid(h) && i.compareDate(t, h) > 0 ? !1 : e ? e(t) : !0;
40
+ function k(t, e, n, a) {
41
+ const i = m, s = i.deserialize(n), o = i.deserialize(a);
42
+ return i.isValid(s) && i.compareDate(t, s) < 0 || i.isValid(o) && i.compareDate(t, o) > 0 ? !1 : e ? e(t) : !0;
43
43
  }
44
- const L = () => new CustomEvent("datepickerControlRegistered", {
44
+ const j = () => new CustomEvent("datepickerControlRegistered", {
45
45
  bubbles: !1,
46
46
  composed: !0
47
47
  });
48
- let n = class extends f {
48
+ let r = class extends b {
49
49
  constructor() {
50
50
  var t;
51
- super(...arguments), this.wide = !1, this.dateFilter = () => !0, this.g = null, this.p = new d(this, n.events.didChange, {
51
+ super(...arguments), this.wide = !1, this.dateFilter = () => !0, this._now = null, this._didChange = new d(this, r.events.didChange, {
52
52
  bubbles: !0,
53
53
  cancelable: !0
54
- }), this.q = new d(this, n.events.change, {
54
+ }), this._change = new d(this, r.events.change, {
55
55
  bubbles: !0
56
- }), this.j = new d(
56
+ }), this._inputUpdated = new d(
57
57
  this,
58
- n.events.inputUpdated,
58
+ r.events.inputUpdated,
59
59
  { bubbles: !0, cancelable: !0 }
60
- ), this.r = new d(
60
+ ), this._datePickerUpdated = new d(
61
61
  this,
62
- n.events.datePickerUpdated,
62
+ r.events.datePickerUpdated,
63
63
  {
64
64
  bubbles: !0,
65
65
  cancelable: !0
66
66
  }
67
- ), this.s = new d(
67
+ ), this._validationChange = new d(
68
68
  this,
69
- n.events.validationChange
70
- ), this.c = null, this.h = new V(this.l.bind(this)), this.b = ((t = y().datetime) == null ? void 0 : t.dateAdapter) ?? p, this.w = new D(this), this.e = new C(this).withHandler(() => {
71
- if (this.a) {
72
- this.a.placeholder = c[this.e.current];
69
+ r.events.validationChange
70
+ ), this._inputElementState = null, this._inputObserver = new y(this._onInputPropertiesChange.bind(this)), this._dateAdapter = ((t = v().datetime) == null ? void 0 : t.dateAdapter) ?? m, this._abort = new C(this), this._language = new w(this).withHandler(() => {
71
+ if (this._inputElement) {
72
+ this._inputElement.placeholder = p[this._language.current];
73
73
  const e = this.getValueAsDate();
74
- e && (this.a.value = this.f(e));
74
+ e && (this._inputElement.value = this._format(e));
75
75
  }
76
76
  });
77
77
  }
78
78
  set now(t) {
79
- this.g = this.b.getValidDateOrNull(this.b.deserialize(t));
79
+ this._now = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t));
80
80
  }
81
81
  get now() {
82
- return this.g ?? this.b.today();
82
+ return this._now ?? this._dateAdapter.today();
83
83
  }
84
- get a() {
85
- return this.c;
84
+ get _inputElement() {
85
+ return this._inputElementState;
86
86
  }
87
- set a(t) {
88
- const e = this.c;
89
- this.c = t, this.t(this.c, e);
87
+ set _inputElement(t) {
88
+ const e = this._inputElementState;
89
+ this._inputElementState = t, this._registerInputElement(this._inputElementState, e);
90
90
  }
91
- u(t, e) {
92
- t !== e && (this.a = u(this, this.input));
91
+ _findInput(t, e) {
92
+ t !== e && (this._inputElement = h(this, this.input));
93
93
  }
94
- t(t, e) {
95
- var s, a;
94
+ _registerInputElement(t, e) {
95
+ var n, a;
96
96
  if (t !== e) {
97
- if ((s = this.d) == null || s.abort(), this.d = new AbortController(), !this.a)
97
+ if ((n = this._datePickerController) == null || n.abort(), this._datePickerController = new AbortController(), !this._inputElement)
98
98
  return;
99
- (a = this.h) == null || a.disconnect(), this.h.observe(this.a, {
99
+ (a = this._inputObserver) == null || a.disconnect(), this._inputObserver.observe(this._inputElement, {
100
100
  attributeFilter: ["disabled", "readonly", "min", "max", "value"]
101
- }), this.a.type = "text", this.a.placeholder || (this.a.placeholder = c[this.e.current]), this.a.addEventListener(
101
+ }), this._inputElement.type = "text", this._inputElement.placeholder || (this._inputElement.placeholder = p[this._language.current]), this._inputElement.addEventListener(
102
102
  "change",
103
103
  (i) => {
104
- i instanceof CustomEvent || this.v(i);
104
+ i instanceof CustomEvent || this._valueChanged(i);
105
105
  },
106
106
  {
107
- signal: this.d.signal
107
+ signal: this._datePickerController.signal
108
108
  }
109
109
  );
110
110
  }
111
111
  }
112
112
  /** Gets the input value with the correct date format. */
113
113
  getValueAsDate() {
114
- if (this.a && this.a.value)
115
- return this.i(this.a.value);
114
+ if (this._inputElement && this._inputElement.value)
115
+ return this._parse(this._inputElement.value);
116
116
  }
117
117
  /** Set the input value to the correctly formatted value. */
118
118
  setValueAsDate(t) {
119
119
  const e = t instanceof Date ? t : new Date(t);
120
- this.a && (this.k(this.a.value, e), this.a.dispatchEvent(new Event("blur", { composed: !0 })));
120
+ this._inputElement && (this._formatAndUpdateValue(this._inputElement.value, e), this._inputElement.dispatchEvent(new Event("blur", { composed: !0 })));
121
121
  }
122
122
  /**
123
123
  * @internal
124
124
  * Whether a custom now is configured.
125
125
  */
126
126
  hasCustomNow() {
127
- return !!this.g;
127
+ return !!this._now;
128
128
  }
129
- l(t) {
130
- var e, s, a, i;
131
- this.j.emit({
132
- disabled: (e = this.a) == null ? void 0 : e.disabled,
133
- readonly: (s = this.a) == null ? void 0 : s.readOnly,
134
- min: (a = this.a) == null ? void 0 : a.min,
135
- max: (i = this.a) == null ? void 0 : i.max
136
- }), this.a && t && Array.from(t).some((r) => r.attributeName === "value") && (this.a.value = this.m(this.a.getAttribute("value")));
129
+ _onInputPropertiesChange(t) {
130
+ var e, n, a, i;
131
+ this._inputUpdated.emit({
132
+ disabled: (e = this._inputElement) == null ? void 0 : e.disabled,
133
+ readonly: (n = this._inputElement) == null ? void 0 : n.readOnly,
134
+ min: (a = this._inputElement) == null ? void 0 : a.min,
135
+ max: (i = this._inputElement) == null ? void 0 : i.max
136
+ }), this._inputElement && t && Array.from(t).some((s) => s.attributeName === "value") && (this._inputElement.value = this._getValidValue(this._inputElement.getAttribute("value")));
137
137
  }
138
138
  connectedCallback() {
139
139
  super.connectedCallback();
140
- const t = this.w.signal;
141
- this.addEventListener("datepickerControlRegistered", () => this.l(), {
140
+ const t = this._abort.signal;
141
+ this.addEventListener("datepickerControlRegistered", () => this._onInputPropertiesChange(), {
142
142
  signal: t
143
- }), this.a = u(this, this.input), this.a && (this.a.value = this.m(this.a.value), this.j.emit({
144
- disabled: this.a.disabled,
145
- readonly: this.a.readOnly,
146
- min: this.a.min,
147
- max: this.a.max
143
+ }), this._inputElement = h(this, this.input), this._inputElement && (this._inputElement.value = this._getValidValue(this._inputElement.value), this._inputUpdated.emit({
144
+ disabled: this._inputElement.disabled,
145
+ readonly: this._inputElement.readOnly,
146
+ min: this._inputElement.min,
147
+ max: this._inputElement.max
148
148
  }));
149
149
  }
150
150
  willUpdate(t) {
151
- super.willUpdate(t), t.has("input") && this.u(this.input, t.get("input")), (t.has("wide") || t.has("dateFilter") || t.has("now")) && this.r.emit();
151
+ super.willUpdate(t), t.has("input") && this._findInput(this.input, t.get("input")), (t.has("wide") || t.has("dateFilter") || t.has("now")) && this._datePickerUpdated.emit();
152
152
  }
153
153
  disconnectedCallback() {
154
154
  var t, e;
155
- super.disconnectedCallback(), (t = this.h) == null || t.disconnect(), (e = this.d) == null || e.abort();
155
+ super.disconnectedCallback(), (t = this._inputObserver) == null || t.disconnect(), (e = this._datePickerController) == null || e.abort();
156
156
  }
157
157
  firstUpdated(t) {
158
- super.firstUpdated(t), this.n(this.getValueAsDate());
158
+ super.firstUpdated(t), this._setAriaLiveMessage(this.getValueAsDate());
159
159
  }
160
- x(t) {
161
- const e = this.i(t);
162
- return this.b.isValid(e) ? this.f(e) : t;
160
+ _parseAndFormatValue(t) {
161
+ const e = this._parse(t);
162
+ return this._dateAdapter.isValid(e) ? this._format(e) : t;
163
163
  }
164
- o(t) {
164
+ _createAndComposeDate(t) {
165
165
  const e = new Date(t);
166
- return this.f(e);
166
+ return this._format(e);
167
167
  }
168
- v(t) {
168
+ _valueChanged(t) {
169
169
  const e = t.target.value;
170
- this.k(e, this.i(e));
170
+ this._formatAndUpdateValue(e, this._parse(e));
171
171
  }
172
172
  /** Applies the correct format to values and triggers event dispatch. */
173
- k(t, e) {
174
- var s, a;
175
- if (this.a) {
176
- this.a.value = this.b.isValid(e) ? this.f(e) : t;
177
- const i = !t || !!e && F(
173
+ _formatAndUpdateValue(t, e) {
174
+ var n, a;
175
+ if (this._inputElement) {
176
+ this._inputElement.value = this._dateAdapter.isValid(e) ? this._format(e) : t;
177
+ const i = !t || !!e && k(
178
178
  e,
179
179
  this.dateFilter,
180
- (s = this.a) == null ? void 0 : s.min,
181
- (a = this.a) == null ? void 0 : a.max
182
- ), r = !this.a.hasAttribute("data-sbb-invalid");
183
- this.a.toggleAttribute("data-sbb-invalid", !i), r !== i && this.s.emit({ valid: i }), this.y(e);
180
+ (n = this._inputElement) == null ? void 0 : n.min,
181
+ (a = this._inputElement) == null ? void 0 : a.max
182
+ ), s = !this._inputElement.hasAttribute("data-sbb-invalid");
183
+ this._inputElement.toggleAttribute("data-sbb-invalid", !i), s !== i && this._validationChange.emit({ valid: i }), this._emitChange(e);
184
184
  }
185
185
  }
186
186
  /** Emits the change event. */
187
- y(t) {
188
- this.n(t), this.q.emit(), this.p.emit(), this.a && (this.a.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })), this.a.dispatchEvent(
187
+ _emitChange(t) {
188
+ this._setAriaLiveMessage(t), this._change.emit(), this._didChange.emit(), this._inputElement && (this._inputElement.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })), this._inputElement.dispatchEvent(
189
189
  new CustomEvent("change", { bubbles: !0, composed: !0 })
190
190
  ));
191
191
  }
192
- m(t) {
192
+ _getValidValue(t) {
193
193
  if (!t)
194
194
  return "";
195
195
  const e = t.match(U);
196
- return (e == null ? void 0 : e.index) === 0 ? this.x(t) : Number.isInteger(+t) ? this.o(+t) : this.b.isValid(new Date(t)) ? this.o(t) : t;
196
+ return (e == null ? void 0 : e.index) === 0 ? this._parseAndFormatValue(t) : Number.isInteger(+t) ? this._createAndComposeDate(+t) : this._dateAdapter.isValid(new Date(t)) ? this._createAndComposeDate(t) : t;
197
197
  }
198
- i(t) {
199
- return this.dateParser ? this.dateParser(t) : this.b.parse(t, this.now);
198
+ _parse(t) {
199
+ return this.dateParser ? this.dateParser(t) : this._dateAdapter.parse(t, this.now);
200
200
  }
201
- f(t) {
202
- return this.format ? this.format(t) : this.b.format(t);
201
+ _format(t) {
202
+ return this.format ? this.format(t) : this._dateAdapter.format(t);
203
203
  }
204
- n(t) {
205
- var i, r;
206
- const e = new Intl.DateTimeFormat(`${this.e.current}-CH`, {
204
+ _setAriaLiveMessage(t) {
205
+ var i, s;
206
+ const e = new Intl.DateTimeFormat(`${this._language.current}-CH`, {
207
207
  weekday: "long"
208
- }), s = new Intl.DateTimeFormat("de-CH", {
208
+ }), n = new Intl.DateTimeFormat("de-CH", {
209
209
  day: "2-digit",
210
210
  month: "2-digit",
211
211
  year: "numeric"
212
- }), a = (r = (i = this.shadowRoot) == null ? void 0 : i.querySelector) == null ? void 0 : r.call(i, "#status-container");
213
- a && (a.innerText = t ? `${E[this.e.current]} ${e.format(
212
+ }), a = (s = (i = this.shadowRoot) == null ? void 0 : i.querySelector) == null ? void 0 : s.call(i, "#status-container");
213
+ a && (a.innerText = t ? `${A[this._language.current]} ${e.format(
214
214
  t
215
- )}, ${s.format(t)}` : "");
215
+ )}, ${n.format(t)}` : "");
216
216
  }
217
217
  render() {
218
- return v`<p id="status-container" role="status"></p>`;
218
+ return f`<p id="status-container" role="status"></p>`;
219
219
  }
220
220
  };
221
- n.styles = k;
222
- n.events = {
221
+ r.styles = V;
222
+ r.events = {
223
223
  didChange: "didChange",
224
224
  change: "change",
225
225
  inputUpdated: "inputUpdated",
226
226
  datePickerUpdated: "datePickerUpdated",
227
227
  validationChange: "validationChange"
228
228
  };
229
- o([
230
- l({ type: Boolean })
231
- ], n.prototype, "wide", 2);
232
- o([
233
- l({ attribute: "date-filter" })
234
- ], n.prototype, "dateFilter", 2);
235
- o([
236
- l({ attribute: "date-parser" })
237
- ], n.prototype, "dateParser", 2);
238
- o([
239
- l()
240
- ], n.prototype, "format", 2);
241
- o([
242
- l()
243
- ], n.prototype, "input", 2);
244
- o([
245
- l()
246
- ], n.prototype, "now", 1);
247
- o([
248
- w()
249
- ], n.prototype, "a", 1);
250
- n = o([
229
+ l([
230
+ u({ type: Boolean })
231
+ ], r.prototype, "wide", 2);
232
+ l([
233
+ u({ attribute: "date-filter" })
234
+ ], r.prototype, "dateFilter", 2);
235
+ l([
236
+ u({ attribute: "date-parser" })
237
+ ], r.prototype, "dateParser", 2);
238
+ l([
239
+ u()
240
+ ], r.prototype, "format", 2);
241
+ l([
242
+ u()
243
+ ], r.prototype, "input", 2);
244
+ l([
245
+ u()
246
+ ], r.prototype, "now", 1);
247
+ l([
248
+ E()
249
+ ], r.prototype, "_inputElement", 1);
250
+ r = l([
251
251
  g("sbb-datepicker")
252
- ], n);
252
+ ], r);
253
253
  export {
254
- n as SbbDatepickerElement,
255
- L as datepickerControlRegisteredEventFactory,
256
- q as findNextAvailableDate,
254
+ r as SbbDatepickerElement,
255
+ j as datepickerControlRegisteredEventFactory,
256
+ H as findNextAvailableDate,
257
257
  $ as findPreviousAvailableDate,
258
- b as getAvailableDate,
259
- S as getDatePicker,
260
- F as isDateAvailable
258
+ _ as getAvailableDate,
259
+ N as getDatePicker,
260
+ k as isDateAvailable
261
261
  };
@@ -1,7 +1,7 @@
1
1
  import { css as v, nothing as g } from "lit";
2
- import { property as r, customElement as p } from "lit/decorators.js";
3
- import { html as c, unsafeStatic as b } from "lit/static-html.js";
4
- import { SbbFocusVisibleWithinController as u } from "../core/a11y.js";
2
+ import { property as b, customElement as u } from "lit/decorators.js";
3
+ import { html as c, unsafeStatic as r } from "lit/static-html.js";
4
+ import { SbbFocusVisibleWithinController as p } from "../core/a11y.js";
5
5
  import { SbbLanguageController as f } from "../core/controllers.js";
6
6
  import { EventEmitter as m } from "../core/eventing.js";
7
7
  import { i18nCloseDialog as w, i18nGoBack as _ } from "../core/i18n.js";
@@ -16,44 +16,44 @@ var y = Object.defineProperty, B = Object.getOwnPropertyDescriptor, o = (e, s, i
16
16
  };
17
17
  let a = class extends h {
18
18
  constructor() {
19
- super(), this.backButton = !1, this.a = !1, this.c = new m(
19
+ super(), this.backButton = !1, this._hideOnScroll = !1, this._backClick = new m(
20
20
  this,
21
21
  a.events.backClick
22
- ), this.b = new f(this), this.level = "2", this.visualLevel = "3";
22
+ ), this._language = new f(this), this.level = "2", this.visualLevel = "3";
23
23
  }
24
24
  set hideOnScroll(e) {
25
- this.a = e === "" ? !0 : e;
25
+ this._hideOnScroll = e === "" ? !0 : e;
26
26
  }
27
27
  get hideOnScroll() {
28
- return this.a;
28
+ return this._hideOnScroll;
29
29
  }
30
30
  connectedCallback() {
31
- super.connectedCallback(), new u(this);
31
+ super.connectedCallback(), new p(this);
32
32
  }
33
33
  willUpdate(e) {
34
34
  super.willUpdate(e), (e.has("backButton") || e.has("accessibilityBackLabel")) && (this.backButton = !this.backButton && this.accessibilityBackLabel ? !0 : this.backButton);
35
35
  }
36
36
  render() {
37
37
  const e = this.negative ? "sbb-transparent-button" : "sbb-secondary-button", s = c`
38
- <${b(e)}
38
+ <${r(e)}
39
39
  class="sbb-dialog__close"
40
- aria-label=${this.accessibilityCloseLabel || w[this.b.current]}
40
+ aria-label=${this.accessibilityCloseLabel || w[this._language.current]}
41
41
  ?negative=${this.negative}
42
42
  size="m"
43
43
  type="button"
44
44
  icon-name="cross-small"
45
45
  sbb-dialog-close
46
- ></${b(e)}>
46
+ ></${r(e)}>
47
47
  `, i = c`
48
- <${b(e)}
48
+ <${r(e)}
49
49
  class="sbb-dialog__back"
50
- aria-label=${this.accessibilityBackLabel || _[this.b.current]}
50
+ aria-label=${this.accessibilityBackLabel || _[this._language.current]}
51
51
  ?negative=${this.negative}
52
52
  size="m"
53
53
  type="button"
54
54
  icon-name="chevron-small-left-small"
55
- @click=${() => this.c.emit()}
56
- ></${b(e)}>
55
+ @click=${() => this._backClick.emit()}
56
+ ></${r(e)}>
57
57
  `;
58
58
  return c`
59
59
  <div class="sbb-dialog__header">
@@ -67,19 +67,19 @@ a.events = {
67
67
  backClick: "requestBackAction"
68
68
  };
69
69
  o([
70
- r({ attribute: "back-button", type: Boolean })
70
+ b({ attribute: "back-button", type: Boolean })
71
71
  ], a.prototype, "backButton", 2);
72
72
  o([
73
- r({ attribute: "accessibility-close-label" })
73
+ b({ attribute: "accessibility-close-label" })
74
74
  ], a.prototype, "accessibilityCloseLabel", 2);
75
75
  o([
76
- r({ attribute: "accessibility-back-label" })
76
+ b({ attribute: "accessibility-back-label" })
77
77
  ], a.prototype, "accessibilityBackLabel", 2);
78
78
  o([
79
- r({ attribute: "hide-on-scroll" })
79
+ b({ attribute: "hide-on-scroll" })
80
80
  ], a.prototype, "hideOnScroll", 1);
81
81
  a = o([
82
- p("sbb-dialog-title")
82
+ u("sbb-dialog-title")
83
83
  ], a);
84
84
  export {
85
85
  a as SbbDialogTitleElement