@elliemae/ds-form-date-time-picker 3.4.3-rc.0 → 3.4.4-next.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 (322) hide show
  1. package/dist/cjs/ControlledDateTimePicker.js +9 -5
  2. package/dist/cjs/ControlledDateTimePicker.js.map +1 -1
  3. package/dist/cjs/ControlledDateTimePickerCTX.js +4 -1
  4. package/dist/cjs/ControlledDateTimePickerCTX.js.map +1 -1
  5. package/dist/cjs/ControlledDateTimePickerDatatestid.js +4 -1
  6. package/dist/cjs/ControlledDateTimePickerDatatestid.js.map +1 -1
  7. package/dist/cjs/ControlledDateTimePickerTypes.js +4 -1
  8. package/dist/cjs/ControlledDateTimePickerTypes.js.map +1 -1
  9. package/dist/cjs/config/useChangeHandlers.js +261 -219
  10. package/dist/cjs/config/useChangeHandlers.js.map +1 -1
  11. package/dist/cjs/config/useControlledDateTimePicker.js +34 -28
  12. package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
  13. package/dist/cjs/config/useFocusTracker.js +130 -124
  14. package/dist/cjs/config/useFocusTracker.js.map +1 -1
  15. package/dist/cjs/config/useGetDestructuredValues.js +50 -38
  16. package/dist/cjs/config/useGetDestructuredValues.js.map +1 -1
  17. package/dist/cjs/config/useGetFlags.js +16 -5
  18. package/dist/cjs/config/useGetFlags.js.map +2 -2
  19. package/dist/cjs/config/useGetPropsBasedOnType.js +60 -54
  20. package/dist/cjs/config/useGetPropsBasedOnType.js.map +1 -1
  21. package/dist/cjs/config/useGetPropsWithDefault.js +4 -1
  22. package/dist/cjs/config/useGetPropsWithDefault.js.map +1 -1
  23. package/dist/cjs/config/useGetReferences.js +35 -29
  24. package/dist/cjs/config/useGetReferences.js.map +1 -1
  25. package/dist/cjs/config/useGlobalKeyHandlers.js +63 -51
  26. package/dist/cjs/config/useGlobalKeyHandlers.js.map +1 -1
  27. package/dist/cjs/config/useRelevantValueFromProps.js +15 -9
  28. package/dist/cjs/config/useRelevantValueFromProps.js.map +1 -1
  29. package/dist/cjs/config/useValidateProps.js +33 -14
  30. package/dist/cjs/config/useValidateProps.js.map +1 -1
  31. package/dist/cjs/exported-related/theming.js +4 -1
  32. package/dist/cjs/exported-related/theming.js.map +1 -1
  33. package/dist/cjs/index.js +4 -1
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/parts/ClearButton/ClearButton.js +12 -7
  36. package/dist/cjs/parts/ClearButton/ClearButton.js.map +1 -1
  37. package/dist/cjs/parts/ClearButton/useClearButton.js +45 -33
  38. package/dist/cjs/parts/ClearButton/useClearButton.js.map +1 -1
  39. package/dist/cjs/parts/ControlledDateTimePickerContent.js +31 -16
  40. package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +1 -1
  41. package/dist/cjs/parts/DateInputs/DDInput.js +42 -33
  42. package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
  43. package/dist/cjs/parts/DateInputs/DateInputs.js +63 -42
  44. package/dist/cjs/parts/DateInputs/DateInputs.js.map +2 -2
  45. package/dist/cjs/parts/DateInputs/MMInput.js +56 -35
  46. package/dist/cjs/parts/DateInputs/MMInput.js.map +3 -3
  47. package/dist/cjs/parts/DateInputs/YYYYInput.js +42 -33
  48. package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
  49. package/dist/cjs/parts/DateInputs/useDateInputs.js +296 -254
  50. package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
  51. package/dist/cjs/parts/Pickers/Calendar/Calendar.js +24 -9
  52. package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +1 -1
  53. package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +14 -4
  54. package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
  55. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +18 -7
  56. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +1 -1
  57. package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js +4 -1
  58. package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js.map +1 -1
  59. package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js +35 -27
  60. package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
  61. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +10 -5
  62. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +1 -1
  63. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +112 -83
  64. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +1 -1
  65. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +21 -13
  66. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +1 -1
  67. package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js +7 -3
  68. package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +1 -1
  69. package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +55 -34
  70. package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
  71. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +11 -6
  72. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +1 -1
  73. package/dist/cjs/parts/Pickers/Calendar/Day.js +73 -58
  74. package/dist/cjs/parts/Pickers/Calendar/Day.js.map +1 -1
  75. package/dist/cjs/parts/Pickers/Calendar/Styleds.js +4 -1
  76. package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +1 -1
  77. package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js +29 -23
  78. package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +1 -1
  79. package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +38 -26
  80. package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
  81. package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +34 -18
  82. package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
  83. package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +190 -166
  84. package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
  85. package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +33 -21
  86. package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
  87. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +22 -8
  88. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +1 -1
  89. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +14 -5
  90. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +1 -1
  91. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +7 -2
  92. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
  93. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +10 -5
  94. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +1 -1
  95. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +27 -19
  96. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +1 -1
  97. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +11 -6
  98. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +1 -1
  99. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +4 -1
  100. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
  101. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +67 -52
  102. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
  103. package/dist/cjs/parts/Pickers/PickersIcons.js +13 -4
  104. package/dist/cjs/parts/Pickers/PickersIcons.js.map +2 -2
  105. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +90 -72
  106. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +1 -1
  107. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +102 -76
  108. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +1 -1
  109. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +87 -69
  110. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +1 -1
  111. package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +4 -1
  112. package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
  113. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js +24 -9
  114. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js.map +1 -1
  115. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +35 -6
  116. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  117. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js +4 -1
  118. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js.map +1 -1
  119. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +10 -5
  120. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +1 -1
  121. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +21 -13
  122. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +1 -1
  123. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +11 -6
  124. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +1 -1
  125. package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +12 -6
  126. package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +1 -1
  127. package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +99 -61
  128. package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
  129. package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js +163 -145
  130. package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
  131. package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +42 -30
  132. package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
  133. package/dist/cjs/parts/Styleds.js +4 -1
  134. package/dist/cjs/parts/Styleds.js.map +1 -1
  135. package/dist/cjs/parts/TimeInputs/HHInput.js +44 -35
  136. package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
  137. package/dist/cjs/parts/TimeInputs/MeridiemInput.js +42 -33
  138. package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
  139. package/dist/cjs/parts/TimeInputs/MinutesInput.js +42 -33
  140. package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
  141. package/dist/cjs/parts/TimeInputs/TimeInputs.js +60 -40
  142. package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +1 -1
  143. package/dist/cjs/parts/TimeInputs/useTimeInputs.js +234 -201
  144. package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +1 -1
  145. package/dist/cjs/parts/config.js +4 -1
  146. package/dist/cjs/parts/config.js.map +1 -1
  147. package/dist/cjs/propTypes.js +19 -6
  148. package/dist/cjs/propTypes.js.map +2 -2
  149. package/dist/cjs/sharedTypes.js +4 -1
  150. package/dist/cjs/sharedTypes.js.map +2 -2
  151. package/dist/cjs/utils/constants.js +4 -1
  152. package/dist/cjs/utils/constants.js.map +1 -1
  153. package/dist/cjs/utils/dateHelpers.js +15 -10
  154. package/dist/cjs/utils/dateHelpers.js.map +1 -1
  155. package/dist/cjs/utils/dateTimeHelpers.js +4 -1
  156. package/dist/cjs/utils/dateTimeHelpers.js.map +1 -1
  157. package/dist/cjs/utils/hooks/useGetDayFromDateString.js +4 -1
  158. package/dist/cjs/utils/hooks/useGetDayFromDateString.js.map +1 -1
  159. package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +4 -1
  160. package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +1 -1
  161. package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js +9 -2
  162. package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js.map +1 -1
  163. package/dist/cjs/utils/hooks/useOnClickOutside.js +4 -1
  164. package/dist/cjs/utils/hooks/useOnClickOutside.js.map +1 -1
  165. package/dist/cjs/utils/numberHelpers.js +4 -1
  166. package/dist/cjs/utils/numberHelpers.js.map +1 -1
  167. package/dist/cjs/utils/stringHelpers.js +4 -1
  168. package/dist/cjs/utils/stringHelpers.js.map +1 -1
  169. package/dist/cjs/utils/timeHelpers.js +4 -1
  170. package/dist/cjs/utils/timeHelpers.js.map +1 -1
  171. package/dist/cjs/utils/typeGuards.js +4 -1
  172. package/dist/cjs/utils/typeGuards.js.map +1 -1
  173. package/dist/esm/ControlledDateTimePicker.js +5 -4
  174. package/dist/esm/ControlledDateTimePicker.js.map +1 -1
  175. package/dist/esm/ControlledDateTimePickerCTX.js.map +1 -1
  176. package/dist/esm/ControlledDateTimePickerDatatestid.js.map +1 -1
  177. package/dist/esm/ControlledDateTimePickerTypes.js.map +1 -1
  178. package/dist/esm/config/useChangeHandlers.js +257 -218
  179. package/dist/esm/config/useChangeHandlers.js.map +1 -1
  180. package/dist/esm/config/useControlledDateTimePicker.js +30 -27
  181. package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
  182. package/dist/esm/config/useFocusTracker.js +126 -123
  183. package/dist/esm/config/useFocusTracker.js.map +1 -1
  184. package/dist/esm/config/useGetDestructuredValues.js +46 -37
  185. package/dist/esm/config/useGetDestructuredValues.js.map +1 -1
  186. package/dist/esm/config/useGetFlags.js +12 -4
  187. package/dist/esm/config/useGetFlags.js.map +2 -2
  188. package/dist/esm/config/useGetPropsBasedOnType.js +56 -53
  189. package/dist/esm/config/useGetPropsBasedOnType.js.map +1 -1
  190. package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
  191. package/dist/esm/config/useGetReferences.js +31 -28
  192. package/dist/esm/config/useGetReferences.js.map +1 -1
  193. package/dist/esm/config/useGlobalKeyHandlers.js +59 -50
  194. package/dist/esm/config/useGlobalKeyHandlers.js.map +1 -1
  195. package/dist/esm/config/useRelevantValueFromProps.js +11 -8
  196. package/dist/esm/config/useRelevantValueFromProps.js.map +1 -1
  197. package/dist/esm/config/useValidateProps.js +29 -13
  198. package/dist/esm/config/useValidateProps.js.map +1 -1
  199. package/dist/esm/exported-related/theming.js.map +1 -1
  200. package/dist/esm/index.js.map +1 -1
  201. package/dist/esm/parts/ClearButton/ClearButton.js +8 -6
  202. package/dist/esm/parts/ClearButton/ClearButton.js.map +1 -1
  203. package/dist/esm/parts/ClearButton/useClearButton.js +41 -32
  204. package/dist/esm/parts/ClearButton/useClearButton.js.map +1 -1
  205. package/dist/esm/parts/ControlledDateTimePickerContent.js +27 -15
  206. package/dist/esm/parts/ControlledDateTimePickerContent.js.map +1 -1
  207. package/dist/esm/parts/DateInputs/DDInput.js +38 -32
  208. package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
  209. package/dist/esm/parts/DateInputs/DateInputs.js +59 -41
  210. package/dist/esm/parts/DateInputs/DateInputs.js.map +2 -2
  211. package/dist/esm/parts/DateInputs/MMInput.js +53 -35
  212. package/dist/esm/parts/DateInputs/MMInput.js.map +3 -3
  213. package/dist/esm/parts/DateInputs/YYYYInput.js +38 -32
  214. package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
  215. package/dist/esm/parts/DateInputs/useDateInputs.js +292 -253
  216. package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
  217. package/dist/esm/parts/Pickers/Calendar/Calendar.js +20 -8
  218. package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +1 -1
  219. package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +10 -3
  220. package/dist/esm/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
  221. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +14 -6
  222. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +1 -1
  223. package/dist/esm/parts/Pickers/Calendar/CalendarContext.js.map +1 -1
  224. package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js +31 -26
  225. package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
  226. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +6 -4
  227. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +1 -1
  228. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +108 -82
  229. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +1 -1
  230. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +17 -12
  231. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +1 -1
  232. package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js +3 -2
  233. package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +1 -1
  234. package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js +51 -33
  235. package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
  236. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +7 -5
  237. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +1 -1
  238. package/dist/esm/parts/Pickers/Calendar/Day.js +69 -57
  239. package/dist/esm/parts/Pickers/Calendar/Day.js.map +1 -1
  240. package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +1 -1
  241. package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js +25 -22
  242. package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +1 -1
  243. package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +34 -25
  244. package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
  245. package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +30 -17
  246. package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
  247. package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +186 -165
  248. package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
  249. package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +29 -20
  250. package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
  251. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +18 -7
  252. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +1 -1
  253. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +10 -4
  254. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +1 -1
  255. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +3 -1
  256. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
  257. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +6 -4
  258. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +1 -1
  259. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +23 -18
  260. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +1 -1
  261. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +7 -5
  262. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +1 -1
  263. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
  264. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +63 -51
  265. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
  266. package/dist/esm/parts/Pickers/PickersIcons.js +9 -3
  267. package/dist/esm/parts/Pickers/PickersIcons.js.map +2 -2
  268. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +86 -71
  269. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +1 -1
  270. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +98 -75
  271. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +1 -1
  272. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +83 -68
  273. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +1 -1
  274. package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
  275. package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js +20 -8
  276. package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js.map +1 -1
  277. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +31 -5
  278. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  279. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContext.js.map +1 -1
  280. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +6 -4
  281. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +1 -1
  282. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +17 -12
  283. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +1 -1
  284. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +7 -5
  285. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +1 -1
  286. package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +8 -5
  287. package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +1 -1
  288. package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +95 -60
  289. package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
  290. package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js +159 -144
  291. package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
  292. package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +38 -29
  293. package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
  294. package/dist/esm/parts/Styleds.js.map +1 -1
  295. package/dist/esm/parts/TimeInputs/HHInput.js +40 -34
  296. package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
  297. package/dist/esm/parts/TimeInputs/MeridiemInput.js +38 -32
  298. package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
  299. package/dist/esm/parts/TimeInputs/MinutesInput.js +38 -32
  300. package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
  301. package/dist/esm/parts/TimeInputs/TimeInputs.js +56 -39
  302. package/dist/esm/parts/TimeInputs/TimeInputs.js.map +1 -1
  303. package/dist/esm/parts/TimeInputs/useTimeInputs.js +230 -200
  304. package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +1 -1
  305. package/dist/esm/parts/config.js.map +1 -1
  306. package/dist/esm/propTypes.js +15 -5
  307. package/dist/esm/propTypes.js.map +2 -2
  308. package/dist/esm/sharedTypes.js.map +1 -1
  309. package/dist/esm/utils/constants.js.map +1 -1
  310. package/dist/esm/utils/dateHelpers.js +11 -9
  311. package/dist/esm/utils/dateHelpers.js.map +1 -1
  312. package/dist/esm/utils/dateTimeHelpers.js.map +1 -1
  313. package/dist/esm/utils/hooks/useGetDayFromDateString.js.map +1 -1
  314. package/dist/esm/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +1 -1
  315. package/dist/esm/utils/hooks/useGetStartingFocusedDay.js +5 -1
  316. package/dist/esm/utils/hooks/useGetStartingFocusedDay.js.map +1 -1
  317. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  318. package/dist/esm/utils/numberHelpers.js.map +1 -1
  319. package/dist/esm/utils/stringHelpers.js.map +1 -1
  320. package/dist/esm/utils/timeHelpers.js.map +1 -1
  321. package/dist/esm/utils/typeGuards.js.map +1 -1
  322. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/useDateInputs.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useMemo, useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport {\n getFormattedDateString,\n prependStringWithPlaceHolders,\n fillStringWithPlaceHolders,\n} from '../../utils/stringHelpers';\nimport { getValidationDateStringMetaInfo } from '../../utils/dateHelpers';\nimport { defaultMetaInfo } from '../../utils/constants';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\nimport type { DSControlledDateTimePickerT } from '../../propTypes';\n\nexport const useDateInputs = (): DSControlledDateTimePickerInternalsT.UseDateInputsR => {\n const {\n props: { disabled },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledDay,\n getIsOutOfRangeDay,\n month,\n day,\n year,\n hideTime,\n handleChangeComposedDateString,\n withClearBtn,\n withAnyPicker,\n withAnyRightController,\n autoFocusMonthInput,\n trackFocusResetter,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n trackFocusDayInput,\n trackFocusMonthInput,\n trackFocusYearInput,\n trackFocusHourInput,\n trackFocusClearBtn,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n trackFocusLastSegment();\n }, [trackFocusLastSegment]);\n\n const handleChangeMonth = useCallback(\n (\n newMonth: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [day, year, getIsOutOfRangeDay, getIsDisabledDay, appOnMonthChange, handleChangeComposedDateString],\n );\n const onMonthFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusMonthInput();\n }, [trackFocusMonthInput]);\n const onMonthChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n let newMonth = e?.target?.value;\n // converts months 2~9 to 02~09\n if (Number.parseInt(newMonth, 10) > 1) newMonth = prependStringWithPlaceHolders(newMonth, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n },\n [handleChangeMonth, trackFocusDayInput],\n );\n const onMonthKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const monthStringConvertedToInteger = Number.parseInt(month, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const monthInteger = Number.isNaN(monthStringConvertedToInteger) ? 0 : monthStringConvertedToInteger;\n let newMonth;\n if (key === 'ArrowUp') newMonth = monthInteger + 1 <= 12 ? monthInteger + 1 : monthInteger;\n else newMonth = monthInteger - 1 > 0 ? monthInteger - 1 : 1;\n newMonth = prependStringWithPlaceHolders(`${newMonth}`, 2);\n handleChangeMonth(newMonth, e);\n }\n if (!Number.isNaN(monthStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n const newMonth = prependStringWithPlaceHolders(`${monthStringConvertedToInteger}`, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n }\n\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [month, onHomeKeyDown, onEndKeyDown, trackFocusLastSegment, trackFocusDayInput, handleChangeMonth],\n );\n const onMonthBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newMonth = e?.target?.value;\n if (newMonth === '0') handleChangeMonth('01', e, { isAutomaticFillTrigger: true });\n else if (newMonth.length > 0 && newMonth.length < 2)\n handleChangeMonth(prependStringWithPlaceHolders(newMonth, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeMonth],\n );\n\n const handleChangeDay = useCallback(\n (\n newDay: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, year, getIsOutOfRangeDay, getIsDisabledDay, appOnDayChange, handleChangeComposedDateString],\n );\n const onDayFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusDayInput();\n }, [trackFocusDayInput]);\n const onDayChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n let newDay = e?.target?.value;\n // converts days 4~9 to 04~09\n if (Number.parseInt(newDay, 10) > 3) newDay = prependStringWithPlaceHolders(newDay, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n },\n [handleChangeDay, trackFocusYearInput],\n );\n const onDayKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const dayStringConvertedToInteger = Number.parseInt(day, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const dayInteger = Number.isNaN(dayStringConvertedToInteger) ? 0 : dayStringConvertedToInteger;\n let newDay;\n if (key === 'ArrowUp') newDay = dayInteger + 1 <= 31 ? dayInteger + 1 : dayInteger;\n else newDay = dayInteger - 1 > 0 ? dayInteger - 1 : 1;\n newDay = prependStringWithPlaceHolders(`${newDay}`, 2);\n handleChangeDay(newDay, e);\n }\n if (!Number.isNaN(dayStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n const newDay = prependStringWithPlaceHolders(`${dayStringConvertedToInteger}`, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n }\n // regressive backspace functionality\n if (key === 'Backspace' && day?.length === 0) {\n trackFocusMonthInput();\n }\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [\n day,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n handleChangeDay,\n trackFocusYearInput,\n trackFocusMonthInput,\n ],\n );\n const onDayBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newDay = e?.target?.value;\n if (newDay === '0') handleChangeDay('01', e, { isAutomaticFillTrigger: true });\n else if (newDay.length > 0 && newDay.length < 2)\n handleChangeDay(prependStringWithPlaceHolders(newDay, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeDay],\n );\n\n const handleChangeYear = useCallback(\n (\n newYear: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, day, getIsOutOfRangeDay, getIsDisabledDay, appOnYearChange, handleChangeComposedDateString],\n );\n const onYearFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusYearInput();\n }, [trackFocusYearInput]);\n const onYearChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n const newYear = e?.target?.value;\n handleChangeYear(newYear, e);\n // auto-advance functionality:\n if (newYear.length === 4) {\n if (!hideTime) trackFocusHourInput();\n else if (withAnyRightController) {\n if (withClearBtn) trackFocusClearBtn();\n else if (withAnyPicker) trackFocusPicker();\n // pending approval from Seda, check which one should be focused first...\n }\n }\n },\n [\n handleChangeYear,\n hideTime,\n trackFocusHourInput,\n withAnyRightController,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n ],\n );\n const onYearKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n\n /* ****** New year value calculator logic ********* */\n const yearStringConvertedToInteger = Number.parseInt(year, 10);\n const yearInteger = Number.isNaN(yearStringConvertedToInteger) ? 0 : yearStringConvertedToInteger;\n let newYear = yearInteger !== 0 ? fillStringWithPlaceHolders(`${yearInteger}`, 4, '0') : '';\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n let newYearInteger;\n if (key === 'ArrowUp') newYearInteger = yearInteger + 1 <= 9999 ? yearInteger + 1 : yearInteger;\n else newYearInteger = yearInteger - 1 > 0 ? yearInteger - 1 : 1;\n newYear = prependStringWithPlaceHolders(`${newYearInteger}`, 4);\n }\n const isAutomaticFillTrigger = newYear !== year && ['Tab', ' '].includes(key);\n const metainfo = { isAutomaticFillTrigger };\n\n /* ************* new year apply logic ************* */\n // tab/spacebar applies auto-fill\n // arrows up/down applies increment/decrement\n if (key === 'ArrowUp' || key === 'ArrowDown' || isAutomaticFillTrigger) {\n handleChangeYear(newYear, e, metainfo);\n }\n\n /* ************* focus tracking logic ************* */\n let trackNextFocus = trackFocusResetter; // if nothing after, we reset internal focus tracker to avoid re-render unexpected focus shift\n if (!hideTime) trackNextFocus = trackFocusHourInput;\n else if (withClearBtn) trackNextFocus = trackFocusClearBtn;\n else if (withAnyPicker) trackNextFocus = trackFocusPicker;\n\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n\n /* ************** auto-advance logic ************** */\n if (key === ' ') {\n // auto-advance functionality:\n trackNextFocus();\n }\n /* ********** regressive backspace logic ********** */\n if (key === 'Backspace' && year?.length === 0) {\n trackFocusDayInput();\n }\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [\n year,\n trackFocusResetter,\n hideTime,\n trackFocusHourInput,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n trackFocusDayInput,\n handleChangeYear,\n ],\n );\n const onYearBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(() => {\n // this was used before, now that we have a wrapping onBlur resetting the focus tracker, this is unused;\n }, []);\n\n return useMemo(\n () => ({\n month,\n day,\n year,\n autoFocusMonthInput,\n disabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n }),\n [\n month,\n day,\n year,\n autoFocusMonthInput,\n disabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n ],\n );\n};\n"],
