@mui/x-date-pickers 9.0.0-alpha.4 → 9.0.0-rc.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 (290) 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 +262 -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 -4
  17. package/DateField/DateField.mjs +22 -4
  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 -4
  33. package/DateTimeField/DateTimeField.mjs +22 -4
  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/MobileDatePicker/MobileDatePicker.d.mts +1 -1
  69. package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
  70. package/MobileDatePicker/MobileDatePicker.js +1 -5
  71. package/MobileDatePicker/MobileDatePicker.mjs +1 -5
  72. package/MobileDatePicker/MobileDatePicker.types.d.mts +3 -3
  73. package/MobileDatePicker/MobileDatePicker.types.d.ts +3 -3
  74. package/MobileDateTimePicker/MobileDateTimePicker.d.mts +1 -1
  75. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
  76. package/MobileDateTimePicker/MobileDateTimePicker.js +1 -5
  77. package/MobileDateTimePicker/MobileDateTimePicker.mjs +1 -5
  78. package/MobileDateTimePicker/MobileDateTimePicker.types.d.mts +3 -3
  79. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +3 -3
  80. package/MobileTimePicker/MobileTimePicker.d.mts +1 -1
  81. package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
  82. package/MobileTimePicker/MobileTimePicker.js +0 -4
  83. package/MobileTimePicker/MobileTimePicker.mjs +0 -4
  84. package/MobileTimePicker/MobileTimePicker.types.d.mts +3 -3
  85. package/MobileTimePicker/MobileTimePicker.types.d.ts +3 -3
  86. package/MonthCalendar/MonthCalendarButton.js +2 -2
  87. package/MonthCalendar/MonthCalendarButton.mjs +3 -3
  88. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
  89. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.mjs +3 -3
  90. package/PickerDay/PickerDay.d.mts +14 -0
  91. package/PickerDay/PickerDay.d.ts +14 -0
  92. package/{PickerDay2/PickerDay2.js → PickerDay/PickerDay.js} +110 -45
  93. package/{PickerDay2/PickerDay2.mjs → PickerDay/PickerDay.mjs} +110 -45
  94. package/PickerDay/PickerDay.types.d.mts +137 -0
  95. package/PickerDay/PickerDay.types.d.ts +137 -0
  96. package/PickerDay/index.d.mts +4 -0
  97. package/PickerDay/index.d.ts +4 -0
  98. package/PickerDay/index.js +25 -0
  99. package/PickerDay/index.mjs +2 -0
  100. package/{PickerDay2/pickerDay2Classes.d.mts → PickerDay/pickerDayClasses.d.mts} +4 -4
  101. package/{PickerDay2/pickerDay2Classes.d.ts → PickerDay/pickerDayClasses.d.ts} +4 -4
  102. package/PickerDay/pickerDayClasses.js +14 -0
  103. package/PickerDay/pickerDayClasses.mjs +6 -0
  104. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +27 -1
  105. package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +27 -1
  106. package/PickersTextField/PickersInput/PickersInput.js +27 -1
  107. package/PickersTextField/PickersInput/PickersInput.mjs +27 -1
  108. package/PickersTextField/PickersInputBase/PickersInputBase.js +26 -0
  109. package/PickersTextField/PickersInputBase/PickersInputBase.mjs +26 -0
  110. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +26 -0
  111. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +26 -0
  112. package/PickersTextField/PickersOutlinedInput/Outline.js +1 -1
  113. package/PickersTextField/PickersOutlinedInput/Outline.mjs +1 -1
  114. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +27 -1
  115. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +27 -1
  116. package/PickersTextField/PickersTextField.js +42 -2
  117. package/PickersTextField/PickersTextField.mjs +42 -2
  118. package/PickersTextField/PickersTextField.types.d.mts +22 -6
  119. package/PickersTextField/PickersTextField.types.d.ts +22 -6
  120. package/StaticDatePicker/StaticDatePicker.js +1 -1
  121. package/StaticDatePicker/StaticDatePicker.mjs +1 -1
  122. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  123. package/StaticDateTimePicker/StaticDateTimePicker.mjs +1 -1
  124. package/TimeField/TimeField.d.mts +1 -1
  125. package/TimeField/TimeField.d.ts +1 -1
  126. package/TimeField/TimeField.js +22 -4
  127. package/TimeField/TimeField.mjs +22 -4
  128. package/TimeField/TimeField.types.d.mts +2 -2
  129. package/TimeField/TimeField.types.d.ts +2 -2
  130. package/TimeField/useTimeField.d.mts +1 -1
  131. package/TimeField/useTimeField.d.ts +1 -1
  132. package/TimePicker/TimePicker.d.mts +1 -1
  133. package/TimePicker/TimePicker.d.ts +1 -1
  134. package/TimePicker/TimePicker.js +0 -4
  135. package/TimePicker/TimePicker.mjs +0 -4
  136. package/TimePicker/TimePicker.types.d.mts +3 -3
  137. package/TimePicker/TimePicker.types.d.ts +3 -3
  138. package/YearCalendar/YearCalendarButton.js +2 -2
  139. package/YearCalendar/YearCalendarButton.mjs +3 -3
  140. package/hooks/useParsedFormat.js +5 -7
  141. package/hooks/useParsedFormat.mjs +5 -7
  142. package/hooks/useSplitFieldProps.d.mts +1 -1
  143. package/hooks/useSplitFieldProps.d.ts +1 -1
  144. package/hooks/useSplitFieldProps.js +1 -1
  145. package/hooks/useSplitFieldProps.mjs +1 -1
  146. package/index.d.mts +1 -2
  147. package/index.d.ts +1 -2
  148. package/index.js +2 -14
  149. package/index.mjs +2 -3
  150. package/internals/components/PickerFieldUI.d.mts +22 -13
  151. package/internals/components/PickerFieldUI.d.ts +22 -13
  152. package/internals/components/PickerFieldUI.js +22 -80
  153. package/internals/components/PickerFieldUI.mjs +22 -80
  154. package/internals/components/PickerPopper/PickerPopper.js +3 -0
  155. package/internals/components/PickerPopper/PickerPopper.mjs +3 -0
  156. package/internals/components/PickersToolbar.js +3 -1
  157. package/internals/components/PickersToolbar.mjs +3 -1
  158. package/internals/demo/DemoContainer.js +6 -8
  159. package/internals/demo/DemoContainer.mjs +6 -8
  160. package/internals/hooks/PickerDay.types.d.mts +12 -0
  161. package/internals/hooks/PickerDay.types.d.ts +12 -0
  162. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +2 -2
  163. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
  164. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.mts +6 -6
  165. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +6 -6
  166. package/internals/hooks/useField/buildSectionsFromFormat.d.mts +0 -1
  167. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +0 -1
  168. package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  169. package/internals/hooks/useField/buildSectionsFromFormat.mjs +1 -1
  170. package/internals/hooks/useField/index.d.mts +1 -1
  171. package/internals/hooks/useField/index.d.ts +1 -1
  172. package/internals/hooks/useField/index.js +2 -8
  173. package/internals/hooks/useField/index.mjs +1 -1
  174. package/internals/hooks/useField/useField.d.mts +2 -2
  175. package/internals/hooks/useField/useField.d.ts +2 -2
  176. package/internals/hooks/useField/useField.js +265 -8
  177. package/internals/hooks/useField/useField.mjs +264 -8
  178. package/internals/hooks/useField/useField.types.d.mts +11 -50
  179. package/internals/hooks/useField/useField.types.d.ts +11 -50
  180. package/internals/hooks/useField/useField.utils.d.mts +2 -3
  181. package/internals/hooks/useField/useField.utils.d.ts +2 -3
  182. package/internals/hooks/useField/useField.utils.js +8 -65
  183. package/internals/hooks/useField/useField.utils.mjs +6 -62
  184. package/internals/hooks/useField/useFieldHiddenInputProps.d.mts +2 -4
  185. package/internals/hooks/useField/useFieldHiddenInputProps.d.ts +2 -4
  186. package/internals/hooks/useField/useFieldHiddenInputProps.js +1 -3
  187. package/internals/hooks/useField/useFieldHiddenInputProps.mjs +1 -3
  188. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +0 -1
  189. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.mjs +0 -1
  190. package/internals/hooks/useField/useFieldRootProps.d.mts +5 -5
  191. package/internals/hooks/useField/useFieldRootProps.d.ts +5 -5
  192. package/internals/hooks/useField/useFieldRootProps.js +183 -11
  193. package/internals/hooks/useField/useFieldRootProps.mjs +183 -11
  194. package/internals/hooks/useField/useFieldSectionContainerProps.d.mts +3 -5
  195. package/internals/hooks/useField/useFieldSectionContainerProps.d.ts +3 -5
  196. package/internals/hooks/useField/useFieldSectionContainerProps.js +2 -4
  197. package/internals/hooks/useField/useFieldSectionContainerProps.mjs +2 -4
  198. package/internals/hooks/useField/useFieldSectionContentProps.d.mts +6 -7
  199. package/internals/hooks/useField/useFieldSectionContentProps.d.ts +6 -7
  200. package/internals/hooks/useField/useFieldSectionContentProps.js +2 -4
  201. package/internals/hooks/useField/useFieldSectionContentProps.mjs +2 -4
  202. package/internals/hooks/useField/useFieldState.d.mts +4 -4
  203. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  204. package/internals/hooks/useField/useFieldState.js +3 -6
  205. package/internals/hooks/useField/useFieldState.mjs +3 -6
  206. package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +2 -2
  207. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
  208. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.mts +6 -6
  209. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +6 -6
  210. package/internals/hooks/useNullableFieldPrivateContext.d.mts +1 -1
  211. package/internals/hooks/useNullableFieldPrivateContext.d.ts +1 -1
  212. package/internals/hooks/usePicker/usePicker.js +1 -3
  213. package/internals/hooks/usePicker/usePicker.mjs +1 -3
  214. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.mts +2 -3
  215. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.ts +2 -3
  216. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.js +3 -5
  217. package/{PickersDay → internals/hooks}/usePickerDayOwnerState.mjs +3 -5
  218. package/internals/index.d.mts +4 -4
  219. package/internals/index.d.ts +4 -4
  220. package/internals/index.js +9 -9
  221. package/internals/index.mjs +3 -3
  222. package/internals/models/manager.d.mts +3 -5
  223. package/internals/models/manager.d.ts +3 -5
  224. package/internals/utils/valueManagers.js +1 -2
  225. package/internals/utils/valueManagers.mjs +2 -3
  226. package/managers/index.d.mts +2 -2
  227. package/managers/index.d.ts +2 -2
  228. package/managers/useDateManager.d.mts +3 -6
  229. package/managers/useDateManager.d.ts +3 -6
  230. package/managers/useDateManager.js +2 -6
  231. package/managers/useDateManager.mjs +2 -6
  232. package/managers/useDateTimeManager.d.mts +3 -6
  233. package/managers/useDateTimeManager.d.ts +3 -6
  234. package/managers/useDateTimeManager.js +2 -6
  235. package/managers/useDateTimeManager.mjs +2 -6
  236. package/managers/useTimeManager.d.mts +4 -6
  237. package/managers/useTimeManager.d.ts +4 -6
  238. package/managers/useTimeManager.js +1 -3
  239. package/managers/useTimeManager.mjs +1 -3
  240. package/models/fields.d.mts +3 -4
  241. package/models/fields.d.ts +3 -4
  242. package/models/manager.d.mts +2 -8
  243. package/models/manager.d.ts +2 -8
  244. package/package.json +55 -69
  245. package/themeAugmentation/components.d.mts +4 -8
  246. package/themeAugmentation/components.d.ts +4 -8
  247. package/themeAugmentation/overrides.d.mts +2 -4
  248. package/themeAugmentation/overrides.d.ts +2 -4
  249. package/themeAugmentation/props.d.mts +5 -7
  250. package/themeAugmentation/props.d.ts +5 -7
  251. package/PickerDay2/PickerDay2.d.mts +0 -7
  252. package/PickerDay2/PickerDay2.d.ts +0 -7
  253. package/PickerDay2/PickerDay2.types.d.mts +0 -18
  254. package/PickerDay2/PickerDay2.types.d.ts +0 -18
  255. package/PickerDay2/index.d.mts +0 -4
  256. package/PickerDay2/index.d.ts +0 -4
  257. package/PickerDay2/index.js +0 -25
  258. package/PickerDay2/index.mjs +0 -2
  259. package/PickerDay2/pickerDay2Classes.js +0 -14
  260. package/PickerDay2/pickerDay2Classes.mjs +0 -6
  261. package/PickersDay/PickersDay.d.mts +0 -15
  262. package/PickersDay/PickersDay.d.ts +0 -15
  263. package/PickersDay/PickersDay.js +0 -384
  264. package/PickersDay/PickersDay.mjs +0 -377
  265. package/PickersDay/PickersDay.types.d.mts +0 -114
  266. package/PickersDay/PickersDay.types.d.ts +0 -114
  267. package/PickersDay/index.d.mts +0 -4
  268. package/PickersDay/index.d.ts +0 -4
  269. package/PickersDay/index.js +0 -25
  270. package/PickersDay/index.mjs +0 -2
  271. package/PickersDay/pickersDayClasses.d.mts +0 -19
  272. package/PickersDay/pickersDayClasses.d.ts +0 -19
  273. package/PickersDay/pickersDayClasses.js +0 -14
  274. package/PickersDay/pickersDayClasses.mjs +0 -6
  275. package/internals/hooks/useField/useFieldRootHandleKeyDown.d.mts +0 -16
  276. package/internals/hooks/useField/useFieldRootHandleKeyDown.d.ts +0 -16
  277. package/internals/hooks/useField/useFieldRootHandleKeyDown.js +0 -211
  278. package/internals/hooks/useField/useFieldRootHandleKeyDown.mjs +0 -205
  279. package/internals/hooks/useField/useFieldV6TextField.d.mts +0 -26
  280. package/internals/hooks/useField/useFieldV6TextField.d.ts +0 -26
  281. package/internals/hooks/useField/useFieldV6TextField.js +0 -422
  282. package/internals/hooks/useField/useFieldV6TextField.mjs +0 -413
  283. package/internals/hooks/useField/useFieldV7TextField.d.mts +0 -3
  284. package/internals/hooks/useField/useFieldV7TextField.d.ts +0 -3
  285. package/internals/hooks/useField/useFieldV7TextField.js +0 -272
  286. package/internals/hooks/useField/useFieldV7TextField.mjs +0 -264
  287. /package/{PickerDay2/PickerDay2.types.js → PickerDay/PickerDay.types.js} +0 -0
  288. /package/{PickerDay2/PickerDay2.types.mjs → PickerDay/PickerDay.types.mjs} +0 -0
  289. /package/{PickersDay/PickersDay.types.js → internals/hooks/PickerDay.types.js} +0 -0
  290. /package/{PickersDay/PickersDay.types.mjs → internals/hooks/PickerDay.types.mjs} +0 -0
