@elliemae/ds-controlled-form 2.4.2-rc.1 → 2.4.2-rc.13

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 (272) hide show
  1. package/cjs/autocomplete/config/useAutocomplete.js +0 -1
  2. package/cjs/autocomplete/parts/A11yFocusedOption.js +46 -0
  3. package/cjs/autocomplete/parts/container/Container.js +36 -24
  4. package/cjs/autocomplete/parts/container/styled.js +2 -2
  5. package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  6. package/cjs/autocomplete/parts/menu-list/MenuList.js +6 -6
  7. package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
  8. package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  9. package/cjs/autocomplete/parts/styled.js +2 -0
  10. package/cjs/autocomplete/utils/listHelper.js +1 -1
  11. package/cjs/checkbox/ControlledCheckbox.js +1 -1
  12. package/cjs/checkbox/config/useValidateProps.js +6 -3
  13. package/cjs/checkbox/react-desc-prop-types.js +2 -1
  14. package/cjs/checkbox/styles.js +73 -27
  15. package/cjs/checkbox/utils/styleHelpers.js +20 -2
  16. package/cjs/combobox/ComboBoxCTX.js +6 -3
  17. package/cjs/combobox/config/useComboBox.js +16 -6
  18. package/cjs/combobox/config/useCorrectOptions.js +1 -2
  19. package/cjs/combobox/parts/A11yFocusedOption.js +14 -6
  20. package/cjs/combobox/parts/A11ySelectedValues.js +2 -4
  21. package/cjs/combobox/parts/DropdownIndicator.js +15 -7
  22. package/cjs/combobox/parts/container/Container.js +11 -14
  23. package/cjs/combobox/parts/container/styled.js +11 -10
  24. package/cjs/combobox/parts/controls/Controls.js +19 -27
  25. package/cjs/combobox/parts/controls/styled.js +54 -22
  26. package/cjs/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  27. package/cjs/combobox/parts/controls-input/ControlsInput.js +2 -2
  28. package/cjs/combobox/parts/controls-input/styled.js +41 -11
  29. package/cjs/combobox/parts/controls-input/useControlsInput.js +4 -7
  30. package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +19 -28
  31. package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  32. package/cjs/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  33. package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
  34. package/cjs/combobox/parts/header-list/styled.js +39 -10
  35. package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  36. package/cjs/combobox/parts/menu-list/MenuList.js +8 -6
  37. package/cjs/combobox/parts/menu-list/styled.js +38 -20
  38. package/cjs/combobox/parts/menu-list/useItemRenderer.js +18 -17
  39. package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  40. package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  41. package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  42. package/cjs/combobox/parts/styled.js +6 -7
  43. package/cjs/combobox/react-desc-prop-types.js +3 -2
  44. package/cjs/combobox/sharedTypes.js +2 -2
  45. package/cjs/combobox/utils/listHelper.js +14 -9
  46. package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
  47. package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  48. package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  49. package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  50. package/cjs/date-time-picker/config/useChangeHandlers.js +11 -15
  51. package/cjs/date-time-picker/config/useControlledDateTimePicker.js +14 -10
  52. package/cjs/date-time-picker/config/useFocusTracker.js +136 -0
  53. package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
  54. package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  55. package/cjs/date-time-picker/config/useGetReferences.js +39 -18
  56. package/cjs/date-time-picker/config/useGlobalKeyHandlers.js +8 -12
  57. package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  58. package/cjs/date-time-picker/config/useValidateProps.js +42 -11
  59. package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +10 -2
  60. package/cjs/date-time-picker/parts/ClearButton/useClearButton.js +12 -25
  61. package/cjs/date-time-picker/parts/ControlledDateTimePickerContent.js +4 -7
  62. package/cjs/date-time-picker/parts/DateInputs/DDInput.js +8 -6
  63. package/cjs/date-time-picker/parts/DateInputs/DateInputs.js +9 -4
  64. package/cjs/date-time-picker/parts/DateInputs/MMInput.js +8 -6
  65. package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +8 -6
  66. package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +84 -113
  67. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  68. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +25 -7
  69. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  70. package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +21 -17
  71. package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
  72. package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +13 -14
  73. package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  74. package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +2 -39
  75. package/cjs/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +40 -73
  76. package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +18 -29
  77. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -1
  78. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +19 -27
  79. package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +15 -11
  80. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +17 -13
  81. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +15 -11
  82. package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  83. package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
  84. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
  85. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  86. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  87. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +36 -230
  88. package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +12 -17
  89. package/cjs/date-time-picker/parts/Styleds.js +12 -6
  90. package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +7 -3
  91. package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +8 -7
  92. package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +8 -6
  93. package/cjs/date-time-picker/parts/TimeInputs/TimeInputs.js +11 -6
  94. package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +55 -97
  95. package/cjs/date-time-picker/utils/constants.js +0 -12
  96. package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
  97. package/cjs/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +38 -36
  98. package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  99. package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
  100. package/cjs/input-group/InputGroup.js +8 -7
  101. package/cjs/input-group/exported-related/data-test-ids.js +12 -0
  102. package/cjs/input-group/exported-related/index.js +12 -0
  103. package/cjs/input-group/exported-related/theming.js +13 -0
  104. package/cjs/input-group/styled.js +90 -23
  105. package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
  106. package/cjs/large-text-input/styles.js +27 -13
  107. package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
  108. package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
  109. package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
  110. package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
  111. package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
  112. package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
  113. package/cjs/mask-hook/utils/flatStringArray.js +0 -1
  114. package/cjs/text-input/config/useInputText.js +0 -1
  115. package/cjs/text-input/styled/borders.js +18 -11
  116. package/cjs/text-input/styled/components.js +49 -10
  117. package/cjs/toggle/ControlledToggle.js +2 -3
  118. package/cjs/toggle/styles.js +7 -5
  119. package/esm/autocomplete/config/useAutocomplete.js +0 -1
  120. package/esm/autocomplete/parts/A11yFocusedOption.js +36 -0
  121. package/esm/autocomplete/parts/container/Container.js +39 -27
  122. package/esm/autocomplete/parts/container/styled.js +2 -2
  123. package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  124. package/esm/autocomplete/parts/menu-list/MenuList.js +7 -7
  125. package/esm/autocomplete/parts/menu-list/styled.js +2 -2
  126. package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  127. package/esm/autocomplete/parts/styled.js +1 -0
  128. package/esm/autocomplete/utils/listHelper.js +1 -1
  129. package/esm/checkbox/ControlledCheckbox.js +2 -2
  130. package/esm/checkbox/config/useValidateProps.js +6 -3
  131. package/esm/checkbox/react-desc-prop-types.js +2 -1
  132. package/esm/checkbox/styles.js +73 -24
  133. package/esm/checkbox/utils/styleHelpers.js +20 -2
  134. package/esm/combobox/ComboBoxCTX.js +6 -3
  135. package/esm/combobox/config/useComboBox.js +16 -6
  136. package/esm/combobox/config/useCorrectOptions.js +1 -2
  137. package/esm/combobox/parts/A11yFocusedOption.js +15 -7
  138. package/esm/combobox/parts/A11ySelectedValues.js +2 -4
  139. package/esm/combobox/parts/DropdownIndicator.js +15 -6
  140. package/esm/combobox/parts/container/Container.js +11 -14
  141. package/esm/combobox/parts/container/styled.js +11 -6
  142. package/esm/combobox/parts/controls/Controls.js +19 -27
  143. package/esm/combobox/parts/controls/styled.js +54 -18
  144. package/esm/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  145. package/esm/combobox/parts/controls-input/ControlsInput.js +2 -2
  146. package/esm/combobox/parts/controls-input/styled.js +41 -7
  147. package/esm/combobox/parts/controls-input/useControlsInput.js +4 -7
  148. package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +20 -29
  149. package/esm/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  150. package/esm/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  151. package/esm/combobox/parts/header-list/HeaderList.js +1 -1
  152. package/esm/combobox/parts/header-list/styled.js +40 -7
  153. package/esm/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  154. package/esm/combobox/parts/menu-list/MenuList.js +8 -6
  155. package/esm/combobox/parts/menu-list/styled.js +38 -17
  156. package/esm/combobox/parts/menu-list/useItemRenderer.js +20 -19
  157. package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  158. package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  159. package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  160. package/esm/combobox/parts/styled.js +6 -3
  161. package/esm/combobox/react-desc-prop-types.js +3 -2
  162. package/esm/combobox/sharedTypes.js +2 -2
  163. package/esm/combobox/utils/listHelper.js +14 -10
  164. package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
  165. package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  166. package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  167. package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  168. package/esm/date-time-picker/config/useChangeHandlers.js +11 -15
  169. package/esm/date-time-picker/config/useControlledDateTimePicker.js +14 -10
  170. package/esm/date-time-picker/config/useFocusTracker.js +132 -0
  171. package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
  172. package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  173. package/esm/date-time-picker/config/useGetReferences.js +40 -19
  174. package/esm/date-time-picker/config/useGlobalKeyHandlers.js +8 -12
  175. package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  176. package/esm/date-time-picker/config/useValidateProps.js +42 -11
  177. package/esm/date-time-picker/parts/ClearButton/ClearButton.js +10 -2
  178. package/esm/date-time-picker/parts/ClearButton/useClearButton.js +12 -25
  179. package/esm/date-time-picker/parts/ControlledDateTimePickerContent.js +4 -7
  180. package/esm/date-time-picker/parts/DateInputs/DDInput.js +8 -6
  181. package/esm/date-time-picker/parts/DateInputs/DateInputs.js +9 -4
  182. package/esm/date-time-picker/parts/DateInputs/MMInput.js +8 -6
  183. package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +8 -6
  184. package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +85 -114
  185. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  186. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +26 -8
  187. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  188. package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +21 -17
  189. package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
  190. package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +12 -13
  191. package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  192. package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +3 -40
  193. package/esm/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +40 -73
  194. package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +18 -29
  195. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -1
  196. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +19 -27
  197. package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +16 -12
  198. package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +18 -14
  199. package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +16 -12
  200. package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  201. package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
  202. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
  203. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  204. package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  205. package/esm/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +36 -230
  206. package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +12 -17
  207. package/esm/date-time-picker/parts/Styleds.js +12 -6
  208. package/esm/date-time-picker/parts/TimeInputs/HHInput.js +7 -3
  209. package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +8 -7
  210. package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +8 -6
  211. package/esm/date-time-picker/parts/TimeInputs/TimeInputs.js +11 -6
  212. package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +55 -97
  213. package/esm/date-time-picker/utils/constants.js +1 -7
  214. package/esm/date-time-picker/utils/dateHelpers.js +17 -34
  215. package/esm/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +38 -36
  216. package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  217. package/esm/date-time-picker/utils/stringHelpers.js +5 -11
  218. package/esm/input-group/InputGroup.js +5 -4
  219. package/esm/input-group/exported-related/data-test-ids.js +8 -0
  220. package/esm/input-group/exported-related/index.js +2 -0
  221. package/esm/input-group/exported-related/theming.js +8 -0
  222. package/esm/input-group/styled.js +89 -18
  223. package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
  224. package/esm/large-text-input/styles.js +27 -9
  225. package/esm/mask-hook/hooks/useNumberMask.js +1 -5
  226. package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
  227. package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
  228. package/esm/mask-hook/hooks/useSSNMask.js +1 -4
  229. package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
  230. package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
  231. package/esm/mask-hook/utils/flatStringArray.js +0 -1
  232. package/esm/text-input/config/useInputText.js +0 -1
  233. package/esm/text-input/styled/borders.js +18 -7
  234. package/esm/text-input/styled/components.js +49 -6
  235. package/esm/toggle/ControlledToggle.js +0 -1
  236. package/esm/toggle/styles.js +7 -5
  237. package/package.json +39 -15
  238. package/types/autocomplete/parts/A11yFocusedOption.d.ts +5 -0
  239. package/types/autocomplete/parts/container/styled.d.ts +1 -1
  240. package/types/autocomplete/parts/styled.d.ts +0 -0
  241. package/types/autocomplete/utils/listHelper.d.ts +5 -5
  242. package/types/checkbox/react-desc-prop-types.d.ts +1 -1
  243. package/types/checkbox/styles.d.ts +1 -0
  244. package/types/combobox/parts/menu-list/styled.d.ts +1 -0
  245. package/types/combobox/react-desc-prop-types.d.ts +8 -6
  246. package/types/combobox/sharedTypes.d.ts +3 -2
  247. package/types/combobox/utils/listHelper.d.ts +1 -0
  248. package/types/date-time-picker/config/useChangeHandlers.d.ts +3 -1
  249. package/types/date-time-picker/config/useControlledDateTimePicker.d.ts +2 -5
  250. package/types/date-time-picker/config/useFocusTracker.d.ts +38 -0
  251. package/types/date-time-picker/config/useGetPropsBasedOnType.d.ts +6 -6
  252. package/types/date-time-picker/config/useGetReferences.d.ts +30 -36
  253. package/types/date-time-picker/config/useGlobalKeyHandlers.d.ts +3 -1
  254. package/types/date-time-picker/parts/DateInputs/DDInput.d.ts +2 -1
  255. package/types/date-time-picker/parts/DateInputs/MMInput.d.ts +2 -1
  256. package/types/date-time-picker/parts/DateInputs/YYYYInput.d.ts +2 -1
  257. package/types/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +14 -0
  258. package/types/date-time-picker/parts/Pickers/Calendar/useFocusLogic.d.ts +1 -2
  259. package/types/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +19 -0
  260. package/types/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +0 -6
  261. package/types/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +14 -0
  262. package/types/date-time-picker/parts/TimeInputs/HHInput.d.ts +2 -1
  263. package/types/date-time-picker/parts/TimeInputs/MeridiemInput.d.ts +2 -1
  264. package/types/date-time-picker/parts/TimeInputs/MinutesInput.d.ts +2 -1
  265. package/types/date-time-picker/propTypes.d.ts +117 -0
  266. package/types/date-time-picker/sharedTypes.d.ts +1 -1
  267. package/types/date-time-picker/utils/constants.d.ts +0 -6
  268. package/types/input-group/exported-related/data-test-ids.d.ts +6 -0
  269. package/types/input-group/exported-related/index.d.ts +2 -0
  270. package/types/input-group/exported-related/theming.d.ts +6 -0
  271. package/types/input-group/styled.d.ts +4 -7
  272. package/types/text-input/config/useInputText.d.ts +4 -4
