@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
@@ -8,15 +8,14 @@ import useForkRef from '@mui/utils/useForkRef';
8
8
  import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
9
9
  import { onSpaceOrEnter } from '@mui/x-date-pickers/internals';
10
10
  const useMultiInputFieldSlotProps = ({
11
+ contextValue,
11
12
  variant,
12
- open,
13
- setOpen,
14
13
  readOnly,
15
14
  labelId,
16
15
  disableOpenPicker,
17
16
  onBlur,
18
17
  rangePosition,
19
- onRangePositionChange,
18
+ setRangePosition,
20
19
  localeText: inLocaleText,
21
20
  pickerSlotProps,
22
21
  pickerSlots,
@@ -24,7 +23,6 @@ const useMultiInputFieldSlotProps = ({
24
23
  anchorRef,
25
24
  currentView,
26
25
  initialView,
27
- onViewChange,
28
26
  startFieldRef,
29
27
  endFieldRef
30
28
  }) => {
@@ -33,7 +31,7 @@ const useMultiInputFieldSlotProps = ({
33
31
  const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
34
32
  const previousRangePosition = React.useRef(rangePosition);
35
33
  React.useEffect(() => {
36
- if (!open || variant === 'mobile') {
34
+ if (!contextValue.open || variant === 'mobile') {
37
35
  return;
38
36
  }
39
37
  const currentFieldRef = rangePosition === 'start' ? startFieldRef : endFieldRef;
@@ -49,36 +47,36 @@ const useMultiInputFieldSlotProps = ({
49
47
  // use the current view or `0` when the range position has just been swapped
50
48
  previousRangePosition.current === rangePosition ? currentView : 0);
51
49
  previousRangePosition.current = rangePosition;
52
- }, [rangePosition, open, currentView, startFieldRef, endFieldRef, variant]);
50
+ }, [rangePosition, contextValue.open, currentView, startFieldRef, endFieldRef, variant]);
53
51
  const openRangeStartSelection = event => {
54
52
  event.stopPropagation();
55
- onRangePositionChange('start');
53
+ setRangePosition('start');
56
54
  if (!readOnly && !disableOpenPicker) {
57
55
  event.preventDefault();
58
- setOpen(true);
56
+ contextValue.setOpen(true);
59
57
  }
60
58
  };
61
59
  const openRangeEndSelection = event => {
62
60
  event.stopPropagation();
63
- onRangePositionChange('end');
61
+ setRangePosition('end');
64
62
  if (!readOnly && !disableOpenPicker) {
65
63
  event.preventDefault();
66
- setOpen(true);
64
+ contextValue.setOpen(true);
67
65
  }
68
66
  };
69
67
  const handleFocusStart = () => {
70
- if (open) {
71
- onRangePositionChange('start');
68
+ if (contextValue.open) {
69
+ setRangePosition('start');
72
70
  if (previousRangePosition.current !== 'start' && initialView) {
73
- onViewChange?.(initialView);
71
+ contextValue.setView?.(initialView);
74
72
  }
75
73
  }
76
74
  };
77
75
  const handleFocusEnd = () => {
78
- if (open) {
79
- onRangePositionChange('end');
76
+ if (contextValue.open) {
77
+ setRangePosition('end');
80
78
  if (previousRangePosition.current !== 'end' && initialView) {
81
- onViewChange?.(initialView);
79
+ contextValue.setView?.(initialView);
82
80
  }
83
81
  }
84
82
  };
@@ -97,8 +95,8 @@ const useMultiInputFieldSlotProps = ({
97
95
  label: inLocaleText?.start ?? translations.start,
98
96
  onKeyDown: onSpaceOrEnter(openRangeStartSelection),
99
97
  onFocus: handleFocusStart,
100
- focused: open ? rangePosition === 'start' : undefined
101
- }, !readOnly && !fieldProps.disabled && {
98
+ focused: contextValue.open ? rangePosition === 'start' : undefined
99
+ }, !readOnly && !contextValue.disabled && {
102
100
  onClick: openRangeStartSelection
103
101
  }, variant === 'mobile' && {
104
102
  readOnly: true
@@ -113,8 +111,8 @@ const useMultiInputFieldSlotProps = ({
113
111
  label: inLocaleText?.end ?? translations.end,
114
112
  onKeyDown: onSpaceOrEnter(openRangeEndSelection),
115
113
  onFocus: handleFocusEnd,
116
- focused: open ? rangePosition === 'end' : undefined
117
- }, !readOnly && !fieldProps.disabled && {
114
+ focused: contextValue.open ? rangePosition === 'end' : undefined
115
+ }, !readOnly && !contextValue.disabled && {
118
116
  onClick: openRangeEndSelection
119
117
  }, variant === 'mobile' && {
120
118
  readOnly: true
@@ -145,29 +143,29 @@ const useMultiInputFieldSlotProps = ({
145
143
  slots,
146
144
  slotProps
147
145
  });
148
- return enrichedFieldProps;
146
+ return {
147
+ fieldProps: enrichedFieldProps,
148
+ fieldPrivateContextValue: {}
149
+ };
149
150
  };
150
151
  const useSingleInputFieldSlotProps = ({
152
+ contextValue,
153
+ fieldPrivateContextValue,
151
154
  variant,
152
- open,
153
- setOpen,
154
155
  readOnly,
155
156
  labelId,
156
157
  disableOpenPicker,
157
158
  label,
158
159
  onBlur,
159
160
  rangePosition,
160
- onRangePositionChange,
161
+ setRangePosition,
161
162
  singleInputFieldRef,
162
- pickerSlots,
163
- pickerSlotProps,
164
163
  fieldProps,
165
- anchorRef,
166
164
  currentView
167
165
  }) => {
168
166
  const handleFieldRef = useForkRef(fieldProps.unstableFieldRef, singleInputFieldRef);
169
167
  React.useEffect(() => {
170
- if (!open || !singleInputFieldRef.current || variant === 'mobile') {
168
+ if (!contextValue.open || !singleInputFieldRef.current || variant === 'mobile') {
171
169
  return;
172
170
  }
173
171
  if (singleInputFieldRef.current.isFieldFocused()) {
@@ -180,7 +178,7 @@ const useSingleInputFieldSlotProps = ({
180
178
  const newSelectedSection = rangePosition === 'start' ? sections.indexOf(currentView) : sections.lastIndexOf(currentView);
181
179
  singleInputFieldRef.current?.focusField(newSelectedSection);
182
180
  }
183
- }, [rangePosition, open, currentView, singleInputFieldRef, variant]);
181
+ }, [rangePosition, contextValue.open, currentView, singleInputFieldRef, variant]);
184
182
  const updateRangePosition = () => {
185
183
  if (!singleInputFieldRef.current?.isFieldFocused()) {
186
184
  return;
@@ -189,52 +187,41 @@ const useSingleInputFieldSlotProps = ({
189
187
  const activeSectionIndex = singleInputFieldRef.current?.getActiveSectionIndex();
190
188
  const domRangePosition = activeSectionIndex == null || activeSectionIndex < sections.length / 2 ? 'start' : 'end';
191
189
  if (domRangePosition != null && domRangePosition !== rangePosition) {
192
- onRangePositionChange(domRangePosition);
190
+ setRangePosition(domRangePosition);
193
191
  }
194
192
  };
195
193
  const handleSelectedSectionsChange = useEventCallback(selectedSection => {
196
194
  setTimeout(updateRangePosition);
197
- fieldProps.onSelectedSectionsChange?.(selectedSection);
195
+ fieldPrivateContextValue.onSelectedSectionsChange?.(selectedSection);
198
196
  });
199
197
  const openPicker = event => {
200
198
  event.stopPropagation();
201
199
  if (!readOnly && !disableOpenPicker) {
202
200
  event.preventDefault();
203
- setOpen(true);
201
+ contextValue.setOpen(true);
204
202
  }
205
203
  };
206
- const slots = _extends({}, fieldProps.slots, {
207
- textField: pickerSlots?.textField,
208
- clearButton: pickerSlots?.clearButton,
209
- clearIcon: pickerSlots?.clearIcon
210
- });
211
- const slotProps = _extends({}, fieldProps.slotProps, {
212
- textField: pickerSlotProps?.textField,
213
- clearButton: pickerSlotProps?.clearButton,
214
- clearIcon: pickerSlotProps?.clearIcon
215
- });
216
204
  const enrichedFieldProps = _extends({}, fieldProps, {
217
- slots,
218
- slotProps,
219
205
  label,
220
206
  unstableFieldRef: handleFieldRef,
221
207
  onKeyDown: onSpaceOrEnter(openPicker, fieldProps.onKeyDown),
222
- onSelectedSectionsChange: handleSelectedSectionsChange,
223
208
  onBlur,
224
- InputProps: _extends({
225
- ref: anchorRef
226
- }, fieldProps?.InputProps),
227
- focused: open ? true : undefined
209
+ focused: contextValue.open ? true : undefined
228
210
  }, labelId != null && {
229
211
  id: labelId
230
212
  }, variant === 'mobile' && {
231
213
  readOnly: true
232
- }, !readOnly && !fieldProps.disabled && {
214
+ }, !readOnly && !contextValue.disabled && {
233
215
  onClick: openPicker
234
216
  });
235
- return enrichedFieldProps;
217
+ return {
218
+ fieldProps: enrichedFieldProps,
219
+ fieldPrivateContextValue: {
220
+ onSelectedSectionsChange: handleSelectedSectionsChange
221
+ }
222
+ };
236
223
  };
237
- export const useEnrichedRangePickerFieldProps = params => {
224
+ export const useEnrichedRangePickerField = params => {
238
225
  /* eslint-disable react-hooks/rules-of-hooks */
239
226
  if (process.env.NODE_ENV !== 'production') {
240
227
  const fieldTypeRef = React.useRef(params.fieldType);
@@ -5,12 +5,13 @@ import * as React from 'react';
5
5
  import useSlotProps from '@mui/utils/useSlotProps';
6
6
  import { useLicenseVerifier } from '@mui/x-license';
7
7
  import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
8
- import { usePicker, PickersModalDialog, PickerProvider } from '@mui/x-date-pickers/internals';
8
+ import { usePicker, PickersModalDialog, PickerProvider, PickerFieldUIContextProvider } from '@mui/x-date-pickers/internals';
9
9
  import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
10
10
  import useId from '@mui/utils/useId';
11
- import { useEnrichedRangePickerFieldProps } from "../useEnrichedRangePickerFieldProps.js";
11
+ import { useEnrichedRangePickerField } from "../useEnrichedRangePickerField.js";
12
12
  import { getReleaseInfo } from "../../utils/releaseInfo.js";
13
13
  import { useRangePosition } from "../useRangePosition.js";
14
+ import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const releaseInfo = getReleaseInfo();
16
17
  export const useMobileRangePicker = _ref => {
@@ -24,17 +25,10 @@ export const useMobileRangePicker = _ref => {
24
25
  slotProps: innerSlotProps,
25
26
  className,
26
27
  sx,
27
- format,
28
- formatDensity,
29
- enableAccessibleFieldDOMStructure,
30
- selectedSections,
31
- onSelectedSectionsChange,
32
- timezone,
33
28
  label,
34
29
  inputRef,
35
30
  name,
36
31
  readOnly,
37
- disabled,
38
32
  disableOpenPicker,
39
33
  localeText
40
34
  } = props;
@@ -42,37 +36,31 @@ export const useMobileRangePicker = _ref => {
42
36
  const endFieldRef = React.useRef(null);
43
37
  const singleInputFieldRef = React.useRef(null);
44
38
  const fieldType = slots.field.fieldType ?? 'multi-input';
45
- const {
46
- rangePosition,
47
- onRangePositionChange
48
- } = useRangePosition(props, fieldType === 'single-input' ? singleInputFieldRef : undefined);
39
+ const rangePositionResponse = useRangePosition(props, fieldType === 'single-input' ? singleInputFieldRef : undefined);
49
40
  const labelId = useId();
50
41
  const contextTranslations = usePickerTranslations();
51
42
  let fieldRef;
52
43
  if (fieldType === 'single-input') {
53
44
  fieldRef = singleInputFieldRef;
54
- } else if (rangePosition === 'start') {
45
+ } else if (rangePositionResponse.rangePosition === 'start') {
55
46
  fieldRef = startFieldRef;
56
47
  } else {
57
48
  fieldRef = endFieldRef;
58
49
  }
59
50
  const {
60
- layoutProps,
61
51
  providerProps,
62
52
  renderCurrentView,
63
- fieldProps: pickerFieldProps,
64
53
  ownerState
65
54
  } = usePicker(_extends({}, pickerParams, {
66
55
  props,
67
56
  variant: 'mobile',
68
57
  autoFocusView: true,
69
58
  fieldRef,
70
- localeText,
71
- additionalViewProps: {
72
- rangePosition,
73
- onRangePositionChange
74
- }
59
+ localeText
75
60
  }));
61
+
62
+ // Temporary hack to hide the opening button on the range pickers until we have migrate them to the new opening logic.
63
+ providerProps.contextValue.triggerStatus = 'hidden';
76
64
  const Field = slots.field;
77
65
  const fieldProps = useSlotProps({
78
66
  elementType: Field,
@@ -80,16 +68,6 @@ export const useMobileRangePicker = _ref => {
80
68
  additionalProps: _extends({
81
69
  // Internal props
82
70
  readOnly: readOnly ?? true,
83
- disabled,
84
- format,
85
- formatDensity,
86
- enableAccessibleFieldDOMStructure,
87
- selectedSections,
88
- onSelectedSectionsChange,
89
- timezone
90
- }, pickerFieldProps, {
91
- // onChange and value
92
-
93
71
  // Forwarded props
94
72
  className,
95
73
  sx
@@ -101,37 +79,24 @@ export const useMobileRangePicker = _ref => {
101
79
  ownerState
102
80
  });
103
81
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
104
- const enrichedFieldProps = useEnrichedRangePickerFieldProps({
82
+ const enrichedFieldResponse = useEnrichedRangePickerField(_extends({
105
83
  variant: 'mobile',
106
84
  fieldType,
107
85
  // These direct access to `providerProps` will go away once the range fields handle the picker opening
108
- open: providerProps.contextValue.open,
109
- setOpen: providerProps.contextValue.setOpen,
86
+ contextValue: providerProps.contextValue,
87
+ fieldPrivateContextValue: providerProps.fieldPrivateContextValue,
110
88
  readOnly,
111
89
  labelId,
112
90
  disableOpenPicker,
113
91
  label,
114
92
  localeText,
115
- rangePosition,
116
- onRangePositionChange,
117
93
  pickerSlots: slots,
118
94
  pickerSlotProps: innerSlotProps,
119
95
  fieldProps,
120
96
  startFieldRef,
121
97
  endFieldRef,
122
98
  singleInputFieldRef
123
- });
124
- const slotPropsForLayout = _extends({}, innerSlotProps, {
125
- tabs: _extends({}, innerSlotProps?.tabs, {
126
- rangePosition,
127
- onRangePositionChange
128
- }),
129
- toolbar: _extends({}, innerSlotProps?.toolbar, {
130
- titleId: labelId,
131
- rangePosition,
132
- onRangePositionChange
133
- })
134
- });
99
+ }, rangePositionResponse));
135
100
  const Layout = slots?.layout ?? PickersLayout;
136
101
  const finalLocaleText = _extends({}, contextTranslations, localeText);
137
102
  let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
@@ -150,20 +115,32 @@ export const useMobileRangePicker = _ref => {
150
115
  labelledById = labels.length > 0 ? labels.join(' ') : undefined;
151
116
  }
152
117
  const slotProps = _extends({}, innerSlotProps, {
118
+ toolbar: _extends({}, innerSlotProps?.toolbar, {
119
+ titleId: labelId
120
+ }),
153
121
  mobilePaper: _extends({
154
122
  'aria-labelledby': labelledById
155
123
  }, innerSlotProps?.mobilePaper)
156
124
  });
157
- const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
158
- children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersModalDialog, {
125
+ const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
126
+ // This override will go away once the range fields handle the picker opening
127
+ fieldPrivateContextValue: _extends({}, providerProps.fieldPrivateContextValue, enrichedFieldResponse.fieldPrivateContextValue),
128
+ children: /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
159
129
  slots: slots,
160
130
  slotProps: slotProps,
161
- children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
162
- slots: slots,
163
- slotProps: slotPropsForLayout,
164
- children: renderCurrentView()
165
- }))
166
- })]
131
+ children: /*#__PURE__*/_jsxs(PickerRangePositionContext.Provider, {
132
+ value: rangePositionResponse,
133
+ children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldResponse.fieldProps)), /*#__PURE__*/_jsx(PickersModalDialog, {
134
+ slots: slots,
135
+ slotProps: slotProps,
136
+ children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
137
+ slots: slots,
138
+ slotProps: slotProps,
139
+ children: renderCurrentView()
140
+ }))
141
+ })]
142
+ })
143
+ })
167
144
  }));
168
145
  return {
169
146
  renderPicker
@@ -1,12 +1,12 @@
1
1
  import { PickersModalDialogSlots, PickersModalDialogSlotProps, UsePickerViewsProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
2
- import { RangeOnlyPickerProps, RangePickerAdditionalViewProps, UseRangePickerParams, UseRangePickerProps, UseRangePickerSlotProps, UseRangePickerSlots } from '../models/useRangePicker';
2
+ import { RangeOnlyPickerProps, UseRangePickerParams, UseRangePickerProps, UseRangePickerSlotProps, UseRangePickerSlots } from '../models/useRangePicker';
3
3
  export interface UseMobileRangePickerSlots extends UseRangePickerSlots, PickersModalDialogSlots {
4
4
  }
5
5
  export interface UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends UseRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>, PickersModalDialogSlotProps {
6
6
  }
7
7
  export interface MobileRangeOnlyPickerProps extends RangeOnlyPickerProps {
8
8
  }
9
- export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends UseRangePickerProps<TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
9
+ export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any>> extends UseRangePickerProps<TView, TError, TExternalProps> {
10
10
  /**
11
11
  * Overridable component slots.
12
12
  * @default {}
@@ -18,7 +18,5 @@ export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMerid
18
18
  */
19
19
  slotProps?: UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
20
20
  }
21
- export interface MobileRangePickerAdditionalViewProps extends RangePickerAdditionalViewProps {
22
- }
23
- export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps, MobileRangePickerAdditionalViewProps> {
21
+ export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps> {
24
22
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns information about the range position of the picker that wraps the current component.
3
+ * If no picker wraps the current component, returns `null`.
4
+ */
5
+ export declare function useNullablePickerRangePositionContext(): import("./useRangePosition").UseRangePositionResponse | null;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { PickerRangePositionContext } from "../../hooks/usePickerRangePositionContext.js";
3
+
4
+ /**
5
+ * Returns information about the range position of the picker that wraps the current component.
6
+ * If no picker wraps the current component, returns `null`.
7
+ */
8
+ export function useNullablePickerRangePositionContext() {
9
+ return React.useContext(PickerRangePositionContext);
10
+ }
@@ -22,6 +22,6 @@ export interface UseRangePositionProps {
22
22
  }
23
23
  export interface UseRangePositionResponse {
24
24
  rangePosition: RangePosition;
25
- onRangePositionChange: (newPosition: RangePosition) => void;
25
+ setRangePosition: (newPosition: RangePosition) => void;
26
26
  }
27
- export declare const useRangePosition: (props: UseRangePositionProps, singleInputFieldRef?: React.RefObject<FieldRef<PickerRangeValue>>) => UseRangePositionResponse;
27
+ export declare const useRangePosition: (props: UseRangePositionProps, singleInputFieldRef?: React.RefObject<FieldRef<PickerRangeValue> | null>) => UseRangePositionResponse;
@@ -25,6 +25,6 @@ export const useRangePosition = (props, singleInputFieldRef) => {
25
25
  });
26
26
  return {
27
27
  rangePosition,
28
- onRangePositionChange: handleRangePositionChange
28
+ setRangePosition: handleRangePositionChange
29
29
  };
30
30
  };
@@ -7,6 +7,7 @@ import { styled } from '@mui/material/styles';
7
7
  import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
8
8
  import { usePicker, DIALOG_WIDTH, PickerProvider } from '@mui/x-date-pickers/internals';
9
9
  import { useRangePosition } from "../useRangePosition.js";
10
+ import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const PickerStaticLayout = styled(PickersLayout)(({
12
13
  theme
@@ -35,12 +36,8 @@ export const useStaticRangePicker = _ref => {
35
36
  displayStaticWrapperAs,
36
37
  autoFocus
37
38
  } = props;
39
+ const rangePositionResponse = useRangePosition(props);
38
40
  const {
39
- rangePosition,
40
- onRangePositionChange
41
- } = useRangePosition(props);
42
- const {
43
- layoutProps,
44
41
  providerProps,
45
42
  renderCurrentView
46
43
  } = usePicker(_extends({}, pickerParams, {
@@ -48,29 +45,22 @@ export const useStaticRangePicker = _ref => {
48
45
  autoFocusView: autoFocus ?? false,
49
46
  fieldRef: undefined,
50
47
  localeText,
51
- additionalViewProps: {
52
- rangePosition,
53
- onRangePositionChange
54
- },
55
48
  variant: displayStaticWrapperAs
56
49
  }));
57
50
  const Layout = slots?.layout ?? PickerStaticLayout;
58
- const slotPropsForLayout = _extends({}, slotProps, {
59
- toolbar: _extends({}, slotProps?.toolbar, {
60
- rangePosition,
61
- onRangePositionChange
62
- })
63
- });
64
- const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
65
- children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
66
- slots: slots,
67
- slotProps: slotPropsForLayout,
68
- sx: [...(Array.isArray(sx) ? sx : [sx]), ...(Array.isArray(slotProps?.layout?.sx) ? slotProps.layout.sx : [slotProps?.layout?.sx])],
69
- className: clsx(className, slotProps?.layout?.className),
70
- ref: ref,
71
- children: renderCurrentView()
51
+ const renderPicker = () => /*#__PURE__*/_jsx(PickerRangePositionContext.Provider, {
52
+ value: rangePositionResponse,
53
+ children: /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
54
+ children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
55
+ slots: slots,
56
+ slotProps: slotProps,
57
+ sx: [...(Array.isArray(sx) ? sx : [sx]), ...(Array.isArray(slotProps?.layout?.sx) ? slotProps.layout.sx : [slotProps?.layout?.sx])],
58
+ className: clsx(className, slotProps?.layout?.className),
59
+ ref: ref,
60
+ children: renderCurrentView()
61
+ }))
72
62
  }))
73
- }));
63
+ });
74
64
  return {
75
65
  renderPicker
76
66
  };
@@ -9,7 +9,7 @@ export interface UseStaticRangePickerSlotProps extends ExportedPickersLayoutSlot
9
9
  }
10
10
  export interface StaticRangeOnlyPickerProps extends StaticOnlyPickerProps, UseRangePositionProps {
11
11
  }
12
- export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends BasePickerProps<PickerRangeValue, TView, TError, TExternalProps, {}>, StaticRangeOnlyPickerProps {
12
+ export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends BasePickerProps<PickerRangeValue, TView, TError, TExternalProps>, StaticRangeOnlyPickerProps {
13
13
  /**
14
14
  * Overridable components.
15
15
  * @default {}
@@ -21,7 +21,7 @@ export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMerid
21
21
  */
22
22
  slotProps?: UseStaticRangePickerSlotProps;
23
23
  }
24
- export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParams<PickerRangeValue, TView, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
24
+ export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParams<PickerRangeValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator'> {
25
25
  props: TExternalProps;
26
26
  /**
27
27
  * Ref to pass to the root element
@@ -1,8 +1,3 @@
1
- import { MakeOptional } from '@mui/x-internals/types';
2
- import { UseFieldInternalProps, DateOrTimeViewWithMeridiem, AmPmProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
3
- import { DateTimeRangeValidationError, RangeFieldSeparatorProps } from '../../models';
4
- import { ExportedValidateDateTimeRangeProps } from '../../validation/validateDateTimeRange';
5
- export interface UseDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateDateTimeRangeProps, AmPmProps {
6
- }
1
+ import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
7
2
  export type DateTimeRangePickerView = Exclude<DateOrTimeViewWithMeridiem, 'month' | 'year'>;
8
3
  export type DateTimeRangePickerViewExternal = Exclude<DateTimeRangePickerView, 'meridiem'>;
@@ -1,6 +1,5 @@
1
1
  import { SxProps } from '@mui/material/styles';
2
2
  import { SlotComponentProps } from '@mui/utils';
3
- import { MakeRequired } from '@mui/x-internals/types';
4
3
  import { PickerRangeValue, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
5
4
  import { FieldOwnerState } from '@mui/x-date-pickers/models';
6
5
  import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
@@ -9,7 +8,7 @@ import type { MultiInputFieldRefs, MultiInputFieldSlotRootProps, RangeFieldSepar
9
8
  * Props the multi input field can receive when used inside a picker.
10
9
  * Only contains what the MUI components are passing to the field, not what users can pass using the `props.slotProps.field`.
11
10
  */
12
- export interface BaseMultiInputFieldProps<TEnableAccessibleFieldDOMStructure extends boolean, TError> extends MakeRequired<Pick<UseFieldInternalProps<PickerRangeValue, TEnableAccessibleFieldDOMStructure, TError>, 'readOnly' | 'disabled' | 'format' | 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange' | 'timezone' | 'autoFocus' | 'value' | 'onChange'>, 'format' | 'value' | 'onChange' | 'timezone'>, RangeFieldSeparatorProps, MultiInputFieldRefs {
11
+ export interface BaseMultiInputFieldProps<TEnableAccessibleFieldDOMStructure extends boolean, TError> extends Pick<UseFieldInternalProps<PickerRangeValue, TEnableAccessibleFieldDOMStructure, TError>, 'readOnly' | 'autoFocus'>, RangeFieldSeparatorProps, MultiInputFieldRefs {
13
12
  className: string | undefined;
14
13
  sx: SxProps<any> | undefined;
15
14
  slots?: {
@@ -1,4 +1,3 @@
1
1
  export * from './dateRange';
2
2
  export * from './dateTimeRange';
3
- export * from './timeRange';
4
3
  export * from './rangePickerProps';
@@ -1,4 +1,3 @@
1
1
  export * from "./dateRange.js";
2
2
  export * from "./dateTimeRange.js";
3
- export * from "./timeRange.js";
4
3
  export * from "./rangePickerProps.js";
@@ -0,0 +1,3 @@
1
+ import { PickerRangeValue } from '@mui/x-date-pickers/internals';
2
+ import { PickerManager } from '@mui/x-date-pickers/models';
3
+ export type PickerAnyRangeManager = PickerManager<PickerRangeValue, any, any, any, any>;
@@ -0,0 +1,3 @@
1
+ import { CreateMultiInputRangeFieldParameters, CreateMultiInputRangeFieldReturnValue } from './createMultiInputRangeField.types';
2
+ import { PickerAnyRangeManager } from '../../models/managers';
3
+ export declare function createMultiInputRangeField<TManager extends PickerAnyRangeManager>({ useManager, name, getUtilityClass, }: CreateMultiInputRangeFieldParameters<TManager>): CreateMultiInputRangeFieldReturnValue<TManager>;