@mui/x-date-pickers 6.0.4 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/AdapterDateFns/index.d.ts +1 -1
  2. package/AdapterDateFnsJalali/index.d.ts +1 -1
  3. package/AdapterDayjs/AdapterDayjs.d.ts +114 -0
  4. package/AdapterDayjs/AdapterDayjs.js +387 -0
  5. package/AdapterDayjs/index.d.ts +1 -29
  6. package/AdapterDayjs/index.js +1 -102
  7. package/AdapterLuxon/index.d.ts +2 -2
  8. package/AdapterLuxon/index.js +1 -1
  9. package/AdapterMoment/index.d.ts +1 -1
  10. package/AdapterMomentHijri/index.d.ts +1 -1
  11. package/AdapterMomentJalaali/index.d.ts +1 -1
  12. package/CHANGELOG.md +110 -0
  13. package/DateCalendar/DateCalendar.js +0 -2
  14. package/DateCalendar/DateCalendar.types.d.ts +1 -1
  15. package/DateCalendar/DayCalendar.d.ts +1 -1
  16. package/DateCalendar/PickersCalendarHeader.d.ts +0 -12
  17. package/DateCalendar/PickersCalendarHeader.js +7 -9
  18. package/DateCalendar/PickersSlideTransition.js +1 -0
  19. package/DateCalendar/useCalendarState.d.ts +1 -1
  20. package/DateField/DateField.js +14 -2
  21. package/DateField/useDateField.js +3 -1
  22. package/DatePicker/DatePicker.js +6 -0
  23. package/DatePicker/shared.d.ts +2 -2
  24. package/DateTimeField/DateTimeField.js +14 -2
  25. package/DateTimeField/useDateTimeField.js +3 -1
  26. package/DateTimePicker/DateTimePicker.js +6 -0
  27. package/DateTimePicker/shared.js +3 -1
  28. package/DesktopDatePicker/DesktopDatePicker.js +6 -0
  29. package/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -0
  30. package/DesktopTimePicker/DesktopTimePicker.js +6 -0
  31. package/LocalizationProvider/LocalizationProvider.d.ts +2 -3
  32. package/MobileDatePicker/MobileDatePicker.js +6 -0
  33. package/MobileDateTimePicker/MobileDateTimePicker.js +6 -0
  34. package/MobileTimePicker/MobileTimePicker.js +6 -0
  35. package/MonthCalendar/PickersMonth.js +1 -0
  36. package/README.md +3 -2
  37. package/TimeClock/ClockNumbers.d.ts +1 -1
  38. package/TimeClock/TimeClock.js +5 -4
  39. package/TimeClock/TimeClock.types.d.ts +1 -1
  40. package/TimeField/TimeField.js +14 -2
  41. package/TimeField/useTimeField.js +3 -1
  42. package/TimePicker/TimePicker.js +6 -0
  43. package/YearCalendar/PickersYear.js +1 -0
  44. package/index.js +1 -1
  45. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
  46. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +0 -12
  47. package/internals/components/PickersModalDialog.d.ts +1 -13
  48. package/internals/components/PickersModalDialog.js +7 -9
  49. package/internals/components/PickersPopper.d.ts +1 -3
  50. package/internals/components/PickersPopper.js +2 -7
  51. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  52. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -3
  53. package/internals/hooks/useField/useField.js +2 -2
  54. package/internals/hooks/useField/useField.types.d.ts +9 -11
  55. package/internals/hooks/useField/useField.utils.d.ts +2 -3
  56. package/internals/hooks/useField/useField.utils.js +19 -5
  57. package/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
  58. package/internals/hooks/useField/useFieldState.js +3 -2
  59. package/internals/hooks/useMobilePicker/useMobilePicker.js +2 -0
  60. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -3
  61. package/internals/hooks/usePicker/index.d.ts +1 -1
  62. package/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
  63. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -1
  64. package/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
  65. package/internals/hooks/usePicker/usePickerValue.d.ts +3 -173
  66. package/internals/hooks/usePicker/usePickerValue.js +199 -144
  67. package/internals/hooks/usePicker/usePickerValue.types.d.ts +233 -0
  68. package/internals/hooks/usePicker/usePickerValue.types.js +1 -0
  69. package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
  70. package/internals/hooks/usePicker/usePickerViews.js +13 -0
  71. package/internals/hooks/useUtils.d.ts +1 -1
  72. package/internals/index.d.ts +1 -2
  73. package/internals/models/index.d.ts +0 -1
  74. package/internals/models/index.js +1 -2
  75. package/internals/models/props/basePickerProps.d.ts +6 -0
  76. package/internals/utils/date-utils.d.ts +1 -1
  77. package/internals/utils/time-utils.d.ts +1 -2
  78. package/internals/utils/valueManagers.d.ts +1 -1
  79. package/internals/utils/valueManagers.js +2 -2
  80. package/legacy/AdapterDayjs/AdapterDayjs.js +403 -0
  81. package/legacy/AdapterDayjs/index.js +1 -119
  82. package/legacy/AdapterLuxon/index.js +1 -1
  83. package/legacy/DateCalendar/DateCalendar.js +0 -2
  84. package/legacy/DateCalendar/PickersCalendarHeader.js +8 -10
  85. package/legacy/DateField/DateField.js +13 -1
  86. package/legacy/DateField/useDateField.js +3 -1
  87. package/legacy/DatePicker/DatePicker.js +6 -0
  88. package/legacy/DateTimeField/DateTimeField.js +13 -1
  89. package/legacy/DateTimeField/useDateTimeField.js +3 -1
  90. package/legacy/DateTimePicker/DateTimePicker.js +6 -0
  91. package/legacy/DateTimePicker/shared.js +3 -1
  92. package/legacy/DesktopDatePicker/DesktopDatePicker.js +6 -0
  93. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -0
  94. package/legacy/DesktopTimePicker/DesktopTimePicker.js +6 -0
  95. package/legacy/MobileDatePicker/MobileDatePicker.js +6 -0
  96. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +6 -0
  97. package/legacy/MobileTimePicker/MobileTimePicker.js +6 -0
  98. package/legacy/TimeClock/TimeClock.js +5 -4
  99. package/legacy/TimeField/TimeField.js +13 -1
  100. package/legacy/TimeField/useTimeField.js +3 -1
  101. package/legacy/TimePicker/TimePicker.js +6 -0
  102. package/legacy/index.js +1 -1
  103. package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
  104. package/legacy/internals/components/PickersModalDialog.js +7 -9
  105. package/legacy/internals/components/PickersPopper.js +2 -7
  106. package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  107. package/legacy/internals/hooks/useField/useField.js +2 -2
  108. package/legacy/internals/hooks/useField/useField.utils.js +27 -10
  109. package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
  110. package/legacy/internals/hooks/useField/useFieldState.js +5 -3
  111. package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +2 -0
  112. package/legacy/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
  113. package/legacy/internals/hooks/usePicker/usePickerValue.js +196 -146
  114. package/legacy/internals/hooks/usePicker/usePickerValue.types.js +1 -0
  115. package/legacy/internals/hooks/usePicker/usePickerViews.js +13 -0
  116. package/legacy/internals/models/index.js +1 -2
  117. package/legacy/internals/utils/valueManagers.js +3 -3
  118. package/legacy/locales/caES.js +88 -0
  119. package/legacy/locales/esES.js +34 -17
  120. package/legacy/locales/heIL.js +33 -16
  121. package/legacy/locales/index.js +1 -0
  122. package/legacy/locales/jaJP.js +3 -1
  123. package/legacy/locales/kzKZ.js +88 -0
  124. package/legacy/locales/nlNL.js +25 -11
  125. package/legacy/locales/ptBR.js +33 -16
  126. package/legacy/models/adapters.js +1 -0
  127. package/legacy/models/index.js +2 -1
  128. package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.js +20 -0
  129. package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +1 -0
  130. package/legacy/tests/describeGregorianAdapter/index.js +1 -0
  131. package/legacy/tests/describeGregorianAdapter/testCalculations.js +273 -0
  132. package/legacy/tests/describeGregorianAdapter/testFormat.js +26 -0
  133. package/legacy/tests/describeGregorianAdapter/testLocalization.js +15 -0
  134. package/legacy/tests/describeValidation/describeValidation.js +2 -1
  135. package/legacy/tests/describeValidation/testMinutesViewValidation.js +201 -0
  136. package/legacy/tests/describeValue/testPickerActionBar.js +52 -3
  137. package/legacy/tests/describeValue/testPickerOpenCloseLifeCycle.js +6 -6
  138. package/locales/beBY.d.ts +3 -3
  139. package/locales/caES.d.ts +51 -0
  140. package/locales/caES.js +54 -0
  141. package/locales/csCZ.d.ts +3 -3
  142. package/locales/daDK.d.ts +3 -3
  143. package/locales/deDE.d.ts +3 -3
  144. package/locales/enUS.d.ts +3 -3
  145. package/locales/esES.d.ts +3 -3
  146. package/locales/esES.js +14 -17
  147. package/locales/faIR.d.ts +3 -3
  148. package/locales/fiFI.d.ts +3 -3
  149. package/locales/frFR.d.ts +3 -3
  150. package/locales/heIL.d.ts +3 -3
  151. package/locales/heIL.js +13 -16
  152. package/locales/huHU.d.ts +3 -3
  153. package/locales/index.d.ts +1 -0
  154. package/locales/index.js +1 -0
  155. package/locales/isIS.d.ts +3 -3
  156. package/locales/itIT.d.ts +3 -3
  157. package/locales/jaJP.d.ts +3 -3
  158. package/locales/jaJP.js +1 -1
  159. package/locales/koKR.d.ts +3 -3
  160. package/locales/kzKZ.d.ts +51 -0
  161. package/locales/kzKZ.js +56 -0
  162. package/locales/nbNO.d.ts +3 -3
  163. package/locales/nlNL.d.ts +3 -3
  164. package/locales/nlNL.js +9 -11
  165. package/locales/plPL.d.ts +3 -3
  166. package/locales/ptBR.d.ts +3 -3
  167. package/locales/ptBR.js +13 -16
  168. package/locales/ruRU.d.ts +3 -3
  169. package/locales/svSE.d.ts +3 -3
  170. package/locales/trTR.d.ts +3 -3
  171. package/locales/ukUA.d.ts +3 -3
  172. package/locales/urPK.d.ts +3 -3
  173. package/locales/utils/getPickersLocalization.d.ts +3 -3
  174. package/locales/utils/pickersLocaleTextApi.d.ts +1 -2
  175. package/locales/zhCN.d.ts +3 -3
  176. package/models/adapters.d.ts +568 -0
  177. package/models/adapters.js +1 -0
  178. package/models/index.d.ts +1 -0
  179. package/models/index.js +2 -1
  180. package/modern/AdapterDayjs/AdapterDayjs.js +386 -0
  181. package/modern/AdapterDayjs/index.js +1 -101
  182. package/modern/AdapterLuxon/index.js +1 -1
  183. package/modern/DateCalendar/DateCalendar.js +0 -2
  184. package/modern/DateCalendar/PickersCalendarHeader.js +6 -8
  185. package/modern/DateCalendar/PickersSlideTransition.js +1 -0
  186. package/modern/DateField/DateField.js +14 -2
  187. package/modern/DateField/useDateField.js +3 -1
  188. package/modern/DatePicker/DatePicker.js +6 -0
  189. package/modern/DateTimeField/DateTimeField.js +14 -2
  190. package/modern/DateTimeField/useDateTimeField.js +3 -1
  191. package/modern/DateTimePicker/DateTimePicker.js +6 -0
  192. package/modern/DateTimePicker/shared.js +3 -1
  193. package/modern/DesktopDatePicker/DesktopDatePicker.js +6 -0
  194. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -0
  195. package/modern/DesktopTimePicker/DesktopTimePicker.js +6 -0
  196. package/modern/MobileDatePicker/MobileDatePicker.js +6 -0
  197. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +6 -0
  198. package/modern/MobileTimePicker/MobileTimePicker.js +6 -0
  199. package/modern/MonthCalendar/PickersMonth.js +1 -0
  200. package/modern/TimeClock/TimeClock.js +5 -4
  201. package/modern/TimeField/TimeField.js +14 -2
  202. package/modern/TimeField/useTimeField.js +3 -1
  203. package/modern/TimePicker/TimePicker.js +6 -0
  204. package/modern/YearCalendar/PickersYear.js +1 -0
  205. package/modern/index.js +1 -1
  206. package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
  207. package/modern/internals/components/PickersModalDialog.js +6 -8
  208. package/modern/internals/components/PickersPopper.js +2 -7
  209. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  210. package/modern/internals/hooks/useField/useField.js +2 -2
  211. package/modern/internals/hooks/useField/useField.utils.js +19 -5
  212. package/modern/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
  213. package/modern/internals/hooks/useField/useFieldState.js +3 -2
  214. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +2 -0
  215. package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
  216. package/modern/internals/hooks/usePicker/usePickerValue.js +199 -144
  217. package/modern/internals/hooks/usePicker/usePickerValue.types.js +1 -0
  218. package/modern/internals/hooks/usePicker/usePickerViews.js +13 -0
  219. package/modern/internals/models/index.js +1 -2
  220. package/modern/internals/utils/valueManagers.js +2 -2
  221. package/modern/locales/caES.js +54 -0
  222. package/modern/locales/esES.js +14 -17
  223. package/modern/locales/heIL.js +13 -16
  224. package/modern/locales/index.js +1 -0
  225. package/modern/locales/jaJP.js +1 -1
  226. package/modern/locales/kzKZ.js +56 -0
  227. package/modern/locales/nlNL.js +9 -11
  228. package/modern/locales/ptBR.js +13 -16
  229. package/modern/models/adapters.js +1 -0
  230. package/modern/models/index.js +2 -1
  231. package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.js +20 -0
  232. package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +1 -0
  233. package/modern/tests/describeGregorianAdapter/index.js +1 -0
  234. package/modern/tests/describeGregorianAdapter/testCalculations.js +272 -0
  235. package/modern/tests/describeGregorianAdapter/testFormat.js +27 -0
  236. package/modern/tests/describeGregorianAdapter/testLocalization.js +16 -0
  237. package/modern/tests/describeValidation/describeValidation.js +2 -1
  238. package/modern/tests/describeValidation/testMinutesViewValidation.js +200 -0
  239. package/modern/tests/describeValue/testPickerActionBar.js +52 -3
  240. package/modern/tests/describeValue/testPickerOpenCloseLifeCycle.js +6 -6
  241. package/node/AdapterDayjs/AdapterDayjs.js +395 -0
  242. package/node/AdapterDayjs/index.js +6 -104
  243. package/node/AdapterLuxon/index.js +1 -1
  244. package/node/AdapterMomentHijri/index.js +2 -0
  245. package/node/DateCalendar/DateCalendar.js +0 -2
  246. package/node/DateCalendar/PickersCalendarHeader.js +5 -9
  247. package/node/DateCalendar/PickersSlideTransition.js +1 -0
  248. package/node/DateField/DateField.js +14 -2
  249. package/node/DateField/useDateField.js +3 -1
  250. package/node/DatePicker/DatePicker.js +6 -0
  251. package/node/DateTimeField/DateTimeField.js +14 -2
  252. package/node/DateTimeField/useDateTimeField.js +3 -1
  253. package/node/DateTimePicker/DateTimePicker.js +6 -0
  254. package/node/DateTimePicker/shared.js +3 -1
  255. package/node/DesktopDatePicker/DesktopDatePicker.js +6 -0
  256. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -0
  257. package/node/DesktopTimePicker/DesktopTimePicker.js +6 -0
  258. package/node/MobileDatePicker/MobileDatePicker.js +6 -0
  259. package/node/MobileDateTimePicker/MobileDateTimePicker.js +6 -0
  260. package/node/MobileTimePicker/MobileTimePicker.js +6 -0
  261. package/node/MonthCalendar/PickersMonth.js +1 -0
  262. package/node/TimeClock/TimeClock.js +5 -4
  263. package/node/TimeField/TimeField.js +14 -2
  264. package/node/TimeField/useTimeField.js +3 -1
  265. package/node/TimePicker/TimePicker.js +6 -0
  266. package/node/YearCalendar/PickersYear.js +1 -0
  267. package/node/index.js +1 -1
  268. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
  269. package/node/internals/components/PickersModalDialog.js +6 -8
  270. package/node/internals/components/PickersPopper.js +2 -7
  271. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  272. package/node/internals/hooks/useField/useField.js +2 -2
  273. package/node/internals/hooks/useField/useField.utils.js +19 -5
  274. package/node/internals/hooks/useField/useFieldCharacterEditing.js +22 -0
  275. package/node/internals/hooks/useField/useFieldState.js +3 -2
  276. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +2 -0
  277. package/node/internals/hooks/usePicker/usePickerLayoutProps.js +5 -0
  278. package/node/internals/hooks/usePicker/usePickerValue.js +199 -144
  279. package/node/internals/hooks/usePicker/usePickerValue.types.js +5 -0
  280. package/node/internals/hooks/usePicker/usePickerViews.js +12 -0
  281. package/node/internals/models/index.js +0 -11
  282. package/node/internals/utils/valueManagers.js +2 -2
  283. package/node/locales/caES.js +61 -0
  284. package/node/locales/csCZ.js +0 -1
  285. package/node/locales/esES.js +14 -17
  286. package/node/locales/heIL.js +13 -16
  287. package/node/locales/index.js +11 -0
  288. package/node/locales/jaJP.js +1 -1
  289. package/node/locales/kzKZ.js +62 -0
  290. package/node/locales/nlNL.js +9 -11
  291. package/node/locales/ptBR.js +13 -16
  292. package/node/models/adapters.js +5 -0
  293. package/node/models/index.js +11 -0
  294. package/node/tests/describeGregorianAdapter/describeGregorianAdapter.js +29 -0
  295. package/node/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +5 -0
  296. package/node/tests/describeGregorianAdapter/index.js +18 -0
  297. package/node/tests/describeGregorianAdapter/testCalculations.js +279 -0
  298. package/node/tests/describeGregorianAdapter/testFormat.js +34 -0
  299. package/node/tests/describeGregorianAdapter/testLocalization.js +23 -0
  300. package/node/tests/describeValidation/describeValidation.js +2 -1
  301. package/node/tests/describeValidation/testMinutesViewValidation.js +210 -0
  302. package/node/tests/describeValue/testPickerActionBar.js +52 -3
  303. package/node/tests/describeValue/testPickerOpenCloseLifeCycle.js +6 -6
  304. package/package.json +11 -11
  305. package/tests/describeGregorianAdapter/describeGregorianAdapter.js +20 -0
  306. package/tests/describeGregorianAdapter/describeGregorianAdapter.types.js +1 -0
  307. package/tests/describeGregorianAdapter/index.js +1 -0
  308. package/tests/describeGregorianAdapter/testCalculations.js +272 -0
  309. package/tests/describeGregorianAdapter/testFormat.js +27 -0
  310. package/tests/describeGregorianAdapter/testLocalization.js +16 -0
  311. package/tests/describeValidation/describeValidation.js +2 -1
  312. package/tests/describeValidation/testMinutesViewValidation.js +200 -0
  313. package/tests/describeValue/testPickerActionBar.js +52 -3
  314. package/tests/describeValue/testPickerOpenCloseLifeCycle.js +6 -6
  315. package/internals/models/muiPickersAdapter.d.ts +0 -26
