@mui/x-date-pickers-pro 7.0.0-beta.1 → 7.0.0-beta.4

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 (293) hide show
  1. package/CHANGELOG.md +437 -4
  2. package/DateRangeCalendar/DateRangeCalendar.d.ts +2 -1
  3. package/DateRangeCalendar/DateRangeCalendar.js +9 -7
  4. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +10 -7
  5. package/DateRangeCalendar/useDragRange.d.ts +4 -4
  6. package/DateRangePicker/DateRangePicker.d.ts +2 -1
  7. package/DateRangePicker/DateRangePicker.js +14 -14
  8. package/DateRangePicker/DateRangePicker.types.d.ts +5 -4
  9. package/DateRangePicker/DateRangePickerToolbar.d.ts +6 -2
  10. package/DateRangePicker/DateRangePickerToolbar.js +7 -1
  11. package/DateRangePicker/shared.d.ts +6 -5
  12. package/DateRangePickerDay/DateRangePickerDay.d.ts +3 -2
  13. package/DateRangePickerDay/DateRangePickerDay.js +2 -2
  14. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +2 -1
  15. package/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
  16. package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +5 -4
  17. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
  18. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +3 -2
  19. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +6 -2
  20. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
  21. package/DateTimeRangePicker/shared.d.ts +6 -5
  22. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +2 -1
  23. package/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
  24. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +5 -4
  25. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +2 -1
  26. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
  27. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +5 -4
  28. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +2 -1
  29. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +2 -1
  30. package/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
  31. package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +5 -4
  32. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +2 -1
  33. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -21
  34. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +5 -4
  35. package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +2 -1
  36. package/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
  37. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +12 -14
  38. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +2 -1
  39. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
  40. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +13 -16
  41. package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +2 -1
  42. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
  43. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +13 -16
  44. package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +3 -2
  45. package/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
  46. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +11 -13
  47. package/SingleInputDateRangeField/index.d.ts +1 -1
  48. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +3 -3
  49. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -15
  50. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +3 -2
  51. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -19
  52. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +12 -14
  53. package/SingleInputDateTimeRangeField/index.d.ts +1 -1
  54. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +3 -3
  55. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -20
  56. package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +3 -2
  57. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
  58. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +12 -14
  59. package/SingleInputTimeRangeField/index.d.ts +1 -1
  60. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +3 -3
  61. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -14
  62. package/StaticDateRangePicker/StaticDateRangePicker.d.ts +2 -1
  63. package/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
  64. package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +4 -3
  65. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +3 -2
  66. package/index.d.ts +7 -2
  67. package/index.js +8 -2
  68. package/internals/hooks/models/useRangePicker.d.ts +8 -7
  69. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +2 -1
  70. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -8
  71. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +7 -6
  72. package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +15 -15
  73. package/internals/hooks/useEnrichedRangePickerFieldProps.js +37 -40
  74. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +2 -1
  75. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +18 -9
  76. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +7 -6
  77. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +21 -0
  78. package/internals/hooks/useMultiInputFieldSelectedSections.js +43 -0
  79. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +2 -1
  80. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -12
  81. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +3 -3
  82. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -31
  83. package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +4 -4
  84. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +3 -3
  85. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -25
  86. package/internals/hooks/useRangePosition.d.ts +2 -4
  87. package/internals/hooks/useRangePosition.js +3 -6
  88. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +2 -1
  89. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
  90. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +6 -6
  91. package/internals/models/dateRange.d.ts +5 -16
  92. package/internals/models/dateTimeRange.d.ts +5 -6
  93. package/internals/models/index.d.ts +0 -1
  94. package/internals/models/index.js +0 -1
  95. package/internals/models/timeRange.d.ts +4 -6
  96. package/internals/utils/date-fields-utils.d.ts +1 -5
  97. package/internals/utils/date-range-manager.d.ts +5 -5
  98. package/internals/utils/date-utils.d.ts +5 -5
  99. package/internals/utils/releaseInfo.js +1 -1
  100. package/internals/utils/validation/validateDateRange.d.ts +2 -2
  101. package/internals/utils/validation/validateDateTimeRange.d.ts +2 -2
  102. package/internals/utils/valueManagers.d.ts +3 -3
  103. package/internals/utils/valueManagers.js +11 -6
  104. package/models/fields.d.ts +69 -0
  105. package/models/index.d.ts +1 -0
  106. package/models/index.js +1 -0
  107. package/models/range.d.ts +3 -2
  108. package/modern/DateRangeCalendar/DateRangeCalendar.js +9 -7
  109. package/modern/DateRangePicker/DateRangePicker.js +14 -14
  110. package/modern/DateRangePicker/DateRangePickerToolbar.js +7 -1
  111. package/modern/DateRangePickerDay/DateRangePickerDay.js +2 -2
  112. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
  113. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
  114. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
  115. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
  116. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
  117. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
  118. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -21
  119. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
  120. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
  121. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
  122. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
  123. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -14
  124. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -19
  125. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -19
  126. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
  127. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -13
  128. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
  129. package/modern/index.js +8 -2
  130. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -8
  131. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +34 -37
  132. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +18 -9
  133. package/modern/internals/hooks/useMultiInputFieldSelectedSections.js +40 -0
  134. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -12
  135. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -30
  136. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -24
  137. package/modern/internals/hooks/useRangePosition.js +3 -6
  138. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
  139. package/modern/internals/models/index.js +0 -1
  140. package/modern/internals/utils/releaseInfo.js +1 -1
  141. package/modern/internals/utils/valueManagers.js +11 -6
  142. package/modern/models/index.js +1 -0
  143. package/node/DateRangeCalendar/DateRangeCalendar.js +10 -8
  144. package/node/DateRangePicker/DateRangePicker.js +14 -14
  145. package/node/DateRangePicker/DateRangePickerToolbar.js +7 -1
  146. package/node/DateRangePickerDay/DateRangePickerDay.js +3 -3
  147. package/node/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
  148. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
  149. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
  150. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
  151. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
  152. package/node/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
  153. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +22 -23
  154. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
  155. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
  156. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
  157. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
  158. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -16
  159. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +24 -22
  160. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -21
  161. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
  162. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -15
  163. package/node/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
  164. package/node/index.js +18 -9
  165. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +18 -9
  166. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +33 -36
  167. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +19 -10
  168. package/node/internals/hooks/useMultiInputFieldSelectedSections.js +50 -0
  169. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +16 -11
  170. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -31
  171. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -25
  172. package/node/internals/hooks/useRangePosition.js +3 -8
  173. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
  174. package/node/internals/models/index.js +0 -11
  175. package/node/internals/utils/releaseInfo.js +1 -1
  176. package/node/internals/utils/valueManagers.js +10 -5
  177. package/node/models/index.js +11 -0
  178. package/package.json +6 -6
  179. package/themeAugmentation/props.d.ts +17 -17
  180. package/internals/models/fields.d.ts +0 -49
  181. package/legacy/AdapterDateFns/index.js +0 -1
  182. package/legacy/AdapterDateFnsJalali/index.js +0 -1
  183. package/legacy/AdapterDateFnsV3/index.js +0 -1
  184. package/legacy/AdapterDayjs/index.js +0 -1
  185. package/legacy/AdapterLuxon/index.js +0 -1
  186. package/legacy/AdapterMoment/index.js +0 -1
  187. package/legacy/AdapterMomentHijri/index.js +0 -1
  188. package/legacy/AdapterMomentJalaali/index.js +0 -1
  189. package/legacy/DateRangeCalendar/DateRangeCalendar.js +0 -764
  190. package/legacy/DateRangeCalendar/DateRangeCalendar.types.js +0 -1
  191. package/legacy/DateRangeCalendar/dateRangeCalendarClasses.js +0 -5
  192. package/legacy/DateRangeCalendar/index.js +0 -2
  193. package/legacy/DateRangeCalendar/useDragRange.js +0 -258
  194. package/legacy/DateRangePicker/DateRangePicker.js +0 -334
  195. package/legacy/DateRangePicker/DateRangePicker.types.js +0 -1
  196. package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -127
  197. package/legacy/DateRangePicker/dateRangePickerToolbarClasses.js +0 -5
  198. package/legacy/DateRangePicker/index.js +0 -3
  199. package/legacy/DateRangePicker/shared.js +0 -33
  200. package/legacy/DateRangePickerDay/DateRangePickerDay.js +0 -366
  201. package/legacy/DateRangePickerDay/dateRangePickerDayClasses.js +0 -5
  202. package/legacy/DateRangePickerDay/index.js +0 -2
  203. package/legacy/DateTimeRangePicker/DateTimeRangePicker.js +0 -413
  204. package/legacy/DateTimeRangePicker/DateTimeRangePicker.types.js +0 -1
  205. package/legacy/DateTimeRangePicker/DateTimeRangePickerTabs.js +0 -191
  206. package/legacy/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +0 -57
  207. package/legacy/DateTimeRangePicker/DateTimeRangePickerToolbar.js +0 -184
  208. package/legacy/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +0 -6
  209. package/legacy/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +0 -5
  210. package/legacy/DateTimeRangePicker/index.js +0 -5
  211. package/legacy/DateTimeRangePicker/shared.js +0 -54
  212. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -343
  213. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.types.js +0 -1
  214. package/legacy/DesktopDateRangePicker/index.js +0 -1
  215. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +0 -491
  216. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +0 -1
  217. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -48
  218. package/legacy/DesktopDateTimeRangePicker/index.js +0 -1
  219. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +0 -339
  220. package/legacy/MobileDateRangePicker/MobileDateRangePicker.types.js +0 -1
  221. package/legacy/MobileDateRangePicker/index.js +0 -1
  222. package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +0 -484
  223. package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +0 -1
  224. package/legacy/MobileDateTimeRangePicker/index.js +0 -1
  225. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +0 -316
  226. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
  227. package/legacy/MultiInputDateRangeField/index.js +0 -2
  228. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +0 -357
  229. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
  230. package/legacy/MultiInputDateTimeRangeField/index.js +0 -2
  231. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +0 -330
  232. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
  233. package/legacy/MultiInputTimeRangeField/index.js +0 -2
  234. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -307
  235. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.types.js +0 -1
  236. package/legacy/SingleInputDateRangeField/index.js +0 -2
  237. package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +0 -30
  238. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -348
  239. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.js +0 -1
  240. package/legacy/SingleInputDateTimeRangeField/index.js +0 -2
  241. package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +0 -35
  242. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -321
  243. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.types.js +0 -1
  244. package/legacy/SingleInputTimeRangeField/index.js +0 -2
  245. package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +0 -29
  246. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +0 -276
  247. package/legacy/StaticDateRangePicker/StaticDateRangePicker.types.js +0 -1
  248. package/legacy/StaticDateRangePicker/index.js +0 -1
  249. package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -87
  250. package/legacy/dateRangeViewRenderers/index.js +0 -1
  251. package/legacy/index.js +0 -33
  252. package/legacy/internals/constants/dimensions.js +0 -5
  253. package/legacy/internals/hooks/models/index.js +0 -1
  254. package/legacy/internals/hooks/models/useRangePicker.js +0 -1
  255. package/legacy/internals/hooks/useDesktopRangePicker/index.js +0 -1
  256. package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +0 -154
  257. package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.js +0 -1
  258. package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +0 -258
  259. package/legacy/internals/hooks/useMobileRangePicker/index.js +0 -1
  260. package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +0 -144
  261. package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.js +0 -1
  262. package/legacy/internals/hooks/useMultiInputRangeField/shared.js +0 -9
  263. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -102
  264. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -115
  265. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
  266. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -109
  267. package/legacy/internals/hooks/useRangePosition.js +0 -39
  268. package/legacy/internals/hooks/useStaticRangePicker/index.js +0 -1
  269. package/legacy/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +0 -76
  270. package/legacy/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.js +0 -1
  271. package/legacy/internals/models/dateRange.js +0 -1
  272. package/legacy/internals/models/dateTimeRange.js +0 -1
  273. package/legacy/internals/models/index.js +0 -5
  274. package/legacy/internals/models/rangePickerProps.js +0 -1
  275. package/legacy/internals/models/timeRange.js +0 -1
  276. package/legacy/internals/utils/date-fields-utils.js +0 -26
  277. package/legacy/internals/utils/date-range-manager.js +0 -65
  278. package/legacy/internals/utils/date-utils.js +0 -12
  279. package/legacy/internals/utils/releaseInfo.js +0 -13
  280. package/legacy/internals/utils/validation/validateDateRange.js +0 -45
  281. package/legacy/internals/utils/validation/validateDateTimeRange.js +0 -45
  282. package/legacy/internals/utils/validation/validateTimeRange.js +0 -32
  283. package/legacy/internals/utils/valueManagers.js +0 -135
  284. package/legacy/locales/index.js +0 -1
  285. package/legacy/models/index.js +0 -3
  286. package/legacy/models/multiInputRangeFieldClasses.js +0 -1
  287. package/legacy/models/range.js +0 -1
  288. package/legacy/models/validation.js +0 -1
  289. package/legacy/themeAugmentation/index.js +0 -4
  290. package/modern/internals/models/fields.js +0 -1
  291. /package/{internals/models → models}/fields.js +0 -0
  292. /package/{legacy/internals → modern}/models/fields.js +0 -0
  293. /package/node/{internals/models → models}/fields.js +0 -0
