@mui/x-date-pickers-pro 8.0.0-alpha.6 → 8.0.0-alpha.8

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 (267) hide show
  1. package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.d.ts +1 -1
  2. package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  3. package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/package.json +1 -1
  4. package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.d.ts +1 -1
  5. package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  6. package/{AdapterDateFnsV3 → AdapterDateFnsV2}/package.json +1 -1
  7. package/CHANGELOG.md +242 -1
  8. package/DateRangeCalendar/DateRangeCalendar.js +12 -10
  9. package/DateRangePicker/DateRangePicker.js +1 -1
  10. package/DateRangePicker/DateRangePicker.types.d.ts +5 -0
  11. package/DateRangePicker/DateRangePickerToolbar.d.ts +2 -3
  12. package/DateRangePicker/DateRangePickerToolbar.js +27 -19
  13. package/DateRangePicker/shared.d.ts +1 -1
  14. package/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  15. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +3 -4
  16. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
  17. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -10
  18. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  19. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +2 -3
  20. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +29 -31
  21. package/DateTimeRangePicker/shared.d.ts +2 -2
  22. package/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
  23. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +5 -0
  24. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
  25. package/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
  26. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
  27. package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +9 -4
  28. package/MultiInputDateRangeField/MultiInputDateRangeField.js +12 -116
  29. package/MultiInputDateRangeField/index.d.ts +5 -3
  30. package/MultiInputDateRangeField/index.js +2 -2
  31. package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.d.ts +6 -0
  32. package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
  33. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +9 -4
  34. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +12 -116
  35. package/MultiInputDateTimeRangeField/index.d.ts +5 -3
  36. package/MultiInputDateTimeRangeField/index.js +2 -2
  37. package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.d.ts +6 -0
  38. package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
  39. package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +9 -4
  40. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -117
  41. package/MultiInputTimeRangeField/index.d.ts +5 -3
  42. package/MultiInputTimeRangeField/index.js +2 -2
  43. package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.d.ts +6 -0
  44. package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
  45. package/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -30
  46. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +6 -17
  47. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  48. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
  49. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +20 -30
  50. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +6 -18
  51. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  52. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
  53. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +20 -30
  54. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +6 -18
  55. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  56. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
  57. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -2
  58. package/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  59. package/hooks/index.d.ts +2 -0
  60. package/hooks/index.js +2 -0
  61. package/hooks/package.json +6 -0
  62. package/hooks/useMultiInputRangeField/index.d.ts +1 -0
  63. package/hooks/useMultiInputRangeField/index.js +1 -0
  64. package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +53 -0
  65. package/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
  66. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.d.ts +17 -0
  67. package/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
  68. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.d.ts +17 -0
  69. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
  70. package/hooks/usePickerRangePositionContext.d.ts +7 -0
  71. package/hooks/usePickerRangePositionContext.js +15 -0
  72. package/index.d.ts +2 -0
  73. package/index.js +4 -2
  74. package/internals/hooks/models/index.d.ts +1 -1
  75. package/internals/hooks/models/useRangePicker.d.ts +6 -8
  76. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +40 -67
  77. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -5
  78. package/internals/hooks/{useEnrichedRangePickerFieldProps.d.ts → useEnrichedRangePickerField.d.ts} +18 -9
  79. package/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +39 -52
  80. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +33 -56
  81. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -5
  82. package/internals/hooks/useNullablePickerRangePositionContext.d.ts +5 -0
  83. package/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
  84. package/internals/hooks/useRangePosition.d.ts +2 -2
  85. package/internals/hooks/useRangePosition.js +1 -1
  86. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
  87. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +2 -2
  88. package/internals/models/dateTimeRange.d.ts +1 -6
  89. package/internals/models/fields.d.ts +1 -2
  90. package/internals/models/index.d.ts +0 -1
  91. package/internals/models/index.js +0 -1
  92. package/internals/models/managers.d.ts +3 -0
  93. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.d.ts +3 -0
  94. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +133 -0
  95. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.d.ts +72 -0
  96. package/internals/utils/createMultiInputRangeField/index.d.ts +3 -0
  97. package/internals/utils/createMultiInputRangeField/index.js +2 -0
  98. package/internals/utils/date-range-manager.js +2 -1
  99. package/internals/utils/releaseInfo.js +1 -1
  100. package/internals/utils/valueManagers.js +7 -7
  101. package/managers/index.d.ts +6 -0
  102. package/managers/index.js +3 -0
  103. package/managers/package.json +6 -0
  104. package/managers/useDateRangeManager.d.ts +15 -0
  105. package/managers/useDateRangeManager.js +33 -0
  106. package/managers/useDateTimeRangeManager.d.ts +15 -0
  107. package/managers/useDateTimeRangeManager.js +33 -0
  108. package/managers/useTimeRangeManager.d.ts +15 -0
  109. package/managers/useTimeRangeManager.js +31 -0
  110. package/models/fields.d.ts +1 -2
  111. package/models/index.d.ts +0 -2
  112. package/models/index.js +0 -2
  113. package/models/range.d.ts +0 -1
  114. package/modern/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  115. package/modern/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  116. package/modern/DateRangeCalendar/DateRangeCalendar.js +12 -10
  117. package/modern/DateRangePicker/DateRangePicker.js +1 -1
  118. package/modern/DateRangePicker/DateRangePickerToolbar.js +27 -19
  119. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  120. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
  121. package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  122. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +29 -31
  123. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
  124. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
  125. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
  126. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
  127. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +12 -116
  128. package/modern/MultiInputDateRangeField/index.js +2 -2
  129. package/modern/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
  130. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +12 -116
  131. package/modern/MultiInputDateTimeRangeField/index.js +2 -2
  132. package/modern/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
  133. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -117
  134. package/modern/MultiInputTimeRangeField/index.js +2 -2
  135. package/modern/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
  136. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -30
  137. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
  138. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +20 -30
  139. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
  140. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +20 -30
  141. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
  142. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  143. package/modern/hooks/index.js +2 -0
  144. package/modern/hooks/useMultiInputRangeField/index.js +1 -0
  145. package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
  146. package/modern/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
  147. package/modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
  148. package/modern/hooks/usePickerRangePositionContext.js +15 -0
  149. package/modern/index.js +4 -2
  150. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +40 -67
  151. package/modern/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +39 -52
  152. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +33 -56
  153. package/modern/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
  154. package/modern/internals/hooks/useRangePosition.js +1 -1
  155. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
  156. package/modern/internals/models/index.js +0 -1
  157. package/modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +133 -0
  158. package/modern/internals/utils/createMultiInputRangeField/index.js +2 -0
  159. package/modern/internals/utils/date-range-manager.js +2 -1
  160. package/modern/internals/utils/releaseInfo.js +1 -1
  161. package/modern/internals/utils/valueManagers.js +7 -7
  162. package/modern/managers/index.js +3 -0
  163. package/modern/managers/useDateRangeManager.js +33 -0
  164. package/modern/managers/useDateTimeRangeManager.js +33 -0
  165. package/modern/managers/useTimeRangeManager.js +31 -0
  166. package/modern/models/index.js +0 -2
  167. package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  168. package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  169. package/node/DateRangeCalendar/DateRangeCalendar.js +12 -10
  170. package/node/DateRangePicker/DateRangePicker.js +1 -1
  171. package/node/DateRangePicker/DateRangePickerToolbar.js +26 -18
  172. package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  173. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
  174. package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  175. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +29 -31
  176. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
  177. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
  178. package/node/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
  179. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
  180. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +11 -119
  181. package/node/MultiInputDateRangeField/index.js +3 -9
  182. package/node/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +12 -0
  183. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +11 -119
  184. package/node/MultiInputDateTimeRangeField/index.js +3 -9
  185. package/node/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +12 -0
  186. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +12 -120
  187. package/node/MultiInputTimeRangeField/index.js +3 -9
  188. package/node/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +12 -0
  189. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +19 -29
  190. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +13 -14
  191. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +19 -29
  192. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +13 -14
  193. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +19 -29
  194. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +13 -14
  195. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  196. package/node/hooks/index.js +19 -0
  197. package/node/hooks/useMultiInputRangeField/index.js +12 -0
  198. package/node/hooks/useMultiInputRangeField/useMultiInputRangeField.js +155 -0
  199. package/node/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +11 -10
  200. package/node/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +66 -0
  201. package/node/hooks/usePickerRangePositionContext.js +22 -0
  202. package/node/index.js +23 -1
  203. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +39 -66
  204. package/node/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +41 -54
  205. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +32 -55
  206. package/node/internals/hooks/useNullablePickerRangePositionContext.js +16 -0
  207. package/node/internals/hooks/useRangePosition.js +1 -1
  208. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
  209. package/node/internals/models/index.js +0 -11
  210. package/node/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +140 -0
  211. package/node/internals/utils/createMultiInputRangeField/index.js +19 -0
  212. package/node/internals/utils/date-range-manager.js +2 -1
  213. package/node/internals/utils/releaseInfo.js +1 -1
  214. package/node/internals/utils/valueManagers.js +7 -7
  215. package/node/managers/index.js +26 -0
  216. package/node/managers/useDateRangeManager.js +40 -0
  217. package/node/managers/useDateTimeRangeManager.js +40 -0
  218. package/node/managers/useTimeRangeManager.js +38 -0
  219. package/node/models/index.js +0 -22
  220. package/package.json +5 -5
  221. package/themeAugmentation/overrides.d.ts +6 -4
  222. package/themeAugmentation/props.d.ts +2 -2
  223. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +0 -55
  224. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +0 -56
  225. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +0 -56
  226. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +0 -20
  227. package/internals/hooks/useMultiInputRangeField/shared.d.ts +0 -1
  228. package/internals/hooks/useMultiInputRangeField/shared.js +0 -9
  229. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +0 -3
  230. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -113
  231. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +0 -3
  232. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -113
  233. package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +0 -11
  234. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +0 -3
  235. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -113
  236. package/internals/models/timeRange.d.ts +0 -6
  237. package/internals/models/timeRange.js +0 -1
  238. package/models/dateRange.d.ts +0 -7
  239. package/models/dateRange.js +0 -1
  240. package/models/multiInputRangeFieldClasses.d.ts +0 -7
  241. package/models/multiInputRangeFieldClasses.js +0 -1
  242. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
  243. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
  244. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
  245. package/modern/internals/hooks/useMultiInputRangeField/shared.js +0 -9
  246. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -113
  247. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -113
  248. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
  249. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -113
  250. package/modern/internals/models/timeRange.js +0 -1
  251. package/modern/models/dateRange.js +0 -1
  252. package/modern/models/multiInputRangeFieldClasses.js +0 -1
  253. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -5
  254. package/node/internals/hooks/useMultiInputRangeField/shared.js +0 -16
  255. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -121
  256. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -121
  257. package/node/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -5
  258. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -121
  259. package/node/internals/models/timeRange.js +0 -5
  260. package/node/models/dateRange.js +0 -5
  261. package/node/models/multiInputRangeFieldClasses.js +0 -5
  262. /package/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
  263. /package/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
  264. /package/{MultiInputTimeRangeField/MultiInputTimeRangeField.types.js → modern/internals/models/managers.js} +0 -0
  265. /package/{internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js → modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
  266. /package/node/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
  267. /package/node/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
@@ -1 +1 @@
1
- export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV3';
1
+ export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV2';
@@ -1 +1 @@
1
- export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV3';
1
+ export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV2';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "module": "./index.js",
4
- "main": "../node/AdapterDateFnsJalaliV3/index.js",
4
+ "main": "../node/AdapterDateFnsJalaliV2/index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -1 +1 @@
1
- export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
1
+ export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV2';
@@ -1 +1 @@
1
- export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
1
+ export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV2';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "module": "./index.js",
4
- "main": "../node/AdapterDateFnsV3/index.js",
4
+ "main": "../node/AdapterDateFnsV2/index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,247 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.0.0-alpha.8
9
+
10
+ _Jan 16, 2025_
11
+
12
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🍬 Improved design for Data Grid [Header filters](https://next.mui.com/x/react-data-grid/filtering/header-filters/)
15
+
16
+ <img width="100%" alt="Data Grid Header filters" src="https://github.com/user-attachments/assets/74a50cd9-7a55-41fc-a2b8-f8a0d5b9120e" />
17
+
18
+ - 🔄 Data Grid [Scroll restoration](https://next.mui.com/x/react-data-grid/scrolling/#scroll-restoration)
19
+ - 📊 Charts support server-side rendering under [some conditions](https://next.mui.com/x/react-charts/getting-started/#server-side-rendering)
20
+ - 🐞 Bugfixes
21
+
22
+ Special thanks go out to the community contributors who have helped make this release possible:
23
+ @lauri865.
24
+ Following are all team members who have contributed to this release:
25
+ @arminmeh, @romgrk, @samuelsycamore, @alexfauquette, @cherniavskii, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen.
26
+
27
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
28
+
29
+ ### Data Grid
30
+
31
+ #### Breaking changes
32
+
33
+ - The clear button in header filter cells has been moved to the header filter menu. Use `slotProps={{ headerFilterCell: { showClearIcon: true } }}` to restore the clear button in the cell.
34
+
35
+ #### `@mui/x-data-grid@8.0.0-alpha.8`
36
+
37
+ - [DataGrid] Improve scrollbar deadzone with overlay scrollbars (#15961) @lauri865
38
+ - [DataGrid] Header filter design improvements (#15991) @KenanYusuf
39
+ - [DataGrid] Scroll restoration (#15623) @lauri865
40
+ - [DataGrid] Fix row, cell and header memoizations (#15666) @lauri865
41
+
42
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
43
+
44
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.8`, plus:
45
+
46
+ - [DataGridPro] Add test for column pinning with disabled column virtualization (#16176) @cherniavskii
47
+ - [DataGridPro] Fix width of right-pinned column group during resize (#16199) @cherniavskii
48
+
49
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.8` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
50
+
51
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.8`.
52
+
53
+ ### Date and Time Pickers
54
+
55
+ #### Breaking changes
56
+
57
+ - The field is now editable if rendered inside a mobile Picker — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#field-editing-on-mobile-pickers)
58
+ - The `useMultiInputDateRangeField`, `useMultiInputTimeRangeField`, and `useMultiInputDateTimeRangeField` hooks have been removed in favor of the new `useMultiInputRangeField` hook — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#usemultiinputdaterangefield)
59
+ - The component passed to the `field` slot no longer receives the `value`, `onChange`, `timezone`, `format`, `disabled`, `formatDensity`, `enableAccessibleFieldDOMStructure`, `selectedSections` and `onSelectedSectionsChange` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-field)
60
+
61
+ #### `@mui/x-date-pickers@8.0.0-alpha.8`
62
+
63
+ - [pickers] Let the field components handle their opening UI, and allow field editing on mobile pickers (#15671) @flaviendelangle
64
+ - [pickers] Remove code duplication for the multi input range fields (#15505) @flaviendelangle
65
+ - [pickers] Rename `onRangePositionChange` into `setRangePosition` in `usePickerRangePositionContext` (#16189) @flaviendelangle
66
+ - [pickers] Use context to pass props from the picker to the field (#16042) @flaviendelangle
67
+
68
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
69
+
70
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.8`.
71
+
72
+ ### Charts
73
+
74
+ #### Breaking changes
75
+
76
+ - Charts tooltip markers now have different styles for each chart type. The tooltip and legend marks are now the same.
77
+ - Duplicate axis id's across `x` and `y` axis now log a warning in dev mode. Axis ids should be unique to prevent internal issues.
78
+
79
+ #### `@mui/x-charts@8.0.0-alpha.8`
80
+
81
+ - [charts] Fix flaky charts tests (#16180) @JCQuintas
82
+ - [charts] Handle case where gradient stop `offset` could be `Infinite` (#16131) @JCQuintas
83
+ - [charts] Make `useChartGradientId` public (#16106) @JCQuintas
84
+ - [charts] Move z-axis to plugin (#16130) @alexfauquette
85
+ - [charts] Plot data at first render if `skipAnimation` is set to `true` (#16166) @alexfauquette
86
+ - [charts] Replace tooltip mark with style (#16117) @JCQuintas
87
+ - [charts] Support `rtl` for gradient legend (#16115) @JCQuintas
88
+ - [charts] Use plugin system for series and axes (#15865) @alexfauquette
89
+
90
+ #### `@mui/x-charts-pro@8.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
91
+
92
+ Same changes as in `@mui/x-charts@8.0.0-alpha.8`.
93
+
94
+ ### Tree View
95
+
96
+ #### `@mui/x-tree-view@8.0.0-alpha.8`
97
+
98
+ No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.7`.
99
+
100
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
101
+
102
+ Same changes as in `@mui/x-tree-view@8.0.0-alpha.8`.
103
+
104
+ ### Docs
105
+
106
+ - [docs] Add example for custom legend (#16169) @alexfauquette
107
+ - [docs] Add full custom field creation example (#15194) @flaviendelangle
108
+ - [docs] Copyedit the Data Grid cell selection page (#16099) @samuelsycamore
109
+ - [docs] Fix demo rendering issue on Codesandbox (#16118) @arminmeh
110
+ - [docs] Remove broken links (#16167) @alexfauquette
111
+ - [docs] Split the Data Grid editing page (#14931) @MBilalShafi
112
+ - [docs] Fix wrong props warnings (#16119) @JCQuintas
113
+
114
+ ### Core
115
+
116
+ - [core] Type all references as `RefObject` (#16124) @arminmeh
117
+ - [code-infra] Refactor `react` and `react-dom` definitions to simplify dep resolving (#16160) @LukasTy
118
+ - [code-infra] Stop renovate from updating `date-fns-v2` (#16158) @LukasTy
119
+ - [infra] Improve cherry-pick action target list (#16184) @michelengelen
120
+ - [test] Fix flaky column pinning unit test (#16202) @cherniavskii
121
+ - [test] Fix flaky screenshot (#16182) @cherniavskii
122
+
123
+ ## 8.0.0-alpha.7
124
+
125
+ _Jan 9, 2025_
126
+
127
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
128
+
129
+ - 📊 Charts legend is now an HTML element which can be styled more easily
130
+ - 💫 Support [aggregation with server-side data](/x/react-data-grid/server-side-data/aggregation/)
131
+ - 🏎️ Improve Data Grid aggregation performance
132
+ - 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
133
+ - 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
134
+ - 🐞 Bugfixes
135
+
136
+ Special thanks go out to the community contributors who have helped make this release possible:
137
+ @derek-0000, @josteinjhauge, @k-rajat19, @nusr, @tomashauser.
138
+ Following are all team members who have contributed to this release:
139
+ @cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @oliviertassinari.
140
+
141
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
142
+
143
+ ### Data Grid
144
+
145
+ #### `@mui/x-data-grid@8.0.0-alpha.7`
146
+
147
+ - [DataGrid] Improve React 19 support (#15769) @LukasTy
148
+ - [DataGrid] Add `name` attribute to the checkbox selection column (#15178) @derek-0000
149
+ - [DataGrid] Fix number filter field formatting values while typing (#16062) @arminmeh
150
+ - [DataGrid] Fix select all checkbox state reset with server side data (#16034) @MBilalShafi
151
+ - [DataGrid] Refactor: create base button props (#15930) @romgrk
152
+ - [DataGrid] Refactor: create tooltip props (#16086) @romgrk
153
+ - [DataGrid] Fix TS error (#16046) @cherniavskii
154
+
155
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
156
+
157
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.7`.
158
+
159
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.7` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
160
+
161
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.7`, plus:
162
+
163
+ - [DataGridPremium] Improve aggregation performance for multiple columns (#16097) @cherniavskii
164
+ - [DataGridPremium] Make Aggregation keyboard accessible in the column menu (#15934) @k-rajat19
165
+ - [DataGridPremium] Server-side aggregation with data source (#15741) @MBilalShafi
166
+
167
+ ### Date and Time Pickers
168
+
169
+ #### Breaking changes
170
+
171
+ - The `date-fns` and `date-fns-jalali` date library adapters have been renamed to better align with the current stable major versions — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#✅-rename-date-fns-adapter-imports)
172
+ - Update default `closeOnSelect` and Action Bar `actions` values - [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#update-default-closeonselect-and-action-bar-actions-values)
173
+ - The component passed to the `layout` slot no longer receives the `value`, `onChange` and `onSelectShortcut` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
174
+ - The component passed to the `toolbar` slot no longer receives the `value`, `onChange` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
175
+ - The component passed to the `shortcuts` slot no longer receives the `onChange`, `isValid` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-shortcuts).
176
+ - The `PickerShortcutChangeImportance` type has been renamed `PickerChangeImportance` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables-and-types).
177
+ - The component passed to the `layout` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
178
+ - The component passed to the `toolbar` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
179
+ - The component passed to the `tabs` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-tabs).
180
+
181
+ #### `@mui/x-date-pickers@8.0.0-alpha.7`
182
+
183
+ - [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (#15985) @LukasTy
184
+ - [pickers] Always use `setValue` internally to update the picker value (#16056) @flaviendelangle
185
+ - [pickers] Create a new context to pass the range position props to the layout components and to the views (#15846) @flaviendelangle
186
+ - [pickers] Introduce a new concept of `manager` (#15339) @flaviendelangle
187
+ - [pickers] Improve React 19 support (#15769) @LukasTy
188
+ - [pickers] Memoize `<PickersActionBar />` (#16071) @LukasTy
189
+ - [pickers] Remove `NonEmptyDateRange` type (#16035) @flaviendelangle
190
+ - [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (#16082) @LukasTy
191
+ - [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (#16044) @flaviendelangle
192
+ - [pickers] Support `date-fns-jalali` v4 (#16011) @LukasTy
193
+ - [pickers] Update `closeOnSelect` and `actionBar.actions` default values (#15944) @LukasTy
194
+ - [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (#15948) @flaviendelangle
195
+ - [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16033) @nusr
196
+ - [l10n] Improve Norwegian (nb-NO) locale (#16089) @josteinjhauge
197
+
198
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
199
+
200
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.7`.
201
+
202
+ ### Charts
203
+
204
+ #### Breaking changes
205
+
206
+ - Removed `DefaultChartsLegend` component, since it is now easier to create custom legends — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
207
+ - The default legend is now an HTML element and can be styled more easily.
208
+ - The `width` and `height` properties of the charts now only apply to the `svg` element, and not their wrappers, this might cause some layout shifts.
209
+ - `slotProps.legend.direction` now accepts `'horizontal' | 'vertical'` instead of `'row' | 'column'` — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#legend-direction-value-change-✅).
210
+ - The `getSeriesToDisplay` function was removed in favor of the `useLegend` hook. — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#the-getseriestodisplay-function-was-removed).
211
+
212
+ #### `@mui/x-charts@8.0.0-alpha.7`
213
+
214
+ - [charts] New HTML legend & styles (#15733) @JCQuintas
215
+ - [charts] Improve React 19 support (#15769) @LukasTy
216
+ - [charts] Fix 301 redirection in the API documentation @oliviertassinari
217
+
218
+ #### `@mui/x-charts-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
219
+
220
+ Same changes as in `@mui/x-charts@8.0.0-alpha.7`.
221
+
222
+ ### Tree View
223
+
224
+ #### `@mui/x-tree-view@8.0.0-alpha.7`
225
+
226
+ - [TreeView] Improve React 19 support (#15769) @LukasTy
227
+
228
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
229
+
230
+ Same changes as in `@mui/x-tree-view@8.0.0-alpha.7`.
231
+
232
+ ### Docs
233
+
234
+ - [docs] Fix `EditingWithDatePickers` demo (#15967) @k-rajat19
235
+ - [docs] Fix inconsistent multi input range field separators (#16043) @flaviendelangle
236
+ - [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16084) @tomashauser
237
+ - [docs] Refactor Data Grid with Date Pickers example (#15992) @LukasTy
238
+ - [docs] Unify the wording of the pickers slots breaking changes (#16036) @flaviendelangle
239
+
240
+ ### Core
241
+
242
+ - [core] Clarify the release strategy (#16014) @MBilalShafi
243
+ - [core] Small fixes on docs @oliviertassinari
244
+ - [core] Sync with other repos @oliviertassinari
245
+ - [core] Update the `release:version` docs (#16038) @cherniavskii
246
+ - [code-infra] Add `testSkipIf` and `describeSkipIf` (#16049) @JCQuintas
247
+ - [test] Stabilize flaky Data Grid tests (#16053) @LukasTy
248
+
8
249
  ## 8.0.0-alpha.6
9
250
 
10
251
  _Dec 26, 2024_
@@ -104,7 +345,7 @@ Following are all team members who have contributed to this release:
104
345
 
105
346
  #### Breaking changes
106
347
 
107
- - Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`.
348
+ - Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
108
349
 
109
350
  - For `.root` element, use `slotProps.root`.
110
351
  - For `.main` element (the one with `role="grid"`), use `slotProps.main`.
@@ -27,6 +27,7 @@ import { useDragRange } from "./useDragRange.js";
27
27
  import { useRangePosition } from "../internals/hooks/useRangePosition.js";
28
28
  import { DAY_RANGE_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
29
29
  import { PickersRangeCalendarHeader } from "../PickersRangeCalendarHeader/index.js";
30
+ import { useNullablePickerRangePositionContext } from "../internals/hooks/useNullablePickerRangePositionContext.js";
30
31
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
32
  const releaseInfo = getReleaseInfo();
32
33
  const DateRangeCalendarRoot = styled('div', {
@@ -135,8 +136,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
135
136
  reduceAnimations,
136
137
  onMonthChange,
137
138
  rangePosition: rangePositionProp,
138
- defaultRangePosition: inDefaultRangePosition,
139
- onRangePositionChange: inOnRangePositionChange,
139
+ defaultRangePosition: defaultRangePositionProp,
140
+ onRangePositionChange: onRangePositionChangeProp,
140
141
  calendars,
141
142
  currentMonthCalendarPosition = 1,
142
143
  slots,
@@ -161,6 +162,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
161
162
  onViewChange
162
163
  } = props,
163
164
  other = _objectWithoutPropertiesLoose(props, _excluded);
165
+ const rangePositionContext = useNullablePickerRangePositionContext();
164
166
  const {
165
167
  value,
166
168
  handleValueChange,
@@ -190,15 +192,15 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
190
192
  const id = useId();
191
193
  const {
192
194
  rangePosition,
193
- onRangePositionChange
195
+ setRangePosition
194
196
  } = useRangePosition({
195
- rangePosition: rangePositionProp,
196
- defaultRangePosition: inDefaultRangePosition,
197
- onRangePositionChange: inOnRangePositionChange
197
+ rangePosition: rangePositionProp ?? rangePositionContext?.rangePosition,
198
+ defaultRangePosition: defaultRangePositionProp,
199
+ onRangePositionChange: onRangePositionChangeProp ?? rangePositionContext?.setRangePosition
198
200
  });
199
201
  const handleDatePositionChange = useEventCallback(position => {
200
202
  if (rangePosition !== position) {
201
- onRangePositionChange(position);
203
+ setRangePosition(position);
202
204
  }
203
205
  });
204
206
  const handleSelectedDayChange = useEventCallback((newDate, selectionState, allowRangeFlip = false) => {
@@ -216,7 +218,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
216
218
  });
217
219
  const isNextSectionAvailable = availableRangePositions.includes(nextSelection);
218
220
  if (isNextSectionAvailable) {
219
- onRangePositionChange(nextSelection);
221
+ setRangePosition(nextSelection);
220
222
  }
221
223
  const isFullRangeSelected = rangePosition === 'end' && isRangeValid(utils, newRange);
222
224
  setValueAndGoToNextView(newRange, isFullRangeSelected || !isNextSectionAvailable ? 'finish' : 'partial', view);
@@ -228,7 +230,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
228
230
 
229
231
  // Range going for the start of the start day to the end of the end day.
230
232
  // This makes sure that `isWithinRange` works with any time in the start and end day.
231
- const valueDayRange = React.useMemo(() => [value[0] == null || !utils.isValid(value[0]) ? value[0] : utils.startOfDay(value[0]), value[1] == null || !utils.isValid(value[1]) ? value[1] : utils.endOfDay(value[1])], [value, utils]);
233
+ const valueDayRange = React.useMemo(() => [!utils.isValid(value[0]) ? value[0] : utils.startOfDay(value[0]), !utils.isValid(value[1]) ? value[1] : utils.endOfDay(value[1])], [value, utils]);
232
234
  const _useDragRange = useDragRange({
233
235
  disableDragEditing: shouldDisableDragEditing,
234
236
  onDrop: handleDrop,
@@ -316,7 +318,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
316
318
  const prevValue = React.useRef(null);
317
319
  React.useEffect(() => {
318
320
  const date = rangePosition === 'start' ? value[0] : value[1];
319
- if (!date || !utils.isValid(date)) {
321
+ if (!utils.isValid(date)) {
320
322
  return;
321
323
  }
322
324
  const prevDate = rangePosition === 'start' ? prevValue.current?.[0] : prevValue.current?.[1];
@@ -63,7 +63,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
63
63
  calendars: PropTypes.oneOf([1, 2, 3]),
64
64
  className: PropTypes.string,
65
65
  /**
66
- * If `true`, the popover or modal will close after submitting the full date.
66
+ * If `true`, the Picker will close after submitting the full date.
67
67
  * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
68
68
  */
69
69
  closeOnSelect: PropTypes.bool,
@@ -24,6 +24,11 @@ export interface DateRangePickerProps<TEnableAccessibleFieldDOMStructure extends
24
24
  * @default {}
25
25
  */
26
26
  slotProps?: DateRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
27
+ /**
28
+ * If `true`, the Picker will close after submitting the full date.
29
+ * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
30
+ */
31
+ closeOnSelect?: boolean;
27
32
  }
28
33
  /**
29
34
  * Props the field can receive when used inside a date range picker (<DateRangePicker />, <DesktopDateRangePicker /> or <MobileDateRangePicker /> component).
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
- import { BaseToolbarProps, ExportedBaseToolbarProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
3
- import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
2
+ import { BaseToolbarProps, ExportedBaseToolbarProps } from '@mui/x-date-pickers/internals';
4
3
  import { DateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
5
- export interface DateRangePickerToolbarProps extends ExportedDateRangePickerToolbarProps, Omit<BaseToolbarProps<PickerRangeValue>, 'onChange' | 'isLandscape'>, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
4
+ export interface DateRangePickerToolbarProps extends ExportedDateRangePickerToolbarProps, Omit<BaseToolbarProps, 'onChange' | 'isLandscape'> {
6
5
  }
7
6
  export interface ExportedDateRangePickerToolbarProps extends ExportedBaseToolbarProps {
8
7
  /**
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "classes"];
5
+ const _excluded = ["toolbarFormat", "className", "classes"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
@@ -10,8 +10,9 @@ import Typography from '@mui/material/Typography';
10
10
  import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
12
  import { PickersToolbar, PickersToolbarButton, useUtils, useToolbarOwnerState } from '@mui/x-date-pickers/internals';
13
- import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
13
+ import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hooks';
14
14
  import { getDateRangePickerToolbarUtilityClass } from "./dateRangePickerToolbarClasses.js";
15
+ import { usePickerRangePositionContext } from "../hooks/index.js";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  const useUtilityClasses = classes => {
17
18
  const slots = {
@@ -49,40 +50,50 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
49
50
  name: 'MuiDateRangePickerToolbar'
50
51
  });
51
52
  const {
52
- value: [start, end],
53
- rangePosition,
54
- onRangePositionChange,
55
- toolbarFormat,
53
+ toolbarFormat: toolbarFormatProp,
56
54
  className,
57
55
  classes: classesProp
58
56
  } = props,
59
57
  other = _objectWithoutPropertiesLoose(props, _excluded);
58
+ const {
59
+ value
60
+ } = usePickerContext();
60
61
  const translations = usePickerTranslations();
61
62
  const ownerState = useToolbarOwnerState();
63
+ const {
64
+ rangePosition,
65
+ setRangePosition
66
+ } = usePickerRangePositionContext();
62
67
  const classes = useUtilityClasses(classesProp);
63
- const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : translations.start;
64
- const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : translations.end;
68
+
69
+ // This can't be a default value when spreading because it breaks the API generation.
70
+ const toolbarFormat = toolbarFormatProp ?? utils.formats.shortDate;
71
+ const formatDate = (date, fallback) => {
72
+ if (!utils.isValid(date)) {
73
+ return fallback;
74
+ }
75
+ return utils.formatByString(date, toolbarFormat);
76
+ };
65
77
  return /*#__PURE__*/_jsx(DateRangePickerToolbarRoot, _extends({}, other, {
66
78
  toolbarTitle: translations.dateRangePickerToolbarTitle,
67
- isLandscape: false,
68
79
  className: clsx(classes.root, className),
69
80
  ownerState: ownerState,
70
81
  ref: ref,
71
82
  children: /*#__PURE__*/_jsxs(DateRangePickerToolbarContainer, {
72
83
  className: classes.container,
73
84
  children: [/*#__PURE__*/_jsx(PickersToolbarButton, {
74
- variant: start !== null ? 'h5' : 'h6',
75
- value: startDateValue,
85
+ variant: value[0] == null ? 'h6' : 'h5',
86
+ value: formatDate(value[0], translations.start),
76
87
  selected: rangePosition === 'start',
77
- onClick: () => onRangePositionChange('start')
88
+ onClick: () => setRangePosition('start')
78
89
  }), /*#__PURE__*/_jsxs(Typography, {
79
90
  variant: "h5",
80
91
  children: ["\xA0", '–', "\xA0"]
81
92
  }), /*#__PURE__*/_jsx(PickersToolbarButton, {
82
- variant: end !== null ? 'h5' : 'h6',
83
- value: endDateValue,
93
+ variant: value[1] == null ? 'h6' : 'h5',
94
+ value: formatDate(value[1], translations.end),
84
95
  selected: rangePosition === 'end',
85
- onClick: () => onRangePositionChange('end')
96
+ onClick: () => setRangePosition('end')
86
97
  })]
87
98
  })
88
99
  }));
@@ -102,8 +113,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
102
113
  * @default `true` for Desktop, `false` for Mobile.
103
114
  */
104
115
  hidden: PropTypes.bool,
105
- onRangePositionChange: PropTypes.func.isRequired,
106
- rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
107
116
  /**
108
117
  * The system prop that allows defining system overrides as well as additional CSS styles.
109
118
  */
@@ -117,7 +126,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
117
126
  * Toolbar value placeholder—it is displayed when the value is empty.
118
127
  * @default "––"
119
128
  */
120
- toolbarPlaceholder: PropTypes.node,
121
- value: PropTypes.arrayOf(PropTypes.object).isRequired
129
+ toolbarPlaceholder: PropTypes.node
122
130
  } : void 0;
123
131
  export { DateRangePickerToolbar };
@@ -33,7 +33,7 @@ export interface BaseDateRangePickerProps extends Omit<BasePickerInputProps<Pick
33
33
  * If `null`, the section will only have field editing.
34
34
  * If `undefined`, internally defined view will be used.
35
35
  */
36
- viewRenderers?: Partial<PickerViewRendererLookup<PickerRangeValue, 'day', DateRangeViewRendererProps<'day'>, {}>>;
36
+ viewRenderers?: Partial<PickerViewRendererLookup<PickerRangeValue, 'day', DateRangeViewRendererProps<'day'>>>;
37
37
  }
38
38
  type UseDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps> = LocalizedComponent<DefaultizedProps<Props, ValidateDateRangePropsToDefault>>;
39
39
  export declare function useDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps>(props: Props, name: string): UseDateRangePickerDefaultizedProps<Props>;
@@ -68,8 +68,8 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
68
68
  calendars: PropTypes.oneOf([1, 2, 3]),
69
69
  className: PropTypes.string,
70
70
  /**
71
- * If `true`, the popover or modal will close after submitting the full date.
72
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
71
+ * If `true`, the Picker will close after submitting the full date.
72
+ * @default false
73
73
  */
74
74
  closeOnSelect: PropTypes.bool,
75
75
  /**
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ExportedBaseTabsProps } from '@mui/x-date-pickers/internals';
3
3
  import { DateTimeRangePickerTabsClasses } from './dateTimeRangePickerTabsClasses';
4
- import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
5
4
  export interface ExportedDateTimeRangePickerTabsProps extends ExportedBaseTabsProps {
6
5
  /**
7
6
  * Toggles visibility of the tabs allowing view switching.
@@ -12,18 +11,18 @@ export interface ExportedDateTimeRangePickerTabsProps extends ExportedBaseTabsPr
12
11
  * Date tab icon.
13
12
  * @default DateRangeIcon
14
13
  */
15
- dateIcon?: React.ReactElement;
14
+ dateIcon?: React.ReactElement<any>;
16
15
  /**
17
16
  * Time tab icon.
18
17
  * @default TimeIcon
19
18
  */
20
- timeIcon?: React.ReactElement;
19
+ timeIcon?: React.ReactElement<any>;
21
20
  /**
22
21
  * Override or extend the styles applied to the component.
23
22
  */
24
23
  classes?: Partial<DateTimeRangePickerTabsClasses>;
25
24
  }
26
- export interface DateTimeRangePickerTabsProps extends ExportedDateTimeRangePickerTabsProps, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
25
+ export interface DateTimeRangePickerTabsProps extends ExportedDateTimeRangePickerTabsProps {
27
26
  }
28
27
  declare const DateTimeRangePickerTabs: {
29
28
  (inProps: DateTimeRangePickerTabsProps): React.JSX.Element | null;
@@ -12,6 +12,7 @@ import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hoo
12
12
  import IconButton from '@mui/material/IconButton';
13
13
  import Button from '@mui/material/Button';
14
14
  import { getDateTimeRangePickerTabsUtilityClass } from "./dateTimeRangePickerTabsClasses.js";
15
+ import { usePickerRangePositionContext } from "../hooks/index.js";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  const viewToTab = (view, rangePosition) => {
17
18
  if (isDatePickerView(view)) {
@@ -71,8 +72,6 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
71
72
  dateIcon = /*#__PURE__*/_jsx(DateRangeIcon, {}),
72
73
  timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
73
74
  hidden = typeof window === 'undefined' || window.innerHeight < 667,
74
- rangePosition,
75
- onRangePositionChange,
76
75
  className,
77
76
  classes: classesProp,
78
77
  sx
@@ -83,9 +82,13 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
83
82
  } = usePickerPrivateContext();
84
83
  const {
85
84
  view,
86
- onViewChange
85
+ setView
87
86
  } = usePickerContext();
88
87
  const classes = useUtilityClasses(classesProp);
88
+ const {
89
+ rangePosition,
90
+ setRangePosition
91
+ } = usePickerRangePositionContext();
89
92
  const value = React.useMemo(() => view == null ? null : viewToTab(view, rangePosition), [view, rangePosition]);
90
93
  const isPreviousHidden = value === 'start-date';
91
94
  const isNextHidden = value === 'end-time';
@@ -105,19 +108,19 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
105
108
  }, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
106
109
  const handleRangePositionChange = useEventCallback(newTab => {
107
110
  if (newTab.includes('start')) {
108
- onRangePositionChange('start');
111
+ setRangePosition('start');
109
112
  } else {
110
- onRangePositionChange('end');
113
+ setRangePosition('end');
111
114
  }
112
115
  });
113
116
  const changeToPreviousTab = useEventCallback(() => {
114
117
  const previousTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) - 1];
115
- onViewChange(tabToView(previousTab));
118
+ setView(tabToView(previousTab));
116
119
  handleRangePositionChange(previousTab);
117
120
  });
118
121
  const changeToNextTab = useEventCallback(() => {
119
122
  const nextTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) + 1];
120
- onViewChange(tabToView(nextTab));
123
+ setView(tabToView(nextTab));
121
124
  handleRangePositionChange(nextTab);
122
125
  });
123
126
  if (hidden) {
@@ -177,8 +180,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerTabs.propTypes = {
177
180
  * @default `window.innerHeight < 667` for `DesktopDateTimeRangePicker` and `MobileDateTimeRangePicker`
178
181
  */
179
182
  hidden: PropTypes.bool,
180
- onRangePositionChange: PropTypes.func.isRequired,
181
- rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
182
183
  /**
183
184
  * The system prop that allows defining system overrides as well as additional CSS styles.
184
185
  */