@mui/x-date-pickers 6.18.1 → 7.0.0-alpha.1

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 (269) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +4 -15
  2. package/AdapterDateFns/AdapterDateFns.js +8 -90
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +4 -15
  4. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
  5. package/AdapterDayjs/AdapterDayjs.d.ts +5 -17
  6. package/AdapterDayjs/AdapterDayjs.js +11 -60
  7. package/AdapterLuxon/AdapterLuxon.d.ts +4 -15
  8. package/AdapterLuxon/AdapterLuxon.js +16 -76
  9. package/AdapterMoment/AdapterMoment.d.ts +4 -20
  10. package/AdapterMoment/AdapterMoment.js +9 -66
  11. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +1 -7
  12. package/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
  13. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +1 -9
  14. package/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
  15. package/CHANGELOG.md +558 -1
  16. package/DateCalendar/DateCalendar.js +4 -21
  17. package/DateCalendar/DateCalendar.types.d.ts +12 -3
  18. package/DateCalendar/DayCalendar.d.ts +13 -5
  19. package/DateCalendar/DayCalendar.js +12 -21
  20. package/DateCalendar/index.d.ts +0 -1
  21. package/DateCalendar/index.js +1 -3
  22. package/DateCalendar/useCalendarState.js +2 -3
  23. package/DateField/DateField.js +5 -21
  24. package/DateField/DateField.types.d.ts +12 -3
  25. package/DatePicker/DatePicker.js +0 -13
  26. package/DatePicker/DatePicker.types.d.ts +1 -14
  27. package/DatePicker/shared.d.ts +4 -16
  28. package/DatePicker/shared.js +2 -5
  29. package/DateTimeField/DateTimeField.js +5 -21
  30. package/DateTimeField/DateTimeField.types.d.ts +2 -15
  31. package/DateTimePicker/DateTimePicker.js +0 -13
  32. package/DateTimePicker/DateTimePicker.types.d.ts +1 -14
  33. package/DateTimePicker/shared.d.ts +4 -17
  34. package/DateTimePicker/shared.js +4 -7
  35. package/DesktopDatePicker/DesktopDatePicker.js +0 -13
  36. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -15
  37. package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
  38. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -15
  39. package/DesktopTimePicker/DesktopTimePicker.js +0 -12
  40. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -15
  41. package/DigitalClock/DigitalClock.js +18 -26
  42. package/DigitalClock/DigitalClock.types.d.ts +2 -15
  43. package/LocalizationProvider/LocalizationProvider.js +0 -6
  44. package/MobileDatePicker/MobileDatePicker.js +0 -13
  45. package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -15
  46. package/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
  47. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -15
  48. package/MobileTimePicker/MobileTimePicker.js +0 -12
  49. package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -15
  50. package/MonthCalendar/MonthCalendar.js +3 -7
  51. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  52. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -15
  53. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -1
  54. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  55. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -2
  56. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  57. package/PickersCalendarHeader/PickersCalendarHeader.js +14 -20
  58. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -16
  59. package/PickersLayout/PickersLayout.js +0 -12
  60. package/PickersLayout/PickersLayout.types.d.ts +6 -19
  61. package/PickersLayout/usePickerLayout.js +2 -7
  62. package/StaticDatePicker/StaticDatePicker.js +0 -13
  63. package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -14
  64. package/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
  65. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -14
  66. package/StaticTimePicker/StaticTimePicker.js +0 -12
  67. package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -14
  68. package/TimeClock/TimeClock.js +3 -20
  69. package/TimeClock/TimeClock.types.d.ts +1 -14
  70. package/TimeField/TimeField.js +5 -21
  71. package/TimeField/TimeField.types.d.ts +2 -15
  72. package/TimePicker/TimePicker.js +0 -12
  73. package/TimePicker/TimePicker.types.d.ts +1 -14
  74. package/TimePicker/shared.d.ts +3 -16
  75. package/TimePicker/shared.js +4 -7
  76. package/YearCalendar/YearCalendar.js +4 -8
  77. package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
  78. package/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
  79. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  80. package/dateViewRenderers/dateViewRenderers.js +0 -4
  81. package/hooks/useClearableField.d.ts +1 -3
  82. package/hooks/useClearableField.js +6 -8
  83. package/index.d.ts +1 -0
  84. package/index.js +4 -1
  85. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +10 -6
  86. package/internals/components/PickersModalDialog.d.ts +4 -5
  87. package/internals/components/PickersPopper.d.ts +5 -6
  88. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -8
  89. package/internals/hooks/useField/useField.types.d.ts +2 -2
  90. package/internals/hooks/useField/useField.utils.js +0 -1
  91. package/internals/hooks/useField/useFieldState.js +1 -1
  92. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -4
  93. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -14
  94. package/internals/index.d.ts +0 -2
  95. package/internals/index.js +0 -1
  96. package/internals/utils/getDefaultReferenceDate.d.ts +1 -2
  97. package/internals/utils/getDefaultReferenceDate.js +0 -4
  98. package/legacy/AdapterDateFns/AdapterDateFns.js +11 -92
  99. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +11 -92
  100. package/legacy/AdapterDayjs/AdapterDayjs.js +15 -63
  101. package/legacy/AdapterLuxon/AdapterLuxon.js +19 -78
  102. package/legacy/AdapterMoment/AdapterMoment.js +12 -70
  103. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -30
  104. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -40
  105. package/legacy/DateCalendar/DateCalendar.js +4 -21
  106. package/legacy/DateCalendar/DayCalendar.js +10 -16
  107. package/legacy/DateCalendar/index.js +1 -3
  108. package/legacy/DateCalendar/useCalendarState.js +2 -3
  109. package/legacy/DateField/DateField.js +6 -22
  110. package/legacy/DatePicker/DatePicker.js +0 -13
  111. package/legacy/DatePicker/shared.js +2 -5
  112. package/legacy/DateTimeField/DateTimeField.js +6 -22
  113. package/legacy/DateTimePicker/DateTimePicker.js +0 -13
  114. package/legacy/DateTimePicker/shared.js +4 -7
  115. package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -13
  116. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
  117. package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -12
  118. package/legacy/DigitalClock/DigitalClock.js +20 -26
  119. package/legacy/LocalizationProvider/LocalizationProvider.js +0 -6
  120. package/legacy/MobileDatePicker/MobileDatePicker.js +0 -13
  121. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
  122. package/legacy/MobileTimePicker/MobileTimePicker.js +0 -12
  123. package/legacy/MonthCalendar/MonthCalendar.js +3 -6
  124. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -18
  125. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  126. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +15 -10
  127. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +14 -20
  128. package/legacy/PickersLayout/PickersLayout.js +0 -12
  129. package/legacy/PickersLayout/usePickerLayout.js +2 -7
  130. package/legacy/StaticDatePicker/StaticDatePicker.js +0 -13
  131. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
  132. package/legacy/StaticTimePicker/StaticTimePicker.js +0 -12
  133. package/legacy/TimeClock/TimeClock.js +3 -20
  134. package/legacy/TimeField/TimeField.js +5 -21
  135. package/legacy/TimePicker/TimePicker.js +0 -12
  136. package/legacy/TimePicker/shared.js +4 -7
  137. package/legacy/YearCalendar/YearCalendar.js +4 -7
  138. package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
  139. package/legacy/dateViewRenderers/dateViewRenderers.js +0 -4
  140. package/legacy/hooks/useClearableField.js +6 -8
  141. package/legacy/index.js +4 -1
  142. package/legacy/internals/hooks/useField/useField.utils.js +0 -1
  143. package/legacy/internals/hooks/useField/useFieldState.js +1 -1
  144. package/legacy/internals/index.js +0 -1
  145. package/legacy/internals/utils/getDefaultReferenceDate.js +0 -6
  146. package/legacy/locales/esES.js +6 -7
  147. package/legacy/locales/eu.js +94 -0
  148. package/legacy/locales/index.js +1 -0
  149. package/legacy/timeViewRenderers/timeViewRenderers.js +0 -12
  150. package/locales/esES.js +6 -7
  151. package/locales/eu.d.ts +54 -0
  152. package/locales/eu.js +58 -0
  153. package/locales/index.d.ts +1 -0
  154. package/locales/index.js +1 -0
  155. package/models/adapters.d.ts +10 -135
  156. package/models/fields.d.ts +0 -6
  157. package/modern/AdapterDateFns/AdapterDateFns.js +8 -90
  158. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
  159. package/modern/AdapterDayjs/AdapterDayjs.js +11 -59
  160. package/modern/AdapterLuxon/AdapterLuxon.js +16 -76
  161. package/modern/AdapterMoment/AdapterMoment.js +9 -65
  162. package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
  163. package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
  164. package/modern/DateCalendar/DateCalendar.js +3 -20
  165. package/modern/DateCalendar/DayCalendar.js +11 -19
  166. package/modern/DateCalendar/index.js +1 -3
  167. package/modern/DateCalendar/useCalendarState.js +2 -3
  168. package/modern/DateField/DateField.js +4 -20
  169. package/modern/DatePicker/DatePicker.js +0 -13
  170. package/modern/DatePicker/shared.js +1 -4
  171. package/modern/DateTimeField/DateTimeField.js +4 -20
  172. package/modern/DateTimePicker/DateTimePicker.js +0 -13
  173. package/modern/DateTimePicker/shared.js +3 -6
  174. package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -13
  175. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
  176. package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -12
  177. package/modern/DigitalClock/DigitalClock.js +17 -25
  178. package/modern/LocalizationProvider/LocalizationProvider.js +0 -6
  179. package/modern/MobileDatePicker/MobileDatePicker.js +0 -13
  180. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
  181. package/modern/MobileTimePicker/MobileTimePicker.js +0 -12
  182. package/modern/MonthCalendar/MonthCalendar.js +3 -7
  183. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  184. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  185. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  186. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +13 -19
  187. package/modern/PickersLayout/PickersLayout.js +0 -12
  188. package/modern/PickersLayout/usePickerLayout.js +2 -7
  189. package/modern/StaticDatePicker/StaticDatePicker.js +0 -13
  190. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
  191. package/modern/StaticTimePicker/StaticTimePicker.js +0 -12
  192. package/modern/TimeClock/TimeClock.js +3 -20
  193. package/modern/TimeField/TimeField.js +4 -20
  194. package/modern/TimePicker/TimePicker.js +0 -12
  195. package/modern/TimePicker/shared.js +3 -6
  196. package/modern/YearCalendar/YearCalendar.js +4 -8
  197. package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
  198. package/modern/dateViewRenderers/dateViewRenderers.js +0 -4
  199. package/modern/hooks/useClearableField.js +5 -7
  200. package/modern/index.js +4 -1
  201. package/modern/internals/hooks/useField/useField.utils.js +0 -1
  202. package/modern/internals/hooks/useField/useFieldState.js +1 -1
  203. package/modern/internals/index.js +0 -1
  204. package/modern/internals/utils/getDefaultReferenceDate.js +0 -1
  205. package/modern/locales/esES.js +6 -7
  206. package/modern/locales/eu.js +58 -0
  207. package/modern/locales/index.js +1 -0
  208. package/modern/timeViewRenderers/timeViewRenderers.js +0 -12
  209. package/node/AdapterDateFns/AdapterDateFns.js +8 -90
  210. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
  211. package/node/AdapterDayjs/AdapterDayjs.js +11 -59
  212. package/node/AdapterLuxon/AdapterLuxon.js +16 -76
  213. package/node/AdapterMoment/AdapterMoment.js +9 -65
  214. package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
  215. package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
  216. package/node/DateCalendar/DateCalendar.js +3 -20
  217. package/node/DateCalendar/DayCalendar.js +11 -19
  218. package/node/DateCalendar/index.js +1 -21
  219. package/node/DateCalendar/useCalendarState.js +1 -2
  220. package/node/DateField/DateField.js +4 -20
  221. package/node/DatePicker/DatePicker.js +0 -13
  222. package/node/DatePicker/shared.js +1 -4
  223. package/node/DateTimeField/DateTimeField.js +4 -20
  224. package/node/DateTimePicker/DateTimePicker.js +0 -13
  225. package/node/DateTimePicker/shared.js +3 -6
  226. package/node/DesktopDatePicker/DesktopDatePicker.js +0 -13
  227. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
  228. package/node/DesktopTimePicker/DesktopTimePicker.js +0 -12
  229. package/node/DigitalClock/DigitalClock.js +17 -25
  230. package/node/LocalizationProvider/LocalizationProvider.js +0 -6
  231. package/node/MobileDatePicker/MobileDatePicker.js +0 -13
  232. package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
  233. package/node/MobileTimePicker/MobileTimePicker.js +0 -12
  234. package/node/MonthCalendar/MonthCalendar.js +3 -7
  235. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  236. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  237. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  238. package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -19
  239. package/node/PickersLayout/PickersLayout.js +0 -12
  240. package/node/PickersLayout/usePickerLayout.js +2 -7
  241. package/node/StaticDatePicker/StaticDatePicker.js +0 -13
  242. package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
  243. package/node/StaticTimePicker/StaticTimePicker.js +0 -12
  244. package/node/TimeClock/TimeClock.js +3 -20
  245. package/node/TimeField/TimeField.js +4 -20
  246. package/node/TimePicker/TimePicker.js +0 -12
  247. package/node/TimePicker/shared.js +3 -6
  248. package/node/YearCalendar/YearCalendar.js +4 -8
  249. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
  250. package/node/dateViewRenderers/dateViewRenderers.js +0 -4
  251. package/node/hooks/useClearableField.js +5 -7
  252. package/node/index.js +13 -1
  253. package/node/internals/hooks/useField/useField.utils.js +0 -1
  254. package/node/internals/hooks/useField/useFieldState.js +1 -1
  255. package/node/internals/index.js +0 -7
  256. package/node/internals/utils/getDefaultReferenceDate.js +1 -3
  257. package/node/locales/esES.js +6 -7
  258. package/node/locales/eu.js +64 -0
  259. package/node/locales/index.js +11 -0
  260. package/node/timeViewRenderers/timeViewRenderers.js +0 -12
  261. package/package.json +1 -1
  262. package/themeAugmentation/overrides.d.ts +1 -1
  263. package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
  264. package/timeViewRenderers/timeViewRenderers.js +0 -12
  265. package/internals/utils/slots-migration.d.ts +0 -36
  266. package/internals/utils/slots-migration.js +0 -13
  267. package/legacy/internals/utils/slots-migration.js +0 -14
  268. package/modern/internals/utils/slots-migration.js +0 -13
  269. package/node/internals/utils/slots-migration.js +0 -21
