@mui/x-date-pickers 7.16.0 → 7.18.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 (390) hide show
  1. package/AdapterDateFns/AdapterDateFns.js +1 -1
  2. package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  3. package/AdapterDayjs/AdapterDayjs.js +1 -1
  4. package/CHANGELOG.md +184 -4
  5. package/DateCalendar/DateCalendar.js +11 -1
  6. package/DateCalendar/useCalendarState.js +2 -0
  7. package/DateCalendar/useIsDateDisabled.d.ts +4 -3
  8. package/DateCalendar/useIsDateDisabled.js +5 -3
  9. package/DateField/DateField.js +2 -0
  10. package/DateField/DateField.types.d.ts +7 -2
  11. package/DateField/index.d.ts +1 -1
  12. package/DateField/useDateField.d.ts +1 -1
  13. package/DateField/useDateField.js +5 -3
  14. package/DatePicker/DatePicker.js +8 -0
  15. package/DatePicker/DatePicker.types.d.ts +5 -5
  16. package/DatePicker/DatePickerToolbar.js +2 -0
  17. package/DateTimeField/DateTimeField.js +2 -0
  18. package/DateTimeField/DateTimeField.types.d.ts +7 -2
  19. package/DateTimeField/index.d.ts +1 -1
  20. package/DateTimeField/useDateTimeField.d.ts +1 -1
  21. package/DateTimeField/useDateTimeField.js +5 -3
  22. package/DateTimePicker/DateTimePicker.js +8 -0
  23. package/DateTimePicker/DateTimePicker.types.d.ts +7 -6
  24. package/DateTimePicker/DateTimePickerTabs.js +2 -0
  25. package/DateTimePicker/DateTimePickerToolbar.js +2 -0
  26. package/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
  27. package/DesktopDatePicker/DesktopDatePicker.js +16 -3
  28. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -6
  29. package/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
  30. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +11 -10
  31. package/DesktopTimePicker/DesktopTimePicker.js +10 -3
  32. package/DigitalClock/DigitalClock.js +2 -0
  33. package/LocalizationProvider/LocalizationProvider.js +2 -0
  34. package/MobileDatePicker/MobileDatePicker.js +16 -3
  35. package/MobileDatePicker/MobileDatePicker.types.d.ts +5 -0
  36. package/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
  37. package/MobileTimePicker/MobileTimePicker.js +10 -3
  38. package/MonthCalendar/MonthCalendar.js +2 -0
  39. package/MonthCalendar/MonthCalendar.types.d.ts +1 -1
  40. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  41. package/PickersActionBar/PickersActionBar.js +2 -0
  42. package/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
  43. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +1 -1
  44. package/PickersDay/PickersDay.js +2 -0
  45. package/PickersLayout/PickersLayout.js +2 -0
  46. package/PickersLayout/usePickerLayout.js +2 -0
  47. package/PickersSectionList/PickersSectionList.js +2 -0
  48. package/PickersShortcuts/PickersShortcuts.js +2 -0
  49. package/PickersTextField/PickersTextField.js +2 -0
  50. package/StaticDatePicker/StaticDatePicker.js +10 -2
  51. package/StaticDatePicker/StaticDatePicker.types.d.ts +5 -0
  52. package/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
  53. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +5 -0
  54. package/StaticTimePicker/StaticTimePicker.js +3 -1
  55. package/TimeClock/Clock.js +1 -1
  56. package/TimeClock/TimeClock.js +2 -0
  57. package/TimeField/TimeField.js +2 -0
  58. package/TimeField/TimeField.types.d.ts +7 -2
  59. package/TimeField/index.d.ts +1 -1
  60. package/TimeField/useTimeField.d.ts +1 -1
  61. package/TimeField/useTimeField.js +5 -3
  62. package/TimePicker/TimePicker.js +2 -0
  63. package/TimePicker/TimePickerToolbar.js +2 -0
  64. package/YearCalendar/YearCalendar.js +21 -6
  65. package/YearCalendar/YearCalendar.types.d.ts +7 -1
  66. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  67. package/dateViewRenderers/dateViewRenderers.js +2 -0
  68. package/hooks/index.d.ts +1 -0
  69. package/hooks/index.js +2 -1
  70. package/hooks/useClearableField.js +2 -0
  71. package/hooks/usePickersTranslations.js +2 -0
  72. package/hooks/useSplitFieldProps.d.ts +19 -0
  73. package/hooks/useSplitFieldProps.js +43 -0
  74. package/index.d.ts +1 -0
  75. package/index.js +3 -2
  76. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  77. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
  78. package/internals/hooks/useField/useField.js +11 -6
  79. package/internals/hooks/useField/useField.types.d.ts +4 -22
  80. package/internals/hooks/useField/useFieldState.js +2 -4
  81. package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  82. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -2
  83. package/internals/hooks/usePicker/usePicker.d.ts +1 -2
  84. package/internals/hooks/usePicker/usePicker.js +1 -1
  85. package/internals/hooks/usePicker/usePickerValue.d.ts +1 -2
  86. package/internals/hooks/usePicker/usePickerValue.js +12 -16
  87. package/internals/hooks/usePicker/usePickerValue.types.d.ts +4 -15
  88. package/internals/index.d.ts +0 -8
  89. package/internals/index.js +0 -7
  90. package/locales/beBY.d.ts +3 -3
  91. package/locales/beBY.js +4 -4
  92. package/locales/caES.d.ts +3 -3
  93. package/locales/caES.js +3 -3
  94. package/locales/csCZ.d.ts +3 -3
  95. package/locales/csCZ.js +4 -4
  96. package/locales/daDK.d.ts +3 -3
  97. package/locales/daDK.js +3 -3
  98. package/locales/deDE.d.ts +3 -3
  99. package/locales/deDE.js +3 -3
  100. package/locales/elGR.d.ts +3 -3
  101. package/locales/elGR.js +4 -4
  102. package/locales/enUS.d.ts +3 -3
  103. package/locales/enUS.js +4 -4
  104. package/locales/esES.d.ts +3 -3
  105. package/locales/esES.js +3 -3
  106. package/locales/eu.d.ts +3 -3
  107. package/locales/eu.js +3 -3
  108. package/locales/faIR.d.ts +3 -3
  109. package/locales/faIR.js +3 -3
  110. package/locales/fiFI.d.ts +3 -3
  111. package/locales/fiFI.js +3 -3
  112. package/locales/frFR.d.ts +3 -3
  113. package/locales/frFR.js +3 -3
  114. package/locales/heIL.d.ts +3 -3
  115. package/locales/heIL.js +3 -3
  116. package/locales/huHU.d.ts +3 -3
  117. package/locales/huHU.js +3 -3
  118. package/locales/isIS.d.ts +3 -3
  119. package/locales/isIS.js +4 -4
  120. package/locales/itIT.d.ts +3 -3
  121. package/locales/itIT.js +3 -3
  122. package/locales/jaJP.d.ts +3 -3
  123. package/locales/jaJP.js +3 -3
  124. package/locales/koKR.d.ts +3 -3
  125. package/locales/koKR.js +3 -3
  126. package/locales/kzKZ.d.ts +3 -3
  127. package/locales/kzKZ.js +4 -4
  128. package/locales/mk.d.ts +3 -3
  129. package/locales/mk.js +3 -3
  130. package/locales/nbNO.d.ts +3 -3
  131. package/locales/nbNO.js +4 -4
  132. package/locales/nlNL.d.ts +3 -3
  133. package/locales/nlNL.js +3 -3
  134. package/locales/nnNO.d.ts +3 -3
  135. package/locales/nnNO.js +3 -3
  136. package/locales/plPL.d.ts +3 -3
  137. package/locales/plPL.js +4 -4
  138. package/locales/ptBR.d.ts +3 -3
  139. package/locales/ptBR.js +4 -4
  140. package/locales/roRO.d.ts +3 -3
  141. package/locales/roRO.js +3 -3
  142. package/locales/ruRU.d.ts +3 -3
  143. package/locales/ruRU.js +3 -3
  144. package/locales/skSK.d.ts +3 -3
  145. package/locales/skSK.js +4 -4
  146. package/locales/svSE.d.ts +3 -3
  147. package/locales/svSE.js +3 -3
  148. package/locales/trTR.d.ts +3 -3
  149. package/locales/trTR.js +4 -4
  150. package/locales/ukUA.d.ts +3 -3
  151. package/locales/ukUA.js +3 -3
  152. package/locales/urPK.d.ts +3 -3
  153. package/locales/urPK.js +4 -4
  154. package/locales/utils/getPickersLocalization.d.ts +10 -3
  155. package/locales/utils/getPickersLocalization.js +13 -0
  156. package/locales/utils/pickersLocaleTextApi.d.ts +27 -3
  157. package/locales/viVN.d.ts +3 -3
  158. package/locales/viVN.js +3 -3
  159. package/locales/zhCN.d.ts +3 -3
  160. package/locales/zhCN.js +3 -3
  161. package/locales/zhHK.d.ts +3 -3
  162. package/locales/zhHK.js +3 -3
  163. package/models/validation.d.ts +13 -0
  164. package/modern/AdapterDateFns/AdapterDateFns.js +1 -1
  165. package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  166. package/modern/AdapterDayjs/AdapterDayjs.js +1 -1
  167. package/modern/DateCalendar/DateCalendar.js +11 -1
  168. package/modern/DateCalendar/useCalendarState.js +2 -0
  169. package/modern/DateCalendar/useIsDateDisabled.js +5 -3
  170. package/modern/DateField/DateField.js +2 -0
  171. package/modern/DateField/useDateField.js +5 -3
  172. package/modern/DatePicker/DatePicker.js +8 -0
  173. package/modern/DatePicker/DatePickerToolbar.js +2 -0
  174. package/modern/DateTimeField/DateTimeField.js +2 -0
  175. package/modern/DateTimeField/useDateTimeField.js +5 -3
  176. package/modern/DateTimePicker/DateTimePicker.js +8 -0
  177. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -0
  178. package/modern/DateTimePicker/DateTimePickerToolbar.js +2 -0
  179. package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
  180. package/modern/DesktopDatePicker/DesktopDatePicker.js +16 -3
  181. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
  182. package/modern/DesktopTimePicker/DesktopTimePicker.js +10 -3
  183. package/modern/DigitalClock/DigitalClock.js +2 -0
  184. package/modern/LocalizationProvider/LocalizationProvider.js +2 -0
  185. package/modern/MobileDatePicker/MobileDatePicker.js +16 -3
  186. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
  187. package/modern/MobileTimePicker/MobileTimePicker.js +10 -3
  188. package/modern/MonthCalendar/MonthCalendar.js +2 -0
  189. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  190. package/modern/PickersActionBar/PickersActionBar.js +2 -0
  191. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
  192. package/modern/PickersDay/PickersDay.js +2 -0
  193. package/modern/PickersLayout/PickersLayout.js +2 -0
  194. package/modern/PickersLayout/usePickerLayout.js +2 -0
  195. package/modern/PickersSectionList/PickersSectionList.js +2 -0
  196. package/modern/PickersShortcuts/PickersShortcuts.js +2 -0
  197. package/modern/PickersTextField/PickersTextField.js +2 -0
  198. package/modern/StaticDatePicker/StaticDatePicker.js +10 -2
  199. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
  200. package/modern/StaticTimePicker/StaticTimePicker.js +3 -1
  201. package/modern/TimeClock/Clock.js +1 -1
  202. package/modern/TimeClock/TimeClock.js +2 -0
  203. package/modern/TimeField/TimeField.js +2 -0
  204. package/modern/TimeField/useTimeField.js +5 -3
  205. package/modern/TimePicker/TimePicker.js +2 -0
  206. package/modern/TimePicker/TimePickerToolbar.js +2 -0
  207. package/modern/YearCalendar/YearCalendar.js +21 -6
  208. package/modern/dateViewRenderers/dateViewRenderers.js +2 -0
  209. package/modern/hooks/index.js +2 -1
  210. package/modern/hooks/useClearableField.js +2 -0
  211. package/modern/hooks/usePickersTranslations.js +2 -0
  212. package/modern/hooks/useSplitFieldProps.js +43 -0
  213. package/modern/index.js +3 -2
  214. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  215. package/modern/internals/hooks/useField/useField.js +11 -6
  216. package/modern/internals/hooks/useField/useFieldState.js +2 -4
  217. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  218. package/modern/internals/hooks/usePicker/usePicker.js +1 -1
  219. package/modern/internals/hooks/usePicker/usePickerValue.js +12 -16
  220. package/modern/internals/index.js +0 -7
  221. package/modern/locales/beBY.js +4 -4
  222. package/modern/locales/caES.js +3 -3
  223. package/modern/locales/csCZ.js +4 -4
  224. package/modern/locales/daDK.js +3 -3
  225. package/modern/locales/deDE.js +3 -3
  226. package/modern/locales/elGR.js +4 -4
  227. package/modern/locales/enUS.js +4 -4
  228. package/modern/locales/esES.js +3 -3
  229. package/modern/locales/eu.js +3 -3
  230. package/modern/locales/faIR.js +3 -3
  231. package/modern/locales/fiFI.js +3 -3
  232. package/modern/locales/frFR.js +3 -3
  233. package/modern/locales/heIL.js +3 -3
  234. package/modern/locales/huHU.js +3 -3
  235. package/modern/locales/isIS.js +4 -4
  236. package/modern/locales/itIT.js +3 -3
  237. package/modern/locales/jaJP.js +3 -3
  238. package/modern/locales/koKR.js +3 -3
  239. package/modern/locales/kzKZ.js +4 -4
  240. package/modern/locales/mk.js +3 -3
  241. package/modern/locales/nbNO.js +4 -4
  242. package/modern/locales/nlNL.js +3 -3
  243. package/modern/locales/nnNO.js +3 -3
  244. package/modern/locales/plPL.js +4 -4
  245. package/modern/locales/ptBR.js +4 -4
  246. package/modern/locales/roRO.js +3 -3
  247. package/modern/locales/ruRU.js +3 -3
  248. package/modern/locales/skSK.js +4 -4
  249. package/modern/locales/svSE.js +3 -3
  250. package/modern/locales/trTR.js +4 -4
  251. package/modern/locales/ukUA.js +3 -3
  252. package/modern/locales/urPK.js +4 -4
  253. package/modern/locales/utils/getPickersLocalization.js +13 -0
  254. package/modern/locales/viVN.js +3 -3
  255. package/modern/locales/zhCN.js +3 -3
  256. package/modern/locales/zhHK.js +3 -3
  257. package/modern/validation/index.js +5 -0
  258. package/modern/validation/useValidation.js +54 -0
  259. package/{internals/utils → modern}/validation/validateDate.js +6 -4
  260. package/modern/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  261. package/{internals/utils → modern}/validation/validateTime.js +6 -4
  262. package/node/AdapterDateFns/AdapterDateFns.js +1 -1
  263. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  264. package/node/AdapterDayjs/AdapterDayjs.js +1 -1
  265. package/node/DateCalendar/DateCalendar.js +10 -1
  266. package/node/DateCalendar/useCalendarState.js +1 -0
  267. package/node/DateCalendar/useIsDateDisabled.js +5 -4
  268. package/node/DateField/DateField.js +1 -0
  269. package/node/DateField/useDateField.js +5 -4
  270. package/node/DatePicker/DatePicker.js +7 -0
  271. package/node/DatePicker/DatePickerToolbar.js +1 -0
  272. package/node/DateTimeField/DateTimeField.js +1 -0
  273. package/node/DateTimeField/useDateTimeField.js +5 -4
  274. package/node/DateTimePicker/DateTimePicker.js +7 -0
  275. package/node/DateTimePicker/DateTimePickerTabs.js +1 -0
  276. package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
  277. package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -0
  278. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -5
  279. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -5
  280. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -5
  281. package/node/DigitalClock/DigitalClock.js +1 -0
  282. package/node/LocalizationProvider/LocalizationProvider.js +1 -0
  283. package/node/MobileDatePicker/MobileDatePicker.js +17 -5
  284. package/node/MobileDateTimePicker/MobileDateTimePicker.js +17 -5
  285. package/node/MobileTimePicker/MobileTimePicker.js +11 -5
  286. package/node/MonthCalendar/MonthCalendar.js +1 -0
  287. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  288. package/node/PickersActionBar/PickersActionBar.js +1 -0
  289. package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
  290. package/node/PickersDay/PickersDay.js +1 -0
  291. package/node/PickersLayout/PickersLayout.js +1 -0
  292. package/node/PickersLayout/usePickerLayout.js +1 -0
  293. package/node/PickersSectionList/PickersSectionList.js +1 -0
  294. package/node/PickersShortcuts/PickersShortcuts.js +1 -0
  295. package/node/PickersTextField/PickersTextField.js +1 -0
  296. package/node/StaticDatePicker/StaticDatePicker.js +10 -3
  297. package/node/StaticDateTimePicker/StaticDateTimePicker.js +10 -3
  298. package/node/StaticTimePicker/StaticTimePicker.js +3 -2
  299. package/node/TimeClock/Clock.js +1 -1
  300. package/node/TimeClock/TimeClock.js +1 -0
  301. package/node/TimeField/TimeField.js +1 -0
  302. package/node/TimeField/useTimeField.js +5 -4
  303. package/node/TimePicker/TimePicker.js +1 -0
  304. package/node/TimePicker/TimePickerToolbar.js +1 -0
  305. package/node/YearCalendar/YearCalendar.js +20 -6
  306. package/node/dateViewRenderers/dateViewRenderers.js +2 -0
  307. package/node/hooks/index.js +8 -1
  308. package/node/hooks/useClearableField.js +1 -0
  309. package/node/hooks/usePickersTranslations.js +1 -0
  310. package/node/hooks/useSplitFieldProps.js +51 -0
  311. package/node/index.js +13 -1
  312. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  313. package/node/internals/hooks/useField/useField.js +11 -6
  314. package/node/internals/hooks/useField/useFieldState.js +2 -4
  315. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  316. package/node/internals/hooks/usePicker/usePicker.js +1 -1
  317. package/node/internals/hooks/usePicker/usePickerValue.js +12 -16
  318. package/node/internals/index.js +0 -49
  319. package/node/locales/beBY.js +4 -4
  320. package/node/locales/caES.js +3 -3
  321. package/node/locales/csCZ.js +4 -4
  322. package/node/locales/daDK.js +3 -3
  323. package/node/locales/deDE.js +3 -3
  324. package/node/locales/elGR.js +4 -4
  325. package/node/locales/enUS.js +4 -4
  326. package/node/locales/esES.js +3 -3
  327. package/node/locales/eu.js +3 -3
  328. package/node/locales/faIR.js +3 -3
  329. package/node/locales/fiFI.js +3 -3
  330. package/node/locales/frFR.js +3 -3
  331. package/node/locales/heIL.js +3 -3
  332. package/node/locales/huHU.js +3 -3
  333. package/node/locales/isIS.js +4 -4
  334. package/node/locales/itIT.js +3 -3
  335. package/node/locales/jaJP.js +3 -3
  336. package/node/locales/koKR.js +3 -3
  337. package/node/locales/kzKZ.js +4 -4
  338. package/node/locales/mk.js +3 -3
  339. package/node/locales/nbNO.js +4 -4
  340. package/node/locales/nlNL.js +3 -3
  341. package/node/locales/nnNO.js +3 -3
  342. package/node/locales/plPL.js +4 -4
  343. package/node/locales/ptBR.js +4 -4
  344. package/node/locales/roRO.js +3 -3
  345. package/node/locales/ruRU.js +3 -3
  346. package/node/locales/skSK.js +4 -4
  347. package/node/locales/svSE.js +3 -3
  348. package/node/locales/trTR.js +4 -4
  349. package/node/locales/ukUA.js +3 -3
  350. package/node/locales/urPK.js +4 -4
  351. package/node/locales/utils/getPickersLocalization.js +16 -2
  352. package/node/locales/viVN.js +3 -3
  353. package/node/locales/zhCN.js +3 -3
  354. package/node/locales/zhHK.js +3 -3
  355. package/node/validation/index.js +40 -0
  356. package/node/validation/useValidation.js +61 -0
  357. package/node/{internals/utils/validation → validation}/validateDate.js +6 -4
  358. package/node/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  359. package/node/{internals/utils/validation → validation}/validateTime.js +6 -4
  360. package/package.json +4 -4
  361. package/{internals/utils/validation → validation}/extractValidationProps.d.ts +1 -1
  362. package/validation/index.d.ts +9 -0
  363. package/validation/index.js +5 -0
  364. package/validation/package.json +6 -0
  365. package/validation/useValidation.d.ts +68 -0
  366. package/validation/useValidation.js +54 -0
  367. package/validation/validateDate.d.ts +6 -0
  368. package/{modern/internals/utils/validation → validation}/validateDate.js +6 -4
  369. package/validation/validateDateTime.d.ts +7 -0
  370. package/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  371. package/validation/validateTime.d.ts +6 -0
  372. package/{modern/internals/utils/validation → validation}/validateTime.js +6 -4
  373. package/internals/hooks/useValidation.d.ts +0 -24
  374. package/internals/hooks/useValidation.js +0 -22
  375. package/internals/utils/fields.d.ts +0 -5
  376. package/internals/utils/fields.js +0 -28
  377. package/internals/utils/validation/validateDate.d.ts +0 -7
  378. package/internals/utils/validation/validateDateTime.d.ts +0 -7
  379. package/internals/utils/validation/validateTime.d.ts +0 -7
  380. package/internals/utils/warning.d.ts +0 -2
  381. package/internals/utils/warning.js +0 -21
  382. package/modern/internals/hooks/useValidation.js +0 -22
  383. package/modern/internals/utils/fields.js +0 -28
  384. package/modern/internals/utils/warning.js +0 -21
  385. package/node/internals/hooks/useValidation.js +0 -29
  386. package/node/internals/utils/fields.js +0 -36
  387. package/node/internals/utils/warning.js +0 -28
  388. /package/{internals/utils → modern}/validation/extractValidationProps.js +0 -0
  389. /package/node/{internals/utils/validation → validation}/extractValidationProps.js +0 -0
  390. /package/{modern/internals/utils/validation → validation}/extractValidationProps.js +0 -0