@@ -1,19 +1,20 @@
1
1
  import useEventCallback from '@mui/utils/useEventCallback';
2
2
  import useTimeout from '@mui/utils/useTimeout';
3
- import { useFieldRootHandleKeyDown } from "./useFieldRootHandleKeyDown.mjs";
4
3
  import { getActiveElement } from "../../utils/utils.mjs";
5
4
  import { syncSelectionToDOM } from "./syncSelectionToDOM.mjs";
5
+ import { usePickerAdapter } from "../../../hooks/usePickerAdapter.mjs";
6
+ import { cleanDigitSectionValue, getLetterEditingOptions, removeLocalizedDigits } from "./useField.utils.mjs";
6
7
 
7
8
  /**
8
9
  * Generate the props to pass to the root element of the field.
9
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
10
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
11
10
  * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
12
11
  * @returns {UseFieldRootPropsReturnValue} The props to forward to the root element of the field.
13
12
  */
14
13
  export function useFieldRootProps(parameters) {
15
14
  const {
16
- manager,
15
+ manager: {
16
+ internal_fieldValueManager: fieldValueManager
17
+ },
17
18
  focused,
18
19
  setFocused,
19
20
  domGetters,
@@ -23,25 +24,118 @@ export function useFieldRootProps(parameters) {
23
24
  stateResponse: {
24
25
  // States and derived states
25
26
  parsedSelectedSections,
27
+ sectionsValueBoundaries,
26
28
  sectionOrder,
27
29
  state,
30
+ value,
31
+ activeSectionIndex,
32
+ localizedDigits,
33
+ timezone,
28
34
  // Methods to update the states
29
35
  clearValue,
36
+ clearActiveSection,
30
37
  setCharacterQuery,
31
38
  setSelectedSections,
32
- updateValueFromValueStr
39
+ updateValueFromValueStr,
40
+ updateSectionValue
33
41
  },
34
42
  internalPropsWithDefaults: {
35
43
  disabled = false,
36
- readOnly = false
44
+ readOnly = false,
45
+ minutesStep
37
46
  }
38
47
  } = parameters;
48
+ const adapter = usePickerAdapter();
49
+ const handleKeyDown = useEventCallback(event => {
50
+ if (disabled) {
51
+ return;
52
+ }
39
53
 
40
- // TODO: Inline onContainerKeyDown once the old DOM structure is removed
41
- const handleKeyDown = useFieldRootHandleKeyDown({
42
- manager,
43
- internalPropsWithDefaults,
44
- stateResponse
54
+ // eslint-disable-next-line default-case
55
+ switch (true) {
56
+ // Select all
57
+ case (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'A' && !event.shiftKey && !event.altKey:
58
+ {
59
+ // prevent default to make sure that the next line "select all" while updating
60
+ // the internal state at the same time.
61
+ event.preventDefault();
62
+ setSelectedSections('all');
63
+ break;
64
+ }
65
+
66
+ // Move selection to next section
67
+ case event.key === 'ArrowRight':
68
+ {
69
+ event.preventDefault();
70
+ if (parsedSelectedSections == null) {
71
+ setSelectedSections(sectionOrder.startIndex);
72
+ } else if (parsedSelectedSections === 'all') {
73
+ setSelectedSections(sectionOrder.endIndex);
74
+ } else {
75
+ const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].rightIndex;
76
+ if (nextSectionIndex !== null) {
77
+ setSelectedSections(nextSectionIndex);
78
+ }
79
+ }
80
+ break;
81
+ }
82
+
83
+ // Move selection to previous section
84
+ case event.key === 'ArrowLeft':
85
+ {
86
+ event.preventDefault();
87
+ if (parsedSelectedSections == null) {
88
+ setSelectedSections(sectionOrder.endIndex);
89
+ } else if (parsedSelectedSections === 'all') {
90
+ setSelectedSections(sectionOrder.startIndex);
91
+ } else {
92
+ const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].leftIndex;
93
+ if (nextSectionIndex !== null) {
94
+ setSelectedSections(nextSectionIndex);
95
+ }
96
+ }
97
+ break;
98
+ }
99
+
100
+ // Reset the value of the selected section
101
+ case event.key === 'Delete':
102
+ {
103
+ event.preventDefault();
104
+ if (readOnly) {
105
+ break;
106
+ }
107
+ if (parsedSelectedSections == null || parsedSelectedSections === 'all') {
108
+ clearValue();
109
+ } else {
110
+ clearActiveSection();
111
+ }
112
+ break;
113
+ }
114
+
115
+ // Increment / decrement the selected section value
116
+ case ['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(event.key):
117
+ {
118
+ event.preventDefault();
119
+ if (readOnly || activeSectionIndex == null) {
120
+ break;
121
+ }
122
+
123
+ // if all sections are selected, mark the currently editing one as selected
124
+ if (parsedSelectedSections === 'all') {
125
+ setSelectedSections(activeSectionIndex);
126
+ }
127
+ const activeSection = state.sections[activeSectionIndex];
128
+ const newSectionValue = adjustSectionValue(adapter, timezone, activeSection, event.key, sectionsValueBoundaries, localizedDigits, fieldValueManager.getDateFromSection(value, activeSection), {
129
+ minutesStep
130
+ });
131
+ updateSectionValue({
132
+ section: activeSection,
133
+ newSectionValue,
134
+ shouldGoToNextSection: false
135
+ });
136
+ break;
137
+ }
138
+ }
45
139
  });
46
140
  const containerClickTimeout = useTimeout();
47
141
  const handleClick = useEventCallback(event => {
@@ -148,4 +242,82 @@ export function useFieldRootProps(parameters) {
148
242
  contentEditable: parsedSelectedSections === 'all',
149
243
  tabIndex: internalPropsWithDefaults.disabled || parsedSelectedSections === 0 ? -1 : 0 // TODO: Try to set to undefined when there is a section selected.
150
244
  };
245
+ }
246
+ function getDeltaFromKeyCode(keyCode) {
247
+ switch (keyCode) {
248
+ case 'ArrowUp':
249
+ return 1;
250
+ case 'ArrowDown':
251
+ return -1;
252
+ case 'PageUp':
253
+ return 5;
254
+ case 'PageDown':
255
+ return -5;
256
+ default:
257
+ return 0;
258
+ }
259
+ }
260
+ function adjustSectionValue(adapter, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) {
261
+ const delta = getDeltaFromKeyCode(keyCode);
262
+ const isStart = keyCode === 'Home';
263
+ const isEnd = keyCode === 'End';
264
+ const shouldSetAbsolute = section.value === '' || isStart || isEnd;
265
+ const adjustDigitSection = () => {
266
+ const sectionBoundaries = sectionsValueBoundaries[section.type]({
267
+ currentDate: activeDate,
268
+ format: section.format,
269
+ contentType: section.contentType
270
+ });
271
+ const getCleanValue = value => cleanDigitSectionValue(adapter, value, sectionBoundaries, localizedDigits, section);
272
+ const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;
273
+ let newSectionValueNumber;
274
+ if (shouldSetAbsolute) {
275
+ if (section.type === 'year' && !isEnd && !isStart) {
276
+ return adapter.formatByString(adapter.date(undefined, timezone), section.format);
277
+ }
278
+ if (delta > 0 || isStart) {
279
+ newSectionValueNumber = sectionBoundaries.minimum;
280
+ } else {
281
+ newSectionValueNumber = sectionBoundaries.maximum;
282
+ }
283
+ } else {
284
+ const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);
285
+ newSectionValueNumber = currentSectionValue + delta * step;
286
+ }
287
+ if (newSectionValueNumber % step !== 0) {
288
+ if (delta < 0 || isStart) {
289
+ newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)
290
+ }
291
+ if (delta > 0 || isEnd) {
292
+ newSectionValueNumber -= newSectionValueNumber % step;
293
+ }
294
+ }
295
+ if (newSectionValueNumber > sectionBoundaries.maximum) {
296
+ return getCleanValue(sectionBoundaries.minimum + (newSectionValueNumber - sectionBoundaries.maximum - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));
297
+ }
298
+ if (newSectionValueNumber < sectionBoundaries.minimum) {
299
+ return getCleanValue(sectionBoundaries.maximum - (sectionBoundaries.minimum - newSectionValueNumber - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));
300
+ }
301
+ return getCleanValue(newSectionValueNumber);
302
+ };
303
+ const adjustLetterSection = () => {
304
+ const options = getLetterEditingOptions(adapter, timezone, section.type, section.format);
305
+ if (options.length === 0) {
306
+ return section.value;
307
+ }
308
+ if (shouldSetAbsolute) {
309
+ if (delta > 0 || isStart) {
310
+ return options[0];
311
+ }
312
+ return options[options.length - 1];
313
+ }
314
+ const currentOptionIndex = options.indexOf(section.value);
315
+ const newOptionIndex = (currentOptionIndex + delta) % options.length;
316
+ const clampedIndex = (newOptionIndex + options.length) % options.length;
317
+ return options[clampedIndex];
318
+ };
319
+ if (section.contentType === 'digit' || section.contentType === 'digit-with-letter') {
320
+ return adjustDigitSection();
321
+ }
322
+ return adjustLetterSection();
151
323
  }
@@ -3,15 +3,13 @@ import { UseFieldStateReturnValue } from "./useFieldState.mjs";
3
3
  import { UseFieldInternalProps } from "./useField.types.mjs";
4
4
  /**
5
5
  * Generate the props to pass to the container element of each section 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
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
9
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the container element of each section of the field.
6
+ * @param {UseFieldSectionContainerPropsParameters} parameters The parameters of the hook.
7
+ * @returns {UseFieldSectionContainerPropsReturnValue} The props to forward to the container element of each section of the field.
10
8
  */
11
9
  export declare function useFieldSectionContainerProps(parameters: UseFieldSectionContainerPropsParameters): UseFieldSectionContainerPropsReturnValue;
12
10
  interface UseFieldSectionContainerPropsParameters {
13
11
  stateResponse: UseFieldStateReturnValue<any>;
14
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
12
+ internalPropsWithDefaults: UseFieldInternalProps<any, any>;
15
13
  }
16
14
  type UseFieldSectionContainerPropsReturnValue = (sectionIndex: number) => React.HTMLAttributes<HTMLSpanElement>;
17
15
  export {};
@@ -3,15 +3,13 @@ import { UseFieldStateReturnValue } from "./useFieldState.js";
3
3
  import { UseFieldInternalProps } from "./useField.types.js";
4
4
  /**
5
5
  * Generate the props to pass to the container element of each section 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
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
9
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the container element of each section of the field.
6
+ * @param {UseFieldSectionContainerPropsParameters} parameters The parameters of the hook.
7
+ * @returns {UseFieldSectionContainerPropsReturnValue} The props to forward to the container element of each section of the field.
10
8
  */
11
9
  export declare function useFieldSectionContainerProps(parameters: UseFieldSectionContainerPropsParameters): UseFieldSectionContainerPropsReturnValue;
12
10
  interface UseFieldSectionContainerPropsParameters {
13
11
  stateResponse: UseFieldStateReturnValue<any>;
14
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
12
+ internalPropsWithDefaults: UseFieldInternalProps<any, any>;
15
13
  }
16
14
  type UseFieldSectionContainerPropsReturnValue = (sectionIndex: number) => React.HTMLAttributes<HTMLSpanElement>;
17
15
  export {};
@@ -8,10 +8,8 @@ exports.useFieldSectionContainerProps = useFieldSectionContainerProps;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  /**
10
10
  * Generate the props to pass to the container element of each section of the field.
11
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
12
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
13
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
14
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the container element of each section of the field.
11
+ * @param {UseFieldSectionContainerPropsParameters} parameters The parameters of the hook.
12
+ * @returns {UseFieldSectionContainerPropsReturnValue} The props to forward to the container element of each section of the field.
15
13
  */
16
14
  function useFieldSectionContainerProps(parameters) {
17
15
  const {
@@ -1,10 +1,8 @@
1
1
  import * as React from 'react';
2
2
  /**
3
3
  * Generate the props to pass to the container element of each section of the field.
4
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
5
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
6
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
7
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the container element of each section of the field.
4
+ * @param {UseFieldSectionContainerPropsParameters} parameters The parameters of the hook.
5
+ * @returns {UseFieldSectionContainerPropsReturnValue} The props to forward to the container element of each section of the field.
8
6
  */
9
7
  export function useFieldSectionContainerProps(parameters) {
10
8
  const {
@@ -1,21 +1,20 @@
1
1
  import { UseFieldStateReturnValue } from "./useFieldState.mjs";
2
- import { FieldSection, PickerManager } from "../../../models/index.mjs";
2
+ import { FieldSection } from "../../../models/index.mjs";
3
3
  import { UseFieldDOMGetters, UseFieldInternalProps } from "./useField.types.mjs";
4
4
  import { UseFieldCharacterEditingReturnValue } from "./useFieldCharacterEditing.mjs";
5
+ import { PickerAnyManager } from "../../models/index.mjs";
5
6
  import { PickersSectionElement } from "../../../PickersSectionList/index.mjs";
6
7
  /**
7
8
  * Generate the props to pass to the content element of each section of the field.
8
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
9
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
10
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
11
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the content element of each section of the field.
9
+ * @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
10
+ * @returns {UseFieldSectionContentPropsReturnValue} The props to forward to the content element of each section of the field.
12
11
  */
13
12
  export declare function useFieldSectionContentProps(parameters: UseFieldSectionContentPropsParameters): UseFieldSectionContentPropsReturnValue;
14
13
  interface UseFieldSectionContentPropsParameters {
15
- manager: PickerManager<any, any, any, any, any>;
14
+ manager: PickerAnyManager;
16
15
  stateResponse: UseFieldStateReturnValue<any>;
17
16
  applyCharacterEditing: UseFieldCharacterEditingReturnValue;
18
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
17
+ internalPropsWithDefaults: UseFieldInternalProps<any, any>;
19
18
  domGetters: UseFieldDOMGetters;
20
19
  focused: boolean;
21
20
  }
@@ -1,21 +1,20 @@
1
1
  import { UseFieldStateReturnValue } from "./useFieldState.js";
2
- import { FieldSection, PickerManager } from "../../../models/index.js";
2
+ import { FieldSection } from "../../../models/index.js";
3
3
  import { UseFieldDOMGetters, UseFieldInternalProps } from "./useField.types.js";
4
4
  import { UseFieldCharacterEditingReturnValue } from "./useFieldCharacterEditing.js";
5
+ import { PickerAnyManager } from "../../models/index.js";
5
6
  import { PickersSectionElement } from "../../../PickersSectionList/index.js";
6
7
  /**
7
8
  * Generate the props to pass to the content element of each section of the field.
8
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
9
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
10
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
11
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the content element of each section of the field.
9
+ * @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
10
+ * @returns {UseFieldSectionContentPropsReturnValue} The props to forward to the content element of each section of the field.
12
11
  */
13
12
  export declare function useFieldSectionContentProps(parameters: UseFieldSectionContentPropsParameters): UseFieldSectionContentPropsReturnValue;
14
13
  interface UseFieldSectionContentPropsParameters {
15
- manager: PickerManager<any, any, any, any, any>;
14
+ manager: PickerAnyManager;
16
15
  stateResponse: UseFieldStateReturnValue<any>;
17
16
  applyCharacterEditing: UseFieldCharacterEditingReturnValue;
18
- internalPropsWithDefaults: UseFieldInternalProps<any, any, any>;
17
+ internalPropsWithDefaults: UseFieldInternalProps<any, any>;
19
18
  domGetters: UseFieldDOMGetters;
20
19
  focused: boolean;
21
20
  }
@@ -12,10 +12,8 @@ var _hooks = require("../../../hooks");
12
12
  var _syncSelectionToDOM = require("./syncSelectionToDOM");
13
13
  /**
14
14
  * Generate the props to pass to the content element of each section of the field.
15
- * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
16
- * It should be used in the MUI accessible DOM structure and the Base UI implementation.
17
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
18
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the content element of each section of the field.
15
+ * @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
16
+ * @returns {UseFieldSectionContentPropsReturnValue} The props to forward to the content element of each section of the field.
19
17
  */
20
18
  function useFieldSectionContentProps(parameters) {
21
19
  const adapter = (0, _hooks.usePickerAdapter)();
@@ -4,10 +4,8 @@ import { usePickerAdapter, usePickerTranslations } from "../../../hooks/index.mj
4
4
  import { syncSelectionToDOM } from "./syncSelectionToDOM.mjs";
5
5
  /**
6
6
  * Generate the props to pass to the content element of each section 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
- * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
10
- * @returns {UseFieldRootPropsReturnValue} The props to forward to the content element of each section of the field.
7
+ * @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
8
+ * @returns {UseFieldSectionContentPropsReturnValue} The props to forward to the content element of each section of the field.
11
9
  */
12
10
  export function useFieldSectionContentProps(parameters) {
13
11
  const adapter = usePickerAdapter();
@@ -1,10 +1,10 @@
1
1
  import { UseFieldInternalProps, UseFieldState, FieldParsedSelectedSections, FieldSectionsValueBoundaries, SectionOrdering, UseFieldForwardedProps, CharacterEditingQuery } from "./useField.types.mjs";
2
2
  import { FieldSelectedSections, PickersTimezone, InferFieldSection, PickerManager } from "../../../models/index.mjs";
3
3
  import { PickerValidValue } from "../../models/index.mjs";
4
- export declare const useFieldState: <TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>>(parameters: UseFieldStateParameters<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, TForwardedProps>) => UseFieldStateReturnValue<TValue>;
5
- interface UseFieldStateParameters<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>> {
6
- manager: PickerManager<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, any>;
7
- internalPropsWithDefaults: UseFieldInternalProps<TValue, TEnableAccessibleFieldDOMStructure, TError> & TValidationProps;
4
+ export declare const useFieldState: <TValue extends PickerValidValue, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps>(parameters: UseFieldStateParameters<TValue, TError, TValidationProps, TForwardedProps>) => UseFieldStateReturnValue<TValue>;
5
+ interface UseFieldStateParameters<TValue extends PickerValidValue, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps> {
6
+ manager: PickerManager<TValue, TError, TValidationProps, any>;
7
+ internalPropsWithDefaults: UseFieldInternalProps<TValue, TError> & TValidationProps;
8
8
  forwardedProps: TForwardedProps;
9
9
  }
10
10
  export interface UpdateSectionValueParameters<TValue extends PickerValidValue> {
@@ -1,10 +1,10 @@
1
1
  import { UseFieldInternalProps, UseFieldState, FieldParsedSelectedSections, FieldSectionsValueBoundaries, SectionOrdering, UseFieldForwardedProps, CharacterEditingQuery } from "./useField.types.js";
2
2
  import { FieldSelectedSections, PickersTimezone, InferFieldSection, PickerManager } from "../../../models/index.js";
3
3
  import { PickerValidValue } from "../../models/index.js";
4
- export declare const useFieldState: <TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>>(parameters: UseFieldStateParameters<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, TForwardedProps>) => UseFieldStateReturnValue<TValue>;
5
- interface UseFieldStateParameters<TValue extends PickerValidValue, TEnableAccessibleFieldDOMStructure extends boolean, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>> {
6
- manager: PickerManager<TValue, TEnableAccessibleFieldDOMStructure, TError, TValidationProps, any>;
7
- internalPropsWithDefaults: UseFieldInternalProps<TValue, TEnableAccessibleFieldDOMStructure, TError> & TValidationProps;
4
+ export declare const useFieldState: <TValue extends PickerValidValue, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps>(parameters: UseFieldStateParameters<TValue, TError, TValidationProps, TForwardedProps>) => UseFieldStateReturnValue<TValue>;
5
+ interface UseFieldStateParameters<TValue extends PickerValidValue, TError, TValidationProps extends {}, TForwardedProps extends UseFieldForwardedProps> {
6
+ manager: PickerManager<TValue, TError, TValidationProps, any>;
7
+ internalPropsWithDefaults: UseFieldInternalProps<TValue, TError> & TValidationProps;
8
8
  forwardedProps: TForwardedProps;
9
9
  }
10
10
  export interface UpdateSectionValueParameters<TValue extends PickerValidValue> {
@@ -42,8 +42,7 @@ const useFieldState = parameters => {
42
42
  selectedSections: selectedSectionsProp,
43
43
  onSelectedSectionsChange,
44
44
  shouldRespectLeadingZeros = false,
45
- timezone: timezoneProp,
46
- enableAccessibleFieldDOMStructure = true
45
+ timezone: timezoneProp
47
46
  },
48
47
  forwardedProps: {
49
48
  error: errorProp
@@ -85,9 +84,8 @@ const useFieldState = parameters => {
85
84
  date,
86
85
  formatDensity,
87
86
  shouldRespectLeadingZeros,
88
- enableAccessibleFieldDOMStructure,
89
87
  isRtl
90
- })), [fieldValueManager, format, translations, localizedDigits, isRtl, shouldRespectLeadingZeros, adapter, formatDensity, enableAccessibleFieldDOMStructure]);
88
+ })), [fieldValueManager, format, translations, localizedDigits, isRtl, shouldRespectLeadingZeros, adapter, formatDensity]);
91
89
  const [state, setState] = React.useState(() => {
92
90
  const sections = getSectionsFromValue(value);
93
91
  (0, _useField.validateSections)(sections, valueType);
@@ -127,7 +125,7 @@ const useFieldState = parameters => {
127
125
  };
128
126
  const parsedSelectedSections = React.useMemo(() => (0, _useField.parseSelectedSections)(selectedSections, state.sections), [selectedSections, state.sections]);
129
127
  const activeSectionIndex = parsedSelectedSections === 'all' ? 0 : parsedSelectedSections;
130
- const sectionOrder = React.useMemo(() => (0, _useField.getSectionOrder)(state.sections, isRtl && !enableAccessibleFieldDOMStructure), [state.sections, isRtl, enableAccessibleFieldDOMStructure]);
128
+ const sectionOrder = React.useMemo(() => (0, _useField.getSectionOrder)(state.sections), [state.sections]);
131
129
  const areAllSectionsEmpty = React.useMemo(() => state.sections.every(section => section.value === ''), [state.sections]);
132
130
 
133
131
  // When the field loses focus (no active section), consider partially filled sections as invalid.
@@ -230,7 +228,6 @@ const useFieldState = parameters => {
230
228
  date,
231
229
  formatDensity,
232
230
  shouldRespectLeadingZeros,
233
- enableAccessibleFieldDOMStructure,
234
231
  isRtl
235
232
  });
236
233
  return (0, _useField.mergeDateIntoReferenceDate)(adapter, date, sections, referenceDate, false);
@@ -35,8 +35,7 @@ export const useFieldState = parameters => {
35
35
  selectedSections: selectedSectionsProp,
36
36
  onSelectedSectionsChange,
37
37
  shouldRespectLeadingZeros = false,
38
- timezone: timezoneProp,
39
- enableAccessibleFieldDOMStructure = true
38
+ timezone: timezoneProp
40
39
  },
41
40
  forwardedProps: {
42
41
  error: errorProp
@@ -78,9 +77,8 @@ export const useFieldState = parameters => {
78
77
  date,
79
78
  formatDensity,
80
79
  shouldRespectLeadingZeros,
81
- enableAccessibleFieldDOMStructure,
82
80
  isRtl
83
- })), [fieldValueManager, format, translations, localizedDigits, isRtl, shouldRespectLeadingZeros, adapter, formatDensity, enableAccessibleFieldDOMStructure]);
81
+ })), [fieldValueManager, format, translations, localizedDigits, isRtl, shouldRespectLeadingZeros, adapter, formatDensity]);
84
82
  const [state, setState] = React.useState(() => {
85
83
  const sections = getSectionsFromValue(value);
86
84
  validateSections(sections, valueType);
@@ -120,7 +118,7 @@ export const useFieldState = parameters => {
120
118
  };
121
119
  const parsedSelectedSections = React.useMemo(() => parseSelectedSections(selectedSections, state.sections), [selectedSections, state.sections]);
122
120
  const activeSectionIndex = parsedSelectedSections === 'all' ? 0 : parsedSelectedSections;
123
- const sectionOrder = React.useMemo(() => getSectionOrder(state.sections, isRtl && !enableAccessibleFieldDOMStructure), [state.sections, isRtl, enableAccessibleFieldDOMStructure]);
121
+ const sectionOrder = React.useMemo(() => getSectionOrder(state.sections), [state.sections]);
124
122
  const areAllSectionsEmpty = React.useMemo(() => state.sections.every(section => section.value === ''), [state.sections]);
125
123
 
126
124
  // When the field loses focus (no active section), consider partially filled sections as invalid.
@@ -223,7 +221,6 @@ export const useFieldState = parameters => {
223
221
  date,
224
222
  formatDensity,
225
223
  shouldRespectLeadingZeros,
226
- enableAccessibleFieldDOMStructure,
227
224
  isRtl
228
225
  });
229
226
  return mergeDateIntoReferenceDate(adapter, date, sections, referenceDate, false);
@@ -6,10 +6,10 @@ import { DateOrTimeViewWithMeridiem } from "../../models/index.mjs";
6
6
  * - MobileDateTimePicker
7
7
  * - MobileTimePicker
8
8
  */
9
- export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
9
+ export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseMobilePickerProps<TView, any, TExternalProps>>({
10
10
  props,
11
11
  steps,
12
12
  ...pickerParams
13
- }: UseMobilePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
13
+ }: UseMobilePickerParams<TView, TExternalProps>) => {
14
14
  renderPicker: () => import("react/jsx-runtime").JSX.Element;
15
15
  };
@@ -6,10 +6,10 @@ import { DateOrTimeViewWithMeridiem } from "../../models/index.js";
6
6
  * - MobileDateTimePicker
7
7
  * - MobileTimePicker
8
8
  */
9
- export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
9
+ export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseMobilePickerProps<TView, any, TExternalProps>>({
10
10
  props,
11
11
  steps,
12
12
  ...pickerParams
13
- }: UseMobilePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
13
+ }: UseMobilePickerParams<TView, TExternalProps>) => {
14
14
  renderPicker: () => import("react/jsx-runtime").JSX.Element;
15
15
  };
@@ -14,12 +14,12 @@ export interface UseMobilePickerSlots extends PickersModalDialogSlots, ExportedP
14
14
  */
15
15
  field: React.ElementType;
16
16
  }
