@mui/x-date-pickers 7.22.2 → 8.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +1 -1
  2. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +3 -3
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -1
  4. package/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts +1 -1
  5. package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +1 -1
  6. package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
  7. package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
  8. package/AdapterMoment/AdapterMoment.d.ts +2 -2
  9. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -2
  10. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -2
  11. package/CHANGELOG.md +142 -155
  12. package/DateCalendar/DateCalendar.d.ts +1 -2
  13. package/DateCalendar/DateCalendar.js +20 -22
  14. package/DateCalendar/DateCalendar.types.d.ts +21 -31
  15. package/DateCalendar/DayCalendar.d.ts +25 -24
  16. package/DateCalendar/DayCalendar.js +13 -10
  17. package/DateCalendar/index.d.ts +1 -0
  18. package/DateCalendar/useCalendarState.d.ts +16 -16
  19. package/DateCalendar/useIsDateDisabled.d.ts +2 -2
  20. package/DateField/DateField.d.ts +1 -2
  21. package/DateField/DateField.js +8 -10
  22. package/DateField/DateField.types.d.ts +8 -9
  23. package/DateField/index.d.ts +1 -1
  24. package/DateField/useDateField.d.ts +1 -2
  25. package/DatePicker/DatePicker.d.ts +1 -2
  26. package/DatePicker/DatePicker.js +15 -14
  27. package/DatePicker/DatePicker.types.d.ts +10 -11
  28. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  29. package/DatePicker/DatePickerToolbar.js +12 -2
  30. package/DatePicker/shared.d.ts +11 -11
  31. package/DateTimeField/DateTimeField.d.ts +1 -2
  32. package/DateTimeField/DateTimeField.js +9 -12
  33. package/DateTimeField/DateTimeField.types.d.ts +9 -14
  34. package/DateTimeField/index.d.ts +1 -1
  35. package/DateTimeField/useDateTimeField.d.ts +1 -2
  36. package/DateTimePicker/DateTimePicker.d.ts +1 -2
  37. package/DateTimePicker/DateTimePicker.js +16 -16
  38. package/DateTimePicker/DateTimePicker.types.d.ts +10 -13
  39. package/DateTimePicker/DateTimePickerTabs.d.ts +1 -2
  40. package/DateTimePicker/DateTimePickerTabs.js +2 -2
  41. package/DateTimePicker/DateTimePickerToolbar.d.ts +3 -3
  42. package/DateTimePicker/DateTimePickerToolbar.js +12 -2
  43. package/DateTimePicker/shared.d.ts +12 -12
  44. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -2
  45. package/DesktopDatePicker/DesktopDatePicker.js +17 -16
  46. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -7
  47. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -2
  48. package/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  49. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
  50. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
  51. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  52. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -2
  53. package/DesktopTimePicker/DesktopTimePicker.js +11 -6
  54. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
  55. package/DigitalClock/DigitalClock.d.ts +1 -2
  56. package/DigitalClock/DigitalClock.js +7 -6
  57. package/DigitalClock/DigitalClock.types.d.ts +4 -4
  58. package/LocalizationProvider/LocalizationProvider.d.ts +12 -12
  59. package/MobileDatePicker/MobileDatePicker.d.ts +1 -2
  60. package/MobileDatePicker/MobileDatePicker.js +17 -16
  61. package/MobileDatePicker/MobileDatePicker.types.d.ts +7 -7
  62. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -2
  63. package/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  64. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +7 -7
  65. package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
  66. package/MobileTimePicker/MobileTimePicker.js +11 -6
  67. package/MobileTimePicker/MobileTimePicker.types.d.ts +7 -7
  68. package/MonthCalendar/MonthCalendar.d.ts +3 -4
  69. package/MonthCalendar/MonthCalendar.js +17 -14
  70. package/MonthCalendar/MonthCalendar.types.d.ts +14 -15
  71. package/MonthCalendar/PickersMonth.js +17 -13
  72. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -2
  73. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  74. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -4
  75. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +9 -9
  76. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +2 -3
  77. package/PickersActionBar/PickersActionBar.js +2 -2
  78. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -2
  79. package/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  80. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
  81. package/PickersDay/PickersDay.d.ts +8 -8
  82. package/PickersLayout/PickersLayout.d.ts +2 -3
  83. package/PickersLayout/PickersLayout.js +10 -0
  84. package/PickersLayout/PickersLayout.types.d.ts +14 -17
  85. package/PickersLayout/index.d.ts +1 -1
  86. package/PickersLayout/usePickerLayout.d.ts +1 -2
  87. package/PickersLayout/usePickerLayout.js +17 -18
  88. package/README.md +2 -2
  89. package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
  90. package/StaticDatePicker/StaticDatePicker.js +14 -13
  91. package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
  92. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
  93. package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  94. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
  95. package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
  96. package/StaticTimePicker/StaticTimePicker.js +8 -3
  97. package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
  98. package/TimeClock/Clock.d.ts +4 -5
  99. package/TimeClock/Clock.js +3 -3
  100. package/TimeClock/ClockNumbers.d.ts +5 -5
  101. package/TimeClock/TimeClock.d.ts +1 -2
  102. package/TimeClock/TimeClock.js +7 -6
  103. package/TimeClock/TimeClock.types.d.ts +4 -4
  104. package/TimeField/TimeField.d.ts +1 -2
  105. package/TimeField/TimeField.js +6 -6
  106. package/TimeField/TimeField.types.d.ts +9 -14
  107. package/TimeField/index.d.ts +1 -1
  108. package/TimeField/useTimeField.d.ts +1 -2
  109. package/TimePicker/TimePicker.d.ts +1 -2
  110. package/TimePicker/TimePicker.js +9 -4
  111. package/TimePicker/TimePicker.types.d.ts +10 -13
  112. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  113. package/TimePicker/TimePickerToolbar.js +12 -2
  114. package/TimePicker/shared.d.ts +10 -10
  115. package/YearCalendar/PickersYear.js +17 -13
  116. package/YearCalendar/YearCalendar.d.ts +1 -2
  117. package/YearCalendar/YearCalendar.js +17 -14
  118. package/YearCalendar/YearCalendar.types.d.ts +14 -15
  119. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  120. package/hooks/index.d.ts +2 -2
  121. package/hooks/index.js +2 -2
  122. package/hooks/useClearableField.js +4 -3
  123. package/hooks/useParsedFormat.d.ts +2 -3
  124. package/hooks/useParsedFormat.js +2 -2
  125. package/hooks/usePickerContext.d.ts +4 -0
  126. package/hooks/usePickerContext.js +15 -0
  127. package/hooks/usePickerTranslations.d.ts +1 -0
  128. package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
  129. package/index.js +1 -1
  130. package/internals/components/{PickersProvider.d.ts → PickerProvider.d.ts} +15 -8
  131. package/internals/components/PickerProvider.js +38 -0
  132. package/internals/hooks/date-helpers-hooks.d.ts +6 -6
  133. package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
  134. package/internals/hooks/useClockReferenceDate.d.ts +5 -5
  135. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
  136. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  137. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
  138. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
  139. package/internals/hooks/useField/useField.d.ts +3 -3
  140. package/internals/hooks/useField/useField.js +1 -1
  141. package/internals/hooks/useField/useField.types.d.ts +38 -48
  142. package/internals/hooks/useField/useField.utils.d.ts +13 -13
  143. package/internals/hooks/useField/useField.utils.js +2 -1
  144. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
  145. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  146. package/internals/hooks/useField/useFieldState.js +3 -3
  147. package/internals/hooks/useField/useFieldV7TextField.js +2 -2
  148. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
  149. package/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  150. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
  151. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  152. package/internals/hooks/usePicker/usePicker.js +12 -4
  153. package/internals/hooks/usePicker/usePicker.types.d.ts +7 -5
  154. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +2 -3
  155. package/internals/hooks/usePicker/usePickerOwnerState.d.ts +4 -3
  156. package/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  157. package/internals/hooks/usePicker/usePickerProvider.d.ts +10 -0
  158. package/internals/hooks/usePicker/usePickerProvider.js +21 -0
  159. package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
  160. package/internals/hooks/usePicker/usePickerValue.js +2 -7
  161. package/internals/hooks/usePicker/usePickerValue.types.d.ts +32 -34
  162. package/internals/hooks/usePicker/usePickerViews.d.ts +6 -11
  163. package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
  164. package/internals/hooks/usePickerPrivateContext.js +9 -0
  165. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
  166. package/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  167. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
  168. package/internals/hooks/useUtils.d.ts +7 -7
  169. package/internals/hooks/useValueWithTimezone.d.ts +5 -5
  170. package/internals/hooks/useViews.d.ts +3 -3
  171. package/internals/hooks/useViews.js +1 -1
  172. package/internals/index.d.ts +6 -4
  173. package/internals/index.js +2 -1
  174. package/internals/models/fields.d.ts +32 -7
  175. package/internals/models/formProps.d.ts +14 -0
  176. package/internals/models/helpers.d.ts +0 -4
  177. package/internals/models/index.d.ts +2 -0
  178. package/internals/models/index.js +3 -1
  179. package/internals/models/props/basePickerProps.d.ts +5 -6
  180. package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
  181. package/internals/models/props/toolbar.d.ts +2 -3
  182. package/internals/models/validation.d.ts +21 -25
  183. package/internals/models/value.d.ts +3 -0
  184. package/internals/models/value.js +1 -0
  185. package/internals/utils/date-time-utils.d.ts +7 -7
  186. package/internals/utils/date-utils.d.ts +16 -16
  187. package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
  188. package/internals/utils/time-utils.d.ts +5 -5
  189. package/internals/utils/valueManagers.d.ts +3 -3
  190. package/locales/beBY.d.ts +3 -3
  191. package/locales/beBY.js +3 -3
  192. package/locales/bgBG.d.ts +3 -3
  193. package/locales/bgBG.js +3 -3
  194. package/locales/caES.d.ts +3 -3
  195. package/locales/caES.js +3 -3
  196. package/locales/csCZ.d.ts +3 -3
  197. package/locales/csCZ.js +3 -3
  198. package/locales/daDK.d.ts +3 -3
  199. package/locales/daDK.js +3 -3
  200. package/locales/deDE.d.ts +3 -3
  201. package/locales/deDE.js +3 -3
  202. package/locales/elGR.d.ts +3 -3
  203. package/locales/elGR.js +12 -13
  204. package/locales/enUS.d.ts +4 -4
  205. package/locales/enUS.js +3 -3
  206. package/locales/esES.d.ts +3 -3
  207. package/locales/esES.js +3 -3
  208. package/locales/eu.d.ts +3 -3
  209. package/locales/eu.js +3 -3
  210. package/locales/faIR.d.ts +3 -3
  211. package/locales/faIR.js +3 -3
  212. package/locales/fiFI.d.ts +3 -3
  213. package/locales/fiFI.js +3 -3
  214. package/locales/frFR.d.ts +3 -3
  215. package/locales/frFR.js +3 -3
  216. package/locales/heIL.d.ts +3 -3
  217. package/locales/heIL.js +3 -3
  218. package/locales/hrHR.d.ts +3 -3
  219. package/locales/hrHR.js +3 -3
  220. package/locales/huHU.d.ts +3 -3
  221. package/locales/huHU.js +3 -3
  222. package/locales/isIS.d.ts +3 -3
  223. package/locales/isIS.js +3 -3
  224. package/locales/itIT.d.ts +3 -3
  225. package/locales/itIT.js +3 -3
  226. package/locales/jaJP.d.ts +3 -3
  227. package/locales/jaJP.js +3 -3
  228. package/locales/koKR.d.ts +3 -3
  229. package/locales/koKR.js +3 -3
  230. package/locales/kzKZ.d.ts +3 -3
  231. package/locales/kzKZ.js +3 -3
  232. package/locales/mk.d.ts +3 -3
  233. package/locales/mk.js +3 -3
  234. package/locales/nbNO.d.ts +3 -3
  235. package/locales/nbNO.js +3 -3
  236. package/locales/nlNL.d.ts +3 -3
  237. package/locales/nlNL.js +3 -3
  238. package/locales/nnNO.d.ts +3 -3
  239. package/locales/nnNO.js +3 -3
  240. package/locales/plPL.d.ts +3 -3
  241. package/locales/plPL.js +3 -3
  242. package/locales/ptBR.d.ts +3 -3
  243. package/locales/ptBR.js +5 -3
  244. package/locales/ptPT.d.ts +3 -3
  245. package/locales/ptPT.js +3 -3
  246. package/locales/roRO.d.ts +3 -3
  247. package/locales/roRO.js +3 -3
  248. package/locales/ruRU.d.ts +3 -3
  249. package/locales/ruRU.js +3 -3
  250. package/locales/skSK.d.ts +3 -3
  251. package/locales/skSK.js +3 -3
  252. package/locales/svSE.d.ts +3 -3
  253. package/locales/svSE.js +3 -3
  254. package/locales/trTR.d.ts +3 -3
  255. package/locales/trTR.js +3 -3
  256. package/locales/ukUA.d.ts +3 -3
  257. package/locales/ukUA.js +3 -3
  258. package/locales/urPK.d.ts +3 -3
  259. package/locales/urPK.js +3 -3
  260. package/locales/utils/getPickersLocalization.d.ts +9 -9
  261. package/locales/utils/getPickersLocalization.js +1 -1
  262. package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
  263. package/locales/viVN.d.ts +3 -3
  264. package/locales/viVN.js +3 -3
  265. package/locales/zhCN.d.ts +3 -3
  266. package/locales/zhCN.js +3 -3
  267. package/locales/zhHK.d.ts +3 -3
  268. package/locales/zhHK.js +3 -3
  269. package/models/adapters.d.ts +151 -202
  270. package/models/fields.d.ts +9 -41
  271. package/models/pickers.d.ts +10 -6
  272. package/modern/DateCalendar/DateCalendar.js +20 -22
  273. package/modern/DateCalendar/DayCalendar.js +13 -10
  274. package/modern/DateField/DateField.js +8 -10
  275. package/modern/DatePicker/DatePicker.js +15 -14
  276. package/modern/DatePicker/DatePickerToolbar.js +12 -2
  277. package/modern/DateTimeField/DateTimeField.js +9 -12
  278. package/modern/DateTimePicker/DateTimePicker.js +16 -16
  279. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
  280. package/modern/DateTimePicker/DateTimePickerToolbar.js +12 -2
  281. package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
  282. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  283. package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  284. package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
  285. package/modern/DigitalClock/DigitalClock.js +7 -6
  286. package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
  287. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  288. package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
  289. package/modern/MonthCalendar/MonthCalendar.js +17 -14
  290. package/modern/MonthCalendar/PickersMonth.js +17 -13
  291. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  292. package/modern/PickersActionBar/PickersActionBar.js +2 -2
  293. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  294. package/modern/PickersLayout/PickersLayout.js +10 -0
  295. package/modern/PickersLayout/usePickerLayout.js +17 -18
  296. package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
  297. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  298. package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
  299. package/modern/TimeClock/Clock.js +3 -3
  300. package/modern/TimeClock/TimeClock.js +7 -6
  301. package/modern/TimeField/TimeField.js +6 -6
  302. package/modern/TimePicker/TimePicker.js +9 -4
  303. package/modern/TimePicker/TimePickerToolbar.js +12 -2
  304. package/modern/YearCalendar/PickersYear.js +17 -13
  305. package/modern/YearCalendar/YearCalendar.js +17 -14
  306. package/modern/hooks/index.js +2 -2
  307. package/modern/hooks/useClearableField.js +4 -3
  308. package/modern/hooks/useParsedFormat.js +2 -2
  309. package/modern/hooks/usePickerContext.js +15 -0
  310. package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
  311. package/modern/index.js +1 -1
  312. package/modern/internals/components/PickerProvider.js +38 -0
  313. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  314. package/modern/internals/hooks/useField/useField.js +1 -1
  315. package/modern/internals/hooks/useField/useField.utils.js +2 -1
  316. package/modern/internals/hooks/useField/useFieldState.js +3 -3
  317. package/modern/internals/hooks/useField/useFieldV7TextField.js +2 -2
  318. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  319. package/modern/internals/hooks/usePicker/usePicker.js +12 -4
  320. package/modern/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  321. package/modern/internals/hooks/usePicker/usePickerProvider.js +21 -0
  322. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -7
  323. package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
  324. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  325. package/modern/internals/hooks/useViews.js +1 -1
  326. package/modern/internals/index.js +2 -1
  327. package/modern/internals/models/formProps.js +1 -0
  328. package/modern/internals/models/index.js +3 -1
  329. package/modern/internals/models/props/time.js +1 -0
  330. package/modern/internals/models/value.js +1 -0
  331. package/modern/locales/beBY.js +3 -3
  332. package/modern/locales/bgBG.js +3 -3
  333. package/modern/locales/caES.js +3 -3
  334. package/modern/locales/csCZ.js +3 -3
  335. package/modern/locales/daDK.js +3 -3
  336. package/modern/locales/deDE.js +3 -3
  337. package/modern/locales/elGR.js +12 -13
  338. package/modern/locales/enUS.js +3 -3
  339. package/modern/locales/esES.js +3 -3
  340. package/modern/locales/eu.js +3 -3
  341. package/modern/locales/faIR.js +3 -3
  342. package/modern/locales/fiFI.js +3 -3
  343. package/modern/locales/frFR.js +3 -3
  344. package/modern/locales/heIL.js +3 -3
  345. package/modern/locales/hrHR.js +3 -3
  346. package/modern/locales/huHU.js +3 -3
  347. package/modern/locales/isIS.js +3 -3
  348. package/modern/locales/itIT.js +3 -3
  349. package/modern/locales/jaJP.js +3 -3
  350. package/modern/locales/koKR.js +3 -3
  351. package/modern/locales/kzKZ.js +3 -3
  352. package/modern/locales/mk.js +3 -3
  353. package/modern/locales/nbNO.js +3 -3
  354. package/modern/locales/nlNL.js +3 -3
  355. package/modern/locales/nnNO.js +3 -3
  356. package/modern/locales/plPL.js +3 -3
  357. package/modern/locales/ptBR.js +5 -3
  358. package/modern/locales/ptPT.js +3 -3
  359. package/modern/locales/roRO.js +3 -3
  360. package/modern/locales/ruRU.js +3 -3
  361. package/modern/locales/skSK.js +3 -3
  362. package/modern/locales/svSE.js +3 -3
  363. package/modern/locales/trTR.js +3 -3
  364. package/modern/locales/ukUA.js +3 -3
  365. package/modern/locales/urPK.js +3 -3
  366. package/modern/locales/utils/getPickersLocalization.js +1 -1
  367. package/modern/locales/viVN.js +3 -3
  368. package/modern/locales/zhCN.js +3 -3
  369. package/modern/locales/zhHK.js +3 -3
  370. package/modern/validation/useValidation.js +2 -3
  371. package/modern/validation/validateDate.js +5 -0
  372. package/modern/validation/validateDateTime.js +5 -0
  373. package/modern/validation/validateTime.js +5 -0
  374. package/node/DateCalendar/DateCalendar.js +20 -22
  375. package/node/DateCalendar/DayCalendar.js +13 -10
  376. package/node/DateField/DateField.js +8 -10
  377. package/node/DatePicker/DatePicker.js +15 -14
  378. package/node/DatePicker/DatePickerToolbar.js +12 -2
  379. package/node/DateTimeField/DateTimeField.js +9 -12
  380. package/node/DateTimePicker/DateTimePicker.js +16 -16
  381. package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
  382. package/node/DateTimePicker/DateTimePickerToolbar.js +12 -2
  383. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
  384. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  385. package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  386. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
  387. package/node/DigitalClock/DigitalClock.js +7 -6
  388. package/node/MobileDatePicker/MobileDatePicker.js +17 -16
  389. package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  390. package/node/MobileTimePicker/MobileTimePicker.js +11 -6
  391. package/node/MonthCalendar/MonthCalendar.js +17 -14
  392. package/node/MonthCalendar/PickersMonth.js +17 -13
  393. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  394. package/node/PickersActionBar/PickersActionBar.js +2 -2
  395. package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  396. package/node/PickersLayout/PickersLayout.js +10 -0
  397. package/node/PickersLayout/usePickerLayout.js +17 -18
  398. package/node/StaticDatePicker/StaticDatePicker.js +14 -13
  399. package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  400. package/node/StaticTimePicker/StaticTimePicker.js +8 -3
  401. package/node/TimeClock/Clock.js +3 -3
  402. package/node/TimeClock/TimeClock.js +7 -6
  403. package/node/TimeField/TimeField.js +6 -6
  404. package/node/TimePicker/TimePicker.js +9 -4
  405. package/node/TimePicker/TimePickerToolbar.js +12 -2
  406. package/node/YearCalendar/PickersYear.js +17 -13
  407. package/node/YearCalendar/YearCalendar.js +17 -14
  408. package/node/hooks/index.js +6 -6
  409. package/node/hooks/useClearableField.js +4 -3
  410. package/node/hooks/useParsedFormat.js +2 -2
  411. package/node/hooks/usePickerContext.js +21 -0
  412. package/node/hooks/usePickerTranslations.js +10 -0
  413. package/node/index.js +1 -1
  414. package/node/internals/components/PickerProvider.js +46 -0
  415. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  416. package/node/internals/hooks/useField/useField.js +1 -1
  417. package/node/internals/hooks/useField/useField.utils.js +2 -1
  418. package/node/internals/hooks/useField/useFieldState.js +3 -3
  419. package/node/internals/hooks/useField/useFieldV7TextField.js +2 -2
  420. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  421. package/node/internals/hooks/usePicker/usePicker.js +12 -4
  422. package/node/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  423. package/node/internals/hooks/usePicker/usePickerProvider.js +28 -0
  424. package/node/internals/hooks/usePicker/usePickerValue.js +1 -7
  425. package/node/internals/hooks/usePickerPrivateContext.js +15 -0
  426. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  427. package/node/internals/hooks/useViews.js +3 -3
  428. package/node/internals/index.js +14 -7
  429. package/node/internals/models/index.js +22 -0
  430. package/node/internals/models/props/time.js +5 -0
  431. package/node/internals/models/value.js +5 -0
  432. package/node/locales/beBY.js +3 -3
  433. package/node/locales/bgBG.js +3 -3
  434. package/node/locales/caES.js +3 -3
  435. package/node/locales/csCZ.js +3 -3
  436. package/node/locales/daDK.js +3 -3
  437. package/node/locales/deDE.js +3 -3
  438. package/node/locales/elGR.js +12 -13
  439. package/node/locales/enUS.js +3 -3
  440. package/node/locales/esES.js +3 -3
  441. package/node/locales/eu.js +3 -3
  442. package/node/locales/faIR.js +3 -3
  443. package/node/locales/fiFI.js +3 -3
  444. package/node/locales/frFR.js +3 -3
  445. package/node/locales/heIL.js +3 -3
  446. package/node/locales/hrHR.js +3 -3
  447. package/node/locales/huHU.js +3 -3
  448. package/node/locales/isIS.js +3 -3
  449. package/node/locales/itIT.js +3 -3
  450. package/node/locales/jaJP.js +3 -3
  451. package/node/locales/koKR.js +3 -3
  452. package/node/locales/kzKZ.js +3 -3
  453. package/node/locales/mk.js +3 -3
  454. package/node/locales/nbNO.js +3 -3
  455. package/node/locales/nlNL.js +3 -3
  456. package/node/locales/nnNO.js +3 -3
  457. package/node/locales/plPL.js +3 -3
  458. package/node/locales/ptBR.js +5 -3
  459. package/node/locales/ptPT.js +3 -3
  460. package/node/locales/roRO.js +3 -3
  461. package/node/locales/ruRU.js +3 -3
  462. package/node/locales/skSK.js +3 -3
  463. package/node/locales/svSE.js +3 -3
  464. package/node/locales/trTR.js +3 -3
  465. package/node/locales/ukUA.js +3 -3
  466. package/node/locales/urPK.js +3 -3
  467. package/node/locales/utils/getPickersLocalization.js +1 -1
  468. package/node/locales/viVN.js +3 -3
  469. package/node/locales/zhCN.js +3 -3
  470. package/node/locales/zhHK.js +3 -3
  471. package/node/validation/useValidation.js +2 -3
  472. package/node/validation/validateDate.js +4 -0
  473. package/node/validation/validateDateTime.js +4 -0
  474. package/node/validation/validateTime.js +4 -0
  475. package/package.json +3 -3
  476. package/themeAugmentation/props.d.ts +28 -28
  477. package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
  478. package/validation/extractValidationProps.d.ts +4 -4
  479. package/validation/useValidation.d.ts +9 -10
  480. package/validation/useValidation.js +2 -3
  481. package/validation/validateDate.d.ts +7 -2
  482. package/validation/validateDate.js +5 -0
  483. package/validation/validateDateTime.d.ts +10 -4
  484. package/validation/validateDateTime.js +5 -0
  485. package/validation/validateTime.d.ts +7 -2
  486. package/validation/validateTime.js +5 -0
  487. package/hooks/usePickersContext.d.ts +0 -4
  488. package/hooks/usePickersContext.js +0 -15
  489. package/hooks/usePickersTranslations.d.ts +0 -2
  490. package/internals/components/PickersProvider.js +0 -26
  491. package/modern/hooks/usePickersContext.js +0 -15
  492. package/modern/internals/components/PickersProvider.js +0 -26
  493. package/node/hooks/usePickersContext.js +0 -21
  494. package/node/hooks/usePickersTranslations.js +0 -10
  495. package/node/internals/components/PickersProvider.js +0 -34
  496. /package/internals/models/{props/clock.js → formProps.js} +0 -0
  497. /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
  498. /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { AvailableAdjustKeyCode, FieldSectionsValueBoundaries, SectionOrdering, FieldSectionValueBoundaries, FieldParsedSelectedSections } from './useField.types';