@@ -78,7 +78,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
78
78
  /* istanbul ignore next */
79
79
  if (process.env.NODE_ENV !== 'production') {
80
80
  if (typeof addDays !== 'function') {
81
- throw new Error(['MUI: The `date-fns` package v3.x is not compatible with this adapter.', 'Please, install v2.x of the package or use the `AdapterDateFnsV3` instead.'].join('\n'));
81
+ throw new Error(['MUI: This adapter is only compatible with `date-fns` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFnsV3` instead.'].join('\n'));
82
82
  }
83
83
  }
84
84
  super({
@@ -82,7 +82,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
82
82
  /* istanbul ignore next */
83
83
  if (process.env.NODE_ENV !== 'production') {
84
84
  if (typeof addDays !== 'function') {
85
- throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
85
+ throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x or v4.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
86
86
  }
87
87
  if (!longFormatters) {
88
88
  throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
@@ -6,7 +6,7 @@ import customParseFormatPlugin from 'dayjs/plugin/customParseFormat';
6
6
  import localizedFormatPlugin from 'dayjs/plugin/localizedFormat';
7
7
  import isBetweenPlugin from 'dayjs/plugin/isBetween';
8
8
  import advancedFormatPlugin from 'dayjs/plugin/advancedFormat';
9
- import { warnOnce } from "../internals/utils/warning.js";
9
+ import { warnOnce } from '@mui/x-internals/warning';
10
10
  defaultDayjs.extend(localizedFormatPlugin);
11
11
  defaultDayjs.extend(weekOfYearPlugin);
12
12
  defaultDayjs.extend(isBetweenPlugin);
package/CHANGELOG.md CHANGED
@@ -3,6 +3,186 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.18.0
7
+
8
+ _Sep 20, 2024_
9
+
10
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
13
+
14
+ <img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
15
+
16
+ - ⏰ Support `date-fns` v4 (#14673) @LukasTy
17
+ - 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@7.18.0`
26
+
27
+ - [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
28
+ - [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
29
+ - [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
30
+ - [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
31
+ - [DataGrid] Row spanning (#14124) @MBilalShafi
32
+
33
+ #### `@mui/x-data-grid-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@7.18.0`, plus:
36
+
37
+ - [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
38
+ - [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
39
+ - [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
40
+
41
+ #### `@mui/x-data-grid-premium@7.18.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
42
+
43
+ Same changes as in `@mui/x-data-grid-pro@7.18.0`.
44
+
45
+ ### Date and Time Pickers
46
+
47
+ #### `@mui/x-date-pickers@7.18.0`
48
+
49
+ - [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
50
+ - [pickers] Support `date-fns` v4 (#14673) @LukasTy
51
+
52
+ #### `@mui/x-date-pickers-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
53
+
54
+ Same changes as in `@mui/x-date-pickers@7.18.0`.
55
+
56
+ ### Charts
57
+
58
+ #### `@mui/x-charts@7.18.0`
59
+
60
+ - [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
61
+ - [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
62
+ - [charts] Fix legend slot typing (#14657) @alexfauquette
63
+ - [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
64
+ - [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
65
+
66
+ #### `@mui/x-charts-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
67
+
68
+ Same changes as in `@mui/x-charts@7.18.0`.
69
+
70
+ ### Tree View
71
+
72
+ #### `@mui/x-tree-view@7.18.0`
73
+
74
+ - [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
75
+
76
+ ### Docs
77
+
78
+ - [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
79
+ - [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
80
+ - [docs] Copy `vale-action.yml` from main repo @oliviertassinari
81
+ - [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
82
+ - [docs] Fix TypeScript capitalization @oliviertassinari
83
+ - [docs] Fix Vale error @oliviertassinari
84
+ - [docs] Make the migration guide diff a bit easier to read @oliviertassinari
85
+ - [docs] Report Vale at warning level (#14660) @oliviertassinari
86
+ - [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
87
+ - [docs] Polish code formatting (#14603) @oliviertassinari
88
+ - [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
89
+
90
+ ### Core
91
+
92
+ - [core] Fix 301 link to Next.js and git diff @oliviertassinari
93
+ - [core] Fix failing CI on `master` (#14644) @cherniavskii
94
+ - [core] Fix `package.json` repository rule @oliviertassinari
95
+ - [core] MUI X repository moved to a new location @oliviertassinari
96
+ - [docs-infra] Strengthen CSP (#14581) @oliviertassinari
97
+ - [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
98
+
99
+ ## 7.17.0
100
+
101
+ _Sep 13, 2024_
102
+
103
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
104
+
105
+ - 📊 Charts performance improvement
106
+ - 🧑‍💻 New Data Grid [custom columns demo](https://mui.com/x/react-data-grid/custom-columns/#full-example)
107
+ - 🐞 Bugfixes
108
+ - 📚 Documentation improvements
109
+ - 🌍 Improve Hungarian (hu-HU) locale on the Data Grid
110
+
111
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
112
+
113
+ ### Data Grid
114
+
115
+ #### `@mui/x-data-grid@7.17.0`
116
+
117
+ - [DataGrid] Add "does not equal" and "does not contain" filter operators (#14489) @KenanYusuf
118
+ - [DataGrid] Add demo to the "Custom columns" page that does not use generator (#13695) @arminmeh
119
+ - [DataGrid] Fix Voice Over reading the column name twice (#14482) @arminmeh
120
+ - [DataGrid] Fix bug in CRUD example (#14513) @michelengelen
121
+ - [DataGrid] Fix failing jsdom tests caused by `:has()` selectors (#14559) @KenanYusuf
122
+ - [DataGrid] Refactor string operator filter functions (#14564) @KenanYusuf
123
+ - [l10n] Improve Hungarian (hu-HU) locale (#14506) @ntamas
124
+
125
+ #### `@mui/x-data-grid-pro@7.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
126
+
127
+ Same changes as in `@mui/x-data-grid@7.17.0`.
128
+
129
+ #### `@mui/x-data-grid-premium@7.17.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
130
+
131
+ Same changes as in `@mui/x-data-grid-pro@7.17.0`.
132
+
133
+ ### Date and Time Pickers
134
+
135
+ #### `@mui/x-date-pickers@7.17.0`
136
+
137
+ - [fields] Improve `useSplitFieldProps` and make it public (#14514) @flaviendelangle
138
+ - [pickers] Improve clear action label (#14243) @oliviertassinari
139
+ - [pickers] Add `"use client"` directive to every public component and hook (#14562) @flaviendelangle
140
+ - [pickers] Allow custom fields to validate the value (#14486) @flaviendelangle
141
+ - [pickers] Stop using utils in locales (#14505) @flaviendelangle
142
+
143
+ #### `@mui/x-date-pickers-pro@7.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
144
+
145
+ Same changes as in `@mui/x-date-pickers@7.17.0`, plus:
146
+
147
+ - [DateRangePicker] Fix `currentMonthCalendarPosition` not scrolling to future sibling (#14442) @GMchris
148
+
149
+ ### Charts
150
+
151
+ #### `@mui/x-charts@7.17.0`
152
+
153
+ - [charts] Add `"use client"` directive to every public component and hook (#14578) @flaviendelangle
154
+ - [charts] Allow `onItemClick` on the `Legend` component (#14231) @JCQuintas
155
+ - [charts] Fix `onAxisClick` with `layout='horizontal'` (#14547) @alexfauquette
156
+ - [charts] Replace `path` with `circle` for performance improvement (#14518) @alexfauquette
157
+
158
+ #### `@mui/x-charts-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
159
+
160
+ Same changes as in `@mui/x-charts@7.17.0`.
161
+
162
+ ### Tree View
163
+
164
+ #### `@mui/x-tree-view@7.17.0`
165
+
166
+ - [TreeView] Make `useTreeItem2` stable (#14498) @flaviendelangle
167
+
168
+ ### Docs
169
+
170
+ - [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
171
+ - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
172
+ - [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
173
+ - [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
174
+ - [docs] Match title with blog posts @oliviertassinari
175
+
176
+ ### Core
177
+
178
+ - [core] Move warning methods to `@mui/x-internals` (#14528) @k-rajat19
179
+ - [core] Sync with core release flow @oliviertassinari
180
+ - [code-infra] Fix charts benchmark workflow (#14573) @JCQuintas
181
+ - [docs-infra] Type interface API pages (#14138) @alexfauquette
182
+ - [infra] Create `ESLint plugins` renovate group (#14574) @LukasTy
183
+ - [license] Clean-up terminology to match codebase (#14531) @oliviertassinari
184
+ - [test] Remove dead `act()` logic (#14529) @oliviertassinari
185
+
6
186
  ## 7.16.0
7
187
 
8
188
  _Sep 5, 2024_
@@ -108,7 +288,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
108
288
 
109
289
  - 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
110
290
 
111
- You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
291
+ You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
112
292
 
113
293
  - 🐞 Bugfixes
114
294
 
@@ -153,7 +333,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
153
333
 
154
334
  - [docs] Fix sentence case `h2` @oliviertassinari
155
335
  - [docs] Clarify contribution guide references @oliviertassinari
156
- - [docs] Fix Stack Overflow issue canned response @oliviertassinari
336
+ - [docs] Fix Stack Overflow issue canned response @oliviertassinari
157
337
  - [docs] Fix outdated link to support page @oliviertassinari
158
338
  - [docs] Fix use of Material UI @oliviertassinari
159
339
  - [docs] Update deprecated props in docs (#14295) @JCQuintas
@@ -411,7 +591,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
411
591
 
412
592
  As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
413
593
 
414
- This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
594
+ This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
415
595
 
416
596
  ### Highlights
417
597
 
@@ -476,7 +656,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
476
656
  #### `@mui/x-charts@7.12.0`
477
657
 
478
658
  - [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
479
- - [charts] Use vendor to have Common JS bundle working out of the box (#13608) @alexfauquette
659
+ - [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
480
660
  - [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
481
661
 
482
662
  ### Tree View
@@ -1,6 +1,8 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsPerRow", "monthsPerRow", "timezone"];
5
+ const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
4
6
  import * as React from 'react';
5
7
  import PropTypes from 'prop-types';
6
8
  import clsx from 'clsx';
@@ -118,6 +120,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
118
120
  loading,
119
121
  renderLoading,
120
122
  displayWeekNumber,
123
+ yearsOrder,
121
124
  yearsPerRow,
122
125
  monthsPerRow,
123
126
  timezone: timezoneProp
@@ -309,6 +312,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
309
312
  shouldDisableYear: shouldDisableYear,
310
313
  hasFocus: hasFocus,
311
314
  onFocusedViewChange: isViewFocused => setFocusedView('year', isViewFocused),
315
+ yearsOrder: yearsOrder,
312
316
  yearsPerRow: yearsPerRow,
313
317
  referenceDate: referenceDate
314
318
  })), view === 'month' && /*#__PURE__*/_jsx(MonthCalendar, _extends({}, baseDateValidationProps, commonViewProps, {
@@ -558,6 +562,12 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
558
562
  * Available views.
559
563
  */
560
564
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
565
+ /**
566
+ * Years are displayed in ascending (chronological) order by default.
567
+ * If `desc`, years are displayed in descending order.
568
+ * @default 'asc'
569
+ */
570
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
561
571
  /**
562
572
  * Years rendered per row.
563
573
  * @default 3
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,4 @@
1
- import { DateComponentValidationProps } from '../internals/utils/validation/validateDate';
2
- import { PickerValidDate } from '../models';
3
- export declare const useIsDateDisabled: <TDate extends PickerValidDate>({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: DateComponentValidationProps<TDate>) => (day: TDate | null) => boolean;
1
+ import { ValidateDateProps } from '../validation';
2
+ import { PickerValidDate, TimezoneProps } from '../models';
3
+ import { DefaultizedProps } from '../internals/models/helpers';
4
+ export declare const useIsDateDisabled: <TDate extends PickerValidDate>({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: ValidateDateProps<TDate> & DefaultizedProps<TimezoneProps, "timezone">) => (day: TDate | null) => boolean;
@@ -1,5 +1,7 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
- import { validateDate } from "../internals/utils/validation/validateDate.js";
4
+ import { validateDate } from "../validation/index.js";
3
5
  import { useLocalizationContext } from "../internals/hooks/useUtils.js";
4
6
  export const useIsDateDisabled = ({
5
7
  shouldDisableDate,
@@ -15,6 +17,7 @@ export const useIsDateDisabled = ({
15
17
  return React.useCallback(day => validateDate({
16
18
  adapter,
17
19
  value: day,
20
+ timezone,
18
21
  props: {
19
22
  shouldDisableDate,
20
23
  shouldDisableMonth,
@@ -22,8 +25,7 @@ export const useIsDateDisabled = ({
22
25
  minDate,
23
26
  maxDate,
24
27
  disableFuture,
25
- disablePast,
26
- timezone
28
+ disablePast
27
29
  }
28
30
  }) !== null, [adapter, shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone]);
29
31
  };
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -2,12 +2,17 @@ import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/utils';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
5
- import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
5
+ import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps, BaseSingleInputFieldProps } from '../models';
6
6
  import { UseFieldInternalProps } from '../internals/hooks/useField';
7
- import { MakeOptional } from '../internals/models/helpers';
7
+ import { MakeOptional, DefaultizedProps } from '../internals/models/helpers';
8
8
  import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
9
9
  export interface UseDateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, ExportedUseClearableFieldProps {
10
10
  }
11
+ /**
12
+ * Props the field can receive when used inside a date picker.
13
+ * (`DatePicker`, `DesktopDatePicker` or `MobileDatePicker` component).
14
+ */
15
+ export type DateFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | keyof BaseDateValidationProps<TDate>> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateValidationError>;
11
16
  export type UseDateFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
12
17
  export type DateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
13
18
  /**
@@ -1,3 +1,3 @@
1
1
  export { DateField } from './DateField';
2
2
  export { useDateField as unstable_useDateField } from './useDateField';
3
- export type { UseDateFieldProps, UseDateFieldComponentProps, DateFieldProps, } from './DateField.types';
3
+ export type { UseDateFieldProps, UseDateFieldComponentProps, DateFieldProps, DateFieldInPickerProps, } from './DateField.types';
@@ -1,3 +1,3 @@
1
1
  import { UseDateFieldProps } from './DateField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, keyof UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>>;
3
+ export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("../internals").BaseDateValidationProps<any> | "dateSeparator">>;
@@ -1,14 +1,16 @@
1
+ 'use client';
2
+
1
3
  import { singleItemFieldValueManager, singleItemValueManager } from "../internals/utils/valueManagers.js";
2
4
  import { useField } from "../internals/hooks/useField/index.js";
3
- import { validateDate } from "../internals/utils/validation/validateDate.js";
4
- import { splitFieldInternalAndForwardedProps } from "../internals/utils/fields.js";
5
+ import { validateDate } from "../validation/index.js";
6
+ import { useSplitFieldProps } from "../hooks/index.js";
5
7
  import { useDefaultizedDateField } from "../internals/hooks/defaultizedFieldProps.js";
6
8
  export const useDateField = inProps => {
7
9
  const props = useDefaultizedDateField(inProps);
8
10
  const {
9
11
  forwardedProps,
10
12
  internalProps
11
- } = splitFieldInternalAndForwardedProps(props, 'date');
13
+ } = useSplitFieldProps(props, 'date');
12
14
  return useField({
13
15
  forwardedProps,
14
16
  internalProps,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["desktopModeMediaQuery"];
@@ -349,6 +351,12 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
349
351
  * Available views.
350
352
  */
351
353
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
354
+ /**
355
+ * Years are displayed in ascending (chronological) order by default.
356
+ * If `desc`, years are displayed in descending order.
357
+ * @default 'asc'
358
+ */
359
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
352
360
  /**
353
361
  * Years rendered per row.
354
362
  * @default 4 on desktop, 3 on mobile
@@ -12,11 +12,6 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
12
12
  * @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
13
13
  */
14
14
  desktopModeMediaQuery?: string;
15
- /**
16
- * Years rendered per row.
17
- * @default 4 on desktop, 3 on mobile
18
- */
19
- yearsPerRow?: 3 | 4;
20
15
  /**
21
16
  * Overridable component slots.
22
17
  * @default {}
@@ -27,4 +22,9 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
27
22
  * @default {}
28
23
  */
29
24
  slotProps?: DatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
25
+ /**
26
+ * Years rendered per row.
27
+ * @default 4 on desktop, 3 on mobile
28
+ */
29
+ yearsPerRow?: 3 | 4;
30
30
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className", "onViewChange", "view"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/utils';
3
3
  import TextField from '@mui/material/TextField';
4
- import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
4
+ import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps, BaseSingleInputFieldProps } from '../models';
5
5
  import { UseFieldInternalProps } from '../internals/hooks/useField';
6
- import { MakeOptional } from '../internals/models/helpers';
6
+ import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
7
7
  import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
8
8
  import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
9
9
  export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateTimeValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, TimeValidationProps<TDate>, BaseTimeValidationProps, DateTimeValidationProps<TDate>, ExportedUseClearableFieldProps {
@@ -13,6 +13,11 @@ export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAcc
13
13
  */
14
14
  ampm?: boolean;
15
15
  }
16
+ /**
17
+ * Props the field can receive when used inside a date time picker.
18
+ * (`DateTimePicker`, `DesktopDateTimePicker` or `MobileDateTimePicker` component).
19
+ */
20
+ export type DateTimeFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseDateValidationProps<TDate> | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateTimeValidationError>;
16
21
  export type UseDateTimeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
17
22
  export type DateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
18
23
  /**
@@ -1,3 +1,3 @@
1
1
  export { DateTimeField } from './DateTimeField';
2
2
  export { useDateTimeField as unstable_useDateTimeField } from './useDateTimeField';
3
- export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps, } from './DateTimeField.types';
3
+ export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps, DateTimeFieldInPickerProps, } from './DateTimeField.types';
@@ -1,3 +1,3 @@
1
1
  import { UseDateTimeFieldProps } from './DateTimeField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, keyof UseDateTimeFieldProps<any, TEnableAccessibleFieldDOMStructure>>>;
3
+ export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
@@ -1,14 +1,16 @@
1
+ 'use client';
2
+
1
3
  import { singleItemFieldValueManager, singleItemValueManager } from "../internals/utils/valueManagers.js";
2
4
  import { useField } from "../internals/hooks/useField/index.js";
3
- import { validateDateTime } from "../internals/utils/validation/validateDateTime.js";
4
- import { splitFieldInternalAndForwardedProps } from "../internals/utils/fields.js";
5
+ import { validateDateTime } from "../validation/index.js";
6
+ import { useSplitFieldProps } from "../hooks/index.js";
5
7
  import { useDefaultizedDateTimeField } from "../internals/hooks/defaultizedFieldProps.js";
6
8
  export const useDateTimeField = inProps => {
7
9
  const props = useDefaultizedDateTimeField(inProps);
8
10
  const {
9
11
  forwardedProps,
10
12
  internalProps
11
- } = splitFieldInternalAndForwardedProps(props, 'date-time');
13
+ } = useSplitFieldProps(props, 'date-time');
12
14
  return useField({
13
15
  forwardedProps,
14
16
  internalProps,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["desktopModeMediaQuery"];
@@ -420,6 +422,12 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
420
422
  * Available views.
421
423
  */
422
424
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'month', 'seconds', 'year']).isRequired),
425
+ /**
426
+ * Years are displayed in ascending (chronological) order by default.
427
+ * If `desc`, years are displayed in descending order.
428
+ * @default 'asc'
429
+ */
430
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
423
431
  /**
424
432
  * Years rendered per row.
425
433
  * @default 4 on desktop, 3 on mobile
@@ -2,22 +2,18 @@ import { DesktopDateTimePickerProps, DesktopDateTimePickerSlots, DesktopDateTime
2
2
  import { DateOrTimeViewWithMeridiem } from '../internals/models';
3
3
  import { MobileDateTimePickerProps, MobileDateTimePickerSlots, MobileDateTimePickerSlotProps } from '../MobileDateTimePicker';
4
4
  import { PickerValidDate } from '../models';
5
+ import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
5
6
  export interface DateTimePickerSlots<TDate extends PickerValidDate> extends DesktopDateTimePickerSlots<TDate>, MobileDateTimePickerSlots<TDate, DateOrTimeViewWithMeridiem> {
6
7
  }
7
8
  export interface DateTimePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends DesktopDateTimePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>, MobileDateTimePickerSlotProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure> {
8
9
  }
9
- export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends DesktopDateTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>, Omit<MobileDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, 'views'> {
10
+ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends DesktopDateTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>, ExportedYearCalendarProps, Omit<MobileDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, 'views'> {
10
11
  /**
11
12
  * CSS media query when `Mobile` mode will be changed to `Desktop`.
12
13
  * @default '@media (pointer: fine)'
13
14
  * @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
14
15
  */
15
16
  desktopModeMediaQuery?: string;
16
- /**
17
- * Years rendered per row.
18
- * @default 4 on desktop, 3 on mobile
19
- */
20
- yearsPerRow?: 3 | 4;
21
17
  /**
22
18
  * Overridable component slots.
23
19
  * @default {}
@@ -28,4 +24,9 @@ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAcces
28
24
  * @default {}
29
25
  */
30
26
  slotProps?: DateTimePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
27
+ /**
28
+ * Years rendered per row.
29
+ * @default 4 on desktop, 3 on mobile
30
+ */
31
+ yearsPerRow?: 3 | 4;
31
32
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import clsx from 'clsx';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant", "toolbarTitle", "className"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["className"];