@@ -1,17 +1,17 @@
1
1
  import * as React from 'react';
2
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
2
3
  import { SlotComponentProps } from '@mui/base/utils';
3
4
  import Typography from '@mui/material/Typography';
4
5
  import Stack, { StackProps } from '@mui/material/Stack';
5
6
  import TextField from '@mui/material/TextField';
6
7
  import { UseDateRangeFieldProps } from '../internals/models/dateRange';
7
8
  import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
8
- import { MultiInputFieldRefs } from '../internals/models/fields';
9
- import { MultiInputRangeFieldClasses, RangePosition } from '../models';
10
- export type UseMultiInputDateRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateRangeFieldProps<TDate>, TTextFieldSlotProps>;
11
- export interface UseMultiInputDateRangeFieldProps<TDate> extends Omit<UseDateRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
9
+ import { MultiInputFieldRefs, MultiInputRangeFieldClasses, RangePosition } from '../models';
10
+ export type UseMultiInputDateRangeFieldParams<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, TTextFieldSlotProps>;
11
+ export interface UseMultiInputDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends Omit<UseDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
12
12
  }
13
- export type UseMultiInputDateRangeFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputDateRangeFieldProps<TDate>> & UseMultiInputDateRangeFieldProps<TDate>;
14
- export interface MultiInputDateRangeFieldProps<TDate> extends UseMultiInputDateRangeFieldComponentProps<TDate, Omit<StackProps, 'position'>> {
13
+ export type UseMultiInputDateRangeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseMultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
14
+ export interface MultiInputDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends UseMultiInputDateRangeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, Omit<StackProps, 'position'>> {
15
15
  autoFocus?: boolean;
16
16
  /**
17
17
  * Override or extend the styles applied to the component.
@@ -26,9 +26,8 @@ export interface MultiInputDateRangeFieldProps<TDate> extends UseMultiInputDateR
26
26
  * The props used for each component slot.
27
27
  * @default {}
28
28
  */
29
- slotProps?: MultiInputDateRangeFieldSlotProps<TDate>;
29
+ slotProps?: MultiInputDateRangeFieldSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
30
30
  }
31
- export type MultiInputDateRangeFieldOwnerState<TDate> = MultiInputDateRangeFieldProps<TDate>;
32
31
  export interface MultiInputDateRangeFieldSlots {
33
32
  /**
34
33
  * Element rendered at the root.
@@ -38,8 +37,7 @@ export interface MultiInputDateRangeFieldSlots {
38
37
  /**
39
38
  * Form control with an input to render a date.
40
39
  * It is rendered twice: once for the start date and once for the end date.
41
- * Receives the same props as `@mui/material/TextField`.
42
- * @default TextField from '@mui/material'
40
+ * @default TextField from '@mui/material' or PickersTextField if `enableAccessibleFieldDOMStructure` is `true`.
43
41
  */
44
42
  textField?: React.ElementType;
45
43
  /**
@@ -48,10 +46,10 @@ export interface MultiInputDateRangeFieldSlots {
48
46
  */
49
47
  separator?: React.ElementType;
50
48
  }
51
- export interface MultiInputDateRangeFieldSlotProps<TDate> {
52
- root?: SlotComponentProps<typeof Stack, {}, MultiInputDateRangeFieldOwnerState<TDate>>;
53
- textField?: SlotComponentProps<typeof TextField, {}, MultiInputDateRangeFieldOwnerState<TDate> & {
49
+ export interface MultiInputDateRangeFieldSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> {
50
+ root?: SlotComponentProps<typeof Stack, {}, MultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
51
+ textField?: SlotComponentProps<typeof TextField, {}, MultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & {
54
52
  position: RangePosition;
55
53
  }>;
56
- separator?: SlotComponentProps<typeof Typography, {}, MultiInputDateRangeFieldOwnerState<TDate>>;
54
+ separator?: SlotComponentProps<typeof Typography, {}, MultiInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
57
55
  }
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
2
3
  import { MultiInputDateTimeRangeFieldProps } from './MultiInputDateTimeRangeField.types';
3
4
  import { MultiInputRangeFieldClasses } from '../models';
4
5
  export declare const multiInputDateTimeRangeFieldClasses: MultiInputRangeFieldClasses;
5
6
  export declare const getMultiInputDateTimeRangeFieldUtilityClass: (slot: string) => string;
6
- type MultiInputDateTimeRangeFieldComponent = (<TDate>(props: MultiInputDateTimeRangeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
7
+ type MultiInputDateTimeRangeFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: MultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
7
8
  propTypes?: any;
8
9
  };
9
10
  /**
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["slots", "slotProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
3
+ const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -11,6 +11,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import { useSlotProps } from '@mui/base/utils';
12
12
  import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
13
13
  import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
14
+ import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
14
15
  import { useMultiInputDateTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField';
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -63,14 +64,12 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
63
64
  name: 'MuiMultiInputDateTimeRangeField'
64
65
  });
65
66
  const {
66
- internalProps: dateTimeFieldInternalProps,
67
+ internalProps,
67
68
  forwardedProps
68
69
  } = splitFieldInternalAndForwardedProps(themeProps, 'date-time');
69
70
  const {
70
71
  slots,
71
72
  slotProps,
72
- disabled,
73
- autoFocus,
74
73
  unstableStartFieldRef,
75
74
  unstableEndFieldRef,
76
75
  className
@@ -89,13 +88,10 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
89
88
  ownerState,
90
89
  className: clsx(className, classes.root)
91
90
  });
92
- const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
91
+ const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField;
93
92
  const startTextFieldProps = useSlotProps({
94
93
  elementType: TextField,
95
94
  externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
96
- additionalProps: {
97
- autoFocus
98
- },
99
95
  ownerState: _extends({}, ownerState, {
100
96
  position: 'start'
101
97
  })
@@ -115,9 +111,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
115
111
  className: classes.separator
116
112
  });
117
113
  const fieldResponse = useMultiInputDateTimeRangeField({
118
- sharedProps: _extends({}, dateTimeFieldInternalProps, {
119
- disabled
120
- }),
114
+ sharedProps: internalProps,
121
115
  startTextFieldProps,
122
116
  endTextFieldProps,
123
117
  unstableStartFieldRef,
@@ -143,6 +137,9 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
143
137
  * @default `utils.is12HourCycleInCurrentLocale()`
144
138
  */
145
139
  ampm: PropTypes.bool,
140
+ /**
141
+ * If `true`, the `input` element is focused during the first mount.
142
+ */
146
143
  autoFocus: PropTypes.bool,
147
144
  /**
148
145
  * Override or extend the styles applied to the component.
@@ -153,7 +150,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
153
150
  /**
154
151
  * The default value. Use when the component is not controlled.
155
152
  */
156
- defaultValue: PropTypes.arrayOf(PropTypes.any),
153
+ defaultValue: PropTypes.arrayOf(PropTypes.object),
157
154
  /**
158
155
  * Defines the `flex-direction` style property.
159
156
  * It is applied for all screen sizes.
@@ -184,6 +181,10 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
184
181
  * Add an element between each child.
185
182
  */
186
183
  divider: PropTypes.node,
184
+ /**
185
+ * @default false
186
+ */
187
+ enableAccessibleFieldDOMStructure: PropTypes.bool,
187
188
  /**
188
189
  * Format of the date when rendered in the input(s).
189
190
  */
@@ -197,29 +198,29 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
197
198
  /**
198
199
  * Maximal selectable date.
199
200
  */
200
- maxDate: PropTypes.any,
201
+ maxDate: PropTypes.object,
201
202
  /**
202
203
  * Maximal selectable moment of time with binding to date, to set max time in each day use `maxTime`.
203
204
  */
204
- maxDateTime: PropTypes.any,
205
+ maxDateTime: PropTypes.object,
205
206
  /**
206
207
  * Maximal selectable time.
207
208
  * The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
208
209
  */
209
- maxTime: PropTypes.any,
210
+ maxTime: PropTypes.object,
210
211
  /**
211
212
  * Minimal selectable date.
212
213
  */
213
- minDate: PropTypes.any,
214
+ minDate: PropTypes.object,
214
215
  /**
215
216
  * Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
216
217
  */
217
- minDateTime: PropTypes.any,
218
+ minDateTime: PropTypes.object,
218
219
  /**
219
220
  * Minimal selectable time.
220
221
  * The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
221
222
  */
222
- minTime: PropTypes.any,
223
+ minTime: PropTypes.object,
223
224
  /**
224
225
  * Step over minutes.
225
226
  * @default 1
@@ -257,20 +258,17 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
257
258
  * For example, on time fields it will be used to determine the date to set.
258
259
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
259
260
  */
260
- referenceDate: PropTypes.any,
261
+ referenceDate: PropTypes.object,
261
262
  /**
262
263
  * The currently selected sections.
263
- * This prop accept four formats:
264
+ * This prop accepts four formats:
264
265
  * 1. If a number is provided, the section at this index will be selected.
265
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
266
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
267
- * 4. If `null` is provided, no section will be selected
266
+ * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
267
+ * 3. If `"all"` is provided, all the sections will be selected.
268
+ * 4. If `null` is provided, no section will be selected.
268
269
  * If not provided, the selected sections will be handled internally.
269
270
  */
270
- selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
271
- endIndex: PropTypes.number.isRequired,
272
- startIndex: PropTypes.number.isRequired
273
- })]),
271
+ selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
274
272
  /**
275
273
  * Disable specific date.
276
274
  *
@@ -349,6 +347,6 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
349
347
  * The selected value.
350
348
  * Used when the component is controlled.
351
349
  */