2
2
  import { FieldSectionType, FieldValueType, FieldSection, MuiPickersAdapter, FieldSectionContentType, PickersTimezone, PickerValidDate, FieldSelectedSections } from '../../../models';
3
- export declare const getDateSectionConfigFromFormatToken: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, formatToken: string) => Pick<FieldSection, "type" | "contentType"> & {
3
+ export declare const getDateSectionConfigFromFormatToken: (utils: MuiPickersAdapter, formatToken: string) => Pick<FieldSection, "type" | "contentType"> & {
4
4
  maxLength: number | undefined;
5
5
  };
6
- export declare const getDaysInWeekStr: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, format: string) => string[];
7
- export declare const getLetterEditingOptions: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
6
+ export declare const getDaysInWeekStr: (utils: MuiPickersAdapter, format: string) => string[];
7
+ export declare const getLetterEditingOptions: (utils: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
8
8
  export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
9
- export declare const getLocalizedDigits: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>) => string[];
9
+ export declare const getLocalizedDigits: (utils: MuiPickersAdapter) => string[];
10
10
  export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
11
11
  export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
12
12
  export declare const isStringNumber: (valueStr: string, localizedDigits: string[]) => boolean;
@@ -16,25 +16,25 @@ export declare const isStringNumber: (valueStr: string, localizedDigits: string[
16
16
  * Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
17
17
  */
18
18
  export declare const cleanLeadingZeros: (valueStr: string, size: number) => string;
19
- export declare const cleanDigitSectionValue: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, value: number, sectionBoundaries: FieldSectionValueBoundaries<TDate, any>, localizedDigits: string[], section: Pick<FieldSection, "format" | "type" | "contentType" | "hasLeadingZerosInFormat" | "hasLeadingZerosInInput" | "maxLength">) => string;
20
- export declare const adjustSectionValue: <TDate extends PickerValidDate, TSection extends FieldSection>(utils: MuiPickersAdapter<TDate>, timezone: PickersTimezone, section: TSection, keyCode: AvailableAdjustKeyCode, sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>, localizedDigits: string[], activeDate: TDate | null, stepsAttributes?: {
19
+ export declare const cleanDigitSectionValue: (utils: MuiPickersAdapter, value: number, sectionBoundaries: FieldSectionValueBoundaries<any>, localizedDigits: string[], section: Pick<FieldSection, "format" | "type" | "contentType" | "hasLeadingZerosInFormat" | "hasLeadingZerosInInput" | "maxLength">) => string;
20
+ export declare const adjustSectionValue: <TSection extends FieldSection>(utils: MuiPickersAdapter, timezone: PickersTimezone, section: TSection, keyCode: AvailableAdjustKeyCode, sectionsValueBoundaries: FieldSectionsValueBoundaries, localizedDigits: string[], activeDate: PickerValidDate | null, stepsAttributes?: {
21
21
  minutesStep?: number;
22
22
  }) => string;
23
23
  export declare const getSectionVisibleValue: (section: FieldSection, target: "input-rtl" | "input-ltr" | "non-input", localizedDigits: string[]) => string;
24
- export declare const changeSectionValueFormat: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, valueStr: string, currentFormat: string, newFormat: string) => string;
25
- export declare const doesSectionFormatHaveLeadingZeros: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, contentType: FieldSectionContentType, sectionType: FieldSectionType, format: string) => boolean;
24
+ export declare const changeSectionValueFormat: (utils: MuiPickersAdapter, valueStr: string, currentFormat: string, newFormat: string) => string;
25
+ export declare const doesSectionFormatHaveLeadingZeros: (utils: MuiPickersAdapter, contentType: FieldSectionContentType, sectionType: FieldSectionType, format: string) => boolean;
26
26
  /**
27
27
  * Some date libraries like `dayjs` don't support parsing from date with escaped characters.
28
28
  * To make sure that the parsing works, we are building a format and a date without any separator.
29
29
  */
30
- export declare const getDateFromDateSections: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, sections: FieldSection[], localizedDigits: string[]) => TDate;
30
+ export declare const getDateFromDateSections: (utils: MuiPickersAdapter, sections: FieldSection[], localizedDigits: string[]) => PickerValidDate;
31
31
  export declare const createDateStrForV7HiddenInputFromSections: (sections: FieldSection[]) => string;