17
- export interface ExportedUseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValue>, PickerFieldUISlotPropsFromContext {
18
- field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValue, TEnableAccessibleFieldDOMStructure>, {}, PickerOwnerState>;
17
+ export interface ExportedUseMobilePickerSlotProps extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValue>, PickerFieldUISlotPropsFromContext {
18
+ field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValue>, {}, PickerOwnerState>;
19
19
  }
20
- export interface UseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerValue>, 'toolbar'> {}
20
+ export interface UseMobilePickerSlotProps extends ExportedUseMobilePickerSlotProps, Pick<PickersLayoutSlotProps<PickerValue>, 'toolbar'> {}
21
21
  export interface MobileOnlyPickerProps extends UsePickerNonStaticProps {}
22
- export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerProps<PickerValue, TView, TError, any>> extends BasePickerProps<PickerValue, TView, TError, TExternalProps>, MakeRequired<MobileOnlyPickerProps, 'format'> {
22
+ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerProps<PickerValue, TView, TError, any>> extends BasePickerProps<PickerValue, TView, TError, TExternalProps>, MakeRequired<MobileOnlyPickerProps, 'format'> {
23
23
  /**
24
24
  * Overridable component slots.
25
25
  * @default {}
@@ -29,9 +29,9 @@ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem,
29
29
  * The props used for each component slot.
30
30
  * @default {}
31
31
  */
32
- slotProps?: UseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
32
+ slotProps?: UseMobilePickerSlotProps;
33
33
  }
34
- export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
34
+ export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseMobilePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
35
35
  props: TExternalProps;
36
36
  /**
37
37
  * Steps available for the picker.
@@ -14,12 +14,12 @@ export interface UseMobilePickerSlots extends PickersModalDialogSlots, ExportedP
14
14
  */
15
15
  field: React.ElementType;
16
16
  }
17
- export interface ExportedUseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValue>, PickerFieldUISlotPropsFromContext {
18
- field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValue, TEnableAccessibleFieldDOMStructure>, {}, PickerOwnerState>;
17
+ export interface ExportedUseMobilePickerSlotProps extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValue>, PickerFieldUISlotPropsFromContext {
18
+ field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValue>, {}, PickerOwnerState>;
19
19
  }
20
- export interface UseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerValue>, 'toolbar'> {}
20
+ export interface UseMobilePickerSlotProps extends ExportedUseMobilePickerSlotProps, Pick<PickersLayoutSlotProps<PickerValue>, 'toolbar'> {}
21
21
  export interface MobileOnlyPickerProps extends UsePickerNonStaticProps {}
22
- export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerProps<PickerValue, TView, TError, any>> extends BasePickerProps<PickerValue, TView, TError, TExternalProps>, MakeRequired<MobileOnlyPickerProps, 'format'> {
22
+ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerProps<PickerValue, TView, TError, any>> extends BasePickerProps<PickerValue, TView, TError, TExternalProps>, MakeRequired<MobileOnlyPickerProps, 'format'> {
23
23
  /**
24
24
  * Overridable component slots.
25
25
  * @default {}
@@ -29,9 +29,9 @@ export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem,
29
29
  * The props used for each component slot.
30
30
  * @default {}
31
31
  */
32
- slotProps?: UseMobilePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
32
+ slotProps?: UseMobilePickerSlotProps;
33
33
  }
34
- export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
34
+ export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseMobilePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
35
35
  props: TExternalProps;
36
36
  /**
37
37
  * Steps available for the picker.
@@ -4,7 +4,7 @@ import { FieldRef } from "../../models/index.mjs";
4
4
  import { PickerRangeValue, PickerValue } from "../models/index.mjs";
5
5
  export declare const PickerFieldPrivateContext: React.Context<PickerFieldPrivateContextValue | null>;
6
6
  export declare function useNullableFieldPrivateContext(): PickerFieldPrivateContextValue | null;
7
- export interface PickerFieldPrivateContextValue extends Pick<UseFieldInternalProps<any, any, any>, 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange'> {
7
+ export interface PickerFieldPrivateContextValue extends Pick<UseFieldInternalProps<any, any>, 'formatDensity' | 'selectedSections' | 'onSelectedSectionsChange'> {
8
8
  internalFieldRef: React.RefObject<FieldRef<PickerValue> | FieldRef<PickerRangeValue> | null>;
9
9
  fieldRef?: React.RefObject<FieldRef<any> | null>;
10
10
  }
@@ -4,7 +4,7 @@ import { FieldRef } from "../../models/index.js";
4
4
  import { PickerRangeValue, PickerValue } from "../models/index.js";
5
5
  export declare const PickerFieldPrivateContext: React.Context<PickerFieldPrivateContextValue | null>;
6
6
  export declare function useNullableFieldPrivateContext(): PickerFieldPrivateContextValue | null;
7
- export interface PickerFieldPrivateContextValue extends Pick<UseFieldInternalProps<any, any, any>, 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange'> {
7
+ export interface PickerFieldPrivateContextValue extends Pick<UseFieldInternalProps<any, any>, 'formatDensity' | 'selectedSections' | 'onSelectedSectionsChange'> {
8
8
  internalFieldRef: React.RefObject<FieldRef<PickerValue> | FieldRef<PickerRangeValue> | null>;
9
9
  fieldRef?: React.RefObject<FieldRef<any> | null>;
10
10
  }