5
- "mappings": "AAAA;ACGA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAIO,MAAM,gBAAgB,MAA2D;AACtF,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW,+BAA+B;A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AAAQ,oBAAc;AAClC,QAAI,QAAQ;AAAO,mBAAa;AAGhC,QAAI,QAAQ,KAAK;AAEf,qBAAe;AAAA,IACjB;AAEA,QAAI,QAAQ,eAAe,MAAM,WAAW,GAAG;AAC7C,yBAAmB;AAAA,IACrB;AAEA,QAAK,YAAW,YAAY,QAAQ;AAAK,4BAAsB;AAAA,EACjE,GACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AACA,QAAM,aAA8D,YAAY,MAAM;AAAA,EAEtF,GAAG,CAAC,CAAC;AAEL,SAAO,QACL,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useMemo, useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport {\n getFormattedDateString,\n prependStringWithPlaceHolders,\n fillStringWithPlaceHolders,\n} from '../../utils/stringHelpers';\nimport { getValidationDateStringMetaInfo } from '../../utils/dateHelpers';\nimport { defaultMetaInfo } from '../../utils/constants';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\nimport type { DSControlledDateTimePickerT } from '../../propTypes';\n\nexport const useDateInputs = (): DSControlledDateTimePickerInternalsT.UseDateInputsR => {\n const {\n props: { disabled },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledDay,\n getIsOutOfRangeDay,\n month,\n day,\n year,\n hideTime,\n handleChangeComposedDateString,\n withClearBtn,\n withAnyPicker,\n withAnyRightController,\n autoFocusMonthInput,\n innerRefMonthInput,\n trackFocusResetter,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n trackFocusDayInput,\n trackFocusMonthInput,\n trackFocusYearInput,\n trackFocusHourInput,\n trackFocusClearBtn,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n trackFocusLastSegment();\n }, [trackFocusLastSegment]);\n\n const handleChangeMonth = useCallback(\n (\n newMonth: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [day, year, getIsOutOfRangeDay, getIsDisabledDay, appOnMonthChange, handleChangeComposedDateString],\n );\n const onMonthFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusMonthInput();\n }, [trackFocusMonthInput]);\n const onMonthChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n let newMonth = e?.target?.value;\n // converts months 2~9 to 02~09\n if (Number.parseInt(newMonth, 10) > 1) newMonth = prependStringWithPlaceHolders(newMonth, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n },\n [handleChangeMonth, trackFocusDayInput],\n );\n const onMonthKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const monthStringConvertedToInteger = Number.parseInt(month, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const monthInteger = Number.isNaN(monthStringConvertedToInteger) ? 0 : monthStringConvertedToInteger;\n let newMonth;\n if (key === 'ArrowUp') newMonth = monthInteger + 1 <= 12 ? monthInteger + 1 : monthInteger;\n else newMonth = monthInteger - 1 > 0 ? monthInteger - 1 : 1;\n newMonth = prependStringWithPlaceHolders(`${newMonth}`, 2);\n handleChangeMonth(newMonth, e);\n }\n if (!Number.isNaN(monthStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n const newMonth = prependStringWithPlaceHolders(`${monthStringConvertedToInteger}`, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n }\n\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [month, onHomeKeyDown, onEndKeyDown, trackFocusLastSegment, trackFocusDayInput, handleChangeMonth],\n );\n const onMonthBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newMonth = e?.target?.value;\n if (newMonth === '0') handleChangeMonth('01', e, { isAutomaticFillTrigger: true });\n else if (newMonth.length > 0 && newMonth.length < 2)\n handleChangeMonth(prependStringWithPlaceHolders(newMonth, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeMonth],\n );\n\n const handleChangeDay = useCallback(\n (\n newDay: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, year, getIsOutOfRangeDay, getIsDisabledDay, appOnDayChange, handleChangeComposedDateString],\n );\n const onDayFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusDayInput();\n }, [trackFocusDayInput]);\n const onDayChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n let newDay = e?.target?.value;\n // converts days 4~9 to 04~09\n if (Number.parseInt(newDay, 10) > 3) newDay = prependStringWithPlaceHolders(newDay, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n },\n [handleChangeDay, trackFocusYearInput],\n );\n const onDayKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const dayStringConvertedToInteger = Number.parseInt(day, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const dayInteger = Number.isNaN(dayStringConvertedToInteger) ? 0 : dayStringConvertedToInteger;\n let newDay;\n if (key === 'ArrowUp') newDay = dayInteger + 1 <= 31 ? dayInteger + 1 : dayInteger;\n else newDay = dayInteger - 1 > 0 ? dayInteger - 1 : 1;\n newDay = prependStringWithPlaceHolders(`${newDay}`, 2);\n handleChangeDay(newDay, e);\n }\n if (!Number.isNaN(dayStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n const newDay = prependStringWithPlaceHolders(`${dayStringConvertedToInteger}`, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n }\n // regressive backspace functionality\n if (key === 'Backspace' && day?.length === 0) {\n trackFocusMonthInput();\n }\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [\n day,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n handleChangeDay,\n trackFocusYearInput,\n trackFocusMonthInput,\n ],\n );\n const onDayBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newDay = e?.target?.value;\n if (newDay === '0') handleChangeDay('01', e, { isAutomaticFillTrigger: true });\n else if (newDay.length > 0 && newDay.length < 2)\n handleChangeDay(prependStringWithPlaceHolders(newDay, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeDay],\n );\n\n const handleChangeYear = useCallback(\n (\n newYear: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, day, getIsOutOfRangeDay, getIsDisabledDay, appOnYearChange, handleChangeComposedDateString],\n );\n const onYearFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusYearInput();\n }, [trackFocusYearInput]);\n const onYearChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n const newYear = e?.target?.value;\n handleChangeYear(newYear, e);\n // auto-advance functionality:\n if (newYear.length === 4) {\n if (!hideTime) trackFocusHourInput();\n else if (withAnyRightController) {\n if (withClearBtn) trackFocusClearBtn();\n else if (withAnyPicker) trackFocusPicker();\n // pending approval from Seda, check which one should be focused first...\n }\n }\n },\n [\n handleChangeYear,\n hideTime,\n trackFocusHourInput,\n withAnyRightController,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n ],\n );\n const onYearKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n\n /* ****** New year value calculator logic ********* */\n const yearStringConvertedToInteger = Number.parseInt(year, 10);\n const yearInteger = Number.isNaN(yearStringConvertedToInteger) ? 0 : yearStringConvertedToInteger;\n let newYear = yearInteger !== 0 ? fillStringWithPlaceHolders(`${yearInteger}`, 4, '0') : '';\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n let newYearInteger;\n if (key === 'ArrowUp') newYearInteger = yearInteger + 1 <= 9999 ? yearInteger + 1 : yearInteger;\n else newYearInteger = yearInteger - 1 > 0 ? yearInteger - 1 : 1;\n newYear = prependStringWithPlaceHolders(`${newYearInteger}`, 4);\n }\n const isAutomaticFillTrigger = newYear !== year && ['Tab', ' '].includes(key);\n const metainfo = { isAutomaticFillTrigger };\n\n /* ************* new year apply logic ************* */\n // tab/spacebar applies auto-fill\n // arrows up/down applies increment/decrement\n if (key === 'ArrowUp' || key === 'ArrowDown' || isAutomaticFillTrigger) {\n handleChangeYear(newYear, e, metainfo);\n }\n\n /* ************* focus tracking logic ************* */\n let trackNextFocus = trackFocusResetter; // if nothing after, we reset internal focus tracker to avoid re-render unexpected focus shift\n if (!hideTime) trackNextFocus = trackFocusHourInput;\n else if (withClearBtn) trackNextFocus = trackFocusClearBtn;\n else if (withAnyPicker) trackNextFocus = trackFocusPicker;\n\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n\n /* ************** auto-advance logic ************** */\n if (key === ' ') {\n // auto-advance functionality:\n trackNextFocus();\n }\n /* ********** regressive backspace logic ********** */\n if (key === 'Backspace' && year?.length === 0) {\n trackFocusDayInput();\n }\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n },\n [\n year,\n trackFocusResetter,\n hideTime,\n trackFocusHourInput,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n trackFocusDayInput,\n handleChangeYear,\n ],\n );\n const onYearBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(() => {\n // this was used before, now that we have a wrapping onBlur resetting the focus tracker, this is unused;\n }, []);\n\n return useMemo(\n () => ({\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n }),\n [\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n ],\n );\n};\n"],
5
+ "mappings": "AAAA,Y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AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import React2, { useContext } from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useContext } from "react";
3
4
  import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePickerCTX";