32
32
  export declare const createDateStrForV6InputFromSections: (sections: FieldSection[], localizedDigits: string[], isRtl: boolean) => string;
33
- export declare const getSectionsBoundaries: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries<TDate>;
33
+ export declare const getSectionsBoundaries: (utils: MuiPickersAdapter, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries;
34
34
  export declare const validateSections: <TSection extends FieldSection>(sections: TSection[], valueType: FieldValueType) => void;
35
- export declare const mergeDateIntoReferenceDate: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, dateToTransferFrom: TDate, sections: FieldSection[], referenceDate: TDate, shouldLimitToEditedSections: boolean) => TDate;
35
+ export declare const mergeDateIntoReferenceDate: (utils: MuiPickersAdapter, dateToTransferFrom: PickerValidDate, sections: FieldSection[], referenceDate: PickerValidDate, shouldLimitToEditedSections: boolean) => PickerValidDate;
36
36
  export declare const isAndroid: () => boolean;
37
37
  export declare const getSectionOrder: (sections: FieldSection[], shouldApplyRTL: boolean) => SectionOrdering;
38
38
  export declare const parseSelectedSections: (selectedSections: FieldSelectedSections, sections: FieldSection[]) => FieldParsedSelectedSections;
39
- export declare const getSectionValueText: <TDate extends PickerValidDate>(section: FieldSection, utils: MuiPickersAdapter<TDate>) => string | undefined;
40
- export declare const getSectionValueNow: <TDate extends PickerValidDate>(section: FieldSection, utils: MuiPickersAdapter<TDate>) => number | undefined;
39
+ export declare const getSectionValueText: (section: FieldSection, utils: MuiPickersAdapter) => string | undefined;
40
+ export declare const getSectionValueNow: (section: FieldSection, utils: MuiPickersAdapter) => number | undefined;
@@ -571,7 +571,8 @@ export const parseSelectedSections = (selectedSections, sections) => {
571
571
  return 'all';
572
572
  }
