@mui/x-date-pickers 8.0.0-beta.2 → 8.0.0-beta.3

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 (378) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/DateField/DateField.js +4 -4
  3. package/DateTimeField/DateTimeField.js +4 -4
  4. package/DesktopDatePicker/DesktopDatePicker.js +2 -1
  5. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
  6. package/DesktopTimePicker/DesktopTimePicker.js +2 -1
  7. package/DigitalClock/DigitalClock.js +1 -0
  8. package/LocalizationProvider/LocalizationProvider.d.ts +1 -1
  9. package/LocalizationProvider/LocalizationProvider.js +2 -2
  10. package/MobileDatePicker/MobileDatePicker.js +2 -1
  11. package/MobileDateTimePicker/MobileDateTimePicker.js +9 -1
  12. package/MobileTimePicker/MobileTimePicker.js +2 -1
  13. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -0
  14. package/PickersActionBar/PickersActionBar.d.ts +1 -1
  15. package/PickersActionBar/PickersActionBar.js +21 -3
  16. package/StaticDatePicker/StaticDatePicker.js +2 -1
  17. package/StaticDateTimePicker/StaticDateTimePicker.js +9 -1
  18. package/StaticTimePicker/StaticTimePicker.js +2 -1
  19. package/TimeField/TimeField.js +4 -4
  20. package/esm/DateField/DateField.js +4 -4
  21. package/esm/DateTimeField/DateTimeField.js +4 -4
  22. package/esm/DesktopDatePicker/DesktopDatePicker.js +2 -1
  23. package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
  24. package/esm/DesktopTimePicker/DesktopTimePicker.js +2 -1
  25. package/esm/DigitalClock/DigitalClock.js +1 -0
  26. package/esm/LocalizationProvider/LocalizationProvider.d.ts +1 -1
  27. package/esm/LocalizationProvider/LocalizationProvider.js +2 -2
  28. package/esm/MobileDatePicker/MobileDatePicker.js +2 -1
  29. package/esm/MobileDateTimePicker/MobileDateTimePicker.js +9 -1
  30. package/esm/MobileTimePicker/MobileTimePicker.js +2 -1
  31. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -0
  32. package/esm/PickersActionBar/PickersActionBar.d.ts +1 -1
  33. package/esm/PickersActionBar/PickersActionBar.js +22 -4
  34. package/esm/StaticDatePicker/StaticDatePicker.js +2 -1
  35. package/esm/StaticDateTimePicker/StaticDateTimePicker.js +9 -1
  36. package/esm/StaticTimePicker/StaticTimePicker.js +2 -1
  37. package/esm/TimeField/TimeField.js +4 -4
  38. package/esm/index.js +1 -1
  39. package/esm/internals/components/PickerProvider.d.ts +9 -0
  40. package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -0
  41. package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -3
  42. package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -0
  43. package/esm/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  44. package/esm/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -0
  45. package/esm/internals/hooks/useMobilePicker/useMobilePicker.js +9 -3
  46. package/esm/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -0
  47. package/esm/internals/hooks/usePicker/usePicker.d.ts +2 -1
  48. package/esm/internals/hooks/usePicker/usePicker.js +14 -4
  49. package/esm/internals/hooks/usePicker/usePicker.types.d.ts +2 -0
  50. package/esm/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -0
  51. package/esm/internals/hooks/useStaticPicker/useStaticPicker.js +9 -3
  52. package/esm/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +7 -0
  53. package/esm/internals/index.d.ts +3 -2
  54. package/esm/internals/index.js +3 -2
  55. package/esm/internals/utils/createNonRangePickerStepNavigation.d.ts +13 -0
  56. package/esm/internals/utils/createNonRangePickerStepNavigation.js +24 -0
  57. package/esm/internals/utils/createStepNavigation.d.ts +32 -0
  58. package/esm/internals/utils/createStepNavigation.js +34 -0
  59. package/esm/internals/utils/date-utils.d.ts +1 -0
  60. package/esm/internals/utils/date-utils.js +2 -2
  61. package/esm/internals/utils/time-utils.d.ts +2 -0
  62. package/esm/internals/utils/time-utils.js +4 -3
  63. package/esm/locales/beBY.d.ts +1 -0
  64. package/esm/locales/beBY.js +1 -0
  65. package/esm/locales/bgBG.d.ts +1 -0
  66. package/esm/locales/bgBG.js +1 -0
  67. package/esm/locales/bnBD.d.ts +1 -0
  68. package/esm/locales/bnBD.js +1 -0
  69. package/esm/locales/caES.d.ts +1 -0
  70. package/esm/locales/caES.js +1 -0
  71. package/esm/locales/csCZ.d.ts +1 -0
  72. package/esm/locales/csCZ.js +1 -0
  73. package/esm/locales/daDK.d.ts +1 -0
  74. package/esm/locales/daDK.js +1 -0
  75. package/esm/locales/deDE.d.ts +1 -0
  76. package/esm/locales/deDE.js +1 -0
  77. package/esm/locales/elGR.d.ts +1 -0
  78. package/esm/locales/elGR.js +1 -0
  79. package/esm/locales/enUS.d.ts +1 -0
  80. package/esm/locales/enUS.js +1 -0
  81. package/esm/locales/esES.d.ts +1 -0
  82. package/esm/locales/esES.js +1 -0
  83. package/esm/locales/eu.d.ts +1 -0
  84. package/esm/locales/eu.js +1 -0
  85. package/esm/locales/faIR.d.ts +1 -0
  86. package/esm/locales/faIR.js +1 -0
  87. package/esm/locales/fiFI.d.ts +1 -0
  88. package/esm/locales/fiFI.js +1 -0
  89. package/esm/locales/frFR.d.ts +1 -0
  90. package/esm/locales/frFR.js +1 -0
  91. package/esm/locales/heIL.d.ts +1 -0
  92. package/esm/locales/heIL.js +1 -0
  93. package/esm/locales/hrHR.d.ts +1 -0
  94. package/esm/locales/hrHR.js +1 -0
  95. package/esm/locales/huHU.d.ts +1 -0
  96. package/esm/locales/huHU.js +1 -0
  97. package/esm/locales/isIS.d.ts +1 -0
  98. package/esm/locales/isIS.js +1 -0
  99. package/esm/locales/itIT.d.ts +1 -0
  100. package/esm/locales/itIT.js +1 -0
  101. package/esm/locales/jaJP.d.ts +1 -0
  102. package/esm/locales/jaJP.js +1 -0
  103. package/esm/locales/koKR.d.ts +1 -0
  104. package/esm/locales/koKR.js +1 -0
  105. package/esm/locales/kzKZ.d.ts +1 -0
  106. package/esm/locales/kzKZ.js +1 -0
  107. package/esm/locales/mk.d.ts +1 -0
  108. package/esm/locales/mk.js +1 -0
  109. package/esm/locales/nbNO.d.ts +1 -0
  110. package/esm/locales/nbNO.js +1 -0
  111. package/esm/locales/nlNL.d.ts +1 -0
  112. package/esm/locales/nlNL.js +1 -0
  113. package/esm/locales/nnNO.d.ts +1 -0
  114. package/esm/locales/nnNO.js +1 -0
  115. package/esm/locales/plPL.d.ts +1 -0
  116. package/esm/locales/plPL.js +1 -0
  117. package/esm/locales/ptBR.d.ts +1 -0
  118. package/esm/locales/ptBR.js +1 -0
  119. package/esm/locales/ptPT.d.ts +1 -0
  120. package/esm/locales/ptPT.js +1 -0
  121. package/esm/locales/roRO.d.ts +1 -0
  122. package/esm/locales/roRO.js +1 -0
  123. package/esm/locales/ruRU.d.ts +1 -0
  124. package/esm/locales/ruRU.js +1 -0
  125. package/esm/locales/skSK.d.ts +1 -0
  126. package/esm/locales/skSK.js +1 -0
  127. package/esm/locales/svSE.d.ts +1 -0
  128. package/esm/locales/svSE.js +1 -0
  129. package/esm/locales/trTR.d.ts +1 -0
  130. package/esm/locales/trTR.js +1 -0
  131. package/esm/locales/ukUA.d.ts +1 -0
  132. package/esm/locales/ukUA.js +1 -0
  133. package/esm/locales/urPK.d.ts +1 -0
  134. package/esm/locales/urPK.js +1 -0
  135. package/esm/locales/utils/getPickersLocalization.d.ts +1 -0
  136. package/esm/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  137. package/esm/locales/viVN.d.ts +1 -0
  138. package/esm/locales/viVN.js +1 -0
  139. package/esm/locales/zhCN.d.ts +1 -0
  140. package/esm/locales/zhCN.js +1 -0
  141. package/esm/locales/zhHK.d.ts +1 -0
  142. package/esm/locales/zhHK.js +1 -0
  143. package/esm/locales/zhTW.d.ts +1 -0
  144. package/esm/locales/zhTW.js +1 -0
  145. package/index.js +1 -1
  146. package/internals/components/PickerProvider.d.ts +9 -0
  147. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -0
  148. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -3
  149. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -0
  150. package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  151. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -0
  152. package/internals/hooks/useMobilePicker/useMobilePicker.js +9 -3
  153. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -0
  154. package/internals/hooks/usePicker/usePicker.d.ts +2 -1
  155. package/internals/hooks/usePicker/usePicker.js +14 -4
  156. package/internals/hooks/usePicker/usePicker.types.d.ts +2 -0
  157. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -0
  158. package/internals/hooks/useStaticPicker/useStaticPicker.js +9 -3
  159. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +7 -0
  160. package/internals/index.d.ts +3 -2
  161. package/internals/index.js +19 -0
  162. package/internals/utils/createNonRangePickerStepNavigation.d.ts +13 -0
  163. package/internals/utils/createNonRangePickerStepNavigation.js +30 -0
  164. package/internals/utils/createStepNavigation.d.ts +32 -0
  165. package/internals/utils/createStepNavigation.js +41 -0
  166. package/internals/utils/date-utils.d.ts +1 -0
  167. package/internals/utils/date-utils.js +3 -3
  168. package/internals/utils/time-utils.d.ts +2 -0
  169. package/internals/utils/time-utils.js +5 -4
  170. package/locales/beBY.d.ts +1 -0
  171. package/locales/beBY.js +1 -0
  172. package/locales/bgBG.d.ts +1 -0
  173. package/locales/bgBG.js +1 -0
  174. package/locales/bnBD.d.ts +1 -0
  175. package/locales/bnBD.js +1 -0
  176. package/locales/caES.d.ts +1 -0
  177. package/locales/caES.js +1 -0
  178. package/locales/csCZ.d.ts +1 -0
  179. package/locales/csCZ.js +1 -0
  180. package/locales/daDK.d.ts +1 -0
  181. package/locales/daDK.js +1 -0
  182. package/locales/deDE.d.ts +1 -0
  183. package/locales/deDE.js +1 -0
  184. package/locales/elGR.d.ts +1 -0
  185. package/locales/elGR.js +1 -0
  186. package/locales/enUS.d.ts +1 -0
  187. package/locales/enUS.js +1 -0
  188. package/locales/esES.d.ts +1 -0
  189. package/locales/esES.js +1 -0
  190. package/locales/eu.d.ts +1 -0
  191. package/locales/eu.js +1 -0
  192. package/locales/faIR.d.ts +1 -0
  193. package/locales/faIR.js +1 -0
  194. package/locales/fiFI.d.ts +1 -0
  195. package/locales/fiFI.js +1 -0
  196. package/locales/frFR.d.ts +1 -0
  197. package/locales/frFR.js +1 -0
  198. package/locales/heIL.d.ts +1 -0
  199. package/locales/heIL.js +1 -0
  200. package/locales/hrHR.d.ts +1 -0
  201. package/locales/hrHR.js +1 -0
  202. package/locales/huHU.d.ts +1 -0
  203. package/locales/huHU.js +1 -0
  204. package/locales/isIS.d.ts +1 -0
  205. package/locales/isIS.js +1 -0
  206. package/locales/itIT.d.ts +1 -0
  207. package/locales/itIT.js +1 -0
  208. package/locales/jaJP.d.ts +1 -0
  209. package/locales/jaJP.js +1 -0
  210. package/locales/koKR.d.ts +1 -0
  211. package/locales/koKR.js +1 -0
  212. package/locales/kzKZ.d.ts +1 -0
  213. package/locales/kzKZ.js +1 -0
  214. package/locales/mk.d.ts +1 -0
  215. package/locales/mk.js +1 -0
  216. package/locales/nbNO.d.ts +1 -0
  217. package/locales/nbNO.js +1 -0
  218. package/locales/nlNL.d.ts +1 -0
  219. package/locales/nlNL.js +1 -0
  220. package/locales/nnNO.d.ts +1 -0
  221. package/locales/nnNO.js +1 -0
  222. package/locales/plPL.d.ts +1 -0
  223. package/locales/plPL.js +1 -0
  224. package/locales/ptBR.d.ts +1 -0
  225. package/locales/ptBR.js +1 -0
  226. package/locales/ptPT.d.ts +1 -0
  227. package/locales/ptPT.js +1 -0
  228. package/locales/roRO.d.ts +1 -0
  229. package/locales/roRO.js +1 -0
  230. package/locales/ruRU.d.ts +1 -0
  231. package/locales/ruRU.js +1 -0
  232. package/locales/skSK.d.ts +1 -0
  233. package/locales/skSK.js +1 -0
  234. package/locales/svSE.d.ts +1 -0
  235. package/locales/svSE.js +1 -0
  236. package/locales/trTR.d.ts +1 -0
  237. package/locales/trTR.js +1 -0
  238. package/locales/ukUA.d.ts +1 -0
  239. package/locales/ukUA.js +1 -0
  240. package/locales/urPK.d.ts +1 -0
  241. package/locales/urPK.js +1 -0
  242. package/locales/utils/getPickersLocalization.d.ts +1 -0
  243. package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  244. package/locales/viVN.d.ts +1 -0
  245. package/locales/viVN.js +1 -0
  246. package/locales/zhCN.d.ts +1 -0
  247. package/locales/zhCN.js +1 -0
  248. package/locales/zhHK.d.ts +1 -0
  249. package/locales/zhHK.js +1 -0
  250. package/locales/zhTW.d.ts +1 -0
  251. package/locales/zhTW.js +1 -0
  252. package/modern/DateField/DateField.js +4 -4
  253. package/modern/DateTimeField/DateTimeField.js +4 -4
  254. package/modern/DesktopDatePicker/DesktopDatePicker.js +2 -1
  255. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
  256. package/modern/DesktopTimePicker/DesktopTimePicker.js +2 -1
  257. package/modern/DigitalClock/DigitalClock.js +1 -0
  258. package/modern/LocalizationProvider/LocalizationProvider.d.ts +1 -1
  259. package/modern/LocalizationProvider/LocalizationProvider.js +2 -2
  260. package/modern/MobileDatePicker/MobileDatePicker.js +2 -1
  261. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +9 -1
  262. package/modern/MobileTimePicker/MobileTimePicker.js +2 -1
  263. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -0
  264. package/modern/PickersActionBar/PickersActionBar.d.ts +1 -1
  265. package/modern/PickersActionBar/PickersActionBar.js +22 -4
  266. package/modern/StaticDatePicker/StaticDatePicker.js +2 -1
  267. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +9 -1
  268. package/modern/StaticTimePicker/StaticTimePicker.js +2 -1
  269. package/modern/TimeField/TimeField.js +4 -4
  270. package/modern/index.js +1 -1
  271. package/modern/internals/components/PickerProvider.d.ts +9 -0
  272. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -0
  273. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -3
  274. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -0
  275. package/modern/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  276. package/modern/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -0
  277. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +9 -3
  278. package/modern/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -0
  279. package/modern/internals/hooks/usePicker/usePicker.d.ts +2 -1
  280. package/modern/internals/hooks/usePicker/usePicker.js +14 -4
  281. package/modern/internals/hooks/usePicker/usePicker.types.d.ts +2 -0
  282. package/modern/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -0
  283. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +9 -3
  284. package/modern/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +7 -0
  285. package/modern/internals/index.d.ts +3 -2
  286. package/modern/internals/index.js +3 -2
  287. package/modern/internals/utils/createNonRangePickerStepNavigation.d.ts +13 -0
  288. package/modern/internals/utils/createNonRangePickerStepNavigation.js +24 -0
  289. package/modern/internals/utils/createStepNavigation.d.ts +32 -0
  290. package/modern/internals/utils/createStepNavigation.js +34 -0
  291. package/modern/internals/utils/date-utils.d.ts +1 -0
  292. package/modern/internals/utils/date-utils.js +2 -2
  293. package/modern/internals/utils/time-utils.d.ts +2 -0
  294. package/modern/internals/utils/time-utils.js +4 -3
  295. package/modern/locales/beBY.d.ts +1 -0
  296. package/modern/locales/beBY.js +1 -0
  297. package/modern/locales/bgBG.d.ts +1 -0
  298. package/modern/locales/bgBG.js +1 -0
  299. package/modern/locales/bnBD.d.ts +1 -0
  300. package/modern/locales/bnBD.js +1 -0
  301. package/modern/locales/caES.d.ts +1 -0
  302. package/modern/locales/caES.js +1 -0
  303. package/modern/locales/csCZ.d.ts +1 -0
  304. package/modern/locales/csCZ.js +1 -0
  305. package/modern/locales/daDK.d.ts +1 -0
  306. package/modern/locales/daDK.js +1 -0
  307. package/modern/locales/deDE.d.ts +1 -0
  308. package/modern/locales/deDE.js +1 -0
  309. package/modern/locales/elGR.d.ts +1 -0
  310. package/modern/locales/elGR.js +1 -0
  311. package/modern/locales/enUS.d.ts +1 -0
  312. package/modern/locales/enUS.js +1 -0
  313. package/modern/locales/esES.d.ts +1 -0
  314. package/modern/locales/esES.js +1 -0
  315. package/modern/locales/eu.d.ts +1 -0
  316. package/modern/locales/eu.js +1 -0
  317. package/modern/locales/faIR.d.ts +1 -0
  318. package/modern/locales/faIR.js +1 -0
  319. package/modern/locales/fiFI.d.ts +1 -0
  320. package/modern/locales/fiFI.js +1 -0
  321. package/modern/locales/frFR.d.ts +1 -0
  322. package/modern/locales/frFR.js +1 -0
  323. package/modern/locales/heIL.d.ts +1 -0
  324. package/modern/locales/heIL.js +1 -0
  325. package/modern/locales/hrHR.d.ts +1 -0
  326. package/modern/locales/hrHR.js +1 -0
  327. package/modern/locales/huHU.d.ts +1 -0
  328. package/modern/locales/huHU.js +1 -0
  329. package/modern/locales/isIS.d.ts +1 -0
  330. package/modern/locales/isIS.js +1 -0
  331. package/modern/locales/itIT.d.ts +1 -0
  332. package/modern/locales/itIT.js +1 -0
  333. package/modern/locales/jaJP.d.ts +1 -0
  334. package/modern/locales/jaJP.js +1 -0
  335. package/modern/locales/koKR.d.ts +1 -0
  336. package/modern/locales/koKR.js +1 -0
  337. package/modern/locales/kzKZ.d.ts +1 -0
  338. package/modern/locales/kzKZ.js +1 -0
  339. package/modern/locales/mk.d.ts +1 -0
  340. package/modern/locales/mk.js +1 -0
  341. package/modern/locales/nbNO.d.ts +1 -0
  342. package/modern/locales/nbNO.js +1 -0
  343. package/modern/locales/nlNL.d.ts +1 -0
  344. package/modern/locales/nlNL.js +1 -0
  345. package/modern/locales/nnNO.d.ts +1 -0
  346. package/modern/locales/nnNO.js +1 -0
  347. package/modern/locales/plPL.d.ts +1 -0
  348. package/modern/locales/plPL.js +1 -0
  349. package/modern/locales/ptBR.d.ts +1 -0
  350. package/modern/locales/ptBR.js +1 -0
  351. package/modern/locales/ptPT.d.ts +1 -0
  352. package/modern/locales/ptPT.js +1 -0
  353. package/modern/locales/roRO.d.ts +1 -0
  354. package/modern/locales/roRO.js +1 -0
  355. package/modern/locales/ruRU.d.ts +1 -0
  356. package/modern/locales/ruRU.js +1 -0
  357. package/modern/locales/skSK.d.ts +1 -0
  358. package/modern/locales/skSK.js +1 -0
  359. package/modern/locales/svSE.d.ts +1 -0
  360. package/modern/locales/svSE.js +1 -0
  361. package/modern/locales/trTR.d.ts +1 -0
  362. package/modern/locales/trTR.js +1 -0
  363. package/modern/locales/ukUA.d.ts +1 -0
  364. package/modern/locales/ukUA.js +1 -0
  365. package/modern/locales/urPK.d.ts +1 -0
  366. package/modern/locales/urPK.js +1 -0
  367. package/modern/locales/utils/getPickersLocalization.d.ts +1 -0
  368. package/modern/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  369. package/modern/locales/viVN.d.ts +1 -0
  370. package/modern/locales/viVN.js +1 -0
  371. package/modern/locales/zhCN.d.ts +1 -0
  372. package/modern/locales/zhCN.js +1 -0
  373. package/modern/locales/zhHK.d.ts +1 -0
  374. package/modern/locales/zhHK.js +1 -0
  375. package/modern/locales/zhTW.d.ts +1 -0
  376. package/modern/locales/zhTW.js +1 -0
  377. package/package.json +6 -6
  378. package/tsconfig.build.tsbuildinfo +1 -1
