@mui/x-date-pickers-pro 8.0.0-alpha.1 → 8.0.0-alpha.11

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 (294) 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 +2007 -230
  8. package/DateRangeCalendar/DateRangeCalendar.js +73 -46
  9. package/DateRangePicker/DateRangePicker.js +1 -4
  10. package/DateRangePicker/DateRangePicker.types.d.ts +6 -2
  11. package/DateRangePicker/DateRangePickerToolbar.d.ts +2 -3
  12. package/DateRangePicker/DateRangePickerToolbar.js +33 -41
  13. package/DateRangePicker/shared.d.ts +4 -3
  14. package/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
  15. package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +1 -2
  16. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +4 -5
  17. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +35 -33
  18. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -10
  19. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  20. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +2 -5
  21. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +81 -109
  22. package/DateTimeRangePicker/shared.d.ts +6 -5
  23. package/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
  24. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +7 -2
  25. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
  26. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +2 -3
  27. package/MobileDateRangePicker/MobileDateRangePicker.js +6 -8
  28. package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +2 -2
  29. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -16
  30. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +2 -3
  31. package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +9 -4
  32. package/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -121
  33. package/MultiInputDateRangeField/index.d.ts +5 -3
  34. package/MultiInputDateRangeField/index.js +2 -2
  35. package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.d.ts +6 -0
  36. package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
  37. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +9 -4
  38. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -121
  39. package/MultiInputDateTimeRangeField/index.d.ts +5 -3
  40. package/MultiInputDateTimeRangeField/index.js +2 -2
  41. package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.d.ts +6 -0
  42. package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
  43. package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +9 -4
  44. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -122
  45. package/MultiInputTimeRangeField/index.d.ts +5 -3
  46. package/MultiInputTimeRangeField/index.js +2 -2
  47. package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.d.ts +6 -0
  48. package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
  49. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  50. package/README.md +8 -5
  51. package/SingleInputDateRangeField/SingleInputDateRangeField.js +23 -33
  52. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +6 -16
  53. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  54. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
  55. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +23 -33
  56. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +6 -17
  57. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  58. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
  59. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +23 -33
  60. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +6 -17
  61. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  62. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
  63. package/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
  64. package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +2 -2
  65. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -2
  66. package/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  67. package/hooks/index.d.ts +2 -0
  68. package/hooks/index.js +2 -0
  69. package/hooks/package.json +6 -0
  70. package/hooks/useMultiInputRangeField/index.d.ts +1 -0
  71. package/hooks/useMultiInputRangeField/index.js +1 -0
  72. package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +53 -0
  73. package/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
  74. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.d.ts +17 -0
  75. package/{modern/internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
  76. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.d.ts +17 -0
  77. package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
  78. package/hooks/usePickerRangePositionContext.d.ts +7 -0
  79. package/hooks/usePickerRangePositionContext.js +15 -0
  80. package/index.d.ts +2 -0
  81. package/index.js +4 -2
  82. package/internals/hooks/models/index.d.ts +1 -1
  83. package/internals/hooks/models/useRangePicker.d.ts +8 -11
  84. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +68 -100
  85. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +8 -10
  86. package/internals/hooks/{useEnrichedRangePickerFieldProps.d.ts → useEnrichedRangePickerField.d.ts} +25 -16
  87. package/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +50 -63
  88. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +57 -80
  89. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +7 -9
  90. package/internals/hooks/useNullablePickerRangePositionContext.d.ts +5 -0
  91. package/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
  92. package/internals/hooks/useRangePosition.d.ts +4 -3
  93. package/internals/hooks/useRangePosition.js +1 -1
  94. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
  95. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +17 -30
  96. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +6 -12
  97. package/internals/models/dateTimeRange.d.ts +1 -6
  98. package/internals/models/fields.d.ts +7 -11
  99. package/internals/models/index.d.ts +0 -1
  100. package/internals/models/index.js +0 -1
  101. package/internals/models/managers.d.ts +3 -0
  102. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.d.ts +3 -0
  103. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +136 -0
  104. package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.d.ts +72 -0
  105. package/internals/utils/createMultiInputRangeField/index.d.ts +3 -0
  106. package/internals/utils/createMultiInputRangeField/index.js +2 -0
  107. package/internals/utils/date-fields-utils.d.ts +6 -6
  108. package/internals/utils/date-range-manager.js +2 -1
  109. package/internals/utils/releaseInfo.js +1 -1
  110. package/internals/utils/valueManagers.d.ts +4 -3
  111. package/internals/utils/valueManagers.js +7 -7
  112. package/managers/index.d.ts +6 -0
  113. package/managers/index.js +3 -0
  114. package/managers/package.json +6 -0
  115. package/managers/useDateRangeManager.d.ts +15 -0
  116. package/managers/useDateRangeManager.js +33 -0
  117. package/managers/useDateTimeRangeManager.d.ts +15 -0
  118. package/managers/useDateTimeRangeManager.js +33 -0
  119. package/managers/useTimeRangeManager.d.ts +15 -0
  120. package/managers/useTimeRangeManager.js +31 -0
  121. package/models/fields.d.ts +7 -11
  122. package/models/index.d.ts +1 -2
  123. package/models/index.js +1 -2
  124. package/models/range.d.ts +0 -2
  125. package/modern/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  126. package/modern/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  127. package/modern/DateRangeCalendar/DateRangeCalendar.js +73 -46
  128. package/modern/DateRangePicker/DateRangePicker.js +1 -4
  129. package/modern/DateRangePicker/DateRangePickerToolbar.js +33 -41
  130. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
  131. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +35 -33
  132. package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  133. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +81 -109
  134. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
  135. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
  136. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +6 -8
  137. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -16
  138. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -121
  139. package/modern/MultiInputDateRangeField/index.js +2 -2
  140. package/modern/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
  141. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -121
  142. package/modern/MultiInputDateTimeRangeField/index.js +2 -2
  143. package/modern/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
  144. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -122
  145. package/modern/MultiInputTimeRangeField/index.js +2 -2
  146. package/modern/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
  147. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  148. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +23 -33
  149. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
  150. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +23 -33
  151. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
  152. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +23 -33
  153. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
  154. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
  155. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  156. package/modern/hooks/index.js +2 -0
  157. package/modern/hooks/useMultiInputRangeField/index.js +1 -0
  158. package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
  159. package/{internals/hooks/useMultiInputFieldSelectedSections.js → modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
  160. package/modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
  161. package/modern/hooks/usePickerRangePositionContext.js +15 -0
  162. package/modern/index.js +4 -2
  163. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +68 -100
  164. package/modern/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +50 -63
  165. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +57 -80
  166. package/modern/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
  167. package/modern/internals/hooks/useRangePosition.js +1 -1
  168. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +17 -30
  169. package/modern/internals/models/index.js +0 -1
  170. package/modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +136 -0
  171. package/modern/internals/utils/createMultiInputRangeField/index.js +2 -0
  172. package/modern/internals/utils/date-range-manager.js +2 -1
  173. package/modern/internals/utils/releaseInfo.js +1 -1
  174. package/modern/internals/utils/valueManagers.js +7 -7
  175. package/modern/managers/index.js +3 -0
  176. package/modern/managers/useDateRangeManager.js +33 -0
  177. package/modern/managers/useDateTimeRangeManager.js +33 -0
  178. package/modern/managers/useTimeRangeManager.js +31 -0
  179. package/modern/models/index.js +1 -2
  180. package/modern/validation/validateDateRange.js +8 -0
  181. package/modern/validation/validateDateTimeRange.js +4 -0
  182. package/modern/validation/validateTimeRange.js +8 -0
  183. package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  184. package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  185. package/node/DateRangeCalendar/DateRangeCalendar.js +72 -45
  186. package/node/DateRangePicker/DateRangePicker.js +1 -4
  187. package/node/DateRangePicker/DateRangePickerToolbar.js +31 -39
  188. package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
  189. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +33 -31
  190. package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
  191. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +80 -108
  192. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
  193. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
  194. package/node/MobileDateRangePicker/MobileDateRangePicker.js +6 -8
  195. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -16
  196. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -124
  197. package/node/MultiInputDateRangeField/index.js +3 -9
  198. package/node/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +12 -0
  199. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -124
  200. package/node/MultiInputDateTimeRangeField/index.js +3 -9
  201. package/node/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +12 -0
  202. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +15 -125
  203. package/node/MultiInputTimeRangeField/index.js +3 -9
  204. package/node/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +12 -0
  205. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  206. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +22 -32
  207. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +13 -14
  208. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +22 -32
  209. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +13 -14
  210. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +22 -32
  211. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +13 -14
  212. package/node/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
  213. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
  214. package/node/hooks/index.js +19 -0
  215. package/node/hooks/useMultiInputRangeField/index.js +12 -0
  216. package/node/hooks/useMultiInputRangeField/useMultiInputRangeField.js +155 -0
  217. package/node/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +11 -10
  218. package/node/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +66 -0
  219. package/node/hooks/usePickerRangePositionContext.js +22 -0
  220. package/node/index.js +23 -1
  221. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +68 -100
  222. package/node/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +52 -65
  223. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +57 -80
  224. package/node/internals/hooks/useNullablePickerRangePositionContext.js +16 -0
  225. package/node/internals/hooks/useRangePosition.js +1 -1
  226. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +16 -29
  227. package/node/internals/models/index.js +0 -11
  228. package/node/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +143 -0
  229. package/node/internals/utils/createMultiInputRangeField/index.js +19 -0
  230. package/node/internals/utils/date-range-manager.js +2 -1
  231. package/node/internals/utils/releaseInfo.js +1 -1
  232. package/node/internals/utils/valueManagers.js +7 -7
  233. package/node/managers/index.js +26 -0
  234. package/node/managers/useDateRangeManager.js +40 -0
  235. package/node/managers/useDateTimeRangeManager.js +40 -0
  236. package/node/managers/useTimeRangeManager.js +38 -0
  237. package/node/models/index.js +0 -22
  238. package/node/validation/validateDateRange.js +8 -0
  239. package/node/validation/validateDateTimeRange.js +4 -0
  240. package/node/validation/validateTimeRange.js +8 -0
  241. package/package.json +6 -6
  242. package/themeAugmentation/overrides.d.ts +6 -4
  243. package/themeAugmentation/props.d.ts +2 -2
  244. package/validation/validateDateRange.d.ts +9 -1
  245. package/validation/validateDateRange.js +8 -0
  246. package/validation/validateDateTimeRange.d.ts +6 -2
  247. package/validation/validateDateTimeRange.js +4 -0
  248. package/validation/validateTimeRange.d.ts +9 -1
  249. package/validation/validateTimeRange.js +8 -0
  250. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +0 -53
  251. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +0 -54
  252. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +0 -54
  253. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +0 -21
  254. package/internals/hooks/useMultiInputRangeField/shared.d.ts +0 -1
  255. package/internals/hooks/useMultiInputRangeField/shared.js +0 -9
  256. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +0 -3
  257. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -113
  258. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +0 -3
  259. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -113
  260. package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +0 -11
  261. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +0 -3
  262. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -113
  263. package/internals/models/timeRange.d.ts +0 -6
  264. package/internals/models/timeRange.js +0 -1
  265. package/models/dateRange.d.ts +0 -7
  266. package/models/dateRange.js +0 -1
  267. package/models/multiInputRangeFieldClasses.d.ts +0 -7
  268. package/models/multiInputRangeFieldClasses.js +0 -1
  269. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
  270. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
  271. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
  272. package/modern/internals/hooks/useMultiInputRangeField/shared.js +0 -9
  273. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -113
  274. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -113
  275. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
  276. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -113
  277. package/modern/internals/models/timeRange.js +0 -1
  278. package/modern/models/dateRange.js +0 -1
  279. package/modern/models/multiInputRangeFieldClasses.js +0 -1
  280. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -5
  281. package/node/internals/hooks/useMultiInputRangeField/shared.js +0 -16
  282. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -121
  283. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -121
  284. package/node/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -5
  285. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -121
  286. package/node/internals/models/timeRange.js +0 -5
  287. package/node/models/dateRange.js +0 -5
  288. package/node/models/multiInputRangeFieldClasses.js +0 -5
  289. /package/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
  290. /package/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
  291. /package/{MultiInputTimeRangeField/MultiInputTimeRangeField.types.js → modern/internals/models/managers.js} +0 -0
  292. /package/{internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js → modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
  293. /package/node/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
  294. /package/node/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
@@ -7,11 +7,12 @@ import { styled, useThemeProps } from '@mui/material/styles';
7
7
  import composeClasses from '@mui/utils/composeClasses';
8
8
  import useEventCallback from '@mui/utils/useEventCallback';
9
9
  import { TimeIcon, DateRangeIcon, ArrowLeftIcon, ArrowRightIcon } from '@mui/x-date-pickers/icons';
10
- import { isDatePickerView } from '@mui/x-date-pickers/internals';
11
- import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
10
+ import { isDatePickerView, usePickerPrivateContext } from '@mui/x-date-pickers/internals';
11
+ import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hooks';
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)) {
@@ -25,10 +26,7 @@ const tabToView = tab => {
25
26
  }
26
27
  return 'hours';
27
28
  };
28
- const useUtilityClasses = ownerState => {
29
- const {
30
- classes
31
- } = ownerState;
29
+ const useUtilityClasses = classes => {
32
30
  const slots = {
33
31
  root: ['root'],
34
32
  tabButton: ['tabButton'],
@@ -72,18 +70,26 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
72
70
  });
73
71
  const {
74
72
  dateIcon = /*#__PURE__*/_jsx(DateRangeIcon, {}),
75
- onViewChange,
76
73
  timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
77
- view,
78
74
  hidden = typeof window === 'undefined' || window.innerHeight < 667,
79
- rangePosition,
80
- onRangePositionChange,
81
75
  className,
76
+ classes: classesProp,
82
77
  sx
83
78
  } = props;
84
79
  const translations = usePickerTranslations();
85
- const classes = useUtilityClasses(props);
86
- const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
80
+ const {
81
+ ownerState
82
+ } = usePickerPrivateContext();
83
+ const {
84
+ view,
85
+ setView
86
+ } = usePickerContext();
87
+ const classes = useUtilityClasses(classesProp);
88
+ const {
89
+ rangePosition,
90
+ setRangePosition
91
+ } = usePickerRangePositionContext();
92
+ const value = React.useMemo(() => view == null ? null : viewToTab(view, rangePosition), [view, rangePosition]);
87
93
  const isPreviousHidden = value === 'start-date';
88
94
  const isNextHidden = value === 'end-time';
89
95
  const tabLabel = React.useMemo(() => {
@@ -102,26 +108,34 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
102
108
  }, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
103
109
  const handleRangePositionChange = useEventCallback(newTab => {
104
110
  if (newTab.includes('start')) {
105
- onRangePositionChange('start');
111
+ setRangePosition('start');
106
112
  } else {
107
- onRangePositionChange('end');
113
+ setRangePosition('end');
108
114
  }
109
115
  });
110
116
  const changeToPreviousTab = useEventCallback(() => {
111
- const previousTab = tabOptions[tabOptions.indexOf(value) - 1];
112
- onViewChange(tabToView(previousTab));
117
+ const previousTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) - 1];
118
+ setView(tabToView(previousTab));
113
119
  handleRangePositionChange(previousTab);
114
120
  });
115
121
  const changeToNextTab = useEventCallback(() => {
116
- const nextTab = tabOptions[tabOptions.indexOf(value) + 1];
117
- onViewChange(tabToView(nextTab));
122
+ const nextTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) + 1];
123
+ setView(tabToView(nextTab));
118
124
  handleRangePositionChange(nextTab);
119
125
  });
