@mui/x-date-pickers 7.0.0-alpha.8 → 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 (240) hide show
  1. package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
  2. package/AdapterLuxon/AdapterLuxon.js +4 -12
  3. package/CHANGELOG.md +379 -2
  4. package/DatePicker/DatePicker.js +0 -3
  5. package/DatePicker/DatePickerToolbar.js +0 -3
  6. package/DateTimePicker/DateTimePicker.js +0 -3
  7. package/DateTimePicker/DateTimePickerToolbar.js +0 -3
  8. package/DesktopDatePicker/DesktopDatePicker.js +0 -3
  9. package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  10. package/DesktopTimePicker/DesktopTimePicker.js +0 -3
  11. package/MobileDatePicker/MobileDatePicker.js +0 -3
  12. package/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  13. package/MobileTimePicker/MobileTimePicker.js +0 -3
  14. package/MonthCalendar/MonthCalendar.js +0 -3
  15. package/MonthCalendar/MonthCalendar.types.d.ts +0 -3
  16. package/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  17. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +0 -3
  18. package/PickersSectionList/PickersSectionList.js +6 -1
  19. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +11 -0
  20. package/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
  21. package/PickersTextField/PickersFilledInput/index.d.ts +4 -0
  22. package/PickersTextField/PickersFilledInput/index.js +2 -0
  23. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +23 -0
  24. package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  25. package/PickersTextField/PickersInput/PickersInput.d.ts +10 -0
  26. package/PickersTextField/PickersInput/PickersInput.js +196 -0
  27. package/{internals/components → PickersTextField}/PickersInput/index.d.ts +2 -2
  28. package/PickersTextField/PickersInput/index.js +2 -0
  29. package/PickersTextField/PickersInput/pickersInputClasses.d.ts +22 -0
  30. package/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  31. package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +16 -0
  32. package/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
  33. package/{internals/components/PickersInput/PickersInput.types.d.ts → PickersTextField/PickersInputBase/PickersInputBase.types.d.ts} +3 -13
  34. package/PickersTextField/PickersInputBase/index.d.ts +4 -0
  35. package/PickersTextField/PickersInputBase/index.js +2 -0
  36. package/PickersTextField/PickersInputBase/pickersInputBaseClasses.d.ts +31 -0
  37. package/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  38. package/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.d.ts +3 -0
  39. package/{modern/internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  40. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +10 -0
  41. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
  42. package/PickersTextField/PickersOutlinedInput/index.d.ts +4 -0
  43. package/PickersTextField/PickersOutlinedInput/index.js +2 -0
  44. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +22 -0
  45. package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  46. package/PickersTextField/PickersTextField.d.ts +3 -0
  47. package/PickersTextField/PickersTextField.js +258 -0
  48. package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.d.ts +5 -2
  49. package/PickersTextField/index.d.ts +8 -0
  50. package/PickersTextField/index.js +6 -0
  51. package/PickersTextField/package.json +6 -0
  52. package/README.md +1 -1
  53. package/StaticDatePicker/StaticDatePicker.js +0 -3
  54. package/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  55. package/StaticTimePicker/StaticTimePicker.js +0 -3
  56. package/TimePicker/TimePicker.js +0 -3
  57. package/TimePicker/TimePickerToolbar.js +0 -3
  58. package/YearCalendar/YearCalendar.js +0 -3
  59. package/YearCalendar/YearCalendar.types.d.ts +0 -3
  60. package/index.d.ts +2 -1
  61. package/index.js +3 -2
  62. package/internals/hooks/useField/useField.js +6 -4
  63. package/internals/hooks/useField/useField.types.d.ts +4 -2
  64. package/internals/hooks/useField/useField.utils.d.ts +19 -9
  65. package/internals/hooks/useField/useField.utils.js +68 -21
  66. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
  67. package/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  68. package/internals/hooks/useField/useFieldState.d.ts +1 -0
  69. package/internals/hooks/useField/useFieldState.js +9 -7
  70. package/internals/models/props/basePickerProps.d.ts +0 -3
  71. package/internals/models/props/toolbar.d.ts +0 -3
  72. package/internals/utils/valueManagers.js +2 -2
  73. package/legacy/AdapterLuxon/AdapterLuxon.js +4 -12
  74. package/legacy/DatePicker/DatePicker.js +0 -3
  75. package/legacy/DatePicker/DatePickerToolbar.js +0 -3
  76. package/legacy/DateTimePicker/DateTimePicker.js +0 -3
  77. package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -3
  78. package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -3
  79. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  80. package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -3
  81. package/legacy/MobileDatePicker/MobileDatePicker.js +0 -3
  82. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  83. package/legacy/MobileTimePicker/MobileTimePicker.js +0 -3
  84. package/legacy/MonthCalendar/MonthCalendar.js +0 -3
  85. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  86. package/legacy/PickersSectionList/PickersSectionList.js +6 -1
  87. package/legacy/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +99 -26
  88. package/legacy/PickersTextField/PickersFilledInput/index.js +2 -0
  89. package/legacy/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  90. package/legacy/PickersTextField/PickersInput/PickersInput.js +190 -0
  91. package/legacy/PickersTextField/PickersInput/index.js +2 -0
  92. package/legacy/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  93. package/legacy/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
  94. package/legacy/PickersTextField/PickersInputBase/index.js +2 -0
  95. package/legacy/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  96. package/legacy/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +7 -1
  97. package/legacy/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +183 -0
  98. package/legacy/PickersTextField/PickersOutlinedInput/index.js +2 -0
  99. package/legacy/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  100. package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -8
  101. package/legacy/PickersTextField/index.js +6 -0
  102. package/legacy/StaticDatePicker/StaticDatePicker.js +0 -3
  103. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  104. package/legacy/StaticTimePicker/StaticTimePicker.js +0 -3
  105. package/legacy/TimePicker/TimePicker.js +0 -3
  106. package/legacy/TimePicker/TimePickerToolbar.js +0 -3
  107. package/legacy/YearCalendar/YearCalendar.js +0 -3
  108. package/legacy/index.js +3 -2
  109. package/legacy/internals/hooks/useField/useField.js +6 -4
  110. package/legacy/internals/hooks/useField/useField.utils.js +71 -20
  111. package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  112. package/legacy/internals/hooks/useField/useFieldState.js +15 -11
  113. package/legacy/internals/utils/valueManagers.js +2 -2
  114. package/modern/AdapterLuxon/AdapterLuxon.js +3 -11
  115. package/modern/DatePicker/DatePicker.js +0 -3
  116. package/modern/DatePicker/DatePickerToolbar.js +0 -3
  117. package/modern/DateTimePicker/DateTimePicker.js +0 -3
  118. package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -3
  119. package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -3
  120. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  121. package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -3
  122. package/modern/MobileDatePicker/MobileDatePicker.js +0 -3
  123. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  124. package/modern/MobileTimePicker/MobileTimePicker.js +0 -3
  125. package/modern/MonthCalendar/MonthCalendar.js +0 -3
  126. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  127. package/modern/PickersSectionList/PickersSectionList.js +6 -1
  128. package/modern/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
  129. package/modern/PickersTextField/PickersFilledInput/index.js +2 -0
  130. package/modern/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
  131. package/modern/PickersTextField/PickersInput/PickersInput.js +196 -0
  132. package/modern/PickersTextField/PickersInput/index.js +2 -0
  133. package/modern/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
  134. package/modern/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
  135. package/modern/PickersTextField/PickersInputBase/index.js +2 -0
  136. package/modern/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
  137. package/{internals/components/PickersInput → modern/PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  138. package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
  139. package/modern/PickersTextField/PickersOutlinedInput/index.js +2 -0
  140. package/modern/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
  141. package/modern/PickersTextField/PickersTextField.js +258 -0
  142. package/modern/PickersTextField/index.js +6 -0
  143. package/modern/StaticDatePicker/StaticDatePicker.js +0 -3
  144. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  145. package/modern/StaticTimePicker/StaticTimePicker.js +0 -3
  146. package/modern/TimePicker/TimePicker.js +0 -3
  147. package/modern/TimePicker/TimePickerToolbar.js +0 -3
  148. package/modern/YearCalendar/YearCalendar.js +0 -3
  149. package/modern/index.js +3 -2
  150. package/modern/internals/hooks/useField/useField.js +5 -3
  151. package/modern/internals/hooks/useField/useField.utils.js +68 -21
  152. package/modern/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
  153. package/modern/internals/hooks/useField/useFieldState.js +9 -7
  154. package/modern/internals/utils/valueManagers.js +2 -2
  155. package/node/AdapterLuxon/AdapterLuxon.js +3 -11
  156. package/node/DatePicker/DatePicker.js +0 -3
  157. package/node/DatePicker/DatePickerToolbar.js +0 -3
  158. package/node/DateTimePicker/DateTimePicker.js +0 -3
  159. package/node/DateTimePicker/DateTimePickerToolbar.js +0 -3
  160. package/node/DesktopDatePicker/DesktopDatePicker.js +0 -3
  161. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
  162. package/node/DesktopTimePicker/DesktopTimePicker.js +0 -3
  163. package/node/MobileDatePicker/MobileDatePicker.js +0 -3
  164. package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
  165. package/node/MobileTimePicker/MobileTimePicker.js +0 -3
  166. package/node/MonthCalendar/MonthCalendar.js +0 -3
  167. package/node/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
  168. package/node/PickersSectionList/PickersSectionList.js +6 -1
  169. package/node/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +102 -30
  170. package/node/PickersTextField/PickersFilledInput/index.js +25 -0
  171. package/node/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +16 -0
  172. package/node/PickersTextField/PickersInput/PickersInput.js +204 -0
  173. package/node/{internals/components → PickersTextField}/PickersInput/index.js +0 -7
  174. package/node/PickersTextField/PickersInput/pickersInputClasses.js +16 -0
  175. package/node/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +105 -27
  176. package/node/PickersTextField/PickersInputBase/index.js +25 -0
  177. package/node/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +14 -0
  178. package/node/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
  179. package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +197 -0
  180. package/node/PickersTextField/PickersOutlinedInput/index.js +25 -0
  181. package/node/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +16 -0
  182. package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -9
  183. package/node/PickersTextField/index.js +78 -0
  184. package/node/StaticDatePicker/StaticDatePicker.js +0 -3
  185. package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
  186. package/node/StaticTimePicker/StaticTimePicker.js +0 -3
  187. package/node/TimePicker/TimePicker.js +0 -3
  188. package/node/TimePicker/TimePickerToolbar.js +0 -3
  189. package/node/YearCalendar/YearCalendar.js +0 -3
  190. package/node/index.js +17 -5
  191. package/node/internals/hooks/useField/useField.js +5 -3
  192. package/node/internals/hooks/useField/useField.utils.js +73 -22
  193. package/node/internals/hooks/useField/useFieldCharacterEditing.js +11 -7
  194. package/node/internals/hooks/useField/useFieldState.js +8 -6
  195. package/node/internals/utils/valueManagers.js +2 -2
  196. package/package.json +7 -7
  197. package/themeAugmentation/components.d.ts +26 -0
  198. package/themeAugmentation/overrides.d.ts +16 -0
  199. package/themeAugmentation/props.d.ts +16 -0
  200. package/internals/components/PickersInput/PickersFilledInput.d.ts +0 -3
  201. package/internals/components/PickersInput/PickersInput.d.ts +0 -13
  202. package/internals/components/PickersInput/PickersOutlinedInput.d.ts +0 -3
  203. package/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
  204. package/internals/components/PickersInput/PickersStandardInput.d.ts +0 -3
  205. package/internals/components/PickersInput/PickersStandardInput.js +0 -123
  206. package/internals/components/PickersInput/index.js +0 -3
  207. package/internals/components/PickersInput/pickersInputClasses.d.ts +0 -84
  208. package/internals/components/PickersInput/pickersInputClasses.js +0 -18
  209. package/internals/components/PickersTextField/PickersTextField.d.ts +0 -2
  210. package/internals/components/PickersTextField/PickersTextField.js +0 -138
  211. package/internals/components/PickersTextField/index.d.ts +0 -1
  212. package/internals/components/PickersTextField/index.js +0 -1
  213. package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +0 -110
  214. package/legacy/internals/components/PickersInput/PickersStandardInput.js +0 -117
  215. package/legacy/internals/components/PickersInput/index.js +0 -3
  216. package/legacy/internals/components/PickersInput/pickersInputClasses.js +0 -18
  217. package/legacy/internals/components/PickersTextField/index.js +0 -1
  218. package/modern/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
  219. package/modern/internals/components/PickersInput/PickersStandardInput.js +0 -123
  220. package/modern/internals/components/PickersInput/index.js +0 -3
  221. package/modern/internals/components/PickersInput/pickersInputClasses.js +0 -18
  222. package/modern/internals/components/PickersTextField/PickersTextField.js +0 -138
  223. package/modern/internals/components/PickersTextField/index.js +0 -1
  224. package/node/internals/components/PickersInput/PickersOutlinedInput.js +0 -125
  225. package/node/internals/components/PickersInput/PickersStandardInput.js +0 -132
  226. package/node/internals/components/PickersInput/pickersInputClasses.js +0 -29
  227. package/node/internals/components/PickersTextField/index.js +0 -12
  228. /package/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  229. /package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  230. /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.d.ts +0 -0
  231. /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  232. /package/legacy/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  233. /package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  234. /package/legacy/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  235. /package/modern/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  236. /package/modern/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  237. /package/modern/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
  238. /package/node/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
  239. /package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
  240. /package/node/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
@@ -65,7 +65,54 @@ export const getLetterEditingOptions = (utils, timezone, sectionType, format) =>
65
65
  }
66
66
  }