4
5
  import { CalendarIconTrigger } from "./CalendarIconTrigger";
5
6
  import { CalendarWrapper } from "./CalendarWrapper";
@@ -7,18 +8,29 @@ import { CalendarContext } from "./CalendarContext";
7
8
  import { useConfigCalendarCTX } from "./useConfigCalendarCTX";
8
9
  const WrappedCalendarContext = ({ children }) => {
9
10
  const ctx = useConfigCalendarCTX();
10
- return /* @__PURE__ */ React2.createElement(CalendarContext.Provider, {
11
- value: ctx
12
- }, children);
11
+ return /* @__PURE__ */ jsx(CalendarContext.Provider, {
12
+ value: ctx,
13
+ children
14
+ });
13
15
  };
14
16
  const CalendarContent = () => {
15
17
  const { showCalendar, handleMenuWrapperKeyDown } = useContext(CalendarContext);
16
18
  const { isControllerOnly } = useContext(ControlledDateTimePickerContext);
17
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isControllerOnly ? null : /* @__PURE__ */ React2.createElement(CalendarIconTrigger, null), isControllerOnly || showCalendar ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", {
18
- onKeyDown: handleMenuWrapperKeyDown
19
- }, /* @__PURE__ */ React2.createElement(CalendarWrapper, null))) : null);
19
+ return /* @__PURE__ */ jsxs(Fragment, {
20
+ children: [
21
+ isControllerOnly ? null : /* @__PURE__ */ jsx(CalendarIconTrigger, {}),
22
+ isControllerOnly || showCalendar ? /* @__PURE__ */ jsx(Fragment, {
23
+ children: /* @__PURE__ */ jsx("div", {
24
+ onKeyDown: handleMenuWrapperKeyDown,
25
+ children: /* @__PURE__ */ jsx(CalendarWrapper, {})
26
+ })
27
+ }) : null
28
+ ]
29
+ });
20
30
  };
