@mui/x-date-pickers 9.0.0-alpha.4 → 9.0.0

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 (300) hide show
  1. package/AdapterDateFnsBase/AdapterDateFnsBase.mjs +1 -1
  2. package/AdapterDayjs/AdapterDayjs.mjs +1 -1
  3. package/AdapterLuxon/AdapterLuxon.mjs +1 -1
  4. package/AdapterMoment/AdapterMoment.mjs +1 -1
  5. package/AdapterMomentHijri/AdapterMomentHijri.mjs +1 -1
  6. package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +1 -1
  7. package/CHANGELOG.md +374 -2
  8. package/DateCalendar/DateCalendar.js +1 -1
  9. package/DateCalendar/DateCalendar.mjs +1 -1
  10. package/DateCalendar/DayCalendar.d.mts +7 -7
  11. package/DateCalendar/DayCalendar.d.ts +7 -7
  12. package/DateCalendar/DayCalendar.js +23 -25
  13. package/DateCalendar/DayCalendar.mjs +23 -25
  14. package/DateField/DateField.d.mts +1 -1
  15. package/DateField/DateField.d.ts +1 -1
  16. package/DateField/DateField.js +22 -28
  17. package/DateField/DateField.mjs +22 -28
  18. package/DateField/DateField.types.d.mts +3 -3
  19. package/DateField/DateField.types.d.ts +3 -3
  20. package/DateField/useDateField.d.mts +1 -1
  21. package/DateField/useDateField.d.ts +1 -1
  22. package/DateField/useDateField.js +1 -1
  23. package/DateField/useDateField.mjs +1 -1
  24. package/DatePicker/DatePicker.d.mts +1 -1
  25. package/DatePicker/DatePicker.d.ts +1 -1
  26. package/DatePicker/DatePicker.js +1 -5
  27. package/DatePicker/DatePicker.mjs +1 -5
  28. package/DatePicker/DatePicker.types.d.mts +3 -3
  29. package/DatePicker/DatePicker.types.d.ts +3 -3
  30. package/DateTimeField/DateTimeField.d.mts +1 -1
  31. package/DateTimeField/DateTimeField.d.ts +1 -1
  32. package/DateTimeField/DateTimeField.js +22 -28
  33. package/DateTimeField/DateTimeField.mjs +22 -28
  34. package/DateTimeField/DateTimeField.types.d.mts +2 -2
  35. package/DateTimeField/DateTimeField.types.d.ts +2 -2
  36. package/DateTimeField/useDateTimeField.d.mts +1 -1
  37. package/DateTimeField/useDateTimeField.d.ts +1 -1
  38. package/DateTimeField/useDateTimeField.js +1 -1
  39. package/DateTimeField/useDateTimeField.mjs +1 -1
  40. package/DateTimePicker/DateTimePicker.d.mts +1 -1
  41. package/DateTimePicker/DateTimePicker.d.ts +1 -1
  42. package/DateTimePicker/DateTimePicker.js +1 -5
  43. package/DateTimePicker/DateTimePicker.mjs +1 -5
  44. package/DateTimePicker/DateTimePicker.types.d.mts +3 -3
  45. package/DateTimePicker/DateTimePicker.types.d.ts +3 -3
  46. package/DesktopDatePicker/DesktopDatePicker.d.mts +1 -1
  47. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
  48. package/DesktopDatePicker/DesktopDatePicker.js +1 -5
  49. package/DesktopDatePicker/DesktopDatePicker.mjs +1 -5
  50. package/DesktopDatePicker/DesktopDatePicker.types.d.mts +3 -3
  51. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +3 -3
  52. package/DesktopDateTimePicker/DesktopDateTimePicker.d.mts +1 -1
  53. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
  54. package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -5
  55. package/DesktopDateTimePicker/DesktopDateTimePicker.mjs +1 -5
  56. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.mts +3 -3
  57. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +3 -3
  58. package/DesktopTimePicker/DesktopTimePicker.d.mts +1 -1
  59. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
  60. package/DesktopTimePicker/DesktopTimePicker.js +0 -4
  61. package/DesktopTimePicker/DesktopTimePicker.mjs +0 -4
  62. package/DesktopTimePicker/DesktopTimePicker.types.d.mts +3 -3
  63. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +3 -3
  64. package/DigitalClock/DigitalClock.d.mts +1 -1
  65. package/DigitalClock/DigitalClock.d.ts +1 -1
  66. package/DigitalClock/DigitalClock.js +2 -2
  67. package/DigitalClock/DigitalClock.mjs +3 -3
  68. package/LocalizationProvider/LocalizationProvider.d.mts +0 -6
  69. package/LocalizationProvider/LocalizationProvider.d.ts +0 -6
  70. package/LocalizationProvider/LocalizationProvider.js +1 -10
  71. package/LocalizationProvider/LocalizationProvider.mjs +0 -9
  72. package/LocalizationProvider/index.d.mts +1 -1
  73. package/LocalizationProvider/index.d.ts +1 -1
  74. package/LocalizationProvider/index.js +0 -6
  75. package/LocalizationProvider/index.mjs +1 -1
  76. package/MobileDatePicker/MobileDatePicker.d.mts +1 -1
  77. package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
  78. package/MobileDatePicker/MobileDatePicker.js +1 -5
  79. package/MobileDatePicker/MobileDatePicker.mjs +1 -5
  80. package/MobileDatePicker/MobileDatePicker.types.d.mts +3 -3
  81. package/MobileDatePicker/MobileDatePicker.types.d.ts +3 -3
  82. package/MobileDateTimePicker/MobileDateTimePicker.d.mts +1 -1
  83. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
  84. package/MobileDateTimePicker/MobileDateTimePicker.js +1 -5
  85. package/MobileDateTimePicker/MobileDateTimePicker.mjs +1 -5
  86. package/MobileDateTimePicker/MobileDateTimePicker.types.d.mts +3 -3
  87. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +3 -3
  88. package/MobileTimePicker/MobileTimePicker.d.mts +1 -1
  89. package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
  90. package/MobileTimePicker/MobileTimePicker.js +0 -4
  91. package/MobileTimePicker/MobileTimePicker.mjs +0 -4
  92. package/MobileTimePicker/MobileTimePicker.types.d.mts +3 -3
  93. package/MobileTimePicker/MobileTimePicker.types.d.ts +3 -3
  94. package/MonthCalendar/MonthCalendarButton.js +2 -2
  95. package/MonthCalendar/MonthCalendarButton.mjs +3 -3
  96. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
  97. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.mjs +3 -3
  98. package/PickerDay/PickerDay.d.mts +14 -0
  99. package/PickerDay/PickerDay.d.ts +14 -0
  100. package/{PickerDay2/PickerDay2.js → PickerDay/PickerDay.js} +110 -45
  101. package/{PickerDay2/PickerDay2.mjs → PickerDay/PickerDay.mjs} +110 -45
  102. package/PickerDay/PickerDay.types.d.mts +137 -0
  103. package/PickerDay/PickerDay.types.d.ts +137 -0
  104. package/PickerDay/index.d.mts +4 -0
  105. package/PickerDay/index.d.ts +4 -0
  106. package/PickerDay/index.js +25 -0
  107. package/PickerDay/index.mjs +2 -0
  108. package/{PickerDay2/pickerDay2Classes.d.mts → PickerDay/pickerDayClasses.d.mts} +4 -4
  109. package/{PickerDay2/pickerDay2Classes.d.ts → PickerDay/pickerDayClasses.d.ts} +4 -4
  110. package/PickerDay/pickerDayClasses.js +14 -0
  111. package/PickerDay/pickerDayClasses.mjs +6 -0
  112. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +37 -16
  113. package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +37 -16
  114. package/PickersTextField/PickersInput/PickersInput.js +35 -14
  115. package/PickersTextField/PickersInput/PickersInput.mjs +35 -14
  116. package/PickersTextField/PickersInputBase/PickersInputBase.js +38 -8
  117. package/PickersTextField/PickersInputBase/PickersInputBase.mjs +38 -8
  118. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +56 -13
  119. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +56 -13
  120. package/PickersTextField/PickersOutlinedInput/Outline.js +1 -1
  121. package/PickersTextField/PickersOutlinedInput/Outline.mjs +1 -1
  122. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +33 -11
  123. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +33 -11
  124. package/PickersTextField/PickersTextField.js +92 -39
  125. package/PickersTextField/PickersTextField.mjs +92 -39
  126. package/PickersTextField/PickersTextField.types.d.mts +56 -28
  127. package/PickersTextField/PickersTextField.types.d.ts +56 -28
  128. package/PickersTextField/index.d.mts +1 -1
  129. package/PickersTextField/index.d.ts +1 -1
  130. package/StaticDatePicker/StaticDatePicker.js +1 -1
  131. package/StaticDatePicker/StaticDatePicker.mjs +1 -1
  132. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  133. package/StaticDateTimePicker/StaticDateTimePicker.mjs +1 -1
  134. package/TimeField/TimeField.d.mts +1 -1
  135. package/TimeField/TimeField.d.ts +1 -1
  136. package/TimeField/TimeField.js +23 -29
  137. package/TimeField/TimeField.mjs +23 -29
  138. package/TimeField/TimeField.types.d.mts +2 -2
  139. package/TimeField/TimeField.types.d.ts +2 -2
  140. package/TimeField/useTimeField.d.mts +1 -1
  141. package/TimeField/useTimeField.d.ts +1 -1
  142. package/TimePicker/TimePicker.d.mts +1 -1
  143. package/TimePicker/TimePicker.d.ts +1 -1
  144. package/TimePicker/TimePicker.js +0 -4
  145. package/TimePicker/TimePicker.mjs +0 -4
  146. package/TimePicker/TimePicker.types.d.mts +3 -3
  147. package/TimePicker/TimePicker.types.d.ts +3 -3
  148. package/YearCalendar/YearCalendarButton.js +2 -2
  149. package/YearCalendar/YearCalendarButton.mjs +3 -3
  150. package/hooks/useParsedFormat.js +5 -7
  151. package/hooks/useParsedFormat.mjs +5 -7
  152. package/hooks/useSplitFieldProps.d.mts +1 -1
  153. package/hooks/useSplitFieldProps.d.ts +1 -1
  154. package/hooks/useSplitFieldProps.js +1 -1
  155. package/hooks/useSplitFieldProps.mjs +1 -1
  156. package/index.d.mts +1 -2
  157. package/index.d.ts +1 -2
  158. package/index.js +2 -14
  159. package/index.mjs +2 -3
  160. package/internals/components/PickerFieldUI.d.mts +11 -17
  161. package/internals/components/PickerFieldUI.d.ts +11 -17
  162. package/internals/components/PickerFieldUI.js +65 -114
  163. package/internals/components/PickerFieldUI.mjs +65 -114
  164. package/internals/components/PickerPopper/PickerPopper.js +3 -0
  165. package/internals/components/PickerPopper/PickerPopper.mjs +3 -0
  166. package/internals/components/PickersToolbar.js +3 -1
  167. package/internals/components/PickersToolbar.mjs +3 -1
  168. package/internals/demo/DemoContainer.js +6 -8
  169. package/internals/demo/DemoContainer.mjs +6 -8
  170. package/internals/hooks/PickerDay.types.d.mts +12 -0
  171. package/internals/hooks/PickerDay.types.d.ts +12 -0
  172. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +2 -2
  173. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
  174. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.mts +6 -6
  175. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +6 -6
  176. package/internals/hooks/useField/buildSectionsFromFormat.d.mts +0 -1
  177. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +0 -1
  178. package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  179. package/internals/hooks/useField/buildSectionsFromFormat.mjs +1 -1
  180. package/internals/hooks/useField/index.d.mts +1 -1
  181. package/internals/hooks/useField/index.d.ts +1 -1
  182. package/internals/hooks/useField/index.js +2 -8
  183. package/internals/hooks/useField/index.mjs +1 -1
  184. package/internals/hooks/useField/useField.d.mts +2 -2
  185. package/internals/hooks/useField/useField.d.ts +2 -2
  186. package/internals/hooks/useField/useField.js +265 -8
  187. package/internals/hooks/useField/useField.mjs +264 -8
  188. package/internals/hooks/useField/useField.types.d.mts +11 -50
  189. package/internals/hooks/useField/useField.types.d.ts +11 -50
  190. package/internals/hooks/useField/useField.utils.d.mts +2 -3
  191. package/internals/hooks/useField/useField.utils.d.ts +2 -3
  192. package/internals/hooks/useField/useField.utils.js +8 -65
  193. package/internals/hooks/useField/useField.utils.mjs +6 -62
  194. package/internals/hooks/useField/useFieldHiddenInputProps.d.mts +2 -4
  195. package/internals/hooks/useField/useFieldHiddenInputProps.d.ts +2 -4
  196. package/internals/hooks/useField/useFieldHiddenInputProps.js +1 -3
  197. package/internals/hooks/useField/useFieldHiddenInputProps.mjs +1 -3
  198. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +0 -1
  199. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.mjs +0 -1
  200. package/internals/hooks/useField/useFieldRootProps.d.mts +5 -5
  201. package/internals/hooks/useField/useFieldRootProps.d.ts +5 -5
  202. package/internals/hooks/useField/useFieldRootProps.js +183 -11
  203. package/internals/hooks/useField/useFieldRootProps.mjs +183 -11
  204. package/internals/hooks/useField/useFieldSectionContainerProps.d.mts +3 -5
  205. package/internals/hooks/useField/useFieldSectionContainerProps.d.ts +3 -5
  206. package/internals/hooks/useField/useFieldSectionContainerProps.js +2 -4
  207. package/internals/hooks/useField/useFieldSectionContainerProps.mjs +2 -4
  208. package/internals/hooks/useField/useFieldSectionContentProps.d.mts +6 -7
  209. package/internals/hooks/useField/useFieldSectionContentProps.d.ts +6 -7
  210. package/internals/hooks/useField/useFieldSectionContentProps.js +2 -4
  211. package/internals/hooks/useField/useFieldSectionContentProps.mjs +2 -4
  212. package/internals/hooks/useField/useFieldState.d.mts +4 -4
  213. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  214. package/internals/hooks/useField/useFieldState.js +3 -6
  215. package/internals/hooks/useField/useFieldState.mjs +3 -6
  216. package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +2 -2
  217. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
  218. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.mts +6 -6
  219. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +6 -6
  220. package/internals/hooks/useNullableFieldPrivateContext.d.mts +1 -1
  221. package/internals/hooks/useNullableFieldPrivateContext.d.ts +1 -1
  222. package/internals/hooks/usePicker/usePicker.js +1 -3
  223. package/internals/hooks/usePicker/usePicker.mjs +1 -3
  224. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.mts +2 -3
  225. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.ts +2 -3
  226. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.js +3 -5
  227. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.mjs +3 -5
  228. package/internals/index.d.mts +4 -4
  229. package/internals/index.d.ts +4 -4
  230. package/internals/index.js +9 -9
  231. package/internals/index.mjs +3 -3
  232. package/internals/models/manager.d.mts +3 -5
  233. package/internals/models/manager.d.ts +3 -5
  234. package/internals/utils/valueManagers.js +1 -2
  235. package/internals/utils/valueManagers.mjs +2 -3
  236. package/managers/index.d.mts +2 -2
  237. package/managers/index.d.ts +2 -2
  238. package/managers/useDateManager.d.mts +3 -6
  239. package/managers/useDateManager.d.ts +3 -6
  240. package/managers/useDateManager.js +2 -6
  241. package/managers/useDateManager.mjs +2 -6
  242. package/managers/useDateTimeManager.d.mts +3 -6
  243. package/managers/useDateTimeManager.d.ts +3 -6
  244. package/managers/useDateTimeManager.js +2 -6
  245. package/managers/useDateTimeManager.mjs +2 -6
  246. package/managers/useTimeManager.d.mts +4 -6
  247. package/managers/useTimeManager.d.ts +4 -6
  248. package/managers/useTimeManager.js +1 -3
  249. package/managers/useTimeManager.mjs +1 -3
  250. package/models/fields.d.mts +3 -4
  251. package/models/fields.d.ts +3 -4
  252. package/models/manager.d.mts +2 -8
  253. package/models/manager.d.ts +2 -8
  254. package/package.json +55 -69
  255. package/themeAugmentation/components.d.mts +4 -8
  256. package/themeAugmentation/components.d.ts +4 -8
  257. package/themeAugmentation/overrides.d.mts +2 -4
  258. package/themeAugmentation/overrides.d.ts +2 -4
  259. package/themeAugmentation/props.d.mts +5 -7
  260. package/themeAugmentation/props.d.ts +5 -7
  261. package/PickerDay2/PickerDay2.d.mts +0 -7
  262. package/PickerDay2/PickerDay2.d.ts +0 -7
  263. package/PickerDay2/PickerDay2.types.d.mts +0 -18
  264. package/PickerDay2/PickerDay2.types.d.ts +0 -18
  265. package/PickerDay2/index.d.mts +0 -4
  266. package/PickerDay2/index.d.ts +0 -4
  267. package/PickerDay2/index.js +0 -25
  268. package/PickerDay2/index.mjs +0 -2
  269. package/PickerDay2/pickerDay2Classes.js +0 -14
  270. package/PickerDay2/pickerDay2Classes.mjs +0 -6
  271. package/PickersDay/PickersDay.d.mts +0 -15
  272. package/PickersDay/PickersDay.d.ts +0 -15
  273. package/PickersDay/PickersDay.js +0 -384
  274. package/PickersDay/PickersDay.mjs +0 -377
  275. package/PickersDay/PickersDay.types.d.mts +0 -114
  276. package/PickersDay/PickersDay.types.d.ts +0 -114
  277. package/PickersDay/index.d.mts +0 -4
  278. package/PickersDay/index.d.ts +0 -4
  279. package/PickersDay/index.js +0 -25
  280. package/PickersDay/index.mjs +0 -2
  281. package/PickersDay/pickersDayClasses.d.mts +0 -19
  282. package/PickersDay/pickersDayClasses.d.ts +0 -19
  283. package/PickersDay/pickersDayClasses.js +0 -14
  284. package/PickersDay/pickersDayClasses.mjs +0 -6
  285. package/internals/hooks/useField/useFieldRootHandleKeyDown.d.mts +0 -16
  286. package/internals/hooks/useField/useFieldRootHandleKeyDown.d.ts +0 -16
  287. package/internals/hooks/useField/useFieldRootHandleKeyDown.js +0 -211
  288. package/internals/hooks/useField/useFieldRootHandleKeyDown.mjs +0 -205
  289. package/internals/hooks/useField/useFieldV6TextField.d.mts +0 -26
  290. package/internals/hooks/useField/useFieldV6TextField.d.ts +0 -26
  291. package/internals/hooks/useField/useFieldV6TextField.js +0 -422
  292. package/internals/hooks/useField/useFieldV6TextField.mjs +0 -413
  293. package/internals/hooks/useField/useFieldV7TextField.d.mts +0 -3
  294. package/internals/hooks/useField/useFieldV7TextField.d.ts +0 -3
  295. package/internals/hooks/useField/useFieldV7TextField.js +0 -272
  296. package/internals/hooks/useField/useFieldV7TextField.mjs +0 -264
  297. /package/{PickerDay2/PickerDay2.types.js → PickerDay/PickerDay.types.js} +0 -0
  298. /package/{PickerDay2/PickerDay2.types.mjs → PickerDay/PickerDay.types.mjs} +0 -0
  299. /package/{PickersDay/PickersDay.types.js → internals/hooks/PickerDay.types.js} +0 -0
  300. /package/{PickersDay/PickersDay.types.mjs → internals/hooks/PickerDay.types.mjs} +0 -0