@@ -0,0 +1,395 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AdapterDayjs = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _dayjs = _interopRequireDefault(require("dayjs"));
10
+ var _weekOfYear = _interopRequireDefault(require("dayjs/plugin/weekOfYear"));
11
+ var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
12
+ var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFormat"));
13
+ var _isBetween = _interopRequireDefault(require("dayjs/plugin/isBetween"));
14
+ var _warning = require("../internals/utils/warning");
15
+ /* eslint-disable class-methods-use-this */
16
+
17
+ _dayjs.default.extend(_customParseFormat.default);
18
+ _dayjs.default.extend(_localizedFormat.default);
19
+ _dayjs.default.extend(_isBetween.default);
20
+ const localeNotFoundWarning = (0, _warning.buildWarning)(['Your locale has not been found.', 'Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale', "Or you forget to import the locale with `require('dayjs/locale/{localeUsed}')`", 'fallback on English locale']);
21
+ const formatTokenMap = {
22
+ // Year
23
+ YY: 'year',
24
+ YYYY: 'year',
25
+ // Month
26
+ M: 'month',
27
+ MM: 'month',
28
+ MMM: {
29
+ sectionType: 'month',
30
+ contentType: 'letter'
31
+ },
32
+ MMMM: {
33
+ sectionType: 'month',
34
+ contentType: 'letter'
35
+ },
36
+ // Day of the month
37
+ D: 'day',
38
+ DD: 'day',
39
+ Do: 'day',
40
+ // Day of the week
41
+ d: 'weekDay',
42
+ dd: {
43
+ sectionType: 'weekDay',
44
+ contentType: 'letter'
45
+ },
46
+ ddd: {
47
+ sectionType: 'weekDay',
48
+ contentType: 'letter'
49
+ },
50
+ dddd: {
51
+ sectionType: 'weekDay',
52
+ contentType: 'letter'
53
+ },
54
+ // Meridiem
55
+ A: 'meridiem',
56
+ a: 'meridiem',
57
+ // Hours
58
+ H: 'hours',
59
+ HH: 'hours',
60
+ h: 'hours',
61
+ hh: 'hours',
62
+ // Minutes
63
+ m: 'minutes',
64
+ mm: 'minutes',
65
+ // Seconds
66
+ s: 'seconds',
67
+ ss: 'seconds'
68
+ };
69
+ const defaultFormats = {
70
+ normalDateWithWeekday: 'ddd, MMM D',
71
+ normalDate: 'D MMMM',
72
+ shortDate: 'MMM D',
73
+ monthAndDate: 'MMMM D',
74
+ dayOfMonth: 'D',
75
+ year: 'YYYY',
76
+ month: 'MMMM',
77
+ monthShort: 'MMM',
78
+ monthAndYear: 'MMMM YYYY',
79
+ weekday: 'dddd',
80
+ weekdayShort: 'ddd',
81
+ minutes: 'mm',
82
+ hours12h: 'hh',
83
+ hours24h: 'HH',
84
+ seconds: 'ss',
85
+ fullTime: 'LT',
86
+ fullTime12h: 'hh:mm A',
87
+ fullTime24h: 'HH:mm',
88
+ fullDate: 'll',
89
+ fullDateWithWeekday: 'dddd, LL',
90
+ fullDateTime: 'lll',
91
+ fullDateTime12h: 'll hh:mm A',
92
+ fullDateTime24h: 'll HH:mm',
93
+ keyboardDate: 'L',
94
+ keyboardDateTime: 'L LT',
95
+ keyboardDateTime12h: 'L hh:mm A',
96
+ keyboardDateTime24h: 'L HH:mm'
97
+ };
98
+ const withLocale = (dayjs, locale) => !locale ? dayjs : (...args) => dayjs(...args).locale(locale);
99
+
100
+ /**
101
+ * Based on `@date-io/dayjs`
102
+ *
103
+ * MIT License
104
+ *
105
+ * Copyright (c) 2017 Dmitriy Kovalenko
106
+ *
107
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
108
+ * of this software and associated documentation files (the "Software"), to deal
109
+ * in the Software without restriction, including without limitation the rights
110
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
111
+ * copies of the Software, and to permit persons to whom the Software is
112
+ * furnished to do so, subject to the following conditions:
113
+ *
114
+ * The above copyright notice and this permission notice shall be included in all
115
+ * copies or substantial portions of the Software.
116
+ *
117
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
118
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
119
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
120
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
121
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
122
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
123
+ * SOFTWARE.
124
+ */
125
+ class AdapterDayjs {
126
+ constructor({
127
+ locale: _locale,
128
+ formats,
129
+ instance
130
+ } = {}) {
131
+ this.isMUIAdapter = true;
132
+ this.rawDayJsInstance = void 0;
133
+ this.lib = 'dayjs';
134
+ this.dayjs = void 0;
135
+ this.locale = void 0;
136
+ this.formats = void 0;
137
+ this.escapedCharacters = {
138
+ start: '[',
139
+ end: ']'
140
+ };
141
+ this.formatTokenMap = formatTokenMap;
142
+ this.getLocaleFormats = () => {
143
+ const locales = this.rawDayJsInstance.Ls ?? _dayjs.default.Ls;
144
+ const locale = this.locale || 'en';
145
+ let localeObject = locales[locale];
146
+ if (localeObject === undefined) {
147
+ localeNotFoundWarning();
148
+ localeObject = locales.en;
149
+ }
150
+ return localeObject.formats;
151
+ };
152
+ this.date = value => {
153
+ if (value === null) {
154
+ return null;
155
+ }
156
+ return this.dayjs(value);
157
+ };
158
+ this.toJsDate = value => {
159
+ return value.toDate();
160
+ };
161
+ this.parseISO = isoString => {
162
+ return this.dayjs(isoString);
163
+ };
164
+ this.toISO = value => {
165
+ return value.toISOString();
166
+ };
167
+ this.parse = (value, format) => {
168
+ if (value === '') {
169
+ return null;
170
+ }
171
+ return this.dayjs(value, format, this.locale, true);
172
+ };
173
+ this.getCurrentLocaleCode = () => {
174
+ return this.locale || 'en';
175
+ };
176
+ this.is12HourCycleInCurrentLocale = () => {
177
+ /* istanbul ignore next */
178
+ return /A|a/.test(this.getLocaleFormats().LT || '');
179
+ };
180
+ this.expandFormat = format => {
181
+ const localeFormats = this.getLocaleFormats();
182
+
183
+ // @see https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/index.js
184
+ const t = formatBis => formatBis.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1));
185
+ return format.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {
186
+ const B = b && b.toUpperCase();
187
+ return a || localeFormats[b] || t(localeFormats[B]);
188
+ });
189
+ };
190
+ this.getFormatHelperText = format => {
191
+ return this.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
192
+ };
193
+ this.isNull = date => {
194
+ return date === null;
195
+ };
196
+ this.isValid = value => {
197
+ return this.dayjs(value).isValid();
198
+ };
199
+ this.format = (date, formatKey) => {
200
+ return this.formatByString(date, this.formats[formatKey]);
201
+ };
202
+ this.formatByString = (date, formatString) => {
203
+ return this.dayjs(date).format(formatString);
204
+ };
205
+ this.formatNumber = numberToFormat => {
206
+ return numberToFormat;
207
+ };
208
+ this.getDiff = (date, comparing, units) => {
209
+ return date.diff(comparing, units);
210
+ };
211
+ this.isEqual = (value, comparing) => {
212
+ if (value === null && comparing === null) {
213
+ return true;
214
+ }
215
+ return this.dayjs(value).isSame(comparing);
216
+ };
217
+ this.isSameYear = (date, comparing) => {
218
+ return date.isSame(comparing, 'year');
219
+ };
220
+ this.isSameMonth = (date, comparing) => {
221
+ return date.isSame(comparing, 'month');
222
+ };
223
+ this.isSameDay = (date, comparing) => {
224
+ return date.isSame(comparing, 'day');
225
+ };
226
+ this.isSameHour = (date, comparing) => {
227
+ return date.isSame(comparing, 'hour');
228
+ };
229
+ this.isAfter = (date, value) => {
230
+ return date.isAfter(value);
231
+ };
232
+ this.isAfterYear = (date, value) => {
233
+ return date.isAfter(value, 'year');
234
+ };
235
+ this.isAfterDay = (date, value) => {
236
+ return date.isAfter(value, 'day');
237
+ };
238
+ this.isBefore = (date, value) => {
239
+ return date.isBefore(value);
240
+ };
241
+ this.isBeforeYear = (date, value) => {
242
+ return date.isBefore(value, 'year');
243
+ };
244
+ this.isBeforeDay = (date, value) => {
245
+ return date.isBefore(value, 'day');
246
+ };
247
+ this.isWithinRange = (date, [start, end]) => {
248
+ return date.isBetween(start, end, null, '[]');
249
+ };
250
+ this.startOfYear = date => {
251
+ return date.startOf('year');
252
+ };
253
+ this.startOfMonth = date => {
254
+ return date.startOf('month');
255
+ };
256
+ this.endOfYear = date => {
257
+ return date.endOf('year');
258
+ };
259
+ this.startOfWeek = date => {
260
+ return date.startOf('week');
261
+ };
262
+ this.startOfDay = date => {
263
+ return date.startOf('day');
264
+ };
265
+ this.endOfMonth = date => {
266
+ return date.endOf('month');
267
+ };
268
+ this.endOfWeek = date => {
269
+ return date.endOf('week');
270
+ };
271
+ this.endOfDay = date => {
272
+ return date.endOf('day');
273
+ };
274
+ this.addYears = (date, count) => {
275
+ return count < 0 ? date.subtract(Math.abs(count), 'year') : date.add(count, 'year');
276
+ };
277
+ this.addMonths = (date, count) => {
278
+ return count < 0 ? date.subtract(Math.abs(count), 'month') : date.add(count, 'month');
279
+ };
280
+ this.addWeeks = (date, count) => {
281
+ return count < 0 ? date.subtract(Math.abs(count), 'week') : date.add(count, 'week');
282
+ };
283
+ this.addDays = (date, count) => {
284
+ return count < 0 ? date.subtract(Math.abs(count), 'day') : date.add(count, 'day');
285
+ };
286
+ this.addHours = (date, count) => {
287
+ return count < 0 ? date.subtract(Math.abs(count), 'hour') : date.add(count, 'hour');
288
+ };
289
+ this.addMinutes = (date, count) => {
290
+ return count < 0 ? date.subtract(Math.abs(count), 'minute') : date.add(count, 'minute');
291
+ };
292
+ this.addSeconds = (date, count) => {
293
+ return count < 0 ? date.subtract(Math.abs(count), 'second') : date.add(count, 'second');
294
+ };
295
+ this.getYear = date => {
296
+ return date.year();
297
+ };
298
+ this.getMonth = date => {
299
+ return date.month();
300
+ };
301
+ this.getDate = date => {
302
+ return date.date();
303
+ };
304
+ this.getHours = date => {
305
+ return date.hour();
306
+ };
307
+ this.getMinutes = date => {
308
+ return date.minute();
309
+ };
310
+ this.getSeconds = date => {
311
+ return date.second();
312
+ };
313
+ this.setYear = (date, year) => {
314
+ return date.set('year', year);
315
+ };
316
+ this.setMonth = (date, count) => {
317
+ return date.set('month', count);
318
+ };
319
+ this.setDate = (date, count) => {
320
+ return date.set('date', count);
321
+ };
322
+ this.setHours = (date, count) => {
323
+ return date.set('hour', count);
324
+ };
325
+ this.setMinutes = (date, count) => {
326
+ return date.set('minute', count);
327
+ };
328
+ this.setSeconds = (date, count) => {
329
+ return date.set('second', count);
330
+ };
331
+ this.getDaysInMonth = date => {
332
+ return date.daysInMonth();
333
+ };
334
+ this.getNextMonth = date => {
335
+ return date.add(1, 'month');
336
+ };
337
+ this.getPreviousMonth = date => {
338
+ return date.subtract(1, 'month');
339
+ };
340
+ this.getMonthArray = date => {
341
+ const firstMonth = date.startOf('year');
342
+ const monthArray = [firstMonth];
343
+ while (monthArray.length < 12) {
344
+ const prevMonth = monthArray[monthArray.length - 1];
345
+ monthArray.push(this.getNextMonth(prevMonth));
346
+ }
347
+ return monthArray;
348
+ };
349
+ this.mergeDateAndTime = (date, time) => {
350
+ return date.hour(time.hour()).minute(time.minute()).second(time.second());
351
+ };
352
+ this.getWeekdays = () => {
353
+ const start = this.dayjs().startOf('week');
354
+ return [0, 1, 2, 3, 4, 5, 6].map(diff => this.formatByString(start.add(diff, 'day'), 'dd'));
355
+ };
356
+ this.getWeekArray = date => {
357
+ const start = this.dayjs(date).startOf('month').startOf('week');
358
+ const end = this.dayjs(date).endOf('month').endOf('week');
359
+ let count = 0;
360
+ let current = start;
361
+ const nestedWeeks = [];
362
+ while (current.isBefore(end)) {
363
+ const weekNumber = Math.floor(count / 7);
364
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
365
+ nestedWeeks[weekNumber].push(current);
366
+ current = current.add(1, 'day');
367
+ count += 1;
368
+ }
369
+ return nestedWeeks;
370
+ };
371
+ this.getWeekNumber = date => {
372
+ return date.week();
373
+ };
374
+ this.getYearRange = (start, end) => {
375
+ const startDate = this.dayjs(start).startOf('year');
376
+ const endDate = this.dayjs(end).endOf('year');
377
+ const years = [];
378
+ let current = startDate;
379
+ while (current.isBefore(endDate)) {
380
+ years.push(current);
381
+ current = current.add(1, 'year');
382
+ }
383
+ return years;
384
+ };
385
+ this.getMeridiemText = ampm => {
386
+ return ampm === 'am' ? 'AM' : 'PM';
387
+ };
388
+ this.rawDayJsInstance = instance || _dayjs.default;
389
+ this.dayjs = withLocale(this.rawDayJsInstance, _locale);
390
+ this.locale = _locale;
391
+ this.formats = (0, _extends2.default)({}, defaultFormats, formats);
392
+ _dayjs.default.extend(_weekOfYear.default);
393
+ }
394
+ }
395
+ exports.AdapterDayjs = AdapterDayjs;
@@ -1,110 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.AdapterDayjs = void 0;
8
- var _dayjs = _interopRequireDefault(require("dayjs"));
9
- var _weekOfYear = _interopRequireDefault(require("dayjs/plugin/weekOfYear"));
10
- var _dayjs2 = _interopRequireDefault(require("@date-io/dayjs"));
11
- var _warning = require("../internals/utils/warning");
12
- /* eslint-disable class-methods-use-this */
13
-
14
- const localeNotFoundWarning = (0, _warning.buildWarning)(['Your locale has not been found.', 'Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale', "Or you forget to import the locale with `require('dayjs/locale/{localeUsed}')`", 'fallback on English locale']);
15
- const formatTokenMap = {
16
- // Year
17
- YY: 'year',
18
- YYYY: 'year',
19
- // Month
20
- M: 'month',
21
- MM: 'month',
22
- MMM: {
23
- sectionType: 'month',
24
- contentType: 'letter'
25
- },
26
- MMMM: {
27
- sectionType: 'month',
28
- contentType: 'letter'
29
- },
30
- // Day of the month
31
- D: 'day',
32
- DD: 'day',
33
- Do: 'day',
34
- // Day of the week
35
- d: 'weekDay',
36
- dd: {
37
- sectionType: 'weekDay',
38
- contentType: 'letter'
39
- },
40
- ddd: {
41
- sectionType: 'weekDay',
42
- contentType: 'letter'
43
- },
44
- dddd: {
45
- sectionType: 'weekDay',
46
- contentType: 'letter'
47
- },
48
- // Meridiem
49
- A: 'meridiem',
50
- a: 'meridiem',
51
- // Hours
52
- H: 'hours',
53
- HH: 'hours',
54
- h: 'hours',
55
- hh: 'hours',
56
- // Minutes
57
- m: 'minutes',
58
- mm: 'minutes',
59
- // Seconds
60
- s: 'seconds',
61
- ss: 'seconds'
62
- };
63
- class AdapterDayjs extends _dayjs2.default {
64
- constructor(options) {
65
- super(options);
66
- this.isMUIAdapter = true;
67
- this.formatTokenMap = formatTokenMap;
68
- this.escapedCharacters = {
69
- start: '[',
70
- end: ']'
71
- };
72
- this.getLocaleFormats = () => {
73
- const locales = this.rawDayJsInstance.Ls ?? _dayjs.default.Ls;
74
- const locale = this.locale || 'en';
75
- let localeObject = locales[locale];
76
- if (localeObject === undefined) {
77
- localeNotFoundWarning();
78
- localeObject = locales.en;
79
- }
80
- return localeObject.formats;
81
- };
82
- this.is12HourCycleInCurrentLocale = () => {
83
- /* istanbul ignore next */
84
- return /A|a/.test(this.getLocaleFormats().LT || '');
85
- };
86
- /**
87
- * The current getFormatHelperText method uses an outdated format parsing logic.
88
- * We should use this one in the future to support all localized formats.
89
- */
90
- this.expandFormat = format => {
91
- const localeFormats = this.getLocaleFormats();
92
-
93
- // @see https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/index.js
94
- const t = formatBis => formatBis.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1));
95
- return format.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {
96
- const B = b && b.toUpperCase();
97
- return a || localeFormats[b] || t(localeFormats[B]);
98
- });
99
- };
100
- // Redefined here just to show how it can be written using expandFormat
101
- this.getFormatHelperText = format => {
102
- return this.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
103
- };
104
- this.getWeekNumber = date => {
105
- return date.week();
106
- };
107
- _dayjs.default.extend(_weekOfYear.default);
6
+ Object.defineProperty(exports, "AdapterDayjs", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _AdapterDayjs.AdapterDayjs;
108
10
  }
