@lmvz-ds/components 0.35.1 → 0.36.0

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 (232) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/assets/icons/calendar.svg +7 -0
  3. package/cjs/{aria-validation-controller-BC0Eaiv4.js → aria-validation-controller-Do0uEK4t.js} +1 -1
  4. package/cjs/{directional-focus-controller-DBat-oF7.js → directional-focus-controller-3uDoin45.js} +3 -1
  5. package/cjs/{element-activation-controller-BHqCUgQv.js → element-activation-controller-BWtUKzu2.js} +1 -1
  6. package/cjs/{element.util-CRS_YJ59.js → element.util-CctmBvUY.js} +14 -0
  7. package/cjs/{index-TGsVZNDP.js → index-BgvZ4y-3.js} +12 -0
  8. package/cjs/lmvz-action-list.cjs.entry.js +5 -5
  9. package/cjs/lmvz-action.cjs.entry.js +1 -1
  10. package/cjs/lmvz-button-group.cjs.entry.js +2 -2
  11. package/cjs/lmvz-button_2.cjs.entry.js +6 -6
  12. package/cjs/lmvz-card.cjs.entry.js +2 -2
  13. package/cjs/lmvz-checkbox.cjs.entry.js +2 -2
  14. package/cjs/lmvz-chip.cjs.entry.js +2 -2
  15. package/cjs/lmvz-components.cjs.js +2 -2
  16. package/cjs/lmvz-datepicker.cjs.entry.js +2764 -0
  17. package/cjs/lmvz-header_2.cjs.entry.js +6 -6
  18. package/cjs/{lmvz-popover.cjs.entry.js → lmvz-input_2.cjs.entry.js} +230 -11
  19. package/cjs/lmvz-link.cjs.entry.js +2 -2
  20. package/cjs/lmvz-menuitem.cjs.entry.js +5 -5
  21. package/cjs/lmvz-message.cjs.entry.js +2 -2
  22. package/cjs/lmvz-modal.cjs.entry.js +4 -4
  23. package/cjs/lmvz-radio.cjs.entry.js +3 -3
  24. package/cjs/lmvz-select.cjs.entry.js +3 -3
  25. package/cjs/lmvz-snackbar.cjs.entry.js +2 -2
  26. package/cjs/lmvz-spinner.cjs.entry.js +2 -2
  27. package/cjs/lmvz-tab.cjs.entry.js +2 -2
  28. package/cjs/lmvz-tabs.cjs.entry.js +4 -4
  29. package/cjs/lmvz-toggle.cjs.entry.js +4 -5
  30. package/cjs/loader.cjs.js +2 -2
  31. package/cjs/{async.util-Dnl6c82X.js → stencil.util-TjS8_DoU.js} +13 -1
  32. package/collection/assets/icons/calendar.svg +7 -0
  33. package/collection/collection-manifest.json +1 -0
  34. package/collection/components/lmvz-action-list/lmvz-action-list.css +1 -0
  35. package/collection/components/lmvz-button/lmvz-button.css +1 -0
  36. package/collection/components/lmvz-card/lmvz-card.css +1 -0
  37. package/collection/components/lmvz-datepicker/lmvz-datepicker.css +166 -0
  38. package/collection/components/lmvz-datepicker/lmvz-datepicker.js +988 -0
  39. package/collection/components/lmvz-datepicker/lmvz-datepicker.utils.js +189 -0
  40. package/collection/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.js +300 -0
  41. package/collection/components/lmvz-header/lmvz-header.js +1 -1
  42. package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
  43. package/collection/components/lmvz-input/lmvz-input.css +2 -1
  44. package/collection/components/lmvz-input/lmvz-input.js +40 -2
  45. package/collection/components/lmvz-link/lmvz-link.js +1 -1
  46. package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
  47. package/collection/components/lmvz-message/lmvz-message.js +1 -1
  48. package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
  49. package/collection/components/lmvz-popover/lmvz-popover.js +6 -2
  50. package/collection/components/lmvz-radio/lmvz-radio.js +1 -1
  51. package/collection/components/lmvz-select/lmvz-select.js +1 -1
  52. package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
  53. package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
  54. package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
  55. package/collection/components/lmvz-tabs/lmvz-tabs.js +1 -1
  56. package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
  57. package/collection/integration/header-integration/header-integration.js +1 -1
  58. package/collection/utils/aria/aria.constants.js +7 -0
  59. package/collection/utils/aria/directional-focus-controller.js +3 -1
  60. package/collection/utils/element/element.util.js +5 -0
  61. package/components/index.d.ts +2 -0
  62. package/components/index.d.ts.bak +2 -0
  63. package/components/index.js +1 -1
  64. package/components/lmvz-action-list.js +1 -1
  65. package/components/lmvz-action.js +1 -1
  66. package/components/lmvz-button-group.js +1 -1
  67. package/components/lmvz-button.js +1 -1
  68. package/components/lmvz-card.js +1 -1
  69. package/components/lmvz-checkbox.js +1 -1
  70. package/components/lmvz-chip.js +1 -1
  71. package/components/lmvz-datepicker.d.ts +11 -0
  72. package/components/lmvz-datepicker.d.ts.bak +11 -0
  73. package/components/lmvz-datepicker.js +1 -0
  74. package/components/lmvz-header.js +1 -1
  75. package/components/lmvz-icon.js +1 -1
  76. package/components/lmvz-input.js +1 -1
  77. package/components/lmvz-link.js +1 -1
  78. package/components/lmvz-menuitem.js +1 -1
  79. package/components/lmvz-message.js +1 -1
  80. package/components/lmvz-modal.js +1 -1
  81. package/components/lmvz-popover.js +1 -1
  82. package/components/lmvz-radio.js +1 -1
  83. package/components/lmvz-select.js +1 -1
  84. package/components/lmvz-snackbar.js +1 -1
  85. package/components/lmvz-spinner.js +1 -1
  86. package/components/lmvz-tab.js +1 -1
  87. package/components/lmvz-tabs.js +1 -1
  88. package/components/lmvz-toggle.js +1 -1
  89. package/components/{p-Chj7BuUZ.js → p--FDdvoIg.js} +1 -1
  90. package/components/{p-CFTmV4XZ.js → p-BAj4FkUt.js} +1 -1
  91. package/components/{p-CxLd309t.js → p-BLMXiDE0.js} +1 -1
  92. package/components/{p-DGg7OzDl.js → p-BPYBmylI.js} +1 -1
  93. package/components/p-BhALzK62.js +1 -0
  94. package/components/p-Bnri3fEI.js +1 -0
  95. package/components/p-C-pRMuMh.js +1 -0
  96. package/components/p-CPuI0_r_.js +1 -0
  97. package/components/p-CWpl0WaZ.js +1 -0
  98. package/components/{p-D5FL8n1q.js → p-CrQCHVKL.js} +1 -1
  99. package/components/p-DqdrUt_G.js +1 -0
  100. package/components/{p-CgK6-SEe.js → p-diOze8wI.js} +1 -1
  101. package/esm/{aria-validation-controller-BvOU1BO8.js → aria-validation-controller-Cp6pofER.js} +1 -1
  102. package/esm/{directional-focus-controller-DgAdCZrG.js → directional-focus-controller-Bhu7RqYE.js} +3 -1
  103. package/esm/{element-activation-controller-7PNSl6io.js → element-activation-controller-BuwyVq4A.js} +1 -1
  104. package/esm/{element.util-BFcYfHYq.js → element.util-Bd9JyKJZ.js} +13 -1
  105. package/esm/{index-BPeerEwm.js → index-BOXP1Vx0.js} +12 -1
  106. package/esm/lmvz-action-list.entry.js +5 -5
  107. package/esm/lmvz-action.entry.js +1 -1
  108. package/esm/lmvz-button-group.entry.js +2 -2
  109. package/esm/lmvz-button_2.entry.js +6 -6
  110. package/esm/lmvz-card.entry.js +2 -2
  111. package/esm/lmvz-checkbox.entry.js +2 -2
  112. package/esm/lmvz-chip.entry.js +2 -2
  113. package/esm/lmvz-components.js +3 -3
  114. package/esm/lmvz-datepicker.entry.js +2762 -0
  115. package/esm/lmvz-header_2.entry.js +6 -6
  116. package/esm/{lmvz-popover.entry.js → lmvz-input_2.entry.js} +227 -9
  117. package/esm/lmvz-link.entry.js +2 -2
  118. package/esm/lmvz-menuitem.entry.js +5 -5
  119. package/esm/lmvz-message.entry.js +2 -2
  120. package/esm/lmvz-modal.entry.js +4 -4
  121. package/esm/lmvz-radio.entry.js +3 -3
  122. package/esm/lmvz-select.entry.js +3 -3
  123. package/esm/lmvz-snackbar.entry.js +2 -2
  124. package/esm/lmvz-spinner.entry.js +2 -2
  125. package/esm/lmvz-tab.entry.js +2 -2
  126. package/esm/lmvz-tabs.entry.js +4 -4
  127. package/esm/lmvz-toggle.entry.js +4 -5
  128. package/esm/loader.js +3 -3
  129. package/esm/{async.util-DZj20TV1.js → stencil.util-C3QOYC8E.js} +13 -1
  130. package/hydrate/index.js +3083 -241
  131. package/hydrate/index.mjs +3083 -241
  132. package/lmvz-components/lmvz-components.esm.js +1 -1
  133. package/lmvz-components/{p-eb62d4af.entry.js → p-0af0211a.entry.js} +1 -1
  134. package/lmvz-components/{p-0c05f24b.entry.js → p-3d5867df.entry.js} +1 -1
  135. package/lmvz-components/{p-a887018d.entry.js → p-492adf21.entry.js} +1 -1
  136. package/lmvz-components/{p-24d13be6.entry.js → p-4fa6e72f.entry.js} +1 -1
  137. package/lmvz-components/{p-5bbbcfc0.entry.js → p-544e3ccb.entry.js} +1 -1
  138. package/lmvz-components/{p-eb4c5a6f.entry.js → p-63f6a596.entry.js} +1 -1
  139. package/lmvz-components/p-7a7aa922.entry.js +1 -0
  140. package/lmvz-components/p-8022c6dc.entry.js +1 -0
  141. package/lmvz-components/{p-BPeerEwm.js → p-BOXP1Vx0.js} +2 -2
  142. package/lmvz-components/p-Bd9JyKJZ.js +1 -0
  143. package/lmvz-components/{p-D9PQIBzA.js → p-BeY96W7m.js} +1 -1
  144. package/lmvz-components/p-C3QOYC8E.js +1 -0
  145. package/lmvz-components/p-GGkwaiT6.js +1 -0
  146. package/lmvz-components/{p-wlMjNjuv.js → p-UhNgD4L3.js} +1 -1
  147. package/lmvz-components/{p-d4154a65.entry.js → p-a611c110.entry.js} +1 -1
  148. package/lmvz-components/{p-46edf36f.entry.js → p-b1bb4393.entry.js} +1 -1
  149. package/lmvz-components/p-b50b1cb5.entry.js +1 -0
  150. package/lmvz-components/{p-f42b16e6.entry.js → p-b932cf91.entry.js} +1 -1
  151. package/lmvz-components/p-bff115d4.entry.js +1 -0
  152. package/lmvz-components/p-d280d21a.entry.js +1 -0
  153. package/lmvz-components/{p-c2544495.entry.js → p-d48203f9.entry.js} +1 -1
  154. package/lmvz-components/{p-e4ce63b3.entry.js → p-d9aede81.entry.js} +1 -1
  155. package/lmvz-components/{p-ecbd9e93.entry.js → p-dbfbcb74.entry.js} +1 -1
  156. package/lmvz-components/p-f0e28f3a.entry.js +1 -0
  157. package/lmvz-components/{p-aaa7691c.entry.js → p-f853faae.entry.js} +1 -1
  158. package/lmvz-components/p-fa2efc42.entry.js +1 -0
  159. package/lmvz-components/{p-194a3af5.entry.js → p-fe6f5bdc.entry.js} +1 -1
  160. package/manifest.json +940 -159
  161. package/package.json +5 -1
  162. package/types/api/ds.constants.d.ts +0 -1
  163. package/types/api/ds.types.d.ts +8 -0
  164. package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
  165. package/types/components/lmvz-action-list/lmvz-action-list.d.ts +0 -1
  166. package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
  167. package/types/components/lmvz-button-group/lmvz-button-group.d.ts +0 -1
  168. package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
  169. package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +0 -1
  170. package/types/components/lmvz-chip/lmvz-chip.d.ts +0 -1
  171. package/types/components/lmvz-datepicker/lmvz-datepicker.d.ts +75 -0
  172. package/types/components/lmvz-datepicker/lmvz-datepicker.utils.d.ts +22 -0
  173. package/types/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.d.ts +1 -0
  174. package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
  175. package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
  176. package/types/components/lmvz-input/lmvz-input.d.ts +5 -1
  177. package/types/components/lmvz-link/lmvz-link.d.ts +0 -1
  178. package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
  179. package/types/components/lmvz-message/lmvz-message.d.ts +0 -1
  180. package/types/components/lmvz-message/public.d.ts +0 -1
  181. package/types/components/lmvz-modal/lmvz-modal.d.ts +0 -1
  182. package/types/components/lmvz-modal/test/testing.d.ts +0 -1
  183. package/types/components/lmvz-popover/lmvz-popover.d.ts +0 -1
  184. package/types/components/lmvz-radio/lmvz-radio.d.ts +0 -1
  185. package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
  186. package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +0 -1
  187. package/types/components/lmvz-snackbar/public.d.ts +0 -1
  188. package/types/components/lmvz-snackbar/snackbar-controller.d.ts +0 -1
  189. package/types/components/lmvz-spinner/lmvz-spinner.d.ts +0 -1
  190. package/types/components/lmvz-tab/lmvz-tab.d.ts +0 -1
  191. package/types/components/lmvz-tabs/lmvz-tabs.d.ts +0 -1
  192. package/types/components/lmvz-toggle/lmvz-toggle.d.ts +0 -1
  193. package/types/components.d.ts +216 -0
  194. package/types/index.d.ts +0 -1
  195. package/types/utils/aria/aria-validation-controller.d.ts +0 -1
  196. package/types/utils/aria/aria.constants.d.ts +1 -1
  197. package/types/utils/aria/directional-focus-controller.d.ts +0 -1
  198. package/types/utils/aria/element-activation-controller.d.ts +0 -1
  199. package/types/utils/async/async.util.d.ts +1 -2
  200. package/types/utils/data/event.util.d.ts +0 -1
  201. package/types/utils/data/number.util.d.ts +0 -1
  202. package/types/utils/data/object.util.d.ts +0 -1
  203. package/types/utils/data/time.util.d.ts +0 -1
  204. package/types/utils/element/element.util.d.ts +1 -1
  205. package/types/utils/environment.d.ts +0 -1
  206. package/types/utils/icons/icons-registry.d.ts +0 -1
  207. package/types/utils/icons/icons.d.ts +0 -1
  208. package/types/utils/icons/icons.unit.d.ts +0 -1
  209. package/types/utils/icons/public.d.ts +0 -1
  210. package/types/utils/public.d.ts +0 -1
  211. package/types/utils/radio/radio-group-controller.d.ts +0 -1
  212. package/types/utils/stencil/assets.d.ts +0 -1
  213. package/types/utils/stencil/reactive-controller-host.d.ts +0 -1
  214. package/types/utils/stencil/stencil.util.d.ts +0 -1
  215. package/cjs/lmvz-input.cjs.entry.js +0 -186
  216. package/cjs/stencil.util-CBrPLd-F.js +0 -17
  217. package/components/p-BVzxNP7h.js +0 -1
  218. package/components/p-DLUsBYJH.js +0 -1
  219. package/components/p-zMWemcoB.js +0 -1
  220. package/esm/lmvz-input.entry.js +0 -184
  221. package/esm/stencil.util-D2-5rsN3.js +0 -15
  222. package/lmvz-components/p-4416d688.entry.js +0 -1
  223. package/lmvz-components/p-489d9912.entry.js +0 -1
  224. package/lmvz-components/p-5ff55ba9.entry.js +0 -1
  225. package/lmvz-components/p-888e04d7.entry.js +0 -1
  226. package/lmvz-components/p-9dc420e2.entry.js +0 -1
  227. package/lmvz-components/p-BFcYfHYq.js +0 -1
  228. package/lmvz-components/p-BuEA0MWd.js +0 -1
  229. package/lmvz-components/p-DZj20TV1.js +0 -1
  230. package/lmvz-components/p-af48eccb.entry.js +0 -1
  231. package/lmvz-components/p-bc237ab7.entry.js +0 -1
  232. package/lmvz-components/p-bh9cItsP.js +0 -1