21
- const Calendar = () => /* @__PURE__ */ React2.createElement(WrappedCalendarContext, null, /* @__PURE__ */ React2.createElement(CalendarContent, null));
31
+ const Calendar = () => /* @__PURE__ */ jsx(WrappedCalendarContext, {
32
+ children: /* @__PURE__ */ jsx(CalendarContent, {})
33
+ });
22
34
  export {
23
35
  Calendar,
24
36
  WrappedCalendarContext
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/Calendar.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { CalendarIconTrigger } from './CalendarIconTrigger';\nimport { CalendarWrapper } from './CalendarWrapper';\n\nimport { CalendarContext } from './CalendarContext';\nimport { useConfigCalendarCTX } from './useConfigCalendarCTX';\n\nexport const WrappedCalendarContext = ({ children }: { children: JSX.Element }) => {\n const ctx = useConfigCalendarCTX();\n return <CalendarContext.Provider value={ctx}>{children}</CalendarContext.Provider>;\n};\n\nconst CalendarContent = () => {\n const { showCalendar, handleMenuWrapperKeyDown } = useContext(CalendarContext);\n const { isControllerOnly } = useContext(ControlledDateTimePickerContext);\n return (\n <>\n {isControllerOnly ? null : <CalendarIconTrigger />}\n {isControllerOnly || showCalendar ? (\n <>\n {/* The <div> element is catching the \"ESC\" key to close the calendar, there is no valid aria role for this */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div onKeyDown={handleMenuWrapperKeyDown}>\n <CalendarWrapper />\n </div>\n </>\n ) : null}\n </>\n );\n};\n\n// we wrap in context in a separate statement so we can use the useContext and be sure it's correctly initialized\nexport const Calendar = () => (\n <WrappedCalendarContext>\n <CalendarContent />\n </WrappedCalendarContext>\n);\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AAEO,MAAM,yBAAyB,CAAC,EAAE,eAA0C;AACjF,QAAM,MAAM,qBAAqB;AACjC,SAAO,qCAAC,gBAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,KAAM,QAAS;AACzD;AAEA,MAAM,kBAAkB,MAAM;AAC5B,QAAM,EAAE,cAAc,6BAA6B,WAAW,eAAe;AAC7E,QAAM,EAAE,qBAAqB,WAAW,+BAA+B;AACvE,SACE,4DACG,mBAAmB,OAAO,qCAAC,yBAAoB,GAC/C,oBAAoB,eACnB,4DAIE,qCAAC;AAAA,IAAI,WAAW;AAAA,KACd,qCAAC,qBAAgB,CACnB,CACF,IACE,IACN;AAEJ;AAGO,MAAM,WAAW,MACtB,qCAAC,8BACC,qCAAC,qBAAgB,CACnB;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,kBAAkB;AAClC,SAAS,uCAAuC;AAChD,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AAE9B,MAAM,yBAAyB,CAAC,EAAE,SAAS,MAAiC;AACjF,QAAM,MAAM,qBAAqB;AACjC,SAAO,oBAAC,gBAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,IAAM;AAAA,GAAS;AACzD;AAEA,MAAM,kBAAkB,MAAM;AAC5B,QAAM,EAAE,cAAc,yBAAyB,IAAI,WAAW,eAAe;AAC7E,QAAM,EAAE,iBAAiB,IAAI,WAAW,+BAA+B;AACvE,SACE;AAAA,IACG;AAAA,yBAAmB,OAAO,oBAAC,uBAAoB;AAAA,MAC/C,oBAAoB,eACnB;AAAA,QAIE,8BAAC;AAAA,UAAI,WAAW;AAAA,UACd,8BAAC,mBAAgB;AAAA,SACnB;AAAA,OACF,IACE;AAAA;AAAA,GACN;AAEJ;AAGO,MAAM,WAAW,MACtB,oBAAC;AAAA,EACC,8BAAC,mBAAgB;AAAA,CACnB;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,20 @@
1
1
  import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import React2 from "react";
3
4
  import { CalendarMonthDays } from "./CalendarMonthDays";
4
5
  import { CalendarWeekDays } from "./CalendarWeekDays";
5
6
  import { StyledBody } from "./Styleds";
6
- const CalendarBody = React2.memo(({ weekRowsNum }) => /* @__PURE__ */ React2.createElement("span", {
7
+ const CalendarBody = React2.memo(({ weekRowsNum }) => /* @__PURE__ */ jsxs("span", {
7
8
  role: "grid",
8
9
  "aria-colcount": 7,
9
- "aria-rowcount": weekRowsNum
10
- }, /* @__PURE__ */ React2.createElement(CalendarWeekDays, null), /* @__PURE__ */ React2.createElement(StyledBody, null, /* @__PURE__ */ React2.createElement(CalendarMonthDays, null))));
10
+ "aria-rowcount": weekRowsNum,
11
+ children: [
12
+ /* @__PURE__ */ jsx(CalendarWeekDays, {}),
13
+ /* @__PURE__ */ jsx(StyledBody, {
14
+ children: /* @__PURE__ */ jsx(CalendarMonthDays, {})
15
+ })
16
+ ]
17
+ }));
11
18
  export {
12
19
  CalendarBody
13
20
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarBody.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { CalendarMonthDays } from './CalendarMonthDays';\nimport { CalendarWeekDays } from './CalendarWeekDays';\nimport { StyledBody } from './Styleds';\ninterface CalendarBodyPropsT {\n weekRowsNum: number;\n}\nexport const CalendarBody = React.memo(({ weekRowsNum }: CalendarBodyPropsT) => (\n <span role=\"grid\" aria-colcount={7} aria-rowcount={weekRowsNum}>\n <CalendarWeekDays />\n <StyledBody>\n <CalendarMonthDays />\n </StyledBody>\n </span>\n));\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAIO,MAAM,eAAe,OAAM,KAAK,CAAC,EAAE,kBACxC,qCAAC;AAAA,EAAK,MAAK;AAAA,EAAO,iBAAe;AAAA,EAAG,iBAAe;AAAA,GACjD,qCAAC,sBAAiB,GAClB,qCAAC,kBACC,qCAAC,uBAAkB,CACrB,CACF,CACD;",
6
- "names": []
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,OAAOA,YAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAIpB,MAAM,eAAeA,OAAM,KAAK,CAAC,EAAE,YAAY,MACpD,qBAAC;AAAA,EAAK,MAAK;AAAA,EAAO,iBAAe;AAAA,EAAG,iBAAe;AAAA,EACjD;AAAA,wBAAC,oBAAiB;AAAA,IAClB,oBAAC;AAAA,MACC,8BAAC,qBAAkB;AAAA,KACrB;AAAA;AAAA,CACF,CACD;",
6
+ "names": ["React"]
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import React2, { useContext } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useContext } from "react";
3
4
  import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid";
4
5
  import { CalendarBody } from "./CalendarBody";
5
6
  import { CalendarHead } from "./CalendarHead";
@@ -8,12 +9,19 @@ import { CalendarContext } from "./CalendarContext";
8
9
  import { StyledShadowWrapper, StyledCalendarWrapper } from "./Styleds";
9
10
  const CalendarContent = ({ className = "" }) => {
10
11
  const { daysMatrixByWeekday } = useContext(CalendarContext);
11
- return /* @__PURE__ */ React2.createElement(StyledShadowWrapper, {
12
+ return /* @__PURE__ */ jsx(StyledShadowWrapper, {
12
13
  className,
13
- "data-testid": ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR
14
- }, /* @__PURE__ */ React2.createElement(StyledCalendarWrapper, null, /* @__PURE__ */ React2.createElement(CalendarHead, null), /* @__PURE__ */ React2.createElement(CalendarBody, {
15
- weekRowsNum: daysMatrixByWeekday.length
16
- }), /* @__PURE__ */ React2.createElement(CalendarFooter, null)));
14
+ "data-testid": ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR,
15
+ children: /* @__PURE__ */ jsxs(StyledCalendarWrapper, {
16
+ children: [
17
+ /* @__PURE__ */ jsx(CalendarHead, {}),
18
+ /* @__PURE__ */ jsx(CalendarBody, {
19
+ weekRowsNum: daysMatrixByWeekday.length
20
+ }),
21
+ /* @__PURE__ */ jsx(CalendarFooter, {})
22
+ ]
23
+ })
24
+ });
17
25
  };
18
26
  export {
19
27
  CalendarContent
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarContent.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { CalendarBody } from './CalendarBody';\nimport { CalendarHead } from './CalendarHead';\nimport { CalendarFooter } from './CalendarFooter';\nimport { CalendarContext } from './CalendarContext';\nimport { StyledShadowWrapper, StyledCalendarWrapper } from './Styleds';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const { daysMatrixByWeekday } = useContext(CalendarContext);\n\n return (\n <StyledShadowWrapper\n className={className}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR}\n >\n <StyledCalendarWrapper>\n <CalendarHead />\n <CalendarBody weekRowsNum={daysMatrixByWeekday.length} />\n <CalendarFooter />\n </StyledCalendarWrapper>\n </StyledShadowWrapper>\n );\n};\n"],
5
- "mappings": "AAAA;ACCA;AACA;AAEA;AACA;AACA;AACA;AACA;AAMO,MAAM,kBAAkB,CAAC,EAAE,YAAY,SAA8C;AAC1F,QAAM,EAAE,wBAAwB,WAAW,eAAe;AAE1D,SACE,qCAAC;AAAA,IACC;AAAA,IACA,eAAa,mCAAmC,qBAAqB;AAAA,KAErE,qCAAC,6BACC,qCAAC,kBAAa,GACd,qCAAC;AAAA,IAAa,aAAa,oBAAoB;AAAA,GAAQ,GACvD,qCAAC,oBAAe,CAClB,CACF;AAEJ;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,kBAAkB;AAClC,SAAS,0CAA0C;AAEnD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB,6BAA6B;AAMpD,MAAM,kBAAkB,CAAC,EAAE,YAAY,GAAG,MAA2C;AAC1F,QAAM,EAAE,oBAAoB,IAAI,WAAW,eAAe;AAE1D,SACE,oBAAC;AAAA,IACC;AAAA,IACA,eAAa,mCAAmC,qBAAqB;AAAA,IAErE,+BAAC;AAAA,MACC;AAAA,4BAAC,gBAAa;AAAA,QACd,oBAAC;AAAA,UAAa,aAAa,oBAAoB;AAAA,SAAQ;AAAA,QACvD,oBAAC,kBAAe;AAAA;AAAA,KAClB;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { CalendarContextT } from './useConfigCalendarCTX';\n\nexport const defaultCalendarContext = {} as CalendarContextT;\n\n/** Context for cross component communication */\nexport const CalendarContext = createContext<CalendarContextT>(defaultCalendarContext);\n\nexport default CalendarContext;\n"],
5
- "mappings": "AAAA;ACAA;AAGO,MAAM,yBAAyB,CAAC;AAGhC,MAAM,kBAAkB,cAAgC,sBAAsB;AAErF,IAAO,0BAAQ;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAGvB,MAAM,yBAAyB,CAAC;AAGhC,MAAM,kBAAkB,cAAgC,sBAAsB;AAErF,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,33 +1,38 @@
1
1
  import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import React2 from "react";
3
4
  import { Day } from "./Day";
4
5
  import { StyledWeekDaysListWrapper } from "./Styleds";
5
- const CalendarDaysList = React2.memo(({ invisibleFirstDay, daysMatrixByWeekday, invisibleLastDay, innerRef }) => /* @__PURE__ */ React2.createElement("div", {
6
- ref: innerRef,
7
- role: "rowgroup"
8
- }, invisibleFirstDay ? /* @__PURE__ */ React2.createElement(Day, {
9
- key: `ds-calendar-${invisibleFirstDay.day.toString()}`,
10
- metaDay: invisibleFirstDay,
11
- isInvisible: true
12
- }) : null, daysMatrixByWeekday.map((week, i) => /* @__PURE__ */ React2.createElement(StyledWeekDaysListWrapper, {
13
- key: `ds-calendar-week-${week[0].day.toString()}-${week[6].day.toString()}`,
14
- role: "row",
15
- "aria-rowindex": i + 1,
16
- cols: ["32px", "32px", "32px", "32px", "32px", "32px", "32px"],
17
- rows: ["28px"],
18
- py: "xxxs",
19
- px: "2px",
20
- justifyContent: "space-between",
21
- alignItems: "center"
22
- }, week.map((metaDay, z) => /* @__PURE__ */ React2.createElement(Day, {
23
- key: `ds-calendar-${metaDay.day.toString()}`,
24
- metaDay,
25
- colIndex: z + 1
26
- })))), invisibleLastDay ? /* @__PURE__ */ React2.createElement(Day, {
27
- key: `ds-calendar-${invisibleLastDay.day.toString()}`,
28
- metaDay: invisibleLastDay,
29
- isInvisible: true
30
- }) : null));
6
+ const CalendarDaysList = React2.memo(
7
+ ({ invisibleFirstDay, daysMatrixByWeekday, invisibleLastDay, innerRef }) => /* @__PURE__ */ jsxs("div", {
8
+ ref: innerRef,
9
+ role: "rowgroup",
10
+ children: [
11
+ invisibleFirstDay ? /* @__PURE__ */ jsx(Day, {
12
+ metaDay: invisibleFirstDay,
13
+ isInvisible: true
14
+ }, `ds-calendar-${invisibleFirstDay.day.toString()}`) : null,
15
+ daysMatrixByWeekday.map((week, i) => /* @__PURE__ */ jsx(StyledWeekDaysListWrapper, {
16
+ role: "row",
17
+ "aria-rowindex": i + 1,
18
+ cols: ["32px", "32px", "32px", "32px", "32px", "32px", "32px"],
19
+ rows: ["28px"],
20
+ py: "xxxs",
21
+ px: "2px",
22
+ justifyContent: "space-between",
23
+ alignItems: "center",
24
+ children: week.map((metaDay, z) => /* @__PURE__ */ jsx(Day, {
25
+ metaDay,
26
+ colIndex: z + 1
27
+ }, `ds-calendar-${metaDay.day.toString()}`))
28
+ }, `ds-calendar-week-${week[0].day.toString()}-${week[6].day.toString()}`)),
29
+ invisibleLastDay ? /* @__PURE__ */ jsx(Day, {
30
+ metaDay: invisibleLastDay,
31
+ isInvisible: true
32
+ }, `ds-calendar-${invisibleLastDay.day.toString()}`) : null
33
+ ]
34
+ })
35
+ );
31
36
  export {
32
37
  CalendarDaysList
33
38
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarDaysList.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Day } from './Day';\nimport { StyledWeekDaysListWrapper } from './Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes';\n\nexport const CalendarDaysList = React.memo(\n ({ invisibleFirstDay, daysMatrixByWeekday, invisibleLastDay, innerRef }: CalendarDaysListPropsT): JSX.Element => (\n <div ref={innerRef} role=\"rowgroup\">\n {invisibleFirstDay ? (\n <Day key={`ds-calendar-${invisibleFirstDay.day.toString()}`} metaDay={invisibleFirstDay} isInvisible />\n ) : null}\n {daysMatrixByWeekday.map((week, i) => (\n <StyledWeekDaysListWrapper\n key={`ds-calendar-week-${week[0].day.toString()}-${week[6].day.toString()}`}\n role=\"row\"\n aria-rowindex={i + 1}\n cols={['32px', '32px', '32px', '32px', '32px', '32px', '32px']}\n rows={['28px']}\n py=\"xxxs\"\n px=\"2px\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n {week.map((metaDay, z) => (\n <Day key={`ds-calendar-${metaDay.day.toString()}`} metaDay={metaDay} colIndex={z + 1} />\n ))}\n </StyledWeekDaysListWrapper>\n ))}\n {invisibleLastDay ? (\n <Day key={`ds-calendar-${invisibleLastDay.day.toString()}`} metaDay={invisibleLastDay} isInvisible />\n ) : null}\n </div>\n ),\n);\nexport interface CalendarDaysListPropsT {\n invisibleFirstDay?: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n daysMatrixByWeekday: DSControlledDateTimePickerInternalsT.MetaMonthDay[][];\n invisibleLastDay?: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n innerRef: React.RefObject<HTMLDivElement>;\n}\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AAGO,MAAM,mBAAmB,OAAM,KACpC,CAAC,EAAE,mBAAmB,qBAAqB,kBAAkB,eAC3D,qCAAC;AAAA,EAAI,KAAK;AAAA,EAAU,MAA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AAC,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAAA,QAC7D,MAAM,CAAC,MAAM;AAAA,QACb,IAAG;AAAA,QACH,IAAG;AAAA,QACH,gBAAe;AAAA,QACf,YAAW;AAAA,QAEV,eAAK,IAAI,CAAC,SAAS,MAClB,oBAAC;AAAA,UAAkD;AAAA,UAAkB,UAAU,IAAI;AAAA,WAAzE,eAAe,QAAQ,IAAI,SAAS,GAAwC,CACvF;AAAA,SAZI,oBAAoB,KAAK,GAAG,IAAI,SAAS,KAAK,KAAK,GAAG,IAAI,SAAS,GAa1E,CACD;AAAA,MACA,mBACC,oBAAC;AAAA,QAA2D,SAAS;AAAA,QAAkB,aAAW;AAAA,SAAxF,eAAe,iBAAiB,IAAI,SAAS,GAA4C,IACjG;AAAA;AAAA,GACN;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import React2, { useContext } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useContext } from "react";
3
4
  import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid";
4
5
  import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePickerCTX";
5
6
  import { CalendarFooterMessage } from "./Styleds";
@@ -9,10 +10,11 @@ const CalendarFooter = () => {
9
10
  isWithTimeWheelToo
10
11
  } = useContext(ControlledDateTimePickerContext);
11
12
  if (pickerFooterMsg !== void 0 && !isWithTimeWheelToo && hasError)
12
- return /* @__PURE__ */ React2.createElement(CalendarFooterMessage, {
13
+ return /* @__PURE__ */ jsx(CalendarFooterMessage, {
13
14
  role: "alert",
14
- "data-testid": ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR
15
- }, pickerFooterMsg);
15
+ "data-testid": ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR,
16
+ children: pickerFooterMsg
17
+ });
16
18
  return null;
17
19
  };
18
20
  export {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarFooter.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { CalendarFooterMessage } from './Styleds';\n\nexport const CalendarFooter: React.ComponentType = () => {\n const {\n props: { pickerFooterMsg, hasError },\n isWithTimeWheelToo,\n } = useContext(ControlledDateTimePickerContext);\n if (pickerFooterMsg !== undefined && !isWithTimeWheelToo && hasError)\n return (\n <CalendarFooterMessage role=\"alert\" data-testid={ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR}>\n {pickerFooterMsg}\n </CalendarFooterMessage>\n );\n return null;\n};\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEO,MAAM,iBAAsC,MAAM;AACvD,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB;AAAA,IAC1B;AAAA,MACE,WAAW,+BAA+B;AAC9C,MAAI,oBAAoB,UAAa,CAAC,sBAAsB;AAC1D,WACE,qCAAC;AAAA,MAAsB,MAAK;AAAA,MAAQ,eAAa,mCAAmC,QAAQ;AAAA,OACzF,eACH;AAEJ,SAAO;AACT;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,kBAAkB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,6BAA6B;AAE/B,MAAM,iBAAsC,MAAM;AACvD,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,SAAS;AAAA,IACnC;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,MAAI,oBAAoB,UAAa,CAAC,sBAAsB;AAC1D,WACE,oBAAC;AAAA,MAAsB,MAAK;AAAA,MAAQ,eAAa,mCAAmC,QAAQ;AAAA,MACzF;AAAA,KACH;AAEJ,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import React2, { useCallback, useContext, useMemo } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useContext, useMemo } from "react";
3
4
  import { BUTTON_SIZES } from "@elliemae/ds-button";
4
5
  import { ChevronDoubleLeft, ChevronLeft, ChevronDoubleRight, ChevronRight } from "@elliemae/ds-icons";
5
6
  import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid";
@@ -38,87 +39,112 @@ const CalendarHead = () => {
38
39
  latestInteractionRegion,
39
40
  currFocusDescriber
40
41
  } = useContext(ControlledDateTimePickerContext);
41
- const handlePrevYearRef = useCallback((ButtonDomNode) => {
42
- prevYearBtnRef.current = ButtonDomNode;
43
- if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-year")
44
- ButtonDomNode?.focus?.();
45
- }, [currFocusDescriber, latestInteractionRegion, prevYearBtnRef]);
46
- const handlePrevMonthRef = useCallback((ButtonDomNode) => {
47
- prevMonthBtnRef.current = ButtonDomNode;
48
- if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-month")
49
- ButtonDomNode?.focus?.();
50
- }, [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef]);
51
- const handleNextMonthRef = useCallback((ButtonDomNode) => {
52
- nextMonthBtnRef.current = ButtonDomNode;
53
- if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-next-month")
54
- ButtonDomNode?.focus?.();
55
- }, [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef]);
56
- const handleNextYearRef = useCallback((ButtonDomNode) => {
57
- nextYearBtnRef.current = ButtonDomNode;
58
- if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-next-year")
59
- ButtonDomNode?.focus?.();
60
- }, [currFocusDescriber, latestInteractionRegion, nextYearBtnRef]);
61
- return /* @__PURE__ */ React2.createElement(StyledHeader, null, /* @__PURE__ */ React2.createElement(StyledHeaderButton, {
62
- "aria-label": "previous year",
63
- buttonType: "raw",
64
- size: BUTTON_SIZES.M,
65
- onClick: handlePrevYear,
66
- innerRef: handlePrevYearRef,
67
- onKeyDown: handlePrevYearKeyDown,
68
- onFocus: onPrevYearFocus,
69
- tabIndex: isControllerOnly ? -1 : 0,
70
- "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR,
71
- type: "button"
72
- }, /* @__PURE__ */ React2.createElement(ChevronDoubleLeft, {
73
- height: 14,
74
- width: 14,
75
- fill: "#25292f"
76
- })), /* @__PURE__ */ React2.createElement(StyledHeaderButton, {
77
- autoFocus: autoFocusPrevMonthArrow,
78
- "aria-label": "previous month",
79
- buttonType: "raw",
80
- size: BUTTON_SIZES.M,
81
- onClick: handlePrevMonth,
82
- innerRef: handlePrevMonthRef,
83
- onKeyDown: handlePrevMonthKeyDown,
84
- onFocus: onPrevMonthFocus,
85
- "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH,
86
- type: "button"
87
- }, /* @__PURE__ */ React2.createElement(ChevronLeft, {
88
- height: 14,
89
- width: 14,
90
- fill: "#25292f"
91
- })), /* @__PURE__ */ React2.createElement(StyledHeaderLabel, {
92
- "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL
93
- }, currentFormatedDate), /* @__PURE__ */ React2.createElement(StyledHeaderButton, {
94
- "aria-label": "next month",
95
- buttonType: "raw",
96
- size: BUTTON_SIZES.M,
97
- onClick: handleNextMonth,
98
- innerRef: handleNextMonthRef,
99
- onKeyDown: handleNextMonthKeyDown,
100
- onFocus: onNextMonthFocus,
101
- "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH,
102
- type: "button"
103
- }, /* @__PURE__ */ React2.createElement(ChevronRight, {
104
- height: 14,
105
- width: 14,
106
- fill: "#25292f"
107
- })), /* @__PURE__ */ React2.createElement(StyledHeaderButton, {
108
- "aria-label": "next year",
109
- buttonType: "raw",
110
- size: BUTTON_SIZES.M,
111
- onClick: handleNextYear,
112
- innerRef: handleNextYearRef,
113
- onKeyDown: handleNextYearKeyDown,
114
- onFocus: onNextYearFocus,
115
- "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR,
116
- type: "button"
117
- }, /* @__PURE__ */ React2.createElement(ChevronDoubleRight, {
118
- height: 14,
119
- width: 14,
120
- fill: "#25292f"
121
- })));
42
+ const handlePrevYearRef = useCallback(
43
+ (ButtonDomNode) => {
44
+ prevYearBtnRef.current = ButtonDomNode;
45
+ if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-year")
46
+ ButtonDomNode?.focus?.();
47
+ },
48
+ [currFocusDescriber, latestInteractionRegion, prevYearBtnRef]
49
+ );
50
+ const handlePrevMonthRef = useCallback(
51
+ (ButtonDomNode) => {
52
+ prevMonthBtnRef.current = ButtonDomNode;
53
+ if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-month")
54
+ ButtonDomNode?.focus?.();
55
+ },
56
+ [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef]
57
+ );
58
+ const handleNextMonthRef = useCallback(
59
+ (ButtonDomNode) => {
60
+ nextMonthBtnRef.current = ButtonDomNode;
61
+ if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-next-month")
62
+ ButtonDomNode?.focus?.();
63
+ },
64
+ [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef]
65
+ );
66
+ const handleNextYearRef = useCallback(
67
+ (ButtonDomNode) => {
68
+ nextYearBtnRef.current = ButtonDomNode;
69
+ if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-next-year")
70
+ ButtonDomNode?.focus?.();
71
+ },
72
+ [currFocusDescriber, latestInteractionRegion, nextYearBtnRef]
73
+ );
74
+ return /* @__PURE__ */ jsxs(StyledHeader, {
75
+ children: [
76
+ /* @__PURE__ */ jsx(StyledHeaderButton, {
77
+ "aria-label": "previous year",
78
+ buttonType: "raw",
79
+ size: BUTTON_SIZES.M,
80
+ onClick: handlePrevYear,
81
+ innerRef: handlePrevYearRef,
82
+ onKeyDown: handlePrevYearKeyDown,
83
+ onFocus: onPrevYearFocus,
84
+ tabIndex: isControllerOnly ? -1 : 0,
85
+ "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR,
86
+ type: "button",
87
+ children: /* @__PURE__ */ jsx(ChevronDoubleLeft, {
88
+ height: 14,
89
+ width: 14,
90
+ fill: "#25292f"
91
+ })
92
+ }),
93
+ /* @__PURE__ */ jsx(StyledHeaderButton, {
94
+ autoFocus: autoFocusPrevMonthArrow,
95
+ "aria-label": "previous month",
96
+ buttonType: "raw",
97
+ size: BUTTON_SIZES.M,
98
+ onClick: handlePrevMonth,
99
+ innerRef: handlePrevMonthRef,
100
+ onKeyDown: handlePrevMonthKeyDown,
101
+ onFocus: onPrevMonthFocus,
102
+ "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH,
103
+ type: "button",
104
+ children: /* @__PURE__ */ jsx(ChevronLeft, {
105
+ height: 14,
106
+ width: 14,
107
+ fill: "#25292f"
108
+ })
109
+ }),
110
+ /* @__PURE__ */ jsx(StyledHeaderLabel, {
111
+ "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL,
112
+ children: currentFormatedDate
113
+ }),
114
+ /* @__PURE__ */ jsx(StyledHeaderButton, {
115
+ "aria-label": "next month",
116
+ buttonType: "raw",
117
+ size: BUTTON_SIZES.M,
118
+ onClick: handleNextMonth,
119
+ innerRef: handleNextMonthRef,
120
+ onKeyDown: handleNextMonthKeyDown,
121
+ onFocus: onNextMonthFocus,
122
+ "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH,
123
+ type: "button",
124
+ children: /* @__PURE__ */ jsx(ChevronRight, {
125
+ height: 14,
126
+ width: 14,
127
+ fill: "#25292f"
128
+ })
129
+ }),
130
+ /* @__PURE__ */ jsx(StyledHeaderButton, {
131
+ "aria-label": "next year",
132
+ buttonType: "raw",
133
+ size: BUTTON_SIZES.M,
134
+ onClick: handleNextYear,
135
+ innerRef: handleNextYearRef,
136
+ onKeyDown: handleNextYearKeyDown,
137
+ onFocus: onNextYearFocus,
138
+ "data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR,
139
+ type: "button",
140
+ children: /* @__PURE__ */ jsx(ChevronDoubleRight, {
141
+ height: 14,
142
+ width: 14,
143
+ fill: "#25292f"
144
+ })
145
+ })
146
+ ]
147
+ });
122
148
  };
123
149
  export {
124
150
  CalendarHead