352
- value: PropTypes.arrayOf(PropTypes.any)
350
+ value: PropTypes.arrayOf(PropTypes.object)
353
351
  } : void 0;
354
352
  export { MultiInputDateTimeRangeField };
@@ -3,15 +3,15 @@ import { SlotComponentProps } from '@mui/base/utils';
3
3
  import Typography from '@mui/material/Typography';
4
4
  import Stack, { StackProps } from '@mui/material/Stack';
5
5
  import TextField from '@mui/material/TextField';
6
- import { UseDateTimeRangeFieldDefaultizedProps, UseDateTimeRangeFieldProps } from '../internals/models/dateTimeRange';
7
- import { MultiInputFieldRefs } from '../internals/models/fields';
6
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
7
+ import { UseDateTimeRangeFieldProps } from '../internals/models/dateTimeRange';
8
8
  import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
9
- import { MultiInputRangeFieldClasses, RangePosition } from '../models';
10
- export type UseMultiInputDateTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
11
- export interface UseMultiInputDateTimeRangeFieldProps<TDate> extends Omit<UseDateTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
9
+ import { MultiInputFieldRefs, MultiInputRangeFieldClasses, RangePosition } from '../models';
10
+ export type UseMultiInputDateTimeRangeFieldParams<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, TTextFieldSlotProps>;
11
+ export interface UseMultiInputDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends Omit<UseDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
12
12
  }