@@ -0,0 +1,988 @@
1
+ import { Host, forceUpdate, h } from "@stencil/core";
2
+ import * as CalendarFns from "temporal-polyfill/fns/Calendar";
3
+ import * as NowFns from "temporal-polyfill/fns/Now";
4
+ import * as PDate from "temporal-polyfill/fns/PlainDate";
5
+ import * as PYM from "temporal-polyfill/fns/PlainYearMonth";
6
+ import chevronLeft from "@lmvz-ds/icons/assets/chevron-left.svg";
7
+ import chevronRight from "@lmvz-ds/icons/assets/chevron-right.svg";
8
+ import { parseIsoDateSafely, toIsoDateString, toIsoYearMonthString } from "@lmvz-ds/lib-ts/date/temporal.js";
9
+ import { toValidSvgStringWithFallback } from "@lmvz-ds/lib-ts/validation/svg.js";
10
+ import calendar from "../../assets/icons/calendar.svg";
11
+ import { buildCalendarGrid, derivePatternFromLocale, firstSelectableDayOfMonth, formatToDisplay, getNavLabels, getValidationLabels, isDisabled, isSelected, lastSelectableDayOfMonth, parseFromDisplay, } from "./lmvz-datepicker.utils";
12
+ const CHEVRON_LEFT = toValidSvgStringWithFallback(chevronLeft);
13
+ const CHEVRON_RIGHT = toValidSvgStringWithFallback(chevronRight);
14
+ const CALENDAR_ICON = toValidSvgStringWithFallback(calendar);
15
+ export class LmvzDatepicker {
16
+ el;
17
+ monthLabelId = `lmvz-dp-month-${Math.random().toString(36).slice(2, 9)}`;
18
+ internals;
19
+ visibleDays;
20
+ inputEl;
21
+ focusedButtonRef;
22
+ initialValue;
23
+ pendingGridFocus = false;
24
+ syncOrigin = null;
25
+ focusedDate;
26
+ setFocusedDate(val) {
27
+ if (this.focusedDate === val || (this.focusedDate && val && PDate.compare(this.focusedDate, val) === 0))
28
+ return;
29
+ this.focusedDate = val;
30
+ }
31
+ valueDate;
32
+ get value() {
33
+ return this.valueDate ? toIsoDateString(this.valueDate) : undefined;
34
+ }
35
+ set value(value) {
36
+ this.valueDate = value ? parseIsoDateSafely(value) : undefined;
37
+ this.visibleMonthDate = this.valueDate ? PDate.toPlainYearMonth(this.valueDate) : this.effectiveVisibleMonth;
38
+ this.setFocusedDate(this.valueDate);
39
+ this.syncInputTextFromValue();
40
+ this.updateFormState();
41
+ }
42
+ visibleMonthDate;
43
+ get visibleMonth() {
44
+ return this.visibleMonthDate ? toIsoYearMonthString(this.visibleMonthDate) : undefined;
45
+ }
46
+ set visibleMonth(value) {
47
+ this.visibleMonthDate = value ? PYM.fromString(value, CalendarFns.getBasic) : undefined;
48
+ this.initFocusedDate();
49
+ }
50
+ min;
51
+ max;
52
+ locale = 'de-CH';
53
+ firstDayOfWeek = 1;
54
+ disabled = false;
55
+ readonly = false;
56
+ required = false;
57
+ name;
58
+ label;
59
+ placeholder;
60
+ helperText;
61
+ errorMessage;
62
+ open = false;
63
+ displayFormat;
64
+ lmvzChange;
65
+ lmvzMonthChange;
66
+ lmvzOpen;
67
+ lmvzClose;
68
+ componentWillLoad() {
69
+ if (!this.label) {
70
+ console.warn('[lmvz-datepicker] no `label` provided; the text field will have no accessible name.');
71
+ }
72
+ this.initialValue = this.value;
73
+ this.syncInputTextFromValue();
74
+ this.updateFormState();
75
+ }
76
+ formAssociatedCallback(form) {
77
+ if (!form)
78
+ return;
79
+ this.updateFormState();
80
+ }
81
+ formResetCallback() {
82
+ this.internals.setValidity?.({});
83
+ this.value = this.initialValue;
84
+ }
85
+ formStateRestoreCallback(state) {
86
+ if (typeof state !== 'string')
87
+ return;
88
+ this.value = (state || undefined);
89
+ }
90
+ async checkValidity() {
91
+ return this.internals.checkValidity?.() ?? true;
92
+ }
93
+ async reportValidity() {
94
+ return this.internals.reportValidity?.() ?? true;
95
+ }
96
+ handleValidityRelevantPropChange() {
97
+ this.updateFormState();
98
+ }
99
+ handleDisplayFormatChange() {
100
+ this.syncInputTextFromValue();
101
+ }
102
+ handleDisabledChange(disabled) {
103
+ if (disabled)
104
+ this.open = false;
105
+ }
106
+ handleKeydown(ev) {
107
+ if (this.disabled)
108
+ return;
109
+ const path = ev.composedPath();
110
+ if (!path.some((el) => el?.getAttribute?.('role') === 'grid'))
111
+ return;
112
+ const focused = this.focusedDate;
113
+ if (!focused) {
114
+ console.warn('[lmvz-datepicker] any date should be focused but none is.');
115
+ return;
116
+ }
117
+ const minDate = parseIsoDateSafely(this.min);
118
+ const maxDate = parseIsoDateSafely(this.max);
119
+ const swallowEvent = () => {
120
+ ev.preventDefault();
121
+ ev.stopPropagation();
122
+ };
123
+ switch (ev.key) {
124
+ case 'ArrowRight': {
125
+ swallowEvent();
126
+ this.moveFocus(PDate.addDays(focused, 1));
127
+ break;
128
+ }
129
+ case 'ArrowLeft': {
130
+ swallowEvent();
131
+ this.moveFocus(PDate.addDays(focused, -1));
132
+ break;
133
+ }
134
+ case 'ArrowDown': {
135
+ swallowEvent();
136
+ this.moveFocus(PDate.addDays(focused, 7));
137
+ break;
138
+ }
139
+ case 'ArrowUp': {
140
+ swallowEvent();
141
+ this.moveFocus(PDate.addDays(focused, -7));
142
+ break;
143
+ }
144
+ case 'Home': {
145
+ swallowEvent();
146
+ this.moveFocus(firstSelectableDayOfMonth(this.effectiveVisibleMonth, minDate, maxDate));
147
+ break;
148
+ }
149
+ case 'End': {
150
+ swallowEvent();
151
+ this.moveFocus(lastSelectableDayOfMonth(this.effectiveVisibleMonth, minDate, maxDate));
152
+ break;
153
+ }
154
+ case 'PageUp':
155
+ swallowEvent();
156
+ this.moveFocus(ev.shiftKey ? PDate.addYears(focused, -1) : PDate.addMonths(focused, -1));
157
+ break;
158
+ case 'PageDown':
159
+ swallowEvent();
160
+ this.moveFocus(ev.shiftKey ? PDate.addYears(focused, 1) : PDate.addMonths(focused, 1));
161
+ break;
162
+ case 'Enter':
163
+ case ' ':
164
+ ev.preventDefault();
165
+ if (!this.readonly && !isDisabled(focused, minDate, maxDate)) {
166
+ this.selectDate(focused, { origin: 'calendar', closePopover: true });
167
+ }
168
+ break;
169
+ case 'Escape':
170
+ break;
171
+ default:
172
+ break;
173
+ }
174
+ }
175
+ initFocusedDate() {
176
+ const vm = this.effectiveVisibleMonth;
177
+ if (this.focusedDate && PYM.compare(PDate.toPlainYearMonth(this.focusedDate), vm) === 0) {
178
+ return;
179
+ }
180
+ const selectedDate = this.valueDate;
181
+ if (selectedDate && PYM.compare(PDate.toPlainYearMonth(selectedDate), vm) === 0) {
182
+ this.setFocusedDate(selectedDate);
183
+ return;
184
+ }
185
+ const todayDate = NowFns.plainDateISO();
186
+ if (PYM.compare(PDate.toPlainYearMonth(todayDate), vm) === 0) {
187
+ this.setFocusedDate(todayDate);
188
+ return;
189
+ }
190
+ this.setFocusedDate(PYM.toPlainDate(vm, { day: 1 }));
191
+ }
192
+ get effectiveVisibleMonth() {
193
+ return this.visibleMonthDate ? this.visibleMonthDate : PDate.toPlainYearMonth(NowFns.plainDateISO());
194
+ }
195
+ navigateMonth(delta, byMonthNav = false) {
196
+ if (delta === 0)
197
+ return;
198
+ const newMonth = PYM.addMonths(this.effectiveVisibleMonth, delta);
199
+ this.visibleMonthDate = newMonth;
200
+ this.lmvzMonthChange.emit({ visibleMonth: toIsoYearMonthString(newMonth) });
201
+ if (byMonthNav) {
202
+ this.setFocusedDate(PYM.toPlainDate(newMonth, { day: 1 }));
203
+ }
204
+ }
205
+ selectDate(date, opts = { origin: 'calendar' }) {
206
+ this.syncOrigin = opts.origin;
207
+ this.valueDate = date;
208
+ this.setFocusedDate(date);
209
+ this.lmvzChange.emit({ value: toIsoDateString(date) });
210
+ this.navigateMonth(PYM.compare(PDate.toPlainYearMonth(date), this.effectiveVisibleMonth));
211
+ if (opts.origin === 'input') {
212
+ this.inputText = formatToDisplay(this.value, this.locale, this.displayFormat);
213
+ this.hasUnparseableInput = false;
214
+ }
215
+ else {
216
+ this.syncInputTextFromValue();
217
+ }
218
+ this.updateFormState();
219
+ if (opts.closePopover)
220
+ this.open = false;
221
+ this.syncOrigin = null;
222
+ }
223
+ moveFocus(date) {
224
+ if (!date)
225
+ return;
226
+ this.setFocusedDate(date);
227
+ if (!this.visibleDays?.length)
228
+ return;
229
+ let day = this.visibleDays.at(0);
230
+ if (day && PDate.compare(date, day) < 0) {
231
+ return this.navigateMonth(-1);
232
+ }
233
+ day = this.visibleDays.at(-1);
234
+ if (day && PDate.compare(date, day) > 0) {
235
+ return this.navigateMonth(1);
236
+ }
237
+ }
238
+ syncInputTextFromValue() {
239
+ if (this.syncOrigin === 'input')
240
+ return;
241
+ this.inputText = formatToDisplay(this.value, this.locale, this.displayFormat);
242
+ this.hasUnparseableInput = false;
243
+ }
244
+ inputText = '';
245
+ hasUnparseableInput = false;
246
+ handleInputTextChange = (ev) => {
247
+ const text = ev.detail;
248
+ this.inputText = text;
249
+ if (!text.trim()) {
250
+ this.hasUnparseableInput = false;
251
+ if (this.valueDate) {
252
+ this.syncOrigin = 'input';
253
+ this.valueDate = undefined;
254
+ this.lmvzChange.emit({ value: undefined });
255
+ this.syncOrigin = null;
256
+ }
257
+ this.updateFormState();
258
+ return;
259
+ }
260
+ const parsed = parseFromDisplay(text, this.locale, this.displayFormat);
261
+ if (!parsed) {
262
+ this.hasUnparseableInput = true;
263
+ this.updateFormState();
264
+ return;
265
+ }
266
+ this.hasUnparseableInput = false;
267
+ const parsedDate = parseIsoDateSafely(parsed);
268
+ if (!parsedDate)
269
+ return;
270
+ if (this.valueDate && PDate.compare(this.valueDate, parsedDate) === 0)
271
+ return;
272
+ this.selectDate(parsedDate, { origin: 'input' });
273
+ };
274
+ handleInputFocus(ev) {
275
+ if (this.disabled || this.readonly)
276
+ return;
277
+ const originalTarget = ev.composedPath()[0];
278
+ if (originalTarget !== this.inputEl && !this.inputEl?.contains(originalTarget ?? null))
279
+ return;
280
+ this.initFocusedDate();
281
+ this.open = true;
282
+ }
283
+ handleInputKeydown = (ev) => {
284
+ if (this.disabled || this.readonly)
285
+ return;
286
+ if (!['ArrowDown', 'ArrowUp', ' '].includes(ev.key))
287
+ return;
288
+ ev.preventDefault();
289
+ if (!this.open) {
290
+ this.pendingGridFocus = true;
291
+ this.initFocusedDate();
292
+ this.open = true;
293
+ }
294
+ else {
295
+ this.focusGrid();
296
+ }
297
+ };
298
+ focusGrid() {
299
+ requestAnimationFrame(() => this.focusedButtonRef?.focus());
300
+ }
301
+ handlePopoverOpen = (ev) => {
302
+ ev.stopPropagation();
303
+ console.log('emitting open event');
304
+ this.lmvzOpen.emit();
305
+ if (this.pendingGridFocus) {
306
+ this.pendingGridFocus = false;
307
+ this.focusGrid();
308
+ }
309
+ };
310
+ handlePopoverClose = (ev) => {
311
+ console.log('handlePopoverClose', ev);
312
+ ev.stopPropagation();
313
+ this.open = false;
314
+ this.lmvzClose.emit();
315
+ };
316
+ updateFormState() {
317
+ const isoValue = this.value;
318
+ this.internals.setFormValue?.(isoValue ?? null);
319
+ const flags = {};
320
+ if (this.required && !this.valueDate) {
321
+ flags.valueMissing = true;
322
+ }
323
+ if (this.hasUnparseableInput) {
324
+ flags.badInput = true;
325
+ }
326
+ if (this.valueDate) {
327
+ const minDate = parseIsoDateSafely(this.min);
328
+ const maxDate = parseIsoDateSafely(this.max);
329
+ if (minDate && PDate.compare(this.valueDate, minDate) < 0)
330
+ flags.rangeUnderflow = true;
331
+ if (maxDate && PDate.compare(this.valueDate, maxDate) > 0)
332
+ flags.rangeOverflow = true;
333
+ }
334
+ const isInvalid = Object.values(flags).some(Boolean);
335
+ this.isInvalid = isInvalid;
336
+ const validationLabels = getValidationLabels(this.locale);
337
+ this.internals.setValidity?.(flags, isInvalid ? this.errorMessage || validationLabels.invalidDateMessage : undefined, isInvalid ? this.el : undefined);
338
+ }
339
+ isInvalid = false;
340
+ get effectivePlaceholder() {
341
+ return this.placeholder ?? derivePatternFromLocale(this.locale).toLowerCase();
342
+ }
343
+ renderHeader() {
344
+ const { locale } = this;
345
+ const vm = this.effectiveVisibleMonth;
346
+ const navLabels = getNavLabels(locale);
347
+ const monthYearLabel = PDate.toLocaleString(PYM.toPlainDate(vm, { day: 1 }), locale, { month: 'long', year: 'numeric' });
348
+ const prevMonth = PYM.addMonths(vm, -1);
349
+ const nextMonth = PYM.addMonths(vm, 1);
350
+ const minYM = this.min ? PYM.fromString(this.min.slice(0, 7), CalendarFns.getBasic) : undefined;
351
+ const maxYM = this.max ? PYM.fromString(this.max.slice(0, 7), CalendarFns.getBasic) : undefined;
352
+ const isPrevDisabled = this.disabled || (minYM !== undefined && PYM.compare(prevMonth, minYM) < 0);
353
+ const isNextDisabled = this.disabled || (maxYM !== undefined && PYM.compare(nextMonth, maxYM) > 0);
354
+ return (h("div", { part: "header", class: "datepicker-header" }, h("lmvz-button", { part: "nav-prev", variant: "tertiary", scale: "small", "aria-label": navLabels.prev, disabled: isPrevDisabled, onLmvzActivation: () => this.navigateMonth(-1, true) }, h("lmvz-icon", { icon: CHEVRON_LEFT, "aria-hidden": "true" })), h("span", { id: this.monthLabelId, part: "month-label", class: "datepicker-month-label" }, monthYearLabel), h("lmvz-button", { part: "nav-next", variant: "tertiary", scale: "small", "aria-label": navLabels.next, disabled: isNextDisabled, onLmvzActivation: () => this.navigateMonth(1, true) }, h("lmvz-icon", { icon: CHEVRON_RIGHT, "aria-hidden": "true" }))));
355
+ }
356
+ renderWeekdayRow() {
357
+ const { locale } = this;
358
+ const mondayFirstDows = [1, 2, 3, 4, 5, 6, 7];
359
+ const refMonday = PDate.fromFields({ year: 2024, month: 1, day: 1 });
360
+ return (h("div", { part: "weekday-row", role: "row", class: "datepicker-weekday-row" }, mondayFirstDows.map((dow) => {
361
+ const refDate = PDate.addDays(refMonday, dow - 1);
362
+ const shortName = PDate.toLocaleString(refDate, locale, { weekday: 'short' });
363
+ const longName = PDate.toLocaleString(refDate, locale, { weekday: 'long' });
364
+ return (h("span", { part: "weekday", role: "columnheader", "aria-label": longName, class: "datepicker-weekday", key: dow }, h("abbr", { title: longName }, shortName)));
365
+ })));
366
+ }
367
+ renderGrid() {
368
+ const { locale, focusedDate } = this;
369
+ const vm = this.effectiveVisibleMonth;
370
+ const selectedDate = this.valueDate;
371
+ const minDate = parseIsoDateSafely(this.min);
372
+ const maxDate = parseIsoDateSafely(this.max);
373
+ const grid = (this.visibleDays = buildCalendarGrid(vm));
374
+ const weekdayAriaLabelFormatter = {
375
+ weekday: 'long',
376
+ day: 'numeric',
377
+ month: 'long',
378
+ year: 'numeric',
379
+ };
380
+ const weeks = [];
381
+ for (let w = 0; w < 6; w++) {
382
+ if (!grid.at(w * 7))
383
+ break;
384
+ weeks.push(grid.slice(w * 7, w * 7 + 7));
385
+ }
386
+ return (h("div", { part: "grid", role: "grid", "aria-labelledby": this.monthLabelId, class: "datepicker-grid" }, this.renderWeekdayRow(), weeks.map((week, wi) => (h("div", { part: "week-row", role: "row", class: "datepicker-week-row", key: wi }, week.map((date) => {
387
+ const iso = toIsoDateString(date);
388
+ const isTodayDate = PDate.compare(date, NowFns.plainDateISO()) === 0;
389
+ const isSelectedDate = isSelected(date, selectedDate);
390
+ const isOutOfMonth = PYM.compare(PDate.toPlainYearMonth(date), vm) !== 0;
391
+ const isDisabledDate = this.readonly || isDisabled(date, minDate, maxDate);
392
+ const isFocused = focusedDate !== undefined && PDate.compare(date, focusedDate) === 0;
393
+ const partMarkers = ['day'];
394
+ if (isTodayDate)
395
+ partMarkers.push('day--today');
396
+ if (isSelectedDate)
397
+ partMarkers.push('day--selected');
398
+ if (isOutOfMonth)
399
+ partMarkers.push('day--out-of-month');
400
+ if (isDisabledDate)
401
+ partMarkers.push('day--disabled');
402
+ const ariaLabel = PDate.toLocaleString(date, locale, weekdayAriaLabelFormatter);
403
+ let fromRender = false;
404
+ let buttonRef;
405
+ if (isFocused) {
406
+ requestAnimationFrame(() => {
407
+ const activeEl = this.el.shadowRoot?.activeElement;
408
+ if (!(activeEl instanceof HTMLButtonElement) || activeEl.getAttribute('role') !== 'gridcell')
409
+ return;
410
+ fromRender = true;
411
+ buttonRef?.focus();
412
+ });
413
+ }
414
+ return (h("button", { "data-debug-id": iso, role: "gridcell", type: "button", part: partMarkers.join(' '), tabIndex: isFocused ? 0 : -1, "aria-label": ariaLabel, "aria-selected": isSelectedDate ? 'true' : undefined, "aria-current": isTodayDate ? 'date' : undefined, "aria-disabled": isDisabledDate ? 'true' : undefined, onClick: () => {
415
+ if (isDisabledDate || this.disabled)
416
+ return;
417
+ this.selectDate(date, { origin: 'calendar', closePopover: true });
418
+ }, ref: (e) => {
419
+ buttonRef = e;
420
+ if (isFocused)
421
+ this.focusedButtonRef = e;
422
+ }, onFocus: (e) => {
423
+ console.log('focus event on grid cell', iso, e.target);
424
+ if (!this.el.shadowRoot?.contains(e.target))
425
+ return;
426
+ if (fromRender) {
427
+ fromRender = false;
428
+ return;
429
+ }
430
+ this.setFocusedDate(date);
431
+ }, key: iso }, date.day));
432
+ }))))));
433
+ }
434
+ render() {
435
+ const validationLabels = getValidationLabels(this.locale);
436
+ const popoverLabel = this.label ? `${this.label} ${validationLabels.popoverSuffix}` : undefined;
437
+ return (h(Host, { key: 'df61136bb4d184e91e086a06f60e3c198f8a2b85' }, h("lmvz-input", { key: '04986afb4a0926df4da693de6210ee4fccd74bd7', ref: (el) => {
438
+ const wasUnset = !this.inputEl;
439
+ this.inputEl = el;
440
+ if (wasUnset && this.inputEl) {
441
+ forceUpdate(this);
442
+ }
443
+ }, label: this.label ?? '', placeholder: this.effectivePlaceholder, helperText: this.helperText, errorMessage: this.errorMessage, error: this.isInvalid, disabled: this.disabled, readonly: this.readonly, required: this.required, value: this.inputText, autocomplete: "off", onLmvzInput: this.handleInputTextChange, onKeyDown: this.handleInputKeydown }, h("lmvz-icon", { key: '47897492e6df2f4b303c99aa33c48f326f3d9d63', slot: "after-input", icon: CALENDAR_ICON, "aria-hidden": "true" })), h("lmvz-popover", { key: 'd2904def9519907f56dada15df992800da77db55', anchor: this.inputEl, open: this.open && !this.disabled, autoFocus: false, size: "md", label: popoverLabel, onLmvzOpen: this.handlePopoverOpen, onLmvzClose: this.handlePopoverClose }, h("div", { key: 'dbdfe38144a63e5ac9de4c46e0df9918f898de28', part: "panel", class: "datepicker-panel" }, this.renderHeader(), this.renderGrid()))));
444
+ }
445
+ static get is() { return "lmvz-datepicker"; }
446
+ static get encapsulation() { return "shadow"; }
447
+ static get delegatesFocus() { return true; }
448
+ static get formAssociated() { return true; }
449
+ static get originalStyleUrls() {
450
+ return {
451
+ "$": ["./lmvz-datepicker.css"]
452
+ };
453
+ }
454
+ static get styleUrls() {
455
+ return {
456
+ "$": ["lmvz-datepicker.css"]
457
+ };
458
+ }
459
+ static get properties() {
460
+ return {
461
+ "value": {
462
+ "type": "string",
463
+ "mutable": false,
464
+ "complexType": {
465
+ "original": "`${number}-${number}-${number}` | undefined",
466
+ "resolved": "`${number}-${number}-${number}` | undefined",
467
+ "references": {}
468
+ },
469
+ "required": false,
470
+ "optional": false,
471
+ "docs": {
472
+ "tags": [],
473
+ "text": "The selected date in ISO `YYYY-MM-DD` format."
474
+ },
475
+ "getter": true,
476
+ "setter": true,
477
+ "reflect": false,
478
+ "attribute": "value"
479
+ },
480
+ "visibleMonth": {
481
+ "type": "string",
482
+ "mutable": false,
483
+ "complexType": {
484
+ "original": "IsoYearMonthString | undefined",
485
+ "resolved": "`${number}-${number}` | undefined",
486
+ "references": {
487
+ "IsoYearMonthString": {
488
+ "location": "import",
489
+ "path": "@lmvz-ds/lib-ts/date/IsoDateString.js",
490
+ "id": "../../lib/ts/src/date/IsoDateString.d.ts::IsoYearMonthString",
491
+ "referenceLocation": "IsoYearMonthString"
492
+ }
493
+ }
494
+ },
495
+ "required": false,
496
+ "optional": false,
497
+ "docs": {
498
+ "tags": [],
499
+ "text": "ISO year-month string (`YYYY-MM`) whose month is currently displayed.\nDefaults to the current month when unset."
500
+ },
501
+ "getter": true,
502
+ "setter": true,
503
+ "reflect": false,
504
+ "attribute": "visible-month"
505
+ },
506
+ "min": {
507
+ "type": "string",
508
+ "mutable": false,
509
+ "complexType": {
510
+ "original": "IsoDateString | undefined",
511
+ "resolved": "`${number}-${number}-${number}` | undefined",
512
+ "references": {
513
+ "IsoDateString": {
514
+ "location": "import",
515
+ "path": "@lmvz-ds/lib-ts/date/IsoDateString.js",
516
+ "id": "../../lib/ts/src/date/IsoDateString.d.ts::IsoDateString",
517
+ "referenceLocation": "IsoDateString"
518
+ }
519
+ }
520
+ },
521
+ "required": false,
522
+ "optional": false,
523
+ "docs": {
524
+ "tags": [],
525
+ "text": "Minimum selectable date in ISO `YYYY-MM-DD` format.\nDays before this date are disabled."
526
+ },
527
+ "getter": false,
528
+ "setter": false,
529
+ "reflect": false,
530
+ "attribute": "min"
531
+ },
532
+ "max": {
533
+ "type": "string",
534
+ "mutable": false,
535
+ "complexType": {
536
+ "original": "IsoDateString | undefined",
537
+ "resolved": "`${number}-${number}-${number}` | undefined",
538
+ "references": {
539
+ "IsoDateString": {
540
+ "location": "import",
541
+ "path": "@lmvz-ds/lib-ts/date/IsoDateString.js",
542
+ "id": "../../lib/ts/src/date/IsoDateString.d.ts::IsoDateString",
543
+ "referenceLocation": "IsoDateString"
544
+ }
545
+ }
546
+ },
547
+ "required": false,
548
+ "optional": false,
549
+ "docs": {
550
+ "tags": [],
551
+ "text": "Maximum selectable date in ISO `YYYY-MM-DD` format.\nDays after this date are disabled."
552
+ },
553
+ "getter": false,
554
+ "setter": false,
555
+ "reflect": false,
556
+ "attribute": "max"
557
+ },
558
+ "locale": {
559
+ "type": "string",
560
+ "mutable": false,
561
+ "complexType": {
562
+ "original": "string",
563
+ "resolved": "string",
564
+ "references": {}
565
+ },
566
+ "required": false,
567
+ "optional": false,
568
+ "docs": {
569
+ "tags": [{
570
+ "name": "default",
571
+ "text": "'de-CH'"
572
+ }],
573
+ "text": "BCP 47 locale tag used for weekday/month names, ARIA labels, and the default display format."
574
+ },
575
+ "getter": false,
576
+ "setter": false,
577
+ "reflect": false,
578
+ "attribute": "locale",
579
+ "defaultValue": "'de-CH'"
580
+ },
581
+ "firstDayOfWeek": {
582
+ "type": "number",
583
+ "mutable": false,
584
+ "complexType": {
585
+ "original": "0 | 1",
586
+ "resolved": "0 | 1",
587
+ "references": {}
588
+ },
589
+ "required": false,
590
+ "optional": false,
591
+ "docs": {
592
+ "tags": [{
593
+ "name": "default",
594
+ "text": "1"
595
+ }],
596
+ "text": "First day of the week: `0` = Sunday, `1` = Monday.\nMonday-first is hardcoded for v1; this prop is reserved for future runtime support."
597
+ },
598
+ "getter": false,
599
+ "setter": false,
600
+ "reflect": false,
601
+ "attribute": "first-day-of-week",
602
+ "defaultValue": "1"
603
+ },
604
+ "disabled": {
605
+ "type": "boolean",
606
+ "mutable": false,
607
+ "complexType": {
608
+ "original": "boolean",
609
+ "resolved": "boolean",
610
+ "references": {}
611
+ },
612
+ "required": false,
613
+ "optional": false,
614
+ "docs": {
615
+ "tags": [{
616
+ "name": "default",
617
+ "text": "false"
618
+ }],
619
+ "text": "Whether the entire datepicker (input + panel) is disabled."
620
+ },
621
+ "getter": false,
622
+ "setter": false,
623
+ "reflect": true,
624
+ "attribute": "disabled",
625
+ "defaultValue": "false"
626
+ },
627
+ "readonly": {
628
+ "type": "boolean",
629
+ "mutable": false,
630
+ "complexType": {
631
+ "original": "boolean",
632
+ "resolved": "boolean",
633
+ "references": {}
634
+ },
635
+ "required": false,
636
+ "optional": false,
637
+ "docs": {
638
+ "tags": [{
639
+ "name": "default",
640
+ "text": "false"
641
+ }],
642
+ "text": "Whether the datepicker is readonly. The text field cannot be typed into and the calendar cannot change the value,\nbut the value is still submitted with the form."
643
+ },
644
+ "getter": false,
645
+ "setter": false,
646
+ "reflect": true,
647
+ "attribute": "readonly",
648
+ "defaultValue": "false"
649
+ },
650
+ "required": {
651
+ "type": "boolean",
652
+ "mutable": false,
653
+ "complexType": {
654
+ "original": "boolean",
655
+ "resolved": "boolean",
656
+ "references": {}
657
+ },
658
+ "required": false,
659
+ "optional": false,
660
+ "docs": {
661
+ "tags": [{
662
+ "name": "default",
663
+ "text": "false"
664
+ }],
665
+ "text": "Whether a value is required for the form to be valid."
666
+ },
667
+ "getter": false,
668
+ "setter": false,
669
+ "reflect": true,
670
+ "attribute": "required",
671
+ "defaultValue": "false"
672
+ },
673
+ "name": {
674
+ "type": "string",
675
+ "mutable": false,
676
+ "complexType": {
677
+ "original": "string",
678
+ "resolved": "string | undefined",
679
+ "references": {}
680
+ },
681
+ "required": false,
682
+ "optional": true,
683
+ "docs": {
684
+ "tags": [],
685
+ "text": "Name submitted with the form."
686
+ },
687
+ "getter": false,
688
+ "setter": false,
689
+ "reflect": true,
690
+ "attribute": "name"
691
+ },
692
+ "label": {
693
+ "type": "string",
694
+ "mutable": false,
695
+ "complexType": {
696
+ "original": "string",
697
+ "resolved": "string | undefined",
698
+ "references": {}
699
+ },
700
+ "required": false,
701
+ "optional": true,
702
+ "docs": {
703
+ "tags": [],
704
+ "text": "Label for the composed text field."
705
+ },
706
+ "getter": false,
707
+ "setter": false,
708
+ "reflect": false,
709
+ "attribute": "label"
710
+ },
711
+ "placeholder": {
712
+ "type": "string",
713
+ "mutable": false,
714
+ "complexType": {
715
+ "original": "string",
716
+ "resolved": "string | undefined",
717
+ "references": {}
718
+ },
719
+ "required": false,
720
+ "optional": true,
721
+ "docs": {
722
+ "tags": [],
723
+ "text": "Placeholder for the composed text field. Defaults to the locale-derived display pattern (e.g. `dd.MM.yyyy`)."
724
+ },
725
+ "getter": false,
726
+ "setter": false,
727
+ "reflect": false,
728
+ "attribute": "placeholder"
729
+ },
730
+ "helperText": {
731
+ "type": "string",
732
+ "mutable": false,
733
+ "complexType": {
734
+ "original": "string",
735
+ "resolved": "string | undefined",
736
+ "references": {}
737
+ },
738
+ "required": false,
739
+ "optional": true,
740
+ "docs": {
741
+ "tags": [],
742
+ "text": "Helper text displayed below the text field."
743
+ },
744
+ "getter": false,
745
+ "setter": false,
746
+ "reflect": false,
747
+ "attribute": "helper-text"
748
+ },
749
+ "errorMessage": {
750
+ "type": "string",
751
+ "mutable": false,
752
+ "complexType": {
753
+ "original": "string",
754
+ "resolved": "string | undefined",
755
+ "references": {}
756
+ },
757
+ "required": false,
758
+ "optional": true,
759
+ "docs": {
760
+ "tags": [],
761
+ "text": "Error message displayed below the text field when the value is invalid."
762
+ },
763
+ "getter": false,
764
+ "setter": false,
765
+ "reflect": false,
766
+ "attribute": "error-message"
767
+ },
768
+ "open": {
769
+ "type": "boolean",
770
+ "mutable": true,
771
+ "complexType": {
772
+ "original": "boolean",
773
+ "resolved": "boolean",
774
+ "references": {}
775
+ },
776
+ "required": false,
777
+ "optional": false,
778
+ "docs": {
779
+ "tags": [{
780
+ "name": "default",
781
+ "text": "false"
782
+ }],
783
+ "text": "Whether the calendar popover is open. Reflects the actual open state \u2014 it is kept\nin sync with focus/keyboard interactions and with light-dismiss/Escape closing."
784
+ },
785
+ "getter": false,
786
+ "setter": false,
787
+ "reflect": true,
788
+ "attribute": "open",
789
+ "defaultValue": "false"
790
+ },
791
+ "displayFormat": {
792
+ "type": "string",
793
+ "mutable": false,
794
+ "complexType": {
795
+ "original": "Datepicker.DisplayFormat",
796
+ "resolved": "string | undefined",
797
+ "references": {
798
+ "Datepicker": {
799
+ "location": "import",
800
+ "path": "../../api",
801
+ "id": "src/api/index.d.ts::Datepicker",
802
+ "referenceLocation": "Datepicker"
803
+ }
804
+ }
805
+ },
806
+ "required": false,
807
+ "optional": true,
808
+ "docs": {
809
+ "tags": [],
810
+ "text": "Custom display-format pattern for the text field, using the tokens `yyyy`, `MM`, `dd`\n(e.g. `'dd.MM.yyyy'`). Defaults to a pattern derived from `locale`."
811
+ },
812
+ "getter": false,
813
+ "setter": false,
814
+ "reflect": false,
815
+ "attribute": "display-format"
816
+ }
817
+ };
818
+ }
819
+ static get states() {
820
+ return {
821
+ "focusedDate": {},
822
+ "valueDate": {},
823
+ "visibleMonthDate": {},
824
+ "inputText": {},
825
+ "hasUnparseableInput": {},
826
+ "isInvalid": {}
827
+ };
828
+ }
829
+ static get events() {
830
+ return [{
831
+ "method": "lmvzChange",
832
+ "name": "lmvzChange",
833
+ "bubbles": true,
834
+ "cancelable": true,
835
+ "composed": true,
836
+ "docs": {
837
+ "tags": [],
838
+ "text": "Emitted when the user selects a date (via the calendar grid or by typing a complete valid date).\nThe `value` field carries an IsoDateString representing the selected date."
839
+ },
840
+ "complexType": {
841
+ "original": "{ value: IsoDateString | undefined }",
842
+ "resolved": "{ value: `${number}-${number}-${number}` | undefined; }",
843
+ "references": {
844
+ "IsoDateString": {
845
+ "location": "import",
846
+ "path": "@lmvz-ds/lib-ts/date/IsoDateString.js",
847
+ "id": "../../lib/ts/src/date/IsoDateString.d.ts::IsoDateString",
848
+ "referenceLocation": "IsoDateString"
849
+ }
850
+ }
851
+ }
852
+ }, {
853
+ "method": "lmvzMonthChange",
854
+ "name": "lmvzMonthChange",
855
+ "bubbles": true,
856
+ "cancelable": true,
857
+ "composed": true,
858
+ "docs": {
859
+ "tags": [],
860
+ "text": "Emitted when the displayed month changes via prev/next navigation.\nThe `visibleMonth` field carries an IsoYearMonthString representing the new month."
861
+ },
862
+ "complexType": {
863
+ "original": "{ visibleMonth: IsoYearMonthString }",
864
+ "resolved": "{ visibleMonth: `${number}-${number}`; }",
865
+ "references": {
866
+ "IsoYearMonthString": {
867
+ "location": "import",
868
+ "path": "@lmvz-ds/lib-ts/date/IsoDateString.js",
869
+ "id": "../../lib/ts/src/date/IsoDateString.d.ts::IsoYearMonthString",
870
+ "referenceLocation": "IsoYearMonthString"
871
+ }
872
+ }
873
+ }
874
+ }, {
875
+ "method": "lmvzOpen",
876
+ "name": "lmvzOpen",
877
+ "bubbles": true,
878
+ "cancelable": true,
879
+ "composed": true,
880
+ "docs": {
881
+ "tags": [],
882
+ "text": "Forwarded from the internal popover: fired after the calendar panel opens."
883
+ },
884
+ "complexType": {
885
+ "original": "void",
886
+ "resolved": "void",
887
+ "references": {}
888
+ }
889
+ }, {
890
+ "method": "lmvzClose",
891
+ "name": "lmvzClose",
892
+ "bubbles": true,
893
+ "cancelable": true,
894
+ "composed": true,
895
+ "docs": {
896
+ "tags": [],
897
+ "text": "Forwarded from the internal popover: fired after the calendar panel closes."
898
+ },
899
+ "complexType": {
900
+ "original": "void",
901
+ "resolved": "void",
902
+ "references": {}
903
+ }
904
+ }];
905
+ }
906
+ static get methods() {
907
+ return {
908
+ "checkValidity": {
909
+ "complexType": {
910
+ "signature": "() => Promise<boolean>",
911
+ "parameters": [],
912
+ "references": {
913
+ "Promise": {
914
+ "location": "global",
915
+ "id": "global::Promise"
916
+ }
917
+ },
918
+ "return": "Promise<boolean>"
919
+ },
920
+ "docs": {
921
+ "text": "Returns whether the current value satisfies `required`/`min`/`max` and is a parseable date.\nUnlike a native `<input>`, form-associated custom elements do not forward `ElementInternals`'\nconstraint-validation API to the element automatically \u2014 this delegates to it explicitly.",
922
+ "tags": []
923
+ }
924
+ },
925
+ "reportValidity": {
926
+ "complexType": {
927
+ "signature": "() => Promise<boolean>",
928
+ "parameters": [],
929
+ "references": {
930
+ "Promise": {
931
+ "location": "global",
932
+ "id": "global::Promise"
933
+ }
934
+ },
935
+ "return": "Promise<boolean>"
936
+ },
937
+ "docs": {
938
+ "text": "Reports validation errors to the user (e.g. shows the browser's native validation bubble)\nand returns whether the current value is valid.",
939
+ "tags": []
940
+ }
941
+ }
942
+ };
943
+ }
944
+ static get elementRef() { return "el"; }
945
+ static get watchers() {
946
+ return [{
947
+ "propName": "required",
948
+ "methodName": "handleValidityRelevantPropChange"
949
+ }, {
950
+ "propName": "min",
951
+ "methodName": "handleValidityRelevantPropChange"
952
+ }, {
953
+ "propName": "max",
954
+ "methodName": "handleValidityRelevantPropChange"
955
+ }, {
956
+ "propName": "locale",
957
+ "methodName": "handleDisplayFormatChange"
958
+ }, {
959
+ "propName": "displayFormat",
960
+ "methodName": "handleDisplayFormatChange"
961
+ }, {
962
+ "propName": "disabled",
963
+ "methodName": "handleDisabledChange"
964
+ }];
965
+ }
966
+ static get listeners() {
967
+ return [{
968
+ "name": "keydown",
969
+ "method": "handleKeydown",
970
+ "target": undefined,
971
+ "capture": false,
972
+ "passive": false
973
+ }, {
974
+ "name": "focusin",
975
+ "method": "handleInputFocus",
976
+ "target": undefined,
977
+ "capture": false,
978
+ "passive": false
979
+ }, {
980
+ "name": "click",
981
+ "method": "handleInputFocus",
982
+ "target": undefined,
983
+ "capture": false,
984
+ "passive": false
985
+ }];
986
+ }
987
+ static get attachInternalsMemberName() { return "internals"; }
988
+ }