@elliemae/ds-controlled-form 2.4.0 → 2.4.1-rc.11

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 (368) hide show
  1. package/cjs/autocomplete/Autocomplete.js +4 -5
  2. package/cjs/autocomplete/AutocompleteCTX.js +3 -14
  3. package/cjs/autocomplete/AutocompleteDataTestids.js +1 -7
  4. package/cjs/autocomplete/config/useAutocomplete.js +23 -10
  5. package/cjs/autocomplete/parts/container/Container.js +36 -20
  6. package/cjs/autocomplete/parts/container/styled.js +1 -5
  7. package/cjs/autocomplete/parts/{controls → container}/useKeyboardNavigation.js +8 -24
  8. package/cjs/autocomplete/parts/menu-list/MenuList.js +17 -50
  9. package/cjs/autocomplete/parts/menu-list/styled.js +9 -10
  10. package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +38 -44
  11. package/cjs/autocomplete/react-desc-prop-types.js +4 -8
  12. package/cjs/autocomplete/utils/listHelper.js +8 -16
  13. package/cjs/checkbox/ControlledCheckbox.js +2 -1
  14. package/cjs/checkbox/react-desc-prop-types.js +2 -0
  15. package/cjs/combobox/ComboBox.js +1 -0
  16. package/cjs/combobox/config/useComboBox.js +8 -2
  17. package/cjs/combobox/config/useCorrectOptions.js +14 -42
  18. package/cjs/combobox/index.js +1 -0
  19. package/cjs/combobox/parts/A11yFocusedOption.js +3 -3
  20. package/cjs/combobox/parts/controls/Controls.js +4 -2
  21. package/cjs/combobox/parts/controls-input/ControlsInput.js +2 -0
  22. package/cjs/combobox/parts/controls-input/styled.js +1 -1
  23. package/cjs/combobox/parts/controls-input/useControlsInput.js +6 -6
  24. package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +30 -26
  25. package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +7 -5
  26. package/cjs/combobox/parts/dropdown-indicator/DropdownIndicator.js +6 -4
  27. package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +4 -4
  28. package/cjs/combobox/parts/menu-list/MenuList.js +13 -7
  29. package/cjs/combobox/parts/menu-list/styled.js +16 -5
  30. package/cjs/combobox/parts/menu-list/useItemRenderer.js +8 -8
  31. package/cjs/combobox/parts/menu-list/useMenuListSetFocusOption.js +6 -6
  32. package/cjs/combobox/react-desc-prop-types.js +2 -1
  33. package/cjs/combobox/utils/listHelper.js +40 -11
  34. package/cjs/date-time-picker/ControlledDateTimePickerCTX.js +1 -114
  35. package/cjs/date-time-picker/ControlledDateTimePickerDatatestid.js +0 -2
  36. package/cjs/date-time-picker/config/useChangeHandlers.js +264 -0
  37. package/cjs/date-time-picker/config/useControlledDateTimePicker.js +37 -420
  38. package/cjs/date-time-picker/config/useGetDestructuredValues.js +25 -68
  39. package/cjs/date-time-picker/config/useGetFlags.js +173 -0
  40. package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +101 -0
  41. package/cjs/date-time-picker/config/useGetPropsWithDefault.js +2 -3
  42. package/cjs/date-time-picker/config/useGetReferences.js +86 -0
  43. package/cjs/date-time-picker/config/useGlobalKeyHandlers.js +106 -0
  44. package/cjs/date-time-picker/config/useRelevantValueFromProps.js +39 -0
  45. package/cjs/date-time-picker/config/useValidateProps.js +47 -42
  46. package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +20 -8
  47. package/cjs/date-time-picker/parts/ControlledDateTimePickerContent.js +14 -12
  48. package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +5 -5
  49. package/cjs/date-time-picker/parts/Pickers/Calendar/Calendar.js +11 -13
  50. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarContent.js +4 -1
  51. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarContext.js +1 -49
  52. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  53. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +10 -7
  54. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +8 -4
  55. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarMonthDays.js +5 -2
  56. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarWrapper.js +5 -2
  57. package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +18 -18
  58. package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +24 -122
  59. package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +32 -4
  60. package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +10 -6
  61. package/cjs/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +30 -14
  62. package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +7 -4
  63. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +7 -3
  64. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +1 -16
  65. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +0 -1
  66. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +10 -10
  67. package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +18 -13
  68. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +60 -33
  69. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +18 -13
  70. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheel.js +11 -13
  71. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +5 -2
  72. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContext.js +1 -65
  73. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +8 -3
  74. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelWrapper.js +5 -2
  75. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +18 -116
  76. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +52 -94
  77. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +4 -1
  78. package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +1 -1
  79. package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +1 -3
  80. package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +1 -1
  81. package/cjs/date-time-picker/parts/TimeInputs/TimeInputs.js +3 -7
  82. package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +3 -6
  83. package/cjs/date-time-picker/propTypes.js +56 -23
  84. package/cjs/{autocomplete/index.d.js → date-time-picker/sharedTypes.js} +0 -0
  85. package/cjs/date-time-picker/utils/dateHelpers.js +56 -56
  86. package/cjs/date-time-picker/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +2 -5
  87. package/cjs/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +50 -47
  88. package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -2
  89. package/cjs/date-time-picker/utils/stringHelpers.js +8 -14
  90. package/cjs/date-time-picker/utils/typeGuards.js +14 -0
  91. package/cjs/index.js +20 -3
  92. package/cjs/large-text-input/DSControlledLargeTextInput.js +83 -0
  93. package/cjs/large-text-input/exported-related/data-test-ids.js +11 -0
  94. package/cjs/large-text-input/exported-related/index.js +12 -0
  95. package/cjs/large-text-input/exported-related/theming.js +13 -0
  96. package/cjs/large-text-input/index.js +15 -0
  97. package/cjs/large-text-input/react-desc-prop-types.js +45 -0
  98. package/cjs/large-text-input/styles.js +40 -0
  99. package/cjs/mask-hook/hooks/index.js +11 -3
  100. package/cjs/mask-hook/hooks/useNumberMask.js +7 -0
  101. package/cjs/mask-hook/hooks/usePhoneMask.js +7 -0
  102. package/cjs/mask-hook/hooks/useRegExpMask.js +122 -0
  103. package/cjs/mask-hook/hooks/useSSNMask.js +7 -0
  104. package/cjs/mask-hook/hooks/{useZipCode.js → useZipCodeMask.js} +12 -5
  105. package/cjs/mask-hook/index.js +11 -3
  106. package/cjs/mask-hook/react-desc-prop-types.js +9 -0
  107. package/cjs/mask-hook/utils/addSpecialCharacters.js +3 -4
  108. package/cjs/mask-hook/utils/flatStringArray.js +18 -0
  109. package/cjs/mask-hook/utils/index.js +2 -0
  110. package/esm/autocomplete/Autocomplete.js +2 -3
  111. package/esm/autocomplete/AutocompleteCTX.js +3 -14
  112. package/esm/autocomplete/AutocompleteDataTestids.js +1 -7
  113. package/esm/autocomplete/config/useAutocomplete.js +27 -14
  114. package/esm/autocomplete/parts/container/Container.js +38 -23
  115. package/esm/autocomplete/parts/container/styled.js +2 -5
  116. package/esm/autocomplete/parts/{controls → container}/useKeyboardNavigation.js +8 -24
  117. package/esm/autocomplete/parts/menu-list/MenuList.js +19 -52
  118. package/esm/autocomplete/parts/menu-list/styled.js +9 -10
  119. package/esm/autocomplete/parts/menu-list/useItemRenderer.js +39 -45
  120. package/esm/autocomplete/react-desc-prop-types.js +5 -8
  121. package/esm/autocomplete/utils/listHelper.js +8 -16
  122. package/esm/checkbox/ControlledCheckbox.js +2 -1
  123. package/esm/checkbox/react-desc-prop-types.js +2 -0
  124. package/esm/combobox/ComboBox.js +1 -1
  125. package/esm/combobox/config/useComboBox.js +8 -2
  126. package/esm/combobox/config/useCorrectOptions.js +15 -43
  127. package/esm/combobox/index.js +1 -1
  128. package/esm/combobox/parts/A11yFocusedOption.js +3 -3
  129. package/esm/combobox/parts/controls/Controls.js +4 -2
  130. package/esm/combobox/parts/controls-input/ControlsInput.js +2 -0
  131. package/esm/combobox/parts/controls-input/styled.js +1 -1
  132. package/esm/combobox/parts/controls-input/useControlsInput.js +6 -6
  133. package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +30 -26
  134. package/esm/combobox/parts/controls-input/useMaskedOnChange.js +7 -5
  135. package/esm/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  136. package/esm/combobox/parts/header-list/useHeaderListHandlers.js +4 -4
  137. package/esm/combobox/parts/menu-list/MenuList.js +13 -7
  138. package/esm/combobox/parts/menu-list/styled.js +16 -5
  139. package/esm/combobox/parts/menu-list/useItemRenderer.js +8 -8
  140. package/esm/combobox/parts/menu-list/useMenuListSetFocusOption.js +6 -6
  141. package/esm/combobox/react-desc-prop-types.js +2 -1
  142. package/esm/combobox/utils/listHelper.js +38 -12
  143. package/esm/date-time-picker/ControlledDateTimePickerCTX.js +3 -115
  144. package/esm/date-time-picker/ControlledDateTimePickerDatatestid.js +0 -2
  145. package/esm/date-time-picker/config/useChangeHandlers.js +256 -0
  146. package/esm/date-time-picker/config/useControlledDateTimePicker.js +38 -421
  147. package/esm/date-time-picker/config/useGetDestructuredValues.js +21 -68
  148. package/esm/date-time-picker/config/useGetFlags.js +165 -0
  149. package/esm/date-time-picker/config/useGetPropsBasedOnType.js +97 -0
  150. package/esm/date-time-picker/config/useGetPropsWithDefault.js +1 -2
  151. package/esm/date-time-picker/config/useGetReferences.js +82 -0
  152. package/esm/date-time-picker/config/useGlobalKeyHandlers.js +98 -0
  153. package/esm/date-time-picker/config/useRelevantValueFromProps.js +35 -0
  154. package/esm/date-time-picker/config/useValidateProps.js +47 -42
  155. package/esm/date-time-picker/parts/ClearButton/ClearButton.js +20 -9
  156. package/esm/date-time-picker/parts/ControlledDateTimePickerContent.js +14 -12
  157. package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +5 -5
  158. package/esm/date-time-picker/parts/Pickers/Calendar/Calendar.js +11 -13
  159. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarContent.js +4 -1
  160. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarContext.js +2 -50
  161. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  162. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +10 -7
  163. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +9 -5
  164. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarMonthDays.js +5 -2
  165. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarWrapper.js +5 -2
  166. package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +18 -18
  167. package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +23 -125
  168. package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +33 -5
  169. package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +10 -6
  170. package/esm/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +30 -14
  171. package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +7 -4
  172. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +9 -5
  173. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +1 -16
  174. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -2
  175. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +10 -10
  176. package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +18 -13
  177. package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +59 -33
  178. package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +18 -13
  179. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheel.js +11 -13
  180. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +5 -2
  181. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContext.js +2 -66
  182. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +8 -3
  183. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelWrapper.js +5 -2
  184. package/esm/date-time-picker/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +15 -117
  185. package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +54 -96
  186. package/esm/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +4 -1
  187. package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +1 -1
  188. package/esm/date-time-picker/parts/TimeInputs/HHInput.js +1 -3
  189. package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +1 -1
  190. package/esm/date-time-picker/parts/TimeInputs/TimeInputs.js +3 -7
  191. package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +3 -6
  192. package/esm/date-time-picker/propTypes.js +49 -17
  193. package/esm/{autocomplete/index.d.js → date-time-picker/sharedTypes.js} +0 -0
  194. package/esm/date-time-picker/utils/dateHelpers.js +57 -57
  195. package/esm/date-time-picker/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +2 -5
  196. package/esm/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +46 -47
  197. package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -2
  198. package/esm/date-time-picker/utils/stringHelpers.js +8 -14
  199. package/esm/date-time-picker/utils/typeGuards.js +8 -0
  200. package/esm/index.js +9 -5
  201. package/esm/large-text-input/DSControlledLargeTextInput.js +72 -0
  202. package/esm/large-text-input/exported-related/data-test-ids.js +7 -0
  203. package/esm/large-text-input/exported-related/index.js +2 -0
  204. package/esm/large-text-input/exported-related/theming.js +8 -0
  205. package/esm/large-text-input/index.js +3 -0
  206. package/esm/large-text-input/react-desc-prop-types.js +36 -0
  207. package/esm/large-text-input/styles.js +30 -0
  208. package/esm/mask-hook/hooks/index.js +5 -4
  209. package/esm/mask-hook/hooks/useNumberMask.js +7 -1
  210. package/esm/mask-hook/hooks/usePhoneMask.js +7 -1
  211. package/esm/mask-hook/hooks/useRegExpMask.js +116 -0
  212. package/esm/mask-hook/hooks/useSSNMask.js +7 -1
  213. package/esm/mask-hook/hooks/{useZipCode.js → useZipCodeMask.js} +11 -5
  214. package/esm/mask-hook/index.js +5 -4
  215. package/esm/mask-hook/react-desc-prop-types.js +8 -1
  216. package/esm/mask-hook/utils/addSpecialCharacters.js +3 -4
  217. package/esm/mask-hook/utils/flatStringArray.js +14 -0
  218. package/esm/mask-hook/utils/index.js +1 -0
  219. package/package.json +92 -88
  220. package/types/autocomplete/Autocomplete.d.ts +4 -61
  221. package/types/autocomplete/AutocompleteCTX.d.ts +4 -3
  222. package/types/autocomplete/AutocompleteDataTestids.d.ts +1 -7
  223. package/types/autocomplete/config/useAutocomplete.d.ts +3 -2
  224. package/types/autocomplete/parts/container/Container.d.ts +1 -2
  225. package/types/autocomplete/parts/container/styled.d.ts +0 -1
  226. package/types/autocomplete/parts/{controls → container}/useKeyboardNavigation.d.ts +0 -0
  227. package/types/autocomplete/parts/menu-list/MenuList.d.ts +1 -2
  228. package/types/autocomplete/parts/menu-list/styled.d.ts +1 -4
  229. package/types/autocomplete/parts/menu-list/useItemRenderer.d.ts +2 -3
  230. package/types/autocomplete/react-desc-prop-types.d.ts +8 -18
  231. package/types/autocomplete/sharedTypes.d.ts +1 -3
  232. package/types/autocomplete/tests/general.test.d.ts +1 -0
  233. package/types/autocomplete/tests/utils.d.ts +5 -0
  234. package/types/autocomplete/utils/listHelper.d.ts +2 -2
  235. package/types/checkbox/ControlledCheckbox.d.ts +1 -1
  236. package/types/checkbox/react-desc-prop-types.d.ts +367 -1
  237. package/types/combobox/ComboBox.d.ts +2 -2
  238. package/types/combobox/parts/dropdown-indicator/DropdownIndicator.d.ts +1 -0
  239. package/types/combobox/react-desc-prop-types.d.ts +381 -3
  240. package/types/combobox/utils/listHelper.d.ts +4 -1
  241. package/types/date-time-picker/ControlledDateTimePicker.d.ts +25 -80
  242. package/types/date-time-picker/ControlledDateTimePickerCTX.d.ts +1 -2
  243. package/types/date-time-picker/ControlledDateTimePickerDatatestid.d.ts +46 -46
  244. package/types/date-time-picker/ControlledDateTimePickerTypes.d.ts +15 -15
  245. package/types/date-time-picker/config/useChangeHandlers.d.ts +25 -0
  246. package/types/date-time-picker/config/useControlledDateTimePicker.d.ts +18 -2
  247. package/types/date-time-picker/config/useGetDestructuredValues.d.ts +30 -4
  248. package/types/date-time-picker/config/useGetFlags.d.ts +27 -0
  249. package/types/date-time-picker/config/useGetPropsBasedOnType.d.ts +28 -0
  250. package/types/date-time-picker/config/useGetPropsWithDefault.d.ts +2 -2
  251. package/types/date-time-picker/config/useGetReferences.d.ts +39 -0
  252. package/types/date-time-picker/config/useGlobalKeyHandlers.d.ts +16 -0
  253. package/types/date-time-picker/config/useRelevantValueFromProps.d.ts +10 -0
  254. package/types/date-time-picker/config/useValidateProps.d.ts +2 -2
  255. package/types/date-time-picker/parts/ClearButton/useClearButton.d.ts +6 -6
  256. package/types/date-time-picker/parts/DateInputs/DDInput.d.ts +6 -6
  257. package/types/date-time-picker/parts/DateInputs/MMInput.d.ts +6 -6
  258. package/types/date-time-picker/parts/DateInputs/YYYYInput.d.ts +6 -6
  259. package/types/date-time-picker/parts/DateInputs/useDateInputs.d.ts +2 -2
  260. package/types/date-time-picker/parts/Pickers/Calendar/Calendar.d.ts +4 -2
  261. package/types/date-time-picker/parts/Pickers/Calendar/CalendarContext.d.ts +3 -63
  262. package/types/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.d.ts +4 -4
  263. package/types/date-time-picker/parts/Pickers/Calendar/CalendarFooter.d.ts +2 -2
  264. package/types/date-time-picker/parts/Pickers/Calendar/Day.d.ts +2 -2
  265. package/types/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +15 -2
  266. package/types/date-time-picker/parts/Pickers/Calendar/useFocusLogic.d.ts +12 -5
  267. package/types/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.d.ts +17 -11
  268. package/types/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.d.ts +1 -16
  269. package/types/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.d.ts +2 -2
  270. package/types/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.d.ts +15 -1
  271. package/types/date-time-picker/parts/Pickers/TimeWheel/TimeWheel.d.ts +4 -2
  272. package/types/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContext.d.ts +3 -62
  273. package/types/date-time-picker/parts/Pickers/TimeWheel/TimeWheelFooter.d.ts +2 -2
  274. package/types/date-time-picker/parts/Pickers/TimeWheel/useConfigTimePickerCTX.d.ts +4 -1
  275. package/types/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.d.ts +16 -5
  276. package/types/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +18 -3
  277. package/types/date-time-picker/parts/TimeInputs/HHInput.d.ts +6 -6
  278. package/types/date-time-picker/parts/TimeInputs/MeridiemInput.d.ts +6 -6
  279. package/types/date-time-picker/parts/TimeInputs/MinutesInput.d.ts +6 -6
  280. package/types/date-time-picker/parts/TimeInputs/useTimeInputs.d.ts +22 -2
  281. package/types/date-time-picker/parts/config.d.ts +3 -3
  282. package/types/date-time-picker/sharedTypes.d.ts +94 -0
  283. package/types/date-time-picker/utils/constants.d.ts +33 -33
  284. package/types/date-time-picker/utils/dateHelpers.d.ts +15 -14
  285. package/types/date-time-picker/utils/dateTimeHelpers.d.ts +3 -3
  286. package/types/date-time-picker/utils/hooks/useGetDayFromDateString.d.ts +1 -1
  287. package/types/date-time-picker/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.d.ts +2 -2
  288. package/types/date-time-picker/utils/hooks/useGetStartingFocusedDay.d.ts +6 -6
  289. package/types/date-time-picker/utils/hooks/useOnClickOutside.d.ts +1 -1
  290. package/types/date-time-picker/utils/timeHelpers.d.ts +2 -2
  291. package/types/date-time-picker/utils/typeGuards.d.ts +4 -0
  292. package/types/index.d.ts +1 -0
  293. package/types/large-text-input/DSControlledLargeTextInput.d.ts +5 -0
  294. package/types/large-text-input/exported-related/data-test-ids.d.ts +5 -0
  295. package/types/large-text-input/exported-related/index.d.ts +2 -0
  296. package/types/large-text-input/exported-related/theming.d.ts +6 -0
  297. package/types/large-text-input/index.d.ts +2 -0
  298. package/types/large-text-input/react-desc-prop-types.d.ts +447 -0
  299. package/types/large-text-input/styles.d.ts +3 -0
  300. package/types/large-text-input/tests/DSControlledLargeTextInput.test.d.ts +1 -0
  301. package/types/mask-hook/hooks/index.d.ts +2 -1
  302. package/types/mask-hook/hooks/useNumberMask.d.ts +2 -1
  303. package/types/mask-hook/hooks/usePhoneMask.d.ts +2 -1
  304. package/types/mask-hook/hooks/useRegExpMask.d.ts +4 -0
  305. package/types/mask-hook/hooks/useSSNMask.d.ts +2 -1
  306. package/types/mask-hook/hooks/useZipCodeMask.d.ts +4 -0
  307. package/types/mask-hook/react-desc-prop-types.d.ts +6 -1
  308. package/types/mask-hook/tests/useRegExpMask.test.d.ts +1 -0
  309. package/types/mask-hook/utils/flatStringArray.d.ts +1 -0
  310. package/types/mask-hook/utils/index.d.ts +1 -0
  311. package/types/text-input/DSInputText.d.ts +1 -1
  312. package/types/text-input/config/useInputText.d.ts +110 -110
  313. package/cjs/autocomplete/config/constants.js +0 -14
  314. package/cjs/autocomplete/config/useGetPropsWithDefault.js +0 -11
  315. package/cjs/autocomplete/parts/a11y-messages/MultiAllyMessages.js +0 -33
  316. package/cjs/autocomplete/parts/a11y-messages/SingleAllyMessages.js +0 -28
  317. package/cjs/autocomplete/parts/a11y-messages/index.js +0 -11
  318. package/cjs/autocomplete/parts/a11y-messages/styled.js +0 -15
  319. package/cjs/autocomplete/parts/controls/Controls.js +0 -63
  320. package/cjs/autocomplete/parts/controls/index.js +0 -9
  321. package/cjs/autocomplete/parts/controls/styled.js +0 -44
  322. package/cjs/autocomplete/parts/controls/useControlsInput.js +0 -44
  323. package/cjs/autocomplete/parts/controls/useMaskedOnChange.js +0 -28
  324. package/cjs/autocomplete/parts/menu-list/useMenuList.js +0 -69
  325. package/cjs/autocomplete/propTypes.js +0 -25
  326. package/cjs/autocomplete/utils/hooks/useKeyboardNavigation.js +0 -97
  327. package/cjs/autocomplete/utils/hooks/useOnElementResize.js +0 -37
  328. package/cjs/text-input/exported-related/name.js +0 -7
  329. package/cjs/text-input/exported-related/slots.js +0 -11
  330. package/esm/autocomplete/config/constants.js +0 -10
  331. package/esm/autocomplete/config/useGetPropsWithDefault.js +0 -7
  332. package/esm/autocomplete/parts/a11y-messages/MultiAllyMessages.js +0 -25
  333. package/esm/autocomplete/parts/a11y-messages/SingleAllyMessages.js +0 -20
  334. package/esm/autocomplete/parts/a11y-messages/index.js +0 -2
  335. package/esm/autocomplete/parts/a11y-messages/styled.js +0 -7
  336. package/esm/autocomplete/parts/controls/Controls.js +0 -55
  337. package/esm/autocomplete/parts/controls/index.js +0 -1
  338. package/esm/autocomplete/parts/controls/styled.js +0 -32
  339. package/esm/autocomplete/parts/controls/useControlsInput.js +0 -40
  340. package/esm/autocomplete/parts/controls/useMaskedOnChange.js +0 -24
  341. package/esm/autocomplete/parts/menu-list/useMenuList.js +0 -65
  342. package/esm/autocomplete/propTypes.js +0 -21
  343. package/esm/autocomplete/utils/hooks/useKeyboardNavigation.js +0 -93
  344. package/esm/autocomplete/utils/hooks/useOnElementResize.js +0 -33
  345. package/esm/text-input/exported-related/name.js +0 -3
  346. package/esm/text-input/exported-related/slots.js +0 -7
  347. package/types/autocomplete/config/constants.d.ts +0 -8
  348. package/types/autocomplete/config/useGetPropsWithDefault.d.ts +0 -2
  349. package/types/autocomplete/parts/a11y-messages/MultiAllyMessages.d.ts +0 -3
  350. package/types/autocomplete/parts/a11y-messages/SingleAllyMessages.d.ts +0 -3
  351. package/types/autocomplete/parts/a11y-messages/index.d.ts +0 -2
  352. package/types/autocomplete/parts/a11y-messages/styled.d.ts +0 -1
  353. package/types/autocomplete/parts/controls/Controls.d.ts +0 -3
  354. package/types/autocomplete/parts/controls/index.d.ts +0 -1
  355. package/types/autocomplete/parts/controls/styled.d.ts +0 -8
  356. package/types/autocomplete/parts/controls/useControlsInput.d.ts +0 -9
  357. package/types/autocomplete/parts/controls/useMaskedOnChange.d.ts +0 -2
  358. package/types/autocomplete/parts/menu-list/useMenuList.d.ts +0 -2
  359. package/types/autocomplete/propTypes.d.ts +0 -51
  360. package/types/autocomplete/utils/hooks/useKeyboardNavigation.d.ts +0 -4
  361. package/types/autocomplete/utils/hooks/useOnElementResize.d.ts +0 -3
  362. package/types/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +0 -2
  363. package/types/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +0 -12
  364. package/types/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +0 -2
  365. package/types/date-time-picker/propTypes.d.ts +0 -81
  366. package/types/mask-hook/hooks/useZipCode.d.ts +0 -3
  367. package/types/text-input/exported-related/name.d.ts +0 -1
  368. package/types/text-input/exported-related/slots.d.ts +0 -5
