@mui/x-date-pickers 5.0.2 → 6.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +212 -3
  2. package/CalendarPicker/CalendarPicker.d.ts +8 -2
  3. package/CalendarPicker/CalendarPicker.js +54 -71
  4. package/CalendarPicker/DayPicker.d.ts +2 -2
  5. package/CalendarPicker/DayPicker.js +6 -2
  6. package/CalendarPicker/PickersCalendarHeader.d.ts +3 -10
  7. package/CalendarPicker/PickersCalendarHeader.js +7 -20
  8. package/CalendarPicker/useCalendarState.d.ts +2 -2
  9. package/CalendarPicker/useCalendarState.js +7 -7
  10. package/ClockPicker/Clock.d.ts +9 -4
  11. package/ClockPicker/Clock.js +13 -13
  12. package/ClockPicker/ClockNumbers.d.ts +3 -3
  13. package/ClockPicker/ClockNumbers.js +2 -2
  14. package/ClockPicker/ClockPicker.d.ts +8 -58
  15. package/ClockPicker/ClockPicker.js +52 -128
  16. package/ClockPicker/ClockPointer.d.ts +1 -1
  17. package/ClockPicker/ClockPointer.js +4 -4
  18. package/DateField/useDateField.d.ts +1 -1
  19. package/DateField/useDateField.js +5 -1
  20. package/DatePicker/DatePicker.js +10 -20
  21. package/DateTimePicker/DateTimePicker.js +10 -39
  22. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
  23. package/DesktopDatePicker/DesktopDatePicker.js +14 -22
  24. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
  25. package/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  26. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
  27. package/DesktopTimePicker/DesktopTimePicker.js +9 -21
  28. package/LocalizationProvider/LocalizationProvider.d.ts +10 -11
  29. package/LocalizationProvider/LocalizationProvider.js +31 -24
  30. package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
  31. package/MobileDatePicker/MobileDatePicker.js +14 -22
  32. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
  33. package/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  34. package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
  35. package/MobileTimePicker/MobileTimePicker.js +9 -21
  36. package/MonthPicker/MonthPicker.d.ts +12 -9
  37. package/MonthPicker/MonthPicker.js +60 -57
  38. package/MonthPicker/PickersMonth.d.ts +10 -7
  39. package/MonthPicker/PickersMonth.js +76 -44
  40. package/MonthPicker/pickersMonthClasses.d.ts +9 -1
  41. package/MonthPicker/pickersMonthClasses.js +1 -1
  42. package/PickersDay/PickersDay.d.ts +0 -6
  43. package/PickersDay/PickersDay.js +0 -5
  44. package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
  45. package/StaticDatePicker/StaticDatePicker.js +17 -23
  46. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
  47. package/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  48. package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
  49. package/StaticTimePicker/StaticTimePicker.js +17 -22
  50. package/TimePicker/TimePicker.js +5 -19
  51. package/YearPicker/PickersYear.d.ts +7 -6
  52. package/YearPicker/PickersYear.js +34 -23
  53. package/YearPicker/YearPicker.d.ts +21 -4
  54. package/YearPicker/YearPicker.js +109 -49
  55. package/YearPicker/pickersYearClasses.d.ts +1 -1
  56. package/index.js +1 -1
  57. package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  58. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +20 -6
  59. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
  60. package/internals/components/PickerStaticWrapper/index.d.ts +1 -1
  61. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +3 -0
  62. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +166 -0
  63. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +63 -0
  64. package/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  65. package/internals/components/PickersArrowSwitcher/index.d.ts +2 -0
  66. package/internals/components/PickersArrowSwitcher/index.js +1 -0
  67. package/internals/components/{pickersArrowSwitcherClasses.d.ts → PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts} +0 -0
  68. package/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  69. package/internals/components/PickersPopper.d.ts +2 -6
  70. package/internals/components/PickersPopper.js +5 -5
  71. package/internals/components/PickersToolbar.d.ts +1 -1
  72. package/internals/components/PickersToolbar.js +1 -2
  73. package/internals/components/PickersToolbarText.d.ts +1 -1
  74. package/internals/components/wrappers/DesktopTooltipWrapper.d.ts +1 -1
  75. package/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  76. package/internals/components/wrappers/DesktopWrapper.d.ts +8 -3
  77. package/internals/components/wrappers/DesktopWrapper.js +26 -21
  78. package/internals/components/wrappers/MobileWrapper.d.ts +8 -3
  79. package/internals/components/wrappers/MobileWrapper.js +23 -18
  80. package/internals/hooks/useField/useField.interfaces.d.ts +0 -1
  81. package/internals/hooks/useField/useField.js +19 -23
  82. package/internals/hooks/useField/useField.utils.js +10 -2
  83. package/internals/hooks/useUtils.d.ts +5 -2
  84. package/internals/hooks/useUtils.js +11 -2
  85. package/internals/hooks/validation/useDateValidation.d.ts +4 -4
  86. package/internals/hooks/validation/useDateValidation.js +12 -2
  87. package/internals/index.d.ts +5 -5
  88. package/internals/index.js +3 -3
  89. package/internals/models/muiPickersAdapter.d.ts +12 -7
  90. package/internals/models/props/baseToolbarProps.d.ts +0 -8
  91. package/internals/models/props/staticPickerProps.d.ts +2 -8
  92. package/legacy/CalendarPicker/CalendarPicker.js +52 -69
  93. package/legacy/CalendarPicker/DayPicker.js +6 -2
  94. package/legacy/CalendarPicker/PickersCalendarHeader.js +7 -20
  95. package/legacy/CalendarPicker/useCalendarState.js +7 -7
  96. package/legacy/ClockPicker/Clock.js +13 -13
  97. package/legacy/ClockPicker/ClockNumbers.js +2 -2
  98. package/legacy/ClockPicker/ClockPicker.js +57 -133
  99. package/legacy/ClockPicker/ClockPointer.js +4 -4
  100. package/legacy/DateField/useDateField.js +5 -1
  101. package/legacy/DatePicker/DatePicker.js +10 -20
  102. package/legacy/DateTimePicker/DateTimePicker.js +10 -39
  103. package/legacy/DesktopDatePicker/DesktopDatePicker.js +13 -21
  104. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  105. package/legacy/DesktopTimePicker/DesktopTimePicker.js +8 -20
  106. package/legacy/LocalizationProvider/LocalizationProvider.js +28 -23
  107. package/legacy/MobileDatePicker/MobileDatePicker.js +13 -21
  108. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  109. package/legacy/MobileTimePicker/MobileTimePicker.js +8 -20
  110. package/legacy/MonthPicker/MonthPicker.js +67 -62
  111. package/legacy/MonthPicker/PickersMonth.js +89 -57
  112. package/legacy/MonthPicker/pickersMonthClasses.js +1 -1
  113. package/legacy/PickersDay/PickersDay.js +0 -5
  114. package/legacy/StaticDatePicker/StaticDatePicker.js +17 -24
  115. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +17 -43
  116. package/legacy/StaticTimePicker/StaticTimePicker.js +17 -23
  117. package/legacy/TimePicker/TimePicker.js +5 -19
  118. package/legacy/YearPicker/PickersYear.js +35 -25
  119. package/legacy/YearPicker/YearPicker.js +111 -51
  120. package/legacy/index.js +1 -1
  121. package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  122. package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +41 -24
  123. package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +180 -0
  124. package/legacy/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  125. package/legacy/internals/components/PickersArrowSwitcher/index.js +1 -0
  126. package/legacy/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  127. package/legacy/internals/components/PickersPopper.js +5 -5
  128. package/legacy/internals/components/PickersToolbar.js +1 -2
  129. package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  130. package/legacy/internals/components/wrappers/DesktopWrapper.js +26 -21
  131. package/legacy/internals/components/wrappers/MobileWrapper.js +22 -17
  132. package/legacy/internals/hooks/useField/useField.js +21 -23
  133. package/legacy/internals/hooks/useField/useField.utils.js +10 -2
  134. package/legacy/internals/hooks/useUtils.js +13 -2
  135. package/legacy/internals/hooks/validation/useDateValidation.js +12 -2
  136. package/legacy/internals/index.js +3 -3
  137. package/legacy/locales/faIR.js +52 -0
  138. package/legacy/locales/fiFI.js +61 -0
  139. package/legacy/locales/index.js +2 -0
  140. package/legacy/locales/isIS.js +0 -1
  141. package/locales/faIR.d.ts +35 -0
  142. package/locales/faIR.js +36 -0
  143. package/locales/fiFI.d.ts +35 -0
  144. package/locales/fiFI.js +45 -0
  145. package/locales/index.d.ts +2 -0
  146. package/locales/index.js +2 -0
  147. package/locales/isIS.js +0 -1
  148. package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  149. package/modern/CalendarPicker/CalendarPicker.js +54 -71
  150. package/modern/CalendarPicker/DayPicker.js +6 -2
  151. package/modern/CalendarPicker/PickersCalendarHeader.js +7 -20
  152. package/modern/CalendarPicker/useCalendarState.js +7 -7
  153. package/modern/ClockPicker/Clock.js +13 -13
  154. package/modern/ClockPicker/ClockNumbers.js +2 -2
  155. package/modern/ClockPicker/ClockPicker.js +52 -128
  156. package/modern/ClockPicker/ClockPointer.js +4 -4
  157. package/modern/DateField/useDateField.js +5 -1
  158. package/modern/DatePicker/DatePicker.js +10 -20
  159. package/modern/DateTimePicker/DateTimePicker.js +10 -39
  160. package/modern/DesktopDatePicker/DesktopDatePicker.js +14 -22
  161. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  162. package/modern/DesktopTimePicker/DesktopTimePicker.js +9 -21
  163. package/modern/LocalizationProvider/LocalizationProvider.js +29 -24
  164. package/modern/MobileDatePicker/MobileDatePicker.js +14 -22
  165. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  166. package/modern/MobileTimePicker/MobileTimePicker.js +9 -21
  167. package/modern/MonthPicker/MonthPicker.js +60 -57
  168. package/modern/MonthPicker/PickersMonth.js +76 -44
  169. package/modern/MonthPicker/pickersMonthClasses.js +1 -1
  170. package/modern/PickersDay/PickersDay.js +0 -5
  171. package/modern/StaticDatePicker/StaticDatePicker.js +17 -23
  172. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  173. package/modern/StaticTimePicker/StaticTimePicker.js +17 -22
  174. package/modern/TimePicker/TimePicker.js +5 -19
  175. package/modern/YearPicker/PickersYear.js +34 -23
  176. package/modern/YearPicker/YearPicker.js +109 -49
  177. package/modern/index.js +1 -1
  178. package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  179. package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
  180. package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +164 -0
  181. package/modern/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  182. package/modern/internals/components/PickersArrowSwitcher/index.js +1 -0
  183. package/modern/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  184. package/modern/internals/components/PickersPopper.js +5 -5
  185. package/modern/internals/components/PickersToolbar.js +1 -2
  186. package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  187. package/modern/internals/components/wrappers/DesktopWrapper.js +26 -21
  188. package/modern/internals/components/wrappers/MobileWrapper.js +23 -18
  189. package/modern/internals/hooks/useField/useField.js +19 -21
  190. package/modern/internals/hooks/useField/useField.utils.js +10 -2
  191. package/modern/internals/hooks/useUtils.js +11 -2
  192. package/modern/internals/hooks/validation/useDateValidation.js +12 -2
  193. package/modern/internals/index.js +3 -3
  194. package/modern/locales/faIR.js +36 -0
  195. package/modern/locales/fiFI.js +45 -0
  196. package/modern/locales/index.js +2 -0
  197. package/modern/locales/isIS.js +0 -1
  198. package/node/CalendarPicker/CalendarPicker.js +54 -71
  199. package/node/CalendarPicker/DayPicker.js +5 -1
  200. package/node/CalendarPicker/PickersCalendarHeader.js +7 -21
  201. package/node/CalendarPicker/useCalendarState.js +6 -6
  202. package/node/ClockPicker/Clock.js +12 -12
  203. package/node/ClockPicker/ClockNumbers.js +2 -2
  204. package/node/ClockPicker/ClockPicker.js +52 -129
  205. package/node/ClockPicker/ClockPointer.js +4 -4
  206. package/node/DateField/useDateField.js +5 -1
  207. package/node/DatePicker/DatePicker.js +10 -20
  208. package/node/DateTimePicker/DateTimePicker.js +10 -39
  209. package/node/DesktopDatePicker/DesktopDatePicker.js +14 -22
  210. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  211. package/node/DesktopTimePicker/DesktopTimePicker.js +9 -21
  212. package/node/LocalizationProvider/LocalizationProvider.js +31 -25
  213. package/node/MobileDatePicker/MobileDatePicker.js +14 -22
  214. package/node/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  215. package/node/MobileTimePicker/MobileTimePicker.js +9 -21
  216. package/node/MonthPicker/MonthPicker.js +61 -58
  217. package/node/MonthPicker/PickersMonth.js +71 -43
  218. package/node/MonthPicker/pickersMonthClasses.js +1 -1
  219. package/node/PickersDay/PickersDay.js +0 -5
  220. package/node/StaticDatePicker/StaticDatePicker.js +17 -23
  221. package/node/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  222. package/node/StaticTimePicker/StaticTimePicker.js +17 -22
  223. package/node/TimePicker/TimePicker.js +5 -19
  224. package/node/YearPicker/PickersYear.js +33 -22
  225. package/node/YearPicker/YearPicker.js +111 -49
  226. package/node/index.js +1 -1
  227. package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  228. package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +39 -22
  229. package/node/internals/components/{PickersArrowSwitcher.js → PickersArrowSwitcher/PickersArrowSwitcher.js} +102 -58
  230. package/node/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  231. package/node/internals/components/PickersArrowSwitcher/index.js +13 -0
  232. package/node/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  233. package/node/internals/components/PickersPopper.js +5 -5
  234. package/node/internals/components/PickersToolbar.js +1 -2
  235. package/node/internals/components/wrappers/DesktopTooltipWrapper.js +30 -24
  236. package/node/internals/components/wrappers/DesktopWrapper.js +27 -21
  237. package/node/internals/components/wrappers/MobileWrapper.js +24 -18
  238. package/node/internals/hooks/useField/useField.js +19 -23
  239. package/node/internals/hooks/useField/useField.utils.js +10 -2
  240. package/node/internals/hooks/useUtils.js +15 -2
  241. package/node/internals/hooks/validation/useDateValidation.js +14 -4
  242. package/node/internals/index.js +8 -2
  243. package/node/locales/faIR.js +45 -0
  244. package/node/locales/fiFI.js +54 -0
  245. package/node/locales/index.js +26 -0
  246. package/node/locales/isIS.js +0 -1
  247. package/package.json +4 -4
  248. package/themeAugmentation/props.d.ts +3 -3
  249. package/internals/components/PickersArrowSwitcher.d.ts +0 -62
  250. package/internals/components/PickersArrowSwitcher.js +0 -124
  251. package/legacy/internals/components/PickersArrowSwitcher.js +0 -128
  252. package/modern/internals/components/PickersArrowSwitcher.js +0 -124
