@mui/x-date-pickers 7.22.2 → 8.0.0-alpha.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 (498) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +1 -1
  2. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +3 -3
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -1
  4. package/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts +1 -1
  5. package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +1 -1
  6. package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
  7. package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
  8. package/AdapterMoment/AdapterMoment.d.ts +2 -2
  9. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -2
  10. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -2
  11. package/CHANGELOG.md +142 -155
  12. package/DateCalendar/DateCalendar.d.ts +1 -2
  13. package/DateCalendar/DateCalendar.js +20 -22
  14. package/DateCalendar/DateCalendar.types.d.ts +21 -31
  15. package/DateCalendar/DayCalendar.d.ts +25 -24
  16. package/DateCalendar/DayCalendar.js +13 -10
  17. package/DateCalendar/index.d.ts +1 -0
  18. package/DateCalendar/useCalendarState.d.ts +16 -16
  19. package/DateCalendar/useIsDateDisabled.d.ts +2 -2
  20. package/DateField/DateField.d.ts +1 -2
  21. package/DateField/DateField.js +8 -10
  22. package/DateField/DateField.types.d.ts +8 -9
  23. package/DateField/index.d.ts +1 -1
  24. package/DateField/useDateField.d.ts +1 -2
  25. package/DatePicker/DatePicker.d.ts +1 -2
  26. package/DatePicker/DatePicker.js +15 -14
  27. package/DatePicker/DatePicker.types.d.ts +10 -11
  28. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  29. package/DatePicker/DatePickerToolbar.js +12 -2
  30. package/DatePicker/shared.d.ts +11 -11
  31. package/DateTimeField/DateTimeField.d.ts +1 -2
  32. package/DateTimeField/DateTimeField.js +9 -12
  33. package/DateTimeField/DateTimeField.types.d.ts +9 -14
  34. package/DateTimeField/index.d.ts +1 -1
  35. package/DateTimeField/useDateTimeField.d.ts +1 -2
  36. package/DateTimePicker/DateTimePicker.d.ts +1 -2
  37. package/DateTimePicker/DateTimePicker.js +16 -16
  38. package/DateTimePicker/DateTimePicker.types.d.ts +10 -13
  39. package/DateTimePicker/DateTimePickerTabs.d.ts +1 -2
  40. package/DateTimePicker/DateTimePickerTabs.js +2 -2
  41. package/DateTimePicker/DateTimePickerToolbar.d.ts +3 -3
  42. package/DateTimePicker/DateTimePickerToolbar.js +12 -2
  43. package/DateTimePicker/shared.d.ts +12 -12
  44. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -2
  45. package/DesktopDatePicker/DesktopDatePicker.js +17 -16
  46. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -7
  47. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -2
  48. package/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  49. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
  50. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
  51. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  52. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -2
  53. package/DesktopTimePicker/DesktopTimePicker.js +11 -6
  54. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
  55. package/DigitalClock/DigitalClock.d.ts +1 -2
  56. package/DigitalClock/DigitalClock.js +7 -6
  57. package/DigitalClock/DigitalClock.types.d.ts +4 -4
  58. package/LocalizationProvider/LocalizationProvider.d.ts +12 -12
  59. package/MobileDatePicker/MobileDatePicker.d.ts +1 -2
  60. package/MobileDatePicker/MobileDatePicker.js +17 -16
  61. package/MobileDatePicker/MobileDatePicker.types.d.ts +7 -7
  62. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -2
  63. package/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  64. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +7 -7
  65. package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
  66. package/MobileTimePicker/MobileTimePicker.js +11 -6
  67. package/MobileTimePicker/MobileTimePicker.types.d.ts +7 -7
  68. package/MonthCalendar/MonthCalendar.d.ts +3 -4
  69. package/MonthCalendar/MonthCalendar.js +17 -14
  70. package/MonthCalendar/MonthCalendar.types.d.ts +14 -15
  71. package/MonthCalendar/PickersMonth.js +17 -13
  72. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -2
  73. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  74. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -4
  75. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +9 -9
  76. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +2 -3
  77. package/PickersActionBar/PickersActionBar.js +2 -2
  78. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -2
  79. package/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  80. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
  81. package/PickersDay/PickersDay.d.ts +8 -8
  82. package/PickersLayout/PickersLayout.d.ts +2 -3
  83. package/PickersLayout/PickersLayout.js +10 -0
  84. package/PickersLayout/PickersLayout.types.d.ts +14 -17
  85. package/PickersLayout/index.d.ts +1 -1
  86. package/PickersLayout/usePickerLayout.d.ts +1 -2
  87. package/PickersLayout/usePickerLayout.js +17 -18
  88. package/README.md +2 -2
  89. package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
  90. package/StaticDatePicker/StaticDatePicker.js +14 -13
  91. package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
  92. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
  93. package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  94. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
  95. package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
  96. package/StaticTimePicker/StaticTimePicker.js +8 -3
  97. package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
  98. package/TimeClock/Clock.d.ts +4 -5
  99. package/TimeClock/Clock.js +3 -3
  100. package/TimeClock/ClockNumbers.d.ts +5 -5
  101. package/TimeClock/TimeClock.d.ts +1 -2
  102. package/TimeClock/TimeClock.js +7 -6
  103. package/TimeClock/TimeClock.types.d.ts +4 -4
  104. package/TimeField/TimeField.d.ts +1 -2
  105. package/TimeField/TimeField.js +6 -6
  106. package/TimeField/TimeField.types.d.ts +9 -14
  107. package/TimeField/index.d.ts +1 -1
  108. package/TimeField/useTimeField.d.ts +1 -2
  109. package/TimePicker/TimePicker.d.ts +1 -2
  110. package/TimePicker/TimePicker.js +9 -4
  111. package/TimePicker/TimePicker.types.d.ts +10 -13
  112. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  113. package/TimePicker/TimePickerToolbar.js +12 -2
  114. package/TimePicker/shared.d.ts +10 -10
  115. package/YearCalendar/PickersYear.js +17 -13
  116. package/YearCalendar/YearCalendar.d.ts +1 -2
  117. package/YearCalendar/YearCalendar.js +17 -14
  118. package/YearCalendar/YearCalendar.types.d.ts +14 -15
  119. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  120. package/hooks/index.d.ts +2 -2
  121. package/hooks/index.js +2 -2
  122. package/hooks/useClearableField.js +4 -3
  123. package/hooks/useParsedFormat.d.ts +2 -3
  124. package/hooks/useParsedFormat.js +2 -2
  125. package/hooks/usePickerContext.d.ts +4 -0
  126. package/hooks/usePickerContext.js +15 -0
  127. package/hooks/usePickerTranslations.d.ts +1 -0
  128. package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
  129. package/index.js +1 -1
  130. package/internals/components/{PickersProvider.d.ts → PickerProvider.d.ts} +15 -8
  131. package/internals/components/PickerProvider.js +38 -0
  132. package/internals/hooks/date-helpers-hooks.d.ts +6 -6
  133. package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
  134. package/internals/hooks/useClockReferenceDate.d.ts +5 -5
  135. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
  136. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  137. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
  138. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
  139. package/internals/hooks/useField/useField.d.ts +3 -3
  140. package/internals/hooks/useField/useField.js +1 -1
  141. package/internals/hooks/useField/useField.types.d.ts +38 -48
  142. package/internals/hooks/useField/useField.utils.d.ts +13 -13
  143. package/internals/hooks/useField/useField.utils.js +2 -1
  144. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
  145. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  146. package/internals/hooks/useField/useFieldState.js +3 -3
  147. package/internals/hooks/useField/useFieldV7TextField.js +2 -2
  148. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
  149. package/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  150. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
  151. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  152. package/internals/hooks/usePicker/usePicker.js +12 -4
  153. package/internals/hooks/usePicker/usePicker.types.d.ts +7 -5
  154. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +2 -3
  155. package/internals/hooks/usePicker/usePickerOwnerState.d.ts +4 -3
  156. package/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  157. package/internals/hooks/usePicker/usePickerProvider.d.ts +10 -0
  158. package/internals/hooks/usePicker/usePickerProvider.js +21 -0
  159. package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
  160. package/internals/hooks/usePicker/usePickerValue.js +2 -7
  161. package/internals/hooks/usePicker/usePickerValue.types.d.ts +32 -34
  162. package/internals/hooks/usePicker/usePickerViews.d.ts +6 -11
  163. package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
  164. package/internals/hooks/usePickerPrivateContext.js +9 -0
  165. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
  166. package/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  167. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
  168. package/internals/hooks/useUtils.d.ts +7 -7
  169. package/internals/hooks/useValueWithTimezone.d.ts +5 -5
  170. package/internals/hooks/useViews.d.ts +3 -3
  171. package/internals/hooks/useViews.js +1 -1
  172. package/internals/index.d.ts +6 -4
  173. package/internals/index.js +2 -1
  174. package/internals/models/fields.d.ts +32 -7
  175. package/internals/models/formProps.d.ts +14 -0
  176. package/internals/models/helpers.d.ts +0 -4
  177. package/internals/models/index.d.ts +2 -0
  178. package/internals/models/index.js +3 -1
  179. package/internals/models/props/basePickerProps.d.ts +5 -6
  180. package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
  181. package/internals/models/props/toolbar.d.ts +2 -3
  182. package/internals/models/validation.d.ts +21 -25
  183. package/internals/models/value.d.ts +3 -0
  184. package/internals/models/value.js +1 -0
  185. package/internals/utils/date-time-utils.d.ts +7 -7
  186. package/internals/utils/date-utils.d.ts +16 -16
  187. package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
  188. package/internals/utils/time-utils.d.ts +5 -5
  189. package/internals/utils/valueManagers.d.ts +3 -3
  190. package/locales/beBY.d.ts +3 -3
  191. package/locales/beBY.js +3 -3
  192. package/locales/bgBG.d.ts +3 -3
  193. package/locales/bgBG.js +3 -3
  194. package/locales/caES.d.ts +3 -3
  195. package/locales/caES.js +3 -3
  196. package/locales/csCZ.d.ts +3 -3
  197. package/locales/csCZ.js +3 -3
  198. package/locales/daDK.d.ts +3 -3
  199. package/locales/daDK.js +3 -3
  200. package/locales/deDE.d.ts +3 -3
  201. package/locales/deDE.js +3 -3
  202. package/locales/elGR.d.ts +3 -3
  203. package/locales/elGR.js +12 -13
  204. package/locales/enUS.d.ts +4 -4
  205. package/locales/enUS.js +3 -3
  206. package/locales/esES.d.ts +3 -3
  207. package/locales/esES.js +3 -3
  208. package/locales/eu.d.ts +3 -3
  209. package/locales/eu.js +3 -3
  210. package/locales/faIR.d.ts +3 -3
  211. package/locales/faIR.js +3 -3
  212. package/locales/fiFI.d.ts +3 -3
  213. package/locales/fiFI.js +3 -3
  214. package/locales/frFR.d.ts +3 -3
  215. package/locales/frFR.js +3 -3
  216. package/locales/heIL.d.ts +3 -3
  217. package/locales/heIL.js +3 -3
  218. package/locales/hrHR.d.ts +3 -3
  219. package/locales/hrHR.js +3 -3
  220. package/locales/huHU.d.ts +3 -3
  221. package/locales/huHU.js +3 -3
  222. package/locales/isIS.d.ts +3 -3
  223. package/locales/isIS.js +3 -3
  224. package/locales/itIT.d.ts +3 -3
  225. package/locales/itIT.js +3 -3
  226. package/locales/jaJP.d.ts +3 -3
  227. package/locales/jaJP.js +3 -3
  228. package/locales/koKR.d.ts +3 -3
  229. package/locales/koKR.js +3 -3
  230. package/locales/kzKZ.d.ts +3 -3
  231. package/locales/kzKZ.js +3 -3
  232. package/locales/mk.d.ts +3 -3
  233. package/locales/mk.js +3 -3
  234. package/locales/nbNO.d.ts +3 -3
  235. package/locales/nbNO.js +3 -3
  236. package/locales/nlNL.d.ts +3 -3
  237. package/locales/nlNL.js +3 -3
  238. package/locales/nnNO.d.ts +3 -3
  239. package/locales/nnNO.js +3 -3
  240. package/locales/plPL.d.ts +3 -3
  241. package/locales/plPL.js +3 -3
  242. package/locales/ptBR.d.ts +3 -3
  243. package/locales/ptBR.js +5 -3
  244. package/locales/ptPT.d.ts +3 -3
  245. package/locales/ptPT.js +3 -3
  246. package/locales/roRO.d.ts +3 -3
  247. package/locales/roRO.js +3 -3
  248. package/locales/ruRU.d.ts +3 -3
  249. package/locales/ruRU.js +3 -3
  250. package/locales/skSK.d.ts +3 -3
  251. package/locales/skSK.js +3 -3
  252. package/locales/svSE.d.ts +3 -3
  253. package/locales/svSE.js +3 -3
  254. package/locales/trTR.d.ts +3 -3
  255. package/locales/trTR.js +3 -3
  256. package/locales/ukUA.d.ts +3 -3
  257. package/locales/ukUA.js +3 -3
  258. package/locales/urPK.d.ts +3 -3
  259. package/locales/urPK.js +3 -3
  260. package/locales/utils/getPickersLocalization.d.ts +9 -9
  261. package/locales/utils/getPickersLocalization.js +1 -1
  262. package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
  263. package/locales/viVN.d.ts +3 -3
  264. package/locales/viVN.js +3 -3
  265. package/locales/zhCN.d.ts +3 -3
  266. package/locales/zhCN.js +3 -3
  267. package/locales/zhHK.d.ts +3 -3
  268. package/locales/zhHK.js +3 -3
  269. package/models/adapters.d.ts +151 -202
  270. package/models/fields.d.ts +9 -41
  271. package/models/pickers.d.ts +10 -6
  272. package/modern/DateCalendar/DateCalendar.js +20 -22
  273. package/modern/DateCalendar/DayCalendar.js +13 -10
  274. package/modern/DateField/DateField.js +8 -10
  275. package/modern/DatePicker/DatePicker.js +15 -14
  276. package/modern/DatePicker/DatePickerToolbar.js +12 -2
  277. package/modern/DateTimeField/DateTimeField.js +9 -12
  278. package/modern/DateTimePicker/DateTimePicker.js +16 -16
  279. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
  280. package/modern/DateTimePicker/DateTimePickerToolbar.js +12 -2
  281. package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
  282. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  283. package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  284. package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
  285. package/modern/DigitalClock/DigitalClock.js +7 -6
  286. package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
  287. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  288. package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
  289. package/modern/MonthCalendar/MonthCalendar.js +17 -14
  290. package/modern/MonthCalendar/PickersMonth.js +17 -13
  291. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  292. package/modern/PickersActionBar/PickersActionBar.js +2 -2
  293. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  294. package/modern/PickersLayout/PickersLayout.js +10 -0
  295. package/modern/PickersLayout/usePickerLayout.js +17 -18
  296. package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
  297. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  298. package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
  299. package/modern/TimeClock/Clock.js +3 -3
  300. package/modern/TimeClock/TimeClock.js +7 -6
  301. package/modern/TimeField/TimeField.js +6 -6
  302. package/modern/TimePicker/TimePicker.js +9 -4
  303. package/modern/TimePicker/TimePickerToolbar.js +12 -2
  304. package/modern/YearCalendar/PickersYear.js +17 -13
  305. package/modern/YearCalendar/YearCalendar.js +17 -14
  306. package/modern/hooks/index.js +2 -2
  307. package/modern/hooks/useClearableField.js +4 -3
  308. package/modern/hooks/useParsedFormat.js +2 -2
  309. package/modern/hooks/usePickerContext.js +15 -0
  310. package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
  311. package/modern/index.js +1 -1
  312. package/modern/internals/components/PickerProvider.js +38 -0
  313. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  314. package/modern/internals/hooks/useField/useField.js +1 -1
  315. package/modern/internals/hooks/useField/useField.utils.js +2 -1
  316. package/modern/internals/hooks/useField/useFieldState.js +3 -3
  317. package/modern/internals/hooks/useField/useFieldV7TextField.js +2 -2
  318. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  319. package/modern/internals/hooks/usePicker/usePicker.js +12 -4
  320. package/modern/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  321. package/modern/internals/hooks/usePicker/usePickerProvider.js +21 -0
  322. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -7
  323. package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
  324. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  325. package/modern/internals/hooks/useViews.js +1 -1
  326. package/modern/internals/index.js +2 -1
  327. package/modern/internals/models/formProps.js +1 -0
  328. package/modern/internals/models/index.js +3 -1
  329. package/modern/internals/models/props/time.js +1 -0
  330. package/modern/internals/models/value.js +1 -0
  331. package/modern/locales/beBY.js +3 -3
  332. package/modern/locales/bgBG.js +3 -3
  333. package/modern/locales/caES.js +3 -3
  334. package/modern/locales/csCZ.js +3 -3
  335. package/modern/locales/daDK.js +3 -3
  336. package/modern/locales/deDE.js +3 -3
  337. package/modern/locales/elGR.js +12 -13
  338. package/modern/locales/enUS.js +3 -3
  339. package/modern/locales/esES.js +3 -3
  340. package/modern/locales/eu.js +3 -3
  341. package/modern/locales/faIR.js +3 -3
  342. package/modern/locales/fiFI.js +3 -3
  343. package/modern/locales/frFR.js +3 -3
  344. package/modern/locales/heIL.js +3 -3
  345. package/modern/locales/hrHR.js +3 -3
  346. package/modern/locales/huHU.js +3 -3
  347. package/modern/locales/isIS.js +3 -3
  348. package/modern/locales/itIT.js +3 -3
  349. package/modern/locales/jaJP.js +3 -3
  350. package/modern/locales/koKR.js +3 -3
  351. package/modern/locales/kzKZ.js +3 -3
  352. package/modern/locales/mk.js +3 -3
  353. package/modern/locales/nbNO.js +3 -3
  354. package/modern/locales/nlNL.js +3 -3
  355. package/modern/locales/nnNO.js +3 -3
  356. package/modern/locales/plPL.js +3 -3
  357. package/modern/locales/ptBR.js +5 -3
  358. package/modern/locales/ptPT.js +3 -3
  359. package/modern/locales/roRO.js +3 -3
  360. package/modern/locales/ruRU.js +3 -3
  361. package/modern/locales/skSK.js +3 -3
  362. package/modern/locales/svSE.js +3 -3
  363. package/modern/locales/trTR.js +3 -3
  364. package/modern/locales/ukUA.js +3 -3
  365. package/modern/locales/urPK.js +3 -3
  366. package/modern/locales/utils/getPickersLocalization.js +1 -1
  367. package/modern/locales/viVN.js +3 -3
  368. package/modern/locales/zhCN.js +3 -3
  369. package/modern/locales/zhHK.js +3 -3
  370. package/modern/validation/useValidation.js +2 -3
  371. package/modern/validation/validateDate.js +5 -0
  372. package/modern/validation/validateDateTime.js +5 -0
  373. package/modern/validation/validateTime.js +5 -0
  374. package/node/DateCalendar/DateCalendar.js +20 -22
  375. package/node/DateCalendar/DayCalendar.js +13 -10
  376. package/node/DateField/DateField.js +8 -10
  377. package/node/DatePicker/DatePicker.js +15 -14
  378. package/node/DatePicker/DatePickerToolbar.js +12 -2
  379. package/node/DateTimeField/DateTimeField.js +9 -12
  380. package/node/DateTimePicker/DateTimePicker.js +16 -16
  381. package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
  382. package/node/DateTimePicker/DateTimePickerToolbar.js +12 -2
  383. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
  384. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  385. package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  386. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
  387. package/node/DigitalClock/DigitalClock.js +7 -6
  388. package/node/MobileDatePicker/MobileDatePicker.js +17 -16
  389. package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  390. package/node/MobileTimePicker/MobileTimePicker.js +11 -6
  391. package/node/MonthCalendar/MonthCalendar.js +17 -14
  392. package/node/MonthCalendar/PickersMonth.js +17 -13
  393. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  394. package/node/PickersActionBar/PickersActionBar.js +2 -2
  395. package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  396. package/node/PickersLayout/PickersLayout.js +10 -0
  397. package/node/PickersLayout/usePickerLayout.js +17 -18
  398. package/node/StaticDatePicker/StaticDatePicker.js +14 -13
  399. package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  400. package/node/StaticTimePicker/StaticTimePicker.js +8 -3
  401. package/node/TimeClock/Clock.js +3 -3
  402. package/node/TimeClock/TimeClock.js +7 -6
  403. package/node/TimeField/TimeField.js +6 -6
  404. package/node/TimePicker/TimePicker.js +9 -4
  405. package/node/TimePicker/TimePickerToolbar.js +12 -2
  406. package/node/YearCalendar/PickersYear.js +17 -13
  407. package/node/YearCalendar/YearCalendar.js +17 -14
  408. package/node/hooks/index.js +6 -6
  409. package/node/hooks/useClearableField.js +4 -3
  410. package/node/hooks/useParsedFormat.js +2 -2
  411. package/node/hooks/usePickerContext.js +21 -0
  412. package/node/hooks/usePickerTranslations.js +10 -0
  413. package/node/index.js +1 -1
  414. package/node/internals/components/PickerProvider.js +46 -0
  415. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  416. package/node/internals/hooks/useField/useField.js +1 -1
  417. package/node/internals/hooks/useField/useField.utils.js +2 -1
  418. package/node/internals/hooks/useField/useFieldState.js +3 -3
  419. package/node/internals/hooks/useField/useFieldV7TextField.js +2 -2
  420. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  421. package/node/internals/hooks/usePicker/usePicker.js +12 -4
  422. package/node/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  423. package/node/internals/hooks/usePicker/usePickerProvider.js +28 -0
  424. package/node/internals/hooks/usePicker/usePickerValue.js +1 -7
  425. package/node/internals/hooks/usePickerPrivateContext.js +15 -0
  426. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  427. package/node/internals/hooks/useViews.js +3 -3
  428. package/node/internals/index.js +14 -7
  429. package/node/internals/models/index.js +22 -0
  430. package/node/internals/models/props/time.js +5 -0
  431. package/node/internals/models/value.js +5 -0
  432. package/node/locales/beBY.js +3 -3
  433. package/node/locales/bgBG.js +3 -3
  434. package/node/locales/caES.js +3 -3
  435. package/node/locales/csCZ.js +3 -3
  436. package/node/locales/daDK.js +3 -3
  437. package/node/locales/deDE.js +3 -3
  438. package/node/locales/elGR.js +12 -13
  439. package/node/locales/enUS.js +3 -3
  440. package/node/locales/esES.js +3 -3
  441. package/node/locales/eu.js +3 -3
  442. package/node/locales/faIR.js +3 -3
  443. package/node/locales/fiFI.js +3 -3
  444. package/node/locales/frFR.js +3 -3
  445. package/node/locales/heIL.js +3 -3
  446. package/node/locales/hrHR.js +3 -3
  447. package/node/locales/huHU.js +3 -3
  448. package/node/locales/isIS.js +3 -3
  449. package/node/locales/itIT.js +3 -3
  450. package/node/locales/jaJP.js +3 -3
  451. package/node/locales/koKR.js +3 -3
  452. package/node/locales/kzKZ.js +3 -3
  453. package/node/locales/mk.js +3 -3
  454. package/node/locales/nbNO.js +3 -3
  455. package/node/locales/nlNL.js +3 -3
  456. package/node/locales/nnNO.js +3 -3
  457. package/node/locales/plPL.js +3 -3
  458. package/node/locales/ptBR.js +5 -3
  459. package/node/locales/ptPT.js +3 -3
  460. package/node/locales/roRO.js +3 -3
  461. package/node/locales/ruRU.js +3 -3
  462. package/node/locales/skSK.js +3 -3
  463. package/node/locales/svSE.js +3 -3
  464. package/node/locales/trTR.js +3 -3
  465. package/node/locales/ukUA.js +3 -3
  466. package/node/locales/urPK.js +3 -3
  467. package/node/locales/utils/getPickersLocalization.js +1 -1
  468. package/node/locales/viVN.js +3 -3
  469. package/node/locales/zhCN.js +3 -3
  470. package/node/locales/zhHK.js +3 -3
  471. package/node/validation/useValidation.js +2 -3
  472. package/node/validation/validateDate.js +4 -0
  473. package/node/validation/validateDateTime.js +4 -0
  474. package/node/validation/validateTime.js +4 -0
  475. package/package.json +3 -3
  476. package/themeAugmentation/props.d.ts +28 -28
  477. package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
  478. package/validation/extractValidationProps.d.ts +4 -4
  479. package/validation/useValidation.d.ts +9 -10
  480. package/validation/useValidation.js +2 -3
  481. package/validation/validateDate.d.ts +7 -2
  482. package/validation/validateDate.js +5 -0
  483. package/validation/validateDateTime.d.ts +10 -4
  484. package/validation/validateDateTime.js +5 -0
  485. package/validation/validateTime.d.ts +7 -2
  486. package/validation/validateTime.js +5 -0
  487. package/hooks/usePickersContext.d.ts +0 -4
  488. package/hooks/usePickersContext.js +0 -15
  489. package/hooks/usePickersTranslations.d.ts +0 -2
  490. package/internals/components/PickersProvider.js +0 -26
  491. package/modern/hooks/usePickersContext.js +0 -15
  492. package/modern/internals/components/PickersProvider.js +0 -26
  493. package/node/hooks/usePickersContext.js +0 -21
  494. package/node/hooks/usePickersTranslations.js +0 -10
  495. package/node/internals/components/PickersProvider.js +0 -34
  496. /package/internals/models/{props/clock.js → formProps.js} +0 -0
  497. /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
  498. /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