@@ -1,13 +1,27 @@
1
1
  import 'core-js/modules/web.dom-collections.iterator.js';
2
- import { useEffect, useState, useMemo, createRef, useCallback } from 'react';
2
+ import { useState, useEffect, useMemo, createRef, useCallback } from 'react';
3
3
  import { useGetMonthYearFromDateStringOrEmptyStartingMonth } from '../../../utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js';
4
4
  import { getFiveBySevenCurrentMonthDaysMatrix, sumValuesToDate, getDateStringFromDay, sumFromDateValues } from '../../../utils/dateHelpers.js';
5
5
 
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ function sliceIntoChunks(arr, chunkSize) {
8
+ const res = [];
9
+
10
+ for (let i = 0; i < arr.length; i += chunkSize) {
11
+ const chunk = arr.slice(i, i + chunkSize);
12
+ res.push(chunk);
13
+ }
14
+
15
+ return res;
16
+ }
17
+
6
18
  const useCurrentDisplayedMonthYearLogic = () => {
7
19
  const {
8
20
  month: monthFromDateString,
9
21
  year: yearFromDateString
10
- } = useGetMonthYearFromDateStringOrEmptyStartingMonth(); // side-effects are really really controlled in this case so use-effect should be fine
22
+ } = useGetMonthYearFromDateStringOrEmptyStartingMonth();
23
+ const [currentMonth, setCurrentMonth] = useState(monthFromDateString);
24
+ const [currentYear, setCurrentYear] = useState(yearFromDateString); // side-effects are really really controlled in this case so use-effect should be fine
11
25
  // don't add 200 side-effects to those or else Chaos would hunt us for the years to come
