@mui/x-date-pickers 6.15.0 → 6.16.1

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 (509) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/DateCalendar/DateCalendar.js +9 -3
  3. package/DateCalendar/DateCalendar.types.d.ts +1 -1
  4. package/DateCalendar/DayCalendar.d.ts +6 -5
  5. package/DateCalendar/DayCalendar.js +20 -8
  6. package/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  7. package/DateCalendar/PickersSlideTransition.d.ts +0 -1
  8. package/DateCalendar/PickersSlideTransition.js +5 -5
  9. package/DateCalendar/dayCalendarClasses.d.ts +2 -0
  10. package/DateCalendar/dayCalendarClasses.js +1 -1
  11. package/DateField/DateField.js +32 -4
  12. package/DateField/DateField.types.d.ts +3 -2
  13. package/DatePicker/DatePicker.js +6 -2
  14. package/DateTimeField/DateTimeField.js +32 -4
  15. package/DateTimeField/DateTimeField.types.d.ts +3 -2
  16. package/DateTimePicker/DateTimePicker.js +6 -2
  17. package/DateTimePicker/DateTimePickerToolbar.js +1 -0
  18. package/DesktopDatePicker/DesktopDatePicker.js +6 -2
  19. package/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  20. package/MobileDatePicker/MobileDatePicker.js +6 -2
  21. package/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  22. package/MonthCalendar/MonthCalendar.js +4 -1
  23. package/StaticDatePicker/StaticDatePicker.js +6 -2
  24. package/StaticDateTimePicker/StaticDateTimePicker.js +6 -2
  25. package/TimeField/TimeField.js +29 -4
  26. package/TimeField/TimeField.types.d.ts +3 -2
  27. package/TimePicker/TimePickerToolbar.js +1 -0
  28. package/YearCalendar/PickersYear.js +1 -1
  29. package/YearCalendar/YearCalendar.js +6 -3
  30. package/hooks/index.d.ts +1 -0
  31. package/hooks/index.js +1 -0
  32. package/hooks/package.json +6 -0
  33. package/hooks/useClearableField.d.ts +25 -0
  34. package/hooks/useClearableField.js +79 -0
  35. package/icons/index.d.ts +6 -0
  36. package/icons/index.js +8 -1
  37. package/index.d.ts +1 -0
  38. package/index.js +3 -2
  39. package/internals/constants/dimensions.d.ts +2 -1
  40. package/internals/constants/dimensions.js +2 -1
  41. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
  42. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +3 -2
  43. package/internals/hooks/useField/index.d.ts +1 -1
  44. package/internals/hooks/useField/useField.js +27 -7
  45. package/internals/hooks/useField/useField.types.d.ts +37 -1
  46. package/internals/index.d.ts +1 -1
  47. package/internals/models/props/toolbar.d.ts +3 -0
  48. package/internals/models/validation.d.ts +3 -0
  49. package/internals/utils/date-utils.d.ts +1 -0
  50. package/internals/utils/date-utils.js +4 -0
  51. package/legacy/DateCalendar/DateCalendar.js +9 -3
  52. package/legacy/DateCalendar/DayCalendar.js +24 -11
  53. package/legacy/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  54. package/legacy/DateCalendar/PickersSlideTransition.js +5 -5
  55. package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
  56. package/legacy/DateField/DateField.js +30 -3
  57. package/legacy/DatePicker/DatePicker.js +6 -2
  58. package/legacy/DateTimeField/DateTimeField.js +30 -3
  59. package/legacy/DateTimePicker/DateTimePicker.js +6 -2
  60. package/legacy/DateTimePicker/DateTimePickerToolbar.js +1 -0
  61. package/legacy/DesktopDatePicker/DesktopDatePicker.js +6 -2
  62. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  63. package/legacy/MobileDatePicker/MobileDatePicker.js +6 -2
  64. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  65. package/legacy/MonthCalendar/MonthCalendar.js +4 -1
  66. package/legacy/StaticDatePicker/StaticDatePicker.js +6 -2
  67. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +6 -2
  68. package/legacy/TimeField/TimeField.js +27 -3
  69. package/legacy/TimePicker/TimePickerToolbar.js +1 -0
  70. package/legacy/YearCalendar/PickersYear.js +1 -1
  71. package/legacy/YearCalendar/YearCalendar.js +6 -4
  72. package/legacy/hooks/index.js +1 -0
  73. package/legacy/hooks/useClearableField.js +80 -0
  74. package/legacy/icons/index.js +8 -1
  75. package/legacy/index.js +3 -2
  76. package/legacy/internals/constants/dimensions.js +2 -1
  77. package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
  78. package/legacy/internals/hooks/useField/useField.js +31 -8
  79. package/legacy/internals/utils/date-utils.js +6 -0
  80. package/legacy/locales/beBY.js +2 -0
  81. package/legacy/locales/caES.js +2 -0
  82. package/legacy/locales/csCZ.js +2 -0
  83. package/legacy/locales/daDK.js +2 -0
  84. package/legacy/locales/deDE.js +2 -0
  85. package/legacy/locales/elGR.js +2 -0
  86. package/legacy/locales/enUS.js +1 -0
  87. package/legacy/locales/esES.js +2 -0
  88. package/legacy/locales/faIR.js +2 -0
  89. package/legacy/locales/fiFI.js +2 -0
  90. package/legacy/locales/frFR.js +2 -0
  91. package/legacy/locales/heIL.js +2 -0
  92. package/legacy/locales/huHU.js +1 -0
  93. package/legacy/locales/isIS.js +2 -0
  94. package/legacy/locales/itIT.js +2 -0
  95. package/legacy/locales/jaJP.js +2 -0
  96. package/legacy/locales/koKR.js +2 -0
  97. package/legacy/locales/kzKZ.js +2 -0
  98. package/legacy/locales/nbNO.js +2 -0
  99. package/legacy/locales/nlNL.js +2 -0
  100. package/legacy/locales/plPL.js +2 -0
  101. package/legacy/locales/ptBR.js +2 -0
  102. package/legacy/locales/roRO.js +1 -0
  103. package/legacy/locales/ruRU.js +2 -0
  104. package/legacy/locales/skSK.js +2 -0
  105. package/legacy/locales/svSE.js +2 -0
  106. package/legacy/locales/trTR.js +2 -0
  107. package/legacy/locales/ukUA.js +2 -0
  108. package/legacy/locales/urPK.js +2 -0
  109. package/legacy/locales/viVN.js +2 -0
  110. package/legacy/locales/zhCN.js +2 -0
  111. package/legacy/locales/zhHK.js +2 -0
  112. package/locales/beBY.d.ts +1 -0
  113. package/locales/beBY.js +2 -0
  114. package/locales/caES.d.ts +1 -0
  115. package/locales/caES.js +2 -0
  116. package/locales/csCZ.d.ts +1 -0
  117. package/locales/csCZ.js +2 -0
  118. package/locales/daDK.d.ts +1 -0
  119. package/locales/daDK.js +2 -0
  120. package/locales/deDE.d.ts +1 -0
  121. package/locales/deDE.js +2 -0
  122. package/locales/elGR.d.ts +1 -0
  123. package/locales/elGR.js +2 -0
  124. package/locales/enUS.d.ts +1 -0
  125. package/locales/enUS.js +1 -0
  126. package/locales/esES.d.ts +1 -0
  127. package/locales/esES.js +2 -0
  128. package/locales/faIR.d.ts +1 -0
  129. package/locales/faIR.js +2 -0
  130. package/locales/fiFI.d.ts +1 -0
  131. package/locales/fiFI.js +2 -0
  132. package/locales/frFR.d.ts +1 -0
  133. package/locales/frFR.js +2 -0
  134. package/locales/heIL.d.ts +1 -0
  135. package/locales/heIL.js +2 -0
  136. package/locales/huHU.d.ts +1 -0
  137. package/locales/huHU.js +1 -0
  138. package/locales/isIS.d.ts +1 -0
  139. package/locales/isIS.js +2 -0
  140. package/locales/itIT.d.ts +1 -0
  141. package/locales/itIT.js +2 -0
  142. package/locales/jaJP.d.ts +1 -0
  143. package/locales/jaJP.js +2 -0
  144. package/locales/koKR.d.ts +1 -0
  145. package/locales/koKR.js +2 -0
  146. package/locales/kzKZ.d.ts +1 -0
  147. package/locales/kzKZ.js +2 -0
  148. package/locales/nbNO.d.ts +1 -0
  149. package/locales/nbNO.js +2 -0
  150. package/locales/nlNL.d.ts +1 -0
  151. package/locales/nlNL.js +2 -0
  152. package/locales/plPL.d.ts +1 -0
  153. package/locales/plPL.js +2 -0
  154. package/locales/ptBR.d.ts +1 -0
  155. package/locales/ptBR.js +2 -0
  156. package/locales/roRO.d.ts +1 -0
  157. package/locales/roRO.js +1 -0
  158. package/locales/ruRU.d.ts +1 -0
  159. package/locales/ruRU.js +2 -0
  160. package/locales/skSK.d.ts +1 -0
  161. package/locales/skSK.js +2 -0
  162. package/locales/svSE.d.ts +1 -0
  163. package/locales/svSE.js +2 -0
  164. package/locales/trTR.d.ts +1 -0
  165. package/locales/trTR.js +2 -0
  166. package/locales/ukUA.d.ts +1 -0
  167. package/locales/ukUA.js +2 -0
  168. package/locales/urPK.d.ts +1 -0
  169. package/locales/urPK.js +2 -0
  170. package/locales/utils/getPickersLocalization.d.ts +1 -0
  171. package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  172. package/locales/viVN.d.ts +1 -0
  173. package/locales/viVN.js +2 -0
  174. package/locales/zhCN.d.ts +1 -0
  175. package/locales/zhCN.js +2 -0
  176. package/locales/zhHK.d.ts +1 -0
  177. package/locales/zhHK.js +2 -0
  178. package/models/adapters.d.ts +1 -0
  179. package/models/fields.d.ts +2 -0
  180. package/modern/DateCalendar/DateCalendar.js +9 -3
  181. package/modern/DateCalendar/DayCalendar.js +27 -13
  182. package/modern/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  183. package/modern/DateCalendar/PickersSlideTransition.js +5 -5
  184. package/modern/DateCalendar/dayCalendarClasses.js +1 -1
  185. package/modern/DateField/DateField.js +32 -4
  186. package/modern/DatePicker/DatePicker.js +6 -2
  187. package/modern/DateTimeField/DateTimeField.js +32 -4
  188. package/modern/DateTimePicker/DateTimePicker.js +6 -2
  189. package/modern/DateTimePicker/DateTimePickerToolbar.js +1 -0
  190. package/modern/DesktopDatePicker/DesktopDatePicker.js +6 -2
  191. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  192. package/modern/MobileDatePicker/MobileDatePicker.js +6 -2
  193. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  194. package/modern/MonthCalendar/MonthCalendar.js +4 -1
  195. package/modern/StaticDatePicker/StaticDatePicker.js +6 -2
  196. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +6 -2
  197. package/modern/TimeField/TimeField.js +29 -4
  198. package/modern/TimePicker/TimePickerToolbar.js +1 -0
  199. package/modern/YearCalendar/PickersYear.js +1 -1
  200. package/modern/YearCalendar/YearCalendar.js +5 -3
  201. package/modern/hooks/index.js +1 -0
  202. package/modern/hooks/useClearableField.js +78 -0
  203. package/modern/icons/index.js +8 -1
  204. package/modern/index.js +3 -2
  205. package/modern/internals/constants/dimensions.js +2 -1
  206. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
  207. package/modern/internals/hooks/useField/useField.js +26 -7
  208. package/modern/internals/utils/date-utils.js +4 -0
  209. package/modern/locales/beBY.js +2 -0
  210. package/modern/locales/caES.js +2 -0
  211. package/modern/locales/csCZ.js +2 -0
  212. package/modern/locales/daDK.js +2 -0
  213. package/modern/locales/deDE.js +2 -0
  214. package/modern/locales/elGR.js +2 -0
  215. package/modern/locales/enUS.js +1 -0
  216. package/modern/locales/esES.js +2 -0
  217. package/modern/locales/faIR.js +2 -0
  218. package/modern/locales/fiFI.js +2 -0
  219. package/modern/locales/frFR.js +2 -0
  220. package/modern/locales/heIL.js +2 -0
  221. package/modern/locales/huHU.js +1 -0
  222. package/modern/locales/isIS.js +2 -0
  223. package/modern/locales/itIT.js +2 -0
  224. package/modern/locales/jaJP.js +2 -0
  225. package/modern/locales/koKR.js +2 -0
  226. package/modern/locales/kzKZ.js +2 -0
  227. package/modern/locales/nbNO.js +2 -0
  228. package/modern/locales/nlNL.js +2 -0
  229. package/modern/locales/plPL.js +2 -0
  230. package/modern/locales/ptBR.js +2 -0
  231. package/modern/locales/roRO.js +1 -0
  232. package/modern/locales/ruRU.js +2 -0
  233. package/modern/locales/skSK.js +2 -0
  234. package/modern/locales/svSE.js +2 -0
  235. package/modern/locales/trTR.js +2 -0
  236. package/modern/locales/ukUA.js +2 -0
  237. package/modern/locales/urPK.js +2 -0
  238. package/modern/locales/viVN.js +2 -0
  239. package/modern/locales/zhCN.js +2 -0
  240. package/modern/locales/zhHK.js +2 -0
  241. package/node/DateCalendar/DateCalendar.js +10 -5
  242. package/node/DateCalendar/DayCalendar.js +26 -12
  243. package/node/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  244. package/node/DateCalendar/PickersSlideTransition.js +5 -7
  245. package/node/DateCalendar/dateCalendarClasses.js +1 -2
  246. package/node/DateCalendar/dayCalendarClasses.js +1 -2
  247. package/node/DateCalendar/pickersFadeTransitionGroupClasses.js +1 -2
  248. package/node/DateCalendar/pickersSlideTransitionClasses.js +1 -2
  249. package/node/DateField/DateField.js +33 -6
  250. package/node/DatePicker/DatePicker.js +7 -4
  251. package/node/DatePicker/DatePickerToolbar.js +1 -2
  252. package/node/DatePicker/datePickerToolbarClasses.js +1 -2
  253. package/node/DateTimeField/DateTimeField.js +33 -6
  254. package/node/DateTimePicker/DateTimePicker.js +7 -4
  255. package/node/DateTimePicker/DateTimePickerTabs.js +1 -2
  256. package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
  257. package/node/DateTimePicker/dateTimePickerTabsClasses.js +1 -2
  258. package/node/DateTimePicker/dateTimePickerToolbarClasses.js +1 -2
  259. package/node/DayCalendarSkeleton/dayCalendarSkeletonClasses.js +1 -2
  260. package/node/DesktopDatePicker/DesktopDatePicker.js +7 -4
  261. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +7 -4
  262. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -2
  263. package/node/DigitalClock/DigitalClock.js +1 -2
  264. package/node/DigitalClock/digitalClockClasses.js +1 -2
  265. package/node/LocalizationProvider/LocalizationProvider.js +2 -4
  266. package/node/MobileDatePicker/MobileDatePicker.js +7 -4
  267. package/node/MobileDateTimePicker/MobileDateTimePicker.js +7 -4
  268. package/node/MobileTimePicker/MobileTimePicker.js +1 -2
  269. package/node/MonthCalendar/MonthCalendar.js +5 -3
  270. package/node/MonthCalendar/PickersMonth.js +2 -3
  271. package/node/MonthCalendar/monthCalendarClasses.js +1 -2
  272. package/node/MonthCalendar/pickersMonthClasses.js +1 -2
  273. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -2
  274. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -3
  275. package/node/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +1 -2
  276. package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +1 -2
  277. package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -2
  278. package/node/PickersCalendarHeader/pickersCalendarHeaderClasses.js +1 -2
  279. package/node/PickersDay/PickersDay.js +1 -2
  280. package/node/PickersDay/pickersDayClasses.js +1 -2
  281. package/node/PickersLayout/PickersLayout.js +3 -6
  282. package/node/PickersLayout/pickersLayoutClasses.js +1 -2
  283. package/node/PickersLayout/usePickerLayout.js +1 -2
  284. package/node/StaticDatePicker/StaticDatePicker.js +7 -4
  285. package/node/StaticDateTimePicker/StaticDateTimePicker.js +7 -4
  286. package/node/StaticTimePicker/StaticTimePicker.js +1 -2
  287. package/node/TimeClock/TimeClock.js +1 -2
  288. package/node/TimeClock/clockClasses.js +1 -2
  289. package/node/TimeClock/clockNumberClasses.js +1 -2
  290. package/node/TimeClock/clockPointerClasses.js +1 -2
  291. package/node/TimeClock/shared.js +2 -4
  292. package/node/TimeClock/timeClockClasses.js +1 -2
  293. package/node/TimeField/TimeField.js +30 -6
  294. package/node/TimePicker/TimePicker.js +1 -2
  295. package/node/TimePicker/TimePickerToolbar.js +1 -0
  296. package/node/TimePicker/timePickerToolbarClasses.js +1 -2
  297. package/node/YearCalendar/PickersYear.js +3 -4
  298. package/node/YearCalendar/YearCalendar.js +6 -5
  299. package/node/YearCalendar/pickersYearClasses.js +1 -2
  300. package/node/YearCalendar/yearCalendarClasses.js +1 -2
  301. package/node/hooks/index.js +12 -0
  302. package/node/hooks/useClearableField.js +87 -0
  303. package/node/icons/index.js +15 -15
  304. package/node/index.js +13 -1
  305. package/node/internals/components/DateTimeViewWrapper/DateTimeViewWrapper.js +2 -3
  306. package/node/internals/components/PickerViewRoot/PickerViewRoot.js +2 -3
  307. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -3
  308. package/node/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.js +1 -2
  309. package/node/internals/components/PickersToolbar.js +2 -3
  310. package/node/internals/components/PickersToolbarButton.js +2 -3
  311. package/node/internals/components/PickersToolbarText.js +2 -3
  312. package/node/internals/components/pickersPopperClasses.js +1 -2
  313. package/node/internals/components/pickersToolbarButtonClasses.js +1 -2
  314. package/node/internals/components/pickersToolbarClasses.js +1 -2
  315. package/node/internals/components/pickersToolbarTextClasses.js +1 -2
  316. package/node/internals/constants/dimensions.js +8 -13
  317. package/node/internals/hooks/useDefaultReduceAnimations.js +1 -2
  318. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
  319. package/node/internals/hooks/useField/useField.js +26 -7
  320. package/node/internals/utils/date-utils.js +7 -2
  321. package/node/internals/utils/getDefaultReferenceDate.js +1 -2
  322. package/node/internals/utils/utils.js +1 -2
  323. package/node/internals/utils/validation/extractValidationProps.js +3 -6
  324. package/node/internals/utils/valueManagers.js +3 -5
  325. package/node/locales/beBY.js +3 -2
  326. package/node/locales/caES.js +3 -2
  327. package/node/locales/csCZ.js +3 -2
  328. package/node/locales/daDK.js +3 -2
  329. package/node/locales/deDE.js +3 -2
  330. package/node/locales/elGR.js +3 -2
  331. package/node/locales/enUS.js +3 -4
  332. package/node/locales/esES.js +3 -2
  333. package/node/locales/faIR.js +3 -2
  334. package/node/locales/fiFI.js +3 -2
  335. package/node/locales/frFR.js +3 -2
  336. package/node/locales/heIL.js +3 -2
  337. package/node/locales/huHU.js +2 -2
  338. package/node/locales/isIS.js +3 -2
  339. package/node/locales/itIT.js +3 -2
  340. package/node/locales/jaJP.js +3 -2
  341. package/node/locales/koKR.js +3 -2
  342. package/node/locales/kzKZ.js +3 -2
  343. package/node/locales/nbNO.js +3 -2
  344. package/node/locales/nlNL.js +3 -2
  345. package/node/locales/plPL.js +3 -2
  346. package/node/locales/ptBR.js +3 -2
  347. package/node/locales/roRO.js +2 -2
  348. package/node/locales/ruRU.js +3 -2
  349. package/node/locales/skSK.js +3 -2
  350. package/node/locales/svSE.js +3 -2
  351. package/node/locales/trTR.js +3 -2
  352. package/node/locales/ukUA.js +3 -2
  353. package/node/locales/urPK.js +3 -2
  354. package/node/locales/viVN.js +3 -2
  355. package/node/locales/zhCN.js +3 -2
  356. package/node/locales/zhHK.js +3 -2
  357. package/package.json +5 -5
  358. package/legacy/tests/describe.types.js +0 -1
  359. package/legacy/tests/describeAdapters/describeAdapters.js +0 -29
  360. package/legacy/tests/describeAdapters/index.js +0 -1
  361. package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.js +0 -32
  362. package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +0 -1
  363. package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +0 -2
  364. package/legacy/tests/describeGregorianAdapter/index.js +0 -2
  365. package/legacy/tests/describeGregorianAdapter/testCalculations.js +0 -707
  366. package/legacy/tests/describeGregorianAdapter/testFormat.js +0 -26
  367. package/legacy/tests/describeGregorianAdapter/testLocalization.js +0 -49
  368. package/legacy/tests/describeHijriAdapter/describeHijriAdapter.js +0 -21
  369. package/legacy/tests/describeHijriAdapter/describeHijriAdapter.types.js +0 -1
  370. package/legacy/tests/describeHijriAdapter/index.js +0 -1
  371. package/legacy/tests/describeHijriAdapter/testCalculations.js +0 -167
  372. package/legacy/tests/describeHijriAdapter/testLocalization.js +0 -20
  373. package/legacy/tests/describeJalaliAdapter/describeJalaliAdapter.js +0 -21
  374. package/legacy/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +0 -1
  375. package/legacy/tests/describeJalaliAdapter/index.js +0 -1
  376. package/legacy/tests/describeJalaliAdapter/testCalculations.js +0 -236
  377. package/legacy/tests/describeJalaliAdapter/testLocalization.js +0 -20
  378. package/legacy/tests/describePicker/describePicker.js +0 -159
  379. package/legacy/tests/describePicker/describePicker.types.js +0 -1
  380. package/legacy/tests/describePicker/index.js +0 -1
  381. package/legacy/tests/describeValidation/describeValidation.js +0 -31
  382. package/legacy/tests/describeValidation/describeValidation.types.js +0 -1
  383. package/legacy/tests/describeValidation/index.js +0 -1
  384. package/legacy/tests/describeValidation/testDayViewValidation.js +0 -281
  385. package/legacy/tests/describeValidation/testMinutesViewValidation.js +0 -194
  386. package/legacy/tests/describeValidation/testMonthViewValidation.js +0 -136
  387. package/legacy/tests/describeValidation/testTextFieldValidation.js +0 -463
  388. package/legacy/tests/describeValidation/testYearViewValidation.js +0 -95
  389. package/legacy/tests/describeValue/describeValue.js +0 -57
  390. package/legacy/tests/describeValue/describeValue.types.js +0 -1
  391. package/legacy/tests/describeValue/index.js +0 -1
  392. package/legacy/tests/describeValue/testControlledUnControlled.js +0 -237
  393. package/legacy/tests/describeValue/testPickerActionBar.js +0 -250
  394. package/legacy/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -362
  395. package/legacy/tests/describeValue/testShortcuts.js +0 -119
  396. package/modern/tests/describe.types.js +0 -1
  397. package/modern/tests/describeAdapters/describeAdapters.js +0 -29
  398. package/modern/tests/describeAdapters/index.js +0 -1
  399. package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.js +0 -29
  400. package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +0 -1
  401. package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +0 -2
  402. package/modern/tests/describeGregorianAdapter/index.js +0 -2
  403. package/modern/tests/describeGregorianAdapter/testCalculations.js +0 -706
  404. package/modern/tests/describeGregorianAdapter/testFormat.js +0 -27
  405. package/modern/tests/describeGregorianAdapter/testLocalization.js +0 -50
  406. package/modern/tests/describeHijriAdapter/describeHijriAdapter.js +0 -21
  407. package/modern/tests/describeHijriAdapter/describeHijriAdapter.types.js +0 -1
  408. package/modern/tests/describeHijriAdapter/index.js +0 -1
  409. package/modern/tests/describeHijriAdapter/testCalculations.js +0 -164
  410. package/modern/tests/describeHijriAdapter/testLocalization.js +0 -21
  411. package/modern/tests/describeJalaliAdapter/describeJalaliAdapter.js +0 -21
  412. package/modern/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +0 -1
  413. package/modern/tests/describeJalaliAdapter/index.js +0 -1
  414. package/modern/tests/describeJalaliAdapter/testCalculations.js +0 -237
  415. package/modern/tests/describeJalaliAdapter/testLocalization.js +0 -21
  416. package/modern/tests/describePicker/describePicker.js +0 -162
  417. package/modern/tests/describePicker/describePicker.types.js +0 -1
  418. package/modern/tests/describePicker/index.js +0 -1
  419. package/modern/tests/describeValidation/describeValidation.js +0 -31
  420. package/modern/tests/describeValidation/describeValidation.types.js +0 -1
  421. package/modern/tests/describeValidation/index.js +0 -1
  422. package/modern/tests/describeValidation/testDayViewValidation.js +0 -280
  423. package/modern/tests/describeValidation/testMinutesViewValidation.js +0 -193
  424. package/modern/tests/describeValidation/testMonthViewValidation.js +0 -137
  425. package/modern/tests/describeValidation/testTextFieldValidation.js +0 -470
  426. package/modern/tests/describeValidation/testYearViewValidation.js +0 -94
  427. package/modern/tests/describeValue/describeValue.js +0 -59
  428. package/modern/tests/describeValue/describeValue.types.js +0 -1
  429. package/modern/tests/describeValue/index.js +0 -1
  430. package/modern/tests/describeValue/testControlledUnControlled.js +0 -239
  431. package/modern/tests/describeValue/testPickerActionBar.js +0 -254
  432. package/modern/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -371
  433. package/modern/tests/describeValue/testShortcuts.js +0 -112
  434. package/node/tests/describe.types.js +0 -5
  435. package/node/tests/describeAdapters/describeAdapters.js +0 -37
  436. package/node/tests/describeAdapters/index.js +0 -12
  437. package/node/tests/describeGregorianAdapter/describeGregorianAdapter.js +0 -37
  438. package/node/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +0 -5
  439. package/node/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +0 -10
  440. package/node/tests/describeGregorianAdapter/index.js +0 -19
  441. package/node/tests/describeGregorianAdapter/testCalculations.js +0 -711
  442. package/node/tests/describeGregorianAdapter/testFormat.js +0 -34
  443. package/node/tests/describeGregorianAdapter/testLocalization.js +0 -57
  444. package/node/tests/describeHijriAdapter/describeHijriAdapter.js +0 -29
  445. package/node/tests/describeHijriAdapter/describeHijriAdapter.types.js +0 -5
  446. package/node/tests/describeHijriAdapter/index.js +0 -12
  447. package/node/tests/describeHijriAdapter/testCalculations.js +0 -171
  448. package/node/tests/describeHijriAdapter/testLocalization.js +0 -28
  449. package/node/tests/describeJalaliAdapter/describeJalaliAdapter.js +0 -29
  450. package/node/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +0 -5
  451. package/node/tests/describeJalaliAdapter/index.js +0 -12
  452. package/node/tests/describeJalaliAdapter/testCalculations.js +0 -244
  453. package/node/tests/describeJalaliAdapter/testLocalization.js +0 -28
  454. package/node/tests/describePicker/describePicker.js +0 -173
  455. package/node/tests/describePicker/describePicker.types.js +0 -5
  456. package/node/tests/describePicker/index.js +0 -12
  457. package/node/tests/describeValidation/describeValidation.js +0 -39
  458. package/node/tests/describeValidation/describeValidation.types.js +0 -5
  459. package/node/tests/describeValidation/index.js +0 -12
  460. package/node/tests/describeValidation/testDayViewValidation.js +0 -290
  461. package/node/tests/describeValidation/testMinutesViewValidation.js +0 -203
  462. package/node/tests/describeValidation/testMonthViewValidation.js +0 -147
  463. package/node/tests/describeValidation/testTextFieldValidation.js +0 -480
  464. package/node/tests/describeValidation/testYearViewValidation.js +0 -104
  465. package/node/tests/describeValue/describeValue.js +0 -69
  466. package/node/tests/describeValue/describeValue.types.js +0 -5
  467. package/node/tests/describeValue/index.js +0 -12
  468. package/node/tests/describeValue/testControlledUnControlled.js +0 -248
  469. package/node/tests/describeValue/testPickerActionBar.js +0 -264
  470. package/node/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -381
  471. package/node/tests/describeValue/testShortcuts.js +0 -122
  472. package/tests/describe.types.js +0 -1
  473. package/tests/describeAdapters/describeAdapters.js +0 -29
  474. package/tests/describeAdapters/index.js +0 -1
  475. package/tests/describeGregorianAdapter/describeGregorianAdapter.js +0 -30
  476. package/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +0 -1
  477. package/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +0 -2
  478. package/tests/describeGregorianAdapter/index.js +0 -2
  479. package/tests/describeGregorianAdapter/testCalculations.js +0 -706
  480. package/tests/describeGregorianAdapter/testFormat.js +0 -27
  481. package/tests/describeGregorianAdapter/testLocalization.js +0 -50
  482. package/tests/describeHijriAdapter/describeHijriAdapter.js +0 -21
  483. package/tests/describeHijriAdapter/describeHijriAdapter.types.js +0 -1
  484. package/tests/describeHijriAdapter/index.js +0 -1
  485. package/tests/describeHijriAdapter/testCalculations.js +0 -164
  486. package/tests/describeHijriAdapter/testLocalization.js +0 -21
  487. package/tests/describeJalaliAdapter/describeJalaliAdapter.js +0 -21
  488. package/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +0 -1
  489. package/tests/describeJalaliAdapter/index.js +0 -1
  490. package/tests/describeJalaliAdapter/testCalculations.js +0 -237
  491. package/tests/describeJalaliAdapter/testLocalization.js +0 -21
  492. package/tests/describePicker/describePicker.js +0 -162
  493. package/tests/describePicker/describePicker.types.js +0 -1
  494. package/tests/describePicker/index.js +0 -1
  495. package/tests/describeValidation/describeValidation.js +0 -31
  496. package/tests/describeValidation/describeValidation.types.js +0 -1
  497. package/tests/describeValidation/index.js +0 -1
  498. package/tests/describeValidation/testDayViewValidation.js +0 -280
  499. package/tests/describeValidation/testMinutesViewValidation.js +0 -193
  500. package/tests/describeValidation/testMonthViewValidation.js +0 -137
  501. package/tests/describeValidation/testTextFieldValidation.js +0 -470
  502. package/tests/describeValidation/testYearViewValidation.js +0 -94
  503. package/tests/describeValue/describeValue.js +0 -59
  504. package/tests/describeValue/describeValue.types.js +0 -1
  505. package/tests/describeValue/index.js +0 -1
  506. package/tests/describeValue/testControlledUnControlled.js +0 -239
  507. package/tests/describeValue/testPickerActionBar.js +0 -254
  508. package/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -371
  509. package/tests/describeValue/testShortcuts.js +0 -112