573
573
  if (typeof selectedSections === 'string') {
574
- return sections.findIndex(section => section.type === selectedSections);
574
+ const index = sections.findIndex(section => section.type === selectedSections);
575
+ return index === -1 ? null : index;
575
576
  }
576
577
  return selectedSections;
577
578
  };
@@ -1,14 +1,14 @@
1
- import { FieldSection, PickersTimezone, PickerValidDate } from '../../../models';
1
+ import { FieldSection, PickersTimezone } from '../../../models';
2
2
  import { FieldSectionsValueBoundaries } from './useField.types';
3
3
  import { UpdateSectionValueParams } from './useFieldState';
4
4
  export interface ApplyCharacterEditingParams {
5
5
  keyPressed: string;
6
6
  sectionIndex: number;
7
7
  }
8
- interface UseFieldCharacterEditingParams<TDate extends PickerValidDate, TSection extends FieldSection> {
8
+ interface UseFieldCharacterEditingParams<TSection extends FieldSection> {
9
9
  sections: TSection[];
10
10
  updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
11
- sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>;
11
+ sectionsValueBoundaries: FieldSectionsValueBoundaries;
12
12
  localizedDigits: string[];
13
13
  setTempAndroidValueStr: (newValue: string | null) => void;
14
14
  timezone: PickersTimezone;
@@ -24,5 +24,5 @@ export interface UseFieldCharacterEditingResponse {
24
24
  * 1. The numeric editing when the user presses a digit
25
25
  * 2. The letter editing when the user presses another key
26
26
  */
27
- export declare const useFieldCharacterEditing: <TDate extends PickerValidDate, TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, localizedDigits, setTempAndroidValueStr, timezone, }: UseFieldCharacterEditingParams<TDate, TSection>) => UseFieldCharacterEditingResponse;
27
+ export declare const useFieldCharacterEditing: <TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, localizedDigits, setTempAndroidValueStr, timezone, }: UseFieldCharacterEditingParams<TSection>) => UseFieldCharacterEditingResponse;
28
28
  export {};
