@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
@@ -7,19 +7,20 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.useFieldRootProps = useFieldRootProps;
8
8
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
9
9
  var _useTimeout = _interopRequireDefault(require("@mui/utils/useTimeout"));
10
- var _useFieldRootHandleKeyDown = require("./useFieldRootHandleKeyDown");
11
10
  var _utils = require("../../utils/utils");
12
11
  var _syncSelectionToDOM = require("./syncSelectionToDOM");
12
+ var _usePickerAdapter = require("../../../hooks/usePickerAdapter");
13
+ var _useField = require("./useField.utils");
13
14
  /**
14
15
  * Generate the props to pass to the root element 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
16
  * @param {UseFieldRootPropsParameters} parameters The parameters of the hook.
18
17
  * @returns {UseFieldRootPropsReturnValue} The props to forward to the root element of the field.
19
18
  */
20
19
  function useFieldRootProps(parameters) {
21
20
  const {
22
- manager,
21
+ manager: {
22
+ internal_fieldValueManager: fieldValueManager
23
+ },
23
24
  focused,
24
25
  setFocused,
25
26
  domGetters,
@@ -29,25 +30,118 @@ function useFieldRootProps(parameters) {
29
30
  stateResponse: {
30
31
  // States and derived states
31
32
  parsedSelectedSections,
33
+ sectionsValueBoundaries,
32
34
  sectionOrder,
33
35
  state,
36
+ value,
37
+ activeSectionIndex,
38
+ localizedDigits,
39
+ timezone,
34
40
  // Methods to update the states
35
41
  clearValue,
42
+ clearActiveSection,
36
43
  setCharacterQuery,
37
44
  setSelectedSections,
38
- updateValueFromValueStr
45
+ updateValueFromValueStr,
46
+ updateSectionValue
39
47
  },
40
48
  internalPropsWithDefaults: {
41
49
  disabled = false,
42
- readOnly = false
50
+ readOnly = false,
51
+ minutesStep
43
52
  }
44
53
  } = parameters;
54
+ const adapter = (0, _usePickerAdapter.usePickerAdapter)();
55
+ const handleKeyDown = (0, _useEventCallback.default)(event => {
56
+ if (disabled) {
57
+ return;
58
+ }
45
59
 
46
- // TODO: Inline onContainerKeyDown once the old DOM structure is removed
47
- const handleKeyDown = (0, _useFieldRootHandleKeyDown.useFieldRootHandleKeyDown)({
48
- manager,
49
- internalPropsWithDefaults,
50
- stateResponse
60
+ // eslint-disable-next-line default-case
61
+ switch (true) {
62
+ // Select all
63
+ case (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'A' && !event.shiftKey && !event.altKey:
64
+ {
65
+ // prevent default to make sure that the next line "select all" while updating
66
+ // the internal state at the same time.
67
+ event.preventDefault();
68
+ setSelectedSections('all');
69
+ break;
70
+ }
71
+
72
+ // Move selection to next section
73
+ case event.key === 'ArrowRight':
74
+ {
75
+ event.preventDefault();
76
+ if (parsedSelectedSections == null) {
77
+ setSelectedSections(sectionOrder.startIndex);
78
+ } else if (parsedSelectedSections === 'all') {
79
+ setSelectedSections(sectionOrder.endIndex);
80
+ } else {
81
+ const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].rightIndex;
82
+ if (nextSectionIndex !== null) {
83
+ setSelectedSections(nextSectionIndex);
84
+ }
85
+ }
86
+ break;
87
+ }
88
+
89
+ // Move selection to previous section
90
+ case event.key === 'ArrowLeft':
91
+ {
92
+ event.preventDefault();
93
+ if (parsedSelectedSections == null) {
94
+ setSelectedSections(sectionOrder.endIndex);
95
+ } else if (parsedSelectedSections === 'all') {
96
+ setSelectedSections(sectionOrder.startIndex);
97
+ } else {
98
+ const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].leftIndex;
99
+ if (nextSectionIndex !== null) {
100
+ setSelectedSections(nextSectionIndex);
101
+ }
102
+ }
103
+ break;
104
+ }
105
+
106
+ // Reset the value of the selected section
107
+ case event.key === 'Delete':
108
+ {
109
+ event.preventDefault();
110
+ if (readOnly) {
111
+ break;
112
+ }
113
+ if (parsedSelectedSections == null || parsedSelectedSections === 'all') {
114
+ clearValue();
115
+ } else {
116
+ clearActiveSection();
117
+ }
118
+ break;
119
+ }
120
+
121
+ // Increment / decrement the selected section value
122
+ case ['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(event.key):
123
+ {
124
+ event.preventDefault();
125
+ if (readOnly || activeSectionIndex == null) {
126
+ break;
127
+ }
128
+
129
+ // if all sections are selected, mark the currently editing one as selected
130
+ if (parsedSelectedSections === 'all') {
131
+ setSelectedSections(activeSectionIndex);
132
+ }
133
+ const activeSection = state.sections[activeSectionIndex];
134
+ const newSectionValue = adjustSectionValue(adapter, timezone, activeSection, event.key, sectionsValueBoundaries, localizedDigits, fieldValueManager.getDateFromSection(value, activeSection), {
135
+ minutesStep
136
+ });
137
+ updateSectionValue({
138
+ section: activeSection,
139
+ newSectionValue,
140
+ shouldGoToNextSection: false
141
+ });
142
+ break;
143
+ }
144
+ }
51
145
  });
52
146
  const containerClickTimeout = (0, _useTimeout.default)();
53
147
  const handleClick = (0, _useEventCallback.default)(event => {
@@ -154,4 +248,82 @@ function useFieldRootProps(parameters) {
154
248
  contentEditable: parsedSelectedSections === 'all',
155
249
  tabIndex: internalPropsWithDefaults.disabled || parsedSelectedSections === 0 ? -1 : 0 // TODO: Try to set to undefined when there is a section selected.
156
250
  };
251
+ }
252
+ function getDeltaFromKeyCode(keyCode) {
253
+ switch (keyCode) {
254
+ case 'ArrowUp':
255
+ return 1;
256
+ case 'ArrowDown':
257
+ return -1;
258
+ case 'PageUp':
259
+ return 5;
260
+ case 'PageDown':
261
+ return -5;
262
+ default:
263
+ return 0;
264
+ }
265
+ }
266
+ function adjustSectionValue(adapter, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) {
267
+ const delta = getDeltaFromKeyCode(keyCode);
268
+ const isStart = keyCode === 'Home';
269
+ const isEnd = keyCode === 'End';
270
+ const shouldSetAbsolute = section.value === '' || isStart || isEnd;
271
+ const adjustDigitSection = () => {
272
+ const sectionBoundaries = sectionsValueBoundaries[section.type]({
273
+ currentDate: activeDate,
274
+ format: section.format,
275
+ contentType: section.contentType
276
+ });
277
+ const getCleanValue = value => (0, _useField.cleanDigitSectionValue)(adapter, value, sectionBoundaries, localizedDigits, section);
278
+ const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;
279
+ let newSectionValueNumber;
280
+ if (shouldSetAbsolute) {
281
+ if (section.type === 'year' && !isEnd && !isStart) {
282
+ return adapter.formatByString(adapter.date(undefined, timezone), section.format);
283
+ }
284
+ if (delta > 0 || isStart) {
285
+ newSectionValueNumber = sectionBoundaries.minimum;
286
+ } else {
287
+ newSectionValueNumber = sectionBoundaries.maximum;
288
+ }
289
+ } else {
290
+ const currentSectionValue = parseInt((0, _useField.removeLocalizedDigits)(section.value, localizedDigits), 10);
291
+ newSectionValueNumber = currentSectionValue + delta * step;
292
+ }
293
+ if (newSectionValueNumber % step !== 0) {
294
+ if (delta < 0 || isStart) {
295
+ newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)
296
+ }
297
+ if (delta > 0 || isEnd) {
298
+ newSectionValueNumber -= newSectionValueNumber % step;
299
+ }
300
+ }
301
+ if (newSectionValueNumber > sectionBoundaries.maximum) {
302
+ return getCleanValue(sectionBoundaries.minimum + (newSectionValueNumber - sectionBoundaries.maximum - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));
303
+ }
304
+ if (newSectionValueNumber < sectionBoundaries.minimum) {
305
+ return getCleanValue(sectionBoundaries.maximum - (sectionBoundaries.minimum - newSectionValueNumber - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));
306
+ }
307
+ return getCleanValue(newSectionValueNumber);
308
+ };
309
+ const adjustLetterSection = () => {
310
+ const options = (0, _useField.getLetterEditingOptions)(adapter, timezone, section.type, section.format);
311
+ if (options.length === 0) {
312
+ return section.value;
313
+ }
314
+ if (shouldSetAbsolute) {
315
+ if (delta > 0 || isStart) {
316
+ return options[0];
317
+ }
318
+ return options[options.length - 1];
319
+ }
320
+ const currentOptionIndex = options.indexOf(section.value);
321
+ const newOptionIndex = (currentOptionIndex + delta) % options.length;
322
+ const clampedIndex = (newOptionIndex + options.length) % options.length;
323
+ return options[clampedIndex];
324
+ };
325
+ if (section.contentType === 'digit' || section.contentType === 'digit-with-letter') {
326
+ return adjustDigitSection();
327
+ }
328
+ return adjustLetterSection();
157
329
  }
@@ -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> {