yukit-web 0.10.6 → 0.10.8

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 (193) hide show
  1. package/fesm2022/yukit-web-chart.mjs +807 -552
  2. package/fesm2022/yukit-web-chart.mjs.map +1 -1
  3. package/fesm2022/yukit-web-helm-accordion.mjs +271 -100
  4. package/fesm2022/yukit-web-helm-accordion.mjs.map +1 -1
  5. package/fesm2022/yukit-web-helm-alert-dialog.mjs +675 -243
  6. package/fesm2022/yukit-web-helm-alert-dialog.mjs.map +1 -1
  7. package/fesm2022/yukit-web-helm-alert.mjs +199 -91
  8. package/fesm2022/yukit-web-helm-alert.mjs.map +1 -1
  9. package/fesm2022/yukit-web-helm-aspect-ratio.mjs +77 -43
  10. package/fesm2022/yukit-web-helm-aspect-ratio.mjs.map +1 -1
  11. package/fesm2022/yukit-web-helm-attachment.mjs +552 -205
  12. package/fesm2022/yukit-web-helm-attachment.mjs.map +1 -1
  13. package/fesm2022/yukit-web-helm-autocomplete.mjs +913 -288
  14. package/fesm2022/yukit-web-helm-autocomplete.mjs.map +1 -1
  15. package/fesm2022/yukit-web-helm-avatar.mjs +298 -137
  16. package/fesm2022/yukit-web-helm-avatar.mjs.map +1 -1
  17. package/fesm2022/yukit-web-helm-badge.mjs +78 -44
  18. package/fesm2022/yukit-web-helm-badge.mjs.map +1 -1
  19. package/fesm2022/yukit-web-helm-breadcrumb.mjs +466 -183
  20. package/fesm2022/yukit-web-helm-breadcrumb.mjs.map +1 -1
  21. package/fesm2022/yukit-web-helm-bubble.mjs +297 -118
  22. package/fesm2022/yukit-web-helm-bubble.mjs.map +1 -1
  23. package/fesm2022/yukit-web-helm-button-group.mjs +179 -83
  24. package/fesm2022/yukit-web-helm-button-group.mjs.map +1 -1
  25. package/fesm2022/yukit-web-helm-button.mjs +137 -67
  26. package/fesm2022/yukit-web-helm-button.mjs.map +1 -1
  27. package/fesm2022/yukit-web-helm-calendar.mjs +957 -230
  28. package/fesm2022/yukit-web-helm-calendar.mjs.map +1 -1
  29. package/fesm2022/yukit-web-helm-card.mjs +318 -136
  30. package/fesm2022/yukit-web-helm-card.mjs.map +1 -1
  31. package/fesm2022/yukit-web-helm-carousel.mjs +563 -233
  32. package/fesm2022/yukit-web-helm-carousel.mjs.map +1 -1
  33. package/fesm2022/yukit-web-helm-checkbox.mjs +367 -101
  34. package/fesm2022/yukit-web-helm-checkbox.mjs.map +1 -1
  35. package/fesm2022/yukit-web-helm-collapsible.mjs +155 -61
  36. package/fesm2022/yukit-web-helm-collapsible.mjs.map +1 -1
  37. package/fesm2022/yukit-web-helm-combobox.mjs +1572 -481
  38. package/fesm2022/yukit-web-helm-combobox.mjs.map +1 -1
  39. package/fesm2022/yukit-web-helm-command.mjs +752 -260
  40. package/fesm2022/yukit-web-helm-command.mjs.map +1 -1
  41. package/fesm2022/yukit-web-helm-context-menu.mjs +161 -63
  42. package/fesm2022/yukit-web-helm-context-menu.mjs.map +1 -1
  43. package/fesm2022/yukit-web-helm-date-picker.mjs +2322 -932
  44. package/fesm2022/yukit-web-helm-date-picker.mjs.map +1 -1
  45. package/fesm2022/yukit-web-helm-dialog.mjs +625 -240
  46. package/fesm2022/yukit-web-helm-dialog.mjs.map +1 -1
  47. package/fesm2022/yukit-web-helm-drawer.mjs +539 -222
  48. package/fesm2022/yukit-web-helm-drawer.mjs.map +1 -1
  49. package/fesm2022/yukit-web-helm-dropdown-menu.mjs +1295 -493
  50. package/fesm2022/yukit-web-helm-dropdown-menu.mjs.map +1 -1
  51. package/fesm2022/yukit-web-helm-empty.mjs +280 -121
  52. package/fesm2022/yukit-web-helm-empty.mjs.map +1 -1
  53. package/fesm2022/yukit-web-helm-field.mjs +670 -301
  54. package/fesm2022/yukit-web-helm-field.mjs.map +1 -1
  55. package/fesm2022/yukit-web-helm-hover-card.mjs +198 -99
  56. package/fesm2022/yukit-web-helm-hover-card.mjs.map +1 -1
  57. package/fesm2022/yukit-web-helm-input-group.mjs +357 -165
  58. package/fesm2022/yukit-web-helm-input-group.mjs.map +1 -1
  59. package/fesm2022/yukit-web-helm-input-otp.mjs +306 -114
  60. package/fesm2022/yukit-web-helm-input-otp.mjs.map +1 -1
  61. package/fesm2022/yukit-web-helm-input.mjs +62 -30
  62. package/fesm2022/yukit-web-helm-input.mjs.map +1 -1
  63. package/fesm2022/yukit-web-helm-item.mjs +545 -227
  64. package/fesm2022/yukit-web-helm-item.mjs.map +1 -1
  65. package/fesm2022/yukit-web-helm-kbd.mjs +85 -44
  66. package/fesm2022/yukit-web-helm-kbd.mjs.map +1 -1
  67. package/fesm2022/yukit-web-helm-label.mjs +60 -28
  68. package/fesm2022/yukit-web-helm-label.mjs.map +1 -1
  69. package/fesm2022/yukit-web-helm-marker.mjs +165 -74
  70. package/fesm2022/yukit-web-helm-marker.mjs.map +1 -1
  71. package/fesm2022/yukit-web-helm-menubar.mjs +207 -82
  72. package/fesm2022/yukit-web-helm-menubar.mjs.map +1 -1
  73. package/fesm2022/yukit-web-helm-message.mjs +277 -112
  74. package/fesm2022/yukit-web-helm-message.mjs.map +1 -1
  75. package/fesm2022/yukit-web-helm-native-select.mjs +363 -129
  76. package/fesm2022/yukit-web-helm-native-select.mjs.map +1 -1
  77. package/fesm2022/yukit-web-helm-navigation-menu.mjs +398 -166
  78. package/fesm2022/yukit-web-helm-navigation-menu.mjs.map +1 -1
  79. package/fesm2022/yukit-web-helm-pagination.mjs +1444 -460
  80. package/fesm2022/yukit-web-helm-pagination.mjs.map +1 -1
  81. package/fesm2022/yukit-web-helm-popover.mjs +358 -133
  82. package/fesm2022/yukit-web-helm-popover.mjs.map +1 -1
  83. package/fesm2022/yukit-web-helm-progress.mjs +126 -58
  84. package/fesm2022/yukit-web-helm-progress.mjs.map +1 -1
  85. package/fesm2022/yukit-web-helm-radio-group.mjs +420 -144
  86. package/fesm2022/yukit-web-helm-radio-group.mjs.map +1 -1
  87. package/fesm2022/yukit-web-helm-resizable.mjs +210 -91
  88. package/fesm2022/yukit-web-helm-resizable.mjs.map +1 -1
  89. package/fesm2022/yukit-web-helm-scroll-area.mjs +64 -34
  90. package/fesm2022/yukit-web-helm-scroll-area.mjs.map +1 -1
  91. package/fesm2022/yukit-web-helm-select.mjs +1059 -351
  92. package/fesm2022/yukit-web-helm-select.mjs.map +1 -1
  93. package/fesm2022/yukit-web-helm-separator.mjs +61 -31
  94. package/fesm2022/yukit-web-helm-separator.mjs.map +1 -1
  95. package/fesm2022/yukit-web-helm-sheet.mjs +590 -231
  96. package/fesm2022/yukit-web-helm-sheet.mjs.map +1 -1
  97. package/fesm2022/yukit-web-helm-sidebar.mjs +1781 -757
  98. package/fesm2022/yukit-web-helm-sidebar.mjs.map +1 -1
  99. package/fesm2022/yukit-web-helm-skeleton.mjs +45 -27
  100. package/fesm2022/yukit-web-helm-skeleton.mjs.map +1 -1
  101. package/fesm2022/yukit-web-helm-slider.mjs +139 -59
  102. package/fesm2022/yukit-web-helm-slider.mjs.map +1 -1
  103. package/fesm2022/yukit-web-helm-sonner.mjs +350 -62
  104. package/fesm2022/yukit-web-helm-sonner.mjs.map +1 -1
  105. package/fesm2022/yukit-web-helm-spinner.mjs +118 -44
  106. package/fesm2022/yukit-web-helm-spinner.mjs.map +1 -1
  107. package/fesm2022/yukit-web-helm-switch.mjs +326 -94
  108. package/fesm2022/yukit-web-helm-switch.mjs.map +1 -1
  109. package/fesm2022/yukit-web-helm-table.mjs +374 -177
  110. package/fesm2022/yukit-web-helm-table.mjs.map +1 -1
  111. package/fesm2022/yukit-web-helm-tabs.mjs +549 -173
  112. package/fesm2022/yukit-web-helm-tabs.mjs.map +1 -1
  113. package/fesm2022/yukit-web-helm-textarea.mjs +62 -30
  114. package/fesm2022/yukit-web-helm-textarea.mjs.map +1 -1
  115. package/fesm2022/yukit-web-helm-toggle-group.mjs +291 -89
  116. package/fesm2022/yukit-web-helm-toggle-group.mjs.map +1 -1
  117. package/fesm2022/yukit-web-helm-toggle.mjs +132 -57
  118. package/fesm2022/yukit-web-helm-toggle.mjs.map +1 -1
  119. package/fesm2022/yukit-web-helm-tooltip.mjs +84 -54
  120. package/fesm2022/yukit-web-helm-tooltip.mjs.map +1 -1
  121. package/fesm2022/yukit-web-helm-typography.mjs +461 -202
  122. package/fesm2022/yukit-web-helm-typography.mjs.map +1 -1
  123. package/fesm2022/yukit-web-helm-utils.mjs +131 -253
  124. package/fesm2022/yukit-web-helm-utils.mjs.map +1 -1
  125. package/fesm2022/yukit-web.mjs +24592 -9669
  126. package/fesm2022/yukit-web.mjs.map +1 -1
  127. package/package.json +9 -9
  128. package/src/lib/theme/components/button.css +14 -0
  129. package/src/lib/theme/spartan-overwrites/sonner.css +2 -2
  130. package/src/lib/theme/tokens/component-colors.css +6 -2
  131. package/types/yukit-web-chart.d.ts +184 -125
  132. package/types/yukit-web-helm-accordion.d.ts +49 -28
  133. package/types/yukit-web-helm-alert-dialog.d.ts +127 -73
  134. package/types/yukit-web-helm-alert.d.ts +30 -32
  135. package/types/yukit-web-helm-aspect-ratio.d.ts +17 -15
  136. package/types/yukit-web-helm-attachment.d.ts +97 -69
  137. package/types/yukit-web-helm-autocomplete.d.ts +205 -79
  138. package/types/yukit-web-helm-avatar.d.ts +44 -39
  139. package/types/yukit-web-helm-badge.d.ts +18 -17
  140. package/types/yukit-web-helm-breadcrumb.d.ts +69 -45
  141. package/types/yukit-web-helm-bubble.d.ts +54 -40
  142. package/types/yukit-web-helm-button-group.d.ts +29 -22
  143. package/types/yukit-web-helm-button.d.ts +41 -31
  144. package/types/yukit-web-helm-calendar.d.ts +157 -85
  145. package/types/yukit-web-helm-card.d.ts +38 -42
  146. package/types/yukit-web-helm-carousel.d.ts +105 -73
  147. package/types/yukit-web-helm-checkbox.d.ts +117 -58
  148. package/types/yukit-web-helm-collapsible.d.ts +34 -19
  149. package/types/yukit-web-helm-combobox.d.ts +355 -150
  150. package/types/yukit-web-helm-command.d.ts +140 -73
  151. package/types/yukit-web-helm-context-menu.d.ts +48 -27
  152. package/types/yukit-web-helm-date-picker.d.ts +852 -556
  153. package/types/yukit-web-helm-dialog.d.ts +106 -78
  154. package/types/yukit-web-helm-drawer.d.ts +90 -61
  155. package/types/yukit-web-helm-dropdown-menu.d.ts +278 -158
  156. package/types/yukit-web-helm-empty.d.ts +38 -42
  157. package/types/yukit-web-helm-field.d.ts +122 -91
  158. package/types/yukit-web-helm-hover-card.d.ts +39 -27
  159. package/types/yukit-web-helm-input-group.d.ts +63 -41
  160. package/types/yukit-web-helm-input-otp.d.ts +38 -35
  161. package/types/yukit-web-helm-input.d.ts +19 -12
  162. package/types/yukit-web-helm-item.d.ts +90 -82
  163. package/types/yukit-web-helm-kbd.d.ts +10 -15
  164. package/types/yukit-web-helm-label.d.ts +14 -11
  165. package/types/yukit-web-helm-marker.d.ts +26 -27
  166. package/types/yukit-web-helm-menubar.d.ts +61 -32
  167. package/types/yukit-web-helm-message.d.ts +34 -38
  168. package/types/yukit-web-helm-native-select.d.ts +102 -61
  169. package/types/yukit-web-helm-navigation-menu.d.ts +76 -42
  170. package/types/yukit-web-helm-pagination.d.ts +344 -166
  171. package/types/yukit-web-helm-popover.d.ts +62 -42
  172. package/types/yukit-web-helm-progress.d.ts +27 -20
  173. package/types/yukit-web-helm-radio-group.d.ts +121 -63
  174. package/types/yukit-web-helm-resizable.d.ts +46 -24
  175. package/types/yukit-web-helm-scroll-area.d.ts +6 -10
  176. package/types/yukit-web-helm-select.d.ts +231 -114
  177. package/types/yukit-web-helm-separator.d.ts +15 -12
  178. package/types/yukit-web-helm-sheet.d.ts +94 -65
  179. package/types/yukit-web-helm-sidebar.d.ts +322 -232
  180. package/types/yukit-web-helm-skeleton.d.ts +6 -10
  181. package/types/yukit-web-helm-slider.d.ts +33 -13
  182. package/types/yukit-web-helm-sonner.d.ts +112 -51
  183. package/types/yukit-web-helm-spinner.d.ts +24 -17
  184. package/types/yukit-web-helm-switch.d.ts +89 -51
  185. package/types/yukit-web-helm-table.d.ts +38 -42
  186. package/types/yukit-web-helm-tabs.d.ts +116 -60
  187. package/types/yukit-web-helm-textarea.d.ts +19 -12
  188. package/types/yukit-web-helm-toggle-group.d.ts +81 -32
  189. package/types/yukit-web-helm-toggle.d.ts +39 -21
  190. package/types/yukit-web-helm-tooltip.d.ts +21 -16
  191. package/types/yukit-web-helm-typography.d.ts +62 -77
  192. package/types/yukit-web-helm-utils.d.ts +8 -11
  193. package/types/yukit-web.d.ts +5125 -2357
@@ -1,107 +1,125 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, computed, input, ChangeDetectionStrategy, Component, forwardRef, viewChild, contentChild, booleanAttribute, linkedSignal, signal, output, ElementRef, effect, Directive, numberAttribute, untracked } from '@angular/core';
3
- import { NgIcon, provideIcons } from '@ng-icons/core';
4
- import { lucideX, lucideCalendar, lucideChevronDown } from '@ng-icons/lucide';
5
- import { BrnDateInput, provideBrnDatePickerTrigger, BrnDatePickerTriggerToken, provideBrnDatePicker, injectBrnDatePicker } from '@spartan-ng/brain/date-picker';
6
- import * as i1$1 from '@spartan-ng/brain/field';
7
- import { BrnFieldControl, provideBrnLabelable, BrnFieldControlDescribedBy } from '@spartan-ng/brain/field';
8
- import * as i1 from 'yukit-web/helm/input-group';
9
- import { HlmInputGroup, HlmInputGroupImports } from 'yukit-web/helm/input-group';
10
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
11
- import { BrnPopover } from '@spartan-ng/brain/popover';
12
- import * as i3 from 'yukit-web/helm/calendar';
13
- import { HlmCalendar, HlmCalendarMulti, HlmCalendarRange, HlmCalendarImports } from 'yukit-web/helm/calendar';
14
- import * as i2 from 'yukit-web/helm/popover';
15
- import { HlmPopoverImports, HlmPopoverTrigger } from 'yukit-web/helm/popover';
16
- import { BrnOverlay } from '@spartan-ng/brain/overlay';
17
- import * as i1$2 from 'yukit-web/helm/button';
18
- import { HlmButtonImports } from 'yukit-web/helm/button';
19
- import { hlm } from 'yukit-web/helm/utils';
20
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, InjectionToken, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, linkedSignal, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
3
+ import { NgIcon, provideIcons } from "@ng-icons/core";
4
+ import { lucideCalendar, lucideChevronDown, lucideX } from "@ng-icons/lucide";
5
+ import { BrnDateInput, BrnDatePickerTriggerToken, injectBrnDatePicker, provideBrnDatePicker, provideBrnDatePickerTrigger } from "@spartan-ng/brain/date-picker";
6
+ import * as i1$1 from "@spartan-ng/brain/field";
7
+ import { BrnFieldControl, BrnFieldControlDescribedBy, provideBrnLabelable } from "@spartan-ng/brain/field";
8
+ import * as i1$2 from "yukit-web/helm/input-group";
9
+ import { HlmInputGroup, HlmInputGroupImports } from "yukit-web/helm/input-group";
10
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
11
+ import { BrnPopover } from "@spartan-ng/brain/popover";
12
+ import * as i3 from "yukit-web/helm/calendar";
13
+ import { HlmCalendar, HlmCalendarImports, HlmCalendarMulti, HlmCalendarRange } from "yukit-web/helm/calendar";
14
+ import * as i2 from "yukit-web/helm/popover";
15
+ import { HlmPopoverImports, HlmPopoverTrigger } from "yukit-web/helm/popover";
16
+ import { BrnOverlay } from "@spartan-ng/brain/overlay";
17
+ import * as i1 from "yukit-web/helm/button";
18
+ import { HlmButtonImports } from "yukit-web/helm/button";
19
+ import { hlm } from "yukit-web/helm/utils";
21
20
  function getDefaultConfig$3() {
22
- return {
23
- formatDates: (dates) => dates.map((date) => (date instanceof Date ? date.toDateString() : `${date}`)).join(', '),
24
- formatInputDates: (dates) => dates
25
- .map((date) => {
26
- if (!(date instanceof Date))
27
- return `${date}`;
28
- const day = String(date.getDate()).padStart(2, '0');
29
- const month = String(date.getMonth() + 1).padStart(2, '0');
30
- const year = date.getFullYear();
31
- return `${day}/${month}/${year}`;
32
- })
33
- .join(', '),
34
- transformDates: (dates) => dates,
35
- autoCloseOnMaxSelection: false,
36
- parseDate: (value) => {
37
- if (typeof value !== 'string')
38
- return null;
39
- const parts = value.split(',').map((v) => v.trim());
40
- const result = [];
41
- for (const part of parts) {
42
- const match = part.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
43
- if (!match)
44
- return null;
45
- const day = Number(match[1]);
46
- const month = Number(match[2]);
47
- const year = Number(match[3]);
48
- if (month < 1 || month > 12)
49
- return null;
50
- if (day < 1 || day > 31)
51
- return null;
52
- const date = new Date(year, month - 1, day);
53
- if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
54
- return null;
55
- }
56
- result.push(date);
57
- }
58
- return result;
59
- },
60
- };
21
+ return {
22
+ formatDates: (dates) => dates.map((date) => date instanceof Date ? date.toDateString() : `${date}`).join(", "),
23
+ formatInputDates: (dates) => dates.map((date) => {
24
+ if (!(date instanceof Date)) return `${date}`;
25
+ return `${String(date.getDate()).padStart(2, "0")}/${String(date.getMonth() + 1).padStart(2, "0")}/${date.getFullYear()}`;
26
+ }).join(", "),
27
+ transformDates: (dates) => dates,
28
+ autoCloseOnMaxSelection: false,
29
+ parseDate: (value) => {
30
+ if (typeof value !== "string") return null;
31
+ const parts = value.split(",").map((v) => v.trim());
32
+ const result = [];
33
+ for (const part of parts) {
34
+ const match = part.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
35
+ if (!match) return null;
36
+ const day = Number(match[1]);
37
+ const month = Number(match[2]);
38
+ const year = Number(match[3]);
39
+ if (month < 1 || month > 12) return null;
40
+ if (day < 1 || day > 31) return null;
41
+ const date = new Date(year, month - 1, day);
42
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) return null;
43
+ result.push(date);
44
+ }
45
+ return result;
46
+ }
47
+ };
61
48
  }
