@4sh/ui-kit 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -953
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2039
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -130
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -246
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -291
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -194
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -131
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +723 -596
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,227 +1,386 @@
1
- import * as i0 from '@angular/core';
2
- import { input, numberAttribute, booleanAttribute, output, contentChild, viewChild, computed, forwardRef, Component } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { BaseFormField, startOfDay, toIsoTime, toIsoDateTime, toIsoDate, parseIsoTime, parseIsoDateTime, parseIsoDate } from '@4sh/ui-kit/forms';
6
- import { UiField } from '@4sh/ui-kit/forms/ui-field';
7
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
8
-
9
- /** `mode` → the native `type` that draws the OS picker. */
1
+ import * as i0 from "@angular/core";
2
+ import { Component, booleanAttribute, computed, contentChild, forwardRef, input, numberAttribute, output, viewChild } from "@angular/core";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
5
+ import { BaseFormField, parseIsoDate, parseIsoDateTime, parseIsoTime, startOfDay, toIsoDate, toIsoDateTime, toIsoTime } from "@4sh/ui-kit/forms";
6
+ import { UiField } from "@4sh/ui-kit/forms/ui-field";
7
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
10
8
  const NATIVE_TYPE = {
11
- date: 'date',
12
- time: 'time',
13
- datetime: 'datetime-local',
9
+ date: "date",
10
+ time: "time",
11
+ datetime: "datetime-local"
14
12
  };