package/CHANGELOG.md CHANGED
@@ -3,6 +3,150 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.16.1
7
+
8
+ _Oct 6, 2023_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🥧 Support interaction with pie chart
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+
16
+ ### Data Grid
17
+
18
+ #### `@mui/x-data-grid@6.16.1`
19
+
20
+ - [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
21
+ - [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
22
+ - [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
23
+
24
+ #### `@mui/x-data-grid-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
25
+
26
+ Same changes as in `@mui/x-data-grid@6.16.1`.
27
+
28
+ #### `@mui/x-data-grid-premium@6.16.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
29
+
30
+ Same changes as in `@mui/x-data-grid-pro@6.16.1`.
31
+
32
+ ### Date Pickers
33
+
34
+ #### `@mui/x-date-pickers@6.16.1`
35
+
36
+ - [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
37
+ - [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
38
+ - [pickers] Improve customization playground examples (#10544) @noraleonte
39
+
40
+ #### `@mui/x-date-pickers-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
43
+
44
+ - [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
45
+
46
+ ### Charts / `@mui/x-charts@6.0.0-alpha.14`
47
+
48
+ - [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
49
+ - [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
50
+ - [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
51
+
52
+ ### Docs
53
+
54
+ - [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
55
+ - [docs] Add section about disabling columns panel (#10328) @MBilalShafi
56
+ - [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
57
+ - [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
58
+ - [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
59
+
60
+ ### Core
61
+
62
+ - [core] Fix casing consistency with legal and marketing content @oliviertassinari
63
+ - [core] Revert the link in the priority support ticket description (#10517) @michelengelen
64
+ - [CHANGELOG] Polish image @oliviertassinari
65
+
66
+ ## 6.16.0
67
+
68
+ _Sep 29, 2023_
69
+
70
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
71
+
72
+ - 🎁 Add a clearable behavior to all the single input pickers and fields (#9095) @noraleonte
73
+
74
+ The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
75
+
76
+ <img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
77
+
78
+ - 💫 Add Date Picker customization playground (#9581) @noraleonte
79
+
80
+ You can play around with style customization options on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#customization).
81
+
82
+ We are thrilled to hear your feedback about this functionality!
83
+
84
+ - 🚀 Fix header filters menu auto closing on render (#10483) @MBilalShafi
85
+ - 🎯 Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
86
+ - 🌍 Improve Russian (ru-RU) locale on the data grid
87
+ - 🐞 Bugfixes
88
+ - 📚 Documentation improvements
89
+
90
+ ### Data Grid
91
+
92
+ #### `@mui/x-data-grid@6.16.0`
93
+
94
+ - [DataGrid] Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
95
+ - [DataGrid] Rename `global` to `globalScope` due to Jest issue (#10470) @romgrk
96
+ - [l10n] Improve Russian (ru-RU) locale (#10464 and #10407) @NKodos
97
+
98
+ #### `@mui/x-data-grid-pro@6.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
99
+
100
+ Same changes as in `@mui/x-data-grid@6.16.0`, plus:
101
+
102
+ - [DataGridPro] Fix header filters menu auto closing on render (#10483) @MBilalShafi
103
+
104
+ #### `@mui/x-data-grid-premium@6.16.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
105
+
106
+ Same changes as in `@mui/x-data-grid-pro@6.16.0`.
107
+
108
+ ### Date Pickers
109
+
110
+ #### `@mui/x-date-pickers@6.16.0`
111
+
112
+ - [pickers] Add warning to `shouldDisableDate` validation (#10502) @michelengelen
113
+ - [pickers] Implement `clearable` field behavior (#9095) @noraleonte
114
+ - [pickers] Refactor `dayOfWeekFormatter` (#10345) @michelengelen
115
+
116
+ #### `@mui/x-date-pickers-pro@6.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
117
+
118
+ Same changes as in `@mui/x-date-pickers@6.16.0`.
119
+
120
+ ### Charts / `@mui/x-charts@6.0.0-alpha.13`
121
+
122
+ - [charts] Share upfront future Pro features (#10465) @oliviertassinari
123
+
124
+ ### Tree View / `@mui/x-tree-view@6.0.0-beta.0`
125
+
126
+ - [TreeView] Do not try to focus a collapsed node when re-focusing the TreeView (#10422) @flaviendelangle
127
+ - [TreeView] Fix the typing of the `Multiple` generic (#10478) @flaviendelangle
128
+
129
+ ### Docs
130
+
131
+ - [docs] Correct the typo in data grid api docs (#10477) @MBilalShafi
132
+ - [docs] Add customization playground (#9581) @noraleonte
133
+ - [docs] Fix Tree View product ID (#10428) @oliviertassinari
134
+ - [docs] Fix demo crashing when all rows are deleted (#10438) @cherniavskii
135
+ - [docs] Fix mobile scrollbar column resize (#10455) @oliviertassinari
136
+ - [docs] Fix usage of `GridRenderCellParams` interface (#10435) @cherniavskii
137
+
138
+ ### Core
139
+
140
+ - [core] Fix typo in header data grid quick filter @oliviertassinari
141
+ - [core] Group D3 renovate PRs (#10480) @flaviendelangle
142
+ - [core] Link the priority support page (#10495) @michelengelen
143
+ - [core] Move the pickers describes to the test utils folder (#10490) @flaviendelangle
144
+ - [core] Priority Support casing normalization @oliviertassinari
145
+ - [core] Remove automated DataGrid performance tests (#10414) @romgrk
146
+ - [core] Sync `prism-okaidia.css` with docs-infra @oliviertassinari
147
+ - [core] Update issue actions & templates (#10375) @romgrk
148
+ - [core] Update release guide (#10468) @DanailH
149
+
6
150
  ## 6.15.0
7
151
 
8
152
  _Sep 22, 2023_
@@ -21,6 +21,7 @@ import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceA
21
21
  import { getDateCalendarUtilityClass } from './dateCalendarClasses';
22
22
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
23
23
  import { singleItemValueManager } from '../internals/utils/valueManagers';
24
+ import { VIEW_HEIGHT } from '../internals/constants/dimensions';
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
25
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
27
  const useUtilityClasses = ownerState => {
@@ -62,7 +63,8 @@ const DateCalendarRoot = styled(PickerViewRoot, {
62
63
  overridesResolver: (props, styles) => styles.root
63
64
  })({
64
65
  display: 'flex',
65
- flexDirection: 'column'
66
+ flexDirection: 'column',
67
+ height: VIEW_HEIGHT
66
68
  });
67
69
  const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
68
70
  name: 'MuiDateCalendar',
@@ -375,9 +377,10 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
375
377
  componentsProps: PropTypes.object,
376
378
  /**
377
379
  * Formats the day of week displayed in the calendar header.
378
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
380
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
381
+ * @param {TDate} date The date of the day of week provided by the adapter.
379
382
  * @returns {string} The name to display.
380
- * @default (day) => day.charAt(0).toUpperCase()
383
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
381
384
  */
382
385
  dayOfWeekFormatter: PropTypes.func,
383
386
  /**
@@ -503,6 +506,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
503
506
  renderLoading: PropTypes.func,
504
507
  /**
505
508
  * Disable specific date.
509
+ *
510
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
511
+ *
506
512
  * @template TDate
507
513
  * @param {TDate} day The date to test.
508
514
  * @returns {boolean} If `true` the date will be disabled.
@@ -24,7 +24,7 @@ export interface DateCalendarSlotsComponent<TDate> extends PickersCalendarHeader
24
24
  export interface DateCalendarSlotsComponentsProps<TDate> extends PickersCalendarHeaderSlotsComponentsProps<TDate>, DayCalendarSlotsComponentsProps<TDate> {
25
25
  calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, DateCalendarProps<TDate>>;
26
26
  }
27
- export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarProps, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
27
+ export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
28
28
  /**
29
29
  * Default calendar month displayed when `value` and `defaultValue` are empty.
30
30
  */
@@ -22,7 +22,7 @@ export interface DayCalendarSlotsComponentsProps<TDate> {
22
22
  selected: boolean;
23
23
  }>;
24
24
  }
25
- export interface ExportedDayCalendarProps extends ExportedPickersDayProps {
25
+ export interface ExportedDayCalendarProps<TDate> extends ExportedPickersDayProps {
26
26
  /**
27
27
  * If `true`, calls `renderLoading` instead of rendering the day calendar.
28
28
  * Can be used to preload information and show it in calendar.
@@ -37,11 +37,12 @@ export interface ExportedDayCalendarProps extends ExportedPickersDayProps {
37
37
  renderLoading?: () => React.ReactNode;
38
38
  /**
39
39
  * Formats the day of week displayed in the calendar header.
40
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
40
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
41
+ * @param {TDate} date The date of the day of week provided by the adapter.
41
42
  * @returns {string} The name to display.
42
- * @default (day) => day.charAt(0).toUpperCase()
43
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
43
44
  */
44
- dayOfWeekFormatter?: (day: string) => string;
45
+ dayOfWeekFormatter?: (day: string, date: TDate) => string;
45
46
  /**
46
47
  * If `true`, the week number will be display in the calendar.
47
48
  */
@@ -53,7 +54,7 @@ export interface ExportedDayCalendarProps extends ExportedPickersDayProps {
53
54
  */
54
55
  fixedWeekNumber?: number;
55
56
  }
56
- export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'>, SlotsAndSlotProps<DayCalendarSlotsComponent<TDate>, DayCalendarSlotsComponentsProps<TDate>> {
57
+ export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'>, SlotsAndSlotProps<DayCalendarSlotsComponent<TDate>, DayCalendarSlotsComponentsProps<TDate>> {
57
58
  autoFocus?: boolean;
58
59
  className?: string;
59
60
  currentMonth: TDate;
@@ -14,7 +14,7 @@ import { useUtils, useNow, useLocaleText } from '../internals/hooks/useUtils';
14
14
  import { DAY_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';
15
15
  import { PickersSlideTransition } from './PickersSlideTransition';
16
16
  import { useIsDateDisabled } from './useIsDateDisabled';
17
- import { findClosestEnabledDate } from '../internals/utils/date-utils';
17
+ import { findClosestEnabledDate, getWeekdays } from '../internals/utils/date-utils';
18
18
  import { getDayCalendarUtilityClass } from './dayCalendarClasses';
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,6 +23,7 @@ const useUtilityClasses = ownerState => {
23
23
  classes
24
24
  } = ownerState;
25
25
  const slots = {
26
+ root: ['root'],
26
27
  header: ['header'],
27
28
  weekDayLabel: ['weekDayLabel'],
28
29
  loadingContainer: ['loadingContainer'],
@@ -34,8 +35,12 @@ const useUtilityClasses = ownerState => {
34
35
  };
35
36
  return composeClasses(slots, getDayCalendarUtilityClass, classes);
36
37
  };
37
- const defaultDayOfWeekFormatter = day => day.charAt(0).toUpperCase();
38
38
  const weeksContainerHeight = (DAY_SIZE + DAY_MARGIN * 2) * 6;
39
+ const PickersCalendarDayRoot = styled('div', {
40
+ name: 'MuiDayCalendar',
41
+ slot: 'Root',
42
+ overridesResolver: (_, styles) => styles.root
43
+ })({});
39
44
  const PickersCalendarDayHeader = styled('div', {
40
45
  name: 'MuiDayCalendar',
41
46
  slot: 'Header',
@@ -62,7 +67,7 @@ const PickersCalendarWeekDayLabel = styled(Typography, {
62
67
  color: (theme.vars || theme).palette.text.secondary
63
68
  }));
64
69
  const PickersCalendarWeekNumberLabel = styled(Typography, {
65
- name: 'MuiDayPicker',
70
+ name: 'MuiDayCalendar',
66
71
  slot: 'WeekNumberLabel',
67
72
  overridesResolver: (_, styles) => styles.weekNumberLabel
68
73
  })(({
@@ -78,7 +83,7 @@ const PickersCalendarWeekNumberLabel = styled(Typography, {
78
83
  color: theme.palette.text.disabled
79
84
  }));
80
85
  const PickersCalendarWeekNumber = styled(Typography, {
81
- name: 'MuiDayPicker',
86
+ name: 'MuiDayCalendar',
82
87
  slot: 'WeekNumber',
83
88
  overridesResolver: (_, styles) => styles.weekNumber
84
89
  })(({
@@ -236,7 +241,7 @@ export function DayCalendar(inProps) {
236
241
  shouldDisableDate,
237
242
  shouldDisableMonth,
238
243
  shouldDisableYear,
239
- dayOfWeekFormatter = defaultDayOfWeekFormatter,
244
+ dayOfWeekFormatter: dayOfWeekFormatterFromProps,
240
245
  hasFocus,
241
246
  onFocusedViewChange,
242
247
  gridLabelId,
@@ -250,6 +255,9 @@ export function DayCalendar(inProps) {
250
255
  const classes = useUtilityClasses(props);
251
256
  const theme = useTheme();
252
257
  const isRTL = theme.direction === 'rtl';
258
+
259
+ // before we could define this outside of the component scope, but now we need utils, which is only defined here
260
+ const dayOfWeekFormatter = dayOfWeekFormatterFromProps || ((_day, date) => utils.format(date, 'weekdayShort').charAt(0).toUpperCase());
253
261
  const isDateDisabled = useIsDateDisabled({
254
262
  shouldDisableDate,
255
263
  shouldDisableMonth,
@@ -391,9 +399,10 @@ export function DayCalendar(inProps) {
391
399
  }
392
400
  return toDisplay;
393
401
  }, [currentMonth, fixedWeekNumber, utils, timezone]);
394
- return /*#__PURE__*/_jsxs("div", {
402
+ return /*#__PURE__*/_jsxs(PickersCalendarDayRoot, {
395
403
  role: "grid",
396
404
  "aria-labelledby": gridLabelId,
405
+ className: classes.root,
397
406
  children: [/*#__PURE__*/_jsxs(PickersCalendarDayHeader, {
398
407
  role: "row",
399
408
  className: classes.header,
@@ -403,14 +412,17 @@ export function DayCalendar(inProps) {
403
412
  "aria-label": localeText.calendarWeekNumberHeaderLabel,
404
413
  className: classes.weekNumberLabel,
405
414
  children: localeText.calendarWeekNumberHeaderText
406
- }), utils.getWeekdays().map((day, i) => {
415
+ }), getWeekdays(utils, now).map((weekday, i) => {
407
416
  var _dayOfWeekFormatter;
417
+ // regression-prevention:
418
+ // since 'weekdayShort' now always returns an abbreviated form we slice the first 2 letters from it.
419
+ const day = utils.format(weekday, 'weekdayShort').slice(0, 2);
408
420
  return /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {
409
421
  variant: "caption",
410
422
  role: "columnheader",
411
423
  "aria-label": utils.format(utils.addDays(startOfCurrentWeek, i), 'weekday'),
412
424
  className: classes.weekDayLabel,
413
- children: (_dayOfWeekFormatter = dayOfWeekFormatter == null ? void 0 : dayOfWeekFormatter(day)) != null ? _dayOfWeekFormatter : day
425
+ children: (_dayOfWeekFormatter = dayOfWeekFormatter == null ? void 0 : dayOfWeekFormatter(day, weekday)) != null ? _dayOfWeekFormatter : day
414
426
  }, day + i.toString());
415
427
  })]
416
428
  }), loading ? /*#__PURE__*/_jsx(PickersCalendarLoadingContainer, {
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import clsx from 'clsx';
3
- import Fade from '@mui/material/Fade';
4
- import { styled, useThemeProps } from '@mui/material/styles';
5
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
3
  import { TransitionGroup } from 'react-transition-group';
4
+ import Fade from '@mui/material/Fade';
5
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
6
+ import composeClasses from '@mui/utils/composeClasses';
7
7
  import { getPickersFadeTransitionGroupUtilityClass } from './pickersFadeTransitionGroupClasses';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  const useUtilityClasses = ownerState => {
@@ -15,7 +15,6 @@ const useUtilityClasses = ownerState => {
15
15
  };
16
16
  return composeClasses(slots, getPickersFadeTransitionGroupUtilityClass, classes);
17
17
  };
18
- const animationDuration = 500;
19
18
  const PickersFadeTransitionGroupRoot = styled(TransitionGroup, {
20
19
  name: 'MuiPickersFadeTransitionGroup',
21
20
  slot: 'Root',
@@ -40,6 +39,7 @@ export function PickersFadeTransitionGroup(inProps) {
40
39
  transKey
41
40
  } = props;
42
41
  const classes = useUtilityClasses(props);
42
+ const theme = useTheme();
43
43
  if (reduceAnimations) {
44
44
  return children;
45
45
  }
@@ -50,8 +50,8 @@ export function PickersFadeTransitionGroup(inProps) {
50
50
  mountOnEnter: true,
51
51
  unmountOnExit: true,
52
52
  timeout: {
53
- appear: animationDuration,
54
- enter: animationDuration / 2,
53
+ appear: theme.transitions.duration.enteringScreen,
54
+ enter: theme.transitions.duration.enteringScreen,
55
55
  exit: 0
56
56
  },
57
57
  children: children
@@ -12,7 +12,6 @@ export interface SlideTransitionProps extends Omit<CSSTransitionProps, 'timeout'
12
12
  slideDirection: SlideDirection;
13
13
  transKey: React.Key;
14
14
  }
15
- export declare const slideAnimationDuration = 350;
16
15
  /**
17
16
  * @ignore - do not document.
18
17
  */
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["children", "className", "reduceAnimations", "slideDirection", "transKey", "classes"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
- import { styled, useThemeProps } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
8
  import { CSSTransition, TransitionGroup } from 'react-transition-group';
9
9
  import { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -22,7 +22,6 @@ const useUtilityClasses = ownerState => {
22
22
  };
23
23
  return composeClasses(slots, getPickersSlideTransitionUtilityClass, classes);
24
24
  };
25
- export const slideAnimationDuration = 350;
26
25
  const PickersSlideTransitionRoot = styled(TransitionGroup, {
27
26
  name: 'MuiPickersSlideTransition',
28
27
  slot: 'Root',
@@ -43,7 +42,7 @@ const PickersSlideTransitionRoot = styled(TransitionGroup, {
43
42
  theme
44
43
  }) => {
45
44
  const slideTransition = theme.transitions.create('transform', {
46
- duration: slideAnimationDuration,
45
+ duration: theme.transitions.duration.complex,
47
46
  easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'
48
47
  });
49
48
  return {
@@ -105,6 +104,7 @@ export function PickersSlideTransition(inProps) {
105
104
  } = props,
106
105
  other = _objectWithoutPropertiesLoose(props, _excluded);
107
106
  const classes = useUtilityClasses(props);
107
+ const theme = useTheme();
108
108
  if (reduceAnimations) {
109
109
  return /*#__PURE__*/_jsx("div", {
110
110
  className: clsx(classes.root, className),
@@ -126,7 +126,7 @@ export function PickersSlideTransition(inProps) {
126
126
  children: /*#__PURE__*/_jsx(CSSTransition, _extends({
127
127
  mountOnEnter: true,
128
128
  unmountOnExit: true,
129
- timeout: slideAnimationDuration,
129
+ timeout: theme.transitions.duration.complex,
130
130
  classNames: transitionClasses
131
131
  }, other, {
132
132
  children: children
@@ -1,4 +1,6 @@
1
1
  export interface DayCalendarClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
2
4
  /** Styles applied to the header element. */
3
5
  header: string;
4
6
  /** Styles applied to the week day label element. */
@@ -1,3 +1,3 @@
1
1
  import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
2
  export const getDayCalendarUtilityClass = slot => generateUtilityClass('MuiDayCalendar', slot);
3
- export const dayPickerClasses = generateUtilityClasses('MuiDayCalendar', ['header', 'weekDayLabel', 'loadingContainer', 'slideTransition', 'monthContainer', 'weekContainer', 'weekNumberLabel', 'weekNumber']);
3
+ export const dayPickerClasses = generateUtilityClasses('MuiDayCalendar', ['root', 'header', 'weekDayLabel', 'loadingContainer', 'slideTransition', 'monthContainer', 'weekContainer', 'weekNumberLabel', 'weekNumber']);
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
4
4
  _excluded2 = ["inputRef"],
5
- _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly"];
5
+ _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
@@ -10,6 +10,7 @@ import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
11
  import { refType } from '@mui/utils';
12
12
  import { useDateField } from './useDateField';
13
+ import { useClearableField } from '../hooks';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
15
16
  var _ref, _slots$textField, _slotProps$textField;
@@ -51,13 +52,28 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
51
52
  onPaste,
52
53
  onKeyDown,
53
54
  inputMode,
54
- readOnly
55
+ readOnly,
56
+ clearable,
57
+ onClear
55
58
  } = _useDateField,
56
59
  fieldProps = _objectWithoutPropertiesLoose(_useDateField, _excluded3);
60
+ const {
61
+ InputProps: ProcessedInputProps,
62
+ fieldProps: processedFieldProps
63
+ } = useClearableField({
64
+ onClear,
65
+ clearable,
66
+ fieldProps,
67
+ InputProps: fieldProps.InputProps,
68
+ slots,
69
+ slotProps,
70
+ components,
71
+ componentsProps
72
+ });
57
73
  return /*#__PURE__*/_jsx(TextField, _extends({
58
74
  ref: ref
59
- }, fieldProps, {
60
- InputProps: _extends({}, fieldProps.InputProps, {
75
+ }, processedFieldProps, {
76
+ InputProps: _extends({}, ProcessedInputProps, {
61
77
  readOnly
62
78
  }),
63
79
  inputProps: _extends({}, fieldProps.inputProps, {
@@ -79,6 +95,11 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
79
95
  */
80
96
  autoFocus: PropTypes.bool,
81
97
  className: PropTypes.string,
98
+ /**
99
+ * If `true`, a clear button will be shown in the field allowing value clearing.
100
+ * @default false
101
+ */
102
+ clearable: PropTypes.bool,
82
103
  /**
83
104
  * The color of the component.
84
105
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -207,6 +228,10 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
207
228
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
208
229
  */
209
230
  onChange: PropTypes.func,
231
+ /**
232
+ * Callback fired when the clear button is clicked.
233
+ */
234
+ onClear: PropTypes.func,
210
235
  /**
211
236
  * Callback fired when the error associated to the current value changes.
212
237
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -253,6 +278,9 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
253
278
  })]),
254
279
  /**
255
280
  * Disable specific date.
281
+ *
282
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
283
+ *
256
284
  * @template TDate
257
285
  * @param {TDate} day The date to test.
258
286
  * @returns {boolean} If `true` the date will be disabled.
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField from '@mui/material/TextField';
4
+ import { FieldSlotsComponents, FieldSlotsComponentsProps } from '../internals';
4
5
  import { DateValidationError, FieldSection } from '../models';
5
6
  import { UseFieldInternalProps } from '../internals/hooks/useField';
6
7
  import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
@@ -18,7 +19,7 @@ export type UseDateFieldComponentProps<TDate, TChildProps extends {}> = Omit<TCh
18
19
  export interface DateFieldProps<TDate> extends UseDateFieldComponentProps<TDate, FieldsTextFieldProps>, SlotsAndSlotProps<DateFieldSlotsComponent, DateFieldSlotsComponentsProps<TDate>> {
19
20
  }
20
21
  export type DateFieldOwnerState<TDate> = DateFieldProps<TDate>;
21
- export interface DateFieldSlotsComponent {
22
+ export interface DateFieldSlotsComponent extends FieldSlotsComponents {
22
23
  /**
23
24
  * Form control with an input to render the value.
24
25
  * Receives the same props as `@mui/material/TextField`.
@@ -26,6 +27,6 @@ export interface DateFieldSlotsComponent {
26
27
  */
27
28
  TextField?: React.ElementType;
28
29
  }
29
- export interface DateFieldSlotsComponentsProps<TDate> {
30
+ export interface DateFieldSlotsComponentsProps<TDate> extends FieldSlotsComponentsProps {
30
31
  textField?: SlotComponentProps<typeof TextField, {}, DateFieldOwnerState<TDate>>;
31
32
  }
@@ -68,9 +68,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
68
68
  componentsProps: PropTypes.object,
69
69
  /**
70
70
  * Formats the day of week displayed in the calendar header.
71
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
71
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
72
+ * @param {TDate} date The date of the day of week provided by the adapter.
72
73
  * @returns {string} The name to display.
73
- * @default (day) => day.charAt(0).toUpperCase()
74
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
74
75
  */
75
76
  dayOfWeekFormatter: PropTypes.func,
76
77
  /**
@@ -270,6 +271,9 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
270
271
  })]),
271
272
  /**
272
273
  * Disable specific date.
274
+ *
275
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
276
+ *
273
277
  * @template TDate
274
278
  * @param {TDate} day The date to test.
275
279
  * @returns {boolean} If `true` the date will be disabled.
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
4
4
  _excluded2 = ["inputRef"],
5
- _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly"];
5
+ _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
@@ -10,6 +10,7 @@ import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
11
  import { refType } from '@mui/utils';
12
12
  import { useDateTimeField } from './useDateTimeField';
13
+ import { useClearableField } from '../hooks';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inProps, ref) {
15
16
  var _ref, _slots$textField, _slotProps$textField;
@@ -51,13 +52,28 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
51
52
  onPaste,
52
53
  onKeyDown,
53
54
  inputMode,
54
- readOnly
55
+ readOnly,
56
+ clearable,
57
+ onClear
55
58
  } = _useDateTimeField,
56
59
  fieldProps = _objectWithoutPropertiesLoose(_useDateTimeField, _excluded3);
60
+ const {
61
+ InputProps: ProcessedInputProps,
62
+ fieldProps: processedFieldProps
63
+ } = useClearableField({
64
+ onClear,
65
+ clearable,
66
+ fieldProps,
67
+ InputProps: fieldProps.InputProps,
68
+ slots,
69
+ slotProps,
70
+ components,
71
+ componentsProps
72
+ });
57
73
  return /*#__PURE__*/_jsx(TextField, _extends({
58
74
  ref: ref
59
- }, fieldProps, {
60
- InputProps: _extends({}, fieldProps.InputProps, {
75
+ }, processedFieldProps, {
76
+ InputProps: _extends({}, ProcessedInputProps, {
61
77
  readOnly
62
78
  }),
63
79
  inputProps: _extends({}, fieldProps.inputProps, {
@@ -84,6 +100,11 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
84
100
  */
85
101
  autoFocus: PropTypes.bool,
86
102
  className: PropTypes.string,
103
+ /**
104
+ * If `true`, a clear button will be shown in the field allowing value clearing.
105
+ * @default false
106
+ */
107
+ clearable: PropTypes.bool,
87
108
  /**
88
109
  * The color of the component.
89
110
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -240,6 +261,10 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
240
261
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
241
262
  */
242
263
  onChange: PropTypes.func,
264
+ /**
265
+ * Callback fired when the clear button is clicked.
266
+ */
267
+ onClear: PropTypes.func,
243
268
  /**
244
269
  * Callback fired when the error associated to the current value changes.
245
270
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -294,6 +319,9 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
294
319
  shouldDisableClock: PropTypes.func,
295
320
  /**
296
321
  * Disable specific date.
322
+ *
323
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
324
+ *
297
325
  * @template TDate
298
326
  * @param {TDate} day The date to test.
299
327
  * @returns {boolean} If `true` the date will be disabled.