67
67
  };
68
- export const cleanLeadingZeros = (utils, valueStr, size) => {
68
+
69
+ // This format should be the same on all the adapters
70
+ // If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
71
+ export const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
72
+ const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
73
+ export const getLocalizedDigits = utils => {
74
+ const today = utils.date(undefined);
75
+ const formattedZero = utils.formatByString(utils.setSeconds(today, 0), FORMAT_SECONDS_NO_LEADING_ZEROS);
76
+ if (formattedZero === '0') {
77
+ return NON_LOCALIZED_DIGITS;
78
+ }
79
+ return Array.from({
80
+ length: 10
81
+ }).map((_, index) => utils.formatByString(utils.setSeconds(today, index), FORMAT_SECONDS_NO_LEADING_ZEROS));
82
+ };
83
+ export const removeLocalizedDigits = (valueStr, localizedDigits) => {
84
+ if (localizedDigits[0] === '0') {
85
+ return valueStr;
86
+ }
87
+ const digits = [];
88
+ let currentFormattedDigit = '';
89
+ for (let i = 0; i < valueStr.length; i += 1) {
90
+ currentFormattedDigit += valueStr[i];
91
+ const matchingDigitIndex = localizedDigits.indexOf(currentFormattedDigit);
92
+ if (matchingDigitIndex > -1) {
93
+ digits.push(matchingDigitIndex.toString());
94
+ currentFormattedDigit = '';
95
+ }
96
+ }
97
+ return digits.join('');
98
+ };
99
+ export const applyLocalizedDigits = (valueStr, localizedDigits) => {
100
+ if (localizedDigits[0] === '0') {
101
+ return valueStr;
102
+ }
103
+ return valueStr.split('').map(char => localizedDigits[Number(char)]).join('');
104
+ };
105
+ export const isStringNumber = (valueStr, localizedDigits) => {
106
+ const nonLocalizedValueStr = removeLocalizedDigits(valueStr, localizedDigits);
107
+ return !Number.isNaN(Number(nonLocalizedValueStr));
108
+ };
109
+
110
+ /**
111
+ * Remove the leading zeroes to a digit section value.
112
+ * E.g.: `03` => `3`
113
+ * Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
114
+ */
115
+ export const cleanLeadingZeros = (valueStr, size) => {
69
116
  let cleanValueStr = valueStr;
70
117
 
71
118
  // Remove the leading zeros
@@ -77,7 +124,7 @@ export const cleanLeadingZeros = (utils, valueStr, size) => {
77
124
  }
78
125
  return cleanValueStr;
79
126
  };
80
- export const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries, section) => {
127
+ export const cleanDigitSectionValue = (utils, value, sectionBoundaries, localizedDigits, section) => {
81
128
  if (process.env.NODE_ENV !== 'production') {
82
129
  if (section.type !== 'day' && section.contentType === 'digit-with-letter') {
83
130
  throw new Error([`MUI X: The token "${section.format}" is a digit format with letter in it.'
@@ -90,13 +137,13 @@ export const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries
90
137
  }
91
138
 
92
139
  // queryValue without leading `0` (`01` => `1`)
93
- const valueStr = value.toString();
140
+ let valueStr = value.toString();
94
141
  if (section.hasLeadingZerosInInput) {
95
- return cleanLeadingZeros(utils, valueStr, section.maxLength);
142
+ valueStr = cleanLeadingZeros(valueStr, section.maxLength);
96
143
  }
97
- return valueStr;
144
+ return applyLocalizedDigits(valueStr, localizedDigits);
98
145
  };
99
- export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, activeDate, stepsAttributes) => {
146
+ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) => {
100
147
  const delta = getDeltaFromKeyCode(keyCode);
101
148
  const isStart = keyCode === 'Home';
102
149
  const isEnd = keyCode === 'End';
@@ -107,9 +154,9 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
107
154
  format: section.format,
108
155
  contentType: section.contentType
109
156
  });
110
- const getCleanValue = value => cleanDigitSectionValue(utils, timezone, value, sectionBoundaries, section);
157
+ const getCleanValue = value => cleanDigitSectionValue(utils, value, sectionBoundaries, localizedDigits, section);
111
158
  const step = section.type === 'minutes' && stepsAttributes != null && stepsAttributes.minutesStep ? stepsAttributes.minutesStep : 1;
112
- const currentSectionValue = parseInt(section.value, 10);
159
+ const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);
113
160
  let newSectionValueNumber = currentSectionValue + delta * step;
114
161
  if (shouldSetAbsolute) {
115
162
  if (section.type === 'year' && !isEnd && !isStart) {
@@ -157,11 +204,11 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
157
204
  }
158
205
  return adjustLetterSection();
159
206
  };
160
- export const getSectionVisibleValue = (section, target) => {
207
+ export const getSectionVisibleValue = (section, target, localizedDigits) => {
161
208
  let value = section.value || section.placeholder;
162
209
  const hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;
163
210
  if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {
164
- value = Number(value).toString();
211
+ value = Number(removeLocalizedDigits(value, localizedDigits)).toString();
165
212
  }
166
213
 
167
214
  // In the input, we add an empty character at the end of each section without leading zeros.
@@ -179,13 +226,13 @@ export const getSectionVisibleValue = (section, target) => {
179
226
  return value;
180
227
  };
181
228
  export const cleanString = dirtyString => dirtyString.replace(/[\u2066\u2067\u2068\u2069]/g, '');
182
- export const addPositionPropertiesToSections = (sections, isRTL) => {
229
+ export const addPositionPropertiesToSections = (sections, localizedDigits, isRTL) => {
183
230
  let position = 0;
184
231
  let positionInInput = isRTL ? 1 : 0;
185
232
  const newSections = [];
186
233
  for (let i = 0; i < sections.length; i += 1) {
187
234
  const section = sections[i];
188
- const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
235
+ const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
189
236
  const sectionStr = `${section.startSeparator}${renderedValue}${section.endSeparator}`;
190
237
  const sectionLength = cleanString(sectionStr).length;
191
238
  const sectionLengthInInput = sectionStr.length;
@@ -337,7 +384,7 @@ const getEscapedPartsFromFormat = (utils, format) => {
337
384
  }
338
385
  return escapedParts;
339
386
  };
340
- export const splitFormatIntoSections = (utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
387
+ export const splitFormatIntoSections = (utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
341
388
  let startSeparator = '';
342
389
  const sections = [];
343
390
  const now = utils.date();
@@ -360,7 +407,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
360
407
  }
361
408
  maxLength = sectionConfig.maxLength;
362
409
  if (isValidDate) {
363
- sectionValue = cleanLeadingZeros(utils, sectionValue, maxLength);
410
+ sectionValue = applyLocalizedDigits(cleanLeadingZeros(removeLocalizedDigits(sectionValue, localizedDigits), maxLength), localizedDigits);
364
411
  }
365
412
  }
366
413
  }
@@ -461,7 +508,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
461
508
  * Some date libraries like `dayjs` don't support parsing from date with escaped characters.
462
509
  * To make sure that the parsing works, we are building a format and a date without any separator.
463
510
  */
464
- export const getDateFromDateSections = (utils, sections) => {
511
+ export const getDateFromDateSections = (utils, sections, localizedDigits) => {
465
512
  // If we have both a day and a weekDay section,
466
513
  // Then we skip the weekDay in the parsing because libraries like dayjs can't parse complicated formats containing a weekDay.
467
514
  // dayjs(dayjs().format('dddd MMMM D YYYY'), 'dddd MMMM D YYYY')) // returns `Invalid Date` even if the format is valid.
@@ -473,16 +520,16 @@ export const getDateFromDateSections = (utils, sections) => {
473
520
  const shouldSkip = shouldSkipWeekDays && section.type === 'weekDay';
474
521
  if (!shouldSkip) {
475
522
  sectionFormats.push(section.format);
476
- sectionValues.push(getSectionVisibleValue(section, 'non-input'));
523
+ sectionValues.push(getSectionVisibleValue(section, 'non-input', localizedDigits));
477
524
  }
478
525
  }
479
526
  const formatWithoutSeparator = sectionFormats.join(' ');
480
527
  const dateWithoutSeparatorStr = sectionValues.join(' ');
481
528
  return utils.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
482
529
  };
483
- export const createDateStrForInputFromSections = (sections, isRTL) => {
530
+ export const createDateStrForInputFromSections = (sections, localizedDigits, isRTL) => {
484
531
  const formattedSections = sections.map(section => {
485
- const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
532
+ const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
486
533
  return `${section.startSeparator}${dateValue}${section.endSeparator}`;
487
534
  });
488
535
  const dateStr = formattedSections.join('');
@@ -497,7 +544,7 @@ export const createDateStrForInputFromSections = (sections, isRTL) => {
497
544
  // wrap into an isolated group such that separators can split the string in smaller ones by adding \u2069\u2068
498
545
  return `\u2066${dateStr}\u2069`;
499
546
  };
500
- export const getSectionsBoundaries = (utils, timezone) => {
547
+ export const getSectionsBoundaries = (utils, localizedDigits, timezone) => {
501
548
  const today = utils.date(undefined, timezone);
502
549
  const endOfYear = utils.endOfYear(today);
503
550
  const endOfDay = utils.endOfDay(today);
@@ -556,11 +603,11 @@ export const getSectionsBoundaries = (utils, timezone) => {
556
603
  format
557
604
  }) => {
558
605
  const lastHourInDay = utils.getHours(endOfDay);
559
- const hasMeridiem = utils.formatByString(utils.endOfDay(today), format) !== lastHourInDay.toString();
606
+ const hasMeridiem = removeLocalizedDigits(utils.formatByString(utils.endOfDay(today), format), localizedDigits) !== lastHourInDay.toString();
560
607
  if (hasMeridiem) {
561
608
  return {
562
609
  minimum: 1,
563
- maximum: Number(utils.formatByString(utils.startOfDay(today), format))
610
+ maximum: Number(removeLocalizedDigits(utils.formatByString(utils.startOfDay(today), format), localizedDigits))
564
611
  };
565
612
  }
566
613
  return {
@@ -9,6 +9,7 @@ interface UseFieldEditingParams<TDate, TSection extends FieldSection> {
9
9
  sections: TSection[];
10
10
  updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
11
11
  sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>;
12
+ localizedDigits: string[];
12
13
  setTempAndroidValueStr: (newValue: string | null) => void;
13
14
  timezone: PickersTimezone;
14
15
  }
@@ -19,7 +20,7 @@ interface UseFieldEditingParams<TDate, TSection extends FieldSection> {
19
20
  * 1. The numeric editing when the user presses a digit
20
21
  * 2. The letter editing when the user presses another key
21
22
  */
22
- export declare const useFieldCharacterEditing: <TDate, TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, setTempAndroidValueStr, timezone, }: UseFieldEditingParams<TDate, TSection>) => {
23
+ export declare const useFieldCharacterEditing: <TDate, TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, localizedDigits, setTempAndroidValueStr, timezone, }: UseFieldEditingParams<TDate, TSection>) => {
23
24
  applyCharacterEditing: (params: ApplyCharacterEditingParams) => void;
24
25
  resetCharacterQuery: () => void;
25
26
  };
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import useEventCallback from '@mui/utils/useEventCallback';
4
4
  import { useUtils } from '../useUtils';
5
- import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions } from './useField.utils';
5
+ import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions, applyLocalizedDigits, removeLocalizedDigits, isStringNumber } from './useField.utils';
6
6
 
7
7
  /**
8
8
  * The letter editing and the numeric editing each define a `CharacterEditingApplier`.
@@ -40,6 +40,7 @@ export const useFieldCharacterEditing = ({
40
40
  sections,
41
41
  updateSectionValue,
42
42
  sectionsValueBoundaries,
43
+ localizedDigits,
43
44
  setTempAndroidValueStr,
44
45
  timezone
45
46
  }) => {
@@ -69,7 +70,7 @@ export const useFieldCharacterEditing = ({
69
70
  const activeSection = sections[sectionIndex];
70
71
 
71
72
  // The current query targets the section being editing
72
- // We can try to concatenated value
73
+ // We can try to concatenate the value
73
74
  if (query != null && (!isValidQueryValue || isValidQueryValue(query.value)) && query.sectionIndex === sectionIndex) {
74
75
  const concatenatedQueryValue = `${query.value}${cleanKeyPressed}`;
75
76
  const queryResponse = getFirstSectionValueMatchingWithQuery(concatenatedQueryValue, activeSection);
@@ -163,7 +164,8 @@ export const useFieldCharacterEditing = ({
163
164
  };
164
165
  const applyNumericEditing = params => {
165
166
  const getNewSectionValue = (queryValue, section) => {
166
- const queryValueNumber = Number(`${queryValue}`);
167
+ const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);
168
+ const queryValueNumber = Number(cleanQueryValue);
167
169
  const sectionBoundaries = sectionsValueBoundaries[section.type]({
168
170
  currentDate: null,
169
171
  format: section.format,
@@ -183,8 +185,8 @@ export const useFieldCharacterEditing = ({
183
185
  saveQuery: true
184
186
  };
185
187
  }
186
- const shouldGoToNextSection = Number(`${queryValue}0`) > sectionBoundaries.maximum || queryValue.length === sectionBoundaries.maximum.toString().length;
187
- const newSectionValue = cleanDigitSectionValue(utils, timezone, queryValueNumber, sectionBoundaries, section);
188
+ const shouldGoToNextSection = queryValueNumber * 10 > sectionBoundaries.maximum || cleanQueryValue.length === sectionBoundaries.maximum.toString().length;
189
+ const newSectionValue = cleanDigitSectionValue(utils, queryValueNumber, sectionBoundaries, localizedDigits, section);
188
190
  return {
189
191
  sectionValue: newSectionValue,
190
192
  shouldGoToNextSection
@@ -232,12 +234,14 @@ export const useFieldCharacterEditing = ({
232
234
  saveQuery: false
233
235
  };
234
236
  };
235
- return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => !Number.isNaN(Number(queryValue)));
237
+ return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => isStringNumber(queryValue, localizedDigits));
236
238
  };
237
239
  const applyCharacterEditing = useEventCallback(params => {
238
240
  const activeSection = sections[params.sectionIndex];
239
- const isNumericEditing = !Number.isNaN(Number(params.keyPressed));
240
- const response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
241
+ const isNumericEditing = isStringNumber(params.keyPressed, localizedDigits);
242
+ const response = isNumericEditing ? applyNumericEditing(_extends({}, params, {
243
+ keyPressed: applyLocalizedDigits(params.keyPressed, localizedDigits)
244
+ })) : applyLetterEditing(params);
241
245
  if (response == null) {
242
246
  setTempAndroidValueStr(null);
243
247
  } else {
@@ -24,6 +24,7 @@ export declare const useFieldState: <TValue, TDate, TSection extends FieldSectio
24
24
  updateValueFromValueStr: (valueStr: string) => void;
25
25
  setTempAndroidValueStr: (tempValueStrAndroid: string | null) => void;
26
26
  sectionsValueBoundaries: import("./useField.types").FieldSectionsValueBoundaries<TDate>;
27
+ localizedDigits: string[];
27
28
  placeholder: string;
28
29
  timezone: string;
29
30
  };
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import useControlled from '@mui/utils/useControlled';
4
4
  import { useTheme } from '@mui/material/styles';
5
5
  import { useUtils, useLocaleText, useLocalizationContext } from '../useUtils';
6
- import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections } from './useField.utils';
6
+ import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, getLocalizedDigits } from './useField.utils';
7
7
  import { useValueWithTimezone } from '../useValueWithTimezone';
8
8
  import { getSectionTypeGranularity } from '../../utils/getDefaultReferenceDate';
9
9
  export const useFieldState = params => {
@@ -42,9 +42,10 @@ export const useFieldState = params => {
42
42
  onChange,
43
43
  valueManager
44
44
  });
45
- const sectionsValueBoundaries = React.useMemo(() => getSectionsBoundaries(utils, timezone), [utils, timezone]);
46
- const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, isRTL, date => splitFormatIntoSections(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
47
- const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, isRTL]);
45
+ const localizedDigits = React.useMemo(() => getLocalizedDigits(utils), [utils]);
46
+ const sectionsValueBoundaries = React.useMemo(() => getSectionsBoundaries(utils, localizedDigits, timezone), [utils, localizedDigits, timezone]);
47
+ const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, localizedDigits, isRTL, date => splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, localizedDigits, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
48
+ const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), localizedDigits, isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, localizedDigits, isRTL]);
48
49
  const [state, setState] = React.useState(() => {
49
50
  const sections = getSectionsFromValue(valueFromTheOutside);
50
51
  validateSections(sections, valueType);
@@ -142,7 +143,7 @@ export const useFieldState = params => {
142
143
  value: newSectionValue,
143
144
  modified: true
144
145
  });
145
- return addPositionPropertiesToSections(newSections, isRTL);
146
+ return addPositionPropertiesToSections(newSections, localizedDigits, isRTL);
146
147
  };
147
148
  const clearValue = () => {
148
149
  publishValue({
@@ -179,7 +180,7 @@ export const useFieldState = params => {
179
180
  if (date == null || !utils.isValid(date)) {
180
181
  return null;
181
182
  }
182
- const sections = splitFormatIntoSections(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
183
+ const sections = splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
183
184
  return mergeDateIntoReferenceDate(utils, timezone, date, sections, referenceDate, false);
184
185
  };
185
186
  const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
@@ -210,7 +211,7 @@ export const useFieldState = params => {
210
211
  const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
211
212
  const newSections = setSectionValue(selectedSectionIndexes.startIndex, newSectionValue);
212
213
  const newActiveDateSections = activeDateManager.getSections(newSections);
213
- const newActiveDate = getDateFromDateSections(utils, newActiveDateSections);
214
+ const newActiveDate = getDateFromDateSections(utils, newActiveDateSections, localizedDigits);
214
215
  let values;
215
216
  let shouldPublish;
216
217
 
@@ -278,6 +279,7 @@ export const useFieldState = params => {
278
279
  updateValueFromValueStr,
279
280
  setTempAndroidValueStr,
280
281
  sectionsValueBoundaries,
282
+ localizedDigits,
281
283
  placeholder,
282
284
  timezone
283
285
  };
@@ -10,9 +10,6 @@ import { DateOrTimeViewWithMeridiem } from '../common';
10
10
  * Props common to all pickers after applying the default props on each picker.
11
11
  */
12
12
  export interface BasePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerBaseProps<TValue, TDate, TView, TError, TExternalProps, TAdditionalProps> {
13
- /**
14
- * Class name applied to the root element.
15
- */
16
13
  className?: string;
17
14
  /**
18
15
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -31,9 +31,6 @@ export interface ExportedBaseToolbarProps {
31
31
  * @default "––"
32
32
  */
33
33
  toolbarPlaceholder?: React.ReactNode;
34
- /**
35
- * className applied to the root component.
36
- */
37
34
  className?: string;
38
35
  /**
39
36
  * If `true`, show the toolbar even in desktop mode.
@@ -30,12 +30,12 @@ export const singleItemValueManager = {
30
30
  };
31
31
  export const singleItemFieldValueManager = {
32
32
  updateReferenceValue: (utils, value, prevReferenceValue) => value == null || !utils.isValid(value) ? prevReferenceValue : value,
33
- getSectionsFromValue: (utils, date, prevSections, isRTL, getSectionsFromDate) => {
33
+ getSectionsFromValue: (utils, date, prevSections, localizedDigits, isRTL, getSectionsFromDate) => {
34
34
  const shouldReUsePrevDateSections = !utils.isValid(date) && !!prevSections;
35
35
  if (shouldReUsePrevDateSections) {
36
36
  return prevSections;
37
37
  }
38
- return addPositionPropertiesToSections(getSectionsFromDate(date), isRTL);
38
+ return addPositionPropertiesToSections(getSectionsFromDate(date), localizedDigits, isRTL);
39
39
  },
40
40
  getValueStrFromSections: createDateStrForInputFromSections,
41
41
  getActiveDateManager: (utils, state) => ({
@@ -348,10 +348,7 @@ export var AdapterLuxon = /*#__PURE__*/_createClass(function AdapterLuxon() {
348
348
  return value.startOf('month');
349
349
  };
350
350
  this.startOfWeek = function (value) {
351
- return value.startOf('week',
352
- // TODO: remove when `@types/luxon` add support for the parameter.
353
- // @ts-ignore
354
- {
351
+ return value.startOf('week', {
355
352
  useLocaleWeeks: true
356
353
  });
357
354
  };
@@ -365,10 +362,7 @@ export var AdapterLuxon = /*#__PURE__*/_createClass(function AdapterLuxon() {
365
362
  return value.endOf('month');
366
363
  };
367
364
  this.endOfWeek = function (value) {
368
- return value.endOf('week',
369
- // TODO: remove when `@types/luxon` add support for the parameter.
370
- // @ts-ignore
371
- {
365
+ return value.endOf('week', {
372
366
  useLocaleWeeks: true
373
367
  });
374
368
  };
@@ -493,10 +487,8 @@ export var AdapterLuxon = /*#__PURE__*/_createClass(function AdapterLuxon() {
493
487
  return weeks;
494
488
  };
495
489
  this.getWeekNumber = function (value) {
496
- var _value$localeWeekNumb;
497
- // TODO: remove when `@types/luxon` add support for the parameter.
498
- // @ts-ignore
499
- return (_value$localeWeekNumb = value.localeWeekNumber) != null ? _value$localeWeekNumb : value.weekNumber;
490
+ var _value$localWeekNumbe;
491
+ return (_value$localWeekNumbe = value.localWeekNumber) != null ? _value$localWeekNumbe : value.weekNumber;
500
492
  };
501
493
  this.getYearRange = function (_ref4) {
502
494
  var _ref5 = _slicedToArray(_ref4, 2),
@@ -54,9 +54,6 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
54
54
  * - the `input` element if there is a field rendered.
55
55
  */
56
56
  autoFocus: PropTypes.bool,
57
- /**
58
- * Class name applied to the root element.
59
- */
60
57
  className: PropTypes.string,
61
58
  /**
62
59
  * If `true`, the popover or modal will close after submitting the full date.
@@ -96,9 +96,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
96
96
  // | To update them edit the TypeScript types and run "yarn proptypes" |
97
97
  // ----------------------------------------------------------------------
98
98
  classes: PropTypes.object,
99
- /**
100
- * className applied to the root component.
101
- */
102
99
  className: PropTypes.string,
103
100
  disabled: PropTypes.bool,
104
101
  /**
@@ -64,9 +64,6 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
64
64
  * - the `input` element if there is a field rendered.
65
65
  */
66
66
  autoFocus: PropTypes.bool,
67
- /**
68
- * Class name applied to the root element.
69
- */
70
67
  className: PropTypes.string,
71
68
  /**
72
69
  * If `true`, the popover or modal will close after submitting the full date.
@@ -333,9 +333,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
333
333
  * Override or extend the styles applied to the component.
334
334
  */
335
335
  classes: PropTypes.object,
336
- /**
337
- * className applied to the root component.
338
- */
339
336
  className: PropTypes.string,
340
337
  disabled: PropTypes.bool,
341
338
  /**
@@ -79,9 +79,6 @@ DesktopDatePicker.propTypes = {
79
79
  * - the `input` element if there is a field rendered.
80
80
  */
81
81
  autoFocus: PropTypes.bool,
82
- /**
83
- * Class name applied to the root element.
84
- */
85
82
  className: PropTypes.string,
86
83
  /**
87
84
  * If `true`, the popover or modal will close after submitting the full date.
@@ -126,9 +126,6 @@ DesktopDateTimePicker.propTypes = {
126
126
  * - the `input` element if there is a field rendered.
127
127
  */
128
128
  autoFocus: PropTypes.bool,
129
- /**
130
- * Class name applied to the root element.
131
- */
132
129
  className: PropTypes.string,
133
130
  /**
134
131
  * If `true`, the popover or modal will close after submitting the full date.
@@ -111,9 +111,6 @@ DesktopTimePicker.propTypes = {
111
111
  * - the `input` element if there is a field rendered.
112
112
  */
113
113
  autoFocus: PropTypes.bool,
114
- /**
115
- * Class name applied to the root element.
116
- */
117
114
  className: PropTypes.string,
118
115
  /**
119
116
  * If `true`, the popover or modal will close after submitting the full date.
@@ -76,9 +76,6 @@ MobileDatePicker.propTypes = {
76
76
  * - the `input` element if there is a field rendered.
77
77
  */
78
78
  autoFocus: PropTypes.bool,
79
- /**
80
- * Class name applied to the root element.
81
- */
82
79
  className: PropTypes.string,
83
80
  /**
84
81
  * If `true`, the popover or modal will close after submitting the full date.
@@ -96,9 +96,6 @@ MobileDateTimePicker.propTypes = {
96
96
  * - the `input` element if there is a field rendered.
97
97
  */
98
98
  autoFocus: PropTypes.bool,
99
- /**
100
- * Class name applied to the root element.
101
- */
102
99
  className: PropTypes.string,
103
100
  /**
104
101
  * If `true`, the popover or modal will close after submitting the full date.
@@ -89,9 +89,6 @@ MobileTimePicker.propTypes = {
89
89
  * - the `input` element if there is a field rendered.
90
90
  */
91
91
  autoFocus: PropTypes.bool,
92
- /**
93
- * Class name applied to the root element.
94
- */
95
92
  className: PropTypes.string,
96
93
  /**
97
94
  * If `true`, the popover or modal will close after submitting the full date.
@@ -254,9 +254,6 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
254
254
  * Override or extend the styles applied to the component.
255
255
  */
256
256
  classes: PropTypes.object,
257
- /**
258
- * className applied to the root element.
259
- */
260
257
  className: PropTypes.string,
261
258
  /**
262
259
  * The default selected value.
@@ -247,9 +247,6 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
247
247
  * Override or extend the styles applied to the component.
248
248
  */
249
249
  classes: PropTypes.object,
250
- /**
251
- * className applied to the root element.
252
- */
253
250
  className: PropTypes.string,
254
251
  currentMonth: PropTypes.any.isRequired,
255
252
  disabled: PropTypes.bool,
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
7
7
  import { useSlotProps } from '@mui/base/utils';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import useForkRef from '@mui/utils/useForkRef';
10
+ import { useThemeProps } from '@mui/material/styles';
10
11
  import { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -109,8 +110,12 @@ function PickersSection(props) {
109
110
  children: [/*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorBeforeProps)), /*#__PURE__*/_jsx(SectionContent, _extends({}, sectionContentProps)), /*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorAfterProps))]
110
111
  }));
111
112
  }
112
- var PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(props, ref) {
113
+ var PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(inProps, ref) {
113
114
  var _slots$root;
115
+ var props = useThemeProps({
116
+ props: inProps,
117
+ name: 'MuiPickersSectionList'
118
+ });
114
119
  var slots = props.slots,
115
120
  slotProps = props.slotProps,
116
121
  elements = props.elements,