@mui/x-date-pickers 7.0.0-beta.1 → 7.0.0-beta.2

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 (282) hide show
  1. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +5 -0
  2. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +5 -0
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +0 -1
  4. package/AdapterDayjs/AdapterDayjs.d.ts +5 -0
  5. package/AdapterDayjs/AdapterDayjs.js +0 -1
  6. package/AdapterLuxon/AdapterLuxon.d.ts +5 -0
  7. package/AdapterLuxon/AdapterLuxon.js +1 -2
  8. package/AdapterMoment/AdapterMoment.d.ts +5 -0
  9. package/AdapterMoment/AdapterMoment.js +0 -1
  10. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +5 -0
  11. package/AdapterMomentHijri/AdapterMomentHijri.js +0 -1
  12. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +5 -0
  13. package/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -1
  14. package/CHANGELOG.md +159 -1
  15. package/DateCalendar/DateCalendar.d.ts +2 -1
  16. package/DateCalendar/DateCalendar.js +5 -5
  17. package/DateCalendar/DateCalendar.types.d.ts +6 -6
  18. package/DateCalendar/DayCalendar.d.ts +6 -6
  19. package/DateCalendar/useCalendarState.d.ts +7 -7
  20. package/DateCalendar/useIsDateDisabled.d.ts +2 -1
  21. package/DateField/DateField.d.ts +2 -1
  22. package/DateField/DateField.js +5 -5
  23. package/DateField/DateField.types.d.ts +7 -7
  24. package/DateField/useDateField.d.ts +2 -1
  25. package/DatePicker/DatePicker.d.ts +2 -1
  26. package/DatePicker/DatePicker.js +5 -5
  27. package/DatePicker/DatePicker.types.d.ts +4 -3
  28. package/DatePicker/DatePickerToolbar.d.ts +3 -3
  29. package/DatePicker/DatePickerToolbar.js +1 -1
  30. package/DatePicker/shared.d.ts +6 -6
  31. package/DateTimeField/DateTimeField.d.ts +2 -1
  32. package/DateTimeField/DateTimeField.js +9 -9
  33. package/DateTimeField/DateTimeField.types.d.ts +7 -7
  34. package/DateTimeField/useDateTimeField.d.ts +2 -1
  35. package/DateTimePicker/DateTimePicker.d.ts +2 -1
  36. package/DateTimePicker/DateTimePicker.js +9 -9
  37. package/DateTimePicker/DateTimePicker.types.d.ts +4 -3
  38. package/DateTimePicker/DateTimePickerToolbar.d.ts +3 -2
  39. package/DateTimePicker/DateTimePickerToolbar.js +1 -1
  40. package/DateTimePicker/shared.d.ts +6 -6
  41. package/DesktopDatePicker/DesktopDatePicker.d.ts +2 -1
  42. package/DesktopDatePicker/DesktopDatePicker.js +5 -5
  43. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +4 -4
  44. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +2 -1
  45. package/DesktopDateTimePicker/DesktopDateTimePicker.js +9 -9
  46. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +4 -4
  47. package/DesktopTimePicker/DesktopTimePicker.d.ts +2 -1
  48. package/DesktopTimePicker/DesktopTimePicker.js +5 -5
  49. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +4 -4
  50. package/DigitalClock/DigitalClock.d.ts +2 -1
  51. package/DigitalClock/DigitalClock.js +5 -5
  52. package/DigitalClock/DigitalClock.types.d.ts +4 -4
  53. package/LocalizationProvider/LocalizationProvider.d.ts +5 -5
  54. package/MobileDatePicker/MobileDatePicker.d.ts +2 -1
  55. package/MobileDatePicker/MobileDatePicker.js +5 -5
  56. package/MobileDatePicker/MobileDatePicker.types.d.ts +4 -4
  57. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -1
  58. package/MobileDateTimePicker/MobileDateTimePicker.js +9 -9
  59. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +4 -4
  60. package/MobileTimePicker/MobileTimePicker.d.ts +2 -1
  61. package/MobileTimePicker/MobileTimePicker.js +5 -5
  62. package/MobileTimePicker/MobileTimePicker.types.d.ts +4 -4
  63. package/MonthCalendar/MonthCalendar.d.ts +3 -2
  64. package/MonthCalendar/MonthCalendar.js +5 -5
  65. package/MonthCalendar/MonthCalendar.types.d.ts +2 -2
  66. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +2 -1
  67. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -5
  68. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +4 -3
  69. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +5 -5
  70. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +2 -1
  71. package/PickersCalendarHeader/PickersCalendarHeader.js +3 -3
  72. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +6 -6
  73. package/PickersDay/PickersDay.d.ts +3 -2
  74. package/PickersDay/PickersDay.js +1 -1
  75. package/PickersLayout/PickersLayout.d.ts +2 -1
  76. package/PickersLayout/PickersLayout.types.d.ts +7 -6
  77. package/PickersLayout/usePickerLayout.d.ts +2 -1
  78. package/StaticDatePicker/StaticDatePicker.d.ts +2 -1
  79. package/StaticDatePicker/StaticDatePicker.js +5 -5
  80. package/StaticDatePicker/StaticDatePicker.types.d.ts +4 -4
  81. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +2 -1
  82. package/StaticDateTimePicker/StaticDateTimePicker.js +9 -9
  83. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +4 -4
  84. package/StaticTimePicker/StaticTimePicker.d.ts +2 -1
  85. package/StaticTimePicker/StaticTimePicker.js +5 -5
  86. package/StaticTimePicker/StaticTimePicker.types.d.ts +4 -4
  87. package/TimeClock/Clock.d.ts +3 -3
  88. package/TimeClock/ClockNumbers.d.ts +4 -4
  89. package/TimeClock/TimeClock.d.ts +2 -1
  90. package/TimeClock/TimeClock.js +5 -5
  91. package/TimeClock/TimeClock.types.d.ts +3 -3
  92. package/TimeField/TimeField.d.ts +2 -1
  93. package/TimeField/TimeField.js +5 -5
  94. package/TimeField/TimeField.types.d.ts +7 -7
  95. package/TimeField/useTimeField.d.ts +2 -1
  96. package/TimePicker/TimePicker.d.ts +2 -1
  97. package/TimePicker/TimePicker.js +5 -5
  98. package/TimePicker/TimePicker.types.d.ts +4 -3
  99. package/TimePicker/TimePickerToolbar.d.ts +3 -2
  100. package/TimePicker/TimePickerToolbar.js +1 -1
  101. package/TimePicker/shared.d.ts +5 -5
  102. package/YearCalendar/YearCalendar.d.ts +2 -1
  103. package/YearCalendar/YearCalendar.js +5 -5
  104. package/YearCalendar/YearCalendar.types.d.ts +2 -2
  105. package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +3 -2
  106. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  107. package/index.js +1 -1
  108. package/internals/hooks/date-helpers-hooks.d.ts +5 -5
  109. package/internals/hooks/useClockReferenceDate.d.ts +3 -3
  110. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -1
  111. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -7
  112. package/internals/hooks/useField/useField.d.ts +2 -2
  113. package/internals/hooks/useField/useField.types.d.ts +7 -7
  114. package/internals/hooks/useField/useField.utils.d.ts +13 -13
  115. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +3 -3
  116. package/internals/hooks/useField/useFieldState.d.ts +2 -2
  117. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -1
  118. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -7
  119. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  120. package/internals/hooks/usePicker/usePicker.types.d.ts +4 -4
  121. package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
  122. package/internals/hooks/usePicker/usePickerValue.types.d.ts +5 -5
  123. package/internals/hooks/usePicker/usePickerViews.d.ts +5 -5
  124. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +2 -1
  125. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
  126. package/internals/hooks/useUtils.d.ts +6 -6
  127. package/internals/hooks/useValidation.d.ts +3 -2
  128. package/internals/hooks/useValueWithTimezone.d.ts +3 -3
  129. package/internals/hooks/useViews.d.ts +2 -1
  130. package/internals/models/fields.d.ts +2 -2
  131. package/internals/models/props/basePickerProps.d.ts +3 -2
  132. package/internals/models/props/clock.d.ts +4 -4
  133. package/internals/models/validation.d.ts +7 -7
  134. package/internals/utils/date-time-utils.d.ts +5 -5
  135. package/internals/utils/date-utils.d.ts +12 -12
  136. package/internals/utils/getDefaultReferenceDate.d.ts +3 -3
  137. package/internals/utils/time-utils.d.ts +6 -6
  138. package/internals/utils/validation/validateDate.d.ts +2 -2
  139. package/internals/utils/validation/validateDateTime.d.ts +2 -2
  140. package/internals/utils/validation/validateTime.d.ts +2 -2
  141. package/internals/utils/valueManagers.d.ts +2 -2
  142. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +0 -1
  143. package/legacy/AdapterDayjs/AdapterDayjs.js +0 -1
  144. package/legacy/AdapterLuxon/AdapterLuxon.js +1 -2
  145. package/legacy/AdapterMoment/AdapterMoment.js +0 -1
  146. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +0 -1
  147. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -1
  148. package/legacy/DateCalendar/DateCalendar.js +5 -5
  149. package/legacy/DateField/DateField.js +5 -5
  150. package/legacy/DatePicker/DatePicker.js +5 -5
  151. package/legacy/DatePicker/DatePickerToolbar.js +1 -1
  152. package/legacy/DateTimeField/DateTimeField.js +9 -9
  153. package/legacy/DateTimePicker/DateTimePicker.js +9 -9
  154. package/legacy/DateTimePicker/DateTimePickerToolbar.js +1 -1
  155. package/legacy/DesktopDatePicker/DesktopDatePicker.js +5 -5
  156. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +9 -9
  157. package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -5
  158. package/legacy/DigitalClock/DigitalClock.js +5 -5
  159. package/legacy/MobileDatePicker/MobileDatePicker.js +5 -5
  160. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +9 -9
  161. package/legacy/MobileTimePicker/MobileTimePicker.js +5 -5
  162. package/legacy/MonthCalendar/MonthCalendar.js +5 -5
  163. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -5
  164. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +3 -3
  165. package/legacy/PickersDay/PickersDay.js +1 -1
  166. package/legacy/StaticDatePicker/StaticDatePicker.js +5 -5
  167. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +9 -9
  168. package/legacy/StaticTimePicker/StaticTimePicker.js +5 -5
  169. package/legacy/TimeClock/TimeClock.js +5 -5
  170. package/legacy/TimeField/TimeField.js +5 -5
  171. package/legacy/TimePicker/TimePicker.js +5 -5
  172. package/legacy/TimePicker/TimePickerToolbar.js +1 -1
  173. package/legacy/YearCalendar/YearCalendar.js +5 -5
  174. package/legacy/index.js +1 -1
  175. package/locales/beBY.d.ts +6 -6
  176. package/locales/caES.d.ts +6 -6
  177. package/locales/csCZ.d.ts +6 -6
  178. package/locales/daDK.d.ts +6 -6
  179. package/locales/deDE.d.ts +6 -6
  180. package/locales/elGR.d.ts +6 -6
  181. package/locales/enUS.d.ts +6 -6
  182. package/locales/esES.d.ts +6 -6
  183. package/locales/eu.d.ts +6 -6
  184. package/locales/faIR.d.ts +6 -6
  185. package/locales/fiFI.d.ts +6 -6
  186. package/locales/frFR.d.ts +6 -6
  187. package/locales/heIL.d.ts +6 -6
  188. package/locales/huHU.d.ts +6 -6
  189. package/locales/isIS.d.ts +6 -6
  190. package/locales/itIT.d.ts +6 -6
  191. package/locales/jaJP.d.ts +6 -6
  192. package/locales/koKR.d.ts +6 -6
  193. package/locales/kzKZ.d.ts +6 -6
  194. package/locales/mk.d.ts +6 -6
  195. package/locales/nbNO.d.ts +6 -6
  196. package/locales/nlNL.d.ts +6 -6
  197. package/locales/plPL.d.ts +6 -6
  198. package/locales/ptBR.d.ts +6 -6
  199. package/locales/roRO.d.ts +6 -6
  200. package/locales/ruRU.d.ts +6 -6
  201. package/locales/skSK.d.ts +6 -6
  202. package/locales/svSE.d.ts +6 -6
  203. package/locales/trTR.d.ts +6 -6
  204. package/locales/ukUA.d.ts +6 -6
  205. package/locales/urPK.d.ts +6 -6
  206. package/locales/utils/getPickersLocalization.d.ts +6 -6
  207. package/locales/utils/pickersLocaleTextApi.d.ts +6 -6
  208. package/locales/viVN.d.ts +6 -6
  209. package/locales/zhCN.d.ts +6 -6
  210. package/locales/zhHK.d.ts +6 -6
  211. package/models/adapters.d.ts +2 -1
  212. package/models/fields.d.ts +3 -2
  213. package/models/pickers.d.ts +3 -0
  214. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +0 -1
  215. package/modern/AdapterDayjs/AdapterDayjs.js +0 -1
  216. package/modern/AdapterLuxon/AdapterLuxon.js +1 -2
  217. package/modern/AdapterMoment/AdapterMoment.js +0 -1
  218. package/modern/AdapterMomentHijri/AdapterMomentHijri.js +0 -1
  219. package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -1
  220. package/modern/DateCalendar/DateCalendar.js +5 -5
  221. package/modern/DateField/DateField.js +5 -5
  222. package/modern/DatePicker/DatePicker.js +5 -5
  223. package/modern/DatePicker/DatePickerToolbar.js +1 -1
  224. package/modern/DateTimeField/DateTimeField.js +9 -9
  225. package/modern/DateTimePicker/DateTimePicker.js +9 -9
  226. package/modern/DateTimePicker/DateTimePickerToolbar.js +1 -1
  227. package/modern/DesktopDatePicker/DesktopDatePicker.js +5 -5
  228. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +9 -9
  229. package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -5
  230. package/modern/DigitalClock/DigitalClock.js +5 -5
  231. package/modern/MobileDatePicker/MobileDatePicker.js +5 -5
  232. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +9 -9
  233. package/modern/MobileTimePicker/MobileTimePicker.js +5 -5
  234. package/modern/MonthCalendar/MonthCalendar.js +5 -5
  235. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -5
  236. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +3 -3
  237. package/modern/PickersDay/PickersDay.js +1 -1
  238. package/modern/StaticDatePicker/StaticDatePicker.js +5 -5
  239. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +9 -9
  240. package/modern/StaticTimePicker/StaticTimePicker.js +5 -5
  241. package/modern/TimeClock/TimeClock.js +5 -5
  242. package/modern/TimeField/TimeField.js +5 -5
  243. package/modern/TimePicker/TimePicker.js +5 -5
  244. package/modern/TimePicker/TimePickerToolbar.js +1 -1
  245. package/modern/YearCalendar/YearCalendar.js +5 -5
  246. package/modern/index.js +1 -1
  247. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +0 -1
  248. package/node/AdapterDayjs/AdapterDayjs.js +0 -1
  249. package/node/AdapterLuxon/AdapterLuxon.js +1 -2
  250. package/node/AdapterMoment/AdapterMoment.js +0 -1
  251. package/node/AdapterMomentHijri/AdapterMomentHijri.js +0 -1
  252. package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -1
  253. package/node/DateCalendar/DateCalendar.js +5 -5
  254. package/node/DateField/DateField.js +5 -5
  255. package/node/DatePicker/DatePicker.js +5 -5
  256. package/node/DatePicker/DatePickerToolbar.js +1 -1
  257. package/node/DateTimeField/DateTimeField.js +9 -9
  258. package/node/DateTimePicker/DateTimePicker.js +9 -9
  259. package/node/DateTimePicker/DateTimePickerToolbar.js +1 -1
  260. package/node/DesktopDatePicker/DesktopDatePicker.js +5 -5
  261. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +9 -9
  262. package/node/DesktopTimePicker/DesktopTimePicker.js +5 -5
  263. package/node/DigitalClock/DigitalClock.js +5 -5
  264. package/node/MobileDatePicker/MobileDatePicker.js +5 -5
  265. package/node/MobileDateTimePicker/MobileDateTimePicker.js +9 -9
  266. package/node/MobileTimePicker/MobileTimePicker.js +5 -5
  267. package/node/MonthCalendar/MonthCalendar.js +5 -5
  268. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -5
  269. package/node/PickersCalendarHeader/PickersCalendarHeader.js +3 -3
  270. package/node/PickersDay/PickersDay.js +1 -1
  271. package/node/StaticDatePicker/StaticDatePicker.js +5 -5
  272. package/node/StaticDateTimePicker/StaticDateTimePicker.js +9 -9
  273. package/node/StaticTimePicker/StaticTimePicker.js +5 -5
  274. package/node/TimeClock/TimeClock.js +5 -5
  275. package/node/TimeField/TimeField.js +5 -5
  276. package/node/TimePicker/TimePicker.js +5 -5
  277. package/node/TimePicker/TimePickerToolbar.js +1 -1
  278. package/node/YearCalendar/YearCalendar.js +5 -5
  279. package/node/index.js +1 -1
  280. package/package.json +1 -1
  281. package/themeAugmentation/props.d.ts +31 -31
  282. package/timeViewRenderers/timeViewRenderers.d.ts +4 -4
@@ -11,6 +11,11 @@ type DateFnsLocaleBase = {
11
11
  type DateFnsAdapterBaseOptions<DateFnsLocale extends DateFnsLocaleBase> = MakeRequired<AdapterOptions<DateFnsLocale, never>, 'locale'> & {
12
12
  longFormatters: Record<'p' | 'P', (token: string, formatLong: any) => string>;
13
13
  };
14
+ declare module '@mui/x-date-pickers/models' {
15
+ interface PickerValidDateLookup {
16
+ 'date-fns': Date;
17
+ }
18
+ }
14
19
  /**
15
20
  * Based on `@date-io/date-fns`
16
21
  *
@@ -2,6 +2,11 @@
2
2
  import defaultLocale from 'date-fns-jalali/locale/fa-IR';
3
3
  import { AdapterFormats, AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
4
4
  type DateFnsLocale = typeof defaultLocale;
5
+ declare module '@mui/x-date-pickers/models' {
6
+ interface PickerValidDateLookup {
7
+ 'date-fns-jalali': Date;
8
+ }
9
+ }
5
10
  /**
6
11
  * Based on `@date-io/date-fns-jalali`
7
12
  *
@@ -246,7 +246,6 @@ const NUMBER_SYMBOL_MAP = {
246
246
  '9': '۹',
247
247
  '0': '۰'
248
248
  };
249
-
250
249
  /**
251
250
  * Based on `@date-io/date-fns-jalali`
252
251
  *
@@ -1,6 +1,11 @@
1
1
  import defaultDayjs, { Dayjs } from 'dayjs';
2
2
  import { FieldFormatTokenMap, MuiPickersAdapter, AdapterFormats, AdapterOptions, PickersTimezone, DateBuilderReturnType } from '../models';
3
3
  type Constructor = (...args: Parameters<typeof defaultDayjs>) => Dayjs;
4
+ declare module '@mui/x-date-pickers/models' {
5
+ interface PickerValidDateLookup {
6
+ dayjs: Dayjs;
7
+ }
8
+ }
4
9
  /**
5
10
  * Based on `@date-io/dayjs`
6
11
  *
@@ -120,7 +120,6 @@ const defaultFormats = {
120
120
  const MISSING_UTC_PLUGIN = ['Missing UTC plugin', 'To be able to use UTC or timezones, you have to enable the `utc` plugin', 'Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc'].join('\n');
121
121
  const MISSING_TIMEZONE_PLUGIN = ['Missing timezone plugin', 'To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin', 'Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone'].join('\n');
122
122
  const withLocale = (dayjs, locale) => !locale ? dayjs : (...args) => dayjs(...args).locale(locale);
123
-
124
123
  /**
125
124
  * Based on `@date-io/dayjs`
126
125
  *
@@ -1,5 +1,10 @@
1
1
  import { DateTime } from 'luxon';
2
2
  import { AdapterFormats, AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter, PickersTimezone } from '../models';
3
+ declare module '@mui/x-date-pickers/models' {
4
+ interface PickerValidDateLookup {
5
+ luxon: DateTime;
6
+ }
7
+ }
3
8
  /**
4
9
  * Based on `@date-io/luxon`
5
10
  *
@@ -131,7 +131,6 @@ const defaultFormats = {
131
131
  keyboardDateTime12h: 'D hh:mm a',
132
132
  keyboardDateTime24h: 'D T'
133
133
  };
134
-
135
134
  /**
136
135
  * Based on `@date-io/luxon`
137
136
  *
@@ -329,7 +328,7 @@ export class AdapterLuxon {
329
328
  return diff.days < 0;
330
329
  };
331
330
  this.isWithinRange = (value, [start, end]) => {
332
- return value.equals(start) || value.equals(end) || this.isAfter(value, start) && this.isBefore(value, end);
331
+ return this.isEqual(value, start) || this.isEqual(value, end) || this.isAfter(value, start) && this.isBefore(value, end);
333
332
  };
334
333
  this.startOfYear = value => {
335
334
  return value.startOf('year');
@@ -1,5 +1,10 @@
1
1
  import defaultMoment, { Moment } from 'moment';
2
2
  import { AdapterFormats, AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter, PickersTimezone } from '../models';
3
+ declare module '@mui/x-date-pickers/models' {
4
+ interface PickerValidDateLookup {
5
+ moment: Moment;
6
+ }
7
+ }
3
8
  /**
4
9
  * Based on `@date-io/moment`
5
10
  *
@@ -121,7 +121,6 @@ const defaultFormats = {
121
121
  keyboardDateTime24h: 'L HH:mm'
122
122
  };
123
123
  const MISSING_TIMEZONE_PLUGIN = ['Missing timezone plugin', 'To be able to use timezones, you have to pass the default export from `moment-timezone` to the `dateLibInstance` prop of `LocalizationProvider`', 'Find more information on https://mui.com/x/react-date-pickers/timezone/#moment-and-timezone'].join('\n');
124
-
125
124
  /**
126
125
  * Based on `@date-io/moment`
127
126
  *
@@ -1,6 +1,11 @@
1
1
  import defaultHMoment, { Moment } from 'moment-hijri';
2
2
  import { AdapterMoment } from '../AdapterMoment';
3
3
  import { AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
4
+ declare module '@mui/x-date-pickers/models' {
5
+ interface PickerValidDateLookup {
6
+ 'moment-hijri': Moment;
7
+ }
8
+ }
4
9
  /**
5
10
  * Based on `@date-io/hijri`
6
11
  *
@@ -102,7 +102,6 @@ const NUMBER_SYMBOL_MAP = {
102
102
  '9': '٩',
103
103
  '0': '٠'
104
104
  };
105
-
106
105
  /**
107
106
  * Based on `@date-io/hijri`
108
107
  *
@@ -1,6 +1,11 @@
1
1
  import defaultJMoment, { Moment } from 'moment-jalaali';
2
2
  import { AdapterMoment } from '../AdapterMoment';
3
3
  import { AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
4
+ declare module '@mui/x-date-pickers/models' {
5
+ interface PickerValidDateLookup {
6
+ 'moment-jalaali': Moment;
7
+ }
8
+ }
4
9
  /**
5
10
  * Based on `@date-io/jalaali`
6
11
  *
@@ -100,7 +100,6 @@ const NUMBER_SYMBOL_MAP = {
100
100
  '9': '۹',
101
101
  '0': '۰'
102
102
  };
103
-
104
103
  /**
105
104
  * Based on `@date-io/jalaali`
106
105
  *
package/CHANGELOG.md CHANGED
@@ -3,6 +3,108 @@
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
+ ## v7.0.0-beta.2
7
+
8
+ _Feb 9, 2024_
9
+
10
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 Add slot typings on the Data Grid components (#11795) @romgrk
13
+ - 🎁 Support UTC date formatting in Charts tooltip (#11943) @shaharyar-shamshi
14
+ - 🌍 Improve Danish (da-DK) locale Data Grid (#11877) @ShahrazH
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ ### Data Grid
19
+
20
+ #### `@mui/x-data-grid@v7.0.0-beta.2`
21
+
22
+ - [DataGrid] Add `removeAllFilterItems` as a reason of `onFilterModelChange` callback (#11911) @shaharyar-shamshi
23
+ - [DataGrid] Add slot typings (#11795) @romgrk
24
+ - [DataGrid] Add support for dialogs in menu actions (#11909) @cherniavskii
25
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11609) @pcorpet
26
+ - [DataGrid] Fix incorrect computation of `lastPage` in `GridPagination` (#11958) @MBilalShafi
27
+ - [DataGrid] Improve vertical scrolling performance (#11924) @romgrk
28
+ - [l10n] Improve Danish (da-DK) locale (#11877) @ShahrazH
29
+
30
+ #### `@mui/x-data-grid-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@v7.0.0-beta.2`.
33
+
34
+ #### `@mui/x-data-grid-premium@v7.0.0-beta.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
+
36
+ Same changes as in `@mui/x-data-grid-pro@v7.0.0-beta.2`, plus:
37
+
38
+ - [DataGridPremium] Fix autosize grouping cell (#11870) @romgrk
39
+ - [DataGridPremium] Fix clipboard paste not working with Caps Lock enabled (#11965) @shaharyar-shamshi
40
+
41
+ ### Date Pickers
42
+
43
+ #### `@mui/x-date-pickers@v7.0.0-beta.2`
44
+
45
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11936) @LukasTy
46
+ - [pickers] Limit the valid values of `TDate` (#11791) @flaviendelangle
47
+
48
+ #### `@mui/x-date-pickers-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
51
+
52
+ ### Charts / `@mui/x-charts@v7.0.0-beta.2`
53
+
54
+ - [charts] Add `reverse` property to axes (#11899) @alexfauquette
55
+ - [charts] Allow series ids to be numbers (#11941) @alexfauquette
56
+ - [charts] Support UTC date formatting in tooltip (#11943) @shaharyar-shamshi
57
+
58
+ ### Tree View / `@mui/x-tree-view@v7.0.0-beta.2`
59
+
60
+ - [TreeView] Correctly detect if an item is expandable (#11963) @swalker326
61
+ - [TreeView] Polish the default design & revise the simple version pages (#11529) @danilo-leal
62
+
63
+ ### License
64
+
65
+ #### Breaking changes
66
+
67
+ - If you're using the [commercial license](https://next.mui.com/x/introduction/licensing), you need to update the import path:
68
+
69
+ ```diff
70
+ -import { LicenseInfo } from '@mui/x-license-pro';
71
+ +import { LicenseInfo } from '@mui/x-license';
72
+ ```
73
+
74
+ `@mui/x-license@v7.0.0-beta.2`
75
+
76
+ - [license] Rename `@mui/x-license-pro` to `@mui/x-license` (#11938) @cherniavskii
77
+
78
+ ### Docs
79
+
80
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11985) @flaviendelangle
81
+ - [docs] Add missing `Charts` breaking change steps (#11971) @alexfauquette
82
+ - [docs] Fix `ChartsTooltip` typo (#11961) @thisisharsh7
83
+ - [docs] Refactor `Localization` documentation sections (#11989) @LukasTy
84
+ - [docs] Use "cannot" instead of "can't" or "can not" (#11986) @flaviendelangle
85
+ - [docs] Add quick fixes to the migration guide (#11806) @danilo-leal
86
+ - [docs] Avoid use of shorthand (#12000) @oliviertassinari
87
+ - [docs] Avoid the use of MUI Core @oliviertassinari
88
+ - [docs] Fix image size and dark mode @oliviertassinari
89
+ - [docs] Follow blank line convention with use client @oliviertassinari
90
+ - [docs] Stable layout between light and dark mode @oliviertassinari
91
+
92
+ ### Core
93
+
94
+ - [core] Add `docs:serve` script (#11935) @cherniavskii
95
+ - [core] Bump monorepo (#12001) @cherniavskii
96
+ - [core] Deprecate `LicenseInfo` re-exports (#11956) @cherniavskii
97
+ - [core] Fix `test_types` failing on the `next` branch (#11944) @cherniavskii
98
+ - [core] Fix failing `test_static` on the next branch (#11977) @cherniavskii
99
+ - [core] Flatten grid packages folder (#11946) @cherniavskii
100
+ - [core] Improve license info deprecation message (#11974) @cherniavskii
101
+ - [core] Integrate changes from Core #40842 PR (#11801) @michaldudak
102
+ - [core] Move next config to ESM (#11882) @Janpot
103
+ - [core] Add auto-message on closed issues (#11805) @michelengelen
104
+ - [core] Simplify bug reproduction (#11849) @oliviertassinari
105
+ - [core] Fix npm reference @oliviertassinari
106
+ - [core] Normalize issue template @oliviertassinari
107
+
6
108
  ## 7.0.0-beta.1
7
109
 
8
110
  _Feb 1, 2024_
@@ -2036,6 +2138,62 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
2036
2138
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
2037
2139
  - [license] Correctly throw errors (#10924) @oliviertassinari
2038
2140
 
2141
+ ## v6.19.4
2142
+
2143
+ _Feb 9, 2024_
2144
+
2145
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
2146
+
2147
+ - 🌍 Improve Danish (da-DK) locale on the Data Grid (#11972) @ShahrazH
2148
+ - 🐞 Bugfixes
2149
+ - 📚 Documentation improvements
2150
+
2151
+ ### Data Grid
2152
+
2153
+ #### `@mui/x-data-grid@v6.19.4`
2154
+
2155
+ - [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
2156
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
2157
+ - [DataGrid] Fix row reorder with cell selection (#11878) @PEsteves8
2158
+ - [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
2159
+ - [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
2160
+
2161
+ #### `@mui/x-data-grid-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2162
+
2163
+ Same changes as in `@mui/x-data-grid@v6.19.4`.
2164
+
2165
+ #### `@mui/x-data-grid-premium@v6.19.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
2166
+
2167
+ Same changes as in `@mui/x-data-grid-pro@v6.19.4`, plus:
2168
+
2169
+ - [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
2170
+ - [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
2171
+
2172
+ ### Date Pickers
2173
+
2174
+ #### `@mui/x-date-pickers@v6.19.4`
2175
+
2176
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
2177
+
2178
+ #### `@mui/x-date-pickers-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2179
+
2180
+ Same changes as in `@mui/x-date-pickers@v6.19.4`.
2181
+
2182
+ ### Charts / `@mui/x-charts@v6.19.4`
2183
+
2184
+ - [charts] Add `reverse` property to axes (#11959) @alexfauquette
2185
+ - [charts] Allow series ids to be numbers (#11960) @alexfauquette
2186
+ - [charts] Fix Proptypes error by supporting string values for axes (#11953) @alexfauquette
2187
+
2188
+ ### Docs
2189
+
2190
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11987) @flaviendelangle
2191
+ - [docs] Avoid the use of MUI Core @oliviertassinari
2192
+ - [docs] Fix API links (#11930) @alexfauquette
2193
+ - [docs] Fix `ChartsTooltip` typo (#11967) @thisisharsh7
2194
+ - [docs] Refactor `Localization` documentation sections (#11997) @LukasTy
2195
+ - [code] Simplify bug reproduction (#11932) @alexfauquette
2196
+
2039
2197
  ## 6.19.3
2040
2198
 
2041
2199
  _Feb 1, 2024_
@@ -7123,7 +7281,7 @@ You can find more information about the new api, including how to set those tran
7123
7281
  - [core] Add link to the security page on the `README` (#6073) @oliviertassinari
7124
7282
  - [core] Fix scroll restoration in the docs (#5938) @oliviertassinari
7125
7283
  - [core] Remove the Storybook (#6099) @flaviendelangle
7126
- - [core] Tag release as `next` in NPM (#6256) @m4theushw
7284
+ - [core] Tag release as `next` in npm (#6256) @m4theushw
7127
7285
  - [core] Update monorepo (#6180) @flaviendelangle
7128
7286
  - [core] Use the `next` branch for Prettier (#6097) @flaviendelangle
7129
7287
  - [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DateCalendarProps } from './DateCalendar.types';
3
- type DateCalendarComponent = (<TDate>(props: DateCalendarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ import { PickerValidDate } from '../models';
4
+ type DateCalendarComponent = (<TDate extends PickerValidDate>(props: DateCalendarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
5
  propTypes?: any;
5
6
  };
6
7
  /**
@@ -369,7 +369,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
369
369
  * The default selected value.
370
370
  * Used when the component is not controlled.
371
371
  */
372
- defaultValue: PropTypes.any,
372
+ defaultValue: PropTypes.object,
373
373
  /**
374
374
  * If `true`, the picker and text field are disabled.
375
375
  * @default false
@@ -413,11 +413,11 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
413
413
  /**
414
414
  * Maximal selectable date.
415
415
  */
416
- maxDate: PropTypes.any,
416
+ maxDate: PropTypes.object,
417
417
  /**
418
418
  * Minimal selectable date.
419
419
  */
420
- minDate: PropTypes.any,
420
+ minDate: PropTypes.object,
421
421
  /**
422
422
  * Months rendered per row.
423
423
  * @default 3
@@ -477,7 +477,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
477
477
  * The date used to generate the new value when both `value` and `defaultValue` are empty.
478
478
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.
479
479
  */
480
- referenceDate: PropTypes.any,
480
+ referenceDate: PropTypes.object,
481
481
  /**
482
482
  * Component displaying when passed `loading` true.
483
483
  * @returns {React.ReactNode} The node to render when loading.
@@ -545,7 +545,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
545
545
  * The selected value.
546
546
  * Used when the component is controlled.
547
547
  */
548
- value: PropTypes.any,
548
+ value: PropTypes.object,
549
549
  /**
550
550
  * The visible view.
551
551
  * Used when the component view is controlled.
@@ -7,11 +7,11 @@ import { DayCalendarSlots, DayCalendarSlotProps, ExportedDayCalendarProps } from
7
7
  import { DateCalendarClasses } from './dateCalendarClasses';
8
8
  import { BaseDateValidationProps, YearValidationProps, MonthValidationProps, DayValidationProps } from '../internals/models/validation';
9
9
  import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
10
- import { DateView, TimezoneProps } from '../models';
10
+ import { DateView, PickerValidDate, TimezoneProps } from '../models';
11
11
  import { DefaultizedProps } from '../internals/models/helpers';
12
12
  import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
13
13
  import { ExportedMonthCalendarProps } from '../MonthCalendar/MonthCalendar.types';
14
- export interface DateCalendarSlots<TDate> extends PickersCalendarHeaderSlots, DayCalendarSlots<TDate> {
14
+ export interface DateCalendarSlots<TDate extends PickerValidDate> extends PickersCalendarHeaderSlots, DayCalendarSlots<TDate> {
15
15
  /**
16
16
  * Custom component for calendar header.
17
17
  * Check the [PickersCalendarHeader](https://mui.com/x/api/date-pickers/pickers-calendar-header/) component.
@@ -19,10 +19,10 @@ export interface DateCalendarSlots<TDate> extends PickersCalendarHeaderSlots, Da
19
19
  */
20
20
  calendarHeader?: React.ElementType<PickersCalendarHeaderProps<TDate>>;
21
21
  }
22
- export interface DateCalendarSlotProps<TDate> extends PickersCalendarHeaderSlotProps<TDate>, DayCalendarSlotProps<TDate> {
22
+ export interface DateCalendarSlotProps<TDate extends PickerValidDate> extends PickersCalendarHeaderSlotProps<TDate>, DayCalendarSlotProps<TDate> {
23
23
  calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, DateCalendarProps<TDate>>;
24
24
  }
25
- export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
25
+ export interface ExportedDateCalendarProps<TDate extends PickerValidDate> extends ExportedDayCalendarProps<TDate>, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
26
26
  /**
27
27
  * If `true`, the picker and text field are disabled.
28
28
  * @default false
@@ -57,7 +57,7 @@ export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarPro
57
57
  */
58
58
  onMonthChange?: (month: TDate) => void;
59
59
  }
60
- export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDate>, ExportedUseViewsOptions<DateView> {
60
+ export interface DateCalendarProps<TDate extends PickerValidDate> extends ExportedDateCalendarProps<TDate>, ExportedUseViewsOptions<DateView> {
61
61
  /**
62
62
  * The selected value.
63
63
  * Used when the component is controlled.
@@ -90,4 +90,4 @@ export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDat
90
90
  */
91
91
  slotProps?: DateCalendarSlotProps<TDate>;
92
92
  }
93
- export type DateCalendarDefaultizedProps<TDate> = DefaultizedProps<DateCalendarProps<TDate>, 'views' | 'openTo' | 'loading' | 'reduceAnimations' | 'renderLoading' | keyof BaseDateValidationProps<TDate>>;
93
+ export type DateCalendarDefaultizedProps<TDate extends PickerValidDate> = DefaultizedProps<DateCalendarProps<TDate>, 'views' | 'openTo' | 'loading' | 'reduceAnimations' | 'renderLoading' | keyof BaseDateValidationProps<TDate>>;
@@ -5,9 +5,9 @@ import { PickerOnChangeFn } from '../internals/hooks/useViews';
5
5
  import { SlideDirection, SlideTransitionProps } from './PickersSlideTransition';
6
6
  import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
7
7
  import { DayCalendarClasses } from './dayCalendarClasses';
8
- import { TimezoneProps } from '../models';
8
+ import { PickerValidDate, TimezoneProps } from '../models';
9
9
  import { DefaultizedProps } from '../internals/models/helpers';
10
- export interface DayCalendarSlots<TDate> {
10
+ export interface DayCalendarSlots<TDate extends PickerValidDate> {
11
11
  /**
12
12
  * Custom component for day.
13
13
  * Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
@@ -15,13 +15,13 @@ export interface DayCalendarSlots<TDate> {
15
15
  */
16
16
  day?: React.ElementType<PickersDayProps<TDate>>;
17
17
  }
18
- export interface DayCalendarSlotProps<TDate> {
18
+ export interface DayCalendarSlotProps<TDate extends PickerValidDate> {
19
19
  day?: SlotComponentProps<typeof PickersDay, {}, DayCalendarProps<TDate> & {
20
20
  day: TDate;
21
21
  selected: boolean;
22
22
  }>;
23
23
  }
24
- export interface ExportedDayCalendarProps<TDate> extends ExportedPickersDayProps {
24
+ export interface ExportedDayCalendarProps<TDate extends PickerValidDate> extends ExportedPickersDayProps {
25
25
  /**
26
26
  * If `true`, calls `renderLoading` instead of rendering the day calendar.
27
27
  * Can be used to preload information and show it in calendar.
@@ -52,7 +52,7 @@ export interface ExportedDayCalendarProps<TDate> extends ExportedPickersDayProps
52
52
  */
53
53
  fixedWeekNumber?: number;
54
54
  }
55
- export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
55
+ export interface DayCalendarProps<TDate extends PickerValidDate> extends ExportedDayCalendarProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
56
56
  autoFocus?: boolean;
57
57
  className?: string;
58
58
  currentMonth: TDate;
@@ -85,4 +85,4 @@ export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>
85
85
  /**
86
86
  * @ignore - do not document.
87
87
  */
88
- export declare function DayCalendar<TDate>(inProps: DayCalendarProps<TDate>): React.JSX.Element;
88
+ export declare function DayCalendar<TDate extends PickerValidDate>(inProps: DayCalendarProps<TDate>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { SlideDirection } from './PickersSlideTransition';
2
- import { MuiPickersAdapter, PickersTimezone } from '../models';
2
+ import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../models';
3
3
  import { DateCalendarDefaultizedProps } from './DateCalendar.types';
4
- interface CalendarState<TDate> {
4
+ interface CalendarState<TDate extends PickerValidDate> {
5
5
  currentMonth: TDate;
6
6
  focusedDay: TDate | null;
7
7
  isMonthSwitchingAnimating: boolean;
@@ -10,11 +10,11 @@ interface CalendarState<TDate> {
10
10
  type ReducerAction<TType, TAdditional = {}> = {
11
11
  type: TType;
12
12
  } & TAdditional;
13
- interface ChangeMonthPayload<TDate> {
13
+ interface ChangeMonthPayload<TDate extends PickerValidDate> {
14
14
  direction: SlideDirection;
15
15
  newMonth: TDate;
16
16
  }
17
- interface ChangeFocusedDayPayload<TDate> {
17
+ interface ChangeFocusedDayPayload<TDate extends PickerValidDate> {
18
18
  focusedDay: TDate | null;
19
19
  /**
20
20
  * The update does not trigger month switching animation.
@@ -22,14 +22,14 @@ interface ChangeFocusedDayPayload<TDate> {
22
22
  */
23
23
  withoutMonthSwitchingAnimation?: boolean;
24
24
  }
25
- export declare const createCalendarStateReducer: <TDate extends unknown>(reduceAnimations: boolean, disableSwitchToMonthOnDayFocus: boolean, utils: MuiPickersAdapter<TDate, any>) => (state: CalendarState<TDate>, action: {
25
+ export declare const createCalendarStateReducer: <TDate extends PickerValidDate>(reduceAnimations: boolean, disableSwitchToMonthOnDayFocus: boolean, utils: MuiPickersAdapter<TDate, any>) => (state: CalendarState<TDate>, action: {
26
26
  type: "finishMonthSwitchingAnimation";
27
27
  } | ReducerAction<"changeMonth", ChangeMonthPayload<TDate>> | ReducerAction<"changeFocusedDay", ChangeFocusedDayPayload<TDate>>) => CalendarState<TDate>;
28
- interface UseCalendarStateParams<TDate> extends Pick<DateCalendarDefaultizedProps<TDate>, 'value' | 'referenceDate' | 'disableFuture' | 'disablePast' | 'minDate' | 'maxDate' | 'onMonthChange' | 'reduceAnimations' | 'shouldDisableDate'> {
28
+ interface UseCalendarStateParams<TDate extends PickerValidDate> extends Pick<DateCalendarDefaultizedProps<TDate>, 'value' | 'referenceDate' | 'disableFuture' | 'disablePast' | 'minDate' | 'maxDate' | 'onMonthChange' | 'reduceAnimations' | 'shouldDisableDate'> {
29
29
  disableSwitchToMonthOnDayFocus?: boolean;
30
30
  timezone: PickersTimezone;
31
31
  }
32
- export declare const useCalendarState: <TDate extends unknown>(params: UseCalendarStateParams<TDate>) => {
32
+ export declare const useCalendarState: <TDate extends PickerValidDate>(params: UseCalendarStateParams<TDate>) => {
33
33
  referenceDate: any;
34
34
  calendarState: CalendarState<TDate>;
35
35
  changeMonth: (newDate: TDate) => void;
@@ -1,2 +1,3 @@
1
1
  import { DateComponentValidationProps } from '../internals/utils/validation/validateDate';
2
- export declare const useIsDateDisabled: <TDate>({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: DateComponentValidationProps<TDate>) => (day: TDate | null) => boolean;
2
+ import { PickerValidDate } from '../models';
3
+ export declare const useIsDateDisabled: <TDate extends PickerValidDate>({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: DateComponentValidationProps<TDate>) => (day: TDate | null) => boolean;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DateFieldProps } from './DateField.types';
3
- type DateFieldComponent = (<TDate>(props: DateFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ import { PickerValidDate } from '../models';
4
+ type DateFieldComponent = (<TDate extends PickerValidDate>(props: DateFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
5
  propTypes?: any;
5
6
  };
6
7
  /**
@@ -84,7 +84,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
84
84
  /**
85
85
  * The default value. Use when the component is not controlled.
86
86
  */
87
- defaultValue: PropTypes.any,
87
+ defaultValue: PropTypes.object,
88
88
  /**
89
89
  * If `true`, the component is disabled.
90
90
  * @default false
@@ -171,11 +171,11 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
171
171
  /**
172
172
  * Maximal selectable date.
173
173
  */
174
- maxDate: PropTypes.any,
174
+ maxDate: PropTypes.object,
175
175
  /**
176
176
  * Minimal selectable date.
177
177
  */
178
- minDate: PropTypes.any,
178
+ minDate: PropTypes.object,
179
179
  /**
180
180
  * Name attribute of the `input` element.
181
181
  */
@@ -218,7 +218,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
218
218
  * For example, on time fields it will be used to determine the date to set.
219
219
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
220
220
  */
221
- referenceDate: PropTypes.any,
221
+ referenceDate: PropTypes.object,
222
222
  /**
223
223
  * If `true`, the label is displayed as required and the `input` element is required.
224
224
  * @default false
@@ -311,7 +311,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
311
311
  * The selected value.
312
312
  * Used when the component is controlled.
313
313
  */
314
- value: PropTypes.any,
314
+ value: PropTypes.object,
315
315
  /**
316
316
  * The variant to use.
317
317
  * @default 'outlined'
@@ -2,16 +2,16 @@ import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import { UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
5
- import { DateValidationError, FieldSection } from '../models';
5
+ import { DateValidationError, FieldSection, PickerValidDate } from '../models';
6
6
  import { UseFieldInternalProps } from '../internals/hooks/useField';
7
7
  import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
8
8
  import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
9
9
  import { FieldsTextFieldProps } from '../internals/models/fields';
10
- export interface UseDateFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate> {
10
+ export interface UseDateFieldProps<TDate extends PickerValidDate> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate> {
11
11
  }
12
- export type UseDateFieldDefaultizedProps<TDate> = DefaultizedProps<UseDateFieldProps<TDate>, keyof BaseDateValidationProps<any> | 'format'>;
13
- export type UseDateFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate>> & UseDateFieldProps<TDate>;
14
- export interface DateFieldProps<TDate> extends UseDateFieldComponentProps<TDate, FieldsTextFieldProps> {
12
+ export type UseDateFieldDefaultizedProps<TDate extends PickerValidDate> = DefaultizedProps<UseDateFieldProps<TDate>, keyof BaseDateValidationProps<any> | 'format'>;
13
+ export type UseDateFieldComponentProps<TDate extends PickerValidDate, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate>> & UseDateFieldProps<TDate>;
14
+ export interface DateFieldProps<TDate extends PickerValidDate> extends UseDateFieldComponentProps<TDate, FieldsTextFieldProps> {
15
15
  /**
16
16
  * Overridable component slots.
17
17
  * @default {}
@@ -23,7 +23,7 @@ export interface DateFieldProps<TDate> extends UseDateFieldComponentProps<TDate,
23
23
  */
24
24
  slotProps?: DateFieldSlotProps<TDate>;
25
25
  }
26
- export type DateFieldOwnerState<TDate> = DateFieldProps<TDate>;
26
+ export type DateFieldOwnerState<TDate extends PickerValidDate> = DateFieldProps<TDate>;
27
27
  export interface DateFieldSlots extends UseClearableFieldSlots {
28
28
  /**
29
29
  * Form control with an input to render the value.
@@ -32,6 +32,6 @@ export interface DateFieldSlots extends UseClearableFieldSlots {
32
32
  */
33
33
  textField?: React.ElementType;
34
34
  }
35
- export interface DateFieldSlotProps<TDate> extends UseClearableFieldSlotProps {
35
+ export interface DateFieldSlotProps<TDate extends PickerValidDate> extends UseClearableFieldSlotProps {
36
36
  textField?: SlotComponentProps<typeof TextField, {}, DateFieldOwnerState<TDate>>;
37
37
  }
@@ -1,2 +1,3 @@
1
1
  import { UseDateFieldProps, UseDateFieldComponentProps } from './DateField.types';
2
- export declare const useDateField: <TDate, TChildProps extends {}>(inProps: UseDateFieldComponentProps<TDate, TChildProps>) => import("../internals/hooks/useField").UseFieldResponse<Omit<TChildProps & Omit<UseDateFieldProps<TDate>, "format" | keyof import("../internals").BaseDateValidationProps<any>> & Required<Pick<UseDateFieldProps<TDate>, "format" | keyof import("../internals").BaseDateValidationProps<any>>>, keyof UseDateFieldProps<TDate>>>;
2
+ import { PickerValidDate } from '../models';
3
+ export declare const useDateField: <TDate extends PickerValidDate, TChildProps extends {}>(inProps: UseDateFieldComponentProps<TDate, TChildProps>) => import("../internals/hooks/useField").UseFieldResponse<Omit<TChildProps & Omit<UseDateFieldProps<TDate>, "format" | keyof import("../internals").BaseDateValidationProps<any>> & Required<Pick<UseDateFieldProps<TDate>, "format" | keyof import("../internals").BaseDateValidationProps<any>>>, keyof UseDateFieldProps<TDate>>>;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DatePickerProps } from './DatePicker.types';
3
- type DatePickerComponent = (<TDate>(props: DatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ import { PickerValidDate } from '../models';
4
+ type DatePickerComponent = (<TDate extends PickerValidDate>(props: DatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
5
  propTypes?: any;
5
6
  };
6
7
  /**