@mui/x-date-pickers 5.0.0-alpha.3 → 5.0.0-alpha.6

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 (323) hide show
  1. package/CHANGELOG.md +237 -16
  2. package/CalendarPicker/CalendarPicker.d.ts +18 -30
  3. package/CalendarPicker/CalendarPicker.js +90 -44
  4. package/CalendarPicker/DayPicker.d.ts +2 -2
  5. package/CalendarPicker/DayPicker.js +16 -4
  6. package/CalendarPicker/PickersCalendarHeader.d.ts +3 -3
  7. package/CalendarPicker/PickersCalendarHeader.js +15 -9
  8. package/CalendarPicker/index.d.ts +1 -1
  9. package/CalendarPicker/useCalendarState.d.ts +2 -2
  10. package/CalendarPicker/useCalendarState.js +9 -9
  11. package/ClockPicker/ClockPicker.d.ts +10 -3
  12. package/ClockPicker/ClockPicker.js +40 -38
  13. package/DatePicker/DatePicker.d.ts +17 -3
  14. package/DatePicker/DatePicker.js +16 -56
  15. package/DatePicker/DatePickerToolbar.d.ts +1 -0
  16. package/DatePicker/DatePickerToolbar.js +16 -7
  17. package/DatePicker/shared.d.ts +2 -10
  18. package/DatePicker/shared.js +0 -2
  19. package/DateTimePicker/DateTimePicker.d.ts +17 -3
  20. package/DateTimePicker/DateTimePicker.js +17 -56
  21. package/DateTimePicker/DateTimePickerTabs.js +4 -2
  22. package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -0
  23. package/DateTimePicker/DateTimePickerToolbar.js +37 -11
  24. package/DateTimePicker/shared.d.ts +2 -10
  25. package/DateTimePicker/shared.js +0 -1
  26. package/DesktopDatePicker/DesktopDatePicker.d.ts +17 -2
  27. package/DesktopDatePicker/DesktopDatePicker.js +24 -28
  28. package/DesktopDatePicker/index.d.ts +1 -1
  29. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +17 -1
  30. package/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -28
  31. package/DesktopDateTimePicker/index.d.ts +1 -1
  32. package/DesktopTimePicker/DesktopTimePicker.d.ts +17 -1
  33. package/DesktopTimePicker/DesktopTimePicker.js +19 -20
  34. package/DesktopTimePicker/index.d.ts +1 -1
  35. package/LocalizationProvider/LocalizationProvider.d.ts +13 -2
  36. package/LocalizationProvider/LocalizationProvider.js +38 -7
  37. package/MobileDatePicker/MobileDatePicker.d.ts +16 -1
  38. package/MobileDatePicker/MobileDatePicker.js +25 -49
  39. package/MobileDatePicker/index.d.ts +1 -1
  40. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +17 -1
  41. package/MobileDateTimePicker/MobileDateTimePicker.js +26 -49
  42. package/MobileDateTimePicker/index.d.ts +1 -1
  43. package/MobileTimePicker/MobileTimePicker.d.ts +17 -1
  44. package/MobileTimePicker/MobileTimePicker.js +20 -41
  45. package/MobileTimePicker/index.d.ts +1 -1
  46. package/MonthPicker/MonthPicker.d.ts +4 -28
  47. package/MonthPicker/MonthPicker.js +18 -27
  48. package/PickersActionBar/PickersActionBar.d.ts +16 -0
  49. package/PickersActionBar/PickersActionBar.js +56 -0
  50. package/PickersActionBar/index.d.ts +2 -0
  51. package/PickersActionBar/index.js +1 -0
  52. package/PickersActionBar/package.json +6 -0
  53. package/PickersDay/PickersDay.d.ts +1 -1
  54. package/PickersDay/PickersDay.js +1 -1
  55. package/README.md +44 -4
  56. package/StaticDatePicker/StaticDatePicker.d.ts +19 -1
  57. package/StaticDatePicker/StaticDatePicker.js +30 -17
  58. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +19 -1
  59. package/StaticDateTimePicker/StaticDateTimePicker.js +32 -17
  60. package/StaticTimePicker/StaticTimePicker.d.ts +19 -1
  61. package/StaticTimePicker/StaticTimePicker.js +26 -10
  62. package/TimePicker/TimePicker.d.ts +17 -3
  63. package/TimePicker/TimePicker.js +11 -48
  64. package/TimePicker/TimePickerToolbar.js +24 -9
  65. package/TimePicker/shared.d.ts +1 -0
  66. package/TimePicker/shared.js +4 -8
  67. package/TimePicker/timePickerToolbarClasses.d.ts +0 -1
  68. package/TimePicker/timePickerToolbarClasses.js +2 -2
  69. package/YearPicker/YearPicker.d.ts +4 -24
  70. package/YearPicker/YearPicker.js +53 -49
  71. package/index.d.ts +2 -0
  72. package/index.js +4 -2
  73. package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.d.ts +2 -3
  74. package/internals/components/CalendarOrClockPicker/index.d.ts +1 -0
  75. package/internals/components/KeyboardDateInput.js +4 -3
  76. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +24 -2
  77. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +78 -7
  78. package/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.d.ts +2 -0
  79. package/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +1 -1
  80. package/internals/components/PickersArrowSwitcher.d.ts +4 -3
  81. package/internals/components/PickersArrowSwitcher.js +8 -8
  82. package/internals/components/PickersModalDialog.d.ts +18 -36
  83. package/internals/components/PickersModalDialog.js +13 -35
  84. package/internals/components/PickersPopper.d.ts +13 -12
  85. package/internals/components/PickersPopper.js +27 -23
  86. package/internals/components/PickersToolbar.d.ts +1 -1
  87. package/internals/components/PickersToolbar.js +23 -9
  88. package/internals/components/PureDateInput.d.ts +3 -3
  89. package/internals/components/PureDateInput.js +7 -3
  90. package/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
  91. package/internals/components/wrappers/DesktopWrapper.d.ts +16 -1
  92. package/internals/components/wrappers/DesktopWrapper.js +9 -5
  93. package/internals/components/wrappers/MobileWrapper.d.ts +8 -1
  94. package/internals/components/wrappers/MobileWrapper.js +8 -14
  95. package/internals/hooks/useMaskedInput.js +32 -31
  96. package/internals/hooks/useUtils.d.ts +3 -0
  97. package/internals/hooks/useUtils.js +2 -3
  98. package/internals/hooks/useViews.d.ts +1 -0
  99. package/internals/hooks/validation/models.d.ts +61 -0
  100. package/internals/hooks/validation/models.js +1 -0
  101. package/internals/hooks/validation/useDateTimeValidation.js +23 -11
  102. package/internals/hooks/validation/useDateValidation.d.ts +3 -26
  103. package/internals/hooks/validation/useDateValidation.js +40 -13
  104. package/internals/hooks/validation/useTimeValidation.js +18 -13
  105. package/internals/hooks/validation/useValidation.d.ts +6 -2
  106. package/internals/hooks/validation/useValidation.js +7 -3
  107. package/internals/index.d.ts +6 -4
  108. package/internals/index.js +3 -2
  109. package/internals/utils/date-utils.d.ts +4 -4
  110. package/internals/utils/date-utils.js +4 -4
  111. package/internals/utils/text-field-helper.d.ts +1 -1
  112. package/internals/utils/text-field-helper.js +29 -14
  113. package/internals/utils/utils.d.ts +0 -1
  114. package/internals/utils/utils.js +0 -9
  115. package/internals/utils/warning.d.ts +3 -0
  116. package/internals/utils/warning.js +17 -0
  117. package/legacy/CalendarPicker/CalendarPicker.js +91 -46
  118. package/legacy/CalendarPicker/DayPicker.js +16 -4
  119. package/legacy/CalendarPicker/PickersCalendarHeader.js +15 -12
  120. package/legacy/CalendarPicker/useCalendarState.js +11 -13
  121. package/legacy/ClockPicker/ClockPicker.js +42 -52
  122. package/legacy/DatePicker/DatePicker.js +17 -57
  123. package/legacy/DatePicker/DatePickerToolbar.js +19 -6
  124. package/legacy/DatePicker/shared.js +0 -2
  125. package/legacy/DateTimePicker/DateTimePicker.js +18 -57
  126. package/legacy/DateTimePicker/DateTimePickerTabs.js +4 -2
  127. package/legacy/DateTimePicker/DateTimePickerToolbar.js +45 -11
  128. package/legacy/DateTimePicker/shared.js +0 -1
  129. package/legacy/DesktopDatePicker/DesktopDatePicker.js +24 -28
  130. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -28
  131. package/legacy/DesktopTimePicker/DesktopTimePicker.js +19 -20
  132. package/legacy/LocalizationProvider/LocalizationProvider.js +38 -7
  133. package/legacy/MobileDatePicker/MobileDatePicker.js +24 -48
  134. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +25 -48
  135. package/legacy/MobileTimePicker/MobileTimePicker.js +19 -40
  136. package/legacy/MonthPicker/MonthPicker.js +20 -27
  137. package/legacy/PickersActionBar/PickersActionBar.js +54 -0
  138. package/legacy/PickersActionBar/index.js +1 -0
  139. package/legacy/PickersDay/PickersDay.js +1 -1
  140. package/legacy/StaticDatePicker/StaticDatePicker.js +29 -16
  141. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +31 -16
  142. package/legacy/StaticTimePicker/StaticTimePicker.js +25 -9
  143. package/legacy/TimePicker/TimePicker.js +12 -49
  144. package/legacy/TimePicker/TimePickerToolbar.js +31 -8
  145. package/legacy/TimePicker/shared.js +4 -8
  146. package/legacy/TimePicker/timePickerToolbarClasses.js +2 -2
  147. package/legacy/YearPicker/YearPicker.js +57 -50
  148. package/legacy/index.js +4 -2
  149. package/legacy/internals/components/KeyboardDateInput.js +4 -4
  150. package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +81 -6
  151. package/legacy/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +1 -1
  152. package/legacy/internals/components/PickersArrowSwitcher.js +8 -10
  153. package/legacy/internals/components/PickersModalDialog.js +14 -43
  154. package/legacy/internals/components/PickersPopper.js +30 -29
  155. package/legacy/internals/components/PickersToolbar.js +29 -9
  156. package/legacy/internals/components/PureDateInput.js +7 -4
  157. package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
  158. package/legacy/internals/components/wrappers/DesktopWrapper.js +9 -5
  159. package/legacy/internals/components/wrappers/MobileWrapper.js +9 -15
  160. package/legacy/internals/hooks/useMaskedInput.js +40 -40
  161. package/legacy/internals/hooks/useUtils.js +4 -3
  162. package/legacy/internals/hooks/validation/models.js +1 -0
  163. package/legacy/internals/hooks/validation/useDateTimeValidation.js +26 -14
  164. package/legacy/internals/hooks/validation/useDateValidation.js +41 -13
  165. package/legacy/internals/hooks/validation/useTimeValidation.js +16 -13
  166. package/legacy/internals/hooks/validation/useValidation.js +7 -3
  167. package/legacy/internals/index.js +3 -2
  168. package/legacy/internals/utils/date-utils.js +4 -4
  169. package/legacy/internals/utils/text-field-helper.js +29 -14
  170. package/legacy/internals/utils/utils.js +0 -9
  171. package/legacy/internals/utils/warning.js +29 -0
  172. package/legacy/locales/deDE.js +31 -0
  173. package/legacy/locales/enUS.js +46 -0
  174. package/legacy/locales/frFR.js +31 -0
  175. package/legacy/locales/index.js +6 -0
  176. package/legacy/locales/ptBR.js +44 -0
  177. package/legacy/locales/trTR.js +32 -0
  178. package/legacy/locales/utils/getPickersLocalization.js +12 -0
  179. package/legacy/locales/utils/pickersLocaleTextApi.js +1 -0
  180. package/locales/deDE.d.ts +29 -0
  181. package/locales/deDE.js +31 -0
  182. package/locales/enUS.d.ts +32 -0
  183. package/locales/enUS.js +32 -0
  184. package/locales/frFR.d.ts +29 -0
  185. package/locales/frFR.js +31 -0
  186. package/locales/index.d.ts +6 -0
  187. package/locales/index.js +6 -0
  188. package/locales/package.json +6 -0
  189. package/locales/ptBR.d.ts +30 -0
  190. package/locales/ptBR.js +30 -0
  191. package/locales/trTR.d.ts +29 -0
  192. package/locales/trTR.js +32 -0
  193. package/locales/utils/getPickersLocalization.d.ts +30 -0
  194. package/locales/utils/getPickersLocalization.js +12 -0
  195. package/locales/utils/pickersLocaleTextApi.d.ts +26 -0
  196. package/locales/utils/pickersLocaleTextApi.js +1 -0
  197. package/modern/CalendarPicker/CalendarPicker.js +90 -44
  198. package/modern/CalendarPicker/DayPicker.js +16 -4
  199. package/modern/CalendarPicker/PickersCalendarHeader.js +15 -9
  200. package/modern/CalendarPicker/useCalendarState.js +9 -9
  201. package/modern/ClockPicker/ClockPicker.js +40 -38
  202. package/modern/DatePicker/DatePicker.js +16 -56
  203. package/modern/DatePicker/DatePickerToolbar.js +16 -7
  204. package/modern/DatePicker/shared.js +0 -2
  205. package/modern/DateTimePicker/DateTimePicker.js +17 -56
  206. package/modern/DateTimePicker/DateTimePickerTabs.js +4 -2
  207. package/modern/DateTimePicker/DateTimePickerToolbar.js +37 -11
  208. package/modern/DateTimePicker/shared.js +0 -1
  209. package/modern/DesktopDatePicker/DesktopDatePicker.js +24 -28
  210. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -28
  211. package/modern/DesktopTimePicker/DesktopTimePicker.js +19 -20
  212. package/modern/LocalizationProvider/LocalizationProvider.js +38 -7
  213. package/modern/MobileDatePicker/MobileDatePicker.js +25 -49
  214. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +26 -49
  215. package/modern/MobileTimePicker/MobileTimePicker.js +20 -41
  216. package/modern/MonthPicker/MonthPicker.js +18 -27
  217. package/modern/PickersActionBar/PickersActionBar.js +56 -0
  218. package/modern/PickersActionBar/index.js +1 -0
  219. package/modern/PickersDay/PickersDay.js +1 -1
  220. package/modern/StaticDatePicker/StaticDatePicker.js +30 -17
  221. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +32 -17
  222. package/modern/StaticTimePicker/StaticTimePicker.js +26 -10
  223. package/modern/TimePicker/TimePicker.js +11 -48
  224. package/modern/TimePicker/TimePickerToolbar.js +24 -9
  225. package/modern/TimePicker/shared.js +4 -8
  226. package/modern/TimePicker/timePickerToolbarClasses.js +2 -2
  227. package/modern/YearPicker/YearPicker.js +53 -49
  228. package/modern/index.js +4 -2
  229. package/modern/internals/components/KeyboardDateInput.js +4 -3
  230. package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +76 -7
  231. package/modern/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +1 -1
  232. package/modern/internals/components/PickersArrowSwitcher.js +8 -8
  233. package/modern/internals/components/PickersModalDialog.js +11 -35
  234. package/modern/internals/components/PickersPopper.js +25 -23
  235. package/modern/internals/components/PickersToolbar.js +23 -9
  236. package/modern/internals/components/PureDateInput.js +7 -3
  237. package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
  238. package/modern/internals/components/wrappers/DesktopWrapper.js +9 -5
  239. package/modern/internals/components/wrappers/MobileWrapper.js +8 -14
  240. package/modern/internals/hooks/useMaskedInput.js +32 -31
  241. package/modern/internals/hooks/useUtils.js +2 -3
  242. package/modern/internals/hooks/validation/models.js +1 -0
  243. package/modern/internals/hooks/validation/useDateTimeValidation.js +23 -11
  244. package/modern/internals/hooks/validation/useDateValidation.js +40 -13
  245. package/modern/internals/hooks/validation/useTimeValidation.js +18 -13
  246. package/modern/internals/hooks/validation/useValidation.js +7 -3
  247. package/modern/internals/index.js +3 -2
  248. package/modern/internals/utils/date-utils.js +4 -4
  249. package/modern/internals/utils/text-field-helper.js +29 -14
  250. package/modern/internals/utils/utils.js +0 -9
  251. package/modern/internals/utils/warning.js +17 -0
  252. package/modern/locales/deDE.js +31 -0
  253. package/modern/locales/enUS.js +32 -0
  254. package/modern/locales/frFR.js +31 -0
  255. package/modern/locales/index.js +6 -0
  256. package/modern/locales/ptBR.js +30 -0
  257. package/modern/locales/trTR.js +32 -0
  258. package/modern/locales/utils/getPickersLocalization.js +12 -0
  259. package/modern/locales/utils/pickersLocaleTextApi.js +1 -0
  260. package/node/CalendarPicker/CalendarPicker.js +90 -44
  261. package/node/CalendarPicker/DayPicker.js +17 -4
  262. package/node/CalendarPicker/PickersCalendarHeader.js +15 -8
  263. package/node/CalendarPicker/useCalendarState.js +8 -8
  264. package/node/ClockPicker/ClockPicker.js +40 -37
  265. package/node/DatePicker/DatePicker.js +16 -56
  266. package/node/DatePicker/DatePickerToolbar.js +17 -7
  267. package/node/DatePicker/shared.js +0 -2
  268. package/node/DateTimePicker/DateTimePicker.js +17 -56
  269. package/node/DateTimePicker/DateTimePickerTabs.js +5 -2
  270. package/node/DateTimePicker/DateTimePickerToolbar.js +38 -11
  271. package/node/DateTimePicker/shared.js +0 -1
  272. package/node/DesktopDatePicker/DesktopDatePicker.js +24 -28
  273. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -28
  274. package/node/DesktopTimePicker/DesktopTimePicker.js +19 -20
  275. package/node/LocalizationProvider/LocalizationProvider.js +41 -7
  276. package/node/MobileDatePicker/MobileDatePicker.js +25 -49
  277. package/node/MobileDateTimePicker/MobileDateTimePicker.js +26 -49
  278. package/node/MobileTimePicker/MobileTimePicker.js +20 -41
  279. package/node/MonthPicker/MonthPicker.js +17 -26
  280. package/node/PickersActionBar/PickersActionBar.js +77 -0
  281. package/node/PickersActionBar/index.js +13 -0
  282. package/node/PickersDay/PickersDay.js +1 -1
  283. package/node/StaticDatePicker/StaticDatePicker.js +30 -17
  284. package/node/StaticDateTimePicker/StaticDateTimePicker.js +32 -17
  285. package/node/StaticTimePicker/StaticTimePicker.js +26 -10
  286. package/node/TimePicker/TimePicker.js +11 -48
  287. package/node/TimePicker/TimePickerToolbar.js +23 -9
  288. package/node/TimePicker/shared.js +3 -6
  289. package/node/TimePicker/timePickerToolbarClasses.js +2 -2
  290. package/node/YearPicker/YearPicker.js +52 -49
  291. package/node/index.js +46 -2
  292. package/node/internals/components/KeyboardDateInput.js +3 -3
  293. package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +76 -6
  294. package/node/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +1 -1
  295. package/node/internals/components/PickersArrowSwitcher.js +8 -8
  296. package/node/internals/components/PickersModalDialog.js +14 -37
  297. package/node/internals/components/PickersPopper.js +28 -24
  298. package/node/internals/components/PickersToolbar.js +25 -10
  299. package/node/internals/components/PureDateInput.js +5 -1
  300. package/node/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
  301. package/node/internals/components/wrappers/DesktopWrapper.js +9 -5
  302. package/node/internals/components/wrappers/MobileWrapper.js +8 -14
  303. package/node/internals/hooks/useMaskedInput.js +33 -33
  304. package/node/internals/hooks/useUtils.js +7 -1
  305. package/node/internals/hooks/validation/models.js +5 -0
  306. package/node/internals/hooks/validation/useDateTimeValidation.js +23 -11
  307. package/node/internals/hooks/validation/useDateValidation.js +50 -14
  308. package/node/internals/hooks/validation/useTimeValidation.js +18 -13
  309. package/node/internals/hooks/validation/useValidation.js +6 -2
  310. package/node/internals/index.js +20 -0
  311. package/node/internals/utils/date-utils.js +4 -4
  312. package/node/internals/utils/text-field-helper.js +31 -16
  313. package/node/internals/utils/utils.js +0 -11
  314. package/node/internals/utils/warning.js +26 -0
  315. package/node/locales/deDE.js +40 -0
  316. package/node/locales/enUS.js +42 -0
  317. package/node/locales/frFR.js +40 -0
  318. package/node/locales/index.js +83 -0
  319. package/node/locales/ptBR.js +39 -0
  320. package/node/locales/trTR.js +41 -0
  321. package/node/locales/utils/getPickersLocalization.js +24 -0
  322. package/node/locales/utils/pickersLocaleTextApi.js +5 -0
  323. package/package.json +9 -10