13
- export type UseMultiInputDateTimeRangeFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputDateTimeRangeFieldProps<TDate>> & UseMultiInputDateTimeRangeFieldProps<TDate>;
14
- export interface MultiInputDateTimeRangeFieldProps<TDate> extends UseMultiInputDateTimeRangeFieldComponentProps<TDate, Omit<StackProps, 'position'>> {
13
+ export type UseMultiInputDateTimeRangeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseMultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
14
+ export interface MultiInputDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends UseMultiInputDateTimeRangeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, Omit<StackProps, 'position'>> {
15
15
  autoFocus?: boolean;
16
16
  /**
17
17
  * Override or extend the styles applied to the component.
@@ -26,9 +26,8 @@ export interface MultiInputDateTimeRangeFieldProps<TDate> extends UseMultiInputD
26
26
  * The props used for each component slot.
27
27
  * @default {}
28
28
  */
29
- slotProps?: MultiInputDateTimeRangeFieldSlotProps<TDate>;
29
+ slotProps?: MultiInputDateTimeRangeFieldSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
30
30
  }
31
- export type MultiInputDateTimeRangeFieldOwnerState<TDate> = MultiInputDateTimeRangeFieldProps<TDate>;
32
31
  export interface MultiInputDateTimeRangeFieldSlots {
33
32
  /**
34
33
  * Element rendered at the root.
@@ -38,8 +37,7 @@ export interface MultiInputDateTimeRangeFieldSlots {
38
37
  /**
39
38
  * Form control with an input to render a date and time.
40
39
  * It is rendered twice: once for the start date time and once for the end date time.
41
- * Receives the same props as `@mui/material/TextField`.
42
- * @default TextField from '@mui/material'
40
+ * @default TextField from '@mui/material' or PickersTextField if `enableAccessibleFieldDOMStructure` is `true`.
43
41
  */
44
42
  textField?: React.ElementType;
45
43
  /**
@@ -48,11 +46,10 @@ export interface MultiInputDateTimeRangeFieldSlots {
48
46
  */
49
47
  separator?: React.ElementType;
50
48
  }
51
- export interface MultiInputDateTimeRangeFieldSlotProps<TDate> {
52
- root?: SlotComponentProps<typeof Stack, {}, MultiInputDateTimeRangeFieldOwnerState<TDate>>;
53
- textField?: SlotComponentProps<typeof TextField, {}, MultiInputDateTimeRangeFieldOwnerState<TDate> & {
49
+ export interface MultiInputDateTimeRangeFieldSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> {
50
+ root?: SlotComponentProps<typeof Stack, {}, MultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
51
+ textField?: SlotComponentProps<typeof TextField, {}, MultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & {
54
52
  position: RangePosition;
55
53
  }>;
56
- separator?: SlotComponentProps<typeof Typography, {}, MultiInputDateTimeRangeFieldOwnerState<TDate>>;
54
+ separator?: SlotComponentProps<typeof Typography, {}, MultiInputDateTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
57
55
  }
58
- export type UseMultiInputDateTimeRangeFieldDefaultizedProps<TDate, AdditionalProps extends {}> = UseDateTimeRangeFieldDefaultizedProps<TDate> & Omit<AdditionalProps, 'value' | 'defaultValue' | 'onChange'>;
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
2
3
  import { MultiInputTimeRangeFieldProps } from './MultiInputTimeRangeField.types';
3
4
  import { MultiInputRangeFieldClasses } from '../models';
4
5
  export declare const multiInputTimeRangeFieldClasses: MultiInputRangeFieldClasses;
5
6
  export declare const getMultiInputTimeRangeFieldUtilityClass: (slot: string) => string;
6
- type MultiInputTimeRangeFieldComponent = (<TDate>(props: MultiInputTimeRangeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
7
+ type MultiInputTimeRangeFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: MultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
7
8
  propTypes?: any;
8
9
  };
9
10
  /**
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["slots", "slotProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
3
+ const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { clsx } from 'clsx';
@@ -11,6 +11,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import { useSlotProps } from '@mui/base/utils';
12
12
  import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
13
13
  import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
14
+ import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
14
15
  import { useMultiInputTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField';
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -63,14 +64,12 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
63
64
  name: 'MuiMultiInputTimeRangeField'
64
65
  });
65
66
  const {
66
- internalProps: timeFieldInternalProps,
67
+ internalProps,
67
68
  forwardedProps
68
69
  } = splitFieldInternalAndForwardedProps(themeProps, 'time');
69
70
  const {
70
71
  slots,
71
72
  slotProps,
72
- disabled,
73
- autoFocus,
74
73
  unstableStartFieldRef,
75
74
  unstableEndFieldRef,
76
75
  className
@@ -89,13 +88,10 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
89
88
  ownerState,
90
89
  className: clsx(className, classes.root)
91
90
  });
92
- const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
91
+ const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField;
93
92
  const startTextFieldProps = useSlotProps({
94
93
  elementType: TextField,
95
94
  externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
96
- additionalProps: {
97
- autoFocus
98
- },
99
95
  ownerState: _extends({}, ownerState, {
100
96
  position: 'start'
101
97
  })
@@ -115,9 +111,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
115
111
  className: classes.separator
116
112
  });
117
113
  const fieldResponse = useMultiInputTimeRangeField({
118
- sharedProps: _extends({}, timeFieldInternalProps, {
119
- disabled
120
- }),
114
+ sharedProps: internalProps,
121
115
  startTextFieldProps,
122
116
  endTextFieldProps,
123
117
  unstableStartFieldRef,
@@ -143,6 +137,9 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
143
137
  * @default `utils.is12HourCycleInCurrentLocale()`
144
138
  */
145
139
  ampm: PropTypes.bool,
140
+ /**
141
+ * If `true`, the `input` element is focused during the first mount.
142
+ */
146
143
  autoFocus: PropTypes.bool,
147
144
  /**
148
145
  * Override or extend the styles applied to the component.
@@ -153,7 +150,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
153
150
  /**
154
151
  * The default value. Use when the component is not controlled.
155
152
  */
156
- defaultValue: PropTypes.arrayOf(PropTypes.any),
153
+ defaultValue: PropTypes.arrayOf(PropTypes.object),
157
154
  /**
158
155
  * Defines the `flex-direction` style property.
159
156
  * It is applied for all screen sizes.
@@ -184,6 +181,10 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
184
181
  * Add an element between each child.
185
182
  */
186
183
  divider: PropTypes.node,
184
+ /**
185
+ * @default false
186
+ */
187
+ enableAccessibleFieldDOMStructure: PropTypes.bool,
187
188
  /**
188
189
  * Format of the date when rendered in the input(s).
189
190
  */
@@ -198,12 +199,12 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
198
199
  * Maximal selectable time.
199
200
  * The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
200
201
  */
201
- maxTime: PropTypes.any,
202
+ maxTime: PropTypes.object,
202
203
  /**
203
204
  * Minimal selectable time.
204
205
  * The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
205
206
  */
206
- minTime: PropTypes.any,
207
+ minTime: PropTypes.object,
207
208
  /**
208
209
  * Step over minutes.
209
210
  * @default 1
@@ -241,20 +242,17 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
241
242
  * For example, on time fields it will be used to determine the date to set.
242
243
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
243
244
  */
244
- referenceDate: PropTypes.any,
245
+ referenceDate: PropTypes.object,
245
246
  /**
246
247
  * The currently selected sections.
247
- * This prop accept four formats:
248
+ * This prop accepts four formats:
248
249
  * 1. If a number is provided, the section at this index will be selected.
249
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
250
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
251
- * 4. If `null` is provided, no section will be selected
250
+ * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
251
+ * 3. If `"all"` is provided, all the sections will be selected.
252
+ * 4. If `null` is provided, no section will be selected.
252
253
  * If not provided, the selected sections will be handled internally.
253
254
  */
254
- selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
255
- endIndex: PropTypes.number.isRequired,
256
- startIndex: PropTypes.number.isRequired
257
- })]),
255
+ selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
258
256
  /**
259
257
  * Disable specific time.
260
258
  * @template TDate
@@ -322,6 +320,6 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
322
320
  * The selected value.
323
321
  * Used when the component is controlled.
324
322
  */