109
- }
110
- exports.AdapterDayjs = AdapterDayjs;
11
+ });
12
+ var _AdapterDayjs = require("./AdapterDayjs");
@@ -92,7 +92,7 @@ class AdapterLuxon extends _luxon2.default {
92
92
  if (!_luxon.DateTime.expandFormat) {
93
93
  throw Error('Your luxon version does not support `expandFormat`. Consider upgrading it to v3.0.2');
94
94
  }
95
- // Extract escaped section to avoid entending them
95
+ // Extract escaped section to avoid extending them
96
96
  const longFormatRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
97
97
  return format.match(longFormatRegexp).map(token => {
98
98
  const firstCharacter = token[0];
@@ -8,6 +8,8 @@ exports.AdapterMomentHijri = void 0;
8
8
  var _hijri = _interopRequireDefault(require("@date-io/hijri"));
9
9
  /* eslint-disable class-methods-use-this */
10
10
 
11
+ // @ts-ignore
12
+
11
13
  // From https://momentjs.com/docs/#/displaying/format/
12
14
  const formatTokenMap = {
13
15
  // Year
@@ -280,8 +280,6 @@ const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps
280
280
  disableFuture: disableFuture,
281
281
  reduceAnimations: reduceAnimations,
282
282
  labelId: gridLabelId,
283
- components: components,
284
- componentsProps: componentsProps,
285
283
  slots: slots,
286
284
  slotProps: slotProps
287
285
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(DateCalendarViewTransitionContainer, {
@@ -20,7 +20,7 @@ var _PickersArrowSwitcher = require("../internals/components/PickersArrowSwitche
20
20
  var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
21
21
  var _pickersCalendarHeaderClasses = require("./pickersCalendarHeaderClasses");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["ownerState"];
23
+ const _excluded = ["ownerState"]; // We keep the interface to allow module augmentation
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
26
26
  const useUtilityClasses = ownerState => {
@@ -109,8 +109,6 @@ function PickersCalendarHeader(inProps) {
109
109
  name: 'MuiPickersCalendarHeader'
110
110
  });
111
111
  const {
112
- components,
113
- componentsProps,
114
112
  slots,
115
113
  slotProps,
116
114
  currentMonth: month,
@@ -128,10 +126,10 @@ function PickersCalendarHeader(inProps) {
128
126
  } = props;
129
127
  const ownerState = props;
130
128
  const classes = useUtilityClasses(props);
131
- const SwitchViewButton = slots?.switchViewButton ?? components?.SwitchViewButton ?? PickersCalendarHeaderSwitchViewButton;
129
+ const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
132
130
  const switchViewButtonProps = (0, _utils.useSlotProps)({
133
131
  elementType: SwitchViewButton,
134
- externalSlotProps: slotProps?.switchViewButton ?? componentsProps?.switchViewButton,
132
+ externalSlotProps: slotProps?.switchViewButton,
135
133
  additionalProps: {
136
134
  size: 'small',
137
135
  'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)
@@ -139,11 +137,11 @@ function PickersCalendarHeader(inProps) {
139
137
  ownerState,
140
138
  className: classes.switchViewButton
141
139
  });
142
- const SwitchViewIcon = slots?.switchViewIcon ?? components?.SwitchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
140
+ const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
143
141
  // The spread is here to avoid this bug mui/material-ui#34056
144
142
  const _useSlotProps = (0, _utils.useSlotProps)({
145
143
  elementType: SwitchViewIcon,
146
- externalSlotProps: slotProps?.switchViewIcon ?? componentsProps?.switchViewIcon,
144
+ externalSlotProps: slotProps?.switchViewIcon,
147
145
  ownerState: undefined,
148
146
  className: classes.switchViewIcon
149
147
  }),
@@ -201,8 +199,6 @@ function PickersCalendarHeader(inProps) {
201
199
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fade.default, {
202
200
  in: view === 'day',
203
201
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersArrowSwitcher.PickersArrowSwitcher, {
204
- components: components,
205
- componentsProps: componentsProps,
206
202
  slots: slots,
207
203
  slotProps: slotProps,
208
204
  onGoToPrevious: selectPreviousMonth,
@@ -112,6 +112,7 @@ function PickersSlideTransition(inProps) {
112
112
  className,
113
113
  reduceAnimations,
114
114
  transKey
115
+ // extracting `classes` from `other`
115
116
  } = props,
116
117
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
117
118
  const classes = useUtilityClasses(props);
@@ -14,7 +14,7 @@ var _styles = require("@mui/material/styles");
14
14
  var _utils = require("@mui/base/utils");
15
15
  var _useDateField2 = require("./useDateField");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
- const _excluded = ["components", "componentsProps", "slots", "slotProps"],
17
+ const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
18
18
  _excluded2 = ["inputRef"],
19
19
  _excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -28,7 +28,9 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
28
28
  components,
29
29
  componentsProps,
30
30
  slots,
31
- slotProps
31
+ slotProps,
32
+ InputProps,
33
+ inputProps
32
34
  } = themeProps,
33
35
  other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
34
36
  const ownerState = themeProps;
@@ -43,6 +45,10 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
43
45
  inputRef: externalInputRef
44
46
  } = _useSlotProps,
45
47
  textFieldProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
48
+
49
+ // TODO: Remove when mui/material-ui#35088 will be merged
50
+ textFieldProps.inputProps = (0, _extends2.default)({}, textFieldProps.inputProps, inputProps);
51
+ textFieldProps.InputProps = (0, _extends2.default)({}, textFieldProps.InputProps, InputProps);
46
52
  const _useDateField = (0, _useDateField2.useDateField)({
47
53
  props: textFieldProps,
48
54
  inputRef: externalInputRef
@@ -123,6 +129,12 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
123
129
  * Format of the date when rendered in the input(s).
124
130
  */
125
131
  format: _propTypes.default.string,
132
+ /**
133
+ * Density of the format when rendered in the input.
134
+ * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
135
+ * @default "dense"
136
+ */
137
+ formatDensity: _propTypes.default.oneOf(['dense', 'spacious']),
126
138
  /**
127
139
  * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
128
140
  */
@@ -12,7 +12,7 @@ var _useField = require("../internals/hooks/useField");
12
12
  var _useDateValidation = require("../internals/hooks/validation/useDateValidation");
13
13
  var _dateUtils = require("../internals/utils/date-utils");
14
14
  var _useUtils = require("../internals/hooks/useUtils");
15
- const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
15
+ const _excluded = ["value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
16
16
  const useDefaultizedDateField = props => {
17
17
  const utils = (0, _useUtils.useUtils)();
18
18
  const defaultDates = (0, _useUtils.useDefaultDates)();
@@ -33,6 +33,7 @@ const useDateField = ({
33
33
  value,
34
34
  defaultValue,
35
35
  format,
36
+ formatDensity,
36
37
  onChange,
37
38
  readOnly,
38
39
  onError,
@@ -55,6 +56,7 @@ const useDateField = ({
55
56
  value,
56
57
  defaultValue,
57
58
  format,
59
+ formatDensity,
58
60
  onChange,
59
61
  readOnly,
60
62
  onError,
@@ -137,6 +137,12 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
137
137
  * Defaults to localized format based on the used `views`.
138
138
  */
139
139
  format: _propTypes.default.string,
140
+ /**
141
+ * Density of the format when rendered in the input.
142
+ * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
143
+ * @default "dense"
144
+ */
145
+ formatDensity: _propTypes.default.oneOf(['dense', 'spacious']),
140
146
  /**
141
147
  * Pass a ref to the `input` element.
142
148
  */