@mui/x-date-pickers 9.6.0 → 9.7.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 (482) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.mts +2 -2
  2. package/AdapterDateFns/AdapterDateFns.d.ts +2 -2
  3. package/AdapterDateFnsBase/AdapterDateFnsBase.d.mts +2 -2
  4. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +2 -2
  5. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.mts +2 -2
  6. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -2
  7. package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.mts +1 -1
  8. package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts +1 -1
  9. package/AdapterDateFnsV2/AdapterDateFnsV2.d.mts +1 -1
  10. package/AdapterDateFnsV2/AdapterDateFnsV2.d.ts +1 -1
  11. package/AdapterDayjs/AdapterDayjs.d.mts +29 -29
  12. package/AdapterDayjs/AdapterDayjs.d.ts +29 -29
  13. package/AdapterDayjs/AdapterDayjs.mjs +1 -0
  14. package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.d.mts +4 -4
  15. package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.d.ts +4 -4
  16. package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.mjs +1 -0
  17. package/AdapterLuxon/AdapterLuxon.d.mts +1 -1
  18. package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
  19. package/AdapterMoment/AdapterMoment.d.mts +29 -28
  20. package/AdapterMoment/AdapterMoment.d.ts +29 -28
  21. package/AdapterMomentHijri/AdapterMomentHijri.d.mts +14 -13
  22. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +14 -13
  23. package/AdapterMomentHijri/AdapterMomentHijri.mjs +1 -0
  24. package/AdapterMomentJalaali/AdapterMomentJalaali.d.mts +13 -12
  25. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +13 -12
  26. package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +1 -0
  27. package/CHANGELOG.md +111 -1
  28. package/DateCalendar/DateCalendar.d.mts +1 -1
  29. package/DateCalendar/DateCalendar.d.ts +1 -1
  30. package/DateCalendar/DateCalendar.types.d.mts +16 -16
  31. package/DateCalendar/DateCalendar.types.d.ts +16 -16
  32. package/DateCalendar/DayCalendar.d.mts +9 -9
  33. package/DateCalendar/DayCalendar.d.ts +9 -9
  34. package/DateCalendar/PickersFadeTransitionGroup.d.mts +1 -1
  35. package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
  36. package/DateCalendar/PickersSlideTransition.d.mts +3 -3
  37. package/DateCalendar/PickersSlideTransition.d.ts +3 -3
  38. package/DateCalendar/useCalendarState.d.mts +3 -3
  39. package/DateCalendar/useCalendarState.d.ts +3 -3
  40. package/DateCalendar/useIsDateDisabled.d.mts +3 -3
  41. package/DateCalendar/useIsDateDisabled.d.ts +3 -3
  42. package/DateField/DateField.d.mts +1 -1
  43. package/DateField/DateField.d.ts +1 -1
  44. package/DateField/DateField.js +1 -0
  45. package/DateField/DateField.mjs +1 -0
  46. package/DateField/DateField.types.d.mts +6 -6
  47. package/DateField/DateField.types.d.ts +6 -6
  48. package/DateField/useDateField.d.mts +1 -1
  49. package/DateField/useDateField.d.ts +1 -1
  50. package/DatePicker/DatePicker.d.mts +1 -1
  51. package/DatePicker/DatePicker.d.ts +1 -1
  52. package/DatePicker/DatePicker.types.d.mts +4 -4
  53. package/DatePicker/DatePicker.types.d.ts +4 -4
  54. package/DatePicker/DatePickerToolbar.d.mts +2 -2
  55. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  56. package/DatePicker/shared.d.mts +10 -10
  57. package/DatePicker/shared.d.ts +10 -10
  58. package/DateTimeField/DateTimeField.d.mts +1 -1
  59. package/DateTimeField/DateTimeField.d.ts +1 -1
  60. package/DateTimeField/DateTimeField.js +1 -0
  61. package/DateTimeField/DateTimeField.mjs +1 -0
  62. package/DateTimeField/DateTimeField.types.d.mts +7 -7
  63. package/DateTimeField/DateTimeField.types.d.ts +7 -7
  64. package/DateTimeField/useDateTimeField.d.mts +1 -1
  65. package/DateTimeField/useDateTimeField.d.ts +1 -1
  66. package/DateTimePicker/DateTimePicker.d.mts +1 -1
  67. package/DateTimePicker/DateTimePicker.d.ts +1 -1
  68. package/DateTimePicker/DateTimePicker.types.d.mts +5 -5
  69. package/DateTimePicker/DateTimePicker.types.d.ts +5 -5
  70. package/DateTimePicker/DateTimePickerTabs.d.mts +2 -2
  71. package/DateTimePicker/DateTimePickerTabs.d.ts +2 -2
  72. package/DateTimePicker/DateTimePickerToolbar.d.mts +5 -5
  73. package/DateTimePicker/DateTimePickerToolbar.d.ts +5 -5
  74. package/DateTimePicker/shared.d.mts +15 -15
  75. package/DateTimePicker/shared.d.ts +15 -15
  76. package/DayCalendarSkeleton/DayCalendarSkeleton.d.mts +3 -3
  77. package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +3 -3
  78. package/DesktopDatePicker/DesktopDatePicker.d.mts +1 -1
  79. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
  80. package/DesktopDatePicker/DesktopDatePicker.types.d.mts +4 -4
  81. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +4 -4
  82. package/DesktopDateTimePicker/DesktopDateTimePicker.d.mts +1 -1
  83. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
  84. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.mts +6 -6
  85. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +6 -6
  86. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.mts +2 -2
  87. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +2 -2
  88. package/DesktopTimePicker/DesktopTimePicker.d.mts +1 -1
  89. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
  90. package/DesktopTimePicker/DesktopTimePicker.types.d.mts +8 -8
  91. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
  92. package/DigitalClock/DigitalClock.d.mts +1 -1
  93. package/DigitalClock/DigitalClock.d.ts +1 -1
  94. package/DigitalClock/DigitalClock.types.d.mts +6 -6
  95. package/DigitalClock/DigitalClock.types.d.ts +6 -6
  96. package/LocalizationProvider/LocalizationProvider.d.mts +2 -2
  97. package/LocalizationProvider/LocalizationProvider.d.ts +2 -2
  98. package/MobileDatePicker/MobileDatePicker.d.mts +1 -1
  99. package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
  100. package/MobileDatePicker/MobileDatePicker.types.d.mts +3 -3
  101. package/MobileDatePicker/MobileDatePicker.types.d.ts +3 -3
  102. package/MobileDateTimePicker/MobileDateTimePicker.d.mts +1 -1
  103. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
  104. package/MobileDateTimePicker/MobileDateTimePicker.types.d.mts +3 -3
  105. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +3 -3
  106. package/MobileTimePicker/MobileTimePicker.d.mts +2 -2
  107. package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
  108. package/MobileTimePicker/MobileTimePicker.types.d.mts +5 -5
  109. package/MobileTimePicker/MobileTimePicker.types.d.ts +5 -5
  110. package/MonthCalendar/MonthCalendar.d.mts +2 -2
  111. package/MonthCalendar/MonthCalendar.d.ts +2 -2
  112. package/MonthCalendar/MonthCalendar.types.d.mts +8 -8
  113. package/MonthCalendar/MonthCalendar.types.d.ts +8 -8
  114. package/MonthCalendar/MonthCalendarButton.d.mts +2 -2
  115. package/MonthCalendar/MonthCalendarButton.d.ts +2 -2
  116. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.mts +1 -1
  117. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -1
  118. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.mts +7 -7
  119. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +7 -7
  120. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.mts +2 -2
  121. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -2
  122. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.mts +3 -3
  123. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +3 -3
  124. package/PickerDay/PickerDay.d.mts +1 -1
  125. package/PickerDay/PickerDay.d.ts +1 -1
  126. package/PickerDay/PickerDay.types.d.mts +5 -5
  127. package/PickerDay/PickerDay.types.d.ts +5 -5
  128. package/PickersActionBar/PickersActionBar.d.mts +1 -1
  129. package/PickersActionBar/PickersActionBar.d.ts +1 -1
  130. package/PickersCalendarHeader/PickersCalendarHeader.d.mts +1 -1
  131. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -1
  132. package/PickersCalendarHeader/PickersCalendarHeader.types.d.mts +9 -9
  133. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
  134. package/PickersLayout/PickersLayout.d.mts +2 -2
  135. package/PickersLayout/PickersLayout.d.ts +2 -2
  136. package/PickersLayout/PickersLayout.types.d.mts +11 -11
  137. package/PickersLayout/PickersLayout.types.d.ts +11 -11
  138. package/PickersLayout/usePickerLayout.d.mts +2 -2
  139. package/PickersLayout/usePickerLayout.d.ts +2 -2
  140. package/PickersSectionList/PickersSectionList.types.d.mts +4 -4
  141. package/PickersSectionList/PickersSectionList.types.d.ts +4 -4
  142. package/PickersShortcuts/PickersShortcuts.d.mts +3 -3
  143. package/PickersShortcuts/PickersShortcuts.d.ts +3 -3
  144. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.mts +2 -2
  145. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +2 -2
  146. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -0
  147. package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +1 -0
  148. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.mts +1 -1
  149. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +1 -1
  150. package/PickersTextField/PickersInput/PickersInput.d.mts +2 -2
  151. package/PickersTextField/PickersInput/PickersInput.d.ts +2 -2
  152. package/PickersTextField/PickersInput/PickersInput.js +1 -0
  153. package/PickersTextField/PickersInput/PickersInput.mjs +1 -0
  154. package/PickersTextField/PickersInput/pickersInputClasses.d.mts +1 -1
  155. package/PickersTextField/PickersInput/pickersInputClasses.d.ts +1 -1
  156. package/PickersTextField/PickersInputBase/PickersInputBase.d.mts +2 -2
  157. package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
  158. package/PickersTextField/PickersInputBase/PickersInputBase.js +16 -1
  159. package/PickersTextField/PickersInputBase/PickersInputBase.mjs +16 -1
  160. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +6 -5
  161. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +6 -5
  162. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.mts +1 -1
  163. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +1 -1
  164. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +12 -8
  165. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +12 -8
  166. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.mts +1 -1
  167. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +1 -1
  168. package/PickersTextField/PickersTextField.js +4 -1
  169. package/PickersTextField/PickersTextField.mjs +4 -1
  170. package/PickersTextField/PickersTextField.types.d.mts +6 -6
  171. package/PickersTextField/PickersTextField.types.d.ts +6 -6
  172. package/PickersTextField/usePickerTextFieldOwnerState.d.mts +1 -1
  173. package/PickersTextField/usePickerTextFieldOwnerState.d.ts +1 -1
  174. package/StaticDatePicker/StaticDatePicker.d.mts +1 -1
  175. package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
  176. package/StaticDatePicker/StaticDatePicker.types.d.mts +3 -3
  177. package/StaticDatePicker/StaticDatePicker.types.d.ts +3 -3
  178. package/StaticDateTimePicker/StaticDateTimePicker.d.mts +1 -1
  179. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
  180. package/StaticDateTimePicker/StaticDateTimePicker.types.d.mts +3 -3
  181. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +3 -3
  182. package/StaticTimePicker/StaticTimePicker.d.mts +1 -1
  183. package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
  184. package/StaticTimePicker/StaticTimePicker.types.d.mts +4 -4
  185. package/StaticTimePicker/StaticTimePicker.types.d.ts +4 -4
  186. package/TimeClock/Clock.d.mts +5 -5
  187. package/TimeClock/Clock.d.ts +5 -5
  188. package/TimeClock/Clock.js +76 -30
  189. package/TimeClock/Clock.mjs +76 -30
  190. package/TimeClock/ClockNumber.d.mts +2 -2
  191. package/TimeClock/ClockNumber.d.ts +2 -2
  192. package/TimeClock/ClockNumbers.d.mts +1 -1
  193. package/TimeClock/ClockNumbers.d.ts +1 -1
  194. package/TimeClock/ClockPointer.d.mts +2 -2
  195. package/TimeClock/ClockPointer.d.ts +2 -2
  196. package/TimeClock/TimeClock.d.mts +1 -1
  197. package/TimeClock/TimeClock.d.ts +1 -1
  198. package/TimeClock/TimeClock.types.d.mts +5 -5
  199. package/TimeClock/TimeClock.types.d.ts +5 -5
  200. package/TimeField/TimeField.d.mts +1 -1
  201. package/TimeField/TimeField.d.ts +1 -1
  202. package/TimeField/TimeField.js +1 -0
  203. package/TimeField/TimeField.mjs +1 -0
  204. package/TimeField/TimeField.types.d.mts +7 -7
  205. package/TimeField/TimeField.types.d.ts +7 -7
  206. package/TimeField/useTimeField.d.mts +1 -1
  207. package/TimeField/useTimeField.d.ts +1 -1
  208. package/TimePicker/TimePicker.d.mts +1 -1
  209. package/TimePicker/TimePicker.d.ts +1 -1
  210. package/TimePicker/TimePicker.types.d.mts +4 -4
  211. package/TimePicker/TimePicker.types.d.ts +4 -4
  212. package/TimePicker/TimePickerToolbar.d.mts +2 -2
  213. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  214. package/TimePicker/shared.d.mts +11 -11
  215. package/TimePicker/shared.d.ts +11 -11
  216. package/YearCalendar/YearCalendar.d.mts +1 -1
  217. package/YearCalendar/YearCalendar.d.ts +1 -1
  218. package/YearCalendar/YearCalendar.types.d.mts +8 -8
  219. package/YearCalendar/YearCalendar.types.d.ts +8 -8
  220. package/YearCalendar/YearCalendarButton.d.mts +2 -2
  221. package/YearCalendar/YearCalendarButton.d.ts +2 -2
  222. package/dateViewRenderers/dateViewRenderers.d.mts +3 -3
  223. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  224. package/hooks/useIsValidValue.d.mts +1 -1
  225. package/hooks/useIsValidValue.d.ts +1 -1
  226. package/hooks/usePickerActionsContext.d.mts +2 -2
  227. package/hooks/usePickerActionsContext.d.ts +2 -2
  228. package/hooks/usePickerAdapter.d.mts +2 -2
  229. package/hooks/usePickerAdapter.d.ts +2 -2
  230. package/hooks/usePickerContext.d.mts +1 -1
  231. package/hooks/usePickerContext.d.ts +1 -1
  232. package/hooks/useSplitFieldProps.d.mts +1 -1
  233. package/hooks/useSplitFieldProps.d.ts +1 -1
  234. package/index.js +1 -1
  235. package/index.mjs +1 -1
  236. package/internals/components/PickerFieldUI.d.mts +7 -7
  237. package/internals/components/PickerFieldUI.d.ts +7 -7
  238. package/internals/components/PickerPopper/PickerPopper.d.mts +7 -7
  239. package/internals/components/PickerPopper/PickerPopper.d.ts +7 -7
  240. package/internals/components/PickerProvider.d.mts +6 -6
  241. package/internals/components/PickerProvider.d.ts +6 -6
  242. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.mts +1 -1
  243. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +1 -1
  244. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.mts +6 -6
  245. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +6 -6
  246. package/internals/components/PickersModalDialog.d.mts +3 -3
  247. package/internals/components/PickersModalDialog.d.ts +3 -3
  248. package/internals/components/PickersToolbar.d.mts +2 -2
  249. package/internals/components/PickersToolbar.d.ts +2 -2
  250. package/internals/components/PickersToolbarButton.d.mts +4 -4
  251. package/internals/components/PickersToolbarButton.d.ts +4 -4
  252. package/internals/components/PickersToolbarText.d.mts +2 -2
  253. package/internals/components/PickersToolbarText.d.ts +2 -2
  254. package/internals/demo/DemoContainer.d.mts +2 -2
  255. package/internals/demo/DemoContainer.d.ts +2 -2
  256. package/internals/hooks/PickerDay.types.d.mts +1 -1
  257. package/internals/hooks/PickerDay.types.d.ts +1 -1
  258. package/internals/hooks/date-helpers-hooks.d.mts +3 -3
  259. package/internals/hooks/date-helpers-hooks.d.ts +3 -3
  260. package/internals/hooks/useClockReferenceDate.d.mts +2 -2
  261. package/internals/hooks/useClockReferenceDate.d.ts +2 -2
  262. package/internals/hooks/useControlledValue.d.mts +2 -3
  263. package/internals/hooks/useControlledValue.d.ts +2 -3
  264. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +2 -2
  265. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
  266. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.mts +10 -10
  267. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +10 -10
  268. package/internals/hooks/useField/buildSectionsFromFormat.d.mts +2 -2
  269. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +2 -2
  270. package/internals/hooks/useField/syncSelectionToDOM.d.mts +3 -3
  271. package/internals/hooks/useField/syncSelectionToDOM.d.ts +3 -3
  272. package/internals/hooks/useField/useField.d.mts +2 -2
  273. package/internals/hooks/useField/useField.d.ts +2 -2
  274. package/internals/hooks/useField/useField.js +18 -0
  275. package/internals/hooks/useField/useField.mjs +18 -0
  276. package/internals/hooks/useField/useField.types.d.mts +5 -4
  277. package/internals/hooks/useField/useField.types.d.ts +5 -4
  278. package/internals/hooks/useField/useField.utils.d.mts +3 -4
  279. package/internals/hooks/useField/useField.utils.d.ts +3 -4
  280. package/internals/hooks/useField/useField.utils.js +1 -3
  281. package/internals/hooks/useField/useField.utils.mjs +0 -1
  282. package/internals/hooks/useField/useFieldCharacterEditing.d.mts +2 -2
  283. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -2
  284. package/internals/hooks/useField/useFieldHiddenInputProps.d.mts +2 -2
  285. package/internals/hooks/useField/useFieldHiddenInputProps.d.ts +2 -2
  286. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.mts +1 -1
  287. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +1 -1
  288. package/internals/hooks/useField/useFieldRootProps.d.mts +5 -4
  289. package/internals/hooks/useField/useFieldRootProps.d.ts +5 -4
  290. package/internals/hooks/useField/useFieldRootProps.js +95 -8
  291. package/internals/hooks/useField/useFieldRootProps.mjs +95 -8
  292. package/internals/hooks/useField/useFieldSectionContainerProps.d.mts +2 -2
  293. package/internals/hooks/useField/useFieldSectionContainerProps.d.ts +2 -2
  294. package/internals/hooks/useField/useFieldSectionContainerProps.js +35 -4
  295. package/internals/hooks/useField/useFieldSectionContainerProps.mjs +34 -4
  296. package/internals/hooks/useField/useFieldSectionContentProps.d.mts +6 -6
  297. package/internals/hooks/useField/useFieldSectionContentProps.d.ts +6 -6
  298. package/internals/hooks/useField/useFieldSectionContentProps.js +3 -1
  299. package/internals/hooks/useField/useFieldSectionContentProps.mjs +3 -1
  300. package/internals/hooks/useField/useFieldState.d.mts +3 -3
  301. package/internals/hooks/useField/useFieldState.d.ts +3 -3
  302. package/internals/hooks/useFieldOwnerState.d.mts +2 -2
  303. package/internals/hooks/useFieldOwnerState.d.ts +2 -2
  304. package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +2 -2
  305. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
  306. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.mts +10 -10
  307. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +10 -10
  308. package/internals/hooks/useNullableFieldPrivateContext.d.mts +2 -2
  309. package/internals/hooks/useNullableFieldPrivateContext.d.ts +2 -2
  310. package/internals/hooks/usePicker/hooks/useOrientation.d.mts +1 -1
  311. package/internals/hooks/usePicker/hooks/useOrientation.d.ts +1 -1
  312. package/internals/hooks/usePicker/hooks/useValueAndOpenStates.d.mts +5 -5
  313. package/internals/hooks/usePicker/hooks/useValueAndOpenStates.d.ts +5 -5
  314. package/internals/hooks/usePicker/usePicker.d.mts +2 -2
  315. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  316. package/internals/hooks/usePicker/usePicker.types.d.mts +10 -10
  317. package/internals/hooks/usePicker/usePicker.types.d.ts +10 -10
  318. package/internals/hooks/usePickerDayOwnerState.d.mts +2 -2
  319. package/internals/hooks/usePickerDayOwnerState.d.ts +2 -2
  320. package/internals/hooks/useReduceAnimations.js +4 -1
  321. package/internals/hooks/useReduceAnimations.mjs +4 -1
  322. package/internals/hooks/useStaticPicker/useStaticPicker.d.mts +2 -2
  323. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +2 -2
  324. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.mts +5 -5
  325. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +5 -5
  326. package/internals/hooks/useToolbarOwnerState.d.mts +1 -1
  327. package/internals/hooks/useToolbarOwnerState.d.ts +1 -1
  328. package/internals/hooks/useUtils.d.mts +1 -1
  329. package/internals/hooks/useUtils.d.ts +1 -1
  330. package/internals/hooks/useViews.d.mts +4 -4
  331. package/internals/hooks/useViews.d.ts +4 -4
  332. package/internals/models/common.d.mts +1 -1
  333. package/internals/models/common.d.ts +1 -1
  334. package/internals/models/fields.d.mts +1 -1
  335. package/internals/models/fields.d.ts +1 -1
  336. package/internals/models/helpers.d.mts +2 -2
  337. package/internals/models/helpers.d.ts +2 -2
  338. package/internals/models/manager.d.mts +1 -1
  339. package/internals/models/manager.d.ts +1 -1
  340. package/internals/models/props/basePickerProps.d.mts +7 -8
  341. package/internals/models/props/basePickerProps.d.ts +7 -8
  342. package/internals/models/props/tabs.d.mts +2 -2
  343. package/internals/models/props/tabs.d.ts +2 -2
  344. package/internals/models/props/time.d.mts +6 -6
  345. package/internals/models/props/time.d.ts +6 -6
  346. package/internals/models/props/toolbar.d.mts +3 -3
  347. package/internals/models/props/toolbar.d.ts +3 -3
  348. package/internals/models/value.d.mts +1 -1
  349. package/internals/models/value.d.ts +1 -1
  350. package/internals/utils/createNonRangePickerStepNavigation.d.mts +1 -1
  351. package/internals/utils/createNonRangePickerStepNavigation.d.ts +1 -1
  352. package/internals/utils/createStepNavigation.d.mts +1 -1
  353. package/internals/utils/createStepNavigation.d.ts +1 -1
  354. package/internals/utils/date-time-utils.d.mts +4 -4
  355. package/internals/utils/date-time-utils.d.ts +4 -4
  356. package/internals/utils/date-utils.d.mts +2 -2
  357. package/internals/utils/date-utils.d.ts +2 -2
  358. package/internals/utils/getDefaultReferenceDate.d.mts +1 -1
  359. package/internals/utils/getDefaultReferenceDate.d.ts +1 -1
  360. package/internals/utils/time-utils.d.mts +2 -2
  361. package/internals/utils/time-utils.d.ts +2 -2
  362. package/internals/utils/utils.d.mts +3 -3
  363. package/internals/utils/utils.d.ts +3 -3
  364. package/internals/utils/valueManagers.d.mts +2 -3
  365. package/internals/utils/valueManagers.d.ts +2 -3
  366. package/internals/utils/views.d.mts +1 -1
  367. package/internals/utils/views.d.ts +1 -1
  368. package/locales/beBY.d.mts +1 -1
  369. package/locales/beBY.d.ts +1 -1
  370. package/locales/bgBG.d.mts +1 -1
  371. package/locales/bgBG.d.ts +1 -1
  372. package/locales/bnBD.d.mts +1 -1
  373. package/locales/bnBD.d.ts +1 -1
  374. package/locales/caES.d.mts +1 -1
  375. package/locales/caES.d.ts +1 -1
  376. package/locales/csCZ.d.mts +1 -1
  377. package/locales/csCZ.d.ts +1 -1
  378. package/locales/daDK.d.mts +1 -1
  379. package/locales/daDK.d.ts +1 -1
  380. package/locales/deDE.d.mts +1 -1
  381. package/locales/deDE.d.ts +1 -1
  382. package/locales/elGR.d.mts +1 -1
  383. package/locales/elGR.d.ts +1 -1
  384. package/locales/enUS.d.mts +1 -1
  385. package/locales/enUS.d.ts +1 -1
  386. package/locales/esES.d.mts +1 -1
  387. package/locales/esES.d.ts +1 -1
  388. package/locales/eu.d.mts +1 -1
  389. package/locales/eu.d.ts +1 -1
  390. package/locales/faIR.d.mts +1 -1
  391. package/locales/faIR.d.ts +1 -1
  392. package/locales/fiFI.d.mts +1 -1
  393. package/locales/fiFI.d.ts +1 -1
  394. package/locales/frFR.d.mts +1 -1
  395. package/locales/frFR.d.ts +1 -1
  396. package/locales/heIL.d.mts +1 -1
  397. package/locales/heIL.d.ts +1 -1
  398. package/locales/hrHR.d.mts +1 -1
  399. package/locales/hrHR.d.ts +1 -1
  400. package/locales/huHU.d.mts +1 -1
  401. package/locales/huHU.d.ts +1 -1
  402. package/locales/isIS.d.mts +1 -1
  403. package/locales/isIS.d.ts +1 -1
  404. package/locales/itIT.d.mts +1 -1
  405. package/locales/itIT.d.ts +1 -1
  406. package/locales/jaJP.d.mts +1 -1
  407. package/locales/jaJP.d.ts +1 -1
  408. package/locales/koKR.d.mts +1 -1
  409. package/locales/koKR.d.ts +1 -1
  410. package/locales/kzKZ.d.mts +1 -1
  411. package/locales/kzKZ.d.ts +1 -1
  412. package/locales/nbNO.d.mts +1 -1
  413. package/locales/nbNO.d.ts +1 -1
  414. package/locales/nlNL.d.mts +1 -1
  415. package/locales/nlNL.d.ts +1 -1
  416. package/locales/nnNO.d.mts +1 -1
  417. package/locales/nnNO.d.ts +1 -1
  418. package/locales/plPL.d.mts +1 -1
  419. package/locales/plPL.d.ts +1 -1
  420. package/locales/ptBR.d.mts +1 -1
  421. package/locales/ptBR.d.ts +1 -1
  422. package/locales/ptPT.d.mts +1 -1
  423. package/locales/ptPT.d.ts +1 -1
  424. package/locales/roRO.d.mts +1 -1
  425. package/locales/roRO.d.ts +1 -1
  426. package/locales/ruRU.d.mts +1 -1
  427. package/locales/ruRU.d.ts +1 -1
  428. package/locales/skSK.d.mts +1 -1
  429. package/locales/skSK.d.ts +1 -1
  430. package/locales/svSE.d.mts +1 -1
  431. package/locales/svSE.d.ts +1 -1
  432. package/locales/thTH.d.mts +1 -1
  433. package/locales/thTH.d.ts +1 -1
  434. package/locales/trTR.d.mts +1 -1
  435. package/locales/trTR.d.ts +1 -1
  436. package/locales/ukUA.d.mts +1 -1
  437. package/locales/ukUA.d.ts +1 -1
  438. package/locales/urPK.d.mts +1 -1
  439. package/locales/urPK.d.ts +1 -1
  440. package/locales/utils/getPickersLocalization.d.mts +1 -1
  441. package/locales/utils/getPickersLocalization.d.ts +1 -1
  442. package/locales/utils/pickersLocaleTextApi.d.mts +2 -2
  443. package/locales/utils/pickersLocaleTextApi.d.ts +2 -2
  444. package/locales/viVN.d.mts +1 -1
  445. package/locales/viVN.d.ts +1 -1
  446. package/locales/zhCN.d.mts +1 -1
  447. package/locales/zhCN.d.ts +1 -1
  448. package/locales/zhHK.d.mts +1 -1
  449. package/locales/zhHK.d.ts +1 -1
  450. package/locales/zhTW.d.mts +1 -1
  451. package/locales/zhTW.d.ts +1 -1
  452. package/managers/useDateManager.d.mts +4 -4
  453. package/managers/useDateManager.d.ts +4 -4
  454. package/managers/useDateTimeManager.d.mts +5 -5
  455. package/managers/useDateTimeManager.d.ts +5 -5
  456. package/managers/useTimeManager.d.mts +5 -5
  457. package/managers/useTimeManager.d.ts +5 -5
  458. package/models/adapters.d.mts +3 -3
  459. package/models/adapters.d.ts +3 -3
  460. package/models/fields.d.mts +4 -4
  461. package/models/fields.d.ts +4 -4
  462. package/models/pickers.d.mts +1 -1
  463. package/models/pickers.d.ts +1 -1
  464. package/package.json +3 -3
  465. package/themeAugmentation/components.d.mts +16 -16
  466. package/themeAugmentation/components.d.ts +16 -16
  467. package/themeAugmentation/overrides.d.mts +20 -20
  468. package/themeAugmentation/overrides.d.ts +20 -20
  469. package/themeAugmentation/props.d.mts +38 -38
  470. package/themeAugmentation/props.d.ts +38 -38
  471. package/timeViewRenderers/timeViewRenderers.d.mts +6 -6
  472. package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
  473. package/validation/extractValidationProps.d.mts +1 -1
  474. package/validation/extractValidationProps.d.ts +1 -1
  475. package/validation/useValidation.d.mts +2 -3
  476. package/validation/useValidation.d.ts +2 -3
  477. package/validation/validateDate.d.mts +4 -4
  478. package/validation/validateDate.d.ts +4 -4
  479. package/validation/validateDateTime.d.mts +6 -6
  480. package/validation/validateDateTime.d.ts +6 -6
  481. package/validation/validateTime.d.mts +4 -4
  482. package/validation/validateTime.d.ts +4 -4
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import type { PickerSelectionState } from "../internals/hooks/usePicker/index.mjs";
3
- import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.mjs";
4
- import { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.mjs";
5
- import { ClockClasses } from "./clockClasses.mjs";
6
- import { Meridiem } from "../internals/utils/time-utils.mjs";
7
- import { FormProps } from "../internals/models/formProps.mjs";
3
+ import type { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.mjs";
4
+ import type { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.mjs";
5
+ import type { ClockClasses } from "./clockClasses.mjs";
6
+ import type { Meridiem } from "../internals/utils/time-utils.mjs";
7
+ import type { FormProps } from "../internals/models/formProps.mjs";
8
8
  export interface ClockProps extends ReturnType<typeof useMeridiemMode>, FormProps {
9
9
  ampm: boolean;
10
10
  ampmInClock: boolean;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import type { PickerSelectionState } from "../internals/hooks/usePicker/index.js";
3
- import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
4
- import { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.js";
5
- import { ClockClasses } from "./clockClasses.js";
6
- import { Meridiem } from "../internals/utils/time-utils.js";
7
- import { FormProps } from "../internals/models/formProps.js";
3
+ import type { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
4
+ import type { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.js";
5
+ import type { ClockClasses } from "./clockClasses.js";
6
+ import type { Meridiem } from "../internals/utils/time-utils.js";
7
+ import type { FormProps } from "../internals/models/formProps.js";
8
8
  export interface ClockProps extends ReturnType<typeof useMeridiemMode>, FormProps {
9
9
  ampm: boolean;
10
10
  ampmInClock: boolean;
@@ -14,6 +14,8 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
14
14
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
15
  var _styles = require("@mui/material/styles");
16
16
  var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
17
+ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
18
+ var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"));
17
19
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
18
20
  var _ClockPointer = require("./ClockPointer");
19
21
  var _hooks = require("../hooks");
@@ -194,6 +196,9 @@ function Clock(inProps) {
194
196
  clockMeridiemMode: meridiemMode
195
197
  });
196
198
  const isMoving = React.useRef(false);
199
+ const activePointerIdRef = React.useRef(null);
200
+ const squareMaskRef = React.useRef(null);
201
+ const removeDragListenersRef = React.useRef(undefined);
197
202
  const classes = useUtilityClasses(classesProp, ownerState);
198
203
  const isSelectedTimeDisabled = isTimeDisabled(viewValue, type);
199
204
  const isPointerInner = !ampm && type === 'hours' && (viewValue < 1 || viewValue > 12);
@@ -207,40 +212,81 @@ function Clock(inProps) {
207
212
  onChange(newValue, isFinish);
208
213
  };
209
214
  const setTime = (event, isFinish) => {
210
- let {
211
- offsetX,
212
- offsetY
213
- } = event;
214
- if (offsetX === undefined) {
215
- const rect = event.target.getBoundingClientRect();
216
- offsetX = event.changedTouches[0].clientX - rect.left;
217
- offsetY = event.changedTouches[0].clientY - rect.top;
215
+ const mask = squareMaskRef.current;
216
+ // The document-level listeners can briefly outlive the mask during unmount:
217
+ // React detaches refs before the cleanup effect removes the listeners, so a
218
+ // pointer event firing in that window would otherwise dereference a null ref.
219
+ if (!mask) {
220
+ return;
218
221
  }
222
+
223
+ // Resolve the pointer coordinates relative to the clock mask rather than from
224
+ // `offsetX`/`offsetY`: the `pointermove`/`pointerup` listeners live on the
225
+ // document (see `handlePointerDown`), so the event target can be any element
226
+ // once the pointer leaves the clock.
227
+ const rect = mask.getBoundingClientRect();
228
+ const offsetX = event.clientX - rect.left;
229
+ const offsetY = event.clientY - rect.top;
219
230
  const newSelectedValue = type === 'seconds' || type === 'minutes' ? (0, _shared.getMinutes)(offsetX, offsetY, minutesStep) : (0, _shared.getHours)(offsetX, offsetY, Boolean(ampm));
220
231
  handleValueChange(newSelectedValue, isFinish);
221
232
  };
222
- const handleTouchSelection = event => {
223
- isMoving.current = true;
224
- setTime(event, 'shallow');
233
+
234
+ // Pointer events are the single source of truth for mouse, touch and pen. The
235
+ // move/up/cancel listeners are attached to the document so a drag keeps
236
+ // tracking and commits even when the pointer is released outside the clock.
237
+ const stopTracking = () => {
238
+ isMoving.current = false;
239
+ activePointerIdRef.current = null;
240
+ // Idempotent: the cleanup clears its own ref, so calling `stopTracking` twice
241
+ // (e.g. a `pointercancel` racing a `pointerup`) is a safe no-op.
242
+ removeDragListenersRef.current?.();
225
243
  };
226
- const handleTouchEnd = event => {
227
- if (isMoving.current) {
228
- setTime(event, 'finish');
229
- isMoving.current = false;
244
+ const handleDocumentPointerMove = (0, _useEventCallback.default)(event => {
245
+ if (event.pointerId !== activePointerIdRef.current) {
246
+ return;
230
247
  }
231
248
  event.preventDefault();
232
- };
233
- const handleMouseMove = event => {
234
- // event.buttons & PRIMARY_MOUSE_BUTTON
235
- if (event.buttons > 0) {
236
- setTime(event.nativeEvent, 'shallow');
249
+ setTime(event, 'shallow');
250
+ });
251
+ const handleDocumentPointerUp = (0, _useEventCallback.default)(event => {
252
+ if (event.pointerId !== activePointerIdRef.current) {
253
+ return;
237
254
  }
238
- };
239
- const handleMouseUp = event => {
240
- if (isMoving.current) {
241
- isMoving.current = false;
255
+ stopTracking();
256
+ setTime(event, 'finish');
257
+ });
258
+ const handleDocumentPointerCancel = (0, _useEventCallback.default)(event => {
259
+ if (event.pointerId !== activePointerIdRef.current) {
260
+ return;
261
+ }
262
+ // The gesture was interrupted by the user agent: drop it without committing.
263
+ stopTracking();
264
+ });
265
+ const handlePointerDown = event => {
266
+ // Ignore secondary buttons (middle = 1, right = 2), secondary multi-touch
267
+ // pointers and interactions that can't change the value. `> 0` rather than
268
+ // `!== 0` keeps the gesture permissive when `event.button` is left unset by a
269
+ // synthetic event (some test environments), matching `useDragRange`.
270
+ if (event.button > 0 || event.isPrimary === false || disabled || readOnly) {
271
+ return;
242
272
  }
243
- setTime(event.nativeEvent, 'finish');
273
+
274
+ // A fresh primary pointerdown ends any previous gesture whose pointerup was
275
+ // lost, fully resetting its state before starting the new one.
276
+ stopTracking();
277
+ isMoving.current = true;
278
+ activePointerIdRef.current = event.pointerId;
279
+ const doc = (0, _ownerDocument.default)(squareMaskRef.current);
280
+ doc.addEventListener('pointermove', handleDocumentPointerMove);
281
+ doc.addEventListener('pointerup', handleDocumentPointerUp);
282
+ doc.addEventListener('pointercancel', handleDocumentPointerCancel);
283
+ removeDragListenersRef.current = () => {
284
+ doc.removeEventListener('pointermove', handleDocumentPointerMove);
285
+ doc.removeEventListener('pointerup', handleDocumentPointerUp);
286
+ doc.removeEventListener('pointercancel', handleDocumentPointerCancel);
287
+ removeDragListenersRef.current = undefined;
288
+ };
289
+ setTime(event.nativeEvent, 'shallow');
244
290
  };
245
291
  const isPointerBetweenTwoClockValues = type === 'hours' ? false : viewValue % 5 !== 0;
246
292
  const keyboardControlStep = type === 'minutes' ? minutesStep : 1;
@@ -253,6 +299,9 @@ function Clock(inProps) {
253
299
  listboxRef.current.focus();
254
300
  }
255
301
  }, [autoFocus]);
302
+
303
+ // Clean up the document-level pointer listeners if the clock unmounts mid-drag.
304
+ React.useEffect(() => () => removeDragListenersRef.current?.(), []);
256
305
  const clampValue = newValue => Math.max(minViewValue, Math.min(maxViewValue, newValue));
257
306
  const circleValue = newValue => (newValue + (maxViewValue + 1)) % (maxViewValue + 1);
258
307
  const handleKeyDown = event => {
@@ -300,11 +349,8 @@ function Clock(inProps) {
300
349
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ClockClock, {
301
350
  className: classes.clock,
302
351
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ClockSquareMask, {
303
- onTouchMove: handleTouchSelection,
304
- onTouchStart: handleTouchSelection,
305
- onTouchEnd: handleTouchEnd,
306
- onMouseUp: handleMouseUp,
307
- onMouseMove: handleMouseMove,
352
+ ref: squareMaskRef,
353
+ onPointerDown: handlePointerDown,
308
354
  ownerState: ownerState,
309
355
  className: classes.squareMask
310
356
  }), !isSelectedTimeDisabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
@@ -7,6 +7,8 @@ import IconButton from '@mui/material/IconButton';
7
7
  import Typography from '@mui/material/Typography';
8
8
  import { styled, useThemeProps } from '@mui/material/styles';
9
9
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
10
+ import useEventCallback from '@mui/utils/useEventCallback';
11
+ import ownerDocument from '@mui/utils/ownerDocument';
10
12
  import composeClasses from '@mui/utils/composeClasses';
11
13
  import { ClockPointer } from "./ClockPointer.mjs";
12
14
  import { usePickerAdapter, usePickerTranslations } from "../hooks/index.mjs";
@@ -187,6 +189,9 @@ export function Clock(inProps) {
187
189
  clockMeridiemMode: meridiemMode
188
190
  });
189
191
  const isMoving = React.useRef(false);
192
+ const activePointerIdRef = React.useRef(null);
193
+ const squareMaskRef = React.useRef(null);
194
+ const removeDragListenersRef = React.useRef(undefined);
190
195
  const classes = useUtilityClasses(classesProp, ownerState);
191
196
  const isSelectedTimeDisabled = isTimeDisabled(viewValue, type);
192
197
  const isPointerInner = !ampm && type === 'hours' && (viewValue < 1 || viewValue > 12);
@@ -200,40 +205,81 @@ export function Clock(inProps) {
200
205
  onChange(newValue, isFinish);
201
206
  };
202
207
  const setTime = (event, isFinish) => {
203
- let {
204
- offsetX,
205
- offsetY
206
- } = event;
207
- if (offsetX === undefined) {
208
- const rect = event.target.getBoundingClientRect();
209
- offsetX = event.changedTouches[0].clientX - rect.left;
210
- offsetY = event.changedTouches[0].clientY - rect.top;
208
+ const mask = squareMaskRef.current;
209
+ // The document-level listeners can briefly outlive the mask during unmount:
210
+ // React detaches refs before the cleanup effect removes the listeners, so a
211
+ // pointer event firing in that window would otherwise dereference a null ref.
212
+ if (!mask) {
213
+ return;
211
214
  }
215
+
216
+ // Resolve the pointer coordinates relative to the clock mask rather than from
217
+ // `offsetX`/`offsetY`: the `pointermove`/`pointerup` listeners live on the
218
+ // document (see `handlePointerDown`), so the event target can be any element
219
+ // once the pointer leaves the clock.
220
+ const rect = mask.getBoundingClientRect();
221
+ const offsetX = event.clientX - rect.left;
222
+ const offsetY = event.clientY - rect.top;
212
223
  const newSelectedValue = type === 'seconds' || type === 'minutes' ? getMinutes(offsetX, offsetY, minutesStep) : getHours(offsetX, offsetY, Boolean(ampm));
213
224
  handleValueChange(newSelectedValue, isFinish);
214
225
  };
215
- const handleTouchSelection = event => {
216
- isMoving.current = true;
217
- setTime(event, 'shallow');
226
+
227
+ // Pointer events are the single source of truth for mouse, touch and pen. The
228
+ // move/up/cancel listeners are attached to the document so a drag keeps
229
+ // tracking and commits even when the pointer is released outside the clock.
230
+ const stopTracking = () => {
231
+ isMoving.current = false;
232
+ activePointerIdRef.current = null;
233
+ // Idempotent: the cleanup clears its own ref, so calling `stopTracking` twice
234
+ // (e.g. a `pointercancel` racing a `pointerup`) is a safe no-op.
235
+ removeDragListenersRef.current?.();
218
236
  };
219
- const handleTouchEnd = event => {
220
- if (isMoving.current) {
221
- setTime(event, 'finish');
222
- isMoving.current = false;
237
+ const handleDocumentPointerMove = useEventCallback(event => {
238
+ if (event.pointerId !== activePointerIdRef.current) {
239
+ return;
223
240
  }
224
241
  event.preventDefault();
225
- };
226
- const handleMouseMove = event => {
227
- // event.buttons & PRIMARY_MOUSE_BUTTON
228
- if (event.buttons > 0) {
229
- setTime(event.nativeEvent, 'shallow');
242
+ setTime(event, 'shallow');
243
+ });
244
+ const handleDocumentPointerUp = useEventCallback(event => {
245
+ if (event.pointerId !== activePointerIdRef.current) {
246
+ return;
230
247
  }
231
- };
232
- const handleMouseUp = event => {
233
- if (isMoving.current) {
234
- isMoving.current = false;
248
+ stopTracking();
249
+ setTime(event, 'finish');
250
+ });
251
+ const handleDocumentPointerCancel = useEventCallback(event => {
252
+ if (event.pointerId !== activePointerIdRef.current) {
253
+ return;
254
+ }
255
+ // The gesture was interrupted by the user agent: drop it without committing.
256
+ stopTracking();
257
+ });
258
+ const handlePointerDown = event => {
259
+ // Ignore secondary buttons (middle = 1, right = 2), secondary multi-touch
260
+ // pointers and interactions that can't change the value. `> 0` rather than
261
+ // `!== 0` keeps the gesture permissive when `event.button` is left unset by a
262
+ // synthetic event (some test environments), matching `useDragRange`.
263
+ if (event.button > 0 || event.isPrimary === false || disabled || readOnly) {
264
+ return;
235
265
  }
236
- setTime(event.nativeEvent, 'finish');
266
+
267
+ // A fresh primary pointerdown ends any previous gesture whose pointerup was
268
+ // lost, fully resetting its state before starting the new one.
269
+ stopTracking();
270
+ isMoving.current = true;
271
+ activePointerIdRef.current = event.pointerId;
272
+ const doc = ownerDocument(squareMaskRef.current);
273
+ doc.addEventListener('pointermove', handleDocumentPointerMove);
274
+ doc.addEventListener('pointerup', handleDocumentPointerUp);
275
+ doc.addEventListener('pointercancel', handleDocumentPointerCancel);
276
+ removeDragListenersRef.current = () => {
277
+ doc.removeEventListener('pointermove', handleDocumentPointerMove);
278
+ doc.removeEventListener('pointerup', handleDocumentPointerUp);
279
+ doc.removeEventListener('pointercancel', handleDocumentPointerCancel);
280
+ removeDragListenersRef.current = undefined;
281
+ };
282
+ setTime(event.nativeEvent, 'shallow');
237
283
  };
238
284
  const isPointerBetweenTwoClockValues = type === 'hours' ? false : viewValue % 5 !== 0;
239
285
  const keyboardControlStep = type === 'minutes' ? minutesStep : 1;
@@ -246,6 +292,9 @@ export function Clock(inProps) {
246
292
  listboxRef.current.focus();
247
293
  }
248
294
  }, [autoFocus]);
295
+
296
+ // Clean up the document-level pointer listeners if the clock unmounts mid-drag.
297
+ React.useEffect(() => () => removeDragListenersRef.current?.(), []);
249
298
  const clampValue = newValue => Math.max(minViewValue, Math.min(maxViewValue, newValue));
250
299
  const circleValue = newValue => (newValue + (maxViewValue + 1)) % (maxViewValue + 1);
251
300
  const handleKeyDown = event => {
@@ -293,11 +342,8 @@ export function Clock(inProps) {
293
342
  children: [/*#__PURE__*/_jsxs(ClockClock, {
294
343
  className: classes.clock,
295
344
  children: [/*#__PURE__*/_jsx(ClockSquareMask, {
296
- onTouchMove: handleTouchSelection,
297
- onTouchStart: handleTouchSelection,
298
- onTouchEnd: handleTouchEnd,
299
- onMouseUp: handleMouseUp,
300
- onMouseMove: handleMouseMove,
345
+ ref: squareMaskRef,
346
+ onPointerDown: handlePointerDown,
301
347
  ownerState: ownerState,
302
348
  className: classes.squareMask
303
349
  }), !isSelectedTimeDisabled && /*#__PURE__*/_jsxs(React.Fragment, {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { ClockNumberClasses } from "./clockNumberClasses.mjs";
3
- import { PickerOwnerState } from "../models/pickers.mjs";
2
+ import type { ClockNumberClasses } from "./clockNumberClasses.mjs";
3
+ import type { PickerOwnerState } from "../models/pickers.mjs";
4
4
  export interface ClockNumberProps extends React.HTMLAttributes<HTMLSpanElement> {
5
5
  'aria-label': string;
6
6
  disabled: boolean;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { ClockNumberClasses } from "./clockNumberClasses.js";
3
- import { PickerOwnerState } from "../models/pickers.js";
2
+ import type { ClockNumberClasses } from "./clockNumberClasses.js";
3
+ import type { PickerOwnerState } from "../models/pickers.js";
4
4
  export interface ClockNumberProps extends React.HTMLAttributes<HTMLSpanElement> {
5
5
  'aria-label': string;
6
6
  disabled: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { MuiPickersAdapter, PickerValidDate } from "../models/index.mjs";
2
+ import type { MuiPickersAdapter, PickerValidDate } from "../models/index.mjs";
3
3
  import type { PickerSelectionState } from "../internals/hooks/usePicker/index.mjs";
4
4
  interface GetHourNumbersOptions {
5
5
  ampm: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { MuiPickersAdapter, PickerValidDate } from "../models/index.js";
2
+ import type { MuiPickersAdapter, PickerValidDate } from "../models/index.js";
3
3
  import type { PickerSelectionState } from "../internals/hooks/usePicker/index.js";
4
4
  interface GetHourNumbersOptions {
5
5
  ampm: boolean;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PickerOwnerState, TimeView } from "../models/index.mjs";
3
- import { ClockPointerClasses } from "./clockPointerClasses.mjs";
2
+ import type { PickerOwnerState, TimeView } from "../models/index.mjs";
3
+ import type { ClockPointerClasses } from "./clockPointerClasses.mjs";
4
4
  export interface ClockPointerProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  /**
6
6
  * `true` if the pointer is between two clock values.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PickerOwnerState, TimeView } from "../models/index.js";
3
- import { ClockPointerClasses } from "./clockPointerClasses.js";
2
+ import type { PickerOwnerState, TimeView } from "../models/index.js";
3
+ import type { ClockPointerClasses } from "./clockPointerClasses.js";
4
4
  export interface ClockPointerProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  /**
6
6
  * `true` if the pointer is between two clock values.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimeClockProps } from "./TimeClock.types.mjs";
2
+ import type { TimeClockProps } from "./TimeClock.types.mjs";
3
3
  type TimeClockComponent = ((props: TimeClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimeClockProps } from "./TimeClock.types.js";
2
+ import type { TimeClockProps } from "./TimeClock.types.js";
3
3
  type TimeClockComponent = ((props: TimeClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -1,8 +1,8 @@
1
- import { TimeClockClasses } from "./timeClockClasses.mjs";
2
- import { PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from "../internals/components/PickersArrowSwitcher/index.mjs";
3
- import { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.mjs";
4
- import { TimeView } from "../models/index.mjs";
5
- import { TimeViewWithMeridiem } from "../internals/models/index.mjs";
1
+ import type { TimeClockClasses } from "./timeClockClasses.mjs";
2
+ import type { PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from "../internals/components/PickersArrowSwitcher/index.mjs";
3
+ import type { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.mjs";
4
+ import type { TimeView } from "../models/index.mjs";
5
+ import type { TimeViewWithMeridiem } from "../internals/models/index.mjs";
6
6
  export interface ExportedTimeClockProps extends ExportedBaseClockProps {
7
7
  /**
8
8
  * Display ampm controls under the clock (instead of in the toolbar).
@@ -1,8 +1,8 @@
1
- import { TimeClockClasses } from "./timeClockClasses.js";
2
- import { PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from "../internals/components/PickersArrowSwitcher/index.js";
3
- import { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.js";
4
- import { TimeView } from "../models/index.js";
5
- import { TimeViewWithMeridiem } from "../internals/models/index.js";
1
+ import type { TimeClockClasses } from "./timeClockClasses.js";
2
+ import type { PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from "../internals/components/PickersArrowSwitcher/index.js";
3
+ import type { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.js";
4
+ import type { TimeView } from "../models/index.js";
5
+ import type { TimeViewWithMeridiem } from "../internals/models/index.js";
6
6
  export interface ExportedTimeClockProps extends ExportedBaseClockProps {
7
7
  /**
8
8
  * Display ampm controls under the clock (instead of in the toolbar).
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimeFieldProps } from "./TimeField.types.mjs";
2
+ import type { TimeFieldProps } from "./TimeField.types.mjs";
3
3
  type TimeFieldComponent = ((props: TimeFieldProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimeFieldProps } from "./TimeField.types.js";
2
+ import type { TimeFieldProps } from "./TimeField.types.js";
3
3
  type TimeFieldComponent = ((props: TimeFieldProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -226,6 +226,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes /* remove-proptypes
226
226
  onFocus: _propTypes.default.func,
227
227
  onInput: _propTypes.default.func,
228
228
  onKeyDown: _propTypes.default.func,
229
+ onMouseDown: _propTypes.default.func,
229
230
  onPaste: _propTypes.default.func,
230
231
  /**
231
232
  * Callback fired when the selected sections change.
@@ -219,6 +219,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes /* remove-proptypes
219
219
  onFocus: PropTypes.func,
220
220
  onInput: PropTypes.func,
221
221
  onKeyDown: PropTypes.func,
222
+ onMouseDown: PropTypes.func,
222
223
  onPaste: PropTypes.func,
223
224
  /**
224
225
  * Callback fired when the selected sections change.
@@ -1,10 +1,10 @@
1
- import { MakeOptional } from '@mui/x-internals/types';
2
- import { UseFieldInternalProps } from "../internals/hooks/useField/index.mjs";
3
- import { TimeValidationError, BuiltInFieldTextFieldProps } from "../models/index.mjs";
4
- import { ExportedValidateTimeProps } from "../validation/validateTime.mjs";
5
- import { AmPmProps } from "../internals/models/props/time.mjs";
6
- import { PickerValue } from "../internals/models/index.mjs";
7
- import { ExportedPickerFieldUIProps, PickerFieldUISlotProps, PickerFieldUISlots } from "../internals/components/PickerFieldUI.mjs";
1
+ import type { MakeOptional } from '@mui/x-internals/types';
2
+ import type { UseFieldInternalProps } from "../internals/hooks/useField/index.mjs";
3
+ import type { TimeValidationError, BuiltInFieldTextFieldProps } from "../models/index.mjs";
4
+ import type { ExportedValidateTimeProps } from "../validation/validateTime.mjs";
5
+ import type { AmPmProps } from "../internals/models/props/time.mjs";
6
+ import type { PickerValue } from "../internals/models/index.mjs";
7
+ import type { ExportedPickerFieldUIProps, PickerFieldUISlotProps, PickerFieldUISlots } from "../internals/components/PickerFieldUI.mjs";
8
8
  export interface UseTimeFieldProps extends MakeOptional<UseFieldInternalProps<PickerValue, TimeValidationError>, 'format'>, ExportedValidateTimeProps, ExportedPickerFieldUIProps, AmPmProps {}
9
9
  export type TimeFieldProps = UseTimeFieldProps & Omit<BuiltInFieldTextFieldProps, keyof UseTimeFieldProps> & {
10
10
  /**
@@ -1,10 +1,10 @@
1
- import { MakeOptional } from '@mui/x-internals/types';
2
- import { UseFieldInternalProps } from "../internals/hooks/useField/index.js";
3
- import { TimeValidationError, BuiltInFieldTextFieldProps } from "../models/index.js";
4
- import { ExportedValidateTimeProps } from "../validation/validateTime.js";
5
- import { AmPmProps } from "../internals/models/props/time.js";
6
- import { PickerValue } from "../internals/models/index.js";
7
- import { ExportedPickerFieldUIProps, PickerFieldUISlotProps, PickerFieldUISlots } from "../internals/components/PickerFieldUI.js";
1
+ import type { MakeOptional } from '@mui/x-internals/types';
2
+ import type { UseFieldInternalProps } from "../internals/hooks/useField/index.js";
3
+ import type { TimeValidationError, BuiltInFieldTextFieldProps } from "../models/index.js";
4
+ import type { ExportedValidateTimeProps } from "../validation/validateTime.js";
5
+ import type { AmPmProps } from "../internals/models/props/time.js";
6
+ import type { PickerValue } from "../internals/models/index.js";
7
+ import type { ExportedPickerFieldUIProps, PickerFieldUISlotProps, PickerFieldUISlots } from "../internals/components/PickerFieldUI.js";
8
8
  export interface UseTimeFieldProps extends MakeOptional<UseFieldInternalProps<PickerValue, TimeValidationError>, 'format'>, ExportedValidateTimeProps, ExportedPickerFieldUIProps, AmPmProps {}
9
9
  export type TimeFieldProps = UseTimeFieldProps & Omit<BuiltInFieldTextFieldProps, keyof UseTimeFieldProps> & {
10
10
  /**
@@ -1,2 +1,2 @@
1
- import { UseTimeFieldProps } from "./TimeField.types.mjs";
1
+ import type { UseTimeFieldProps } from "./TimeField.types.mjs";
2
2
  export declare const useTimeField: <TProps extends UseTimeFieldProps>(props: TProps) => import("../internals/index.mjs").UseFieldReturnValue<TProps>;
@@ -1,2 +1,2 @@
1
- import { UseTimeFieldProps } from "./TimeField.types.js";
1
+ import type { UseTimeFieldProps } from "./TimeField.types.js";
2
2
  export declare const useTimeField: <TProps extends UseTimeFieldProps>(props: TProps) => import("../internals/index.js").UseFieldReturnValue<TProps>;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimePickerProps } from "./TimePicker.types.mjs";
2
+ import type { TimePickerProps } from "./TimePicker.types.mjs";
3
3
  type TimePickerComponent = ((props: TimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TimePickerProps } from "./TimePicker.types.js";
2
+ import type { TimePickerProps } from "./TimePicker.types.js";
3
3
  type TimePickerComponent = ((props: TimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
@@ -1,7 +1,7 @@
1
- import { DesktopTimePickerProps, DesktopTimePickerSlots, DesktopTimePickerSlotProps } from "../DesktopTimePicker/index.mjs";
2
- import { BaseSingleInputFieldProps, TimeViewWithMeridiem } from "../internals/models/index.mjs";
3
- import { MobileTimePickerProps, MobileTimePickerSlots, MobileTimePickerSlotProps } from "../MobileTimePicker/index.mjs";
4
- import { ValidateTimeProps } from "../validation/validateTime.mjs";
1
+ import type { DesktopTimePickerProps, DesktopTimePickerSlots, DesktopTimePickerSlotProps } from "../DesktopTimePicker/index.mjs";
2
+ import type { BaseSingleInputFieldProps, TimeViewWithMeridiem } from "../internals/models/index.mjs";
3
+ import type { MobileTimePickerProps, MobileTimePickerSlots, MobileTimePickerSlotProps } from "../MobileTimePicker/index.mjs";
4
+ import type { ValidateTimeProps } from "../validation/validateTime.mjs";
5
5
  export interface TimePickerSlots extends DesktopTimePickerSlots, MobileTimePickerSlots {}
6
6
  export interface TimePickerSlotProps extends DesktopTimePickerSlotProps, MobileTimePickerSlotProps {}
7
7
  export interface TimePickerProps extends DesktopTimePickerProps, Omit<MobileTimePickerProps<TimeViewWithMeridiem>, 'views'> {
@@ -1,7 +1,7 @@
1
- import { DesktopTimePickerProps, DesktopTimePickerSlots, DesktopTimePickerSlotProps } from "../DesktopTimePicker/index.js";
2
- import { BaseSingleInputFieldProps, TimeViewWithMeridiem } from "../internals/models/index.js";
3
- import { MobileTimePickerProps, MobileTimePickerSlots, MobileTimePickerSlotProps } from "../MobileTimePicker/index.js";
4
- import { ValidateTimeProps } from "../validation/validateTime.js";
1
+ import type { DesktopTimePickerProps, DesktopTimePickerSlots, DesktopTimePickerSlotProps } from "../DesktopTimePicker/index.js";
2
+ import type { BaseSingleInputFieldProps, TimeViewWithMeridiem } from "../internals/models/index.js";
3
+ import type { MobileTimePickerProps, MobileTimePickerSlots, MobileTimePickerSlotProps } from "../MobileTimePicker/index.js";
4
+ import type { ValidateTimeProps } from "../validation/validateTime.js";
5
5
  export interface TimePickerSlots extends DesktopTimePickerSlots, MobileTimePickerSlots {}
6
6
  export interface TimePickerSlotProps extends DesktopTimePickerSlotProps, MobileTimePickerSlotProps {}
7
7
  export interface TimePickerProps extends DesktopTimePickerProps, Omit<MobileTimePickerProps<TimeViewWithMeridiem>, 'views'> {
@@ -1,5 +1,5 @@
1
- import { BaseToolbarProps, ExportedBaseToolbarProps } from "../internals/models/props/toolbar.mjs";
2
- import { TimePickerToolbarClasses } from "./timePickerToolbarClasses.mjs";
1
+ import type { BaseToolbarProps, ExportedBaseToolbarProps } from "../internals/models/props/toolbar.mjs";
2
+ import type { TimePickerToolbarClasses } from "./timePickerToolbarClasses.mjs";
3
3
  export interface TimePickerToolbarProps extends BaseToolbarProps, ExportedTimePickerToolbarProps {
4
4
  ampm?: boolean;
5
5
  ampmInClock?: boolean;
@@ -1,5 +1,5 @@
1
- import { BaseToolbarProps, ExportedBaseToolbarProps } from "../internals/models/props/toolbar.js";
2
- import { TimePickerToolbarClasses } from "./timePickerToolbarClasses.js";
1
+ import type { BaseToolbarProps, ExportedBaseToolbarProps } from "../internals/models/props/toolbar.js";
2
+ import type { TimePickerToolbarClasses } from "./timePickerToolbarClasses.js";
3
3
  export interface TimePickerToolbarProps extends BaseToolbarProps, ExportedTimePickerToolbarProps {
4
4
  ampm?: boolean;
5
5
  ampmInClock?: boolean;
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { DefaultizedProps } from '@mui/x-internals/types';
3
- import { TimeClockSlots, TimeClockSlotProps } from "../TimeClock/TimeClock.types.mjs";
4
- import { BasePickerInputProps } from "../internals/models/props/basePickerProps.mjs";
5
- import { LocalizedComponent } from "../locales/utils/pickersLocaleTextApi.mjs";
6
- import { TimePickerToolbarProps, ExportedTimePickerToolbarProps } from "./TimePickerToolbar.mjs";
7
- import { TimeValidationError } from "../models/index.mjs";
8
- import { PickerViewRendererLookup } from "../internals/hooks/usePicker/index.mjs";
9
- import { TimeViewRendererProps } from "../timeViewRenderers/index.mjs";
10
- import { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.mjs";
11
- import { PickerValue, TimeViewWithMeridiem } from "../internals/models/index.mjs";
12
- import { ValidateTimePropsToDefault } from "../validation/validateTime.mjs";
2
+ import type { DefaultizedProps } from '@mui/x-internals/types';
3
+ import type { TimeClockSlots, TimeClockSlotProps } from "../TimeClock/TimeClock.types.mjs";
4
+ import type { BasePickerInputProps } from "../internals/models/props/basePickerProps.mjs";
5
+ import type { LocalizedComponent } from "../locales/utils/pickersLocaleTextApi.mjs";
6
+ import type { TimePickerToolbarProps, ExportedTimePickerToolbarProps } from "./TimePickerToolbar.mjs";
7
+ import type { TimeValidationError } from "../models/index.mjs";
8
+ import type { PickerViewRendererLookup } from "../internals/hooks/usePicker/index.mjs";
9
+ import type { TimeViewRendererProps } from "../timeViewRenderers/index.mjs";
10
+ import type { BaseClockProps, ExportedBaseClockProps } from "../internals/models/props/time.mjs";
11
+ import type { PickerValue, TimeViewWithMeridiem } from "../internals/models/index.mjs";
12
+ import type { ValidateTimePropsToDefault } from "../validation/validateTime.mjs";
13
13
  export interface BaseTimePickerSlots extends TimeClockSlots {
14
14
  /**
15
15
  * Custom component for the toolbar rendered above the views.