package/CHANGELOG.md CHANGED
@@ -3,6 +3,562 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.0.0-alpha.1
7
+
8
+ _Nov 17, 2023_
9
+
10
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+ - 📚 Documentation improvements
14
+
15
+ ### Date Pickers
16
+
17
+ #### `@mui/x-date-pickers@7.0.0-alpha.1` / `@mui/x-date-pickers-pro@7.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
18
+
19
+ #### Breaking changes
20
+
21
+ - The string argument of the `dayOfWeekFormatter` prop has been replaced in favor of the date object to allow more flexibility.
22
+
23
+ ```diff
24
+ <DateCalendar
25
+ // If you were still using the day string, you can get it back with your date library.
26
+ - dayOfWeekFormatter={dayStr => `${dayStr}.`}
27
+ + dayOfWeekFormatter={day => `${day.format('dd')}.`}
28
+
29
+ // If you were already using the day object, just remove the first argument.
30
+ - dayOfWeekFormatter={(_dayStr, day) => `${day.format('dd')}.`}
31
+ + dayOfWeekFormatter={day => `${day.format('dd')}.`}
32
+ />
33
+ ```
34
+
35
+ - The imports related to the `calendarHeader` slot have been moved from `@mui/x-date-pickers/DateCalendar` to `@mui/x-date-pickers/PIckersCalendarHeader`:
36
+
37
+ ```diff
38
+ export {
39
+ pickersCalendarHeaderClasses,
40
+ PickersCalendarHeaderClassKey,
41
+ PickersCalendarHeaderClasses,
42
+ PickersCalendarHeader,
43
+ PickersCalendarHeaderProps,
44
+ PickersCalendarHeaderSlotsComponent,
45
+ PickersCalendarHeaderSlotsComponentsProps,
46
+ ExportedPickersCalendarHeaderProps,
47
+ - } from '@mui/x-date-pickers/DateCalendar';
48
+ + } from '@mui/x-date-pickers/PickersCalendarHeader';
49
+
50
+ ```
51
+
52
+ - The `monthAndYear` format has been removed.
53
+ It was used in the header of the calendar views, you can replace it with the new `format` prop of the `calendarHeader` slot:
54
+
55
+ ```diff
56
+ <LocalizationProvider
57
+ adapter={AdapterDayJS}
58
+ - formats={{ monthAndYear: 'MM/YYYY' }}
59
+ />
60
+ <DatePicker
61
+ + slotProps={{ calendarHeader: { format: 'MM/YYYY' }}}
62
+ />
63
+ <DateRangePicker
64
+ + slotProps={{ calendarHeader: { format: 'MM/YYYY' }}}
65
+ />
66
+ <LocalizationProvider />
67
+ ```
68
+
69
+ - The `adapter.getDiff` method have been removed, you can directly use your date library:
70
+
71
+ ```diff
72
+ // For Day.js
73
+ - const diff = adapter.getDiff(value, comparing, unit);
74
+ + const diff = value.diff(comparing, unit);
75
+
76
+ // For Luxon
77
+ - const diff = adapter.getDiff(value, comparing, unit);
78
+ + const getDiff = (value: DateTime, comparing: DateTime | string, unit?: AdapterUnits) => {
79
+ + const parsedComparing = typeof comparing === 'string'
80
+ + ? DateTime.fromJSDate(new Date(comparing))
81
+ + : comparing;
82
+ + if (unit) {
83
+ + return Math.floor(value.diff(comparing).as(unit));
84
+ + }
85
+ + return value.diff(comparing).as('millisecond');
86
+ + };
87
+ +
88
+ + const diff = getDiff(value, comparing, unit);
89
+
90
+ // For DateFns
91
+ - const diff = adapter.getDiff(value, comparing, unit);
92
+ + const getDiff = (value: Date, comparing: Date | string, unit?: AdapterUnits) => {
93
+ + const parsedComparing = typeof comparing === 'string' ? new Date(comparing) : comparing;
94
+ + switch (unit) {
95
+ + case 'years':
96
+ + return dateFns.differenceInYears(value, parsedComparing);
97
+ + case 'quarters':
98
+ + return dateFns.differenceInQuarters(value, parsedComparing);
99
+ + case 'months':
100
+ + return dateFns.differenceInMonths(value, parsedComparing);
101
+ + case 'weeks':
102
+ + return dateFns.differenceInWeeks(value, parsedComparing);
103
+ + case 'days':
104
+ + return dateFns.differenceInDays(value, parsedComparing);
105
+ + case 'hours':
106
+ + return dateFns.differenceInHours(value, parsedComparing);
107
+ + case 'minutes':
108
+ + return dateFns.differenceInMinutes(value, parsedComparing);
109
+ + case 'seconds':
110
+ + return dateFns.differenceInSeconds(value, parsedComparing);
111
+ + default: {
112
+ + return dateFns.differenceInMilliseconds(value, parsedComparing);
113
+ + }
114
+ + }
115
+ + };
116
+ +
117
+ + const diff = getDiff(value, comparing, unit);
118
+
119
+ // For Moment
120
+ - const diff = adapter.getDiff(value, comparing, unit);
121
+ + const diff = value.diff(comparing, unit);
122
+ ```
123
+
124
+ - The `adapter.getFormatHelperText` method have been removed, you can use the `adapter.expandFormat` instead:
125
+
126
+ ```diff
127
+ - const expandedFormat = adapter.getFormatHelperText(format);
128
+ + const expandedFormat = adapter.expandFormat(format);
129
+ ```
130
+
131
+ And if you need the exact same output you can apply the following transformation:
132
+
133
+ ```diff
134
+ // For Day.js
135
+ - const expandedFormat = adapter.getFormatHelperText(format);
136
+ + const expandedFormat = adapter.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
137
+
138
+ // For Luxon
139
+ - const expandedFormat = adapter.getFormatHelperText(format);
140
+ + const expandedFormat = adapter.expandFormat(format).replace(/(a)/g, '(a|p)m').toLocaleLowerCase();
141
+
142
+ // For DateFns
143
+ - const expandedFormat = adapter.getFormatHelperText(format);
144
+ + const expandedFormat = adapter.expandFormat(format).replace(/(aaa|aa|a)/g, '(a|p)m').toLocaleLowerCase();
145
+
146
+ // For Moment
147
+ - const expandedFormat = adapter.getFormatHelperText(format);
148
+ + const expandedFormat = adapter.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
149
+ ```
150
+
151
+ - The `adapter.getMeridiemText` method have been removed, you can use the `adapter.setHours`, `adapter.date` and `adapter.format` methods to recreate its behavior:
152
+
153
+ ```diff
154
+ - const meridiem = adapter.getMeridiemText('am');
155
+ + const getMeridiemText = (meridiem: 'am' | 'pm') => {
156
+ + const date = adapter.setHours(adapter.date()!, meridiem === 'am' ? 2 : 14);
157
+ + return utils.format(date, 'meridiem');
158
+ + };
159
+ +
160
+ + const meridiem = getMeridiemText('am');
161
+ ```
162
+
163
+ - The `adapter.getMonthArray` method have been removed, you can use the `adapter.startOfYear` and `adapter.addMonths` methods to recreate its behavior:
164
+
165
+ ```diff
166
+ - const monthArray = adapter.getMonthArray(value);
167
+ + const getMonthArray = (year) => {
168
+ + const firstMonth = utils.startOfYear(year);
169
+ + const months = [firstMonth];
170
+ +
171
+ + while (months.length < 12) {
172
+ + const prevMonth = months[months.length - 1];
173
+ + months.push(utils.addMonths(prevMonth, 1));
174
+ + }
175
+ +
176
+ + return months;
177
+ + }
178
+ +
179
+ + const monthArray = getMonthArray(value);
180
+ ```
181
+
182
+ - The `adapter.getNextMonth` method have been removed, you can use the `adapter.addMonths` method instead:
183
+
184
+ ```diff
185
+ - const nextMonth = adapter.getNextMonth(value);
186
+ + const nextMonth = adapter.addMonths(value, 1);
187
+ ```
188
+
189
+ - The `adapter.getPreviousMonth` method have been removed, you can use the `adapter.addMonths` method instead:
190
+
191
+ ```diff
192
+ - const previousMonth = adapter.getPreviousMonth(value);
193
+ + const previousMonth = adapter.addMonths(value, -1);
194
+ ```
195
+
196
+ - The `adapter.getWeekdays` method have been removed, you can use the `adapter.startOfWeek` and `adapter.addDays` methods instead:
197
+
198
+ ```diff
199
+ - const weekDays = adapter.getWeekdays(value);
200
+ + const getWeekdays = (value) => {
201
+ + const start = adapter.startOfWeek(value);
202
+ + return [0, 1, 2, 3, 4, 5, 6].map((diff) => utils.addDays(start, diff));
203
+ + };
204
+ +
205
+ + const weekDays = getWeekdays(value);
206
+ ```
207
+
208
+ - The `isNull` method have been removed, you can replace it with a very basic check:
209
+
210
+ ```diff
211
+ - const isNull = adapter.isNull(value);
212
+ + const isNull = value === null;
213
+ ```
214
+
215
+ - The `adapter.mergeDateAndTime` method have been removed, you can use the `adapter.setHours`, `adapter.setMinutes`, and `adapter.setSeconds` methods to recreate its behavior:
216
+
217
+ ```diff
218
+ - const result = adapter.mergeDateAndTime(valueWithDate, valueWithTime);
219
+ + const mergeDateAndTime = <TDate>(
220
+ + dateParam,
221
+ + timeParam,
222
+ + ) => {
223
+ + let mergedDate = dateParam;
224
+ + mergedDate = utils.setHours(mergedDate, utils.getHours(timeParam));
225
+ + mergedDate = utils.setMinutes(mergedDate, utils.getMinutes(timeParam));
226
+ + mergedDate = utils.setSeconds(mergedDate, utils.getSeconds(timeParam));
227
+ +
228
+ + return mergedDate;
229
+ + };
230
+ +
231
+ + const result = mergeDateAndTime(valueWithDate, valueWithTime);
232
+ ```
233
+
234
+ - The `adapter.parseISO` method have been removed, you can directly use your date library:
235
+
236
+ ```diff
237
+ // For Day.js
238
+ - const value = adapter.parseISO(isoString);
239
+ + const value = dayjs(isoString);
240
+
241
+ // For Luxon
242
+ - const value = adapter.parseISO(isoString);
243
+ + const value = DateTime.fromISO(isoString);
244
+
245
+ // For DateFns
246
+ - const value = adapter.parseISO(isoString);
247
+ + const value = dateFns.parseISO(isoString);
248
+
249
+ // For Moment
250
+ - const value = adapter.parseISO(isoString);
251
+ + const value = moment(isoString, true);
252
+ ```
253
+
254
+ - The `adapter.toISO` method have been removed, you can directly use your date library:
255
+
256
+ ```diff
257
+ - const isoString = adapter.toISO(value);
258
+ + const isoString = value.toISOString();
259
+ + const isoString = value.toUTC().toISO({ format: 'extended' });
260
+ + const isoString = dateFns.formatISO(value, { format: 'extended' });
261
+ + const isoString = value.toISOString();
262
+ ```
263
+
264
+ - The `adapter.isEqual` method used to accept any type of value for its two input and tried to parse them before checking if they were equal.
265
+ The method has been simplified and now only accepts an already-parsed date or `null` (ie: the same formats used by the `value` prop in the pickers)
266
+
267
+ ```diff
268
+ const adapterDayjs = new AdapterDayjs();
269
+ const adapterLuxon = new AdapterLuxon();
270
+ const adapterDateFns = new AdapterDateFns();
271
+ const adapterMoment = new AdatperMoment();
272
+
273
+ // Supported formats
274
+ const isEqual = adapterDayjs.isEqual(null, null); // Same for the other adapters
275
+ const isEqual = adapterLuxon.isEqual(DateTime.now(), DateTime.fromISO('2022-04-17'));
276
+ const isEqual = adapterMoment.isEqual(moment(), moment('2022-04-17'));
277
+ const isEqual = adapterDateFns.isEqual(new Date(), new Date('2022-04-17'));
278
+
279
+ // Non-supported formats (JS Date)
280
+ - const isEqual = adapterDayjs.isEqual(new Date(), new Date('2022-04-17'));
281
+ + const isEqual = adapterDayjs.isEqual(dayjs(), dayjs('2022-04-17'));
282
+
283
+ - const isEqual = adapterLuxon.isEqual(new Date(), new Date('2022-04-17'));
284
+ + const isEqual = adapterLuxon.isEqual(DateTime.now(), DateTime.fromISO('2022-04-17'));
285
+
286
+ - const isEqual = adapterMoment.isEqual(new Date(), new Date('2022-04-17'));
287
+ + const isEqual = adapterMoment.isEqual(moment(), moment('2022-04-17'));
288
+
289
+ // Non-supported formats (string)
290
+ - const isEqual = adapterDayjs.isEqual('2022-04-16', '2022-04-17');
291
+ + const isEqual = adapterDayjs.isEqual(dayjs('2022-04-17'), dayjs('2022-04-17'));
292
+
293
+ - const isEqual = adapterLuxon.isEqual('2022-04-16', '2022-04-17');
294
+ + const isEqual = adapterLuxon.isEqual(DateTime.fromISO('2022-04-17'), DateTime.fromISO('2022-04-17'));
295
+
296
+ - const isEqual = adapterMoment.isEqual('2022-04-16', '2022-04-17');
297
+ + const isEqual = adapterMoment.isEqual(moment('2022-04-17'), moment('2022-04-17'));
298
+
299
+ - const isEqual = adapterDateFns.isEqual('2022-04-16', '2022-04-17');
300
+ + const isEqual = adapterDateFns.isEqual(new Date('2022-04-17'), new Date('2022-04-17'));
301
+ ```
302
+
303
+ - The `dateLibInstance` prop of `LocalizationProvider` does not work with `AdapterDayjs` anymore (#11023). This prop was used to set the pickers in UTC mode before the implementation of a proper timezone support in the components.
304
+ You can learn more about the new approach on the [dedicated doc page](https://mui.com/x/react-date-pickers/timezone/).
305
+
306
+ ```diff
307
+ // When a `value` or a `defaultValue` is provided
308
+ <LocalizationProvider
309
+ adapter={AdapterDayjs}
310
+ - dateLibInstance={dayjs.utc}
311
+ >
312
+ <DatePicker value={dayjs.utc('2022-04-17')} />
313
+ </LocalizationProvider>
314
+
315
+ // When no `value` or `defaultValue` is provided
316
+ <LocalizationProvider
317
+ adapter={AdapterDayjs}
318
+ - dateLibInstance={dayjs.utc}
319
+ >
320
+ - <DatePicker />
321
+ + <DatePicker timezone="UTC" />
322
+ </LocalizationProvider>
323
+ ```
324
+
325
+ - The property `hasLeadingZeros` has been removed from the sections in favor of the more precise `hasLeadingZerosInFormat` and `hasLeadingZerosInInput` properties (#10994). To keep the same behavior, you can replace it by `hasLeadingZerosInFormat`:
326
+
327
+ ```diff
328
+ const fieldRef = React.useRef<FieldRef<FieldSection>>(null);
329
+
330
+ React.useEffect(() => {
331
+ const firstSection = fieldRef.current!.getSections()[0]
332
+ - console.log(firstSection.hasLeadingZeros)
333
+ + console.log(firstSection.hasLeadingZerosInFormat)
334
+ }, [])
335
+
336
+ return (
337
+ <DateField unstableFieldRef={fieldRef} />
338
+ );
339
+ ```
340
+
341
+ - The `adapter.getYearRange` method used to accept two params and now accepts a tuple to be consistent with the `adapter.isWithinRange` method (#10978):
342
+
343
+ ```diff
344
+ - adapter.getYearRange(start, end);
345
+ + adapter.getYearRange([start, end])
346
+ ```
347
+
348
+ - The `adapter.isValid` method used to accept any type of value and tried to parse them before checking their validity (#10971).
349
+ The method has been simplified and now only accepts an already-parsed date or `null`.
350
+ Which is the same type as the one accepted by the components `value` prop.
351
+
352
+ ```diff
353
+ const adapterDayjs = new AdapterDayjs();
354
+ const adapterLuxon = new AdapterLuxon();
355
+ const adapterDateFns = new AdapterDateFns();
356
+ const adapterMoment = new AdatperMoment();
357
+
358
+ // Supported formats
359
+ const isValid = adapterDayjs.isValid(null); // Same for the other adapters
360
+ const isValid = adapterLuxon.isValid(DateTime.now());
361
+ const isValid = adapterMoment.isValid(moment());
362
+ const isValid = adapterDateFns.isValid(new Date());
363
+
364
+ // Non-supported formats (JS Date)
365
+ - const isValid = adapterDayjs.isValid(new Date('2022-04-17'));
366
+ + const isValid = adapterDayjs.isValid(dayjs('2022-04-17'));
367
+
368
+ - const isValid = adapterLuxon.isValid(new Date('2022-04-17'));
369
+ + const isValid = adapterLuxon.isValid(DateTime.fromISO('2022-04-17'));
370
+
371
+ - const isValid = adapterMoment.isValid(new Date('2022-04-17'));
372
+ + const isValid = adapterMoment.isValid(moment('2022-04-17'));
373
+
374
+ // Non-supported formats (string)
375
+ - const isValid = adapterDayjs.isValid('2022-04-17');
376
+ + const isValid = adapterDayjs.isValid(dayjs('2022-04-17'));
377
+
378
+ - const isValid = adapterLuxon.isValid('2022-04-17');
379
+ + const isValid = adapterLuxon.isValid(DateTime.fromISO('2022-04-17'));
380
+
381
+ - const isValid = adapterMoment.isValid('2022-04-17');
382
+ + const isValid = adapterMoment.isValid(moment('2022-04-17'));
383
+
384
+ - const isValid = adapterDateFns.isValid('2022-04-17');
385
+ + const isValid = adapterDateFns.isValid(new Date('2022-04-17'));
386
+ ```
387
+
388
+ #### Changes
389
+
390
+ - [pickers] Change the input format of `adapter.getYearRange` to be consistent with `adapter.isWithinRange` (#10978) @flaviendelangle
391
+ - [pickers] Clean remaining `components` / `componentsProps` typings (#11040) @flaviendelangle
392
+ - [pickers] Modify `adapter.isEqual` method to accept `TDate | null` instead of `any` (#10976) @flaviendelangle
393
+ - [pickers] Modify `adapter.isValid` method to accept `TDate | null` instead of `any` (#10971) @flaviendelangle
394
+ - [pickers] Remove the `hasLeadingZeros` property from `FieldSection` (#10994) @flaviendelangle
395
+ - [pickers] Remove the deprecated methods and formats from the adapters (#10776) @flaviendelangle
396
+ - [pickers] Remove the legacy UTC implementation for `dayjs` (#11023) @flaviendelangle
397
+ - [pickers] Remove unused code (#11048) @flaviendelangle
398
+ - [pickers] Move the exports of the `calendarHeader` slot to `@mui/x-date-pickers/PickersCalendarHeader` (#11020) @flaviendelangle
399
+ - [DateCalendar] Allow to override the format of the header with a prop (#10990) @flaviendelangle
400
+ - [DateCalendar] Remove the string argument of the `dayOfWeekFormatter` prop (#10992) @flaviendelangle
401
+
402
+ ### Docs
403
+
404
+ - [docs] Fix incorrect component name in the "Custom slots and subcomponents" page (#11024) @flaviendelangle
405
+ - [docs] Fix typos in pickers migration guide (#11057) @flaviendelangle
406
+
407
+ ### Core
408
+
409
+ - [core] Clean the component slots doc generation (#11021) @flaviendelangle
410
+ - [core] Fix script to release with `next` tag (#10996) @LukasTy
411
+ - [test] Wait for images to load (#11004) @cherniavskii
412
+
413
+ ## 7.0.0-alpha.0
414
+
415
+ _Nov 10, 2023_
416
+
417
+ We're thrilled to announce the first alpha release of our next major version, v7.
418
+ This release introduces a few breaking changes, paving the way for the upcoming features like Pivoting and DateTimeRangePicker.
419
+
420
+ A special shoutout to thank the 12 contributors who made this release possible. Here are some highlights ✨:
421
+
422
+ - 🚀 First v7 alpha release
423
+ - ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
424
+ - 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/)
425
+ - 💫 New recipes added for the data grid
426
+ - 📈 `<ChartsReferenceLine />` component is now available
427
+ - 🌍 Add Basque (eu) locale, improve Czech (cs-CZ) and Spanish (es-ES) locales
428
+ - 🐞 Bugfixes
429
+ - 📚 Documentation improvements
430
+
431
+ ### Data Grid
432
+
433
+ #### Breaking changes
434
+
435
+ - The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead. See [components section](/x/react-data-grid/components/) for more details.
436
+ - The print export will now only print the selected rows if there are any.
437
+ If there are no selected rows, it will print all rows. This makes the print export consistent with the other exports.
438
+ You can [customize the rows to export by using the `getRowsToExport` function](/x/react-data-grid/export/#customizing-the-rows-to-export).
439
+ - The `getApplyFilterFnV7` in `GridFilterOperator` was renamed to `getApplyFilterFn`.
440
+ If you use `getApplyFilterFnV7` directly - rename it to `getApplyFilterFn`.
441
+ - The signature of the function returned by `getApplyFilterFn` has changed for performance reasons:
442
+
443
+ ```diff
444
+ const getApplyFilterFn: GetApplyFilterFn<any, unknown> = (filterItem) => {
445
+ if (!filterItem.value) {
446
+ return null;
447
+ }
448
+ const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');
449
+ - return (cellParams) => {
450
+ - const { value } = cellParams;
451
+ + return (value, row, colDef, apiRef) => {
452
+ return value != null ? filterRegex.test(String(value)) : false;
453
+ };
454
+ }
455
+ ```
456
+
457
+ - The `getApplyQuickFilterFnV7` in `GridColDef` was renamed to `getApplyQuickFilterFn`.
458
+ If you use `getApplyQuickFilterFnV7` directly - rename it to `getApplyQuickFilterFn`.
459
+ - The signature of the function returned by `getApplyQuickFilterFn` has changed for performance reasons:
460
+
461
+ ```diff
462
+ const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown> = (value) => {
463
+ if (!value) {
464
+ return null;
465
+ }
466
+ const filterRegex = new RegExp(escapeRegExp(value), 'i');
467
+ - return (cellParams) => {
468
+ - const { formattedValue } = cellParams;
469
+ + return (value, row, column, apiRef) => {
470
+ + let formattedValue = apiRef.current.getRowFormattedValue(row, column);
471
+ return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false;
472
+ };
473
+ };
474
+ ```
475
+
476
+ #### `@mui/x-data-grid@7.0.0-alpha.0`
477
+
478
+ - [DataGrid] Fix for error thrown when removing skeleton rows, after sorting is applied (#10807) @benjaminbialy
479
+ - [DataGrid] Fix: `undefined` slot value (#10937) @romgrk
480
+ - [DataGrid] Print selected rows by default (#10846) @cherniavskii
481
+ - [DataGrid] Remove deprecated `components` and `componentsProps` (#10911) @MBilalShafi
482
+ - [DataGrid] Remove legacy filtering API (#10897) @cherniavskii
483
+ - [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10882) @michelengelen
484
+ - [DataGrid] Added a recipe for using non-native select in filter panel (#10916) @michelengelen
485
+ - [DataGrid] Added a recipe to style cells without impacting the aggregation cells (#10913) @michelengelen
486
+ - [l10n] Improve Czech (cs-CZ) locale (#10949) @luborepka
487
+
488
+ #### `@mui/x-data-grid-pro@7.0.0-alpha.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
489
+
490
+ Same changes as in `@mui/x-data-grid@7.0.0-alpha.0`, plus:
491
+
492
+ - [DataGridPro] Autosize Columns - Fix headers being cut off (#10666) @gitstart
493
+ - [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
494
+
495
+ #### `@mui/x-data-grid-premium@7.0.0-alpha.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
496
+
497
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.0`, plus:
498
+
499
+ - [DataGridPremium] Render aggregation label when `renderHeader` is used (#10936) @cherniavskii
500
+
501
+ ### Date Pickers
502
+
503
+ #### Breaking changes
504
+
505
+ - The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead.
506
+
507
+ #### `@mui/x-date-pickers@7.0.0-alpha.0`
508
+
509
+ - [pickers] Escape non tokens words (#10400) @alexfauquette
510
+ - [fields] Fix `MultiInputTimeRangeField` section selection (#10922) @noraleonte
511
+ - [pickers] Refine `referenceDate` behavior in views (#10863) @LukasTy
512
+ - [pickers] Remove `components` and `componentsProps` props (#10700) @alexfauquette
513
+ - [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10819) @lajtomekadimon
514
+ - [pickers] Add short weekdays token (#10988) @alexfauquette
515
+
516
+ #### `@mui/x-date-pickers-pro@7.0.0-alpha.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
517
+
518
+ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.0`.
519
+
520
+ ### Charts / `@mui/x-charts@7.0.0-alpha.0`
521
+
522
+ #### Breaking changes
523
+
524
+ Types for `slots` and `slotProps` got renamed by removing the "Component" which is meaningless for charts.
525
+ Unless you imported those types, to create a wrapper, you should not be impacted by this breaking change.
526
+
527
+ Here is an example of the renaming for the `<ChartsTooltip />` component.
528
+
529
+ ```diff
530
+ -ChartsTooltipSlotsComponent
531
+ +ChartsTooltipSlots
532
+
533
+ -ChartsTooltipSlotComponentProps
534
+ +ChartsTooltipSlotProps
535
+ ```
536
+
537
+ - [charts] Add `<ChartsReferenceLine />` component (#10597) (#10946) @alexfauquette
538
+ - [charts] Improve properties JSDoc (#10931) (#10955) @alexfauquette
539
+ - [charts] Rename `slots` and `slotProps` types (#10875) @alexfauquette
540
+
541
+ ### `@mui/x-codemod@7.0.0-alpha.0`
542
+
543
+ - [codemod] Add `v7.0.0/preset-safe` (#10973) @LukasTy
544
+
545
+ ### Docs
546
+
547
+ - [docs] Add `@next` tag to the installation instructions (#10963) @MBilalShafi
548
+ - [docs] Document how to hide the legend (#10951) @alexfauquette
549
+ - [docs] Fix typo in the migration guide (#10972) @flaviendelangle
550
+
551
+ ### Core
552
+
553
+ - [core] Adds migration docs for charts, pickers and tree view (#10926) @michelengelen
554
+ - [core] Bump monorepo (#10959) @LukasTy
555
+ - [core] Changed prettier branch value to next (#10917) @michelengelen
556
+ - [core] Fix GitHub title tag consistency @oliviertassinari
557
+ - [core] Fixed wrong package names in migration docs (#10953) @michelengelen
558
+ - [core] Merge `master` into `next` (#10929) @cherniavskii
559
+ - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
560
+ - [license] Correctly throw errors (#10924) @oliviertassinari
561
+
6
562
  ## 6.18.1
7
563
 
8
564
  _Nov 9, 2023_
@@ -235,7 +791,7 @@ Same changes as in `@mui/x-date-pickers@6.16.3`, plus:
235
791
 
236
792
  - [charts] Add reference links to area + bar chart components (#10652) @michelengelen
237
793
  - [charts] Add reference links to line chart + sparkline components (#10650) @michelengelen
238
- - [charts] Add reference links to pie + scatter chart components (#10653) @michelengelen
794
+ - [charts] Add reference links to pie + scatter chart components (#10653) @michelengelen
239
795
  - [charts] Render only when `width` and `height` are resolved (#10714) @alexfauquette
240
796
  - [charts] Support animation on `BarChart` (#9926) @alexfauquette
241
797
  - [charts] Use new text component to avoid tick label overflow on x-axis (#10648) @alexfauquette
@@ -311,6 +867,7 @@ It adds line break support and avoids overlapping text in the legend.
311
867
  This comes with some breaking changes.
312
868
 
313
869
  - The DOM structure is modified. An intermediary `<tspan />` element has been added. This can impact how your style is applied.
870
+
314
871
  ```diff
315
872
  - <text>The label</text>
316
873
  + <text><tspan>The label</tspan></text>
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "defaultCalendarMonth", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsPerRow", "monthsPerRow", "timezone"];
3
+ const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "defaultCalendarMonth", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsPerRow", "monthsPerRow", "timezone"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -83,7 +83,7 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
83
83
  * - [DateCalendar API](https://mui.com/x/api/date-pickers/date-calendar/)
84
84
  */
85
85
  export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
86
- var _ref, _slots$calendarHeader, _slotProps$calendarHe;
86
+ var _slots$calendarHeader;
87
87
  const utils = useUtils();
88
88
  const id = useId();
89
89
  const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
@@ -117,8 +117,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
117
117
  showDaysOutsideCurrentMonth,
118
118
  fixedWeekNumber,
119
119
  dayOfWeekFormatter,
120
- components,
121
- componentsProps,
122
120
  slots,
123
121
  slotProps,
124
122
  loading,
@@ -185,10 +183,10 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
185
183
  const maxDateWithDisabled = disabled && value || maxDate;
186
184
  const gridLabelId = `${id}-grid-label`;
187
185
  const hasFocus = focusedView !== null;
188
- const CalendarHeader = (_ref = (_slots$calendarHeader = slots == null ? void 0 : slots.calendarHeader) != null ? _slots$calendarHeader : components == null ? void 0 : components.CalendarHeader) != null ? _ref : PickersCalendarHeader;
186
+ const CalendarHeader = (_slots$calendarHeader = slots == null ? void 0 : slots.calendarHeader) != null ? _slots$calendarHeader : PickersCalendarHeader;
189
187
  const calendarHeaderProps = useSlotProps({
190
188
  elementType: CalendarHeader,
191
- externalSlotProps: (_slotProps$calendarHe = slotProps == null ? void 0 : slotProps.calendarHeader) != null ? _slotProps$calendarHe : componentsProps == null ? void 0 : componentsProps.calendarHeader,
189
+ externalSlotProps: slotProps == null ? void 0 : slotProps.calendarHeader,
192
190
  additionalProps: {
193
191
  views,
194
192
  view,
@@ -339,8 +337,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
339
337
  fixedWeekNumber: fixedWeekNumber,
340
338
  dayOfWeekFormatter: dayOfWeekFormatter,
341
339
  displayWeekNumber: displayWeekNumber,
342
- components: components,
343
- componentsProps: componentsProps,
344
340
  slots: slots,
345
341
  slotProps: slotProps,
346
342
  loading: loading,
@@ -364,21 +360,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
364
360
  autoFocus: PropTypes.bool,
365
361
  classes: PropTypes.object,
366
362
  className: PropTypes.string,
367
- /**
368
- * Overridable components.
369
- * @default {}
370
- * @deprecated Please use `slots`.
371
- */
372
- components: PropTypes.object,
373
- /**
374
- * The props used for each component slot.
375
- * @default {}
376
- * @deprecated Please use `slotProps`.
377
- */
378
- componentsProps: PropTypes.object,
379
363
  /**
380
364
  * Formats the day of week displayed in the calendar header.
381
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
382
365
  * @param {TDate} date The date of the day of week provided by the adapter.
383
366
  * @returns {string} The name to display.
384
367
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()