@@ -2,46 +2,77 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/es.error.cause.js');
5
6
  var stringHelpers = require('../utils/stringHelpers.js');
6
7
  var numberHelpers = require('../utils/numberHelpers.js');
7
8
  var typeGuards = require('../utils/typeGuards.js');
8
9
 
9
- /* eslint-disable max-statements */
10
- const PREPEND = "ControlledDateTimePicker:\n Invalid configuration detected::\n \n ";
10
+ const PREPEND = `ControlledDateTimePicker:
11
+ Invalid configuration detected::
12
+
13
+ `;
11
14
  const NOT_A_DEFECT = ''; // '\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';
12
15
 
13
- const INLINE_RECEIVED_PREPEND = "\n\n Received:";
16
+ const INLINE_RECEIVED_PREPEND = `
17
+
18
+ Received:`;
14
19
 
15
20
  const throwInvalidDateTimeError = invalidValue => {
16
- throw new Error("".concat(PREPEND, "the \"dateTime\" you are providing is not respecting the format it must respect.").concat(INLINE_RECEIVED_PREPEND).concat(invalidValue, "(").concat(typeof invalidValue, ")").concat(NOT_A_DEFECT));
21
+ throw new Error(`${PREPEND}the "dateTime" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
17
22
  };
18
23
 
19
24
  const throwInvalidDaterror = invalidValue => {
20
- throw new Error("".concat(PREPEND, "the \"date\" you are providing is not respecting the format it must respect.").concat(INLINE_RECEIVED_PREPEND).concat(invalidValue, "(").concat(typeof invalidValue, ")").concat(NOT_A_DEFECT));
25
+ throw new Error(`${PREPEND}the "date" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
21
26
  };
22
27
 
23
28
  const throwInvalidTimerror = invalidValue => {
24
- throw new Error("".concat(PREPEND, "the \"time\" you are providing is not respecting the format it must respect.").concat(INLINE_RECEIVED_PREPEND).concat(invalidValue, "(").concat(typeof invalidValue, ")").concat(NOT_A_DEFECT));
29
+ throw new Error(`${PREPEND}the "time" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
25
30
  };
26
31
 
27
32
  const throwUncontrolledDateError = (date, onDateChange) => {
28
- throw new Error("".concat(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: ").concat(date, "(").concat(typeof date, ")\n onDateChange: (").concat(typeof onDateChange, ")\n ").concat(NOT_A_DEFECT));
33
+ throw new Error(`${PREPEND}you are trying to use a date selector while providing a non-string "date" or providing a non-function to "onDateChange"
34
+ the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
35
+
36
+ Received:
37
+ date: ${date}(${typeof date})
38
+ onDateChange: (${typeof onDateChange})
39
+ ${NOT_A_DEFECT}`);
29
40
  };
30
41
 
31
42
  const throwUncontrolledTimeError = (time, onTimeChange) => {
32
- throw new Error("".concat(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: ").concat(time, "(").concat(typeof time, ")\n onTimeChange: (").concat(typeof onTimeChange, ")\n ").concat(NOT_A_DEFECT));
43
+ throw new Error(`${PREPEND}you are trying to use a time selector while providing a non-string "time" or providing a non-function to "onTimeChange"
44
+ the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
45
+
46
+ Received:
47
+ time: ${time}(${typeof time})
48
+ onTimeChange: (${typeof onTimeChange})
49
+ ${NOT_A_DEFECT}`);
33
50
  };
34
51
 
35
52
  const throwUncontrolledDateTimeError = (dateTime, onDateTimeChange) => {
36
- throw new Error("".concat(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: ").concat(dateTime, "(").concat(typeof dateTime, ")\n onDateTimeChange: (").concat(typeof onDateTimeChange, ")\n ").concat(NOT_A_DEFECT));
53
+ throw new Error(`${PREPEND}you are trying to use a date-time selector while providing a non-string "dateTime" or providing a non-function to "onDateTimeChange"
54
+ the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
55
+
56
+ Received:
57
+ dateTime: ${dateTime}(${typeof dateTime})
58
+ onDateTimeChange: (${typeof onDateTimeChange})
59
+ ${NOT_A_DEFECT}`);
37
60
  };
38
61
 
39
62
  const throwInvalidEmptyPickerStartingMonthError = emptyPickerStartingMonth => {
40
- throw new Error("".concat(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 ").concat(emptyPickerStartingMonth, "(").concat(typeof emptyPickerStartingMonth, ")\n ").concat(NOT_A_DEFECT));
63
+ throw new Error(`${PREPEND}the provided emptyPickerStartingMonth props is invalid. please provide a string with the format mm/__/yyyy, (mm 01~12, yyyy 0001~9999)
64
+
65
+ Received:
66
+ ${emptyPickerStartingMonth}(${typeof emptyPickerStartingMonth})
67
+ ${NOT_A_DEFECT}`);
41
68
  };
42
69
 
43
70
  const throwInvalidOnCalendarOpenFocusedDayError = onCalendarOpenFocusedDay => {
44
- throw new Error("".concat(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 ").concat(onCalendarOpenFocusedDay, "(").concat(typeof onCalendarOpenFocusedDay, ")\n ").concat(NOT_A_DEFECT));
71
+ throw new Error(`${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)
72
+
73
+ Received:
74
+ ${onCalendarOpenFocusedDay}(${typeof onCalendarOpenFocusedDay})
75
+ ${NOT_A_DEFECT}`);
45
76
  };
46
77
 
47
78
  const useValidateProps = props => {
@@ -9,12 +9,13 @@ require('core-js/modules/esnext.async-iterator.for-each.js');
9
9
  require('core-js/modules/esnext.iterator.for-each.js');
10
10
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
11
11
  var _jsx = require('@babel/runtime/helpers/jsx');
12
- require('react');
12
+ var React = require('react');
13
13
  var dsIcons = require('@elliemae/ds-icons');
14
14
  var dsIcon = require('@elliemae/ds-icon');
15
15
  var DSButton = require('@elliemae/ds-button');
16
16
  var Styleds = require('../Styleds.js');
17
17
  var ControlledDateTimePickerDatatestid = require('../../ControlledDateTimePickerDatatestid.js');
18
+ var ControlledDateTimePickerCTX = require('../../ControlledDateTimePickerCTX.js');
18
19
  var useClearButton = require('./useClearButton.js');
19
20
  var jsxRuntime = require('react/jsx-runtime');
20
21
 
@@ -36,12 +37,19 @@ const ClearButton = () => {
36
37
  const styledsAttrs = {
37
38
  shouldDisplay: withClearBtn
38
39
  };
40
+ const {
41
+ latestInteractionRegion,
42
+ currFocusDescriber
43
+ } = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
39
44
  return /*#__PURE__*/jsxRuntime.jsx(Styleds.StyledClearButton, _objectSpread(_objectSpread({
40
45
  "aria-label": "clear selected date",
41
46
  buttonType: "icon",
42
47
  size: DSButton.BUTTON_SIZES.M,
43
48
  "data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CLEAR_BUTTON,
44
- innerRef: clearButtonRef,
49
+ innerRef: DomElem => {
50
+ clearButtonRef.current = DomElem;
51
+ if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();
52
+ },
45
53
  onClick: onClearClick,
46
54
  onKeyDown: onClearButtonKeyDown
47
55
  }, styledsAttrs), {}, {
@@ -15,32 +15,21 @@ const useClearButton = () => {
15
15
  withAnyInputs,
16
16
  isWithTimeInputs,
17
17
  isWithDateInputs,
18
- isTimeSelector,
19
- hourInputRef,
20
- monthInputRef,
21
- pickerButtonRef,
22
- meridiemInputRef,
23
- yearInputRef,
24
- setLatestInteractionRegion
18
+ trackFocusFirstSegment,
19
+ trackFocusMeridiemInput,
20
+ trackFocusYearInput,
21
+ trackFocusPicker
25
22
  } = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
26
- const focusFirstRegion = React.useCallback(() => {
27
- var _hourInputRef$current, _hourInputRef$current2, _monthInputRef$curren, _monthInputRef$curren2;
28
-
29
- if (withAnyInputs) if (isTimeSelector) hourInputRef === null || hourInputRef === void 0 ? void 0 : (_hourInputRef$current = hourInputRef.current) === null || _hourInputRef$current === void 0 ? void 0 : (_hourInputRef$current2 = _hourInputRef$current.focus) === null || _hourInputRef$current2 === void 0 ? void 0 : _hourInputRef$current2.call(_hourInputRef$current);else monthInputRef === null || monthInputRef === void 0 ? void 0 : (_monthInputRef$curren = monthInputRef.current) === null || _monthInputRef$curren === void 0 ? void 0 : (_monthInputRef$curren2 = _monthInputRef$curren.focus) === null || _monthInputRef$curren2 === void 0 ? void 0 : _monthInputRef$curren2.call(_monthInputRef$curren);
30
- }, [withAnyInputs, isTimeSelector, hourInputRef, monthInputRef]);
31
23
  const onClearClick = React.useCallback(e => {
32
24
  handleClearAll(e);
33
- setLatestInteractionRegion('clear-btn');
34
- focusFirstRegion();
35
- }, [focusFirstRegion, handleClearAll, setLatestInteractionRegion]);
25
+ trackFocusFirstSegment();
26
+ }, [handleClearAll, trackFocusFirstSegment]);
36
27
  const onHomeKeyDown = React.useCallback(() => {
37
- focusFirstRegion();
38
- }, [focusFirstRegion]);
28
+ trackFocusFirstSegment();
29
+ }, [trackFocusFirstSegment]);
39
30
  const onEndKeyDown = React.useCallback(() => {
40
- var _pickerButtonRef$curr, _pickerButtonRef$curr2;
41
-
42
- if (withAnyPicker) pickerButtonRef === null || pickerButtonRef === void 0 ? void 0 : (_pickerButtonRef$curr = pickerButtonRef.current) === null || _pickerButtonRef$curr === void 0 ? void 0 : (_pickerButtonRef$curr2 = _pickerButtonRef$curr.focus) === null || _pickerButtonRef$curr2 === void 0 ? void 0 : _pickerButtonRef$curr2.call(_pickerButtonRef$curr);
43
- }, [withAnyPicker, pickerButtonRef]);
31
+ if (withAnyPicker) trackFocusPicker();
32
+ }, [withAnyPicker, trackFocusPicker]);
44
33
  const onClearButtonKeyDown = React.useCallback(e => {
45
34
  const {
46
35
  key
@@ -53,11 +42,9 @@ const useClearButton = () => {
53
42
  if (key === 'End') onEndKeyDown();
54
43
 
55
44
  if (key === 'Backspace' && withAnyInputs) {
56
- var _meridiemInputRef$cur, _meridiemInputRef$cur2, _yearInputRef$current, _yearInputRef$current2;
57
-
58
- if (isWithTimeInputs) meridiemInputRef === null || meridiemInputRef === void 0 ? void 0 : (_meridiemInputRef$cur = meridiemInputRef.current) === null || _meridiemInputRef$cur === void 0 ? void 0 : (_meridiemInputRef$cur2 = _meridiemInputRef$cur.focus) === null || _meridiemInputRef$cur2 === void 0 ? void 0 : _meridiemInputRef$cur2.call(_meridiemInputRef$cur);else if (isWithDateInputs) yearInputRef === null || yearInputRef === void 0 ? void 0 : (_yearInputRef$current = yearInputRef.current) === null || _yearInputRef$current === void 0 ? void 0 : (_yearInputRef$current2 = _yearInputRef$current.focus) === null || _yearInputRef$current2 === void 0 ? void 0 : _yearInputRef$current2.call(_yearInputRef$current);
45
+ if (isWithTimeInputs) trackFocusMeridiemInput();else if (isWithDateInputs) trackFocusYearInput();
59
46
  }
60
- }, [isWithDateInputs, isWithTimeInputs, meridiemInputRef, onEndKeyDown, onHomeKeyDown, withAnyInputs, yearInputRef]);
47
+ }, [isWithDateInputs, isWithTimeInputs, onEndKeyDown, onHomeKeyDown, trackFocusMeridiemInput, trackFocusYearInput, withAnyInputs]);
61
48
  return React.useMemo(() => ({
62
49
  onClearClick,
63
50
  onClearButtonKeyDown,
@@ -41,13 +41,13 @@ const ControlledDateTimePickerContent = () => {
41
41
  hideTime,
42
42
  hideTimePicker,
43
43
  hideDateTimePicker,
44
- setLatestInteractionRegion,
45
44
  withAnyPicker,
46
45
  withAnyRightController,
47
46
  shouldPreserveClearableSpace,
48
47
  isControllerOnly,
49
48
  dataAttrs,
50
- onGlobalKeyDown
49
+ onGlobalKeyDown,
50
+ trackFocusResetter
51
51
  } = React__default["default"].useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
52
52
  const styledsAttrs = {
53
53
  justPicker: hideDate && hideTime,
@@ -55,9 +55,6 @@ const ControlledDateTimePickerContent = () => {
55
55
  hasError,
56
56
  isControllerOnly
57
57
  };
58
- const resetLatestInteraction = React__default["default"].useCallback(() => {
59
- setLatestInteractionRegion('');
60
- }, [setLatestInteractionRegion]);
61
58
  const mainCols = [];
62
59
  if (!hideDate) mainCols.push('auto');
63
60
  if (!hideTime) mainCols.push('auto');
@@ -70,9 +67,9 @@ const ControlledDateTimePickerContent = () => {
70
67
  cols: mainCols,
71
68
  gutter: "xxs",
72
69
  pr: hideDatePicker && hideTimePicker && hideDateTimePicker ? '2px' : undefined,
73
- onBlur: resetLatestInteraction,
74
70
  onKeyDown: onGlobalKeyDown,
75
- disabled: disabled
71
+ disabled: disabled,
72
+ onBlur: trackFocusResetter
76
73
  }, styledsAttrs), dataAttrs), {}, {
77
74
  children: [hideDate ? null : _DateInputs || (_DateInputs = /*#__PURE__*/_jsx__default["default"](DateInputs.DateInputs, {})), hideTime ? null : _TimeInputs || (_TimeInputs = /*#__PURE__*/_jsx__default["default"](TimeInputs.TimeInputs, {})), withAnyRightController ? /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
78
75
  cols: rightControlCols
@@ -29,12 +29,11 @@ const DDInput = /*#__PURE__*/React__default["default"].memo(_ref => {
29
29
  disabled,
30
30
  contextRef,
31
31
  placeholder,
32
- ariaCurrentValueForInputs
32
+ ariaCurrentValueForInputs,
33
+ isFocused
33
34
  } = _ref;
34
35
  const validateOnChange = React.useCallback(e => {
35
- var _e$target;
36
-
37
- if (isInvalidDay(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
36
+ if (isInvalidDay(e?.target?.value)) {
38
37
  e.preventDefault();
39
38
  return;
40
39
  }
@@ -47,9 +46,12 @@ const DDInput = /*#__PURE__*/React__default["default"].memo(_ref => {
47
46
  onFocus: onFocus,
48
47
  onKeyDown: onKeyDown,
49
48
  value: value,
50
- ref: contextRef,
49
+ ref: DomElem => {
50
+ contextRef.current = DomElem;
51
+ if (isFocused) DomElem?.focus?.();
52
+ },
51
53
  placeholder: placeholder,
52
- "aria-label": "day input field, ".concat(ariaCurrentValueForInputs),
54
+ "aria-label": `day input field, ${ariaCurrentValueForInputs}`,
53
55
  "data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY,
54
56
  disabled: disabled,
55
57
  "aria-disabled": disabled
@@ -43,7 +43,9 @@ const DateInputs = () => {
43
43
  monthInputRef,
44
44
  dayInputRef,
45
45
  yearInputRef,
46
- ariaCurrentValueForInputs
46
+ ariaCurrentValueForInputs,
47
+ latestInteractionRegion,
48
+ currFocusDescriber
47
49
  } = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
48
50
  return /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
49
51
  cols: [config.fixedValues.smallInputWidth, config.fixedValues.separatorWidth, config.fixedValues.smallInputWidth, config.fixedValues.separatorWidth, config.fixedValues.largeInputWidth]
@@ -57,7 +59,8 @@ const DateInputs = () => {
57
59
  autoFocusMonthInput: autoFocusMonthInput,
58
60
  placeholder: "MM",
59
61
  ariaCurrentValueForInputs: ariaCurrentValueForInputs,
60
- disabled: disabled
62
+ disabled: disabled,
63
+ isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'
61
64
  })), _StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](Styleds.StyledSeparator, {
62
65
  alignItems: "center"
63
66
  }, void 0, "/")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](DDInput.DDInput, {
@@ -69,7 +72,8 @@ const DateInputs = () => {
69
72
  contextRef: dayInputRef,
70
73
  placeholder: "DD",
71
74
  ariaCurrentValueForInputs: ariaCurrentValueForInputs,
72
- disabled: disabled
75
+ disabled: disabled,
76
+ isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'
73
77
  })), _StyledSeparator2 || (_StyledSeparator2 = /*#__PURE__*/_jsx__default["default"](Styleds.StyledSeparator, {
74
78
  alignItems: "center"
75
79
  }, void 0, "/")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](YYYYInput.YYYYInput, {
@@ -81,7 +85,8 @@ const DateInputs = () => {
81
85
  contextRef: yearInputRef,
82
86
  placeholder: "YYYY",
83
87
  ariaCurrentValueForInputs: ariaCurrentValueForInputs,
84
- disabled: disabled
88
+ disabled: disabled,
89
+ isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'
85
90
  })));
86
91
  };
87
92
 
@@ -30,12 +30,11 @@ const MMInput = /*#__PURE__*/React__default["default"].memo(_ref => {
30
30
  placeholder,
31
31
  contextRef,
32
32
  autoFocusMonthInput,
33
- ariaCurrentValueForInputs
33
+ ariaCurrentValueForInputs,
34
+ isFocused
34
35
  } = _ref;
35
36
  const validateOnChange = React.useCallback(e => {
36
- var _e$target;
37
-
38
- if (isInvalidMonth(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
37
+ if (isInvalidMonth(e?.target?.value)) {
39
38
  e.preventDefault();
40
39
  return;
41
40
  }
@@ -49,9 +48,12 @@ const MMInput = /*#__PURE__*/React__default["default"].memo(_ref => {
49
48
  onFocus: onFocus,
50
49
  onKeyDown: onKeyDown,
51
50
  value: value,
52
- ref: contextRef,
51
+ ref: DomElem => {
52
+ contextRef.current = DomElem;
53
+ if (isFocused) DomElem?.focus?.();
54
+ },
53
55
  placeholder: placeholder,
54
- "aria-label": "month input field, ".concat(ariaCurrentValueForInputs),
56
+ "aria-label": `month input field, ${ariaCurrentValueForInputs}`,
55
57
  "data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
56
58
  disabled: disabled,
57
59
  "aria-disabled": disabled
@@ -29,12 +29,11 @@ const YYYYInput = /*#__PURE__*/React__default["default"].memo(_ref => {
29
29
  disabled,
30
30
  placeholder,
31
31
  contextRef,
32
- ariaCurrentValueForInputs
32
+ ariaCurrentValueForInputs,
33
+ isFocused
33
34
  } = _ref;
34
35
  const validateOnChange = React.useCallback(e => {
35
- var _e$target;
36
-
37
- if (isInvalidYear(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
36
+ if (isInvalidYear(e?.target?.value)) {
38
37
  e.preventDefault();
39
38
  return;
40
39
  }
@@ -47,9 +46,12 @@ const YYYYInput = /*#__PURE__*/React__default["default"].memo(_ref => {
47
46
  onFocus: onFocus,
48
47
  onKeyDown: onKeyDown,
49
48
  value: value,
50
- ref: contextRef,
49
+ ref: DomElem => {
50
+ contextRef.current = DomElem;
51
+ if (isFocused) DomElem?.focus?.();
52
+ },
51
53
  placeholder: placeholder,
52
- "aria-label": "year input field, ".concat(ariaCurrentValueForInputs),
54
+ "aria-label": `year input field, ${ariaCurrentValueForInputs}`,
53
55
  "data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR,
54
56
  disabled: disabled,
55
57
  "aria-disabled": disabled