120
126
  if (hidden) {
121
127
  return null;
122
128
  }
129
+ let startIcon;
130
+ if (view == null) {
131
+ startIcon = null;
132
+ } else if (isDatePickerView(view)) {
133
+ startIcon = dateIcon;
134
+ } else {
135
+ startIcon = timeIcon;
136
+ }
123
137
  return /*#__PURE__*/_jsxs(DateTimeRangePickerTabsRoot, {
124
- ownerState: props,
138
+ ownerState: ownerState,
125
139
  className: clsx(classes.root, className),
126
140
  sx: sx,
127
141
  children: [!isPreviousHidden ? /*#__PURE__*/_jsx(IconButton, {
@@ -132,7 +146,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
132
146
  }) : /*#__PURE__*/_jsx(DateTimeRangePickerTabFiller, {
133
147
  className: classes.filler
134
148
  }), /*#__PURE__*/_jsx(DateTimeRangePickerTab, {
135
- startIcon: isDatePickerView(view) ? dateIcon : timeIcon,
149
+ startIcon: startIcon,
136
150
  className: classes.tabButton,
137
151
  size: "large",
138
152
  children: tabLabel
@@ -166,14 +180,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerTabs.propTypes = {
166
180
  * @default `window.innerHeight < 667` for `DesktopDateTimeRangePicker` and `MobileDateTimeRangePicker`
167
181
  */
168
182
  hidden: PropTypes.bool,
169
- onRangePositionChange: PropTypes.func.isRequired,
170
- /**
171
- * Callback called when a tab is clicked.
172
- * @template TView
173
- * @param {TView} view The view to open
174
- */
175
- onViewChange: PropTypes.func.isRequired,
176
- rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
177
183
  /**
178
184
  * The system prop that allows defining system overrides as well as additional CSS styles.
179
185
  */
@@ -182,10 +188,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerTabs.propTypes = {
182
188
  * Time tab icon.
183
189
  * @default TimeIcon
184
190
  */
185
- timeIcon: PropTypes.element,
186
- /**
187
- * Currently visible picker view.
188
- */
189
- view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired
191
+ timeIcon: PropTypes.element
190
192
  } : void 0;
191
193
  export { DateTimeRangePickerTabs };
@@ -1,19 +1,17 @@
1
- import * as React from 'react';
2
1
  import { DefaultizedProps } from '@mui/x-internals/types';
3
2
  import { PickerSelectionState, PickerViewRenderer, TimeViewWithMeridiem, BaseClockProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
4
- import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
5
- export type DateTimeRangePickerTimeWrapperProps<TView extends TimeViewWithMeridiem, TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TView>, 'value' | 'defaultValue' | 'onChange'>, 'views'>> = Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> & Omit<TComponentProps, 'views' | 'view' | 'onViewChange' | 'value' | 'defaultValue' | 'onChange'> & {
6
- view: TView;
7
- onViewChange?: (view: TView) => void;
8
- views: readonly TView[];
3
+ export type DateTimeRangePickerTimeWrapperProps<TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TimeViewWithMeridiem>, 'value' | 'defaultValue' | 'onChange'>, 'views'>> = Omit<TComponentProps, 'views' | 'view' | 'onViewChange' | 'value' | 'defaultValue' | 'onChange'> & {
4
+ view: TimeViewWithMeridiem;
5
+ onViewChange?: (view: TimeViewWithMeridiem) => void;
6
+ views: readonly TimeViewWithMeridiem[];
9
7
  value?: PickerRangeValue;
10
8
  defaultValue?: PickerRangeValue;
11
- onChange?: (value: PickerRangeValue, selectionState: PickerSelectionState, selectedView: TView) => void;
12
- viewRenderer?: PickerViewRenderer<PickerRangeValue, TView, TComponentProps, any> | null;
13
- openTo?: TView;
9
+ onChange?: (value: PickerRangeValue, selectionState: PickerSelectionState, selectedView: TimeViewWithMeridiem) => void;
10
+ viewRenderer?: PickerViewRenderer<PickerRangeValue, TComponentProps> | null;
11
+ openTo?: TimeViewWithMeridiem;
14
12
  };
15
13
  /**
16
14
  * @ignore - internal component.
17
15
  */
18
- declare function DateTimeRangePickerTimeWrapper<TView extends TimeViewWithMeridiem, TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TView>, 'value' | 'defaultValue' | 'onChange'>, 'views'>>(props: DateTimeRangePickerTimeWrapperProps<TView, TComponentProps>, ref: React.Ref<HTMLDivElement>): React.ReactNode;
16
+ declare function DateTimeRangePickerTimeWrapper<TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TimeViewWithMeridiem>, 'value' | 'defaultValue' | 'onChange'>, 'views'>>(props: DateTimeRangePickerTimeWrapperProps<TComponentProps>): import("react").ReactNode;
19
17
  export { DateTimeRangePickerTimeWrapper };
@@ -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,
@@ -1,11 +1,8 @@
1
1
  import * as React from 'react';
2
- import { BaseToolbarProps, ExportedBaseToolbarProps, DateOrTimeViewWithMeridiem, PickerVariant, 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 { DateTimeRangePickerToolbarClasses } from './dateTimeRangePickerToolbarClasses';
5
- type DateTimeRangeViews = Exclude<DateOrTimeViewWithMeridiem, 'year' | 'month'>;
6
- export interface DateTimeRangePickerToolbarProps extends BaseToolbarProps<PickerRangeValue, DateTimeRangeViews>, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'>, ExportedDateTimeRangePickerToolbarProps {
4
+ export interface DateTimeRangePickerToolbarProps extends BaseToolbarProps, ExportedDateTimeRangePickerToolbarProps {
7
5
  ampm?: boolean;
8
- toolbarVariant?: PickerVariant;
9
6
  }
10
7
  export interface ExportedDateTimeRangePickerToolbarProps extends ExportedBaseToolbarProps {
11
8
  /**
@@ -2,22 +2,20 @@
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", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "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';
9
9
  import { styled, useThemeProps } from '@mui/material/styles';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
- import { useUtils } from '@mui/x-date-pickers/internals';
11
+ import { useUtils, useToolbarOwnerState, DateTimePickerToolbarOverrideContext } from '@mui/x-date-pickers/internals';
12
12
  import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hooks';
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
- const useUtilityClasses = ownerState => {
18
- const {
19
- classes
20
- } = ownerState;
18
+ const useUtilityClasses = classes => {
21
19
  const slots = {
22
20
  root: ['root'],
23
21
  startToolbar: ['startToolbar'],
@@ -39,36 +37,13 @@ const DateTimeRangePickerToolbarStart = styled(DateTimePickerToolbar, {
39
37
  overridesResolver: (_, styles) => styles.startToolbar
40
38
  })({
41
39
  borderBottom: 'none',
42
- variants: [{
43
- props: ({
44
- toolbarVariant
45
- }) => toolbarVariant !== 'desktop',
46
- style: {
47
- padding: '12px 8px 0 12px'
48
- }
49
- }, {
50
- props: {
51
- toolbarVariant: 'desktop'
52
- },
53
- style: {
54
- paddingBottom: 0
55
- }
56
- }]
40
+ paddingBottom: 0
57
41
  });
58
42
  const DateTimeRangePickerToolbarEnd = styled(DateTimePickerToolbar, {
59
43
  name: 'MuiDateTimeRangePickerToolbar',
60
44
  slot: 'EndToolbar',
61
45
  overridesResolver: (_, styles) => styles.endToolbar
62
- })({
63
- variants: [{
64
- props: ({
65
- toolbarVariant
66
- }) => toolbarVariant !== 'desktop',
67
- style: {
68
- padding: '12px 8px 12px 12px'
69
- }
70
- }]
71
- });
46
+ })({});
72
47
  const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTimeRangePickerToolbar(inProps, ref) {
73
48
  const props = useThemeProps({
74
49
  props: inProps,
@@ -76,15 +51,8 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
76
51
  });
77
52
  const utils = useUtils();
78
53
  const {
79
- value: [start, end],
80
- rangePosition,
81
- onRangePositionChange,
82
54
  className,
83
- onViewChange,
84
- onChange,
85
- view,
86
- isLandscape,
87
- views,
55
+ classes: classesProp,
88
56
  ampm,
89
57
  hidden,
90
58
  toolbarFormat,
@@ -94,11 +62,22 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
94
62
  } = props,
95
63
  other = _objectWithoutPropertiesLoose(props, _excluded);
96
64
  const {
65
+ value,
66
+ setValue,
97
67
  disabled,
98
- readOnly
68
+ readOnly,
69
+ view,
70
+ setView,
71
+ views
99
72
  } = usePickerContext();
73
+ const translations = usePickerTranslations();
74
+ const ownerState = useToolbarOwnerState();
75
+ const {
76
+ rangePosition,
77
+ setRangePosition
78
+ } = usePickerRangePositionContext();
79
+ const classes = useUtilityClasses(classesProp);
100
80
  const commonToolbarProps = {
101
- isLandscape,
102
81
  views,
103
82
  ampm,
104
83
  disabled,
@@ -107,41 +86,58 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
107
86
  toolbarFormat,
108
87
  toolbarPlaceholder
109
88
  };
110
- const translations = usePickerTranslations();
111
- const ownerState = props;
112
- const classes = useUtilityClasses(ownerState);
113
- const handleStartRangeViewChange = React.useCallback(newView => {
114
- if (newView === 'year' || newView === 'month') {
115
- return;
116
- }
117
- if (rangePosition !== 'start') {
118
- onRangePositionChange('start');
119
- }
120
- onViewChange(newView);
121
- }, [onRangePositionChange, onViewChange, rangePosition]);
122
- const handleEndRangeViewChange = React.useCallback(newView => {
123
- if (newView === 'year' || newView === 'month') {
124
- return;
125
- }
126
- if (rangePosition !== 'end') {
127
- onRangePositionChange('end');
128
- }
129
- onViewChange(newView);
130
- }, [onRangePositionChange, onViewChange, rangePosition]);
131
- const handleOnChange = React.useCallback(newDate => {
89
+ const wrappedSetValue = React.useCallback(newDate => {
132
90
  const {
133
91
  nextSelection,
134
92
  newRange
135
93
  } = calculateRangeChange({
136
94
  newDate,
137
95
  utils,
138
- range: props.value,
96
+ range: value,
139
97
  rangePosition,
140
98
  allowRangeFlip: true
141
99
  });
142
- onRangePositionChange(nextSelection);
143
- onChange(newRange);
144
- }, [onChange, onRangePositionChange, props.value, rangePosition, utils]);
100
+ setRangePosition(nextSelection);
101
+ setValue(newRange, {
102
+ changeImportance: 'set'
103
+ });
104
+ }, [setValue, setRangePosition, value, rangePosition, utils]);
105
+ const startOverrides = React.useMemo(() => {
106
+ const handleStartRangeViewChange = newView => {
107
+ if (newView === 'year' || newView === 'month') {
108
+ return;
109
+ }
110
+ if (rangePosition !== 'start') {
111
+ setRangePosition('start');
112
+ }
113
+ setView(newView);
114
+ };
115
+ return {
116
+ value: value[0],
117
+ setValue: wrappedSetValue,
118
+ forceDesktopVariant: true,
119
+ setView: handleStartRangeViewChange,
120
+ view: rangePosition === 'start' ? view : null
121
+ };
122
+ }, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
123
+ const endOverrides = React.useMemo(() => {
124
+ const handleEndRangeViewChange = newView => {
125
+ if (newView === 'year' || newView === 'month') {
126
+ return;
127
+ }
128
+ if (rangePosition !== 'end') {
129
+ setRangePosition('end');
130
+ }
131
+ setView(newView);
132
+ };
133
+ return {
134
+ value: value[1],
135
+ setValue: wrappedSetValue,
136
+ forceDesktopVariant: true,
137
+ setView: handleEndRangeViewChange,
138
+ view: rangePosition === 'end' ? view : null
139
+ };
140
+ }, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
145
141
  if (hidden) {
146
142
  return null;
147
143
  }
@@ -151,27 +147,23 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
151
147
  ref: ref,
152
148
  sx: sx
153
149
  }, other, {
154
- children: [/*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
155
- value: start,
156
- onViewChange: handleStartRangeViewChange,
157
- toolbarTitle: translations.start,
158
- ownerState: ownerState,
159
- toolbarVariant: "desktop",
160
- view: rangePosition === 'start' ? view : undefined,
161
- className: classes.startToolbar,
162
- onChange: handleOnChange,
163
- titleId: titleId ? `${titleId}-start-toolbar` : undefined
164
- }, commonToolbarProps)), /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
165
- value: end,
166
- onViewChange: handleEndRangeViewChange,
167
- toolbarTitle: translations.end,
168
- ownerState: ownerState,
169
- toolbarVariant: "desktop",
170
- view: rangePosition === 'end' ? view : undefined,
171
- className: classes.endToolbar,
172
- onChange: handleOnChange,
173
- titleId: titleId ? `${titleId}-end-toolbar` : undefined
174
- }, commonToolbarProps))]
150
+ children: [/*#__PURE__*/_jsx(DateTimePickerToolbarOverrideContext.Provider, {
151
+ value: startOverrides,
152
+ children: /*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
153
+ toolbarTitle: translations.start,
154
+ ownerState: ownerState,
155
+ className: classes.startToolbar,
156
+ titleId: titleId ? `${titleId}-start-toolbar` : undefined
157
+ }, commonToolbarProps))
158
+ }), /*#__PURE__*/_jsx(DateTimePickerToolbarOverrideContext.Provider, {
159
+ value: endOverrides,
160
+ children: /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
161
+ toolbarTitle: translations.end,
162
+ ownerState: ownerState,
163
+ className: classes.endToolbar,
164
+ titleId: titleId ? `${titleId}-end-toolbar` : undefined
165
+ }, commonToolbarProps))
166
+ })]
175
167
  }));
176
168
  });
177
169
  process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
@@ -190,16 +182,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
190
182
  * @default `true` for Desktop, `false` for Mobile.
191
183
  */
192
184
  hidden: PropTypes.bool,
193
- isLandscape: PropTypes.bool.isRequired,
194
- onChange: PropTypes.func.isRequired,
195
- onRangePositionChange: PropTypes.func.isRequired,
196
- /**
197
- * Callback called when a toolbar is clicked
198
- * @template TView
199
- * @param {TView} view The view to open
200
- */
201
- onViewChange: PropTypes.func.isRequired,
202
- rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
203
185
  /**
204
186
  * The system prop that allows defining system overrides as well as additional CSS styles.
205
187
  */
@@ -213,16 +195,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
213
195
  * Toolbar value placeholder—it is displayed when the value is empty.
214
196
  * @default "––"
215
197
  */
216
- toolbarPlaceholder: PropTypes.node,
217
- toolbarVariant: PropTypes.oneOf(['desktop', 'mobile']),
218
- value: PropTypes.arrayOf(PropTypes.object).isRequired,
219
- /**
220
- * Currently visible picker view.
221
- */
222
- view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired,
223
- /**
224
- * Available views.
225
- */
226
- views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
198
+ toolbarPlaceholder: PropTypes.node
227
199
  } : void 0;
228
200
  export { DateTimeRangePickerToolbar };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DefaultizedProps } from '@mui/x-internals/types';
3
3
  import { LocalizedComponent } from '@mui/x-date-pickers/locales';
4
- import { BaseDateValidationProps, BasePickerInputProps, PickerViewRendererLookup, BaseClockProps, DesktopOnlyTimePickerProps, TimeViewWithMeridiem, UseViewsOptions, DateTimeValidationProps, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
4
+ import { BasePickerInputProps, PickerViewRendererLookup, BaseClockProps, DesktopOnlyTimePickerProps, TimeViewWithMeridiem, UseViewsOptions, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
5
5
  import { TimeViewRendererProps } from '@mui/x-date-pickers/timeViewRenderers';
6
6
  import { DigitalClockSlots, DigitalClockSlotProps } from '@mui/x-date-pickers/DigitalClock';
7
7
  import { MultiSectionDigitalClockSlots, MultiSectionDigitalClockSlotProps } from '@mui/x-date-pickers/MultiSectionDigitalClock';
@@ -11,6 +11,7 @@ import { DateRangeCalendarSlots, DateRangeCalendarSlotProps, ExportedDateRangeCa
11
11
  import { DateTimeRangePickerToolbarProps, ExportedDateTimeRangePickerToolbarProps } from './DateTimeRangePickerToolbar';
12
12
  import { DateRangeViewRendererProps } from '../dateRangeViewRenderers';
13
13
  import { DateTimeRangePickerTabsProps, ExportedDateTimeRangePickerTabsProps } from './DateTimeRangePickerTabs';
14
+ import { ExportedValidateDateTimeRangeProps, ValidateDateTimeRangePropsToDefault } from '../validation/validateDateTimeRange';
14
15
  export interface BaseDateTimeRangePickerSlots extends DateRangeCalendarSlots, DigitalClockSlots, MultiSectionDigitalClockSlots {
15
16
  /**
16
17
  * Tabs enabling toggling between date and time pickers.
@@ -33,10 +34,10 @@ export interface BaseDateTimeRangePickerSlotProps extends DateRangeCalendarSlotP
33
34
  */
34
35
  toolbar?: ExportedDateTimeRangePickerToolbarProps;
35
36
  }
36
- export type DateTimeRangePickerRenderers<TView extends DateOrTimeViewWithMeridiem, TAdditionalProps extends {} = {}> = PickerViewRendererLookup<PickerRangeValue, TView, Omit<DateRangeViewRendererProps<'day'>, 'view' | 'slots' | 'slotProps'> & Omit<TimeViewRendererProps<TimeViewWithMeridiem, BaseClockProps<TimeViewWithMeridiem>>, 'view' | 'slots' | 'slotProps'> & {
37
+ export type DateTimeRangePickerRenderers<TView extends DateOrTimeViewWithMeridiem> = PickerViewRendererLookup<PickerRangeValue, TView, Omit<DateRangeViewRendererProps<'day'>, 'view' | 'slots' | 'slotProps'> & Omit<TimeViewRendererProps<TimeViewWithMeridiem, BaseClockProps<TimeViewWithMeridiem>>, 'view' | 'slots' | 'slotProps'> & {
37
38
  view: TView;
38
- }, TAdditionalProps>;
39
- export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<PickerRangeValue, DateTimeRangePickerView, DateTimeRangeValidationError>, 'orientation' | 'views' | 'openTo'>, ExportedDateRangeCalendarProps, BaseDateValidationProps, DesktopOnlyTimePickerProps, Partial<Pick<UseViewsOptions<PickerRangeValue, DateTimeRangePickerViewExternal>, 'openTo' | 'views'>>, DateTimeValidationProps {
39
+ }>;
40
+ export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<PickerRangeValue, DateTimeRangePickerView, DateTimeRangeValidationError>, 'orientation' | 'views' | 'openTo'>, ExportedDateRangeCalendarProps, ExportedValidateDateTimeRangeProps, DesktopOnlyTimePickerProps, Partial<Pick<UseViewsOptions<PickerRangeValue, DateTimeRangePickerViewExternal>, 'openTo' | 'views'>> {
40
41
  /**
41
42
  * Overridable component slots.
42
43
  * @default {}
@@ -54,7 +55,7 @@ export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<
54
55
  */
55
56
  viewRenderers?: Partial<DateTimeRangePickerRenderers<DateTimeRangePickerView>>;
56
57
  }
57
- type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' | keyof BaseDateValidationProps>, 'views'>> & {
58
+ type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' | ValidateDateTimeRangePropsToDefault>, 'views'>> & {
58
59
  shouldRenderTimeInASingleColumn: boolean;
59
60
  views: readonly DateTimeRangePickerView[];
60
61
  };
@@ -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,
@@ -41,17 +44,19 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
41
44
  field: MultiInputDateRangeField
42
45
  }, defaultizedProps.slots),
43
46
  slotProps: _extends({}, defaultizedProps.slotProps, {
44
- field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {
45
- ref
46
- }),
47
+ field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps)),
47
48
  toolbar: _extends({
48
49
  hidden: true
49
- }, defaultizedProps.slotProps?.toolbar)
50
+ }, defaultizedProps.slotProps?.toolbar),
51
+ actionBar: ownerState => _extends({
52
+ actions: emptyActions
53
+ }, resolveComponentProps(defaultizedProps.slotProps?.actionBar, ownerState))
50
54
  })