@@ -18,6 +18,13 @@ import { DIALOG_WIDTH, VIEW_HEIGHT } from "../internals/constants/dimensions.js"
18
18
  import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from "../MultiSectionDigitalClock/index.js";
19
19
  import { mergeSx } from "../internals/utils/utils.js";
20
20
  import { digitalClockClasses } from "../DigitalClock/index.js";
21
+ import { EXPORTED_TIME_VIEWS } from "../internals/utils/time-utils.js";
22
+ import { DATE_VIEWS } from "../internals/utils/date-utils.js";
23
+ const STEPS = [{
24
+ views: DATE_VIEWS
25
+ }, {
26
+ views: EXPORTED_TIME_VIEWS
27
+ }];
21
28
  /**
22
29
  * Demos:
23
30
  *
@@ -98,7 +105,8 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
98
105
  props,
99
106
  valueManager: singleItemValueManager,
100
107
  valueType: 'date-time',
101
- validator: validateDateTime
108
+ validator: validateDateTime,
109
+ steps: STEPS
102
110
  });
103
111
  return renderPicker();
104
112
  });
@@ -58,7 +58,8 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
58
58
  props,
59
59
  valueManager: singleItemValueManager,
60
60
  valueType: 'time',
61
- validator: validateTime
61
+ validator: validateTime,
62
+ steps: null
62
63
  });
63
64
  return renderPicker();
64
65
  });
@@ -33,6 +33,7 @@ const MultiSectionDigitalClockSectionRoot = styled(MenuList, {
33
33
  width: 56,
34
34
  padding: 0,
35
35
  overflow: 'hidden',
36
+ scrollbarWidth: 'thin',
36
37
  '@media (prefers-reduced-motion: no-preference)': {
37
38
  scrollBehavior: 'auto'
38
39
  },
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DialogActionsProps } from '@mui/material/DialogActions';
3
- export type PickersActionBarAction = 'clear' | 'cancel' | 'accept' | 'today';
3
+ export type PickersActionBarAction = 'clear' | 'cancel' | 'accept' | 'today' | 'next' | 'nextOrAccept';
4
4
  export interface PickersActionBarProps extends DialogActionsProps {
5
5
  /**
6
6
  * Ordered array of actions to display.
@@ -9,7 +9,7 @@ import { styled } from '@mui/material/styles';
9
9
  import Button from '@mui/material/Button';
10
10
  import DialogActions from '@mui/material/DialogActions';
11
11
  import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
12
- import { usePickerActionsContext } from "../hooks/index.js";
12
+ import { usePickerContext } from "../hooks/index.js";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const PickersActionBarRoot = styled(DialogActions, {
15
15
  name: 'MuiPickersLayout',
@@ -37,8 +37,10 @@ function PickersActionBarComponent(props) {
37
37
  clearValue,
38
38
  setValueToToday,
39
39
  acceptValueChanges,
40
- cancelValueChanges
41
- } = usePickerActionsContext();
40
+ cancelValueChanges,
41
+ goToNextStep,
42
+ hasNextStep
43
+ } = usePickerContext();
42
44
  if (actions == null || actions.length === 0) {
43
45
  return null;
44
46
  }
@@ -64,6 +66,22 @@ function PickersActionBarComponent(props) {
64
66
  onClick: setValueToToday,
65
67
  children: translations.todayButtonLabel
66
68
  }, actionType);
69
+ case 'next':
70
+ return /*#__PURE__*/_jsx(Button, {
71
+ onClick: goToNextStep,
72
+ children: translations.nextStepButtonLabel
73
+ }, actionType);
74
+ case 'nextOrAccept':
75
+ if (hasNextStep) {
76
+ return /*#__PURE__*/_jsx(Button, {
77
+ onClick: goToNextStep,
78
+ children: translations.nextStepButtonLabel
79
+ }, actionType);
80
+ }
81
+ return /*#__PURE__*/_jsx(Button, {
82
+ onClick: acceptValueChanges,
83
+ children: translations.okButtonLabel
84
+ }, actionType);
67
85
  default:
