@mui/x-date-pickers 7.0.0-alpha.4 → 7.0.0-alpha.6

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 (252) hide show
  1. package/CHANGELOG.md +342 -0
  2. package/DateCalendar/DateCalendar.types.d.ts +6 -6
  3. package/DateCalendar/DayCalendar.d.ts +4 -4
  4. package/DateCalendar/index.d.ts +1 -1
  5. package/DateField/DateField.js +17 -50
  6. package/DateField/DateField.types.d.ts +5 -9
  7. package/DateField/useDateField.d.ts +2 -2
  8. package/DateField/useDateField.js +1 -5
  9. package/DatePicker/DatePicker.js +5 -1
  10. package/DatePicker/DatePicker.types.d.ts +6 -6
  11. package/DatePicker/index.d.ts +1 -1
  12. package/DatePicker/shared.d.ts +6 -6
  13. package/DateTimeField/DateTimeField.js +17 -50
  14. package/DateTimeField/DateTimeField.types.d.ts +5 -9
  15. package/DateTimeField/useDateTimeField.d.ts +2 -2
  16. package/DateTimeField/useDateTimeField.js +1 -5
  17. package/DateTimePicker/DateTimePicker.js +5 -1
  18. package/DateTimePicker/DateTimePicker.types.d.ts +6 -6
  19. package/DateTimePicker/index.d.ts +1 -1
  20. package/DateTimePicker/shared.d.ts +6 -6
  21. package/DesktopDatePicker/DesktopDatePicker.js +7 -2
  22. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +6 -6
  23. package/DesktopDatePicker/index.d.ts +1 -1
  24. package/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
  25. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
  26. package/DesktopDateTimePicker/index.d.ts +1 -1
  27. package/DesktopTimePicker/DesktopTimePicker.js +5 -1
  28. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
  29. package/DesktopTimePicker/index.d.ts +1 -1
  30. package/DigitalClock/DigitalClock.types.d.ts +4 -4
  31. package/DigitalClock/index.d.ts +1 -1
  32. package/MobileDatePicker/MobileDatePicker.js +7 -2
  33. package/MobileDatePicker/MobileDatePicker.types.d.ts +6 -6
  34. package/MobileDatePicker/index.d.ts +1 -1
  35. package/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
  36. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +6 -6
  37. package/MobileDateTimePicker/index.d.ts +1 -1
  38. package/MobileTimePicker/MobileTimePicker.js +5 -1
  39. package/MobileTimePicker/MobileTimePicker.types.d.ts +6 -6
  40. package/MobileTimePicker/index.d.ts +1 -1
  41. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +4 -4
  42. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +3 -3
  43. package/MultiSectionDigitalClock/index.d.ts +1 -1
  44. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +8 -8
  45. package/PickersCalendarHeader/index.d.ts +1 -1
  46. package/PickersLayout/PickersLayout.types.d.ts +6 -6
  47. package/PickersLayout/index.d.ts +1 -1
  48. package/PickersSectionList/PickersSectionList.d.ts +11 -0
  49. package/PickersSectionList/PickersSectionList.js +223 -0
  50. package/PickersSectionList/PickersSectionList.types.d.ts +56 -0
  51. package/PickersSectionList/index.d.ts +4 -0
  52. package/PickersSectionList/index.js +2 -0
  53. package/PickersSectionList/package.json +6 -0
  54. package/PickersSectionList/pickersSectionListClasses.d.ts +11 -0
  55. package/PickersSectionList/pickersSectionListClasses.js +6 -0
  56. package/StaticDatePicker/StaticDatePicker.js +1 -1
  57. package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
  58. package/StaticDatePicker/index.d.ts +1 -1
  59. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
  60. package/StaticDateTimePicker/index.d.ts +1 -1
  61. package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
  62. package/StaticTimePicker/index.d.ts +1 -1
  63. package/TimeClock/TimeClock.types.d.ts +5 -5
  64. package/TimeClock/index.d.ts +1 -1
  65. package/TimeField/TimeField.js +17 -50
  66. package/TimeField/TimeField.types.d.ts +5 -9
  67. package/TimeField/useTimeField.d.ts +2 -2
  68. package/TimeField/useTimeField.js +1 -5
  69. package/TimePicker/TimePicker.js +5 -1
  70. package/TimePicker/TimePicker.types.d.ts +6 -6
  71. package/TimePicker/index.d.ts +1 -1
  72. package/TimePicker/shared.d.ts +5 -5
  73. package/hooks/index.d.ts +1 -0
  74. package/hooks/useClearableField.d.ts +32 -20
  75. package/hooks/useClearableField.js +32 -33
  76. package/index.d.ts +1 -0
  77. package/index.js +4 -1
  78. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +9 -9
  79. package/internals/components/PickersArrowSwitcher/index.d.ts +3 -1
  80. package/internals/components/PickersArrowSwitcher/index.js +2 -1
  81. package/internals/components/{PickersTextField → PickersInput}/Outline.d.ts +1 -0
  82. package/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
  83. package/internals/components/PickersInput/PickersFilledInput.d.ts +3 -0
  84. package/internals/components/PickersInput/PickersFilledInput.js +166 -0
  85. package/internals/components/PickersInput/PickersInput.d.ts +15 -0
  86. package/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
  87. package/internals/components/PickersInput/PickersInput.types.d.ts +60 -0
  88. package/internals/components/PickersInput/PickersOutlinedInput.d.ts +3 -0
  89. package/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
  90. package/internals/components/PickersInput/PickersStandardInput.d.ts +3 -0
  91. package/internals/components/PickersInput/PickersStandardInput.js +123 -0
  92. package/internals/components/PickersInput/index.d.ts +4 -0
  93. package/internals/components/PickersInput/index.js +3 -0
  94. package/internals/components/PickersInput/pickersInputClasses.d.ts +84 -0
  95. package/internals/components/PickersInput/pickersInputClasses.js +18 -0
  96. package/internals/components/PickersModalDialog.d.ts +4 -4
  97. package/internals/components/PickersPopper.d.ts +4 -4
  98. package/internals/components/PickersTextField/PickersTextField.d.ts +1 -2
  99. package/internals/components/PickersTextField/PickersTextField.js +15 -6
  100. package/internals/components/PickersTextField/PickersTextField.types.d.ts +46 -3
  101. package/internals/components/PickersTextField/pickersTextFieldClasses.d.ts +0 -31
  102. package/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
  103. package/internals/hooks/useDesktopPicker/index.d.ts +1 -1
  104. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  105. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +8 -8
  106. package/internals/hooks/useField/index.d.ts +1 -1
  107. package/internals/hooks/useField/useField.js +11 -4
  108. package/internals/hooks/useField/useField.types.d.ts +4 -24
  109. package/internals/hooks/useField/useField.utils.js +24 -4
  110. package/internals/hooks/useField/useFieldState.js +7 -3
  111. package/internals/hooks/useMobilePicker/index.d.ts +1 -1
  112. package/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  113. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -7
  114. package/internals/hooks/useStaticPicker/index.d.ts +1 -1
  115. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +5 -5
  116. package/internals/index.d.ts +7 -6
  117. package/internals/index.js +1 -0
  118. package/internals/models/props/basePickerProps.d.ts +4 -0
  119. package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.d.ts +3 -0
  120. package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +26 -0
  121. package/legacy/DateField/DateField.js +19 -47
  122. package/legacy/DateField/useDateField.js +1 -4
  123. package/legacy/DatePicker/DatePicker.js +5 -1
  124. package/legacy/DateTimeField/DateTimeField.js +19 -47
  125. package/legacy/DateTimeField/useDateTimeField.js +1 -4
  126. package/legacy/DateTimePicker/DateTimePicker.js +5 -1
  127. package/legacy/DesktopDatePicker/DesktopDatePicker.js +7 -2
  128. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
  129. package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -1
  130. package/legacy/MobileDatePicker/MobileDatePicker.js +7 -2
  131. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
  132. package/legacy/MobileTimePicker/MobileTimePicker.js +5 -1
  133. package/legacy/PickersSectionList/PickersSectionList.js +230 -0
  134. package/legacy/PickersSectionList/index.js +2 -0
  135. package/legacy/PickersSectionList/pickersSectionListClasses.js +6 -0
  136. package/legacy/StaticDatePicker/StaticDatePicker.js +1 -1
  137. package/legacy/TimeField/TimeField.js +19 -47
  138. package/legacy/TimeField/useTimeField.js +1 -4
  139. package/legacy/TimePicker/TimePicker.js +5 -1
  140. package/legacy/hooks/useClearableField.js +30 -32
  141. package/legacy/index.js +4 -1
  142. package/legacy/internals/components/PickersArrowSwitcher/index.js +2 -1
  143. package/legacy/internals/components/{PickersTextField → PickersInput}/Outline.js +40 -22
  144. package/legacy/internals/components/PickersInput/PickersFilledInput.js +161 -0
  145. package/legacy/internals/components/{PickersTextField → PickersInput}/PickersInput.js +75 -90
  146. package/legacy/internals/components/PickersInput/PickersInput.types.js +1 -0
  147. package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +110 -0
  148. package/legacy/internals/components/PickersInput/PickersStandardInput.js +117 -0
  149. package/legacy/internals/components/PickersInput/index.js +3 -0
  150. package/legacy/internals/components/PickersInput/pickersInputClasses.js +18 -0
  151. package/legacy/internals/components/PickersTextField/PickersTextField.js +16 -7
  152. package/legacy/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
  153. package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  154. package/legacy/internals/hooks/useField/useField.js +12 -5
  155. package/legacy/internals/hooks/useField/useField.utils.js +26 -4
  156. package/legacy/internals/hooks/useField/useFieldState.js +7 -3
  157. package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  158. package/legacy/internals/index.js +1 -0
  159. package/legacy/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +24 -0
  160. package/legacy/locales/ruRU.js +1 -2
  161. package/locales/ruRU.js +1 -2
  162. package/models/fields.d.ts +2 -1
  163. package/modern/DateField/DateField.js +17 -50
  164. package/modern/DateField/useDateField.js +1 -5
  165. package/modern/DatePicker/DatePicker.js +5 -1
  166. package/modern/DateTimeField/DateTimeField.js +17 -50
  167. package/modern/DateTimeField/useDateTimeField.js +1 -5
  168. package/modern/DateTimePicker/DateTimePicker.js +5 -1
  169. package/modern/DesktopDatePicker/DesktopDatePicker.js +7 -2
  170. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
  171. package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -1
  172. package/modern/MobileDatePicker/MobileDatePicker.js +7 -2
  173. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
  174. package/modern/MobileTimePicker/MobileTimePicker.js +5 -1
  175. package/modern/PickersSectionList/PickersSectionList.js +221 -0
  176. package/modern/PickersSectionList/PickersSectionList.types.js +1 -0
  177. package/modern/PickersSectionList/index.js +2 -0
  178. package/modern/PickersSectionList/pickersSectionListClasses.js +6 -0
  179. package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
  180. package/modern/TimeField/TimeField.js +17 -50
  181. package/modern/TimeField/useTimeField.js +1 -5
  182. package/modern/TimePicker/TimePicker.js +5 -1
  183. package/modern/hooks/useClearableField.js +32 -33
  184. package/modern/index.js +4 -1
  185. package/modern/internals/components/PickersArrowSwitcher/index.js +2 -1
  186. package/modern/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
  187. package/modern/internals/components/PickersInput/PickersFilledInput.js +165 -0
  188. package/modern/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
  189. package/modern/internals/components/PickersInput/PickersInput.types.js +1 -0
  190. package/modern/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
  191. package/modern/internals/components/PickersInput/PickersStandardInput.js +123 -0
  192. package/modern/internals/components/PickersInput/index.js +3 -0
  193. package/modern/internals/components/PickersInput/pickersInputClasses.js +18 -0
  194. package/modern/internals/components/PickersTextField/PickersTextField.js +15 -6
  195. package/modern/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
  196. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  197. package/modern/internals/hooks/useField/useField.js +11 -4
  198. package/modern/internals/hooks/useField/useField.utils.js +24 -4
  199. package/modern/internals/hooks/useField/useFieldState.js +7 -3
  200. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  201. package/modern/internals/index.js +1 -0
  202. package/modern/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +26 -0
  203. package/modern/locales/ruRU.js +1 -2
  204. package/node/DateField/DateField.js +18 -51
  205. package/node/DateField/useDateField.js +1 -5
  206. package/node/DatePicker/DatePicker.js +5 -1
  207. package/node/DateTimeField/DateTimeField.js +18 -51
  208. package/node/DateTimeField/useDateTimeField.js +1 -5
  209. package/node/DateTimePicker/DateTimePicker.js +5 -1
  210. package/node/DesktopDatePicker/DesktopDatePicker.js +10 -5
  211. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
  212. package/node/DesktopTimePicker/DesktopTimePicker.js +5 -1
  213. package/node/MobileDatePicker/MobileDatePicker.js +10 -5
  214. package/node/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
  215. package/node/MobileTimePicker/MobileTimePicker.js +5 -1
  216. package/node/PickersSectionList/PickersSectionList.js +228 -0
  217. package/node/PickersSectionList/index.js +49 -0
  218. package/node/PickersSectionList/pickersSectionListClasses.js +14 -0
  219. package/node/StaticDatePicker/StaticDatePicker.js +2 -2
  220. package/node/TimeField/TimeField.js +18 -51
  221. package/node/TimeField/useTimeField.js +1 -5
  222. package/node/TimePicker/TimePicker.js +5 -1
  223. package/node/hooks/useClearableField.js +33 -34
  224. package/node/index.js +13 -1
  225. package/node/internals/components/PickersArrowSwitcher/index.js +14 -1
  226. package/node/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
  227. package/node/internals/components/PickersInput/PickersFilledInput.js +174 -0
  228. package/node/internals/components/{PickersTextField → PickersInput}/PickersInput.js +80 -108
  229. package/node/internals/components/PickersInput/PickersInput.types.js +5 -0
  230. package/node/internals/components/PickersInput/PickersOutlinedInput.js +125 -0
  231. package/node/internals/components/PickersInput/PickersStandardInput.js +132 -0
  232. package/node/internals/components/PickersInput/index.js +32 -0
  233. package/node/internals/components/PickersInput/pickersInputClasses.js +29 -0
  234. package/node/internals/components/PickersTextField/PickersTextField.js +15 -6
  235. package/node/internals/components/PickersTextField/pickersTextFieldClasses.js +6 -9
  236. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  237. package/node/internals/hooks/useField/useField.js +11 -4
  238. package/node/internals/hooks/useField/useField.utils.js +24 -4
  239. package/node/internals/hooks/useField/useFieldState.js +7 -3
  240. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  241. package/node/internals/index.js +7 -0
  242. package/node/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +34 -0
  243. package/node/locales/ruRU.js +1 -2
  244. package/package.json +5 -5
  245. package/themeAugmentation/overrides.d.ts +5 -7
  246. package/themeAugmentation/props.d.ts +6 -8
  247. package/internals/components/PickersTextField/PickersInput.d.ts +0 -3
  248. package/internals/components/PickersTextField/PickersInput.types.d.ts +0 -45
  249. /package/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
  250. /package/{legacy/internals/components/PickersTextField → internals/components/PickersInput}/PickersInput.types.js +0 -0
  251. /package/{modern/internals/components/PickersTextField/PickersInput.types.js → legacy/PickersSectionList/PickersSectionList.types.js} +0 -0
  252. /package/node/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