package/CHANGELOG.md CHANGED
@@ -3,21 +3,247 @@
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
+ ## v5.12.1
7
+
8
+ _Jun 9, 2022_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Add `reason` to `onFilterModelChange` (#4938) @m4theushw
13
+ - 🔎 Control quick filter input value via model prop (#5013) @alexfauquette
14
+ - 📚 Documentation improvements
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v5.12.1` / `@mui/x-data-grid-pro@v5.12.1` / `@mui/x-data-grid-premium@v5.12.1`
18
+
19
+ #### Changes
20
+
21
+ - [DataGrid] Add `reason` to `onFilterModelChange` (#4938) @m4theushw
22
+ - [DataGrid] Restore focus after dismissing the column menu (#5027) @m4theushw
23
+ - [DataGrid] Update quick filter input when model is modified (#5013) @alexfauquette
24
+ - [DataGrid] Fix implicit dependency on react-dom (#5121) @oliviertassinari
25
+ - [DataGrid] Support `getRowId` in row reordering (#5093) @flaviendelangle
26
+ - [DataGridPro] Fix column resizing in RTL mode (#4989) @cherniavskii
27
+ - [DataGridPro] Fix column resizing on touchscreen (#5056) @cherniavskii
28
+ - [l10n] Update Japanese (ja-JP) locale (#5122) @hikotq
29
+ - [l10n] Update Russian (ru-RU) locale (#5069) @Artboomy
30
+
31
+ ### `@mui/x-date-pickers@5.0.0-alpha.6` / `@mui/x-date-pickers-pro@5.0.0-alpha.6`
32
+
33
+ #### Changes
34
+
35
+ - [pickers] Fix usage of `maxDate` / `minDate` / `disableFuture` and `disablePast` (#5081) @flaviendelangle
36
+ - [pickers] Infer mask from `inputFormat` (#5060) @alexfauquette
37
+ - [pickers] Manage input value without using the focus (#4486) @alexfauquette
38
+ - [pickers] Use new localization for doc examples (#5097) @flaviendelangle
39
+ - [pickers] Fix `shouldDisableDate` in range pickers (#5123) @flaviendelangle
40
+ - [l10n] Add Brazilian Portuguese (pt-BR) locale (#5100) @jardelnovaes
41
+ - [l10n] Use `localText` for remaining texts (#4986) @alexfauquette
42
+
43
+ ### Docs
44
+
45
+ - [docs] Implement the focus management on data grid demo links (#5070) @alexfauquette
46
+ - [docs] Fix `301` link to render cell (#5106) @oliviertassinari
47
+ - [docs] Fix broken anchor link @oliviertassinari
48
+ - [docs] Improve movie dataset (#5142) @flaviendelangle
49
+ - [docs] Move all localization documentation in a unique page (#5072) @alexfauquette
50
+ - [docs] Section for overwriting core components i18n keys (#4998) @DanailH
51
+ - [docs] Small grammar and format fixes for Dynamic Row Height section (#5098) @samuelsycamore
52
+
53
+ ### Core
54
+
55
+ - [core] Allows to run tests with different date adapters (#5055) @alexfauquette
56
+ - [core] Prettify the l10n issue (#4928) @alexfauquette
57
+ - [core] Set correct `apiRef` type in row reorder pre processors #5125 @DanailH
58
+ - [core] Stop using `GridEvents` in technical doc (#5157) @flaviendelangle
59
+ - [core] Upgrade monorepo (#5101) @oliviertassinari
60
+ - [test] Fix dynamic row height test failing on Chrome (#5147) @m4theushw
61
+ - [test] Remove delay on server demo for regression tests (#5131) @alexfauquette
62
+
63
+ ## v5.12.0
64
+
65
+ _May 31, 2022_
66
+
67
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
68
+
69
+ - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/rows/#dynamic-row-height) (#4859) @m4theushw
70
+
71
+ <img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
72
+
73
+ - ⚠️ Remove deprecated row grouping feature from `@mui/x-data-grid-pro`
74
+
75
+ Row grouping is available through the `@mui/x-data-grid-premium` package - see [Premium plan release blogpost](https://mui.com/blog/premium-plan-release/).
76
+
77
+ - 🐞 Bug fixes and improvements
78
+
79
+ ### `@mui/x-data-grid@v5.12.0` / `@mui/x-data-grid-pro@v5.12.0` / `@mui/x-data-grid-premium@v5.12.0`
80
+
81
+ #### Changes
82
+
83
+ - [DataGrid] Support dynamic row height (#4859) @m4theushw
84
+ - [DataGrid] Add `onMenuOpen` and `onMenuClose` props (#4825) @DanailH
85
+ - [DataGrid] Add generics to `GridActionsColDef` to match `GridColDef` (#4982) @subvertallchris
86
+ - [DataGrid] Disable drag event handlers when row or column reorder are disabled (#4857) @DanailH
87
+ - [DataGrid] Allow other attempts to stop edit mode if the first failed (#5016) @m4theushw
88
+ - [DataGrid] Better reflect the dependency on Material UI (#4795) @oliviertassinari
89
+ - [DataGrid] Add an id to the filter item created when opening the filter panel (#5014) @flaviendelangle
90
+ - [DataGrid] Use column visibility model on Hide All / Show All when enabled (#5050) @flaviendelangle
91
+ - [DataGridPro] Unpin columns back to original position (#4512) @m4theushw
92
+ - [DataGridPro] Remove experimental row grouping from Pro plan (#4949) @flaviendelangle
93
+ - [DataGridPro] Allow to scroll detail panel content if it overflows the panel (#4979) @cherniavskii
94
+ - [DataGridPro] Do not call `setRowIndex` when dragging a column over a row (#4987) @flaviendelangle
95
+ - [l10n] Add Norwegian (Bokmål) (nb-NO) locale (#5001) @spiftire
96
+ - [l10n] Add Turkish (tr-TR) locale (#5026) @Rassilion
97
+
98
+ ### `@mui/x-date-pickers@5.0.0-alpha.5` / `@mui/x-date-pickers-pro@5.0.0-alpha.5`
99
+
100
+ #### Breaking changes
101
+
102
+ - [pickers] Restructure props in `MonthPicker` / `YearPicker` and `DayPicker` (#4814) @flaviendelangle
103
+
104
+ The props of `MonthPicker` / `YearPicker` and `DayPicker` have been reworked to make them more consistent for a standalone usage (#4814) @flaviendelangle
105
+
106
+ **MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
107
+
108
+ **YearPicker**: The prop `onYearPicker` has been removed, you can use `onChange` instead since every change is a year change
109
+
110
+ **DayPicker**: The prop `isDateDisabled` has been removed, you can now use the same validation props as for the other components (`maxDate`, `minDate`, `shouldDisableDate`, `disableFuture` and `disablePast`)
111
+
112
+ #### Changes
113
+
114
+ - [pickers] Add German (de-DE) translations (#4974) @felixh10r
115
+ - [pickers] Support action bar on static pickers and improve typing (#5015) @flaviendelangle
116
+
117
+ ### Docs
118
+
119
+ - [docs] Add docs sections / pages for upcoming features on pickers (#4603) @flaviendelangle
120
+ - [docs] Add docs for filter panel components (#4919) @m4theushw
121
+ - [docs] Explain how to manage focus with `renderCell` (#4254) @alexfauquette
122
+ - [docs] Fix broken links to GitHub source (#5003) @Edwardveb
123
+ - [docs] Fix navigation links (#4956) @oliviertassinari
124
+ - [docs] Fix typo on rows docs (#4952) @jamesRadicl
125
+ - [docs] New WAI-ARIA guidelines location (#4957) @oliviertassinari
126
+ - [docs] Add "Slots" section to the right nav in the API pages (#4993) @DanailH
127
+ - [docs] Fix docs feedback widget not working (#4905) @cherniavskii
128
+ - [docs] Replace custom notes and warning with callouts (#5008) @flaviendelangle
129
+
130
+ ### Core
131
+
132
+ - [core] Avoid Order ID to refer to GitHub issues/PRs (#5005) @oliviertassinari
133
+ - [core] Improve the workflow for incomplete issues (#5012) @mnajdova
134
+ - [core] Remove dead code on row grouping tree creation (#4945) @flaviendelangle
135
+ - [core] Use new cache api for the row grouping last model tracking (#4980) @flaviendelangle
136
+ - [core] Ensure that PRs have atleast 1 label (#5011) @DanailH
137
+ - [core] Fix trailing-space @oliviertassinari
138
+ - [core] Stop Renovate PR updates when PR is on hold (#5020) @cherniavskii
139
+ - [license] Remove support for UTF-8 (#4893) @oliviertassinari
140
+ - [license] Tweak error messages (#4907) @mbrookes
141
+ - [test] Skip Safari and Firefox on broken tests (#4994) @alexfauquette
142
+ - [test] Make argos screenshots stable (#5061) @m4theushw
143
+
144
+ ## v5.11.1
145
+
146
+ _May 20, 2022_
147
+
148
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
149
+
150
+ - 🌍 Support localization on the date and time picker components (#4517) @alexfauquette
151
+
152
+ Texts can be translated in the pickers components, similar to what can be done in the data grid component. Check the [documentation](https://mui.com/x/react-date-pickers/localization/) for more information.
153
+
154
+ - 📃 Add support for column spanning when exporting to Excel (#4830) @cherniavskii
155
+
156
+ <img src="https://user-images.githubusercontent.com/13808724/167691417-bf6baeb9-d409-4134-acb6-aadaf6434de9.png" width="800">
157
+
158
+ - 🐞 Bugs fixes
159
+
160
+ ### `@mui/x-data-grid@v5.11.1` / `@mui/x-data-grid-pro@v5.11.1` / `@mui/x-data-grid-premium@v5.11.1`
161
+
162
+ #### Changes
163
+
164
+ - [DataGrid] Add a CSS class corresponding to current density (#4858) @m4theushw
165
+ - [DataGrid] Execute the pipe-processors in their initialization order (#4913) @flaviendelangle
166
+ - [DataGrid] Fix rendering of the no rows overlay when the `loading` prop is changed (#4910) @m4theushw
167
+ - [DataGridPremium] Add `exceljs` to the dependencies (#4939) @alexfauquette
168
+ - [DataGridPremium] Support column spanning in the Excel export (#4830) @cherniavskii
169
+ - [l10n] Improve Russian (ru-RU) locale (#4864) @arvkonstantin
170
+
171
+ ### `@mui/x-date-pickers@5.0.0-alpha.4` / `@mui/x-date-pickers-pro@5.0.0-alpha.4`
172
+
173
+ #### Breaking changes
174
+
175
+ - The props related to the action bar buttons have been removed (`clearable`, `showTodayButton`, `cancelText`, `okText`)
176
+
177
+ To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
178
+
179
+ ```jsx
180
+ <DatePicker
181
+ componentsProps={{
182
+ actionBar: {
183
+ // The actions will be the same between desktop and mobile
184
+ actions: ['clear'],
185
+
186
+ // The actions will be different between desktop and mobile
187
+ actions: (variant) => (variant === 'desktop' ? [] : ['clear']),
188
+ },
189
+ }}
190
+ />
191
+ ```
192
+
193
+ The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
194
+ By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
195
+
196
+ If you need other actions, you can provide your own component to the `ActionBar` component slot
197
+
198
+ ```jsx
199
+ <DatePicker components={{ ActionBar: CustomActionBar }} />
200
+ ```
201
+
202
+ #### Changes
203
+
204
+ - [DatePicker] Fix keyboard accessibility for first and last year (#4807) @alexfauquette
205
+ - [pickers] Add component slot for action bar (#4778) @alexfauquette
206
+ - [pickers] Add l10n support (#4517) @alexfauquette
207
+ - [pickers] Close Popper when pressing <kbd>Esc</kbd> inside a modal (#4499) @alexfauquette
208
+ - [pickers] Support class slots on toolbar components (#4855) @flaviendelangle
209
+ - [TimePicker] Fix time validation when current date is `null` (#4867) @flaviendelangle
210
+
211
+ ### Docs
212
+
213
+ - [docs] Add 301 redirect for columns page (#4940) @alexfauquette
214
+ - [docs] Avoid confusion with license key installation (#4891) @oliviertassinari
215
+ - [docs] Complete the instructions for pickers installation in readme (#4852) @alexfauquette
216
+ - [docs] Disable ads on paid-only pages (#4842) @flaviendelangle
217
+ - [docs] Don't redirect to localized doc on deploy preview (#4818) @m4theushw
218
+ - [docs] Limit `LICENSE` file to 80 char per line (#4873) @oliviertassinari
219
+ - [docs] Typo on OrderId @oliviertassinari
220
+ - [docs] Update feature comparison table (#4918) @cherniavskii
221
+
222
+ ### Core
223
+
224
+ - [core] Add new script to generate tree data rows from file tree (#4902) @flaviendelangle
225
+ - [core] Fix code style (#4874) @oliviertassinari
226
+ - [core] Fix React 18 peer dependency (#4908) @oliviertassinari
227
+ - [core] Fix link to the LICENSE file (#4875) @oliviertassinari
228
+ - [core] Fix transitive babel dependency (#4793) @oliviertassinari
229
+ - [core] New pipe processing `rowHydration` (#4896) @flaviendelangle
230
+ - [core] Remove dead code for the docs (#4791) @oliviertassinari
231
+ - [core] Run `yarn prettier` @oliviertassinari
232
+ - [core] Polishes on `CHANGELOG.md` (#4876) @oliviertassinari
233
+ - [core] Simplify rows cache management (#4933) @flaviendelangle
234
+ - [core] Use internal icons for quick filter (#4912) @alexfauquette
235
+
6
236
  ## v5.11.0
7
237
 
8
238
  _May 13, 2022_
9
239
 
10
240
  We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
241
 
12
- - 🚀 Premium plan release
13
-
14
- We’re happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)!
15
- With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
242
+ - 🚀 **Premium plan release**. We're happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)! With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
16
243
 
17
244
  This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
18
245
 
19
- If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows.
20
- Note that the experimental flag is not required anymore to use the row grouping.
246
+ If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows. Note that the experimental flag is not required anymore to use the row grouping.
21
247
 
22
248
  ```diff
23
249
  -import { DataGridPro } from '@mui/x-data-grid-pro';
@@ -29,16 +255,11 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
29
255
 
30
256
  For more information about the revised pricing model please have a look at the [blog post](https://mui.com/blog/premium-plan-release/#the-new-licensing-model).
31
257
 
32
- - 👔 Add Excel export
33
-
34
- - 🔎 Quick filtering
35
-
36
- You can now add a quick filtering search bar to your grid.
37
- To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar.
258
+ - 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
38
259
 
39
- More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/#quick-filter)
260
+ - 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/#quick-filter).
40
261
 
41
- ![image](https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png)
262
+ <img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
42
263
 
43
264
  - 🐞 Bugs fixes
44
265
 
@@ -46,7 +267,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
46
267
 
47
268
  #### Breaking changes
48
269
 
49
- - Moving row grouping to premium package
270
+ - Move row grouping to the premium package (#4223) @flaviendelangle
50
271
 
51
272
  The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
52
273
 
@@ -76,7 +297,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
76
297
 
77
298
  #### Breaking changes
78
299
 
79
- - Rework the auto-closing behavior of the pickers.
300
+ - Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
80
301
 
81
302
  The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
82
303
  The default behavior remains the same (close after the last step on desktop but not on mobile).
@@ -1,26 +1,24 @@
1
1
  import * as React from 'react';
2
- import { ExportedMonthPickerProps } from '../MonthPicker/MonthPicker';
3
2
  import { ExportedDayPickerProps } from './DayPicker';
4
3
  import { PickerOnChangeFn } from '../internals/hooks/useViews';
5
4
  import { ExportedCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from './PickersCalendarHeader';
6
- import { ExportedYearPickerProps } from '../YearPicker/YearPicker';
7
5
  import { CalendarPickerView } from '../internals/models';
8
6
  import { CalendarPickerClasses } from './calendarPickerClasses';
7
+ import { MonthValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
9
8
  export interface CalendarPickerSlotsComponent extends PickersCalendarHeaderSlotsComponent {
10
9
  }
11
10
  export interface CalendarPickerSlotsComponentsProps extends PickersCalendarHeaderSlotsComponentsProps {
12
11
  }
13
- export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate>, ExportedYearPickerProps<TDate>, ExportedMonthPickerProps<TDate>, ExportedCalendarHeaderProps<TDate> {
12
+ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, ExportedCalendarHeaderProps<TDate> {
14
13
  className?: string;
15
14
  classes?: Partial<CalendarPickerClasses>;
16
15
  /**
17
- * The components used for each slot.
18
- * Either a string to use an HTML element or a component.
16
+ * Overrideable components.
19
17
  * @default {}
20
18
  */
21
19
  components?: Partial<CalendarPickerSlotsComponent>;
22
20
  /**
23
- * The props used for each slot inside.
21
+ * The props used for each component slot.
24
22
  * @default {}
25
23
  */
26
24
  componentsProps?: Partial<CalendarPickerSlotsComponentsProps>;
@@ -34,22 +32,6 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
34
32
  * @default false
35
33
  */
36
34
  disabled?: boolean;
37
- /**
38
- * @default false
39
- */
40
- disableFuture?: boolean;
41
- /**
42
- * @default false
43
- */
44
- disablePast?: boolean;
45
- /**
46
- * Max selectable date. @DateIOType
47
- */
48
- maxDate?: TDate;
49
- /**
50
- * Min selectable date. @DateIOType
51
- */
52
- minDate?: TDate;
53
35
  /**
54
36
  * Callback fired on view change.
55
37
  * @param {CalendarPickerView} view The new view.
@@ -80,13 +62,6 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
80
62
  * @default () => <span data-mui-test="loading-progress">...</span>
81
63
  */
82
64
  renderLoading?: () => React.ReactNode;
83
- /**
84
- * Disable specific date. @DateIOType
85
- * @template TDate
86
- * @param {TDate} day The date to check.
87
- * @returns {boolean} If `true` the day will be disabled.
88
- */
89
- shouldDisableDate?: (day: TDate) => boolean;
90
65
  /**
91
66
  * Controlled open view.
92
67
  */
@@ -96,8 +71,21 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
96
71
  * @default ['year', 'day']
97
72
  */
98
73
  views?: readonly CalendarPickerView[];
74
+ /**
75
+ * Callback firing on year change @DateIOType.
76
+ * @template TDate
77
+ * @param {TDate} year The new year.
78
+ */
79
+ onYearChange?: (year: TDate) => void;
80
+ /**
81
+ * Callback firing on month change @DateIOType.
82
+ * @template TDate
83
+ * @param {TDate} month The new month.
84
+ * @returns {void|Promise} -
85
+ */
86
+ onMonthChange?: (month: TDate) => void | Promise<void>;
99
87
  }
100
- export declare type ExportedCalendarPickerProps<TDate> = Omit<CalendarPickerProps<TDate>, 'date' | 'view' | 'views' | 'openTo' | 'onChange' | 'changeView' | 'slideDirection' | 'currentMonth' | 'className' | 'classes'>;
88
+ export declare type ExportedCalendarPickerProps<TDate> = Omit<CalendarPickerProps<TDate>, 'date' | 'view' | 'views' | 'openTo' | 'onChange' | 'changeView' | 'slideDirection' | 'currentMonth' | 'className' | 'classes' | 'components' | 'componentsProps'>;
101
89
  declare type CalendarPickerComponent = (<TDate>(props: CalendarPickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
102
90
  propTypes?: any;
103
91
  };
@@ -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 = ["autoFocus", "onViewChange", "date", "disableFuture", "disablePast", "defaultCalendarMonth", "loading", "maxDate", "minDate", "onChange", "onMonthChange", "reduceAnimations", "renderLoading", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly"];
3
+ const _excluded = ["autoFocus", "onViewChange", "date", "disableFuture", "disablePast", "defaultCalendarMonth", "loading", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "renderLoading", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -59,6 +59,8 @@ const CalendarPickerViewTransitionContainer = styled(PickersFadeTransitionGroup,
59
59
  * - [CalendarPicker API](https://mui.com/x/api/date-pickers/calendar-picker/)
60
60
  */
61
61
  const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inProps, ref) {
62
+ const utils = useUtils();
63
+ const defaultDates = useDefaultDates();
62
64
  const props = useThemeProps({
63
65
  props: inProps,
64
66
  name: 'MuiCalendarPicker'
@@ -68,13 +70,12 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
68
70
  autoFocus,
69
71
  onViewChange,
70
72
  date,
71
- disableFuture = false,
72
- disablePast = false,
73
+ disableFuture,
74
+ disablePast,
73
75
  defaultCalendarMonth,
74
76
  loading = false,
75
- maxDate: maxDateProp,
76
- minDate: minDateProp,
77
77
  onChange,
78
+ onYearChange,
78
79
  onMonthChange,
79
80
  reduceAnimations = defaultReduceAnimations,
80
81
  renderLoading = () => /*#__PURE__*/_jsx("span", {
@@ -88,17 +89,16 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
88
89
  openTo = 'day',
89
90
  className,
90
91
  disabled,
91
- readOnly
92
+ readOnly,
93
+ minDate = defaultDates.minDate,
94
+ maxDate = defaultDates.maxDate
92
95
  } = props,
93
96
  other = _objectWithoutPropertiesLoose(props, _excluded);
94
97
 
95
- const utils = useUtils();
96
- const defaultDates = useDefaultDates();
97
- const minDate = minDateProp != null ? minDateProp : defaultDates.minDate;
98
- const maxDate = maxDateProp != null ? maxDateProp : defaultDates.maxDate;
99
98
  const {
100
99
  openView,
101
- setOpenView
100
+ setOpenView,
101
+ openNext
102
102
  } = useViews({
103
103
  view,
104
104
  views,
@@ -110,8 +110,8 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
110
110
  calendarState,
111
111
  changeFocusedDay,
112
112
  changeMonth,
113
- isDateDisabled,
114
113
  handleChangeMonth,
114
+ isDateDisabled,
115
115
  onMonthSwitchingAnimationEnd
116
116
  } = useCalendarState({
117
117
  date,
@@ -124,6 +124,54 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
124
124
  disablePast,
125
125
  disableFuture
126
126
  });
127
+ const handleDateMonthChange = React.useCallback((newDate, selectionState) => {
128
+ const startOfMonth = utils.startOfMonth(newDate);
129
+ const endOfMonth = utils.endOfMonth(newDate);
130
+ const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({
131
+ utils,
132
+ date: newDate,
133
+ minDate: utils.isBefore(minDate, startOfMonth) ? startOfMonth : minDate,
134
+ maxDate: utils.isAfter(maxDate, endOfMonth) ? endOfMonth : maxDate,
135
+ disablePast,
136
+ disableFuture,
137
+ isDateDisabled
138
+ }) : newDate;
139
+
140
+ if (closestEnabledDate) {
141
+ onChange(closestEnabledDate, selectionState);
142
+ onMonthChange == null ? void 0 : onMonthChange(startOfMonth);
143
+ } else {
144
+ openNext();
145
+ changeMonth(startOfMonth);
146
+ }
147
+
148
+ changeFocusedDay(closestEnabledDate);
149
+ }, [changeFocusedDay, disableFuture, disablePast, isDateDisabled, maxDate, minDate, onChange, onMonthChange, changeMonth, openNext, utils]); // TODO: Use same behavior as `handleDateMonthChange` to avoid selecting a date in another year.
150
+ // Needs startOfYear / endOfYear methods in adapter.
151
+
152
+ const handleDateYearChange = React.useCallback((newDate, selectionState) => {
153
+ const startOfYear = utils.startOfYear(newDate);
154
+ const endOfYear = utils.endOfYear(newDate);
155
+ const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({
156
+ utils,
157
+ date: newDate,
158
+ minDate: utils.isBefore(minDate, startOfYear) ? startOfYear : minDate,
159
+ maxDate: utils.isAfter(maxDate, endOfYear) ? endOfYear : maxDate,
160
+ disablePast,
161
+ disableFuture,
162
+ isDateDisabled
163
+ }) : newDate;
164
+
165
+ if (closestEnabledDate) {
166
+ onChange(closestEnabledDate, selectionState);
167
+ onYearChange == null ? void 0 : onYearChange(closestEnabledDate);
168
+ } else {
169
+ openNext();
170
+ changeMonth(startOfYear);
171
+ }
172
+
173
+ changeFocusedDay(closestEnabledDate);
174
+ }, [changeFocusedDay, disableFuture, disablePast, isDateDisabled, maxDate, minDate, onChange, onYearChange, openNext, utils, changeMonth]);
127
175
  const onSelectedDayChange = React.useCallback((day, isFinish) => {
128
176
  if (date && day) {
129
177
  // If there is a date already selected, then we want to keep its time
@@ -141,7 +189,7 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
141
189
  maxDate,
142
190
  disablePast,
143
191
  disableFuture,
144
- shouldDisableDate: isDateDisabled
192
+ isDateDisabled
145
193
  });
146
194
  onChange(closestEnabledDate, 'partial');
147
195
  } // This call is too expensive to run it on each prop change.
@@ -157,19 +205,12 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
157
205
 
158
206
  const ownerState = props;
159
207
  const classes = useUtilityClasses(ownerState);
160
- const monthPickerProps = {
161
- className,
162
- date,
163
- disabled,
208
+ const baseDateValidationProps = {
164
209
  disablePast,
165
210
  disableFuture,
166
- onChange,
167
- minDate,
168
211
  maxDate,
169
- shouldDisableMonth,
170
- onMonthChange,
171
- readOnly
172
- }; // When disable, limit the view to the selected date
212
+ minDate
213
+ }; // When disabled, limit the view to the selected date
173
214
 
174
215
  const minDateWithDisabled = disabled && date || minDate;
175
216
  const maxDateWithDisabled = disabled && date || maxDate;
@@ -198,31 +239,32 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
198
239
  transKey: openView,
199
240
  ownerState: ownerState,
200
241
  children: /*#__PURE__*/_jsxs("div", {
201
- children: [openView === 'year' && /*#__PURE__*/_jsx(YearPicker, _extends({}, other, {
242
+ children: [openView === 'year' && /*#__PURE__*/_jsx(YearPicker, _extends({}, other, baseDateValidationProps, {
202
243
  autoFocus: autoFocus,
203
244
  date: date,
204
- onChange: onChange,
205
- minDate: minDate,
206
- maxDate: maxDate,
207
- disableFuture: disableFuture,
208
- disablePast: disablePast,
209
- isDateDisabled: isDateDisabled,
245
+ onChange: handleDateYearChange,
210
246
  shouldDisableYear: shouldDisableYear,
211
- onFocusedDayChange: changeFocusedDay,
212
247
  disabled: disabled,
213
248
  readOnly: readOnly
214
- })), openView === 'month' && /*#__PURE__*/_jsx(MonthPicker, _extends({}, monthPickerProps)), openView === 'day' && /*#__PURE__*/_jsx(DayPicker, _extends({}, other, calendarState, {
249
+ })), openView === 'month' && /*#__PURE__*/_jsx(MonthPicker, _extends({}, baseDateValidationProps, {
250
+ className: className,
251
+ date: date,
252
+ onChange: handleDateMonthChange,
253
+ disabled: disabled,
254
+ readOnly: readOnly,
255
+ shouldDisableMonth: shouldDisableMonth
256
+ })), openView === 'day' && /*#__PURE__*/_jsx(DayPicker, _extends({}, other, calendarState, baseDateValidationProps, {
215
257
  autoFocus: autoFocus,
216
258
  onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
217
259
  onFocusedDayChange: changeFocusedDay,
218
260
  reduceAnimations: reduceAnimations,
219
261
  selectedDays: [date],
220
262
  onSelectedDaysChange: onSelectedDayChange,
221
- isDateDisabled: isDateDisabled,
222
263
  loading: loading,
223
264
  renderLoading: renderLoading,
224
265
  disabled: disabled,
225
- readOnly: readOnly
266
+ readOnly: readOnly,
267
+ shouldDisableDate: shouldDisableDate
226
268
  }))]
227
269
  })
228
270
  })]
@@ -238,14 +280,13 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
238
280
  className: PropTypes.string,
239
281
 
240
282
  /**
241
- * The components used for each slot.
242
- * Either a string to use an HTML element or a component.
283
+ * Overrideable components.
243
284
  * @default {}
244
285
  */
245
286
  components: PropTypes.object,
246
287
 
247
288
  /**
248
- * The props used for each slot inside.
289
+ * The props used for each component slot.
249
290
  * @default {}
250
291
  */
251
292
  componentsProps: PropTypes.object,
@@ -263,17 +304,19 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
263
304
  disabled: PropTypes.bool,
264
305
 
265
306
  /**
307
+ * If `true` future days are disabled.
266
308
  * @default false
267
309
  */
268
310
  disableFuture: PropTypes.bool,
269
311
 
270
312
  /**
271
- * If `true`, todays date is rendering without highlighting with circle.
313
+ * If `true`, today's date is rendering without highlighting with circle.
272
314
  * @default false
273
315
  */
274
316
  disableHighlightToday: PropTypes.bool,
275
317
 
276
318
  /**
319
+ * If `true` past days are disabled.
277
320
  * @default false
278
321
  */
279
322
  disablePast: PropTypes.bool,
@@ -282,11 +325,13 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
282
325
  * Get aria-label text for switching between views button.
283
326
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
284
327
  * @returns {string} The label of the view.
328
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
285
329
  */
286
330
  getViewSwitchingButtonText: PropTypes.func,
287
331
 
288
332
  /**
289
333
  * Left arrow icon aria-label text.
334
+ * @deprecated
290
335
  */
291
336
  leftArrowButtonText: PropTypes.string,
292
337
 
@@ -298,12 +343,12 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
298
343
  loading: PropTypes.bool,
299
344
 
300
345
  /**
301
- * Max selectable date. @DateIOType
346
+ * Maximal selectable date. @DateIOType
302
347
  */
303
348
  maxDate: PropTypes.any,
304
349
 
305
350
  /**
306
- * Min selectable date. @DateIOType
351
+ * Minimal selectable date. @DateIOType
307
352
  */
308
353
  minDate: PropTypes.any,
309
354
 
@@ -315,7 +360,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
315
360
  /**
316
361
  * Callback firing on month change @DateIOType.
317
362
  * @template TDate
318
- * @param {TDate} month The new year.
363
+ * @param {TDate} month The new month.
319
364
  * @returns {void|Promise} -
320
365
  */
321
366
  onMonthChange: PropTypes.func,
@@ -370,14 +415,15 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
370
415
 
371
416
  /**
372
417
  * Right arrow icon aria-label text.
418
+ * @deprecated
373
419
  */
374
420
  rightArrowButtonText: PropTypes.string,
375
421
 
376
422
  /**
377
423
  * Disable specific date. @DateIOType
378
424
  * @template TDate
379
- * @param {TDate} day The date to check.
380
- * @returns {boolean} If `true` the day will be disabled.
425
+ * @param {TDate} day The date to test.
426
+ * @returns {boolean} Returns `true` if the date should be disabled.
381
427
  */
382
428
  shouldDisableDate: PropTypes.func,
383
429
 
@@ -395,7 +441,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
395
441
  * Works like `shouldDisableDate` but for year selection view @DateIOType.
396
442
  * @template TDate
397
443
  * @param {TDate} year The year to test.
398
- * @returns {boolean} Return `true` if the year should be disabled.
444
+ * @returns {boolean} Returns `true` if the year should be disabled.
399
445
  */
400
446
  shouldDisableYear: PropTypes.func,
401
447