@mui/x-date-pickers 7.0.0-alpha.7 → 7.0.0-alpha.9

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 (326) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +4 -21
  2. package/AdapterDateFns/AdapterDateFns.js +11 -255
  3. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +62 -0
  4. package/AdapterDateFnsBase/AdapterDateFnsBase.js +291 -0
  5. package/AdapterDateFnsBase/index.d.ts +1 -0
  6. package/AdapterDateFnsBase/index.js +1 -0
  7. package/AdapterDateFnsBase/package.json +6 -0
  8. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
  9. package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +80 -0
  10. package/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
  11. package/AdapterDateFnsV3/index.d.ts +1 -0
  12. package/AdapterDateFnsV3/index.js +1 -0
  13. package/AdapterDateFnsV3/package.json +6 -0
  14. package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
  15. package/AdapterLuxon/AdapterLuxon.js +4 -12
  16. package/CHANGELOG.md +554 -51
  17. package/DatePicker/DatePicker.js +0 -3
  18. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  19. package/DatePicker/DatePickerToolbar.js +2 -10
  20. package/DateTimePicker/DateTimePicker.js +0 -3
  21. package/DateTimePicker/DateTimePickerToolbar.js +0 -3
  22. package/DesktopDatePicker/DesktopDatePicker.js +0 -3
  23. package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  24. package/DesktopTimePicker/DesktopTimePicker.js +0 -3
  25. package/DigitalClock/DigitalClock.js +1 -0
  26. package/DigitalClock/DigitalClock.types.d.ts +5 -0
  27. package/LocalizationProvider/LocalizationProvider.js +1 -1
  28. package/MobileDatePicker/MobileDatePicker.js +0 -3
  29. package/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  30. package/MobileTimePicker/MobileTimePicker.js +0 -3
  31. package/MonthCalendar/MonthCalendar.js +0 -3
  32. package/MonthCalendar/MonthCalendar.types.d.ts +0 -3
  33. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  34. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
  35. package/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  36. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +0 -3
  37. package/PickersSectionList/PickersSectionList.js +7 -2
  38. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +11 -0
  39. package/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
  40. package/PickersTextField/PickersFilledInput/index.d.ts +4 -0
  41. package/PickersTextField/PickersFilledInput/index.js +2 -0
  42. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +23 -0
  43. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  44. package/PickersTextField/PickersInput/PickersInput.d.ts +10 -0
  45. package/PickersTextField/PickersInput/PickersInput.js +196 -0
  46. package/{internals/components → PickersTextField}/PickersInput/index.d.ts +2 -2
  47. package/PickersTextField/PickersInput/index.js +2 -0
  48. package/PickersTextField/PickersInput/pickersInputClasses.d.ts +22 -0
  49. package/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  50. package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +16 -0
  51. package/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -28
  52. package/{internals/components/PickersInput/PickersInput.types.d.ts → PickersTextField/PickersInputBase/PickersInputBase.types.d.ts} +3 -13
  53. package/PickersTextField/PickersInputBase/index.d.ts +4 -0
  54. package/PickersTextField/PickersInputBase/index.js +2 -0
  55. package/PickersTextField/PickersInputBase/pickersInputBaseClasses.d.ts +31 -0
  56. package/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  57. package/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.d.ts +3 -0
  58. package/{modern/internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  59. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +10 -0
  60. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
  61. package/PickersTextField/PickersOutlinedInput/index.d.ts +4 -0
  62. package/PickersTextField/PickersOutlinedInput/index.js +2 -0
  63. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +22 -0
  64. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  65. package/PickersTextField/PickersTextField.d.ts +3 -0
  66. package/PickersTextField/PickersTextField.js +258 -0
  67. package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.d.ts +5 -2
  68. package/PickersTextField/index.d.ts +8 -0
  69. package/PickersTextField/index.js +6 -0
  70. package/PickersTextField/package.json +6 -0
  71. package/README.md +1 -1
  72. package/StaticDatePicker/StaticDatePicker.js +0 -3
  73. package/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  74. package/StaticTimePicker/StaticTimePicker.js +0 -3
  75. package/TimeClock/TimeClock.js +1 -0
  76. package/TimeClock/TimeClock.types.d.ts +5 -0
  77. package/TimePicker/TimePicker.js +0 -3
  78. package/TimePicker/TimePickerToolbar.js +0 -3
  79. package/YearCalendar/YearCalendar.js +0 -3
  80. package/YearCalendar/YearCalendar.types.d.ts +0 -3
  81. package/hooks/useClearableField.js +3 -3
  82. package/index.d.ts +2 -1
  83. package/index.js +3 -2
  84. package/internals/hooks/useField/useField.js +6 -4
  85. package/internals/hooks/useField/useField.types.d.ts +4 -2
  86. package/internals/hooks/useField/useField.utils.d.ts +19 -9
  87. package/internals/hooks/useField/useField.utils.js +73 -26
  88. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
  89. package/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  90. package/internals/hooks/useField/useFieldState.d.ts +1 -0
  91. package/internals/hooks/useField/useFieldState.js +9 -7
  92. package/internals/hooks/usePicker/index.d.ts +1 -1
  93. package/internals/hooks/usePicker/usePickerValue.js +2 -2
  94. package/internals/hooks/useUtils.js +2 -2
  95. package/internals/hooks/useViews.js +2 -2
  96. package/internals/index.d.ts +9 -3
  97. package/internals/index.js +6 -2
  98. package/internals/models/common.d.ts +1 -1
  99. package/internals/models/helpers.d.ts +1 -0
  100. package/internals/models/props/basePickerProps.d.ts +0 -3
  101. package/internals/models/props/toolbar.d.ts +0 -3
  102. package/internals/utils/valueManagers.js +2 -2
  103. package/internals/utils/views.js +1 -1
  104. package/legacy/AdapterDateFns/AdapterDateFns.js +222 -458
  105. package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +293 -0
  106. package/legacy/AdapterDateFnsBase/index.js +1 -0
  107. package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +306 -0
  108. package/legacy/AdapterDateFnsV3/index.js +1 -0
  109. package/legacy/AdapterLuxon/AdapterLuxon.js +4 -12
  110. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
  111. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
  112. package/legacy/DatePicker/DatePicker.js +0 -3
  113. package/legacy/DatePicker/DatePickerToolbar.js +2 -10
  114. package/legacy/DateTimePicker/DateTimePicker.js +0 -3
  115. package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -3
  116. package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -3
  117. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  118. package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -3
  119. package/legacy/DigitalClock/DigitalClock.js +1 -0
  120. package/legacy/LocalizationProvider/LocalizationProvider.js +1 -1
  121. package/legacy/MobileDatePicker/MobileDatePicker.js +0 -3
  122. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  123. package/legacy/MobileTimePicker/MobileTimePicker.js +0 -3
  124. package/legacy/MonthCalendar/MonthCalendar.js +0 -3
  125. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  126. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  127. package/legacy/PickersSectionList/PickersSectionList.js +7 -2
  128. package/legacy/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +99 -26
  129. package/legacy/PickersTextField/PickersFilledInput/index.js +2 -0
  130. package/legacy/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  131. package/legacy/PickersTextField/PickersInput/PickersInput.js +190 -0
  132. package/legacy/PickersTextField/PickersInput/index.js +2 -0
  133. package/legacy/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  134. package/legacy/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -28
  135. package/legacy/PickersTextField/PickersInputBase/index.js +2 -0
  136. package/legacy/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  137. package/legacy/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +7 -1
  138. package/legacy/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +183 -0
  139. package/legacy/PickersTextField/PickersOutlinedInput/index.js +2 -0
  140. package/legacy/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  141. package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -8
  142. package/legacy/PickersTextField/index.js +6 -0
  143. package/legacy/StaticDatePicker/StaticDatePicker.js +0 -3
  144. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  145. package/legacy/StaticTimePicker/StaticTimePicker.js +0 -3
  146. package/legacy/TimeClock/TimeClock.js +1 -0
  147. package/legacy/TimePicker/TimePicker.js +0 -3
  148. package/legacy/TimePicker/TimePickerToolbar.js +0 -3
  149. package/legacy/YearCalendar/YearCalendar.js +0 -3
  150. package/legacy/hooks/useClearableField.js +3 -3
  151. package/legacy/index.js +3 -2
  152. package/legacy/internals/hooks/useField/useField.js +6 -4
  153. package/legacy/internals/hooks/useField/useField.utils.js +76 -25
  154. package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  155. package/legacy/internals/hooks/useField/useFieldState.js +15 -11
  156. package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -2
  157. package/legacy/internals/hooks/useUtils.js +2 -2
  158. package/legacy/internals/hooks/useViews.js +2 -2
  159. package/legacy/internals/index.js +6 -2
  160. package/legacy/internals/utils/valueManagers.js +2 -2
  161. package/legacy/internals/utils/views.js +1 -1
  162. package/legacy/locales/index.js +1 -0
  163. package/locales/enUS.d.ts +1 -1
  164. package/locales/index.d.ts +1 -0
  165. package/locales/index.js +1 -0
  166. package/locales/mk.d.ts +1 -1
  167. package/locales/utils/getPickersLocalization.d.ts +1 -1
  168. package/modern/AdapterDateFns/AdapterDateFns.js +11 -254
  169. package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +290 -0
  170. package/modern/AdapterDateFnsBase/index.js +1 -0
  171. package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
  172. package/modern/AdapterDateFnsV3/index.js +1 -0
  173. package/modern/AdapterLuxon/AdapterLuxon.js +3 -11
  174. package/modern/DatePicker/DatePicker.js +0 -3
  175. package/modern/DatePicker/DatePickerToolbar.js +2 -10
  176. package/modern/DateTimePicker/DateTimePicker.js +0 -3
  177. package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -3
  178. package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -3
  179. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  180. package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -3
  181. package/modern/DigitalClock/DigitalClock.js +1 -0
  182. package/modern/LocalizationProvider/LocalizationProvider.js +1 -1
  183. package/modern/MobileDatePicker/MobileDatePicker.js +0 -3
  184. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  185. package/modern/MobileTimePicker/MobileTimePicker.js +0 -3
  186. package/modern/MonthCalendar/MonthCalendar.js +0 -3
  187. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  188. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  189. package/modern/PickersSectionList/PickersSectionList.js +7 -2
  190. package/modern/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
  191. package/modern/PickersTextField/PickersFilledInput/index.js +2 -0
  192. package/modern/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  193. package/modern/PickersTextField/PickersInput/PickersInput.js +196 -0
  194. package/modern/PickersTextField/PickersInput/index.js +2 -0
  195. package/modern/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  196. package/modern/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -28
  197. package/modern/PickersTextField/PickersInputBase/index.js +2 -0
  198. package/modern/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  199. package/{internals/components/PickersInput → modern/PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  200. package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
  201. package/modern/PickersTextField/PickersOutlinedInput/index.js +2 -0
  202. package/modern/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  203. package/modern/PickersTextField/PickersTextField.js +258 -0
  204. package/modern/PickersTextField/index.js +6 -0
  205. package/modern/StaticDatePicker/StaticDatePicker.js +0 -3
  206. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  207. package/modern/StaticTimePicker/StaticTimePicker.js +0 -3
  208. package/modern/TimeClock/TimeClock.js +1 -0
  209. package/modern/TimePicker/TimePicker.js +0 -3
  210. package/modern/TimePicker/TimePickerToolbar.js +0 -3
  211. package/modern/YearCalendar/YearCalendar.js +0 -3
  212. package/modern/hooks/useClearableField.js +3 -3
  213. package/modern/index.js +3 -2
  214. package/modern/internals/hooks/useField/useField.js +5 -3
  215. package/modern/internals/hooks/useField/useField.utils.js +73 -26
  216. package/modern/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  217. package/modern/internals/hooks/useField/useFieldState.js +9 -7
  218. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -2
  219. package/modern/internals/hooks/useUtils.js +2 -2
  220. package/modern/internals/hooks/useViews.js +2 -2
  221. package/modern/internals/index.js +6 -2
  222. package/modern/internals/utils/valueManagers.js +2 -2
  223. package/modern/internals/utils/views.js +1 -1
  224. package/modern/locales/index.js +1 -0
  225. package/node/AdapterDateFns/AdapterDateFns.js +11 -254
  226. package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +298 -0
  227. package/node/AdapterDateFnsBase/index.js +12 -0
  228. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +295 -0
  229. package/node/AdapterDateFnsV3/index.js +12 -0
  230. package/node/AdapterLuxon/AdapterLuxon.js +3 -11
  231. package/node/DatePicker/DatePicker.js +0 -3
  232. package/node/DatePicker/DatePickerToolbar.js +0 -7
  233. package/node/DateTimePicker/DateTimePicker.js +0 -3
  234. package/node/DateTimePicker/DateTimePickerToolbar.js +0 -3
  235. package/node/DesktopDatePicker/DesktopDatePicker.js +0 -3
  236. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  237. package/node/DesktopTimePicker/DesktopTimePicker.js +0 -3
  238. package/node/DigitalClock/DigitalClock.js +1 -0
  239. package/node/LocalizationProvider/LocalizationProvider.js +1 -1
  240. package/node/MobileDatePicker/MobileDatePicker.js +0 -3
  241. package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  242. package/node/MobileTimePicker/MobileTimePicker.js +0 -3
  243. package/node/MonthCalendar/MonthCalendar.js +0 -3
  244. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  245. package/node/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  246. package/node/PickersSectionList/PickersSectionList.js +7 -2
  247. package/node/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +102 -30
  248. package/node/PickersTextField/PickersFilledInput/index.js +25 -0
  249. package/node/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +16 -0
  250. package/node/PickersTextField/PickersInput/PickersInput.js +204 -0
  251. package/node/{internals/components → PickersTextField}/PickersInput/index.js +0 -7
  252. package/node/PickersTextField/PickersInput/pickersInputClasses.js +16 -0
  253. package/node/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +105 -28
  254. package/node/PickersTextField/PickersInputBase/index.js +25 -0
  255. package/node/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +14 -0
  256. package/node/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  257. package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +197 -0
  258. package/node/PickersTextField/PickersOutlinedInput/index.js +25 -0
  259. package/node/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +16 -0
  260. package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -9
  261. package/node/PickersTextField/index.js +78 -0
  262. package/node/StaticDatePicker/StaticDatePicker.js +0 -3
  263. package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  264. package/node/StaticTimePicker/StaticTimePicker.js +0 -3
  265. package/node/TimeClock/TimeClock.js +1 -0
  266. package/node/TimePicker/TimePicker.js +0 -3
  267. package/node/TimePicker/TimePickerToolbar.js +0 -3
  268. package/node/YearCalendar/YearCalendar.js +0 -3
  269. package/node/hooks/useClearableField.js +3 -3
  270. package/node/index.js +17 -5
  271. package/node/internals/hooks/useField/useField.js +5 -3
  272. package/node/internals/hooks/useField/useField.utils.js +78 -27
  273. package/node/internals/hooks/useField/useFieldCharacterEditing.js +11 -7
  274. package/node/internals/hooks/useField/useFieldState.js +8 -6
  275. package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
  276. package/node/internals/hooks/useUtils.js +2 -2
  277. package/node/internals/hooks/useViews.js +2 -2
  278. package/node/internals/index.js +47 -1
  279. package/node/internals/utils/valueManagers.js +2 -2
  280. package/node/internals/utils/views.js +1 -1
  281. package/node/locales/index.js +11 -0
  282. package/package.json +8 -8
  283. package/themeAugmentation/components.d.ts +26 -0
  284. package/themeAugmentation/overrides.d.ts +16 -0
  285. package/themeAugmentation/props.d.ts +16 -0
  286. package/internals/components/PickersInput/PickersFilledInput.d.ts +0 -3
  287. package/internals/components/PickersInput/PickersInput.d.ts +0 -15
  288. package/internals/components/PickersInput/PickersOutlinedInput.d.ts +0 -3
  289. package/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
  290. package/internals/components/PickersInput/PickersStandardInput.d.ts +0 -3
  291. package/internals/components/PickersInput/PickersStandardInput.js +0 -123
  292. package/internals/components/PickersInput/index.js +0 -3
  293. package/internals/components/PickersInput/pickersInputClasses.d.ts +0 -84
  294. package/internals/components/PickersInput/pickersInputClasses.js +0 -18
  295. package/internals/components/PickersTextField/PickersTextField.d.ts +0 -2
  296. package/internals/components/PickersTextField/PickersTextField.js +0 -138
  297. package/internals/components/PickersTextField/index.d.ts +0 -1
  298. package/internals/components/PickersTextField/index.js +0 -1
  299. package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +0 -110
  300. package/legacy/internals/components/PickersInput/PickersStandardInput.js +0 -117
  301. package/legacy/internals/components/PickersInput/index.js +0 -3
  302. package/legacy/internals/components/PickersInput/pickersInputClasses.js +0 -18
  303. package/legacy/internals/components/PickersTextField/index.js +0 -1
  304. package/modern/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
  305. package/modern/internals/components/PickersInput/PickersStandardInput.js +0 -123
  306. package/modern/internals/components/PickersInput/index.js +0 -3
  307. package/modern/internals/components/PickersInput/pickersInputClasses.js +0 -18
  308. package/modern/internals/components/PickersTextField/PickersTextField.js +0 -138
  309. package/modern/internals/components/PickersTextField/index.js +0 -1
  310. package/node/internals/components/PickersInput/PickersOutlinedInput.js +0 -125
  311. package/node/internals/components/PickersInput/PickersStandardInput.js +0 -132
  312. package/node/internals/components/PickersInput/pickersInputClasses.js +0 -29
  313. package/node/internals/components/PickersTextField/index.js +0 -12
  314. /package/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  315. /package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  316. /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.d.ts +0 -0
  317. /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  318. /package/legacy/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  319. /package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  320. /package/legacy/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  321. /package/modern/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  322. /package/modern/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  323. /package/modern/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  324. /package/node/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  325. /package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  326. /package/node/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
@@ -4,13 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.validateSections = exports.splitFormatIntoSections = exports.mergeDateIntoReferenceDate = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForInputFromSections = exports.cleanString = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.adjustSectionValue = exports.addPositionPropertiesToSections = void 0;
7
+ exports.validateSections = exports.splitFormatIntoSections = exports.removeLocalizedDigits = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForInputFromSections = exports.cleanString = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = exports.adjustSectionValue = exports.addPositionPropertiesToSections = exports.FORMAT_SECONDS_NO_LEADING_ZEROS = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _dateUtils = require("../../utils/date-utils");
10
10
  const getDateSectionConfigFromFormatToken = (utils, formatToken) => {
11
11
  const config = utils.formatTokenMap[formatToken];
12
12
  if (config == null) {
13
- throw new Error([`MUI: The token "${formatToken}" is not supported by the Date and Time Pickers.`, 'Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.'].join('\n'));
13
+ throw new Error([`MUI X: The token "${formatToken}" is not supported by the Date and Time Pickers.`, 'Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.'].join('\n'));
14
14
  }
15
15
  if (typeof config === 'string') {
16
16
  return {
@@ -74,8 +74,59 @@ const getLetterEditingOptions = (utils, timezone, sectionType, format) => {
74
74
  }
75
75
  }
76
76
  };
77
+
78
+ // This format should be the same on all the adapters
79
+ // If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
77
80
  exports.getLetterEditingOptions = getLetterEditingOptions;
78
- const cleanLeadingZeros = (utils, valueStr, size) => {
81
+ const FORMAT_SECONDS_NO_LEADING_ZEROS = exports.FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
82
+ const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
83
+ const getLocalizedDigits = utils => {
84
+ const today = utils.date(undefined);
85
+ const formattedZero = utils.formatByString(utils.setSeconds(today, 0), FORMAT_SECONDS_NO_LEADING_ZEROS);
86
+ if (formattedZero === '0') {
87
+ return NON_LOCALIZED_DIGITS;
88
+ }
89
+ return Array.from({
90
+ length: 10
91
+ }).map((_, index) => utils.formatByString(utils.setSeconds(today, index), FORMAT_SECONDS_NO_LEADING_ZEROS));
92
+ };
93
+ exports.getLocalizedDigits = getLocalizedDigits;
94
+ const removeLocalizedDigits = (valueStr, localizedDigits) => {
95
+ if (localizedDigits[0] === '0') {
96
+ return valueStr;
97
+ }
98
+ const digits = [];
99
+ let currentFormattedDigit = '';
100
+ for (let i = 0; i < valueStr.length; i += 1) {
101
+ currentFormattedDigit += valueStr[i];
102
+ const matchingDigitIndex = localizedDigits.indexOf(currentFormattedDigit);
103
+ if (matchingDigitIndex > -1) {
104
+ digits.push(matchingDigitIndex.toString());
105
+ currentFormattedDigit = '';
106
+ }
107
+ }
108
+ return digits.join('');
109
+ };
110
+ exports.removeLocalizedDigits = removeLocalizedDigits;
111
+ const applyLocalizedDigits = (valueStr, localizedDigits) => {
112
+ if (localizedDigits[0] === '0') {
113
+ return valueStr;
114
+ }
115
+ return valueStr.split('').map(char => localizedDigits[Number(char)]).join('');
116
+ };
117
+ exports.applyLocalizedDigits = applyLocalizedDigits;
118
+ const isStringNumber = (valueStr, localizedDigits) => {
119
+ const nonLocalizedValueStr = removeLocalizedDigits(valueStr, localizedDigits);
120
+ return !Number.isNaN(Number(nonLocalizedValueStr));
121
+ };
122
+
123
+ /**
124
+ * Remove the leading zeroes to a digit section value.
125
+ * E.g.: `03` => `3`
126
+ * Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
127
+ */
128
+ exports.isStringNumber = isStringNumber;
129
+ const cleanLeadingZeros = (valueStr, size) => {
79
130
  let cleanValueStr = valueStr;
80
131
 
81
132
  // Remove the leading zeros
@@ -88,10 +139,10 @@ const cleanLeadingZeros = (utils, valueStr, size) => {
88
139
  return cleanValueStr;
89
140
  };
90
141
  exports.cleanLeadingZeros = cleanLeadingZeros;
91
- const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries, section) => {
142
+ const cleanDigitSectionValue = (utils, value, sectionBoundaries, localizedDigits, section) => {
92
143
  if (process.env.NODE_ENV !== 'production') {
93
144
  if (section.type !== 'day' && section.contentType === 'digit-with-letter') {
94
- throw new Error([`MUI: The token "${section.format}" is a digit format with letter in it.'
145
+ throw new Error([`MUI X: The token "${section.format}" is a digit format with letter in it.'
95
146
  This type of format is only supported for 'day' sections`].join('\n'));
96
147
  }
97
148
  }
@@ -101,14 +152,14 @@ const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries, secti
101
152
  }
102
153
 
103
154
  // queryValue without leading `0` (`01` => `1`)
104
- const valueStr = value.toString();
155
+ let valueStr = value.toString();
105
156
  if (section.hasLeadingZerosInInput) {
106
- return cleanLeadingZeros(utils, valueStr, section.maxLength);
157
+ valueStr = cleanLeadingZeros(valueStr, section.maxLength);
107
158
  }
108
- return valueStr;
159
+ return applyLocalizedDigits(valueStr, localizedDigits);
109
160
  };
110
161
  exports.cleanDigitSectionValue = cleanDigitSectionValue;
111
- const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, activeDate, stepsAttributes) => {
162
+ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) => {
112
163
  const delta = getDeltaFromKeyCode(keyCode);
113
164
  const isStart = keyCode === 'Home';
114
165
  const isEnd = keyCode === 'End';
@@ -119,9 +170,9 @@ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoun
119
170
  format: section.format,
120
171
  contentType: section.contentType
121
172
  });
122
- const getCleanValue = value => cleanDigitSectionValue(utils, timezone, value, sectionBoundaries, section);
173
+ const getCleanValue = value => cleanDigitSectionValue(utils, value, sectionBoundaries, localizedDigits, section);
123
174
  const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;
124
- const currentSectionValue = parseInt(section.value, 10);
175
+ const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);
125
176
  let newSectionValueNumber = currentSectionValue + delta * step;
126
177
  if (shouldSetAbsolute) {
127
178
  if (section.type === 'year' && !isEnd && !isStart) {
@@ -170,11 +221,11 @@ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoun
170
221
  return adjustLetterSection();
171
222
  };
172
223
  exports.adjustSectionValue = adjustSectionValue;
173
- const getSectionVisibleValue = (section, target) => {
224
+ const getSectionVisibleValue = (section, target, localizedDigits) => {
174
225
  let value = section.value || section.placeholder;
175
226
  const hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;
176
227
  if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {
177
- value = Number(value).toString();
228
+ value = Number(removeLocalizedDigits(value, localizedDigits)).toString();
178
229
  }
179
230
 
180
231
  // In the input, we add an empty character at the end of each section without leading zeros.
@@ -194,13 +245,13 @@ const getSectionVisibleValue = (section, target) => {
194
245
  exports.getSectionVisibleValue = getSectionVisibleValue;
195
246
  const cleanString = dirtyString => dirtyString.replace(/[\u2066\u2067\u2068\u2069]/g, '');
196
247
  exports.cleanString = cleanString;
197
- const addPositionPropertiesToSections = (sections, isRTL) => {
248
+ const addPositionPropertiesToSections = (sections, localizedDigits, isRTL) => {
198
249
  let position = 0;
199
250
  let positionInInput = isRTL ? 1 : 0;
200
251
  const newSections = [];
201
252
  for (let i = 0; i < sections.length; i += 1) {
202
253
  const section = sections[i];
203
- const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
254
+ const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
204
255
  const sectionStr = `${section.startSeparator}${renderedValue}${section.endSeparator}`;
205
256
  const sectionLength = cleanString(sectionStr).length;
206
257
  const sectionLengthInInput = sectionStr.length;
@@ -355,7 +406,7 @@ const getEscapedPartsFromFormat = (utils, format) => {
355
406
  }
356
407
  return escapedParts;
357
408
  };
358
- const splitFormatIntoSections = (utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
409
+ const splitFormatIntoSections = (utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
359
410
  let startSeparator = '';
360
411
  const sections = [];
361
412
  const now = utils.date();
@@ -374,11 +425,11 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
374
425
  maxLength = sectionValue === '' ? utils.formatByString(now, token).length : sectionValue.length;
375
426
  } else {
376
427
  if (sectionConfig.maxLength == null) {
377
- throw new Error(`MUI: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);
428
+ throw new Error(`MUI X: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);
378
429
  }
379
430
  maxLength = sectionConfig.maxLength;
380
431
  if (isValidDate) {
381
- sectionValue = cleanLeadingZeros(utils, sectionValue, maxLength);
432
+ sectionValue = applyLocalizedDigits(cleanLeadingZeros(removeLocalizedDigits(sectionValue, localizedDigits), maxLength), localizedDigits);
382
433
  }
383
434
  }
384
435
  }
@@ -405,7 +456,7 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
405
456
  nextFormat = utils.expandFormat(prevFormat);
406
457
  formatExpansionOverflow -= 1;
407
458
  if (formatExpansionOverflow < 0) {
408
- throw new Error('MUI: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component');
459
+ throw new Error('MUI X: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component.');
409
460
  }
410
461
  }
411
462
  const expandedFormat = nextFormat;
@@ -480,7 +531,7 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
480
531
  * To make sure that the parsing works, we are building a format and a date without any separator.
481
532
  */
482
533
  exports.splitFormatIntoSections = splitFormatIntoSections;
483
- const getDateFromDateSections = (utils, sections) => {
534
+ const getDateFromDateSections = (utils, sections, localizedDigits) => {
484
535
  // If we have both a day and a weekDay section,
485
536
  // Then we skip the weekDay in the parsing because libraries like dayjs can't parse complicated formats containing a weekDay.
486
537
  // dayjs(dayjs().format('dddd MMMM D YYYY'), 'dddd MMMM D YYYY')) // returns `Invalid Date` even if the format is valid.
@@ -492,7 +543,7 @@ const getDateFromDateSections = (utils, sections) => {
492
543
  const shouldSkip = shouldSkipWeekDays && section.type === 'weekDay';
493
544
  if (!shouldSkip) {
494
545
  sectionFormats.push(section.format);
495
- sectionValues.push(getSectionVisibleValue(section, 'non-input'));
546
+ sectionValues.push(getSectionVisibleValue(section, 'non-input', localizedDigits));
496
547
  }
497
548
  }
498
549
  const formatWithoutSeparator = sectionFormats.join(' ');
@@ -500,9 +551,9 @@ const getDateFromDateSections = (utils, sections) => {
500
551
  return utils.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
501
552
  };
502
553
  exports.getDateFromDateSections = getDateFromDateSections;
503
- const createDateStrForInputFromSections = (sections, isRTL) => {
554
+ const createDateStrForInputFromSections = (sections, localizedDigits, isRTL) => {
504
555
  const formattedSections = sections.map(section => {
505
- const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
556
+ const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
506
557
  return `${section.startSeparator}${dateValue}${section.endSeparator}`;
507
558
  });
508
559
  const dateStr = formattedSections.join('');
@@ -518,7 +569,7 @@ const createDateStrForInputFromSections = (sections, isRTL) => {
518
569
  return `\u2066${dateStr}\u2069`;
519
570
  };
520
571
  exports.createDateStrForInputFromSections = createDateStrForInputFromSections;
521
- const getSectionsBoundaries = (utils, timezone) => {
572
+ const getSectionsBoundaries = (utils, localizedDigits, timezone) => {
522
573
  const today = utils.date(undefined, timezone);
523
574
  const endOfYear = utils.endOfYear(today);
524
575
  const endOfDay = utils.endOfDay(today);
@@ -577,11 +628,11 @@ const getSectionsBoundaries = (utils, timezone) => {
577
628
  format
578
629
  }) => {
579
630
  const lastHourInDay = utils.getHours(endOfDay);
580
- const hasMeridiem = utils.formatByString(utils.endOfDay(today), format) !== lastHourInDay.toString();
631
+ const hasMeridiem = removeLocalizedDigits(utils.formatByString(utils.endOfDay(today), format), localizedDigits) !== lastHourInDay.toString();
581
632
  if (hasMeridiem) {
582
633
  return {
583
634
  minimum: 1,
584
- maximum: Number(utils.formatByString(utils.startOfDay(today), format))
635
+ maximum: Number(removeLocalizedDigits(utils.formatByString(utils.startOfDay(today), format), localizedDigits))
585
636
  };
586
637
  }
587
638
  return {
@@ -623,7 +674,7 @@ const validateSections = (sections, valueType) => {
623
674
  }
624
675
  const invalidSection = sections.find(section => !supportedSections.includes(section.type));
625
676
  if (invalidSection) {
626
- console.warn(`MUI: The field component you are using is not compatible with the "${invalidSection.type}" date section.`, `The supported date sections are ["${supportedSections.join('", "')}"]\`.`);
677
+ console.warn(`MUI X: The field component you are using is not compatible with the "${invalidSection.type}" date section.`, `The supported date sections are ["${supportedSections.join('", "')}"]\`.`);
627
678
  warnedOnceInvalidSection = true;
628
679
  }
629
680
  }
@@ -48,6 +48,7 @@ const useFieldCharacterEditing = ({
48
48
  sections,
49
49
  updateSectionValue,
50
50
  sectionsValueBoundaries,
51
+ localizedDigits,
51
52
  setTempAndroidValueStr,
52
53
  timezone
53
54
  }) => {
@@ -76,7 +77,7 @@ const useFieldCharacterEditing = ({
76
77
  const activeSection = sections[sectionIndex];
77
78
 
78
79
  // The current query targets the section being editing
79
- // We can try to concatenated value
80
+ // We can try to concatenate the value
80
81
  if (query != null && (!isValidQueryValue || isValidQueryValue(query.value)) && query.sectionIndex === sectionIndex) {
81
82
  const concatenatedQueryValue = `${query.value}${cleanKeyPressed}`;
82
83
  const queryResponse = getFirstSectionValueMatchingWithQuery(concatenatedQueryValue, activeSection);
@@ -170,7 +171,8 @@ const useFieldCharacterEditing = ({
170
171
  };
171
172
  const applyNumericEditing = params => {
172
173
  const getNewSectionValue = (queryValue, section) => {
173
- const queryValueNumber = Number(`${queryValue}`);
174
+ const cleanQueryValue = (0, _useField.removeLocalizedDigits)(queryValue, localizedDigits);
175
+ const queryValueNumber = Number(cleanQueryValue);
174
176
  const sectionBoundaries = sectionsValueBoundaries[section.type]({
175
177
  currentDate: null,
176
178
  format: section.format,
@@ -190,8 +192,8 @@ const useFieldCharacterEditing = ({
190
192
  saveQuery: true
191
193
  };
192
194
  }
193
- const shouldGoToNextSection = Number(`${queryValue}0`) > sectionBoundaries.maximum || queryValue.length === sectionBoundaries.maximum.toString().length;
194
- const newSectionValue = (0, _useField.cleanDigitSectionValue)(utils, timezone, queryValueNumber, sectionBoundaries, section);
195
+ const shouldGoToNextSection = queryValueNumber * 10 > sectionBoundaries.maximum || cleanQueryValue.length === sectionBoundaries.maximum.toString().length;
196
+ const newSectionValue = (0, _useField.cleanDigitSectionValue)(utils, queryValueNumber, sectionBoundaries, localizedDigits, section);
195
197
  return {
196
198
  sectionValue: newSectionValue,
197
199
  shouldGoToNextSection
@@ -239,12 +241,14 @@ const useFieldCharacterEditing = ({
239
241
  saveQuery: false
240
242
  };
241
243
  };
242
- return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => !Number.isNaN(Number(queryValue)));
244
+ return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => (0, _useField.isStringNumber)(queryValue, localizedDigits));
243
245
  };
244
246
  const applyCharacterEditing = (0, _useEventCallback.default)(params => {
245
247
  const activeSection = sections[params.sectionIndex];
246
- const isNumericEditing = !Number.isNaN(Number(params.keyPressed));
247
- const response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
248
+ const isNumericEditing = (0, _useField.isStringNumber)(params.keyPressed, localizedDigits);
249
+ const response = isNumericEditing ? applyNumericEditing((0, _extends2.default)({}, params, {
250
+ keyPressed: (0, _useField.applyLocalizedDigits)(params.keyPressed, localizedDigits)
251
+ })) : applyLetterEditing(params);
248
252
  if (response == null) {
249
253
  setTempAndroidValueStr(null);
250
254
  } else {
@@ -51,9 +51,10 @@ const useFieldState = params => {
51
51
  onChange,
52
52
  valueManager
53
53
  });
54
- const sectionsValueBoundaries = React.useMemo(() => (0, _useField.getSectionsBoundaries)(utils, timezone), [utils, timezone]);
55
- const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, isRTL, date => (0, _useField.splitFormatIntoSections)(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
56
- const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, isRTL]);
54
+ const localizedDigits = React.useMemo(() => (0, _useField.getLocalizedDigits)(utils), [utils]);
55
+ const sectionsValueBoundaries = React.useMemo(() => (0, _useField.getSectionsBoundaries)(utils, localizedDigits, timezone), [utils, localizedDigits, timezone]);
56
+ const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, localizedDigits, isRTL, date => (0, _useField.splitFormatIntoSections)(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, localizedDigits, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
57
+ const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), localizedDigits, isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, localizedDigits, isRTL]);
57
58
  const [state, setState] = React.useState(() => {
58
59
  const sections = getSectionsFromValue(valueFromTheOutside);
59
60
  (0, _useField.validateSections)(sections, valueType);
@@ -151,7 +152,7 @@ const useFieldState = params => {
151
152
  value: newSectionValue,
152
153
  modified: true
153
154
  });
154
- return (0, _useField.addPositionPropertiesToSections)(newSections, isRTL);
155
+ return (0, _useField.addPositionPropertiesToSections)(newSections, localizedDigits, isRTL);
155
156
  };
156
157
  const clearValue = () => {
157
158
  publishValue({
@@ -188,7 +189,7 @@ const useFieldState = params => {
188
189
  if (date == null || !utils.isValid(date)) {
189
190
  return null;
190
191
  }
191
- const sections = (0, _useField.splitFormatIntoSections)(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
192
+ const sections = (0, _useField.splitFormatIntoSections)(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
192
193
  return (0, _useField.mergeDateIntoReferenceDate)(utils, timezone, date, sections, referenceDate, false);
193
194
  };
194
195
  const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
@@ -219,7 +220,7 @@ const useFieldState = params => {
219
220
  const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
220
221
  const newSections = setSectionValue(selectedSectionIndexes.startIndex, newSectionValue);
221
222
  const newActiveDateSections = activeDateManager.getSections(newSections);
222
- const newActiveDate = (0, _useField.getDateFromDateSections)(utils, newActiveDateSections);
223
+ const newActiveDate = (0, _useField.getDateFromDateSections)(utils, newActiveDateSections, localizedDigits);
223
224
  let values;
224
225
  let shouldPublish;
225
226
 
@@ -287,6 +288,7 @@ const useFieldState = params => {
287
288
  updateValueFromValueStr,
288
289
  setTempAndroidValueStr,
289
290
  sectionsValueBoundaries,
291
+ localizedDigits,
290
292
  placeholder,
291
293
  timezone
292
294
  };
@@ -146,12 +146,12 @@ const usePickerValue = ({
146
146
  if (process.env.NODE_ENV !== 'production') {
147
147
  React.useEffect(() => {
148
148
  if (isControlled !== (inValue !== undefined)) {
149
- console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled value of a picker to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled value` + 'for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
149
+ console.error([`MUI X: A component is changing the ${isControlled ? '' : 'un'}controlled value of a picker to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled value` + 'for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
150
150
  }
151
151
  }, [inValue]);
152
152
  React.useEffect(() => {
153
153
  if (!isControlled && defaultValue !== inDefaultValue) {
154
- console.error([`MUI: A component is changing the defaultValue of an uncontrolled picker after being initialized. ` + `To suppress this warning opt to use a controlled value.`].join('\n'));
154
+ console.error([`MUI X: A component is changing the defaultValue of an uncontrolled picker after being initialized. ` + `To suppress this warning opt to use a controlled value.`].join('\n'));
155
155
  }
156
156
  }, [JSON.stringify(defaultValue)]);
157
157
  }
@@ -14,10 +14,10 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
14
14
  const useLocalizationContext = () => {
15
15
  const localization = React.useContext(_LocalizationProvider.MuiPickersAdapterContext);
16
16
  if (localization === null) {
17
- throw new Error(['MUI: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\n'));
17
+ throw new Error(['MUI X: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\n'));
18
18
  }
19
19
  if (localization.utils === null) {
20
- throw new Error(['MUI: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\n'));
20
+ throw new Error(['MUI X: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\n'));
21
21
  }
22
22
  const localeText = React.useMemo(() => (0, _extends2.default)({}, _enUS.DEFAULT_LOCALE, localization.localeText), [localization.localeText]);
23
23
  return React.useMemo(() => (0, _extends2.default)({}, localization, {
@@ -24,11 +24,11 @@ function useViews({
24
24
  if (process.env.NODE_ENV !== 'production') {
25
25
  if (!warnedOnceNotValidView) {
26
26
  if (inView != null && !views.includes(inView)) {
27
- console.warn(`MUI: \`view="${inView}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
27
+ console.warn(`MUI X: \`view="${inView}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
28
28
  warnedOnceNotValidView = true;
29
29
  }
30
30
  if (inView == null && openTo != null && !views.includes(openTo)) {
31
- console.warn(`MUI: \`openTo="${openTo}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
31
+ console.warn(`MUI X: \`openTo="${openTo}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
32
32
  warnedOnceNotValidView = true;
33
33
  }
34
34
  }
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "applyDefaultDate", {
69
69
  return _dateUtils.applyDefaultDate;
70
70
  }
71
71
  });
72
+ Object.defineProperty(exports, "applyDefaultViewProps", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _views.applyDefaultViewProps;
76
+ }
77
+ });
72
78
  Object.defineProperty(exports, "areDatesEqual", {
73
79
  enumerable: true,
74
80
  get: function () {
@@ -111,6 +117,12 @@ Object.defineProperty(exports, "extractValidationProps", {
111
117
  return _extractValidationProps.extractValidationProps;
112
118
  }
113
119
  });
120
+ Object.defineProperty(exports, "formatMeridiem", {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _dateUtils.formatMeridiem;
124
+ }
125
+ });
114
126
  Object.defineProperty(exports, "getActiveElement", {
115
127
  enumerable: true,
116
128
  get: function () {
@@ -129,6 +141,24 @@ Object.defineProperty(exports, "getTodayDate", {
129
141
  return _dateUtils.getTodayDate;
130
142
  }
131
143
  });
144
+ Object.defineProperty(exports, "isDatePickerView", {
145
+ enumerable: true,
146
+ get: function () {
147
+ return _dateUtils.isDatePickerView;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "isTimeView", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _timeUtils.isTimeView;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, "mergeDateAndTime", {
157
+ enumerable: true,
158
+ get: function () {
159
+ return _dateUtils.mergeDateAndTime;
160
+ }
161
+ });
132
162
  Object.defineProperty(exports, "onSpaceOrEnter", {
133
163
  enumerable: true,
134
164
  get: function () {
@@ -171,6 +201,12 @@ Object.defineProperty(exports, "replaceInvalidDateByNull", {
171
201
  return _dateUtils.replaceInvalidDateByNull;
172
202
  }
173
203
  });
204
+ Object.defineProperty(exports, "resolveTimeViewsResponse", {
205
+ enumerable: true,
206
+ get: function () {
207
+ return _dateTimeUtils.resolveTimeViewsResponse;
208
+ }
209
+ });
174
210
  Object.defineProperty(exports, "splitFieldInternalAndForwardedProps", {
175
211
  enumerable: true,
176
212
  get: function () {
@@ -261,6 +297,12 @@ Object.defineProperty(exports, "useValidation", {
261
297
  return _useValidation.useValidation;
262
298
  }
263
299
  });
300
+ Object.defineProperty(exports, "useViews", {
301
+ enumerable: true,
302
+ get: function () {
303
+ return _useViews.useViews;
304
+ }
305
+ });
264
306
  Object.defineProperty(exports, "validateDate", {
265
307
  enumerable: true,
266
308
  get: function () {
@@ -295,10 +337,12 @@ var _useField = require("./hooks/useField");
295
337
  var _usePicker = require("./hooks/usePicker");
296
338
  var _useStaticPicker = require("./hooks/useStaticPicker");
297
339
  var _useUtils = require("./hooks/useUtils");
340
+ var _useViews = require("./hooks/useViews");
298
341
  var _useValidation = require("./hooks/useValidation");
299
342
  var _dateHelpersHooks = require("./hooks/date-helpers-hooks");
300
343
  var _convertFieldResponseIntoMuiTextFieldProps = require("./utils/convertFieldResponseIntoMuiTextFieldProps");
301
344
  var _dateUtils = require("./utils/date-utils");
345
+ var _dateTimeUtils = require("./utils/date-time-utils");
302
346
  var _fields = require("./utils/fields");
303
347
  var _getDefaultReferenceDate = require("./utils/getDefaultReferenceDate");
304
348
  var _utils = require("./utils/utils");
@@ -307,6 +351,8 @@ var _extractValidationProps = require("./utils/validation/extractValidationProps
307
351
  var _validateDate = require("./utils/validation/validateDate");
308
352
  var _validateDateTime = require("./utils/validation/validateDateTime");
309
353
  var _validateTime = require("./utils/validation/validateTime");
354
+ var _views = require("./utils/views");
310
355
  var _warning = require("./utils/warning");
311
356
  var _DayCalendar = require("../DateCalendar/DayCalendar");
312
- var _useCalendarState = require("../DateCalendar/useCalendarState");
357
+ var _useCalendarState = require("../DateCalendar/useCalendarState");
358
+ var _timeUtils = require("./utils/time-utils");
@@ -37,12 +37,12 @@ const singleItemValueManager = exports.singleItemValueManager = {
37
37
  };
38
38
  const singleItemFieldValueManager = exports.singleItemFieldValueManager = {
39
39
  updateReferenceValue: (utils, value, prevReferenceValue) => value == null || !utils.isValid(value) ? prevReferenceValue : value,
40
- getSectionsFromValue: (utils, date, prevSections, isRTL, getSectionsFromDate) => {
40
+ getSectionsFromValue: (utils, date, prevSections, localizedDigits, isRTL, getSectionsFromDate) => {
41
41
  const shouldReUsePrevDateSections = !utils.isValid(date) && !!prevSections;
42
42
  if (shouldReUsePrevDateSections) {
43
43
  return prevSections;
44
44
  }
45
- return (0, _useField.addPositionPropertiesToSections)(getSectionsFromDate(date), isRTL);
45
+ return (0, _useField.addPositionPropertiesToSections)(getSectionsFromDate(date), localizedDigits, isRTL);
46
46
  },
47
47
  getValueStrFromSections: _useField.createDateStrForInputFromSections,
48
48
  getActiveDateManager: (utils, state) => ({
@@ -26,7 +26,7 @@ const applyDefaultViewProps = ({
26
26
  } else if (viewsWithDefault.length > 0) {
27
27
  openToWithDefault = viewsWithDefault[0];
28
28
  } else {
29
- throw new Error('MUI: The `views` prop must contain at least one view');
29
+ throw new Error('MUI X: The `views` prop must contain at least one view.');
30
30
  }
31
31
  return {
32
32
  views: viewsWithDefault,
@@ -36,6 +36,17 @@ Object.keys(_csCZ).forEach(function (key) {
36
36
  }
37
37
  });
38
38
  });
39
+ var _daDK = require("./daDK");
40
+ Object.keys(_daDK).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _daDK[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _daDK[key];
47
+ }
48
+ });
49
+ });
39
50
  var _deDE = require("./deDE");
40
51
  Object.keys(_deDE).forEach(function (key) {
41
52
  if (key === "default" || key === "__esModule") return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "7.0.0-alpha.7",
3
+ "version": "7.0.0-alpha.9",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -34,20 +34,20 @@
34
34
  "directory": "packages/x-date-pickers"
35
35
  },
36
36
  "dependencies": {
37
- "@babel/runtime": "^7.23.7",
38
- "@mui/base": "^5.0.0-beta.29",
39
- "@mui/system": "^5.15.2",
40
- "@mui/utils": "^5.15.2",
37
+ "@babel/runtime": "^7.23.8",
38
+ "@mui/base": "^5.0.0-beta.32",
39
+ "@mui/system": "^5.15.5",
40
+ "@mui/utils": "^5.15.5",
41
41
  "@types/react-transition-group": "^4.4.10",
42
- "clsx": "^2.0.0",
42
+ "clsx": "^2.1.0",
43
43
  "prop-types": "^15.8.1",
44
44
  "react-transition-group": "^4.4.5"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@emotion/react": "^11.9.0",
48
48
  "@emotion/styled": "^11.8.1",
49
- "@mui/material": "^5.8.6",
50
- "date-fns": "^2.25.0",
49
+ "@mui/material": "^5.15.0",
50
+ "date-fns": "^2.25.0 || ^3.2.0",
51
51
  "date-fns-jalali": "^2.13.0-0",
52
52
  "dayjs": "^1.10.7",
53
53
  "luxon": "^3.0.2",
@@ -167,6 +167,32 @@ export interface PickerComponents<Theme = unknown> {
167
167
  MuiStaticDateTimePicker?: {
168
168
  defaultProps?: ComponentsProps['MuiStaticDateTimePicker'];
169
169
  };
170
+
171
+ // PickersTextField
172
+ MuiPickersTextField?: {
173
+ defaultProps?: ComponentsProps['MuiPickersTextField'];
174
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersTextField'];
175
+ };
176
+ MuiPickersInputBase?: {
177
+ defaultProps?: ComponentsProps['MuiPickersInputBase'];
178
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersInputBase'];
179
+ };
180
+ MuiPickersInput?: {
181
+ defaultProps?: ComponentsProps['MuiPickersInput'];
182
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersInput'];
183
+ };
184
+ MuiPickersFilledInput?: {
185
+ defaultProps?: ComponentsProps['MuiPickersFilledInput'];
186
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersFilledInput'];
187
+ };
188
+ MuiPickersOutlinedInput?: {
189
+ defaultProps?: ComponentsProps['MuiPickersOutlinedInput'];
190
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersOutlinedInput'];
191
+ };
192
+ MuiPickersSectionList?: {
193
+ defaultProps?: ComponentsProps['MuiPickersSectionList'];
194
+ styleOverrides?: ComponentsOverrides<Theme>['MuiPickersSectionList'];
195
+ };
170
196
  }
171
197
 
172
198
  declare module '@mui/material/styles' {
@@ -29,6 +29,14 @@ import {
29
29
  MultiSectionDigitalClockClassKey,
30
30
  MultiSectionDigitalClockSectionClassKey,
31
31
  } from '../MultiSectionDigitalClock';
32
+ import {
33
+ PickersTextFieldClassKey,
34
+ PickersInputClassKey,
35
+ PickersOutlinedInputClassKey,
36
+ PickersFilledInputClassKey,
37
+ PickersInputBaseClassKey,
38
+ } from '../PickersTextField';
39
+ import { PickersSectionListClassKey } from '../PickersSectionList';
32
40
 
33
41
  // prettier-ignore
34
42
  export interface PickersComponentNameToClassKey {
@@ -60,6 +68,14 @@ export interface PickersComponentNameToClassKey {
60
68
  MuiTimeClock: TimeClockClassKey;
61
69
  MuiTimePickerToolbar: TimePickerToolbarClassKey;
62
70
  MuiYearCalendar: YearCalendarClassKey;
71
+
72
+ // V7 Picker's TextField
73
+ MuiPickersTextField: PickersTextFieldClassKey;
74
+ MuiPickersInputBase: PickersInputBaseClassKey
75
+ MuiPickersInput: PickersInputClassKey
76
+ MuiPickersFilledInput: PickersFilledInputClassKey
77
+ MuiPickersOutlinedInput: PickersOutlinedInputClassKey
78
+ MuiPickersSectionList: PickersSectionListClassKey
63
79
  }
64
80
 
65
81
  declare module '@mui/material/styles' {