@mui/x-date-pickers 5.0.0-alpha.1 → 5.0.0-alpha.4

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 (288) hide show
  1. package/CHANGELOG.md +284 -10
  2. package/CalendarPicker/CalendarPicker.d.ts +19 -9
  3. package/CalendarPicker/CalendarPicker.js +46 -20
  4. package/CalendarPicker/DayPicker.d.ts +7 -10
  5. package/CalendarPicker/DayPicker.js +10 -14
  6. package/CalendarPicker/PickersCalendarHeader.d.ts +11 -9
  7. package/CalendarPicker/PickersCalendarHeader.js +17 -16
  8. package/CalendarPicker/index.d.ts +1 -1
  9. package/ClockPicker/Clock.d.ts +2 -0
  10. package/ClockPicker/Clock.js +21 -9
  11. package/ClockPicker/ClockPicker.d.ts +26 -17
  12. package/ClockPicker/ClockPicker.js +92 -24
  13. package/DatePicker/DatePicker.d.ts +10 -4
  14. package/DatePicker/DatePicker.js +31 -80
  15. package/DatePicker/DatePickerToolbar.d.ts +2 -1
  16. package/DatePicker/DatePickerToolbar.js +24 -15
  17. package/DatePicker/shared.d.ts +19 -7
  18. package/DatePicker/shared.js +8 -1
  19. package/DateTimePicker/DateTimePicker.d.ts +2 -2
  20. package/DateTimePicker/DateTimePicker.js +32 -72
  21. package/DateTimePicker/DateTimePickerToolbar.d.ts +2 -1
  22. package/DateTimePicker/DateTimePickerToolbar.js +47 -21
  23. package/DateTimePicker/shared.d.ts +21 -8
  24. package/DateTimePicker/shared.js +10 -5
  25. package/DesktopDatePicker/DesktopDatePicker.d.ts +11 -4
  26. package/DesktopDatePicker/DesktopDatePicker.js +41 -52
  27. package/DesktopDatePicker/index.d.ts +1 -1
  28. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +11 -4
  29. package/DesktopDateTimePicker/DesktopDateTimePicker.js +45 -50
  30. package/DesktopDateTimePicker/index.d.ts +1 -1
  31. package/DesktopTimePicker/DesktopTimePicker.d.ts +10 -3
  32. package/DesktopTimePicker/DesktopTimePicker.js +33 -57
  33. package/DesktopTimePicker/index.d.ts +1 -1
  34. package/LocalizationProvider/LocalizationProvider.d.ts +13 -2
  35. package/LocalizationProvider/LocalizationProvider.js +38 -7
  36. package/MobileDatePicker/MobileDatePicker.d.ts +10 -3
  37. package/MobileDatePicker/MobileDatePicker.js +42 -73
  38. package/MobileDatePicker/index.d.ts +1 -1
  39. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +10 -3
  40. package/MobileDateTimePicker/MobileDateTimePicker.js +43 -74
  41. package/MobileDateTimePicker/index.d.ts +1 -1
  42. package/MobileTimePicker/MobileTimePicker.d.ts +10 -3
  43. package/MobileTimePicker/MobileTimePicker.js +31 -81
  44. package/MobileTimePicker/index.d.ts +1 -1
  45. package/MonthPicker/MonthPicker.d.ts +18 -2
  46. package/MonthPicker/MonthPicker.js +34 -6
  47. package/PickersActionBar/PickersActionBar.d.ts +16 -0
  48. package/PickersActionBar/PickersActionBar.js +56 -0
  49. package/PickersActionBar/index.d.ts +2 -0
  50. package/PickersActionBar/index.js +1 -0
  51. package/PickersActionBar/package.json +6 -0
  52. package/PickersDay/PickersDay.d.ts +0 -5
  53. package/PickersDay/PickersDay.js +1 -13
  54. package/README.md +47 -5
  55. package/StaticDatePicker/StaticDatePicker.d.ts +3 -9
  56. package/StaticDatePicker/StaticDatePicker.js +40 -57
  57. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +3 -9
  58. package/StaticDateTimePicker/StaticDateTimePicker.js +41 -58
  59. package/StaticTimePicker/StaticTimePicker.d.ts +3 -9
  60. package/StaticTimePicker/StaticTimePicker.js +27 -59
  61. package/TimePicker/TimePicker.d.ts +10 -4
  62. package/TimePicker/TimePicker.js +20 -77
  63. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  64. package/TimePicker/TimePickerToolbar.js +37 -18
  65. package/TimePicker/shared.d.ts +11 -5
  66. package/TimePicker/shared.js +17 -3
  67. package/TimePicker/timePickerToolbarClasses.d.ts +0 -1
  68. package/TimePicker/timePickerToolbarClasses.js +2 -2
  69. package/YearPicker/YearPicker.js +26 -3
  70. package/index.d.ts +1 -0
  71. package/index.js +3 -2
  72. package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.d.ts +24 -9
  73. package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +6 -6
  74. package/internals/components/CalendarOrClockPicker/index.d.ts +1 -0
  75. package/internals/components/PickersArrowSwitcher.d.ts +14 -10
  76. package/internals/components/PickersArrowSwitcher.js +30 -14
  77. package/internals/components/PickersModalDialog.d.ts +10 -30
  78. package/internals/components/PickersModalDialog.js +14 -35
  79. package/internals/components/PickersPopper.d.ts +13 -11
  80. package/internals/components/PickersPopper.js +31 -26
  81. package/internals/components/PickersToolbar.d.ts +3 -3
  82. package/internals/components/PickersToolbar.js +23 -9
  83. package/internals/components/PureDateInput.d.ts +13 -13
  84. package/internals/components/wrappers/DesktopTooltipWrapper.js +14 -2
  85. package/internals/components/wrappers/DesktopWrapper.d.ts +11 -3
  86. package/internals/components/wrappers/DesktopWrapper.js +11 -5
  87. package/internals/components/wrappers/MobileWrapper.d.ts +11 -3
  88. package/internals/components/wrappers/MobileWrapper.js +10 -14
  89. package/internals/components/wrappers/WrapperProps.d.ts +0 -7
  90. package/internals/hooks/useMaskedInput.d.ts +2 -2
  91. package/internals/hooks/usePickerState.d.ts +98 -31
  92. package/internals/hooks/usePickerState.js +152 -69
  93. package/internals/hooks/useUtils.d.ts +1 -0
  94. package/internals/hooks/useUtils.js +1 -0
  95. package/internals/hooks/validation/useDateTimeValidation.d.ts +3 -3
  96. package/internals/hooks/validation/useDateValidation.d.ts +7 -9
  97. package/internals/hooks/validation/useTimeValidation.d.ts +9 -4
  98. package/internals/hooks/validation/useTimeValidation.js +7 -3
  99. package/internals/hooks/validation/useValidation.d.ts +5 -5
  100. package/internals/index.d.ts +11 -10
  101. package/internals/index.js +4 -3
  102. package/internals/models/props/basePickerProps.d.ts +4 -56
  103. package/internals/models/props/baseToolbarProps.d.ts +2 -4
  104. package/internals/models/props/staticPickerProps.d.ts +9 -0
  105. package/internals/models/{parseableDate.js → props/staticPickerProps.js} +0 -0
  106. package/internals/utils/date-utils.d.ts +1 -1
  107. package/internals/utils/text-field-helper.d.ts +2 -3
  108. package/internals/utils/text-field-helper.js +20 -9
  109. package/internals/utils/time-utils.d.ts +1 -1
  110. package/internals/utils/time-utils.js +1 -1
  111. package/internals/utils/utils.d.ts +0 -1
  112. package/internals/utils/utils.js +0 -3
  113. package/internals/utils/warning.d.ts +3 -0
  114. package/internals/utils/warning.js +17 -0
  115. package/legacy/CalendarPicker/CalendarPicker.js +45 -19
  116. package/legacy/CalendarPicker/DayPicker.js +15 -17
  117. package/legacy/CalendarPicker/PickersCalendarHeader.js +17 -18
  118. package/legacy/ClockPicker/Clock.js +46 -33
  119. package/legacy/ClockPicker/ClockPicker.js +99 -43
  120. package/legacy/DatePicker/DatePicker.js +32 -81
  121. package/legacy/DatePicker/DatePickerToolbar.js +27 -14
  122. package/legacy/DatePicker/shared.js +12 -1
  123. package/legacy/DateTimePicker/DateTimePicker.js +33 -73
  124. package/legacy/DateTimePicker/DateTimePickerToolbar.js +55 -21
  125. package/legacy/DateTimePicker/shared.js +14 -5
  126. package/legacy/DesktopDatePicker/DesktopDatePicker.js +41 -54
  127. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +44 -51
  128. package/legacy/DesktopTimePicker/DesktopTimePicker.js +32 -58
  129. package/legacy/LocalizationProvider/LocalizationProvider.js +38 -7
  130. package/legacy/MobileDatePicker/MobileDatePicker.js +41 -74
  131. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +42 -75
  132. package/legacy/MobileTimePicker/MobileTimePicker.js +30 -82
  133. package/legacy/MonthPicker/MonthPicker.js +34 -6
  134. package/legacy/PickersActionBar/PickersActionBar.js +54 -0
  135. package/legacy/PickersActionBar/index.js +1 -0
  136. package/legacy/PickersDay/PickersDay.js +2 -15
  137. package/legacy/StaticDatePicker/StaticDatePicker.js +40 -60
  138. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +41 -61
  139. package/legacy/StaticTimePicker/StaticTimePicker.js +27 -61
  140. package/legacy/TimePicker/TimePicker.js +21 -78
  141. package/legacy/TimePicker/TimePickerToolbar.js +45 -18
  142. package/legacy/TimePicker/shared.js +21 -3
  143. package/legacy/TimePicker/timePickerToolbarClasses.js +2 -2
  144. package/legacy/YearPicker/YearPicker.js +27 -3
  145. package/legacy/index.js +3 -2
  146. package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +6 -6
  147. package/legacy/internals/components/PickersArrowSwitcher.js +36 -16
  148. package/legacy/internals/components/PickersModalDialog.js +15 -43
  149. package/legacy/internals/components/PickersPopper.js +34 -32
  150. package/legacy/internals/components/PickersToolbar.js +29 -9
  151. package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +14 -2
  152. package/legacy/internals/components/wrappers/DesktopWrapper.js +11 -5
  153. package/legacy/internals/components/wrappers/MobileWrapper.js +11 -15
  154. package/legacy/internals/hooks/usePickerState.js +162 -85
  155. package/legacy/internals/hooks/useUtils.js +3 -0
  156. package/legacy/internals/hooks/validation/useTimeValidation.js +7 -3
  157. package/legacy/internals/index.js +4 -3
  158. package/legacy/internals/models/{parseableDate.js → props/staticPickerProps.js} +0 -0
  159. package/legacy/internals/utils/text-field-helper.js +20 -9
  160. package/legacy/internals/utils/time-utils.js +3 -1
  161. package/legacy/internals/utils/utils.js +0 -15
  162. package/legacy/internals/utils/warning.js +29 -0
  163. package/legacy/locales/enUS.js +16 -0
  164. package/legacy/locales/frFR.js +14 -0
  165. package/legacy/locales/index.js +3 -0
  166. package/legacy/locales/utils/getPickersLocalization.js +12 -0
  167. package/{modern/internals/models/parseableDate.js → legacy/locales/utils/pickersLocaleTextApi.js} +0 -0
  168. package/locales/enUS.d.ts +22 -0
  169. package/locales/enUS.js +16 -0
  170. package/locales/frFR.d.ts +20 -0
  171. package/locales/frFR.js +14 -0
  172. package/locales/index.d.ts +3 -0
  173. package/locales/index.js +3 -0
  174. package/locales/package.json +6 -0
  175. package/locales/utils/getPickersLocalization.d.ts +21 -0
  176. package/locales/utils/getPickersLocalization.js +12 -0
  177. package/locales/utils/pickersLocaleTextApi.d.ts +16 -0
  178. package/locales/utils/pickersLocaleTextApi.js +1 -0
  179. package/modern/CalendarPicker/CalendarPicker.js +46 -20
  180. package/modern/CalendarPicker/DayPicker.js +10 -14
  181. package/modern/CalendarPicker/PickersCalendarHeader.js +17 -16
  182. package/modern/ClockPicker/Clock.js +21 -9
  183. package/modern/ClockPicker/ClockPicker.js +92 -24
  184. package/modern/DatePicker/DatePicker.js +31 -80
  185. package/modern/DatePicker/DatePickerToolbar.js +24 -15
  186. package/modern/DatePicker/shared.js +8 -1
  187. package/modern/DateTimePicker/DateTimePicker.js +32 -72
  188. package/modern/DateTimePicker/DateTimePickerToolbar.js +47 -21
  189. package/modern/DateTimePicker/shared.js +10 -5
  190. package/modern/DesktopDatePicker/DesktopDatePicker.js +41 -52
  191. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +45 -50
  192. package/modern/DesktopTimePicker/DesktopTimePicker.js +33 -57
  193. package/modern/LocalizationProvider/LocalizationProvider.js +38 -7
  194. package/modern/MobileDatePicker/MobileDatePicker.js +42 -73
  195. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +43 -74
  196. package/modern/MobileTimePicker/MobileTimePicker.js +31 -81
  197. package/modern/MonthPicker/MonthPicker.js +34 -6
  198. package/modern/PickersActionBar/PickersActionBar.js +56 -0
  199. package/modern/PickersActionBar/index.js +1 -0
  200. package/modern/PickersDay/PickersDay.js +1 -13
  201. package/modern/StaticDatePicker/StaticDatePicker.js +40 -57
  202. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +41 -58
  203. package/modern/StaticTimePicker/StaticTimePicker.js +27 -59
  204. package/modern/TimePicker/TimePicker.js +20 -77
  205. package/modern/TimePicker/TimePickerToolbar.js +37 -18
  206. package/modern/TimePicker/shared.js +17 -3
  207. package/modern/TimePicker/timePickerToolbarClasses.js +2 -2
  208. package/modern/YearPicker/YearPicker.js +26 -3
  209. package/modern/index.js +3 -2
  210. package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +6 -6
  211. package/modern/internals/components/PickersArrowSwitcher.js +30 -14
  212. package/modern/internals/components/PickersModalDialog.js +12 -35
  213. package/modern/internals/components/PickersPopper.js +29 -26
  214. package/modern/internals/components/PickersToolbar.js +23 -9
  215. package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +14 -2
  216. package/modern/internals/components/wrappers/DesktopWrapper.js +11 -5
  217. package/modern/internals/components/wrappers/MobileWrapper.js +10 -14
  218. package/modern/internals/hooks/usePickerState.js +152 -69
  219. package/modern/internals/hooks/useUtils.js +1 -0
  220. package/modern/internals/hooks/validation/useTimeValidation.js +7 -3
  221. package/modern/internals/index.js +4 -3
  222. package/modern/internals/models/props/staticPickerProps.js +1 -0
  223. package/modern/internals/utils/text-field-helper.js +20 -9
  224. package/modern/internals/utils/time-utils.js +1 -1
  225. package/modern/internals/utils/utils.js +0 -3
  226. package/modern/internals/utils/warning.js +17 -0
  227. package/modern/locales/enUS.js +16 -0
  228. package/modern/locales/frFR.js +14 -0
  229. package/modern/locales/index.js +3 -0
  230. package/modern/locales/utils/getPickersLocalization.js +12 -0
  231. package/modern/locales/utils/pickersLocaleTextApi.js +1 -0
  232. package/node/CalendarPicker/CalendarPicker.js +46 -20
  233. package/node/CalendarPicker/DayPicker.js +10 -14
  234. package/node/CalendarPicker/PickersCalendarHeader.js +17 -15
  235. package/node/ClockPicker/Clock.js +21 -9
  236. package/node/ClockPicker/ClockPicker.js +92 -24
  237. package/node/DatePicker/DatePicker.js +31 -80
  238. package/node/DatePicker/DatePickerToolbar.js +25 -15
  239. package/node/DatePicker/shared.js +12 -2
  240. package/node/DateTimePicker/DateTimePicker.js +32 -72
  241. package/node/DateTimePicker/DateTimePickerToolbar.js +48 -21
  242. package/node/DateTimePicker/shared.js +14 -5
  243. package/node/DesktopDatePicker/DesktopDatePicker.js +40 -53
  244. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +44 -51
  245. package/node/DesktopTimePicker/DesktopTimePicker.js +32 -58
  246. package/node/LocalizationProvider/LocalizationProvider.js +41 -7
  247. package/node/MobileDatePicker/MobileDatePicker.js +41 -74
  248. package/node/MobileDateTimePicker/MobileDateTimePicker.js +42 -75
  249. package/node/MobileTimePicker/MobileTimePicker.js +30 -82
  250. package/node/MonthPicker/MonthPicker.js +34 -6
  251. package/node/PickersActionBar/PickersActionBar.js +77 -0
  252. package/node/PickersActionBar/index.js +13 -0
  253. package/node/PickersDay/PickersDay.js +1 -13
  254. package/node/StaticDatePicker/StaticDatePicker.js +38 -58
  255. package/node/StaticDateTimePicker/StaticDateTimePicker.js +39 -59
  256. package/node/StaticTimePicker/StaticTimePicker.js +25 -60
  257. package/node/TimePicker/TimePicker.js +20 -77
  258. package/node/TimePicker/TimePickerToolbar.js +36 -18
  259. package/node/TimePicker/shared.js +21 -3
  260. package/node/TimePicker/timePickerToolbarClasses.js +2 -2
  261. package/node/YearPicker/YearPicker.js +26 -3
  262. package/node/index.js +14 -1
  263. package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +6 -6
  264. package/node/internals/components/PickersArrowSwitcher.js +32 -14
  265. package/node/internals/components/PickersModalDialog.js +15 -37
  266. package/node/internals/components/PickersPopper.js +32 -27
  267. package/node/internals/components/PickersToolbar.js +25 -10
  268. package/node/internals/components/wrappers/DesktopTooltipWrapper.js +14 -2
  269. package/node/internals/components/wrappers/DesktopWrapper.js +11 -5
  270. package/node/internals/components/wrappers/MobileWrapper.js +10 -14
  271. package/node/internals/hooks/usePickerState.js +157 -74
  272. package/node/internals/hooks/useUtils.js +5 -1
  273. package/node/internals/hooks/validation/useTimeValidation.js +7 -3
  274. package/node/internals/index.js +26 -0
  275. package/node/internals/models/{parseableDate.js → props/staticPickerProps.js} +0 -0
  276. package/node/internals/utils/text-field-helper.js +20 -9
  277. package/node/internals/utils/time-utils.js +1 -1
  278. package/node/internals/utils/utils.js +1 -7
  279. package/node/internals/utils/warning.js +26 -0
  280. package/node/locales/enUS.js +26 -0
  281. package/node/locales/frFR.js +23 -0
  282. package/node/locales/index.js +44 -0
  283. package/node/locales/utils/getPickersLocalization.js +24 -0
  284. package/node/locales/utils/pickersLocaleTextApi.js +5 -0
  285. package/package.json +16 -8
  286. package/themeAugmentation/overrides.d.ts +2 -2
  287. package/themeAugmentation/props.d.ts +2 -2
  288. package/internals/models/parseableDate.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,280 @@
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.11.1
7
+
8
+ _May 20, 2022_
9
+
10
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Support localization on the date and time picker components (#4517) @alexfauquette
13
+
14
+ 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.
15
+
16
+ - 📃 Add support for column spanning when exporting to Excel (#4830) @cherniavskii
17
+
18
+ <img src="https://user-images.githubusercontent.com/13808724/167691417-bf6baeb9-d409-4134-acb6-aadaf6434de9.png" width="800">
19
+
20
+ - 🐞 Bugs fixes
21
+
22
+ ### `@mui/x-data-grid@v5.11.1` / `@mui/x-data-grid-pro@v5.11.1` / `@mui/x-data-grid-premium@v5.11.1`
23
+
24
+ #### Changes
25
+
26
+ - [DataGrid] Add a CSS class corresponding to current density (#4858) @m4theushw
27
+ - [DataGrid] Execute the pipe-processors in their initialization order (#4913) @flaviendelangle
28
+ - [DataGrid] Fix rendering of the no rows overlay when the `loading` prop is changed (#4910) @m4theushw
29
+ - [DataGridPremium] Add `exceljs` to the dependencies (#4939) @alexfauquette
30
+ - [DataGridPremium] Support column spanning in the Excel export (#4830) @cherniavskii
31
+ - [l10n] Improve Russian (ru-RU) locale (#4864) @arvkonstantin
32
+
33
+ ### `@mui/x-date-pickers@5.0.0-alpha.4` / `@mui/x-date-pickers-pro@5.0.0-alpha.4`
34
+
35
+ #### Breaking changes
36
+
37
+ - The props related to the action bar buttons have been removed (`clearable`, `showTodayButton`, `cancelText`, `okText`)
38
+
39
+ To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
40
+
41
+ ```jsx
42
+ <DatePicker
43
+ componentsProps={{
44
+ actionBar: {
45
+ // The actions will be the same between desktop and mobile
46
+ actions: ['clear'],
47
+
48
+ // The actions will be different between desktop and mobile
49
+ actions: (variant) => variant === 'desktop' ? [] : ['clear'],
50
+ }
51
+ }}
52
+ />
53
+ ```
54
+
55
+ The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
56
+ By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
57
+
58
+ If you need other actions, you can provide your own component to the `ActionBar` component slot
59
+
60
+ ```jsx
61
+ <DatePicker
62
+ components={{ ActionBar: CustomActionBar }}
63
+ />
64
+ ```
65
+
66
+ #### Changes
67
+
68
+ - [DatePicker] Fix keyboard accessibility for first and last year (#4807) @alexfauquette
69
+ - [pickers] Add component slot for action bar (#4778) @alexfauquette
70
+ - [pickers] Add l10n support (#4517) @alexfauquette
71
+ - [pickers] Close Popper when pressing <kbd>Esc</kbd> inside a modal (#4499) @alexfauquette
72
+ - [pickers] Support class slots on toolbar components (#4855) @flaviendelangle
73
+ - [TimePicker] Fix time validation when current date is `null` (#4867) @flaviendelangle
74
+
75
+ ### Docs
76
+
77
+ - [docs] Add 301 redirect for columns page (#4940) @alexfauquette
78
+ - [docs] Avoid confusion with license key installation (#4891) @oliviertassinari
79
+ - [docs] Complete the instructions for pickers installation in readme (#4852) @alexfauquette
80
+ - [docs] Disable ads on paid-only pages (#4842) @flaviendelangle
81
+ - [docs] Don't redirect to localized doc on deploy preview (#4818) @m4theushw
82
+ - [docs] Limit `LICENSE` file to 80 char per line (#4873) @oliviertassinari
83
+ - [docs] Typo on OrderId @oliviertassinari
84
+ - [docs] Update feature comparison table (#4918) @cherniavskii
85
+
86
+ ### Core
87
+
88
+ - [core] Add new script to generate tree data rows from file tree (#4902) @flaviendelangle
89
+ - [core] Fix code style (#4874) @oliviertassinari
90
+ - [core] Fix React 18 peer dependency (#4908) @oliviertassinari
91
+ - [core] Fix link to the LICENSE file (#4875) @oliviertassinari
92
+ - [core] Fix transitive babel dependency (#4793) @oliviertassinari
93
+ - [core] New pipe processing `rowHydration` (#4896) @flaviendelangle
94
+ - [core] Remove dead code for the docs (#4791) @oliviertassinari
95
+ - [core] Run `yarn prettier` @oliviertassinari
96
+ - [core] Polishes on `CHANGELOG.md` (#4876) @oliviertassinari
97
+ - [core] Simplify rows cache management (#4933) @flaviendelangle
98
+ - [core] Use internal icons for quick filter (#4912) @alexfauquette
99
+
100
+ ## v5.11.0
101
+
102
+ _May 13, 2022_
103
+
104
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
105
+
106
+ - 🚀 **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.
107
+
108
+ This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
109
+
110
+ 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.
111
+
112
+ ```diff
113
+ -import { DataGridPro } from '@mui/x-data-grid-pro';
114
+ +import { DataGridPremium } from '@mui/x-data-grid-premium';
115
+
116
+ -<DataGridPro experimentalFeatures={{ rowGrouping: true }} />
117
+ +<DataGridPremium />
118
+ ```
119
+
120
+ 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).
121
+
122
+ - 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
123
+
124
+ - 🔎 **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).
125
+
126
+ <img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
127
+
128
+ - 🐞 Bugs fixes
129
+
130
+ ### `@mui/x-data-grid@v5.11.0` / `@mui/x-data-grid-pro@v5.11.0` / `@mui/x-data-grid-premium@v5.11.0`
131
+
132
+ #### Breaking changes
133
+
134
+ - Move row grouping to the premium package (#4223) @flaviendelangle
135
+
136
+ The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
137
+
138
+ #### Changes
139
+
140
+ - [DataGrid] Add TypeScript support to the `sx` prop in inner components (#4743) @lindapaiste
141
+ - [DataGrid] Add props to control cell mode (#4210) @m4theushw
142
+ - [DataGrid] Add quick filtering engine (#4317) @alexfauquette
143
+ - [DataGrid] Check focus validity whenever the rows in state changes (#4683) @flaviendelangle
144
+ - [DataGrid] Fix infinite scroll when dragging column header cell over row cell (#4735) @DjoSmer
145
+ - [DataGrid] Fix scroll jump when using keyboard navigation (#4515) @cherniavskii
146
+ - [DataGrid] Improve sorting accessibility (#4379) @cherniavskii
147
+ - [DataGrid] New `getRowGroupChildren` API method (#4304) @flaviendelangle
148
+ - [DataGrid] Publish `preferencePanelClose` event only once when clicking on another panel button (#4810) @flaviendelangle
149
+ - [DataGrid] Update focused action if the currently focused one is removed (#4694) @m4theushw
150
+ - [DataGrid] Add `onChange` callback to edit components (#4621) @m4theushw
151
+ - [DataGrid] Add `keepNonExistentRowsSelected` prop (#4786) @willsoto
152
+ - [DataGrid] Prevent crash if row is removed with click (#4831) @m4theushw
153
+ - [DataGridPro] Fix detail panel not taking full width (#4610) @cherniavskii
154
+ - [DataGridPremium] Add Excel export (#3981) @alexfauquette
155
+ - [DataGridPremium] Bootstrap `@mui/x-data-grid-premium` (#4223) @flaviendelangle
156
+ - [DataGridPremium] Fix Excel date serialization when row grouping is enabled (#4774) @cherniavskii
157
+ - [l10n] Improve German (de-DE) locale (#4748) @sebastianfrey
158
+ - [l10n] Improve German (de-DE) locale (#4668) @izu-co
159
+
160
+ ### `@mui/x-date-pickers@5.0.0-alpha.3` / `@mui/x-date-pickers-pro@5.0.0-alpha.3`
161
+
162
+ #### Breaking changes
163
+
164
+ - Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
165
+
166
+ The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
167
+ The default behavior remains the same (close after the last step on desktop but not on mobile).
168
+
169
+ ```diff
170
+ // If you don't want to close after the last step
171
+ -<DatePicker disableCloseOnSelect={false} />
172
+ +<DatePicker closeOnSelect />
173
+
174
+ // If you want to close after the last step
175
+ -<DatePicker disableCloseOnSelect />
176
+ +<DatePicker closeOnSelect={false} />
177
+ ```
178
+
179
+ #### Changes
180
+
181
+ - [DatePicker] Ignore <kbd>Escape</kbd> when the picker is already closed (#4770) @mikewolfd
182
+ - [DatePicker] Make month year order changeable in header (#4695) @gky360
183
+ - [DateRangePicker] Open view on click, <kbd>Enter</kbd> or <kbd>Space</kbd> instead of focus (#4747) @alexfauquette
184
+ - [DateRangePicker] Refactor tests (#4745) @flaviendelangle
185
+ - [DateRangePicker] Remove `orientation` prop (#4665) @m4theushw
186
+ - [DateTimePicker] `Toolbar` should be visible by default on mobile (#4833) @flaviendelangle
187
+ - [MonthPicker] New prop `shouldDisableMonth` (#4708) @someone635
188
+ - [TimePicker] Disable and invalidate date with minutes not matching `minutesStep` (#4726) @flaviendelangle
189
+ - [TimePicker] Don't merge with previous value when new value is not valid (#4847) @flaviendelangle
190
+ - [TimePicker] Refactor `isTimeDisabled` method (#4688) @flaviendelangle
191
+ - [pickers] Add details in invalid mask error (#4501) @alexfauquette
192
+ - [pickers] Add explicit interfaces for components slots and components slots props (#4589) @flaviendelangle
193
+ - [pickers] Add missing `peerDependencies` for `yarn pnp` users (#4763) @nate-summercook
194
+ - [pickers] Add overrides to `PickersArrowSwitcher` (#4672) @m4theushw
195
+ - [pickers] Clean component interfaces and remove non-implemented props (#4758) @flaviendelangle
196
+ - [pickers] Do not apply the current time when no date provided in `DayPicker` (#4649) @flaviendelangle
197
+ - [pickers] Document and refacto the value manager (#4701) @flaviendelangle
198
+ - [pickers] Drop `allowSameDateSelection` prop (#4808) @flaviendelangle
199
+ - [pickers] Enable mask by default when using `ampm=true` (#4731) @alexfauquette
200
+ - [pickers] Fix `disabled` and `readOnly` behavior on calendar and clock (#4645) @alexfauquette
201
+ - [pickers] Invalid character does not delete last digit (#4839) @alexfauquette
202
+ - [pickers] Rename prop `date` into `parsedValue` when it can contain a range (#4736) @flaviendelangle
203
+ - [pickers] Rework `TDate`, `TInputDate`, `TValue` and `TInputValue` generics (#4617) @flaviendelangle
204
+ - [pickers] Rework the date lifecycle in `usePickerState` (#4408) @flaviendelangle
205
+
206
+ ### Docs
207
+
208
+ - [docs] Add `scopePathNames` property to column page (#4811) @flaviendelangle
209
+ - [docs] Add label to each demo (#4667) @m4theushw
210
+ - [docs] Correctly capitalize <kbd>Ctrl</kbd> (#4707) @oliviertassinari
211
+ - [docs] Fix documentation on `ampm` prop (#4846) @alexfauquette
212
+ - [docs] Generate the event documentation from `GridEventLookup` (#4725) @flaviendelangle
213
+ - [docs] Keep columns section expanded when switching between pages (#4816) @cherniavskii
214
+ - [docs] Move `useKeepGroupingColumnsHidden` on `@mui/x-data-grid-premium` (#4319) @flaviendelangle
215
+ - [docs] Remove legacy pages for old URLs (#4575) @m4theushw
216
+ - [docs] Remove remaining pages in `docs/pages/api-docs` folder (#4709) @m4theushw
217
+ - [docs] SEO fixes (#4711) @oliviertassinari
218
+ - [docs] Set type number to movie column year (#4753) @flaviendelangle
219
+ - [docs] Simplify server examples (#4186) @alexfauquette
220
+ - [docs] Small typo (#4670) @flaviendelangle
221
+ - [docs] Split the 'Columns' page (#4600) @flaviendelangle
222
+ - [docs] Stop using `GridEvents` enum in documentation (#4699) @flaviendelangle
223
+ - [docs] Update mono repo to get copy code block (#4691) @siriwatknp
224
+ - [docs] Update the feature table in the Getting Started page of the data grid (#4619) @flaviendelangle
225
+ - [docs] Add demo for Premium (#4750) @m4theushw
226
+
227
+ ### Core
228
+
229
+ - [core] Check if `process` is available (#4193) @m4theushw
230
+ - [core] Fix naming collision (#4853) @alexfauquette
231
+ - [core] Prevent out-of-memory when type-checking in CI (#4697) @flaviendelangle
232
+ - [core] Remove `rowsCache` from state (#4480) @m4theushw
233
+ - [core] Rework `DayPicker` api (#4783) @flaviendelangle
234
+ - [core] Update `x-license-pro` license to handle premium package (#4315) @DanailH
235
+ - [core] Update monorepo & version (#4789) @oliviertassinari
236
+ - [core] Update monorepo (#4772) @flaviendelangle
237
+ - [core] Stop using `GridEvents` enum (#4698, #4696, #4685) @flaviendelangle
238
+ - [core] Update monorepo (#4854) @cherniavskii
239
+ - [license] Allow to limit some packages to a specific license plan (#4651) @flaviendelangle
240
+ - [test] Fix path to detect `DataGrid` tests (#4752) @m4theushw
241
+ - [test] Reset cleanup tracking on Karma tests (#4679) @m4theushw
242
+ - [test] Restore `sinon` sandbox after each `karma` test (#4689) @m4theushw
243
+
244
+ ## v5.10.0
245
+
246
+ _Apr 25, 2022_
247
+
248
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
249
+
250
+ - 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/rows/#row-reorder) (#4034) @DanailH
251
+
252
+ <img src="https://user-images.githubusercontent.com/5858539/165091263-23472fbb-a989-44b8-849a-d2185adfe13b.gif" width="800">
253
+
254
+ - 🐞 Bug fixes
255
+
256
+ ### `@mui/x-data-grid@v5.10.0` / `@mui/x-data-grid-pro@v5.10.0`
257
+
258
+ - [DataGrid] Don't close column menu when updating rows (#4498) @m4theushw
259
+ - [DataGridPro] Introduce row reorder (#4034) @DanailH
260
+
261
+ ### `@mui/x-date-pickers@5.0.0-alpha.2` / `@mui/x-date-pickers-pro@5.0.0-alpha.2`
262
+
263
+ - [pickers] Pass `PaperProps` to `DesktopWrapper` component (#4584) @alexfauquette
264
+ - [TimePicker] Fix bug when time picker clear value (#4582) @alexfauquette
265
+ - [DateRangePicker] Fix missing `clearable` and `clearText` props (#4511) @zigang93
266
+
267
+ ### Docs
268
+
269
+ - [docs] Add plan in the nav bar for pro-only and premium-only pages (#4591) @flaviendelangle
270
+ - [docs] Clarify where to install the license (#4452) @oliviertassinari
271
+ - [docs] Fix CodeSandbox links for demo with pickers (#4570) @alexfauquette
272
+ - [docs] Include date-fns dependency when opening demos in CodeSandbox (#4508) @m4theushw
273
+ - [docs] Split the 'Group & Pivot' page (#4441) @flaviendelangle
274
+
275
+ ### Core
276
+
277
+ - [core] Fix the README of the X packages (#4590) @flaviendelangle
278
+ - [test] Fix test to not depend on screen resolution (#4587) @m4theushw
279
+
6
280
  ## v5.9.0
7
281
 
8
282
  _Apr 14, 2022_
@@ -13,7 +287,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
13
287
 
14
288
  Now the data grid and pickers components support the concurrent mode.
15
289
 
16
- - 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/columns/#column-spanning) (#4020) @cherniavskii
290
+ - 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/column-spanning/) (#4020) @cherniavskii
17
291
 
18
292
  <img src="https://user-images.githubusercontent.com/13808724/162926746-93bcb180-3c9d-4eb9-afc7-c3908a5c6406.png" width="788">
19
293
 
@@ -636,7 +910,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
636
910
  />
637
911
  ```
638
912
 
639
- See the [documentation](https://mui.com/x/react-data-grid/columns/#column-visibility) for more details.
913
+ See the [documentation](https://mui.com/x/react-data-grid/column-visibility/) for more details.
640
914
 
641
915
  The `hide` property from `GridColDef` still works but has been deprecated.
642
916
 
@@ -792,7 +1066,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
792
1066
 
793
1067
  ### `@mui/x-data-grid@v5.2.0` / `@mui/x-data-grid-pro@v5.2.0`
794
1068
 
795
- - 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/columns/#column-pinning) feature (#2946) @m4theushw
1069
+ - 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/column-pinning/) feature (#2946) @m4theushw
796
1070
 
797
1071
  <img src="https://user-images.githubusercontent.com/42154031/145425635-b6314fbe-2f1e-4b73-908f-33ee1fda20c7.gif" width="964" height="657">
798
1072
 
@@ -1746,7 +2020,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
1746
2020
  - 📚 Migrate to the new documentation infrastructure and design (#2441) (@DanailH, @m4theushw)
1747
2021
  - 🎁 Add `actions` column type (#2385) @m4theushw
1748
2022
 
1749
- See the documentation for [more details](https://mui.com/x/react-data-grid/columns/#column-types).
2023
+ See the documentation for [more details](https://mui.com/x/react-data-grid/column-definition/#column-types).
1750
2024
 
1751
2025
  - 👁 Allow to disable virtualization with the `disableVirtualization` prop (#2326) @m4theushw
1752
2026
  - 🚀 Introduce the new `isRowSelected` api method (#2523) @flaviendelangle
@@ -2368,11 +2642,11 @@ _July 1, 2021_
2368
2642
  Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
2369
2643
 
2370
2644
  - 🐞 As a focus of Q2, we have kept fixing bugs
2371
- - 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>CTRL</kbd> + <kbd>c</kbd> (#1929) @m4theushw
2645
+ - 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>Ctrl</kbd> + <kbd>c</kbd> (#1929) @m4theushw
2372
2646
  - 🐛 We have fixed the `Select all` checkbox. When triggered, it should only select the filtered rows (#1879) @ZeeshanTamboli
2373
2647
  - ⚡️ We have added a new `singleSelect` column type (#1956) @DanailH
2374
2648
 
2375
- Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/columns/#column-types).
2649
+ Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/column-definition/#column-types).
2376
2650
 
2377
2651
  ```jsx
2378
2652
  <DataGrid
@@ -2568,7 +2842,7 @@ _June 9, 2021_
2568
2842
  Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
2569
2843
 
2570
2844
  - 💅 Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
2571
- - 🐛 Allow to deselect rows with <kbd>CTRL</kbd> + click (#1813) @ZeeshanTamboli
2845
+ - 🐛 Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
2572
2846
  - ⚡️ Refactor scroll size detector (#1703) @dtassone
2573
2847
  - 📖 Add [documentation](https://mui.com/x/api/data-grid/) for interfaces and events (#1529) @m4theushw
2574
2848
  - 🐞 Bugfixes
@@ -2595,7 +2869,7 @@ Big thanks to the 6 contributors who made this release possible. Here are some h
2595
2869
 
2596
2870
  - [DataGrid] Add `valueParser` to parse values entered by the user (#1785) @m4theushw
2597
2871
  - [DataGrid] Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
2598
- - [DataGrid] Allow to deselect rows with <kbd>CTRL</kbd> + click (#1813) @ZeeshanTamboli
2872
+ - [DataGrid] Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
2599
2873
  - [DataGrid] Improve general architecture to better isolate hooks (#1720) @dtassone
2600
2874
  - [DataGrid] Fix cell height after changing grid density (#1819) @DanailH
2601
2875
  - [DataGrid] Fix fluid columns width when available `viewportWidth` < 0 (#1816) @DanailH
@@ -3117,7 +3391,7 @@ Big thanks to the 8 contributors who made this release possible. Here are some h
3117
3391
  - [DataGrid] Rename `useGridBaseComponentProps` hook to `useGridSlotComponentProps` (#1252) @DanailH
3118
3392
  - [DataGrid] Rename modules (#1292) @DanailH
3119
3393
  - [DataGrid] Rename all events related to column reordering, e.g. `GRID_COL_REORDER_START` -> `GRID_COLUMN_REORDER_START` (#1299) @m4theushw
3120
- - [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/columns/#column-reorder) (#1299) @m4theushw
3394
+ - [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/column-ordering/) (#1299) @m4theushw
3121
3395
  - [DataGrid] Calling `apiRef.current.getColumnHeaderParams` returns a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
3122
3396
  - [DataGrid] Events that follow the pattern `GRID_COLUMN_HEADER_xxx` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
3123
3397
  - [DataGrid] The `renderHeader` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
@@ -3485,7 +3759,7 @@ _Jan 14, 2021_
3485
3759
  Big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
3486
3760
 
3487
3761
  - 🎛 Add support for Column selector (#837) @DanailH @dtassone.
3488
- The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/columns/#column-selector).
3762
+ The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/column-definition/#column-selector).
3489
3763
 
3490
3764
  ![column selector](https://user-images.githubusercontent.com/3165635/104791267-6ff77300-579a-11eb-9338-11a8fde83258.gif)
3491
3765
 
@@ -1,13 +1,29 @@
1
1
  import * as React from 'react';
2
- import { ExportedCalendarProps } from './DayPicker';
2
+ import { ExportedMonthPickerProps } from '../MonthPicker/MonthPicker';
3
+ import { ExportedDayPickerProps } from './DayPicker';
3
4
  import { PickerOnChangeFn } from '../internals/hooks/useViews';
4
- import { ExportedCalendarHeaderProps } from './PickersCalendarHeader';
5
+ import { ExportedCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from './PickersCalendarHeader';
5
6
  import { ExportedYearPickerProps } from '../YearPicker/YearPicker';
6
7
  import { CalendarPickerView } from '../internals/models';
7
8
  import { CalendarPickerClasses } from './calendarPickerClasses';
8
- export interface CalendarPickerProps<TDate> extends ExportedCalendarProps<TDate>, ExportedYearPickerProps<TDate>, ExportedCalendarHeaderProps<TDate> {
9
+ export interface CalendarPickerSlotsComponent extends PickersCalendarHeaderSlotsComponent {
10
+ }
11
+ export interface CalendarPickerSlotsComponentsProps extends PickersCalendarHeaderSlotsComponentsProps {
12
+ }
13
+ export interface CalendarPickerProps<TDate> extends ExportedDayPickerProps<TDate>, ExportedYearPickerProps<TDate>, ExportedMonthPickerProps<TDate>, ExportedCalendarHeaderProps<TDate> {
9
14
  className?: string;
10
15
  classes?: Partial<CalendarPickerClasses>;
16
+ /**
17
+ * The components used for each slot.
18
+ * Either a string to use an HTML element or a component.
19
+ * @default {}
20
+ */
21
+ components?: Partial<CalendarPickerSlotsComponent>;
22
+ /**
23
+ * The props used for each slot inside.
24
+ * @default {}
25
+ */
26
+ componentsProps?: Partial<CalendarPickerSlotsComponentsProps>;
11
27
  date: TDate | null;
12
28
  /**
13
29
  * Default calendar month displayed when `value={null}`.
@@ -43,12 +59,6 @@ export interface CalendarPickerProps<TDate> extends ExportedCalendarProps<TDate>
43
59
  * Callback fired on date change
44
60
  */
45
61
  onChange: PickerOnChangeFn<TDate>;
46
- /**
47
- * Callback firing on month change. @DateIOType
48
- * @template TDate
49
- * @param {TDate} month The new month.
50
- */
51
- onMonthChange?: (month: TDate) => void;
52
62
  /**
53
63
  * Initially open view.
54
64
  * @default 'day'
@@ -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", "shouldDisableYear", "view", "views", "openTo", "className"];
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"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -81,11 +81,14 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
81
81
  children: "..."
82
82
  }),
83
83
  shouldDisableDate,
84
+ shouldDisableMonth,
84
85
  shouldDisableYear,
85
86
  view,
86
87
  views = ['year', 'day'],
87
88
  openTo = 'day',
88
- className
89
+ className,
90
+ disabled,
91
+ readOnly
89
92
  } = props,
90
93
  other = _objectWithoutPropertiesLoose(props, _excluded);
91
94
 
@@ -121,6 +124,14 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
121
124
  disablePast,
122
125
  disableFuture
123
126
  });
127
+ const onSelectedDayChange = React.useCallback((day, isFinish) => {
128
+ if (date && day) {
129
+ // If there is a date already selected, then we want to keep its time
130
+ return onChange(utils.mergeDateAndTime(day, date), isFinish);
131
+ }
132
+
133
+ return onChange(day, isFinish);
134
+ }, [utils, date, onChange]);
124
135
  React.useEffect(() => {
125
136
  if (date && isDateDisabled(date)) {
126
137
  const closestEnabledDate = findClosestEnabledDate({
@@ -149,15 +160,19 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
149
160
  const monthPickerProps = {
150
161
  className,
151
162
  date,
152
- disabled: other.disabled,
163
+ disabled,
153
164
  disablePast,
154
165
  disableFuture,
155
166
  onChange,
156
167
  minDate,
157
168
  maxDate,
169
+ shouldDisableMonth,
158
170
  onMonthChange,
159
- readOnly: other.readOnly
160
- };
171
+ readOnly
172
+ }; // When disable, limit the view to the selected date
173
+
174
+ const minDateWithDisabled = disabled && date || minDate;
175
+ const maxDateWithDisabled = disabled && date || maxDate;
161
176
  return /*#__PURE__*/_jsxs(CalendarPickerRoot, {
162
177
  ref: ref,
163
178
  className: clsx(classes.root, className),
@@ -171,8 +186,9 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
171
186
  newMonth,
172
187
  direction
173
188
  }),
174
- minDate: minDate,
175
- maxDate: maxDate,
189
+ minDate: minDateWithDisabled,
190
+ maxDate: maxDateWithDisabled,
191
+ disabled: disabled,
176
192
  disablePast: disablePast,
177
193
  disableFuture: disableFuture,
178
194
  reduceAnimations: reduceAnimations
@@ -192,17 +208,21 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
192
208
  disablePast: disablePast,
193
209
  isDateDisabled: isDateDisabled,
194
210
  shouldDisableYear: shouldDisableYear,
195
- onFocusedDayChange: changeFocusedDay
211
+ onFocusedDayChange: changeFocusedDay,
212
+ disabled: disabled,
213
+ readOnly: readOnly
196
214
  })), openView === 'month' && /*#__PURE__*/_jsx(MonthPicker, _extends({}, monthPickerProps)), openView === 'day' && /*#__PURE__*/_jsx(DayPicker, _extends({}, other, calendarState, {
197
215
  autoFocus: autoFocus,
198
216
  onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
199
217
  onFocusedDayChange: changeFocusedDay,
200
218
  reduceAnimations: reduceAnimations,
201
- date: date,
202
- onChange: onChange,
219
+ selectedDays: [date],
220
+ onSelectedDaysChange: onSelectedDayChange,
203
221
  isDateDisabled: isDateDisabled,
204
222
  loading: loading,
205
- renderLoading: renderLoading
223
+ renderLoading: renderLoading,
224
+ disabled: disabled,
225
+ readOnly: readOnly
206
226
  }))]
207
227
  })
208
228
  })]
@@ -213,12 +233,6 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
213
233
  // | These PropTypes are generated from the TypeScript type definitions |
214
234
  // | To update them edit the TypeScript types and run "yarn proptypes" |
215
235
  // ----------------------------------------------------------------------
216
-
217
- /**
218
- * If `true`, `onChange` is fired on click even if the same date is selected.
219
- * @default false
220
- */
221
- allowSameDateSelection: PropTypes.bool,
222
236
  autoFocus: PropTypes.bool,
223
237
  classes: PropTypes.object,
224
238
  className: PropTypes.string,
@@ -273,6 +287,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
273
287
 
274
288
  /**
275
289
  * Left arrow icon aria-label text.
290
+ * @deprecated
276
291
  */
277
292
  leftArrowButtonText: PropTypes.string,
278
293
 
@@ -299,9 +314,10 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
299
314
  onChange: PropTypes.func.isRequired,
300
315
 
301
316
  /**
302
- * Callback firing on month change. @DateIOType
317
+ * Callback firing on month change @DateIOType.
303
318
  * @template TDate
304
- * @param {TDate} month The new month.
319
+ * @param {TDate} month The new year.
320
+ * @returns {void|Promise} -
305
321
  */
306
322
  onMonthChange: PropTypes.func,
307
323
 
@@ -340,7 +356,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
340
356
  * Custom renderer for day. Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
341
357
  * @template TDate
342
358
  * @param {TDate} day The day to render.
343
- * @param {Array<TDate | null>} selectedDates The dates currently selected.
359
+ * @param {Array<TDate | null>} selectedDays The days currently selected.
344
360
  * @param {PickersDayProps<TDate>} pickersDayProps The props of the day to render.
345
361
  * @returns {JSX.Element} The element representing the day.
346
362
  */
@@ -355,6 +371,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
355
371
 
356
372
  /**
357
373
  * Right arrow icon aria-label text.
374
+ * @deprecated
358
375
  */
359
376
  rightArrowButtonText: PropTypes.string,
360
377
 
@@ -366,6 +383,15 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
366
383
  */
367
384
  shouldDisableDate: PropTypes.func,
368
385
 
386
+ /**
387
+ * Disable specific months dynamically.
388
+ * Works like `shouldDisableDate` but for month selection view @DateIOType.
389
+ * @template TDate
390
+ * @param {TDate} month The month to check.
391
+ * @returns {boolean} If `true` the month will be disabled.
392
+ */
393
+ shouldDisableMonth: PropTypes.func,
394
+
369
395
  /**
370
396
  * Disable specific years dynamically.
371
397
  * Works like `shouldDisableDate` but for year selection view @DateIOType.
@@ -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
- export interface ExportedCalendarProps<TDate> extends Pick<PickersDayProps<TDate>, 'disableHighlightToday' | 'showDaysOutsideCurrentMonth' | 'allowSameDateSelection'> {
5
+ export interface ExportedDayPickerProps<TDate> extends Pick<PickersDayProps<TDate>, 'disableHighlightToday' | 'showDaysOutsideCurrentMonth'> {
6
6
  autoFocus?: boolean;
7
7
  /**
8
8
  * If `true` renders `LoadingComponent` in calendar instead of calendar view.
@@ -10,19 +10,15 @@ export interface ExportedCalendarProps<TDate> extends Pick<PickersDayProps<TDate
10
10
  * @default false
11
11
  */
12
12
  loading?: boolean;
13
- /**
14
- * Calendar onChange.
15
- */
16
- onChange: PickerOnChangeFn<TDate>;
17
13
  /**
18
14
  * Custom renderer for day. Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
19
15
  * @template TDate
20
16
  * @param {TDate} day The day to render.
21
- * @param {Array<TDate | null>} selectedDates The dates currently selected.
17
+ * @param {Array<TDate | null>} selectedDays The days currently selected.
22
18
  * @param {PickersDayProps<TDate>} pickersDayProps The props of the day to render.
23
19
  * @returns {JSX.Element} The element representing the day.
24
20
  */
25
- renderDay?: (day: TDate, selectedDates: Array<TDate | null>, pickersDayProps: PickersDayProps<TDate>) => JSX.Element;
21
+ renderDay?: (day: TDate, selectedDays: TDate[], pickersDayProps: PickersDayProps<TDate>) => JSX.Element;
26
22
  /**
27
23
  * Component displaying when passed `loading` true.
28
24
  * @returns {React.ReactNode} The node to render when loading.
@@ -30,11 +26,12 @@ export interface ExportedCalendarProps<TDate> extends Pick<PickersDayProps<TDate
30
26
  */
31
27
  renderLoading?: () => React.ReactNode;
32
28
  }
33
- export interface PickersCalendarProps<TDate> extends ExportedCalendarProps<TDate> {
29
+ export interface DayPickerProps<TDate> extends ExportedDayPickerProps<TDate> {
34
30
  autoFocus?: boolean;
35
31
  className?: string;
36
32
  currentMonth: TDate;
37
- date: TDate | [TDate | null, TDate | null] | null;
33
+ selectedDays: (TDate | null)[];
34
+ onSelectedDaysChange: PickerOnChangeFn<TDate>;
38
35
  disabled?: boolean;
39
36
  focusedDay: TDate | null;
40
37
  isDateDisabled: (day: TDate) => boolean;
@@ -49,4 +46,4 @@ export interface PickersCalendarProps<TDate> extends ExportedCalendarProps<TDate
49
46
  /**
50
47
  * @ignore - do not document.
51
48
  */
52
- export declare function DayPicker<TDate>(props: PickersCalendarProps<TDate>): JSX.Element;
49
+ export declare function DayPicker<TDate>(props: DayPickerProps<TDate>): JSX.Element;