@@ -3,12 +3,12 @@ import { FieldSectionType, FieldSection, FieldSelectedSections, MuiPickersAdapte
3
3
  import { InternalPropNames } from "../../../hooks/useSplitFieldProps.mjs";
4
4
  import type { PickersSectionElement, PickersSectionListRef } from "../../../PickersSectionList/index.mjs";
5
5
  import { FormProps, InferNonNullablePickerValue, PickerRangeValue, PickerValidValue } from "../../models/index.mjs";
6
- export interface UseFieldParameters<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> {
7
- manager: PickerManager<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, any>;
6
+ export interface UseFieldParameters<TValue extends PickerValidValue, TError, TValidationProps extends {}, TProps extends UseFieldProps> {
7
+ manager: PickerManager<TValue, TError, TValidationProps, any>;
8
8
  props: TProps;
9
9
  skipContextFieldRefAssignment?: boolean;
10
10
  }
11
- export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends TimezoneProps, FormProps, OnErrorProps<TValue, TError> {
11
+ export interface UseFieldInternalProps<TValue extends PickerValidValue, TError> extends TimezoneProps, FormProps, OnErrorProps<TValue, TError> {
12
12
  /**
13
13
  * The selected value.
14
14
  * Used when the component is controlled.
@@ -76,10 +76,6 @@ export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableA
76
76
  * The ref object used to imperatively interact with the field.
77
77
  */
78
78
  fieldRef?: React.Ref<FieldRef<TValue>>;
79
- /**
80
- * @default true
81
- */
82
- enableAccessibleFieldDOMStructure?: TEnableAccessibleFieldDOMStructure;
83
79
  /**
84
80
  * If `true`, the `input` element is focused during the first mount.
85
81
  * @default false
@@ -90,18 +86,7 @@ export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableA
90
86
  */
91
87
  focused?: boolean;
92
88
  }
93
- export type UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure extends boolean> = TEnableAccessibleFieldDOMStructure extends false ? {
94
- clearable?: boolean;
95
- error?: boolean;
96
- placeholder?: string;
97
- inputRef?: React.Ref<HTMLInputElement>;
98
- onClick?: React.MouseEventHandler;
99
- onFocus?: React.FocusEventHandler;
100
- onKeyDown?: React.KeyboardEventHandler;
101
- onBlur?: React.FocusEventHandler;
102
- onPaste?: React.ClipboardEventHandler<HTMLDivElement>;
103
- onClear?: React.MouseEventHandler;
104
- } : {
89
+ export interface UseFieldForwardedProps {
105
90
  clearable?: boolean;
106
91
  error?: boolean;
107
92
  focused?: boolean;
@@ -113,25 +98,12 @@ export type UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure extends bo
113
98
  onInput?: React.FormEventHandler<HTMLDivElement>;
114
99
  onPaste?: React.ClipboardEventHandler<HTMLDivElement>;
115
100
  onClear?: React.MouseEventHandler;
116
- };
117
- type UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure extends boolean> = TEnableAccessibleFieldDOMStructure extends false ? {
118
- /**
119
- * The aria label to set on the button that opens the Picker.
120
- */
121
- openPickerAriaLabel: string;
122
- enableAccessibleFieldDOMStructure: false;
123
- focused: boolean | undefined;
124
- inputMode: 'text' | 'numeric';
125
- placeholder: string;
126
- value: string;
127
- onChange: React.ChangeEventHandler<HTMLInputElement>;
128
- autoComplete: 'off';
129
- } : {
101
+ }
102
+ interface UseFieldAdditionalProps {
130
103
  /**
131
104
  * The aria label to set on the button that opens the Picker.
132
105
  */
133
106
  openPickerAriaLabel: string;
134
- enableAccessibleFieldDOMStructure: true;
135
107
  elements: PickersSectionElement[];
136
108
  tabIndex: number | undefined;
137
109
  contentEditable: boolean;
@@ -139,8 +111,8 @@ type UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure extends boolean>
139
111
  onChange: React.ChangeEventHandler<HTMLInputElement>;
140
112
  areAllSectionsEmpty: boolean;
141
113
  focused: boolean;
142
- };
143
- export type UseFieldReturnValue<TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> = Required<Pick<UseFieldInternalProps<any, any, any>, 'disabled' | 'readOnly' | 'autoFocus'>> & Required<UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>> & UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure> & Omit<TProps, InternalPropNames<PickerValueType>>;
114
+ }
115
+ export type UseFieldReturnValue<TProps extends {}> = Required<Pick<UseFieldInternalProps<any, any>, 'disabled' | 'readOnly' | 'autoFocus'>> & Required<UseFieldForwardedProps> & UseFieldAdditionalProps & Omit<TProps, InternalPropNames<PickerValueType>>;
144
116
  export type FieldSectionValueBoundaries<SectionType extends FieldSectionType> = {
145
117
  minimum: number;
146
118
  maximum: number;
@@ -172,21 +144,12 @@ export interface FieldValueManager<TValue extends PickerValidValue> {
172
144
  */
173
145
  getSectionsFromValue: (value: TValue, getSectionsFromDate: (date: PickerValidDate | null) => FieldSection[]) => InferFieldSection<TValue>[];
174
146
  /**
175
- * Creates the string value to render in the input based on the current section list.
147
+ * Creates the string value to render in the hidden input based on the current section list.
176
148
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
177
149
  * @param {InferFieldSection<TValue>[]} sections The current section list.
178
- * @param {string} localizedDigits The conversion table from localized to 0-9 digits.
179
- * @param {boolean} isRtl `true` if the current orientation is "right to left"
180
150
  * @returns {string} The string value to render in the input.
181
151
  */
182
- getV6InputValueFromSections: (sections: InferFieldSection<TValue>[], localizedDigits: string[], isRtl: boolean) => string;
183
- /**
184
- * Creates the string value to render in the input based on the current section list.
185
- * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
186
- * @param {InferFieldSection<TValue>[]} sections The current section list.
187
- * @returns {string} The string value to render in the input.
188
- */
189
- getV7HiddenInputValueFromSections: (sections: InferFieldSection<TValue>[]) => string;
152
+ getHiddenInputValueFromSections: (sections: InferFieldSection<TValue>[]) => string;
190
153
  /**
191
154
  * Parses a string version (most of the time coming from the input).
192
155
  * This method should only be used when the change does not come from a single section.
@@ -316,9 +279,7 @@ export interface CharacterEditingQuery {
316
279
  sectionIndex: number;
317
280
  sectionType: FieldSectionType;
318
281
  }
319
- export type UseFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure> & {
320
- enableAccessibleFieldDOMStructure?: boolean;
321
- };
282
+ export type UseFieldProps = UseFieldForwardedProps;
322
283
  export interface UseFieldDOMGetters {
323
284
  isReady: () => boolean;
324
285
  getRoot: () => HTMLElement;
@@ -3,12 +3,12 @@ import { FieldSectionType, FieldSection, FieldSelectedSections, MuiPickersAdapte
3
3
  import { InternalPropNames } from "../../../hooks/useSplitFieldProps.js";
4
4
  import type { PickersSectionElement, PickersSectionListRef } from "../../../PickersSectionList/index.js";
5
5
  import { FormProps, InferNonNullablePickerValue, PickerRangeValue, PickerValidValue } from "../../models/index.js";
6
- export interface UseFieldParameters<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> {
7
- manager: PickerManager<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, any>;
6
+ export interface UseFieldParameters<TValue extends PickerValidValue, TError, TValidationProps extends {}, TProps extends UseFieldProps> {
7
+ manager: PickerManager<TValue, TError, TValidationProps, any>;
8
8
  props: TProps;
9
9
  skipContextFieldRefAssignment?: boolean;
10
10
  }
11
- export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends TimezoneProps, FormProps, OnErrorProps<TValue, TError> {
11
+ export interface UseFieldInternalProps<TValue extends PickerValidValue, TError> extends TimezoneProps, FormProps, OnErrorProps<TValue, TError> {
12
12
  /**
13
13
  * The selected value.
14
14
  * Used when the component is controlled.
@@ -76,10 +76,6 @@ export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableA
76
76
  * The ref object used to imperatively interact with the field.
77
77
  */
78
78
  fieldRef?: React.Ref<FieldRef<TValue>>;
79
- /**
80
- * @default true
81
- */
82
- enableAccessibleFieldDOMStructure?: TEnableAccessibleFieldDOMStructure;
83
79
  /**
84
80
  * If `true`, the `input` element is focused during the first mount.
85
81
  * @default false
@@ -90,18 +86,7 @@ export interface UseFieldInternalProps<TValue extends PickerValidValue, TEnableA
90
86
  */
91
87
  focused?: boolean;
92
88
  }
93
- export type UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure extends boolean> = TEnableAccessibleFieldDOMStructure extends false ? {
94
- clearable?: boolean;
95
- error?: boolean;
96
- placeholder?: string;
97
- inputRef?: React.Ref<HTMLInputElement>;
98
- onClick?: React.MouseEventHandler;
99
- onFocus?: React.FocusEventHandler;
100
- onKeyDown?: React.KeyboardEventHandler;
101
- onBlur?: React.FocusEventHandler;
102
- onPaste?: React.ClipboardEventHandler<HTMLDivElement>;
103
- onClear?: React.MouseEventHandler;
104
- } : {
89
+ export interface UseFieldForwardedProps {
105
90
  clearable?: boolean;
106
91
  error?: boolean;
107
92
  focused?: boolean;
@@ -113,25 +98,12 @@ export type UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure extends bo
113
98
  onInput?: React.FormEventHandler<HTMLDivElement>;
114
99
  onPaste?: React.ClipboardEventHandler<HTMLDivElement>;
115
100
  onClear?: React.MouseEventHandler;
116
- };
117
- type UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure extends boolean> = TEnableAccessibleFieldDOMStructure extends false ? {
118
- /**
119
- * The aria label to set on the button that opens the Picker.
120
- */
121
- openPickerAriaLabel: string;
122
- enableAccessibleFieldDOMStructure: false;
123
- focused: boolean | undefined;
124
- inputMode: 'text' | 'numeric';
125
- placeholder: string;
126
- value: string;
127
- onChange: React.ChangeEventHandler<HTMLInputElement>;
128
- autoComplete: 'off';
129
- } : {
101
+ }
102
+ interface UseFieldAdditionalProps {
130
103
  /**
131
104
  * The aria label to set on the button that opens the Picker.
132
105
  */
133
106
  openPickerAriaLabel: string;
134
- enableAccessibleFieldDOMStructure: true;
135
107
  elements: PickersSectionElement[];
136
108
  tabIndex: number | undefined;
137
109
  contentEditable: boolean;
@@ -139,8 +111,8 @@ type UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure extends boolean>
139
111
  onChange: React.ChangeEventHandler<HTMLInputElement>;
140
112
  areAllSectionsEmpty: boolean;
141
113
  focused: boolean;
142
- };
143
- export type UseFieldReturnValue<TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> = Required<Pick<UseFieldInternalProps<any, any, any>, 'disabled' | 'readOnly' | 'autoFocus'>> & Required<UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>> & UseFieldAdditionalProps<TEnableAccessibleFieldDOMStructure> & Omit<TProps, InternalPropNames<PickerValueType>>;
114
+ }
115
+ export type UseFieldReturnValue<TProps extends {}> = Required<Pick<UseFieldInternalProps<any, any>, 'disabled' | 'readOnly' | 'autoFocus'>> & Required<UseFieldForwardedProps> & UseFieldAdditionalProps & Omit<TProps, InternalPropNames<PickerValueType>>;
144
116
  export type FieldSectionValueBoundaries<SectionType extends FieldSectionType> = {
145
117
  minimum: number;
146
118
  maximum: number;
@@ -172,21 +144,12 @@ export interface FieldValueManager<TValue extends PickerValidValue> {
172
144
  */
173
145
  getSectionsFromValue: (value: TValue, getSectionsFromDate: (date: PickerValidDate | null) => FieldSection[]) => InferFieldSection<TValue>[];
174
146
  /**
175
- * Creates the string value to render in the input based on the current section list.
147
+ * Creates the string value to render in the hidden input based on the current section list.
176
148
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
177
149
  * @param {InferFieldSection<TValue>[]} sections The current section list.
178
- * @param {string} localizedDigits The conversion table from localized to 0-9 digits.
179
- * @param {boolean} isRtl `true` if the current orientation is "right to left"
180
150
  * @returns {string} The string value to render in the input.
181
151
  */
182
- getV6InputValueFromSections: (sections: InferFieldSection<TValue>[], localizedDigits: string[], isRtl: boolean) => string;
183
- /**
184
- * Creates the string value to render in the input based on the current section list.
185
- * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
186
- * @param {InferFieldSection<TValue>[]} sections The current section list.
187
- * @returns {string} The string value to render in the input.
188
- */
189
- getV7HiddenInputValueFromSections: (sections: InferFieldSection<TValue>[]) => string;
152
+ getHiddenInputValueFromSections: (sections: InferFieldSection<TValue>[]) => string;
190
153
  /**
191
154
  * Parses a string version (most of the time coming from the input).
192
155
  * This method should only be used when the change does not come from a single section.
@@ -316,9 +279,7 @@ export interface CharacterEditingQuery {
316
279
  sectionIndex: number;
317
280
  sectionType: FieldSectionType;
318
281
  }
319
- export type UseFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure> & {
320
- enableAccessibleFieldDOMStructure?: boolean;
321
- };
282
+ export type UseFieldProps = UseFieldForwardedProps;
322
283
  export interface UseFieldDOMGetters {
323
284
  isReady: () => boolean;
324
285
  getRoot: () => HTMLElement;
@@ -26,11 +26,10 @@ export declare const doesSectionFormatHaveLeadingZeros: (adapter: MuiPickersAdap
26
26
  * To make sure that the parsing works, we are building a format and a date without any separator.
27
27
  */
28
28
  export declare const getDateFromDateSections: (adapter: MuiPickersAdapter, sections: FieldSection[], localizedDigits: string[]) => PickerValidDate;
29
- export declare const createDateStrForV7HiddenInputFromSections: (sections: FieldSection[]) => string;
30
- export declare const createDateStrForV6InputFromSections: (sections: FieldSection[], localizedDigits: string[], isRtl: boolean) => string;
29
+ export declare const createDateStrForHiddenInputFromSections: (sections: FieldSection[]) => string;
31
30
  export declare const getSectionsBoundaries: (adapter: MuiPickersAdapter, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries;
32
31
  export declare const validateSections: <TValue extends PickerValidValue>(sections: InferFieldSection<TValue>[], valueType: PickerValueType) => void;
33
32
  export declare const mergeDateIntoReferenceDate: (adapter: MuiPickersAdapter, dateToTransferFrom: PickerValidDate, sections: FieldSection[], referenceDate: PickerValidDate, shouldLimitToEditedSections: boolean) => PickerValidDate;
34
33
  export declare const isAndroid: () => boolean;
35
- export declare const getSectionOrder: (sections: FieldSection[], shouldApplyRTL: boolean) => SectionOrdering;
34
+ export declare const getSectionOrder: (sections: FieldSection[]) => SectionOrdering;
36
35
  export declare const parseSelectedSections: (selectedSections: FieldSelectedSections, sections: FieldSection[]) => FieldParsedSelectedSections;
@@ -26,11 +26,10 @@ export declare const doesSectionFormatHaveLeadingZeros: (adapter: MuiPickersAdap
26
26
  * To make sure that the parsing works, we are building a format and a date without any separator.
27
27
  */
28
28
  export declare const getDateFromDateSections: (adapter: MuiPickersAdapter, sections: FieldSection[], localizedDigits: string[]) => PickerValidDate;
29
- export declare const createDateStrForV7HiddenInputFromSections: (sections: FieldSection[]) => string;
30
- export declare const createDateStrForV6InputFromSections: (sections: FieldSection[], localizedDigits: string[], isRtl: boolean) => string;
29
+ export declare const createDateStrForHiddenInputFromSections: (sections: FieldSection[]) => string;
31
30
  export declare const getSectionsBoundaries: (adapter: MuiPickersAdapter, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries;
32
31
  export declare const validateSections: <TValue extends PickerValidValue>(sections: InferFieldSection<TValue>[], valueType: PickerValueType) => void;
33
32
  export declare const mergeDateIntoReferenceDate: (adapter: MuiPickersAdapter, dateToTransferFrom: PickerValidDate, sections: FieldSection[], referenceDate: PickerValidDate, shouldLimitToEditedSections: boolean) => PickerValidDate;
34
33
  export declare const isAndroid: () => boolean;
35
- export declare const getSectionOrder: (sections: FieldSection[], shouldApplyRTL: boolean) => SectionOrdering;
34
+ export declare const getSectionOrder: (sections: FieldSection[]) => SectionOrdering;
36
35
  export declare const parseSelectedSections: (selectedSections: FieldSelectedSections, sections: FieldSection[]) => FieldParsedSelectedSections;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForV7HiddenInputFromSections = exports.createDateStrForV6InputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = exports.FORMAT_SECONDS_NO_LEADING_ZEROS = void 0;
7
+ exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForHiddenInputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = exports.FORMAT_SECONDS_NO_LEADING_ZEROS = void 0;
8
8
  var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
9
9
  var _dateUtils = require("../../utils/date-utils");
10
10
  const getDateSectionConfigFromFormatToken = (adapter, formatToken) => {
@@ -242,28 +242,10 @@ const getDateFromDateSections = (adapter, sections, localizedDigits) => {
242
242
  return adapter.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
243
243
  };
244
244
  exports.getDateFromDateSections = getDateFromDateSections;
245
- const createDateStrForV7HiddenInputFromSections = sections => sections.map(section => {
245
+ const createDateStrForHiddenInputFromSections = sections => sections.map(section => {
246
246
  return `${section.startSeparator}${section.value || section.placeholder}${section.endSeparator}`;
247
247
  }).join('');
248
- exports.createDateStrForV7HiddenInputFromSections = createDateStrForV7HiddenInputFromSections;
249
- const createDateStrForV6InputFromSections = (sections, localizedDigits, isRtl) => {
250
- const formattedSections = sections.map(section => {
251
- const dateValue = getSectionVisibleValue(section, isRtl ? 'input-rtl' : 'input-ltr', localizedDigits);
252
- return `${section.startSeparator}${dateValue}${section.endSeparator}`;
253
- });
254
- const dateStr = formattedSections.join('');
255
- if (!isRtl) {
256
- return dateStr;
257
- }
258
-
259
- // \u2066: start left-to-right isolation
260
- // \u2067: start right-to-left isolation
261
- // \u2068: start first strong character isolation
262
- // \u2069: pop isolation
263
- // wrap into an isolated group such that separators can split the string in smaller ones by adding \u2069\u2068
264
- return `\u2066${dateStr}\u2069`;
265
- };
266
- exports.createDateStrForV6InputFromSections = createDateStrForV6InputFromSections;
248
+ exports.createDateStrForHiddenInputFromSections = createDateStrForHiddenInputFromSections;
267
249
  const getSectionsBoundaries = (adapter, localizedDigits, timezone) => {
268
250
  const today = adapter.date(undefined, timezone);
269
251
  const endOfYear = adapter.endOfYear(today);
@@ -453,51 +435,12 @@ const mergeDateIntoReferenceDate = (adapter, dateToTransferFrom, sections, refer
453
435
  }, referenceDate);
454
436
  exports.mergeDateIntoReferenceDate = mergeDateIntoReferenceDate;
455
437
  const isAndroid = () => navigator.userAgent.toLowerCase().includes('android');
456
-
457
- // TODO v9: Remove
458
438
  exports.isAndroid = isAndroid;
459
- const getSectionOrder = (sections, shouldApplyRTL) => {
439
+ const getSectionOrder = sections => {
460
440
  const neighbors = {};
461
- if (!shouldApplyRTL) {
462
- sections.forEach((_, index) => {
463
- const leftIndex = index === 0 ? null : index - 1;
464
- const rightIndex = index === sections.length - 1 ? null : index + 1;
465
- neighbors[index] = {
466
- leftIndex,
467
- rightIndex
468
- };
469
- });
470
- return {
471
- neighbors,
472
- startIndex: 0,
473
- endIndex: sections.length - 1
474
- };
475
- }
476
- const rtl2ltr = {};
477
- const ltr2rtl = {};
478
- let groupedSectionsStart = 0;
479
- let groupedSectionsEnd = 0;
480
- let RTLIndex = sections.length - 1;
481
- while (RTLIndex >= 0) {
482
- groupedSectionsEnd = sections.findIndex(
483
- // eslint-disable-next-line @typescript-eslint/no-loop-func
484
- (section, index) => index >= groupedSectionsStart && section.endSeparator?.includes(' ') &&
485
- // Special case where the spaces were not there in the initial input
486
- section.endSeparator !== ' / ');
487
- if (groupedSectionsEnd === -1) {
488
- groupedSectionsEnd = sections.length - 1;
489
- }
490
- for (let i = groupedSectionsEnd; i >= groupedSectionsStart; i -= 1) {
491
- ltr2rtl[i] = RTLIndex;
492
- rtl2ltr[RTLIndex] = i;
493
- RTLIndex -= 1;
494
- }
495
- groupedSectionsStart = groupedSectionsEnd + 1;
496
- }
497
441
  sections.forEach((_, index) => {
498
- const rtlIndex = ltr2rtl[index];
499
- const leftIndex = rtlIndex === 0 ? null : rtl2ltr[rtlIndex - 1];
500
- const rightIndex = rtlIndex === sections.length - 1 ? null : rtl2ltr[rtlIndex + 1];
442
+ const leftIndex = index === 0 ? null : index - 1;
443
+ const rightIndex = index === sections.length - 1 ? null : index + 1;
501
444
  neighbors[index] = {
502
445
  leftIndex,
503
446
  rightIndex
@@ -505,8 +448,8 @@ const getSectionOrder = (sections, shouldApplyRTL) => {
505
448
  });
506
449
  return {
507
450
  neighbors,
508
- startIndex: rtl2ltr[0],
509
- endIndex: rtl2ltr[sections.length - 1]
451
+ startIndex: 0,
452
+ endIndex: sections.length - 1
510
453
  };
511
454
  };
512
455
  exports.getSectionOrder = getSectionOrder;
@@ -222,26 +222,9 @@ export const getDateFromDateSections = (adapter, sections, localizedDigits) => {
222
222
  const dateWithoutSeparatorStr = sectionValues.join(' ');
223
223
  return adapter.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
224
224
  };
225
- export const createDateStrForV7HiddenInputFromSections = sections => sections.map(section => {
225
+ export const createDateStrForHiddenInputFromSections = sections => sections.map(section => {
226
226
  return `${section.startSeparator}${section.value || section.placeholder}${section.endSeparator}`;
227
227
  }).join('');
228
- export const createDateStrForV6InputFromSections = (sections, localizedDigits, isRtl) => {
229
- const formattedSections = sections.map(section => {
230
- const dateValue = getSectionVisibleValue(section, isRtl ? 'input-rtl' : 'input-ltr', localizedDigits);
231
- return `${section.startSeparator}${dateValue}${section.endSeparator}`;
232
- });
233
- const dateStr = formattedSections.join('');
234
- if (!isRtl) {
235
- return dateStr;
236
- }
237
-
238
- // \u2066: start left-to-right isolation
239
- // \u2067: start right-to-left isolation
240
- // \u2068: start first strong character isolation
241
- // \u2069: pop isolation
242
- // wrap into an isolated group such that separators can split the string in smaller ones by adding \u2069\u2068
243
- return `\u2066${dateStr}\u2069`;
244
- };
245
228
  export const getSectionsBoundaries = (adapter, localizedDigits, timezone) => {
246
229
  const today = adapter.date(undefined, timezone);
247
230
  const endOfYear = adapter.endOfYear(today);
@@ -428,50 +411,11 @@ export const mergeDateIntoReferenceDate = (adapter, dateToTransferFrom, sections
428
411
  return mergedDate;
429
412
  }, referenceDate);
430
413
  export const isAndroid = () => navigator.userAgent.toLowerCase().includes('android');
431
-
432
- // TODO v9: Remove
433
- export const getSectionOrder = (sections, shouldApplyRTL) => {
414
+ export const getSectionOrder = sections => {
434
415
  const neighbors = {};
435
- if (!shouldApplyRTL) {
436
- sections.forEach((_, index) => {
437
- const leftIndex = index === 0 ? null : index - 1;
438
- const rightIndex = index === sections.length - 1 ? null : index + 1;
439
- neighbors[index] = {
440
- leftIndex,
441
- rightIndex
442
- };
443
- });
444
- return {
445
- neighbors,
446
- startIndex: 0,
447
- endIndex: sections.length - 1
448
- };
449
- }
450
- const rtl2ltr = {};
451
- const ltr2rtl = {};
452
- let groupedSectionsStart = 0;
453
- let groupedSectionsEnd = 0;
454
- let RTLIndex = sections.length - 1;
455
- while (RTLIndex >= 0) {
456
- groupedSectionsEnd = sections.findIndex(
457
- // eslint-disable-next-line @typescript-eslint/no-loop-func
458
- (section, index) => index >= groupedSectionsStart && section.endSeparator?.includes(' ') &&
459
- // Special case where the spaces were not there in the initial input
460
- section.endSeparator !== ' / ');
461
- if (groupedSectionsEnd === -1) {
462
- groupedSectionsEnd = sections.length - 1;
463
- }
464
- for (let i = groupedSectionsEnd; i >= groupedSectionsStart; i -= 1) {
465
- ltr2rtl[i] = RTLIndex;
466
- rtl2ltr[RTLIndex] = i;
467
- RTLIndex -= 1;
468
- }
469
- groupedSectionsStart = groupedSectionsEnd + 1;
470
- }
471
416
  sections.forEach((_, index) => {
472
- const rtlIndex = ltr2rtl[index];
473
- const leftIndex = rtlIndex === 0 ? null : rtl2ltr[rtlIndex - 1];
474
- const rightIndex = rtlIndex === sections.length - 1 ? null : rtl2ltr[rtlIndex + 1];
417
+ const leftIndex = index === 0 ? null : index - 1;
418
+ const rightIndex = index === sections.length - 1 ? null : index + 1;
475
419
  neighbors[index] = {
476
420
  leftIndex,
477
421
  rightIndex
@@ -479,8 +423,8 @@ export const getSectionOrder = (sections, shouldApplyRTL) => {
479
423
  });
480
424
  return {
481
425
  neighbors,
482
- startIndex: rtl2ltr[0],
483
- endIndex: rtl2ltr[sections.length - 1]
426
+ startIndex: 0,
427
+ endIndex: sections.length - 1
484
428
  };
485
429
  };
486
430
  export const parseSelectedSections = (selectedSections, sections) => {
@@ -1,16 +1,14 @@
1
1
  import * as React from 'react';
2
- import { PickerManager } from "../../../models/index.mjs";
2
+ import { PickerAnyManager } from "../../models/manager.mjs";
3
3
  import { UseFieldStateReturnValue } from "./useFieldState.mjs";
4
4
  /**
5
5
  * Generate the props to pass to the hidden input element of the field.
6
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
7
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
8
6
  * @param {UseFieldHiddenInputPropsParameters} parameters The parameters of the hook.
9
7
  * @returns {UseFieldHiddenInputPropsReturnValue} The props to forward to the hidden input element of the field.
10
8
  */
11
9
  export declare function useFieldHiddenInputProps(parameters: UseFieldHiddenInputPropsParameters): UseFieldHiddenInputPropsReturnValue;
12
10
  interface UseFieldHiddenInputPropsParameters {
13
- manager: PickerManager<any, any, any, any, any>;
11
+ manager: PickerAnyManager;
14
12
  stateResponse: UseFieldStateReturnValue<any>;
15
13
  }
16
14
  interface UseFieldHiddenInputPropsReturnValue {
@@ -1,16 +1,14 @@
1
1
  import * as React from 'react';
2
- import { PickerManager } from "../../../models/index.js";
2
+ import { PickerAnyManager } from "../../models/manager.js";
3
3
  import { UseFieldStateReturnValue } from "./useFieldState.js";
4
4
  /**
5
5
  * Generate the props to pass to the hidden input element of the field.
6
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
7
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
8
6
  * @param {UseFieldHiddenInputPropsParameters} parameters The parameters of the hook.
9
7
  * @returns {UseFieldHiddenInputPropsReturnValue} The props to forward to the hidden input element of the field.
10
8
  */
11
9
  export declare function useFieldHiddenInputProps(parameters: UseFieldHiddenInputPropsParameters): UseFieldHiddenInputPropsReturnValue;
12
10
  interface UseFieldHiddenInputPropsParameters {
13
- manager: PickerManager<any, any, any, any, any>;
11
+ manager: PickerAnyManager;
14
12
  stateResponse: UseFieldStateReturnValue<any>;
15
13
  }
16
14
  interface UseFieldHiddenInputPropsReturnValue {
@@ -10,8 +10,6 @@ var React = _interopRequireWildcard(require("react"));
10
10
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
11
11
  /**
12
12
  * Generate the props to pass to the hidden input element of the field.
13
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
14
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
15
13
  * @param {UseFieldHiddenInputPropsParameters} parameters The parameters of the hook.
16
14
  * @returns {UseFieldHiddenInputPropsReturnValue} The props to forward to the hidden input element of the field.
17
15
  */
@@ -31,7 +29,7 @@ function useFieldHiddenInputProps(parameters) {
31
29
  const handleChange = (0, _useEventCallback.default)(event => {
32
30
  updateValueFromValueStr(event.target.value);
33
31
  });
34
- const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getV7HiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);
32
+ const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getHiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);
35
33
  return {
36
34
  value: valueStr,
37
35
  onChange: handleChange
@@ -2,8 +2,6 @@ import * as React from 'react';
2
2
  import useEventCallback from '@mui/utils/useEventCallback';
3
3
  /**
4
4
  * Generate the props to pass to the hidden input element of the field.
5
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
6
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
7
5
  * @param {UseFieldHiddenInputPropsParameters} parameters The parameters of the hook.
8
6
  * @returns {UseFieldHiddenInputPropsReturnValue} The props to forward to the hidden input element of the field.
9
7
  */
@@ -23,7 +21,7 @@ export function useFieldHiddenInputProps(parameters) {
23
21
  const handleChange = useEventCallback(event => {
24
22
  updateValueFromValueStr(event.target.value);
25
23
  });
26
- const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getV7HiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);
24
+ const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getHiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);
27
25
  return {
28
26
  value: valueStr,
29
27
  onChange: handleChange
@@ -48,7 +48,6 @@ function useFieldInternalPropsWithDefaults(parameters) {
48
48
  focused: pickerContext.open ? true : undefined,
49
49
  format: pickerContext.fieldFormat,
50
50
  formatDensity: fieldPrivateContext.formatDensity,
51
- enableAccessibleFieldDOMStructure: fieldPrivateContext.enableAccessibleFieldDOMStructure,
52
51
  selectedSections: fieldPrivateContext.selectedSections,
53
52
  onSelectedSectionsChange: fieldPrivateContext.onSelectedSectionsChange,
54
53
  fieldRef: handleFieldRef
@@ -41,7 +41,6 @@ export function useFieldInternalPropsWithDefaults(parameters) {
41
41
  focused: pickerContext.open ? true : undefined,
42
42
  format: pickerContext.fieldFormat,
43
43
  formatDensity: fieldPrivateContext.formatDensity,
44
- enableAccessibleFieldDOMStructure: fieldPrivateContext.enableAccessibleFieldDOMStructure,
45
44
  selectedSections: fieldPrivateContext.selectedSections,
46
45
  onSelectedSectionsChange: fieldPrivateContext.onSelectedSectionsChange,
47
46
  fieldRef: handleFieldRef
@@ -1,20 +1,20 @@
1
- import { PickerManager } from "../../../models/index.mjs";
2
1
  import { UseFieldDOMGetters, UseFieldInternalProps } from "./useField.types.mjs";
3
2
  import { UseFieldStateReturnValue } from "./useFieldState.mjs";
4
3
  import { UseFieldCharacterEditingReturnValue } from "./useFieldCharacterEditing.mjs";
4
+ import { PickerAnyManager } from "../../models/index.mjs";
5
5
  /**
6
6
  * Generate the props to pass to the root element of the field.
7
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
8
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
9
7
  * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
10
8
  * @returns {UseFieldRootPropsReturnValue} The props to forward to the root element of the field.
11
9
  */
12
10
  export declare function useFieldRootProps(parameters: UseFieldRootPropsParameters): UseFieldRootPropsReturnValue;
13
11
  interface UseFieldRootPropsParameters {
14
- manager: PickerManager<any, any, any, any, any>;
12
+ manager: PickerAnyManager;
15
13
  stateResponse: UseFieldStateReturnValue<any>;
16
14
  applyCharacterEditing: UseFieldCharacterEditingReturnValue;
17
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
15
+ internalPropsWithDefaults: UseFieldInternalProps<any, any> & {
16
+ minutesStep?: number;
17
+ };
18
18
  domGetters: UseFieldDOMGetters;
19
19
  focused: boolean;
20
20
  setFocused: (focused: boolean) => void;
@@ -1,20 +1,20 @@
1
- import { PickerManager } from "../../../models/index.js";
2
1
  import { UseFieldDOMGetters, UseFieldInternalProps } from "./useField.types.js";
3
2
  import { UseFieldStateReturnValue } from "./useFieldState.js";
4
3
  import { UseFieldCharacterEditingReturnValue } from "./useFieldCharacterEditing.js";
4
+ import { PickerAnyManager } from "../../models/index.js";
5
5
  /**
6
6
  * Generate the props to pass to the root element of the field.
7
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
8
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
9
7
  * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
10
8
  * @returns {UseFieldRootPropsReturnValue} The props to forward to the root element of the field.
11
9
  */
12
10
  export declare function useFieldRootProps(parameters: UseFieldRootPropsParameters): UseFieldRootPropsReturnValue;
13
11
  interface UseFieldRootPropsParameters {
14
- manager: PickerManager<any, any, any, any, any>;
12
+ manager: PickerAnyManager;
15
13
  stateResponse: UseFieldStateReturnValue<any>;
16
14
  applyCharacterEditing: UseFieldCharacterEditingReturnValue;
17
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
15
+ internalPropsWithDefaults: UseFieldInternalProps<any, any> & {
16
+ minutesStep?: number;
17
+ };
18
18
  domGetters: UseFieldDOMGetters;
19
19
  focused: boolean;
20
20
  setFocused: (focused: boolean) => void;