@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.
Files changed (220) 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/breadcrumb-group.d.ts.map +1 -1
  7. package/breadcrumb/breadcrumb-group.js +70 -69
  8. package/breadcrumb/breadcrumb.js +17 -17
  9. package/calendar.js +423 -423
  10. package/card/card-badge.js +17 -17
  11. package/card/card.js +2 -2
  12. package/card/common.js +30 -30
  13. package/checkbox/checkbox-group.js +17 -17
  14. package/checkbox/checkbox.js +34 -34
  15. package/clock.js +83 -83
  16. package/container/sticky-bar.js +16 -16
  17. package/core/a11y.js +91 -91
  18. package/core/base-elements.js +87 -88
  19. package/core/controllers.js +40 -40
  20. package/core/datetime.js +34 -36
  21. package/core/dom.js +26 -26
  22. package/core/eventing.js +33 -33
  23. package/core/mixins.js +122 -122
  24. package/core/overlay/overlay.d.ts.map +1 -1
  25. package/core/overlay.js +55 -50
  26. package/core/testing/event-spy.d.ts +1 -1
  27. package/core/testing/wait-for-image-ready.d.ts +4 -0
  28. package/core/testing/wait-for-image-ready.d.ts.map +1 -0
  29. package/core/testing.d.ts +1 -0
  30. package/core/testing.d.ts.map +1 -1
  31. package/core/testing.js +42 -31
  32. package/custom-elements.json +70 -4
  33. package/datepicker/common.js +55 -55
  34. package/datepicker/datepicker-toggle.js +94 -94
  35. package/datepicker/datepicker.js +144 -144
  36. package/development/accordion.js +2 -3
  37. package/development/action-group.js +2 -3
  38. package/development/alert/alert-group.js +2 -3
  39. package/development/alert/alert.js +2 -3
  40. package/development/autocomplete.js +2 -3
  41. package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
  42. package/development/breadcrumb/breadcrumb-group.js +5 -5
  43. package/development/breadcrumb/breadcrumb.js +2 -3
  44. package/development/button/button-link.js +2 -3
  45. package/development/button/button-static.js +2 -3
  46. package/development/button/button.js +2 -3
  47. package/development/button/common.js +2 -3
  48. package/development/button/mini-button.js +2 -3
  49. package/development/button/secondary-button-link.js +2 -3
  50. package/development/button/secondary-button-static.js +2 -3
  51. package/development/button/secondary-button.js +2 -3
  52. package/development/button/tertiary-button-link.js +2 -3
  53. package/development/button/tertiary-button-static.js +2 -3
  54. package/development/button/tertiary-button.js +2 -3
  55. package/development/button/transparent-button-link.js +2 -3
  56. package/development/button/transparent-button-static.js +2 -3
  57. package/development/button/transparent-button.js +2 -3
  58. package/development/calendar.js +2 -3
  59. package/development/card/card-badge.js +2 -3
  60. package/development/card/card-button.js +2 -3
  61. package/development/card/card-link.js +2 -3
  62. package/development/card/card.js +2 -3
  63. package/development/card/common.js +2 -3
  64. package/development/checkbox/checkbox-group.js +2 -3
  65. package/development/checkbox/checkbox.js +2 -3
  66. package/development/chip.js +2 -3
  67. package/development/clock.js +2 -3
  68. package/development/container/container.js +2 -3
  69. package/development/container/sticky-bar.js +2 -3
  70. package/development/core/base-elements.js +4 -7
  71. package/development/core/mixins.js +7 -13
  72. package/development/core/overlay/overlay.d.ts.map +1 -1
  73. package/development/core/overlay.js +9 -3
  74. package/development/core/testing/event-spy.d.ts +1 -1
  75. package/development/core/testing/wait-for-image-ready.d.ts +4 -0
  76. package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
  77. package/development/core/testing.d.ts +1 -0
  78. package/development/core/testing.d.ts.map +1 -1
  79. package/development/core/testing.js +17 -1
  80. package/development/datepicker/common.js +2 -3
  81. package/development/datepicker/datepicker-next-day.js +2 -3
  82. package/development/datepicker/datepicker-previous-day.js +2 -3
  83. package/development/datepicker/datepicker-toggle.js +2 -3
  84. package/development/datepicker/datepicker.js +2 -3
  85. package/development/dialog/dialog-actions.js +2 -3
  86. package/development/dialog/dialog-content.js +2 -3
  87. package/development/dialog/dialog-title.js +2 -3
  88. package/development/dialog/dialog.js +2 -3
  89. package/development/divider.js +2 -3
  90. package/development/expansion-panel/expansion-panel-content.js +2 -3
  91. package/development/expansion-panel/expansion-panel-header.js +2 -3
  92. package/development/expansion-panel/expansion-panel.js +2 -3
  93. package/development/file-selector.js +2 -3
  94. package/development/footer.js +2 -3
  95. package/development/form-error.js +2 -3
  96. package/development/form-field/form-field-clear.js +2 -3
  97. package/development/form-field/form-field.js +2 -3
  98. package/development/header/common.js +2 -3
  99. package/development/header/header-button.js +2 -3
  100. package/development/header/header-link.js +2 -3
  101. package/development/header/header.js +2 -3
  102. package/development/icon.js +4 -7
  103. package/development/image/image.d.ts +12 -3
  104. package/development/image/image.d.ts.map +1 -1
  105. package/development/image.js +41 -24
  106. package/development/journey-header.js +2 -3
  107. package/development/lead-container.js +2 -3
  108. package/development/link/block-link-button.js +2 -3
  109. package/development/link/block-link-static.js +2 -3
  110. package/development/link/block-link.js +2 -3
  111. package/development/link/common.js +3 -5
  112. package/development/link/link-button.js +2 -3
  113. package/development/link/link-static.js +2 -3
  114. package/development/link/link.js +2 -3
  115. package/development/link-list.js +2 -3
  116. package/development/loading-indicator.js +2 -3
  117. package/development/logo.js +2 -3
  118. package/development/map-container.js +2 -3
  119. package/development/menu/common.js +2 -3
  120. package/development/menu/menu-button.js +2 -3
  121. package/development/menu/menu-link.js +2 -3
  122. package/development/menu/menu.js +2 -3
  123. package/development/message.js +2 -3
  124. package/development/navigation/common.js +2 -3
  125. package/development/navigation/navigation-button.js +2 -3
  126. package/development/navigation/navigation-link.js +2 -3
  127. package/development/navigation/navigation-list.js +2 -3
  128. package/development/navigation/navigation-marker.js +2 -3
  129. package/development/navigation/navigation-section.js +2 -3
  130. package/development/navigation/navigation.js +2 -3
  131. package/development/notification.js +2 -3
  132. package/development/option/optgroup.js +2 -3
  133. package/development/option/option.js +2 -3
  134. package/development/overlay.js +3 -5
  135. package/development/popover/popover-trigger.js +2 -3
  136. package/development/popover/popover.js +2 -3
  137. package/development/radio-button/radio-button-group.js +2 -3
  138. package/development/radio-button/radio-button.js +2 -3
  139. package/development/screen-reader-only.js +2 -3
  140. package/development/select.js +2 -3
  141. package/development/selection-panel.js +2 -3
  142. package/development/signet.js +2 -3
  143. package/development/skiplink-list.js +2 -3
  144. package/development/slider.js +2 -3
  145. package/development/status.js +2 -3
  146. package/development/stepper/step-label.js +2 -3
  147. package/development/stepper/step.js +2 -3
  148. package/development/stepper/stepper/stepper.d.ts +1 -1
  149. package/development/stepper/stepper/stepper.d.ts.map +1 -1
  150. package/development/stepper/stepper.js +5 -6
  151. package/development/tabs/tab-group.js +2 -3
  152. package/development/tabs/tab-title.js +2 -3
  153. package/development/tag/tag-group.js +2 -3
  154. package/development/tag/tag.js +2 -3
  155. package/development/teaser-hero.js +2 -3
  156. package/development/teaser-paid.js +2 -3
  157. package/development/teaser.js +2 -3
  158. package/development/time-input.js +2 -3
  159. package/development/timetable-occupancy-icon.js +2 -3
  160. package/development/timetable-occupancy.js +2 -3
  161. package/development/title.js +3 -5
  162. package/development/toast.js +2 -3
  163. package/development/toggle/toggle-option.js +3 -5
  164. package/development/toggle/toggle.js +2 -3
  165. package/development/toggle-check.js +10 -3
  166. package/development/train/train-blocked-passage.js +2 -3
  167. package/development/train/train-formation.js +2 -3
  168. package/development/train/train-wagon.js +2 -3
  169. package/development/train/train.js +2 -3
  170. package/development/visual-checkbox.js +2 -3
  171. package/dialog/dialog-title.js +20 -20
  172. package/dialog/dialog.js +66 -66
  173. package/expansion-panel/expansion-panel-header.js +20 -20
  174. package/expansion-panel/expansion-panel.js +60 -60
  175. package/file-selector.js +91 -91
  176. package/form-field/form-field-clear.js +12 -12
  177. package/form-field/form-field.js +111 -111
  178. package/header/header.js +53 -53
  179. package/icon.js +107 -107
  180. package/image/image.d.ts +12 -3
  181. package/image/image.d.ts.map +1 -1
  182. package/image.js +118 -105
  183. package/journey-header.js +29 -29
  184. package/map-container.js +23 -23
  185. package/menu/menu.js +91 -91
  186. package/navigation/common.js +16 -16
  187. package/navigation/navigation-marker.js +34 -34
  188. package/navigation/navigation-section.js +83 -83
  189. package/navigation/navigation.js +87 -87
  190. package/notification.js +52 -52
  191. package/option/optgroup.js +45 -45
  192. package/option/option.js +108 -108
  193. package/overlay.js +5 -5
  194. package/package.json +1 -1
  195. package/popover/popover.js +110 -110
  196. package/radio-button/radio-button-group.js +93 -93
  197. package/radio-button/radio-button.js +84 -84
  198. package/select.js +178 -178
  199. package/selection-panel.js +44 -44
  200. package/slider.js +58 -58
  201. package/status.js +6 -6
  202. package/stepper/step-label.js +19 -19
  203. package/stepper/step.js +31 -31
  204. package/stepper/stepper/stepper.d.ts +1 -1
  205. package/stepper/stepper/stepper.d.ts.map +1 -1
  206. package/stepper/stepper.js +48 -48
  207. package/tabs/tab-group.js +67 -67
  208. package/tag/tag-group.js +8 -8
  209. package/tag/tag.js +27 -27
  210. package/teaser-paid.js +12 -12
  211. package/time-input.js +73 -73
  212. package/timetable-occupancy-icon.js +26 -26
  213. package/timetable-occupancy.js +9 -9
  214. package/toast.js +38 -38
  215. package/toggle/toggle-option.js +33 -33
  216. package/toggle/toggle.js +46 -46
  217. package/toggle-check.js +14 -14
  218. package/train/train-formation.js +36 -37
  219. package/train/train-wagon.js +30 -30
  220. package/train/train.js +13 -13