68
86
  return null;
69
87
  }
@@ -84,7 +102,7 @@ process.env.NODE_ENV !== "production" ? PickersActionBarComponent.propTypes = {
84
102
  * - `[]` for Desktop Date Picker and Desktop Date Range Picker
85
103
  * - `['cancel', 'accept']` for all other Pickers
86
104
  */
87
- actions: PropTypes.arrayOf(PropTypes.oneOf(['accept', 'cancel', 'clear', 'today']).isRequired),
105
+ actions: PropTypes.arrayOf(PropTypes.oneOf(['accept', 'cancel', 'clear', 'next', 'nextOrAccept', 'today']).isRequired),
88
106
  /**
89
107
  * If `true`, the actions do not have additional margin.
90
108
  * @default false
@@ -45,7 +45,8 @@ const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker
45
45
  props,
46
46
  valueManager: singleItemValueManager,
47
47
  valueType: 'date',
48
- validator: validateDate
48
+ validator: validateDate,
49
+ steps: null
49
50
  });
50
51
  return renderPicker();
51
52
  });
@@ -13,6 +13,13 @@ import { mergeSx } from "../internals/utils/utils.js";
13
13
  import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from "../MultiSectionDigitalClock/index.js";
14
14
  import { DIALOG_WIDTH, VIEW_HEIGHT } from "../internals/constants/dimensions.js";
15
15
  import { digitalClockClasses } from "../DigitalClock/index.js";
16
+ import { DATE_VIEWS } from "../internals/utils/date-utils.js";
17
+ import { EXPORTED_TIME_VIEWS } from "../internals/utils/time-utils.js";
18
+ const STEPS = [{
19
+ views: DATE_VIEWS
20
+ }, {
21
+ views: EXPORTED_TIME_VIEWS
22
+ }];
16
23
  /**
17
24
  * Demos:
18
25
  *
@@ -87,7 +94,8 @@ const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTi
87
94
  props,
88
95
  valueManager: singleItemValueManager,
89
96
  valueType: 'date-time',
90
- validator: validateDateTime
97
+ validator: validateDateTime,
98
+ steps: STEPS
91
99
  });
92
100
  return renderPicker();
93
101
  });
@@ -47,7 +47,8 @@ const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker
47
47
  props,
48
48
  valueManager: singleItemValueManager,
49
49
  valueType: 'time',
50
- validator: validateTime
50
+ validator: validateTime,
51
+ steps: null
51
52
  });
52
53
  return renderPicker();
53
54
  });
@@ -123,7 +123,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
123
123
  formatDensity: PropTypes.oneOf(['dense', 'spacious']),
124
124
  /**
125
125
  * Props applied to the [`FormHelperText`](https://mui.com/material-ui/api/form-helper-text/) element.
126
- * @deprecated Use `slotProps.formHelperText` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
126
+ * @deprecated Use `slotProps.formHelperText` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
127
127
  */
128
128
  FormHelperTextProps: PropTypes.object,
129
129
  /**
@@ -150,12 +150,12 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
150
150
  /**
151
151
  * Props applied to the [`InputLabel`](https://mui.com/material-ui/api/input-label/) element.
152
152
  * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
153
- * @deprecated Use `slotProps.inputLabel` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
153
+ * @deprecated Use `slotProps.inputLabel` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
154
154
  */
155
155
  InputLabelProps: PropTypes.object,
156
156
  /**
157
157
  * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
158
- * @deprecated Use `slotProps.htmlInput` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
158
+ * @deprecated Use `slotProps.htmlInput` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
159
159
  */
160
160
  inputProps: PropTypes.object,
161
161
  /**
@@ -163,7 +163,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
163
163
  * It will be a [`FilledInput`](https://mui.com/material-ui/api/filled-input/),
164
164
  * [`OutlinedInput`](https://mui.com/material-ui/api/outlined-input/) or [`Input`](https://mui.com/material-ui/api/input/)
165
165
  * component depending on the `variant` prop value.
166
- * @deprecated Use `slotProps.input` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
166
+ * @deprecated Use `slotProps.input` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
167
167
  */
168
168
  InputProps: PropTypes.object,
169
169
  /**
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v8.0.0-beta.2
2
+ * @mui/x-date-pickers v8.0.0-beta.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -109,6 +109,10 @@ export interface PickerContextValue<TValue extends PickerValidValue, TView exten
109
109
  * If it is "enabled", the field should render an interactive UI to open the Picker.
110
110
  */
111
111
  triggerStatus: 'hidden' | 'disabled' | 'enabled';
112
+ /**
113
+ * Whether the Picker has any value picking steps left.
114
+ */
115
+ hasNextStep: boolean;
112
116
  /**
113
117
  * The ref to attach to the popup's outermost element that contains the view, if any.
114
118
  * When using a built-in popup component, this property is automatically attached to the appropriate element.
@@ -203,6 +207,11 @@ export interface PickerActionsContextValue<TValue extends PickerValidValue, TVie
203
207
  * The value will be reset to the last accepted value.
204
208
  */
205
209
  cancelValueChanges: () => void;
210
+ /**
211
+ * Go to the next step in the value picking process.
212
+ * For example, on the Mobile Date Time Picker, if the user is editing the date, it will switch to editing the time.
213
+ */
214
+ goToNextStep: () => void;
206
215
  }