51
55
  });
52
56
  const {
53
57
  renderPicker
54
58
  } = useDesktopRangePicker({
59
+ ref,
55
60
  props,
56
61
  valueManager: rangeValueManager,
57
62
  valueType: 'date',
@@ -78,8 +83,8 @@ DesktopDateRangePicker.propTypes = {
78
83
  calendars: PropTypes.oneOf([1, 2, 3]),
79
84
  className: PropTypes.string,
80
85
  /**
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).
86
+ * If `true`, the Picker will close after submitting the full date.
87
+ * @default true
83
88
  */
84
89
  closeOnSelect: PropTypes.bool,
85
90
  /**
@@ -167,12 +172,10 @@ DesktopDateRangePicker.propTypes = {
167
172
  formatDensity: PropTypes.oneOf(['dense', 'spacious']),
168
173
  /**
169
174
  * Pass a ref to the `input` element.
170
- * Ignored if the field has several inputs.
171
175
  */
172
176
  inputRef: refType,
173
177
  /**
174
178
  * The label content.
175
- * Ignored if the field has several inputs.
176
179
  */
177
180
  label: PropTypes.node,
178
181
  /**
@@ -198,7 +201,6 @@ DesktopDateRangePicker.propTypes = {
198
201
  minDate: PropTypes.object,
199
202
  /**
200
203
  * Name attribute used by the `input` element in the Field.
201
- * Ignored if the field has several inputs.
202
204
  */
203
205
  name: PropTypes.string,
204
206
  /**
@@ -1,9 +1,9 @@
1
1
  import { MakeOptional } from '@mui/x-internals/types';
2
2
  import { UseDesktopRangePickerSlots, UseDesktopRangePickerSlotProps, DesktopRangeOnlyPickerProps } from '../internals/hooks/useDesktopRangePicker';
3
3
  import { BaseDateRangePickerProps, BaseDateRangePickerSlots, BaseDateRangePickerSlotProps } from '../DateRangePicker/shared';
4
- export interface DesktopDateRangePickerSlots extends BaseDateRangePickerSlots, MakeOptional<UseDesktopRangePickerSlots<'day'>, 'field'> {
4
+ export interface DesktopDateRangePickerSlots extends BaseDateRangePickerSlots, MakeOptional<UseDesktopRangePickerSlots, 'field'> {
5
5
  }
6
- export interface DesktopDateRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps, Omit<UseDesktopRangePickerSlotProps<'day', TEnableAccessibleFieldDOMStructure>, 'tabs' | 'toolbar'> {
6
+ export interface DesktopDateRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps, Omit<UseDesktopRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>, 'tabs' | 'toolbar'> {
7
7
  }
8
8
  export interface DesktopDateRangePickerProps<TEnableAccessibleFieldDOMStructure extends boolean = true> extends BaseDateRangePickerProps, DesktopRangeOnlyPickerProps {
9
9
  /**
@@ -21,4 +21,9 @@ export interface DesktopDateRangePickerProps<TEnableAccessibleFieldDOMStructure
21
21
  * @default {}
22
22
  */
23
23
  slotProps?: DesktopDateRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
24
+ /**
25
+ * If `true`, the Picker will close after submitting the full date.
26
+ * @default true
27
+ */
28
+ closeOnSelect?: boolean;
24
29
  }