@@ -1,5 +1,5 @@
1
1
  import { UseFieldInternalProps, UseFieldParams, UseFieldState, FieldParsedSelectedSections, FieldSectionsValueBoundaries, UseFieldForwardedProps } from './useField.types';
2
- import { FieldSection, FieldSelectedSections, PickersTimezone, PickerValidDate } from '../../../models';
2
+ import { FieldSection, FieldSelectedSections, PickersTimezone } from '../../../models';
3
3
  export interface UpdateSectionValueParams<TSection extends FieldSection> {
4
4
  /**
5
5
  * The section on which we want to apply the new value.
@@ -14,7 +14,7 @@ export interface UpdateSectionValueParams<TSection extends FieldSection> {
14
14
  */
15
15
  shouldGoToNextSection: boolean;
16
16
  }
17
- export interface UseFieldStateResponse<TValue, TDate extends PickerValidDate, TSection extends FieldSection> {
17
+ export interface UseFieldStateResponse<TValue, TSection extends FieldSection> {
18
18
  state: UseFieldState<TValue, TSection>;
19
19
  activeSectionIndex: number | null;
20
20
  parsedSelectedSections: FieldParsedSelectedSections;
@@ -24,9 +24,9 @@ export interface UseFieldStateResponse<TValue, TDate extends PickerValidDate, TS
24
24
  updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
25
25
  updateValueFromValueStr: (valueStr: string) => void;
26
26
  setTempAndroidValueStr: (tempAndroidValueStr: string | null) => void;
27
- sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>;
27
+ sectionsValueBoundaries: FieldSectionsValueBoundaries;
28
28
  getSectionsFromValue: (value: TValue, fallbackSections?: TSection[] | null) => TSection[];
29
29
  localizedDigits: string[];
30
30
  timezone: PickersTimezone;
31
31
  }
32
- export declare const useFieldState: <TValue, TDate extends PickerValidDate, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>, TInternalProps extends UseFieldInternalProps<any, any, any, any, any>>(params: UseFieldParams<TValue, TDate, TSection, TEnableAccessibleFieldDOMStructure, TForwardedProps, TInternalProps>) => UseFieldStateResponse<TValue, TDate, TSection>;
32
+ export declare const useFieldState: <TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>, TInternalProps extends UseFieldInternalProps<any, any, any, any>>(params: UseFieldParams<TValue, TSection, TEnableAccessibleFieldDOMStructure, TForwardedProps, TInternalProps>) => UseFieldStateResponse<TValue, TSection>;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import useControlled from '@mui/utils/useControlled';
4
4
  import { useRtl } from '@mui/system/RtlProvider';
5
- import { usePickersTranslations } from "../../../hooks/usePickersTranslations.js";
5
+ import { usePickerTranslations } from "../../../hooks/usePickerTranslations.js";
6
6
  import { useUtils, useLocalizationContext } from "../useUtils.js";
7
7
  import { mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, parseSelectedSections, getLocalizedDigits } from "./useField.utils.js";
8
8
  import { buildSectionsFromFormat } from "./buildSectionsFromFormat.js";
@@ -10,7 +10,7 @@ import { useValueWithTimezone } from "../useValueWithTimezone.js";
10
10
  import { getSectionTypeGranularity } from "../../utils/getDefaultReferenceDate.js";
11
11
  export const useFieldState = params => {
12
12
  const utils = useUtils();
13
- const translations = usePickersTranslations();
13
+ const translations = usePickerTranslations();
14
14
  const adapter = useLocalizationContext();
15
15
  const isRtl = useRtl();
16
16
  const {
@@ -30,7 +30,7 @@ export const useFieldState = params => {
30
30
  onSelectedSectionsChange,
31
31
  shouldRespectLeadingZeros = false,
32
32
  timezone: timezoneProp,
33
- enableAccessibleFieldDOMStructure = false
33
+ enableAccessibleFieldDOMStructure = true
34
34
  }
35
35
  } = params;
36
36
  const {
@@ -5,7 +5,7 @@ import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
5
5
  import useId from '@mui/utils/useId';
6
6
  import { getSectionValueNow, getSectionValueText, parseSelectedSections } from "./useField.utils.js";
7
7
  import { getActiveElement } from "../../utils/utils.js";
8
- import { usePickersTranslations } from "../../../hooks/usePickersTranslations.js";
8
+ import { usePickerTranslations } from "../../../hooks/usePickerTranslations.js";
9
9
  import { useUtils } from "../useUtils.js";
10
10
  export const useFieldV7TextField = params => {
11
11
  const {
@@ -39,7 +39,7 @@ export const useFieldV7TextField = params => {
39
39
  } = params;
40
40
  const sectionListRef = React.useRef(null);
41
41
  const handleSectionListRef = useForkRef(inSectionListRef, sectionListRef);
42
- const translations = usePickersTranslations();
42
+ const translations = usePickerTranslations();
43
43
  const utils = useUtils();
44
44
  const id = useId();
45
45
  const [focused, setFocused] = React.useState(false);
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { UseMobilePickerParams, UseMobilePickerProps } from './useMobilePicker.types';
3
- import { PickerValidDate } from '../../../models';
4
3
  import { DateOrTimeViewWithMeridiem } from '../../models';
5
4
  /**
6
5
  * Hook managing all the single-date mobile pickers:
@@ -8,6 +7,6 @@ import { DateOrTimeViewWithMeridiem } from '../../models';
8
7
  * - MobileDateTimePicker
9
8
  * - MobileTimePicker
10
9
  */
11
- export declare const useMobilePicker: <TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TDate, TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({ props, getOpenDialogAriaText, ...pickerParams }: UseMobilePickerParams<TDate, TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
10
+ export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({ props, getOpenDialogAriaText, ...pickerParams }: UseMobilePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
12
11
  renderPicker: () => React.JSX.Element;
13
12
  };
@@ -9,7 +9,7 @@ import { PickersModalDialog } from "../../components/PickersModalDialog.js";
9
9
  import { usePicker } from "../usePicker/index.js";
10
10
  import { onSpaceOrEnter } from "../../utils/utils.js";
11
11
  import { PickersLayout } from "../../../PickersLayout/index.js";
12
- import { PickersProvider } from "../../components/PickersProvider.js";
12
+ import { PickerProvider } from "../../components/PickerProvider.js";
13
13
 
14
14
  /**
15
15
  * Hook managing all the single-date mobile pickers:
@@ -49,12 +49,14 @@ export const useMobilePicker = _ref => {
49
49
  open,
50
50
  actions,
51
51
  layoutProps,
52
+ providerProps,
52
53
  renderCurrentView,
53
54
  fieldProps: pickerFieldProps,
54
- contextValue
55
+ ownerState
55
56
  } = usePicker(_extends({}, pickerParams, {
56
57
  props,
57
58
  fieldRef,
59
+ localeText,
58
60
  autoFocusView: true,
59
61
  additionalViewProps: {},
60
62
  wrapperVariant: 'mobile'
@@ -63,28 +65,33 @@ export const useMobilePicker = _ref => {
63
65
  const fieldProps = useSlotProps({
64
66
  elementType: Field,
65
67
  externalSlotProps: innerSlotProps?.field,
66
- additionalProps: _extends({}, pickerFieldProps, isToolbarHidden && {
67
- id: labelId
68
- }, !(disabled || readOnly) && {
69
- onClick: actions.onOpen,
70
- onKeyDown: onSpaceOrEnter(actions.onOpen)
71
- }, {
68
+ additionalProps: _extends({
69
+ // Internal props
72
70
  readOnly: readOnly ?? true,
73
71
  disabled,
74
- className,
75
- sx,
76
72
  format,
77
73
  formatDensity,
78
74
  enableAccessibleFieldDOMStructure,
79
75
  selectedSections,
80
76
  onSelectedSectionsChange,
81
- timezone,
77
+ timezone
78
+ }, pickerFieldProps, {
79
+ // onChange and value
80
+
81
+ // Forwarded props
82
+ className,
83
+ sx,
82
84
  label,
83
85
  name
84
- }, inputRef ? {
86
+ }, isToolbarHidden && {
87
+ id: labelId
88
+ }, !(disabled || readOnly) && {
89
+ onClick: actions.onOpen,
90
+ onKeyDown: onSpaceOrEnter(actions.onOpen)
91
+ }, !!inputRef && {
85
92
  inputRef
86
- } : {}),
87
- ownerState: props
93
+ }),
94
+ ownerState
88
95
  });
89
96
 
90
97
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
@@ -112,9 +119,7 @@ export const useMobilePicker = _ref => {
112
119
  }, innerSlotProps?.mobilePaper)
113
120
  });
114
121
  const handleFieldRef = useForkRef(fieldRef, fieldProps.unstableFieldRef);
115
- const renderPicker = () => /*#__PURE__*/_jsxs(PickersProvider, {
116
- contextValue: contextValue,
117
- localeText: localeText,
122
+ const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
118
123
  children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
119
124
  slots: slotsForField,
120
125
  slotProps: slotProps,
@@ -129,7 +134,7 @@ export const useMobilePicker = _ref => {
129
134
  children: renderCurrentView()
130
135
  }))
131
136
  }))]
132
- });
137
+ }));
133
138
  return {
134
139
  renderPicker
135
140
  };
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import TextField from '@mui/material/TextField';
3
3
  import { SlotComponentProps } from '@mui/utils';
