@elliemae/ds-form-date-time-picker 3.16.0-next.2 → 3.16.0-next.21

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 (424) hide show
  1. package/dist/cjs/ControlledDateTimePicker.js +11 -7
  2. package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
  3. package/dist/cjs/ControlledDateTimePickerCTX.js +4 -0
  4. package/dist/cjs/ControlledDateTimePickerCTX.js.map +2 -2
  5. package/dist/cjs/ControlledDateTimePickerDatatestid.js +4 -0
  6. package/dist/cjs/ControlledDateTimePickerDatatestid.js.map +1 -1
  7. package/dist/cjs/ControlledDateTimePickerTypes.js +4 -0
  8. package/dist/cjs/ControlledDateTimePickerTypes.js.map +1 -1
  9. package/dist/cjs/config/useChangeHandlers.js +9 -4
  10. package/dist/cjs/config/useChangeHandlers.js.map +2 -2
  11. package/dist/cjs/config/useControlledDateTimePicker.js +18 -13
  12. package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
  13. package/dist/cjs/config/useFocusTracker.js +4 -0
  14. package/dist/cjs/config/useFocusTracker.js.map +2 -2
  15. package/dist/cjs/config/useGetDestructuredValues.js +11 -4
  16. package/dist/cjs/config/useGetDestructuredValues.js.map +2 -2
  17. package/dist/cjs/config/useGetFlags.js +12 -8
  18. package/dist/cjs/config/useGetFlags.js.map +2 -2
  19. package/dist/cjs/config/useGetPropsBasedOnType.js +6 -2
  20. package/dist/cjs/config/useGetPropsBasedOnType.js.map +2 -2
  21. package/dist/cjs/config/useGetPropsWithDefault.js +7 -3
  22. package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
  23. package/dist/cjs/config/useGetReferences.js +4 -0
  24. package/dist/cjs/config/useGetReferences.js.map +2 -2
  25. package/dist/cjs/config/useGlobalKeyHandlers.js +8 -4
  26. package/dist/cjs/config/useGlobalKeyHandlers.js.map +2 -2
  27. package/dist/cjs/config/useRelevantValueFromProps.js +6 -2
  28. package/dist/cjs/config/useRelevantValueFromProps.js.map +2 -2
  29. package/dist/cjs/config/useValidateProps.js +7 -3
  30. package/dist/cjs/config/useValidateProps.js.map +2 -2
  31. package/dist/cjs/exported-related/theming.js +4 -0
  32. package/dist/cjs/exported-related/theming.js.map +1 -1
  33. package/dist/cjs/index.js +13 -9
  34. package/dist/cjs/index.js.map +2 -2
  35. package/dist/cjs/package.json +7 -0
  36. package/dist/cjs/parts/ClearButton/ClearButton.js +16 -6
  37. package/dist/cjs/parts/ClearButton/ClearButton.js.map +3 -3
  38. package/dist/cjs/parts/ClearButton/useClearButton.js +5 -1
  39. package/dist/cjs/parts/ClearButton/useClearButton.js.map +2 -2
  40. package/dist/cjs/parts/ControlledDateTimePickerContent.js +19 -8
  41. package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +3 -3
  42. package/dist/cjs/parts/DateInputs/DDInput.js +10 -4
  43. package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
  44. package/dist/cjs/parts/DateInputs/DateInputs.js +34 -12
  45. package/dist/cjs/parts/DateInputs/DateInputs.js.map +3 -3
  46. package/dist/cjs/parts/DateInputs/MMInput.js +10 -4
  47. package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
  48. package/dist/cjs/parts/DateInputs/YYYYInput.js +10 -4
  49. package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
  50. package/dist/cjs/parts/DateInputs/useDateInputs.js +9 -5
  51. package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
  52. package/dist/cjs/parts/Pickers/Calendar/Calendar.js +9 -5
  53. package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +2 -2
  54. package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +7 -3
  55. package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
  56. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +19 -7
  57. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
  58. package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js +4 -0
  59. package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js.map +2 -2
  60. package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js +6 -2
  61. package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
  62. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +23 -5
  63. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
  64. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +44 -7
  65. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
  66. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +24 -6
  67. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
  68. package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js +7 -3
  69. package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
  70. package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +5 -1
  71. package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
  72. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +16 -6
  73. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
  74. package/dist/cjs/parts/Pickers/Calendar/Day.js +15 -7
  75. package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
  76. package/dist/cjs/parts/Pickers/Calendar/Styleds.js +5 -1
  77. package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
  78. package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js +9 -5
  79. package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +2 -2
  80. package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +6 -2
  81. package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
  82. package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +6 -2
  83. package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
  84. package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +7 -2
  85. package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
  86. package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +5 -1
  87. package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
  88. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +10 -6
  89. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +2 -2
  90. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +17 -7
  91. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
  92. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +4 -0
  93. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +2 -2
  94. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +15 -4
  95. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
  96. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +17 -4
  97. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
  98. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +16 -4
  99. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
  100. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +6 -2
  101. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
  102. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +8 -4
  103. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
  104. package/dist/cjs/parts/Pickers/PickersIcons.js +9 -5
  105. package/dist/cjs/parts/Pickers/PickersIcons.js.map +2 -2
  106. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +32 -7
  107. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
  108. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +32 -6
  109. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
  110. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +32 -7
  111. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
  112. package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +5 -1
  113. package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
  114. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js +9 -5
  115. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js.map +2 -2
  116. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +30 -9
  117. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  118. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js +4 -0
  119. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js.map +2 -2
  120. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +23 -5
  121. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
  122. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +24 -6
  123. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
  124. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +16 -6
  125. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
  126. package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +7 -3
  127. package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +2 -2
  128. package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +8 -4
  129. package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +2 -2
  130. package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js +5 -1
  131. package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +2 -2
  132. package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +5 -1
  133. package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
  134. package/dist/cjs/parts/Styleds.js +5 -1
  135. package/dist/cjs/parts/Styleds.js.map +2 -2
  136. package/dist/cjs/parts/TimeInputs/HHInput.js +10 -4
  137. package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
  138. package/dist/cjs/parts/TimeInputs/MeridiemInput.js +10 -4
  139. package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
  140. package/dist/cjs/parts/TimeInputs/MinutesInput.js +10 -4
  141. package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
  142. package/dist/cjs/parts/TimeInputs/TimeInputs.js +34 -12
  143. package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +3 -3
  144. package/dist/cjs/parts/TimeInputs/useTimeInputs.js +6 -2
  145. package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +2 -2
  146. package/dist/cjs/parts/config.js +4 -0
  147. package/dist/cjs/parts/config.js.map +1 -1
  148. package/dist/cjs/propTypes.js +32 -26
  149. package/dist/cjs/propTypes.js.map +2 -2
  150. package/dist/cjs/sharedTypes.js +4 -0
  151. package/dist/cjs/sharedTypes.js.map +2 -2
  152. package/dist/cjs/tests/custom-props/customProps.js +237 -0
  153. package/dist/cjs/tests/custom-props/customProps.js.map +7 -0
  154. package/dist/cjs/utils/constants.js +4 -0
  155. package/dist/cjs/utils/constants.js.map +1 -1
  156. package/dist/cjs/utils/dateHelpers.js +7 -3
  157. package/dist/cjs/utils/dateHelpers.js.map +2 -2
  158. package/dist/cjs/utils/dateTimeHelpers.js +6 -2
  159. package/dist/cjs/utils/dateTimeHelpers.js.map +2 -2
  160. package/dist/cjs/utils/hooks/useGetDayFromDateString.js +6 -2
  161. package/dist/cjs/utils/hooks/useGetDayFromDateString.js.map +2 -2
  162. package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +6 -2
  163. package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +2 -2
  164. package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js +9 -5
  165. package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js.map +2 -2
  166. package/dist/cjs/utils/hooks/useOnClickOutside.js +4 -0
  167. package/dist/cjs/utils/hooks/useOnClickOutside.js.map +1 -1
  168. package/dist/cjs/utils/numberHelpers.js +4 -0
  169. package/dist/cjs/utils/numberHelpers.js.map +1 -1
  170. package/dist/cjs/utils/stringHelpers.js +9 -2
  171. package/dist/cjs/utils/stringHelpers.js.map +2 -2
  172. package/dist/cjs/utils/timeHelpers.js +5 -1
  173. package/dist/cjs/utils/timeHelpers.js.map +2 -2
  174. package/dist/cjs/utils/typeGuards.js +4 -0
  175. package/dist/cjs/utils/typeGuards.js.map +2 -2
  176. package/dist/esm/ControlledDateTimePicker.js +6 -6
  177. package/dist/esm/ControlledDateTimePicker.js.map +1 -1
  178. package/dist/esm/ControlledDateTimePickerCTX.js.map +1 -1
  179. package/dist/esm/config/useChangeHandlers.js +5 -4
  180. package/dist/esm/config/useChangeHandlers.js.map +2 -2
  181. package/dist/esm/config/useControlledDateTimePicker.js +12 -11
  182. package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
  183. package/dist/esm/config/useFocusTracker.js.map +1 -1
  184. package/dist/esm/config/useGetDestructuredValues.js +7 -4
  185. package/dist/esm/config/useGetDestructuredValues.js.map +2 -2
  186. package/dist/esm/config/useGetFlags.js +8 -8
  187. package/dist/esm/config/useGetFlags.js.map +2 -2
  188. package/dist/esm/config/useGetPropsBasedOnType.js +2 -2
  189. package/dist/esm/config/useGetPropsBasedOnType.js.map +2 -2
  190. package/dist/esm/config/useGetPropsWithDefault.js +2 -2
  191. package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
  192. package/dist/esm/config/useGetReferences.js.map +1 -1
  193. package/dist/esm/config/useGlobalKeyHandlers.js +4 -4
  194. package/dist/esm/config/useGlobalKeyHandlers.js.map +2 -2
  195. package/dist/esm/config/useRelevantValueFromProps.js +2 -2
  196. package/dist/esm/config/useRelevantValueFromProps.js.map +1 -1
  197. package/dist/esm/config/useValidateProps.js +3 -3
  198. package/dist/esm/config/useValidateProps.js.map +1 -1
  199. package/dist/esm/index.js +9 -9
  200. package/dist/esm/index.js.map +1 -1
  201. package/dist/esm/package.json +7 -0
  202. package/dist/esm/parts/ClearButton/ClearButton.js +12 -6
  203. package/dist/esm/parts/ClearButton/ClearButton.js.map +3 -3
  204. package/dist/esm/parts/ClearButton/useClearButton.js +1 -1
  205. package/dist/esm/parts/ClearButton/useClearButton.js.map +1 -1
  206. package/dist/esm/parts/ControlledDateTimePickerContent.js +15 -8
  207. package/dist/esm/parts/ControlledDateTimePickerContent.js.map +3 -3
  208. package/dist/esm/parts/DateInputs/DDInput.js +6 -4
  209. package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
  210. package/dist/esm/parts/DateInputs/DateInputs.js +30 -12
  211. package/dist/esm/parts/DateInputs/DateInputs.js.map +3 -3
  212. package/dist/esm/parts/DateInputs/MMInput.js +6 -4
  213. package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
  214. package/dist/esm/parts/DateInputs/YYYYInput.js +6 -4
  215. package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
  216. package/dist/esm/parts/DateInputs/useDateInputs.js +5 -5
  217. package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
  218. package/dist/esm/parts/Pickers/Calendar/Calendar.js +5 -5
  219. package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +2 -2
  220. package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +3 -3
  221. package/dist/esm/parts/Pickers/Calendar/CalendarBody.js.map +1 -1
  222. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +15 -7
  223. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
  224. package/dist/esm/parts/Pickers/Calendar/CalendarContext.js.map +1 -1
  225. package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js +2 -2
  226. package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
  227. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +19 -5
  228. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
  229. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +40 -7
  230. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
  231. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +20 -6
  232. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
  233. package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js +3 -3
  234. package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
  235. package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js +1 -1
  236. package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js.map +1 -1
  237. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +12 -6
  238. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
  239. package/dist/esm/parts/Pickers/Calendar/Day.js +11 -7
  240. package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
  241. package/dist/esm/parts/Pickers/Calendar/Styleds.js +1 -1
  242. package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
  243. package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js +5 -5
  244. package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +1 -1
  245. package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -2
  246. package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
  247. package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +2 -2
  248. package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
  249. package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +3 -2
  250. package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
  251. package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +1 -1
  252. package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
  253. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +6 -6
  254. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +1 -1
  255. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +13 -7
  256. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
  257. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
  258. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +11 -4
  259. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
  260. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +13 -4
  261. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
  262. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +12 -4
  263. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
  264. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
  265. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
  266. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +4 -4
  267. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
  268. package/dist/esm/parts/Pickers/PickersIcons.js +5 -5
  269. package/dist/esm/parts/Pickers/PickersIcons.js.map +1 -1
  270. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +28 -7
  271. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
  272. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +28 -6
  273. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
  274. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +28 -7
  275. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
  276. package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +1 -1
  277. package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
  278. package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js +5 -5
  279. package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js.map +1 -1
  280. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +26 -9
  281. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  282. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContext.js.map +1 -1
  283. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +19 -5
  284. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
  285. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +20 -6
  286. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
  287. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +12 -6
  288. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
  289. package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +3 -3
  290. package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +1 -1
  291. package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +4 -4
  292. package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +2 -2
  293. package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js +1 -1
  294. package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
  295. package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +1 -1
  296. package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
  297. package/dist/esm/parts/Styleds.js +1 -1
  298. package/dist/esm/parts/Styleds.js.map +2 -2
  299. package/dist/esm/parts/TimeInputs/HHInput.js +6 -4
  300. package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
  301. package/dist/esm/parts/TimeInputs/MeridiemInput.js +6 -4
  302. package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
  303. package/dist/esm/parts/TimeInputs/MinutesInput.js +6 -4
  304. package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
  305. package/dist/esm/parts/TimeInputs/TimeInputs.js +30 -12
  306. package/dist/esm/parts/TimeInputs/TimeInputs.js.map +3 -3
  307. package/dist/esm/parts/TimeInputs/useTimeInputs.js +2 -2
  308. package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +1 -1
  309. package/dist/esm/propTypes.js +9 -2
  310. package/dist/esm/propTypes.js.map +2 -2
  311. package/dist/esm/tests/custom-props/customProps.js +207 -0
  312. package/dist/esm/tests/custom-props/customProps.js.map +7 -0
  313. package/dist/esm/utils/dateHelpers.js +3 -3
  314. package/dist/esm/utils/dateHelpers.js.map +2 -2
  315. package/dist/esm/utils/dateTimeHelpers.js +2 -2
  316. package/dist/esm/utils/dateTimeHelpers.js.map +1 -1
  317. package/dist/esm/utils/hooks/useGetDayFromDateString.js +2 -2
  318. package/dist/esm/utils/hooks/useGetDayFromDateString.js.map +1 -1
  319. package/dist/esm/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +2 -2
  320. package/dist/esm/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +1 -1
  321. package/dist/esm/utils/hooks/useGetStartingFocusedDay.js +5 -5
  322. package/dist/esm/utils/hooks/useGetStartingFocusedDay.js.map +1 -1
  323. package/dist/esm/utils/stringHelpers.js +5 -2
  324. package/dist/esm/utils/stringHelpers.js.map +2 -2
  325. package/dist/esm/utils/timeHelpers.js +1 -1
  326. package/dist/esm/utils/timeHelpers.js.map +1 -1
  327. package/dist/esm/utils/typeGuards.js.map +1 -1
  328. package/package.json +14 -13
  329. package/dist/types/ControlledDateTimePicker.d.ts +0 -7
  330. package/dist/types/ControlledDateTimePickerCTX.d.ts +0 -5
  331. package/dist/types/ControlledDateTimePickerDatatestid.d.ts +0 -63
  332. package/dist/types/ControlledDateTimePickerTypes.d.ts +0 -20
  333. package/dist/types/config/useChangeHandlers.d.ts +0 -27
  334. package/dist/types/config/useControlledDateTimePicker.d.ts +0 -16
  335. package/dist/types/config/useFocusTracker.d.ts +0 -38
  336. package/dist/types/config/useGetDestructuredValues.d.ts +0 -30
  337. package/dist/types/config/useGetFlags.d.ts +0 -30
  338. package/dist/types/config/useGetPropsBasedOnType.d.ts +0 -28
  339. package/dist/types/config/useGetPropsWithDefault.d.ts +0 -2
  340. package/dist/types/config/useGetReferences.d.ts +0 -33
  341. package/dist/types/config/useGlobalKeyHandlers.d.ts +0 -18
  342. package/dist/types/config/useRelevantValueFromProps.d.ts +0 -10
  343. package/dist/types/config/useValidateProps.d.ts +0 -2
  344. package/dist/types/exported-related/theming.d.ts +0 -37
  345. package/dist/types/index.d.ts +0 -9
  346. package/dist/types/parts/ClearButton/ClearButton.d.ts +0 -1
  347. package/dist/types/parts/ClearButton/useClearButton.d.ts +0 -11
  348. package/dist/types/parts/ControlledDateTimePickerContent.d.ts +0 -1
  349. package/dist/types/parts/DateInputs/DDInput.d.ts +0 -16
  350. package/dist/types/parts/DateInputs/DateInputs.d.ts +0 -1
  351. package/dist/types/parts/DateInputs/MMInput.d.ts +0 -18
  352. package/dist/types/parts/DateInputs/YYYYInput.d.ts +0 -16
  353. package/dist/types/parts/DateInputs/useDateInputs.d.ts +0 -2
  354. package/dist/types/parts/Pickers/Calendar/Calendar.d.ts +0 -4
  355. package/dist/types/parts/Pickers/Calendar/CalendarBody.d.ts +0 -6
  356. package/dist/types/parts/Pickers/Calendar/CalendarContent.d.ts +0 -3
  357. package/dist/types/parts/Pickers/Calendar/CalendarContext.d.ts +0 -6
  358. package/dist/types/parts/Pickers/Calendar/CalendarDaysList.d.ts +0 -9
  359. package/dist/types/parts/Pickers/Calendar/CalendarFooter.d.ts +0 -2
  360. package/dist/types/parts/Pickers/Calendar/CalendarHead.d.ts +0 -1
  361. package/dist/types/parts/Pickers/Calendar/CalendarIconTrigger.d.ts +0 -1
  362. package/dist/types/parts/Pickers/Calendar/CalendarMonthDays.d.ts +0 -1
  363. package/dist/types/parts/Pickers/Calendar/CalendarWeekDays.d.ts +0 -2
  364. package/dist/types/parts/Pickers/Calendar/CalendarWrapper.d.ts +0 -1
  365. package/dist/types/parts/Pickers/Calendar/Day.d.ts +0 -8
  366. package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +0 -21
  367. package/dist/types/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +0 -14
  368. package/dist/types/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +0 -15
  369. package/dist/types/parts/Pickers/Calendar/useFocusLogic.d.ts +0 -14
  370. package/dist/types/parts/Pickers/Calendar/useKeyboardHandlers.d.ts +0 -19
  371. package/dist/types/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +0 -16
  372. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.d.ts +0 -1
  373. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.d.ts +0 -1
  374. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.d.ts +0 -6
  375. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.d.ts +0 -2
  376. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.d.ts +0 -1
  377. package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.d.ts +0 -1
  378. package/dist/types/parts/Pickers/CalendarWithTimeWheel/Styleds.d.ts +0 -7
  379. package/dist/types/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.d.ts +0 -14
  380. package/dist/types/parts/Pickers/PickersIcons.d.ts +0 -1
  381. package/dist/types/parts/Pickers/TimeWheel/HoursList.d.ts +0 -1
  382. package/dist/types/parts/Pickers/TimeWheel/MeridiemList.d.ts +0 -2
  383. package/dist/types/parts/Pickers/TimeWheel/MinutesList.d.ts +0 -2
  384. package/dist/types/parts/Pickers/TimeWheel/TimeWheel.d.ts +0 -4
  385. package/dist/types/parts/Pickers/TimeWheel/TimeWheelContent.d.ts +0 -2
  386. package/dist/types/parts/Pickers/TimeWheel/TimeWheelContext.d.ts +0 -6
  387. package/dist/types/parts/Pickers/TimeWheel/TimeWheelFooter.d.ts +0 -2
  388. package/dist/types/parts/Pickers/TimeWheel/TimeWheelIconTrigger.d.ts +0 -1
  389. package/dist/types/parts/Pickers/TimeWheel/TimeWheelWrapper.d.ts +0 -1
  390. package/dist/types/parts/Pickers/TimeWheel/useConfigTimePickerCTX.d.ts +0 -5
  391. package/dist/types/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.d.ts +0 -17
  392. package/dist/types/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +0 -13
  393. package/dist/types/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +0 -12
  394. package/dist/types/parts/Styleds.d.ts +0 -13
  395. package/dist/types/parts/TimeInputs/HHInput.d.ts +0 -17
  396. package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +0 -16
  397. package/dist/types/parts/TimeInputs/MinutesInput.d.ts +0 -16
  398. package/dist/types/parts/TimeInputs/TimeInputs.d.ts +0 -1
  399. package/dist/types/parts/TimeInputs/useTimeInputs.d.ts +0 -22
  400. package/dist/types/parts/config.d.ts +0 -5
  401. package/dist/types/propTypes.d.ts +0 -97
  402. package/dist/types/sharedTypes.d.ts +0 -95
  403. package/dist/types/tests/date-time-picker.auto-advance.test.d.ts +0 -1
  404. package/dist/types/tests/date-time-picker.clear-button.test.d.ts +0 -1
  405. package/dist/types/tests/date-time-picker.keyboard-focus.test.d.ts +0 -1
  406. package/dist/types/tests/date-time-picker.keyboard.data-entry-typing.test.d.ts +0 -1
  407. package/dist/types/tests/date-time-picker.keyboard.fill-with-now.test.d.ts +0 -1
  408. package/dist/types/tests/date-time-picker.keyboard.regressive-backspace.test.d.ts +0 -1
  409. package/dist/types/tests/date-time-picker.keyboard.shortcut-clear.test.d.ts +0 -1
  410. package/dist/types/tests/date-time-picker.manual-delete-values.test.d.ts +0 -1
  411. package/dist/types/tests/date-time-picker.onChange-meta-info.test.d.ts +0 -1
  412. package/dist/types/tests/date-time-picker.types-button.test.d.ts +0 -1
  413. package/dist/types/tests/date-time-picker.types-dom.test.d.ts +0 -1
  414. package/dist/types/utils/constants.d.ts +0 -38
  415. package/dist/types/utils/dateHelpers.d.ts +0 -40
  416. package/dist/types/utils/dateTimeHelpers.d.ts +0 -8
  417. package/dist/types/utils/hooks/useGetDayFromDateString.d.ts +0 -1
  418. package/dist/types/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.d.ts +0 -5
  419. package/dist/types/utils/hooks/useGetStartingFocusedDay.d.ts +0 -8
  420. package/dist/types/utils/hooks/useOnClickOutside.d.ts +0 -1
  421. package/dist/types/utils/numberHelpers.d.ts +0 -1
  422. package/dist/types/utils/stringHelpers.d.ts +0 -36
  423. package/dist/types/utils/timeHelpers.d.ts +0 -2
  424. package/dist/types/utils/typeGuards.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useMemo, useState } from "react";