207
216
  export interface SetValueActionOptions<TError = string | null> {
208
217
  /**
@@ -9,6 +9,7 @@ import { DateOrTimeViewWithMeridiem } from "../../models/index.js";
9
9
  */
10
10
  export declare const useDesktopPicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopPickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
11
11
  props,
12
+ steps,
12
13
  ...pickerParams
13
14
  }: UseDesktopPickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
14
15
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"],
3
+ const _excluded = ["props", "steps"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
6
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -9,6 +9,7 @@ import { usePicker } from "../usePicker/index.js";
9
9
  import { PickersLayout } from "../../../PickersLayout/index.js";
10
10
  import { PickerProvider } from "../../components/PickerProvider.js";
11
11
  import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js";
12
+ import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.js";
12
13
 
13
14
  /**
14
15
  * Hook managing all the single-date desktop pickers:
@@ -19,7 +20,8 @@ import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js"
19
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
21
  export const useDesktopPicker = _ref => {
21
22
  let {
22
- props
23
+ props,
24
+ steps
23
25
  } = _ref,
24
26
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
25
27
  const {
@@ -29,6 +31,9 @@ export const useDesktopPicker = _ref => {
29
31
  inputRef,
30
32
  localeText
31
33
  } = props;
34
+ const getStepNavigation = createNonRangePickerStepNavigation({
35
+ steps
36
+ });
32
37
  const {
33
38
  providerProps,
34
39
  renderCurrentView,
@@ -38,7 +43,8 @@ export const useDesktopPicker = _ref => {
38
43
  localeText,
39
44
  autoFocusView: true,
40
45
  viewContainerRole: 'dialog',
41
- variant: 'desktop'
46
+ variant: 'desktop',
47
+ getStepNavigation
42
48
  }));
43
49
  const labelId = providerProps.privateContextValue.labelId;
44
50
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
@@ -7,6 +7,7 @@ import { PickerFieldSlotProps, PickerOwnerState } from "../../../models/index.js
7
7
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps, PickersLayoutSlotProps } from "../../../PickersLayout/PickersLayout.types.js";
8
8
  import { DateOrTimeViewWithMeridiem, PickerValue } from "../../models/index.js";
9
9
  import { PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from "../../components/PickerFieldUI.js";
10
+ import { PickerStep } from "../../utils/createNonRangePickerStepNavigation.js";
10
11
  export interface UseDesktopPickerSlots extends Pick<PickerPopperSlots, 'desktopPaper' | 'desktopTransition' | 'desktopTrapFocus' | 'popper'>, ExportedPickersLayoutSlots<PickerValue>, PickerFieldUISlotsFromContext {
11
12
  /**
12
13
  * Component used to enter the date with the keyboard.
@@ -38,4 +39,10 @@ export interface UseDesktopPickerProps<TView extends DateOrTimeViewWithMeridiem,
38
39
  }
39
40
  export interface UseDesktopPickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopPickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'rendererInterceptor' | 'ref'> {
40
41
  props: TExternalProps;
42
+ /**
43
+ * Steps available for the picker.
44
+ * This will be used to define the behavior of navigation actions.
45
+ * If null, the picker will not have any step navigation.
46
+ */
47
+ steps: PickerStep[] | null;
41
48
  }