4
+ import { MakeRequired, SlotComponentPropsFromProps } from '@mui/x-internals/types';
4
5
  import { BaseNonStaticPickerProps, BasePickerProps, BaseNonRangeNonStaticPickerProps } from '../../models/props/basePickerProps';
5
6
  import { PickersModalDialogSlots, PickersModalDialogSlotProps } from '../../components/PickersModalDialog';
6
- import { UsePickerParams, UsePickerProps } from '../usePicker';
7
- import { BaseSingleInputFieldProps, FieldSection, PickerValidDate } from '../../../models';
7
+ import { UsePickerParams } from '../usePicker';
8
+ import { FieldSection, PickerFieldSlotProps, PickerOwnerState, PickerValidDate } from '../../../models';
8
9
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps, PickersLayoutSlotProps } from '../../../PickersLayout/PickersLayout.types';
9
10
  import { UsePickerValueNonStaticProps } from '../usePicker/usePickerValue.types';
10
11
  import { UsePickerViewsNonStaticProps, UsePickerViewsProps } from '../usePicker/usePickerViews';
11
12
  import { DateOrTimeViewWithMeridiem } from '../../models';
12
- import { SlotComponentPropsFromProps } from '../../models/helpers';
13
- export interface UseMobilePickerSlots<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlots, ExportedPickersLayoutSlots<TDate | null, TDate, TView> {
13
+ export interface UseMobilePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlots, ExportedPickersLayoutSlots<PickerValidDate | null, TView> {
14
14
  /**
15
15
  * Component used to enter the date with the keyboard.
16
16
  */
@@ -21,27 +21,27 @@ export interface UseMobilePickerSlots<TDate extends PickerValidDate, TView exten
21
21
  */
22
22
  textField?: React.ElementType;
23
23
  }
24
- export interface ExportedUseMobilePickerSlotProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<TDate | null, TDate, TView> {
25
- field?: SlotComponentPropsFromProps<BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, unknown>, {}, UsePickerProps<TDate | null, TDate, any, any, any, any>>;
24
+ export interface ExportedUseMobilePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValidDate | null, TView> {
25
+ field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValidDate | null, FieldSection, TEnableAccessibleFieldDOMStructure>, {}, PickerOwnerState>;
26
26
  textField?: SlotComponentProps<typeof TextField, {}, Record<string, any>>;
27
27
  }
28
- export interface UseMobilePickerSlotProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobilePickerSlotProps<TDate, TView, TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<TDate | null, TDate, TView>, 'toolbar'> {
28
+ export interface UseMobilePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobilePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerValidDate | null, TView>, 'toolbar'> {
29
29
  }
30
30
  export interface MobileOnlyPickerProps extends BaseNonStaticPickerProps, BaseNonRangeNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps {
31
31
  }
32
- export interface UseMobilePickerProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, MobileOnlyPickerProps {
32
+ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends BasePickerProps<PickerValidDate | null, TView, TError, TExternalProps, {}>, MakeRequired<MobileOnlyPickerProps, 'format'> {
33
33
  /**
34
34
  * Overridable component slots.
35
35
  * @default {}
36
36
  */
37
- slots: UseMobilePickerSlots<TDate, TView>;
37
+ slots: UseMobilePickerSlots<TView>;
38
38
  /**
39
39
  * The props used for each component slot.
40
40
  * @default {}
41
41
  */
42
- slotProps?: UseMobilePickerSlotProps<TDate, TView, TEnableAccessibleFieldDOMStructure>;
42
+ slotProps?: UseMobilePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>;
43
43
  }
44
- export interface UseMobilePickerParams<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TDate, TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParams<TDate | null, TDate, TView, FieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
44
+ export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParams<PickerValidDate | null, TView, FieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
45
45
  props: TExternalProps;
46
- getOpenDialogAriaText: (date: TDate | null) => string;
46
+ getOpenDialogAriaText: (date: PickerValidDate | null) => string;
47
47
  }
@@ -1,4 +1,4 @@
1
1
  import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.types';
2
- import { FieldSection, PickerValidDate, InferError } from '../../../models';
2
+ import { FieldSection, InferError } from '../../../models';
3
3
  import { DateOrTimeViewWithMeridiem } from '../../models';
4
- export declare const usePicker: <TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, additionalViewProps, validator, autoFocusView, rendererInterceptor, fieldRef, }: UsePickerParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
4
+ export declare const usePicker: <TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TView, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, additionalViewProps, validator, autoFocusView, rendererInterceptor, fieldRef, localeText, }: UsePickerParams<TValue, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
@@ -3,6 +3,7 @@ import { usePickerValue } from "./usePickerValue.js";
3
3
  import { usePickerViews } from "./usePickerViews.js";
4
4
  import { usePickerLayoutProps } from "./usePickerLayoutProps.js";
5
5
  import { usePickerOwnerState } from "./usePickerOwnerState.js";
6
+ import { usePickerProvider } from "./usePickerProvider.js";
6
7
  export const usePicker = ({
7
8
  props,
8
9
  valueManager,
@@ -12,7 +13,8 @@ export const usePicker = ({
12
13
  validator,
13
14
  autoFocusView,
14
15
  rendererInterceptor,
15
- fieldRef
16
+ fieldRef,
17
+ localeText
16
18
  }) => {
17
19
  if (process.env.NODE_ENV !== 'production') {
18
20
  if (props.renderInput != null) {
@@ -42,7 +44,13 @@ export const usePicker = ({
42
44
  });
43
45
  const pickerOwnerState = usePickerOwnerState({
44
46
  props,
45
- pickerValueResponse
47
+ pickerValueResponse,
48
+ valueManager
49
+ });
50
+ const providerProps = usePickerProvider({
51
+ pickerValueResponse,
52
+ ownerState: pickerOwnerState,
53
+ localeText
46
54
  });
47
55
  return {
48
56
  // Picker value
@@ -55,8 +63,8 @@ export const usePicker = ({
55
63
  shouldRestoreFocus: pickerViewsResponse.shouldRestoreFocus,
56
64
  // Picker layout
57
65
  layoutProps: pickerLayoutResponse.layoutProps,
58
- // Picker context
59
- contextValue: pickerValueResponse.contextValue,
66
+ // Picker provider
67
+ providerProps,
60
68
  // Picker owner state
61
69
  ownerState: pickerOwnerState
62
70
  };
@@ -1,18 +1,20 @@
1
1
  import { UsePickerValueParams, UsePickerValueProps, UsePickerValueBaseProps, UsePickerValueResponse } from './usePickerValue.types';
2
2
  import { UsePickerViewsProps, UsePickerViewParams, UsePickerViewsResponse, UsePickerViewsBaseProps } from './usePickerViews';
3
3
  import { UsePickerLayoutProps, UsePickerLayoutPropsResponse } from './usePickerLayoutProps';
4
- import { FieldSection, PickerOwnerState, PickerValidDate } from '../../../models';
4
+ import { FieldSection, PickerOwnerState } from '../../../models';
5
5
  import { DateOrTimeViewWithMeridiem } from '../../models';
6
+ import { UsePickerProviderParameters, UsePickerProviderReturnValue } from './usePickerProvider';
6
7
  /**
7
8
  * Props common to all picker headless implementations.
8
9
  */
9
- export interface UsePickerBaseProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
10
+ export interface UsePickerBaseProps<TValue, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
10
11
  }
11
- export interface UsePickerProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TError>, UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
12
+ export interface UsePickerProps<TValue, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TError>, UsePickerViewsProps<TValue, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
12
13
  }
13
- export interface UsePickerParams<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'autoFocusView' | 'rendererInterceptor' | 'fieldRef'> {
14
+ export interface UsePickerParams<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TView, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TView, TSection, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'autoFocusView' | 'rendererInterceptor' | 'fieldRef'>, Pick<UsePickerProviderParameters<TValue>, 'localeText'> {
14
15
  props: TExternalProps;
15
16
  }
16
17
  export interface UsePickerResponse<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError> extends Omit<UsePickerValueResponse<TValue, TSection, TError>, 'viewProps' | 'layoutProps'>, Omit<UsePickerViewsResponse<TView>, 'layoutProps'>, UsePickerLayoutPropsResponse<TValue, TView> {
17
- ownerState: PickerOwnerState<TValue>;
18
+ ownerState: PickerOwnerState;
19
+ providerProps: UsePickerProviderReturnValue;
18
20
  }
@@ -1,13 +1,12 @@
1
1
  import { UsePickerValueLayoutResponse } from './usePickerValue.types';
2
2
  import { UsePickerViewsLayoutResponse } from './usePickerViews';
3
3
  import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../../models/common';
4
+ import { FormProps } from '../../models';
4
5
  /**
5
6
  * Props used to create the layout of the views.
6
7
  * Those props are exposed on all the pickers.
7
8
  */
8
- export interface UsePickerLayoutProps {
9
- disabled?: boolean;
10
- readOnly?: boolean;
9
+ export interface UsePickerLayoutProps extends FormProps {
11
10
  /**
12
11
  * Force rendering in particular orientation.
13
12
  */
@@ -1,9 +1,10 @@
1
1
  import { FieldSection, PickerOwnerState } from '../../../models';
2
2
  import type { UsePickerProps } from './usePicker.types';
3
- import { UsePickerValueResponse } from './usePickerValue.types';
3
+ import { PickerValueManager, UsePickerValueResponse } from './usePickerValue.types';
4
4
  interface UsePickerOwnerStateParameters<TValue> {
5
- props: UsePickerProps<TValue, any, any, any, any, any>;
5
+ props: UsePickerProps<TValue, any, any, any, any>;
6
6
  pickerValueResponse: UsePickerValueResponse<TValue, FieldSection, any>;
7
+ valueManager: PickerValueManager<TValue, any>;
7
8
  }
8
- export declare function usePickerOwnerState<TValue>(parameters: UsePickerOwnerStateParameters<TValue>): PickerOwnerState<TValue>;
9
+ export declare function usePickerOwnerState<TValue>(parameters: UsePickerOwnerStateParameters<TValue>): PickerOwnerState;
9
10
  export {};
@@ -1,13 +1,16 @@
1
1
  import * as React from 'react';
2
+ import { useUtils } from "../useUtils.js";
2
3
  export function usePickerOwnerState(parameters) {
3
4
  const {
4
5
  props,
5
- pickerValueResponse
6
+ pickerValueResponse,
7
+ valueManager
6
8
  } = parameters;
9
+ const utils = useUtils();
7
10
  return React.useMemo(() => ({
8
- value: pickerValueResponse.viewProps.value,
9
- open: pickerValueResponse.open,
10
- disabled: props.disabled ?? false,
11
- readOnly: props.readOnly ?? false
12
- }), [pickerValueResponse.viewProps.value, pickerValueResponse.open, props.disabled, props.readOnly]);
11
+ isPickerValueEmpty: valueManager.areValuesEqual(utils, pickerValueResponse.viewProps.value, valueManager.emptyValue),
12
+ isPickerOpen: pickerValueResponse.open,
13
+ isPickerDisabled: props.disabled ?? false,
14
+ isPickerReadOnly: props.readOnly ?? false
15
+ }), [utils, valueManager, pickerValueResponse.viewProps.value, pickerValueResponse.open, props.disabled, props.readOnly]);
13
16
  }
@@ -0,0 +1,10 @@
1
+ import { FieldSection, PickerOwnerState } from '../../../models';
2
+ import { UsePickerValueResponse } from './usePickerValue.types';
3
+ import { PickerProviderProps } from '../../components/PickerProvider';
4
+ export interface UsePickerProviderParameters<TValue> extends Pick<PickerProviderProps, 'localeText'> {
5
+ pickerValueResponse: UsePickerValueResponse<TValue, FieldSection, any>;
6
+ ownerState: PickerOwnerState;
7
+ }
8
+ export interface UsePickerProviderReturnValue extends Omit<PickerProviderProps, 'children'> {
9
+ }
10
+ export declare function usePickerProvider<TValue>(parameters: UsePickerProviderParameters<TValue>): UsePickerProviderReturnValue;
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export function usePickerProvider(parameters) {
3
+ const {
4
+ pickerValueResponse,
5
+ ownerState,
6
+ localeText
7
+ } = parameters;
8
+ const contextValue = React.useMemo(() => ({
9
+ onOpen: pickerValueResponse.actions.onOpen,
10
+ onClose: pickerValueResponse.actions.onClose,
11
+ open: pickerValueResponse.open
12
+ }), [pickerValueResponse.actions.onOpen, pickerValueResponse.actions.onClose, pickerValueResponse.open]);
13
+ const privateContextValue = React.useMemo(() => ({
14
+ ownerState
15
+ }), [ownerState]);
16
+ return {
17
+ localeText,
18
+ contextValue,
19
+ privateContextValue
20
+ };
21
+ }
@@ -1,6 +1,6 @@
1
- import { FieldSection, PickerValidDate, InferError } from '../../../models';
1
+ import { FieldSection, InferError } from '../../../models';
2
2
  import { UsePickerValueProps, UsePickerValueParams, UsePickerValueResponse } from './usePickerValue.types';
3
3
  /**
4
4
  * Manage the value lifecycle of all the pickers.
5
5
  */
6
- export declare const usePickerValue: <TValue, TDate extends PickerValidDate, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, any>>({ props, valueManager, valueType, wrapperVariant, validator, }: UsePickerValueParams<TValue, TDate, TExternalProps>) => UsePickerValueResponse<TValue, TSection, InferError<TExternalProps>>;
6
+ export declare const usePickerValue: <TValue, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, any>>({ props, valueManager, valueType, wrapperVariant, validator, }: UsePickerValueParams<TValue, TExternalProps>) => UsePickerValueResponse<TValue, TSection, InferError<TExternalProps>>;
@@ -5,6 +5,7 @@ import { useOpenState } from "../useOpenState.js";
5
5
  import { useLocalizationContext, useUtils } from "../useUtils.js";
6
6
  import { useValidation } from "../../../validation/index.js";
7
7
  import { useValueWithTimezone } from "../useValueWithTimezone.js";
8
+
8
9
  /**
9
10
  * Decide if the new value should be published
10
11
  * The published value will be passed to `onChange` if defined.
@@ -333,17 +334,11 @@ export const usePickerValue = ({
333
334
  onSelectShortcut: handleSelectShortcut,
334
335
  isValid
335
336
  });
336
- const contextValue = React.useMemo(() => ({
337
- onOpen: handleOpen,
338
- onClose: handleClose,
339
- open: isOpen
340
- }), [isOpen, handleClose, handleOpen]);
341
337
  return {
342
338
  open: isOpen,
343
339
  fieldProps: fieldResponse,
344
340
  viewProps: viewResponse,
345
341
  layoutProps: layoutResponse,
346
- actions,
347
- contextValue
342
+ actions
348
343
  };
349
344
  };