@@ -37,7 +37,7 @@ const ptPTPickers = {
37
37
  timePickerToolbarTitle: 'Selecione a hora',
38
38
  dateRangePickerToolbarTitle: 'Selecione o intervalo de datas',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `Selecione ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Hora não selecionada' : `Selecionado a hora ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `Selecione ${timeViews[view]}. ${!formattedTime ? 'Hora não selecionada' : `Selecionado a hora ${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours} horas`,
42
42
  minutesClockNumberText: minutes => `${minutes} minutos`,
43
43
  secondsClockNumberText: seconds => `${seconds} segundos`,
@@ -49,8 +49,8 @@ const ptPTPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `Semana ${weekNumber}`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Escolha uma data, a data selecionada é ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Escolha uma data',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Escolha uma hora, a hora selecionada é ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Escolha uma hora',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `Escolha uma data, a data selecionada é ${formattedDate}` : 'Escolha uma data',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `Escolha uma hora, a hora selecionada é ${formattedTime}` : 'Escolha uma hora',
54
54
  fieldClearLabel: 'Limpar valor',
55
55
  // Table labels
56
56
  timeTableLabel: 'escolha uma hora',
@@ -39,7 +39,7 @@ const roROPickers = {
39
39
  timePickerToolbarTitle: 'Selectați ora',
40
40
  dateRangePickerToolbarTitle: 'Selectați intervalul de date',
41
41
  // Clock labels
42
- clockLabelText: (view, time, utils, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
42
+ clockLabelText: (view, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime}`}`,
43
43
  hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
44
44
  minutesClockNumberText: minutes => `${minutes} ${timeViews.minutes}`,
45
45
  secondsClockNumberText: seconds => `${seconds} ${timeViews.seconds}`,
@@ -51,8 +51,8 @@ const roROPickers = {
51
51
  calendarWeekNumberAriaLabelText: weekNumber => `Săptămâna ${weekNumber}`,
52
52
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
53
53
  // Open picker labels
54
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Selectați data, data selectată este ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Selectați data',
55
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Selectați ora, ora selectată este ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Selectați ora',
54
+ openDatePickerDialogue: formattedDate => formattedDate ? `Selectați data, data selectată este ${formattedDate}` : 'Selectați data',
55
+ openTimePickerDialogue: formattedTime => formattedTime ? `Selectați ora, ora selectată este ${formattedTime}` : 'Selectați ora',
56
56
  fieldClearLabel: 'Golire conținut',
57
57
  // Table labels
58
58
  timeTableLabel: 'Selectați ora',
@@ -38,7 +38,7 @@ const ruRUPickers = {
38
38
  timePickerToolbarTitle: 'Выбрать время',
39
39
  dateRangePickerToolbarTitle: 'Выбрать период',
40
40
  // Clock labels
41
- clockLabelText: (view, time, utils, formattedTime) => `Выбрать ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Время не выбрано' : `Выбрано время ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
41
+ clockLabelText: (view, formattedTime) => `Выбрать ${timeViews[view]}. ${!formattedTime ? 'Время не выбрано' : `Выбрано время ${formattedTime}`}`,
42
42
  hoursClockNumberText: hours => `${hours} часов`,
43
43
  minutesClockNumberText: minutes => `${minutes} минут`,
44
44
  secondsClockNumberText: seconds => `${seconds} секунд`,
@@ -50,8 +50,8 @@ const ruRUPickers = {
50
50
  calendarWeekNumberAriaLabelText: weekNumber => `Неделя ${weekNumber}`,
51
51
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
52
52
  // Open picker labels
53
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Выберите дату, выбрана дата ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Выберите дату',
54
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Выберите время, выбрано время ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Выберите время',
53
+ openDatePickerDialogue: formattedDate => formattedDate ? `Выберите дату, выбрана дата ${formattedDate}` : 'Выберите дату',
54
+ openTimePickerDialogue: formattedTime => formattedTime ? `Выберите время, выбрано время ${formattedTime}` : 'Выберите время',
55
55
  fieldClearLabel: 'Очистить значение',
56
56
  // Table labels
57
57
  timeTableLabel: 'выбрать время',
@@ -39,7 +39,7 @@ const skSKPickers = {
39
39
  timePickerToolbarTitle: 'Vyberte čas',
40
40
  dateRangePickerToolbarTitle: 'Vyberete rozmedzie dátumov',
41
41
  // Clock labels
42
- clockLabelText: (view, time, utils, formattedTime) => `${timeViews[view] ?? view} vybraný. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Nie je vybraný čas' : `Vybraný čas je ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
42
+ clockLabelText: (view, formattedTime) => `${timeViews[view] ?? view} vybraný. ${!formattedTime ? 'Nie je vybraný čas' : `Vybraný čas je ${formattedTime}`}`,
43
43
  hoursClockNumberText: hours => `${hours} hodín`,
44
44
  minutesClockNumberText: minutes => `${minutes} minút`,
45
45
  secondsClockNumberText: seconds => `${seconds} sekúnd`,
@@ -51,8 +51,8 @@ const skSKPickers = {
51
51
  calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} týždeň v roku`,
52
52
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
53
53
  // Open picker labels
54
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Vyberte dátum, vybraný dátum je ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Vyberte dátum',
55
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Vyberte čas, vybraný čas je ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Vyberte čas',
54
+ openDatePickerDialogue: formattedDate => formattedDate ? `Vyberte dátum, vybraný dátum je ${formattedDate}` : 'Vyberte dátum',
55
+ openTimePickerDialogue: formattedTime => formattedTime ? `Vyberte čas, vybraný čas je ${formattedTime}` : 'Vyberte čas',
56
56
  // fieldClearLabel: 'Clear',
57
57
 
58
58
  // Table labels
@@ -37,7 +37,7 @@ const svSEPickers = {
37
37
  timePickerToolbarTitle: 'Välj tid',
38
38
  dateRangePickerToolbarTitle: 'Välj datumintervall',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `Välj ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ingen tid vald' : `Vald tid är ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `Välj ${timeViews[view]}. ${!formattedTime ? 'Ingen tid vald' : `Vald tid är ${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours} timmar`,
42
42
  minutesClockNumberText: minutes => `${minutes} minuter`,
43
43
  secondsClockNumberText: seconds => `${seconds} sekunder`,
@@ -49,8 +49,8 @@ const svSEPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `Vecka ${weekNumber}`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Välj datum, valt datum är ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Välj datum',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Välj tid, vald tid är ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Välj tid',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `Välj datum, valt datum är ${formattedDate}` : 'Välj datum',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `Välj tid, vald tid är ${formattedTime}` : 'Välj tid',
54
54
  fieldClearLabel: 'Rensa värde',
55
55
  // Table labels
56
56
  timeTableLabel: 'välj tid',
@@ -38,7 +38,7 @@ const trTRPickers = {
38
38
  timePickerToolbarTitle: 'Saat seç',
39
39
  dateRangePickerToolbarTitle: 'Tarih aralığı seçin',
40
40
  // Clock labels
41
- clockLabelText: (view, time, utils, formattedTime) => `${timeViews[view]} seç. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Zaman seçilmedi' : `Seçilen zaman: ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
41
+ clockLabelText: (view, formattedTime) => `${timeViews[view]} seç. ${!formattedTime ? 'Zaman seçilmedi' : `Seçilen zaman: ${formattedTime}`}`,
42
42
  hoursClockNumberText: hours => `${hours} saat`,
43
43
  minutesClockNumberText: minutes => `${minutes} dakika`,
44
44
  secondsClockNumberText: seconds => `${seconds} saniye`,
@@ -50,8 +50,8 @@ const trTRPickers = {
50
50
  calendarWeekNumberAriaLabelText: weekNumber => `Hafta ${weekNumber}`,
51
51
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
52
52
  // Open picker labels
53
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Tarih seçin, seçilen tarih: ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Tarih seç',
54
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Saat seçin, seçilen saat: ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Saat seç',
53
+ openDatePickerDialogue: formattedDate => formattedDate ? `Tarih seçin, seçilen tarih: ${formattedDate}` : 'Tarih seç',
54
+ openTimePickerDialogue: formattedTime => formattedTime ? `Saat seçin, seçilen saat: ${formattedTime}` : 'Saat seç',
55
55
  // fieldClearLabel: 'Clear',
56
56
 
57
57
  // Table labels
@@ -37,7 +37,7 @@ const ukUAPickers = {
37
37
  timePickerToolbarTitle: 'Вибрати час',
38
38
  dateRangePickerToolbarTitle: 'Вибрати календарний період',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `Вибрати ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Час не вибраний' : `Вибрано час ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `Вибрати ${timeViews[view]}. ${!formattedTime ? 'Час не вибраний' : `Вибрано час ${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours} годин`,
42
42
  minutesClockNumberText: minutes => `${minutes} хвилин`,
43
43
  secondsClockNumberText: seconds => `${seconds} секунд`,
@@ -49,8 +49,8 @@ const ukUAPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `Тиждень ${weekNumber}`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Оберіть дату, обрана дата ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Оберіть дату',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Оберіть час, обраний час ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Оберіть час',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `Оберіть дату, обрана дата ${formattedDate}` : 'Оберіть дату',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `Оберіть час, обраний час ${formattedTime}` : 'Оберіть час',
54
54
  fieldClearLabel: 'Очистити дані',
55
55
  // Table labels
56
56
  timeTableLabel: 'оберіть час',
@@ -38,7 +38,7 @@ const urPKPickers = {
38
38
  timePickerToolbarTitle: 'وقت منتخب کریں',
39
39
  dateRangePickerToolbarTitle: 'تاریخوں کی رینج منتخب کریں',
40
40
  // Clock labels
41
- clockLabelText: (view, time, utils, formattedTime) => `${timeViews[view]} منتخب کریں ${!formattedTime && (time === null || !utils.isValid(time)) ? 'کوئی وقت منتخب نہیں' : `منتخب وقت ہے ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
41
+ clockLabelText: (view, formattedTime) => `${timeViews[view]} منتخب کریں ${!formattedTime ? 'کوئی وقت منتخب نہیں' : `منتخب وقت ہے ${formattedTime}`}`,
42
42
  hoursClockNumberText: hours => `${hours} گھنٹے`,
43
43
  minutesClockNumberText: minutes => `${minutes} منٹ`,
44
44
  secondsClockNumberText: seconds => `${seconds} سیکنڈ`,
@@ -50,8 +50,8 @@ const urPKPickers = {
50
50
  calendarWeekNumberAriaLabelText: weekNumber => `ہفتہ ${weekNumber}`,
51
51
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
52
52
  // Open picker labels
53
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `تاریخ منتخب کریں، منتخب شدہ تاریخ ہے ${formattedDate ?? utils.format(value, 'fullDate')}` : 'تاریخ منتخب کریں',
54
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `وقت منتخب کریں، منتخب شدہ وقت ہے ${formattedTime ?? utils.format(value, 'fullTime')}` : 'وقت منتخب کریں',
53
+ openDatePickerDialogue: formattedDate => formattedDate ? `تاریخ منتخب کریں، منتخب شدہ تاریخ ہے ${formattedDate}` : 'تاریخ منتخب کریں',
54
+ openTimePickerDialogue: formattedTime => formattedTime ? `وقت منتخب کریں، منتخب شدہ وقت ہے ${formattedTime}` : 'وقت منتخب کریں',
55
55
  // fieldClearLabel: 'Clear',
56
56
 
57
57
  // Table labels
@@ -28,7 +28,7 @@ const buildGetOpenDialogAriaText = params => {
28
28
  return value => {
29
29
  const formattedValue = value !== null && utils.isValid(value) ? utils.format(value, formatKey) : null;
30
30
  const translation = propsTranslation ?? contextTranslation;
31
- return translation(value, utils, formattedValue);
31
+ return translation(formattedValue);
32
32
  };
33
33
  };
34
34
  exports.buildGetOpenDialogAriaText = buildGetOpenDialogAriaText;
@@ -37,7 +37,7 @@ const viVNPickers = {
37
37
  timePickerToolbarTitle: 'Chọn giờ',
38
38
  dateRangePickerToolbarTitle: 'Chọn khoảng ngày',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `Chọn ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Không có giờ được chọn' : `Giờ được chọn là ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `Chọn ${views[view]}. ${!formattedTime ? 'Không có giờ được chọn' : `Giờ được chọn là ${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours} giờ`,
42
42
  minutesClockNumberText: minutes => `${minutes} phút`,
43
43
  secondsClockNumberText: seconds => `${seconds} giây`,
@@ -49,8 +49,8 @@ const viVNPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `Tuần ${weekNumber}`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Chọn ngày, ngày đã chọn là ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Chọn ngày',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Chọn giờ, giờ đã chọn là ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Chọn giờ',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `Chọn ngày, ngày đã chọn là ${formattedDate}` : 'Chọn ngày',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `Chọn giờ, giờ đã chọn là ${formattedTime}` : 'Chọn giờ',
54
54
  fieldClearLabel: 'Xóa giá trị',
55
55
  // Table labels
56
56
  timeTableLabel: 'chọn giờ',
@@ -37,7 +37,7 @@ const zhCNPickers = {
37
37
  timePickerToolbarTitle: '选择时间',
38
38
  dateRangePickerToolbarTitle: '选择时间范围',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `选择 ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? '未选择时间' : `已选择${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `选择 ${views[view]}. ${!formattedTime ? '未选择时间' : `已选择${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours}小时`,
42
42
  minutesClockNumberText: minutes => `${minutes}分钟`,
43
43
  secondsClockNumberText: seconds => `${seconds}秒`,
@@ -49,8 +49,8 @@ const zhCNPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}周`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `选择日期,已选择${formattedDate ?? utils.format(value, 'fullDate')}` : '选择日期',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `选择时间,已选择${formattedTime ?? utils.format(value, 'fullTime')}` : '选择时间',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `选择日期,已选择${formattedDate}` : '选择日期',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `选择时间,已选择${formattedTime}` : '选择时间',
54
54
  fieldClearLabel: '清除',
55
55
  // Table labels
56
56
  timeTableLabel: '选择时间',
@@ -37,7 +37,7 @@ const zhHKPickers = {
37
37
  timePickerToolbarTitle: '選擇時間',
38
38
  dateRangePickerToolbarTitle: '選擇時間範圍',
39
39
  // Clock labels
40
- clockLabelText: (view, time, utils, formattedTime) => `選擇 ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? '未選擇時間' : `已選擇${formattedTime ?? utils.format(time, 'fullTime')}`}`,
40
+ clockLabelText: (view, formattedTime) => `選擇 ${views[view]}. ${!formattedTime ? '未選擇時間' : `已選擇${formattedTime}`}`,
41
41
  hoursClockNumberText: hours => `${hours}小時`,
42
42
  minutesClockNumberText: minutes => `${minutes}分鐘`,
43
43
  secondsClockNumberText: seconds => `${seconds}秒`,
@@ -49,8 +49,8 @@ const zhHKPickers = {
49
49
  calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}週`,
50
50
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
51
51
  // Open picker labels
52
- openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `選擇日期,已選擇${formattedDate ?? utils.format(value, 'fullDate')}` : '選擇日期',
53
- openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `選擇時間,已選擇${formattedTime ?? utils.format(value, 'fullTime')}` : '選擇時間',
52
+ openDatePickerDialogue: formattedDate => formattedDate ? `選擇日期,已選擇${formattedDate}` : '選擇日期',
53
+ openTimePickerDialogue: formattedTime => formattedTime ? `選擇時間,已選擇${formattedTime}` : '選擇時間',
54
54
  fieldClearLabel: '清除',
55
55
  // Table labels
56
56
  timeTableLabel: '選擇時間',
@@ -12,13 +12,12 @@ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallb
12
12
  var _useUtils = require("../internals/hooks/useUtils");
13
13
  /**
14
14
  * Utility hook to check if a given value is valid based on the provided validation props.
15
- * @template TDate
16
15
  * @template TValue The value type. It will be either the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
17
16
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
18
- * @param {UseValidationOptions<TValue, TDate, TError, TValidationProps>} options The options to configure the hook.
17
+ * @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
19
18
  * @param {TValue} options.value The value to validate.
20
19
  * @param {PickersTimezone} options.timezone The timezone to use for the validation.
21
- * @param {Validator<TValue, TDate, TError, TValidationProps>} options.validator The validator function to use.
20
+ * @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
22
21
  * @param {TValidationProps} options.props The validation props, they differ depending on the component.
23
22
  * @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
24
23
  */
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.validateDate = void 0;
7
7
  var _dateUtils = require("../internals/utils/date-utils");
8
8
  var _valueManagers = require("../internals/utils/valueManagers");
9
+ /**
10
+ * Validation props used by the Date Picker, Date Field and Date Calendar components.
11
+ */
12
+
9
13
  const validateDate = ({
10
14
  props,
11
15
  value,
@@ -7,6 +7,10 @@ exports.validateDateTime = void 0;
7
7
  var _validateDate = require("./validateDate");
8
8
  var _validateTime = require("./validateTime");
9
9
  var _valueManagers = require("../internals/utils/valueManagers");
10
+ /**
11
+ * Validation props used by the Date Time Picker and Date Time Field components.
12
+ */
13
+
10
14
  const validateDateTime = ({
11
15
  adapter,
12
16
  value,
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.validateTime = void 0;
7
7
  var _timeUtils = require("../internals/utils/time-utils");
8
8
  var _valueManagers = require("../internals/utils/valueManagers");
9
+ /**
10
+ * Validation props used by the Time Picker, Time Field and Clock components.
11
+ */
12
+
9
13
  const validateTime = ({
10
14
  adapter,
11
15
  value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "7.22.2",
3
+ "version": "8.0.0-alpha.0",
4
4
  "description": "The community edition of the Date and Time Picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -35,13 +35,13 @@
35
35
  "directory": "packages/x-date-pickers"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.25.7",
38
+ "@babel/runtime": "^7.26.0",
39
39
  "@mui/utils": "^5.16.6 || ^6.0.0",
40
40
  "@types/react-transition-group": "^4.4.11",
41
41
  "clsx": "^2.1.1",
42
42
  "prop-types": "^15.8.1",
43
43
  "react-transition-group": "^4.4.5",
44
- "@mui/x-internals": "7.21.0"
44
+ "@mui/x-internals": "8.0.0-alpha.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@emotion/react": "^11.9.0",
@@ -17,7 +17,7 @@ import { PickerPopperProps } from '../internals/components/PickersPopper';
17
17
  import { PickersToolbarProps } from '../internals/components/PickersToolbar';
18
18
  import { PickersToolbarButtonProps } from '../internals/components/PickersToolbarButton';
19
19
  import { ExportedPickersToolbarTextProps } from '../internals/components/PickersToolbarText';
20
- import { DateOrTimeView, PickerValidDate } from '../models';
20
+ import { DateOrTimeView } from '../models';
21
21
 
22
22
  import { DatePickerProps } from '../DatePicker';
23
23
  import { ExportedDatePickerToolbarProps } from '../DatePicker/DatePickerToolbar';
@@ -54,25 +54,25 @@ import {
54
54
  import { PickersSectionListProps } from '../PickersSectionList';
55
55
 
56
56
  export interface PickersComponentsPropsList {
57
- MuiClock: ClockProps<PickerValidDate>;
57
+ MuiClock: ClockProps;
58
58
  MuiClockNumber: ClockNumberProps;
59
59
  MuiClockPointer: ClockPointerProps;
60
- MuiDateCalendar: DateCalendarProps<PickerValidDate>;
61
- MuiDateField: DateFieldProps<PickerValidDate, any>;
60
+ MuiDateCalendar: DateCalendarProps;
61
+ MuiDateField: DateFieldProps<any>;
62
62
  MuiDatePickerToolbar: ExportedDatePickerToolbarProps;
63
- MuiDateTimeField: DateTimeFieldProps<PickerValidDate, any>;
63
+ MuiDateTimeField: DateTimeFieldProps<any>;
64
64
  MuiDateTimePickerTabs: DateTimePickerTabsProps;
65
65
  MuiDateTimePickerToolbar: ExportedDateTimePickerToolbarProps;
66
- MuiDayCalendar: DayCalendarProps<PickerValidDate>;
66
+ MuiDayCalendar: DayCalendarProps;
67
67
  MuiDayCalendarSkeleton: DayCalendarSkeletonProps;
68
- MuiDigitalClock: ExportedDigitalClockProps<PickerValidDate>;
69
- MuiLocalizationProvider: LocalizationProviderProps<PickerValidDate, unknown>;
70
- MuiMonthCalendar: MonthCalendarProps<PickerValidDate>;
71
- MuiMultiSectionDigitalClock: MultiSectionDigitalClockProps<PickerValidDate>;
68
+ MuiDigitalClock: ExportedDigitalClockProps;
69
+ MuiLocalizationProvider: LocalizationProviderProps<unknown>;
70
+ MuiMonthCalendar: MonthCalendarProps;
71
+ MuiMultiSectionDigitalClock: MultiSectionDigitalClockProps;
72
72
  MuiMultiSectionDigitalClockSection: ExportedMultiSectionDigitalClockSectionProps;
73
73
  MuiPickersArrowSwitcher: ExportedPickersArrowSwitcherProps;
74
- MuiPickersCalendarHeader: ExportedPickersCalendarHeaderProps<PickerValidDate>;
75
- MuiPickersDay: PickersDayProps<PickerValidDate>;
74
+ MuiPickersCalendarHeader: ExportedPickersCalendarHeaderProps;
75
+ MuiPickersDay: PickersDayProps;
76
76
  MuiPickersFadeTransitionGroup: PickersFadeTransitionGroupProps;
77
77
  MuiPickersMonth: ExportedPickersMonthProps;
78
78
  MuiPickersPopper: PickerPopperProps;
@@ -80,30 +80,30 @@ export interface PickersComponentsPropsList {
80
80
  MuiPickersToolbar: PickersToolbarProps<unknown, DateOrTimeView>;
81
81
  MuiPickersToolbarButton: PickersToolbarButtonProps;
82
82
  MuiPickersToolbarText: ExportedPickersToolbarTextProps;
83
- MuiPickersLayout: PickersLayoutProps<unknown, PickerValidDate, DateOrTimeView>;
83
+ MuiPickersLayout: PickersLayoutProps<unknown, DateOrTimeView>;
84
84
  MuiPickersYear: ExportedPickersYearProps;
85
- MuiTimeClock: TimeClockProps<PickerValidDate>;
86
- MuiTimeField: TimeFieldProps<PickerValidDate, any>;
85
+ MuiTimeClock: TimeClockProps;
86
+ MuiTimeField: TimeFieldProps<any>;
87
87
  MuiTimePickerToolbar: ExportedTimePickerToolbarProps;
88
- MuiYearCalendar: YearCalendarProps<PickerValidDate>;
88
+ MuiYearCalendar: YearCalendarProps;
89
89
 
90
90
  // Date Pickers
91
- MuiDatePicker: DatePickerProps<PickerValidDate>;
92
- MuiDesktopDatePicker: DesktopDatePickerProps<PickerValidDate>;
93
- MuiMobileDatePicker: MobileDatePickerProps<PickerValidDate>;
94
- MuiStaticDatePicker: StaticDatePickerProps<PickerValidDate>;
91
+ MuiDatePicker: DatePickerProps;
92
+ MuiDesktopDatePicker: DesktopDatePickerProps;
93
+ MuiMobileDatePicker: MobileDatePickerProps;
94
+ MuiStaticDatePicker: StaticDatePickerProps;
95
95
 
96
96
  // Time Pickers
97
- MuiTimePicker: TimePickerProps<PickerValidDate>;
98
- MuiDesktopTimePicker: DesktopTimePickerProps<PickerValidDate>;
99
- MuiMobileTimePicker: MobileTimePickerProps<PickerValidDate>;
100
- MuiStaticTimePicker: StaticTimePickerProps<PickerValidDate>;
97
+ MuiTimePicker: TimePickerProps;
98
+ MuiDesktopTimePicker: DesktopTimePickerProps;
99
+ MuiMobileTimePicker: MobileTimePickerProps;
100
+ MuiStaticTimePicker: StaticTimePickerProps;
101
101
 
102
102
  // Date Time Pickers
103
- MuiDateTimePicker: DateTimePickerProps<PickerValidDate>;
104
- MuiDesktopDateTimePicker: DesktopDateTimePickerProps<PickerValidDate>;
105
- MuiMobileDateTimePicker: MobileDateTimePickerProps<PickerValidDate>;
106
- MuiStaticDateTimePicker: StaticDateTimePickerProps<PickerValidDate>;
103
+ MuiDateTimePicker: DateTimePickerProps;
104
+ MuiDesktopDateTimePicker: DesktopDateTimePickerProps;
105
+ MuiMobileDateTimePicker: MobileDateTimePickerProps;
106
+ MuiStaticDateTimePicker: StaticDateTimePickerProps;
107
107
 
108
108
  // V7 Picker's TextField
109
109
  MuiPickersTextField: PickersTextFieldProps;
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { TimeClockProps } from '../TimeClock';
3
- import { PickerValidDate, TimeView } from '../models';
3
+ import { TimeView } from '../models';
4
4
  import { DigitalClockProps } from '../DigitalClock';
5
- import { BaseClockProps } from '../internals/models/props/clock';
5
+ import { BaseClockProps } from '../internals/models/props/time';
6
6
  import { MultiSectionDigitalClockProps } from '../MultiSectionDigitalClock';
7
7
  import { TimeViewWithMeridiem } from '../internals/models';
8
8
  import type { TimePickerProps } from '../TimePicker/TimePicker.types';
9
- export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponentProps extends BaseClockProps<any, TView>> = Omit<TComponentProps, 'views' | 'openTo' | 'view' | 'onViewChange'> & {
9
+ export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponentProps extends BaseClockProps<TView>> = Omit<TComponentProps, 'views' | 'openTo' | 'view' | 'onViewChange'> & {
10
10
  view: TView;
11
11
  onViewChange?: (view: TView) => void;
12
12
  views: readonly TView[];
13
13
  };
14
- export declare const renderTimeViewClock: <TDate extends PickerValidDate>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TDate, TimeView>>) => React.JSX.Element;
15
- export declare const renderDigitalClockTimeView: <TDate extends PickerValidDate>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps<TDate>, "timeStep"> & Pick<TimePickerProps<TDate>, "timeSteps">>) => React.JSX.Element;
16
- export declare const renderMultiSectionDigitalClockTimeView: <TDate extends PickerValidDate>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps<TDate>>) => React.JSX.Element;
14
+ export declare const renderTimeViewClock: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => React.JSX.Element;
15
+ export declare const renderDigitalClockTimeView: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => React.JSX.Element;
16
+ export declare const renderMultiSectionDigitalClockTimeView: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
2
- export declare const DATE_VALIDATION_PROP_NAMES: (keyof BaseDateValidationProps<any> | keyof YearValidationProps<any> | keyof MonthValidationProps<any> | keyof DayValidationProps<any>)[];
3
- export declare const TIME_VALIDATION_PROP_NAMES: (keyof BaseTimeValidationProps | keyof TimeValidationProps<any> | 'ampm')[];
4
- export declare const DATE_TIME_VALIDATION_PROP_NAMES: (keyof DateTimeValidationProps<any>)[];
2
+ export declare const DATE_VALIDATION_PROP_NAMES: (keyof BaseDateValidationProps | keyof YearValidationProps | keyof MonthValidationProps | keyof DayValidationProps)[];
3
+ export declare const TIME_VALIDATION_PROP_NAMES: (keyof BaseTimeValidationProps | keyof TimeValidationProps | 'ampm')[];
4
+ export declare const DATE_TIME_VALIDATION_PROP_NAMES: (keyof DateTimeValidationProps)[];
5
5
  /**
6
6
  * Extract the validation props for the props received by a component.
7
7
  * Limit the risk of forgetting some of them and reduce the bundle size.
8
8
  */
9
9
  export declare const extractValidationProps: <Props extends {
10
10
  [key: string]: any;
11
- }>(props: Props) => Pick<Props, "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime">;
11
+ }>(props: Props) => Pick<Props, "ampm" | "disableFuture" | "disablePast" | "maxDate" | "minDate" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime">;
@@ -1,16 +1,16 @@
1
1
  import { MuiPickersAdapterContextValue } from '../LocalizationProvider/LocalizationProvider';
2
- import { OnErrorProps, PickersTimezone, PickerValidDate } from '../models';
2
+ import { OnErrorProps, PickersTimezone } from '../models';
3
3
  import type { PickerValueManager } from '../internals/hooks/usePicker';
4
- export type Validator<TValue, TDate extends PickerValidDate, TError, TValidationProps> = {
4
+ export type Validator<TValue, TError, TValidationProps> = {
5
5
  (params: {
6
- adapter: MuiPickersAdapterContextValue<TDate>;
6
+ adapter: MuiPickersAdapterContextValue;
7
7
  value: TValue;
8
8
  timezone: PickersTimezone;
9
9
  props: TValidationProps;
10
10
  }): TError;
11
- valueManager: PickerValueManager<TValue, TDate, any>;
11
+ valueManager: PickerValueManager<TValue, any>;
12
12
  };
13
- interface UseValidationOptions<TValue, TDate extends PickerValidDate, TError, TValidationProps extends {}> extends OnErrorProps<TValue, TError> {
13
+ interface UseValidationOptions<TValue, TError, TValidationProps extends {}> extends OnErrorProps<TValue, TError> {
14
14
  /**
15
15
  * The value to validate.
16
16
  */
@@ -25,7 +25,7 @@ interface UseValidationOptions<TValue, TDate extends PickerValidDate, TError, TV
25
25
  * It is recommended to only use the validator exported by the MUI X packages,
26
26
  * otherwise you may have inconsistent behaviors between the field and the views.
27
27
  */
28
- validator: Validator<TValue, TDate, TError, TValidationProps>;
28
+ validator: Validator<TValue, TError, TValidationProps>;
29
29
  /**
30
30
  * The validation props, they differ depending on the component.
31
31
  * For example, the `validateTime` function supports `minTime`, `maxTime`, etc.
@@ -54,15 +54,14 @@ interface UseValidationReturnValue<TValue, TError> {
54
54
  }
55
55
  /**
56
56
  * Utility hook to check if a given value is valid based on the provided validation props.
57
- * @template TDate
58
57
  * @template TValue The value type. It will be either the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
59
58
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
60
- * @param {UseValidationOptions<TValue, TDate, TError, TValidationProps>} options The options to configure the hook.
59
+ * @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
61
60
  * @param {TValue} options.value The value to validate.
62
61
  * @param {PickersTimezone} options.timezone The timezone to use for the validation.
63
- * @param {Validator<TValue, TDate, TError, TValidationProps>} options.validator The validator function to use.
62
+ * @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
64
63
  * @param {TValidationProps} options.props The validation props, they differ depending on the component.
65
64
  * @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
66
65
  */
67
- export declare function useValidation<TValue, TDate extends PickerValidDate, TError, TValidationProps extends {}>(options: UseValidationOptions<TValue, TDate, TError, TValidationProps>): UseValidationReturnValue<TValue, TError>;
66
+ export declare function useValidation<TValue, TError, TValidationProps extends {}>(options: UseValidationOptions<TValue, TError, TValidationProps>): UseValidationReturnValue<TValue, TError>;
68
67
  export {};
@@ -5,13 +5,12 @@ import useEventCallback from '@mui/utils/useEventCallback';
5
5
  import { useLocalizationContext } from "../internals/hooks/useUtils.js";
6
6
  /**
7
7
  * Utility hook to check if a given value is valid based on the provided validation props.
8
- * @template TDate
9
8
  * @template TValue The value type. It will be either the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
10
9
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
11
- * @param {UseValidationOptions<TValue, TDate, TError, TValidationProps>} options The options to configure the hook.
10
+ * @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
12
11
  * @param {TValue} options.value The value to validate.
13
12
  * @param {PickersTimezone} options.timezone The timezone to use for the validation.
14
- * @param {Validator<TValue, TDate, TError, TValidationProps>} options.validator The validator function to use.
13
+ * @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
15
14
  * @param {TValidationProps} options.props The validation props, they differ depending on the component.
16
15
  * @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
17
16
  */
@@ -1,6 +1,11 @@
1
1
  import { Validator } from './useValidation';
2
2
  import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
3
3
  import { DateValidationError, PickerValidDate } from '../models';
4
- export interface ValidateDateProps<TDate extends PickerValidDate> extends DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>> {
4
+ /**
5
+ * Validation props used by the Date Picker, Date Field and Date Calendar components.
6
+ */
7
+ export interface ExportedValidateDateProps extends DayValidationProps, MonthValidationProps, YearValidationProps, BaseDateValidationProps {
5
8
  }
6
- export declare const validateDate: Validator<any | null, any, DateValidationError, ValidateDateProps<any>>;
9
+ export interface ValidateDateProps extends DayValidationProps, MonthValidationProps, YearValidationProps, Required<BaseDateValidationProps> {
10
+ }
11
+ export declare const validateDate: Validator<PickerValidDate | null, DateValidationError, ValidateDateProps>;
@@ -1,5 +1,10 @@
1
1
  import { applyDefaultDate } from "../internals/utils/date-utils.js";
2
2
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
3
+
4
+ /**
5
+ * Validation props used by the Date Picker, Date Field and Date Calendar components.
6
+ */
7
+
3
8
  export const validateDate = ({
4
9
  props,
5
10
  value,
@@ -1,7 +1,13 @@
1
1
  import { Validator } from './useValidation';
2
- import { ValidateDateProps } from './validateDate';
3
- import { ValidateTimeProps } from './validateTime';
2
+ import { ExportedValidateDateProps, ValidateDateProps } from './validateDate';
3
+ import { ExportedValidateTimeProps, ValidateTimeProps } from './validateTime';
4
4
  import { DateTimeValidationError, PickerValidDate } from '../models';
5
- export interface ValidateDateTimeProps<TDate extends PickerValidDate> extends ValidateDateProps<TDate>, ValidateTimeProps<TDate> {
5
+ import { DateTimeValidationProps } from '../internals/models/validation';
6
+ /**
7
+ * Validation props used by the Date Time Picker and Date Time Field components.
8
+ */
9
+ export interface ExportedValidateDateTimeProps extends ExportedValidateDateProps, ExportedValidateTimeProps, DateTimeValidationProps {
6
10
  }
7
- export declare const validateDateTime: Validator<any | null, any, DateTimeValidationError, ValidateDateTimeProps<any>>;
11
+ export interface ValidateDateTimeProps extends ValidateDateProps, ValidateTimeProps {
12
+ }
13
+ export declare const validateDateTime: Validator<PickerValidDate | null, DateTimeValidationError, ValidateDateTimeProps>;
@@ -1,6 +1,11 @@
1
1
  import { validateDate } from "./validateDate.js";
2
2
  import { validateTime } from "./validateTime.js";
3
3
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
4
+
5
+ /**
6
+ * Validation props used by the Date Time Picker and Date Time Field components.
7
+ */
8
+
4
9
  export const validateDateTime = ({
5
10
  adapter,
6
11
  value,