325
- value: PropTypes.arrayOf(PropTypes.any)
323
+ value: PropTypes.arrayOf(PropTypes.object)
326
324
  } : void 0;
327
325
  export { MultiInputTimeRangeField };
@@ -3,15 +3,15 @@ import { SlotComponentProps } from '@mui/base/utils';
3
3
  import Typography from '@mui/material/Typography';
4
4
  import Stack, { StackProps } from '@mui/material/Stack';
5
5
  import TextField from '@mui/material/TextField';
6
- import { UseTimeRangeFieldDefaultizedProps, UseTimeRangeFieldProps } from '../internals/models/timeRange';
6
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
7
+ import { UseTimeRangeFieldProps } from '../internals/models/timeRange';
7
8
  import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
8
- import { MultiInputFieldRefs } from '../internals/models/fields';
9
- import { MultiInputRangeFieldClasses, RangePosition } from '../models';
10
- export type UseMultiInputTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
11
- export interface UseMultiInputTimeRangeFieldProps<TDate> extends Omit<UseTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
9
+ import { MultiInputFieldRefs, MultiInputRangeFieldClasses, RangePosition } from '../models';
10
+ export type UseMultiInputTimeRangeFieldParams<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, TTextFieldSlotProps>;
11
+ export interface UseMultiInputTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends Omit<UseTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'unstableFieldRef' | 'clearable' | 'onClear'>, MultiInputFieldRefs {
12
12
  }
