@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
@@ -1,16 +1,16 @@
1
1
  import { UsePickerValueParams, UsePickerValueProps, UsePickerValueBaseProps, UsePickerValueResponse } from './usePickerValue.types';
2
2
  import { UsePickerViewsProps, UsePickerViewParams, UsePickerViewsResponse, UsePickerViewsBaseProps } from './usePickerViews';
3
3
  import { UsePickerLayoutProps, UsePickerLayoutPropsResponse } from './usePickerLayoutProps';
4
- import { FieldSection } from '../../../models';
4
+ import { FieldSection, PickerValidDate } from '../../../models';
5
5
  import { DateOrTimeViewWithMeridiem } from '../../models';
6
6
  /**
7
7
  * Props common to all picker headless implementations.
8
8
  */
9
- export interface UsePickerBaseProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
9
+ export interface UsePickerBaseProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
10
10
  }
11
- export interface UsePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TSection, TError>, UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
11
+ export interface UsePickerProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TSection, TError>, UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
12
12
  }
13
- export interface UsePickerParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView' | 'rendererInterceptor'> {
13
+ export interface UsePickerParams<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView' | 'rendererInterceptor'> {
14
14
  props: TExternalProps;
15
15
  }
16
16
  export interface UsePickerResponse<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError> extends Omit<UsePickerValueResponse<TValue, TSection, TError>, 'viewProps' | 'layoutProps'>, Omit<UsePickerViewsResponse<TView>, 'layoutProps'>, UsePickerLayoutPropsResponse<TValue, TView> {
@@ -1,7 +1,7 @@
1
1
  import { InferError } from '../useValidation';
2
- import { FieldSection } from '../../../models';
2
+ import { FieldSection, PickerValidDate } from '../../../models';
3
3
  import { UsePickerValueProps, UsePickerValueParams, UsePickerValueResponse } from './usePickerValue.types';
4
4
  /**
5
5
  * Manage the value lifecycle of all the pickers.
6
6
  */
7
- export declare const usePickerValue: <TValue, TDate, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, TSection, any>>({ props, valueManager, valueType, wrapperVariant, validator, }: UsePickerValueParams<TValue, TDate, TSection, TExternalProps>) => UsePickerValueResponse<TValue, TSection, InferError<TExternalProps>>;
7
+ export declare const usePickerValue: <TValue, TDate extends PickerValidDate, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, TSection, any>>({ props, valueManager, valueType, wrapperVariant, validator, }: UsePickerValueParams<TValue, TDate, TSection, TExternalProps>) => UsePickerValueResponse<TValue, TSection, InferError<TExternalProps>>;
@@ -2,10 +2,10 @@ import { FieldChangeHandlerContext, UseFieldInternalProps } from '../useField';
2
2
  import { InferError, Validator } from '../useValidation';
3
3
  import { UseFieldValidationProps } from '../useField/useField.types';
4
4
  import { WrapperVariant } from '../../models/common';
5
- import { FieldSection, FieldSelectedSections, FieldValueType, TimezoneProps, MuiPickersAdapter, PickersTimezone, PickerChangeHandlerContext } from '../../../models';
5
+ import { FieldSection, FieldSelectedSections, FieldValueType, TimezoneProps, MuiPickersAdapter, PickersTimezone, PickerChangeHandlerContext, PickerValidDate } from '../../../models';
6
6
  import { GetDefaultReferenceDateProps } from '../../utils/getDefaultReferenceDate';
7
7
  import { PickerShortcutChangeImportance, PickersShortcutsItemContext } from '../../../PickersShortcuts';
8
- export interface PickerValueManager<TValue, TDate, TError> {
8
+ export interface PickerValueManager<TValue, TDate extends PickerValidDate, TError> {
9
9
  /**
10
10
  * Determines if two values are equal.
11
11
  * @template TDate, TValue
@@ -209,7 +209,7 @@ export interface UsePickerValueBaseProps<TValue, TError> {
209
209
  /**
210
210
  * Props used to handle the value of non-static pickers.
211
211
  */
212
- export interface UsePickerValueNonStaticProps<TValue, TSection extends FieldSection> extends Pick<UseFieldInternalProps<TValue, unknown, TSection, unknown>, 'selectedSections' | 'onSelectedSectionsChange'> {
212
+ export interface UsePickerValueNonStaticProps<TValue, TSection extends FieldSection> extends Pick<UseFieldInternalProps<TValue, PickerValidDate, TSection, unknown>, 'selectedSections' | 'onSelectedSectionsChange'> {
213
213
  /**
214
214
  * If `true`, the popover or modal will close after submitting the full date.
215
215
  * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
@@ -236,7 +236,7 @@ export interface UsePickerValueNonStaticProps<TValue, TSection extends FieldSect
236
236
  */
237
237
  export interface UsePickerValueProps<TValue, TSection extends FieldSection, TError> extends UsePickerValueBaseProps<TValue, TError>, UsePickerValueNonStaticProps<TValue, TSection>, TimezoneProps {
238
238
  }
239
- export interface UsePickerValueParams<TValue, TDate, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, TSection, any>> {
239
+ export interface UsePickerValueParams<TValue, TDate extends PickerValidDate, TSection extends FieldSection, TExternalProps extends UsePickerValueProps<TValue, TSection, any>> {
240
240
  props: TExternalProps;
241
241
  valueManager: PickerValueManager<TValue, TDate, InferError<TExternalProps>>;
242
242
  valueType: FieldValueType;
@@ -252,7 +252,7 @@ export interface UsePickerValueActions {
252
252
  onOpen: () => void;
253
253
  onClose: () => void;
254
254
  }
255
- export type UsePickerValueFieldResponse<TValue, TSection extends FieldSection, TError> = Required<Pick<UseFieldInternalProps<TValue, unknown, TSection, TError>, 'value' | 'onChange' | 'selectedSections' | 'onSelectedSectionsChange'>>;
255
+ export type UsePickerValueFieldResponse<TValue, TSection extends FieldSection, TError> = Required<Pick<UseFieldInternalProps<TValue, PickerValidDate, TSection, TError>, 'value' | 'onChange' | 'selectedSections' | 'onSelectedSectionsChange'>>;
256
256
  /**
257
257
  * Props passed to `usePickerViews`.
258
258
  */
@@ -4,7 +4,7 @@ import { Theme } from '@mui/material/styles';
4
4
  import { UseViewsOptions } from '../useViews';
5
5
  import type { UsePickerValueViewsResponse } from './usePickerValue.types';
6
6
  import { DateOrTimeViewWithMeridiem } from '../../models';
7
- import { TimezoneProps } from '../../../models';
7
+ import { PickerValidDate, TimezoneProps } from '../../../models';
8
8
  interface PickerViewsRendererBaseExternalProps<TView extends DateOrTimeViewWithMeridiem> extends Omit<UsePickerViewsProps<any, any, TView, any, any>, 'openTo' | 'viewRenderers'> {
9
9
  }
10
10
  export type PickerViewsRendererProps<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends PickerViewsRendererBaseExternalProps<TView>, TAdditionalProps extends {}> = TExternalProps & TAdditionalProps & UsePickerValueViewsResponse<TValue> & {
@@ -20,7 +20,7 @@ export type PickerViewRendererLookup<TValue, TView extends DateOrTimeViewWithMer
20
20
  /**
21
21
  * Props used to handle the views that are common to all pickers.
22
22
  */
23
- export interface UsePickerViewsBaseProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends Omit<UseViewsOptions<any, TView>, 'onChange' | 'onFocusedViewChange' | 'focusedView'>, TimezoneProps {
23
+ export interface UsePickerViewsBaseProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends Omit<UseViewsOptions<any, TView>, 'onChange' | 'onFocusedViewChange' | 'focusedView'>, TimezoneProps {
24
24
  /**
25
25
  * If `true`, the picker and text field are disabled.
26
26
  * @default false
@@ -55,11 +55,11 @@ export interface UsePickerViewsNonStaticProps {
55
55
  /**
56
56
  * Props used to handle the value of the pickers.
57
57
  */
58
- export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
58
+ export interface UsePickerViewsProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
59
59
  className?: string;
60
60
  sx?: SxProps<Theme>;
61
61
  }
62
- export interface UsePickerViewParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, TAdditionalProps extends {}> {
62
+ export interface UsePickerViewParams<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, TAdditionalProps extends {}> {
63
63
  props: TExternalProps;
64
64
  propsFromPickerValue: UsePickerValueViewsResponse<TValue>;
65
65
  additionalViewProps: TAdditionalProps;
@@ -96,5 +96,5 @@ export interface UsePickerViewsLayoutResponse<TView extends DateOrTimeViewWithMe
96
96
  * - Handles the switch between UI views and field views
97
97
  * - Handles the focus management when switching views
98
98
  */
99
- export declare const usePickerViews: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, rendererInterceptor, }: UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
99
+ export declare const usePickerViews: <TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, rendererInterceptor, }: UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
100
100
  export {};
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { UseStaticPickerParams, UseStaticPickerProps } from './useStaticPicker.types';
3
+ import { PickerValidDate } from '../../../models';
3
4
  import { DateOrTimeViewWithMeridiem } from '../../models';
4
5
  /**
5
6
  * Hook managing all the single-date static pickers:
@@ -7,6 +8,6 @@ import { DateOrTimeViewWithMeridiem } from '../../models';
7
8
  * - StaticDateTimePicker
8
9
  * - StaticTimePicker
9
10
  */
10
- export declare const useStaticPicker: <TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TDate, TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticPickerParams<TDate, TView, TExternalProps>) => {
11
+ export declare const useStaticPicker: <TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TDate, TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticPickerParams<TDate, TView, TExternalProps>) => {
11
12
  renderPicker: () => React.JSX.Element;
12
13
  };
@@ -3,11 +3,11 @@ import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '../.
3
3
  import { BasePickerProps } from '../../models/props/basePickerProps';
4
4
  import { UsePickerParams } from '../usePicker';
5
5
  import { UsePickerViewsProps } from '../usePicker/usePickerViews';
6
- import { FieldSection } from '../../../models';
6
+ import { FieldSection, PickerValidDate } from '../../../models';
7
7
  import { DateOrTimeViewWithMeridiem } from '../../models';
8
- export interface UseStaticPickerSlots<TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<TDate | null, TDate, TView> {
8
+ export interface UseStaticPickerSlots<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<TDate | null, TDate, TView> {
9
9
  }
10
- export interface UseStaticPickerSlotProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<TDate | null, TDate, TView> {
10
+ export interface UseStaticPickerSlotProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<TDate | null, TDate, TView> {
11
11
  }
12
12
  export interface StaticOnlyPickerProps {
13
13
  /**
@@ -26,19 +26,19 @@ export interface StaticOnlyPickerProps {
26
26
  */
27
27
  onClose?: () => void;
28
28
  }
29
- export interface UseStaticPickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TDate | null, TDate, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, StaticOnlyPickerProps {
29
+ export interface UseStaticPickerProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TDate | null, TDate, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, StaticOnlyPickerProps {
30
30
  /**
31
31
  * Overridable component slots.
32
32
  * @default {}
33
33
  */
34
- slots?: UseStaticPickerSlots<TDate | null, TView>;
34
+ slots?: UseStaticPickerSlots<TDate, TView>;
35
35
  /**
36
36
  * The props used for each component slot.
37
37
  * @default {}
38
38
  */
39
39
  slotProps?: UseStaticPickerSlotProps<TDate, TView>;
40
40
  }
41
- export interface UseStaticPickerParams<TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<TDate | null, TDate, TView, FieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
41
+ export interface UseStaticPickerParams<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<TDate | null, TDate, TView, FieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
42
42
  props: TExternalProps;
43
43
  /**
44
44
  * Ref to pass to the root element
@@ -1,13 +1,13 @@
1
1
  import { MuiPickersAdapterContextValue } from '../../LocalizationProvider/LocalizationProvider';
2
2
  import { PickersLocaleText } from '../../locales/utils/pickersLocaleTextApi';
3
- import { PickersTimezone } from '../../models';
4
- export declare const useLocalizationContext: <TDate>() => Omit<MuiPickersAdapterContextValue<TDate>, "localeText"> & {
3
+ import { PickersTimezone, PickerValidDate } from '../../models';
4
+ export declare const useLocalizationContext: <TDate extends PickerValidDate>() => Omit<MuiPickersAdapterContextValue<TDate>, "localeText"> & {
5
5
  localeText: PickersLocaleText<TDate>;
6
6
  };
7
- export declare const useUtils: <TDate>() => import("../../models").MuiPickersAdapter<TDate, any>;
8
- export declare const useDefaultDates: <TDate>() => {
7
+ export declare const useUtils: <TDate extends PickerValidDate>() => import("@mui/x-date-pickers/models").MuiPickersAdapter<TDate, any>;
8
+ export declare const useDefaultDates: <TDate extends PickerValidDate>() => {
9
9
  minDate: TDate;
10
10
  maxDate: TDate;
11
11
  };
12
- export declare const useLocaleText: <TDate>() => PickersLocaleText<TDate>;
13
- export declare const useNow: <TDate>(timezone: PickersTimezone) => TDate;
12
+ export declare const useLocaleText: <TDate extends PickerValidDate>() => PickersLocaleText<TDate>;
13
+ export declare const useNow: <TDate extends PickerValidDate>(timezone: PickersTimezone) => TDate;
@@ -1,4 +1,5 @@
1
1
  import { MuiPickersAdapterContextValue } from '../../LocalizationProvider/LocalizationProvider';
2
+ import { PickerValidDate } from '../../models';
2
3
  interface ValidationCommonProps<TError, TValue> {
3
4
  /**
4
5
  * Callback that fired when input value or new `value` prop validation returns **new** validation error (or value is valid after error).
@@ -14,10 +15,10 @@ interface ValidationCommonProps<TError, TValue> {
14
15
  }
15
16
  export type ValidationProps<TError, TValue, TValidationProps extends {}> = ValidationCommonProps<TError, TValue> & TValidationProps;
16
17
  export type InferError<TProps> = TProps extends Pick<ValidationCommonProps<any, any>, 'onError'> ? Parameters<Exclude<TProps['onError'], undefined>>[0] : never;
17
- export type Validator<TValue, TDate, TError, TValidationProps> = (params: {
18
+ export type Validator<TValue, TDate extends PickerValidDate, TError, TValidationProps> = (params: {
18
19
  adapter: MuiPickersAdapterContextValue<TDate>;
19
20
  value: TValue;
20
21
  props: Omit<TValidationProps, 'value' | 'onError'>;
21
22
  }) => TError;
22
- export declare function useValidation<TValue, TDate, TError, TValidationProps extends {}>(props: ValidationProps<TError, TValue, TValidationProps>, validate: Validator<TValue, TDate, TError, TValidationProps>, isSameError: (a: TError, b: TError | null) => boolean, defaultErrorState: TError): TError;
23
+ export declare function useValidation<TValue, TDate extends PickerValidDate, TError, TValidationProps extends {}>(props: ValidationProps<TError, TValue, TValidationProps>, validate: Validator<TValue, TDate, TError, TValidationProps>, isSameError: (a: TError, b: TError | null) => boolean, defaultErrorState: TError): TError;
23
24
  export {};
@@ -1,11 +1,11 @@
1
1
  import type { PickerValueManager } from './usePicker';
2
- import { PickersTimezone } from '../../models';
2
+ import { PickersTimezone, PickerValidDate } from '../../models';
3
3
  /**
4
4
  * Hooks making sure that:
5
5
  * - The value returned by `onChange` always have the timezone of `props.value` or `props.defaultValue` if defined
6
6
  * - The value rendered is always the one from `props.timezone` if defined
7
7
  */
8
- export declare const useValueWithTimezone: <TDate, TValue, TChange extends (...params: any[]) => void>({ timezone: timezoneProp, value: valueProp, defaultValue, onChange, valueManager, }: {
8
+ export declare const useValueWithTimezone: <TDate extends PickerValidDate, TValue, TChange extends (...params: any[]) => void>({ timezone: timezoneProp, value: valueProp, defaultValue, onChange, valueManager, }: {
9
9
  timezone: PickersTimezone | undefined;
10
10
  value: TValue | undefined;
11
11
  defaultValue: TValue | undefined;
@@ -19,7 +19,7 @@ export declare const useValueWithTimezone: <TDate, TValue, TChange extends (...p
19
19
  /**
20
20
  * Wrapper around `useControlled` and `useValueWithTimezone`
21
21
  */
22
- export declare const useControlledValueWithTimezone: <TDate, TValue, TChange extends (...params: any[]) => void>({ name, timezone: timezoneProp, value: valueProp, defaultValue, onChange: onChangeProp, valueManager, }: {
22
+ export declare const useControlledValueWithTimezone: <TDate extends PickerValidDate, TValue, TChange extends (...params: any[]) => void>({ name, timezone: timezoneProp, value: valueProp, defaultValue, onChange: onChangeProp, valueManager, }: {
23
23
  name: string;
24
24
  timezone: PickersTimezone | undefined;
25
25
  value: TValue | undefined;
@@ -1,7 +1,8 @@
1
1
  import type { PickerSelectionState } from './usePicker';
2
2
  import { MakeOptional } from '../models/helpers';
3
3
  import { DateOrTimeViewWithMeridiem } from '../models';
4
- export type PickerOnChangeFn<TDate> = (date: TDate | null, selectionState?: PickerSelectionState) => void;
4
+ import { PickerValidDate } from '../../models';
5
+ export type PickerOnChangeFn<TDate extends PickerValidDate> = (date: TDate | null, selectionState?: PickerSelectionState) => void;
5
6
  export interface UseViewsOptions<TValue, TView extends DateOrTimeViewWithMeridiem> {
6
7
  /**
7
8
  * Callback fired when the value changes.
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import type { UseFieldInternalProps } from '../hooks/useField';
4
- import type { FieldSection } from '../../models';
5
- export interface BaseFieldProps<TValue, TDate, TSection extends FieldSection, TError> extends Omit<UseFieldInternalProps<TValue, TDate, TSection, TError>, 'format'> {
4
+ import { FieldSection, PickerValidDate } from '../../models';
5
+ export interface BaseFieldProps<TValue, TDate extends PickerValidDate, TSection extends FieldSection, TError> extends Omit<UseFieldInternalProps<TValue, TDate, TSection, TError>, 'format'> {
6
6
  className?: string;
7
7
  format?: string;
8
8
  disabled?: boolean;
@@ -6,10 +6,11 @@ import { PickersInputComponentLocaleText } from '../../../locales/utils/pickersL
6
6
  import type { UsePickerViewsProps } from '../../hooks/usePicker/usePickerViews';
7
7
  import { MakeOptional } from '../helpers';
8
8
  import { DateOrTimeViewWithMeridiem } from '../common';
9
+ import { PickerValidDate } from '../../../models';
9
10
  /**
10
11
  * Props common to all pickers after applying the default props on each picker.
11
12
  */
12
- export interface BasePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerBaseProps<TValue, TDate, TView, TError, TExternalProps, TAdditionalProps> {
13
+ export interface BasePickerProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerBaseProps<TValue, TDate, TView, TError, TExternalProps, TAdditionalProps> {
13
14
  className?: string;
14
15
  /**
15
16
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -24,7 +25,7 @@ export interface BasePickerProps<TValue, TDate, TView extends DateOrTimeViewWith
24
25
  /**
25
26
  * Props common to all pickers before applying the default props on each picker.
26
27
  */
27
- export interface BasePickerInputProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError> extends Omit<MakeOptional<BasePickerProps<TValue, TDate, TView, TError, any, any>, 'openTo' | 'views'>, 'viewRenderers'> {
28
+ export interface BasePickerInputProps<TValue, TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError> extends Omit<MakeOptional<BasePickerProps<TValue, TDate, TView, TError, any, any>, 'openTo' | 'views'>, 'viewRenderers'> {
28
29
  }
29
30
  /**
30
31
  * Props common to all non-static pickers.
@@ -1,18 +1,18 @@
1
1
  import { SxProps, Theme } from '@mui/material/styles';
2
2
  import { BaseTimeValidationProps, TimeValidationProps } from '../validation';
3
- import { TimeStepOptions, TimezoneProps } from '../../../models';
3
+ import { PickerValidDate, TimeStepOptions, TimezoneProps } from '../../../models';
4
4
  import type { ExportedDigitalClockProps } from '../../../DigitalClock/DigitalClock.types';
5
5
  import type { ExportedMultiSectionDigitalClockProps } from '../../../MultiSectionDigitalClock/MultiSectionDigitalClock.types';
6
6
  import type { ExportedUseViewsOptions } from '../../hooks/useViews';
7
7
  import { TimeViewWithMeridiem } from '../common';
8
- export interface ExportedBaseClockProps<TDate> extends TimeValidationProps<TDate>, BaseTimeValidationProps, TimezoneProps {
8
+ export interface ExportedBaseClockProps<TDate extends PickerValidDate> extends TimeValidationProps<TDate>, BaseTimeValidationProps, TimezoneProps {
9
9
  /**
10
10
  * 12h/24h view for hour selection clock.
11
11
  * @default `utils.is12HourCycleInCurrentLocale()`
12
12
  */
13
13
  ampm?: boolean;
14
14
  }
15
- export interface BaseClockProps<TDate, TView extends TimeViewWithMeridiem> extends ExportedUseViewsOptions<TView>, ExportedBaseClockProps<TDate> {
15
+ export interface BaseClockProps<TDate extends PickerValidDate, TView extends TimeViewWithMeridiem> extends ExportedUseViewsOptions<TView>, ExportedBaseClockProps<TDate> {
16
16
  className?: string;
17
17
  /**
18
18
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -44,7 +44,7 @@ export interface BaseClockProps<TDate, TView extends TimeViewWithMeridiem> exten
44
44
  */
45
45
  referenceDate?: TDate;
46
46
  }
47
- export interface DesktopOnlyTimePickerProps<TDate> extends Omit<ExportedDigitalClockProps<TDate>, 'timeStep'>, Omit<ExportedMultiSectionDigitalClockProps<TDate>, 'timeSteps'> {
47
+ export interface DesktopOnlyTimePickerProps<TDate extends PickerValidDate> extends Omit<ExportedDigitalClockProps<TDate>, 'timeStep'>, Omit<ExportedMultiSectionDigitalClockProps<TDate>, 'timeSteps'> {
48
48
  /**
49
49
  * Amount of time options below or at which the single column time renderer is used.
50
50
  * @default 24
@@ -1,4 +1,4 @@
1
- import { TimeView } from '../../models';
1
+ import { PickerValidDate, TimeView } from '../../models';
2
2
  interface FutureAndPastValidationProps {
3
3
  /**
4
4
  * If `true`, disable values before the current date for date components, time for time components and both for date time components.
@@ -20,7 +20,7 @@ export interface BaseTimeValidationProps extends FutureAndPastValidationProps {
20
20
  /**
21
21
  * Props used to validate a time value.
22
22
  */
23
- export interface TimeValidationProps<TDate> {
23
+ export interface TimeValidationProps<TDate extends PickerValidDate> {
24
24
  /**
25
25
  * Minimal selectable time.
26
26
  * The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
@@ -54,7 +54,7 @@ export interface TimeValidationProps<TDate> {
54
54
  * Validation props common to all the date views.
55
55
  * All these props have a default value when used inside a field / picker / calendar.
56
56
  */
57
- export interface BaseDateValidationProps<TDate> extends FutureAndPastValidationProps {
57
+ export interface BaseDateValidationProps<TDate extends PickerValidDate> extends FutureAndPastValidationProps {
58
58
  /**
59
59
  * Maximal selectable date.
60
60
  */
@@ -67,7 +67,7 @@ export interface BaseDateValidationProps<TDate> extends FutureAndPastValidationP
67
67
  /**
68
68
  * Props used to validate a date value (validates day + month + year).
69
69
  */
70
- export interface DayValidationProps<TDate> {
70
+ export interface DayValidationProps<TDate extends PickerValidDate> {
71
71
  /**
72
72
  * Disable specific date.
73
73
  *
@@ -82,7 +82,7 @@ export interface DayValidationProps<TDate> {
82
82
  /**
83
83
  * Props used to validate a month value
84
84
  */
85
- export interface MonthValidationProps<TDate> {
85
+ export interface MonthValidationProps<TDate extends PickerValidDate> {
86
86
  /**
87
87
  * Disable specific month.
88
88
  * @template TDate
@@ -94,7 +94,7 @@ export interface MonthValidationProps<TDate> {
94
94
  /**
95
95
  * Props used to validate a year value
96
96
  */
97
- export interface YearValidationProps<TDate> {
97
+ export interface YearValidationProps<TDate extends PickerValidDate> {
98
98
  /**
99
99
  * Disable specific year.
100
100
  * @template TDate
@@ -106,7 +106,7 @@ export interface YearValidationProps<TDate> {
106
106
  /**
107
107
  * Props used to validate a date time value.
108
108
  */
109
- export interface DateTimeValidationProps<TDate> {
109
+ export interface DateTimeValidationProps<TDate extends PickerValidDate> {
110
110
  /**
111
111
  * Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
112
112
  */
@@ -1,17 +1,17 @@
1
- import { DateOrTimeView, MuiPickersAdapter } from '../../models';
1
+ import { DateOrTimeView, MuiPickersAdapter, PickerValidDate } from '../../models';
2
2
  import { DateOrTimeViewWithMeridiem } from '../models';
3
3
  import { DesktopOnlyTimePickerProps } from '../models/props/clock';
4
4
  import { DefaultizedProps } from '../models/helpers';
5
- export declare const resolveDateTimeFormat: (utils: MuiPickersAdapter<any>, { views, format, ...other }: {
5
+ export declare const resolveDateTimeFormat: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, { views, format, ...other }: {
6
6
  format?: string | undefined;
7
7
  views: readonly DateOrTimeView[];
8
8
  ampm: boolean;
9
9
  }) => string;
10
- interface DefaultizedTimeViewsProps<TDate, TView = DateOrTimeView> extends DefaultizedProps<DesktopOnlyTimePickerProps<TDate>, 'ampm'> {
10
+ interface DefaultizedTimeViewsProps<TDate extends PickerValidDate, TView = DateOrTimeView> extends DefaultizedProps<DesktopOnlyTimePickerProps<TDate>, 'ampm'> {
11
11
  views: readonly TView[];
12
12
  }
13
- interface DefaultizedTimeViewsResponse<TDate, TView = DateOrTimeViewWithMeridiem> extends Required<Pick<DefaultizedTimeViewsProps<TDate, TView>, 'thresholdToRenderTimeInASingleColumn' | 'timeSteps' | 'views'>> {
13
+ interface DefaultizedTimeViewsResponse<TDate extends PickerValidDate, TView = DateOrTimeViewWithMeridiem> extends Required<Pick<DefaultizedTimeViewsProps<TDate, TView>, 'thresholdToRenderTimeInASingleColumn' | 'timeSteps' | 'views'>> {
14
14
  shouldRenderTimeInASingleColumn: boolean;
15
15
  }
16
- export declare function resolveTimeViewsResponse<TDate, InTView extends DateOrTimeView = DateOrTimeView, OutTView extends DateOrTimeViewWithMeridiem = DateOrTimeViewWithMeridiem>({ thresholdToRenderTimeInASingleColumn: inThreshold, ampm, timeSteps: inTimeSteps, views, }: DefaultizedTimeViewsProps<TDate, InTView>): DefaultizedTimeViewsResponse<TDate, OutTView>;
16
+ export declare function resolveTimeViewsResponse<TDate extends PickerValidDate, InTView extends DateOrTimeView = DateOrTimeView, OutTView extends DateOrTimeViewWithMeridiem = DateOrTimeViewWithMeridiem>({ thresholdToRenderTimeInASingleColumn: inThreshold, ampm, timeSteps: inTimeSteps, views, }: DefaultizedTimeViewsProps<TDate, InTView>): DefaultizedTimeViewsResponse<TDate, OutTView>;
17
17
  export {};
@@ -1,6 +1,6 @@
1
- import { DateView, FieldValueType, MuiPickersAdapter, PickersTimezone } from '../../models';
1
+ import { DateView, FieldValueType, MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../../models';
2
2
  import { DateOrTimeViewWithMeridiem } from '../models';
3
- interface FindClosestDateParams<TDate> {
3
+ interface FindClosestDateParams<TDate extends PickerValidDate> {
4
4
  date: TDate;
5
5
  disableFuture?: boolean;
6
6
  disablePast?: boolean;
@@ -10,18 +10,18 @@ interface FindClosestDateParams<TDate> {
10
10
  utils: MuiPickersAdapter<TDate>;
11
11
  timezone: PickersTimezone;
12
12
  }
13
- export declare const findClosestEnabledDate: <TDate>({ date, disableFuture, disablePast, maxDate, minDate, isDateDisabled, utils, timezone, }: FindClosestDateParams<TDate>) => NonNullable<TDate> | null;
14
- export declare const replaceInvalidDateByNull: <TDate>(utils: MuiPickersAdapter<TDate, any>, value: TDate | null) => NonNullable<TDate> | null;
15
- export declare const applyDefaultDate: <TDate>(utils: MuiPickersAdapter<TDate, any>, value: TDate | null | undefined, defaultValue: TDate) => TDate;
16
- export declare const areDatesEqual: <TDate>(utils: MuiPickersAdapter<TDate, any>, a: TDate, b: TDate) => boolean;
17
- export declare const getMonthsInYear: <TDate>(utils: MuiPickersAdapter<TDate, any>, year: TDate) => TDate[];
18
- export declare const mergeDateAndTime: <TDate>(utils: MuiPickersAdapter<TDate, any>, dateParam: TDate, timeParam: TDate) => TDate;
19
- export declare const getTodayDate: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, valueType?: FieldValueType) => TDate;
20
- export declare const formatMeridiem: <TDate>(utils: MuiPickersAdapter<TDate, any>, meridiem: 'am' | 'pm') => string;
13
+ export declare const findClosestEnabledDate: <TDate extends PickerValidDate>({ date, disableFuture, disablePast, maxDate, minDate, isDateDisabled, utils, timezone, }: FindClosestDateParams<TDate>) => TDate | null;
14
+ export declare const replaceInvalidDateByNull: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, value: TDate | null) => TDate | null;
15
+ export declare const applyDefaultDate: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, value: TDate | null | undefined, defaultValue: TDate) => TDate;
16
+ export declare const areDatesEqual: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, a: TDate, b: TDate) => boolean;
17
+ export declare const getMonthsInYear: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, year: TDate) => TDate[];
18
+ export declare const mergeDateAndTime: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, dateParam: TDate, timeParam: TDate) => TDate;
19
+ export declare const getTodayDate: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, valueType?: FieldValueType) => TDate;
20
+ export declare const formatMeridiem: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, meridiem: 'am' | 'pm') => string;
21
21
  export declare const isDatePickerView: (view: DateOrTimeViewWithMeridiem) => view is DateView;
22
- export declare const resolveDateFormat: (utils: MuiPickersAdapter<any>, { format, views }: {
22
+ export declare const resolveDateFormat: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, { format, views }: {
23
23
  format?: string | undefined;
24
24
  views: readonly DateView[];
25
25
  }, isInToolbar: boolean) => string;
26
- export declare const getWeekdays: <TDate>(utils: MuiPickersAdapter<TDate, any>, date: TDate) => TDate[];
26
+ export declare const getWeekdays: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, date: TDate) => TDate[];
27
27
  export {};
@@ -1,6 +1,6 @@
1
1
  import { getTodayDate } from './date-utils';
2
- import { FieldSection, MuiPickersAdapter, PickersTimezone } from '../../models';
3
- export interface GetDefaultReferenceDateProps<TDate> {
2
+ import { FieldSection, MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../../models';
3
+ export interface GetDefaultReferenceDateProps<TDate extends PickerValidDate> {
4
4
  maxDate?: TDate;
5
5
  minDate?: TDate;
6
6
  minTime?: TDate;
@@ -17,7 +17,7 @@ export declare const SECTION_TYPE_GRANULARITY: {
17
17
  milliseconds: number;
18
18
  };
19
19
  export declare const getSectionTypeGranularity: (sections: FieldSection[]) => number;
20
- export declare const getDefaultReferenceDate: <TDate>({ props, utils, granularity, timezone, getTodayDate: inGetTodayDate, }: {
20
+ export declare const getDefaultReferenceDate: <TDate extends PickerValidDate>({ props, utils, granularity, timezone, getTodayDate: inGetTodayDate, }: {
21
21
  props: GetDefaultReferenceDateProps<TDate>;
22
22
  utils: MuiPickersAdapter<TDate, any>;
23
23
  granularity: number;
@@ -1,14 +1,14 @@
1
- import { MuiPickersAdapter, TimeView } from '../../models';
1
+ import { MuiPickersAdapter, PickerValidDate, TimeView } from '../../models';
2
2
  import { DateOrTimeViewWithMeridiem, TimeViewWithMeridiem } from '../models';
3
3
  export declare const isTimeView: (view: DateOrTimeViewWithMeridiem) => boolean;
4
4
  export declare const isInternalTimeView: (view: DateOrTimeViewWithMeridiem) => view is TimeViewWithMeridiem;
5
5
  export type Meridiem = 'am' | 'pm';
6
- export declare const getMeridiem: <TDate>(date: TDate | null, utils: MuiPickersAdapter<TDate, any>) => Meridiem | null;
6
+ export declare const getMeridiem: <TDate extends PickerValidDate>(date: TDate | null, utils: MuiPickersAdapter<TDate, any>) => Meridiem | null;
7
7
  export declare const convertValueToMeridiem: (value: number, meridiem: Meridiem | null, ampm: boolean) => number;
8
- export declare const convertToMeridiem: <TDate>(time: TDate, meridiem: Meridiem, ampm: boolean, utils: MuiPickersAdapter<TDate, any>) => TDate;
9
- export declare const getSecondsInDay: <TDate>(date: TDate, utils: MuiPickersAdapter<TDate, any>) => number;
10
- export declare const createIsAfterIgnoreDatePart: <TDate>(disableIgnoringDatePartForTimeValidation: boolean, utils: MuiPickersAdapter<TDate, any>) => (dateLeft: TDate, dateRight: TDate) => boolean;
11
- export declare const resolveTimeFormat: (utils: MuiPickersAdapter<any>, { format, views, ampm }: {
8
+ export declare const convertToMeridiem: <TDate extends PickerValidDate>(time: TDate, meridiem: Meridiem, ampm: boolean, utils: MuiPickersAdapter<TDate, any>) => TDate;
9
+ export declare const getSecondsInDay: <TDate extends PickerValidDate>(date: TDate, utils: MuiPickersAdapter<TDate, any>) => number;
10
+ export declare const createIsAfterIgnoreDatePart: <TDate extends PickerValidDate>(disableIgnoringDatePartForTimeValidation: boolean, utils: MuiPickersAdapter<TDate, any>) => (dateLeft: TDate, dateRight: TDate) => boolean;
11
+ export declare const resolveTimeFormat: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate, any>, { format, views, ampm }: {
12
12
  format?: string | undefined;
13
13
  views: readonly TimeView[];
14
14
  ampm: boolean;
@@ -1,7 +1,7 @@
1
1
  import { Validator } from '../../hooks/useValidation';
2
2
  import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../../models/validation';
3
- import { DateValidationError, TimezoneProps } from '../../../models';
3
+ import { DateValidationError, PickerValidDate, TimezoneProps } from '../../../models';
4
4
  import { DefaultizedProps } from '../../models/helpers';
5
- export interface DateComponentValidationProps<TDate> extends DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
5
+ export interface DateComponentValidationProps<TDate extends PickerValidDate> extends DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
6
6
  }
7
7
  export declare const validateDate: Validator<any | null, any, DateValidationError, DateComponentValidationProps<any>>;
@@ -1,7 +1,7 @@
1
1
  import { Validator } from '../../hooks/useValidation';
2
2
  import { DateComponentValidationProps } from './validateDate';
3
3
  import { TimeComponentValidationProps } from './validateTime';
4
- import { DateTimeValidationError } from '../../../models';
5
- export interface DateTimeComponentValidationProps<TDate> extends DateComponentValidationProps<TDate>, TimeComponentValidationProps<TDate> {
4
+ import { DateTimeValidationError, PickerValidDate } from '../../../models';
5
+ export interface DateTimeComponentValidationProps<TDate extends PickerValidDate> extends DateComponentValidationProps<TDate>, TimeComponentValidationProps<TDate> {
6
6
  }
7
7
  export declare const validateDateTime: Validator<any | null, any, DateTimeValidationError, DateTimeComponentValidationProps<any>>;
@@ -1,7 +1,7 @@
1
1
  import { Validator } from '../../hooks/useValidation';
2
2
  import { BaseTimeValidationProps, TimeValidationProps } from '../../models/validation';
3
- import { TimeValidationError, TimezoneProps } from '../../../models';
3
+ import { PickerValidDate, TimeValidationError, TimezoneProps } from '../../../models';
4
4
  import { DefaultizedProps } from '../../models/helpers';
5
- export interface TimeComponentValidationProps<TDate> extends Required<BaseTimeValidationProps>, TimeValidationProps<TDate>, DefaultizedProps<TimezoneProps, 'timezone'> {
5
+ export interface TimeComponentValidationProps<TDate extends PickerValidDate> extends Required<BaseTimeValidationProps>, TimeValidationProps<TDate>, DefaultizedProps<TimezoneProps, 'timezone'> {
6
6
  }
7
7
  export declare const validateTime: Validator<any | null, any, TimeValidationError, TimeComponentValidationProps<any>>;
@@ -1,6 +1,6 @@
1
1
  import type { PickerValueManager } from '../hooks/usePicker';
2
- import { DateValidationError, TimeValidationError, DateTimeValidationError, FieldSection } from '../../models';
2
+ import { DateValidationError, TimeValidationError, DateTimeValidationError, FieldSection, PickerValidDate } from '../../models';
3
3
  import type { FieldValueManager } from '../hooks/useField';
4
- export type SingleItemPickerValueManager<TValue = any, TDate = any, TError extends DateValidationError | TimeValidationError | DateTimeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
4
+ export type SingleItemPickerValueManager<TValue = any, TDate extends PickerValidDate = any, TError extends DateValidationError | TimeValidationError | DateTimeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
5
5
  export declare const singleItemValueManager: SingleItemPickerValueManager;
6
6
  export declare const singleItemFieldValueManager: FieldValueManager<any, any, FieldSection>;
@@ -249,7 +249,6 @@ var NUMBER_SYMBOL_MAP = {
249
249
  '9': '۹',
250
250
  '0': '۰'
251
251
  };
252
-
253
252
  /**
254
253
  * Based on `@date-io/date-fns-jalali`
255
254
  *
@@ -127,7 +127,6 @@ var withLocale = function withLocale(dayjs, locale) {
127
127
  return dayjs.apply(void 0, arguments).locale(locale);
128
128
  };
129
129
  };
130
-
131
130
  /**
132
131
  * Based on `@date-io/dayjs`
133
132
  *
@@ -134,7 +134,6 @@ var defaultFormats = {
134
134
  keyboardDateTime12h: 'D hh:mm a',
135
135
  keyboardDateTime24h: 'D T'
136
136
  };
137
-
138
137
  /**
139
138
  * Based on `@date-io/luxon`
140
139
  *
@@ -339,7 +338,7 @@ export var AdapterLuxon = /*#__PURE__*/_createClass(function AdapterLuxon() {
339
338
  var _ref3 = _slicedToArray(_ref2, 2),
340
339
  start = _ref3[0],
341
340
  end = _ref3[1];
342
- return value.equals(start) || value.equals(end) || _this.isAfter(value, start) && _this.isBefore(value, end);
341
+ return _this.isEqual(value, start) || _this.isEqual(value, end) || _this.isAfter(value, start) && _this.isBefore(value, end);
343
342
  };
344
343
  this.startOfYear = function (value) {
345
344
  return value.startOf('year');
@@ -124,7 +124,6 @@ var defaultFormats = {
124
124
  keyboardDateTime24h: 'L HH:mm'
125
125
  };
126
126
  var 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');
127
-
128
127
  /**
129
128
  * Based on `@date-io/moment`
130
129
  *
@@ -112,7 +112,6 @@ var NUMBER_SYMBOL_MAP = {
112
112
  '9': '٩',
113
113
  '0': '٠'
114
114
  };
115
-
116
115
  /**
117
116
  * Based on `@date-io/hijri`
118
117
  *
@@ -107,7 +107,6 @@ var NUMBER_SYMBOL_MAP = {
107
107
  '9': '۹',
108
108
  '0': '۰'
109
109
  };
110
-
111
110
  /**
112
111
  * Based on `@date-io/jalaali`
113
112
  *