package/CHANGELOG.md CHANGED
@@ -3,6 +3,215 @@
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
+ ## 6.0.0-alpha.0
7
+
8
+ _Sep 22, 2022_
9
+
10
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Add a `localeText` prop to all pickers to customize the translations (#6212) @flaviendelangle
13
+ - 🌍 Add Finnish (fi-FI) locale to the pickers (#6219) @PetroSilenius
14
+ - 🌍 Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
15
+ - 📚 Documentation improvements
16
+ - 🐞 Bugfixes
17
+
18
+ ### `@mui/x-data-grid@v6.0.0-alpha.0` / `@mui/x-data-grid-pro@v6.0.0-alpha.0` / `@mui/x-data-grid-premium@v6.0.0-alpha.0`
19
+
20
+ #### Breaking changes
21
+
22
+ - The deprecated `hide` column property has been removed in favor of the `columnVisibilityModel` prop and initial state.
23
+
24
+ ```diff
25
+ <DataGrid
26
+ columns={[
27
+ field: 'id,
28
+ - hide: true,
29
+ ]}
30
+ + initialState={{
31
+ + columns: {
32
+ + columnVisibilityModel: { id: false },
33
+ + }
34
+ + }}
35
+ />
36
+ ```
37
+
38
+ You can find more information about this new API on our [documentation](https://next.mui.com/x/react-data-grid/column-visibility/).
39
+
40
+ - The `GridEvents` enum is now a TypeScript type.
41
+
42
+ ```diff
43
+ - apiRef.current.subscribeEvent(GridEvents.rowClick', handleRowClick)
44
+ + apiRef.current.subscribeEvent('rowClick', handleRowClick)
45
+ ```
46
+
47
+ #### Changes
48
+
49
+ - [DataGrid] Do not publish `cellFocusOut` event if the row was removed (#6251) @cherniavskii
50
+ - [DataGrid] Fix scroll anchoring with master details (#6054) @oliviertassinari
51
+ - [DataGrid] Improve Polish (pl-PL) locale on the data grid (#6245) @grzegorz-bach
52
+ - [DataGrid] Remove the `GridEvents` enum (#6003) @flaviendelangle
53
+ - [DataGrid] Remove the deprecated `hide` column property (#5999) @flaviendelangle
54
+
55
+ ### `@mui/x-date-pickers@v6.0.0-alpha.0` / `@mui/x-date-pickers-pro@v6.0.0-alpha.0`
56
+
57
+ #### Breaking changes
58
+
59
+ - All the deprecated props that allowed you to set the text displayed in the pickers have been removed.
60
+
61
+ You can now use the `localText` prop available on all picker components:
62
+
63
+ | Removed prop | Property in the new `localText` prop |
64
+ |------------------------------|-----------------------------------------------------------------------------------|
65
+ | `endText` | `end` |
66
+ | `getClockLabelText` | `clockLabelText` |
67
+ | `getHoursClockNumberText` | `hoursClockNumberText` |
68
+ | `getMinutesClockNumberText` | `minutesClockNumberText` |
69
+ | `getSecondsClockNumberText` | `secondsClockNumberText` |
70
+ | `getViewSwitchingButtonText` | `calendarViewSwitchingButtonAriaLabel` |
71
+ | `leftArrowButtonText` | `openPreviousView` (or `previousMonth` when the button changes the visible month) |
72
+ | `rightArrowButtonText` | `openNextView` (or `nextMonth` when the button changes the visible month) |
73
+ | `startText` | `start` |
74
+
75
+ For instance if you want to replace the `startText` / `endText`
76
+
77
+ ```diff
78
+ <DateRangePicker
79
+ - startText="From"
80
+ - endText="To"
81
+ + localeText={{
82
+ + start: 'From',
83
+ + end: 'To',
84
+ + }}
85
+ />
86
+ ```
87
+
88
+ You can find more information about the new api, including how to set those translations on all your components at once in the [documentation](https://next.mui.com/x/react-date-pickers/localization/)
89
+
90
+ - The component slots `LeftArrowButton` and `RightArrowButton` have been renamed `PreviousIconButton` and `NextIconButton` to better describe there usage:
91
+
92
+ ```diff
93
+ <DatePicker
94
+ components={{
95
+ - LeftArrowButton: CustomButton,
96
+ + PreviousIconButton: CustomButton,
97
+
98
+ - RightArrowButton: CustomButton,
99
+ + NextIconButton: CustomButton,
100
+ }}
101
+
102
+ componentsProps={{
103
+ - leftArrowButton: {},
104
+ + previousIconButton: {},
105
+
106
+ - rightArrowButton: {},
107
+ + nextIconButton: {},
108
+ }}
109
+ />
110
+ ```
111
+
112
+ - The `date` prop has been renamed `value` on `MonthPicker` / `YearPicker`, `ClockPicker` and `CalendarPicker`.
113
+
114
+ ```diff
115
+ - <MonthPicker date={dayjs()} onChange={handleMonthChange} />
116
+ + <MonthPicker value={dayjs()} onChange={handleMonthChange} />
117
+
118
+ - <YearPicker date={dayjs()} onChange={handleYearChange} />
119
+ + <YearPicker value={dayjs()} onChange={handleYearChange} />
120
+
121
+ - <ClockPicker date={dayjs()} onChange={handleTimeChange} />
122
+ + <ClockPicker value={dayjs()} onChange={handleTimeChange} />
123
+
124
+ - <CalendarPicker date={dayjs()} onChange={handleDateChange} />
125
+ + <CalendarPicker value={dayjs()} onChange={handleDateChange} />
126
+ ```
127
+
128
+ #### Changes
129
+
130
+ - [CalendarPicker] Don't move to closest enabled date when `props.date` contains a disabled date (#6146) @flaviendelangle
131
+ - [DateRangePicker] Switch to new month when changing the value from the outside (#6166) @flaviendelangle
132
+ - [pickers] Add a `localeText` prop to all pickers to customize the translations (#6212) @flaviendelangle
133
+ - [pickers] Add Finnish (fi-FI) locale to the pickers (#6219) (#6230) @PetroSilenius
134
+ - [pickers] Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
135
+ - [pickers] Allow nested `LocalizationProvider` (#6011) @flaviendelangle
136
+ - [pickers] Clean slots on `PickersArrowSwitcher` component (#5890) @flaviendelangle
137
+ - [pickers] Fix invalid date error when decreasing `DateField` day (#6071) @alexfauquette
138
+ - [pickers] Fix mobile section selection (#6207) @oliviertassinari
139
+ - [pickers] Fix usage with Typescript 4.8 (#6229) @flaviendelangle
140
+ - [pickers] Improve error message when no adapter context is found (#6211) @flaviendelangle
141
+ - [pickers] Remove `valueStr` from the field state (#6142) @flaviendelangle
142
+ - [pickers] Remove remaining deprecated locale props (#6233) @flaviendelangle
143
+ - [pickers] Rename the `date` prop `value` on `MonthPicker` / `YearPicker`, `ClockPicker` and `CalendarPicker` (#6128) @flaviendelangle
144
+ - [pickers] Rename the `onClose` prop of `PickersPopper` `onDismiss` to simplify typing (#6155) @flaviendelangle
145
+ - [pickers] Support the `sx` prop on all public component with a root HTML elements (#5944) @flaviendelangle
146
+ - [pickers] Unify `PickersMonth` and `PickersYear` behaviors (#6034) @flaviendelangle
147
+ - [pickers] Use `shouldDisableMonth` and `shouldDisableYear` for date validation (#6066) @flaviendelangle
148
+ - [YearPicker] Scroll to the current year even with `autoFocus=false` (#6224) @alexfauquette
149
+
150
+ ### Docs
151
+
152
+ - [docs] Add automatic vale check (#5429) @alexfauquette
153
+ - [docs] Add Pro logo in "column ordering" link (#6127) @alexfauquette
154
+ - [docs] Fix 301 link (#6239) @oliviertassinari
155
+ - [docs] Fix broken link (#6163) @alexfauquette
156
+ - [docs] Fix broken links (#6101) @alexfauquette
157
+ - [docs] Fix demonstration date to avoid hydration errors (#6032) @alexfauquette
158
+ - [docs] Fix hidden popper in restore state example (#6191) @heyfirst
159
+ - [docs] Fix invalid links causing 404 & 301 errors (#6105) @oliviertassinari
160
+ - [docs] Fix npm repository url in the pickers `package.json` (#6172) @oliviertassinari
161
+ - [docs] Fix typo in linked issue (#6162) @flaviendelangle
162
+ - [docs] Import `generateUtilityClass` from `@mui/utils` (#6216) @michaldudak
163
+ - [docs] Improve Upgrade plan docs (#6018) @oliviertassinari
164
+ - [docs] Link the OpenSSF Best Practices card (#6171) @oliviertassinari
165
+
166
+ ### Core
167
+
168
+ - [core] Add `v5.17.3` changelog to next branch (#6250) @flaviendelangle
169
+ - [core] Add link to the security page on the `README` (#6073) @oliviertassinari
170
+ - [core] Fix scroll restoration in the docs (#5938) @oliviertassinari
171
+ - [core] Remove the Storybook (#6099) @flaviendelangle
172
+ - [core] Tag release as `next` in NPM (#6256) @m4theushw
173
+ - [core] Update monorepo (#6180) @flaviendelangle
174
+ - [core] Use the `next` branch for Prettier (#6097) @flaviendelangle
175
+ - [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
176
+ - [test] Fix logic to skip column pinning tests (#6133) @m4theushw
177
+ - [test] Hide the date on the print regression test (#6120) @flaviendelangle
178
+ - [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
179
+ - [website] Improve security header @oliviertassinari
180
+
181
+ ## v5.17.4
182
+
183
+ _Sep 22, 2022_
184
+
185
+ We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
186
+
187
+ - 🌍 Add Finnish (fi-FI) locale to the pickers (#6230) @PetroSilenius
188
+ - 🌍 Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
189
+ - 🐞 Bugfixes
190
+
191
+ ### `@mui/x-data-grid@v5.17.4` / `@mui/x-data-grid-pro@v5.17.4` / `@mui/x-data-grid-premium@v5.17.4`
192
+
193
+ #### Changes
194
+
195
+ - [DataGrid] Do not publish `cellFocusOut` event if the row was removed (#6251) @cherniavskii
196
+ - [DataGrid] Improve Polish (pl-PL) locale on the data grid (#6245) @grzegorz-bach
197
+
198
+ ### `@mui/x-date-pickers@v5.0.3` / `@mui/x-date-pickers-pro@v5.0.3`
199
+
200
+ #### Changes
201
+
202
+ - [pickers] Add Finnish (fi-FI) locale to pickers (#6219) (#6230) @PetroSilenius
203
+ - [pickers] Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
204
+ - [pickers] Fix usage with Typescript 4.8 (#6229) @flaviendelangle
205
+ - [YearPicker] Scroll to the current year even with `autoFocus=false` (#6224) @alexfauquette
206
+
207
+ ### Docs
208
+
209
+ - [docs] Fix 301 link (#6239) @oliviertassinari
210
+
211
+ ### Core
212
+
213
+ - [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
214
+
6
215
  ## 5.17.3
7
216
 
8
217
  _Sep 16, 2022_
@@ -1406,7 +1615,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
1406
1615
  - [DataGrid] Stop checkbox ripple on blur (#3835) @m4theushw
1407
1616
  - [DataGrid] Stop calling `onRowClick` when clicking in cells with interactive elements (#3929) @m4theushw
1408
1617
  - [DataGrid] Use only `headerName` when available to search column (#3959) @pkratz
1409
- - [DataGrid] Use the bundling scripts as the packages published by the [https://github.com/mui/material-ui](material-ui) repository (#3965) @flaviendelangle
1618
+ - [DataGrid] Use the bundling scripts as the packages published by the [material-ui](https://github.com/mui/material-ui) repository (#3965) @flaviendelangle
1410
1619
  - [DataGridPro] Add `unstable_setRowHeight` method to `apiRef` (#3751) @cherniavskii
1411
1620
  - [DataGridPro] Always export the `pageSize` and `page` when it has been initialized or is being controlled (#3908) @flaviendelangle
1412
1621
  - [DataGridPro] Disable export for detail panel column (#4057) @gustavhagland
@@ -4051,7 +4260,7 @@ Big thanks to the 7 contributors who made this release possible. Here are some h
4051
4260
 
4052
4261
  - 💄 Release the cell editing feature (#1287) @dtassone
4053
4262
 
4054
- This is the first release of the Cell editing feature. You can find the documentation [following this link](https://mui.com/x/react-data-grid/editing/#cell-editing). We have spent the last three months working on it.
4263
+ This is the first release of the Cell editing feature. You can find the documentation [following this link](https://mui.com/x/react-data-grid/editing/). We have spent the last three months working on it.
4055
4264
 
4056
4265
  ![cell edit](https://user-images.githubusercontent.com/3165635/115632215-87994700-a307-11eb-91d9-9f5537df0911.gif)
4057
4266
 
@@ -4661,7 +4870,7 @@ _Dec 9, 2020_
4661
4870
 
4662
4871
  Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
4663
4872
 
4664
- - 🔍 Add a new data grid [density selector](https://mui.com/x/react-data-grid/rendering/#density) feature (#606) @DanailH.
4873
+ - 🔍 Add a new data grid [density selector](https://mui.com/x/react-data-grid/accessibility/#density) feature (#606) @DanailH.
4665
4874
  - 💄 A first iteration on the data grid's toolbar.
4666
4875
  - 🧪 Continue the iteration on the data grid filtering feature, soon to be released @dtassone.
4667
4876
 
@@ -1,4 +1,6 @@
1
1
  import * as React from 'react';
2
+ import { Theme } from '@mui/material/styles';
3
+ import { SxProps } from '@mui/system';
2
4
  import { ExportedDayPickerProps } from './DayPicker';
3
5
  import { PickerOnChangeFn } from '../internals/hooks/useViews';
4
6
  import { ExportedCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from './PickersCalendarHeader';
@@ -14,6 +16,10 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
14
16
  autoFocus?: boolean;
15
17
  className?: string;
16
18
  classes?: Partial<CalendarPickerClasses>;
19
+ /**
20
+ * The system prop that allows defining system overrides as well as additional CSS styles.
21
+ */
22
+ sx?: SxProps<Theme>;
17
23
  /**
18
24
  * Overrideable components.
19
25
  * @default {}
@@ -24,7 +30,7 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
24
30
  * @default {}
25
31
  */
26
32
  componentsProps?: Partial<CalendarPickerSlotsComponentsProps>;
27
- date: TDate | null;
33
+ value: TDate | null;
28
34
  /**
29
35
  * Default calendar month displayed when `value={null}`.
30
36
  */
@@ -89,7 +95,7 @@ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate
89
95
  focusedView?: CalendarPickerView | null;
90
96
  onFocusedViewChange?: (view: CalendarPickerView) => (newHasFocus: boolean) => void;
91
97
  }
92
- export declare type ExportedCalendarPickerProps<TDate> = Omit<CalendarPickerProps<TDate>, 'date' | 'view' | 'views' | 'openTo' | 'onChange' | 'changeView' | 'slideDirection' | 'currentMonth' | 'className' | 'classes' | 'components' | 'componentsProps' | 'onFocusedViewChange' | 'focusedView'>;
98
+ export declare type ExportedCalendarPickerProps<TDate> = Omit<CalendarPickerProps<TDate>, 'value' | 'view' | 'views' | 'openTo' | 'onChange' | 'changeView' | 'slideDirection' | 'currentMonth' | 'className' | 'classes' | 'components' | 'componentsProps' | 'onFocusedViewChange' | 'focusedView'>;
93
99
  export declare type CalendarPickerDefaultizedProps<TDate> = DefaultizedProps<CalendarPickerProps<TDate>, 'views' | 'openTo' | 'loading' | 'reduceAnimations' | 'renderLoading' | keyof BaseDateValidationProps<TDate>>;
94
100
  declare type CalendarPickerComponent = (<TDate>(props: CalendarPickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
95
101
  propTypes?: any;
@@ -1,6 +1,4 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["autoFocus", "onViewChange", "date", "disableFuture", "disablePast", "defaultCalendarMonth", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "classes"];
4
2
  import * as React from 'react';
5
3
  import PropTypes from 'prop-types';
6
4
  import clsx from 'clsx';
@@ -68,9 +66,7 @@ const CalendarPickerViewTransitionContainer = styled(PickersFadeTransitionGroup,
68
66
  name: 'MuiCalendarPicker',
69
67
  slot: 'ViewTransitionContainer',
70
68
  overridesResolver: (props, styles) => styles.viewTransitionContainer
71
- })({
72
- overflowY: 'auto'
73
- });
69
+ })({});
74
70
 
75
71
  /**
76
72
  *
@@ -86,11 +82,10 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
86
82
  const utils = useUtils();
87
83
  const id = useId();
88
84
  const props = useCalendarPickerDefaultizedProps(inProps, 'MuiCalendarPicker');
89
-
90
85
  const {
91
86
  autoFocus,
92
87
  onViewChange,
93
- date,
88
+ value,
94
89
  disableFuture,
95
90
  disablePast,
96
91
  defaultCalendarMonth,
@@ -111,10 +106,16 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
111
106
  maxDate,
112
107
  disableHighlightToday,
113
108
  focusedView,
114
- onFocusedViewChange
115
- } = props,
116
- other = _objectWithoutPropertiesLoose(props, _excluded);
117
-
109
+ onFocusedViewChange,
110
+ showDaysOutsideCurrentMonth,
111
+ dayOfWeekFormatter,
112
+ renderDay,
113
+ components,
114
+ componentsProps,
115
+ loading,
116
+ renderLoading,
117
+ sx
118
+ } = props;
118
119
  const {
119
120
  openView,
120
121
  setOpenView,
@@ -134,7 +135,7 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
134
135
  isDateDisabled,
135
136
  onMonthSwitchingAnimationEnd
136
137
  } = useCalendarState({
137
- date,
138
+ value,
138
139
  defaultCalendarMonth,
139
140
  reduceAnimations,
140
141
  onMonthChange,
@@ -144,7 +145,7 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
144
145
  disablePast,
145
146
  disableFuture
146
147
  });
147
- const handleDateMonthChange = React.useCallback((newDate, selectionState) => {
148
+ const handleDateMonthChange = React.useCallback(newDate => {
148
149
  const startOfMonth = utils.startOfMonth(newDate);
149
150
  const endOfMonth = utils.endOfMonth(newDate);
150
151
  const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({
@@ -158,7 +159,7 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
158
159
  }) : newDate;
159
160
 
160
161
  if (closestEnabledDate) {
161
- onChange(closestEnabledDate, selectionState);
162
+ onChange(closestEnabledDate, 'finish');
162
163
  onMonthChange == null ? void 0 : onMonthChange(startOfMonth);
163
164
  } else {
164
165
  openNext();
@@ -167,7 +168,7 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
167
168
 
168
169
  changeFocusedDay(closestEnabledDate, true);
169
170
  }, [changeFocusedDay, disableFuture, disablePast, isDateDisabled, maxDate, minDate, onChange, onMonthChange, changeMonth, openNext, utils]);
170
- const handleDateYearChange = React.useCallback((newDate, selectionState) => {
171
+ const handleDateYearChange = React.useCallback(newDate => {
171
172
  const startOfYear = utils.startOfYear(newDate);
172
173
  const endOfYear = utils.endOfYear(newDate);
173
174
  const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({
@@ -181,7 +182,7 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
181
182
  }) : newDate;
182
183
 
183
184
  if (closestEnabledDate) {
184
- onChange(closestEnabledDate, selectionState);
185
+ onChange(closestEnabledDate, 'finish');
185
186
  onYearChange == null ? void 0 : onYearChange(closestEnabledDate);
186
187
  } else {
187
188
  openNext();
@@ -191,35 +192,18 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
191
192
  changeFocusedDay(closestEnabledDate, true);
192
193
  }, [changeFocusedDay, disableFuture, disablePast, isDateDisabled, maxDate, minDate, onChange, onYearChange, openNext, utils, changeMonth]);
193
194
  const onSelectedDayChange = React.useCallback((day, isFinish) => {
194
- if (date && day) {
195
+ if (value && day) {
195
196
  // If there is a date already selected, then we want to keep its time
196
- return onChange(utils.mergeDateAndTime(day, date), isFinish);
197
+ return onChange(utils.mergeDateAndTime(day, value), isFinish);
197
198
  }
198
199
 
199
200
  return onChange(day, isFinish);
200
- }, [utils, date, onChange]);
201
- React.useEffect(() => {
202
- if (date && isDateDisabled(date)) {
203
- const closestEnabledDate = findClosestEnabledDate({
204
- utils,
205
- date,
206
- minDate,
207
- maxDate,
208
- disablePast,
209
- disableFuture,
210
- isDateDisabled
211
- });
212
- onChange(closestEnabledDate, 'partial');
213
- } // This call is too expensive to run it on each prop change.
214
- // So just ensure that we are not rendering disabled as selected on mount.
215
-
216
- }, []); // eslint-disable-line
217
-
201
+ }, [utils, value, onChange]);
218
202
  React.useEffect(() => {
219
- if (date) {
220
- changeMonth(date);
203
+ if (value != null && utils.isValid(value)) {
204
+ changeMonth(value);
221
205
  }
222
- }, [date]); // eslint-disable-line
206
+ }, [value]); // eslint-disable-line
223
207
 
224
208
  const ownerState = props;
225
209
  const classes = useUtilityClasses(ownerState);
@@ -230,8 +214,8 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
230
214
  minDate
231
215
  }; // When disabled, limit the view to the selected date
232
216
 
233
- const minDateWithDisabled = disabled && date || minDate;
234
- const maxDateWithDisabled = disabled && date || maxDate;
217
+ const minDateWithDisabled = disabled && value || minDate;
218
+ const maxDateWithDisabled = disabled && value || maxDate;
235
219
  const commonViewProps = {
236
220
  disableHighlightToday,
237
221
  readOnly,
@@ -259,11 +243,16 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
259
243
  setInternalFocusedView(prevView => prevView === eventView ? null : prevView);
260
244
  }
261
245
  });
246
+ React.useEffect(() => {
247
+ // Set focus to the button when switching from a view to another
248
+ handleFocusedViewChange(openView)(true);
249
+ }, [openView, handleFocusedViewChange]);
262
250
  return /*#__PURE__*/_jsxs(CalendarPickerRoot, {
263
251
  ref: ref,
264
252
  className: clsx(classes.root, className),
265
253
  ownerState: ownerState,
266
- children: [/*#__PURE__*/_jsx(PickersCalendarHeader, _extends({}, other, {
254
+ sx: sx,
255
+ children: [/*#__PURE__*/_jsx(PickersCalendarHeader, {
267
256
  views: views,
268
257
  openView: openView,
269
258
  currentMonth: calendarState.currentMonth,
@@ -278,16 +267,18 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
278
267
  disablePast: disablePast,
279
268
  disableFuture: disableFuture,
280
269
  reduceAnimations: reduceAnimations,
281
- labelId: gridLabelId
282
- })), /*#__PURE__*/_jsx(CalendarPickerViewTransitionContainer, {
270
+ labelId: gridLabelId,
271
+ components: components,
272
+ componentsProps: componentsProps
273
+ }), /*#__PURE__*/_jsx(CalendarPickerViewTransitionContainer, {
283
274
  reduceAnimations: reduceAnimations,
284
275
  className: classes.viewTransitionContainer,
285
276
  transKey: openView,
286
277
  ownerState: ownerState,
287
278
  children: /*#__PURE__*/_jsxs("div", {
288
- children: [openView === 'year' && /*#__PURE__*/_jsx(YearPicker, _extends({}, other, baseDateValidationProps, commonViewProps, {
279
+ children: [openView === 'year' && /*#__PURE__*/_jsx(YearPicker, _extends({}, baseDateValidationProps, commonViewProps, {
289
280
  autoFocus: autoFocus,
290
- date: date,
281
+ value: value,
291
282
  onChange: handleDateYearChange,
292
283
  shouldDisableYear: shouldDisableYear,
293
284
  hasFocus: hasFocus,
@@ -296,21 +287,28 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
296
287
  autoFocus: autoFocus,
297
288
  hasFocus: hasFocus,
298
289
  className: className,
299
- date: date,
290
+ value: value,
300
291
  onChange: handleDateMonthChange,
301
292
  shouldDisableMonth: shouldDisableMonth,
302
293
  onFocusedViewChange: handleFocusedViewChange('month')
303
- })), openView === 'day' && /*#__PURE__*/_jsx(DayPicker, _extends({}, other, calendarState, baseDateValidationProps, commonViewProps, {
294
+ })), openView === 'day' && /*#__PURE__*/_jsx(DayPicker, _extends({}, calendarState, baseDateValidationProps, commonViewProps, {
304
295
  autoFocus: autoFocus,
305
296
  onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
306
297
  onFocusedDayChange: changeFocusedDay,
307
298
  reduceAnimations: reduceAnimations,
308
- selectedDays: [date],
299
+ selectedDays: [value],
309
300
  onSelectedDaysChange: onSelectedDayChange,
310
301
  shouldDisableDate: shouldDisableDate,
302
+ shouldDisableMonth: shouldDisableMonth,
303
+ shouldDisableYear: shouldDisableYear,
311
304
  hasFocus: hasFocus,
312
305
  onFocusedViewChange: handleFocusedViewChange('day'),
313
- gridLabelId: gridLabelId
306
+ gridLabelId: gridLabelId,
307
+ showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,
308
+ dayOfWeekFormatter: dayOfWeekFormatter,
309
+ renderDay: renderDay,
310
+ loading: loading,
311
+ renderLoading: renderLoading
314
312
  }))]
315
313
  })
316
314
  })]
@@ -336,7 +334,6 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
336
334
  * @default {}
337
335
  */
338
336
  componentsProps: PropTypes.object,
339
- date: PropTypes.any,
340
337
 
341
338
  /**
342
339
  * Formats the day of week displayed in the calendar header.
@@ -376,20 +373,6 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
376
373
  disablePast: PropTypes.bool,
377
374
  focusedView: PropTypes.oneOf(['day', 'month', 'year']),
378
375
 
379
- /**
380
- * Get aria-label text for switching between views button.
381
- * @param {CalendarPickerView} currentView The view from which we want to get the button text.
382
- * @returns {string} The label of the view.
383
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
384
- */
385
- getViewSwitchingButtonText: PropTypes.func,
386
-
387
- /**
388
- * Left arrow icon aria-label text.
389
- * @deprecated
390
- */
391
- leftArrowButtonText: PropTypes.string,
392
-
393
376
  /**
394
377
  * If `true` renders `LoadingComponent` in calendar instead of calendar view.
395
378
  * Can be used to preload information and show it in calendar.
@@ -469,12 +452,6 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
469
452
  */
470
453
  renderLoading: PropTypes.func,
471
454
 
472
- /**
473
- * Right arrow icon aria-label text.
474
- * @deprecated
475
- */
476
- rightArrowButtonText: PropTypes.string,
477
-
478
455
  /**
479
456
  * Disable specific date. @DateIOType
480
457
  * @template TDate
@@ -507,6 +484,12 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
507
484
  */
508
485
  showDaysOutsideCurrentMonth: PropTypes.bool,
509
486
 
487
+ /**
488
+ * The system prop that allows defining system overrides as well as additional CSS styles.
489
+ */
490
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
491
+ value: PropTypes.any,
492
+
510
493
  /**
511
494
  * Controlled open view.
512
495
  */
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { PickersDayProps } from '../PickersDay/PickersDay';
3
3
  import { PickerOnChangeFn } from '../internals/hooks/useViews';
4
4
  import { SlideDirection, SlideTransitionProps } from './PickersSlideTransition';
5
- import { BaseDateValidationProps, DayValidationProps } from '../internals/hooks/validation/models';
5
+ import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
6
6
  import { DayPickerClasses } from './dayPickerClasses';
7
7
  export interface ExportedDayPickerProps<TDate> extends Pick<PickersDayProps<TDate>, 'disableHighlightToday' | 'showDaysOutsideCurrentMonth'> {
8
8
  /**
@@ -34,7 +34,7 @@ export interface ExportedDayPickerProps<TDate> extends Pick<PickersDayProps<TDat
34
34
  */
35
35
  dayOfWeekFormatter?: (day: string) => string;
36
36
  }
37
- export interface DayPickerProps<TDate> extends ExportedDayPickerProps<TDate>, DayValidationProps<TDate>, Required<BaseDateValidationProps<TDate>> {
37
+ export interface DayPickerProps<TDate> extends ExportedDayPickerProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>> {
38
38
  autoFocus?: boolean;
39
39
  className?: string;
40
40
  currentMonth: TDate;
@@ -8,7 +8,7 @@ import { PickersDay } from '../PickersDay/PickersDay';
8
8
  import { useUtils, useNow } from '../internals/hooks/useUtils';
9
9
  import { DAY_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';
10
10
  import { PickersSlideTransition } from './PickersSlideTransition';
11
- import { useIsDayDisabled } from '../internals/hooks/validation/useDateValidation';
11
+ import { useIsDateDisabled } from '../internals/hooks/validation/useDateValidation';
12
12
  import { findClosestEnabledDate } from '../internals/utils/date-utils';
13
13
  import { getDayPickerUtilityClass } from './dayPickerClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -128,13 +128,17 @@ export function DayPicker(inProps) {
128
128
  minDate,
129
129
  maxDate,
130
130
  shouldDisableDate,
131
+ shouldDisableMonth,
132
+ shouldDisableYear,
131
133
  dayOfWeekFormatter = defaultDayOfWeekFormatter,
132
134
  hasFocus,
133
135
  onFocusedViewChange,
134
136
  gridLabelId
135
137
  } = props;
136
- const isDateDisabled = useIsDayDisabled({
138
+ const isDateDisabled = useIsDateDisabled({
137
139
  shouldDisableDate,
140
+ shouldDisableMonth,
141
+ shouldDisableYear,
138
142
  minDate,
139
143
  maxDate,
140
144
  disablePast,
@@ -2,10 +2,10 @@ import * as React from 'react';
2
2
  import IconButton from '@mui/material/IconButton';
3
3
  import { SlideDirection } from './PickersSlideTransition';
4
4
  import { ExportedDateValidationProps } from '../internals/hooks/validation/useDateValidation';
5
- import { ExportedArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
5
+ import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
6
6
  import { CalendarPickerView } from '../internals/models';
7
7
  import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
8
- export declare type ExportedCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'getViewSwitchingButtonText' | 'leftArrowButtonText' | 'rightArrowButtonText' | 'classes'>;
8
+ export declare type ExportedCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes'>;
9
9
  export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitcherSlotsComponent {
10
10
  /**
11
11
  * Button displayed to switch between different calendar views.
@@ -23,7 +23,7 @@ export interface PickersCalendarHeaderComponentsPropsOverrides {
23
23
  export interface PickersCalendarHeaderSlotsComponentsProps extends PickersArrowSwitcherSlotsComponentsProps {
24
24
  switchViewButton: React.ComponentPropsWithRef<typeof IconButton> & PickersCalendarHeaderComponentsPropsOverrides;
25
25
  }
26
- export interface PickersCalendarHeaderProps<TDate> extends ExportedArrowSwitcherProps, Omit<ExportedDateValidationProps<TDate>, 'shouldDisableDate'> {
26
+ export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, Omit<ExportedDateValidationProps<TDate>, 'shouldDisableDate'> {
27
27
  /**
28
28
  * Overrideable components.
29
29
  * @default {}
@@ -37,13 +37,6 @@ export interface PickersCalendarHeaderProps<TDate> extends ExportedArrowSwitcher
37
37
  currentMonth: TDate;
38
38
  disabled?: boolean;
39
39
  views: readonly CalendarPickerView[];
40
- /**
41
- * Get aria-label text for switching between views button.
42
- * @param {CalendarPickerView} currentView The view from which we want to get the button text.
43
- * @returns {string} The label of the view.
44
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
45
- */
46
- getViewSwitchingButtonText?: (currentView: CalendarPickerView) => string;
47
40
  onMonthChange: (date: TDate, slideDirection: SlideDirection) => void;
48
41
  openView: CalendarPickerView;
49
42
  reduceAnimations: boolean;