@@ -121,7 +121,7 @@ const createSection = ({
121
121
  maxLength = sectionValue === '' ? utils.formatByString(now, token).length : sectionValue.length;
122
122
  } else {
123
123
  if (sectionConfig.maxLength == null) {
124
- throw new Error(`MUI X: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);
124
+ throw new Error(`MUI X: The token ${token} should have a 'maxLength' property on it's adapter`);
125
125
  }
126
126
  maxLength = sectionConfig.maxLength;
127
127
  if (isValidDate) {
@@ -9,6 +9,7 @@ import { DateOrTimeViewWithMeridiem } from "../../models/index.js";
9
9
  */
10
10
  export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
11
11
  props,
12
+ steps,
12
13
  ...pickerParams
13
14
  }: UseMobilePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
14
15
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"],
3
+ const _excluded = ["props", "steps"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
6
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -9,6 +9,7 @@ import { usePicker } from "../usePicker/index.js";
9
9
  import { PickersLayout } from "../../../PickersLayout/index.js";
10
10
  import { PickerProvider } from "../../components/PickerProvider.js";
11
11
  import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js";
12
+ import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.js";
12
13
 
13
14
  /**
14
15
  * Hook managing all the single-date mobile pickers:
@@ -19,7 +20,8 @@ import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js"
19
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
21
  export const useMobilePicker = _ref => {
21
22
  let {
22
- props
23
+ props,
24
+ steps
23
25
  } = _ref,
24
26
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
25
27
  const {
@@ -29,6 +31,9 @@ export const useMobilePicker = _ref => {
29
31
  inputRef,
30
32
  localeText
31
33
  } = props;
34
+ const getStepNavigation = createNonRangePickerStepNavigation({
35
+ steps
36
+ });
32
37
  const {
33
38
  providerProps,
34
39
  renderCurrentView,
@@ -38,7 +43,8 @@ export const useMobilePicker = _ref => {
38
43
  localeText,
39
44
  autoFocusView: true,
40
45
  viewContainerRole: 'dialog',
41
- variant: 'mobile'
46
+ variant: 'mobile',
47
+ getStepNavigation
42
48
  }));
43
49
  const labelId = providerProps.privateContextValue.labelId;
44
50
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
@@ -7,6 +7,7 @@ import { PickerFieldSlotProps, PickerOwnerState } from "../../../models/index.js
7
7
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps, PickersLayoutSlotProps } from "../../../PickersLayout/PickersLayout.types.js";
8
8
  import { DateOrTimeViewWithMeridiem, PickerValue } from "../../models/index.js";
9
9
  import { PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from "../../components/PickerFieldUI.js";
10
+ import { PickerStep } from "../../utils/createNonRangePickerStepNavigation.js";
10
11
  export interface UseMobilePickerSlots extends PickersModalDialogSlots, ExportedPickersLayoutSlots<PickerValue>, PickerFieldUISlotsFromContext {
11
12
  /**
12
13
  * Component used to enter the date with the keyboard.
@@ -32,4 +33,10 @@ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem,
32
33
  }
33
34
  export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
34
35
  props: TExternalProps;
36
+ /**
37
+ * Steps available for the picker.
38
+ * This will be used to define the behavior of navigation actions.
39
+ * If null, the picker will not have any step navigation.
40
+ */
41
+ steps: PickerStep[] | null;
35
42
  }
@@ -10,5 +10,6 @@ export declare const usePicker: <TValue extends PickerValidValue, TView extends
10
10
  autoFocusView,
11
11
  rendererInterceptor: RendererInterceptor,
12
12
  localeText,
13
- viewContainerRole
13
+ viewContainerRole,
14
+ getStepNavigation
14
15
  }: UsePickerParameters<TValue, TView, TExternalProps>) => UsePickerReturnValue<TValue>;
@@ -23,7 +23,8 @@ export const usePicker = ({
23
23
  autoFocusView,
24
24
  rendererInterceptor: RendererInterceptor,
25
25
  localeText,
26
- viewContainerRole
26
+ viewContainerRole,
27
+ getStepNavigation
27
28
  }) => {
28
29
  const {
29
30
  // View props
@@ -190,6 +191,13 @@ export const usePicker = ({
190
191
  }
191
192
  return 'enabled';
192
193
  }, [disableOpenPicker, hasUIView, disabled, readOnly]);
194
+ const stepNavigation = getStepNavigation({
195
+ setView,
196
+ view,
197
+ initialView: initialView ?? views[0],
198
+ views
199
+ });
200
+ const wrappedGoToNextStep = useEventCallback(stepNavigation.goToNextStep);
193
201
  const actionsContextValue = React.useMemo(() => ({
194
202
  setValue,
195
203
  setOpen,
@@ -197,8 +205,9 @@ export const usePicker = ({
197
205
  setValueToToday,
198
206
  acceptValueChanges,
199
207
  cancelValueChanges,
200
- setView
201
- }), [setValue, setOpen, clearValue, setValueToToday, acceptValueChanges, cancelValueChanges, setView]);
208
+ setView,
209
+ goToNextStep: wrappedGoToNextStep
210
+ }), [setValue, setOpen, clearValue, setValueToToday, acceptValueChanges, cancelValueChanges, setView, wrappedGoToNextStep]);
202
211
  const contextValue = React.useMemo(() => _extends({}, actionsContextValue, {
203
212
  value,
204
213
  timezone,
@@ -215,13 +224,14 @@ export const usePicker = ({
215
224
  reduceAnimations,
216
225
  triggerRef,
217
226
  triggerStatus,
227
+ hasNextStep: stepNavigation.hasNextStep,
218
228
  fieldFormat: format ?? '',
219
229
  name,
220
230
  label,
221
231
  rootSx: sx,
222
232
  rootRef,
223
233
  rootClassName: className
224
- }), [actionsContextValue, value, rootRef, variant, orientation, reduceAnimations, disabled, readOnly, format, className, name, label, sx, triggerStatus, timezone, state.open, popperView, views, initialView, autoFocus]);
234
+ }), [actionsContextValue, value, rootRef, variant, orientation, reduceAnimations, disabled, readOnly, format, className, name, label, sx, triggerStatus, stepNavigation.hasNextStep, timezone, state.open, popperView, views, initialView, autoFocus]);
225
235
  const privateContextValue = React.useMemo(() => ({
226
236
  dismissViews,
227
237
  ownerState,
@@ -7,6 +7,7 @@ import { UseViewsOptions } from "../useViews.js";
7
7
  import { PickerProviderProps } from "../../components/PickerProvider.js";
8
8
  import { PickersInputLocaleText } from "../../../locales/index.js";
9
9
  import { PickerFieldPrivateContextValue } from "../useNullableFieldPrivateContext.js";
10
+ import { CreateStepNavigationReturnValue } from "../../utils/createStepNavigation.js";
10
11
  /**
11
12
  * Props common to all Picker headless implementations.
12
13
  * Those props are exposed on all the Pickers.
@@ -130,6 +131,7 @@ export interface UsePickerParameters<TValue extends PickerValidValue, TView exte
130
131
  */
131
132
  rendererInterceptor?: React.JSXElementConstructor<PickerRendererInterceptorProps<TValue, TView, TExternalProps>>;
132
133
  props: TExternalProps;
134
+ getStepNavigation: CreateStepNavigationReturnValue;
133
135
  }
134
136
  export interface UsePickerReturnValue<TValue extends PickerValidValue> {
135
137
  ownerState: PickerOwnerState;
@@ -9,6 +9,7 @@ import { DateOrTimeViewWithMeridiem } from "../../models/index.js";
9
9
  */
10
10
  export declare const useStaticPicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TView, any, TExternalProps>>({
11
11
  props,
12
+ steps,
12
13
  ...pickerParams
13
14
  }: UseStaticPickerParams<TView, TExternalProps>) => {
14
15
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"];
3
+ const _excluded = ["props", "steps"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { styled } from '@mui/material/styles';
@@ -9,6 +9,7 @@ import { PickerProvider } from "../../components/PickerProvider.js";
9
9
  import { PickersLayout } from "../../../PickersLayout/index.js";
10
10
  import { DIALOG_WIDTH } from "../../constants/dimensions.js";
11
11
  import { mergeSx } from "../../utils/utils.js";
12
+ import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.js";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const PickerStaticLayout = styled(PickersLayout)(({
14
15
  theme
@@ -26,7 +27,8 @@ const PickerStaticLayout = styled(PickersLayout)(({
26
27
  */
27
28
  export const useStaticPicker = _ref => {
28
29
  let {
29
- props
30
+ props,
31
+ steps
30
32
  } = _ref,
31
33
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
32
34
  const {
@@ -36,6 +38,9 @@ export const useStaticPicker = _ref => {
36
38
  displayStaticWrapperAs,
37
39
  autoFocus
38
40
  } = props;
41
+ const getStepNavigation = createNonRangePickerStepNavigation({
42
+ steps
43
+ });
39
44
  const {
40
45
  providerProps,
41
46
  renderCurrentView
@@ -44,7 +49,8 @@ export const useStaticPicker = _ref => {
44
49
  variant: displayStaticWrapperAs,
45
50
  autoFocusView: autoFocus ?? false,
46
51
  viewContainerRole: null,
47
- localeText
52
+ localeText,
53
+ getStepNavigation
48
54
  }));
49
55
  const Layout = slots?.layout ?? PickerStaticLayout;
50
56
  const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
@@ -2,6 +2,7 @@ import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from "../.
2
2
  import { BasePickerProps } from "../../models/props/basePickerProps.js";
3
3
  import { UsePickerParameters, UsePickerProps } from "../usePicker/index.js";
4
4
  import { DateOrTimeViewWithMeridiem, PickerValue } from "../../models/index.js";
5
+ import { PickerStep } from "../../utils/createNonRangePickerStepNavigation.js";
5
6
  export interface UseStaticPickerSlots extends ExportedPickersLayoutSlots<PickerValue> {}
6
7
  export interface UseStaticPickerSlotProps extends ExportedPickersLayoutSlotProps<PickerValue> {}
7
8
  export interface StaticOnlyPickerProps {
@@ -36,4 +37,10 @@ export interface UseStaticPickerProps<TView extends DateOrTimeViewWithMeridiem,
36
37
  }
37
38
  export interface UseStaticPickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
38
39
  props: TExternalProps;
40
+ /**
41
+ * Steps available for the picker.
42
+ * This will be used to define the behavior of navigation actions.
43
+ * If null, the picker will not have any step navigation.
44
+ */
45
+ steps: PickerStep[] | null;
39
46
  }
@@ -53,9 +53,10 @@ export type { FormProps } from './models/formProps';
53
53
  export type { PickerVariant, TimeViewWithMeridiem, DateOrTimeViewWithMeridiem } from './models/common';
54
54
  export type { BaseDateValidationProps, BaseTimeValidationProps, TimeValidationProps, MonthValidationProps, YearValidationProps, DayValidationProps, DateTimeValidationProps } from './models/validation';
55
55
  export type { PickerValue, PickerRangeValue, PickerNonNullableRangeValue, InferNonNullablePickerValue, PickerValidValue } from './models/value';
56
- export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual, getTodayDate, isDatePickerView, mergeDateAndTime, formatMeridiem } from "./utils/date-utils.js";
56
+ export { createStepNavigation } from "./utils/createStepNavigation.js";
57
+ export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual, getTodayDate, isDatePickerView, mergeDateAndTime, formatMeridiem, DATE_VIEWS } from "./utils/date-utils.js";
57
58
  export { getDefaultReferenceDate } from "./utils/getDefaultReferenceDate.js";
58
- export { isTimeView, isInternalTimeView, resolveTimeFormat, getMeridiem } from "./utils/time-utils.js";
59
+ export { isTimeView, isInternalTimeView, resolveTimeFormat, getMeridiem, TIME_VIEWS } from "./utils/time-utils.js";
59
60
  export { resolveTimeViewsResponse, resolveDateTimeFormat } from "./utils/date-time-utils.js";
60
61
  export { executeInTheNextEventLoopTick, getActiveElement, onSpaceOrEnter, mergeSx, DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from "./utils/utils.js";
61
62
  export { useReduceAnimations } from "./hooks/useReduceAnimations.js";
@@ -23,9 +23,10 @@ export { useToolbarOwnerState } from "./hooks/useToolbarOwnerState.js";
23
23
  export { useLocalizationContext, useDefaultDates, useUtils, useNow } from "./hooks/useUtils.js";
24
24
  export { useViews } from "./hooks/useViews.js";
25
25
  export { usePreviousMonthDisabled, useNextMonthDisabled } from "./hooks/date-helpers-hooks.js";
26
- export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual, getTodayDate, isDatePickerView, mergeDateAndTime, formatMeridiem } from "./utils/date-utils.js";
26
+ export { createStepNavigation } from "./utils/createStepNavigation.js";
27
+ export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual, getTodayDate, isDatePickerView, mergeDateAndTime, formatMeridiem, DATE_VIEWS } from "./utils/date-utils.js";
27
28
  export { getDefaultReferenceDate } from "./utils/getDefaultReferenceDate.js";
28
- export { isTimeView, isInternalTimeView, resolveTimeFormat, getMeridiem } from "./utils/time-utils.js";
29
+ export { isTimeView, isInternalTimeView, resolveTimeFormat, getMeridiem, TIME_VIEWS } from "./utils/time-utils.js";
29
30
  export { resolveTimeViewsResponse, resolveDateTimeFormat } from "./utils/date-time-utils.js";
30
31
  export { executeInTheNextEventLoopTick, getActiveElement, onSpaceOrEnter, mergeSx, DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from "./utils/utils.js";
31
32
  export { useReduceAnimations } from "./hooks/useReduceAnimations.js";
@@ -0,0 +1,13 @@
1
+ import { DateOrTimeViewWithMeridiem } from "../models/common.js";
2
+ export declare function createNonRangePickerStepNavigation(parameters: CreateNonRangePickerStepNavigationParameters): import("./createStepNavigation").CreateStepNavigationReturnValue;
3
+ export interface PickerStep {
4
+ /**
5
+ * The views that are handled inside this step.
6
+ * If null, all views are handled by this step.
7
+ */
8
+ views: readonly DateOrTimeViewWithMeridiem[] | null;
9
+ }
10
+ interface CreateNonRangePickerStepNavigationParameters {
11
+ steps: PickerStep[] | null;
12
+ }
13
+ export {};
@@ -0,0 +1,24 @@
1
+ import { createStepNavigation } from "./createStepNavigation.js";
2
+ export function createNonRangePickerStepNavigation(parameters) {
3
+ const {
4
+ steps
5
+ } = parameters;
6
+ return createStepNavigation({
7
+ steps,
8
+ isCurrentViewMatchingStep: (view, step) => {
9
+ return step.views == null || step.views.includes(view);
10
+ },
11
+ onStepChange: ({
12
+ step,
13
+ initialView,
14
+ setView,
15
+ view,
16
+ views
17
+ }) => {
18
+ const targetView = step.views == null ? initialView : step.views.find(viewBis => views.includes(viewBis));
19
+ if (targetView !== view) {
20
+ setView(targetView);
21
+ }
22
+ }
23
+ });
24
+ }
@@ -0,0 +1,32 @@
1
+ import { DateOrTimeViewWithMeridiem } from "../models/index.js";
2
+ /**
3
+ * Create an object that determines whether there is a next step and allows to go to the next step.
4
+ * @param {CreateStepNavigationParameters<TStep>} parameters The parameters of the createStepNavigation function
5
+ * @returns {CreateStepNavigationReturnValue} The return value of the createStepNavigation function
6
+ */
7
+ export declare function createStepNavigation<TStep extends {}>(parameters: CreateStepNavigationParameters<TStep>): CreateStepNavigationReturnValue;
8
+ interface CreateStepNavigationParameters<TStep extends {}> {
9
+ steps: TStep[] | null;
10
+ isCurrentViewMatchingStep: (view: DateOrTimeViewWithMeridiem, step: TStep) => boolean;
11
+ onStepChange: (parameters: UseRangePickerStepNavigationOnStepChangeParameters<TStep>) => void;
12
+ }
13
+ export type CreateStepNavigationReturnValue = (parameters: CreateStepNavigationReturnValueParameters) => {
14
+ /**
15
+ * Whether there is a next step.
16
+ */
17
+ hasNextStep: boolean;
18
+ /**
19
+ * Go to the next step if any.
20
+ */
21
+ goToNextStep: () => void;
22
+ };
23
+ export interface CreateStepNavigationReturnValueParameters {
24
+ initialView: DateOrTimeViewWithMeridiem;
25
+ view: DateOrTimeViewWithMeridiem;
26
+ views: readonly DateOrTimeViewWithMeridiem[];
27
+ setView: (view: any) => void;
28
+ }
29
+ interface UseRangePickerStepNavigationOnStepChangeParameters<TStep extends {}> extends CreateStepNavigationReturnValueParameters {
30
+ step: TStep;
31
+ }
32
+ export {};