15
- /**
16
- * ui-input-date — **native** date/time field on the `ui-field` shell (label + box + helper).
17
- *
18
- * The picker belongs to the OS: the system wheel on mobile — which no overlay matches —
19
- * and the browser's own calendar on desktop. That is the whole reason this component
20
- * exists next to [`ui-datepicker`](../ui-datepicker), which owns the opposite trade: a
21
- * calendar carried by the design system, with ranges, multi-month and inline modes.
22
- *
23
- * It is a sibling of `ui-input`, not a variant of it: three things a text field cannot do
24
- * are settled here.
25
- *
26
- * 1. **The value is a date, not a string.** `valueType` commits to `Date` or to an ISO
27
- * string, exactly as `ui-datepicker` does — that alignment is what lets a host branch
28
- * between the two on viewport without converting anything.
29
- * 2. **It emits on `change`, never on `input`.** A native temporal control blanks its own
30
- * value while the entry is incomplete, so an `input`-driven field fires a burst of
31
- * empty values as the user types — indistinguishable from clearing the field, and quite
32
- * visible on an autosave or a dependent control.
33
- * 3. **The label stays raised.** The browser draws its own `jj/mm/aaaa` template in the
34
- * box, so a floating label at rest would land on top of it.
35
- *
36
- * No `placeholder`: the browser ignores it on these types, that template holding the spot.
37
- *
38
- * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
39
- */
40
- class UiInputDate extends BaseFormField {
41
- constructor() {
42
- super(...arguments);
43
- /** Granularity: a day, a time of day, or both. */
44
- this.mode = input('date', /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
46
- /**
47
- * Shape of the emitted value: `'date'` (a plain `Date`) or `'iso'` (`yyyy-MM-dd`, or
48
- * `yyyy-MM-ddTHH:mm` as soon as a time is part of it). Incoming values are accepted in
49
- * **either** shape whatever this says — only the emitted side commits.
50
- */
51
- this.valueType = input('date', /* @ts-ignore */
52
- ...(ngDevMode ? [{ debugName: "valueType" }] : /* istanbul ignore next */ []));
53
- /** Earliest accepted value, as a `Date` or in the ISO shape of the current `mode`. */
54
- this.min = input(/* @ts-ignore */
55
- ...(ngDevMode ? [undefined, { debugName: "min" }] : /* istanbul ignore next */ []));
56
- /** Latest accepted value, same two shapes as {@link min}. */
57
- this.max = input(/* @ts-ignore */
58
- ...(ngDevMode ? [undefined, { debugName: "max" }] : /* istanbul ignore next */ []));
59
- /**
60
- * Native `step`: days on `date`, **seconds** on `time` / `datetime` (`900` = quarters of
61
- * an hour; the browser's own default is `60`, i.e. whole minutes).
62
- */
63
- this.step = input(undefined, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
64
- /** Icon of the button that opens the picker: `clock` by default in `mode="time"`. */
65
- this.icon = input(/* @ts-ignore */
66
- ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
67
- /** Renders the button that opens the picker. */
68
- this.showIcon = input(true, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
69
- /** Accessible name of the picker button. Defaults per {@link mode}. */
70
- this.iconAriaLabel = input(/* @ts-ignore */
71
- ...(ngDevMode ? [undefined, { debugName: "iconAriaLabel" }] : /* istanbul ignore next */ []));
72
- /** Custom icon, as an input: same context as `ui-input`'s / `ui-datepicker`'s. */
73
- this.iconTemplate = input(/* @ts-ignore */
74
- ...(ngDevMode ? [undefined, { debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
75
- /** Emitted when the browser commits a value — never mid-entry. */
76
- this.valueChange = output();
77
- /** Emitted when the field receives focus. */
78
- this.inputFocus = output();
79
- /** Emitted when the field loses focus. */
80
- this.inputBlur = output();
81
- /** Custom icon: `<ng-template #icon let-name let-size="size">`. */
82
- this.iconTemplateContent = contentChild('icon', /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "iconTemplateContent" }] : /* istanbul ignore next */ []));
84
- /** @ignore */
85
- this.inputEl = viewChild.required('inputEl', /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
87
- /** @ignore Icon size aligned with the field size, same pairing as `ui-input`. */
88
- this.iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'md'), /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
90
- /** @ignore Calendar, or clock when the field only carries a time. */
91
- this.resolvedIcon = computed(() => this.icon() ?? (this.mode() === 'time' ? 'clock' : 'calendar'), /* @ts-ignore */
92
- ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
93
- /** @ignore */
94
- this.resolvedIconAriaLabel = computed(() => this.iconAriaLabel() ??
95
- (this.mode() === 'time' ? "Ouvrir le sélecteur d'heure" : 'Ouvrir le calendrier'), /* @ts-ignore */
96
- ...(ngDevMode ? [{ debugName: "resolvedIconAriaLabel" }] : /* istanbul ignore next */ []));
97
- /** @ignore Input wins over the projected `#icon` template. */
98
- this.resolvedIconTemplate = computed(() => this.iconTemplate() ?? this.iconTemplateContent(), /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "resolvedIconTemplate" }] : /* istanbul ignore next */ []));
100
- /** @ignore */
101
- this.iconContext = computed(() => ({
102
- $implicit: this.resolvedIcon(),
103
- size: this.iconSize(),
104
- disabled: this.isDisabled(),
105
- }), /* @ts-ignore */
106
- ...(ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []));
107
- /** @ignore The native `type` the OS picker hangs off. */
108
- this.nativeType = computed(() => NATIVE_TYPE[this.mode()], /* @ts-ignore */
109
- ...(ngDevMode ? [{ debugName: "nativeType" }] : /* istanbul ignore next */ []));
110
- /** @ignore Whether the value carries a time — decides both serializers. */
111
- this.hasTimeComponent = computed(() => this.mode() !== 'date', /* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "hasTimeComponent" }] : /* istanbul ignore next */ []));
113
- /** @ignore Model → the string the native control reads, `''` when there is no value. */
114
- this.nativeValue = computed(() => {
115
- const date = this.parseValue(this.modelValue() ?? null);
116
- return date ? this.toNative(date) : '';
117
- }, /* @ts-ignore */
118
- ...(ngDevMode ? [{ debugName: "nativeValue" }] : /* istanbul ignore next */ []));
119
- /** @ignore Bounds go through the same serializer as the value: a caller may hand a `Date`
120
- * or an already-native string, the attribute only ever sees the latter. */
121
- this.nativeMin = computed(() => this.toNativeBound(this.min()), /* @ts-ignore */
122
- ...(ngDevMode ? [{ debugName: "nativeMin" }] : /* istanbul ignore next */ []));
123
- /** @ignore */
124
- this.nativeMax = computed(() => this.toNativeBound(this.max()), /* @ts-ignore */
125
- ...(ngDevMode ? [{ debugName: "nativeMax" }] : /* istanbul ignore next */ []));
126
- /** @ignore Full `aria-describedby`: the message id, only when a message is rendered. */
127
- this.resolvedAriaDescribedBy = computed(() => this.displayMessage() ? this.messageId() : null, /* @ts-ignore */
128
- ...(ngDevMode ? [{ debugName: "resolvedAriaDescribedBy" }] : /* istanbul ignore next */ []));
129
- }
130
- /** Focuses the field. */
131
- focus(options) {
132
- this.inputEl().nativeElement.focus(options);
133
- }
134
- openPicker() {
135
- if (this.isDisabled() || this.readonly())
136
- return;
137
- const el = this.inputEl().nativeElement;
138
- el.focus();
139
- try {
140
- el.showPicker();
141
- }
142
- catch {
143
- /* no picker to show */
144
- }
145
- }
146
- /** Native `<input>` element, for a composite host that needs direct DOM access. */
147
- nativeInputElement() {
148
- return this.inputEl().nativeElement;
149
- }
150
- /** @ignore */
151
- uidPrefix() {
152
- return 'ui-input-date';
153
- }
154
- /**
155
- * @ignore The browser committed a value — a complete one, or an empty one because the
156
- * field was cleared. This is the only place a value leaves the component: `input` fires
157
- * on every keystroke with the blanks in between, and is deliberately not listened to.
158
- */
159
- onNativeChange() {
160
- const raw = this.inputEl().nativeElement.value;
161
- const date = raw ? this.fromNative(raw) : null;
162
- const value = date ? this.serializeValue(date) : null;
163
- this.modelValue.set(value);
164
- this.emitChange(value);
165
- this.valueChange.emit(value);
166
- }
167
- /** @ignore */
168
- onBlur(event) {
169
- this.emitTouch();
170
- this.inputBlur.emit(event);
171
- }
172
- /** @ignore Internal `Date` → the shape `valueType` commits to. Mirrors `ui-datepicker`'s
173
- * own `serializeValue`, down to the fresh instance: the caller never gets a reference it
174
- * could mutate behind our back. */
175
- serializeValue(date) {
176
- if (this.valueType() === 'iso')
177
- return this.toNative(date);
178
- return this.hasTimeComponent() ? new Date(date) : startOfDay(date);
179
- }
180
- /** @ignore Incoming value, `Date` or ISO string, auto-detected — cloned when already a
181
- * `Date`, symmetric with {@link serializeValue}. */
182
- parseValue(value) {
183
- if (value === undefined || value === null || value === '')
184
- return null;
185
- return value instanceof Date ? new Date(value) : this.fromNative(value);
186
- }
187
- /** @ignore `Date` → the exact string the native control of this `mode` accepts. */
188
- toNative(date) {
189
- if (this.mode() === 'time')
190
- return toIsoTime(date);
191
- return this.hasTimeComponent() ? toIsoDateTime(date) : toIsoDate(date);
192
- }
193
- /** @ignore The reverse. `null` on anything malformed — a bad value degrades to "no value"
194
- * rather than throwing, the browser being the one that produced it. */
195
- fromNative(value) {
196
- if (this.mode() === 'time')
197
- return parseIsoTime(value);
198
- return this.hasTimeComponent() ? parseIsoDateTime(value) : parseIsoDate(value);
199
- }
200
- /** @ignore A bound is optional, and a string one is already native. */
201
- toNativeBound(bound) {
202
- if (!bound)
203
- return null;
204
- return bound instanceof Date ? this.toNative(bound) : bound;
205
- }
206
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputDate, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
207
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiInputDate, isStandalone: true, selector: "ui-input-date", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, valueType: { classPropertyName: "valueType", publicName: "valueType", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, iconAriaLabel: { classPropertyName: "iconAriaLabel", publicName: "iconAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [
208
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
209
- ], queries: [{ propertyName: "iconTemplateContent", first: true, predicate: ["icon"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\n }\n</ui-field>\n", styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"], dependencies: [{ kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "floatLabel", "filled", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "showMessageIcon", "messageIcon", "hasFooter", "hasPrefix"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
210
- }
211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputDate, decorators: [{
212
- type: Component,
213
- args: [{ selector: 'ui-input-date', imports: [UiField, UiIcon, NgTemplateOutlet], providers: [
214
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
215
- ], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\n }\n</ui-field>\n", styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"] }]
216
- }], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], valueType: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueType", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], iconAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAriaLabel", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], iconTemplateContent: [{ type: i0.ContentChild, args: ['icon', { isSignal: true }] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
217
-
218
- /*
219
- * Public API Surface of ui-kit/ui-input-date
220
- */
221
-
222
- /**
223
- * Generated bundle index. Do not edit.
224
- */
225
-
13
+ var UiInputDate = class UiInputDate extends BaseFormField {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.mode = input("date", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
17
+ this.valueType = input("date", ...ngDevMode ? [{ debugName: "valueType" }] : /* istanbul ignore next */ []);
18
+ this.min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
19
+ this.max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
20
+ this.step = input(void 0, {
21
+ ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
22
+ transform: numberAttribute
23
+ });
24
+ this.icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
25
+ this.showIcon = input(true, {
26
+ ...ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {},
27
+ transform: booleanAttribute
28
+ });
29
+ this.iconAriaLabel = input(...ngDevMode ? [void 0, { debugName: "iconAriaLabel" }] : /* istanbul ignore next */ []);
30
+ this.iconTemplate = input(...ngDevMode ? [void 0, { debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
31
+ this.valueChange = output();
32
+ this.inputFocus = output();
33
+ this.inputBlur = output();
34
+ this.iconTemplateContent = contentChild("icon", ...ngDevMode ? [{ debugName: "iconTemplateContent" }] : /* istanbul ignore next */ []);
35
+ this.inputEl = viewChild.required("inputEl", ...ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []);
36
+ this.iconSize = computed(() => this.size() === "small" ? "sm" : "md", ...ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []);
37
+ this.resolvedIcon = computed(() => this.icon() ?? (this.mode() === "time" ? "clock" : "calendar"), ...ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []);
38
+ this.resolvedIconAriaLabel = computed(() => this.iconAriaLabel() ?? (this.mode() === "time" ? "Ouvrir le sélecteur d'heure" : "Ouvrir le calendrier"), ...ngDevMode ? [{ debugName: "resolvedIconAriaLabel" }] : /* istanbul ignore next */ []);
39
+ this.resolvedIconTemplate = computed(() => this.iconTemplate() ?? this.iconTemplateContent(), ...ngDevMode ? [{ debugName: "resolvedIconTemplate" }] : /* istanbul ignore next */ []);
40
+ this.iconContext = computed(() => ({
41
+ $implicit: this.resolvedIcon(),
42
+ size: this.iconSize(),
43
+ disabled: this.isDisabled()
44
+ }), ...ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []);
45
+ this.nativeType = computed(() => NATIVE_TYPE[this.mode()], ...ngDevMode ? [{ debugName: "nativeType" }] : /* istanbul ignore next */ []);
46
+ this.hasTimeComponent = computed(() => this.mode() !== "date", ...ngDevMode ? [{ debugName: "hasTimeComponent" }] : /* istanbul ignore next */ []);
47
+ this.nativeValue = computed(() => {
48
+ const date = this.parseValue(this.modelValue() ?? null);
49
+ return date ? this.toNative(date) : "";
50
+ }, ...ngDevMode ? [{ debugName: "nativeValue" }] : /* istanbul ignore next */ []);
51
+ this.nativeMin = computed(() => this.toNativeBound(this.min()), ...ngDevMode ? [{ debugName: "nativeMin" }] : /* istanbul ignore next */ []);
52
+ this.nativeMax = computed(() => this.toNativeBound(this.max()), ...ngDevMode ? [{ debugName: "nativeMax" }] : /* istanbul ignore next */ []);
53
+ this.resolvedAriaDescribedBy = computed(() => this.displayMessage() ? this.messageId() : null, ...ngDevMode ? [{ debugName: "resolvedAriaDescribedBy" }] : /* istanbul ignore next */ []);
54
+ }
55
+ focus(options) {
56
+ this.inputEl().nativeElement.focus(options);
57
+ }
58
+ openPicker() {
59
+ if (this.isDisabled() || this.readonly()) return;
60
+ const el = this.inputEl().nativeElement;
61
+ el.focus();
62
+ try {
63
+ el.showPicker();
64
+ } catch {}
65
+ }
66
+ nativeInputElement() {
67
+ return this.inputEl().nativeElement;
68
+ }
69
+ uidPrefix() {
70
+ return "ui-input-date";
71
+ }
72
+ onNativeChange() {
73
+ const raw = this.inputEl().nativeElement.value;
74
+ const date = raw ? this.fromNative(raw) : null;
75
+ const value = date ? this.serializeValue(date) : null;
76
+ this.modelValue.set(value);
77
+ this.emitChange(value);
78
+ this.valueChange.emit(value);
79
+ }
80
+ onBlur(event) {
81
+ this.emitTouch();
82
+ this.inputBlur.emit(event);
83
+ }
84
+ serializeValue(date) {
85
+ if (this.valueType() === "iso") return this.toNative(date);
86
+ return this.hasTimeComponent() ? new Date(date) : startOfDay(date);
87
+ }
88
+ parseValue(value) {
89
+ if (value === void 0 || value === null || value === "") return null;
90
+ return value instanceof Date ? new Date(value) : this.fromNative(value);
91
+ }
92
+ toNative(date) {
93
+ if (this.mode() === "time") return toIsoTime(date);
94
+ return this.hasTimeComponent() ? toIsoDateTime(date) : toIsoDate(date);
95
+ }
96
+ fromNative(value) {
97
+ if (this.mode() === "time") return parseIsoTime(value);
98
+ return this.hasTimeComponent() ? parseIsoDateTime(value) : parseIsoDate(value);
99
+ }
100
+ toNativeBound(bound) {
101
+ if (!bound) return null;
102
+ return bound instanceof Date ? this.toNative(bound) : bound;
103
+ }
104
+ static {
105
+ this.ɵfac = i0.ɵɵngDeclareFactory({
106
+ minVersion: "12.0.0",
107
+ version: "22.3.0",
108
+ ngImport: i0,
109
+ type: UiInputDate,
110
+ deps: null,
111
+ target: i0.ɵɵFactoryTarget.Component
112
+ });
113
+ }
114
+ static {
115
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
116
+ minVersion: "17.0.0",
117
+ version: "22.3.0",
118
+ type: UiInputDate,
119
+ isStandalone: true,
120
+ selector: "ui-input-date",
121
+ inputs: {
122
+ mode: {
123
+ classPropertyName: "mode",
124
+ publicName: "mode",
125
+ isSignal: true,
126
+ isRequired: false,
127
+ transformFunction: null
128
+ },
129
+ valueType: {
130
+ classPropertyName: "valueType",
131
+ publicName: "valueType",
132
+ isSignal: true,
133
+ isRequired: false,
134
+ transformFunction: null
135
+ },
136
+ min: {
137
+ classPropertyName: "min",
138
+ publicName: "min",
139
+ isSignal: true,
140
+ isRequired: false,
141
+ transformFunction: null
142
+ },
143
+ max: {
144
+ classPropertyName: "max",
145
+ publicName: "max",
146
+ isSignal: true,
147
+ isRequired: false,
148
+ transformFunction: null
149
+ },
150
+ step: {
151
+ classPropertyName: "step",
152
+ publicName: "step",
153
+ isSignal: true,
154
+ isRequired: false,
155
+ transformFunction: null
156
+ },
157
+ icon: {
158
+ classPropertyName: "icon",
159
+ publicName: "icon",
160
+ isSignal: true,
161
+ isRequired: false,
162
+ transformFunction: null
163
+ },
164
+ showIcon: {
165
+ classPropertyName: "showIcon",
166
+ publicName: "showIcon",
167
+ isSignal: true,
168
+ isRequired: false,
169
+ transformFunction: null
170
+ },
171
+ iconAriaLabel: {
172
+ classPropertyName: "iconAriaLabel",
173
+ publicName: "iconAriaLabel",
174
+ isSignal: true,
175
+ isRequired: false,
176
+ transformFunction: null
177
+ },
178
+ iconTemplate: {
179
+ classPropertyName: "iconTemplate",
180
+ publicName: "iconTemplate",
181
+ isSignal: true,
182
+ isRequired: false,
183
+ transformFunction: null
184
+ }
185
+ },
186
+ outputs: {
187
+ valueChange: "valueChange",
188
+ inputFocus: "inputFocus",
189
+ inputBlur: "inputBlur"
190
+ },
191
+ providers: [{
192
+ provide: NG_VALUE_ACCESSOR,
193
+ useExisting: forwardRef(() => UiInputDate),
194
+ multi: true
195
+ }],
196
+ queries: [{
197
+ propertyName: "iconTemplateContent",
198
+ first: true,
199
+ predicate: ["icon"],
200
+ descendants: true,
201
+ isSignal: true
202
+ }],
203
+ viewQueries: [{
204
+ propertyName: "inputEl",
205
+ first: true,
206
+ predicate: ["inputEl"],
207
+ descendants: true,
208
+ isSignal: true
209
+ }],
210
+ usesInheritance: true,
211
+ ngImport: i0,
212
+ template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\n }\n</ui-field>\n",
213
+ styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"],
214
+ dependencies: [
215
+ {
216
+ kind: "component",
217
+ type: UiField,
218
+ selector: "ui-field",
219
+ inputs: [
220
+ "label",
221
+ "for",
222
+ "required",
223
+ "size",
224
+ "level",
225
+ "floatLabel",
226
+ "filled",
227
+ "disabled",
228
+ "readonly",
229
+ "multiline",
230
+ "autoHeight",
231
+ "message",
232
+ "messageId",
233
+ "showMessageIcon",
234
+ "messageIcon",
235
+ "hasFooter",
236
+ "hasPrefix"
237
+ ]
238
+ },
239
+ {
240
+ kind: "component",
241
+ type: UiIcon,
242
+ selector: "ui-icon",
243
+ inputs: [
244
+ "name",
245
+ "size",
246
+ "type",
247
+ "family",
248
+ "decorative",
249
+ "ariaLabel"
250
+ ]
251
+ },
252
+ {
253
+ kind: "directive",
254
+ type: NgTemplateOutlet,
255
+ selector: "[ngTemplateOutlet]",
256
+ inputs: [
257
+ "ngTemplateOutletContext",
258
+ "ngTemplateOutlet",
259
+ "ngTemplateOutletInjector"
260
+ ]
261
+ }
262
+ ]
263
+ });
264
+ }
265
+ };
266
+ i0.ɵɵngDeclareClassMetadata({
267
+ minVersion: "12.0.0",
268
+ version: "22.3.0",
269
+ ngImport: i0,
270
+ type: UiInputDate,
271
+ decorators: [{
272
+ type: Component,
273
+ args: [{
274
+ selector: "ui-input-date",
275
+ imports: [
276
+ UiField,
277
+ UiIcon,
278
+ NgTemplateOutlet
279
+ ],
280
+ providers: [{
281
+ provide: NG_VALUE_ACCESSOR,
282
+ useExisting: forwardRef(() => UiInputDate),
283
+ multi: true
284
+ }],
285
+ template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\n }\n</ui-field>\n",
286
+ styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"]
287
+ }]
288
+ }],
289
+ propDecorators: {
290
+ mode: [{
291
+ type: i0.Input,
292
+ args: [{
293
+ isSignal: true,
294
+ alias: "mode",
295
+ required: false
296
+ }]
297
+ }],
298
+ valueType: [{
299
+ type: i0.Input,
300
+ args: [{
301
+ isSignal: true,
302
+ alias: "valueType",
303
+ required: false
304
+ }]
305
+ }],
306
+ min: [{
307
+ type: i0.Input,
308
+ args: [{
309
+ isSignal: true,
310
+ alias: "min",
311
+ required: false
312
+ }]
313
+ }],
314
+ max: [{
315
+ type: i0.Input,
316
+ args: [{
317
+ isSignal: true,
318
+ alias: "max",
319
+ required: false
320
+ }]
321
+ }],
322
+ step: [{
323
+ type: i0.Input,
324
+ args: [{
325
+ isSignal: true,
326
+ alias: "step",
327
+ required: false
328
+ }]
329
+ }],
330
+ icon: [{
331
+ type: i0.Input,
332
+ args: [{
333
+ isSignal: true,
334
+ alias: "icon",
335
+ required: false
336
+ }]
337
+ }],
338
+ showIcon: [{
339
+ type: i0.Input,
340
+ args: [{
341
+ isSignal: true,
342
+ alias: "showIcon",
343
+ required: false
344
+ }]
345
+ }],
346
+ iconAriaLabel: [{
347
+ type: i0.Input,
348
+ args: [{
349
+ isSignal: true,
350
+ alias: "iconAriaLabel",
351
+ required: false
352
+ }]
353
+ }],
354
+ iconTemplate: [{
355
+ type: i0.Input,
356
+ args: [{
357
+ isSignal: true,
358
+ alias: "iconTemplate",
359
+ required: false
360
+ }]
361
+ }],
362
+ valueChange: [{
363
+ type: i0.Output,
364
+ args: ["valueChange"]
365
+ }],
366
+ inputFocus: [{
367
+ type: i0.Output,
368
+ args: ["inputFocus"]
369
+ }],
370
+ inputBlur: [{
371
+ type: i0.Output,
372
+ args: ["inputBlur"]
373
+ }],
374
+ iconTemplateContent: [{
375
+ type: i0.ContentChild,
376
+ args: ["icon", { isSignal: true }]
377
+ }],
378
+ inputEl: [{
379
+ type: i0.ViewChild,
380
+ args: ["inputEl", { isSignal: true }]
381
+ }]
382
+ }
383
+ });
226
384
  export { UiInputDate };
227
- //# sourceMappingURL=4sh-ui-kit-forms-ui-input-date.mjs.map
385
+
386
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-input-date.mjs.map