13
- export type UseMultiInputTimeRangeFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputTimeRangeFieldProps<TDate>> & UseMultiInputTimeRangeFieldProps<TDate>;
14
- export interface MultiInputTimeRangeFieldProps<TDate> extends UseMultiInputTimeRangeFieldComponentProps<TDate, Omit<StackProps, 'position'>> {
13
+ export type UseMultiInputTimeRangeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseMultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseMultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
14
+ export interface MultiInputTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends UseMultiInputTimeRangeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, Omit<StackProps, 'position'>> {
15
15
  autoFocus?: boolean;
16
16
  /**
17
17
  * Override or extend the styles applied to the component.
@@ -26,9 +26,8 @@ export interface MultiInputTimeRangeFieldProps<TDate> extends UseMultiInputTimeR
26
26
  * The props used for each component slot.
27
27
  * @default {}
28
28
  */
29
- slotProps?: MultiInputTimeRangeFieldSlotProps<TDate>;
29
+ slotProps?: MultiInputTimeRangeFieldSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
30
30
  }
31
- export type MultiInputTimeRangeFieldOwnerState<TDate> = MultiInputTimeRangeFieldProps<TDate>;
32
31
  export interface MultiInputTimeRangeFieldSlots {
33
32
  /**
34
33
  * Element rendered at the root.
@@ -38,8 +37,7 @@ export interface MultiInputTimeRangeFieldSlots {
38
37
  /**
39
38
  * Form control with an input to render a time.
40
39
  * It is rendered twice: once for the start time and once for the end time.
41
- * Receives the same props as `@mui/material/TextField`.
42
- * @default TextField from '@mui/material'
40
+ * @default TextField from '@mui/material' or PickersTextField if `enableAccessibleFieldDOMStructure` is `true`.
43
41
  */
44
42
  textField?: React.ElementType;
45
43
  /**
@@ -48,11 +46,10 @@ export interface MultiInputTimeRangeFieldSlots {
48
46
  */
49
47
  separator?: React.ElementType;
50
48
  }
51
- export interface MultiInputTimeRangeFieldSlotProps<TDate> {
52
- root?: SlotComponentProps<typeof Stack, {}, MultiInputTimeRangeFieldOwnerState<TDate>>;
53
- textField?: SlotComponentProps<typeof TextField, {}, MultiInputTimeRangeFieldOwnerState<TDate> & {
49
+ export interface MultiInputTimeRangeFieldSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> {
50
+ root?: SlotComponentProps<typeof Stack, {}, MultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
51
+ textField?: SlotComponentProps<typeof TextField, {}, MultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & {
54
52
  position: RangePosition;
55
53
  }>;
56
- separator?: SlotComponentProps<typeof Typography, {}, MultiInputTimeRangeFieldOwnerState<TDate>>;
54
+ separator?: SlotComponentProps<typeof Typography, {}, MultiInputTimeRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>;
57
55
  }
58
- export type UseMultiInputTimeRangeFieldDefaultizedProps<TDate, AdditionalProps extends {}> = UseTimeRangeFieldDefaultizedProps<TDate> & Omit<AdditionalProps, 'value' | 'defaultValue' | 'onChange'>;
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
+ import { PickerValidDate } from '@mui/x-date-pickers/models';
2
3
  import { SingleInputDateRangeFieldProps } from './SingleInputDateRangeField.types';
3
- import { FieldType } from '../internals/models';
4
- type DateRangeFieldComponent = (<TDate>(props: SingleInputDateRangeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
+ import { FieldType } from '../models';
5
+ type DateRangeFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: SingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
6
  propTypes?: any;
6
7
  fieldType?: FieldType;
7
8
  };
@@ -6,9 +6,10 @@ import PropTypes from 'prop-types';
6
6
  import MuiTextField from '@mui/material/TextField';
7
7
  import { useThemeProps } from '@mui/material/styles';
8
8
  import { useSlotProps } from '@mui/base/utils';
9
+ import { refType } from '@mui/utils';
9
10
  import { useClearableField } from '@mui/x-date-pickers/hooks';
10
11
  import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
11
- import { refType } from '@mui/utils';
12
+ import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
12
13
  import { useSingleInputDateRangeField } from './useSingleInputDateRangeField';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  /**
@@ -35,7 +36,7 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
35
36
  } = themeProps,
36
37
  other = _objectWithoutPropertiesLoose(themeProps, _excluded);
37
38
  const ownerState = themeProps;
38
- const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
39
+ const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField;
39
40
  const textFieldProps = useSlotProps({
40
41
  elementType: TextField,
41
42
  externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
@@ -85,7 +86,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
85
86
  /**
86
87
  * The default value. Use when the component is not controlled.
87
88
  */
88
- defaultValue: PropTypes.arrayOf(PropTypes.any),
89
+ defaultValue: PropTypes.arrayOf(PropTypes.object),
89
90
  /**
90
91
  * If `true`, the component is disabled.
91
92
  * @default false
@@ -101,6 +102,10 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
101
102
  * @default false
102
103
  */
103
104
  disablePast: PropTypes.bool,
105
+ /**
106
+ * @default false
107
+ */
108
+ enableAccessibleFieldDOMStructure: PropTypes.bool,
104
109
  /**
105
110
  * If `true`, the component is displayed in focused state.
106
111
  */
@@ -172,11 +177,11 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
172
177
  /**
173
178
  * Maximal selectable date.
174
179
  */
175
- maxDate: PropTypes.any,
180
+ maxDate: PropTypes.object,
176
181
  /**
177
182
  * Minimal selectable date.
178
183
  */
179
- minDate: PropTypes.any,
184
+ minDate: PropTypes.object,
180
185
  /**
181
186
  * Name attribute of the `input` element.
182
187
  */
@@ -219,7 +224,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
219
224
  * For example, on time fields it will be used to determine the date to set.
220
225
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
221
226
  */
222
- referenceDate: PropTypes.any,
227
+ referenceDate: PropTypes.object,
223
228
  /**
224
229
  * If `true`, the label is displayed as required and the `input` element is required.
225
230
  * @default false
@@ -227,17 +232,14 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
227
232
  required: PropTypes.bool,
228
233
  /**
229
234
  * The currently selected sections.
230
- * This prop accept four formats:
235
+ * This prop accepts four formats:
231
236
  * 1. If a number is provided, the section at this index will be selected.
232
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
233
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
234
- * 4. If `null` is provided, no section will be selected
237
+ * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
238
+ * 3. If `"all"` is provided, all the sections will be selected.
239
+ * 4. If `null` is provided, no section will be selected.
235
240
  * If not provided, the selected sections will be handled internally.
236
241
  */
237
- selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
238
- endIndex: PropTypes.number.isRequired,
239
- startIndex: PropTypes.number.isRequired
240
- })]),
242
+ selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
241
243
  /**
242
244
  * Disable specific date.
243
245
  *
@@ -299,7 +301,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
299
301
  * The selected value.
300
302
  * Used when the component is controlled.
301
303
  */
302
- value: PropTypes.arrayOf(PropTypes.any),
304
+ value: PropTypes.arrayOf(PropTypes.object),
303
305
  /**
304
306
  * The variant to use.
305
307
  * @default 'outlined'