@beeq/core 1.12.14-beta.0 → 1.13.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 (545) hide show
  1. package/dist/beeq/beeq.esm.js +1 -1
  2. package/dist/beeq/beeq.esm.js.map +1 -1
  3. package/dist/beeq/index.esm.js +1 -1
  4. package/dist/beeq/{p-9d1503bd.entry.js → p-0d078519.entry.js} +2 -2
  5. package/dist/beeq/{p-9d1503bd.entry.js.map → p-0d078519.entry.js.map} +1 -1
  6. package/dist/beeq/{p-7f9d895b.entry.js → p-1a2c4878.entry.js} +2 -2
  7. package/dist/beeq/{p-7f9d895b.entry.js.map → p-1a2c4878.entry.js.map} +1 -1
  8. package/dist/beeq/p-21db4f39.entry.js +6 -0
  9. package/dist/beeq/p-21db4f39.entry.js.map +1 -0
  10. package/dist/beeq/{p-f47905ae.entry.js → p-24bb2588.entry.js} +2 -2
  11. package/dist/beeq/{p-f47905ae.entry.js.map → p-24bb2588.entry.js.map} +1 -1
  12. package/dist/beeq/{p-41910dc5.entry.js → p-2a081a54.entry.js} +2 -2
  13. package/dist/beeq/{p-41910dc5.entry.js.map → p-2a081a54.entry.js.map} +1 -1
  14. package/dist/beeq/{p-515a1162.entry.js → p-2e1fffcd.entry.js} +2 -2
  15. package/dist/beeq/{p-515a1162.entry.js.map → p-2e1fffcd.entry.js.map} +1 -1
  16. package/dist/beeq/p-2fd6ea70.entry.js +6 -0
  17. package/dist/beeq/{p-2283258e.entry.js.map → p-2fd6ea70.entry.js.map} +1 -1
  18. package/dist/beeq/{p-7d356cce.entry.js → p-30d1bd84.entry.js} +2 -2
  19. package/dist/beeq/p-30d1bd84.entry.js.map +1 -0
  20. package/dist/beeq/{p-882966dd.entry.js → p-38006c8e.entry.js} +2 -2
  21. package/dist/beeq/p-3d754d97.entry.js +6 -0
  22. package/dist/beeq/p-3d754d97.entry.js.map +1 -0
  23. package/dist/beeq/{p-e9535627.entry.js → p-45ae19aa.entry.js} +2 -2
  24. package/dist/beeq/p-45ae19aa.entry.js.map +1 -0
  25. package/dist/beeq/{p-54bfb042.entry.js → p-56b49d4e.entry.js} +2 -2
  26. package/dist/beeq/{p-54bfb042.entry.js.map → p-56b49d4e.entry.js.map} +1 -1
  27. package/dist/beeq/{p-0d8618d2.entry.js → p-58813f83.entry.js} +2 -2
  28. package/dist/beeq/{p-0d8618d2.entry.js.map → p-58813f83.entry.js.map} +1 -1
  29. package/dist/beeq/{p-050c757b.entry.js → p-5eba392c.entry.js} +2 -2
  30. package/dist/beeq/{p-050c757b.entry.js.map → p-5eba392c.entry.js.map} +1 -1
  31. package/dist/beeq/{p-debcabde.entry.js → p-6a38fcaf.entry.js} +2 -2
  32. package/dist/beeq/{p-debcabde.entry.js.map → p-6a38fcaf.entry.js.map} +1 -1
  33. package/dist/beeq/{p-8dfd0329.entry.js → p-6b0f896f.entry.js} +2 -2
  34. package/dist/beeq/{p-a0ef4135.entry.js → p-6be3f23a.entry.js} +2 -2
  35. package/dist/beeq/{p-a0ef4135.entry.js.map → p-6be3f23a.entry.js.map} +1 -1
  36. package/dist/beeq/{p-ea473f56.entry.js → p-72ff2fe2.entry.js} +2 -2
  37. package/dist/beeq/{p-7527b08d.entry.js → p-79fd999a.entry.js} +2 -2
  38. package/dist/beeq/{p-7527b08d.entry.js.map → p-79fd999a.entry.js.map} +1 -1
  39. package/dist/beeq/{p-0323869d.entry.js → p-7ebe6b9d.entry.js} +2 -2
  40. package/dist/beeq/p-7ebe6b9d.entry.js.map +1 -0
  41. package/dist/beeq/{p-250ee94e.entry.js → p-817f7a5e.entry.js} +2 -2
  42. package/dist/beeq/{p-250ee94e.entry.js.map → p-817f7a5e.entry.js.map} +1 -1
  43. package/dist/beeq/{p-ad419446.entry.js → p-8bd7f4c2.entry.js} +2 -2
  44. package/dist/beeq/{p-e63d6c4f.entry.js → p-8be7ceb5.entry.js} +2 -2
  45. package/dist/beeq/{p-e63d6c4f.entry.js.map → p-8be7ceb5.entry.js.map} +1 -1
  46. package/dist/beeq/{p-42e388d0.entry.js → p-9413a4d3.entry.js} +2 -2
  47. package/dist/beeq/{p-42e388d0.entry.js.map → p-9413a4d3.entry.js.map} +1 -1
  48. package/dist/beeq/{p-c25c20bf.entry.js → p-96f72671.entry.js} +2 -2
  49. package/dist/beeq/p-96f72671.entry.js.map +1 -0
  50. package/dist/beeq/{p-CO2T68hs.js → p-BSSRzVAz.js} +2 -2
  51. package/dist/beeq/p-BSSRzVAz.js.map +1 -0
  52. package/dist/beeq/p-DbxZ8FhA.js +6 -0
  53. package/dist/beeq/p-DbxZ8FhA.js.map +1 -0
  54. package/dist/beeq/p-DdvbF5yL.js.map +1 -1
  55. package/dist/beeq/p-Dx-CEPSQ.js.map +1 -1
  56. package/dist/beeq/p-a0a8ea5b.entry.js +6 -0
  57. package/dist/beeq/p-a0a8ea5b.entry.js.map +1 -0
  58. package/dist/beeq/{p-2e9bc398.entry.js → p-a55354ee.entry.js} +2 -2
  59. package/dist/beeq/{p-2e9bc398.entry.js.map → p-a55354ee.entry.js.map} +1 -1
  60. package/dist/beeq/{p-7adb6e2e.entry.js → p-a72671f9.entry.js} +2 -2
  61. package/dist/beeq/p-a72671f9.entry.js.map +1 -0
  62. package/dist/beeq/{p-40bb4e2c.entry.js → p-bb99b400.entry.js} +2 -2
  63. package/dist/beeq/{p-40bb4e2c.entry.js.map → p-bb99b400.entry.js.map} +1 -1
  64. package/dist/beeq/p-bdb983f9.entry.js +6 -0
  65. package/dist/beeq/{p-bb46524f.entry.js.map → p-bdb983f9.entry.js.map} +1 -1
  66. package/dist/beeq/{p-cfe07fad.entry.js → p-cf2e4d57.entry.js} +2 -2
  67. package/dist/beeq/{p-cfe07fad.entry.js.map → p-cf2e4d57.entry.js.map} +1 -1
  68. package/dist/beeq/{p-6cd90918.entry.js → p-d6c35472.entry.js} +2 -2
  69. package/dist/beeq/{p-6cd90918.entry.js.map → p-d6c35472.entry.js.map} +1 -1
  70. package/dist/beeq/p-d792e3d3.entry.js +6 -0
  71. package/dist/beeq/{p-edc81a31.entry.js.map → p-d792e3d3.entry.js.map} +1 -1
  72. package/dist/beeq/{p-bae91da4.entry.js → p-e91ee0da.entry.js} +2 -2
  73. package/dist/beeq/{p-bae91da4.entry.js.map → p-e91ee0da.entry.js.map} +1 -1
  74. package/dist/beeq/{p-1fb43de2.entry.js → p-e9a1b183.entry.js} +2 -2
  75. package/dist/beeq/{p-580f0a77.entry.js → p-f3184477.entry.js} +2 -2
  76. package/dist/beeq/{p-580f0a77.entry.js.map → p-f3184477.entry.js.map} +1 -1
  77. package/dist/beeq/p-f688d230.entry.js +6 -0
  78. package/dist/beeq/{p-1e675bdc.entry.js.map → p-f688d230.entry.js.map} +1 -1
  79. package/dist/beeq/{p-3c77308c.entry.js → p-f891fb4b.entry.js} +2 -2
  80. package/dist/beeq/{p-40163197.entry.js → p-fa123a10.entry.js} +2 -2
  81. package/dist/beeq/{p-40163197.entry.js.map → p-fa123a10.entry.js.map} +1 -1
  82. package/dist/beeq/p-kY6d9Evy.js +6 -0
  83. package/dist/beeq/p-kY6d9Evy.js.map +1 -0
  84. package/dist/beeq/p-uqkxeAeG.js.map +1 -1
  85. package/dist/beeq/svg/.icons-meta.json +13 -0
  86. package/dist/beeq.html-custom-data.json +2214 -106
  87. package/dist/cjs/beeq.cjs.js +3 -3
  88. package/dist/cjs/beeq.cjs.js.map +1 -1
  89. package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -2
  90. package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
  91. package/dist/cjs/bq-accordion.cjs.entry.js +3 -3
  92. package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
  93. package/dist/cjs/bq-alert.cjs.entry.js +3 -3
  94. package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
  95. package/dist/cjs/bq-avatar.cjs.entry.js +3 -3
  96. package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
  97. package/dist/cjs/bq-badge.cjs.entry.js +3 -3
  98. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +3 -3
  99. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
  100. package/dist/cjs/bq-breadcrumb.cjs.entry.js +2 -2
  101. package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
  102. package/dist/cjs/bq-button_2.cjs.entry.js +6 -6
  103. package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
  104. package/dist/cjs/bq-card.cjs.entry.js +3 -3
  105. package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
  106. package/dist/cjs/bq-checkbox.cjs.entry.js +35 -22
  107. package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
  108. package/dist/cjs/bq-date-picker.cjs.entry.js +1743 -366
  109. package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
  110. package/dist/cjs/bq-dialog.cjs.entry.js +7 -7
  111. package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
  112. package/dist/cjs/bq-divider.cjs.entry.js +7 -7
  113. package/dist/cjs/bq-drawer.cjs.entry.js +7 -7
  114. package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
  115. package/dist/cjs/bq-dropdown_2.cjs.entry.js +6 -6
  116. package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
  117. package/dist/cjs/bq-empty-state.cjs.entry.js +8 -8
  118. package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
  119. package/dist/cjs/bq-input.cjs.entry.js +17 -10
  120. package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
  121. package/dist/cjs/bq-notification.cjs.entry.js +8 -8
  122. package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
  123. package/dist/cjs/bq-option-group.cjs.entry.js +3 -3
  124. package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
  125. package/dist/cjs/bq-option-list_2.cjs.entry.js +10 -10
  126. package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
  127. package/dist/cjs/bq-option.cjs.entry.js +5 -5
  128. package/dist/cjs/bq-page-title.cjs.entry.js +6 -6
  129. package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
  130. package/dist/cjs/bq-progress.cjs.entry.js +7 -7
  131. package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
  132. package/dist/cjs/bq-radio-group.cjs.entry.js +8 -12
  133. package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
  134. package/dist/cjs/bq-radio.cjs.entry.js +5 -5
  135. package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
  136. package/dist/cjs/bq-select.cjs.entry.js +39 -10
  137. package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
  138. package/dist/cjs/bq-side-menu-item.cjs.entry.js +2 -2
  139. package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
  140. package/dist/cjs/bq-side-menu.cjs.entry.js +3 -3
  141. package/dist/cjs/bq-slider.cjs.entry.js +4 -4
  142. package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
  143. package/dist/cjs/bq-spinner.cjs.entry.js +8 -8
  144. package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
  145. package/dist/cjs/bq-status.cjs.entry.js +4 -4
  146. package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
  147. package/dist/cjs/bq-step-item.cjs.entry.js +7 -7
  148. package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
  149. package/dist/cjs/bq-steps.cjs.entry.js +4 -4
  150. package/dist/cjs/bq-switch.cjs.entry.js +9 -20
  151. package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
  152. package/dist/cjs/bq-tab-group.cjs.entry.js +5 -5
  153. package/dist/cjs/bq-tab.cjs.entry.js +6 -6
  154. package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
  155. package/dist/cjs/bq-textarea.cjs.entry.js +17 -15
  156. package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
  157. package/dist/cjs/bq-toast.cjs.entry.js +5 -7
  158. package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
  159. package/dist/cjs/bq-tooltip.cjs.entry.js +6 -6
  160. package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
  161. package/dist/cjs/{cssVariables-exM7Oz37.js → cssVariables-DuVz7KcV.js} +3 -3
  162. package/dist/cjs/cssVariables-DuVz7KcV.js.map +1 -0
  163. package/dist/cjs/event-BhuEFC-I.js.map +1 -1
  164. package/dist/cjs/{index-BSrsKFVG.js → index-J9jJ-fFQ.js} +47 -12
  165. package/dist/cjs/index-J9jJ-fFQ.js.map +1 -0
  166. package/dist/cjs/index.cjs.js +2 -2
  167. package/dist/cjs/loader.cjs.js +2 -2
  168. package/dist/cjs/{props-DzFXZXSF.js → props-BXpv3G-e.js} +6 -5
  169. package/dist/cjs/props-BXpv3G-e.js.map +1 -0
  170. package/dist/cjs/slot-DKWrtk4b.js.map +1 -1
  171. package/dist/cjs/transition-C0S-pYqN.js.map +1 -1
  172. package/dist/collection/collection-manifest.json +1 -1
  173. package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
  174. package/dist/collection/components/alert/scss/bq-alert.css +1 -1
  175. package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
  176. package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
  177. package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +1 -1
  178. package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
  179. package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
  180. package/dist/collection/components/button/scss/bq-button.css +1 -1
  181. package/dist/collection/components/card/scss/bq-card.css +1 -1
  182. package/dist/collection/components/checkbox/bq-checkbox.js +35 -21
  183. package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
  184. package/dist/collection/components/checkbox/scss/bq-checkbox.css +1 -1
  185. package/dist/collection/components/date-picker/bq-date-picker.js +1141 -457
  186. package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
  187. package/dist/collection/components/date-picker/bq-date-picker.types.js +29 -0
  188. package/dist/collection/components/date-picker/bq-date-picker.types.js.map +1 -1
  189. package/dist/collection/components/date-picker/components/CalendarDayView.js +96 -0
  190. package/dist/collection/components/date-picker/components/CalendarDayView.js.map +1 -0
  191. package/dist/collection/components/date-picker/components/CalendarHeader.js +18 -0
  192. package/dist/collection/components/date-picker/components/CalendarHeader.js.map +1 -0
  193. package/dist/collection/components/date-picker/components/CalendarMonthView.js +70 -0
  194. package/dist/collection/components/date-picker/components/CalendarMonthView.js.map +1 -0
  195. package/dist/collection/components/date-picker/components/CalendarYearView.js +68 -0
  196. package/dist/collection/components/date-picker/components/CalendarYearView.js.map +1 -0
  197. package/dist/collection/components/date-picker/helper/bounds.js +114 -0
  198. package/dist/collection/components/date-picker/helper/bounds.js.map +1 -0
  199. package/dist/collection/components/date-picker/helper/calendar.js +156 -0
  200. package/dist/collection/components/date-picker/helper/calendar.js.map +1 -0
  201. package/dist/collection/components/date-picker/helper/constants.js +62 -16
  202. package/dist/collection/components/date-picker/helper/constants.js.map +1 -1
  203. package/dist/collection/components/date-picker/helper/input.js +37 -0
  204. package/dist/collection/components/date-picker/helper/input.js.map +1 -0
  205. package/dist/collection/components/date-picker/helper/intl.js +78 -0
  206. package/dist/collection/components/date-picker/helper/intl.js.map +1 -0
  207. package/dist/collection/components/date-picker/helper/labels.js +61 -0
  208. package/dist/collection/components/date-picker/helper/labels.js.map +1 -0
  209. package/dist/collection/components/date-picker/helper/navigation.js +45 -0
  210. package/dist/collection/components/date-picker/helper/navigation.js.map +1 -0
  211. package/dist/collection/components/date-picker/helper/selection.js +167 -0
  212. package/dist/collection/components/date-picker/helper/selection.js.map +1 -0
  213. package/dist/collection/components/date-picker/helper/value.js +49 -0
  214. package/dist/collection/components/date-picker/helper/value.js.map +1 -0
  215. package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
  216. package/dist/collection/components/dialog/bq-dialog.js +4 -4
  217. package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
  218. package/dist/collection/components/divider/bq-divider.js +4 -4
  219. package/dist/collection/components/drawer/bq-drawer.js +4 -4
  220. package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
  221. package/dist/collection/components/dropdown/bq-dropdown.js +1 -1
  222. package/dist/collection/components/dropdown/scss/bq-dropdown.css +1 -1
  223. package/dist/collection/components/empty-state/bq-empty-state.js +5 -5
  224. package/dist/collection/components/empty-state/scss/bq-empty-state.css +1 -1
  225. package/dist/collection/components/icon/bq-icon.js +1 -1
  226. package/dist/collection/components/icon/helper/request.js +1 -1
  227. package/dist/collection/components/icon/helper/request.js.map +1 -1
  228. package/dist/collection/components/icon/svg/.icons-meta.json +13 -0
  229. package/dist/collection/components/input/bq-input.js +15 -8
  230. package/dist/collection/components/input/bq-input.js.map +1 -1
  231. package/dist/collection/components/input/scss/bq-input.css +1 -1
  232. package/dist/collection/components/notification/bq-notification.js +5 -5
  233. package/dist/collection/components/notification/bq-notification.js.map +1 -1
  234. package/dist/collection/components/notification/scss/bq-notification.css +1 -1
  235. package/dist/collection/components/option/bq-option.js +4 -4
  236. package/dist/collection/components/option-group/bq-option-group.js +1 -1
  237. package/dist/collection/components/option-group/scss/bq-option-group.css +1 -1
  238. package/dist/collection/components/option-list/bq-option-list.js +1 -1
  239. package/dist/collection/components/option-list/scss/bq-option-list.css +1 -1
  240. package/dist/collection/components/page-title/bq-page-title.js +4 -4
  241. package/dist/collection/components/page-title/scss/bq-page-title.css +1 -1
  242. package/dist/collection/components/panel/bq-panel.js +2 -2
  243. package/dist/collection/components/panel/scss/bq-panel.css +1 -1
  244. package/dist/collection/components/progress/bq-progress.js +4 -4
  245. package/dist/collection/components/progress/scss/bq-progress.css +1 -1
  246. package/dist/collection/components/radio/bq-radio.js +5 -4
  247. package/dist/collection/components/radio/bq-radio.js.map +1 -1
  248. package/dist/collection/components/radio/scss/bq-radio.css +1 -1
  249. package/dist/collection/components/radio-group/bq-radio-group.js +6 -10
  250. package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
  251. package/dist/collection/components/select/bq-select.js +59 -10
  252. package/dist/collection/components/select/bq-select.js.map +1 -1
  253. package/dist/collection/components/select/scss/bq-select.css +1 -1
  254. package/dist/collection/components/side-menu/bq-side-menu.js +2 -2
  255. package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
  256. package/dist/collection/components/slider/bq-slider.js +2 -2
  257. package/dist/collection/components/spinner/bq-spinner.js +4 -4
  258. package/dist/collection/components/spinner/scss/bq-spinner.css +1 -1
  259. package/dist/collection/components/status/bq-status.js +1 -1
  260. package/dist/collection/components/status/scss/bq-status.css +1 -1
  261. package/dist/collection/components/step-item/bq-step-item.js +4 -4
  262. package/dist/collection/components/step-item/scss/bq-step-item.css +1 -1
  263. package/dist/collection/components/steps/bq-steps.js +2 -2
  264. package/dist/collection/components/switch/bq-switch.js +9 -18
  265. package/dist/collection/components/switch/bq-switch.js.map +1 -1
  266. package/dist/collection/components/switch/scss/bq-switch.css +1 -1
  267. package/dist/collection/components/tab/bq-tab.js +3 -3
  268. package/dist/collection/components/tab/scss/bq-tab.css +1 -1
  269. package/dist/collection/components/tab-group/bq-tab-group.js +3 -3
  270. package/dist/collection/components/tag/bq-tag.js +4 -4
  271. package/dist/collection/components/tag/scss/bq-tag.css +1 -1
  272. package/dist/collection/components/textarea/bq-textarea.js +15 -13
  273. package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
  274. package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
  275. package/dist/collection/components/toast/bq-toast.js +2 -4
  276. package/dist/collection/components/toast/bq-toast.js.map +1 -1
  277. package/dist/collection/components/toast/scss/bq-toast.css +1 -1
  278. package/dist/collection/components/tooltip/bq-tooltip.js +4 -4
  279. package/dist/collection/components/tooltip/scss/bq-tooltip.css +1 -1
  280. package/dist/collection/shared/test-utils/computedStyle.js +24 -24
  281. package/dist/collection/shared/test-utils/computedStyle.js.map +1 -1
  282. package/dist/collection/shared/test-utils/sleep.js +5 -1
  283. package/dist/collection/shared/test-utils/sleep.js.map +1 -1
  284. package/dist/collection/shared/utils/cssVariables.js +1 -1
  285. package/dist/collection/shared/utils/cssVariables.js.map +1 -1
  286. package/dist/collection/shared/utils/event.js.map +1 -1
  287. package/dist/collection/shared/utils/props.js +4 -3
  288. package/dist/collection/shared/utils/props.js.map +1 -1
  289. package/dist/collection/shared/utils/slot.js.map +1 -1
  290. package/dist/collection/shared/utils/transition.js.map +1 -1
  291. package/dist/components/bq-accordion-group.js +1 -1
  292. package/dist/components/bq-accordion.js +1 -1
  293. package/dist/components/bq-alert.js +1 -1
  294. package/dist/components/bq-avatar.js +1 -1
  295. package/dist/components/bq-badge.js +1 -1
  296. package/dist/components/bq-breadcrumb-item.js +1 -1
  297. package/dist/components/bq-breadcrumb-item.js.map +1 -1
  298. package/dist/components/bq-breadcrumb.js +1 -1
  299. package/dist/components/bq-button.js +1 -1
  300. package/dist/components/bq-card.js +1 -1
  301. package/dist/components/bq-checkbox.js +1 -1
  302. package/dist/components/bq-checkbox.js.map +1 -1
  303. package/dist/components/bq-date-picker.js +1 -1
  304. package/dist/components/bq-date-picker.js.map +1 -1
  305. package/dist/components/bq-dialog.js +1 -1
  306. package/dist/components/bq-dialog.js.map +1 -1
  307. package/dist/components/bq-divider.js +1 -1
  308. package/dist/components/bq-drawer.js +1 -1
  309. package/dist/components/bq-drawer.js.map +1 -1
  310. package/dist/components/bq-dropdown.js +1 -1
  311. package/dist/components/bq-empty-state.js +1 -1
  312. package/dist/components/bq-icon.js +1 -1
  313. package/dist/components/bq-input.js +1 -1
  314. package/dist/components/bq-input.js.map +1 -1
  315. package/dist/components/bq-notification.js +1 -1
  316. package/dist/components/bq-notification.js.map +1 -1
  317. package/dist/components/bq-option-group.js +1 -1
  318. package/dist/components/bq-option-group.js.map +1 -1
  319. package/dist/components/bq-option-list.js +1 -1
  320. package/dist/components/bq-option.js +1 -1
  321. package/dist/components/bq-page-title.js +1 -1
  322. package/dist/components/bq-page-title.js.map +1 -1
  323. package/dist/components/bq-panel.js +1 -1
  324. package/dist/components/bq-progress.js +1 -1
  325. package/dist/components/bq-radio-group.js +1 -1
  326. package/dist/components/bq-radio-group.js.map +1 -1
  327. package/dist/components/bq-radio.js +1 -1
  328. package/dist/components/bq-radio.js.map +1 -1
  329. package/dist/components/bq-select.js +1 -1
  330. package/dist/components/bq-select.js.map +1 -1
  331. package/dist/components/bq-side-menu-item.js +1 -1
  332. package/dist/components/bq-side-menu.js +1 -1
  333. package/dist/components/bq-slider.js +1 -1
  334. package/dist/components/bq-spinner.js +1 -1
  335. package/dist/components/bq-status.js +1 -1
  336. package/dist/components/bq-status.js.map +1 -1
  337. package/dist/components/bq-step-item.js +1 -1
  338. package/dist/components/bq-step-item.js.map +1 -1
  339. package/dist/components/bq-steps.js +1 -1
  340. package/dist/components/bq-switch.js +1 -1
  341. package/dist/components/bq-switch.js.map +1 -1
  342. package/dist/components/bq-tab-group.js +1 -1
  343. package/dist/components/bq-tab.js +1 -1
  344. package/dist/components/bq-tag.js +1 -1
  345. package/dist/components/bq-textarea.js +1 -1
  346. package/dist/components/bq-textarea.js.map +1 -1
  347. package/dist/components/bq-toast.js +1 -1
  348. package/dist/components/bq-toast.js.map +1 -1
  349. package/dist/components/bq-tooltip.js +1 -1
  350. package/dist/components/index.js +1 -1
  351. package/dist/components/{p-YjPwN7vu.js → p-2eUC8A3N.js} +2 -2
  352. package/dist/components/p-2eUC8A3N.js.map +1 -0
  353. package/dist/components/{p-D3RCJ1ti.js → p-BBCVL6R0.js} +2 -2
  354. package/dist/components/{p-BY4GkNoQ.js → p-BMHXMsVR.js} +2 -2
  355. package/dist/components/{p-4ksDMBf6.js → p-BS8hIETL.js} +2 -2
  356. package/dist/components/{p-DTsYGX5p.js → p-CWawcXxA.js} +2 -2
  357. package/dist/components/{p-DTsYGX5p.js.map → p-CWawcXxA.js.map} +1 -1
  358. package/dist/components/{p-fdkSHq2G.js → p-D6ngGq0Y.js} +2 -2
  359. package/dist/components/p-D6ngGq0Y.js.map +1 -0
  360. package/dist/components/{p-B99eLANt.js → p-DMKBBBUE.js} +2 -2
  361. package/dist/components/p-DbxZ8FhA.js +6 -0
  362. package/dist/components/p-DbxZ8FhA.js.map +1 -0
  363. package/dist/components/{p-CvvcRGDG.js → p-Dd3v3b2E.js} +2 -2
  364. package/dist/components/p-DdvbF5yL.js.map +1 -1
  365. package/dist/components/p-Dx-CEPSQ.js.map +1 -1
  366. package/dist/components/{p-Dj-mQvqv.js → p-iyX-PhkX.js} +2 -2
  367. package/dist/components/p-kY6d9Evy.js +6 -0
  368. package/dist/components/p-kY6d9Evy.js.map +1 -0
  369. package/dist/components/p-uqkxeAeG.js.map +1 -1
  370. package/dist/{beeq/p-edc81a31.entry.js → components/p-v3c5-Hhf.js} +2 -2
  371. package/dist/components/p-v3c5-Hhf.js.map +1 -0
  372. package/dist/custom-elements.json +25954 -1583
  373. package/dist/esm/beeq.js +4 -4
  374. package/dist/esm/beeq.js.map +1 -1
  375. package/dist/esm/bq-accordion-group.entry.js +2 -2
  376. package/dist/esm/bq-accordion-group.entry.js.map +1 -1
  377. package/dist/esm/bq-accordion.entry.js +3 -3
  378. package/dist/esm/bq-accordion.entry.js.map +1 -1
  379. package/dist/esm/bq-alert.entry.js +3 -3
  380. package/dist/esm/bq-alert.entry.js.map +1 -1
  381. package/dist/esm/bq-avatar.entry.js +3 -3
  382. package/dist/esm/bq-avatar.entry.js.map +1 -1
  383. package/dist/esm/bq-badge.entry.js +3 -3
  384. package/dist/esm/bq-breadcrumb-item.entry.js +3 -3
  385. package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
  386. package/dist/esm/bq-breadcrumb.entry.js +2 -2
  387. package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
  388. package/dist/esm/bq-button_2.entry.js +6 -6
  389. package/dist/esm/bq-button_2.entry.js.map +1 -1
  390. package/dist/esm/bq-card.entry.js +3 -3
  391. package/dist/esm/bq-card.entry.js.map +1 -1
  392. package/dist/esm/bq-checkbox.entry.js +35 -22
  393. package/dist/esm/bq-checkbox.entry.js.map +1 -1
  394. package/dist/esm/bq-date-picker.entry.js +1744 -367
  395. package/dist/esm/bq-date-picker.entry.js.map +1 -1
  396. package/dist/esm/bq-dialog.entry.js +7 -7
  397. package/dist/esm/bq-dialog.entry.js.map +1 -1
  398. package/dist/esm/bq-divider.entry.js +7 -7
  399. package/dist/esm/bq-drawer.entry.js +7 -7
  400. package/dist/esm/bq-drawer.entry.js.map +1 -1
  401. package/dist/esm/bq-dropdown_2.entry.js +6 -6
  402. package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
  403. package/dist/esm/bq-empty-state.entry.js +8 -8
  404. package/dist/esm/bq-empty-state.entry.js.map +1 -1
  405. package/dist/esm/bq-input.entry.js +17 -10
  406. package/dist/esm/bq-input.entry.js.map +1 -1
  407. package/dist/esm/bq-notification.entry.js +8 -8
  408. package/dist/esm/bq-notification.entry.js.map +1 -1
  409. package/dist/esm/bq-option-group.entry.js +3 -3
  410. package/dist/esm/bq-option-group.entry.js.map +1 -1
  411. package/dist/esm/bq-option-list_2.entry.js +10 -10
  412. package/dist/esm/bq-option-list_2.entry.js.map +1 -1
  413. package/dist/esm/bq-option.entry.js +5 -5
  414. package/dist/esm/bq-page-title.entry.js +6 -6
  415. package/dist/esm/bq-page-title.entry.js.map +1 -1
  416. package/dist/esm/bq-progress.entry.js +7 -7
  417. package/dist/esm/bq-progress.entry.js.map +1 -1
  418. package/dist/esm/bq-radio-group.entry.js +8 -12
  419. package/dist/esm/bq-radio-group.entry.js.map +1 -1
  420. package/dist/esm/bq-radio.entry.js +5 -5
  421. package/dist/esm/bq-radio.entry.js.map +1 -1
  422. package/dist/esm/bq-select.entry.js +39 -10
  423. package/dist/esm/bq-select.entry.js.map +1 -1
  424. package/dist/esm/bq-side-menu-item.entry.js +2 -2
  425. package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
  426. package/dist/esm/bq-side-menu.entry.js +3 -3
  427. package/dist/esm/bq-slider.entry.js +4 -4
  428. package/dist/esm/bq-slider.entry.js.map +1 -1
  429. package/dist/esm/bq-spinner.entry.js +8 -8
  430. package/dist/esm/bq-spinner.entry.js.map +1 -1
  431. package/dist/esm/bq-status.entry.js +4 -4
  432. package/dist/esm/bq-status.entry.js.map +1 -1
  433. package/dist/esm/bq-step-item.entry.js +7 -7
  434. package/dist/esm/bq-step-item.entry.js.map +1 -1
  435. package/dist/esm/bq-steps.entry.js +4 -4
  436. package/dist/esm/bq-switch.entry.js +9 -20
  437. package/dist/esm/bq-switch.entry.js.map +1 -1
  438. package/dist/esm/bq-tab-group.entry.js +5 -5
  439. package/dist/esm/bq-tab.entry.js +6 -6
  440. package/dist/esm/bq-tab.entry.js.map +1 -1
  441. package/dist/esm/bq-textarea.entry.js +17 -15
  442. package/dist/esm/bq-textarea.entry.js.map +1 -1
  443. package/dist/esm/bq-toast.entry.js +5 -7
  444. package/dist/esm/bq-toast.entry.js.map +1 -1
  445. package/dist/esm/bq-tooltip.entry.js +6 -6
  446. package/dist/esm/bq-tooltip.entry.js.map +1 -1
  447. package/dist/esm/{cssVariables-CyiWA5Ok.js → cssVariables-DhGXeOL_.js} +3 -3
  448. package/dist/esm/cssVariables-DhGXeOL_.js.map +1 -0
  449. package/dist/esm/event-Dx-CEPSQ.js.map +1 -1
  450. package/dist/esm/{index-CO2T68hs.js → index-BSSRzVAz.js} +47 -12
  451. package/dist/esm/index-BSSRzVAz.js.map +1 -0
  452. package/dist/esm/index.js +2 -2
  453. package/dist/esm/loader.js +3 -3
  454. package/dist/esm/{props-zh4P02Kn.js → props-DbxZ8FhA.js} +6 -5
  455. package/dist/esm/props-DbxZ8FhA.js.map +1 -0
  456. package/dist/esm/slot-uqkxeAeG.js.map +1 -1
  457. package/dist/esm/transition-DdvbF5yL.js.map +1 -1
  458. package/dist/hydrate/index.js +2142 -675
  459. package/dist/hydrate/index.mjs +2142 -675
  460. package/dist/stencil.config.js +7 -0
  461. package/dist/stencil.config.js.map +1 -1
  462. package/dist/types/components/checkbox/bq-checkbox.d.ts +4 -3
  463. package/dist/types/components/date-picker/bq-date-picker.d.ts +330 -238
  464. package/dist/types/components/date-picker/bq-date-picker.types.d.ts +30 -39
  465. package/dist/types/components/date-picker/components/CalendarDayView.d.ts +42 -0
  466. package/dist/types/components/date-picker/components/CalendarHeader.d.ts +34 -0
  467. package/dist/types/components/date-picker/components/CalendarMonthView.d.ts +34 -0
  468. package/dist/types/components/date-picker/components/CalendarYearView.d.ts +32 -0
  469. package/dist/types/components/date-picker/helper/bounds.d.ts +49 -0
  470. package/dist/types/components/date-picker/helper/calendar.d.ts +78 -0
  471. package/dist/types/components/date-picker/helper/constants.d.ts +62 -16
  472. package/dist/types/components/date-picker/helper/input.d.ts +23 -0
  473. package/dist/types/components/date-picker/helper/intl.d.ts +38 -0
  474. package/dist/types/components/date-picker/helper/labels.d.ts +29 -0
  475. package/dist/types/components/date-picker/helper/navigation.d.ts +23 -0
  476. package/dist/types/components/date-picker/helper/selection.d.ts +44 -0
  477. package/dist/types/components/date-picker/helper/value.d.ts +31 -0
  478. package/dist/types/components/input/bq-input.d.ts +1 -0
  479. package/dist/types/components/radio/bq-radio.d.ts +2 -1
  480. package/dist/types/components/select/bq-select.d.ts +5 -0
  481. package/dist/types/components/switch/bq-switch.d.ts +2 -3
  482. package/dist/types/components.d.ts +450 -350
  483. package/dist/types/home/runner/work/BEEQ/BEEQ/.stencil/packages/beeq/vitest.config.d.ts +2 -0
  484. package/dist/types/shared/test-utils/computedStyle.d.ts +7 -6
  485. package/dist/types/shared/test-utils/setProperties.d.ts +1 -1
  486. package/dist/types/shared/test-utils/sleep.d.ts +5 -1
  487. package/dist/types/shared/utils/event.d.ts +1 -1
  488. package/dist/types/shared/utils/slot.d.ts +1 -1
  489. package/dist/types/stencil-public-runtime.d.ts +1 -0
  490. package/dist/vitest.config.js +81 -0
  491. package/dist/vitest.config.js.map +1 -0
  492. package/package.json +1 -1
  493. package/dist/beeq/p-0323869d.entry.js.map +0 -1
  494. package/dist/beeq/p-1e675bdc.entry.js +0 -6
  495. package/dist/beeq/p-2283258e.entry.js +0 -6
  496. package/dist/beeq/p-654c7701.entry.js +0 -6
  497. package/dist/beeq/p-654c7701.entry.js.map +0 -1
  498. package/dist/beeq/p-7a6a89f1.entry.js +0 -6
  499. package/dist/beeq/p-7a6a89f1.entry.js.map +0 -1
  500. package/dist/beeq/p-7adb6e2e.entry.js.map +0 -1
  501. package/dist/beeq/p-7d356cce.entry.js.map +0 -1
  502. package/dist/beeq/p-CO2T68hs.js.map +0 -1
  503. package/dist/beeq/p-_RvVpeh2.js +0 -6
  504. package/dist/beeq/p-_RvVpeh2.js.map +0 -1
  505. package/dist/beeq/p-a83ce5aa.entry.js +0 -6
  506. package/dist/beeq/p-a83ce5aa.entry.js.map +0 -1
  507. package/dist/beeq/p-bb46524f.entry.js +0 -6
  508. package/dist/beeq/p-c25c20bf.entry.js.map +0 -1
  509. package/dist/beeq/p-e9535627.entry.js.map +0 -1
  510. package/dist/beeq/p-zh4P02Kn.js +0 -6
  511. package/dist/beeq/p-zh4P02Kn.js.map +0 -1
  512. package/dist/cjs/cssVariables-exM7Oz37.js.map +0 -1
  513. package/dist/cjs/index-BSrsKFVG.js.map +0 -1
  514. package/dist/cjs/props-DzFXZXSF.js.map +0 -1
  515. package/dist/collection/components/date-picker/libs/callyLibrary.js +0 -92
  516. package/dist/collection/components/date-picker/libs/callyLibrary.js.map +0 -1
  517. package/dist/components/p-DnqmdkvK.js +0 -6
  518. package/dist/components/p-DnqmdkvK.js.map +0 -1
  519. package/dist/components/p-YjPwN7vu.js.map +0 -1
  520. package/dist/components/p-_RvVpeh2.js +0 -6
  521. package/dist/components/p-_RvVpeh2.js.map +0 -1
  522. package/dist/components/p-fdkSHq2G.js.map +0 -1
  523. package/dist/components/p-zh4P02Kn.js +0 -6
  524. package/dist/components/p-zh4P02Kn.js.map +0 -1
  525. package/dist/esm/cssVariables-CyiWA5Ok.js.map +0 -1
  526. package/dist/esm/index-CO2T68hs.js.map +0 -1
  527. package/dist/esm/props-zh4P02Kn.js.map +0 -1
  528. package/dist/jest.config.js +0 -23
  529. package/dist/jest.config.js.map +0 -1
  530. package/dist/types/Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System/.stencil/packages/beeq/jest.config.d.ts +0 -19
  531. package/dist/types/components/date-picker/libs/callyLibrary.d.ts +0 -15
  532. /package/dist/beeq/{p-882966dd.entry.js.map → p-38006c8e.entry.js.map} +0 -0
  533. /package/dist/beeq/{p-8dfd0329.entry.js.map → p-6b0f896f.entry.js.map} +0 -0
  534. /package/dist/beeq/{p-ea473f56.entry.js.map → p-72ff2fe2.entry.js.map} +0 -0
  535. /package/dist/beeq/{p-ad419446.entry.js.map → p-8bd7f4c2.entry.js.map} +0 -0
  536. /package/dist/beeq/{p-1fb43de2.entry.js.map → p-e9a1b183.entry.js.map} +0 -0
  537. /package/dist/beeq/{p-3c77308c.entry.js.map → p-f891fb4b.entry.js.map} +0 -0
  538. /package/dist/components/{p-D3RCJ1ti.js.map → p-BBCVL6R0.js.map} +0 -0
  539. /package/dist/components/{p-BY4GkNoQ.js.map → p-BMHXMsVR.js.map} +0 -0
  540. /package/dist/components/{p-4ksDMBf6.js.map → p-BS8hIETL.js.map} +0 -0
  541. /package/dist/components/{p-B99eLANt.js.map → p-DMKBBBUE.js.map} +0 -0
  542. /package/dist/components/{p-CvvcRGDG.js.map → p-Dd3v3b2E.js.map} +0 -0
  543. /package/dist/components/{p-Dj-mQvqv.js.map → p-iyX-PhkX.js.map} +0 -0
  544. /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/packages/beeq/stencil.config.d.ts +0 -0
  545. /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/tailwind.config.d.ts +0 -0
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { parseDateInput, toISODateString } from "../../../shared/utils/date/dateParsing";
6
+ import { padBound } from "./bounds";
7
+ import { serializeValue } from "./selection";
8
+ /**
9
+ * Precision-aware, bounds-aware parser for the trigger input field.
10
+ * Returns the parsed date as a wire-format string at the configured
11
+ * precision, clamped against `min`/`max`, or `{ invalid: true }` on failure.
12
+ */
13
+ export const parseTypedInput = (text, locale, precision, min, max, isDateDisallowed) => {
14
+ const trimmed = text.trim();
15
+ if (!trimmed)
16
+ return { value: undefined };
17
+ const parsed = parseDateInput(trimmed, locale);
18
+ if (!parsed || isDateDisallowed?.(parsed))
19
+ return { invalid: true };
20
+ const iso = clampISO(toISODateString(parsed), min, max);
21
+ return { value: serializeValue([iso], 'single', precision) };
22
+ };
23
+ /**
24
+ * Lexically clamp a full `YYYY-MM-DD` ISO date to precision-padded bounds.
25
+ * Coarser bounds (`YYYY`, `YYYY-MM`) are padded to the widest matching day
26
+ * before comparing.
27
+ */
28
+ export const clampISO = (iso, min, max) => {
29
+ const paddedMin = padBound(min, 'min');
30
+ const paddedMax = padBound(max, 'max');
31
+ if (paddedMin && iso < paddedMin)
32
+ return paddedMin;
33
+ if (paddedMax && iso > paddedMax)
34
+ return paddedMax;
35
+ return iso;
36
+ };
37
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAEzF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAa7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAY,EACZ,MAA4B,EAC5B,SAAyB,EACzB,GAAY,EACZ,GAAY,EACZ,gBAA0C,EAC5B,EAAE;IAChB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE1C,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,IAAI,gBAAgB,EAAE,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAEpE,MAAM,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;AAC/D,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,GAAY,EAAE,GAAY,EAAU,EAAE;IAC1E,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACvC,IAAI,SAAS,IAAI,GAAG,GAAG,SAAS;QAAE,OAAO,SAAS,CAAC;IACnD,IAAI,SAAS,IAAI,GAAG,GAAG,SAAS;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","sourcesContent":["import { parseDateInput, toISODateString } from '../../../shared/utils/date/dateParsing';\nimport type { TDatePrecision } from '../bq-date-picker.types';\nimport { padBound } from './bounds';\nimport { serializeValue } from './selection';\n\n/**\n * Result of parsing user-typed input.\n * - `value` is set when parsing succeeded — always at the configured precision.\n * - `invalid: true` when the string could not be parsed or `isDateDisallowed`\n * rejected the result.\n */\nexport type TParsedInput = {\n value?: string;\n invalid?: boolean;\n};\n\n/**\n * Precision-aware, bounds-aware parser for the trigger input field.\n * Returns the parsed date as a wire-format string at the configured\n * precision, clamped against `min`/`max`, or `{ invalid: true }` on failure.\n */\nexport const parseTypedInput = (\n text: string,\n locale: Intl.LocalesArgument,\n precision: TDatePrecision,\n min?: string,\n max?: string,\n isDateDisallowed?: (date: Date) => boolean,\n): TParsedInput => {\n const trimmed = text.trim();\n if (!trimmed) return { value: undefined };\n\n const parsed = parseDateInput(trimmed, locale);\n if (!parsed || isDateDisallowed?.(parsed)) return { invalid: true };\n\n const iso = clampISO(toISODateString(parsed), min, max);\n return { value: serializeValue([iso], 'single', precision) };\n};\n\n/**\n * Lexically clamp a full `YYYY-MM-DD` ISO date to precision-padded bounds.\n * Coarser bounds (`YYYY`, `YYYY-MM`) are padded to the widest matching day\n * before comparing.\n */\nexport const clampISO = (iso: string, min?: string, max?: string): string => {\n const paddedMin = padBound(min, 'min');\n const paddedMax = padBound(max, 'max');\n if (paddedMin && iso < paddedMin) return paddedMin;\n if (paddedMax && iso > paddedMax) return paddedMax;\n return iso;\n};\n"]}
@@ -0,0 +1,78 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ /**
6
+ * Cached `Intl.DateTimeFormat` factories.
7
+ *
8
+ * The Intl API is powerful but relatively expensive to instantiate. Since the
9
+ * calendar re-renders on every user interaction we keep a small LRU-ish cache
10
+ * keyed by locale + option shape.
11
+ */
12
+ const cache = new Map();
13
+ /** Prevents unbounded growth in long-running apps. */
14
+ const CACHE_MAX_SIZE = 64;
15
+ const cacheKey = (locale, options) => {
16
+ const localeKey = typeof locale === 'string' ? locale : JSON.stringify(locale ?? '');
17
+ return `${localeKey}|${JSON.stringify(options)}`;
18
+ };
19
+ const getFormatter = (locale, options) => {
20
+ const key = cacheKey(locale, options);
21
+ let formatter = cache.get(key);
22
+ if (!formatter) {
23
+ formatter = new Intl.DateTimeFormat(locale, options);
24
+ cache.set(key, formatter);
25
+ if (cache.size > CACHE_MAX_SIZE) {
26
+ const firstKey = cache.keys().next().value;
27
+ if (firstKey !== undefined)
28
+ cache.delete(firstKey);
29
+ }
30
+ }
31
+ return formatter;
32
+ };
33
+ /**
34
+ * Format a full date, e.g. "1 January 2026".
35
+ */
36
+ export const formatDate = (date, locale, options = { day: 'numeric', month: 'long', year: 'numeric' }) => getFormatter(locale, options).format(date);
37
+ /**
38
+ * Format a month, e.g. "January 2026" or "Jan".
39
+ */
40
+ export const formatMonth = (date, locale, monthStyle = 'long', includeYear = true) => getFormatter(locale, {
41
+ month: monthStyle,
42
+ ...(includeYear ? { year: 'numeric' } : {}),
43
+ }).format(date);
44
+ /**
45
+ * Format a year, e.g. "2026".
46
+ */
47
+ export const formatYear = (date, locale) => getFormatter(locale, { year: 'numeric' }).format(date);
48
+ /**
49
+ * Returns the weekday names for the given locale ordered from `firstDayOfWeek`.
50
+ *
51
+ * @param locale The locale used for formatting.
52
+ * @param firstDayOfWeek The first day of the week (0 = Sunday, 1 = Monday, ...).
53
+ * @param style Weekday style (long, short, narrow).
54
+ * @returns An array of `{short, long}` names in display order.
55
+ */
56
+ export const getWeekdayNames = (locale, firstDayOfWeek, style = 'short') => {
57
+ const shortFormatter = getFormatter(locale, { weekday: style });
58
+ const longFormatter = getFormatter(locale, { weekday: 'long' });
59
+ // Any known Sunday works as the anchor date. 2024-01-07 is a Sunday.
60
+ const anchor = new Date(2024, 0, 7);
61
+ return Array.from({ length: 7 }, (_, i) => {
62
+ const dayIndex = (firstDayOfWeek + i) % 7;
63
+ const day = new Date(anchor);
64
+ day.setDate(anchor.getDate() + dayIndex);
65
+ return { short: shortFormatter.format(day), long: longFormatter.format(day) };
66
+ });
67
+ };
68
+ /**
69
+ * Returns the localized month names.
70
+ *
71
+ * @param locale The locale used for formatting.
72
+ * @param style Month style (long, short, narrow).
73
+ */
74
+ export const getMonthNames = (locale, style = 'short') => {
75
+ const formatter = getFormatter(locale, { month: style });
76
+ return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 1)));
77
+ };
78
+ //# sourceMappingURL=intl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/intl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAC;AAErD,sDAAsD;AACtD,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,QAAQ,GAAG,CAAC,MAA4B,EAAE,OAAmC,EAAU,EAAE;IAC7F,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAA4B,EAAE,OAAmC,EAAuB,EAAE;IAC9G,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,IAAI,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACrD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC1B,IAAI,KAAK,CAAC,IAAI,GAAG,cAAc,EAAE,CAAC;YAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YAC3C,IAAI,QAAQ,KAAK,SAAS;gBAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;A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AAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,QAAQ,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;QACzC,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAA4B,EAAE,QAAqC,OAAO,EAAY,EAAE;IACpH,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC","sourcesContent":["/**\n * Cached `Intl.DateTimeFormat` factories.\n *\n * The Intl API is powerful but relatively expensive to instantiate. Since the\n * calendar re-renders on every user interaction we keep a small LRU-ish cache\n * keyed by locale + option shape.\n */\n\nconst cache = new Map<string, Intl.DateTimeFormat>();\n\n/** Prevents unbounded growth in long-running apps. */\nconst CACHE_MAX_SIZE = 64;\n\nconst cacheKey = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): string => {\n const localeKey = typeof locale === 'string' ? locale : JSON.stringify(locale ?? '');\n return `${localeKey}|${JSON.stringify(options)}`;\n};\n\nconst getFormatter = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat => {\n const key = cacheKey(locale, options);\n let formatter = cache.get(key);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options);\n cache.set(key, formatter);\n if (cache.size > CACHE_MAX_SIZE) {\n const firstKey = cache.keys().next().value;\n if (firstKey !== undefined) cache.delete(firstKey);\n }\n }\n return formatter;\n};\n\n/**\n * Format a full date, e.g. \"1 January 2026\".\n */\nexport const formatDate = (\n date: Date,\n locale: Intl.LocalesArgument,\n options: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' },\n): string => getFormatter(locale, options).format(date);\n\n/**\n * Format a month, e.g. \"January 2026\" or \"Jan\".\n */\nexport const formatMonth = (\n date: Date,\n locale: Intl.LocalesArgument,\n monthStyle: 'long' | 'short' | 'narrow' = 'long',\n includeYear = true,\n): string =>\n getFormatter(locale, {\n month: monthStyle,\n ...(includeYear ? { year: 'numeric' } : {}),\n }).format(date);\n\n/**\n * Format a year, e.g. \"2026\".\n */\nexport const formatYear = (date: Date, locale: Intl.LocalesArgument): string =>\n getFormatter(locale, { year: 'numeric' }).format(date);\n\n/**\n * Returns the weekday names for the given locale ordered from `firstDayOfWeek`.\n *\n * @param locale The locale used for formatting.\n * @param firstDayOfWeek The first day of the week (0 = Sunday, 1 = Monday, ...).\n * @param style Weekday style (long, short, narrow).\n * @returns An array of `{short, long}` names in display order.\n */\nexport const getWeekdayNames = (\n locale: Intl.LocalesArgument,\n firstDayOfWeek: number,\n style: 'long' | 'short' | 'narrow' = 'short',\n): Array<{ short: string; long: string }> => {\n const shortFormatter = getFormatter(locale, { weekday: style });\n const longFormatter = getFormatter(locale, { weekday: 'long' });\n // Any known Sunday works as the anchor date. 2024-01-07 is a Sunday.\n const anchor = new Date(2024, 0, 7);\n\n return Array.from({ length: 7 }, (_, i) => {\n const dayIndex = (firstDayOfWeek + i) % 7;\n const day = new Date(anchor);\n day.setDate(anchor.getDate() + dayIndex);\n return { short: shortFormatter.format(day), long: longFormatter.format(day) };\n });\n};\n\n/**\n * Returns the localized month names.\n *\n * @param locale The locale used for formatting.\n * @param style Month style (long, short, narrow).\n */\nexport const getMonthNames = (locale: Intl.LocalesArgument, style: 'long' | 'short' | 'narrow' = 'short'): string[] => {\n const formatter = getFormatter(locale, { month: style });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 1)));\n};\n"]}
@@ -0,0 +1,61 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { addMonths, startOfMonth } from "./calendar";
6
+ import { DECADE_GRID_SIZE, DEFAULT_ARIA_LABELS } from "./constants";
7
+ import { formatMonth, formatYear } from "./intl";
8
+ /**
9
+ * Builds the label shown in the calendar header title button.
10
+ *
11
+ * - `days`: localized "Month Year" for a single panel, or "StartYear – EndYear"
12
+ * when several months are visible at once.
13
+ * - `months`: the localized year currently in focus.
14
+ * - `years`: the closed range spanning the visible decade.
15
+ */
16
+ export const getHeaderLabel = ({ view, viewDate, focusedYear, decadeStart, monthCount, locale, }) => {
17
+ if (view === 'days') {
18
+ if (monthCount > 1) {
19
+ const first = startOfMonth(viewDate);
20
+ const last = startOfMonth(addMonths(viewDate, monthCount - 1));
21
+ const startYear = formatYear(first, locale);
22
+ const endYear = formatYear(last, locale);
23
+ return startYear === endYear ? startYear : `${startYear} – ${endYear}`;
24
+ }
25
+ return formatMonth(viewDate, locale, 'long', true);
26
+ }
27
+ if (view === 'months') {
28
+ return formatYear(new Date(focusedYear, 0, 1), locale);
29
+ }
30
+ const end = decadeStart + DECADE_GRID_SIZE - 1;
31
+ return `${decadeStart} – ${end}`;
32
+ };
33
+ /**
34
+ * Aria label announcing what clicking the title switches to.
35
+ * Views cycle days → months → years → back to the base view (days for
36
+ * `precision="day"`, months for `precision="month"`).
37
+ */
38
+ export const getHeaderTitleLabel = (view, precision = 'day') => {
39
+ if (view === 'days')
40
+ return DEFAULT_ARIA_LABELS.chooseMonth;
41
+ if (view === 'months')
42
+ return DEFAULT_ARIA_LABELS.chooseYear;
43
+ return precision === 'month' ? DEFAULT_ARIA_LABELS.chooseMonth : DEFAULT_ARIA_LABELS.chooseDate;
44
+ };
45
+ /** Aria label for the "previous" navigation button, per view. */
46
+ export const getPreviousLabel = (view) => {
47
+ if (view === 'days')
48
+ return DEFAULT_ARIA_LABELS.previousMonth;
49
+ if (view === 'months')
50
+ return DEFAULT_ARIA_LABELS.previousYear;
51
+ return DEFAULT_ARIA_LABELS.previousDecade;
52
+ };
53
+ /** Aria label for the "next" navigation button, per view. */
54
+ export const getNextLabel = (view) => {
55
+ if (view === 'days')
56
+ return DEFAULT_ARIA_LABELS.nextMonth;
57
+ if (view === 'months')
58
+ return DEFAULT_ARIA_LABELS.nextYear;
59
+ return DEFAULT_ARIA_LABELS.nextDecade;
60
+ };
61
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/labels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAWjD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACV,MAAM,GACU,EAAU,EAAE;IAC5B,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/D,M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CAAC,cAAc,CAAC;AAC5C,CAAC,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAmB,EAAU,EAAE;IAC1D,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,mBAAmB,CAAC,SAAS,CAAC;IAC1D,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,mBAAmB,CAAC,QAAQ,CAAC;IAC3D,OAAO,mBAAmB,CAAC,UAAU,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import type { TCalendarView, TDatePrecision } from '../bq-date-picker.types';\nimport { addMonths, startOfMonth } from './calendar';\nimport { DECADE_GRID_SIZE, DEFAULT_ARIA_LABELS } from './constants';\nimport { formatMonth, formatYear } from './intl';\n\ninterface HeaderLabelArgs {\n view: TCalendarView;\n viewDate: Date;\n focusedYear: number;\n decadeStart: number;\n monthCount: number;\n locale: Intl.LocalesArgument;\n}\n\n/**\n * Builds the label shown in the calendar header title button.\n *\n * - `days`: localized \"Month Year\" for a single panel, or \"StartYear – EndYear\"\n * when several months are visible at once.\n * - `months`: the localized year currently in focus.\n * - `years`: the closed range spanning the visible decade.\n */\nexport const getHeaderLabel = ({\n view,\n viewDate,\n focusedYear,\n decadeStart,\n monthCount,\n locale,\n}: HeaderLabelArgs): string => {\n if (view === 'days') {\n if (monthCount > 1) {\n const first = startOfMonth(viewDate);\n const last = startOfMonth(addMonths(viewDate, monthCount - 1));\n const startYear = formatYear(first, locale);\n const endYear = formatYear(last, locale);\n return startYear === endYear ? startYear : `${startYear} – ${endYear}`;\n }\n return formatMonth(viewDate, locale, 'long', true);\n }\n if (view === 'months') {\n return formatYear(new Date(focusedYear, 0, 1), locale);\n }\n const end = decadeStart + DECADE_GRID_SIZE - 1;\n return `${decadeStart} – ${end}`;\n};\n\n/**\n * Aria label announcing what clicking the title switches to.\n * Views cycle days → months → years → back to the base view (days for\n * `precision=\"day\"`, months for `precision=\"month\"`).\n */\nexport const getHeaderTitleLabel = (view: TCalendarView, precision: TDatePrecision = 'day'): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.chooseMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.chooseYear;\n return precision === 'month' ? DEFAULT_ARIA_LABELS.chooseMonth : DEFAULT_ARIA_LABELS.chooseDate;\n};\n\n/** Aria label for the \"previous\" navigation button, per view. */\nexport const getPreviousLabel = (view: TCalendarView): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.previousMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.previousYear;\n return DEFAULT_ARIA_LABELS.previousDecade;\n};\n\n/** Aria label for the \"next\" navigation button, per view. */\nexport const getNextLabel = (view: TCalendarView): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.nextMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.nextYear;\n return DEFAULT_ARIA_LABELS.nextDecade;\n};\n"]}
@@ -0,0 +1,45 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { DECADE_GRID_SIZE } from "./constants";
6
+ /**
7
+ * Advances a focused month cursor by `delta` months, carrying over to the
8
+ * previous or next year as needed. Pure — accepts and returns primitives so
9
+ * it can be unit-tested and reused by keyboard handlers.
10
+ */
11
+ export const advanceFocusedMonth = (focusedMonth, focusedYear, delta) => {
12
+ let month = focusedMonth + delta;
13
+ let year = focusedYear;
14
+ while (month < 0) {
15
+ month += 12;
16
+ year -= 1;
17
+ }
18
+ while (month > 11) {
19
+ month -= 12;
20
+ year += 1;
21
+ }
22
+ return { month, year };
23
+ };
24
+ /**
25
+ * Advances a focused year cursor by `delta` years, sliding the visible
26
+ * decade grid so the focused year always stays in view.
27
+ */
28
+ export const advanceFocusedYear = (focusedYear, decadeStart, delta) => {
29
+ const year = focusedYear + delta;
30
+ let nextDecadeStart = decadeStart;
31
+ if (year < decadeStart) {
32
+ nextDecadeStart = decadeStart - DECADE_GRID_SIZE;
33
+ }
34
+ else if (year > decadeStart + DECADE_GRID_SIZE - 1) {
35
+ nextDecadeStart = decadeStart + DECADE_GRID_SIZE;
36
+ }
37
+ return { year, decadeStart: nextDecadeStart };
38
+ };
39
+ /**
40
+ * Number of columns used to render the months/years grids. The grids widen
41
+ * from 3 → 4 columns when multiple months are visible, so vertical arrow
42
+ * navigation stride must match.
43
+ */
44
+ export const getGridColumns = (monthCount) => (monthCount > 1 ? 4 : 3);
45
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,YAAoB,EACpB,WAAmB,EACnB,KAAa,EACoB,EAAE;IACnC,IAAI,KAAK,GAAG,YAAY,GAAG,KAAK,CAAC;IACjC,IAAI,IAAI,GAAG,WAAW,CAAC;IACvB,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;QACjB,KAAK,IAAI,EAAE,CAAC;QACZ,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,GAAG,EAAE,EAAE,CAAC;QAClB,KAAK,IAAI,EAAE,CAAC;QACZ,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,WAAmB,EACnB,WAAmB,EACnB,KAAa,EAC0B,EAAE;IACzC,MAAM,IAAI,GAAG,WAAW,GAAG,KAAK,CAAC;IACjC,IAAI,eAAe,GAAG,WAAW,CAAC;IAClC,IAAI,IAAI,GAAG,WAAW,EAAE,CAAC;QACvB,eAAe,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACnD,CAAC;SAAM,IAAI,IAAI,GAAG,WAAW,GAAG,gBAAgB,GAAG,CAAC,EAAE,CAAC;QACrD,eAAe,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACnD,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AAChD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAkB,EAAU,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { DECADE_GRID_SIZE } from './constants';\n\n/**\n * Advances a focused month cursor by `delta` months, carrying over to the\n * previous or next year as needed. Pure — accepts and returns primitives so\n * it can be unit-tested and reused by keyboard handlers.\n */\nexport const advanceFocusedMonth = (\n focusedMonth: number,\n focusedYear: number,\n delta: number,\n): { month: number; year: number } => {\n let month = focusedMonth + delta;\n let year = focusedYear;\n while (month < 0) {\n month += 12;\n year -= 1;\n }\n while (month > 11) {\n month -= 12;\n year += 1;\n }\n return { month, year };\n};\n\n/**\n * Advances a focused year cursor by `delta` years, sliding the visible\n * decade grid so the focused year always stays in view.\n */\nexport const advanceFocusedYear = (\n focusedYear: number,\n decadeStart: number,\n delta: number,\n): { year: number; decadeStart: number } => {\n const year = focusedYear + delta;\n let nextDecadeStart = decadeStart;\n if (year < decadeStart) {\n nextDecadeStart = decadeStart - DECADE_GRID_SIZE;\n } else if (year > decadeStart + DECADE_GRID_SIZE - 1) {\n nextDecadeStart = decadeStart + DECADE_GRID_SIZE;\n }\n return { year, decadeStart: nextDecadeStart };\n};\n\n/**\n * Number of columns used to render the months/years grids. The grids widen\n * from 3 → 4 columns when multiple months are visible, so vertical arrow\n * navigation stride must match.\n */\nexport const getGridColumns = (monthCount: number): number => (monthCount > 1 ? 4 : 3);\n"]}
@@ -0,0 +1,167 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { compareISO, isValidISO, sortRange } from "./calendar";
6
+ /* -------------------------------------------------------------------------- */
7
+ /* Wire format parse/serialize */
8
+ /* -------------------------------------------------------------------------- */
9
+ /**
10
+ * Regex matching the wire-format ISO shape for each precision.
11
+ * The internal selection is always `YYYY-MM-DD`; these only apply at the
12
+ * public value boundary.
13
+ */
14
+ const PRECISION_ISO_REGEX = {
15
+ day: /^\d{4}-\d{2}-\d{2}$/,
16
+ month: /^\d{4}-\d{2}$/,
17
+ year: /^\d{4}$/,
18
+ };
19
+ /** Expand a wire-format token to a full `YYYY-MM-DD` ISO date. */
20
+ const expandToken = (token, precision) => {
21
+ if (precision === 'month')
22
+ return `${token}-01`;
23
+ if (precision === 'year')
24
+ return `${token}-01-01`;
25
+ return token;
26
+ };
27
+ /** Truncate a full `YYYY-MM-DD` ISO date to the wire-format for the precision. */
28
+ const truncateISO = (iso, precision) => {
29
+ if (precision === 'month')
30
+ return iso.slice(0, 7);
31
+ if (precision === 'year')
32
+ return iso.slice(0, 4);
33
+ return iso;
34
+ };
35
+ /**
36
+ * Whether the token matches the precision-specific shape *and* is a real date.
37
+ * For month/year we still expand to a full ISO date so `2026-13` / `2026-02-30`
38
+ * style errors are caught by `isValidISO`.
39
+ */
40
+ const isValidToken = (token, precision) => {
41
+ if (!PRECISION_ISO_REGEX[precision].test(token))
42
+ return false;
43
+ return isValidISO(expandToken(token, precision));
44
+ };
45
+ /**
46
+ * Parse a raw `value` string into an internal `TSelection` array.
47
+ *
48
+ * Wire format:
49
+ * - single: `YYYY-MM-DD` (or `YYYY-MM` / `YYYY` at coarser precision)
50
+ * - multi: space-separated tokens
51
+ * - range: `<start>/<end>`
52
+ *
53
+ * Internally the selection is always stored as full `YYYY-MM-DD` — month
54
+ * precision expands to the first day of the month; year precision to Jan 1st.
55
+ *
56
+ * Invalid tokens (malformed strings, impossible dates like `2026-99-99`,
57
+ * non-ISO input) are silently discarded — the returned selection is
58
+ * guaranteed to contain only valid ISO-8601 dates.
59
+ */
60
+ export const parseValue = (value, type, precision = 'day') => {
61
+ if (!value)
62
+ return [];
63
+ const trimmed = value.trim();
64
+ if (!trimmed)
65
+ return [];
66
+ if (type === 'range') {
67
+ const parts = trimmed
68
+ .split('/')
69
+ .filter((token) => isValidToken(token, precision))
70
+ .map((token) => expandToken(token, precision));
71
+ if (parts.length === 0)
72
+ return [];
73
+ if (parts.length === 1)
74
+ return [parts[0]];
75
+ const [start, end] = sortRange(parts[0], parts[1]);
76
+ return [start, end];
77
+ }
78
+ if (type === 'multi') {
79
+ const valid = trimmed
80
+ .split(/\s+/)
81
+ .filter((token) => isValidToken(token, precision))
82
+ .map((token) => expandToken(token, precision));
83
+ return Array.from(new Set(valid)).sort(compareISO);
84
+ }
85
+ return isValidToken(trimmed, precision) ? [expandToken(trimmed, precision)] : [];
86
+ };
87
+ /**
88
+ * Serialize an internal `TSelection` array back to the wire format.
89
+ * Truncates each entry to the precision's ISO shape.
90
+ */
91
+ export const serializeValue = (selection, type, precision = 'day') => {
92
+ if (!selection.length)
93
+ return '';
94
+ const format = (iso) => truncateISO(iso, precision);
95
+ if (type === 'range') {
96
+ if (selection.length < 2)
97
+ return format(selection[0] ?? '');
98
+ const [start, end] = sortRange(selection[0], selection[1]);
99
+ return `${format(start)}/${format(end)}`;
100
+ }
101
+ if (type === 'multi') {
102
+ return Array.from(new Set(selection.map(format)))
103
+ .sort(compareISO)
104
+ .join(' ');
105
+ }
106
+ return format(selection[0]);
107
+ };
108
+ /* -------------------------------------------------------------------------- */
109
+ /* Predicates */
110
+ /* -------------------------------------------------------------------------- */
111
+ /** Whether the given ISO day is included in the selection. */
112
+ export const isSelected = (iso, selection, type) => {
113
+ if (!selection.length)
114
+ return false;
115
+ if (type === 'range') {
116
+ if (selection.length < 2)
117
+ return iso === selection[0];
118
+ const [start, end] = selection;
119
+ return iso >= start && iso <= end;
120
+ }
121
+ return selection.includes(iso);
122
+ };
123
+ /** Whether the ISO day is the start of a range selection. */
124
+ export const isRangeStart = (iso, selection, type) => type === 'range' && selection.length === 2 && iso === selection[0];
125
+ /** Whether the ISO day is the end of a range selection. */
126
+ export const isRangeEnd = (iso, selection, type) => type === 'range' && selection.length === 2 && iso === selection[1];
127
+ /** Whether the ISO day sits strictly inside the range (not start/end). */
128
+ export const isRangeInner = (iso, selection, type) => {
129
+ if (type !== 'range' || selection.length < 2)
130
+ return false;
131
+ const [start, end] = selection;
132
+ return iso > start && iso < end;
133
+ };
134
+ /* -------------------------------------------------------------------------- */
135
+ /* Selection ops */
136
+ /* -------------------------------------------------------------------------- */
137
+ /**
138
+ * Apply a click on `iso` and return the next selection.
139
+ *
140
+ * - single: always replace.
141
+ * - multi: toggle (add if missing, remove if present).
142
+ * - range: if there is no start OR a full range exists, start a new range;
143
+ * otherwise complete the range (auto-sorted).
144
+ */
145
+ export const applySelection = (iso, selection, type) => {
146
+ if (type === 'single')
147
+ return [iso];
148
+ if (type === 'multi') {
149
+ return selection.includes(iso) ? selection.filter((v) => v !== iso) : [...selection, iso].sort(compareISO);
150
+ }
151
+ // range
152
+ if (selection.length === 0 || selection.length === 2)
153
+ return [iso];
154
+ const [start, end] = sortRange(selection[0], iso);
155
+ return [start, end];
156
+ };
157
+ /**
158
+ * Build the highlighted range while the user is hovering with an in-progress
159
+ * range selection (`tentative` = the pending start).
160
+ */
161
+ export const buildTentativeRange = (tentative, hovered) => {
162
+ if (!tentative || !hovered)
163
+ return [];
164
+ const [start, end] = sortRange(tentative, hovered);
165
+ return [start, end];
166
+ };
167
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/selection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/D,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,mBAAmB,GAAmC;IAC1D,GAAG,EAAE,qBAAqB;I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AAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7G,CAAC;IAED,QAAQ;IACR,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAClD,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAA6B,EAAE,OAA2B,EAAc,EAAE;IAC5G,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACtB,CAAC,CAAC","sourcesContent":["import type { TDatePickerType, TDatePrecision, TSelection } from '../bq-date-picker.types';\nimport { compareISO, isValidISO, sortRange } from './calendar';\n\n/* -------------------------------------------------------------------------- */\n/* Wire format parse/serialize */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Regex matching the wire-format ISO shape for each precision.\n * The internal selection is always `YYYY-MM-DD`; these only apply at the\n * public value boundary.\n */\nconst PRECISION_ISO_REGEX: Record<TDatePrecision, RegExp> = {\n day: /^\\d{4}-\\d{2}-\\d{2}$/,\n month: /^\\d{4}-\\d{2}$/,\n year: /^\\d{4}$/,\n};\n\n/** Expand a wire-format token to a full `YYYY-MM-DD` ISO date. */\nconst expandToken = (token: string, precision: TDatePrecision): string => {\n if (precision === 'month') return `${token}-01`;\n if (precision === 'year') return `${token}-01-01`;\n return token;\n};\n\n/** Truncate a full `YYYY-MM-DD` ISO date to the wire-format for the precision. */\nconst truncateISO = (iso: string, precision: TDatePrecision): string => {\n if (precision === 'month') return iso.slice(0, 7);\n if (precision === 'year') return iso.slice(0, 4);\n return iso;\n};\n\n/**\n * Whether the token matches the precision-specific shape *and* is a real date.\n * For month/year we still expand to a full ISO date so `2026-13` / `2026-02-30`\n * style errors are caught by `isValidISO`.\n */\nconst isValidToken = (token: string, precision: TDatePrecision): boolean => {\n if (!PRECISION_ISO_REGEX[precision].test(token)) return false;\n return isValidISO(expandToken(token, precision));\n};\n\n/**\n * Parse a raw `value` string into an internal `TSelection` array.\n *\n * Wire format:\n * - single: `YYYY-MM-DD` (or `YYYY-MM` / `YYYY` at coarser precision)\n * - multi: space-separated tokens\n * - range: `<start>/<end>`\n *\n * Internally the selection is always stored as full `YYYY-MM-DD` — month\n * precision expands to the first day of the month; year precision to Jan 1st.\n *\n * Invalid tokens (malformed strings, impossible dates like `2026-99-99`,\n * non-ISO input) are silently discarded — the returned selection is\n * guaranteed to contain only valid ISO-8601 dates.\n */\nexport const parseValue = (\n value: string | undefined | null,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): TSelection => {\n if (!value) return [];\n const trimmed = value.trim();\n if (!trimmed) return [];\n\n if (type === 'range') {\n const parts = trimmed\n .split('/')\n .filter((token) => isValidToken(token, precision))\n .map((token) => expandToken(token, precision));\n if (parts.length === 0) return [];\n if (parts.length === 1) return [parts[0]];\n const [start, end] = sortRange(parts[0], parts[1]);\n return [start, end];\n }\n\n if (type === 'multi') {\n const valid = trimmed\n .split(/\\s+/)\n .filter((token) => isValidToken(token, precision))\n .map((token) => expandToken(token, precision));\n return Array.from(new Set(valid)).sort(compareISO);\n }\n\n return isValidToken(trimmed, precision) ? [expandToken(trimmed, precision)] : [];\n};\n\n/**\n * Serialize an internal `TSelection` array back to the wire format.\n * Truncates each entry to the precision's ISO shape.\n */\nexport const serializeValue = (\n selection: TSelection,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): string => {\n if (!selection.length) return '';\n const format = (iso: string) => truncateISO(iso, precision);\n\n if (type === 'range') {\n if (selection.length < 2) return format(selection[0] ?? '');\n const [start, end] = sortRange(selection[0], selection[1]);\n return `${format(start)}/${format(end)}`;\n }\n\n if (type === 'multi') {\n return Array.from(new Set(selection.map(format)))\n .sort(compareISO)\n .join(' ');\n }\n\n return format(selection[0]);\n};\n\n/* -------------------------------------------------------------------------- */\n/* Predicates */\n/* -------------------------------------------------------------------------- */\n\n/** Whether the given ISO day is included in the selection. */\nexport const isSelected = (iso: string, selection: TSelection, type: TDatePickerType): boolean => {\n if (!selection.length) return false;\n if (type === 'range') {\n if (selection.length < 2) return iso === selection[0];\n const [start, end] = selection;\n return iso >= start && iso <= end;\n }\n return selection.includes(iso);\n};\n\n/** Whether the ISO day is the start of a range selection. */\nexport const isRangeStart = (iso: string, selection: TSelection, type: TDatePickerType): boolean =>\n type === 'range' && selection.length === 2 && iso === selection[0];\n\n/** Whether the ISO day is the end of a range selection. */\nexport const isRangeEnd = (iso: string, selection: TSelection, type: TDatePickerType): boolean =>\n type === 'range' && selection.length === 2 && iso === selection[1];\n\n/** Whether the ISO day sits strictly inside the range (not start/end). */\nexport const isRangeInner = (iso: string, selection: TSelection, type: TDatePickerType): boolean => {\n if (type !== 'range' || selection.length < 2) return false;\n const [start, end] = selection;\n return iso > start && iso < end;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Selection ops */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Apply a click on `iso` and return the next selection.\n *\n * - single: always replace.\n * - multi: toggle (add if missing, remove if present).\n * - range: if there is no start OR a full range exists, start a new range;\n * otherwise complete the range (auto-sorted).\n */\nexport const applySelection = (iso: string, selection: TSelection, type: TDatePickerType): TSelection => {\n if (type === 'single') return [iso];\n\n if (type === 'multi') {\n return selection.includes(iso) ? selection.filter((v) => v !== iso) : [...selection, iso].sort(compareISO);\n }\n\n // range\n if (selection.length === 0 || selection.length === 2) return [iso];\n const [start, end] = sortRange(selection[0], iso);\n return [start, end];\n};\n\n/**\n * Build the highlighted range while the user is hovering with an in-progress\n * range selection (`tentative` = the pending start).\n */\nexport const buildTentativeRange = (tentative: string | undefined, hovered: string | undefined): TSelection => {\n if (!tentative || !hovered) return [];\n const [start, end] = sortRange(tentative, hovered);\n return [start, end];\n};\n"]}
@@ -0,0 +1,49 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { formatDisplayValue, isDefined } from "../../../shared/utils";
6
+ import { parseValue, serializeValue } from "./selection";
7
+ /**
8
+ * Normalizes a raw public `value` string against the current picker `type`
9
+ * and `precision`.
10
+ *
11
+ * Runs the value through `parseValue`/`serializeValue` so any invalid ISO
12
+ * tokens are dropped before the value ever reaches the form, the display
13
+ * input, or the visible selection. Returns `undefined` when normalization
14
+ * leaves an empty string, so callers can distinguish "no value" from "empty
15
+ * string value".
16
+ */
17
+ export const normalizeValue = (raw, type, precision = 'day') => {
18
+ const serialized = serializeValue(parseValue(raw, type, precision), type, precision);
19
+ return serialized === '' ? undefined : serialized;
20
+ };
21
+ /** Whether a value string is present and non-empty — used to drive UI affordances. */
22
+ export const computeHasValue = (value) => isDefined(value) && `${value}`.length > 0;
23
+ /**
24
+ * Formats the current value for display in the trigger input. Thin wrapper
25
+ * around `formatDisplayValue` that accepts `undefined` and coerces to an
26
+ * empty string, so callers don't have to repeat the null check.
27
+ *
28
+ * Precision-agnostic: internally the selection is stored as full ISO dates
29
+ * (the first day of the month / January 1st for coarser precisions), so
30
+ * `Intl.DateTimeFormat(locale, formatOptions)` produces the right label
31
+ * whether the user asked for `{ year: 'numeric' }` or `{ dateStyle: 'full' }`.
32
+ */
33
+ export const computeDisplayDate = (value, type, locale, formatOptions, precision = 'day') => {
34
+ // Expand precision-truncated wire values back to full ISO so
35
+ // `formatDisplayValue` (which expects YYYY-MM-DD) can parse them.
36
+ const expanded = serializeValue(parseValue(value ?? '', type, precision), type, 'day');
37
+ return formatDisplayValue(expanded, type, locale, formatOptions);
38
+ };
39
+ /**
40
+ * Default `Intl.DateTimeFormat` options per precision.
41
+ * Applied when the consumer hasn't explicitly overridden `formatOptions`, so
42
+ * a `precision="month"` picker doesn't show "1 May 2026".
43
+ */
44
+ export const DEFAULT_FORMAT_OPTIONS_BY_PRECISION = {
45
+ day: { day: 'numeric', month: 'short', year: 'numeric' },
46
+ month: { month: 'long', year: 'numeric' },
47
+ year: { year: 'numeric' },
48
+ };
49
+ //# sourceMappingURL=value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../../../../packages/beeq/src/components/date-picker/helper/value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAuB,EACvB,IAAqB,EACrB,YAA4B,KAAK,EACb,EAAE;IACtB,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACrF,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;AACpD,CAAC,CAAC;AAEF,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAyB,EAAW,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAEjH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAyB,EACzB,IAAqB,EACrB,MAA4B,EAC5B,aAAyC,EACzC,YAA4B,KAAK,EACb,EAAE;IACtB,6DAA6D;IAC7D,kEAAkE;IAClE,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvF,OAAO,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAuD;IACrG,GAAG,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACxD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;IACzC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CAC1B,CAAC","sourcesContent":["import { formatDisplayValue, isDefined } from '../../../shared/utils';\nimport type { TDatePickerType, TDatePrecision } from '../bq-date-picker.types';\nimport { parseValue, serializeValue } from './selection';\n\n/**\n * Normalizes a raw public `value` string against the current picker `type`\n * and `precision`.\n *\n * Runs the value through `parseValue`/`serializeValue` so any invalid ISO\n * tokens are dropped before the value ever reaches the form, the display\n * input, or the visible selection. Returns `undefined` when normalization\n * leaves an empty string, so callers can distinguish \"no value\" from \"empty\n * string value\".\n */\nexport const normalizeValue = (\n raw: string | undefined,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): string | undefined => {\n const serialized = serializeValue(parseValue(raw, type, precision), type, precision);\n return serialized === '' ? undefined : serialized;\n};\n\n/** Whether a value string is present and non-empty — used to drive UI affordances. */\nexport const computeHasValue = (value: string | undefined): boolean => isDefined(value) && `${value}`.length > 0;\n\n/**\n * Formats the current value for display in the trigger input. Thin wrapper\n * around `formatDisplayValue` that accepts `undefined` and coerces to an\n * empty string, so callers don't have to repeat the null check.\n *\n * Precision-agnostic: internally the selection is stored as full ISO dates\n * (the first day of the month / January 1st for coarser precisions), so\n * `Intl.DateTimeFormat(locale, formatOptions)` produces the right label\n * whether the user asked for `{ year: 'numeric' }` or `{ dateStyle: 'full' }`.\n */\nexport const computeDisplayDate = (\n value: string | undefined,\n type: TDatePickerType,\n locale: Intl.LocalesArgument,\n formatOptions: Intl.DateTimeFormatOptions,\n precision: TDatePrecision = 'day',\n): string | undefined => {\n // Expand precision-truncated wire values back to full ISO so\n // `formatDisplayValue` (which expects YYYY-MM-DD) can parse them.\n const expanded = serializeValue(parseValue(value ?? '', type, precision), type, 'day');\n return formatDisplayValue(expanded, type, locale, formatOptions);\n};\n\n/**\n * Default `Intl.DateTimeFormat` options per precision.\n * Applied when the consumer hasn't explicitly overridden `formatOptions`, so\n * a `precision=\"month\"` picker doesn't show \"1 May 2026\".\n */\nexport const DEFAULT_FORMAT_OPTIONS_BY_PRECISION: Record<TDatePrecision, Intl.DateTimeFormatOptions> = {\n day: { day: 'numeric', month: 'short', year: 'numeric' },\n month: { month: 'long', year: 'numeric' },\n year: { year: 'numeric' },\n};\n"]}