@@ -224,6 +224,10 @@ MobileDateTimePicker.propTypes = {
224
224
  * @default 3
225
225
  */
226
226
  monthsPerRow: PropTypes.oneOf([3, 4]),
227
+ /**
228
+ * Name attribute used by the `input` element in the Field.
229
+ */
230
+ name: PropTypes.string,
227
231
  /**
228
232
  * Callback fired when the value is accepted.
229
233
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -322,7 +326,7 @@ MobileDateTimePicker.propTypes = {
322
326
  * 4. If `null` is provided, no section will be selected
323
327
  * If not provided, the selected sections will be handled internally.
324
328
  */
325
- selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
329
+ selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
326
330
  endIndex: PropTypes.number.isRequired,
327
331
  startIndex: PropTypes.number.isRequired
328
332
  })]),
@@ -1,21 +1,21 @@
1
- import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
- import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
1
+ import { UseMobilePickerSlots, ExportedUseMobilePickerSlotProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
+ import { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from '../DateTimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateOrTimeView } from '../models';
5
5
  import { DateOrTimeViewWithMeridiem } from '../internals/models';
6
- export interface MobileDateTimePickerSlotsComponent<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, 'field'> {
6
+ export interface MobileDateTimePickerSlots<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlots<TDate>, MakeOptional<UseMobilePickerSlots<TDate, TView>, 'field'> {
7
7
  }
8
- export interface MobileDateTimePickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseMobilePickerSlotsComponentsProps<TDate, TView> {
8
+ export interface MobileDateTimePickerSlotProps<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotProps<TDate>, ExportedUseMobilePickerSlotProps<TDate, TView> {
9
9
  }
10
10
  export interface MobileDateTimePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerProps<TDate, TView>, MobileOnlyPickerProps<TDate> {
11
11
  /**
12
12
  * Overridable component slots.
13
13
  * @default {}
14
14
  */
15
- slots?: MobileDateTimePickerSlotsComponent<TDate, TView>;
15
+ slots?: MobileDateTimePickerSlots<TDate, TView>;
16
16
  /**
17
17
  * The props used for each component slot.
18
18
  * @default {}
19
19
  */
20
- slotProps?: MobileDateTimePickerSlotsComponentsProps<TDate, TView>;
20
+ slotProps?: MobileDateTimePickerSlotProps<TDate, TView>;
21
21
  }
@@ -1,2 +1,2 @@
1
1
  export { MobileDateTimePicker } from './MobileDateTimePicker';
2
- export type { MobileDateTimePickerProps, MobileDateTimePickerSlotsComponent, MobileDateTimePickerSlotsComponentsProps, } from './MobileDateTimePicker.types';
2
+ export type { MobileDateTimePickerProps, MobileDateTimePickerSlots, MobileDateTimePickerSlotProps, } from './MobileDateTimePicker.types';
@@ -168,6 +168,10 @@ MobileTimePicker.propTypes = {
168
168
  * @default 1
169
169
  */
170
170
  minutesStep: PropTypes.number,
171
+ /**
172
+ * Name attribute used by the `input` element in the Field.
173
+ */
174
+ name: PropTypes.string,
171
175
  /**
172
176
  * Callback fired when the value is accepted.
173
177
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -248,7 +252,7 @@ MobileTimePicker.propTypes = {
248
252
  * 4. If `null` is provided, no section will be selected
249
253
  * If not provided, the selected sections will be handled internally.
250
254
  */
251
- selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
255
+ selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
252
256
  endIndex: PropTypes.number.isRequired,
253
257
  startIndex: PropTypes.number.isRequired
254
258
  })]),
@@ -1,21 +1,21 @@
1
- import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
- import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
1
+ import { UseMobilePickerSlots, ExportedUseMobilePickerSlotProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
+ import { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from '../TimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { TimeView } from '../models';
5
5
  import { TimeViewWithMeridiem } from '../internals/models';
6
- export interface MobileTimePickerSlotsComponent<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, 'field'> {
6
+ export interface MobileTimePickerSlots<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlots<TDate>, MakeOptional<UseMobilePickerSlots<TDate, TView>, 'field'> {
7
7
  }
8
- export interface MobileTimePickerSlotsComponentsProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotsComponentsProps, ExportedUseMobilePickerSlotsComponentsProps<TDate, TView> {
8
+ export interface MobileTimePickerSlotProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotProps, ExportedUseMobilePickerSlotProps<TDate, TView> {
9
9
  }
10
10
  export interface MobileTimePickerProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerProps<TDate, TView>, MobileOnlyPickerProps<TDate> {
11
11
  /**
12
12
  * Overridable component slots.
13
13
  * @default {}
14
14
  */
15
- slots?: MobileTimePickerSlotsComponent<TDate, TView>;
15
+ slots?: MobileTimePickerSlots<TDate, TView>;
16
16
  /**
17
17
  * The props used for each component slot.
18
18
  * @default {}
19
19
  */
20
- slotProps?: MobileTimePickerSlotsComponentsProps<TDate, TView>;
20
+ slotProps?: MobileTimePickerSlotProps<TDate, TView>;
21
21
  }
@@ -1,2 +1,2 @@
1
1
  export { MobileTimePicker } from './MobileTimePicker';
2
- export type { MobileTimePickerProps, MobileTimePickerSlotsComponent, MobileTimePickerSlotsComponentsProps, } from './MobileTimePicker.types';
2
+ export type { MobileTimePickerProps, MobileTimePickerSlots, MobileTimePickerSlotProps, } from './MobileTimePicker.types';
@@ -17,14 +17,14 @@ export interface ExportedMultiSectionDigitalClockProps<TDate> extends ExportedBa
17
17
  }
18
18
  export interface MultiSectionDigitalClockViewProps<TValue> extends Pick<MultiSectionDigitalClockSectionProps<TValue>, 'onChange' | 'items'> {
19
19
  }
20
- export interface MultiSectionDigitalClockSlotsComponent {
20
+ export interface MultiSectionDigitalClockSlots {
21
21
  /**
22
22
  * Component responsible for rendering a single multi section digital clock section item.
23
23
  * @default MenuItem from '@mui/material'
24
24
  */
25
25
  digitalClockSectionItem?: React.ElementType;
26
26
  }
27
- export interface MultiSectionDigitalClockSlotsComponentsProps {
27
+ export interface MultiSectionDigitalClockSlotProps {
28
28
  digitalClockSectionItem?: SlotComponentProps<typeof MenuItem, {}, Record<string, any>>;
29
29
  }
30
30
  export interface MultiSectionDigitalClockProps<TDate> extends ExportedMultiSectionDigitalClockProps<TDate>, BaseClockProps<TDate, TimeViewWithMeridiem> {
@@ -36,10 +36,10 @@ export interface MultiSectionDigitalClockProps<TDate> extends ExportedMultiSecti
36
36
  * Overrideable component slots.
37
37
  * @default {}
38
38
  */
39
- slots?: MultiSectionDigitalClockSlotsComponent;
39
+ slots?: MultiSectionDigitalClockSlots;
40
40
  /**
41
41
  * The props used for each component slot.
42
42
  * @default {}
43
43
  */
44
- slotProps?: MultiSectionDigitalClockSlotsComponentsProps;
44
+ slotProps?: MultiSectionDigitalClockSlotProps;
45
45
  }
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { MultiSectionDigitalClockSectionClasses } from './multiSectionDigitalClockSectionClasses';
3
- import type { MultiSectionDigitalClockOption, MultiSectionDigitalClockSlotsComponent, MultiSectionDigitalClockSlotsComponentsProps } from './MultiSectionDigitalClock.types';
3
+ import type { MultiSectionDigitalClockOption, MultiSectionDigitalClockSlots, MultiSectionDigitalClockSlotProps } from './MultiSectionDigitalClock.types';
4
4
  export interface ExportedMultiSectionDigitalClockSectionProps {
5
5
  className?: string;
6
6
  classes?: Partial<MultiSectionDigitalClockSectionClasses>;
7
- slots?: MultiSectionDigitalClockSlotsComponent;
8
- slotProps?: MultiSectionDigitalClockSlotsComponentsProps;
7
+ slots?: MultiSectionDigitalClockSlots;
8
+ slotProps?: MultiSectionDigitalClockSlotProps;
9
9
  }
10
10
  export interface MultiSectionDigitalClockSectionProps<TValue> extends ExportedMultiSectionDigitalClockSectionProps {
11
11
  autoFocus?: boolean;
@@ -1,5 +1,5 @@
1
1
  export { MultiSectionDigitalClock } from './MultiSectionDigitalClock';
2
- export type { MultiSectionDigitalClockProps, MultiSectionDigitalClockSlotsComponent, MultiSectionDigitalClockSlotsComponentsProps, } from './MultiSectionDigitalClock.types';
2
+ export type { MultiSectionDigitalClockProps, MultiSectionDigitalClockSlots, MultiSectionDigitalClockSlotProps, } from './MultiSectionDigitalClock.types';
3
3
  export { multiSectionDigitalClockSectionClasses } from './multiSectionDigitalClockSectionClasses';
4
4
  export type { MultiSectionDigitalClockSectionClasses, MultiSectionDigitalClockSectionClassKey, } from './multiSectionDigitalClockSectionClasses';
5
5
  export type { ExportedMultiSectionDigitalClockSectionProps } from './MultiSectionDigitalClockSection';
@@ -3,12 +3,12 @@ import { SlotComponentProps } from '@mui/base/utils';
3
3
  import IconButton from '@mui/material/IconButton';
4
4
  import SvgIcon from '@mui/material/SvgIcon';
5
5
  import { SxProps, Theme } from '@mui/material/styles';
6
- import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
6
+ import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from '../internals/components/PickersArrowSwitcher';
7
7
  import { MonthValidationOptions } from '../internals/hooks/date-helpers-hooks';
8
8
  import { DateView } from '../models/views';
9
9
  import { SlideDirection } from '../DateCalendar/PickersSlideTransition';
10
10
  import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
11
- export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitcherSlotsComponent {
11
+ export interface PickersCalendarHeaderSlots extends PickersArrowSwitcherSlots {
12
12
  /**
13
13
  * Button displayed to switch between different calendar views.
14
14
  * @default IconButton
@@ -20,24 +20,24 @@ export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitche
20
20
  */
21
21
  switchViewIcon?: React.ElementType;
22
22
  }
23
- export interface PickersCalendarHeaderComponentsPropsOverrides {
23
+ export interface PickersCalendarHeaderSlotPropsOverrides {
24
24
  }
25
25
  export type PickersCalendarHeaderOwnerState<TDate> = PickersCalendarHeaderProps<TDate>;
26
- export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends PickersArrowSwitcherSlotsComponentsProps {
27
- switchViewButton?: SlotComponentProps<typeof IconButton, PickersCalendarHeaderComponentsPropsOverrides, PickersCalendarHeaderOwnerState<TDate>>;
28
- switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
26
+ export interface PickersCalendarHeaderSlotProps<TDate> extends PickersArrowSwitcherSlotProps {
27
+ switchViewButton?: SlotComponentProps<typeof IconButton, PickersCalendarHeaderSlotPropsOverrides, PickersCalendarHeaderOwnerState<TDate>>;
28
+ switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderSlotPropsOverrides, undefined>;
29
29
  }
30
30
  export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, MonthValidationOptions<TDate> {
31
31
  /**
32
32
  * Overridable component slots.
33
33
  * @default {}
34
34
  */
35
- slots?: PickersCalendarHeaderSlotsComponent;
35
+ slots?: PickersCalendarHeaderSlots;
36
36
  /**
37
37
  * The props used for each component slot.
38
38
  * @default {}
39
39
  */
40
- slotProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
40
+ slotProps?: PickersCalendarHeaderSlotProps<TDate>;
41
41
  currentMonth: TDate;
42
42
  disabled?: boolean;
43
43
  views: readonly DateView[];
@@ -1,4 +1,4 @@
1
1
  export { pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
2
2
  export type { PickersCalendarHeaderClassKey, PickersCalendarHeaderClasses, } from './pickersCalendarHeaderClasses';
3
3
  export { PickersCalendarHeader } from './PickersCalendarHeader';
4
- export type { PickersCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps, ExportedPickersCalendarHeaderProps, } from './PickersCalendarHeader.types';
4
+ export type { PickersCalendarHeaderProps, PickersCalendarHeaderSlots, PickersCalendarHeaderSlotProps, ExportedPickersCalendarHeaderProps, } from './PickersCalendarHeader.types';
@@ -8,7 +8,7 @@ import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/useP
8
8
  import { PickersLayoutClasses } from './pickersLayoutClasses';
9
9
  import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models/common';
10
10
  import { PickersShortcutsProps } from '../PickersShortcuts';
11
- export interface ExportedPickersLayoutSlotsComponent<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
11
+ export interface ExportedPickersLayoutSlots<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
12
12
  /**
13
13
  * Custom component for the action bar, it is placed below the picker views.
14
14
  * @default PickersActionBar
@@ -31,7 +31,7 @@ interface PickersLayoutActionBarOwnerState<TValue, TDate, TView extends DateOrTi
31
31
  interface PickersShortcutsOwnerState<TValue> extends PickersShortcutsProps<TValue> {
32
32
  wrapperVariant: WrapperVariant;
33
33
  }
34
- export interface ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
34
+ export interface ExportedPickersLayoutSlotProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
35
35
  /**
36
36
  * Props passed down to the action bar component.
37
37
  */
@@ -45,7 +45,7 @@ export interface ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView
45
45
  */
46
46
  layout?: Partial<PickersLayoutProps<TValue, TDate, TView>>;
47
47
  }
48
- export interface PickersLayoutSlotsComponent<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotsComponent<TValue, TDate, TView> {
48
+ export interface PickersLayoutSlots<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<TValue, TDate, TView> {
49
49
  /**
50
50
  * Tabs enabling toggling between views.
51
51
  */
@@ -56,7 +56,7 @@ export interface PickersLayoutSlotsComponent<TValue, TDate, TView extends DateOr
56
56
  */
57
57
  toolbar?: React.JSXElementConstructor<BaseToolbarProps<TValue, TView>>;
58
58
  }
59
- export interface PickersLayoutSlotsComponentsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView> {
59
+ export interface PickersLayoutSlotProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<TValue, TDate, TView> {
60
60
  /**
61
61
  * Props passed down to the tabs component.
62
62
  */
@@ -80,12 +80,12 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
80
80
  * Overridable component slots.
81
81
  * @default {}
82
82
  */
83
- slots?: PickersLayoutSlotsComponent<TValue, TDate, TView>;
83
+ slots?: PickersLayoutSlots<TValue, TDate, TView>;
84
84
  /**
85
85
  * The props used for each component slot.
86
86
  * @default {}
87
87
  */
88
- slotProps?: PickersLayoutSlotsComponentsProps<TValue, TDate, TView>;
88
+ slotProps?: PickersLayoutSlotProps<TValue, TDate, TView>;
89
89
  }
90
90
  export interface SubComponents {
91
91
  toolbar: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  export { PickersLayout, PickersLayoutRoot, PickersLayoutContentWrapper } from './PickersLayout';
2
- export type { PickersLayoutProps, PickersLayoutSlotsComponent, PickersLayoutSlotsComponentsProps, ExportedPickersLayoutSlotsComponent, ExportedPickersLayoutSlotsComponentsProps, } from './PickersLayout.types';
2
+ export type { PickersLayoutProps, PickersLayoutSlots, PickersLayoutSlotProps, ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps, } from './PickersLayout.types';
3
3
  export { default as usePickerLayout } from './usePickerLayout';
4
4
  export { pickersLayoutClasses } from './pickersLayoutClasses';
5
5
  export type { PickersLayoutClassKey } from './pickersLayoutClasses';
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { PickersSectionListProps } from './PickersSectionList.types';
3
+ export declare const PickersSectionListRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
4
+ export declare const PickersSectionListSection: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
5
+ export declare const PickersSectionListSectionSeparator: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
6
+ export declare const PickersSectionListSectionContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
7
+ type PickersSectionListComponent = ((props: PickersSectionListProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
8
+ propTypes?: any;
9
+ };
10
+ declare const PickersSectionList: PickersSectionListComponent;
11
+ export { PickersSectionList };
@@ -0,0 +1,223 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["slots", "slotProps", "elements", "sectionListRef"];
4
+ import * as React from 'react';
5
+ import styled from '@mui/system/styled';
6
+ import PropTypes from 'prop-types';
7
+ import { useSlotProps } from '@mui/base/utils';
8
+ import composeClasses from '@mui/utils/composeClasses';
9
+ import useForkRef from '@mui/utils/useForkRef';
10
+ import { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ export const PickersSectionListRoot = styled('div', {
14
+ name: 'MuiPickersSectionList',
15
+ slot: 'Root',
16
+ overridesResolver: (props, styles) => styles.root
17
+ })({
18
+ direction: 'ltr /*! @noflip */',
19
+ outline: 'none'
20
+ });
21
+ export const PickersSectionListSection = styled('span', {
22
+ name: 'MuiPickersSectionList',
23
+ slot: 'Section',
24
+ overridesResolver: (props, styles) => styles.section
25
+ })({});
26
+ export const PickersSectionListSectionSeparator = styled('span', {
27
+ name: 'MuiPickersSectionList',
28
+ slot: 'SectionSeparator',
29
+ overridesResolver: (props, styles) => styles.sectionSeparator
30
+ })({
31
+ whiteSpace: 'pre'
32
+ });
33
+ export const PickersSectionListSectionContent = styled('span', {
34
+ name: 'MuiPickersSectionList',
35
+ slot: 'SectionContent',
36
+ overridesResolver: (props, styles) => styles.sectionContent
37
+ })({
38
+ outline: 'none'
39
+ });
40
+ const useUtilityClasses = ownerState => {
41
+ const {
42
+ classes
43
+ } = ownerState;
44
+ const slots = {
45
+ root: ['root'],
46
+ section: ['section'],
47
+ sectionContent: ['sectionContent']
48
+ };
49
+ return composeClasses(slots, getPickersSectionListUtilityClass, classes);
50
+ };
51
+ /**
52
+ * Demos:
53
+ *
54
+ * - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)
55
+ *
56
+ * API:
57
+ *
58
+ * - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
59
+ */
60
+ function PickersSection(props) {
61
+ var _slots$section, _slots$sectionContent, _slots$sectionSeparat;
62
+ const {
63
+ slots,
64
+ slotProps,
65
+ element,
66
+ classes
67
+ } = props;
68
+ const Section = (_slots$section = slots == null ? void 0 : slots.section) != null ? _slots$section : PickersSectionListSection;
69
+ const sectionProps = useSlotProps({
70
+ elementType: Section,
71
+ externalSlotProps: slotProps == null ? void 0 : slotProps.section,
72
+ externalForwardedProps: element.container,
73
+ className: classes.section,
74
+ ownerState: {}
75
+ });
76
+ const SectionContent = (_slots$sectionContent = slots == null ? void 0 : slots.sectionContent) != null ? _slots$sectionContent : PickersSectionListSectionContent;
77
+ const sectionContentProps = useSlotProps({
78
+ elementType: SectionContent,
79
+ externalSlotProps: slotProps == null ? void 0 : slotProps.sectionContent,
80
+ externalForwardedProps: element.content,
81
+ additionalProps: {
82
+ suppressContentEditableWarning: true
83
+ },
84
+ className: classes.sectionContent,
85
+ ownerState: {}
86
+ });
87
+ const SectionSeparator = (_slots$sectionSeparat = slots == null ? void 0 : slots.sectionSeparator) != null ? _slots$sectionSeparat : PickersSectionListSectionSeparator;
88
+ const sectionSeparatorBeforeProps = useSlotProps({
89
+ elementType: SectionSeparator,
90
+ externalSlotProps: slotProps == null ? void 0 : slotProps.sectionSeparator,
91
+ externalForwardedProps: element.before,
92
+ ownerState: {
93
+ position: 'before'
94
+ }
95
+ });
96
+ const sectionSeparatorAfterProps = useSlotProps({
97
+ elementType: SectionSeparator,
98
+ externalSlotProps: slotProps == null ? void 0 : slotProps.sectionSeparator,
99
+ externalForwardedProps: element.after,
100
+ ownerState: {
101
+ position: 'after'
102
+ }
103
+ });
104
+ return /*#__PURE__*/_jsxs(Section, _extends({}, sectionProps, {
105
+ children: [/*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorBeforeProps)), /*#__PURE__*/_jsx(SectionContent, _extends({}, sectionContentProps)), /*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorAfterProps))]
106
+ }));
107
+ }
108
+ const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(props, ref) {
109
+ var _slots$root;
110
+ const {
111
+ slots,
112
+ slotProps,
113
+ elements,
114
+ sectionListRef
115
+ } = props,
116
+ other = _objectWithoutPropertiesLoose(props, _excluded);
117
+ const classes = useUtilityClasses(props);
118
+ const rootRef = React.useRef(null);
119
+ const handleRootRef = useForkRef(ref, rootRef);
120
+ const getRoot = methodName => {
121
+ if (!rootRef.current) {
122
+ throw new Error(`MUI: Cannot call sectionListRef.${methodName} before the mount of the component`);
123
+ }
124
+ return rootRef.current;
125
+ };
126
+ React.useImperativeHandle(sectionListRef, () => ({
127
+ getRoot() {
128
+ return getRoot('getRoot');
129
+ },
130
+ getSectionContainer(index) {
131
+ const root = getRoot('getSectionContainer');
132
+ return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex="${index}"]`);
133
+ },
134
+ getSectionContent(index) {
135
+ const root = getRoot('getSectionContent');
136
+ return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex="${index}"] .${pickersSectionListClasses.sectionContent}`);
137
+ },
138
+ getSectionIndexFromDOMElement(element) {
139
+ const root = getRoot('getSectionIndexFromDOMElement');
140
+ if (element == null || !root.contains(element)) {
141
+ return null;
142
+ }
143
+ let sectionContainer = null;
144
+ if (element.classList.contains(pickersSectionListClasses.section)) {
145
+ sectionContainer = element;
146
+ } else if (element.classList.contains(pickersSectionListClasses.sectionContent)) {
147
+ sectionContainer = element.parentElement;
148
+ }
149
+ if (sectionContainer == null) {
150
+ return null;
151
+ }
152
+ return Number(sectionContainer.dataset.sectionindex);
153
+ }
154
+ }));
155
+ const Root = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : PickersSectionListRoot;
156
+ const rootProps = useSlotProps({
157
+ elementType: Root,
158
+ externalSlotProps: slotProps == null ? void 0 : slotProps.root,
159
+ externalForwardedProps: other,
160
+ additionalProps: {
161
+ ref: handleRootRef,
162
+ suppressContentEditableWarning: true
163
+ },
164
+ className: classes.root,
165
+ ownerState: {}
166
+ });
167
+ return /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {
168
+ children: rootProps.contentEditable ? elements.map(({
169
+ content,
170
+ before,
171
+ after
172
+ }) => `${before.children}${content.children}${after.children}`).join('') : /*#__PURE__*/_jsx(React.Fragment, {
173
+ children: elements.map((element, elementIndex) => /*#__PURE__*/_jsx(PickersSection, {
174
+ slots: slots,
175
+ slotProps: slotProps,
176
+ element: element,
177
+ classes: classes
178
+ }, elementIndex))
179
+ })
180
+ }));
181
+ });
182
+ process.env.NODE_ENV !== "production" ? PickersSectionList.propTypes = {
183
+ // ----------------------------- Warning --------------------------------
184
+ // | These PropTypes are generated from the TypeScript type definitions |
185
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
186
+ // ----------------------------------------------------------------------
187
+ /**
188
+ * Override or extend the styles applied to the component.
189
+ */
190
+ classes: PropTypes.object,
191
+ /**
192
+ * If true, the whole element is editable.
193
+ * Useful when all the sections are selected.
194
+ */
195
+ contentEditable: PropTypes.bool.isRequired,
196
+ /**
197
+ * The elements to render.
198
+ * Each element contains the prop to edit a section of the value.
199
+ */
200
+ elements: PropTypes.arrayOf(PropTypes.shape({
201
+ after: PropTypes.object.isRequired,
202
+ before: PropTypes.object.isRequired,
203
+ container: PropTypes.object.isRequired,
204
+ content: PropTypes.object.isRequired
205
+ })).isRequired,
206
+ sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
207
+ current: PropTypes.shape({
208
+ getRoot: PropTypes.func.isRequired,
209
+ getSectionContainer: PropTypes.func.isRequired,
210
+ getSectionContent: PropTypes.func.isRequired,
211
+ getSectionIndexFromDOMElement: PropTypes.func.isRequired
212
+ })
213
+ })]),
214
+ /**
215
+ * The props used for each component slot.
216
+ */
217
+ slotProps: PropTypes.object,
218
+ /**
219
+ * Overridable component slots.
220
+ */
221
+ slots: PropTypes.object
222
+ } : void 0;
223
+ export { PickersSectionList };
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+ import { SlotComponentProps } from '@mui/base/utils';
3
+ import { PickersSectionListClasses } from './pickersSectionListClasses';
4
+ export interface PickersSectionListSlots {
5
+ root: React.ElementType;
6
+ section: React.ElementType;
7
+ sectionSeparator: React.ElementType;
8
+ sectionContent: React.ElementType;
9
+ }
10
+ export interface PickersSectionListSlotProps {
11
+ root?: SlotComponentProps<'div', {}, {}>;
12
+ section?: SlotComponentProps<'span', {}, {}>;
13
+ sectionSeparator?: SlotComponentProps<'span', {}, {
14
+ position: 'before' | 'after';
15
+ }>;
16
+ sectionContent?: SlotComponentProps<'span', {}, {}>;
17
+ }
18
+ export interface PickersSectionElement {
19
+ container: React.HTMLAttributes<HTMLSpanElement>;
20
+ content: React.HTMLAttributes<HTMLSpanElement>;
21
+ before: React.HTMLAttributes<HTMLSpanElement>;
22
+ after: React.HTMLAttributes<HTMLSpanElement>;
23
+ }
24
+ export interface PickersSectionListRef {
25
+ getRoot: () => HTMLElement;
26
+ getSectionContainer: (sectionIndex: number) => HTMLElement;
27
+ getSectionContent: (sectionIndex: number) => HTMLElement;
28
+ getSectionIndexFromDOMElement: (element: Element | null | undefined) => number | null;
29
+ }
30
+ export interface ExportedPickersSectionListProps extends Pick<React.HTMLAttributes<HTMLDivElement>, 'tabIndex'> {
31
+ /**
32
+ * The elements to render.
33
+ * Each element contains the prop to edit a section of the value.
34
+ */
35
+ elements: PickersSectionElement[];
36
+ sectionListRef: React.Ref<PickersSectionListRef>;
37
+ /**
38
+ * If true, the whole element is editable.
39
+ * Useful when all the sections are selected.
40
+ */
41
+ contentEditable: boolean;
42
+ }
43
+ export interface PickersSectionListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'contentEditable'>, ExportedPickersSectionListProps {
44
+ /**
45
+ * Overridable component slots.
46
+ */
47
+ slots?: PickersSectionListSlots;
48
+ /**
49
+ * The props used for each component slot.
50
+ */
51
+ slotProps?: PickersSectionListSlotProps;
52
+ /**
53
+ * Override or extend the styles applied to the component.
54
+ */
55
+ classes?: Partial<PickersSectionListClasses>;
56
+ }
@@ -0,0 +1,4 @@
1
+ export { PickersSectionList as Unstable_PickersSectionList, PickersSectionListRoot as Unstable_PickersSectionListRoot, PickersSectionListSection as Unstable_PickersSectionListSection, PickersSectionListSectionSeparator as Unstable_PickersSectionListSectionSeparator, PickersSectionListSectionContent as Unstable_PickersSectionListSectionContent, } from './PickersSectionList';
2
+ export type { PickersSectionListProps, PickersSectionElement, PickersSectionListRef, PickersSectionListSlots, PickersSectionListSlotProps, ExportedPickersSectionListProps, } from './PickersSectionList.types';
3
+ export { getPickersSectionListUtilityClass, pickersSectionListClasses, } from './pickersSectionListClasses';
4
+ export type { PickersSectionListClasses, PickersSectionListClassKey, } from './pickersSectionListClasses';
@@ -0,0 +1,2 @@
1
+ export { PickersSectionList as Unstable_PickersSectionList, PickersSectionListRoot as Unstable_PickersSectionListRoot, PickersSectionListSection as Unstable_PickersSectionListSection, PickersSectionListSectionSeparator as Unstable_PickersSectionListSectionSeparator, PickersSectionListSectionContent as Unstable_PickersSectionListSectionContent } from './PickersSectionList';
2
+ export { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/PickersSectionList/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,11 @@
1
+ export interface PickersSectionListClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the container of a section. */
5
+ section: string;
6
+ /** Styles applied to the content of a section. */
7
+ sectionContent: string;
8
+ }
9
+ export type PickersSectionListClassKey = keyof PickersSectionListClasses;
10
+ export declare function getPickersSectionListUtilityClass(slot: string): string;
11
+ export declare const pickersSectionListClasses: Record<keyof PickersSectionListClasses, string>;
@@ -0,0 +1,6 @@
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
+ export function getPickersSectionListUtilityClass(slot) {
4
+ return generateUtilityClass('MuiPickersSectionList', slot);
5
+ }
6
+ export const pickersSectionListClasses = generateUtilityClasses('MuiPickersSectionList', ['root', 'section', 'sectionContent']);
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
5
5
  import { renderDateViewCalendar } from '../dateViewRenderers';
6
6
  import { useStaticPicker } from '../internals/hooks/useStaticPicker';
7
- import { validateDate } from '../internals';
7
+ import { validateDate } from '../internals/utils/validation/validateDate';
8
8
  import { singleItemValueManager } from '../internals/utils/valueManagers';
9
9
  /**
10
10
  * Demos: