@mui/x-date-pickers 7.16.0 → 7.18.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 (390) hide show
  1. package/AdapterDateFns/AdapterDateFns.js +1 -1
  2. package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  3. package/AdapterDayjs/AdapterDayjs.js +1 -1
  4. package/CHANGELOG.md +184 -4
  5. package/DateCalendar/DateCalendar.js +11 -1
  6. package/DateCalendar/useCalendarState.js +2 -0
  7. package/DateCalendar/useIsDateDisabled.d.ts +4 -3
  8. package/DateCalendar/useIsDateDisabled.js +5 -3
  9. package/DateField/DateField.js +2 -0
  10. package/DateField/DateField.types.d.ts +7 -2
  11. package/DateField/index.d.ts +1 -1
  12. package/DateField/useDateField.d.ts +1 -1
  13. package/DateField/useDateField.js +5 -3
  14. package/DatePicker/DatePicker.js +8 -0
  15. package/DatePicker/DatePicker.types.d.ts +5 -5
  16. package/DatePicker/DatePickerToolbar.js +2 -0
  17. package/DateTimeField/DateTimeField.js +2 -0
  18. package/DateTimeField/DateTimeField.types.d.ts +7 -2
  19. package/DateTimeField/index.d.ts +1 -1
  20. package/DateTimeField/useDateTimeField.d.ts +1 -1
  21. package/DateTimeField/useDateTimeField.js +5 -3
  22. package/DateTimePicker/DateTimePicker.js +8 -0
  23. package/DateTimePicker/DateTimePicker.types.d.ts +7 -6
  24. package/DateTimePicker/DateTimePickerTabs.js +2 -0
  25. package/DateTimePicker/DateTimePickerToolbar.js +2 -0
  26. package/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
  27. package/DesktopDatePicker/DesktopDatePicker.js +16 -3
  28. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -6
  29. package/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
  30. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +11 -10
  31. package/DesktopTimePicker/DesktopTimePicker.js +10 -3
  32. package/DigitalClock/DigitalClock.js +2 -0
  33. package/LocalizationProvider/LocalizationProvider.js +2 -0
  34. package/MobileDatePicker/MobileDatePicker.js +16 -3
  35. package/MobileDatePicker/MobileDatePicker.types.d.ts +5 -0
  36. package/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
  37. package/MobileTimePicker/MobileTimePicker.js +10 -3
  38. package/MonthCalendar/MonthCalendar.js +2 -0
  39. package/MonthCalendar/MonthCalendar.types.d.ts +1 -1
  40. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  41. package/PickersActionBar/PickersActionBar.js +2 -0
  42. package/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
  43. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +1 -1
  44. package/PickersDay/PickersDay.js +2 -0
  45. package/PickersLayout/PickersLayout.js +2 -0
  46. package/PickersLayout/usePickerLayout.js +2 -0
  47. package/PickersSectionList/PickersSectionList.js +2 -0
  48. package/PickersShortcuts/PickersShortcuts.js +2 -0
  49. package/PickersTextField/PickersTextField.js +2 -0
  50. package/StaticDatePicker/StaticDatePicker.js +10 -2
  51. package/StaticDatePicker/StaticDatePicker.types.d.ts +5 -0
  52. package/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
  53. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +5 -0
  54. package/StaticTimePicker/StaticTimePicker.js +3 -1
  55. package/TimeClock/Clock.js +1 -1
  56. package/TimeClock/TimeClock.js +2 -0
  57. package/TimeField/TimeField.js +2 -0
  58. package/TimeField/TimeField.types.d.ts +7 -2
  59. package/TimeField/index.d.ts +1 -1
  60. package/TimeField/useTimeField.d.ts +1 -1
  61. package/TimeField/useTimeField.js +5 -3
  62. package/TimePicker/TimePicker.js +2 -0
  63. package/TimePicker/TimePickerToolbar.js +2 -0
  64. package/YearCalendar/YearCalendar.js +21 -6
  65. package/YearCalendar/YearCalendar.types.d.ts +7 -1
  66. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  67. package/dateViewRenderers/dateViewRenderers.js +2 -0
  68. package/hooks/index.d.ts +1 -0
  69. package/hooks/index.js +2 -1
  70. package/hooks/useClearableField.js +2 -0
  71. package/hooks/usePickersTranslations.js +2 -0
  72. package/hooks/useSplitFieldProps.d.ts +19 -0
  73. package/hooks/useSplitFieldProps.js +43 -0
  74. package/index.d.ts +1 -0
  75. package/index.js +3 -2
  76. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  77. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
  78. package/internals/hooks/useField/useField.js +11 -6
  79. package/internals/hooks/useField/useField.types.d.ts +4 -22
  80. package/internals/hooks/useField/useFieldState.js +2 -4
  81. package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  82. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -2
  83. package/internals/hooks/usePicker/usePicker.d.ts +1 -2
  84. package/internals/hooks/usePicker/usePicker.js +1 -1
  85. package/internals/hooks/usePicker/usePickerValue.d.ts +1 -2
  86. package/internals/hooks/usePicker/usePickerValue.js +12 -16
  87. package/internals/hooks/usePicker/usePickerValue.types.d.ts +4 -15
  88. package/internals/index.d.ts +0 -8
  89. package/internals/index.js +0 -7
  90. package/locales/beBY.d.ts +3 -3
  91. package/locales/beBY.js +4 -4
  92. package/locales/caES.d.ts +3 -3
  93. package/locales/caES.js +3 -3
  94. package/locales/csCZ.d.ts +3 -3
  95. package/locales/csCZ.js +4 -4
  96. package/locales/daDK.d.ts +3 -3
  97. package/locales/daDK.js +3 -3
  98. package/locales/deDE.d.ts +3 -3
  99. package/locales/deDE.js +3 -3
  100. package/locales/elGR.d.ts +3 -3
  101. package/locales/elGR.js +4 -4
  102. package/locales/enUS.d.ts +3 -3
  103. package/locales/enUS.js +4 -4
  104. package/locales/esES.d.ts +3 -3
  105. package/locales/esES.js +3 -3
  106. package/locales/eu.d.ts +3 -3
  107. package/locales/eu.js +3 -3
  108. package/locales/faIR.d.ts +3 -3
  109. package/locales/faIR.js +3 -3
  110. package/locales/fiFI.d.ts +3 -3
  111. package/locales/fiFI.js +3 -3
  112. package/locales/frFR.d.ts +3 -3
  113. package/locales/frFR.js +3 -3
  114. package/locales/heIL.d.ts +3 -3
  115. package/locales/heIL.js +3 -3
  116. package/locales/huHU.d.ts +3 -3
  117. package/locales/huHU.js +3 -3
  118. package/locales/isIS.d.ts +3 -3
  119. package/locales/isIS.js +4 -4
  120. package/locales/itIT.d.ts +3 -3
  121. package/locales/itIT.js +3 -3
  122. package/locales/jaJP.d.ts +3 -3
  123. package/locales/jaJP.js +3 -3
  124. package/locales/koKR.d.ts +3 -3
  125. package/locales/koKR.js +3 -3
  126. package/locales/kzKZ.d.ts +3 -3
  127. package/locales/kzKZ.js +4 -4
  128. package/locales/mk.d.ts +3 -3
  129. package/locales/mk.js +3 -3
  130. package/locales/nbNO.d.ts +3 -3
  131. package/locales/nbNO.js +4 -4
  132. package/locales/nlNL.d.ts +3 -3
  133. package/locales/nlNL.js +3 -3
  134. package/locales/nnNO.d.ts +3 -3
  135. package/locales/nnNO.js +3 -3
  136. package/locales/plPL.d.ts +3 -3
  137. package/locales/plPL.js +4 -4
  138. package/locales/ptBR.d.ts +3 -3
  139. package/locales/ptBR.js +4 -4
  140. package/locales/roRO.d.ts +3 -3
  141. package/locales/roRO.js +3 -3
  142. package/locales/ruRU.d.ts +3 -3
  143. package/locales/ruRU.js +3 -3
  144. package/locales/skSK.d.ts +3 -3
  145. package/locales/skSK.js +4 -4
  146. package/locales/svSE.d.ts +3 -3
  147. package/locales/svSE.js +3 -3
  148. package/locales/trTR.d.ts +3 -3
  149. package/locales/trTR.js +4 -4
  150. package/locales/ukUA.d.ts +3 -3
  151. package/locales/ukUA.js +3 -3
  152. package/locales/urPK.d.ts +3 -3
  153. package/locales/urPK.js +4 -4
  154. package/locales/utils/getPickersLocalization.d.ts +10 -3
  155. package/locales/utils/getPickersLocalization.js +13 -0
  156. package/locales/utils/pickersLocaleTextApi.d.ts +27 -3
  157. package/locales/viVN.d.ts +3 -3
  158. package/locales/viVN.js +3 -3
  159. package/locales/zhCN.d.ts +3 -3
  160. package/locales/zhCN.js +3 -3
  161. package/locales/zhHK.d.ts +3 -3
  162. package/locales/zhHK.js +3 -3
  163. package/models/validation.d.ts +13 -0
  164. package/modern/AdapterDateFns/AdapterDateFns.js +1 -1
  165. package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  166. package/modern/AdapterDayjs/AdapterDayjs.js +1 -1
  167. package/modern/DateCalendar/DateCalendar.js +11 -1
  168. package/modern/DateCalendar/useCalendarState.js +2 -0
  169. package/modern/DateCalendar/useIsDateDisabled.js +5 -3
  170. package/modern/DateField/DateField.js +2 -0
  171. package/modern/DateField/useDateField.js +5 -3
  172. package/modern/DatePicker/DatePicker.js +8 -0
  173. package/modern/DatePicker/DatePickerToolbar.js +2 -0
  174. package/modern/DateTimeField/DateTimeField.js +2 -0
  175. package/modern/DateTimeField/useDateTimeField.js +5 -3
  176. package/modern/DateTimePicker/DateTimePicker.js +8 -0
  177. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -0
  178. package/modern/DateTimePicker/DateTimePickerToolbar.js +2 -0
  179. package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
  180. package/modern/DesktopDatePicker/DesktopDatePicker.js +16 -3
  181. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
  182. package/modern/DesktopTimePicker/DesktopTimePicker.js +10 -3
  183. package/modern/DigitalClock/DigitalClock.js +2 -0
  184. package/modern/LocalizationProvider/LocalizationProvider.js +2 -0
  185. package/modern/MobileDatePicker/MobileDatePicker.js +16 -3
  186. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
  187. package/modern/MobileTimePicker/MobileTimePicker.js +10 -3
  188. package/modern/MonthCalendar/MonthCalendar.js +2 -0
  189. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  190. package/modern/PickersActionBar/PickersActionBar.js +2 -0
  191. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
  192. package/modern/PickersDay/PickersDay.js +2 -0
  193. package/modern/PickersLayout/PickersLayout.js +2 -0
  194. package/modern/PickersLayout/usePickerLayout.js +2 -0
  195. package/modern/PickersSectionList/PickersSectionList.js +2 -0
  196. package/modern/PickersShortcuts/PickersShortcuts.js +2 -0
  197. package/modern/PickersTextField/PickersTextField.js +2 -0
  198. package/modern/StaticDatePicker/StaticDatePicker.js +10 -2
  199. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
  200. package/modern/StaticTimePicker/StaticTimePicker.js +3 -1
  201. package/modern/TimeClock/Clock.js +1 -1
  202. package/modern/TimeClock/TimeClock.js +2 -0
  203. package/modern/TimeField/TimeField.js +2 -0
  204. package/modern/TimeField/useTimeField.js +5 -3
  205. package/modern/TimePicker/TimePicker.js +2 -0
  206. package/modern/TimePicker/TimePickerToolbar.js +2 -0
  207. package/modern/YearCalendar/YearCalendar.js +21 -6
  208. package/modern/dateViewRenderers/dateViewRenderers.js +2 -0
  209. package/modern/hooks/index.js +2 -1
  210. package/modern/hooks/useClearableField.js +2 -0
  211. package/modern/hooks/usePickersTranslations.js +2 -0
  212. package/modern/hooks/useSplitFieldProps.js +43 -0
  213. package/modern/index.js +3 -2
  214. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  215. package/modern/internals/hooks/useField/useField.js +11 -6
  216. package/modern/internals/hooks/useField/useFieldState.js +2 -4
  217. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  218. package/modern/internals/hooks/usePicker/usePicker.js +1 -1
  219. package/modern/internals/hooks/usePicker/usePickerValue.js +12 -16
  220. package/modern/internals/index.js +0 -7
  221. package/modern/locales/beBY.js +4 -4
  222. package/modern/locales/caES.js +3 -3
  223. package/modern/locales/csCZ.js +4 -4
  224. package/modern/locales/daDK.js +3 -3
  225. package/modern/locales/deDE.js +3 -3
  226. package/modern/locales/elGR.js +4 -4
  227. package/modern/locales/enUS.js +4 -4
  228. package/modern/locales/esES.js +3 -3
  229. package/modern/locales/eu.js +3 -3
  230. package/modern/locales/faIR.js +3 -3
  231. package/modern/locales/fiFI.js +3 -3
  232. package/modern/locales/frFR.js +3 -3
  233. package/modern/locales/heIL.js +3 -3
  234. package/modern/locales/huHU.js +3 -3
  235. package/modern/locales/isIS.js +4 -4
  236. package/modern/locales/itIT.js +3 -3
  237. package/modern/locales/jaJP.js +3 -3
  238. package/modern/locales/koKR.js +3 -3
  239. package/modern/locales/kzKZ.js +4 -4
  240. package/modern/locales/mk.js +3 -3
  241. package/modern/locales/nbNO.js +4 -4
  242. package/modern/locales/nlNL.js +3 -3
  243. package/modern/locales/nnNO.js +3 -3
  244. package/modern/locales/plPL.js +4 -4
  245. package/modern/locales/ptBR.js +4 -4
  246. package/modern/locales/roRO.js +3 -3
  247. package/modern/locales/ruRU.js +3 -3
  248. package/modern/locales/skSK.js +4 -4
  249. package/modern/locales/svSE.js +3 -3
  250. package/modern/locales/trTR.js +4 -4
  251. package/modern/locales/ukUA.js +3 -3
  252. package/modern/locales/urPK.js +4 -4
  253. package/modern/locales/utils/getPickersLocalization.js +13 -0
  254. package/modern/locales/viVN.js +3 -3
  255. package/modern/locales/zhCN.js +3 -3
  256. package/modern/locales/zhHK.js +3 -3
  257. package/modern/validation/index.js +5 -0
  258. package/modern/validation/useValidation.js +54 -0
  259. package/{internals/utils → modern}/validation/validateDate.js +6 -4
  260. package/modern/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  261. package/{internals/utils → modern}/validation/validateTime.js +6 -4
  262. package/node/AdapterDateFns/AdapterDateFns.js +1 -1
  263. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
  264. package/node/AdapterDayjs/AdapterDayjs.js +1 -1
  265. package/node/DateCalendar/DateCalendar.js +10 -1
  266. package/node/DateCalendar/useCalendarState.js +1 -0
  267. package/node/DateCalendar/useIsDateDisabled.js +5 -4
  268. package/node/DateField/DateField.js +1 -0
  269. package/node/DateField/useDateField.js +5 -4
  270. package/node/DatePicker/DatePicker.js +7 -0
  271. package/node/DatePicker/DatePickerToolbar.js +1 -0
  272. package/node/DateTimeField/DateTimeField.js +1 -0
  273. package/node/DateTimeField/useDateTimeField.js +5 -4
  274. package/node/DateTimePicker/DateTimePicker.js +7 -0
  275. package/node/DateTimePicker/DateTimePickerTabs.js +1 -0
  276. package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
  277. package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -0
  278. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -5
  279. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -5
  280. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -5
  281. package/node/DigitalClock/DigitalClock.js +1 -0
  282. package/node/LocalizationProvider/LocalizationProvider.js +1 -0
  283. package/node/MobileDatePicker/MobileDatePicker.js +17 -5
  284. package/node/MobileDateTimePicker/MobileDateTimePicker.js +17 -5
  285. package/node/MobileTimePicker/MobileTimePicker.js +11 -5
  286. package/node/MonthCalendar/MonthCalendar.js +1 -0
  287. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  288. package/node/PickersActionBar/PickersActionBar.js +1 -0
  289. package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
  290. package/node/PickersDay/PickersDay.js +1 -0
  291. package/node/PickersLayout/PickersLayout.js +1 -0
  292. package/node/PickersLayout/usePickerLayout.js +1 -0
  293. package/node/PickersSectionList/PickersSectionList.js +1 -0
  294. package/node/PickersShortcuts/PickersShortcuts.js +1 -0
  295. package/node/PickersTextField/PickersTextField.js +1 -0
  296. package/node/StaticDatePicker/StaticDatePicker.js +10 -3
  297. package/node/StaticDateTimePicker/StaticDateTimePicker.js +10 -3
  298. package/node/StaticTimePicker/StaticTimePicker.js +3 -2
  299. package/node/TimeClock/Clock.js +1 -1
  300. package/node/TimeClock/TimeClock.js +1 -0
  301. package/node/TimeField/TimeField.js +1 -0
  302. package/node/TimeField/useTimeField.js +5 -4
  303. package/node/TimePicker/TimePicker.js +1 -0
  304. package/node/TimePicker/TimePickerToolbar.js +1 -0
  305. package/node/YearCalendar/YearCalendar.js +20 -6
  306. package/node/dateViewRenderers/dateViewRenderers.js +2 -0
  307. package/node/hooks/index.js +8 -1
  308. package/node/hooks/useClearableField.js +1 -0
  309. package/node/hooks/usePickersTranslations.js +1 -0
  310. package/node/hooks/useSplitFieldProps.js +51 -0
  311. package/node/index.js +13 -1
  312. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
  313. package/node/internals/hooks/useField/useField.js +11 -6
  314. package/node/internals/hooks/useField/useFieldState.js +2 -4
  315. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
  316. package/node/internals/hooks/usePicker/usePicker.js +1 -1
  317. package/node/internals/hooks/usePicker/usePickerValue.js +12 -16
  318. package/node/internals/index.js +0 -49
  319. package/node/locales/beBY.js +4 -4
  320. package/node/locales/caES.js +3 -3
  321. package/node/locales/csCZ.js +4 -4
  322. package/node/locales/daDK.js +3 -3
  323. package/node/locales/deDE.js +3 -3
  324. package/node/locales/elGR.js +4 -4
  325. package/node/locales/enUS.js +4 -4
  326. package/node/locales/esES.js +3 -3
  327. package/node/locales/eu.js +3 -3
  328. package/node/locales/faIR.js +3 -3
  329. package/node/locales/fiFI.js +3 -3
  330. package/node/locales/frFR.js +3 -3
  331. package/node/locales/heIL.js +3 -3
  332. package/node/locales/huHU.js +3 -3
  333. package/node/locales/isIS.js +4 -4
  334. package/node/locales/itIT.js +3 -3
  335. package/node/locales/jaJP.js +3 -3
  336. package/node/locales/koKR.js +3 -3
  337. package/node/locales/kzKZ.js +4 -4
  338. package/node/locales/mk.js +3 -3
  339. package/node/locales/nbNO.js +4 -4
  340. package/node/locales/nlNL.js +3 -3
  341. package/node/locales/nnNO.js +3 -3
  342. package/node/locales/plPL.js +4 -4
  343. package/node/locales/ptBR.js +4 -4
  344. package/node/locales/roRO.js +3 -3
  345. package/node/locales/ruRU.js +3 -3
  346. package/node/locales/skSK.js +4 -4
  347. package/node/locales/svSE.js +3 -3
  348. package/node/locales/trTR.js +4 -4
  349. package/node/locales/ukUA.js +3 -3
  350. package/node/locales/urPK.js +4 -4
  351. package/node/locales/utils/getPickersLocalization.js +16 -2
  352. package/node/locales/viVN.js +3 -3
  353. package/node/locales/zhCN.js +3 -3
  354. package/node/locales/zhHK.js +3 -3
  355. package/node/validation/index.js +40 -0
  356. package/node/validation/useValidation.js +61 -0
  357. package/node/{internals/utils/validation → validation}/validateDate.js +6 -4
  358. package/node/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  359. package/node/{internals/utils/validation → validation}/validateTime.js +6 -4
  360. package/package.json +4 -4
  361. package/{internals/utils/validation → validation}/extractValidationProps.d.ts +1 -1
  362. package/validation/index.d.ts +9 -0
  363. package/validation/index.js +5 -0
  364. package/validation/package.json +6 -0
  365. package/validation/useValidation.d.ts +68 -0
  366. package/validation/useValidation.js +54 -0
  367. package/validation/validateDate.d.ts +6 -0
  368. package/{modern/internals/utils/validation → validation}/validateDate.js +6 -4
  369. package/validation/validateDateTime.d.ts +7 -0
  370. package/{internals/utils/validation → validation}/validateDateTime.js +8 -3
  371. package/validation/validateTime.d.ts +6 -0
  372. package/{modern/internals/utils/validation → validation}/validateTime.js +6 -4
  373. package/internals/hooks/useValidation.d.ts +0 -24
  374. package/internals/hooks/useValidation.js +0 -22
  375. package/internals/utils/fields.d.ts +0 -5
  376. package/internals/utils/fields.js +0 -28
  377. package/internals/utils/validation/validateDate.d.ts +0 -7
  378. package/internals/utils/validation/validateDateTime.d.ts +0 -7
  379. package/internals/utils/validation/validateTime.d.ts +0 -7
  380. package/internals/utils/warning.d.ts +0 -2
  381. package/internals/utils/warning.js +0 -21
  382. package/modern/internals/hooks/useValidation.js +0 -22
  383. package/modern/internals/utils/fields.js +0 -28
  384. package/modern/internals/utils/warning.js +0 -21
  385. package/node/internals/hooks/useValidation.js +0 -29
  386. package/node/internals/utils/fields.js +0 -36
  387. package/node/internals/utils/warning.js +0 -28
  388. /package/{internals/utils → modern}/validation/extractValidationProps.js +0 -0
  389. /package/node/{internals/utils/validation → validation}/extractValidationProps.js +0 -0
  390. /package/{modern/internals/utils/validation → validation}/extractValidationProps.js +0 -0
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -7,13 +9,13 @@ import { singleItemValueManager } from "../internals/utils/valueManagers.js";
7
9
  import { useDatePickerDefaultizedProps } from "../DatePicker/shared.js";
8
10
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
9
11
  import { useUtils } from "../internals/hooks/useUtils.js";
10
- import { validateDate } from "../internals/utils/validation/validateDate.js";
12
+ import { validateDate, extractValidationProps } from "../validation/index.js";
11
13
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
12
14
  import { CalendarIcon } from "../icons/index.js";
13
15
  import { DateField } from "../DateField/index.js";
14
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
15
16
  import { renderDateViewCalendar } from "../dateViewRenderers/index.js";
16
17
  import { resolveDateFormat } from "../internals/utils/date-utils.js";
18
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
17
19
  /**
18
20
  * Demos:
19
21
  *
@@ -60,7 +62,12 @@ const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePick
60
62
  props,
61
63
  valueManager: singleItemValueManager,
62
64
  valueType: 'date',
63
- getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
65
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
66
+ utils,
67
+ formatKey: 'fullDate',
68
+ contextTranslation: translations.openDatePickerDialogue,
69
+ propsTranslation: props.localeText?.openDatePickerDialogue
70
+ }),
64
71
  validator: validateDate
65
72
  });
66
73
  return renderPicker();
@@ -365,6 +372,12 @@ DesktopDatePicker.propTypes = {
365
372
  * Available views.
366
373
  */
367
374
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
375
+ /**
376
+ * Years are displayed in ascending (chronological) order by default.
377
+ * If `desc`, years are displayed in descending order.
378
+ * @default 'asc'
379
+ */
380
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
368
381
  /**
369
382
  * Years rendered per row.
370
383
  * @default 4
@@ -2,16 +2,12 @@ import { UseDesktopPickerSlots, ExportedUseDesktopPickerSlotProps, DesktopOnlyPi
2
2
  import { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from '../DatePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateView, PickerValidDate } from '../models';
5
+ import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
5
6
  export interface DesktopDatePickerSlots<TDate extends PickerValidDate> extends BaseDatePickerSlots<TDate>, MakeOptional<UseDesktopPickerSlots<TDate, DateView>, 'field' | 'openPickerIcon'> {
6
7
  }
7
8
  export interface DesktopDatePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDatePickerSlotProps<TDate>, ExportedUseDesktopPickerSlotProps<TDate, DateView, TEnableAccessibleFieldDOMStructure> {
8
9
  }
9
- export interface DesktopDatePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDatePickerProps<TDate>, DesktopOnlyPickerProps {
10
- /**
11
- * Years rendered per row.
12
- * @default 4
13
- */
14
- yearsPerRow?: 3 | 4;
10
+ export interface DesktopDatePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDatePickerProps<TDate>, DesktopOnlyPickerProps, ExportedYearCalendarProps {
15
11
  /**
16
12
  * Overridable component slots.
17
13
  * @default {}
@@ -22,4 +18,9 @@ export interface DesktopDatePickerProps<TDate extends PickerValidDate, TEnableAc
22
18
  * @default {}
23
19
  */
24
20
  slotProps?: DesktopDatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
21
+ /**
22
+ * Years rendered per row.
23
+ * @default 4
24
+ */
25
+ yearsPerRow?: 3 | 4;
25
26
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["openTo", "focusedView", "timeViewsCount"];
@@ -12,10 +14,9 @@ import { useDateTimePickerDefaultizedProps } from "../DateTimePicker/shared.js";
12
14
  import { renderDateViewCalendar } from "../dateViewRenderers/dateViewRenderers.js";
13
15
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
14
16
  import { useUtils } from "../internals/hooks/useUtils.js";
15
- import { validateDateTime } from "../internals/utils/validation/validateDateTime.js";
17
+ import { validateDateTime, extractValidationProps } from "../validation/index.js";
16
18
  import { CalendarIcon } from "../icons/index.js";
17
19
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
18
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
19
20
  import { resolveDateTimeFormat, resolveTimeViewsResponse } from "../internals/utils/date-time-utils.js";
20
21
  import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from "../timeViewRenderers/index.js";
21
22
  import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from "../MultiSectionDigitalClock/index.js";
@@ -24,6 +25,7 @@ import { DesktopDateTimePickerLayout } from "./DesktopDateTimePickerLayout.js";
24
25
  import { VIEW_HEIGHT } from "../internals/constants/dimensions.js";
25
26
  import { isInternalTimeView } from "../internals/utils/time-utils.js";
26
27
  import { isDatePickerView } from "../internals/utils/date-utils.js";
28
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
27
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
30
  const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
29
31
  const {
@@ -146,7 +148,12 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
146
148
  props,
147
149
  valueManager: singleItemValueManager,
148
150
  valueType: 'date-time',
149
- getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
151
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
152
+ utils,
153
+ formatKey: 'fullDate',
154
+ contextTranslation: translations.openDatePickerDialogue,
155
+ propsTranslation: props.localeText?.openDatePickerDialogue
156
+ }),
150
157
  validator: validateDateTime,
151
158
  rendererInterceptor
152
159
  });
@@ -523,6 +530,12 @@ DesktopDateTimePicker.propTypes = {
523
530
  * Available views.
524
531
  */
525
532
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'month', 'seconds', 'year']).isRequired),
533
+ /**
534
+ * Years are displayed in ascending (chronological) order by default.
535
+ * If `desc`, years are displayed in descending order.
536
+ * @default 'asc'
537
+ */
538
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
526
539
  /**
527
540
  * Years rendered per row.
528
541
  * @default 4
@@ -6,20 +6,12 @@ import { DesktopOnlyTimePickerProps } from '../internals/models/props/clock';
6
6
  import { DateOrTimeViewWithMeridiem } from '../internals/models';
7
7
  import { MultiSectionDigitalClockSlots, MultiSectionDigitalClockSlotProps } from '../MultiSectionDigitalClock';
8
8
  import { DigitalClockSlots, DigitalClockSlotProps } from '../DigitalClock';
9
+ import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
9
10
  export interface DesktopDateTimePickerSlots<TDate extends PickerValidDate> extends BaseDateTimePickerSlots<TDate>, MakeOptional<UseDesktopPickerSlots<TDate, DateOrTimeViewWithMeridiem>, 'field' | 'openPickerIcon'>, DigitalClockSlots, MultiSectionDigitalClockSlots {
10
11
  }
11
12
  export interface DesktopDateTimePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateTimePickerSlotProps<TDate>, ExportedUseDesktopPickerSlotProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, DigitalClockSlotProps, MultiSectionDigitalClockSlotProps {
12
13
  }
13
- export interface DesktopDateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem>, DesktopOnlyPickerProps, DesktopOnlyTimePickerProps<TDate> {
14
- /**
15
- * Available views.
16
- */
17
- views?: readonly DateOrTimeView[];
18
- /**
19
- * Years rendered per row.
20
- * @default 4
21
- */
22
- yearsPerRow?: 3 | 4;
14
+ export interface DesktopDateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem>, DesktopOnlyPickerProps, DesktopOnlyTimePickerProps<TDate>, ExportedYearCalendarProps {
23
15
  /**
24
16
  * Overridable component slots.
25
17
  * @default {}
@@ -30,4 +22,13 @@ export interface DesktopDateTimePickerProps<TDate extends PickerValidDate, TEnab
30
22
  * @default {}
31
23
  */
32
24
  slotProps?: DesktopDateTimePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
25
+ /**
26
+ * Available views.
27
+ */
28
+ views?: readonly DateOrTimeView[];
29
+ /**
30
+ * Years rendered per row.
31
+ * @default 4
32
+ */
33
+ yearsPerRow?: 3 | 4;
33
34
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -8,13 +10,13 @@ import { TimeField } from "../TimeField/index.js";
8
10
  import { useTimePickerDefaultizedProps } from "../TimePicker/shared.js";
9
11
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
10
12
  import { useUtils } from "../internals/hooks/useUtils.js";
11
- import { validateTime } from "../internals/utils/validation/validateTime.js";
13
+ import { extractValidationProps, validateTime } from "../validation/index.js";
12
14
  import { ClockIcon } from "../icons/index.js";
13
15
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
14
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
15
16
  import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from "../timeViewRenderers/index.js";
16
17
  import { resolveTimeFormat } from "../internals/utils/time-utils.js";
17
18
  import { resolveTimeViewsResponse } from "../internals/utils/date-time-utils.js";
19
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
18
20
  /**
19
21
  * Demos:
20
22
  *
@@ -81,7 +83,12 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
81
83
  props,
82
84
  valueManager: singleItemValueManager,
83
85
  valueType: 'time',
84
- getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ?? translations.openTimePickerDialogue,
86
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
87
+ utils,
88
+ formatKey: 'fullTime',
89
+ contextTranslation: translations.openTimePickerDialogue,
90
+ propsTranslation: props.localeText?.openTimePickerDialogue
91
+ }),
85
92
  validator: validateTime
86
93
  });
87
94
  return renderPicker();
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "views", "skipDisabled", "timezone"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["localeText"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -7,12 +9,12 @@ import { useMobilePicker } from "../internals/hooks/useMobilePicker/index.js";
7
9
  import { useDatePickerDefaultizedProps } from "../DatePicker/shared.js";
8
10
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
9
11
  import { useUtils } from "../internals/hooks/useUtils.js";
10
- import { validateDate } from "../internals/utils/validation/validateDate.js";
12
+ import { extractValidationProps, validateDate } from "../validation/index.js";
11
13
  import { DateField } from "../DateField/index.js";
12
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
13
14
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
14
15
  import { renderDateViewCalendar } from "../dateViewRenderers/index.js";
15
16
  import { resolveDateFormat } from "../internals/utils/date-utils.js";
17
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
16
18
  /**
17
19
  * Demos:
18
20
  *
@@ -57,7 +59,12 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
57
59
  props,
58
60
  valueManager: singleItemValueManager,
59
61
  valueType: 'date',
60
- getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
62
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
63
+ utils,
64
+ formatKey: 'fullDate',
65
+ contextTranslation: translations.openDatePickerDialogue,
66
+ propsTranslation: props.localeText?.openDatePickerDialogue
67
+ }),
61
68
  validator: validateDate
62
69
  });
63
70
  return renderPicker();
@@ -362,6 +369,12 @@ MobileDatePicker.propTypes = {
362
369
  * Available views.
363
370
  */
364
371
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
372
+ /**
373
+ * Years are displayed in ascending (chronological) order by default.
374
+ * If `desc`, years are displayed in descending order.
375
+ * @default 'asc'
376
+ */
377
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
365
378
  /**
366
379
  * Years rendered per row.
367
380
  * @default 3
@@ -17,4 +17,9 @@ export interface MobileDatePickerProps<TDate extends PickerValidDate, TEnableAcc
17
17
  * @default {}
18
18
  */
19
19
  slotProps?: MobileDatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
20
+ /**
21
+ * Years rendered per row.
22
+ * @default 3
23
+ */
24
+ yearsPerRow?: 3 | 4;
20
25
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -8,12 +10,12 @@ import { DateTimeField } from "../DateTimeField/index.js";
8
10
  import { useDateTimePickerDefaultizedProps } from "../DateTimePicker/shared.js";
9
11
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
10
12
  import { useUtils } from "../internals/hooks/useUtils.js";
11
- import { validateDateTime } from "../internals/utils/validation/validateDateTime.js";
13
+ import { extractValidationProps, validateDateTime } from "../validation/index.js";
12
14
  import { useMobilePicker } from "../internals/hooks/useMobilePicker/index.js";
13
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
14
15
  import { renderDateViewCalendar } from "../dateViewRenderers/index.js";
15
16
  import { renderTimeViewClock } from "../timeViewRenderers/index.js";
16
17
  import { resolveDateTimeFormat } from "../internals/utils/date-time-utils.js";
18
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
17
19
  /**
18
20
  * Demos:
19
21
  *
@@ -67,7 +69,12 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
67
69
  props,
68
70
  valueManager: singleItemValueManager,
69
71
  valueType: 'date-time',
70
- getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
72
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
73
+ utils,
74
+ formatKey: 'fullDate',
75
+ contextTranslation: translations.openDatePickerDialogue,
76
+ propsTranslation: props.localeText?.openDatePickerDialogue
77
+ }),
71
78
  validator: validateDateTime
72
79
  });
73
80
  return renderPicker();
@@ -421,6 +428,12 @@ MobileDateTimePicker.propTypes = {
421
428
  * Available views.
422
429
  */
423
430
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'month', 'seconds', 'year']).isRequired),
431
+ /**
432
+ * Years are displayed in ascending (chronological) order by default.
433
+ * If `desc`, years are displayed in descending order.
434
+ * @default 'asc'
435
+ */
436
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
424
437
  /**
425
438
  * Years rendered per row.
426
439
  * @default 3
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -8,11 +10,11 @@ import { TimeField } from "../TimeField/index.js";
8
10
  import { useTimePickerDefaultizedProps } from "../TimePicker/shared.js";
9
11
  import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
10
12
  import { useUtils } from "../internals/hooks/useUtils.js";
11
- import { validateTime } from "../internals/utils/validation/validateTime.js";
13
+ import { extractValidationProps, validateTime } from "../validation/index.js";
12
14
  import { useMobilePicker } from "../internals/hooks/useMobilePicker/index.js";
13
- import { extractValidationProps } from "../internals/utils/validation/extractValidationProps.js";
14
15
  import { renderTimeViewClock } from "../timeViewRenderers/index.js";
15
16
  import { resolveTimeFormat } from "../internals/utils/time-utils.js";
17
+ import { buildGetOpenDialogAriaText } from "../locales/utils/getPickersLocalization.js";
16
18
  /**
17
19
  * Demos:
18
20
  *
@@ -60,7 +62,12 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
60
62
  props,
61
63
  valueManager: singleItemValueManager,
62
64
  valueType: 'time',
63
- getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ?? translations.openTimePickerDialogue,
65
+ getOpenDialogAriaText: buildGetOpenDialogAriaText({
66
+ utils,
67
+ formatKey: 'fullTime',
68
+ contextTranslation: translations.openTimePickerDialogue,
69
+ propsTranslation: props.localeText?.openTimePickerDialogue
70
+ }),
64
71
  validator: validateTime
65
72
  });
66
73
  return renderPicker();
@@ -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 = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
@@ -8,7 +8,7 @@ import type { PickersMonthProps } from './PickersMonth';
8
8
  import { SlotComponentPropsFromProps } from '../internals/models/helpers';
9
9
  export interface MonthCalendarSlots {
10
10
  /**
11
- * Button displayed to render a single month in the "month" view.
11
+ * Button displayed to render a single month in the `month` view.
12
12
  * @default MonthCalendarButton
13
13
  */
14
14
  monthButton?: React.ElementType;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "skipDisabled", "timezone"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["onAccept", "onClear", "onCancel", "onSetToday", "actions"];
@@ -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 = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone", "format"],
@@ -15,7 +15,7 @@ export interface PickersCalendarHeaderSlots extends PickersArrowSwitcherSlots {
15
15
  */
16
16
  switchViewButton?: React.ElementType;
17
17
  /**
18
- * Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is "year".
18
+ * Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is `year`.
19
19
  * @default ArrowDropDown
20
20
  */
21
21
  switchViewIcon?: React.ElementType;
@@ -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 = ["autoFocus", "className", "day", "disabled", "disableHighlightToday", "disableMargin", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "outsideCurrentMonth", "selected", "showDaysOutsideCurrentMonth", "children", "today", "isFirstVisibleCell", "isLastVisibleCell"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import clsx from 'clsx';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -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 = ["slots", "slotProps", "elements", "sectionListRef"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["items", "changeImportance", "isLandscape", "onChange", "isValid"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["onFocus", "onBlur", "className", "color", "disabled", "error", "variant", "required", "InputProps", "inputProps", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "name", "helperText", "FormHelperTextProps", "label", "InputLabelProps"];
@@ -1,10 +1,12 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
4
6
  import { useDatePickerDefaultizedProps } from "../DatePicker/shared.js";
5
7
  import { renderDateViewCalendar } from "../dateViewRenderers/index.js";
6
8
  import { useStaticPicker } from "../internals/hooks/useStaticPicker/index.js";
7
- import { validateDate } from "../internals/utils/validation/validateDate.js";
9
+ import { validateDate } from "../validation/index.js";
8
10
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
9
11
  /**
10
12
  * Demos:
@@ -291,9 +293,15 @@ StaticDatePicker.propTypes = {
291
293
  * Available views.
292
294
  */
293
295
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
296
+ /**
297
+ * Years are displayed in ascending (chronological) order by default.
298
+ * If `desc`, years are displayed in descending order.
299
+ * @default 'asc'
300
+ */
301
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
294
302
  /**
295
303
  * Years rendered per row.
296
- * @default 3
304
+ * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
297
305
  */
298
306
  yearsPerRow: PropTypes.oneOf([3, 4])
299
307
  };
@@ -17,4 +17,9 @@ export interface StaticDatePickerProps<TDate extends PickerValidDate> extends Ba
17
17
  * @default {}
18
18
  */
19
19
  slotProps?: StaticDatePickerSlotProps<TDate>;
20
+ /**
21
+ * Years rendered per row.
22
+ * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
23
+ */
24
+ yearsPerRow?: 3 | 4;
20
25
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -6,7 +8,7 @@ import { renderTimeViewClock } from "../timeViewRenderers/index.js";
6
8
  import { renderDateViewCalendar } from "../dateViewRenderers/index.js";
7
9
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
8
10
  import { useStaticPicker } from "../internals/hooks/useStaticPicker/index.js";
9
- import { validateDateTime } from "../internals/utils/validation/validateDateTime.js";
11
+ import { validateDateTime } from "../validation/index.js";
10
12
  /**
11
13
  * Demos:
12
14
  *
@@ -350,9 +352,15 @@ StaticDateTimePicker.propTypes = {
350
352
  * Available views.
351
353
  */
352
354
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'month', 'seconds', 'year']).isRequired),
355
+ /**
356
+ * Years are displayed in ascending (chronological) order by default.
357
+ * If `desc`, years are displayed in descending order.
358
+ * @default 'asc'
359
+ */
360
+ yearsOrder: PropTypes.oneOf(['asc', 'desc']),
353
361
  /**
354
362
  * Years rendered per row.
355
- * @default 3
363
+ * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
356
364
  */
357
365
  yearsPerRow: PropTypes.oneOf([3, 4])
358
366
  };
@@ -17,4 +17,9 @@ export interface StaticDateTimePickerProps<TDate extends PickerValidDate> extend
17
17
  * @default {}
18
18
  */
19
19
  slotProps?: StaticDateTimePickerSlotProps<TDate>;
20
+ /**
21
+ * Years rendered per row.
22
+ * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
23
+ */
24
+ yearsPerRow?: 3 | 4;
20
25
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -5,7 +7,7 @@ import { useTimePickerDefaultizedProps } from "../TimePicker/shared.js";
5
7
  import { renderTimeViewClock } from "../timeViewRenderers/index.js";
6
8
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
7
9
  import { useStaticPicker } from "../internals/hooks/useStaticPicker/index.js";
8
- import { validateTime } from "../internals/utils/validation/validateTime.js";
10
+ import { validateTime } from "../validation/index.js";
9
11
  /**
10
12
  * Demos:
11
13
  *
@@ -308,7 +308,7 @@ export function Clock(inProps) {
308
308
  })]
309
309
  }), /*#__PURE__*/_jsx(ClockWrapper, {
310
310
  "aria-activedescendant": selectedId,
311
- "aria-label": translations.clockLabelText(type, value, utils),
311
+ "aria-label": translations.clockLabelText(type, value, utils, value == null ? null : utils.format(value, 'fullTime')),
312
312
  ref: listboxRef,
313
313
  role: "listbox",
314
314
  onKeyDown: handleKeyDown,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -2,9 +2,9 @@ import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/utils';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import { UseFieldInternalProps } from '../internals/hooks/useField';
5
- import { MakeOptional } from '../internals/models/helpers';
5
+ import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
6
6
  import { BaseTimeValidationProps, TimeValidationProps } from '../internals/models/validation';
7
- import { FieldSection, PickerValidDate, TimeValidationError, BuiltInFieldTextFieldProps } from '../models';
7
+ import { FieldSection, PickerValidDate, TimeValidationError, BuiltInFieldTextFieldProps, BaseSingleInputFieldProps } from '../models';
8
8
  import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
9
9
  export interface UseTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, TimeValidationError>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps, ExportedUseClearableFieldProps {
10
10
  /**
@@ -13,6 +13,11 @@ export interface UseTimeFieldProps<TDate extends PickerValidDate, TEnableAccessi
13
13
  */
14
14
  ampm?: boolean;
15
15
  }
16
+ /**
17
+ * Props the field can receive when used inside a time picker.
18
+ * (`TimePicker`, `DesktopTimePicker` or `MobileTimePicker` component).
19
+ */
20
+ export type TimeFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, TimeValidationError>;
16
21
  export type UseTimeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
17
22
  export type TimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
18
23
  /**
@@ -1,3 +1,3 @@
1
1
  export { TimeField } from './TimeField';
2
2
  export { useTimeField as unstable_useTimeField } from './useTimeField';
3
- export type { UseTimeFieldProps, UseTimeFieldComponentProps, TimeFieldProps, } from './TimeField.types';
3
+ export type { UseTimeFieldProps, UseTimeFieldComponentProps, TimeFieldProps, TimeFieldInPickerProps, } from './TimeField.types';
@@ -1,3 +1,3 @@
1
1
  import { UseTimeFieldProps } from './TimeField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps> & Required<Pick<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps>>, keyof UseTimeFieldProps<any, TEnableAccessibleFieldDOMStructure>>>;
3
+ export declare const useTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps> & Required<Pick<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "ampm" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | keyof import("../internals").BaseTimeValidationProps | keyof import("../internals").TimeValidationProps<any> | "dateSeparator">>;