@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
@@ -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 };
@@ -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
  /**
@@ -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
  */
@@ -1,17 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["rangePosition", "onRangePositionChange", "viewRenderer", "value", "onChange", "defaultValue", "onViewChange", "views", "className"];
3
+ const _excluded = ["viewRenderer", "value", "onChange", "defaultValue", "onViewChange", "views", "className"];
4
4
  import { isInternalTimeView, useUtils } from '@mui/x-date-pickers/internals';
5
5
  import { isRangeValid } from "../internals/utils/date-utils.js";
6
6
  import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
7
+ import { usePickerRangePositionContext } from "../hooks/index.js";
7
8
  /**
8
9
  * @ignore - internal component.
9
10
  */
10
- function DateTimeRangePickerTimeWrapper(props, ref) {
11
+ function DateTimeRangePickerTimeWrapper(props) {
11
12
  const utils = useUtils();
12
13
  const {
13
- rangePosition,
14
- onRangePositionChange,
15
14
  viewRenderer,
16
15
  value,
17
16
  onChange,
@@ -20,6 +19,10 @@ function DateTimeRangePickerTimeWrapper(props, ref) {
20
19
  views
21
20
  } = props,
22
21
  other = _objectWithoutPropertiesLoose(props, _excluded);
22
+ const {
23
+ rangePosition,
24
+ setRangePosition
25
+ } = usePickerRangePositionContext();
23
26
  if (!viewRenderer) {
24
27
  return null;
25
28
  }
@@ -42,12 +45,11 @@ function DateTimeRangePickerTimeWrapper(props, ref) {
42
45
  // reset view to the first time view and swap range position after selecting the last time view (start or end position)
43
46
  if (selectedView === timeViews[timeViews.length - 1] && onViewChange) {
44
47
  onViewChange(views[0]);
45
- onRangePositionChange(rangePosition === 'start' ? 'end' : 'start');
48
+ setRangePosition(rangePosition === 'start' ? 'end' : 'start');
46
49
  }
47
50
  onChange(newRange, isFullRangeSelected ? 'finish' : 'partial', selectedView);
48
51
  };
49
52
  return viewRenderer(_extends({}, other, {
50
- ref,
51
53
  views,
52
54
  onViewChange,
53
55
  value: currentValue,
@@ -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", "className", "classes", "onChange", "classes", "isLandscape", "ampm", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
5
+ const _excluded = ["className", "classes", "classes", "ampm", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
@@ -13,6 +13,7 @@ import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hoo
13
13
  import { DateTimePickerToolbar } from '@mui/x-date-pickers/DateTimePicker';
14
14
  import { getDateTimeRangePickerToolbarUtilityClass } from "./dateTimeRangePickerToolbarClasses.js";
15
15
  import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
16
+ import { usePickerRangePositionContext } from "../hooks/index.js";
16
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const useUtilityClasses = classes => {
18
19
  const slots = {
@@ -50,13 +51,8 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
50
51
  });
51
52
  const utils = useUtils();
52
53
  const {
53
- value: [start, end],
54
- rangePosition,
55
- onRangePositionChange,
56
54
  className,
57
55
  classes: classesProp,
58
- onChange,
59
- isLandscape,
60
56
  ampm,
61
57
  hidden,
62
58
  toolbarFormat,
@@ -66,17 +62,22 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
66
62
  } = props,
67
63
  other = _objectWithoutPropertiesLoose(props, _excluded);
68
64
  const {
65
+ value,
66
+ setValue,
69
67
  disabled,
70
68
  readOnly,
71
69
  view,
72
- onViewChange,
70
+ setView,
73
71
  views
74
72
  } = usePickerContext();
75
73
  const translations = usePickerTranslations();
76
74
  const ownerState = useToolbarOwnerState();
75
+ const {
76
+ rangePosition,
77
+ setRangePosition
78
+ } = usePickerRangePositionContext();
77
79
  const classes = useUtilityClasses(classesProp);
78
80
  const commonToolbarProps = {
79
- isLandscape,
80
81
  views,
81
82
  ampm,
82
83
  disabled,
@@ -85,52 +86,58 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
85
86
  toolbarFormat,
86
87
  toolbarPlaceholder
87
88
  };
88
- const handleOnChange = React.useCallback(newDate => {
89
+ const wrappedSetValue = React.useCallback(newDate => {
89
90
  const {
90
91
  nextSelection,
91
92
  newRange
92
93
  } = calculateRangeChange({
93
94
  newDate,
94
95
  utils,
95
- range: props.value,
96
+ range: value,
96
97
  rangePosition,
97
98
  allowRangeFlip: true
98
99
  });
99
- onRangePositionChange(nextSelection);
100
- onChange(newRange);
101
- }, [onChange, onRangePositionChange, props.value, rangePosition, utils]);
100
+ setRangePosition(nextSelection);
101
+ setValue(newRange, {
102
+ changeImportance: 'set'
103
+ });
104
+ }, [setValue, setRangePosition, value, rangePosition, utils]);
102
105
  const startOverrides = React.useMemo(() => {
103
106
  const handleStartRangeViewChange = newView => {
104
107
  if (newView === 'year' || newView === 'month') {
105
108
  return;
106
109
  }
107
110
  if (rangePosition !== 'start') {
108
- onRangePositionChange('start');
111
+ setRangePosition('start');
109
112
  }
110
- onViewChange(newView);
113
+ setView(newView);
111
114
  };
112
115
  return {
116
+ value: value[0],
117
+ setValue: wrappedSetValue,
113
118
  forceDesktopVariant: true,
114
- onViewChange: handleStartRangeViewChange,
119
+ setView: handleStartRangeViewChange,
115
120
  view: rangePosition === 'start' ? view : null
116
121
  };
117
- }, [rangePosition, view, onRangePositionChange, onViewChange]);
122
+ }, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
118
123
  const endOverrides = React.useMemo(() => {
119
124
  const handleEndRangeViewChange = newView => {
120
125
  if (newView === 'year' || newView === 'month') {
121
126
  return;
122
127
  }
123
128
  if (rangePosition !== 'end') {
124
- onRangePositionChange('end');
129
+ setRangePosition('end');
125
130
  }
126
- onViewChange(newView);
131
+ setView(newView);
127
132
  };
128
133
  return {
134
+ value: value[1],
135
+ setValue: wrappedSetValue,
129
136
  forceDesktopVariant: true,
130
- onViewChange: handleEndRangeViewChange,
137
+ setView: handleEndRangeViewChange,
131
138
  view: rangePosition === 'end' ? view : null
132
139
  };
133
- }, [rangePosition, view, onRangePositionChange, onViewChange]);
140
+ }, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
134
141
  if (hidden) {
135
142
  return null;
136
143
  }
@@ -143,21 +150,17 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
143
150
  children: [/*#__PURE__*/_jsx(DateTimePickerToolbarOverrideContext.Provider, {
144
151
  value: startOverrides,
145
152
  children: /*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
146
- value: start,
147
153
  toolbarTitle: translations.start,
148
154
  ownerState: ownerState,
149
155
  className: classes.startToolbar,
150
- onChange: handleOnChange,
151
156
  titleId: titleId ? `${titleId}-start-toolbar` : undefined
152
157
  }, commonToolbarProps))
153
158
  }), /*#__PURE__*/_jsx(DateTimePickerToolbarOverrideContext.Provider, {
154
159
  value: endOverrides,
155
160
  children: /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
156
- value: end,
157
161
  toolbarTitle: translations.end,
158
162
  ownerState: ownerState,
159
163
  className: classes.endToolbar,
160
- onChange: handleOnChange,
161
164
  titleId: titleId ? `${titleId}-end-toolbar` : undefined
162
165
  }, commonToolbarProps))
163
166
  })]
@@ -179,10 +182,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
179
182
  * @default `true` for Desktop, `false` for Mobile.
180
183
  */
181
184
  hidden: PropTypes.bool,
182
- isLandscape: PropTypes.bool.isRequired,
183
- onChange: PropTypes.func.isRequired,
184
- onRangePositionChange: PropTypes.func.isRequired,
185
- rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
186
185
  /**
187
186
  * The system prop that allows defining system overrides as well as additional CSS styles.
188
187
  */
@@ -196,7 +195,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
196
195
  * Toolbar value placeholder—it is displayed when the value is empty.
197
196
  * @default "––"
198
197
  */
199
- toolbarPlaceholder: PropTypes.node,
200
- value: PropTypes.arrayOf(PropTypes.object).isRequired
198
+ toolbarPlaceholder: PropTypes.node
201
199
  } : void 0;
202
200
  export { DateTimeRangePickerToolbar };
@@ -13,6 +13,8 @@ import { renderDateRangeViewCalendar } from "../dateRangeViewRenderers/index.js"
13
13
  import { MultiInputDateRangeField } from "../MultiInputDateRangeField/index.js";
14
14
  import { useDesktopRangePicker } from "../internals/hooks/useDesktopRangePicker/index.js";
15
15
  import { validateDateRange } from "../validation/index.js";
16
+ const emptyActions = [];
17
+
16
18
  /**
17
19
  * Demos:
18
20
  *
@@ -32,6 +34,7 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
32
34
  day: renderDateRangeViewCalendar
33
35
  }, defaultizedProps.viewRenderers);
34
36
  const props = _extends({}, defaultizedProps, {
37
+ closeOnSelect: defaultizedProps.closeOnSelect ?? true,
35
38
  viewRenderers,
36
39
  format: utils.formats.keyboardDate,
37
40
  calendars: defaultizedProps.calendars ?? 2,
@@ -46,7 +49,10 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
46
49
  }),
47
50
  toolbar: _extends({
48
51
  hidden: true
49
- }, defaultizedProps.slotProps?.toolbar)
52
+ }, defaultizedProps.slotProps?.toolbar),
53
+ actionBar: ownerState => _extends({
54
+ actions: emptyActions
55
+ }, resolveComponentProps(defaultizedProps.slotProps?.actionBar, ownerState))
50
56
  })
51
57
  });
52
58
  const {
@@ -78,8 +84,8 @@ DesktopDateRangePicker.propTypes = {
78
84
  calendars: PropTypes.oneOf([1, 2, 3]),
79
85
  className: PropTypes.string,
80
86
  /**
81
- * If `true`, the popover or modal will close after submitting the full date.
82
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
87
+ * If `true`, the Picker will close after submitting the full date.
88
+ * @default true
83
89
  */
84
90
  closeOnSelect: PropTypes.bool,
85
91
  /**
@@ -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 = ["openTo", "rangePosition"];
5
+ const _excluded = ["openTo"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { isDatePickerView, isInternalTimeView, resolveDateTimeFormat, useUtils } from '@mui/x-date-pickers/internals';
@@ -22,15 +22,22 @@ import { useDateTimeRangePickerDefaultizedProps } from "../DateTimeRangePicker/s
22
22
  import { MultiInputDateTimeRangeField } from "../MultiInputDateTimeRangeField/index.js";
23
23
  import { DateTimeRangePickerTimeWrapper } from "../DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js";
24
24
  import { RANGE_VIEW_HEIGHT } from "../internals/constants/dimensions.js";
25
+ import { usePickerRangePositionContext } from "../hooks/index.js";
25
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
- const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
27
+ const rendererInterceptor = function RendererInterceptor(props) {
27
28
  const {
28
- openTo,
29
- rangePosition
29
+ viewRenderers,
30
+ popperView,
31
+ rendererProps
32
+ } = props;
33
+ const {
34
+ openTo
30
35
  } = rendererProps,
31
36
  otherProps = _objectWithoutPropertiesLoose(rendererProps, _excluded);
37
+ const {
38
+ rangePosition
39
+ } = usePickerRangePositionContext();
32
40
  const finalProps = _extends({}, otherProps, {
33
- rangePosition,
34
41
  focusedView: null,
35
42
  sx: [{
36
43
  [`&.${multiSectionDigitalClockClasses.root}`]: {
@@ -43,7 +50,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
43
50
  });
44
51
  const isTimeViewActive = isInternalTimeView(popperView);
45
52
  return /*#__PURE__*/_jsxs(React.Fragment, {
46
- children: [inViewRenderers.day?.(_extends({}, rendererProps, {
53
+ children: [viewRenderers.day?.(_extends({}, rendererProps, {
47
54
  availableRangePositions: [rangePosition],
48
55
  view: !isTimeViewActive ? popperView : 'day',
49
56
  views: rendererProps.views.filter(isDatePickerView),
@@ -59,7 +66,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
59
66
  view: isTimeViewActive ? popperView : 'hours',
60
67
  views: finalProps.views.filter(isInternalTimeView),
61
68
  openTo: isInternalTimeView(openTo) ? openTo : 'hours',
62
- viewRenderer: inViewRenderers[isTimeViewActive ? popperView : 'hours'],
69
+ viewRenderer: viewRenderers[isTimeViewActive ? popperView : 'hours'],
63
70
  sx: [{
64
71
  gridColumn: 3
65
72
  }, ...finalProps.sx]
@@ -92,7 +99,6 @@ const DesktopDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function Deskto
92
99
  // Need to avoid adding the `meridiem` view when unexpected renderer is specified
93
100
  const shouldHoursRendererContainMeridiemView = viewRenderers.hours?.name === renderMultiSectionDigitalClockTimeView.name;
94
101
  const views = !shouldHoursRendererContainMeridiemView ? defaultizedProps.views.filter(view => view !== 'meridiem') : defaultizedProps.views;
95
- const actionBarActions = defaultizedProps.shouldRenderTimeInASingleColumn ? [] : ['accept'];
96
102
  const props = _extends({}, defaultizedProps, {
97
103
  views,
98
104
  viewRenderers,
@@ -113,10 +119,7 @@ const DesktopDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function Deskto
113
119
  }, defaultizedProps.slotProps?.tabs),
114
120
  toolbar: _extends({
115
121
  hidden: true
116
- }, defaultizedProps.slotProps?.toolbar),
117
- actionBar: ownerState => _extends({
118
- actions: actionBarActions
119
- }, resolveComponentProps(defaultizedProps.slotProps?.actionBar, ownerState))
122
+ }, defaultizedProps.slotProps?.toolbar)
120
123
  })
121
124
  });
122
125
  const {
@@ -154,8 +157,8 @@ DesktopDateTimeRangePicker.propTypes = {
154
157
  calendars: PropTypes.oneOf([1, 2, 3]),
155
158
  className: PropTypes.string,
156
159
  /**
157
- * If `true`, the popover or modal will close after submitting the full date.
158
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
160
+ * If `true`, the Picker will close after submitting the full date.
161
+ * @default false
159
162
  */
160
163
  closeOnSelect: PropTypes.bool,
161
164
  /**
@@ -74,8 +74,8 @@ MobileDateRangePicker.propTypes = {
74
74
  autoFocus: PropTypes.bool,
75
75
  className: PropTypes.string,
76
76
  /**
77
- * If `true`, the popover or modal will close after submitting the full date.
78
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
77
+ * If `true`, the Picker will close after submitting the full date.
78
+ * @default false
79
79
  */
80
80
  closeOnSelect: PropTypes.bool,
81
81
  /**
@@ -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 = ["view", "openTo", "rangePosition"];
5
+ const _excluded = ["view", "openTo"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { refType } from '@mui/utils';
@@ -20,16 +20,23 @@ import { useDateTimeRangePickerDefaultizedProps } from "../DateTimeRangePicker/s
20
20
  import { MultiInputDateTimeRangeField } from "../MultiInputDateTimeRangeField/index.js";
21
21
  import { DateTimeRangePickerTimeWrapper } from "../DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js";
22
22
  import { RANGE_VIEW_HEIGHT } from "../internals/constants/dimensions.js";
23
+ import { usePickerRangePositionContext } from "../hooks/index.js";
23
24
  import { jsx as _jsx } from "react/jsx-runtime";
24
- const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
25
+ const rendererInterceptor = function RendererInterceptor(props) {
26
+ const {
27
+ viewRenderers,
28
+ popperView,
29
+ rendererProps
30
+ } = props;
31
+ const {
32
+ rangePosition
33
+ } = usePickerRangePositionContext();
25
34
  const {
26
35
  view,
27
- openTo,
28
- rangePosition
36
+ openTo
29
37
  } = rendererProps,
30
38
  otherRendererProps = _objectWithoutPropertiesLoose(rendererProps, _excluded);
31
39
  const finalProps = _extends({}, otherRendererProps, {
32
- rangePosition,
33
40
  focusedView: null,
34
41
  sx: [{
35
42
  width: DIALOG_WIDTH,
@@ -53,7 +60,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
53
60
  }]
54
61
  });
55
62
  const isTimeView = isInternalTimeView(popperView);
56
- const viewRenderer = inViewRenderers[popperView];
63
+ const viewRenderer = viewRenderers[popperView];
57
64
  if (!viewRenderer) {
58
65
  return null;
59
66
  }
@@ -148,8 +155,8 @@ MobileDateTimeRangePicker.propTypes = {
148
155
  autoFocus: PropTypes.bool,
149
156
  className: PropTypes.string,
150
157
  /**
151
- * If `true`, the popover or modal will close after submitting the full date.
152
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
158
+ * If `true`, the Picker will close after submitting the full date.
159
+ * @default false
153
160
  */
154
161
  closeOnSelect: PropTypes.bool,
155
162
  /**