12
26
 
13
27
  useEffect(() => {
@@ -16,8 +30,6 @@ const useCurrentDisplayedMonthYearLogic = () => {
16
30
  useEffect(() => {
17
31
  setCurrentYear(yearFromDateString);
18
32
  }, [yearFromDateString]);
19
- const [currentMonth, setCurrentMonth] = useState(monthFromDateString);
20
- const [currentYear, setCurrentYear] = useState(yearFromDateString);
21
33
  const daysArray = useMemo(() => {
22
34
  const newDaysArray = getFiveBySevenCurrentMonthDaysMatrix(currentMonth, currentYear);
23
35
  const hiddenPrevDay = sumValuesToDate(newDaysArray[0].day, {
@@ -94,15 +106,31 @@ const useCurrentDisplayedMonthYearLogic = () => {
94
106
  });
95
107
  setCurrentYear(newYear);
96
108
  }, [currentMonth, currentYear]);
109
+ const {
110
+ invisibleFirstDay,
111
+ daysMatrixByWeekday,
112
+ invisibleLastDay
113
+ } = useMemo(() => {
114
+ const [invisible1stDay, ...otherDays] = [...daysArray];
115
+ const invisibleDayLast = otherDays.pop();
116
+ return {
117
+ invisibleFirstDay: invisible1stDay,
118
+ daysMatrixByWeekday: sliceIntoChunks(otherDays, 7),
119
+ invisibleLastDay: invisibleDayLast
120
+ };
121
+ }, [daysArray]);
97
122
  return useMemo(() => ({
98
123
  currentMonth,
99
124
  currentYear,
100
125
  daysArray,
126
+ invisibleFirstDay,
127
+ daysMatrixByWeekday,
128
+ invisibleLastDay,
101
129
  handlePrevYear,
102
130
  handlePrevMonth,
103
131
  handleNextMonth,
104
132
  handleNextYear
105
- }), [currentMonth, currentYear, daysArray, handleNextMonth, handleNextYear, handlePrevMonth, handlePrevYear]);
133
+ }), [currentMonth, currentYear, daysArray, daysMatrixByWeekday, handleNextMonth, handleNextYear, handlePrevMonth, handlePrevYear, invisibleFirstDay, invisibleLastDay]);
106
134
  };