package/core/testing.js CHANGED
@@ -1,12 +1,12 @@
1
1
  class u {
2
- constructor(n, e = null) {
3
- this._event = n, this._target = e, this._count = 0, this._events = [], this._target || (this._target = document), this._listenForEvent();
2
+ constructor(i, e = null) {
3
+ this.e = i, this.a = e, this.b = 0, this.c = [], this.a || (this.a = document), this.d();
4
4
  }
5
5
  get count() {
6
- return this._count;
6
+ return this.b;
7
7
  }
8
8
  get events() {
9
- return this._events;
9
+ return this.c;
10
10
  }
11
11
  get firstEvent() {
12
12
  return this.events.length ? this.events[0] : null;
@@ -14,49 +14,60 @@ class u {
14
14
  get lastEvent() {
15
15
  return this.events.length ? this.events[this.events.length - 1] : null;
16
16
  }
17
- _listenForEvent() {
18
- var n;
19
- (n = this._target) == null || n.addEventListener(this._event, (e) => {
20
- this._events.push(e), this._count++;
17
+ d() {
18
+ var i;
19
+ (i = this.a) == null || i.addEventListener(this.e, (e) => {
20
+ this.c.push(e), this.b++;
21
21
  });
22
22
  }
23
23
  }
24
- const h = (t, n, e) => {
24
+ const m = (t, i, e) => {
25
25
  if (t)
26
- return Mocha.describe(n, e);
27
- }, m = (t, n, e) => {
26
+ return Mocha.describe(i, e);
27
+ }, h = (t, i, e) => {
28
28
  if (t)
29
- return Mocha.test(n, e);
29
+ return Mocha.test(i, e);
30
30
  };
31
- function v(t) {
31
+ function d(t) {
32
32
  window.scrollTo(t), document.dispatchEvent(new Event("scroll"));
33
33
  }
34
- async function g(t, n = 30, e = 2 * 1e3) {
35
- const s = /* @__PURE__ */ new Date();
36
- let i = 0;
37
- function r() {
38
- return i++, t();
34
+ async function g(t, i = 30, e = 2 * 1e3) {
35
+ const n = /* @__PURE__ */ new Date();
36
+ let o = 0;
37
+ function s() {
38
+ return o++, t();
39
39
  }
40
- for (; !await r() && s.getTime() + e >= (/* @__PURE__ */ new Date()).getTime(); )
41
- await new Promise((o) => setTimeout(o, n));
42
- return s.getTime() + e < (/* @__PURE__ */ new Date()).getTime() ? Promise.reject(
43
- `waitForCondition timeout: ${t.toString()}, attempts: ${i}, start: ${s.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`
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()}`
44
44
  ) : Promise.resolve(!0);
45
45
  }
46
- const a = (t) => !!t.updateComplete, l = Promise.resolve(), c = async (t) => {
47
- const n = [t, ...t.querySelectorAll("*")].filter(a).map((e) => [
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);
49
+ t.addEventListener("load", () => {
50
+ clearTimeout(o), e();
51
+ }), t.addEventListener("error", () => {
52
+ clearTimeout(o), n("image error");
53
+ });
54
+ });
55
+ }
56
+ const a = (t) => !!t.updateComplete, c = Promise.resolve(), l = async (t) => {
57
+ const i = [t, ...t.querySelectorAll("*")].filter(a).map((e) => [
48
58
  e.updateComplete,
49
- e.hydrationComplete ?? l,
50
- c(e.renderRoot)
59
+ e.hydrationComplete ?? c,
60
+ l(e.renderRoot)
51
61
  ]).flat(1 / 0);
52
- await Promise.all(n);
62
+ await Promise.all(i);
53
63
  };
54
64
  export {
55
65
  u as EventSpy,
56
- h as describeIf,
66
+ m as describeIf,
57
67
  a as isReactiveElement,
58
- v as mockScrollTo,
59
- m as testIf,
68
+ d as mockScrollTo,
69
+ h as testIf,
60
70
  g as waitForCondition,
61
- c as waitForLitRender
71
+ w as waitForImageReady,
72
+ l as waitForLitRender
62
73
  };
@@ -5059,6 +5059,17 @@
5059
5059
  }
5060
5060
  ],
5061
5061
  "members": [
5062
+ {
5063
+ "kind": "field",
5064
+ "name": "events",
5065
+ "privacy": "public",
5066
+ "static": true,
5067
+ "readonly": true,
5068
+ "default": "{ error: 'error', load: 'load', }",
5069
+ "type": {
5070
+ "text": "{\n error: 'error',\n load: 'load',\n }"
5071
+ }
5072
+ },
5062
5073
  {
5063
5074
  "kind": "field",
5064
5075
  "name": "_captionElement",
@@ -5267,6 +5278,16 @@
5267
5278
  "attribute": "aspect-ratio",
5268
5279
  "reflects": true
5269
5280
  },
5281
+ {
5282
+ "kind": "field",
5283
+ "name": "complete",
5284
+ "type": {
5285
+ "text": "boolean"
5286
+ },
5287
+ "privacy": "public",
5288
+ "description": "Whether the image is finished loading or failed to load.",
5289
+ "readonly": true
5290
+ },
5270
5291
  {
5271
5292
  "kind": "method",
5272
5293
  "name": "_logPerformanceMarks",
@@ -5366,6 +5387,22 @@
5366
5387
  }
5367
5388
  }
5368
5389
  ],
5390
+ "events": [
5391
+ {
5392
+ "name": "load",
5393
+ "type": {
5394
+ "text": "Event"
5395
+ },
5396
+ "description": "Emits when the image has been loaded."
5397
+ },
5398
+ {
5399
+ "name": "error",
5400
+ "type": {
5401
+ "text": "Event"
5402
+ },
5403
+ "description": "Emits when the image loading ended in an error."
5404
+ }
5405
+ ],
5369
5406
  "attributes": [
5370
5407
  {
5371
5408
  "name": "alt",
@@ -29897,7 +29934,7 @@
29897
29934
  "declarations": [
29898
29935
  {
29899
29936
  "kind": "class",
29900
- "description": "This class exists to facilitate the E2E test migration from stencil to lit.\nIt mimics the API that stencil provided to test events.\n\nTODO: Document me",
29937
+ "description": "This class exists to facilitate the test migration from stencil to lit.\nIt mimics the API that stencil provided to test events.\n\nTODO: Document me",
29901
29938
  "name": "EventSpy",
29902
29939
  "members": [
29903
29940
  {
@@ -30073,6 +30110,27 @@
30073
30110
  }
30074
30111
  ]
30075
30112
  },
30113
+ {
30114
+ "kind": "function",
30115
+ "name": "waitForImageReady",
30116
+ "return": {
30117
+ "type": {
30118
+ "text": "Promise<void>"
30119
+ }
30120
+ },
30121
+ "parameters": [
30122
+ {
30123
+ "name": "element",
30124
+ "type": {
30125
+ "text": "HTMLImageElement | SbbImageElement"
30126
+ }
30127
+ },
30128
+ {
30129
+ "name": "timeoutInMilliseconds",
30130
+ "default": "2 * 1000"
30131
+ }
30132
+ ]
30133
+ },
30076
30134
  {
30077
30135
  "kind": "function",
30078
30136
  "name": "isReactiveElement",
@@ -30153,6 +30211,14 @@
30153
30211
  "module": "core/testing.js"
30154
30212
  }
30155
30213
  },
30214
+ {
30215
+ "kind": "js",
30216
+ "name": "waitForImageReady",
30217
+ "declaration": {
30218
+ "name": "waitForImageReady",
30219
+ "module": "core/testing.js"
30220
+ }
30221
+ },
30156
30222
  {
30157
30223
  "kind": "js",
30158
30224
  "name": "isReactiveElement",
@@ -47749,11 +47815,11 @@
47749
47815
  {
47750
47816
  "kind": "field",
47751
47817
  "name": "horizontalFrom",
47818
+ "privacy": "public",
47819
+ "description": "Overrides the behaviour of `orientation` property.",
47752
47820
  "type": {
47753
47821
  "text": "SbbHorizontalFrom | undefined"
47754
47822
  },
47755
- "privacy": "public",
47756
- "description": "Overrides the behaviour of `orientation` property.",
47757
47823
  "attribute": "horizontal-from",
47758
47824
  "reflects": true
47759
47825
  },
@@ -48009,10 +48075,10 @@
48009
48075
  },
48010
48076
  {
48011
48077
  "name": "horizontal-from",
48078
+ "description": "Overrides the behaviour of `orientation` property.",
48012
48079
  "type": {
48013
48080
  "text": "SbbHorizontalFrom | undefined"
48014
48081
  },
48015
- "description": "Overrides the behaviour of `orientation` property.",
48016
48082
  "fieldName": "horizontalFrom"
48017
48083
  },
48018
48084
  {
@@ -1,122 +1,122 @@
1
- import { html as o } from "lit";
2
- import { property as h, state as b } from "lit/decorators.js";
3
- import { SbbButtonBaseElement as u } from "../core/base-elements.js";
4
- import { SbbConnectedAbortController as c, SbbLanguageController as _ } from "../core/controllers.js";
5
- import { defaultDateAdapter as m } from "../core/datetime.js";
6
- import { i18nToday as p } from "../core/i18n.js";
7
- import { SbbNegativeMixin as A } from "../core/mixins.js";
8
- import { getDatePicker as g, datepickerControlRegisteredEventFactory as f } from "./datepicker.js";
1
+ import { html as d } from "lit";
2
+ import { property as o, state as b } from "lit/decorators.js";
3
+ import { SbbButtonBaseElement as c } from "../core/base-elements.js";
4
+ import { SbbConnectedAbortController as u, SbbLanguageController as m } from "../core/controllers.js";
5
+ import { defaultDateAdapter as f } from "../core/datetime.js";
6
+ import { i18nToday as g } from "../core/i18n.js";
7
+ import { SbbNegativeMixin as p } from "../core/mixins.js";
8
+ import { getDatePicker as E, datepickerControlRegisteredEventFactory as D } from "./datepicker.js";
9
9
  import "../icon.js";
10
- var D = Object.defineProperty, l = (r, t, i, a) => {
11
- for (var e = void 0, s = r.length - 1, n; s >= 0; s--)
12
- (n = r[s]) && (e = n(t, i, e) || e);
13
- return e && D(t, i, e), e;
10
+ var A = Object.defineProperty, l = (r, t, i, s) => {
11
+ for (var e = void 0, a = r.length - 1, n; a >= 0; a--)
12
+ (n = r[a]) && (e = n(t, i, e) || e);
13
+ return e && A(t, i, e), e;
14
14
  };
15
- class d extends A(u) {
15
+ class h extends p(c) {
16
16
  constructor() {
17
- super(...arguments), this.boundary = null, this._disabled = !1, this._inputDisabled = !1, this.datePickerElement = null, this._dateAdapter = m, this._abort = new c(this), this._language = new _(this).withHandler(() => this._setAriaLabel());
17
+ super(...arguments), this.boundary = null, this.e = !1, this.f = !1, this.datePickerElement = null, this.b = f, this.i = new u(this), this.g = new m(this).withHandler(() => this.c());
18
18
  }
19
19
  connectedCallback() {
20
- super.connectedCallback(), this.addEventListener("click", () => this._handleClick(), { signal: this._abort.signal }), this._syncUpstreamProperties(), this.datePicker || this._init();
20
+ super.connectedCallback(), this.addEventListener("click", () => this.j(), { signal: this.i.signal }), this.k(), this.datePicker || this.h();
21
21
  }
22
22
  willUpdate(t) {
23
- super.willUpdate(t), t.has("datePicker") && this._init(this.datePicker);
23
+ super.willUpdate(t), t.has("datePicker") && this.h(this.datePicker);
24
24
  }
25
25
  disconnectedCallback() {
26
26
  var t;
27
- super.disconnectedCallback(), (t = this._datePickerController) == null || t.abort();
27
+ super.disconnectedCallback(), (t = this.a) == null || t.abort();
28
28
  }
29
29
  setDisabledState(t) {
30
30
  var e;
31
31
  const i = (e = t == null ? void 0 : t.getValueAsDate) == null ? void 0 : e.call(t);
32
32
  if (!i) {
33
- this._disabled = !0, this._setDisabledRenderAttributes(!0);
33
+ this.e = !0, this.d(!0);
34
34
  return;
35
35
  }
36
- const a = this.findAvailableDate(
36
+ const s = this.findAvailableDate(
37
37
  i,
38
38
  (t == null ? void 0 : t.dateFilter) || null,
39
- this._dateAdapter,
39
+ this.b,
40
40
  this.boundary
41
41
  );
42
- this._disabled = this._dateAdapter.compareDate(a, i) === 0, this._setDisabledRenderAttributes();
42
+ this.e = this.b.compareDate(s, i) === 0, this.d();
43
43
  }
44
- _handleClick() {
44
+ j() {
45
45
  if (!this.datePickerElement || this.hasAttribute("data-disabled"))
46
46
  return;
47
47
  const t = this.datePickerElement.getValueAsDate() ?? this.datePickerElement.now, i = this.findAvailableDate(
48
48
  t,
49
49
  this.datePickerElement.dateFilter,
50
- this._dateAdapter,
50
+ this.b,
51
51
  this.boundary
52
52
  );
53
- this._dateAdapter.compareDate(i, t) !== 0 && this.datePickerElement.setValueAsDate(i);
53
+ this.b.compareDate(i, t) !== 0 && this.datePickerElement.setValueAsDate(i);
54
54
  }
55
- _syncUpstreamProperties() {
56
- var i, a;
57
- const t = ((i = this.closest) == null ? void 0 : i.call(this, "sbb-form-field")) ?? ((a = this.closest) == null ? void 0 : a.call(this, "[data-form-field]"));
55
+ k() {
56
+ var i, s;
57
+ const t = ((i = this.closest) == null ? void 0 : i.call(this, "sbb-form-field")) ?? ((s = this.closest) == null ? void 0 : s.call(this, "[data-form-field]"));
58
58
  if (t) {
59
59
  this.negative = t.hasAttribute("negative");
60
60
  const e = t.querySelector("input");
61
- e && (this._inputDisabled = e.hasAttribute("disabled") || e.hasAttribute("readonly"), this._setDisabledRenderAttributes());
61
+ e && (this.f = e.hasAttribute("disabled") || e.hasAttribute("readonly"), this.d());
62
62
  }
63
63
  }
64
- _init(t) {
65
- var i, a;
66
- if ((i = this._datePickerController) == null || i.abort(), this._datePickerController = new AbortController(), this.datePickerElement = g(this, t), this.setDisabledState(this.datePickerElement), !this.datePickerElement) {
67
- (a = this.parentElement) == null || a.addEventListener(
64
+ h(t) {
65
+ var i, s;
66
+ if ((i = this.a) == null || i.abort(), this.a = new AbortController(), this.datePickerElement = E(this, t), this.setDisabledState(this.datePickerElement), !this.datePickerElement) {
67
+ (s = this.parentElement) == null || s.addEventListener(
68
68
  "inputUpdated",
69
- (e) => this._init(e.target),
70
- { once: !0, signal: this._datePickerController.signal }
69
+ (e) => this.h(e.target),
70
+ { once: !0, signal: this.a.signal }
71
71
  );
72
72
  return;
73
73
  }
74
- this._setAriaLabel(), this.datePickerElement.addEventListener(
74
+ this.c(), this.datePickerElement.addEventListener(
75
75
  "change",
76
76
  (e) => {
77
- this.setDisabledState(e.target), this._setAriaLabel();
77
+ this.setDisabledState(e.target), this.c();
78
78
  },
79
- { signal: this._datePickerController.signal }
79
+ { signal: this.a.signal }
80
80
  ), this.datePickerElement.addEventListener(
81
81
  "datePickerUpdated",
82
82
  (e) => {
83
- this.setDisabledState(e.target), this._setAriaLabel();
83
+ this.setDisabledState(e.target), this.c();
84
84
  },
85
- { signal: this._datePickerController.signal }
85
+ { signal: this.a.signal }
86
86
  ), this.datePickerElement.addEventListener(
87
87
  "inputUpdated",
88
88
  (e) => {
89
- this._inputDisabled = !!(e.detail.disabled || e.detail.readonly), this._setDisabledRenderAttributes(), this._setAriaLabel(), this.onInputUpdated(e);
89
+ this.f = !!(e.detail.disabled || e.detail.readonly), this.d(), this.c(), this.onInputUpdated(e);
90
90
  },
91
- { signal: this._datePickerController.signal }
92
- ), this.datePickerElement.dispatchEvent(f());
91
+ { signal: this.a.signal }
92
+ ), this.datePickerElement.dispatchEvent(D());
93
93
  }
94
- _setAriaLabel() {
95
- var a, e, s;
96
- const t = (e = (a = this.datePickerElement) == null ? void 0 : a.getValueAsDate) == null ? void 0 : e.call(a);
97
- if (!t || !this._dateAdapter.isValid(t)) {
98
- this.setAttribute("aria-label", this.i18nOffBoundaryDay[this._language.current]);
94
+ c() {
95
+ var s, e, a;
96
+ const t = (e = (s = this.datePickerElement) == null ? void 0 : s.getValueAsDate) == null ? void 0 : e.call(s);
97
+ if (!t || !this.b.isValid(t)) {
98
+ this.setAttribute("aria-label", this.i18nOffBoundaryDay[this.g.current]);
99
99
  return;
100
100
  }
101
- const i = ((s = this.datePickerElement) == null ? void 0 : s.now.toDateString()) === t.toDateString() ? p[this._language.current].toLowerCase() : this._dateAdapter.getAccessibilityFormatDate(t);
101
+ const i = ((a = this.datePickerElement) == null ? void 0 : a.now.toDateString()) === t.toDateString() ? g[this.g.current].toLowerCase() : this.b.getAccessibilityFormatDate(t);
102
102
  this.setAttribute(
103
103
  "aria-label",
104
- this.i18nSelectOffBoundaryDay(i)[this._language.current]
104
+ this.i18nSelectOffBoundaryDay(i)[this.g.current]
105
105
  );
106
106
  }
107
- _setDisabledRenderAttributes(t = this._disabled || this._inputDisabled) {
107
+ d(t = this.e || this.f) {
108
108
  this.toggleAttribute("data-disabled", t), t ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0"));
109
109
  }
110
110
  renderTemplate() {
111
- return o` <sbb-icon name=${this.iconName}></sbb-icon> `;
111
+ return d` <sbb-icon name=${this.iconName}></sbb-icon> `;
112
112
  }
113
113
  }
114
114
  l([
115
- h({ attribute: "date-picker" })
116
- ], d.prototype, "datePicker");
115
+ o({ attribute: "date-picker" })
116
+ ], h.prototype, "datePicker");
117
117
  l([
118
118
  b()
119
- ], d.prototype, "boundary");
119
+ ], h.prototype, "boundary");
120
120
  export {
121
- d as SbbDatepickerButton
121
+ h as SbbDatepickerButton
122
122
  };