3
- import { getIsDateTime, getIsDate, getIsTime } from "../utils/typeGuards";
4
- import { dateTimeToTime, dateTimeToDate } from "../utils/stringHelpers";
3
+ import { getIsDateTime, getIsDate, getIsTime } from "../utils/typeGuards.js";
4
+ import { dateTimeToTime, dateTimeToDate } from "../utils/stringHelpers.js";
5
5
  const useRelevantValueFromProps = (props) => {
6
6
  const dateStringFromProps = useMemo(() => {
7
7
  if (getIsDateTime(props))
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useRelevantValueFromProps.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo, useState } from 'react';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards';\nimport { dateTimeToTime, dateTimeToDate } from '../utils/stringHelpers';\nimport type { DSControlledDateTimePickerT } from '../propTypes';\n\nexport const useRelevantValueFromProps = (props: DSControlledDateTimePickerT.InternalProps) => {\n const dateStringFromProps = useMemo(() => {\n if (getIsDateTime(props)) return props.dateTime !== '' ? dateTimeToDate(props.dateTime) : '__/__/____';\n if (getIsDate(props)) return props.date !== '' ? props.date : '__/__/____';\n return '__/__/____';\n }, [props]);\n const timeStringFromProps = useMemo(() => {\n if (getIsDateTime(props)) return props.dateTime !== '' ? dateTimeToTime(props.dateTime) : '__:__ __';\n if (getIsTime(props)) return props.time !== '' ? props.time : '__:__ __';\n return '__:__ __';\n }, [props]);\n\n // don't use tempDateString to trigger useEffect for onDateChange\n // that is an anti-pattern and leads to a lot of issue\n // if you don't believe me, check date-time-picker v1 which is doing it\n const [tempDateString, setTempDateString] = useState(dateStringFromProps);\n // don't use tempTimeString to trigger useEffect for onTimeChange\n // that is an anti-pattern and leads to a lot of issue\n // if you don't believe me, check date-time-picker v1 which is doing it\n const [tempTimeString, setTimeString] = useState(timeStringFromProps);\n\n return useMemo(\n () => ({\n dateStringFromProps,\n timeStringFromProps,\n tempDateString,\n setTempDateString,\n tempTimeString,\n setTimeString,\n }),\n [dateStringFromProps, tempDateString, tempTimeString, timeStringFromProps],\n );\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo, useState } from 'react';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nimport { dateTimeToTime, dateTimeToDate } from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../propTypes.js';\n\nexport const useRelevantValueFromProps = (props: DSControlledDateTimePickerT.InternalProps) => {\n const dateStringFromProps = useMemo(() => {\n if (getIsDateTime(props)) return props.dateTime !== '' ? dateTimeToDate(props.dateTime) : '__/__/____';\n if (getIsDate(props)) return props.date !== '' ? props.date : '__/__/____';\n return '__/__/____';\n }, [props]);\n const timeStringFromProps = useMemo(() => {\n if (getIsDateTime(props)) return props.dateTime !== '' ? dateTimeToTime(props.dateTime) : '__:__ __';\n if (getIsTime(props)) return props.time !== '' ? props.time : '__:__ __';\n return '__:__ __';\n }, [props]);\n\n // don't use tempDateString to trigger useEffect for onDateChange\n // that is an anti-pattern and leads to a lot of issue\n // if you don't believe me, check date-time-picker v1 which is doing it\n const [tempDateString, setTempDateString] = useState(dateStringFromProps);\n // don't use tempTimeString to trigger useEffect for onTimeChange\n // that is an anti-pattern and leads to a lot of issue\n // if you don't believe me, check date-time-picker v1 which is doing it\n const [tempTimeString, setTimeString] = useState(timeStringFromProps);\n\n return useMemo(\n () => ({\n dateStringFromProps,\n timeStringFromProps,\n tempDateString,\n setTempDateString,\n tempTimeString,\n setTimeString,\n }),\n [dateStringFromProps, tempDateString, tempTimeString, timeStringFromProps],\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,SAAS,gBAAgB;AAClC,SAAS,eAAe,WAAW,iBAAiB;AACpD,SAAS,gBAAgB,sBAAsB;AAGxC,MAAM,4BAA4B,CAAC,UAAqD;AAC7F,QAAM,sBAAsB,QAAQ,MAAM;AACxC,QAAI,cAAc,KAAK;AAAG,aAAO,MAAM,aAAa,KAAK,eAAe,MAAM,QAAQ,IAAI;AAC1F,QAAI,UAAU,KAAK;AAAG,aAAO,MAAM,SAAS,KAAK,MAAM,OAAO;AAC9D,WAAO;AAAA,EACT,GAAG,CAAC,KAAK,CAAC;AACV,QAAM,sBAAsB,QAAQ,MAAM;AACxC,QAAI,cAAc,KAAK;AAAG,aAAO,MAAM,aAAa,KAAK,eAAe,MAAM,QAAQ,IAAI;AAC1F,QAAI,UAAU,KAAK;AAAG,aAAO,MAAM,SAAS,KAAK,MAAM,OAAO;AAC9D,WAAO;AAAA,EACT,GAAG,CAAC,KAAK,CAAC;AAKV,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,mBAAmB;AAIxE,QAAM,CAAC,gBAAgB,aAAa,IAAI,SAAS,mBAAmB;AAEpE,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,qBAAqB,gBAAgB,gBAAgB,mBAAmB;AAAA,EAC3E;AACF;",
6
6
  "names": []
7
7
  }
@@ -5,9 +5,9 @@ import {
5
5
  dateTimeToTime,
6
6
  isValidTimeString,
7
7
  deconstructValuesFromDateString
8
- } from "../utils/stringHelpers";
9
- import { convertToPositiveNumberIfPossible } from "../utils/numberHelpers";
10
- import { getIsDateTime, getIsDate, getIsTime } from "../utils/typeGuards";
8
+ } from "../utils/stringHelpers.js";
9
+ import { convertToPositiveNumberIfPossible } from "../utils/numberHelpers.js";
10
+ import { getIsDateTime, getIsDate, getIsTime } from "../utils/typeGuards.js";
11
11
  const PREPEND = `ControlledDateTimePicker:
12
12
  Invalid configuration detected::
13
13
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type { DSControlledDateTimePickerT } from '../propTypes';\nimport {\n dateTimeToDate,\n isValidDateString,\n dateTimeToTime,\n isValidTimeString,\n deconstructValuesFromDateString,\n} from '../utils/stringHelpers';\nimport { convertToPositiveNumberIfPossible } from '../utils/numberHelpers';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards';\nconst PREPEND = `ControlledDateTimePicker:\n Invalid configuration detected::\n \n `;\nconst NOT_A_DEFECT = '';\n// '\\n\\n\\t\\tThis is not a defect, please check\\n\\n\\t\\thttps://qa.dimsum.rd.elliemae.io/?path=/story/components-desktop-components-d-controlledform-date-time-picker--basic\\n\\n\\t\\tfor instructions on how to use the component correctly\\n\\n';\nconst INLINE_RECEIVED_PREPEND = `\n\n Received:`;\nconst throwInvalidDateTimeError = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"dateTime\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidDaterror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"date\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidTimerror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"time\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledDateError = (date: string, onDateChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date selector while providing a non-string \"date\" or providing a non-function to \"onDateChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n date: ${date}(${typeof date})\n onDateChange: (${typeof onDateChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledTimeError = (time: string, onTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a time selector while providing a non-string \"time\" or providing a non-function to \"onTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n time: ${time}(${typeof time})\n onTimeChange: (${typeof onTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\n\nconst throwUncontrolledDateTimeError = (dateTime: string, onDateTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date-time selector while providing a non-string \"dateTime\" or providing a non-function to \"onDateTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n dateTime: ${dateTime}(${typeof dateTime})\n onDateTimeChange: (${typeof onDateTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidEmptyPickerStartingMonthError = (emptyPickerStartingMonth: string) => {\n throw new Error(\n `${PREPEND}the provided emptyPickerStartingMonth props is invalid. please provide a string with the format mm/__/yyyy, (mm 01~12, yyyy 0001~9999) \n\n Received:\n ${emptyPickerStartingMonth}(${typeof emptyPickerStartingMonth})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidOnCalendarOpenFocusedDayError = (onCalendarOpenFocusedDay: string) => {\n throw new Error(\n `${PREPEND}the provided onCalendarOpenFocusedDay props is invalid. please provide a string with the format mm/dd/yyyy, (mm 01~12, dd 01~31, yyyy 0001~9999) \n\n Received:\n ${onCalendarOpenFocusedDay}(${typeof onCalendarOpenFocusedDay})\n ${NOT_A_DEFECT}`,\n );\n};\nexport const useValidateProps = (props: DSControlledDateTimePickerT.Props): void => {\n // validate date-related props\n if (getIsDateTime(props) || getIsDate(props)) {\n const { emptyPickerStartingMonth, onCalendarOpenFocusedDay } = props;\n\n // validate generic use-cases\n if (emptyPickerStartingMonth) {\n const { month: stringMonthVal, year: stringYearVal } = deconstructValuesFromDateString(emptyPickerStartingMonth);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || yearNum <= 0 || yearNum > 9999)\n throwInvalidEmptyPickerStartingMonthError(emptyPickerStartingMonth);\n }\n if (onCalendarOpenFocusedDay) {\n const {\n month: stringMonthVal,\n day: stringDayVal,\n year: stringYearVal,\n } = deconstructValuesFromDateString(onCalendarOpenFocusedDay);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const dayNum = convertToPositiveNumberIfPossible(stringDayVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || dayNum <= 0 || dayNum > 31 || yearNum <= 0 || yearNum > 9999)\n throwInvalidOnCalendarOpenFocusedDayError(onCalendarOpenFocusedDay);\n }\n }\n // validate full datetime cases\n if (getIsDateTime(props)) {\n const { dateTime, onDateTimeChange } = props;\n if (typeof dateTime !== 'string' || typeof onDateTimeChange !== 'function')\n throwUncontrolledDateTimeError(dateTime, onDateTimeChange);\n else if (!isValidDateString(dateTimeToDate(dateTime)) || !isValidTimeString(dateTimeToTime(dateTime)))\n throwInvalidDateTimeError(dateTimeToTime(dateTime));\n }\n\n // validate date-only cases\n if (getIsDate(props)) {\n const { date, onDateChange } = props;\n if (typeof date !== 'string' || typeof onDateChange !== 'function') throwUncontrolledDateError(date, onDateChange);\n else if (!isValidDateString(date)) throwInvalidDaterror(date);\n }\n\n // validate time-only cases\n\n if (getIsTime(props)) {\n const { time, onTimeChange } = props;\n if (typeof time !== 'string' || typeof onTimeChange !== 'function') throwUncontrolledTimeError(time, onTimeChange);\n else if (!isValidTimeString(time)) throwInvalidTimerror(time);\n }\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type { DSControlledDateTimePickerT } from '../propTypes.js';\nimport {\n dateTimeToDate,\n isValidDateString,\n dateTimeToTime,\n isValidTimeString,\n deconstructValuesFromDateString,\n} from '../utils/stringHelpers.js';\nimport { convertToPositiveNumberIfPossible } from '../utils/numberHelpers.js';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nconst PREPEND = `ControlledDateTimePicker:\n Invalid configuration detected::\n \n `;\nconst NOT_A_DEFECT = '';\n// '\\n\\n\\t\\tThis is not a defect, please check\\n\\n\\t\\thttps://qa.dimsum.rd.elliemae.io/?path=/story/components-desktop-components-d-controlledform-date-time-picker--basic\\n\\n\\t\\tfor instructions on how to use the component correctly\\n\\n';\nconst INLINE_RECEIVED_PREPEND = `\n\n Received:`;\nconst throwInvalidDateTimeError = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"dateTime\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidDaterror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"date\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidTimerror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"time\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledDateError = (date: string, onDateChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date selector while providing a non-string \"date\" or providing a non-function to \"onDateChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n date: ${date}(${typeof date})\n onDateChange: (${typeof onDateChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledTimeError = (time: string, onTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a time selector while providing a non-string \"time\" or providing a non-function to \"onTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n time: ${time}(${typeof time})\n onTimeChange: (${typeof onTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\n\nconst throwUncontrolledDateTimeError = (dateTime: string, onDateTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date-time selector while providing a non-string \"dateTime\" or providing a non-function to \"onDateTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n dateTime: ${dateTime}(${typeof dateTime})\n onDateTimeChange: (${typeof onDateTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidEmptyPickerStartingMonthError = (emptyPickerStartingMonth: string) => {\n throw new Error(\n `${PREPEND}the provided emptyPickerStartingMonth props is invalid. please provide a string with the format mm/__/yyyy, (mm 01~12, yyyy 0001~9999) \n\n Received:\n ${emptyPickerStartingMonth}(${typeof emptyPickerStartingMonth})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidOnCalendarOpenFocusedDayError = (onCalendarOpenFocusedDay: string) => {\n throw new Error(\n `${PREPEND}the provided onCalendarOpenFocusedDay props is invalid. please provide a string with the format mm/dd/yyyy, (mm 01~12, dd 01~31, yyyy 0001~9999) \n\n Received:\n ${onCalendarOpenFocusedDay}(${typeof onCalendarOpenFocusedDay})\n ${NOT_A_DEFECT}`,\n );\n};\nexport const useValidateProps = (props: DSControlledDateTimePickerT.Props): void => {\n // validate date-related props\n if (getIsDateTime(props) || getIsDate(props)) {\n const { emptyPickerStartingMonth, onCalendarOpenFocusedDay } = props;\n\n // validate generic use-cases\n if (emptyPickerStartingMonth) {\n const { month: stringMonthVal, year: stringYearVal } = deconstructValuesFromDateString(emptyPickerStartingMonth);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || yearNum <= 0 || yearNum > 9999)\n throwInvalidEmptyPickerStartingMonthError(emptyPickerStartingMonth);\n }\n if (onCalendarOpenFocusedDay) {\n const {\n month: stringMonthVal,\n day: stringDayVal,\n year: stringYearVal,\n } = deconstructValuesFromDateString(onCalendarOpenFocusedDay);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const dayNum = convertToPositiveNumberIfPossible(stringDayVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || dayNum <= 0 || dayNum > 31 || yearNum <= 0 || yearNum > 9999)\n throwInvalidOnCalendarOpenFocusedDayError(onCalendarOpenFocusedDay);\n }\n }\n // validate full datetime cases\n if (getIsDateTime(props)) {\n const { dateTime, onDateTimeChange } = props;\n if (typeof dateTime !== 'string' || typeof onDateTimeChange !== 'function')\n throwUncontrolledDateTimeError(dateTime, onDateTimeChange);\n else if (!isValidDateString(dateTimeToDate(dateTime)) || !isValidTimeString(dateTimeToTime(dateTime)))\n throwInvalidDateTimeError(dateTimeToTime(dateTime));\n }\n\n // validate date-only cases\n if (getIsDate(props)) {\n const { date, onDateChange } = props;\n if (typeof date !== 'string' || typeof onDateChange !== 'function') throwUncontrolledDateError(date, onDateChange);\n else if (!isValidDateString(date)) throwInvalidDaterror(date);\n }\n\n // validate time-only cases\n\n if (getIsTime(props)) {\n const { time, onTimeChange } = props;\n if (typeof time !== 'string' || typeof onTimeChange !== 'function') throwUncontrolledTimeError(time, onTimeChange);\n else if (!isValidTimeString(time)) throwInvalidTimerror(time);\n }\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yCAAyC;AAClD,SAAS,eAAe,WAAW,iBAAiB;AACpD,MAAM,UAAU;AAAA;AAAA;AAAA;AAIhB,MAAM,eAAe;AAErB,MAAM,0BAA0B;AAAA;AAAA;AAGhC,MAAM,4BAA4B,CAAC,iBAAyB;AAC1D,QAAM,IAAI;AAAA,IACR,GAAG,wFAAwF,0BAA0B,gBAAgB,OAAO,gBAAgB;AAAA,EAC9J;AACF;AACA,MAAM,uBAAuB,CAAC,iBAAyB;AACrD,QAAM,IAAI;AAAA,IACR,GAAG,oFAAoF,0BAA0B,gBAAgB,OAAO,gBAAgB;AAAA,EAC1J;AACF;AACA,MAAM,uBAAuB,CAAC,iBAAyB;AACrD,QAAM,IAAI;AAAA,IACR,GAAG,oFAAoF,0BAA0B,gBAAgB,OAAO,gBAAgB;AAAA,EAC1J;AACF;AACA,MAAM,6BAA6B,CAAC,MAAc,iBAA0B;AAC1E,QAAM,IAAI;AAAA,IACR,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,YAIK,QAAQ,OAAO;AAAA,qBACN,OAAO;AAAA,IACxB;AAAA,EACF;AACF;AACA,MAAM,6BAA6B,CAAC,MAAc,iBAA0B;AAC1E,QAAM,IAAI;AAAA,IACR,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,YAIK,QAAQ,OAAO;AAAA,qBACN,OAAO;AAAA,IACxB;AAAA,EACF;AACF;AAEA,MAAM,iCAAiC,CAAC,UAAkB,qBAA8B;AACtF,QAAM,IAAI;AAAA,IACR,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,gBAIS,YAAY,OAAO;AAAA,yBACV,OAAO;AAAA,IAC5B;AAAA,EACF;AACF;AACA,MAAM,4CAA4C,CAAC,6BAAqC;AACtF,QAAM,IAAI;AAAA,IACR,GAAG;AAAA;AAAA;AAAA,MAGD,4BAA4B,OAAO;AAAA,IACrC;AAAA,EACF;AACF;AACA,MAAM,4CAA4C,CAAC,6BAAqC;AACtF,QAAM,IAAI;AAAA,IACR,GAAG;AAAA;AAAA;AAAA,MAGD,4BAA4B,OAAO;AAAA,IACrC;AAAA,EACF;AACF;AACO,MAAM,mBAAmB,CAAC,UAAmD;AAElF,MAAI,cAAc,KAAK,KAAK,UAAU,KAAK,GAAG;AAC5C,UAAM,EAAE,0BAA0B,yBAAyB,IAAI;AAG/D,QAAI,0BAA0B;AAC5B,YAAM,EAAE,OAAO,gBAAgB,MAAM,cAAc,IAAI,gCAAgC,wBAAwB;AAC/G,YAAM,WAAW,kCAAkC,cAAc;AACjE,YAAM,UAAU,kCAAkC,aAAa;AAC/D,UAAI,YAAY,KAAK,YAAY,MAAM,WAAW,KAAK,UAAU;AAC/D,kDAA0C,wBAAwB;AAAA,IACtE;AACA,QAAI,0BAA0B;AAC5B,YAAM;AAAA,QACJ,OAAO;AAAA,QACP,KAAK;AAAA,QACL,MAAM;AAAA,MACR,IAAI,gCAAgC,wBAAwB;AAC5D,YAAM,WAAW,kCAAkC,cAAc;AACjE,YAAM,SAAS,kCAAkC,YAAY;AAC7D,YAAM,UAAU,kCAAkC,aAAa;AAC/D,UAAI,YAAY,KAAK,YAAY,MAAM,UAAU,KAAK,SAAS,MAAM,WAAW,KAAK,UAAU;AAC7F,kDAA0C,wBAAwB;AAAA,IACtE;AAAA,EACF;AAEA,MAAI,cAAc,KAAK,GAAG;AACxB,UAAM,EAAE,UAAU,iBAAiB,IAAI;AACvC,QAAI,OAAO,aAAa,YAAY,OAAO,qBAAqB;AAC9D,qCAA+B,UAAU,gBAAgB;AAAA,aAClD,CAAC,kBAAkB,eAAe,QAAQ,CAAC,KAAK,CAAC,kBAAkB,eAAe,QAAQ,CAAC;AAClG,gCAA0B,eAAe,QAAQ,CAAC;AAAA,EACtD;AAGA,MAAI,UAAU,KAAK,GAAG;AACpB,UAAM,EAAE,MAAM,aAAa,IAAI;AAC/B,QAAI,OAAO,SAAS,YAAY,OAAO,iBAAiB;AAAY,iCAA2B,MAAM,YAAY;AAAA,aACxG,CAAC,kBAAkB,IAAI;AAAG,2BAAqB,IAAI;AAAA,EAC9D;AAIA,MAAI,UAAU,KAAK,GAAG;AACpB,UAAM,EAAE,MAAM,aAAa,IAAI;AAC/B,QAAI,OAAO,SAAS,YAAY,OAAO,iBAAiB;AAAY,iCAA2B,MAAM,YAAY;AAAA,aACxG,CAAC,kBAAkB,IAAI;AAAG,2BAAqB,IAAI;AAAA,EAC9D;AACF;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import * as React from "react";
2
- import { DSControlledDateTimePickerWithSchema, DSControlledDateTimePicker } from "./ControlledDateTimePicker";
3
- import { ControlledDateTimePickerDatatestid } from "./ControlledDateTimePickerDatatestid";
4
- import { CONTROLLED_DATE_TIME_PICKER_TYPES } from "./ControlledDateTimePickerTypes";
5
- import { deconstructValuesFromDateString, prependStringWithPlaceHolders } from "./utils/stringHelpers";
6
- import { getValidationDateTimeStringMetaInfo } from "./utils/dateTimeHelpers";
2
+ import { DSControlledDateTimePickerWithSchema, DSControlledDateTimePicker } from "./ControlledDateTimePicker.js";
3
+ import { ControlledDateTimePickerDatatestid } from "./ControlledDateTimePickerDatatestid.js";
4
+ import { CONTROLLED_DATE_TIME_PICKER_TYPES } from "./ControlledDateTimePickerTypes.js";
5
+ import { deconstructValuesFromDateString, prependStringWithPlaceHolders } from "./utils/stringHelpers.js";
6
+ import { getValidationDateTimeStringMetaInfo } from "./utils/dateTimeHelpers.js";
7
7
  import {
8
8
  getValidationDateStringMetaInfo,
9
9
  getDateStringFromDay,
10
10
  getDayFromDateString,
11
11
  getDateValuesFromDate
12
- } from "./utils/dateHelpers";
13
- import { getValidationTimeStringMetaInfo } from "./utils/timeHelpers";
14
- import { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from "./exported-related/theming";
15
- import {} from "./propTypes";
12
+ } from "./utils/dateHelpers.js";
13
+ import { getValidationTimeStringMetaInfo } from "./utils/timeHelpers.js";
14
+ import { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from "./exported-related/theming.js";
15
+ import {} from "./propTypes.js";
16
16
  export {
17
17
  CONTROLLED_DATE_TIME_PICKER_TYPES,
18
18
  ControlledDateTimePickerDatatestid,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSControlledDateTimePickerWithSchema, DSControlledDateTimePicker } from './ControlledDateTimePicker';\nexport { ControlledDateTimePickerDatatestid } from './ControlledDateTimePickerDatatestid';\nexport { CONTROLLED_DATE_TIME_PICKER_TYPES } from './ControlledDateTimePickerTypes';\nexport { deconstructValuesFromDateString, prependStringWithPlaceHolders } from './utils/stringHelpers';\nexport { getValidationDateTimeStringMetaInfo } from './utils/dateTimeHelpers';\nexport {\n getValidationDateStringMetaInfo,\n getDateStringFromDay,\n getDayFromDateString,\n getDateValuesFromDate,\n} from './utils/dateHelpers';\nexport { getValidationTimeStringMetaInfo } from './utils/timeHelpers';\nexport { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from './exported-related/theming';\nexport { type DSControlledDateTimePickerT } from './propTypes';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSControlledDateTimePickerWithSchema, DSControlledDateTimePicker } from './ControlledDateTimePicker.js';\nexport { ControlledDateTimePickerDatatestid } from './ControlledDateTimePickerDatatestid.js';\nexport { CONTROLLED_DATE_TIME_PICKER_TYPES } from './ControlledDateTimePickerTypes.js';\nexport { deconstructValuesFromDateString, prependStringWithPlaceHolders } from './utils/stringHelpers.js';\nexport { getValidationDateTimeStringMetaInfo } from './utils/dateTimeHelpers.js';\nexport {\n getValidationDateStringMetaInfo,\n getDateStringFromDay,\n getDayFromDateString,\n getDateValuesFromDate,\n} from './utils/dateHelpers.js';\nexport { getValidationTimeStringMetaInfo } from './utils/timeHelpers.js';\nexport { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from './exported-related/theming.js';\nexport { type DSControlledDateTimePickerT } from './propTypes.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC,kCAAkC;AACjF,SAAS,0CAA0C;AACnD,SAAS,yCAAyC;AAClD,SAAS,iCAAiC,qCAAqC;AAC/E,SAAS,2CAA2C;AACpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uCAAuC;AAChD,SAAS,gCAAgC,uCAAuC;AAChF,eAAiD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -1,19 +1,24 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
4
  import { CloseMedium } from "@elliemae/ds-icons";
5
5
  import { DSIconColors } from "@elliemae/ds-icon";
6
6
  import { BUTTON_SIZES } from "@elliemae/ds-button";
7
- import { StyledClearButton } from "../Styleds";
8
- import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid";
9
- import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
10
- import { useClearButton } from "./useClearButton";
7
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
8
+ import { StyledClearButton } from "../Styleds.js";
9
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
10
+ import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
11
+ import { useClearButton } from "./useClearButton.js";
11
12
  const ClearButton = () => {
12
13
  const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();
13
14
  const styledsAttrs = {
14
15
  shouldDisplay: withClearBtn
15
16
  };
16
- const { latestInteractionRegion, currFocusDescriber } = useContext(ControlledDateTimePickerContext);
17
+ const { latestInteractionRegion, currFocusDescriber, props } = useContext(ControlledDateTimePickerContext);
18
+ const ariaAndDataProps = React2.useMemo(
19
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CLEAR_BUTTON]),
20
+ [props]
21
+ );
17
22
  return /* @__PURE__ */ jsx(
18
23
  StyledClearButton,
19
24
  {
@@ -30,6 +35,7 @@ const ClearButton = () => {
30
35
  onKeyDown: onClearButtonKeyDown,
31
36
  type: "button",
32
37
  ...styledsAttrs,
38
+ ...ariaAndDataProps,
33
39
  children: /* @__PURE__ */ jsx(CloseMedium, { color: DSIconColors.PRIMARY })
34
40
  }
35
41
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/ClearButton/ClearButton.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { StyledClearButton } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { useClearButton } from './useClearButton';\n\nexport const ClearButton = (): JSX.Element => {\n const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();\n const styledsAttrs = {\n shouldDisplay: withClearBtn,\n };\n const { latestInteractionRegion, currFocusDescriber } = useContext(ControlledDateTimePickerContext);\n\n return (\n <StyledClearButton\n aria-label=\"clear selected date\"\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n data-testid={ControlledDateTimePickerDatatestid.CLEAR_BUTTON}\n innerRef={(DomElem: HTMLButtonElement) => {\n clearButtonRef.current = DomElem;\n if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();\n }}\n onClick={onClearClick}\n onKeyDown={onClearButtonKeyDown}\n type=\"button\"\n {...styledsAttrs}\n >\n <CloseMedium color={DSIconColors.PRIMARY} />\n </StyledClearButton>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgCjB;AA/BN,SAAgB,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,sBAAsB;AAExB,MAAM,cAAc,MAAmB;AAC5C,QAAM,EAAE,cAAc,sBAAsB,gBAAgB,aAAa,IAAI,eAAe;AAC5F,QAAM,eAAe;AAAA,IACnB,eAAe;AAAA,EACjB;AACA,QAAM,EAAE,yBAAyB,mBAAmB,IAAI,WAAW,+BAA+B;AAElG,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,aAAa;AAAA,MACnB,eAAa,mCAAmC;AAAA,MAChD,UAAU,CAAC,YAA+B;AACxC,uBAAe,UAAU;AACzB,YAAI,4BAA4B,eAAe,uBAAuB;AAAa,mBAAS,QAAQ;AAAA,MACtG;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MAEJ,8BAAC,eAAY,OAAO,aAAa,SAAS;AAAA;AAAA,EAC5C;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { StyledClearButton } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { useClearButton } from './useClearButton.js';\n\nexport const ClearButton = (): JSX.Element => {\n const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();\n const styledsAttrs = {\n shouldDisplay: withClearBtn,\n };\n const { latestInteractionRegion, currFocusDescriber, props } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CLEAR_BUTTON]),\n [props],\n );\n\n return (\n <StyledClearButton\n aria-label=\"clear selected date\"\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n data-testid={ControlledDateTimePickerDatatestid.CLEAR_BUTTON}\n innerRef={(DomElem: HTMLButtonElement) => {\n clearButtonRef.current = DomElem;\n if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();\n }}\n onClick={onClearClick}\n onKeyDown={onClearButtonKeyDown}\n type=\"button\"\n {...styledsAttrs}\n {...ariaAndDataProps}\n >\n <CloseMedium color={DSIconColors.PRIMARY} />\n </StyledClearButton>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACsCjB;AArCN,OAAOA,UAAS,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,sBAAsB;AAExB,MAAM,cAAc,MAAmB;AAC5C,QAAM,EAAE,cAAc,sBAAsB,gBAAgB,aAAa,IAAI,eAAe;AAC5F,QAAM,eAAe;AAAA,IACnB,eAAe;AAAA,EACjB;AACA,QAAM,EAAE,yBAAyB,oBAAoB,MAAM,IAAI,WAAW,+BAA+B;AACzG,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,CAAC;AAAA,IAClF,CAAC,KAAK;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,aAAa;AAAA,MACnB,eAAa,mCAAmC;AAAA,MAChD,UAAU,CAAC,YAA+B;AACxC,uBAAe,UAAU;AACzB,YAAI,4BAA4B,eAAe,uBAAuB;AAAa,mBAAS,QAAQ;AAAA,MACtG;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,8BAAC,eAAY,OAAO,aAAa,SAAS;AAAA;AAAA,EAC5C;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useCallback, useMemo, useContext } from "react";
3
- import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
3
+ import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
4
4
  const useClearButton = () => {
5
5
  const {
6
6
  handleClearAll,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/ClearButton/useClearButton.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useMemo, useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\ninterface UseOnClearClickR {\n onClearClick: DSControlledDateTimePickerInternalsT.OnDSBtnClick;\n onClearButtonKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown<HTMLButtonElement>;\n clearButtonRef: React.MutableRefObject<HTMLButtonElement | null>;\n withAnyPicker: boolean;\n withClearBtn: boolean;\n}\nexport const useClearButton = (): UseOnClearClickR => {\n const {\n handleClearAll,\n clearButtonRef,\n withAnyPicker,\n withClearBtn,\n withAnyInputs,\n isWithTimeInputs,\n isWithDateInputs,\n trackFocusFirstSegment,\n trackFocusMeridiemInput,\n trackFocusYearInput,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const onClearClick: DSControlledDateTimePickerInternalsT.OnDSBtnClick = useCallback(\n (e) => {\n handleClearAll(e);\n trackFocusFirstSegment();\n },\n [handleClearAll, trackFocusFirstSegment],\n );\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n if (withAnyPicker) trackFocusPicker();\n }, [withAnyPicker, trackFocusPicker]);\n\n const onClearButtonKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown<HTMLButtonElement> = useCallback(\n (e) => {\n const { key } = e;\n const preventDefaultKeys = ['Home', 'End'];\n const stopPropagationKeys = ['Home', 'End'];\n if (preventDefaultKeys.includes(key)) e.preventDefault();\n if (stopPropagationKeys.includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'Backspace' && withAnyInputs) {\n if (isWithTimeInputs) trackFocusMeridiemInput();\n else if (isWithDateInputs) trackFocusYearInput();\n }\n },\n [\n isWithDateInputs,\n isWithTimeInputs,\n onEndKeyDown,\n onHomeKeyDown,\n trackFocusMeridiemInput,\n trackFocusYearInput,\n withAnyInputs,\n ],\n );\n\n return useMemo(\n () => ({ onClearClick, onClearButtonKeyDown, clearButtonRef, withAnyPicker, withClearBtn }),\n [onClearClick, onClearButtonKeyDown, clearButtonRef, withAnyPicker, withClearBtn],\n );\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useMemo, useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\ninterface UseOnClearClickR {\n onClearClick: DSControlledDateTimePickerInternalsT.OnDSBtnClick;\n onClearButtonKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown<HTMLButtonElement>;\n clearButtonRef: React.MutableRefObject<HTMLButtonElement | null>;\n withAnyPicker: boolean;\n withClearBtn: boolean;\n}\nexport const useClearButton = (): UseOnClearClickR => {\n const {\n handleClearAll,\n clearButtonRef,\n withAnyPicker,\n withClearBtn,\n withAnyInputs,\n isWithTimeInputs,\n isWithDateInputs,\n trackFocusFirstSegment,\n trackFocusMeridiemInput,\n trackFocusYearInput,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const onClearClick: DSControlledDateTimePickerInternalsT.OnDSBtnClick = useCallback(\n (e) => {\n handleClearAll(e);\n trackFocusFirstSegment();\n },\n [handleClearAll, trackFocusFirstSegment],\n );\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n if (withAnyPicker) trackFocusPicker();\n }, [withAnyPicker, trackFocusPicker]);\n\n const onClearButtonKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown<HTMLButtonElement> = useCallback(\n (e) => {\n const { key } = e;\n const preventDefaultKeys = ['Home', 'End'];\n const stopPropagationKeys = ['Home', 'End'];\n if (preventDefaultKeys.includes(key)) e.preventDefault();\n if (stopPropagationKeys.includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n if (key === 'Backspace' && withAnyInputs) {\n if (isWithTimeInputs) trackFocusMeridiemInput();\n else if (isWithDateInputs) trackFocusYearInput();\n }\n },\n [\n isWithDateInputs,\n isWithTimeInputs,\n onEndKeyDown,\n onHomeKeyDown,\n trackFocusMeridiemInput,\n trackFocusYearInput,\n withAnyInputs,\n ],\n );\n\n return useMemo(\n () => ({ onClearClick, onClearButtonKeyDown, clearButtonRef, withAnyPicker, withClearBtn }),\n [onClearClick, onClearButtonKeyDown, clearButtonRef, withAnyPicker, withClearBtn],\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,aAAa,SAAS,kBAAkB;AACjD,SAAS,uCAAuC;AAUzC,MAAM,iBAAiB,MAAwB;AACpD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,QAAM,eAAkE;AAAA,IACtE,CAAC,MAAM;AACL,qBAAe,CAAC;AAChB,6BAAuB;AAAA,IACzB;AAAA,IACA,CAAC,gBAAgB,sBAAsB;AAAA,EACzC;AACA,QAAM,gBAAgB,YAAY,MAAM;AACtC,2BAAuB;AAAA,EACzB,GAAG,CAAC,sBAAsB,CAAC;AAC3B,QAAM,eAAe,YAAY,MAAM;AACrC,QAAI;AAAe,uBAAiB;AAAA,EACtC,GAAG,CAAC,eAAe,gBAAgB,CAAC;AAEpC,QAAM,uBAA0F;AAAA,IAC9F,CAAC,MAAM;AACL,YAAM,EAAE,IAAI,IAAI;AAChB,YAAM,qBAAqB,CAAC,QAAQ,KAAK;AACzC,YAAM,sBAAsB,CAAC,QAAQ,KAAK;AAC1C,UAAI,mBAAmB,SAAS,GAAG;AAAG,UAAE,eAAe;AACvD,UAAI,oBAAoB,SAAS,GAAG;AAAG,UAAE,gBAAgB;AACzD,UAAI,QAAQ;AAAQ,sBAAc;AAClC,UAAI,QAAQ;AAAO,qBAAa;AAChC,UAAI,QAAQ,eAAe,eAAe;AACxC,YAAI;AAAkB,kCAAwB;AAAA,iBACrC;AAAkB,8BAAoB;AAAA,MACjD;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,cAAc,sBAAsB,gBAAgB,eAAe,aAAa;AAAA,IACzF,CAAC,cAAc,sBAAsB,gBAAgB,eAAe,YAAY;AAAA,EAClF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,18 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
4
  import { Grid } from "@elliemae/ds-grid";
5
- import { ControlledDateTimePickerContext } from "../ControlledDateTimePickerCTX";
6
- import { StyledInputsWrapperGrid } from "./Styleds";
7
- import { DateInputs } from "./DateInputs/DateInputs";
8
- import { TimeInputs } from "./TimeInputs/TimeInputs";
9
- import { PickersIcons } from "./Pickers/PickersIcons";
10
- import { ClearButton } from "./ClearButton/ClearButton";
11
- import { ControlledDateTimePickerDatatestid } from "../ControlledDateTimePickerDatatestid";
5
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
6
+ import { ControlledDateTimePickerContext } from "../ControlledDateTimePickerCTX.js";
7
+ import { StyledInputsWrapperGrid } from "./Styleds.js";
8
+ import { DateInputs } from "./DateInputs/DateInputs.js";
9
+ import { TimeInputs } from "./TimeInputs/TimeInputs.js";
10
+ import { PickersIcons } from "./Pickers/PickersIcons.js";
11
+ import { ClearButton } from "./ClearButton/ClearButton.js";
12
+ import { ControlledDateTimePickerDatatestid } from "../ControlledDateTimePickerDatatestid.js";
12
13
  const ControlledDateTimePickerContent = () => {
13
14
  const {
15
+ props,
14
16
  props: { hasError, disabled },
15
17
  hideDate,
16
18
  hideTime,
@@ -23,6 +25,10 @@ const ControlledDateTimePickerContent = () => {
23
25
  onGlobalKeyDown,
24
26
  trackFocusResetter
25
27
  } = useContext(ControlledDateTimePickerContext);
28
+ const ariaAndDataProps = React2.useMemo(
29
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTAINER]),
30
+ [props]
31
+ );
26
32
  const styledsAttrs = {
27
33
  justPicker: hideDate && hideTime,
28
34
  withAnyPicker,
@@ -52,6 +58,7 @@ const ControlledDateTimePickerContent = () => {
52
58
  onBlur: trackFocusResetter,
53
59
  "data-testid": ControlledDateTimePickerDatatestid.CONTAINER,
54
60
  ...styledsAttrs,
61
+ ...ariaAndDataProps,
55
62
  ...globalAttrs,
56
63
  ...xstyledAttrs,
57
64
  children: [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledDateTimePickerContent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX';\nimport { StyledInputsWrapperGrid } from './Styleds';\nimport { DateInputs } from './DateInputs/DateInputs';\nimport { TimeInputs } from './TimeInputs/TimeInputs';\nimport { PickersIcons } from './Pickers/PickersIcons';\nimport { ClearButton } from './ClearButton/ClearButton';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled },\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n trackFocusResetter,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\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 <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={trackFocusResetter}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n {...styledsAttrs}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2CnB,mBAiBuB,KAGjB,YApBN;AA1CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,0CAA0C;AAE5C,MAAM,kCAAkC,MAAmB;AAChE,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,QAAM,eAAe;AAAA,IACnB,YAAY,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW,CAAC;AAClB,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI;AAAwB,aAAS,KAAK,MAAM;AAEhD,QAAM,mBAAmB,CAAC;AAC1B,MAAI;AAA8B,qBAAiB,KAAK,MAAM;AAC9D,MAAI;AAAe,qBAAiB,KAAK,MAAM;AAE/C,SACE,gCAKE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP,IAAI,CAAC,yBAAyB,QAAQ;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,eAAa,mCAAmC;AAAA,MAC/C,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,mBAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,WAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,yBACC,qBAAC,QAAK,MAAM,kBACT;AAAA,yCAA+B,oBAAC,eAAY,IAAK;AAAA,UACjD,gBAAgB,oBAAC,gBAAa,IAAK;AAAA,WACtC,IACE;AAAA;AAAA;AAAA,EACN,GACF;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props,\n props: { hasError, disabled },\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n trackFocusResetter,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTAINER]),\n [props],\n );\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\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 <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={trackFocusResetter}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n {...styledsAttrs}\n {...ariaAndDataProps}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiDnB,mBAkBuB,KAGjB,YArBN;AAhDJ,OAAOA,UAAS,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,0CAA0C;AAE5C,MAAM,kCAAkC,MAAmB;AAChE,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAM,sBAAsB,MAAM,mCAAmC,SAAS,CAAC;AAAA,IAC/E,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,eAAe;AAAA,IACnB,YAAY,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW,CAAC;AAClB,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI;AAAwB,aAAS,KAAK,MAAM;AAEhD,QAAM,mBAAmB,CAAC;AAC1B,MAAI;AAA8B,qBAAiB,KAAK,MAAM;AAC9D,MAAI;AAAe,qBAAiB,KAAK,MAAM;AAE/C,SACE,gCAKE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP,IAAI,CAAC,yBAAyB,QAAQ;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,eAAa,mCAAmC;AAAA,MAC/C,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,mBAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,WAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,yBACC,qBAAC,QAAK,MAAM,kBACT;AAAA,yCAA+B,oBAAC,eAAY,IAAK;AAAA,UACjD,gBAAgB,oBAAC,gBAAa,IAAK;AAAA,WACtC,IACE;AAAA;AAAA;AAAA,EACN,GACF;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React2, { useCallback } from "react";
4
- import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid";
5
- import { Styled2DigitsInput } from "../Styleds";
4
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
5
+ import { Styled2DigitsInput } from "../Styleds.js";
6
6
  const regExpNumbers = /^[0-9]+$/;
7
7
  const isInvalidDay = (day) => {
8
8
  if (day === "")
@@ -21,7 +21,8 @@ const DDInput = React2.memo(
21
21
  contextRef,
22
22
  placeholder,
23
23
  ariaCurrentValueForInputs,
24
- isFocused
24
+ isFocused,
25
+ ariaAndDataProps
25
26
  }) => {
26
27
  const validateOnChange = useCallback(
27
28
  (e) => {
@@ -50,7 +51,8 @@ const DDInput = React2.memo(
50
51
  "aria-label": `day input field, ${ariaCurrentValueForInputs}`,
51
52
  "data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY,
52
53
  disabled,
53
- "aria-disabled": disabled
54
+ "aria-disabled": disabled,
55
+ ...ariaAndDataProps
54
56
  }
55
57
  );
56
58
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DDInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { Styled2DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n isFocused: boolean;\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n contextRef,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgDjB;AAhDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,0BAA0B;AAGnC,MAAM,gBAAgB;AACtB,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,QAAQ;AAAI,WAAO;AACvB,QAAM,aAAa,cAAc,KAAK,GAAG;AACzC,SAAO,IAAI,SAAS,KAAK,QAAQ,QAAQ,CAAC,cAAc,OAAO,SAAS,KAAK,EAAE,IAAI;AACrF;AAcO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,aAAa,GAAG,eAAe,KAAK,GAAG;AACzC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,oBAAoB;AAAA,QAChC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n isFocused: boolean;\n ariaAndDataProps?: AriaAndDataProps;\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n contextRef,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n ariaAndDataProps,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkDjB;AAlDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,0BAA0B;AAGnC,MAAM,gBAAgB;AACtB,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,QAAQ;AAAI,WAAO;AACvB,QAAM,aAAa,cAAc,KAAK,GAAG;AACzC,SAAO,IAAI,SAAS,KAAK,QAAQ,QAAQ,CAAC,cAAc,OAAO,SAAS,KAAK,EAAE,IAAI;AACrF;AAeO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,aAAa,GAAG,eAAe,KAAK,GAAG;AACzC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,oBAAoB;AAAA,QAChC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,14 +1,16 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
4
  import { Grid } from "@elliemae/ds-grid";
5
- import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
6
- import { MMInput } from "./MMInput";
7
- import { DDInput } from "./DDInput";
8
- import { YYYYInput } from "./YYYYInput";
9
- import { StyledFocusWithIn, StyledSeparator } from "../Styleds";
10
- import { useDateInputs } from "./useDateInputs";
11
- import { fixedValues } from "../config";
5
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
6
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
7
+ import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
8
+ import { MMInput } from "./MMInput.js";
9
+ import { DDInput } from "./DDInput.js";
10
+ import { YYYYInput } from "./YYYYInput.js";
11
+ import { StyledFocusWithIn, StyledSeparator } from "../Styleds.js";
12
+ import { useDateInputs } from "./useDateInputs.js";
13
+ import { fixedValues } from "../config.js";
12
14
  const DateInputs = () => {
13
15
  const {
14
16
  month,
@@ -36,8 +38,21 @@ const DateInputs = () => {
36
38
  yearInputRef,
37
39
  ariaCurrentValueForInputs,
38
40
  latestInteractionRegion,
39
- currFocusDescriber
41
+ currFocusDescriber,
42
+ props
40
43
  } = useContext(ControlledDateTimePickerContext);
44
+ const ariaAndDataPropsMonth = React2.useMemo(
45
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH]),
46
+ [props]
47
+ );
48
+ const ariaAndDataPropsDay = React2.useMemo(
49
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY]),
50
+ [props]
51
+ );
52
+ const ariaAndDataPropsYear = React2.useMemo(
53
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR]),
54
+ [props]
55
+ );
41
56
  return /* @__PURE__ */ jsxs(
42
57
  Grid,
43
58
  {
@@ -63,7 +78,8 @@ const DateInputs = () => {
63
78
  placeholder: "MM",
64
79
  ariaCurrentValueForInputs,
65
80
  disabled,
66
- isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "month-input"
81
+ isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "month-input",
82
+ ariaAndDataProps: ariaAndDataPropsMonth
67
83
  }
68
84
  ) }),
69
85
  /* @__PURE__ */ jsx(StyledSeparator, { alignItems: "center", children: "/" }),
@@ -79,7 +95,8 @@ const DateInputs = () => {
79
95
  placeholder: "DD",
80
96
  ariaCurrentValueForInputs,
81
97
  disabled,
82
- isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "day-input"
98
+ isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "day-input",
99
+ ariaAndDataProps: ariaAndDataPropsDay
83
100
  }
84
101
  ) }),
85
102
  /* @__PURE__ */ jsx(StyledSeparator, { alignItems: "center", children: "/" }),
@@ -95,7 +112,8 @@ const DateInputs = () => {
95
112
  placeholder: "YYYY",
96
113
  ariaCurrentValueForInputs,
97
114
  disabled,
98
- isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "year-input"
115
+ isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "year-input",
116
+ ariaAndDataProps: ariaAndDataPropsYear
99
117
  }
100
118
  ) })
101
119
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DateInputs.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\n\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { MMInput } from './MMInput';\nimport { DDInput } from './DDInput';\nimport { YYYYInput } from './YYYYInput';\nimport { StyledFocusWithIn, StyledSeparator } from '../Styleds';\nimport { useDateInputs } from './useDateInputs';\nimport { fixedValues } from '../config';\n\nexport const DateInputs = (): JSX.Element => {\n const {\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n onMonthChange,\n onDayChange,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthFocus,\n onDayFocus,\n onYearFocus,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n disabled,\n } = useDateInputs();\n // we do this here so MMInput,DDInput,YYYYInput can be pure component memoized via React.memo\n const {\n monthInputRef,\n dayInputRef,\n yearInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.largeInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <MMInput\n onChange={onMonthChange}\n onBlur={onMonthBlur}\n onFocus={onMonthFocus}\n onKeyDown={onMonthKeyDown}\n value={month}\n contextRef={monthInputRef}\n innerRef={innerRefMonthInput}\n autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <DDInput\n onChange={onDayChange}\n onBlur={onDayBlur}\n onFocus={onDayFocus}\n onKeyDown={onDayKeyDown}\n value={day}\n contextRef={dayInputRef}\n placeholder=\"DD\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <YYYYInput\n onChange={onYearChange}\n onBlur={onYearBlur}\n onFocus={onYearFocus}\n onKeyDown={onYearKeyDown}\n value={year}\n contextRef={yearInputRef}\n placeholder=\"YYYY\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2CnB,SAUI,KAVJ;AA3CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AAErB,SAAS,uCAAuC;AAChD,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAErB,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;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,EACF,IAAI,cAAc;AAElB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,4BAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,UAAU;AAAA,YACV;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { MMInput } from './MMInput.js';\nimport { DDInput } from './DDInput.js';\nimport { YYYYInput } from './YYYYInput.js';\nimport { StyledFocusWithIn, StyledSeparator } from '../Styleds.js';\nimport { useDateInputs } from './useDateInputs.js';\nimport { fixedValues } from '../config.js';\n\nexport const DateInputs = (): JSX.Element => {\n const {\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n onMonthChange,\n onDayChange,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthFocus,\n onDayFocus,\n onYearFocus,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n disabled,\n } = useDateInputs();\n // we do this here so MMInput,DDInput,YYYYInput can be pure component memoized via React.memo\n const {\n monthInputRef,\n dayInputRef,\n yearInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n props,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataPropsMonth = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH]),\n [props],\n );\n const ariaAndDataPropsDay = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY]),\n [props],\n );\n const ariaAndDataPropsYear = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR]),\n [props],\n );\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.largeInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <MMInput\n onChange={onMonthChange}\n onBlur={onMonthBlur}\n onFocus={onMonthFocus}\n onKeyDown={onMonthKeyDown}\n value={month}\n contextRef={monthInputRef}\n innerRef={innerRefMonthInput}\n autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n ariaAndDataProps={ariaAndDataPropsMonth}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <DDInput\n onChange={onDayChange}\n onBlur={onDayBlur}\n onFocus={onDayFocus}\n onKeyDown={onDayKeyDown}\n value={day}\n contextRef={dayInputRef}\n placeholder=\"DD\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n ariaAndDataProps={ariaAndDataPropsDay}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <YYYYInput\n onChange={onYearChange}\n onBlur={onYearBlur}\n onFocus={onYearFocus}\n onKeyDown={onYearKeyDown}\n value={year}\n contextRef={yearInputRef}\n placeholder=\"YYYY\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n ariaAndDataProps={ariaAndDataPropsYear}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACyDnB,SAUI,KAVJ;AAzDJ,OAAOA,UAAS,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAErB,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;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,EACF,IAAI,cAAc;AAElB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,wBAAwBA,OAAM;AAAA,IAClC,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,KAAK,CAAC;AAAA,IACvF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,sBAAsBA,OAAM;AAAA,IAChC,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,GAAG,CAAC;AAAA,IACrF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,uBAAuBA,OAAM;AAAA,IACjC,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,IAAI,CAAC;AAAA,IACtF,CAAC,KAAK;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,4BAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,UAAU;AAAA,YACV;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -2,8 +2,8 @@ import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React2, { useCallback, useMemo } from "react";
4
4
  import { setMultipleRefs } from "@elliemae/ds-utilities";
5
- import { Styled2DigitsInput } from "../Styleds";
6
- import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid";
5
+ import { Styled2DigitsInput } from "../Styleds.js";
6
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
7
7
  const regExpNumbers = /^[0-9]+$/;
8
8
  const isInvalidMonth = (month) => {
9
9
  if (month === "")
@@ -24,7 +24,8 @@ const MMInput = React2.memo(
24
24
  innerRef,
25
25
  autoFocusMonthInput,
26
26
  ariaCurrentValueForInputs,
27
- isFocused
27
+ isFocused,
28
+ ariaAndDataProps
28
29
  }) => {
29
30
  const validateOnChange = useCallback(
30
31
  (e) => {
@@ -64,7 +65,8 @@ const MMInput = React2.memo(
64
65
  "aria-label": `month input field, ${ariaCurrentValueForInputs}`,
65
66
  "data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
66
67
  disabled,
67
- "aria-disabled": disabled
68
+ "aria-disabled": disabled,
69
+ ...ariaAndDataProps
68
70
  }
69
71
  );
70
72
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/MMInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>;\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n innerRef,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={currentRef}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoEjB;AApEN,OAAOA,UAAS,aAAa,eAAe;AAC5C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,CAAC,UAAkB;AACxC,MAAI,UAAU;AAAI,WAAO;AACzB,QAAM,aAAa,cAAc,KAAK,KAAK;AAC3C,SAAO,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAC,cAAc,OAAO,SAAS,OAAO,EAAE,IAAI;AAC3F;AAeO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,eAAe,GAAG,QAAQ,KAAK,GAAG;AACpC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,UAAM,YAAY;AAAA,MAChB,CAAC,YAA8B;AAC7B,QAAC,WAAwD,UAAU;AACnE,YAAI;AAAW,mBAAS,QAAQ;AAAA,MAClC;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AAEA,UAAM,aAAa,QAAQ,MAAM;AAC/B,UAAI,UAAU;AACZ,eAAO,gBAAgB,CAAC,WAAW,QAAQ,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,IACT,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,cAAY,sBAAsB;AAAA,QAClC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>;\n ariaAndDataProps?: AriaAndDataProps;\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n innerRef,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n ariaAndDataProps,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={currentRef}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACsEjB;AAtEN,OAAOA,UAAS,aAAa,eAAe;AAC5C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,CAAC,UAAkB;AACxC,MAAI,UAAU;AAAI,WAAO;AACzB,QAAM,aAAa,cAAc,KAAK,KAAK;AAC3C,SAAO,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAC,cAAc,OAAO,SAAS,OAAO,EAAE,IAAI;AAC3F;AAgBO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;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,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,eAAe,GAAG,QAAQ,KAAK,GAAG;AACpC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,UAAM,YAAY;AAAA,MAChB,CAAC,YAA8B;AAC7B,QAAC,WAAwD,UAAU;AACnE,YAAI;AAAW,mBAAS,QAAQ;AAAA,MAClC;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AAEA,UAAM,aAAa,QAAQ,MAAM;AAC/B,UAAI,UAAU;AACZ,eAAO,gBAAgB,CAAC,WAAW,QAAQ,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,IACT,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,cAAY,sBAAsB;AAAA,QAClC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React2, { useCallback } from "react";
4
- import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid";
5
- import { StyledMin4DigitsInput } from "../Styleds";
4
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
5
+ import { StyledMin4DigitsInput } from "../Styleds.js";
6
6
  const regExpNumbers = /^[0-9]+$/;
7
7
  const isInvalidYear = (year) => {
8
8
  if (year === "")
@@ -21,7 +21,8 @@ const YYYYInput = React2.memo(
21
21
  placeholder,
22
22
  contextRef,
23
23
  ariaCurrentValueForInputs,
24
- isFocused
24
+ isFocused,
25
+ ariaAndDataProps
25
26
  }) => {
26
27
  const validateOnChange = useCallback(
27
28
  (e) => {
@@ -50,7 +51,8 @@ const YYYYInput = React2.memo(
50
51
  "aria-label": `year input field, ${ariaCurrentValueForInputs}`,
51
52
  "data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR,
52
53
  disabled,
53
- "aria-disabled": disabled
54
+ "aria-disabled": disabled,
55
+ ...ariaAndDataProps
54
56
  }
55
57
  );
56
58
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/YYYYInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { StyledMin4DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n ariaCurrentValueForInputs,\n isFocused,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledMin4DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgDjB;AAhDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,6BAA6B;AAGtC,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,SAAiB;AACtC,MAAI,SAAS;AAAI,WAAO;AACxB,QAAM,aAAa,cAAc,KAAK,IAAI;AAC1C,SAAO,KAAK,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,MAAM,EAAE,IAAI;AACvE;AAcO,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAqC;AACnC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,GAAG,eAAe,KAAK,GAAG;AAC1C,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledMin4DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n ariaAndDataProps?: AriaAndDataProps;\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n ariaCurrentValueForInputs,\n isFocused,\n ariaAndDataProps,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledMin4DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkDjB;AAlDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,6BAA6B;AAGtC,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,SAAiB;AACtC,MAAI,SAAS;AAAI,WAAO;AACxB,QAAM,aAAa,cAAc,KAAK,IAAI;AAC1C,SAAO,KAAK,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,MAAM,EAAE,IAAI;AACvE;AAeO,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAqC;AACnC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,GAAG,eAAe,KAAK,GAAG;AAC1C,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }