@mui/x-date-pickers 8.0.0-alpha.0 → 8.0.0-alpha.10

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 (584) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +2 -4
  2. package/AdapterDateFns/AdapterDateFns.js +49 -47
  3. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +1 -1
  4. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -4
  5. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +48 -46
  6. package/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts} +2 -2
  7. package/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +45 -52
  8. package/AdapterDateFnsJalaliV2/index.d.ts +1 -0
  9. package/AdapterDateFnsJalaliV2/index.js +1 -0
  10. package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/package.json +1 -1
  11. package/{AdapterDateFnsV3/AdapterDateFnsV3.d.ts → AdapterDateFnsV2/AdapterDateFnsV2.d.ts} +2 -2
  12. package/{AdapterDateFnsV3/AdapterDateFnsV3.js → AdapterDateFnsV2/AdapterDateFnsV2.js} +46 -54
  13. package/AdapterDateFnsV2/index.d.ts +1 -0
  14. package/AdapterDateFnsV2/index.js +1 -0
  15. package/{AdapterDateFnsV3 → AdapterDateFnsV2}/package.json +1 -1
  16. package/AdapterDayjs/AdapterDayjs.d.ts +1 -1
  17. package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
  18. package/AdapterMoment/AdapterMoment.d.ts +1 -1
  19. package/AdapterMoment/AdapterMoment.js +10 -0
  20. package/CHANGELOG.md +2215 -119
  21. package/DateCalendar/DateCalendar.js +5 -4
  22. package/DateCalendar/DateCalendar.types.d.ts +2 -1
  23. package/DateCalendar/DayCalendar.js +2 -0
  24. package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
  25. package/DateCalendar/PickersFadeTransitionGroup.js +4 -6
  26. package/DateCalendar/PickersSlideTransition.d.ts +1 -1
  27. package/DateCalendar/PickersSlideTransition.js +12 -5
  28. package/DateCalendar/useCalendarState.d.ts +6 -4
  29. package/DateField/DateField.js +29 -33
  30. package/DateField/DateField.types.d.ts +7 -15
  31. package/DateField/useDateField.d.ts +1 -1
  32. package/DateField/useDateField.js +14 -11
  33. package/DatePicker/DatePicker.js +1 -1
  34. package/DatePicker/DatePicker.types.d.ts +7 -3
  35. package/DatePicker/DatePickerToolbar.d.ts +1 -2
  36. package/DatePicker/DatePickerToolbar.js +17 -45
  37. package/DatePicker/shared.d.ts +6 -5
  38. package/DateTimeField/DateTimeField.js +29 -33
  39. package/DateTimeField/DateTimeField.types.d.ts +7 -16
  40. package/DateTimeField/useDateTimeField.d.ts +1 -1
  41. package/DateTimeField/useDateTimeField.js +14 -11
  42. package/DateTimePicker/DateTimePicker.js +2 -2
  43. package/DateTimePicker/DateTimePicker.types.d.ts +4 -5
  44. package/DateTimePicker/DateTimePickerTabs.d.ts +2 -5
  45. package/DateTimePicker/DateTimePickerTabs.js +15 -20
  46. package/DateTimePicker/DateTimePickerToolbar.d.ts +16 -5
  47. package/DateTimePicker/DateTimePickerToolbar.js +92 -93
  48. package/DateTimePicker/shared.d.ts +8 -8
  49. package/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
  50. package/DesktopDatePicker/DesktopDatePicker.js +11 -17
  51. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -3
  52. package/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
  53. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -2
  54. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +2 -2
  55. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +9 -46
  56. package/DesktopTimePicker/DesktopTimePicker.js +6 -22
  57. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -2
  58. package/DigitalClock/DigitalClock.js +14 -11
  59. package/DigitalClock/DigitalClock.types.d.ts +8 -2
  60. package/MobileDatePicker/MobileDatePicker.js +4 -14
  61. package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -3
  62. package/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
  63. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +4 -4
  64. package/MobileTimePicker/MobileTimePicker.js +4 -14
  65. package/MobileTimePicker/MobileTimePicker.types.d.ts +4 -4
  66. package/MonthCalendar/MonthCalendar.d.ts +1 -1
  67. package/MonthCalendar/MonthCalendar.js +32 -11
  68. package/MonthCalendar/MonthCalendar.types.d.ts +2 -2
  69. package/MonthCalendar/MonthCalendarButton.d.ts +24 -0
  70. package/{modern/MonthCalendar/PickersMonth.js → MonthCalendar/MonthCalendarButton.js} +20 -61
  71. package/MonthCalendar/index.d.ts +0 -3
  72. package/MonthCalendar/index.js +1 -2
  73. package/MonthCalendar/monthCalendarClasses.d.ts +7 -1
  74. package/MonthCalendar/monthCalendarClasses.js +1 -1
  75. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -7
  76. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +6 -6
  77. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +4 -4
  78. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +14 -10
  79. package/PickersActionBar/PickersActionBar.d.ts +6 -7
  80. package/PickersActionBar/PickersActionBar.js +26 -17
  81. package/PickersCalendarHeader/PickersCalendarHeader.js +10 -7
  82. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -4
  83. package/PickersLayout/PickersLayout.d.ts +7 -5
  84. package/PickersLayout/PickersLayout.js +23 -54
  85. package/PickersLayout/PickersLayout.types.d.ts +20 -22
  86. package/PickersLayout/usePickerLayout.d.ts +5 -4
  87. package/PickersLayout/usePickerLayout.js +26 -57
  88. package/PickersSectionList/PickersSectionList.js +21 -16
  89. package/PickersSectionList/PickersSectionList.types.d.ts +13 -6
  90. package/PickersShortcuts/PickersShortcuts.d.ts +9 -11
  91. package/PickersShortcuts/PickersShortcuts.js +21 -11
  92. package/PickersShortcuts/index.d.ts +1 -1
  93. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +7 -0
  94. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
  95. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +1 -1
  96. package/PickersTextField/PickersInput/PickersInput.js +20 -14
  97. package/PickersTextField/PickersInput/pickersInputClasses.d.ts +3 -2
  98. package/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
  99. package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +3 -6
  100. package/PickersTextField/PickersInputBase/PickersInputBase.js +51 -44
  101. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +1 -0
  102. package/PickersTextField/PickersOutlinedInput/Outline.d.ts +0 -1
  103. package/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
  104. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
  105. package/PickersTextField/PickersTextField.js +75 -62
  106. package/PickersTextField/PickersTextField.types.d.ts +43 -4
  107. package/PickersTextField/usePickerTextFieldOwnerState.d.ts +4 -0
  108. package/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
  109. package/README.md +10 -7
  110. package/StaticDatePicker/StaticDatePicker.js +2 -2
  111. package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -3
  112. package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  113. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -2
  114. package/StaticTimePicker/StaticTimePicker.js +2 -2
  115. package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -2
  116. package/TimeClock/Clock.d.ts +4 -0
  117. package/TimeClock/Clock.js +28 -27
  118. package/TimeClock/ClockNumber.js +15 -11
  119. package/TimeClock/ClockPointer.d.ts +6 -1
  120. package/TimeClock/ClockPointer.js +16 -10
  121. package/TimeClock/TimeClock.js +31 -12
  122. package/TimeField/TimeField.js +28 -32
  123. package/TimeField/TimeField.types.d.ts +7 -16
  124. package/TimeField/useTimeField.d.ts +1 -1
  125. package/TimeField/useTimeField.js +14 -11
  126. package/TimePicker/TimePicker.js +2 -2
  127. package/TimePicker/TimePicker.types.d.ts +4 -5
  128. package/TimePicker/TimePickerToolbar.d.ts +1 -3
  129. package/TimePicker/TimePickerToolbar.js +40 -64
  130. package/TimePicker/shared.d.ts +6 -6
  131. package/YearCalendar/YearCalendar.js +47 -13
  132. package/YearCalendar/YearCalendar.types.d.ts +2 -2
  133. package/YearCalendar/YearCalendarButton.d.ts +23 -0
  134. package/{modern/YearCalendar/PickersYear.js → YearCalendar/YearCalendarButton.js} +20 -59
  135. package/YearCalendar/index.d.ts +0 -3
  136. package/YearCalendar/index.js +1 -2
  137. package/YearCalendar/yearCalendarClasses.d.ts +7 -1
  138. package/YearCalendar/yearCalendarClasses.js +1 -1
  139. package/hooks/index.d.ts +2 -0
  140. package/hooks/index.js +3 -1
  141. package/hooks/useClearableField.d.ts +5 -3
  142. package/hooks/useClearableField.js +4 -2
  143. package/hooks/useIsValidValue.d.ts +7 -0
  144. package/hooks/useIsValidValue.js +11 -0
  145. package/hooks/useParsedFormat.d.ts +9 -7
  146. package/hooks/useParsedFormat.js +11 -13
  147. package/hooks/usePickerActionsContext.d.ts +7 -0
  148. package/hooks/usePickerActionsContext.js +15 -0
  149. package/hooks/usePickerContext.d.ts +5 -1
  150. package/hooks/usePickerContext.js +2 -2
  151. package/hooks/useSplitFieldProps.d.ts +15 -6
  152. package/hooks/useSplitFieldProps.js +8 -3
  153. package/index.d.ts +1 -0
  154. package/index.js +3 -2
  155. package/internals/components/PickerFieldUI.d.ts +133 -0
  156. package/internals/components/PickerFieldUI.js +317 -0
  157. package/internals/components/{PickersPopper.d.ts → PickerPopper/PickerPopper.d.ts} +26 -25
  158. package/{modern/internals/components/PickersPopper.js → internals/components/PickerPopper/PickerPopper.js} +47 -47
  159. package/internals/components/PickerPopper/index.d.ts +4 -0
  160. package/internals/components/PickerPopper/index.js +2 -0
  161. package/internals/components/PickerPopper/pickerPopperClasses.d.ts +9 -0
  162. package/internals/components/PickerPopper/pickerPopperClasses.js +6 -0
  163. package/internals/components/PickerProvider.d.ts +94 -14
  164. package/internals/components/PickerProvider.js +28 -8
  165. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
  166. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +11 -8
  167. package/internals/components/PickersModalDialog.d.ts +1 -3
  168. package/internals/components/PickersModalDialog.js +9 -3
  169. package/internals/components/PickersToolbar.d.ts +2 -3
  170. package/internals/components/PickersToolbar.js +16 -15
  171. package/internals/components/PickersToolbarButton.js +4 -6
  172. package/internals/components/PickersToolbarText.js +11 -13
  173. package/internals/hooks/date-helpers-hooks.js +4 -3
  174. package/internals/hooks/useClockReferenceDate.d.ts +2 -1
  175. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
  176. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +36 -121
  177. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +16 -38
  178. package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  179. package/internals/hooks/useField/index.d.ts +2 -0
  180. package/internals/hooks/useField/index.js +2 -1
  181. package/internals/hooks/useField/useField.d.ts +3 -3
  182. package/internals/hooks/useField/useField.js +17 -4
  183. package/internals/hooks/useField/useField.types.d.ts +56 -49
  184. package/internals/hooks/useField/useField.utils.d.ts +4 -3
  185. package/internals/hooks/useField/useField.utils.js +2 -2
  186. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +6 -5
  187. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +15 -0
  188. package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +47 -0
  189. package/internals/hooks/useField/useFieldState.d.ts +9 -8
  190. package/internals/hooks/useField/useFieldState.js +3 -3
  191. package/internals/hooks/useField/useFieldV6TextField.d.ts +4 -3
  192. package/internals/hooks/useField/useFieldV6TextField.js +5 -2
  193. package/internals/hooks/useField/useFieldV7TextField.js +8 -4
  194. package/internals/hooks/useFieldOwnerState.d.ts +6 -0
  195. package/internals/hooks/useFieldOwnerState.js +16 -0
  196. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
  197. package/internals/hooks/useMobilePicker/useMobilePicker.js +35 -69
  198. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +15 -22
  199. package/internals/hooks/useNullablePickerContext.d.ts +5 -0
  200. package/internals/hooks/useNullablePickerContext.js +10 -0
  201. package/internals/hooks/useOpenState.d.ts +3 -2
  202. package/internals/hooks/useOpenState.js +11 -9
  203. package/internals/hooks/usePicker/index.d.ts +1 -1
  204. package/internals/hooks/usePicker/usePicker.d.ts +3 -4
  205. package/internals/hooks/usePicker/usePicker.js +10 -29
  206. package/internals/hooks/usePicker/usePicker.types.d.ts +11 -11
  207. package/internals/hooks/usePicker/usePickerProvider.d.ts +58 -7
  208. package/internals/hooks/usePicker/usePickerProvider.js +102 -12
  209. package/internals/hooks/usePicker/usePickerValue.d.ts +3 -2
  210. package/internals/hooks/usePicker/usePickerValue.js +100 -218
  211. package/internals/hooks/usePicker/usePickerValue.types.d.ts +135 -79
  212. package/internals/hooks/usePicker/usePickerViews.d.ts +59 -40
  213. package/internals/hooks/usePicker/usePickerViews.js +31 -19
  214. package/internals/hooks/useReduceAnimations.d.ts +2 -0
  215. package/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +5 -2
  216. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
  217. package/internals/hooks/useStaticPicker/useStaticPicker.js +8 -13
  218. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +7 -13
  219. package/internals/hooks/useToolbarOwnerState.d.ts +10 -0
  220. package/internals/hooks/useToolbarOwnerState.js +13 -0
  221. package/internals/hooks/useUtils.d.ts +4 -3
  222. package/internals/hooks/useUtils.js +1 -1
  223. package/internals/hooks/useValueWithTimezone.d.ts +20 -15
  224. package/internals/hooks/useValueWithTimezone.js +13 -1
  225. package/internals/hooks/useViews.d.ts +5 -5
  226. package/internals/index.d.ts +28 -19
  227. package/internals/index.js +13 -8
  228. package/internals/models/common.d.ts +2 -1
  229. package/internals/models/fields.d.ts +8 -24
  230. package/internals/models/index.d.ts +1 -0
  231. package/internals/models/index.js +2 -1
  232. package/internals/models/manager.d.ts +15 -0
  233. package/internals/models/manager.js +1 -0
  234. package/internals/models/pickers.d.ts +1 -0
  235. package/internals/models/pickers.js +1 -0
  236. package/internals/models/props/basePickerProps.d.ts +3 -33
  237. package/internals/models/props/tabs.d.ts +0 -13
  238. package/internals/models/props/time.d.ts +2 -1
  239. package/internals/models/props/toolbar.d.ts +1 -20
  240. package/internals/models/value.d.ts +9 -0
  241. package/internals/utils/date-utils.d.ts +3 -3
  242. package/internals/utils/date-utils.js +1 -1
  243. package/internals/utils/utils.d.ts +3 -0
  244. package/internals/utils/utils.js +11 -1
  245. package/internals/utils/valueManagers.d.ts +4 -3
  246. package/internals/utils/valueManagers.js +4 -4
  247. package/locales/index.d.ts +1 -0
  248. package/locales/index.js +1 -0
  249. package/locales/nbNO.js +15 -19
  250. package/locales/nlNL.js +7 -7
  251. package/locales/roRO.js +15 -18
  252. package/locales/utils/getPickersLocalization.d.ts +0 -7
  253. package/locales/utils/getPickersLocalization.js +0 -13
  254. package/locales/zhTW.d.ts +80 -0
  255. package/locales/zhTW.js +73 -0
  256. package/managers/index.d.ts +6 -0
  257. package/managers/index.js +3 -0
  258. package/managers/package.json +6 -0
  259. package/managers/useDateManager.d.ts +27 -0
  260. package/managers/useDateManager.js +55 -0
  261. package/managers/useDateTimeManager.d.ts +28 -0
  262. package/managers/useDateTimeManager.js +60 -0
  263. package/managers/useTimeManager.d.ts +28 -0
  264. package/managers/useTimeManager.js +51 -0
  265. package/models/adapters.d.ts +5 -5
  266. package/models/common.d.ts +1 -0
  267. package/models/fields.d.ts +33 -10
  268. package/models/index.d.ts +1 -0
  269. package/models/index.js +1 -0
  270. package/models/manager.d.ts +87 -0
  271. package/models/manager.js +1 -0
  272. package/models/pickers.d.ts +25 -0
  273. package/models/validation.d.ts +2 -1
  274. package/modern/AdapterDateFns/AdapterDateFns.js +49 -47
  275. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +48 -46
  276. package/modern/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +45 -52
  277. package/modern/AdapterDateFnsJalaliV2/index.js +1 -0
  278. package/modern/{AdapterDateFnsV3/AdapterDateFnsV3.js → AdapterDateFnsV2/AdapterDateFnsV2.js} +46 -54
  279. package/modern/AdapterDateFnsV2/index.js +1 -0
  280. package/modern/AdapterMoment/AdapterMoment.js +10 -0
  281. package/modern/DateCalendar/DateCalendar.js +5 -4
  282. package/modern/DateCalendar/DayCalendar.js +2 -0
  283. package/modern/DateCalendar/PickersFadeTransitionGroup.js +4 -6
  284. package/modern/DateCalendar/PickersSlideTransition.js +12 -5
  285. package/modern/DateField/DateField.js +29 -33
  286. package/modern/DateField/useDateField.js +14 -11
  287. package/modern/DatePicker/DatePicker.js +1 -1
  288. package/modern/DatePicker/DatePickerToolbar.js +17 -45
  289. package/modern/DateTimeField/DateTimeField.js +29 -33
  290. package/modern/DateTimeField/useDateTimeField.js +14 -11
  291. package/modern/DateTimePicker/DateTimePicker.js +2 -2
  292. package/modern/DateTimePicker/DateTimePickerTabs.js +15 -20
  293. package/modern/DateTimePicker/DateTimePickerToolbar.js +92 -93
  294. package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
  295. package/modern/DesktopDatePicker/DesktopDatePicker.js +11 -17
  296. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
  297. package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +9 -46
  298. package/modern/DesktopTimePicker/DesktopTimePicker.js +6 -22
  299. package/modern/DigitalClock/DigitalClock.js +14 -11
  300. package/modern/MobileDatePicker/MobileDatePicker.js +4 -14
  301. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
  302. package/modern/MobileTimePicker/MobileTimePicker.js +4 -14
  303. package/modern/MonthCalendar/MonthCalendar.js +32 -11
  304. package/{MonthCalendar/PickersMonth.js → modern/MonthCalendar/MonthCalendarButton.js} +20 -61
  305. package/modern/MonthCalendar/index.js +1 -2
  306. package/modern/MonthCalendar/monthCalendarClasses.js +1 -1
  307. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -7
  308. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +14 -10
  309. package/modern/PickersActionBar/PickersActionBar.js +26 -17
  310. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +10 -7
  311. package/modern/PickersLayout/PickersLayout.js +23 -54
  312. package/modern/PickersLayout/usePickerLayout.js +26 -57
  313. package/modern/PickersSectionList/PickersSectionList.js +21 -16
  314. package/modern/PickersShortcuts/PickersShortcuts.js +21 -11
  315. package/modern/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
  316. package/modern/PickersTextField/PickersInput/PickersInput.js +20 -14
  317. package/modern/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
  318. package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +51 -44
  319. package/modern/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
  320. package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
  321. package/modern/PickersTextField/PickersTextField.js +75 -62
  322. package/modern/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
  323. package/modern/StaticDatePicker/StaticDatePicker.js +2 -2
  324. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  325. package/modern/StaticTimePicker/StaticTimePicker.js +2 -2
  326. package/modern/TimeClock/Clock.js +28 -27
  327. package/modern/TimeClock/ClockNumber.js +15 -11
  328. package/modern/TimeClock/ClockPointer.js +16 -10
  329. package/modern/TimeClock/TimeClock.js +31 -12
  330. package/modern/TimeField/TimeField.js +28 -32
  331. package/modern/TimeField/useTimeField.js +14 -11
  332. package/modern/TimePicker/TimePicker.js +2 -2
  333. package/modern/TimePicker/TimePickerToolbar.js +40 -64
  334. package/modern/YearCalendar/YearCalendar.js +47 -13
  335. package/{YearCalendar/PickersYear.js → modern/YearCalendar/YearCalendarButton.js} +20 -59
  336. package/modern/YearCalendar/index.js +1 -2
  337. package/modern/YearCalendar/yearCalendarClasses.js +1 -1
  338. package/modern/hooks/index.js +3 -1
  339. package/modern/hooks/useClearableField.js +4 -2
  340. package/modern/hooks/useIsValidValue.js +11 -0
  341. package/modern/hooks/useParsedFormat.js +11 -13
  342. package/modern/hooks/usePickerActionsContext.js +15 -0
  343. package/modern/hooks/usePickerContext.js +2 -2
  344. package/modern/hooks/useSplitFieldProps.js +8 -3
  345. package/modern/index.js +3 -2
  346. package/modern/internals/components/PickerFieldUI.js +317 -0
  347. package/{internals/components/PickersPopper.js → modern/internals/components/PickerPopper/PickerPopper.js} +47 -47
  348. package/modern/internals/components/PickerPopper/index.js +2 -0
  349. package/modern/internals/components/PickerPopper/pickerPopperClasses.js +6 -0
  350. package/modern/internals/components/PickerProvider.js +28 -8
  351. package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
  352. package/modern/internals/components/PickersModalDialog.js +9 -3
  353. package/modern/internals/components/PickersToolbar.js +16 -15
  354. package/modern/internals/components/PickersToolbarButton.js +4 -6
  355. package/modern/internals/components/PickersToolbarText.js +11 -13
  356. package/modern/internals/hooks/date-helpers-hooks.js +4 -3
  357. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +36 -121
  358. package/modern/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  359. package/modern/internals/hooks/useField/index.js +2 -1
  360. package/modern/internals/hooks/useField/useField.js +17 -4
  361. package/modern/internals/hooks/useField/useField.utils.js +2 -2
  362. package/modern/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +47 -0
  363. package/modern/internals/hooks/useField/useFieldState.js +3 -3
  364. package/modern/internals/hooks/useField/useFieldV6TextField.js +5 -2
  365. package/modern/internals/hooks/useField/useFieldV7TextField.js +8 -4
  366. package/modern/internals/hooks/useFieldOwnerState.js +16 -0
  367. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +35 -69
  368. package/modern/internals/hooks/useNullablePickerContext.js +10 -0
  369. package/modern/internals/hooks/useOpenState.js +11 -9
  370. package/modern/internals/hooks/usePicker/usePicker.js +10 -29
  371. package/modern/internals/hooks/usePicker/usePickerProvider.js +102 -12
  372. package/modern/internals/hooks/usePicker/usePickerValue.js +100 -218
  373. package/modern/internals/hooks/usePicker/usePickerViews.js +31 -19
  374. package/modern/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +5 -2
  375. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +8 -13
  376. package/modern/internals/hooks/useToolbarOwnerState.js +13 -0
  377. package/modern/internals/hooks/useUtils.js +1 -1
  378. package/modern/internals/hooks/useValueWithTimezone.js +13 -1
  379. package/modern/internals/index.js +13 -8
  380. package/modern/internals/models/index.js +2 -1
  381. package/modern/internals/models/manager.js +1 -0
  382. package/modern/internals/models/pickers.js +1 -0
  383. package/modern/internals/utils/date-utils.js +1 -1
  384. package/modern/internals/utils/utils.js +11 -1
  385. package/modern/internals/utils/valueManagers.js +4 -4
  386. package/modern/locales/index.js +1 -0
  387. package/modern/locales/nbNO.js +15 -19
  388. package/modern/locales/nlNL.js +7 -7
  389. package/modern/locales/roRO.js +15 -18
  390. package/modern/locales/utils/getPickersLocalization.js +0 -13
  391. package/modern/locales/zhTW.js +73 -0
  392. package/modern/managers/index.js +3 -0
  393. package/modern/managers/useDateManager.js +55 -0
  394. package/modern/managers/useDateTimeManager.js +60 -0
  395. package/modern/managers/useTimeManager.js +51 -0
  396. package/modern/models/index.js +1 -0
  397. package/modern/models/manager.js +1 -0
  398. package/modern/validation/useValidation.js +1 -1
  399. package/modern/validation/validateDate.js +8 -0
  400. package/modern/validation/validateDateTime.js +8 -0
  401. package/modern/validation/validateTime.js +8 -0
  402. package/node/AdapterDateFns/AdapterDateFns.js +97 -97
  403. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +97 -96
  404. package/node/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +94 -101
  405. package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
  406. package/node/AdapterDateFnsV2/AdapterDateFnsV2.js +291 -0
  407. package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
  408. package/node/AdapterMoment/AdapterMoment.js +10 -0
  409. package/node/DateCalendar/DateCalendar.js +5 -4
  410. package/node/DateCalendar/DayCalendar.js +1 -0
  411. package/node/DateCalendar/PickersFadeTransitionGroup.js +4 -6
  412. package/node/DateCalendar/PickersSlideTransition.js +12 -5
  413. package/node/DateField/DateField.js +29 -33
  414. package/node/DateField/useDateField.js +13 -10
  415. package/node/DatePicker/DatePicker.js +1 -1
  416. package/node/DatePicker/DatePickerToolbar.js +17 -45
  417. package/node/DateTimeField/DateTimeField.js +29 -33
  418. package/node/DateTimeField/useDateTimeField.js +13 -10
  419. package/node/DateTimePicker/DateTimePicker.js +2 -2
  420. package/node/DateTimePicker/DateTimePickerTabs.js +15 -20
  421. package/node/DateTimePicker/DateTimePickerToolbar.js +93 -93
  422. package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
  423. package/node/DesktopDatePicker/DesktopDatePicker.js +11 -17
  424. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
  425. package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -47
  426. package/node/DesktopTimePicker/DesktopTimePicker.js +6 -22
  427. package/node/DigitalClock/DigitalClock.js +14 -11
  428. package/node/MobileDatePicker/MobileDatePicker.js +4 -14
  429. package/node/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
  430. package/node/MobileTimePicker/MobileTimePicker.js +4 -14
  431. package/node/MonthCalendar/MonthCalendar.js +32 -11
  432. package/node/MonthCalendar/{PickersMonth.js → MonthCalendarButton.js} +20 -61
  433. package/node/MonthCalendar/index.js +1 -8
  434. package/node/MonthCalendar/monthCalendarClasses.js +1 -1
  435. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -7
  436. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  437. package/node/PickersActionBar/PickersActionBar.js +28 -19
  438. package/node/PickersCalendarHeader/PickersCalendarHeader.js +10 -7
  439. package/node/PickersLayout/PickersLayout.js +23 -54
  440. package/node/PickersLayout/usePickerLayout.js +30 -61
  441. package/node/PickersSectionList/PickersSectionList.js +21 -16
  442. package/node/PickersShortcuts/PickersShortcuts.js +21 -11
  443. package/node/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
  444. package/node/PickersTextField/PickersInput/PickersInput.js +20 -14
  445. package/node/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
  446. package/node/PickersTextField/PickersInputBase/PickersInputBase.js +51 -44
  447. package/node/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
  448. package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
  449. package/node/PickersTextField/PickersTextField.js +75 -62
  450. package/node/PickersTextField/usePickerTextFieldOwnerState.js +18 -0
  451. package/node/StaticDatePicker/StaticDatePicker.js +2 -2
  452. package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  453. package/node/StaticTimePicker/StaticTimePicker.js +2 -2
  454. package/node/TimeClock/Clock.js +28 -27
  455. package/node/TimeClock/ClockNumber.js +15 -11
  456. package/node/TimeClock/ClockPointer.js +15 -10
  457. package/node/TimeClock/TimeClock.js +31 -12
  458. package/node/TimeField/TimeField.js +28 -32
  459. package/node/TimeField/useTimeField.js +13 -10
  460. package/node/TimePicker/TimePicker.js +2 -2
  461. package/node/TimePicker/TimePickerToolbar.js +40 -64
  462. package/node/YearCalendar/YearCalendar.js +46 -12
  463. package/node/YearCalendar/{PickersYear.js → YearCalendarButton.js} +20 -59
  464. package/node/YearCalendar/index.js +1 -8
  465. package/node/YearCalendar/yearCalendarClasses.js +1 -1
  466. package/node/hooks/index.js +15 -1
  467. package/node/hooks/useClearableField.js +4 -2
  468. package/node/hooks/useIsValidValue.js +18 -0
  469. package/node/hooks/useParsedFormat.js +11 -13
  470. package/node/hooks/usePickerActionsContext.js +22 -0
  471. package/node/hooks/usePickerContext.js +5 -4
  472. package/node/hooks/useSplitFieldProps.js +7 -2
  473. package/node/index.js +13 -1
  474. package/node/internals/components/PickerFieldUI.js +329 -0
  475. package/node/internals/components/{PickersPopper.js → PickerPopper/PickerPopper.js} +48 -48
  476. package/node/internals/components/PickerPopper/index.js +25 -0
  477. package/node/internals/components/PickerPopper/pickerPopperClasses.js +14 -0
  478. package/node/internals/components/PickerProvider.js +30 -10
  479. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
  480. package/node/internals/components/PickersModalDialog.js +9 -3
  481. package/node/internals/components/PickersToolbar.js +16 -15
  482. package/node/internals/components/PickersToolbarButton.js +4 -6
  483. package/node/internals/components/PickersToolbarText.js +10 -12
  484. package/node/internals/hooks/date-helpers-hooks.js +4 -3
  485. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +38 -123
  486. package/node/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
  487. package/node/internals/hooks/useField/index.js +8 -1
  488. package/node/internals/hooks/useField/useField.js +16 -3
  489. package/node/internals/hooks/useField/useField.utils.js +2 -2
  490. package/node/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +56 -0
  491. package/node/internals/hooks/useField/useFieldState.js +3 -3
  492. package/node/internals/hooks/useField/useFieldV6TextField.js +5 -2
  493. package/node/internals/hooks/useField/useFieldV7TextField.js +8 -4
  494. package/node/internals/hooks/useFieldOwnerState.js +24 -0
  495. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +36 -70
  496. package/node/internals/hooks/useNullablePickerContext.js +16 -0
  497. package/node/internals/hooks/useOpenState.js +12 -9
  498. package/node/internals/hooks/usePicker/usePicker.js +10 -29
  499. package/node/internals/hooks/usePicker/usePickerProvider.js +105 -12
  500. package/node/internals/hooks/usePicker/usePickerValue.js +100 -217
  501. package/node/internals/hooks/usePicker/usePickerViews.js +31 -20
  502. package/node/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +7 -4
  503. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +8 -13
  504. package/node/internals/hooks/useToolbarOwnerState.js +21 -0
  505. package/node/internals/hooks/useUtils.js +1 -1
  506. package/node/internals/hooks/useValueWithTimezone.js +13 -1
  507. package/node/internals/index.js +87 -34
  508. package/node/internals/models/index.js +11 -0
  509. package/node/internals/models/manager.js +5 -0
  510. package/node/internals/models/pickers.js +5 -0
  511. package/node/internals/utils/date-utils.js +1 -1
  512. package/node/internals/utils/utils.js +14 -2
  513. package/node/internals/utils/valueManagers.js +4 -4
  514. package/node/locales/index.js +11 -0
  515. package/node/locales/nbNO.js +15 -19
  516. package/node/locales/nlNL.js +7 -7
  517. package/node/locales/roRO.js +15 -18
  518. package/node/locales/utils/getPickersLocalization.js +2 -16
  519. package/node/locales/zhTW.js +79 -0
  520. package/node/managers/index.js +26 -0
  521. package/node/managers/useDateManager.js +63 -0
  522. package/node/managers/useDateTimeManager.js +68 -0
  523. package/node/managers/useTimeManager.js +59 -0
  524. package/node/models/index.js +11 -0
  525. package/node/models/manager.js +5 -0
  526. package/node/validation/useValidation.js +1 -1
  527. package/node/validation/validateDate.js +8 -0
  528. package/node/validation/validateDateTime.js +8 -0
  529. package/node/validation/validateTime.js +8 -0
  530. package/package.json +7 -7
  531. package/themeAugmentation/components.d.ts +3 -11
  532. package/themeAugmentation/overrides.d.ts +5 -7
  533. package/themeAugmentation/props.d.ts +7 -9
  534. package/validation/extractValidationProps.d.ts +1 -1
  535. package/validation/useValidation.d.ts +7 -6
  536. package/validation/useValidation.js +1 -1
  537. package/validation/validateDate.d.ts +12 -3
  538. package/validation/validateDate.js +8 -0
  539. package/validation/validateDateTime.d.ts +12 -4
  540. package/validation/validateDateTime.js +8 -0
  541. package/validation/validateTime.d.ts +12 -3
  542. package/validation/validateTime.js +8 -0
  543. package/AdapterDateFnsJalaliV3/index.d.ts +0 -1
  544. package/AdapterDateFnsJalaliV3/index.js +0 -1
  545. package/AdapterDateFnsV3/index.d.ts +0 -1
  546. package/AdapterDateFnsV3/index.js +0 -1
  547. package/MonthCalendar/PickersMonth.d.ts +0 -28
  548. package/MonthCalendar/pickersMonthClasses.d.ts +0 -13
  549. package/MonthCalendar/pickersMonthClasses.js +0 -5
  550. package/YearCalendar/PickersYear.d.ts +0 -27
  551. package/YearCalendar/pickersYearClasses.d.ts +0 -13
  552. package/YearCalendar/pickersYearClasses.js +0 -5
  553. package/internals/components/pickersPopperClasses.d.ts +0 -9
  554. package/internals/components/pickersPopperClasses.js +0 -5
  555. package/internals/hooks/defaultizedFieldProps.d.ts +0 -18
  556. package/internals/hooks/defaultizedFieldProps.js +0 -40
  557. package/internals/hooks/useDefaultReduceAnimations.d.ts +0 -2
  558. package/internals/hooks/useIsLandscape.d.ts +0 -4
  559. package/internals/hooks/useIsLandscape.js +0 -35
  560. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +0 -33
  561. package/internals/hooks/usePicker/usePickerLayoutProps.js +0 -34
  562. package/internals/hooks/usePicker/usePickerOwnerState.d.ts +0 -10
  563. package/internals/hooks/usePicker/usePickerOwnerState.js +0 -16
  564. package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.d.ts +0 -3
  565. package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -44
  566. package/modern/AdapterDateFnsJalaliV3/index.js +0 -1
  567. package/modern/AdapterDateFnsV3/index.js +0 -1
  568. package/modern/MonthCalendar/pickersMonthClasses.js +0 -5
  569. package/modern/YearCalendar/pickersYearClasses.js +0 -5
  570. package/modern/internals/components/pickersPopperClasses.js +0 -5
  571. package/modern/internals/hooks/defaultizedFieldProps.js +0 -40
  572. package/modern/internals/hooks/useIsLandscape.js +0 -35
  573. package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +0 -34
  574. package/modern/internals/hooks/usePicker/usePickerOwnerState.js +0 -16
  575. package/modern/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -44
  576. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +0 -299
  577. package/node/MonthCalendar/pickersMonthClasses.js +0 -12
  578. package/node/YearCalendar/pickersYearClasses.js +0 -12
  579. package/node/internals/components/pickersPopperClasses.js +0 -12
  580. package/node/internals/hooks/defaultizedFieldProps.js +0 -50
  581. package/node/internals/hooks/useIsLandscape.js +0 -43
  582. package/node/internals/hooks/usePicker/usePickerLayoutProps.js +0 -41
  583. package/node/internals/hooks/usePicker/usePickerOwnerState.js +0 -23
  584. package/node/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -52
@@ -1,50 +1,48 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  /* eslint-disable class-methods-use-this */
3
- import addSeconds from 'date-fns-jalali/addSeconds';
4
- import addMinutes from 'date-fns-jalali/addMinutes';
5
- import addHours from 'date-fns-jalali/addHours';
6
- import addDays from 'date-fns-jalali/addDays';
7
- import addWeeks from 'date-fns-jalali/addWeeks';
8
- import addMonths from 'date-fns-jalali/addMonths';
9
- import addYears from 'date-fns-jalali/addYears';
10
- import endOfDay from 'date-fns-jalali/endOfDay';
11
- import endOfWeek from 'date-fns-jalali/endOfWeek';
12
- import endOfYear from 'date-fns-jalali/endOfYear';
13
- import dateFnsFormat from 'date-fns-jalali/format';
14
- import getHours from 'date-fns-jalali/getHours';
15
- import getSeconds from 'date-fns-jalali/getSeconds';
16
- import getMilliseconds from 'date-fns-jalali/getMilliseconds';
17
- import getWeek from 'date-fns-jalali/getWeek';
18
- import getYear from 'date-fns-jalali/getYear';
19
- import getMonth from 'date-fns-jalali/getMonth';
20
- import getDate from 'date-fns-jalali/getDate';
21
- import getDaysInMonth from 'date-fns-jalali/getDaysInMonth';
22
- import getMinutes from 'date-fns-jalali/getMinutes';
23
- import isAfter from 'date-fns-jalali/isAfter';
24
- import isBefore from 'date-fns-jalali/isBefore';
25
- import isEqual from 'date-fns-jalali/isEqual';
26
- import isSameDay from 'date-fns-jalali/isSameDay';
27
- import isSameYear from 'date-fns-jalali/isSameYear';
28
- import isSameMonth from 'date-fns-jalali/isSameMonth';
29
- import isSameHour from 'date-fns-jalali/isSameHour';
30
- import isValid from 'date-fns-jalali/isValid';
31
- import dateFnsParse from 'date-fns-jalali/parse';
32
- import setDate from 'date-fns-jalali/setDate';
33
- import setHours from 'date-fns-jalali/setHours';
34
- import setMinutes from 'date-fns-jalali/setMinutes';
35
- import setMonth from 'date-fns-jalali/setMonth';
36
- import setSeconds from 'date-fns-jalali/setSeconds';
37
- import setMilliseconds from 'date-fns-jalali/setMilliseconds';
38
- import setYear from 'date-fns-jalali/setYear';
39
- import startOfDay from 'date-fns-jalali/startOfDay';
40
- import startOfMonth from 'date-fns-jalali/startOfMonth';
41
- import endOfMonth from 'date-fns-jalali/endOfMonth';
42
- import startOfWeek from 'date-fns-jalali/startOfWeek';
43
- import startOfYear from 'date-fns-jalali/startOfYear';
44
- import isWithinInterval from 'date-fns-jalali/isWithinInterval';
45
- import defaultLocale from 'date-fns-jalali/locale/fa-IR';
46
- // @ts-ignore
47
- import longFormatters from 'date-fns-jalali/_lib/format/longFormatters';
3
+ import { addSeconds } from 'date-fns-jalali/addSeconds';
4
+ import { addMinutes } from 'date-fns-jalali/addMinutes';
5
+ import { addHours } from 'date-fns-jalali/addHours';
6
+ import { addDays } from 'date-fns-jalali/addDays';
7
+ import { addWeeks } from 'date-fns-jalali/addWeeks';
8
+ import { addMonths } from 'date-fns-jalali/addMonths';
9
+ import { addYears } from 'date-fns-jalali/addYears';
10
+ import { endOfDay } from 'date-fns-jalali/endOfDay';
11
+ import { endOfWeek } from 'date-fns-jalali/endOfWeek';
12
+ import { endOfYear } from 'date-fns-jalali/endOfYear';
13
+ import { format as dateFnsFormat, longFormatters } from 'date-fns-jalali/format';
14
+ import { getHours } from 'date-fns-jalali/getHours';
15
+ import { getSeconds } from 'date-fns-jalali/getSeconds';
16
+ import { getMilliseconds } from 'date-fns-jalali/getMilliseconds';
17
+ import { getWeek } from 'date-fns-jalali/getWeek';
18
+ import { getYear } from 'date-fns-jalali/getYear';
19
+ import { getMonth } from 'date-fns-jalali/getMonth';
20
+ import { getDate } from 'date-fns-jalali/getDate';
21
+ import { getDaysInMonth } from 'date-fns-jalali/getDaysInMonth';
22
+ import { getMinutes } from 'date-fns-jalali/getMinutes';
23
+ import { isAfter } from 'date-fns-jalali/isAfter';
24
+ import { isBefore } from 'date-fns-jalali/isBefore';
25
+ import { isEqual } from 'date-fns-jalali/isEqual';
26
+ import { isSameDay } from 'date-fns-jalali/isSameDay';
27
+ import { isSameYear } from 'date-fns-jalali/isSameYear';
28
+ import { isSameMonth } from 'date-fns-jalali/isSameMonth';
29
+ import { isSameHour } from 'date-fns-jalali/isSameHour';
30
+ import { isValid } from 'date-fns-jalali/isValid';
31
+ import { parse as dateFnsParse } from 'date-fns-jalali/parse';
32
+ import { setDate } from 'date-fns-jalali/setDate';
33
+ import { setHours } from 'date-fns-jalali/setHours';
34
+ import { setMinutes } from 'date-fns-jalali/setMinutes';
35
+ import { setMonth } from 'date-fns-jalali/setMonth';
36
+ import { setSeconds } from 'date-fns-jalali/setSeconds';
37
+ import { setMilliseconds } from 'date-fns-jalali/setMilliseconds';
38
+ import { setYear } from 'date-fns-jalali/setYear';
39
+ import { startOfDay } from 'date-fns-jalali/startOfDay';
40
+ import { startOfMonth } from 'date-fns-jalali/startOfMonth';
41
+ import { endOfMonth } from 'date-fns-jalali/endOfMonth';
42
+ import { startOfWeek } from 'date-fns-jalali/startOfWeek';
43
+ import { startOfYear } from 'date-fns-jalali/startOfYear';
44
+ import { isWithinInterval } from 'date-fns-jalali/isWithinInterval';
45
+ import { faIR as defaultLocale } from 'date-fns-jalali/locale/fa-IR';
48
46
  import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
49
47
  const defaultFormats = {
50
48
  year: 'yyyy',
@@ -116,7 +114,10 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
116
114
  /* istanbul ignore next */
117
115
  if (process.env.NODE_ENV !== 'production') {
118
116
  if (typeof addDays !== 'function') {
119
- throw new Error(['MUI: The `date-fns-jalali` package v3.x is not compatible with this adapter.', 'Please, install v2.x of the package or use the `AdapterDateFnsJalaliV3` instead.'].join('\n'));
117
+ throw new Error(['MUI: The `date-fns-jalali` package v2.x is not compatible with this adapter.', 'Please, install v3.x or v4.x of the package or use the `AdapterDateFnsJalaliV2` instead.'].join('\n'));
118
+ }
119
+ if (!longFormatters) {
120
+ throw new Error('MUI: The minimum supported `date-fns-jalali` package version compatible with this adapter is `3.2.x`.');
120
121
  }
121
122
  }
122
123
  super({
@@ -127,6 +128,7 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
127
128
  longFormatters,
128
129
  lib: 'date-fns-jalali'
129
130
  });
131
+ // TODO: explicit return types can be removed once there is only one date-fns version supported
130
132
  this.parse = (value, format) => {
131
133
  if (value === '') {
132
134
  return null;
@@ -1,53 +1,50 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  /* eslint-disable class-methods-use-this */
3
- // TODO remove when date-fns-jalali-v3 is the default
4
3
  // @ts-nocheck
5
- import { addSeconds } from 'date-fns-jalali/addSeconds';
6
- import { addMinutes } from 'date-fns-jalali/addMinutes';
7
- import { addHours } from 'date-fns-jalali/addHours';
8
- import { addDays } from 'date-fns-jalali/addDays';
9
- import { addWeeks } from 'date-fns-jalali/addWeeks';
10
- import { addMonths } from 'date-fns-jalali/addMonths';
11
- import { addYears } from 'date-fns-jalali/addYears';
12
- import { endOfDay } from 'date-fns-jalali/endOfDay';
13
- import { endOfWeek } from 'date-fns-jalali/endOfWeek';
14
- import { endOfYear } from 'date-fns-jalali/endOfYear';
15
- import { format as dateFnsFormat, longFormatters } from 'date-fns-jalali/format';
16
- import { getHours } from 'date-fns-jalali/getHours';
17
- import { getSeconds } from 'date-fns-jalali/getSeconds';
18
- import { getMilliseconds } from 'date-fns-jalali/getMilliseconds';
19
- import { getWeek } from 'date-fns-jalali/getWeek';
20
- import { getYear } from 'date-fns-jalali/getYear';
21
- import { getMonth } from 'date-fns-jalali/getMonth';
22
- import { getDate } from 'date-fns-jalali/getDate';
23
- import { getDaysInMonth } from 'date-fns-jalali/getDaysInMonth';
24
- import { getMinutes } from 'date-fns-jalali/getMinutes';
25
- import { isAfter } from 'date-fns-jalali/isAfter';
26
- import { isBefore } from 'date-fns-jalali/isBefore';
27
- import { isEqual } from 'date-fns-jalali/isEqual';
28
- import { isSameDay } from 'date-fns-jalali/isSameDay';
29
- import { isSameYear } from 'date-fns-jalali/isSameYear';
30
- import { isSameMonth } from 'date-fns-jalali/isSameMonth';
31
- import { isSameHour } from 'date-fns-jalali/isSameHour';
32
- import { isValid } from 'date-fns-jalali/isValid';
33
- import { parse as dateFnsParse } from 'date-fns-jalali/parse';
34
- import { setDate } from 'date-fns-jalali/setDate';
35
- import { setHours } from 'date-fns-jalali/setHours';
36
- import { setMinutes } from 'date-fns-jalali/setMinutes';
37
- import { setMonth } from 'date-fns-jalali/setMonth';
38
- import { setSeconds } from 'date-fns-jalali/setSeconds';
39
- import { setMilliseconds } from 'date-fns-jalali/setMilliseconds';
40
- import { setYear } from 'date-fns-jalali/setYear';
41
- import { startOfDay } from 'date-fns-jalali/startOfDay';
42
- import { startOfMonth } from 'date-fns-jalali/startOfMonth';
43
- import { endOfMonth } from 'date-fns-jalali/endOfMonth';
44
- import { startOfWeek } from 'date-fns-jalali/startOfWeek';
45
- import { startOfYear } from 'date-fns-jalali/startOfYear';
46
- import { isWithinInterval } from 'date-fns-jalali/isWithinInterval';
47
- import { faIR as defaultLocale } from 'date-fns-jalali/locale/fa-IR';
48
- // date-fns-jalali v2 does not export types
49
- // @ts-ignore TODO remove when date-fns-jalali-v3 is the default
50
-
4
+ import addSeconds from 'date-fns-jalali/addSeconds';
5
+ import addMinutes from 'date-fns-jalali/addMinutes';
6
+ import addHours from 'date-fns-jalali/addHours';
7
+ import addDays from 'date-fns-jalali/addDays';
8
+ import addWeeks from 'date-fns-jalali/addWeeks';
9
+ import addMonths from 'date-fns-jalali/addMonths';
10
+ import addYears from 'date-fns-jalali/addYears';
11
+ import endOfDay from 'date-fns-jalali/endOfDay';
12
+ import endOfWeek from 'date-fns-jalali/endOfWeek';
13
+ import endOfYear from 'date-fns-jalali/endOfYear';
14
+ import dateFnsFormat from 'date-fns-jalali/format';
15
+ import getHours from 'date-fns-jalali/getHours';
16
+ import getSeconds from 'date-fns-jalali/getSeconds';
17
+ import getMilliseconds from 'date-fns-jalali/getMilliseconds';
18
+ import getWeek from 'date-fns-jalali/getWeek';
19
+ import getYear from 'date-fns-jalali/getYear';
20
+ import getMonth from 'date-fns-jalali/getMonth';
21
+ import getDate from 'date-fns-jalali/getDate';
22
+ import getDaysInMonth from 'date-fns-jalali/getDaysInMonth';
23
+ import getMinutes from 'date-fns-jalali/getMinutes';
24
+ import isAfter from 'date-fns-jalali/isAfter';
25
+ import isBefore from 'date-fns-jalali/isBefore';
26
+ import isEqual from 'date-fns-jalali/isEqual';
27
+ import isSameDay from 'date-fns-jalali/isSameDay';
28
+ import isSameYear from 'date-fns-jalali/isSameYear';
29
+ import isSameMonth from 'date-fns-jalali/isSameMonth';
30
+ import isSameHour from 'date-fns-jalali/isSameHour';
31
+ import isValid from 'date-fns-jalali/isValid';
32
+ import dateFnsParse from 'date-fns-jalali/parse';
33
+ import setDate from 'date-fns-jalali/setDate';
34
+ import setHours from 'date-fns-jalali/setHours';
35
+ import setMinutes from 'date-fns-jalali/setMinutes';
36
+ import setMonth from 'date-fns-jalali/setMonth';
37
+ import setSeconds from 'date-fns-jalali/setSeconds';
38
+ import setMilliseconds from 'date-fns-jalali/setMilliseconds';
39
+ import setYear from 'date-fns-jalali/setYear';
40
+ import startOfDay from 'date-fns-jalali/startOfDay';
41
+ import startOfMonth from 'date-fns-jalali/startOfMonth';
42
+ import endOfMonth from 'date-fns-jalali/endOfMonth';
43
+ import startOfWeek from 'date-fns-jalali/startOfWeek';
44
+ import startOfYear from 'date-fns-jalali/startOfYear';
45
+ import isWithinInterval from 'date-fns-jalali/isWithinInterval';
46
+ import defaultLocale from 'date-fns-jalali/locale/fa-IR';
47
+ import longFormatters from 'date-fns-jalali/_lib/format/longFormatters';
51
48
  import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
52
49
  const defaultFormats = {
53
50
  year: 'yyyy',
@@ -119,10 +116,7 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
119
116
  /* istanbul ignore next */
120
117
  if (process.env.NODE_ENV !== 'production') {
121
118
  if (typeof addDays !== 'function') {
122
- throw new Error([`MUI: The \`date-fns-jalali\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x of the package or use the `AdapterDateFnsJalali` instead.'].join('\n'));
123
- }
124
- if (!longFormatters) {
125
- throw new Error('MUI: The minimum supported `date-fns-jalali` package version compatible with this adapter is `3.2.x`.');
119
+ throw new Error(['MUI: This adapter is only compatible with `date-fns-jalali` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFnsJalali` instead.'].join('\n'));
126
120
  }
127
121
  }
128
122
  super({
@@ -133,7 +127,6 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
133
127
  longFormatters,
134
128
  lib: 'date-fns-jalali'
135
129
  });
136
- // TODO: explicit return types can be removed once there is only one date-fns version supported
137
130
  this.parse = (value, format) => {
138
131
  if (value === '') {
139
132
  return null;
@@ -0,0 +1 @@
1
+ export { AdapterDateFnsJalali } from "./AdapterDateFnsJalaliV2.js";
@@ -1,53 +1,49 @@
1
1
  /* eslint-disable class-methods-use-this */
2
- // TODO remove when date-fns-v3 is the default
3
2
  // @ts-nocheck
4
- import { addDays } from 'date-fns/addDays';
5
- import { addSeconds } from 'date-fns/addSeconds';
6
- import { addMinutes } from 'date-fns/addMinutes';
7
- import { addHours } from 'date-fns/addHours';
8
- import { addWeeks } from 'date-fns/addWeeks';
9
- import { addMonths } from 'date-fns/addMonths';
10
- import { addYears } from 'date-fns/addYears';
11
- import { endOfDay } from 'date-fns/endOfDay';
12
- import { endOfWeek } from 'date-fns/endOfWeek';
13
- import { endOfYear } from 'date-fns/endOfYear';
14
- // @ts-ignore TODO remove when date-fns-v3 is the default
15
- import { format as dateFnsFormat, longFormatters } from 'date-fns/format';
16
- import { getDate } from 'date-fns/getDate';
17
- import { getDaysInMonth } from 'date-fns/getDaysInMonth';
18
- import { getHours } from 'date-fns/getHours';
19
- import { getMinutes } from 'date-fns/getMinutes';
20
- import { getMonth } from 'date-fns/getMonth';
21
- import { getSeconds } from 'date-fns/getSeconds';
22
- import { getMilliseconds } from 'date-fns/getMilliseconds';
23
- import { getWeek } from 'date-fns/getWeek';
24
- import { getYear } from 'date-fns/getYear';
25
- import { isAfter } from 'date-fns/isAfter';
26
- import { isBefore } from 'date-fns/isBefore';
27
- import { isEqual } from 'date-fns/isEqual';
28
- import { isSameDay } from 'date-fns/isSameDay';
29
- import { isSameYear } from 'date-fns/isSameYear';
30
- import { isSameMonth } from 'date-fns/isSameMonth';
31
- import { isSameHour } from 'date-fns/isSameHour';
32
- import { isValid } from 'date-fns/isValid';
33
- import { parse as dateFnsParse } from 'date-fns/parse';
34
- import { setDate } from 'date-fns/setDate';
35
- import { setHours } from 'date-fns/setHours';
36
- import { setMinutes } from 'date-fns/setMinutes';
37
- import { setMonth } from 'date-fns/setMonth';
38
- import { setSeconds } from 'date-fns/setSeconds';
39
- import { setMilliseconds } from 'date-fns/setMilliseconds';
40
- import { setYear } from 'date-fns/setYear';
41
- import { startOfDay } from 'date-fns/startOfDay';
42
- import { startOfMonth } from 'date-fns/startOfMonth';
43
- import { endOfMonth } from 'date-fns/endOfMonth';
44
- import { startOfWeek } from 'date-fns/startOfWeek';
45
- import { startOfYear } from 'date-fns/startOfYear';
46
- import { isWithinInterval } from 'date-fns/isWithinInterval';
47
- import { enUS } from 'date-fns/locale/en-US';
48
- // date-fns v2 does not export types
49
- // @ts-ignore TODO remove when date-fns-v3 is the default
50
-
3
+ import addDays from 'date-fns/addDays';
4
+ import addSeconds from 'date-fns/addSeconds';
5
+ import addMinutes from 'date-fns/addMinutes';
6
+ import addHours from 'date-fns/addHours';
7
+ import addWeeks from 'date-fns/addWeeks';
8
+ import addMonths from 'date-fns/addMonths';
9
+ import addYears from 'date-fns/addYears';
10
+ import endOfDay from 'date-fns/endOfDay';
11
+ import endOfWeek from 'date-fns/endOfWeek';
12
+ import endOfYear from 'date-fns/endOfYear';
13
+ import dateFnsFormat from 'date-fns/format';
14
+ import getDate from 'date-fns/getDate';
15
+ import getDaysInMonth from 'date-fns/getDaysInMonth';
16
+ import getHours from 'date-fns/getHours';
17
+ import getMinutes from 'date-fns/getMinutes';
18
+ import getMonth from 'date-fns/getMonth';
19
+ import getSeconds from 'date-fns/getSeconds';
20
+ import getMilliseconds from 'date-fns/getMilliseconds';
21
+ import getWeek from 'date-fns/getWeek';
22
+ import getYear from 'date-fns/getYear';
23
+ import isAfter from 'date-fns/isAfter';
24
+ import isBefore from 'date-fns/isBefore';
25
+ import isEqual from 'date-fns/isEqual';
26
+ import isSameDay from 'date-fns/isSameDay';
27
+ import isSameYear from 'date-fns/isSameYear';
28
+ import isSameMonth from 'date-fns/isSameMonth';
29
+ import isSameHour from 'date-fns/isSameHour';
30
+ import isValid from 'date-fns/isValid';
31
+ import dateFnsParse from 'date-fns/parse';
32
+ import setDate from 'date-fns/setDate';
33
+ import setHours from 'date-fns/setHours';
34
+ import setMinutes from 'date-fns/setMinutes';
35
+ import setMonth from 'date-fns/setMonth';
36
+ import setSeconds from 'date-fns/setSeconds';
37
+ import setMilliseconds from 'date-fns/setMilliseconds';
38
+ import setYear from 'date-fns/setYear';
39
+ import startOfDay from 'date-fns/startOfDay';
40
+ import startOfMonth from 'date-fns/startOfMonth';
41
+ import endOfMonth from 'date-fns/endOfMonth';
42
+ import startOfWeek from 'date-fns/startOfWeek';
43
+ import startOfYear from 'date-fns/startOfYear';
44
+ import isWithinInterval from 'date-fns/isWithinInterval';
45
+ import defaultLocale from 'date-fns/locale/en-US';
46
+ import longFormatters from 'date-fns/_lib/format/longFormatters';
51
47
  import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
52
48
  /**
53
49
  * Based on `@date-io/date-fns`
@@ -82,18 +78,14 @@ export class AdapterDateFns extends AdapterDateFnsBase {
82
78
  /* istanbul ignore next */
83
79
  if (process.env.NODE_ENV !== 'production') {
84
80
  if (typeof addDays !== 'function') {
85
- throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x or v4.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
86
- }
87
- if (!longFormatters) {
88
- throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
81
+ throw new Error(['MUI: This adapter is only compatible with `date-fns` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
89
82
  }
90
83
  }
91
84
  super({
92
- locale: locale ?? enUS,
85
+ locale: locale ?? defaultLocale,
93
86
  formats,
94
87
  longFormatters
95
88
  });
96
- // TODO: explicit return types can be removed once there is only one date-fns version supported
97
89
  this.parse = (value, format) => {
98
90
  if (value === '') {
99
91
  return null;
@@ -0,0 +1 @@
1
+ export { AdapterDateFns } from "./AdapterDateFnsV2.js";
@@ -430,12 +430,22 @@ export class AdapterMoment {
430
430
  const end = this.endOfWeek(this.endOfMonth(value));
431
431
  let count = 0;
432
432
  let current = start;
433
+ let currentDayOfYear = current.get('dayOfYear');
433
434
  const nestedWeeks = [];
434
435
  while (current.isBefore(end)) {
435
436
  const weekNumber = Math.floor(count / 7);
436
437
  nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
437
438
  nestedWeeks[weekNumber].push(current);
439
+ const prevDayOfYear = currentDayOfYear;
438
440
  current = this.addDays(current, 1);
441
+ currentDayOfYear = current.get('dayOfYear');
442
+
443
+ // If there is a TZ change at midnight, adding 1 day may only increase the date by 23 hours to 11pm
444
+ // To fix, bump the date into the next day (add 12 hours) and then revert to the start of the day
445
+ // See https://github.com/moment/moment/issues/4743#issuecomment-811306874 for context.
446
+ if (prevDayOfYear === currentDayOfYear) {
447
+ current = current.add(12, 'h').startOf('day');
448
+ }
439
449
  count += 1;
440
450
  }
441
451
  return nestedWeeks;
@@ -19,7 +19,7 @@ import { useViews } from "../internals/hooks/useViews.js";
19
19
  import { PickersCalendarHeader } from "../PickersCalendarHeader/index.js";
20
20
  import { findClosestEnabledDate, applyDefaultDate, mergeDateAndTime } from "../internals/utils/date-utils.js";
21
21
  import { PickerViewRoot } from "../internals/components/PickerViewRoot/index.js";
22
- import { useDefaultReduceAnimations } from "../internals/hooks/useDefaultReduceAnimations.js";
22
+ import { useReduceAnimations } from "../internals/hooks/useReduceAnimations.js";
23
23
  import { getDateCalendarUtilityClass } from "./dateCalendarClasses.js";
24
24
  import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
25
25
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
@@ -36,18 +36,18 @@ const useUtilityClasses = classes => {
36
36
  function useDateCalendarDefaultizedProps(props, name) {
37
37
  const utils = useUtils();
38
38
  const defaultDates = useDefaultDates();
39
- const defaultReduceAnimations = useDefaultReduceAnimations();
40
39
  const themeProps = useThemeProps({
41
40
  props,
42
41
  name
43
42
  });
43
+ const reduceAnimations = useReduceAnimations(themeProps.reduceAnimations);
44
44
  return _extends({}, themeProps, {
45
45
  loading: themeProps.loading ?? false,
46
46
  disablePast: themeProps.disablePast ?? false,
47
47
  disableFuture: themeProps.disableFuture ?? false,
48
48
  openTo: themeProps.openTo ?? 'day',
49
49
  views: themeProps.views ?? ['year', 'day'],
50
- reduceAnimations: themeProps.reduceAnimations ?? defaultReduceAnimations,
50
+ reduceAnimations,
51
51
  renderLoading: themeProps.renderLoading ?? (() => /*#__PURE__*/_jsx("span", {
52
52
  children: "..."
53
53
  })),
@@ -137,6 +137,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
137
137
  timezone: timezoneProp,
138
138
  value: valueProp,
139
139
  defaultValue,
140
+ referenceDate: referenceDateProp,
140
141
  onChange,
141
142
  valueManager: singleItemValueManager
142
143
  });
@@ -259,7 +260,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
259
260
  return handleValueChange(day, 'finish', view);
260
261
  });
261
262
  React.useEffect(() => {
262
- if (value != null && utils.isValid(value)) {
263
+ if (utils.isValid(value)) {
263
264
  changeMonth(value);
264
265
  }
265
266
  }, [value]); // eslint-disable-line
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["parentProps", "day", "focusableDay", "selectedDays", "isDateDisabled", "currentMonthNumber", "isViewFocused"],
@@ -6,10 +6,7 @@ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import { getPickersFadeTransitionGroupUtilityClass } from "./pickersFadeTransitionGroupClasses.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const useUtilityClasses = ownerState => {
10
- const {
11
- classes
12
- } = ownerState;
9
+ const useUtilityClasses = classes => {
13
10
  const slots = {
14
11
  root: ['root']
15
12
  };
@@ -36,9 +33,10 @@ export function PickersFadeTransitionGroup(inProps) {
36
33
  children,
37
34
  className,
38
35
  reduceAnimations,
39
- transKey
36
+ transKey,
37
+ classes: classesProp
40
38
  } = props;
41
- const classes = useUtilityClasses(props);
39
+ const classes = useUtilityClasses(classesProp);
42
40
  const theme = useTheme();
43
41
  if (reduceAnimations) {
44
42
  return children;
@@ -7,10 +7,10 @@ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
7
7
  import composeClasses from '@mui/utils/composeClasses';
8
8
  import { CSSTransition, TransitionGroup } from 'react-transition-group';
9
9
  import { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from "./pickersSlideTransitionClasses.js";
10
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const useUtilityClasses = ownerState => {
12
+ const useUtilityClasses = (classes, ownerState) => {
12
13
  const {
13
- classes,
14
14
  slideDirection
15
15
  } = ownerState;
16
16
  const slots = {
@@ -99,11 +99,18 @@ export function PickersSlideTransition(inProps) {
99
99
  children,
100
100
  className,
101
101
  reduceAnimations,
102
- transKey
103
- // extracting `classes` from `other`
102
+ slideDirection,
103
+ transKey,
104
+ classes: classesProp
104
105
  } = props,
105
106
  other = _objectWithoutPropertiesLoose(props, _excluded);
106
- const classes = useUtilityClasses(props);
107
+ const {
108
+ ownerState: pickerOwnerState
109
+ } = usePickerPrivateContext();
110
+ const ownerState = _extends({}, pickerOwnerState, {
111
+ slideDirection
112
+ });
113
+ const classes = useUtilityClasses(classesProp, ownerState);
107
114
  const theme = useTheme();
108
115
  if (reduceAnimations) {
109
116
  return /*#__PURE__*/_jsx("div", {
@@ -1,18 +1,14 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
4
+ const _excluded = ["slots", "slotProps"];
6
5
  import * as React from 'react';
7
6
  import PropTypes from 'prop-types';
8
- import MuiTextField from '@mui/material/TextField';
9
7
  import { useThemeProps } from '@mui/material/styles';
10
- import useSlotProps from '@mui/utils/useSlotProps';
11
8
  import { refType } from '@mui/utils';
12
9
  import { useDateField } from "./useDateField.js";
13
- import { useClearableField } from "../hooks/index.js";
14
- import { PickersTextField } from "../PickersTextField/index.js";
15
- import { convertFieldResponseIntoMuiTextFieldProps } from "../internals/utils/convertFieldResponseIntoMuiTextFieldProps.js";
10
+ import { PickerFieldUI, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
11
+ import { CalendarIcon } from "../icons/index.js";
16
12
  import { jsx as _jsx } from "react/jsx-runtime";
17
13
  /**
18
14
  * Demos:
@@ -31,33 +27,21 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, inRe
31
27
  });
32
28
  const {
33
29
  slots,
34
- slotProps,
35
- InputProps,
36
- inputProps
30
+ slotProps
37
31
  } = themeProps,
38
32
  other = _objectWithoutPropertiesLoose(themeProps, _excluded);
39
- const ownerState = themeProps;
40
- const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
41
- const textFieldProps = useSlotProps({
42
- elementType: TextField,
43
- externalSlotProps: slotProps?.textField,
44
- externalForwardedProps: other,
45
- additionalProps: {
46
- ref: inRef
47
- },
48
- ownerState
33
+ const textFieldProps = useFieldTextFieldProps({
34
+ slotProps,
35
+ ref: inRef,
36
+ externalForwardedProps: other
49
37
  });
50
-
51
- // TODO: Remove when mui/material-ui#35088 will be merged
52
- textFieldProps.inputProps = _extends({}, inputProps, textFieldProps.inputProps);
53
- textFieldProps.InputProps = _extends({}, InputProps, textFieldProps.InputProps);
54
38
  const fieldResponse = useDateField(textFieldProps);
55
- const convertedFieldResponse = convertFieldResponseIntoMuiTextFieldProps(fieldResponse);
56
- const processedFieldProps = useClearableField(_extends({}, convertedFieldResponse, {
57
- slots,
58
- slotProps
59
- }));
60
- return /*#__PURE__*/_jsx(TextField, _extends({}, processedFieldProps));
39
+ return /*#__PURE__*/_jsx(PickerFieldUI, {
40
+ slots: slots,
41
+ slotProps: slotProps,
42
+ fieldResponse: fieldResponse,
43
+ defaultOpenPickerIcon: CalendarIcon
44
+ });
61
45
  });
62
46
  process.env.NODE_ENV !== "production" ? DateField.propTypes = {
63
47
  // ----------------------------- Warning --------------------------------
@@ -75,6 +59,12 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
75
59
  * @default false
76
60
  */
77
61
  clearable: PropTypes.bool,
62
+ /**
63
+ * The position at which the clear button is placed.
64
+ * If the field is not clearable, the button is not rendered.
65
+ * @default 'end'
66
+ */
67
+ clearButtonPosition: PropTypes.oneOf(['end', 'start']),
78
68
  /**
79
69
  * The color of the component.
80
70
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -218,6 +208,12 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
218
208
  * @param {FieldSelectedSections} newValue The new selected sections.
219
209
  */
220
210
  onSelectedSectionsChange: PropTypes.func,
211
+ /**
212
+ * The position at which the opening button is placed.
213
+ * If there is no picker to open, the button is not rendered
214
+ * @default 'end'
215
+ */
216
+ openPickerButtonPosition: PropTypes.oneOf(['end', 'start']),
221
217
  /**
222
218
  * If `true`, the component is read-only.
223
219
  * When read-only, the value cannot be changed but the user can interact with the interface.
@@ -267,10 +263,10 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
267
263
  */
268
264
  shouldDisableYear: PropTypes.func,
269
265
  /**
270
- * If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
271
- * If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
266
+ * If `true`, the format will respect the leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
267
+ * If `false`, the format will always add leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
272
268
  *
273
- * Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
269
+ * Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (for example "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
274
270
  *
275
271
  * Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
276
272
  * If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.