62
- const HlmDatePickerMultiConfigToken = new InjectionToken('HlmDatePickerMultiConfig');
49
+ const HlmDatePickerMultiConfigToken = new InjectionToken("HlmDatePickerMultiConfig");
63
50
  function provideHlmDatePickerMultiConfig(config) {
64
- return { provide: HlmDatePickerMultiConfigToken, useValue: { ...getDefaultConfig$3(), ...config } };
51
+ return {
52
+ provide: HlmDatePickerMultiConfigToken,
53
+ useValue: {
54
+ ...getDefaultConfig$3(),
55
+ ...config
56
+ }
57
+ };
65
58
  }
66
59
  function injectHlmDatePickerMultiConfig() {
67
- const injectedConfig = inject(HlmDatePickerMultiConfigToken, { optional: true });
68
- return injectedConfig ? injectedConfig : getDefaultConfig$3();
60
+ const injectedConfig = inject(HlmDatePickerMultiConfigToken, { optional: true });
61
+ return injectedConfig ? injectedConfig : getDefaultConfig$3();
69
62
  }
70
-
71
- class HlmDateMultiInput extends BrnDateInput {
72
- constructor() {
73
- super(...arguments);
74
- this._config = injectHlmDatePickerMultiConfig();
75
- this._fieldControl = inject(BrnFieldControl, { optional: true });
76
- this._invalid = this._fieldControl?.invalid;
77
- this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
78
- this._dirty = this._fieldControl?.dirty;
79
- this._touched = this._fieldControl?.touched;
80
- this._ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
81
- /**
82
- * Parses input text into dates. Return `null` for invalid input - the
83
- * picker's dates are cleared while the text is preserved so the user can
84
- * fix it.
85
- *
86
- * Defaults to `parseDate` from `HlmDatePickerMultiConfig`.
87
- */
88
- this.parseDate = input(this._config.parseDate, ...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
89
- /**
90
- * Formats the current dates into the input/edit format shown while the
91
- * input is focused. On blur the picker's display format is restored.
92
- *
93
- * Defaults to `formatInputDates` from `HlmDatePickerMultiConfig`.
94
- */
95
- this.formatInputDates = input(this._config.formatInputDates, ...(ngDevMode ? [{ debugName: "formatInputDates" }] : /* istanbul ignore next */ []));
96
- }
97
- parseValue(value) {
98
- return this.parseDate()(value);
99
- }
100
- formatInputValue(value) {
101
- return this.formatInputDates()(value);
102
- }
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateMultiInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
104
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HlmDateMultiInput, isStandalone: true, selector: "hlm-date-multi-input", inputs: { parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDates: { classPropertyName: "formatInputDates", publicName: "formatInputDates", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDateMultiInput)], usesInheritance: true, hostDirectives: [{ directive: i1.HlmInputGroup }], ngImport: i0, template: `
63
+ var HlmDateMultiInput = class HlmDateMultiInput extends BrnDateInput {
64
+ constructor() {
65
+ super(...arguments);
66
+ this._config = injectHlmDatePickerMultiConfig();
67
+ this._fieldControl = inject(BrnFieldControl, { optional: true });
68
+ this._invalid = this._fieldControl?.invalid;
69
+ this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []);
70
+ this._dirty = this._fieldControl?.dirty;
71
+ this._touched = this._fieldControl?.touched;
72
+ this._ariaInvalid = computed(() => this._invalid?.() ? "true" : null, ...ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []);
73
+ this.parseDate = input(this._config.parseDate, ...ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []);
74
+ this.formatInputDates = input(this._config.formatInputDates, ...ngDevMode ? [{ debugName: "formatInputDates" }] : /* istanbul ignore next */ []);
75
+ }
76
+ parseValue(value) {
77
+ return this.parseDate()(value);
78
+ }
79
+ formatInputValue(value) {
80
+ return this.formatInputDates()(value);
81
+ }
82
+ static {
83
+ this.ɵfac = i0.ɵɵngDeclareFactory({
84
+ minVersion: "12.0.0",
85
+ version: "22.2.4",
86
+ ngImport: i0,
87
+ type: HlmDateMultiInput,
88
+ deps: null,
89
+ target: i0.ɵɵFactoryTarget.Component
90
+ });
91
+ }
92
+ static {
93
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
94
+ minVersion: "17.0.0",
95
+ version: "22.2.4",
96
+ type: HlmDateMultiInput,
97
+ isStandalone: true,
98
+ selector: "hlm-date-multi-input",
99
+ inputs: {
100
+ parseDate: {
101
+ classPropertyName: "parseDate",
102
+ publicName: "parseDate",
103
+ isSignal: true,
104
+ isRequired: false,
105
+ transformFunction: null
106
+ },
107
+ formatInputDates: {
108
+ classPropertyName: "formatInputDates",
109
+ publicName: "formatInputDates",
110
+ isSignal: true,
111
+ isRequired: false,
112
+ transformFunction: null
113
+ }
114
+ },
115
+ providers: [provideIcons({
116
+ lucideCalendar,
117
+ lucideX
118
+ }), provideBrnDatePickerTrigger(HlmDateMultiInput)],
119
+ usesInheritance: true,
120
+ hostDirectives: [{ directive: i1$2.HlmInputGroup }],
121
+ ngImport: i0,
122
+ template: `
105
123
  <input
106
124
  #input
107
125
  hlmInputGroupInput
@@ -145,17 +163,60 @@ class HlmDateMultiInput extends BrnDateInput {
145
163
  <ng-icon name="lucideCalendar" />
146
164
  </button>
147
165
  </hlm-input-group-addon>
148
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
149
- }
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateMultiInput, decorators: [{
151
- type: Component,
152
- args: [{
153
- selector: 'hlm-date-multi-input',
154
- imports: [HlmInputGroupImports, NgIcon],
155
- providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDateMultiInput)],
156
- changeDetection: ChangeDetectionStrategy.OnPush,
157
- hostDirectives: [HlmInputGroup],
158
- template: `
166
+ `,
167
+ isInline: true,
168
+ dependencies: [
169
+ {
170
+ kind: "directive",
171
+ type: i1$2.HlmInputGroupAddon,
172
+ selector: "[hlmInputGroupAddon],hlm-input-group-addon",
173
+ inputs: ["align"]
174
+ },
175
+ {
176
+ kind: "directive",
177
+ type: i1$2.HlmInputGroupButton,
178
+ selector: "button[hlmInputGroupButton]",
179
+ inputs: ["size", "type"]
180
+ },
181
+ {
182
+ kind: "directive",
183
+ type: i1$2.HlmInputGroupInput,
184
+ selector: "input[hlmInputGroupInput]"
185
+ },
186
+ {
187
+ kind: "component",
188
+ type: NgIcon,
189
+ selector: "ng-icon",
190
+ inputs: [
191
+ "name",
192
+ "svg",
193
+ "size",
194
+ "strokeWidth",
195
+ "color"
196
+ ]
197
+ }
198
+ ],
199
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
200
+ });
201
+ }
202
+ };
203
+ i0.ɵɵngDeclareClassMetadata({
204
+ minVersion: "12.0.0",
205
+ version: "22.2.4",
206
+ ngImport: i0,
207
+ type: HlmDateMultiInput,
208
+ decorators: [{
209
+ type: Component,
210
+ args: [{
211
+ selector: "hlm-date-multi-input",
212
+ imports: [HlmInputGroupImports, NgIcon],
213
+ providers: [provideIcons({
214
+ lucideCalendar,
215
+ lucideX
216
+ }), provideBrnDatePickerTrigger(HlmDateMultiInput)],
217
+ changeDetection: ChangeDetectionStrategy.OnPush,
218
+ hostDirectives: [HlmInputGroup],
219
+ template: `
159
220
  <input
160
221
  #input
161
222
  hlmInputGroupInput
@@ -199,131 +260,248 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
199
260
  <ng-icon name="lucideCalendar" />
200
261
  </button>
201
262
  </hlm-input-group-addon>
202
- `,
203
- }]
204
- }], propDecorators: { parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDates", required: false }] }] } });
205
-
263
+ `
264
+ }]
265
+ }],
266
+ propDecorators: {
267
+ parseDate: [{
268
+ type: i0.Input,
269
+ args: [{
270
+ isSignal: true,
271
+ alias: "parseDate",
272
+ required: false
273
+ }]
274
+ }],
275
+ formatInputDates: [{
276
+ type: i0.Input,
277
+ args: [{
278
+ isSignal: true,
279
+ alias: "formatInputDates",
280
+ required: false
281
+ }]
282
+ }]
283
+ }
284
+ });
206
285
  function getDefaultConfig$2() {
207
- return {
208
- formatDate: (date) => (date instanceof Date ? date.toDateString() : `${date}`),
209
- formatInputDate: (date) => (date instanceof Date ? date.toDateString() : `${date}`),
210
- transformDate: (date) => date,
211
- parseDate: (value) => {
212
- const date = new Date(value);
213
- return isNaN(date.getTime()) ? null : date;
214
- },
215
- autoCloseOnSelect: false,
216
- };
286
+ return {
287
+ formatDate: (date) => date instanceof Date ? date.toDateString() : `${date}`,
288
+ formatInputDate: (date) => date instanceof Date ? date.toDateString() : `${date}`,
289
+ transformDate: (date) => date,
290
+ parseDate: (value) => {
291
+ const date = new Date(value);
292
+ return isNaN(date.getTime()) ? null : date;
293
+ },
294
+ autoCloseOnSelect: false
295
+ };
217
296
  }
218
- const HlmDatePickerConfigToken = new InjectionToken('HlmDatePickerConfig');
297
+ const HlmDatePickerConfigToken = new InjectionToken("HlmDatePickerConfig");
219
298
  function provideHlmDatePickerConfig(config) {
220
- return { provide: HlmDatePickerConfigToken, useValue: { ...getDefaultConfig$2(), ...config } };
299
+ return {
300
+ provide: HlmDatePickerConfigToken,
301
+ useValue: {
302
+ ...getDefaultConfig$2(),
303
+ ...config
304
+ }
305
+ };
221
306
  }
222
307
  function injectHlmDatePickerConfig() {
223
- const injectedConfig = inject(HlmDatePickerConfigToken, { optional: true });
224
- return injectedConfig ? injectedConfig : getDefaultConfig$2();
308
+ const injectedConfig = inject(HlmDatePickerConfigToken, { optional: true });
309
+ return injectedConfig ? injectedConfig : getDefaultConfig$2();
225
310
  }
226
-
227
311
  const HLM_DATE_PICKER_VALUE_ACCESSOR = {
228
- provide: NG_VALUE_ACCESSOR,
229
- useExisting: forwardRef(() => HlmDatePicker),
230
- multi: true,
312
+ provide: NG_VALUE_ACCESSOR,
313
+ useExisting: forwardRef(() => HlmDatePicker),
314
+ multi: true
231
315
  };
232
- class HlmDatePicker {
233
- constructor() {
234
- this._config = injectHlmDatePickerConfig();
235
- this.popover = viewChild.required(BrnPopover);
236
- this._trigger = contentChild(BrnDatePickerTriggerToken, ...(ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []));
237
- this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
238
- /** Show dropdowns to navigate between months or years. */
239
- this.captionLayout = input('label', ...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
240
- /** The minimum date that can be selected. */
241
- this.minDate = input(...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
242
- /** The maximum date that can be selected. */
243
- this.maxDate = input(...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
244
- /** Determine if the date picker is disabled. */
245
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
246
- /** The selected value. */
247
- this.date = input(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
248
- /** The date the calendar focuses on first open when no date is selected. */
249
- this.defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
250
- this._mutableDate = linkedSignal(this.date, ...(ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []));
251
- /** If true, the date picker will close when a date is selected. */
252
- this.autoCloseOnSelect = input(this._config.autoCloseOnSelect, { ...(ngDevMode ? { debugName: "autoCloseOnSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
253
- /** Defines how the date should be displayed in the UI. */
254
- this.formatDate = input(this._config.formatDate, ...(ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []));
255
- /** Defines how the date should be transformed before saving to model/form. */
256
- this.transformDate = input(this._config.transformDate, ...(ngDevMode ? [{ debugName: "transformDate" }] : /* istanbul ignore next */ []));
257
- this._popoverState = signal(null, ...(ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []));
258
- this._disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
259
- /** @internal The disabled state as a readonly signal */
260
- this.disabledState = this._disabled.asReadonly();
261
- this.formattedDate = computed(() => {
262
- const date = this._mutableDate();
263
- return date ? this.formatDate()(date) : undefined;
264
- }, ...(ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []));
265
- this.dateChange = output();
266
- this.labelableId = computed(() => this._trigger()?.triggerId(), ...(ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []));
267
- this.hasDate = computed(() => !!this._mutableDate(), ...(ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []));
268
- /** @internal The current raw value, used by inputs to reformat on focus. */
269
- this.value = computed(() => this._mutableDate() ?? null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
270
- }
271
- _onStateChange(state) {
272
- this._popoverState.set(state);
273
- if (state === 'closed')
274
- this._onTouched?.();
275
- }
276
- _handleChange(value) {
277
- if (this._disabled())
278
- return;
279
- this.updateDate(value ?? null);
280
- if (this.autoCloseOnSelect()) {
281
- this._popoverState.set('closed');
282
- }
283
- }
284
- /**
285
- * Commit a date to the picker. Updates the internal model, notifies form
286
- * controls, and emits `dateChange`. Unlike `_handleChange`, this does not
287
- * close the popover - it's intended to be called from a text input that
288
- * is parsing user-entered values while typing.
289
- */
290
- updateDate(value) {
291
- if (this._disabled())
292
- return;
293
- const transformedDate = value != null ? this.transformDate()(value) : undefined;
294
- this._mutableDate.set(transformedDate);
295
- this._onChange?.(transformedDate ?? null);
296
- this.dateChange.emit(transformedDate ?? null);
297
- }
298
- /** CONTROL VALUE ACCESSOR */
299
- writeValue(value) {
300
- this._mutableDate.set(value ? this.transformDate()(value) : undefined);
301
- }
302
- registerOnChange(fn) {
303
- this._onChange = fn;
304
- }
305
- registerOnTouched(fn) {
306
- this._onTouched = fn;
307
- }
308
- touched() {
309
- this._onTouched?.();
310
- }
311
- setDisabledState(isDisabled) {
312
- this._disabled.set(isDisabled);
313
- }
314
- open() {
315
- this._popoverState.set('open');
316
- }
317
- close() {
318
- this._popoverState.set('closed');
319
- }
320
- reset() {
321
- this._mutableDate.set(undefined);
322
- this._onChange?.(null);
323
- this.dateChange.emit(null);
324
- }
325
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
326
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: HlmDatePicker, isStandalone: true, selector: "hlm-date-picker", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnSelect: { classPropertyName: "autoCloseOnSelect", publicName: "autoCloseOnSelect", isSignal: true, isRequired: false, transformFunction: null }, formatDate: { classPropertyName: "formatDate", publicName: "formatDate", isSignal: true, isRequired: false, transformFunction: null }, transformDate: { classPropertyName: "transformDate", publicName: "transformDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange" }, host: { classAttribute: "block" }, providers: [HLM_DATE_PICKER_VALUE_ACCESSOR, provideBrnDatePicker(HlmDatePicker), provideBrnLabelable(HlmDatePicker)], queries: [{ propertyName: "_trigger", first: true, predicate: BrnDatePickerTriggerToken, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: BrnPopover, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.BrnFieldControl }], ngImport: i0, template: `
316
+ var HlmDatePicker = class HlmDatePicker {
317
+ constructor() {
318
+ this._config = injectHlmDatePickerConfig();
319
+ this.popover = viewChild.required(BrnPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
320
+ this._trigger = contentChild(BrnDatePickerTriggerToken, ...ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []);
321
+ this.align = input("center", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
322
+ this.captionLayout = input("label", ...ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []);
323
+ this.minDate = input(...ngDevMode ? [void 0, { debugName: "minDate" }] : /* istanbul ignore next */ []);
324
+ this.maxDate = input(...ngDevMode ? [void 0, { debugName: "maxDate" }] : /* istanbul ignore next */ []);
325
+ this.disabled = input(false, {
326
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
327
+ transform: booleanAttribute
328
+ });
329
+ this.date = input(...ngDevMode ? [void 0, { debugName: "date" }] : /* istanbul ignore next */ []);
330
+ this.defaultFocusedDate = input(...ngDevMode ? [void 0, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []);
331
+ this._mutableDate = linkedSignal(this.date, ...ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []);
332
+ this.autoCloseOnSelect = input(this._config.autoCloseOnSelect, {
333
+ ...ngDevMode ? { debugName: "autoCloseOnSelect" } : /* istanbul ignore next */ {},
334
+ transform: booleanAttribute
335
+ });
336
+ this.formatDate = input(this._config.formatDate, ...ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []);
337
+ this.transformDate = input(this._config.transformDate, ...ngDevMode ? [{ debugName: "transformDate" }] : /* istanbul ignore next */ []);
338
+ this._popoverState = signal(null, ...ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []);
339
+ this._disabled = linkedSignal(this.disabled, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
340
+ this.disabledState = this._disabled.asReadonly();
341
+ this.formattedDate = computed(() => {
342
+ const date = this._mutableDate();
343
+ return date ? this.formatDate()(date) : void 0;
344
+ }, ...ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []);
345
+ this.dateChange = output();
346
+ this.labelableId = computed(() => this._trigger()?.triggerId(), ...ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []);
347
+ this.hasDate = computed(() => !!this._mutableDate(), ...ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []);
348
+ this.value = computed(() => this._mutableDate() ?? null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
349
+ }
350
+ _onStateChange(state) {
351
+ this._popoverState.set(state);
352
+ if (state === "closed") this._onTouched?.();
353
+ }
354
+ _handleChange(value) {
355
+ if (this._disabled()) return;
356
+ this.updateDate(value ?? null);
357
+ if (this.autoCloseOnSelect()) this._popoverState.set("closed");
358
+ }
359
+ updateDate(value) {
360
+ if (this._disabled()) return;
361
+ const transformedDate = value != null ? this.transformDate()(value) : void 0;
362
+ this._mutableDate.set(transformedDate);
363
+ this._onChange?.(transformedDate ?? null);
364
+ this.dateChange.emit(transformedDate ?? null);
365
+ }
366
+ writeValue(value) {
367
+ this._mutableDate.set(value ? this.transformDate()(value) : void 0);
368
+ }
369
+ registerOnChange(fn) {
370
+ this._onChange = fn;
371
+ }
372
+ registerOnTouched(fn) {
373
+ this._onTouched = fn;
374
+ }
375
+ touched() {
376
+ this._onTouched?.();
377
+ }
378
+ setDisabledState(isDisabled) {
379
+ this._disabled.set(isDisabled);
380
+ }
381
+ open() {
382
+ this._popoverState.set("open");
383
+ }
384
+ close() {
385
+ this._popoverState.set("closed");
386
+ }
387
+ reset() {
388
+ this._mutableDate.set(void 0);
389
+ this._onChange?.(null);
390
+ this.dateChange.emit(null);
391
+ }
392
+ static {
393
+ this.ɵfac = i0.ɵɵngDeclareFactory({
394
+ minVersion: "12.0.0",
395
+ version: "22.2.4",
396
+ ngImport: i0,
397
+ type: HlmDatePicker,
398
+ deps: [],
399
+ target: i0.ɵɵFactoryTarget.Component
400
+ });
401
+ }
402
+ static {
403
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
404
+ minVersion: "17.2.0",
405
+ version: "22.2.4",
406
+ type: HlmDatePicker,
407
+ isStandalone: true,
408
+ selector: "hlm-date-picker",
409
+ inputs: {
410
+ align: {
411
+ classPropertyName: "align",
412
+ publicName: "align",
413
+ isSignal: true,
414
+ isRequired: false,
415
+ transformFunction: null
416
+ },
417
+ captionLayout: {
418
+ classPropertyName: "captionLayout",
419
+ publicName: "captionLayout",
420
+ isSignal: true,
421
+ isRequired: false,
422
+ transformFunction: null
423
+ },
424
+ minDate: {
425
+ classPropertyName: "minDate",
426
+ publicName: "minDate",
427
+ isSignal: true,
428
+ isRequired: false,
429
+ transformFunction: null
430
+ },
431
+ maxDate: {
432
+ classPropertyName: "maxDate",
433
+ publicName: "maxDate",
434
+ isSignal: true,
435
+ isRequired: false,
436
+ transformFunction: null
437
+ },
438
+ disabled: {
439
+ classPropertyName: "disabled",
440
+ publicName: "disabled",
441
+ isSignal: true,
442
+ isRequired: false,
443
+ transformFunction: null
444
+ },
445
+ date: {
446
+ classPropertyName: "date",
447
+ publicName: "date",
448
+ isSignal: true,
449
+ isRequired: false,
450
+ transformFunction: null
451
+ },
452
+ defaultFocusedDate: {
453
+ classPropertyName: "defaultFocusedDate",
454
+ publicName: "defaultFocusedDate",
455
+ isSignal: true,
456
+ isRequired: false,
457
+ transformFunction: null
458
+ },
459
+ autoCloseOnSelect: {
460
+ classPropertyName: "autoCloseOnSelect",
461
+ publicName: "autoCloseOnSelect",
462
+ isSignal: true,
463
+ isRequired: false,
464
+ transformFunction: null
465
+ },
466
+ formatDate: {
467
+ classPropertyName: "formatDate",
468
+ publicName: "formatDate",
469
+ isSignal: true,
470
+ isRequired: false,
471
+ transformFunction: null
472
+ },
473
+ transformDate: {
474
+ classPropertyName: "transformDate",
475
+ publicName: "transformDate",
476
+ isSignal: true,
477
+ isRequired: false,
478
+ transformFunction: null
479
+ }
480
+ },
481
+ outputs: { dateChange: "dateChange" },
482
+ host: { classAttribute: "block" },
483
+ providers: [
484
+ HLM_DATE_PICKER_VALUE_ACCESSOR,
485
+ provideBrnDatePicker(HlmDatePicker),
486
+ provideBrnLabelable(HlmDatePicker)
487
+ ],
488
+ queries: [{
489
+ propertyName: "_trigger",
490
+ first: true,
491
+ predicate: BrnDatePickerTriggerToken,
492
+ descendants: true,
493
+ isSignal: true
494
+ }],
495
+ viewQueries: [{
496
+ propertyName: "popover",
497
+ first: true,
498
+ predicate: BrnPopover,
499
+ descendants: true,
500
+ isSignal: true
501
+ }],
502
+ hostDirectives: [{ directive: i1$1.BrnFieldControl }],
503
+ ngImport: i0,
504
+ template: `
327
505
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
328
506
  <ng-content />
329
507
 
@@ -342,18 +520,54 @@ class HlmDatePicker {
342
520
  <ng-content select="[hlmDatePickerFooter]" />
343
521
  </hlm-popover-content>
344
522
  </hlm-popover>
345
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: i2.HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "directive", type: i2.HlmPopoverPortal, selector: "[hlmPopoverPortal]" }, { kind: "component", type: HlmCalendar, selector: "hlm-calendar", inputs: ["captionLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
346
- }
347
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePicker, decorators: [{
348
- type: Component,
349
- args: [{
350
- selector: 'hlm-date-picker',
351
- imports: [HlmPopoverImports, HlmCalendar],
352
- providers: [HLM_DATE_PICKER_VALUE_ACCESSOR, provideBrnDatePicker(HlmDatePicker), provideBrnLabelable(HlmDatePicker)],
353
- changeDetection: ChangeDetectionStrategy.OnPush,
354
- hostDirectives: [BrnFieldControl],
355
- host: { class: 'block' },
356
- template: `
523
+ `,
524
+ isInline: true,
525
+ dependencies: [
526
+ {
527
+ kind: "directive",
528
+ type: i2.HlmPopover,
529
+ selector: "[hlmPopover],hlm-popover"
530
+ },
531
+ {
532
+ kind: "directive",
533
+ type: i2.HlmPopoverContent,
534
+ selector: "[hlmPopoverContent],hlm-popover-content"
535
+ },
536
+ {
537
+ kind: "directive",
538
+ type: i2.HlmPopoverPortal,
539
+ selector: "[hlmPopoverPortal]"
540
+ },
541
+ {
542
+ kind: "component",
543
+ type: HlmCalendar,
544
+ selector: "hlm-calendar",
545
+ inputs: ["captionLayout"]
546
+ }
547
+ ],
548
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
549
+ });
550
+ }
551
+ };
552
+ i0.ɵɵngDeclareClassMetadata({
553
+ minVersion: "12.0.0",
554
+ version: "22.2.4",
555
+ ngImport: i0,
556
+ type: HlmDatePicker,
557
+ decorators: [{
558
+ type: Component,
559
+ args: [{
560
+ selector: "hlm-date-picker",
561
+ imports: [HlmPopoverImports, HlmCalendar],
562
+ providers: [
563
+ HLM_DATE_PICKER_VALUE_ACCESSOR,
564
+ provideBrnDatePicker(HlmDatePicker),
565
+ provideBrnLabelable(HlmDatePicker)
566
+ ],
567
+ changeDetection: ChangeDetectionStrategy.OnPush,
568
+ hostDirectives: [BrnFieldControl],
569
+ host: { class: "block" },
570
+ template: `
357
571
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
358
572
  <ng-content />
359
573
 
@@ -372,63 +586,225 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
372
586
  <ng-content select="[hlmDatePickerFooter]" />
373
587
  </hlm-popover-content>
374
588
  </hlm-popover>
375
- `,
376
- }]
377
- }], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnPopover), { isSignal: true }] }], _trigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], autoCloseOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnSelect", required: false }] }], formatDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDate", required: false }] }], transformDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDate", required: false }] }], dateChange: [{ type: i0.Output, args: ["dateChange"] }] } });
378
-
379
- class HlmDatePickerAnchor {
380
- constructor() {
381
- this._host = inject(ElementRef, { host: true });
382
- this._brnOverlay = inject(BrnOverlay, { optional: true });
383
- this.hlmDatePickerAnchorForInput = input(undefined, { ...(ngDevMode ? { debugName: "hlmDatePickerAnchorForInput" } : /* istanbul ignore next */ {}), alias: 'hlmDatePickerAnchorFor' });
384
- this.hlmDatePickerAnchorFor = linkedSignal(this.hlmDatePickerAnchorForInput, ...(ngDevMode ? [{ debugName: "hlmDatePickerAnchorFor" }] : /* istanbul ignore next */ []));
385
- effect(() => {
386
- this.hlmDatePickerAnchorFor()?.setOrigin(this._host.nativeElement);
387
- });
388
- this._brnOverlay?.setOrigin(this._host.nativeElement);
389
- }
390
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerAnchor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
391
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: HlmDatePickerAnchor, isStandalone: true, selector: "[hlmDatePickerAnchor]", inputs: { hlmDatePickerAnchorForInput: { classPropertyName: "hlmDatePickerAnchorForInput", publicName: "hlmDatePickerAnchorFor", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
392
- }
393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerAnchor, decorators: [{
394
- type: Directive,
395
- args: [{ selector: '[hlmDatePickerAnchor]' }]
396
- }], ctorParameters: () => [], propDecorators: { hlmDatePickerAnchorForInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "hlmDatePickerAnchorFor", required: false }] }] } });
397
-
398
- class HlmDatePickerInput extends BrnDateInput {
399
- constructor() {
400
- super(...arguments);
401
- this._config = injectHlmDatePickerConfig();
402
- this._fieldControl = inject(BrnFieldControl, { optional: true });
403
- this._invalid = this._fieldControl?.invalid;
404
- this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
405
- this._dirty = this._fieldControl?.dirty;
406
- this._touched = this._fieldControl?.touched;
407
- this._ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
408
- /**
409
- * Parses input text into a date value. Return `null` for invalid
410
- * input - the picker's date is cleared while the text is preserved so
411
- * the user can fix it.
412
- *
413
- * Defaults to `parseDate` from `HlmDatePickerConfig`.
414
- */
415
- this.parseDate = input(this._config.parseDate, ...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
416
- /**
417
- * Formats the current date into the input/edit format shown while the
418
- * input is focused. On blur the picker's display format is restored.
419
- *
420
- * Defaults to `formatInputDate` from `HlmDatePickerConfig`.
421
- */
422
- this.formatInputDate = input(this._config.formatInputDate, ...(ngDevMode ? [{ debugName: "formatInputDate" }] : /* istanbul ignore next */ []));
423
- }
424
- parseValue(value) {
425
- return this.parseDate()(value);
426
- }
427
- formatInputValue(value) {
428
- return this.formatInputDate()(value);
429
- }
430
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
431
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HlmDatePickerInput, isStandalone: true, selector: "hlm-date-picker-input", inputs: { parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDate: { classPropertyName: "formatInputDate", publicName: "formatInputDate", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDatePickerInput)], usesInheritance: true, hostDirectives: [{ directive: i1.HlmInputGroup }], ngImport: i0, template: `
589
+ `
590
+ }]
591
+ }],
592
+ propDecorators: {
593
+ popover: [{
594
+ type: i0.ViewChild,
595
+ args: [i0.forwardRef(() => BrnPopover), { isSignal: true }]
596
+ }],
597
+ _trigger: [{
598
+ type: i0.ContentChild,
599
+ args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }]
600
+ }],
601
+ align: [{
602
+ type: i0.Input,
603
+ args: [{
604
+ isSignal: true,
605
+ alias: "align",
606
+ required: false
607
+ }]
608
+ }],
609
+ captionLayout: [{
610
+ type: i0.Input,
611
+ args: [{
612
+ isSignal: true,
613
+ alias: "captionLayout",
614
+ required: false
615
+ }]
616
+ }],
617
+ minDate: [{
618
+ type: i0.Input,
619
+ args: [{
620
+ isSignal: true,
621
+ alias: "minDate",
622
+ required: false
623
+ }]
624
+ }],
625
+ maxDate: [{
626
+ type: i0.Input,
627
+ args: [{
628
+ isSignal: true,
629
+ alias: "maxDate",
630
+ required: false
631
+ }]
632
+ }],
633
+ disabled: [{
634
+ type: i0.Input,
635
+ args: [{
636
+ isSignal: true,
637
+ alias: "disabled",
638
+ required: false
639
+ }]
640
+ }],
641
+ date: [{
642
+ type: i0.Input,
643
+ args: [{
644
+ isSignal: true,
645
+ alias: "date",
646
+ required: false
647
+ }]
648
+ }],
649
+ defaultFocusedDate: [{
650
+ type: i0.Input,
651
+ args: [{
652
+ isSignal: true,
653
+ alias: "defaultFocusedDate",
654
+ required: false
655
+ }]
656
+ }],
657
+ autoCloseOnSelect: [{
658
+ type: i0.Input,
659
+ args: [{
660
+ isSignal: true,
661
+ alias: "autoCloseOnSelect",
662
+ required: false
663
+ }]
664
+ }],
665
+ formatDate: [{
666
+ type: i0.Input,
667
+ args: [{
668
+ isSignal: true,
669
+ alias: "formatDate",
670
+ required: false
671
+ }]
672
+ }],
673
+ transformDate: [{
674
+ type: i0.Input,
675
+ args: [{
676
+ isSignal: true,
677
+ alias: "transformDate",
678
+ required: false
679
+ }]
680
+ }],
681
+ dateChange: [{
682
+ type: i0.Output,
683
+ args: ["dateChange"]
684
+ }]
685
+ }
686
+ });
687
+ var HlmDatePickerAnchor = class HlmDatePickerAnchor {
688
+ constructor() {
689
+ this._host = inject(ElementRef, { host: true });
690
+ this._brnOverlay = inject(BrnOverlay, { optional: true });
691
+ this.hlmDatePickerAnchorForInput = input(void 0, {
692
+ ...ngDevMode ? { debugName: "hlmDatePickerAnchorForInput" } : /* istanbul ignore next */ {},
693
+ alias: "hlmDatePickerAnchorFor"
694
+ });
695
+ this.hlmDatePickerAnchorFor = linkedSignal(this.hlmDatePickerAnchorForInput, ...ngDevMode ? [{ debugName: "hlmDatePickerAnchorFor" }] : /* istanbul ignore next */ []);
696
+ effect(() => {
697
+ this.hlmDatePickerAnchorFor()?.setOrigin(this._host.nativeElement);
698
+ });
699
+ this._brnOverlay?.setOrigin(this._host.nativeElement);
700
+ }
701
+ static {
702
+ this.ɵfac = i0.ɵɵngDeclareFactory({
703
+ minVersion: "12.0.0",
704
+ version: "22.2.4",
705
+ ngImport: i0,
706
+ type: HlmDatePickerAnchor,
707
+ deps: [],
708
+ target: i0.ɵɵFactoryTarget.Directive
709
+ });
710
+ }
711
+ static {
712
+ this.ɵdir = i0.ɵɵngDeclareDirective({
713
+ minVersion: "17.1.0",
714
+ version: "22.2.4",
715
+ type: HlmDatePickerAnchor,
716
+ isStandalone: true,
717
+ selector: "[hlmDatePickerAnchor]",
718
+ inputs: { hlmDatePickerAnchorForInput: {
719
+ classPropertyName: "hlmDatePickerAnchorForInput",
720
+ publicName: "hlmDatePickerAnchorFor",
721
+ isSignal: true,
722
+ isRequired: false,
723
+ transformFunction: null
724
+ } },
725
+ ngImport: i0
726
+ });
727
+ }
728
+ };
729
+ i0.ɵɵngDeclareClassMetadata({
730
+ minVersion: "12.0.0",
731
+ version: "22.2.4",
732
+ ngImport: i0,
733
+ type: HlmDatePickerAnchor,
734
+ decorators: [{
735
+ type: Directive,
736
+ args: [{ selector: "[hlmDatePickerAnchor]" }]
737
+ }],
738
+ ctorParameters: () => [],
739
+ propDecorators: { hlmDatePickerAnchorForInput: [{
740
+ type: i0.Input,
741
+ args: [{
742
+ isSignal: true,
743
+ alias: "hlmDatePickerAnchorFor",
744
+ required: false
745
+ }]
746
+ }] }
747
+ });
748
+ var HlmDatePickerInput = class HlmDatePickerInput extends BrnDateInput {
749
+ constructor() {
750
+ super(...arguments);
751
+ this._config = injectHlmDatePickerConfig();
752
+ this._fieldControl = inject(BrnFieldControl, { optional: true });
753
+ this._invalid = this._fieldControl?.invalid;
754
+ this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []);
755
+ this._dirty = this._fieldControl?.dirty;
756
+ this._touched = this._fieldControl?.touched;
757
+ this._ariaInvalid = computed(() => this._invalid?.() ? "true" : null, ...ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []);
758
+ this.parseDate = input(this._config.parseDate, ...ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []);
759
+ this.formatInputDate = input(this._config.formatInputDate, ...ngDevMode ? [{ debugName: "formatInputDate" }] : /* istanbul ignore next */ []);
760
+ }
761
+ parseValue(value) {
762
+ return this.parseDate()(value);
763
+ }
764
+ formatInputValue(value) {
765
+ return this.formatInputDate()(value);
766
+ }
767
+ static {
768
+ this.ɵfac = i0.ɵɵngDeclareFactory({
769
+ minVersion: "12.0.0",
770
+ version: "22.2.4",
771
+ ngImport: i0,
772
+ type: HlmDatePickerInput,
773
+ deps: null,
774
+ target: i0.ɵɵFactoryTarget.Component
775
+ });
776
+ }
777
+ static {
778
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
779
+ minVersion: "17.0.0",
780
+ version: "22.2.4",
781
+ type: HlmDatePickerInput,
782
+ isStandalone: true,
783
+ selector: "hlm-date-picker-input",
784
+ inputs: {
785
+ parseDate: {
786
+ classPropertyName: "parseDate",
787
+ publicName: "parseDate",
788
+ isSignal: true,
789
+ isRequired: false,
790
+ transformFunction: null
791
+ },
792
+ formatInputDate: {
793
+ classPropertyName: "formatInputDate",
794
+ publicName: "formatInputDate",
795
+ isSignal: true,
796
+ isRequired: false,
797
+ transformFunction: null
798
+ }
799
+ },
800
+ providers: [provideIcons({
801
+ lucideCalendar,
802
+ lucideX
803
+ }), provideBrnDatePickerTrigger(HlmDatePickerInput)],
804
+ usesInheritance: true,
805
+ hostDirectives: [{ directive: i1$2.HlmInputGroup }],
806
+ ngImport: i0,
807
+ template: `
432
808
  <input
433
809
  #input
434
810
  hlmInputGroupInput
@@ -472,17 +848,60 @@ class HlmDatePickerInput extends BrnDateInput {
472
848
  <ng-icon name="lucideCalendar" />
473
849
  </button>
474
850
  </hlm-input-group-addon>
475
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
476
- }
477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerInput, decorators: [{
478
- type: Component,
479
- args: [{
480
- selector: 'hlm-date-picker-input',
481
- imports: [HlmInputGroupImports, NgIcon],
482
- providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDatePickerInput)],
483
- changeDetection: ChangeDetectionStrategy.OnPush,
484
- hostDirectives: [HlmInputGroup],
485
- template: `
851
+ `,
852
+ isInline: true,
853
+ dependencies: [
854
+ {
855
+ kind: "directive",
856
+ type: i1$2.HlmInputGroupAddon,
857
+ selector: "[hlmInputGroupAddon],hlm-input-group-addon",
858
+ inputs: ["align"]
859
+ },
860
+ {
861
+ kind: "directive",
862
+ type: i1$2.HlmInputGroupButton,
863
+ selector: "button[hlmInputGroupButton]",
864
+ inputs: ["size", "type"]
865
+ },
866
+ {
867
+ kind: "directive",
868
+ type: i1$2.HlmInputGroupInput,
869
+ selector: "input[hlmInputGroupInput]"
870
+ },
871
+ {
872
+ kind: "component",
873
+ type: NgIcon,
874
+ selector: "ng-icon",
875
+ inputs: [
876
+ "name",
877
+ "svg",
878
+ "size",
879
+ "strokeWidth",
880
+ "color"
881
+ ]
882
+ }
883
+ ],
884
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
885
+ });
886
+ }
887
+ };
888
+ i0.ɵɵngDeclareClassMetadata({
889
+ minVersion: "12.0.0",
890
+ version: "22.2.4",
891
+ ngImport: i0,
892
+ type: HlmDatePickerInput,
893
+ decorators: [{
894
+ type: Component,
895
+ args: [{
896
+ selector: "hlm-date-picker-input",
897
+ imports: [HlmInputGroupImports, NgIcon],
898
+ providers: [provideIcons({
899
+ lucideCalendar,
900
+ lucideX
901
+ }), provideBrnDatePickerTrigger(HlmDatePickerInput)],
902
+ changeDetection: ChangeDetectionStrategy.OnPush,
903
+ hostDirectives: [HlmInputGroup],
904
+ template: `
486
905
  <input
487
906
  #input
488
907
  hlmInputGroupInput
@@ -526,120 +945,240 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
526
945
  <ng-icon name="lucideCalendar" />
527
946
  </button>
528
947
  </hlm-input-group-addon>
529
- `,
530
- }]
531
- }], propDecorators: { parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDate", required: false }] }] } });
532
-
948
+ `
949
+ }]
950
+ }],
951
+ propDecorators: {
952
+ parseDate: [{
953
+ type: i0.Input,
954
+ args: [{
955
+ isSignal: true,
956
+ alias: "parseDate",
957
+ required: false
958
+ }]
959
+ }],
960
+ formatInputDate: [{
961
+ type: i0.Input,
962
+ args: [{
963
+ isSignal: true,
964
+ alias: "formatInputDate",
965
+ required: false
966
+ }]
967
+ }]
968
+ }
969
+ });
533
970
  const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR = {
534
- provide: NG_VALUE_ACCESSOR,
535
- useExisting: forwardRef(() => HlmDatePickerMulti),
536
- multi: true,
971
+ provide: NG_VALUE_ACCESSOR,
972
+ useExisting: forwardRef(() => HlmDatePickerMulti),
973
+ multi: true
537
974
  };
538
- class HlmDatePickerMulti {
539
- constructor() {
540
- this._config = injectHlmDatePickerMultiConfig();
541
- this.popover = viewChild.required(BrnPopover);
542
- this._trigger = contentChild(BrnDatePickerTriggerToken, ...(ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []));
543
- this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
544
- /** Show dropdowns to navigate between months or years. */
545
- this.captionLayout = input('label', ...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
546
- /** The minimum date that can be selected.*/
547
- this.minDate = input(...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
548
- /** The maximum date that can be selected. */
549
- this.maxDate = input(...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
550
- /** The minimum selectable dates. */
551
- this.minSelection = input(undefined, { ...(ngDevMode ? { debugName: "minSelection" } : /* istanbul ignore next */ {}), transform: numberAttribute });
552
- /** The maximum selectable dates. */
553
- this.maxSelection = input(undefined, { ...(ngDevMode ? { debugName: "maxSelection" } : /* istanbul ignore next */ {}), transform: numberAttribute });
554
- /** Determine if the date picker is disabled. */
555
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
556
- /** The selected value. */
557
- this.date = input(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
558
- this._mutableDate = linkedSignal(this.date, ...(ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []));
559
- /** If true, the date picker will close when the max selection of dates is reached. */
560
- this.autoCloseOnMaxSelection = input(this._config.autoCloseOnMaxSelection, { ...(ngDevMode ? { debugName: "autoCloseOnMaxSelection" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
561
- /** Defines how the date should be displayed in the UI. */
562
- this.formatDates = input(this._config.formatDates, ...(ngDevMode ? [{ debugName: "formatDates" }] : /* istanbul ignore next */ []));
563
- /** Defines how the date should be transformed before saving to model/form. */
564
- this.transformDates = input(this._config.transformDates, ...(ngDevMode ? [{ debugName: "transformDates" }] : /* istanbul ignore next */ []));
565
- this._popoverState = signal(null, ...(ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []));
566
- this._disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
567
- /** @internal The disabled state as a readonly signal */
568
- this.disabledState = this._disabled.asReadonly();
569
- this.formattedDate = computed(() => {
570
- const dates = this._mutableDate();
571
- return dates ? this.formatDates()(dates) : undefined;
572
- }, ...(ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []));
573
- this.dateChange = output();
574
- this.labelableId = computed(() => this._trigger()?.triggerId(), ...(ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []));
575
- this.hasDate = computed(() => !!this._mutableDate()?.length, ...(ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []));
576
- /** @internal The current raw value, used by inputs to reformat on focus. */
577
- this.value = computed(() => this._mutableDate() ?? null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
578
- }
579
- _onStateChange(state) {
580
- this._popoverState.set(state);
581
- if (state === 'closed')
582
- this._onTouched?.();
583
- }
584
- _handleChange(value) {
585
- if (value === undefined)
586
- return;
587
- if (this._disabled())
588
- return;
589
- const transformedDate = value !== undefined ? this.transformDates()(value) : value;
590
- this._mutableDate.set(transformedDate);
591
- this._onChange?.(transformedDate);
592
- this.dateChange.emit(transformedDate);
593
- if (this.autoCloseOnMaxSelection() && this._mutableDate()?.length === this.maxSelection()) {
594
- this._popoverState.set('closed');
595
- }
596
- }
597
- /**
598
- * Commit dates to the picker. Updates the internal model, notifies form
599
- * controls, and emits `dateChange`. Intended to be called from a text input
600
- * that parses user-entered values. Pass `null` to clear the selection.
601
- */
602
- updateDate(value) {
603
- if (this._disabled())
604
- return;
605
- const transformedDate = value ? this.transformDates()(value) : undefined;
606
- this._mutableDate.set(transformedDate);
607
- this._onChange?.(transformedDate ?? []);
608
- this.dateChange.emit(transformedDate ?? []);
609
- }
610
- touched() {
611
- this._onTouched?.();
612
- }
613
- /** CONTROL VALUE ACCESSOR */
614
- writeValue(value) {
615
- this._mutableDate.set(value ? this.transformDates()(value) : undefined);
616
- }
617
- registerOnChange(fn) {
618
- this._onChange = fn;
619
- }
620
- registerOnTouched(fn) {
621
- this._onTouched = fn;
622
- }
623
- setDisabledState(isDisabled) {
624
- this._disabled.set(isDisabled);
625
- }
626
- open() {
627
- this._popoverState.set('open');
628
- }
629
- close() {
630
- this._popoverState.set('closed');
631
- }
632
- reset() {
633
- this._mutableDate.set(undefined);
634
- this._onChange?.([]);
635
- this.dateChange.emit([]);
636
- }
637
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerMulti, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
638
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: HlmDatePickerMulti, isStandalone: true, selector: "hlm-date-picker-multi", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minSelection: { classPropertyName: "minSelection", publicName: "minSelection", isSignal: true, isRequired: false, transformFunction: null }, maxSelection: { classPropertyName: "maxSelection", publicName: "maxSelection", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnMaxSelection: { classPropertyName: "autoCloseOnMaxSelection", publicName: "autoCloseOnMaxSelection", isSignal: true, isRequired: false, transformFunction: null }, formatDates: { classPropertyName: "formatDates", publicName: "formatDates", isSignal: true, isRequired: false, transformFunction: null }, transformDates: { classPropertyName: "transformDates", publicName: "transformDates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange" }, host: { classAttribute: "block" }, providers: [
639
- HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR,
640
- provideBrnDatePicker(HlmDatePickerMulti),
641
- provideBrnLabelable(HlmDatePickerMulti),
642
- ], queries: [{ propertyName: "_trigger", first: true, predicate: BrnDatePickerTriggerToken, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: BrnPopover, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.BrnFieldControl }], ngImport: i0, template: `
975
+ var HlmDatePickerMulti = class HlmDatePickerMulti {
976
+ constructor() {
977
+ this._config = injectHlmDatePickerMultiConfig();
978
+ this.popover = viewChild.required(BrnPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
979
+ this._trigger = contentChild(BrnDatePickerTriggerToken, ...ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []);
980
+ this.align = input("center", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
981
+ this.captionLayout = input("label", ...ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []);
982
+ this.minDate = input(...ngDevMode ? [void 0, { debugName: "minDate" }] : /* istanbul ignore next */ []);
983
+ this.maxDate = input(...ngDevMode ? [void 0, { debugName: "maxDate" }] : /* istanbul ignore next */ []);
984
+ this.minSelection = input(void 0, {
985
+ ...ngDevMode ? { debugName: "minSelection" } : /* istanbul ignore next */ {},
986
+ transform: numberAttribute
987
+ });
988
+ this.maxSelection = input(void 0, {
989
+ ...ngDevMode ? { debugName: "maxSelection" } : /* istanbul ignore next */ {},
990
+ transform: numberAttribute
991
+ });
992
+ this.disabled = input(false, {
993
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
994
+ transform: booleanAttribute
995
+ });
996
+ this.date = input(...ngDevMode ? [void 0, { debugName: "date" }] : /* istanbul ignore next */ []);
997
+ this._mutableDate = linkedSignal(this.date, ...ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []);
998
+ this.autoCloseOnMaxSelection = input(this._config.autoCloseOnMaxSelection, {
999
+ ...ngDevMode ? { debugName: "autoCloseOnMaxSelection" } : /* istanbul ignore next */ {},
1000
+ transform: booleanAttribute
1001
+ });
1002
+ this.formatDates = input(this._config.formatDates, ...ngDevMode ? [{ debugName: "formatDates" }] : /* istanbul ignore next */ []);
1003
+ this.transformDates = input(this._config.transformDates, ...ngDevMode ? [{ debugName: "transformDates" }] : /* istanbul ignore next */ []);
1004
+ this._popoverState = signal(null, ...ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []);
1005
+ this._disabled = linkedSignal(this.disabled, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
1006
+ this.disabledState = this._disabled.asReadonly();
1007
+ this.formattedDate = computed(() => {
1008
+ const dates = this._mutableDate();
1009
+ return dates ? this.formatDates()(dates) : void 0;
1010
+ }, ...ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []);
1011
+ this.dateChange = output();
1012
+ this.labelableId = computed(() => this._trigger()?.triggerId(), ...ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []);
1013
+ this.hasDate = computed(() => !!this._mutableDate()?.length, ...ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []);
1014
+ this.value = computed(() => this._mutableDate() ?? null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1015
+ }
1016
+ _onStateChange(state) {
1017
+ this._popoverState.set(state);
1018
+ if (state === "closed") this._onTouched?.();
1019
+ }
1020
+ _handleChange(value) {
1021
+ if (value === void 0) return;
1022
+ if (this._disabled()) return;
1023
+ const transformedDate = value !== void 0 ? this.transformDates()(value) : value;
1024
+ this._mutableDate.set(transformedDate);
1025
+ this._onChange?.(transformedDate);
1026
+ this.dateChange.emit(transformedDate);
1027
+ if (this.autoCloseOnMaxSelection() && this._mutableDate()?.length === this.maxSelection()) this._popoverState.set("closed");
1028
+ }
1029
+ updateDate(value) {
1030
+ if (this._disabled()) return;
1031
+ const transformedDate = value ? this.transformDates()(value) : void 0;
1032
+ this._mutableDate.set(transformedDate);
1033
+ this._onChange?.(transformedDate ?? []);
1034
+ this.dateChange.emit(transformedDate ?? []);
1035
+ }
1036
+ touched() {
1037
+ this._onTouched?.();
1038
+ }
1039
+ writeValue(value) {
1040
+ this._mutableDate.set(value ? this.transformDates()(value) : void 0);
1041
+ }
1042
+ registerOnChange(fn) {
1043
+ this._onChange = fn;
1044
+ }
1045
+ registerOnTouched(fn) {
1046
+ this._onTouched = fn;
1047
+ }
1048
+ setDisabledState(isDisabled) {
1049
+ this._disabled.set(isDisabled);
1050
+ }
1051
+ open() {
1052
+ this._popoverState.set("open");
1053
+ }
1054
+ close() {
1055
+ this._popoverState.set("closed");
1056
+ }
1057
+ reset() {
1058
+ this._mutableDate.set(void 0);
1059
+ this._onChange?.([]);
1060
+ this.dateChange.emit([]);
1061
+ }
1062
+ static {
1063
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1064
+ minVersion: "12.0.0",
1065
+ version: "22.2.4",
1066
+ ngImport: i0,
1067
+ type: HlmDatePickerMulti,
1068
+ deps: [],
1069
+ target: i0.ɵɵFactoryTarget.Component
1070
+ });
1071
+ }
1072
+ static {
1073
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1074
+ minVersion: "17.2.0",
1075
+ version: "22.2.4",
1076
+ type: HlmDatePickerMulti,
1077
+ isStandalone: true,
1078
+ selector: "hlm-date-picker-multi",
1079
+ inputs: {
1080
+ align: {
1081
+ classPropertyName: "align",
1082
+ publicName: "align",
1083
+ isSignal: true,
1084
+ isRequired: false,
1085
+ transformFunction: null
1086
+ },
1087
+ captionLayout: {
1088
+ classPropertyName: "captionLayout",
1089
+ publicName: "captionLayout",
1090
+ isSignal: true,
1091
+ isRequired: false,
1092
+ transformFunction: null
1093
+ },
1094
+ minDate: {
1095
+ classPropertyName: "minDate",
1096
+ publicName: "minDate",
1097
+ isSignal: true,
1098
+ isRequired: false,
1099
+ transformFunction: null
1100
+ },
1101
+ maxDate: {
1102
+ classPropertyName: "maxDate",
1103
+ publicName: "maxDate",
1104
+ isSignal: true,
1105
+ isRequired: false,
1106
+ transformFunction: null
1107
+ },
1108
+ minSelection: {
1109
+ classPropertyName: "minSelection",
1110
+ publicName: "minSelection",
1111
+ isSignal: true,
1112
+ isRequired: false,
1113
+ transformFunction: null
1114
+ },
1115
+ maxSelection: {
1116
+ classPropertyName: "maxSelection",
1117
+ publicName: "maxSelection",
1118
+ isSignal: true,
1119
+ isRequired: false,
1120
+ transformFunction: null
1121
+ },
1122
+ disabled: {
1123
+ classPropertyName: "disabled",
1124
+ publicName: "disabled",
1125
+ isSignal: true,
1126
+ isRequired: false,
1127
+ transformFunction: null
1128
+ },
1129
+ date: {
1130
+ classPropertyName: "date",
1131
+ publicName: "date",
1132
+ isSignal: true,
1133
+ isRequired: false,
1134
+ transformFunction: null
1135
+ },
1136
+ autoCloseOnMaxSelection: {
1137
+ classPropertyName: "autoCloseOnMaxSelection",
1138
+ publicName: "autoCloseOnMaxSelection",
1139
+ isSignal: true,
1140
+ isRequired: false,
1141
+ transformFunction: null
1142
+ },
1143
+ formatDates: {
1144
+ classPropertyName: "formatDates",
1145
+ publicName: "formatDates",
1146
+ isSignal: true,
1147
+ isRequired: false,
1148
+ transformFunction: null
1149
+ },
1150
+ transformDates: {
1151
+ classPropertyName: "transformDates",
1152
+ publicName: "transformDates",
1153
+ isSignal: true,
1154
+ isRequired: false,
1155
+ transformFunction: null
1156
+ }
1157
+ },
1158
+ outputs: { dateChange: "dateChange" },
1159
+ host: { classAttribute: "block" },
1160
+ providers: [
1161
+ HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR,
1162
+ provideBrnDatePicker(HlmDatePickerMulti),
1163
+ provideBrnLabelable(HlmDatePickerMulti)
1164
+ ],
1165
+ queries: [{
1166
+ propertyName: "_trigger",
1167
+ first: true,
1168
+ predicate: BrnDatePickerTriggerToken,
1169
+ descendants: true,
1170
+ isSignal: true
1171
+ }],
1172
+ viewQueries: [{
1173
+ propertyName: "popover",
1174
+ first: true,
1175
+ predicate: BrnPopover,
1176
+ descendants: true,
1177
+ isSignal: true
1178
+ }],
1179
+ hostDirectives: [{ directive: i1$1.BrnFieldControl }],
1180
+ ngImport: i0,
1181
+ template: `
643
1182
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
644
1183
  <ng-content />
645
1184
 
@@ -659,22 +1198,54 @@ class HlmDatePickerMulti {
659
1198
  <ng-content select="[hlmDatePickerFooter]" />
660
1199
  </hlm-popover-content>
661
1200
  </hlm-popover>
662
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: i2.HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "directive", type: i2.HlmPopoverPortal, selector: "[hlmPopoverPortal]" }, { kind: "component", type: HlmCalendarMulti, selector: "hlm-calendar-multi", inputs: ["captionLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
663
- }
664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerMulti, decorators: [{
665
- type: Component,
666
- args: [{
667
- selector: 'hlm-date-picker-multi',
668
- imports: [HlmPopoverImports, HlmCalendarMulti],
669
- providers: [
670
- HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR,
671
- provideBrnDatePicker(HlmDatePickerMulti),
672
- provideBrnLabelable(HlmDatePickerMulti),
673
- ],
674
- changeDetection: ChangeDetectionStrategy.OnPush,
675
- hostDirectives: [BrnFieldControl],
676
- host: { class: 'block' },
677
- template: `
1201
+ `,
1202
+ isInline: true,
1203
+ dependencies: [
1204
+ {
1205
+ kind: "directive",
1206
+ type: i2.HlmPopover,
1207
+ selector: "[hlmPopover],hlm-popover"
1208
+ },
1209
+ {
1210
+ kind: "directive",
1211
+ type: i2.HlmPopoverContent,
1212
+ selector: "[hlmPopoverContent],hlm-popover-content"
1213
+ },
1214
+ {
1215
+ kind: "directive",
1216
+ type: i2.HlmPopoverPortal,
1217
+ selector: "[hlmPopoverPortal]"
1218
+ },
1219
+ {
1220
+ kind: "component",
1221
+ type: HlmCalendarMulti,
1222
+ selector: "hlm-calendar-multi",
1223
+ inputs: ["captionLayout"]
1224
+ }
1225
+ ],
1226
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1227
+ });
1228
+ }
1229
+ };
1230
+ i0.ɵɵngDeclareClassMetadata({
1231
+ minVersion: "12.0.0",
1232
+ version: "22.2.4",
1233
+ ngImport: i0,
1234
+ type: HlmDatePickerMulti,
1235
+ decorators: [{
1236
+ type: Component,
1237
+ args: [{
1238
+ selector: "hlm-date-picker-multi",
1239
+ imports: [HlmPopoverImports, HlmCalendarMulti],
1240
+ providers: [
1241
+ HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR,
1242
+ provideBrnDatePicker(HlmDatePickerMulti),
1243
+ provideBrnLabelable(HlmDatePickerMulti)
1244
+ ],
1245
+ changeDetection: ChangeDetectionStrategy.OnPush,
1246
+ hostDirectives: [BrnFieldControl],
1247
+ host: { class: "block" },
1248
+ template: `
678
1249
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
679
1250
  <ng-content />
680
1251
 
@@ -694,37 +1265,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
694
1265
  <ng-content select="[hlmDatePickerFooter]" />
695
1266
  </hlm-popover-content>
696
1267
  </hlm-popover>
697
- `,
698
- }]
699
- }], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnPopover), { isSignal: true }] }], _trigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSelection", required: false }] }], maxSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelection", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], autoCloseOnMaxSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnMaxSelection", required: false }] }], formatDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDates", required: false }] }], transformDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDates", required: false }] }], dateChange: [{ type: i0.Output, args: ["dateChange"] }] } });
700
-
701
- class HlmDatePickerTrigger {
702
- constructor() {
703
- this._fieldControl = inject(BrnFieldControl, { optional: true });
704
- this._datePicker = injectBrnDatePicker();
705
- this._invalid = this._fieldControl?.invalid;
706
- this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
707
- this._dirty = this._fieldControl?.dirty;
708
- this._touched = this._fieldControl?.touched;
709
- this._ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
710
- this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
711
- this._computedClass = computed(() => hlm('data-placeholder:text-muted-foreground justify-between', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
712
- this._isPlaceholder = computed(() => !this._datePicker.hasDate(), ...(ngDevMode ? [{ debugName: "_isPlaceholder" }] : /* istanbul ignore next */ []));
713
- /** The id of the button that opens the date picker. */
714
- this.buttonId = input(`hlm-date-picker-${++HlmDatePickerTrigger._nextId}`, ...(ngDevMode ? [{ debugName: "buttonId" }] : /* istanbul ignore next */ []));
715
- /** @internal The id of the button that opens the date picker, used for labeling. */
716
- this.triggerId = this.buttonId;
717
- /** Forces the invalid state visually, regardless of form control state. */
718
- this.forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
719
- this.variant = input('outline', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
720
- this.showTrigger = input(true, { ...(ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
721
- this._popover = this._datePicker.popover;
722
- this._disabled = this._datePicker.disabledState;
723
- this._formattedDate = this._datePicker.formattedDate;
724
- }
725
- static { this._nextId = 0; }
726
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
727
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HlmDatePickerTrigger, isStandalone: true, selector: "hlm-date-picker-trigger", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, buttonId: { classPropertyName: "buttonId", publicName: "buttonId", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, showTrigger: { classPropertyName: "showTrigger", publicName: "showTrigger", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "date-picker-trigger" } }, providers: [provideIcons({ lucideChevronDown }), provideBrnDatePickerTrigger(HlmDatePickerTrigger)], ngImport: i0, template: `
1268
+ `
1269
+ }]
1270
+ }],
1271
+ propDecorators: {
1272
+ popover: [{
1273
+ type: i0.ViewChild,
1274
+ args: [i0.forwardRef(() => BrnPopover), { isSignal: true }]
1275
+ }],
1276
+ _trigger: [{
1277
+ type: i0.ContentChild,
1278
+ args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }]
1279
+ }],
1280
+ align: [{
1281
+ type: i0.Input,
1282
+ args: [{
1283
+ isSignal: true,
1284
+ alias: "align",
1285
+ required: false
1286
+ }]
1287
+ }],
1288
+ captionLayout: [{
1289
+ type: i0.Input,
1290
+ args: [{
1291
+ isSignal: true,
1292
+ alias: "captionLayout",
1293
+ required: false
1294
+ }]
1295
+ }],
1296
+ minDate: [{
1297
+ type: i0.Input,
1298
+ args: [{
1299
+ isSignal: true,
1300
+ alias: "minDate",
1301
+ required: false
1302
+ }]
1303
+ }],
1304
+ maxDate: [{
1305
+ type: i0.Input,
1306
+ args: [{
1307
+ isSignal: true,
1308
+ alias: "maxDate",
1309
+ required: false
1310
+ }]
1311
+ }],
1312
+ minSelection: [{
1313
+ type: i0.Input,
1314
+ args: [{
1315
+ isSignal: true,
1316
+ alias: "minSelection",
1317
+ required: false
1318
+ }]
1319
+ }],
1320
+ maxSelection: [{
1321
+ type: i0.Input,
1322
+ args: [{
1323
+ isSignal: true,
1324
+ alias: "maxSelection",
1325
+ required: false
1326
+ }]
1327
+ }],
1328
+ disabled: [{
1329
+ type: i0.Input,
1330
+ args: [{
1331
+ isSignal: true,
1332
+ alias: "disabled",
1333
+ required: false
1334
+ }]
1335
+ }],
1336
+ date: [{
1337
+ type: i0.Input,
1338
+ args: [{
1339
+ isSignal: true,
1340
+ alias: "date",
1341
+ required: false
1342
+ }]
1343
+ }],
1344
+ autoCloseOnMaxSelection: [{
1345
+ type: i0.Input,
1346
+ args: [{
1347
+ isSignal: true,
1348
+ alias: "autoCloseOnMaxSelection",
1349
+ required: false
1350
+ }]
1351
+ }],
1352
+ formatDates: [{
1353
+ type: i0.Input,
1354
+ args: [{
1355
+ isSignal: true,
1356
+ alias: "formatDates",
1357
+ required: false
1358
+ }]
1359
+ }],
1360
+ transformDates: [{
1361
+ type: i0.Input,
1362
+ args: [{
1363
+ isSignal: true,
1364
+ alias: "transformDates",
1365
+ required: false
1366
+ }]
1367
+ }],
1368
+ dateChange: [{
1369
+ type: i0.Output,
1370
+ args: ["dateChange"]
1371
+ }]
1372
+ }
1373
+ });
1374
+ var HlmDatePickerTrigger = class HlmDatePickerTrigger {
1375
+ constructor() {
1376
+ this._fieldControl = inject(BrnFieldControl, { optional: true });
1377
+ this._datePicker = injectBrnDatePicker();
1378
+ this._invalid = this._fieldControl?.invalid;
1379
+ this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []);
1380
+ this._dirty = this._fieldControl?.dirty;
1381
+ this._touched = this._fieldControl?.touched;
1382
+ this._ariaInvalid = computed(() => this._invalid?.() ? "true" : null, ...ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []);
1383
+ this.userClass = input("", {
1384
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
1385
+ alias: "class"
1386
+ });
1387
+ this._computedClass = computed(() => hlm("data-placeholder:text-muted-foreground justify-between", this.userClass()), ...ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []);
1388
+ this._isPlaceholder = computed(() => !this._datePicker.hasDate(), ...ngDevMode ? [{ debugName: "_isPlaceholder" }] : /* istanbul ignore next */ []);
1389
+ this.buttonId = input(`hlm-date-picker-${++HlmDatePickerTrigger._nextId}`, ...ngDevMode ? [{ debugName: "buttonId" }] : /* istanbul ignore next */ []);
1390
+ this.triggerId = this.buttonId;
1391
+ this.forceInvalid = input(false, {
1392
+ ...ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {},
1393
+ transform: booleanAttribute
1394
+ });
1395
+ this.variant = input("outline", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
1396
+ this.showTrigger = input(true, {
1397
+ ...ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {},
1398
+ transform: booleanAttribute
1399
+ });
1400
+ this._popover = this._datePicker.popover;
1401
+ this._disabled = this._datePicker.disabledState;
1402
+ this._formattedDate = this._datePicker.formattedDate;
1403
+ }
1404
+ static {
1405
+ this._nextId = 0;
1406
+ }
1407
+ static {
1408
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1409
+ minVersion: "12.0.0",
1410
+ version: "22.2.4",
1411
+ ngImport: i0,
1412
+ type: HlmDatePickerTrigger,
1413
+ deps: [],
1414
+ target: i0.ɵɵFactoryTarget.Component
1415
+ });
1416
+ }
1417
+ static {
1418
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1419
+ minVersion: "17.0.0",
1420
+ version: "22.2.4",
1421
+ type: HlmDatePickerTrigger,
1422
+ isStandalone: true,
1423
+ selector: "hlm-date-picker-trigger",
1424
+ inputs: {
1425
+ userClass: {
1426
+ classPropertyName: "userClass",
1427
+ publicName: "class",
1428
+ isSignal: true,
1429
+ isRequired: false,
1430
+ transformFunction: null
1431
+ },
1432
+ buttonId: {
1433
+ classPropertyName: "buttonId",
1434
+ publicName: "buttonId",
1435
+ isSignal: true,
1436
+ isRequired: false,
1437
+ transformFunction: null
1438
+ },
1439
+ forceInvalid: {
1440
+ classPropertyName: "forceInvalid",
1441
+ publicName: "forceInvalid",
1442
+ isSignal: true,
1443
+ isRequired: false,
1444
+ transformFunction: null
1445
+ },
1446
+ variant: {
1447
+ classPropertyName: "variant",
1448
+ publicName: "variant",
1449
+ isSignal: true,
1450
+ isRequired: false,
1451
+ transformFunction: null
1452
+ },
1453
+ showTrigger: {
1454
+ classPropertyName: "showTrigger",
1455
+ publicName: "showTrigger",
1456
+ isSignal: true,
1457
+ isRequired: false,
1458
+ transformFunction: null
1459
+ }
1460
+ },
1461
+ host: { attributes: { "data-slot": "date-picker-trigger" } },
1462
+ providers: [provideIcons({ lucideChevronDown }), provideBrnDatePickerTrigger(HlmDatePickerTrigger)],
1463
+ ngImport: i0,
1464
+ template: `
728
1465
  <button
729
1466
  [id]="buttonId()"
730
1467
  type="button"
@@ -754,17 +1491,63 @@ class HlmDatePickerTrigger {
754
1491
  <ng-icon name="lucideChevronDown" />
755
1492
  }
756
1493
  </button>
757
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$2.HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }, { kind: "directive", type: HlmPopoverTrigger, selector: "button[hlmPopoverTrigger],button[hlmPopoverTriggerFor]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: BrnFieldControlDescribedBy, selector: "[brnFieldControlDescribedBy]", inputs: ["aria-describedby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
758
- }
759
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDatePickerTrigger, decorators: [{
760
- type: Component,
761
- args: [{
762
- selector: 'hlm-date-picker-trigger',
763
- imports: [HlmButtonImports, HlmPopoverTrigger, NgIcon, BrnFieldControlDescribedBy],
764
- providers: [provideIcons({ lucideChevronDown }), provideBrnDatePickerTrigger(HlmDatePickerTrigger)],
765
- changeDetection: ChangeDetectionStrategy.OnPush,
766
- host: { 'data-slot': 'date-picker-trigger' },
767
- template: `
1494
+ `,
1495
+ isInline: true,
1496
+ dependencies: [
1497
+ {
1498
+ kind: "directive",
1499
+ type: i1.HlmButton,
1500
+ selector: "button[hlmBtn], a[hlmBtn]",
1501
+ inputs: ["variant", "size"],
1502
+ exportAs: ["hlmBtn"]
1503
+ },
1504
+ {
1505
+ kind: "directive",
1506
+ type: HlmPopoverTrigger,
1507
+ selector: "button[hlmPopoverTrigger],button[hlmPopoverTriggerFor]"
1508
+ },
1509
+ {
1510
+ kind: "component",
1511
+ type: NgIcon,
1512
+ selector: "ng-icon",
1513
+ inputs: [
1514
+ "name",
1515
+ "svg",
1516
+ "size",
1517
+ "strokeWidth",
1518
+ "color"
1519
+ ]
1520
+ },
1521
+ {
1522
+ kind: "directive",
1523
+ type: BrnFieldControlDescribedBy,
1524
+ selector: "[brnFieldControlDescribedBy]",
1525
+ inputs: ["aria-describedby"]
1526
+ }
1527
+ ],
1528
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1529
+ });
1530
+ }
1531
+ };
1532
+ i0.ɵɵngDeclareClassMetadata({
1533
+ minVersion: "12.0.0",
1534
+ version: "22.2.4",
1535
+ ngImport: i0,
1536
+ type: HlmDatePickerTrigger,
1537
+ decorators: [{
1538
+ type: Component,
1539
+ args: [{
1540
+ selector: "hlm-date-picker-trigger",
1541
+ imports: [
1542
+ HlmButtonImports,
1543
+ HlmPopoverTrigger,
1544
+ NgIcon,
1545
+ BrnFieldControlDescribedBy
1546
+ ],
1547
+ providers: [provideIcons({ lucideChevronDown }), provideBrnDatePickerTrigger(HlmDatePickerTrigger)],
1548
+ changeDetection: ChangeDetectionStrategy.OnPush,
1549
+ host: { "data-slot": "date-picker-trigger" },
1550
+ template: `
768
1551
  <button
769
1552
  [id]="buttonId()"
770
1553
  type="button"
@@ -794,79 +1577,143 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
794
1577
  <ng-icon name="lucideChevronDown" />
795
1578
  }
796
1579
  </button>
797
- `,
798
- }]
799
- }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], buttonId: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonId", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }] } });
800
-
1580
+ `
1581
+ }]
1582
+ }],
1583
+ propDecorators: {
1584
+ userClass: [{
1585
+ type: i0.Input,
1586
+ args: [{
1587
+ isSignal: true,
1588
+ alias: "class",
1589
+ required: false
1590
+ }]
1591
+ }],
1592
+ buttonId: [{
1593
+ type: i0.Input,
1594
+ args: [{
1595
+ isSignal: true,
1596
+ alias: "buttonId",
1597
+ required: false
1598
+ }]
1599
+ }],
1600
+ forceInvalid: [{
1601
+ type: i0.Input,
1602
+ args: [{
1603
+ isSignal: true,
1604
+ alias: "forceInvalid",
1605
+ required: false
1606
+ }]
1607
+ }],
1608
+ variant: [{
1609
+ type: i0.Input,
1610
+ args: [{
1611
+ isSignal: true,
1612
+ alias: "variant",
1613
+ required: false
1614
+ }]
1615
+ }],
1616
+ showTrigger: [{
1617
+ type: i0.Input,
1618
+ args: [{
1619
+ isSignal: true,
1620
+ alias: "showTrigger",
1621
+ required: false
1622
+ }]
1623
+ }]
1624
+ }
1625
+ });
801
1626
  function getDefaultConfig$1() {
802
- return {
803
- formatDates: (dates) => dates
804
- .filter(Boolean)
805
- .map((date) => (date instanceof Date ? date.toDateString() : `${date}`))
806
- .join(' - '),
807
- formatInputDates: (dates) => dates
808
- .filter(Boolean)
809
- .map((date) => (date instanceof Date ? date.toDateString() : `${date}`))
810
- .join(' - '),
811
- transformDates: (dates) => dates,
812
- autoCloseOnEndSelection: false,
813
- parseDate: (value) => {
814
- if (typeof value !== 'string')
815
- return null;
816
- const parts = value.split(' - ').map((part) => part.trim());
817
- if (parts.length === 0 || parts.length > 2)
818
- return null;
819
- const start = new Date(parts[0]);
820
- if (isNaN(start.getTime()))
821
- return null;
822
- const end = parts.length === 2 ? new Date(parts[1]) : start;
823
- return [start, isNaN(end.getTime()) ? start : end];
824
- },
825
- };
1627
+ return {
1628
+ formatDates: (dates) => dates.filter(Boolean).map((date) => date instanceof Date ? date.toDateString() : `${date}`).join(" - "),
1629
+ formatInputDates: (dates) => dates.filter(Boolean).map((date) => date instanceof Date ? date.toDateString() : `${date}`).join(" - "),
1630
+ transformDates: (dates) => dates,
1631
+ autoCloseOnEndSelection: false,
1632
+ parseDate: (value) => {
1633
+ if (typeof value !== "string") return null;
1634
+ const parts = value.split(" - ").map((part) => part.trim());
1635
+ if (parts.length === 0 || parts.length > 2) return null;
1636
+ const start = new Date(parts[0]);
1637
+ if (isNaN(start.getTime())) return null;
1638
+ const end = parts.length === 2 ? new Date(parts[1]) : start;
1639
+ return [start, isNaN(end.getTime()) ? start : end];
1640
+ }
1641
+ };
826
1642
  }
827
- const HlmDateRangePickerConfigToken = new InjectionToken('HlmDateRangePickerConfig');
1643
+ const HlmDateRangePickerConfigToken = new InjectionToken("HlmDateRangePickerConfig");
828
1644
  function provideHlmDateRangePickerConfig(config) {
829
- return { provide: HlmDateRangePickerConfigToken, useValue: { ...getDefaultConfig$1(), ...config } };
1645
+ return {
1646
+ provide: HlmDateRangePickerConfigToken,
1647
+ useValue: {
1648
+ ...getDefaultConfig$1(),
1649
+ ...config
1650
+ }
1651
+ };
830
1652
  }
831
1653
  function injectHlmDateRangePickerConfig() {
832
- const injectedConfig = inject(HlmDateRangePickerConfigToken, { optional: true });
833
- return injectedConfig ? injectedConfig : getDefaultConfig$1();
1654
+ const injectedConfig = inject(HlmDateRangePickerConfigToken, { optional: true });
1655
+ return injectedConfig ? injectedConfig : getDefaultConfig$1();
834
1656
  }
835
-
836
- class HlmDateRangeInput extends BrnDateInput {
837
- constructor() {
838
- super(...arguments);
839
- this._config = injectHlmDateRangePickerConfig();
840
- this._fieldControl = inject(BrnFieldControl, { optional: true });
841
- this._invalid = this._fieldControl?.invalid;
842
- this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
843
- this._dirty = this._fieldControl?.dirty;
844
- this._touched = this._fieldControl?.touched;
845
- this._ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
846
- /**
847
- * Parses input text into a date range. Return `null` for invalid
848
- * input - the picker's range is cleared while the text is preserved so
849
- * the user can fix it.
850
- *
851
- * Defaults to `parseDate` from `HlmDateRangePickerConfig`.
852
- */
853
- this.parseDate = input(this._config.parseDate, ...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
854
- /**
855
- * Formats the current range into the input/edit format shown while the
856
- * input is focused. On blur the picker's display format is restored.
857
- *
858
- * Defaults to `formatInputDates` from `HlmDateRangePickerConfig`.
859
- */
860
- this.formatInputDates = input(this._config.formatInputDates, ...(ngDevMode ? [{ debugName: "formatInputDates" }] : /* istanbul ignore next */ []));
861
- }
862
- parseValue(value) {
863
- return this.parseDate()(value);
864
- }
865
- formatInputValue(value) {
866
- return this.formatInputDates()(value);
867
- }
868
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateRangeInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
869
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HlmDateRangeInput, isStandalone: true, selector: "hlm-date-range-input", inputs: { parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDates: { classPropertyName: "formatInputDates", publicName: "formatInputDates", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDateRangeInput)], usesInheritance: true, hostDirectives: [{ directive: i1.HlmInputGroup }], ngImport: i0, template: `
1657
+ var HlmDateRangeInput = class HlmDateRangeInput extends BrnDateInput {
1658
+ constructor() {
1659
+ super(...arguments);
1660
+ this._config = injectHlmDateRangePickerConfig();
1661
+ this._fieldControl = inject(BrnFieldControl, { optional: true });
1662
+ this._invalid = this._fieldControl?.invalid;
1663
+ this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []);
1664
+ this._dirty = this._fieldControl?.dirty;
1665
+ this._touched = this._fieldControl?.touched;
1666
+ this._ariaInvalid = computed(() => this._invalid?.() ? "true" : null, ...ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []);
1667
+ this.parseDate = input(this._config.parseDate, ...ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []);
1668
+ this.formatInputDates = input(this._config.formatInputDates, ...ngDevMode ? [{ debugName: "formatInputDates" }] : /* istanbul ignore next */ []);
1669
+ }
1670
+ parseValue(value) {
1671
+ return this.parseDate()(value);
1672
+ }
1673
+ formatInputValue(value) {
1674
+ return this.formatInputDates()(value);
1675
+ }
1676
+ static {
1677
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1678
+ minVersion: "12.0.0",
1679
+ version: "22.2.4",
1680
+ ngImport: i0,
1681
+ type: HlmDateRangeInput,
1682
+ deps: null,
1683
+ target: i0.ɵɵFactoryTarget.Component
1684
+ });
1685
+ }
1686
+ static {
1687
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1688
+ minVersion: "17.0.0",
1689
+ version: "22.2.4",
1690
+ type: HlmDateRangeInput,
1691
+ isStandalone: true,
1692
+ selector: "hlm-date-range-input",
1693
+ inputs: {
1694
+ parseDate: {
1695
+ classPropertyName: "parseDate",
1696
+ publicName: "parseDate",
1697
+ isSignal: true,
1698
+ isRequired: false,
1699
+ transformFunction: null
1700
+ },
1701
+ formatInputDates: {
1702
+ classPropertyName: "formatInputDates",
1703
+ publicName: "formatInputDates",
1704
+ isSignal: true,
1705
+ isRequired: false,
1706
+ transformFunction: null
1707
+ }
1708
+ },
1709
+ providers: [provideIcons({
1710
+ lucideCalendar,
1711
+ lucideX
1712
+ }), provideBrnDatePickerTrigger(HlmDateRangeInput)],
1713
+ usesInheritance: true,
1714
+ hostDirectives: [{ directive: i1$2.HlmInputGroup }],
1715
+ ngImport: i0,
1716
+ template: `
870
1717
  <input
871
1718
  #input
872
1719
  hlmInputGroupInput
@@ -910,17 +1757,60 @@ class HlmDateRangeInput extends BrnDateInput {
910
1757
  <ng-icon name="lucideCalendar" />
911
1758
  </button>
912
1759
  </hlm-input-group-addon>
913
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
914
- }
915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateRangeInput, decorators: [{
916
- type: Component,
917
- args: [{
918
- selector: 'hlm-date-range-input',
919
- imports: [HlmInputGroupImports, NgIcon],
920
- providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmDateRangeInput)],
921
- changeDetection: ChangeDetectionStrategy.OnPush,
922
- hostDirectives: [HlmInputGroup],
923
- template: `
1760
+ `,
1761
+ isInline: true,
1762
+ dependencies: [
1763
+ {
1764
+ kind: "directive",
1765
+ type: i1$2.HlmInputGroupAddon,
1766
+ selector: "[hlmInputGroupAddon],hlm-input-group-addon",
1767
+ inputs: ["align"]
1768
+ },
1769
+ {
1770
+ kind: "directive",
1771
+ type: i1$2.HlmInputGroupButton,
1772
+ selector: "button[hlmInputGroupButton]",
1773
+ inputs: ["size", "type"]
1774
+ },
1775
+ {
1776
+ kind: "directive",
1777
+ type: i1$2.HlmInputGroupInput,
1778
+ selector: "input[hlmInputGroupInput]"
1779
+ },
1780
+ {
1781
+ kind: "component",
1782
+ type: NgIcon,
1783
+ selector: "ng-icon",
1784
+ inputs: [
1785
+ "name",
1786
+ "svg",
1787
+ "size",
1788
+ "strokeWidth",
1789
+ "color"
1790
+ ]
1791
+ }
1792
+ ],
1793
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1794
+ });
1795
+ }
1796
+ };
1797
+ i0.ɵɵngDeclareClassMetadata({
1798
+ minVersion: "12.0.0",
1799
+ version: "22.2.4",
1800
+ ngImport: i0,
1801
+ type: HlmDateRangeInput,
1802
+ decorators: [{
1803
+ type: Component,
1804
+ args: [{
1805
+ selector: "hlm-date-range-input",
1806
+ imports: [HlmInputGroupImports, NgIcon],
1807
+ providers: [provideIcons({
1808
+ lucideCalendar,
1809
+ lucideX
1810
+ }), provideBrnDatePickerTrigger(HlmDateRangeInput)],
1811
+ changeDetection: ChangeDetectionStrategy.OnPush,
1812
+ hostDirectives: [HlmInputGroup],
1813
+ template: `
924
1814
  <input
925
1815
  #input
926
1816
  hlmInputGroupInput
@@ -964,152 +1854,252 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
964
1854
  <ng-icon name="lucideCalendar" />
965
1855
  </button>
966
1856
  </hlm-input-group-addon>
967
- `,
968
- }]
969
- }], propDecorators: { parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDates", required: false }] }] } });
970
-
1857
+ `
1858
+ }]
1859
+ }],
1860
+ propDecorators: {
1861
+ parseDate: [{
1862
+ type: i0.Input,
1863
+ args: [{
1864
+ isSignal: true,
1865
+ alias: "parseDate",
1866
+ required: false
1867
+ }]
1868
+ }],
1869
+ formatInputDates: [{
1870
+ type: i0.Input,
1871
+ args: [{
1872
+ isSignal: true,
1873
+ alias: "formatInputDates",
1874
+ required: false
1875
+ }]
1876
+ }]
1877
+ }
1878
+ });
971
1879
  const HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR = {
972
- provide: NG_VALUE_ACCESSOR,
973
- useExisting: forwardRef(() => HlmDateRangePicker),
974
- multi: true,
1880
+ provide: NG_VALUE_ACCESSOR,
1881
+ useExisting: forwardRef(() => HlmDateRangePicker),
1882
+ multi: true
975
1883
  };
976
- class HlmDateRangePicker {
977
- constructor() {
978
- this._config = injectHlmDateRangePickerConfig();
979
- this.popover = viewChild.required(BrnPopover);
980
- this._trigger = contentChild(BrnDatePickerTriggerToken, ...(ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []));
981
- this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
982
- /** Show dropdowns to navigate between months or years. */
983
- this.captionLayout = input('label', ...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
984
- /** The minimum date that can be selected.*/
985
- this.minDate = input(...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
986
- /** The maximum date that can be selected. */
987
- this.maxDate = input(...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
988
- /** Determine if the date picker is disabled. */
989
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
990
- /** The selected value. */
991
- this.date = input(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
992
- this._mutableDate = linkedSignal(this.date, ...(ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []));
993
- this._start = linkedSignal(() => this._mutableDate()?.[0], ...(ngDevMode ? [{ debugName: "_start" }] : /* istanbul ignore next */ []));
994
- this._end = linkedSignal(() => this._mutableDate()?.[1], ...(ngDevMode ? [{ debugName: "_end" }] : /* istanbul ignore next */ []));
995
- /** If true, the date picker will close when the end date is selected */
996
- this.autoCloseOnEndSelection = input(this._config.autoCloseOnEndSelection, { ...(ngDevMode ? { debugName: "autoCloseOnEndSelection" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
997
- /** Defines how the date should be displayed in the UI. */
998
- this.formatDates = input(this._config.formatDates, ...(ngDevMode ? [{ debugName: "formatDates" }] : /* istanbul ignore next */ []));
999
- /** Defines how the date should be transformed before saving to model/form. */
1000
- this.transformDates = input(this._config.transformDates, ...(ngDevMode ? [{ debugName: "transformDates" }] : /* istanbul ignore next */ []));
1001
- this._popoverState = signal(null, ...(ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []));
1002
- this._disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
1003
- /** @internal The disabled state as a readonly signal */
1004
- this.disabledState = this._disabled.asReadonly();
1005
- this.formattedDate = computed(() => {
1006
- const start = this._start();
1007
- const end = this._end();
1008
- return start || end ? this.formatDates()([start ?? null, end ?? null]) : undefined;
1009
- }, ...(ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []));
1010
- this.dateChange = output();
1011
- this.labelableId = computed(() => this._trigger()?.triggerId(), ...(ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []));
1012
- this.hasDate = computed(() => !!this._start() || !!this._end(), ...(ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []));
1013
- /** @internal The current raw value, used by inputs to reformat on focus. */
1014
- this.value = computed(() => this._mutableDate() ?? null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1015
- }
1016
- _onStateChange(state) {
1017
- this._popoverState.set(state);
1018
- if (state === 'closed') {
1019
- this._onClose();
1020
- this._onTouched?.();
1021
- }
1022
- }
1023
- _handleStartDayChange(value) {
1024
- this._start.set(value);
1025
- }
1026
- _handleEndDateChange(value) {
1027
- this._end.set(value);
1028
- if (this._disabled())
1029
- return;
1030
- const start = this._start();
1031
- if (start && value) {
1032
- const transformedDates = this.transformDates()([start, value]);
1033
- this._mutableDate.set(transformedDates);
1034
- this.dateChange.emit(transformedDates);
1035
- this._onChange?.(transformedDates);
1036
- if (this.autoCloseOnEndSelection()) {
1037
- this._popoverState.set('closed');
1038
- }
1039
- }
1040
- }
1041
- /**
1042
- * Commit a range to the picker. Updates the internal model, notifies form
1043
- * controls, and emits `dateChange`. Intended to be called from a text input
1044
- * that parses user-entered values. Pass `null` to clear the range.
1045
- */
1046
- updateDate(value) {
1047
- if (this._disabled())
1048
- return;
1049
- if (!value) {
1050
- this._mutableDate.set(undefined);
1051
- this._start.set(undefined);
1052
- this._end.set(undefined);
1053
- this._onChange?.(null);
1054
- this.dateChange.emit(null);
1055
- return;
1056
- }
1057
- const transformedDates = this.transformDates()(value);
1058
- this._mutableDate.set(transformedDates);
1059
- this._start.set(transformedDates[0]);
1060
- this._end.set(transformedDates[1]);
1061
- this._onChange?.(transformedDates);
1062
- this.dateChange.emit(transformedDates);
1063
- }
1064
- touched() {
1065
- this._onTouched?.();
1066
- }
1067
- /** CONTROL VALUE ACCESSOR */
1068
- writeValue(value) {
1069
- untracked(() => {
1070
- if (!value) {
1071
- this._mutableDate.set(undefined);
1072
- }
1073
- else {
1074
- this._mutableDate.set(this.transformDates()(value));
1075
- }
1076
- });
1077
- }
1078
- registerOnChange(fn) {
1079
- this._onChange = fn;
1080
- }
1081
- registerOnTouched(fn) {
1082
- this._onTouched = fn;
1083
- }
1084
- setDisabledState(isDisabled) {
1085
- this._disabled.set(isDisabled);
1086
- }
1087
- open() {
1088
- this._popoverState.set('open');
1089
- }
1090
- close() {
1091
- this._popoverState.set('closed');
1092
- }
1093
- reset() {
1094
- this._mutableDate.set(undefined);
1095
- this._start.set(undefined);
1096
- this._end.set(undefined);
1097
- this._onChange?.(null);
1098
- this.dateChange.emit(null);
1099
- }
1100
- _onClose() {
1101
- const dates = this._mutableDate();
1102
- if (this._start() && !this._end() && dates) {
1103
- this._start.set(dates[0]);
1104
- this._end.set(dates[1]);
1105
- }
1106
- }
1107
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1108
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: HlmDateRangePicker, isStandalone: true, selector: "hlm-date-range-picker", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnEndSelection: { classPropertyName: "autoCloseOnEndSelection", publicName: "autoCloseOnEndSelection", isSignal: true, isRequired: false, transformFunction: null }, formatDates: { classPropertyName: "formatDates", publicName: "formatDates", isSignal: true, isRequired: false, transformFunction: null }, transformDates: { classPropertyName: "transformDates", publicName: "transformDates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange" }, host: { classAttribute: "block" }, providers: [
1109
- HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR,
1110
- provideBrnDatePicker(HlmDateRangePicker),
1111
- provideBrnLabelable(HlmDateRangePicker),
1112
- ], queries: [{ propertyName: "_trigger", first: true, predicate: BrnDatePickerTriggerToken, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: BrnPopover, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.BrnFieldControl }], ngImport: i0, template: `
1884
+ var HlmDateRangePicker = class HlmDateRangePicker {
1885
+ constructor() {
1886
+ this._config = injectHlmDateRangePickerConfig();
1887
+ this.popover = viewChild.required(BrnPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
1888
+ this._trigger = contentChild(BrnDatePickerTriggerToken, ...ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []);
1889
+ this.align = input("center", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
1890
+ this.captionLayout = input("label", ...ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []);
1891
+ this.minDate = input(...ngDevMode ? [void 0, { debugName: "minDate" }] : /* istanbul ignore next */ []);
1892
+ this.maxDate = input(...ngDevMode ? [void 0, { debugName: "maxDate" }] : /* istanbul ignore next */ []);
1893
+ this.disabled = input(false, {
1894
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1895
+ transform: booleanAttribute
1896
+ });
1897
+ this.date = input(...ngDevMode ? [void 0, { debugName: "date" }] : /* istanbul ignore next */ []);
1898
+ this._mutableDate = linkedSignal(this.date, ...ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []);
1899
+ this._start = linkedSignal(() => this._mutableDate()?.[0], ...ngDevMode ? [{ debugName: "_start" }] : /* istanbul ignore next */ []);
1900
+ this._end = linkedSignal(() => this._mutableDate()?.[1], ...ngDevMode ? [{ debugName: "_end" }] : /* istanbul ignore next */ []);
1901
+ this.autoCloseOnEndSelection = input(this._config.autoCloseOnEndSelection, {
1902
+ ...ngDevMode ? { debugName: "autoCloseOnEndSelection" } : /* istanbul ignore next */ {},
1903
+ transform: booleanAttribute
1904
+ });
1905
+ this.formatDates = input(this._config.formatDates, ...ngDevMode ? [{ debugName: "formatDates" }] : /* istanbul ignore next */ []);
1906
+ this.transformDates = input(this._config.transformDates, ...ngDevMode ? [{ debugName: "transformDates" }] : /* istanbul ignore next */ []);
1907
+ this._popoverState = signal(null, ...ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []);
1908
+ this._disabled = linkedSignal(this.disabled, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
1909
+ this.disabledState = this._disabled.asReadonly();
1910
+ this.formattedDate = computed(() => {
1911
+ const start = this._start();
1912
+ const end = this._end();
1913
+ return start || end ? this.formatDates()([start ?? null, end ?? null]) : void 0;
1914
+ }, ...ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []);
1915
+ this.dateChange = output();
1916
+ this.labelableId = computed(() => this._trigger()?.triggerId(), ...ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []);
1917
+ this.hasDate = computed(() => !!this._start() || !!this._end(), ...ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []);
1918
+ this.value = computed(() => this._mutableDate() ?? null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1919
+ }
1920
+ _onStateChange(state) {
1921
+ this._popoverState.set(state);
1922
+ if (state === "closed") {
1923
+ this._onClose();
1924
+ this._onTouched?.();
1925
+ }
1926
+ }
1927
+ _handleStartDayChange(value) {
1928
+ this._start.set(value);
1929
+ }
1930
+ _handleEndDateChange(value) {
1931
+ this._end.set(value);
1932
+ if (this._disabled()) return;
1933
+ const start = this._start();
1934
+ if (start && value) {
1935
+ const transformedDates = this.transformDates()([start, value]);
1936
+ this._mutableDate.set(transformedDates);
1937
+ this.dateChange.emit(transformedDates);
1938
+ this._onChange?.(transformedDates);
1939
+ if (this.autoCloseOnEndSelection()) this._popoverState.set("closed");
1940
+ }
1941
+ }
1942
+ updateDate(value) {
1943
+ if (this._disabled()) return;
1944
+ if (!value) {
1945
+ this._mutableDate.set(void 0);
1946
+ this._start.set(void 0);
1947
+ this._end.set(void 0);
1948
+ this._onChange?.(null);
1949
+ this.dateChange.emit(null);
1950
+ return;
1951
+ }
1952
+ const transformedDates = this.transformDates()(value);
1953
+ this._mutableDate.set(transformedDates);
1954
+ this._start.set(transformedDates[0]);
1955
+ this._end.set(transformedDates[1]);
1956
+ this._onChange?.(transformedDates);
1957
+ this.dateChange.emit(transformedDates);
1958
+ }
1959
+ touched() {
1960
+ this._onTouched?.();
1961
+ }
1962
+ writeValue(value) {
1963
+ untracked(() => {
1964
+ if (!value) this._mutableDate.set(void 0);
1965
+ else this._mutableDate.set(this.transformDates()(value));
1966
+ });
1967
+ }
1968
+ registerOnChange(fn) {
1969
+ this._onChange = fn;
1970
+ }
1971
+ registerOnTouched(fn) {
1972
+ this._onTouched = fn;
1973
+ }
1974
+ setDisabledState(isDisabled) {
1975
+ this._disabled.set(isDisabled);
1976
+ }
1977
+ open() {
1978
+ this._popoverState.set("open");
1979
+ }
1980
+ close() {
1981
+ this._popoverState.set("closed");
1982
+ }
1983
+ reset() {
1984
+ this._mutableDate.set(void 0);
1985
+ this._start.set(void 0);
1986
+ this._end.set(void 0);
1987
+ this._onChange?.(null);
1988
+ this.dateChange.emit(null);
1989
+ }
1990
+ _onClose() {
1991
+ const dates = this._mutableDate();
1992
+ if (this._start() && !this._end() && dates) {
1993
+ this._start.set(dates[0]);
1994
+ this._end.set(dates[1]);
1995
+ }
1996
+ }
1997
+ static {
1998
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1999
+ minVersion: "12.0.0",
2000
+ version: "22.2.4",
2001
+ ngImport: i0,
2002
+ type: HlmDateRangePicker,
2003
+ deps: [],
2004
+ target: i0.ɵɵFactoryTarget.Component
2005
+ });
2006
+ }
2007
+ static {
2008
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2009
+ minVersion: "17.2.0",
2010
+ version: "22.2.4",
2011
+ type: HlmDateRangePicker,
2012
+ isStandalone: true,
2013
+ selector: "hlm-date-range-picker",
2014
+ inputs: {
2015
+ align: {
2016
+ classPropertyName: "align",
2017
+ publicName: "align",
2018
+ isSignal: true,
2019
+ isRequired: false,
2020
+ transformFunction: null
2021
+ },
2022
+ captionLayout: {
2023
+ classPropertyName: "captionLayout",
2024
+ publicName: "captionLayout",
2025
+ isSignal: true,
2026
+ isRequired: false,
2027
+ transformFunction: null
2028
+ },
2029
+ minDate: {
2030
+ classPropertyName: "minDate",
2031
+ publicName: "minDate",
2032
+ isSignal: true,
2033
+ isRequired: false,
2034
+ transformFunction: null
2035
+ },
2036
+ maxDate: {
2037
+ classPropertyName: "maxDate",
2038
+ publicName: "maxDate",
2039
+ isSignal: true,
2040
+ isRequired: false,
2041
+ transformFunction: null
2042
+ },
2043
+ disabled: {
2044
+ classPropertyName: "disabled",
2045
+ publicName: "disabled",
2046
+ isSignal: true,
2047
+ isRequired: false,
2048
+ transformFunction: null
2049
+ },
2050
+ date: {
2051
+ classPropertyName: "date",
2052
+ publicName: "date",
2053
+ isSignal: true,
2054
+ isRequired: false,
2055
+ transformFunction: null
2056
+ },
2057
+ autoCloseOnEndSelection: {
2058
+ classPropertyName: "autoCloseOnEndSelection",
2059
+ publicName: "autoCloseOnEndSelection",
2060
+ isSignal: true,
2061
+ isRequired: false,
2062
+ transformFunction: null
2063
+ },
2064
+ formatDates: {
2065
+ classPropertyName: "formatDates",
2066
+ publicName: "formatDates",
2067
+ isSignal: true,
2068
+ isRequired: false,
2069
+ transformFunction: null
2070
+ },
2071
+ transformDates: {
2072
+ classPropertyName: "transformDates",
2073
+ publicName: "transformDates",
2074
+ isSignal: true,
2075
+ isRequired: false,
2076
+ transformFunction: null
2077
+ }
2078
+ },
2079
+ outputs: { dateChange: "dateChange" },
2080
+ host: { classAttribute: "block" },
2081
+ providers: [
2082
+ HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR,
2083
+ provideBrnDatePicker(HlmDateRangePicker),
2084
+ provideBrnLabelable(HlmDateRangePicker)
2085
+ ],
2086
+ queries: [{
2087
+ propertyName: "_trigger",
2088
+ first: true,
2089
+ predicate: BrnDatePickerTriggerToken,
2090
+ descendants: true,
2091
+ isSignal: true
2092
+ }],
2093
+ viewQueries: [{
2094
+ propertyName: "popover",
2095
+ first: true,
2096
+ predicate: BrnPopover,
2097
+ descendants: true,
2098
+ isSignal: true
2099
+ }],
2100
+ hostDirectives: [{ directive: i1$1.BrnFieldControl }],
2101
+ ngImport: i0,
2102
+ template: `
1113
2103
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
1114
2104
  <ng-content />
1115
2105
 
@@ -1129,22 +2119,54 @@ class HlmDateRangePicker {
1129
2119
  <ng-content select="[hlmDatePickerFooter]" />
1130
2120
  </hlm-popover-content>
1131
2121
  </hlm-popover>
1132
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: i2.HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "directive", type: i2.HlmPopoverPortal, selector: "[hlmPopoverPortal]" }, { kind: "component", type: HlmCalendarRange, selector: "hlm-calendar-range", inputs: ["captionLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1133
- }
1134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmDateRangePicker, decorators: [{
1135
- type: Component,
1136
- args: [{
1137
- selector: 'hlm-date-range-picker',
1138
- imports: [HlmPopoverImports, HlmCalendarRange],
1139
- providers: [
1140
- HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR,
1141
- provideBrnDatePicker(HlmDateRangePicker),
1142
- provideBrnLabelable(HlmDateRangePicker),
1143
- ],
1144
- changeDetection: ChangeDetectionStrategy.OnPush,
1145
- hostDirectives: [BrnFieldControl],
1146
- host: { class: 'block' },
1147
- template: `
2122
+ `,
2123
+ isInline: true,
2124
+ dependencies: [
2125
+ {
2126
+ kind: "directive",
2127
+ type: i2.HlmPopover,
2128
+ selector: "[hlmPopover],hlm-popover"
2129
+ },
2130
+ {
2131
+ kind: "directive",
2132
+ type: i2.HlmPopoverContent,
2133
+ selector: "[hlmPopoverContent],hlm-popover-content"
2134
+ },
2135
+ {
2136
+ kind: "directive",
2137
+ type: i2.HlmPopoverPortal,
2138
+ selector: "[hlmPopoverPortal]"
2139
+ },
2140
+ {
2141
+ kind: "component",
2142
+ type: HlmCalendarRange,
2143
+ selector: "hlm-calendar-range",
2144
+ inputs: ["captionLayout"]
2145
+ }
2146
+ ],
2147
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2148
+ });
2149
+ }
2150
+ };
2151
+ i0.ɵɵngDeclareClassMetadata({
2152
+ minVersion: "12.0.0",
2153
+ version: "22.2.4",
2154
+ ngImport: i0,
2155
+ type: HlmDateRangePicker,
2156
+ decorators: [{
2157
+ type: Component,
2158
+ args: [{
2159
+ selector: "hlm-date-range-picker",
2160
+ imports: [HlmPopoverImports, HlmCalendarRange],
2161
+ providers: [
2162
+ HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR,
2163
+ provideBrnDatePicker(HlmDateRangePicker),
2164
+ provideBrnLabelable(HlmDateRangePicker)
2165
+ ],
2166
+ changeDetection: ChangeDetectionStrategy.OnPush,
2167
+ hostDirectives: [BrnFieldControl],
2168
+ host: { class: "block" },
2169
+ template: `
1148
2170
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
1149
2171
  <ng-content />
1150
2172
 
@@ -1164,81 +2186,191 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
1164
2186
  <ng-content select="[hlmDatePickerFooter]" />
1165
2187
  </hlm-popover-content>
1166
2188
  </hlm-popover>
1167
- `,
1168
- }]
1169
- }], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnPopover), { isSignal: true }] }], _trigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], autoCloseOnEndSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnEndSelection", required: false }] }], formatDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDates", required: false }] }], transformDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDates", required: false }] }], dateChange: [{ type: i0.Output, args: ["dateChange"] }] } });
1170
-
2189
+ `
2190
+ }]
2191
+ }],
2192
+ propDecorators: {
2193
+ popover: [{
2194
+ type: i0.ViewChild,
2195
+ args: [i0.forwardRef(() => BrnPopover), { isSignal: true }]
2196
+ }],
2197
+ _trigger: [{
2198
+ type: i0.ContentChild,
2199
+ args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }]
2200
+ }],
2201
+ align: [{
2202
+ type: i0.Input,
2203
+ args: [{
2204
+ isSignal: true,
2205
+ alias: "align",
2206
+ required: false
2207
+ }]
2208
+ }],
2209
+ captionLayout: [{
2210
+ type: i0.Input,
2211
+ args: [{
2212
+ isSignal: true,
2213
+ alias: "captionLayout",
2214
+ required: false
2215
+ }]
2216
+ }],
2217
+ minDate: [{
2218
+ type: i0.Input,
2219
+ args: [{
2220
+ isSignal: true,
2221
+ alias: "minDate",
2222
+ required: false
2223
+ }]
2224
+ }],
2225
+ maxDate: [{
2226
+ type: i0.Input,
2227
+ args: [{
2228
+ isSignal: true,
2229
+ alias: "maxDate",
2230
+ required: false
2231
+ }]
2232
+ }],
2233
+ disabled: [{
2234
+ type: i0.Input,
2235
+ args: [{
2236
+ isSignal: true,
2237
+ alias: "disabled",
2238
+ required: false
2239
+ }]
2240
+ }],
2241
+ date: [{
2242
+ type: i0.Input,
2243
+ args: [{
2244
+ isSignal: true,
2245
+ alias: "date",
2246
+ required: false
2247
+ }]
2248
+ }],
2249
+ autoCloseOnEndSelection: [{
2250
+ type: i0.Input,
2251
+ args: [{
2252
+ isSignal: true,
2253
+ alias: "autoCloseOnEndSelection",
2254
+ required: false
2255
+ }]
2256
+ }],
2257
+ formatDates: [{
2258
+ type: i0.Input,
2259
+ args: [{
2260
+ isSignal: true,
2261
+ alias: "formatDates",
2262
+ required: false
2263
+ }]
2264
+ }],
2265
+ transformDates: [{
2266
+ type: i0.Input,
2267
+ args: [{
2268
+ isSignal: true,
2269
+ alias: "transformDates",
2270
+ required: false
2271
+ }]
2272
+ }],
2273
+ dateChange: [{
2274
+ type: i0.Output,
2275
+ args: ["dateChange"]
2276
+ }]
2277
+ }
2278
+ });
1171
2279
  const mmYYYY = (date) => {
1172
- if (!(date instanceof Date))
1173
- return `${date}`;
1174
- const month = String(date.getMonth() + 1).padStart(2, '0');
1175
- const year = date.getFullYear();
1176
- return `${month}/${year}`;
2280
+ if (!(date instanceof Date)) return `${date}`;
2281
+ return `${String(date.getMonth() + 1).padStart(2, "0")}/${date.getFullYear()}`;
1177
2282
  };
1178
2283
  function getDefaultConfig() {
1179
- return {
1180
- formatDate: mmYYYY,
1181
- formatInputDate: mmYYYY,
1182
- transformDate: (date) => date,
1183
- parseDate: (value) => {
1184
- if (typeof value !== 'string')
1185
- return null;
1186
- const match = value.match(/^(\d{2})\/(\d{4})$/);
1187
- if (!match)
1188
- return null;
1189
- const month = Number(match[1]);
1190
- const year = Number(match[2]);
1191
- if (month < 1 || month > 12)
1192
- return null;
1193
- const date = new Date(year, month - 1, 1);
1194
- return date;
1195
- },
1196
- autoCloseOnSelect: false,
1197
- };
2284
+ return {
2285
+ formatDate: mmYYYY,
2286
+ formatInputDate: mmYYYY,
2287
+ transformDate: (date) => date,
2288
+ parseDate: (value) => {
2289
+ if (typeof value !== "string") return null;
2290
+ const match = value.match(/^(\d{2})\/(\d{4})$/);
2291
+ if (!match) return null;
2292
+ const month = Number(match[1]);
2293
+ const year = Number(match[2]);
2294
+ if (month < 1 || month > 12) return null;
2295
+ return new Date(year, month - 1, 1);
2296
+ },
2297
+ autoCloseOnSelect: false
2298
+ };
1198
2299
  }
1199
- const HlmMonthYearPickerConfigToken = new InjectionToken('HlmMonthYearPickerConfig');
2300
+ const HlmMonthYearPickerConfigToken = new InjectionToken("HlmMonthYearPickerConfig");
1200
2301
  function provideHlmMonthYearPickerConfig(config) {
1201
- return { provide: HlmMonthYearPickerConfigToken, useValue: { ...getDefaultConfig(), ...config } };
2302
+ return {
2303
+ provide: HlmMonthYearPickerConfigToken,
2304
+ useValue: {
2305
+ ...getDefaultConfig(),
2306
+ ...config
2307
+ }
2308
+ };
1202
2309
  }
1203
2310
  function injectHlmMonthYearPickerConfig() {
1204
- const injectedConfig = inject(HlmMonthYearPickerConfigToken, { optional: true });
1205
- return injectedConfig ? injectedConfig : getDefaultConfig();
2311
+ const injectedConfig = inject(HlmMonthYearPickerConfigToken, { optional: true });
2312
+ return injectedConfig ? injectedConfig : getDefaultConfig();
1206
2313
  }
1207
-
1208
- class HlmMonthYearInput extends BrnDateInput {
1209
- constructor() {
1210
- super(...arguments);
1211
- this._config = injectHlmMonthYearPickerConfig();
1212
- this._fieldControl = inject(BrnFieldControl, { optional: true });
1213
- this._invalid = this._fieldControl?.invalid;
1214
- this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
1215
- this._dirty = this._fieldControl?.dirty;
1216
- this._touched = this._fieldControl?.touched;
1217
- this._ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
1218
- /**
1219
- * Parses input text into a date value. Return `null` for invalid
1220
- * input - the picker's date is cleared while the text is preserved so
1221
- * the user can fix it.
1222
- *
1223
- * Defaults to `parseDate` from `HlmMonthYearPickerConfig`.
1224
- */
1225
- this.parseDate = input(this._config.parseDate, ...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
1226
- /**
1227
- * Formats the current date into the input/edit format shown while the
1228
- * input is focused. On blur the picker's display format is restored.
1229
- *
1230
- * Defaults to `formatInputDate` from `HlmMonthYearPickerConfig`.
1231
- */
1232
- this.formatInputDate = input(this._config.formatInputDate, ...(ngDevMode ? [{ debugName: "formatInputDate" }] : /* istanbul ignore next */ []));
1233
- }
1234
- parseValue(value) {
1235
- return this.parseDate()(value);
1236
- }
1237
- formatInputValue(value) {
1238
- return this.formatInputDate()(value);
1239
- }
1240
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmMonthYearInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1241
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HlmMonthYearInput, isStandalone: true, selector: "hlm-month-year-input", inputs: { parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDate: { classPropertyName: "formatInputDate", publicName: "formatInputDate", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmMonthYearInput)], usesInheritance: true, hostDirectives: [{ directive: i1.HlmInputGroup }], ngImport: i0, template: `
2314
+ var HlmMonthYearInput = class HlmMonthYearInput extends BrnDateInput {
2315
+ constructor() {
2316
+ super(...arguments);
2317
+ this._config = injectHlmMonthYearPickerConfig();
2318
+ this._fieldControl = inject(BrnFieldControl, { optional: true });
2319
+ this._invalid = this._fieldControl?.invalid;
2320
+ this._spartanInvalid = computed(() => this.forceInvalid() || this._fieldControl?.spartanInvalid(), ...ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []);
2321
+ this._dirty = this._fieldControl?.dirty;
2322
+ this._touched = this._fieldControl?.touched;
2323
+ this._ariaInvalid = computed(() => this._invalid?.() ? "true" : null, ...ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []);
2324
+ this.parseDate = input(this._config.parseDate, ...ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []);
2325
+ this.formatInputDate = input(this._config.formatInputDate, ...ngDevMode ? [{ debugName: "formatInputDate" }] : /* istanbul ignore next */ []);
2326
+ }
2327
+ parseValue(value) {
2328
+ return this.parseDate()(value);
2329
+ }
2330
+ formatInputValue(value) {
2331
+ return this.formatInputDate()(value);
2332
+ }
2333
+ static {
2334
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2335
+ minVersion: "12.0.0",
2336
+ version: "22.2.4",
2337
+ ngImport: i0,
2338
+ type: HlmMonthYearInput,
2339
+ deps: null,
2340
+ target: i0.ɵɵFactoryTarget.Component
2341
+ });
2342
+ }
2343
+ static {
2344
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2345
+ minVersion: "17.0.0",
2346
+ version: "22.2.4",
2347
+ type: HlmMonthYearInput,
2348
+ isStandalone: true,
2349
+ selector: "hlm-month-year-input",
2350
+ inputs: {
2351
+ parseDate: {
2352
+ classPropertyName: "parseDate",
2353
+ publicName: "parseDate",
2354
+ isSignal: true,
2355
+ isRequired: false,
2356
+ transformFunction: null
2357
+ },
2358
+ formatInputDate: {
2359
+ classPropertyName: "formatInputDate",
2360
+ publicName: "formatInputDate",
2361
+ isSignal: true,
2362
+ isRequired: false,
2363
+ transformFunction: null
2364
+ }
2365
+ },
2366
+ providers: [provideIcons({
2367
+ lucideCalendar,
2368
+ lucideX
2369
+ }), provideBrnDatePickerTrigger(HlmMonthYearInput)],
2370
+ usesInheritance: true,
2371
+ hostDirectives: [{ directive: i1$2.HlmInputGroup }],
2372
+ ngImport: i0,
2373
+ template: `
1242
2374
  <input
1243
2375
  #input
1244
2376
  hlmInputGroupInput
@@ -1282,17 +2414,60 @@ class HlmMonthYearInput extends BrnDateInput {
1282
2414
  <ng-icon name="lucideCalendar" />
1283
2415
  </button>
1284
2416
  </hlm-input-group-addon>
1285
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1286
- }
1287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmMonthYearInput, decorators: [{
1288
- type: Component,
1289
- args: [{
1290
- selector: 'hlm-month-year-input',
1291
- imports: [HlmInputGroupImports, NgIcon],
1292
- providers: [provideIcons({ lucideCalendar, lucideX }), provideBrnDatePickerTrigger(HlmMonthYearInput)],
1293
- changeDetection: ChangeDetectionStrategy.OnPush,
1294
- hostDirectives: [HlmInputGroup],
1295
- template: `
2417
+ `,
2418
+ isInline: true,
2419
+ dependencies: [
2420
+ {
2421
+ kind: "directive",
2422
+ type: i1$2.HlmInputGroupAddon,
2423
+ selector: "[hlmInputGroupAddon],hlm-input-group-addon",
2424
+ inputs: ["align"]
2425
+ },
2426
+ {
2427
+ kind: "directive",
2428
+ type: i1$2.HlmInputGroupButton,
2429
+ selector: "button[hlmInputGroupButton]",
2430
+ inputs: ["size", "type"]
2431
+ },
2432
+ {
2433
+ kind: "directive",
2434
+ type: i1$2.HlmInputGroupInput,
2435
+ selector: "input[hlmInputGroupInput]"
2436
+ },
2437
+ {
2438
+ kind: "component",
2439
+ type: NgIcon,
2440
+ selector: "ng-icon",
2441
+ inputs: [
2442
+ "name",
2443
+ "svg",
2444
+ "size",
2445
+ "strokeWidth",
2446
+ "color"
2447
+ ]
2448
+ }
2449
+ ],
2450
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2451
+ });
2452
+ }
2453
+ };
2454
+ i0.ɵɵngDeclareClassMetadata({
2455
+ minVersion: "12.0.0",
2456
+ version: "22.2.4",
2457
+ ngImport: i0,
2458
+ type: HlmMonthYearInput,
2459
+ decorators: [{
2460
+ type: Component,
2461
+ args: [{
2462
+ selector: "hlm-month-year-input",
2463
+ imports: [HlmInputGroupImports, NgIcon],
2464
+ providers: [provideIcons({
2465
+ lucideCalendar,
2466
+ lucideX
2467
+ }), provideBrnDatePickerTrigger(HlmMonthYearInput)],
2468
+ changeDetection: ChangeDetectionStrategy.OnPush,
2469
+ hostDirectives: [HlmInputGroup],
2470
+ template: `
1296
2471
  <input
1297
2472
  #input
1298
2473
  hlmInputGroupInput
@@ -1336,112 +2511,214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
1336
2511
  <ng-icon name="lucideCalendar" />
1337
2512
  </button>
1338
2513
  </hlm-input-group-addon>
1339
- `,
1340
- }]
1341
- }], propDecorators: { parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDate", required: false }] }] } });
1342
-
2514
+ `
2515
+ }]
2516
+ }],
2517
+ propDecorators: {
2518
+ parseDate: [{
2519
+ type: i0.Input,
2520
+ args: [{
2521
+ isSignal: true,
2522
+ alias: "parseDate",
2523
+ required: false
2524
+ }]
2525
+ }],
2526
+ formatInputDate: [{
2527
+ type: i0.Input,
2528
+ args: [{
2529
+ isSignal: true,
2530
+ alias: "formatInputDate",
2531
+ required: false
2532
+ }]
2533
+ }]
2534
+ }
2535
+ });
1343
2536
  const HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR = {
1344
- provide: NG_VALUE_ACCESSOR,
1345
- useExisting: forwardRef(() => HlmMonthYearPicker),
1346
- multi: true,
2537
+ provide: NG_VALUE_ACCESSOR,
2538
+ useExisting: forwardRef(() => HlmMonthYearPicker),
2539
+ multi: true
1347
2540
  };
1348
- class HlmMonthYearPicker {
1349
- constructor() {
1350
- this._config = injectHlmMonthYearPickerConfig();
1351
- this.popover = viewChild.required(BrnPopover);
1352
- this._trigger = contentChild(BrnDatePickerTriggerToken, ...(ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []));
1353
- this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
1354
- /** The minimum date that can be selected.*/
1355
- this.minDate = input(...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
1356
- /** The maximum date that can be selected. */
1357
- this.maxDate = input(...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
1358
- /** Determine if the date picker is disabled. */
1359
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1360
- /** The selected value. */
1361
- this.date = input(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
1362
- /** The date the calendar focuses on first open when no date is selected. */
1363
- this.defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
1364
- this._mutableDate = linkedSignal(this.date, ...(ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []));
1365
- /** If true, the date picker will close when a date is selected. */
1366
- this.autoCloseOnSelect = input(this._config.autoCloseOnSelect, { ...(ngDevMode ? { debugName: "autoCloseOnSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1367
- /** Defines how the date should be displayed in the UI. */
1368
- this.formatDate = input(this._config.formatDate, ...(ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []));
1369
- /** Defines how the date should be transformed before saving to model/form. */
1370
- this.transformDate = input(this._config.transformDate, ...(ngDevMode ? [{ debugName: "transformDate" }] : /* istanbul ignore next */ []));
1371
- this._popoverState = signal(null, ...(ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []));
1372
- this._disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
1373
- /** @internal The disabled state as a readonly signal */
1374
- this.disabledState = this._disabled.asReadonly();
1375
- this.formattedDate = computed(() => {
1376
- const date = this._mutableDate();
1377
- return date ? this.formatDate()(date) : undefined;
1378
- }, ...(ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []));
1379
- this.dateChange = output();
1380
- this.labelableId = computed(() => this._trigger()?.triggerId(), ...(ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []));
1381
- this.hasDate = computed(() => !!this._mutableDate(), ...(ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []));
1382
- /** @internal The current raw value, used by inputs to reformat on focus. */
1383
- this.value = computed(() => this._mutableDate() ?? null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1384
- }
1385
- _onStateChange(state) {
1386
- this._popoverState.set(state);
1387
- if (state === 'closed')
1388
- this._onTouched?.();
1389
- }
1390
- _handleChange(value) {
1391
- if (this._disabled())
1392
- return;
1393
- this.updateDate(value ?? null);
1394
- if (this.autoCloseOnSelect()) {
1395
- this._popoverState.set('closed');
1396
- }
1397
- }
1398
- /**
1399
- * Commit a date to the picker. Updates the internal model, notifies form
1400
- * controls, and emits `dateChange`. Unlike `_handleChange`, this does not
1401
- * close the popover - it's intended to be called from a text input that
1402
- * is parsing user-entered values while typing.
1403
- */
1404
- updateDate(value) {
1405
- if (this._disabled())
1406
- return;
1407
- const transformedDate = value != null ? this.transformDate()(value) : undefined;
1408
- this._mutableDate.set(transformedDate);
1409
- this._onChange?.(transformedDate ?? null);
1410
- this.dateChange.emit(transformedDate ?? null);
1411
- }
1412
- /** CONTROL VALUE ACCESSOR */
1413
- writeValue(value) {
1414
- this._mutableDate.set(value ? this.transformDate()(value) : undefined);
1415
- }
1416
- registerOnChange(fn) {
1417
- this._onChange = fn;
1418
- }
1419
- registerOnTouched(fn) {
1420
- this._onTouched = fn;
1421
- }
1422
- touched() {
1423
- this._onTouched?.();
1424
- }
1425
- setDisabledState(isDisabled) {
1426
- this._disabled.set(isDisabled);
1427
- }
1428
- open() {
1429
- this._popoverState.set('open');
1430
- }
1431
- close() {
1432
- this._popoverState.set('closed');
1433
- }
1434
- reset() {
1435
- this._mutableDate.set(undefined);
1436
- this._onChange?.(null);
1437
- this.dateChange.emit(null);
1438
- }
1439
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmMonthYearPicker, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1440
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: HlmMonthYearPicker, isStandalone: true, selector: "hlm-month-year-picker", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnSelect: { classPropertyName: "autoCloseOnSelect", publicName: "autoCloseOnSelect", isSignal: true, isRequired: false, transformFunction: null }, formatDate: { classPropertyName: "formatDate", publicName: "formatDate", isSignal: true, isRequired: false, transformFunction: null }, transformDate: { classPropertyName: "transformDate", publicName: "transformDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange" }, host: { classAttribute: "block" }, providers: [
1441
- HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR,
1442
- provideBrnDatePicker(HlmMonthYearPicker),
1443
- provideBrnLabelable(HlmMonthYearPicker),
1444
- ], queries: [{ propertyName: "_trigger", first: true, predicate: BrnDatePickerTriggerToken, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: BrnPopover, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.BrnFieldControl }], ngImport: i0, template: `
2541
+ var HlmMonthYearPicker = class HlmMonthYearPicker {
2542
+ constructor() {
2543
+ this._config = injectHlmMonthYearPickerConfig();
2544
+ this.popover = viewChild.required(BrnPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
2545
+ this._trigger = contentChild(BrnDatePickerTriggerToken, ...ngDevMode ? [{ debugName: "_trigger" }] : /* istanbul ignore next */ []);
2546
+ this.align = input("center", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
2547
+ this.minDate = input(...ngDevMode ? [void 0, { debugName: "minDate" }] : /* istanbul ignore next */ []);
2548
+ this.maxDate = input(...ngDevMode ? [void 0, { debugName: "maxDate" }] : /* istanbul ignore next */ []);
2549
+ this.disabled = input(false, {
2550
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
2551
+ transform: booleanAttribute
2552
+ });
2553
+ this.date = input(...ngDevMode ? [void 0, { debugName: "date" }] : /* istanbul ignore next */ []);
2554
+ this.defaultFocusedDate = input(...ngDevMode ? [void 0, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []);
2555
+ this._mutableDate = linkedSignal(this.date, ...ngDevMode ? [{ debugName: "_mutableDate" }] : /* istanbul ignore next */ []);
2556
+ this.autoCloseOnSelect = input(this._config.autoCloseOnSelect, {
2557
+ ...ngDevMode ? { debugName: "autoCloseOnSelect" } : /* istanbul ignore next */ {},
2558
+ transform: booleanAttribute
2559
+ });
2560
+ this.formatDate = input(this._config.formatDate, ...ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []);
2561
+ this.transformDate = input(this._config.transformDate, ...ngDevMode ? [{ debugName: "transformDate" }] : /* istanbul ignore next */ []);
2562
+ this._popoverState = signal(null, ...ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []);
2563
+ this._disabled = linkedSignal(this.disabled, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
2564
+ this.disabledState = this._disabled.asReadonly();
2565
+ this.formattedDate = computed(() => {
2566
+ const date = this._mutableDate();
2567
+ return date ? this.formatDate()(date) : void 0;
2568
+ }, ...ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []);
2569
+ this.dateChange = output();
2570
+ this.labelableId = computed(() => this._trigger()?.triggerId(), ...ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []);
2571
+ this.hasDate = computed(() => !!this._mutableDate(), ...ngDevMode ? [{ debugName: "hasDate" }] : /* istanbul ignore next */ []);
2572
+ this.value = computed(() => this._mutableDate() ?? null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
2573
+ }
2574
+ _onStateChange(state) {
2575
+ this._popoverState.set(state);
2576
+ if (state === "closed") this._onTouched?.();
2577
+ }
2578
+ _handleChange(value) {
2579
+ if (this._disabled()) return;
2580
+ this.updateDate(value ?? null);
2581
+ if (this.autoCloseOnSelect()) this._popoverState.set("closed");
2582
+ }
2583
+ updateDate(value) {
2584
+ if (this._disabled()) return;
2585
+ const transformedDate = value != null ? this.transformDate()(value) : void 0;
2586
+ this._mutableDate.set(transformedDate);
2587
+ this._onChange?.(transformedDate ?? null);
2588
+ this.dateChange.emit(transformedDate ?? null);
2589
+ }
2590
+ writeValue(value) {
2591
+ this._mutableDate.set(value ? this.transformDate()(value) : void 0);
2592
+ }
2593
+ registerOnChange(fn) {
2594
+ this._onChange = fn;
2595
+ }
2596
+ registerOnTouched(fn) {
2597
+ this._onTouched = fn;
2598
+ }
2599
+ touched() {
2600
+ this._onTouched?.();
2601
+ }
2602
+ setDisabledState(isDisabled) {
2603
+ this._disabled.set(isDisabled);
2604
+ }
2605
+ open() {
2606
+ this._popoverState.set("open");
2607
+ }
2608
+ close() {
2609
+ this._popoverState.set("closed");
2610
+ }
2611
+ reset() {
2612
+ this._mutableDate.set(void 0);
2613
+ this._onChange?.(null);
2614
+ this.dateChange.emit(null);
2615
+ }
2616
+ static {
2617
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2618
+ minVersion: "12.0.0",
2619
+ version: "22.2.4",
2620
+ ngImport: i0,
2621
+ type: HlmMonthYearPicker,
2622
+ deps: [],
2623
+ target: i0.ɵɵFactoryTarget.Component
2624
+ });
2625
+ }
2626
+ static {
2627
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2628
+ minVersion: "17.2.0",
2629
+ version: "22.2.4",
2630
+ type: HlmMonthYearPicker,
2631
+ isStandalone: true,
2632
+ selector: "hlm-month-year-picker",
2633
+ inputs: {
2634
+ align: {
2635
+ classPropertyName: "align",
2636
+ publicName: "align",
2637
+ isSignal: true,
2638
+ isRequired: false,
2639
+ transformFunction: null
2640
+ },
2641
+ minDate: {
2642
+ classPropertyName: "minDate",
2643
+ publicName: "minDate",
2644
+ isSignal: true,
2645
+ isRequired: false,
2646
+ transformFunction: null
2647
+ },
2648
+ maxDate: {
2649
+ classPropertyName: "maxDate",
2650
+ publicName: "maxDate",
2651
+ isSignal: true,
2652
+ isRequired: false,
2653
+ transformFunction: null
2654
+ },
2655
+ disabled: {
2656
+ classPropertyName: "disabled",
2657
+ publicName: "disabled",
2658
+ isSignal: true,
2659
+ isRequired: false,
2660
+ transformFunction: null
2661
+ },
2662
+ date: {
2663
+ classPropertyName: "date",
2664
+ publicName: "date",
2665
+ isSignal: true,
2666
+ isRequired: false,
2667
+ transformFunction: null
2668
+ },
2669
+ defaultFocusedDate: {
2670
+ classPropertyName: "defaultFocusedDate",
2671
+ publicName: "defaultFocusedDate",
2672
+ isSignal: true,
2673
+ isRequired: false,
2674
+ transformFunction: null
2675
+ },
2676
+ autoCloseOnSelect: {
2677
+ classPropertyName: "autoCloseOnSelect",
2678
+ publicName: "autoCloseOnSelect",
2679
+ isSignal: true,
2680
+ isRequired: false,
2681
+ transformFunction: null
2682
+ },
2683
+ formatDate: {
2684
+ classPropertyName: "formatDate",
2685
+ publicName: "formatDate",
2686
+ isSignal: true,
2687
+ isRequired: false,
2688
+ transformFunction: null
2689
+ },
2690
+ transformDate: {
2691
+ classPropertyName: "transformDate",
2692
+ publicName: "transformDate",
2693
+ isSignal: true,
2694
+ isRequired: false,
2695
+ transformFunction: null
2696
+ }
2697
+ },
2698
+ outputs: { dateChange: "dateChange" },
2699
+ host: { classAttribute: "block" },
2700
+ providers: [
2701
+ HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR,
2702
+ provideBrnDatePicker(HlmMonthYearPicker),
2703
+ provideBrnLabelable(HlmMonthYearPicker)
2704
+ ],
2705
+ queries: [{
2706
+ propertyName: "_trigger",
2707
+ first: true,
2708
+ predicate: BrnDatePickerTriggerToken,
2709
+ descendants: true,
2710
+ isSignal: true
2711
+ }],
2712
+ viewQueries: [{
2713
+ propertyName: "popover",
2714
+ first: true,
2715
+ predicate: BrnPopover,
2716
+ descendants: true,
2717
+ isSignal: true
2718
+ }],
2719
+ hostDirectives: [{ directive: i1$1.BrnFieldControl }],
2720
+ ngImport: i0,
2721
+ template: `
1445
2722
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
1446
2723
  <ng-content />
1447
2724
 
@@ -1459,22 +2736,53 @@ class HlmMonthYearPicker {
1459
2736
  <ng-content select="[hlmDatePickerFooter]" />
1460
2737
  </hlm-popover-content>
1461
2738
  </hlm-popover>
1462
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: i2.HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "directive", type: i2.HlmPopoverPortal, selector: "[hlmPopoverPortal]" }, { kind: "component", type: i3.HlmMonthYearCalendar, selector: "hlm-month-year-calendar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1463
- }
1464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HlmMonthYearPicker, decorators: [{
1465
- type: Component,
1466
- args: [{
1467
- selector: 'hlm-month-year-picker',
1468
- imports: [HlmPopoverImports, HlmCalendarImports],
1469
- providers: [
1470
- HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR,
1471
- provideBrnDatePicker(HlmMonthYearPicker),
1472
- provideBrnLabelable(HlmMonthYearPicker),
1473
- ],
1474
- changeDetection: ChangeDetectionStrategy.OnPush,
1475
- hostDirectives: [BrnFieldControl],
1476
- host: { class: 'block' },
1477
- template: `
2739
+ `,
2740
+ isInline: true,
2741
+ dependencies: [
2742
+ {
2743
+ kind: "directive",
2744
+ type: i2.HlmPopover,
2745
+ selector: "[hlmPopover],hlm-popover"
2746
+ },
2747
+ {
2748
+ kind: "directive",
2749
+ type: i2.HlmPopoverContent,
2750
+ selector: "[hlmPopoverContent],hlm-popover-content"
2751
+ },
2752
+ {
2753
+ kind: "directive",
2754
+ type: i2.HlmPopoverPortal,
2755
+ selector: "[hlmPopoverPortal]"
2756
+ },
2757
+ {
2758
+ kind: "component",
2759
+ type: i3.HlmMonthYearCalendar,
2760
+ selector: "hlm-month-year-calendar"
2761
+ }
2762
+ ],
2763
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2764
+ });
2765
+ }
2766
+ };
2767
+ i0.ɵɵngDeclareClassMetadata({
2768
+ minVersion: "12.0.0",
2769
+ version: "22.2.4",
2770
+ ngImport: i0,
2771
+ type: HlmMonthYearPicker,
2772
+ decorators: [{
2773
+ type: Component,
2774
+ args: [{
2775
+ selector: "hlm-month-year-picker",
2776
+ imports: [HlmPopoverImports, HlmCalendarImports],
2777
+ providers: [
2778
+ HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR,
2779
+ provideBrnDatePicker(HlmMonthYearPicker),
2780
+ provideBrnLabelable(HlmMonthYearPicker)
2781
+ ],
2782
+ changeDetection: ChangeDetectionStrategy.OnPush,
2783
+ hostDirectives: [BrnFieldControl],
2784
+ host: { class: "block" },
2785
+ template: `
1478
2786
  <hlm-popover [align]="align()" sideOffset="5" [state]="_popoverState()" (stateChanged)="_onStateChange($event)">
1479
2787
  <ng-content />
1480
2788
 
@@ -1492,26 +2800,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
1492
2800
  <ng-content select="[hlmDatePickerFooter]" />
1493
2801
  </hlm-popover-content>
1494
2802
  </hlm-popover>
1495
- `,
1496
- }]
1497
- }], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnPopover), { isSignal: true }] }], _trigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], autoCloseOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnSelect", required: false }] }], formatDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDate", required: false }] }], transformDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDate", required: false }] }], dateChange: [{ type: i0.Output, args: ["dateChange"] }] } });
1498
-
2803
+ `
2804
+ }]
2805
+ }],
2806
+ propDecorators: {
2807
+ popover: [{
2808
+ type: i0.ViewChild,
2809
+ args: [i0.forwardRef(() => BrnPopover), { isSignal: true }]
2810
+ }],
2811
+ _trigger: [{
2812
+ type: i0.ContentChild,
2813
+ args: [i0.forwardRef(() => BrnDatePickerTriggerToken), { isSignal: true }]
2814
+ }],
2815
+ align: [{
2816
+ type: i0.Input,
2817
+ args: [{
2818
+ isSignal: true,
2819
+ alias: "align",
2820
+ required: false
2821
+ }]
2822
+ }],
2823
+ minDate: [{
2824
+ type: i0.Input,
2825
+ args: [{
2826
+ isSignal: true,
2827
+ alias: "minDate",
2828
+ required: false
2829
+ }]
2830
+ }],
2831
+ maxDate: [{
2832
+ type: i0.Input,
2833
+ args: [{
2834
+ isSignal: true,
2835
+ alias: "maxDate",
2836
+ required: false
2837
+ }]
2838
+ }],
2839
+ disabled: [{
2840
+ type: i0.Input,
2841
+ args: [{
2842
+ isSignal: true,
2843
+ alias: "disabled",
2844
+ required: false
2845
+ }]
2846
+ }],
2847
+ date: [{
2848
+ type: i0.Input,
2849
+ args: [{
2850
+ isSignal: true,
2851
+ alias: "date",
2852
+ required: false
2853
+ }]
2854
+ }],
2855
+ defaultFocusedDate: [{
2856
+ type: i0.Input,
2857
+ args: [{
2858
+ isSignal: true,
2859
+ alias: "defaultFocusedDate",
2860
+ required: false
2861
+ }]
2862
+ }],
2863
+ autoCloseOnSelect: [{
2864
+ type: i0.Input,
2865
+ args: [{
2866
+ isSignal: true,
2867
+ alias: "autoCloseOnSelect",
2868
+ required: false
2869
+ }]
2870
+ }],
2871
+ formatDate: [{
2872
+ type: i0.Input,
2873
+ args: [{
2874
+ isSignal: true,
2875
+ alias: "formatDate",
2876
+ required: false
2877
+ }]
2878
+ }],
2879
+ transformDate: [{
2880
+ type: i0.Input,
2881
+ args: [{
2882
+ isSignal: true,
2883
+ alias: "transformDate",
2884
+ required: false
2885
+ }]
2886
+ }],
2887
+ dateChange: [{
2888
+ type: i0.Output,
2889
+ args: ["dateChange"]
2890
+ }]
2891
+ }
2892
+ });
1499
2893
  const HlmDatePickerImports = [
1500
- HlmDatePicker,
1501
- HlmDatePickerAnchor,
1502
- HlmDatePickerInput,
1503
- HlmDatePickerMulti,
1504
- HlmDateMultiInput,
1505
- HlmDateRangeInput,
1506
- HlmDateRangePicker,
1507
- HlmDatePickerTrigger,
1508
- HlmMonthYearPicker,
1509
- HlmMonthYearInput,
2894
+ HlmDatePicker,
2895
+ HlmDatePickerAnchor,
2896
+ HlmDatePickerInput,
2897
+ HlmDatePickerMulti,
2898
+ HlmDateMultiInput,
2899
+ HlmDateRangeInput,
2900
+ HlmDateRangePicker,
2901
+ HlmDatePickerTrigger,
2902
+ HlmMonthYearPicker,
2903
+ HlmMonthYearInput
1510
2904
  ];
1511
-
1512
- /**
1513
- * Generated bundle index. Do not edit.
1514
- */
1515
-
1516
2905
  export { HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR, HLM_DATE_PICKER_VALUE_ACCESSOR, HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR, HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR, HlmDateMultiInput, HlmDatePicker, HlmDatePickerAnchor, HlmDatePickerImports, HlmDatePickerInput, HlmDatePickerMulti, HlmDatePickerTrigger, HlmDateRangeInput, HlmDateRangePicker, HlmMonthYearInput, HlmMonthYearPicker, injectHlmDatePickerConfig, injectHlmDatePickerMultiConfig, injectHlmDateRangePickerConfig, injectHlmMonthYearPickerConfig, provideHlmDatePickerConfig, provideHlmDatePickerMultiConfig, provideHlmDateRangePickerConfig, provideHlmMonthYearPickerConfig };
1517
- //# sourceMappingURL=yukit-web-helm-date-picker.mjs.map
2906
+
2907
+ //# sourceMappingURL=yukit-web-helm-date-picker.mjs.map