107
135
 
108
136
  export { useCurrentDisplayedMonthYearLogic };
@@ -22,32 +22,36 @@ const loopWhileWaiting = function (cb) {
22
22
 
23
23
  const useFocusLogic = _ref => {
24
24
  let {
25
- daysArray,
25
+ currentDisplayedMonthLogic,
26
26
  showCalendar
27
27
  } = _ref;
28
28
  const {
29
29
  calendarDaysWrapperRef
30
30
  } = useContext(ControlledDateTimePickerContext);
31
+ const {
32
+ daysArray
33
+ } = currentDisplayedMonthLogic;
31
34
  const {
32
35
  startFocusedDate
33
36
  } = useGetStartingFocusedDay();
34
- const [metadayToFocus, setMetadayToFocus] = useState(daysArray.find(_ref2 => {
37
+ const [metadayToFocus, setMetadayToFocus] = useState(() => startFocusedDate ? daysArray.find(_ref2 => {
35
38
  let {
36
39
  day: currDay
37
40
  } = _ref2;
38
41
  return compareTwoDatesDayEquality(currDay, startFocusedDate);
39
- })); // this is required because we have to focus based on the inputs values too,
42
+ }) : undefined); // this is required because we have to focus based on the inputs values too,
40
43
  // useGetStartingFocusedDay does this already,
41
44
  // this "useMemo" is here just to trigger it functionally by changing the metadayToFocus state
42
45
  // which is required for arrow key navigation in the calendar
43
46
 
44
47
  const focusedDay = useMemo(() => {
45
- const newFocusedDay = metadayToFocus ? daysArray.find(_ref3 => {
48
+ let newFocusedDay;
49
+ if (metadayToFocus) newFocusedDay = daysArray.find(_ref3 => {
46
50
  let {
47
51
  day: currDay
48
52
  } = _ref3;
49
53
  return compareTwoDatesDayEquality(currDay, metadayToFocus.day);
50
- }) : daysArray.find(_ref4 => {
54
+ });else if (startFocusedDate) newFocusedDay = daysArray.find(_ref4 => {
51
55
  let {
52
56
  day: currDay
53
57
  } = _ref4;
@@ -93,7 +97,7 @@ const useFocusLogic = _ref => {
93
97
  if (focusedDay !== newFocusedMetaDay) setMetadayToFocus(newFocusedMetaDay);
94
98
  }, [daysArray, focusedDay]);
95
99
  const resetFocusedDayToStartDate = useCallback(() => {
96
- setMetadayToFocus(null);
100
+ setMetadayToFocus(undefined);
97
101
  }, []);
98
102
  return useMemo(() => ({
99
103
  focusedDay,
@@ -8,13 +8,8 @@ import { homeEndKeys, homeEndAllArrowKeys } from '../../../utils/constants.js';
8
8
 
9
9
  const useKeyboardHandlers = _ref => {
10
10
  let {
11
- focusedDay,
12
- daysArray,
13
- handlePrevMonth,
14
- handleNextMonth,
15
- handleFocusMetaDay,
16
- handleFocusMetaDayByDay,
17
- tryToFocusCurrentlyDataIsFocusedDay
11
+ currentDisplayedMonthLogic,
12
+ focusLogic
18
13
  } = _ref;
19
14
  const {
20
15
  hideDate,
@@ -35,6 +30,17 @@ const useKeyboardHandlers = _ref => {
35
30
  isWithDateInputs,
36
31
  yearInputRef
37
32
  } = useContext(ControlledDateTimePickerContext);
33
+ const {
34
+ focusedDay,
35
+ handleFocusMetaDay,
36
+ handleFocusMetaDayByDay,
37
+ tryToFocusCurrentlyDataIsFocusedDay
38
+ } = focusLogic;
39
+ const {
40
+ daysArray,
41
+ handlePrevMonth,
42
+ handleNextMonth
43
+ } = currentDisplayedMonthLogic;
38
44
  const tryToFocusDayRegion = useCallback(() => {
39
45
  setLatestInteractionRegion('calendar-days');
40
46
 
@@ -146,9 +152,13 @@ const useKeyboardHandlers = _ref => {
146
152
  e.preventDefault();
147
153
 
148
154
  if (shiftKey) {
149
- nextMonthBtnRef.current.focus();
155
+ var _nextMonthBtnRef$curr;
156
+
157
+ (_nextMonthBtnRef$curr = nextMonthBtnRef.current) === null || _nextMonthBtnRef$curr === void 0 ? void 0 : _nextMonthBtnRef$curr.focus();
150
158
  } else {
151
- nextYearBtnRef.current.focus();
159
+ var _nextYearBtnRef$curre;
160
+
161
+ (_nextYearBtnRef$curre = nextYearBtnRef.current) === null || _nextYearBtnRef$curre === void 0 ? void 0 : _nextYearBtnRef$curre.focus();
152
162
  }
153
163
  }
154
164
 
@@ -178,8 +188,10 @@ const useKeyboardHandlers = _ref => {
178
188
  if (isWithTimeWheelToo) currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c3 = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c3 === void 0 ? void 0 : (_currMeridiemBtnRef$c4 = _currMeridiemBtnRef$c3.focus) === null || _currMeridiemBtnRef$c4 === void 0 ? void 0 : _currMeridiemBtnRef$c4.call(_currMeridiemBtnRef$c3);else tryToFocusDayRegion();
179
189
  }
180
190
  } else {
191
+ var _nextMonthBtnRef$curr2;
192
+
181
193
  e.preventDefault();
182
- nextMonthBtnRef.current.focus();
194
+ (_nextMonthBtnRef$curr2 = nextMonthBtnRef.current) === null || _nextMonthBtnRef$curr2 === void 0 ? void 0 : _nextMonthBtnRef$curr2.focus();
183
195
  }
184
196
  }
185
197
 
@@ -203,9 +215,13 @@ const useKeyboardHandlers = _ref => {
203
215
  e.preventDefault();
204
216
 
205
217
  if (shiftKey) {
206
- prevMonthBtnRef.current.focus();
218
+ var _prevMonthBtnRef$curr5;
219
+
220
+ (_prevMonthBtnRef$curr5 = prevMonthBtnRef.current) === null || _prevMonthBtnRef$curr5 === void 0 ? void 0 : _prevMonthBtnRef$curr5.focus();
207
221
  } else {
208
- prevYearBtnRef.current.focus();
222
+ var _prevYearBtnRef$curre;
223
+
224
+ (_prevYearBtnRef$curre = prevYearBtnRef.current) === null || _prevYearBtnRef$curre === void 0 ? void 0 : _prevYearBtnRef$curre.focus();
209
225
  }
210
226
  }
211
227
 
@@ -229,9 +245,9 @@ const useKeyboardHandlers = _ref => {
229
245
  e.preventDefault();
230
246
 
231
247
  if (shiftKey) {
232
- var _prevYearBtnRef$curre, _prevYearBtnRef$curre2;
248
+ var _prevYearBtnRef$curre2, _prevYearBtnRef$curre3;
233
249
 
234
- prevYearBtnRef === null || prevYearBtnRef === void 0 ? void 0 : (_prevYearBtnRef$curre = prevYearBtnRef.current) === null || _prevYearBtnRef$curre === void 0 ? void 0 : (_prevYearBtnRef$curre2 = _prevYearBtnRef$curre.focus) === null || _prevYearBtnRef$curre2 === void 0 ? void 0 : _prevYearBtnRef$curre2.call(_prevYearBtnRef$curre);
250
+ prevYearBtnRef === null || prevYearBtnRef === void 0 ? void 0 : (_prevYearBtnRef$curre2 = prevYearBtnRef.current) === null || _prevYearBtnRef$curre2 === void 0 ? void 0 : (_prevYearBtnRef$curre3 = _prevYearBtnRef$curre2.focus) === null || _prevYearBtnRef$curre3 === void 0 ? void 0 : _prevYearBtnRef$curre3.call(_prevYearBtnRef$curre2);
235
251
  }
236
252
 
237
253
  if (!shiftKey) tryToFocusDayRegion();
@@ -6,12 +6,15 @@ import { useOnClickOutside } from '../../../utils/hooks/useOnClickOutside.js';
6
6
 
7
7
  const usePopperTriggerLogic = _ref => {
8
8
  let {
9
+ focusLogic,
10
+ showCalendar,
11
+ setShowCalendar
12
+ } = _ref;
13
+ const {
9
14
  focusedDay,
10
15
  resetFocusedDayToStartDate,
11
- showCalendar,
12
- setShowCalendar,
13
16
  tryToFocusCurrentlyDataIsFocusedDay
14
- } = _ref;
17
+ } = focusLogic;
15
18
  const {
16
19
  props: {
17
20
  onPickerOpen,
@@ -80,7 +83,7 @@ const usePopperTriggerLogic = _ref => {
80
83
  useOnClickOutside(popperElement, e => {
81
84
  var _pickerButtonRef$curr5, _pickerButtonRef$curr6;
82
85
 
83
- if (!(pickerButtonRef !== null && pickerButtonRef !== void 0 && (_pickerButtonRef$curr5 = pickerButtonRef.current) !== null && _pickerButtonRef$curr5 !== void 0 && (_pickerButtonRef$curr6 = _pickerButtonRef$curr5.contains) !== null && _pickerButtonRef$curr6 !== void 0 && _pickerButtonRef$curr6.call(_pickerButtonRef$curr5, e === null || e === void 0 ? void 0 : e.target))) closeCalendar();
86
+ if (e.target instanceof Element && !(pickerButtonRef !== null && pickerButtonRef !== void 0 && (_pickerButtonRef$curr5 = pickerButtonRef.current) !== null && _pickerButtonRef$curr5 !== void 0 && (_pickerButtonRef$curr6 = _pickerButtonRef$curr5.contains) !== null && _pickerButtonRef$curr6 !== void 0 && _pickerButtonRef$curr6.call(_pickerButtonRef$curr5, e === null || e === void 0 ? void 0 : e.target))) closeCalendar();
84
87
  });
85
88
  return useMemo(() => ({
86
89
  closeCalendar,
@@ -4,12 +4,13 @@ import { CalendarWithTimeWheelIconTrigger } from './CalendarWithTimeWheelIconTri
4
4
  import { CalendarWithTimeWheelWrapper } from './CalendarWithTimeWheelWrapper.js';
5
5
  import { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';
6
6
  import { useConfigCalendarWithTimeWheelCTX } from './useConfigCalendarWithTimeWheelCTX.js';
7
- import { WrapWithCalendarContext } from '../Calendar/Calendar.js';
8
- import { WrapWithTimeWheelContext } from '../TimeWheel/TimeWheel.js';
7
+ import { WrappedCalendarContext } from '../Calendar/Calendar.js';
8
+ import { WrappedTimeWheelContext } from '../TimeWheel/TimeWheel.js';
9
9
  import { jsx, Fragment } from 'react/jsx-runtime';
10
10
 
11
- var _CalendarWithTimeWhee, _CalendarWithTimeWhee2;
12
- const CalendarWithTimeWheel = WrapWithCalendarContext(WrapWithTimeWheelContext(() => {
11
+ var _CalendarWithTimeWhee, _CalendarWithTimeWhee2, _WrappedCalendarConte;
12
+
13
+ const CalendarWithTimeWheelContent = () => {
13
14
  const ctx = useConfigCalendarWithTimeWheelCTX();
14
15
  const {
15
16
  showCalendarWithTimeWheel,
@@ -23,6 +24,9 @@ const CalendarWithTimeWheel = WrapWithCalendarContext(WrapWithTimeWheelContext((
23
24
  onKeyDown: handleMenuWrapperKeyDown
24
25
  }, void 0, _CalendarWithTimeWhee2 || (_CalendarWithTimeWhee2 = /*#__PURE__*/_jsx(CalendarWithTimeWheelWrapper, {})))
25
26
  }) : null);
26
- }));
27
+ }; // we wrap in context in a separate statement so we can use the useContext and be sure it's correctly initialized
28
+
29
+
30
+ const CalendarWithTimeWheel = () => _WrappedCalendarConte || (_WrappedCalendarConte = /*#__PURE__*/_jsx(WrappedCalendarContext, {}, void 0, /*#__PURE__*/_jsx(WrappedTimeWheelContext, {}, void 0, /*#__PURE__*/_jsx(CalendarWithTimeWheelContent, {}))));
27
31
 
28
32
  export { CalendarWithTimeWheel };
@@ -1,21 +1,6 @@
1
1
  import { createContext } from 'react';
2
2
 
3
- // eslint-disable-next-line @typescript-eslint/no-empty-function
4
- const noop = () => {};
5
-
6
- const defaultCalendarWithTimeWheelContext = {
7
- ariaCurrentValueForInputs: '',
8
- showCalendarWithTimeWheel: false,
9
- setPopperElement: noop,
10
- setArrowElement: noop,
11
- usePopperHelpers: null,
12
- handleSetTriggerRef: noop,
13
- handleToggleCalendarWithTimeWheel: noop,
14
- handleMenuWrapperKeyDown: noop,
15
- handlePickerIconKeyDown: noop,
16
- isControllerOnly: false,
17
- disabled: false
18
- };
3
+ const defaultCalendarWithTimeWheelContext = {};
19
4
  /** Context for cross component communication */
20
5
 
21
6
  const CalendarWithTimeWheelContext = /*#__PURE__*/createContext(defaultCalendarWithTimeWheelContext);
@@ -1,6 +1,6 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import { useContext, useMemo } from 'react';
3
- import { BUTTON_SIZES, BUTTON_VARIANT } from '@elliemae/ds-button';
3
+ import { BUTTON_SIZES } from '@elliemae/ds-button';
4
4
  import { DatePicker } from '@elliemae/ds-icons';
5
5
  import { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';
6
6
  import { StyledIconTriggerButton } from './Styleds.js';
@@ -22,7 +22,6 @@ const CalendarWithTimeWheelIconTrigger = () => {
22
22
  "aria-label": "date time picker context menu trigger, ".concat(ariaCurrentValueForInputs),
23
23
  buttonType: "icon",
24
24
  size: BUTTON_SIZES.M,
25
- variant: BUTTON_VARIANT.DEFAULT,
26
25
  innerRef: handleSetTriggerRef,
27
26
  onClick: handleToggleCalendarWithTimeWheel,
28
27
  onKeyDown: handlePickerIconKeyDown,
@@ -64,25 +64,25 @@ const useConfigCalendarWithTimeWheelCTX = () => {
64
64
  }
65
65
  }]
66
66
  });
67
- const openCalendar = useCallback(e => {
67
+ const openCalendar = useCallback(() => {
68
68
  setShowCalendarWithTimeWheel(true);
69
69
  onPickerOpen();
70
- setTimeout(() => handleToggleCalendar(e));
71
- setTimeout(() => handleToggleTimePicker(e));
70
+ setTimeout(() => handleToggleCalendar());
71
+ setTimeout(() => handleToggleTimePicker());
72
72
  }, [handleToggleCalendar, handleToggleTimePicker, onPickerOpen]);
73
- const closeCalendar = useCallback(e => {
73
+ const closeCalendar = useCallback(() => {
74
74
  setShowCalendarWithTimeWheel(false);
75
75
  onPickerClose();
76
- setTimeout(() => handleToggleCalendar(e));
77
- setTimeout(() => handleToggleTimePicker(e));
76
+ setTimeout(() => handleToggleCalendar());
77
+ setTimeout(() => handleToggleTimePicker());
78
78
  }, [handleToggleCalendar, handleToggleTimePicker, onPickerClose]);
79
- const handleToggleCalendarWithTimeWheel = useCallback(e => {
80
- if (!showCalendarWithTimeWheel) openCalendar(e);else closeCalendar(e);
79
+ const handleToggleCalendarWithTimeWheel = useCallback(() => {
80
+ if (!showCalendarWithTimeWheel) openCalendar();else closeCalendar();
81
81
  }, [closeCalendar, openCalendar, showCalendarWithTimeWheel]);
82
82
  useOnClickOutside(popperElement, e => {
83
83
  var _pickerButtonRef$curr, _pickerButtonRef$curr2;
84
84
 
85
- if (!(pickerButtonRef !== null && pickerButtonRef !== void 0 && (_pickerButtonRef$curr = pickerButtonRef.current) !== null && _pickerButtonRef$curr !== void 0 && (_pickerButtonRef$curr2 = _pickerButtonRef$curr.contains) !== null && _pickerButtonRef$curr2 !== void 0 && _pickerButtonRef$curr2.call(_pickerButtonRef$curr, e === null || e === void 0 ? void 0 : e.target))) closeCalendar(e);
85
+ if (e.target instanceof Element && !(pickerButtonRef !== null && pickerButtonRef !== void 0 && (_pickerButtonRef$curr = pickerButtonRef.current) !== null && _pickerButtonRef$curr !== void 0 && (_pickerButtonRef$curr2 = _pickerButtonRef$curr.contains) !== null && _pickerButtonRef$curr2 !== void 0 && _pickerButtonRef$curr2.call(_pickerButtonRef$curr, e === null || e === void 0 ? void 0 : e.target))) closeCalendar();
86
86
  });
87
87
  const handleSetTriggerRef = useCallback(newRef => {
88
88
  pickerButtonRef.current = newRef;
@@ -96,7 +96,7 @@ const useConfigCalendarWithTimeWheelCTX = () => {
96
96
  if (key === 'Escape') {
97
97
  var _pickerButtonRef$curr3, _pickerButtonRef$curr4;
98
98
 
99
- closeCalendar(e);
99
+ closeCalendar();
100
100
  pickerButtonRef === null || pickerButtonRef === void 0 ? void 0 : (_pickerButtonRef$curr3 = pickerButtonRef.current) === null || _pickerButtonRef$curr3 === void 0 ? void 0 : (_pickerButtonRef$curr4 = _pickerButtonRef$curr3.focus) === null || _pickerButtonRef$curr4 === void 0 ? void 0 : _pickerButtonRef$curr4.call(_pickerButtonRef$curr3);
101
101
  }
102
102
  }, [closeCalendar, pickerButtonRef]);
@@ -10,6 +10,7 @@ import 'core-js/modules/esnext.iterator.for-each.js';
10
10
  import { useContext } from 'react';
11
11
  import { ChevronSmallUp, ChevronSmallDown } from '@elliemae/ds-icons';
12
12
  import { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';
13
+ import { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';
13
14
  import { convertToPositiveNumberIfPossible } from '../../../utils/numberHelpers.js';
14
15
  import { StyledWheelList, StyledWheelListItem, StyledWheelChangeTimeBtn, StyledTimeBtn } from './Styleds.js';
15
16
  import { TimeWheelContext } from './TimeWheelContext.js';
@@ -23,22 +24,24 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
23
24
  const HoursList = () => {
24
25
  const {
25
26
  currHourNum,
26
- hours,
27
- minutes,
28
- meridiem,
27
+ currMinuteNum,
28
+ currMeridiem,
29
29
  visibleHours,
30
30
  handlePrevHour,
31
31
  handleNextHour,
32
32
  handleTimeWheelBtnChangeHours,
33
33
  handlePrevHourBtnOnKeyDown,
34
34
  handleCurrHourOnKeyDown,
35
- handleNextHourBtnOnKeyDown,
35
+ handleNextHourBtnOnKeyDown
36
+ } = useContext(TimeWheelContext);
37
+ const {
36
38
  prevHourBtnRef,
37
39
  currHourBtnRef,
38
40
  nextHourBtnRef,
39
41
  getIsDisabledTime,
40
- autoFocusHourTimeWheel
41
- } = useContext(TimeWheelContext);
42
+ autoFocusHourTimeWheel,
43
+ hours
44
+ } = useContext(ControlledDateTimePickerContext);
42
45
  return /*#__PURE__*/_jsx(StyledWheelList, {}, void 0, /*#__PURE__*/_jsx(StyledWheelListItem, {}, void 0, /*#__PURE__*/_jsx(StyledWheelChangeTimeBtn, {
43
46
  "aria-label": "subtract one hour",
44
47
  buttonType: "raw",
@@ -49,9 +52,9 @@ const HoursList = () => {
49
52
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_HOUR,
50
53
  tabIndex: -1
51
54
  }, void 0, _ChevronSmallUp || (_ChevronSmallUp = /*#__PURE__*/_jsx(ChevronSmallUp, {})))), visibleHours.map(hourString => {
52
- const key = "timewheel-hour-".concat(hourString);
55
+ const key = "timewheel-hour-".concat(hourString || '');
53
56
  if (!hourString) return /*#__PURE__*/_jsx(StyledWheelListItem, {}, key);
54
- const currHourTimeString = "".concat(hourString, ":").concat(minutes || '00', " ").concat(meridiem || 'AM');
57
+ const currHourTimeString = "".concat(hourString, ":").concat(currMinuteNum, " ").concat(currMeridiem);
55
58
  const isEmptyCurrValueCurrentListItem = !hours && convertToPositiveNumberIfPossible(hourString) === currHourNum;
56
59
  const isCurrentListItem = isEmptyCurrValueCurrentListItem || hours === hourString;
57
60
  const isDisabled = getIsDisabledTime(currHourTimeString);
@@ -60,23 +63,25 @@ const HoursList = () => {
60
63
  onKeyDown: isCurrentListItem ? handleCurrHourOnKeyDown : undefined,
61
64
  innerRef: isCurrentListItem ? currHourBtnRef : undefined
62
65
  };
66
+ const styleProps = {
67
+ isCurrentListItem,
68
+ isDisabled
69
+ };
63
70
  return /*#__PURE__*/_jsx(StyledWheelListItem, {
64
71
  isCurrentListItem: isCurrentListItem
65
- }, key, /*#__PURE__*/jsx(StyledTimeBtn, _objectSpread(_objectSpread({
66
- isCurrentListItem: isCurrentListItem,
72
+ }, key, /*#__PURE__*/jsx(StyledTimeBtn, _objectSpread(_objectSpread(_objectSpread({}, styleProps), {}, {
67
73
  autoFocus: autoFocusHourTimeWheel && isCurrentListItem,
68
74
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL[isCurrentListItem ? 'CURRENT_HOUR' : 'HOUR'],
69
75
  selected: hours.length === 2 && convertToPositiveNumberIfPossible(hourString) === currHourNum,
70
76
  "aria-label": "".concat(hourString, " hours"),
71
77
  "aria-disabled": isDisabled,
72
- isDisabled: isDisabled,
73
78
  buttonType: "raw",
74
79
  size: "m",
75
80
  onClick: e => handleTimeWheelBtnChangeHours(hourString, e),
76
81
  tabIndex: tabIndex,
77
82
  role: "spinbutton",
78
- "aria-valuemax": "12",
79
- "aria-valuemin": "1",
83
+ "aria-valuemax": 12,
84
+ "aria-valuemin": 1,
80
85
  "aria-valuenow": currHourNum,
81
86
  "aria-valuetext": "".concat(hourString, " hours")
82
87
  }, btnProps), {}, {
@@ -1,52 +1,78 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
1
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
8
  import { useContext } from 'react';
3
9
  import { ChevronSmallUp, ChevronSmallDown } from '@elliemae/ds-icons';
4
10
  import { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';
11
+ import { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';
5
12
  import { StyledWheelList, StyledWheelListItem, StyledWheelChangeTimeBtn, StyledTimeBtn } from './Styleds.js';
6
13
  import { TimeWheelContext } from './TimeWheelContext.js';
14
+ import { jsx } from 'react/jsx-runtime';
7
15
 
8
16
  var _ChevronSmallUp, _StyledWheelListItem, _StyledWheelListItem2, _ChevronSmallDown;
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
21
  const MeridiemList = () => {
10
22
  const {
11
- hours,
12
- minutes,
13
- meridiem,
23
+ currMeridiem,
14
24
  handleTimeWheelBtnChangeMeridiem,
15
25
  handlePrevMeridiemBtnOnKeyDown,
16
26
  handleCurrMeridiemOnKeyDown,
17
- handleNextMeridiemBtnOnKeyDown,
27
+ handleNextMeridiemBtnOnKeyDown
28
+ } = useContext(TimeWheelContext);
29
+ const {
18
30
  prevMeridiemBtnRef,
19
31
  currMeridiemBtnRef,
20
32
  nextMeridiemBtnRef,
21
- getIsDisabledTime
22
- } = useContext(TimeWheelContext);
23
- const isAmCurrent = !meridiem || meridiem === 'AM';
24
- const isPmCurrent = meridiem === 'PM';
33
+ getIsDisabledTime,
34
+ hours,
35
+ minutes
36
+ } = useContext(ControlledDateTimePickerContext);
37
+ const isAmCurrent = !currMeridiem || currMeridiem === 'AM';
38
+ const isPmCurrent = currMeridiem === 'PM';
25
39
  const hourMinuteString = "".concat(hours || '01', ":").concat(minutes || '00');
26
40
  const amTimeString = "".concat(hourMinuteString, " AM");
27
41
  const pmTimeString = "".concat(hourMinuteString, " PM");
28
42
  const isDisabledAm = getIsDisabledTime(amTimeString);
29
43
  const isDisabledPm = getIsDisabledTime(pmTimeString);
30
- return /*#__PURE__*/_jsx(StyledWheelList, {}, void 0, /*#__PURE__*/_jsx(StyledWheelListItem, {}, void 0, /*#__PURE__*/_jsx(StyledWheelChangeTimeBtn, {
44
+ const styledPropsPrevMeridiem = {
45
+ isDisabled: isDisabledAm
46
+ };
47
+ const styledPropsCurrentAmMeridiem = {
48
+ isCurrentListItem: isAmCurrent,
49
+ isDisabled: isDisabledAm
50
+ };
51
+ const styledPropsCurrentPmMeridiem = {
52
+ isCurrentListItem: isPmCurrent,
53
+ isDisabled: isDisabledPm
54
+ };
55
+ const styledPropsNextMeridiem = {
56
+ isDisabled: isDisabledPm
57
+ };
58
+ return /*#__PURE__*/_jsx(StyledWheelList, {}, void 0, /*#__PURE__*/_jsx(StyledWheelListItem, {}, void 0, /*#__PURE__*/jsx(StyledWheelChangeTimeBtn, _objectSpread(_objectSpread({}, styledPropsPrevMeridiem), {}, {
31
59
  "aria-label": "set am meridiem",
32
60
  "aria-disabled": isDisabledAm,
33
- isDisabled: isDisabledAm,
34
61
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MERIDIEM,
35
62
  buttonType: "raw",
36
63
  size: "m",
37
64
  onClick: e => handleTimeWheelBtnChangeMeridiem('AM', e),
38
65
  onKeyDown: handlePrevMeridiemBtnOnKeyDown,
39
66
  innerRef: prevMeridiemBtnRef,
40
- tabIndex: -1
41
- }, void 0, _ChevronSmallUp || (_ChevronSmallUp = /*#__PURE__*/_jsx(ChevronSmallUp, {})))), meridiem === 'AM' || meridiem === '' ? _StyledWheelListItem || (_StyledWheelListItem = /*#__PURE__*/_jsx(StyledWheelListItem, {})) : null, /*#__PURE__*/_jsx(StyledWheelListItem, {
67
+ tabIndex: -1,
68
+ children: _ChevronSmallUp || (_ChevronSmallUp = /*#__PURE__*/_jsx(ChevronSmallUp, {}))
69
+ }))), currMeridiem === 'AM' || currMeridiem === '' ? _StyledWheelListItem || (_StyledWheelListItem = /*#__PURE__*/_jsx(StyledWheelListItem, {})) : null, /*#__PURE__*/_jsx(StyledWheelListItem, {
42
70
  isCurrentListItem: isAmCurrent
43
- }, void 0, /*#__PURE__*/_jsx(StyledTimeBtn, {
44
- isCurrentListItem: isAmCurrent,
71
+ }, void 0, /*#__PURE__*/jsx(StyledTimeBtn, _objectSpread(_objectSpread({}, styledPropsCurrentAmMeridiem), {}, {
45
72
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL[isAmCurrent ? 'CURRENT_MERIDIEM' : 'MERIDIEM'],
46
- selected: meridiem === 'AM',
73
+ selected: currMeridiem === 'AM',
47
74
  "aria-label": "AM ".concat(isAmCurrent ? 'selected' : ''),
48
75
  "aria-disabled": isDisabledAm,
49
- isDisabled: isDisabledAm,
50
76
  buttonType: "raw",
51
77
  size: "m",
52
78
  onClick: e => handleTimeWheelBtnChangeMeridiem('AM', e),
@@ -54,19 +80,18 @@ const MeridiemList = () => {
54
80
  innerRef: isAmCurrent ? currMeridiemBtnRef : undefined,
55
81
  tabIndex: isAmCurrent ? 0 : -1,
56
82
  role: "spinbutton",
57
- "aria-valuemax": "1",
58
- "aria-valuemin": "0",
59
- "aria-valuenow": isPmCurrent ? '1' : '0',
60
- "aria-valuetext": isAmCurrent ? 'ante meridiem' : 'post meridiem'
61
- }, void 0, "AM")), /*#__PURE__*/_jsx(StyledWheelListItem, {
83
+ "aria-valuemax": 1,
84
+ "aria-valuemin": 0,
85
+ "aria-valuenow": isPmCurrent ? 1 : 0,
86
+ "aria-valuetext": isAmCurrent ? 'ante meridiem' : 'post meridiem',
87
+ children: "AM"
88
+ }))), /*#__PURE__*/_jsx(StyledWheelListItem, {
62
89
  isCurrentListItem: isPmCurrent
63
- }, void 0, /*#__PURE__*/_jsx(StyledTimeBtn, {
64
- isCurrentListItem: isPmCurrent,
90
+ }, void 0, /*#__PURE__*/jsx(StyledTimeBtn, _objectSpread(_objectSpread({}, styledPropsCurrentPmMeridiem), {}, {
65
91
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL[isPmCurrent ? 'CURRENT_MERIDIEM' : 'MERIDIEM'],
66
- selected: meridiem === 'PM',
92
+ selected: currMeridiem === 'PM',
67
93
  "aria-label": "PM ".concat(isPmCurrent ? 'selected' : ''),
68
94
  "aria-disabled": isDisabledPm,
69
- isDisabled: isDisabledPm,
70
95
  buttonType: "raw",
71
96
  size: "m",
72
97
  onClick: e => handleTimeWheelBtnChangeMeridiem('PM', e),
@@ -74,22 +99,23 @@ const MeridiemList = () => {
74
99
  innerRef: isPmCurrent ? currMeridiemBtnRef : undefined,
75
100
  tabIndex: isPmCurrent ? 0 : -1,
76
101
  role: "spinbutton",
77
- "aria-valuemax": "1",
78
- "aria-valuemin": "0",
79
- "aria-valuenow": isPmCurrent ? '1' : '0',
80
- "aria-valuetext": isAmCurrent ? 'ante meridiem' : 'post meridiem'
81
- }, void 0, "PM")), meridiem === 'PM' ? _StyledWheelListItem2 || (_StyledWheelListItem2 = /*#__PURE__*/_jsx(StyledWheelListItem, {})) : null, /*#__PURE__*/_jsx(StyledWheelListItem, {}, void 0, /*#__PURE__*/_jsx(StyledWheelChangeTimeBtn, {
102
+ "aria-valuemax": 1,
103
+ "aria-valuemin": 0,
104
+ "aria-valuenow": isPmCurrent ? 1 : 0,
105
+ "aria-valuetext": isAmCurrent ? 'ante meridiem' : 'post meridiem',
106
+ children: "PM"
107
+ }))), currMeridiem === 'PM' ? _StyledWheelListItem2 || (_StyledWheelListItem2 = /*#__PURE__*/_jsx(StyledWheelListItem, {})) : null, /*#__PURE__*/_jsx(StyledWheelListItem, {}, void 0, /*#__PURE__*/jsx(StyledWheelChangeTimeBtn, _objectSpread(_objectSpread({}, styledPropsNextMeridiem), {}, {
82
108
  "aria-label": "set pm meridiem",
83
109
  "aria-disabled": isDisabledPm,
84
- isDisabled: isDisabledPm,
85
110
  "data-testid": ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MERIDIEM,
86
111
  buttonType: "raw",
87
112
  size: "m",
88
113
  onClick: e => handleTimeWheelBtnChangeMeridiem('PM', e),
89
114
  onKeyDown: handleNextMeridiemBtnOnKeyDown,
90
115
  innerRef: nextMeridiemBtnRef,
91
- tabIndex: -1
92
- }, void 0, _ChevronSmallDown || (_ChevronSmallDown = /*#__PURE__*/_jsx(ChevronSmallDown, {})))));
116
+ tabIndex: -1,
117
+ children: _ChevronSmallDown || (_ChevronSmallDown = /*#__PURE__*/_jsx(ChevronSmallDown, {}))
118
+ }))));
93
119
  };
94
120
 
95
121
  export { MeridiemList, MeridiemList as default };