@mui/x-date-pickers 6.18.1 → 7.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/AdapterLuxon/AdapterLuxon.js +13 -3
  2. package/CHANGELOG.md +149 -0
  3. package/DateCalendar/DateCalendar.js +4 -20
  4. package/DateCalendar/DateCalendar.types.d.ts +12 -3
  5. package/DateCalendar/DayCalendar.d.ts +12 -3
  6. package/DateCalendar/DayCalendar.js +3 -5
  7. package/DateCalendar/useCalendarState.js +2 -3
  8. package/DateField/DateField.js +5 -21
  9. package/DateField/DateField.types.d.ts +12 -3
  10. package/DatePicker/DatePicker.js +0 -12
  11. package/DatePicker/DatePicker.types.d.ts +1 -14
  12. package/DatePicker/shared.d.ts +3 -15
  13. package/DatePicker/shared.js +2 -5
  14. package/DateTimeField/DateTimeField.js +5 -21
  15. package/DateTimeField/DateTimeField.types.d.ts +2 -15
  16. package/DateTimePicker/DateTimePicker.js +0 -12
  17. package/DateTimePicker/DateTimePicker.types.d.ts +1 -14
  18. package/DateTimePicker/shared.d.ts +3 -16
  19. package/DateTimePicker/shared.js +4 -7
  20. package/DesktopDatePicker/DesktopDatePicker.js +0 -12
  21. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -15
  22. package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
  23. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -15
  24. package/DesktopTimePicker/DesktopTimePicker.js +0 -12
  25. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -15
  26. package/DigitalClock/DigitalClock.js +15 -24
  27. package/DigitalClock/DigitalClock.types.d.ts +2 -15
  28. package/MobileDatePicker/MobileDatePicker.js +0 -12
  29. package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -15
  30. package/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
  31. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -15
  32. package/MobileTimePicker/MobileTimePicker.js +0 -12
  33. package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -15
  34. package/MonthCalendar/MonthCalendar.js +3 -7
  35. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  36. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -15
  37. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -1
  38. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  39. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -2
  40. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  41. package/PickersCalendarHeader/PickersCalendarHeader.js +4 -17
  42. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -16
  43. package/PickersLayout/PickersLayout.js +0 -12
  44. package/PickersLayout/PickersLayout.types.d.ts +6 -19
  45. package/PickersLayout/usePickerLayout.js +2 -7
  46. package/StaticDatePicker/StaticDatePicker.js +0 -12
  47. package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -14
  48. package/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
  49. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -14
  50. package/StaticTimePicker/StaticTimePicker.js +0 -12
  51. package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -14
  52. package/TimeClock/TimeClock.js +3 -20
  53. package/TimeClock/TimeClock.types.d.ts +1 -14
  54. package/TimeField/TimeField.js +5 -21
  55. package/TimeField/TimeField.types.d.ts +2 -15
  56. package/TimePicker/TimePicker.js +0 -12
  57. package/TimePicker/TimePicker.types.d.ts +1 -14
  58. package/TimePicker/shared.d.ts +2 -15
  59. package/TimePicker/shared.js +4 -7
  60. package/YearCalendar/YearCalendar.js +3 -7
  61. package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
  62. package/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
  63. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  64. package/dateViewRenderers/dateViewRenderers.js +0 -4
  65. package/hooks/useClearableField.d.ts +1 -3
  66. package/hooks/useClearableField.js +6 -8
  67. package/index.js +1 -1
  68. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +5 -6
  69. package/internals/components/PickersModalDialog.d.ts +4 -5
  70. package/internals/components/PickersPopper.d.ts +5 -6
  71. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -8
  72. package/internals/hooks/useField/useField.types.d.ts +2 -2
  73. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -4
  74. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -14
  75. package/internals/index.d.ts +0 -2
  76. package/internals/index.js +0 -1
  77. package/legacy/AdapterLuxon/AdapterLuxon.js +13 -3
  78. package/legacy/DateCalendar/DateCalendar.js +4 -20
  79. package/legacy/DateCalendar/DayCalendar.js +3 -5
  80. package/legacy/DateCalendar/useCalendarState.js +2 -3
  81. package/legacy/DateField/DateField.js +6 -22
  82. package/legacy/DatePicker/DatePicker.js +0 -12
  83. package/legacy/DatePicker/shared.js +2 -5
  84. package/legacy/DateTimeField/DateTimeField.js +6 -22
  85. package/legacy/DateTimePicker/DateTimePicker.js +0 -12
  86. package/legacy/DateTimePicker/shared.js +4 -7
  87. package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -12
  88. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
  89. package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -12
  90. package/legacy/DigitalClock/DigitalClock.js +17 -24
  91. package/legacy/MobileDatePicker/MobileDatePicker.js +0 -12
  92. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
  93. package/legacy/MobileTimePicker/MobileTimePicker.js +0 -12
  94. package/legacy/MonthCalendar/MonthCalendar.js +3 -6
  95. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -18
  96. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  97. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +15 -10
  98. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +4 -18
  99. package/legacy/PickersLayout/PickersLayout.js +0 -12
  100. package/legacy/PickersLayout/usePickerLayout.js +2 -7
  101. package/legacy/StaticDatePicker/StaticDatePicker.js +0 -12
  102. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
  103. package/legacy/StaticTimePicker/StaticTimePicker.js +0 -12
  104. package/legacy/TimeClock/TimeClock.js +3 -20
  105. package/legacy/TimeField/TimeField.js +5 -21
  106. package/legacy/TimePicker/TimePicker.js +0 -12
  107. package/legacy/TimePicker/shared.js +4 -7
  108. package/legacy/YearCalendar/YearCalendar.js +3 -6
  109. package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
  110. package/legacy/dateViewRenderers/dateViewRenderers.js +0 -4
  111. package/legacy/hooks/useClearableField.js +6 -8
  112. package/legacy/index.js +1 -1
  113. package/legacy/internals/index.js +0 -1
  114. package/legacy/locales/esES.js +6 -7
  115. package/legacy/locales/eu.js +94 -0
  116. package/legacy/locales/index.js +1 -0
  117. package/legacy/timeViewRenderers/timeViewRenderers.js +0 -12
  118. package/locales/esES.js +6 -7
  119. package/locales/eu.d.ts +54 -0
  120. package/locales/eu.js +58 -0
  121. package/locales/index.d.ts +1 -0
  122. package/locales/index.js +1 -0
  123. package/modern/AdapterLuxon/AdapterLuxon.js +13 -3
  124. package/modern/DateCalendar/DateCalendar.js +3 -19
  125. package/modern/DateCalendar/DayCalendar.js +2 -4
  126. package/modern/DateCalendar/useCalendarState.js +2 -3
  127. package/modern/DateField/DateField.js +4 -20
  128. package/modern/DatePicker/DatePicker.js +0 -12
  129. package/modern/DatePicker/shared.js +1 -4
  130. package/modern/DateTimeField/DateTimeField.js +4 -20
  131. package/modern/DateTimePicker/DateTimePicker.js +0 -12
  132. package/modern/DateTimePicker/shared.js +3 -6
  133. package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -12
  134. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
  135. package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -12
  136. package/modern/DigitalClock/DigitalClock.js +14 -23
  137. package/modern/MobileDatePicker/MobileDatePicker.js +0 -12
  138. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
  139. package/modern/MobileTimePicker/MobileTimePicker.js +0 -12
  140. package/modern/MonthCalendar/MonthCalendar.js +3 -7
  141. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  142. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  143. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  144. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
  145. package/modern/PickersLayout/PickersLayout.js +0 -12
  146. package/modern/PickersLayout/usePickerLayout.js +2 -7
  147. package/modern/StaticDatePicker/StaticDatePicker.js +0 -12
  148. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
  149. package/modern/StaticTimePicker/StaticTimePicker.js +0 -12
  150. package/modern/TimeClock/TimeClock.js +3 -20
  151. package/modern/TimeField/TimeField.js +4 -20
  152. package/modern/TimePicker/TimePicker.js +0 -12
  153. package/modern/TimePicker/shared.js +3 -6
  154. package/modern/YearCalendar/YearCalendar.js +3 -7
  155. package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
  156. package/modern/dateViewRenderers/dateViewRenderers.js +0 -4
  157. package/modern/hooks/useClearableField.js +5 -7
  158. package/modern/index.js +1 -1
  159. package/modern/internals/index.js +0 -1
  160. package/modern/locales/esES.js +6 -7
  161. package/modern/locales/eu.js +58 -0
  162. package/modern/locales/index.js +1 -0
  163. package/modern/timeViewRenderers/timeViewRenderers.js +0 -12
  164. package/node/AdapterLuxon/AdapterLuxon.js +13 -3
  165. package/node/DateCalendar/DateCalendar.js +3 -19
  166. package/node/DateCalendar/DayCalendar.js +2 -4
  167. package/node/DateCalendar/useCalendarState.js +1 -2
  168. package/node/DateField/DateField.js +4 -20
  169. package/node/DatePicker/DatePicker.js +0 -12
  170. package/node/DatePicker/shared.js +1 -4
  171. package/node/DateTimeField/DateTimeField.js +4 -20
  172. package/node/DateTimePicker/DateTimePicker.js +0 -12
  173. package/node/DateTimePicker/shared.js +3 -6
  174. package/node/DesktopDatePicker/DesktopDatePicker.js +0 -12
  175. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
  176. package/node/DesktopTimePicker/DesktopTimePicker.js +0 -12
  177. package/node/DigitalClock/DigitalClock.js +14 -23
  178. package/node/MobileDatePicker/MobileDatePicker.js +0 -12
  179. package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
  180. package/node/MobileTimePicker/MobileTimePicker.js +0 -12
  181. package/node/MonthCalendar/MonthCalendar.js +3 -7
  182. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
  183. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
  184. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
  185. package/node/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
  186. package/node/PickersLayout/PickersLayout.js +0 -12
  187. package/node/PickersLayout/usePickerLayout.js +2 -7
  188. package/node/StaticDatePicker/StaticDatePicker.js +0 -12
  189. package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
  190. package/node/StaticTimePicker/StaticTimePicker.js +0 -12
  191. package/node/TimeClock/TimeClock.js +3 -20
  192. package/node/TimeField/TimeField.js +4 -20
  193. package/node/TimePicker/TimePicker.js +0 -12
  194. package/node/TimePicker/shared.js +3 -6
  195. package/node/YearCalendar/YearCalendar.js +3 -7
  196. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
  197. package/node/dateViewRenderers/dateViewRenderers.js +0 -4
  198. package/node/hooks/useClearableField.js +5 -7
  199. package/node/index.js +1 -1
  200. package/node/internals/index.js +0 -7
  201. package/node/locales/esES.js +6 -7
  202. package/node/locales/eu.js +64 -0
  203. package/node/locales/index.js +11 -0
  204. package/node/timeViewRenderers/timeViewRenderers.js +0 -12
  205. package/package.json +1 -1
  206. package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
  207. package/timeViewRenderers/timeViewRenderers.js +0 -12
  208. package/internals/utils/slots-migration.d.ts +0 -36
  209. package/internals/utils/slots-migration.js +0 -13
  210. package/legacy/internals/utils/slots-migration.js +0 -14
  211. package/modern/internals/utils/slots-migration.js +0 -13
  212. package/node/internals/utils/slots-migration.js +0 -21
@@ -16,7 +16,7 @@ var _utils2 = require("@mui/utils");
16
16
  var _useTimeField2 = require("./useTimeField");
17
17
  var _hooks = require("../hooks");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
19
+ const _excluded = ["slots", "slotProps", "InputProps", "inputProps"],
20
20
  _excluded2 = ["inputRef"],
21
21
  _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -39,17 +39,15 @@ const TimeField = exports.TimeField = /*#__PURE__*/React.forwardRef(function Tim
39
39
  const {
40
40
  slots,
41
41
  slotProps,
42
- components,
43
- componentsProps,
44
42
  InputProps,
45
43
  inputProps
46
44
  } = themeProps,
47
45
  other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
48
46
  const ownerState = themeProps;
49
- const TextField = slots?.textField ?? components?.TextField ?? _TextField.default;
47
+ const TextField = slots?.textField ?? _TextField.default;
50
48
  const _useSlotProps = (0, _utils.useSlotProps)({
51
49
  elementType: TextField,
52
- externalSlotProps: slotProps?.textField ?? componentsProps?.textField,
50
+ externalSlotProps: slotProps?.textField,
53
51
  externalForwardedProps: other,
54
52
  ownerState
55
53
  }),
@@ -84,9 +82,7 @@ const TimeField = exports.TimeField = /*#__PURE__*/React.forwardRef(function Tim
84
82
  fieldProps,
85
83
  InputProps: fieldProps.InputProps,
86
84
  slots,
87
- slotProps,
88
- components,
89
- componentsProps
85
+ slotProps
90
86
  });
91
87
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TextField, (0, _extends2.default)({
92
88
  ref: ref
@@ -131,18 +127,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
131
127
  */
132
128
  color: _propTypes.default.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
133
129
  component: _propTypes.default.elementType,
134
- /**
135
- * Overridable components.
136
- * @default {}
137
- * @deprecated Please use `slots`.
138
- */
139
- components: _propTypes.default.object,
140
- /**
141
- * The props used for each component slot.
142
- * @default {}
143
- * @deprecated Please use `slotProps`.
144
- */
145
- componentsProps: _propTypes.default.object,
146
130
  /**
147
131
  * The default value. Use when the component is not controlled.
148
132
  */
@@ -83,18 +83,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
83
83
  * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
84
84
  */
85
85
  closeOnSelect: _propTypes.default.bool,
86
- /**
87
- * Overridable components.
88
- * @default {}
89
- * @deprecated Please use `slots`.
90
- */
91
- components: _propTypes.default.object,
92
- /**
93
- * The props used for each component slot.
94
- * @default {}
95
- * @deprecated Please use `slotProps`.
96
- */
97
- componentsProps: _propTypes.default.object,
98
86
  /**
99
87
  * The default value.
100
88
  * Used when the component is not controlled.
@@ -11,7 +11,6 @@ var _styles = require("@mui/material/styles");
11
11
  var _useUtils = require("../internals/hooks/useUtils");
12
12
  var _TimePickerToolbar = require("./TimePickerToolbar");
13
13
  var _views = require("../internals/utils/views");
14
- var _slotsMigration = require("../internals/utils/slots-migration");
15
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
16
  function useTimePickerDefaultizedProps(props, name) {
@@ -29,8 +28,6 @@ function useTimePickerDefaultizedProps(props, name) {
29
28
  timePickerToolbarTitle: themeProps.localeText.toolbarTitle
30
29
  });
31
30
  }, [themeProps.localeText]);
32
- const slots = themeProps.slots ?? (0, _slotsMigration.uncapitalizeObjectKeys)(themeProps.components);
33
- const slotProps = themeProps.slotProps ?? themeProps.componentsProps;
34
31
  return (0, _extends2.default)({}, themeProps, {
35
32
  ampm,
36
33
  localeText
@@ -44,12 +41,12 @@ function useTimePickerDefaultizedProps(props, name) {
44
41
  disablePast: themeProps.disablePast ?? false,
45
42
  slots: (0, _extends2.default)({
46
43
  toolbar: _TimePickerToolbar.TimePickerToolbar
47
- }, slots),
48
- slotProps: (0, _extends2.default)({}, slotProps, {
44
+ }, themeProps.slots),
45
+ slotProps: (0, _extends2.default)({}, themeProps.slotProps, {
49
46
  toolbar: (0, _extends2.default)({
50
47
  ampm,
51
48
  ampmInClock: themeProps.ampmInClock
52
- }, slotProps?.toolbar)
49
+ }, themeProps.slotProps?.toolbar)
53
50
  })
54
51
  });
55
52
  }
@@ -92,7 +92,6 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
92
92
  onChange,
93
93
  readOnly,
94
94
  shouldDisableYear,
95
- disableHighlightToday,
96
95
  onYearFocus,
97
96
  hasFocus,
98
97
  onFocusedViewChange,
@@ -133,12 +132,9 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
133
132
  if (value != null) {
134
133
  return utils.getYear(value);
135
134
  }
136
- if (disableHighlightToday) {
137
- return null;
138
- }
139
- return utils.getYear(referenceDate);
140
- }, [value, utils, disableHighlightToday, referenceDate]);
141
- const [focusedYear, setFocusedYear] = React.useState(() => selectedYear || todayYear);
135
+ return null;
136
+ }, [value, utils]);
137
+ const [focusedYear, setFocusedYear] = React.useState(() => selectedYear || utils.getYear(referenceDate));
142
138
  const [internalHasFocus, setInternalHasFocus] = (0, _utils.unstable_useControlled)({
143
139
  name: 'YearCalendar',
144
140
  state: 'hasFocus',
@@ -51,8 +51,6 @@ const renderDesktopDateTimeView = ({
51
51
  onYearChange,
52
52
  yearsPerRow,
53
53
  defaultCalendarMonth,
54
- components,
55
- componentsProps,
56
54
  slots,
57
55
  slotProps,
58
56
  loading,
@@ -73,7 +71,7 @@ const renderDesktopDateTimeView = ({
73
71
  timeViewsCount,
74
72
  shouldRenderTimeInASingleColumn
75
73
  }) => {
76
- const isActionBarVisible = !!(0, _utils.resolveComponentProps)(slotProps?.actionBar ?? componentsProps?.actionBar, {})?.actions?.length;
74
+ const isActionBarVisible = !!(0, _utils.resolveComponentProps)(slotProps?.actionBar, {})?.actions?.length;
77
75
  const commonTimeProps = {
78
76
  view: (0, _timeUtils.isInternalTimeView)(view) ? view : 'hours',
79
77
  onViewChange,
@@ -94,8 +92,6 @@ const renderDesktopDateTimeView = ({
94
92
  shouldDisableClock,
95
93
  minutesStep,
96
94
  ampm,
97
- components,
98
- componentsProps,
99
95
  slots,
100
96
  slotProps,
101
97
  readOnly,
@@ -133,8 +129,6 @@ const renderDesktopDateTimeView = ({
133
129
  onYearChange: onYearChange,
134
130
  yearsPerRow: yearsPerRow,
135
131
  defaultCalendarMonth: defaultCalendarMonth,
136
- components: components,
137
- componentsProps: componentsProps,
138
132
  slots: slots,
139
133
  slotProps: slotProps,
140
134
  loading: loading,
@@ -35,8 +35,6 @@ const renderDateViewCalendar = ({
35
35
  onYearChange,
36
36
  yearsPerRow,
37
37
  defaultCalendarMonth,
38
- components,
39
- componentsProps,
40
38
  slots,
41
39
  slotProps,
42
40
  loading,
@@ -76,8 +74,6 @@ const renderDateViewCalendar = ({
76
74
  onYearChange: onYearChange,
77
75
  yearsPerRow: yearsPerRow,
78
76
  defaultCalendarMonth: defaultCalendarMonth,
79
- components: components,
80
- componentsProps: componentsProps,
81
77
  slots: slots,
82
78
  slotProps: slotProps,
83
79
  loading: loading,
@@ -23,16 +23,14 @@ const useClearableField = ({
23
23
  InputProps: ForwardedInputProps,
24
24
  onClear,
25
25
  slots,
26
- slotProps,
27
- components,
28
- componentsProps
26
+ slotProps
29
27
  }) => {
30
28
  const localeText = (0, _internals.useLocaleText)();
31
- const IconButton = slots?.clearButton ?? components?.ClearButton ?? _IconButton.default;
29
+ const IconButton = slots?.clearButton ?? _IconButton.default;
32
30
  // The spread is here to avoid this bug mui/material-ui#34056
33
31
  const _useSlotProps = (0, _utils.useSlotProps)({
34
32
  elementType: IconButton,
35
- externalSlotProps: slotProps?.clearButton ?? componentsProps?.clearButton,
33
+ externalSlotProps: slotProps?.clearButton,
36
34
  ownerState: {},
37
35
  className: 'clearButton',
38
36
  additionalProps: {
@@ -40,10 +38,10 @@ const useClearableField = ({
40
38
  }
41
39
  }),
42
40
  iconButtonProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded);
43
- const EndClearIcon = slots?.clearIcon ?? components?.ClearIcon ?? _icons.ClearIcon;
41
+ const EndClearIcon = slots?.clearIcon ?? _icons.ClearIcon;
44
42
  const endClearIconProps = (0, _utils.useSlotProps)({
45
43
  elementType: EndClearIcon,
46
- externalSlotProps: slotProps?.clearIcon ?? componentsProps?.clearIcon,
44
+ externalSlotProps: slotProps?.clearIcon,
47
45
  ownerState: {}
48
46
  });
49
47
  const InputProps = (0, _extends2.default)({}, ForwardedInputProps, {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.1
2
+ * @mui/x-date-pickers v7.0.0-alpha.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -171,12 +171,6 @@ Object.defineProperty(exports, "splitFieldInternalAndForwardedProps", {
171
171
  return _fields.splitFieldInternalAndForwardedProps;
172
172
  }
173
173
  });
174
- Object.defineProperty(exports, "uncapitalizeObjectKeys", {
175
- enumerable: true,
176
- get: function () {
177
- return _slotsMigration.uncapitalizeObjectKeys;
178
- }
179
- });
180
174
  Object.defineProperty(exports, "useCalendarState", {
181
175
  enumerable: true,
182
176
  get: function () {
@@ -307,6 +301,5 @@ var _validateDate = require("./utils/validation/validateDate");
307
301
  var _validateDateTime = require("./utils/validation/validateDateTime");
308
302
  var _validateTime = require("./utils/validation/validateTime");
309
303
  var _warning = require("./utils/warning");
310
- var _slotsMigration = require("./utils/slots-migration");
311
304
  var _DayCalendar = require("../DateCalendar/DayCalendar");
312
305
  var _useCalendarState = require("../DateCalendar/useCalendarState");
@@ -33,7 +33,7 @@ const esESPickers = {
33
33
  timePickerToolbarTitle: 'Seleccionar hora',
34
34
  dateRangePickerToolbarTitle: 'Seleccionar rango de fecha',
35
35
  // Clock labels
36
- clockLabelText: (view, time, adapter) => `Seleccione ${views[view]}. ${time === null ? 'Sin tiempo seleccionado' : `El tiempo seleccionado es ${adapter.format(time, 'fullTime')}`}`,
36
+ clockLabelText: (view, time, adapter) => `Seleccione ${views[view]}. ${time === null ? 'No hay hora seleccionada' : `La hora seleccionada es ${adapter.format(time, 'fullTime')}`}`,
37
37
  hoursClockNumberText: hours => `${hours} horas`,
38
38
  minutesClockNumberText: minutes => `${minutes} minutos`,
39
39
  secondsClockNumberText: seconds => `${seconds} segundos`,
@@ -45,13 +45,12 @@ const esESPickers = {
45
45
  calendarWeekNumberAriaLabelText: weekNumber => `Semana ${weekNumber}`,
46
46
  calendarWeekNumberText: weekNumber => `${weekNumber}`,
47
47
  // Open picker labels
48
- openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige la fecha, la fecha elegida es ${utils.format(value, 'fullDate')}` : 'Elige la fecha',
49
- openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige la hora, la hora elegido es ${utils.format(value, 'fullTime')}` : 'Elige la hora',
50
- // fieldClearLabel: 'Clear value',
51
-
48
+ openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige fecha, la fecha elegida es ${utils.format(value, 'fullDate')}` : 'Elige fecha',
49
+ openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige hora, la hora elegida es ${utils.format(value, 'fullTime')}` : 'Elige hora',
50
+ fieldClearLabel: 'Limpiar valor',
52
51
  // Table labels
53
- timeTableLabel: 'elige la fecha',
54
- dateTableLabel: 'elige la hora',
52
+ timeTableLabel: 'elige hora',
53
+ dateTableLabel: 'elige fecha',
55
54
  // Field section placeholders
56
55
  fieldYearPlaceholder: params => 'A'.repeat(params.digitAmount),
57
56
  fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.eu = void 0;
7
+ var _getPickersLocalization = require("./utils/getPickersLocalization");
8
+ const views = {
9
+ hours: 'orduak',
10
+ minutes: 'minutuak',
11
+ seconds: 'segunduak',
12
+ meridiem: 'meridianoa'
13
+ };
14
+ const euPickers = {
15
+ // Calendar navigation
16
+ previousMonth: 'Azken hilabetea',
17
+ nextMonth: 'Hurrengo hilabetea',
18
+ // View navigation
19
+ openPreviousView: 'azken bista ireki',
20
+ openNextView: 'hurrengo bista ireki',
21
+ calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'urteko bista irekita dago, aldatu egutegi bistara' : 'egutegi bista irekita dago, aldatu urteko bistara',
22
+ // DateRange placeholders
23
+ start: 'Hasi',
24
+ end: 'Bukatu',
25
+ // Action bar
26
+ cancelButtonLabel: 'Utxi',
27
+ clearButtonLabel: 'Garbitu',
28
+ okButtonLabel: 'OK',
29
+ todayButtonLabel: 'Gaur',
30
+ // Toolbar titles
31
+ datePickerToolbarTitle: 'Data aukeratu',
32
+ dateTimePickerToolbarTitle: 'Data eta ordua aukeratu',
33
+ timePickerToolbarTitle: 'Ordua aukeratu',
34
+ dateRangePickerToolbarTitle: 'Data tartea aukeratu',
35
+ // Clock labels
36
+ clockLabelText: (view, time, adapter) => `Aukeratu ${views[view]}. ${time === null ? 'Ez da ordurik aukertau' : `Aukeratutako ordua ${adapter.format(time, 'fullTime')} da`}`,
37
+ hoursClockNumberText: hours => `${hours} ordu`,
38
+ minutesClockNumberText: minutes => `${minutes} minutu`,
39
+ secondsClockNumberText: seconds => `${seconds} segundu`,
40
+ // Digital clock labels
41
+ selectViewText: view => `Aukeratu ${views[view]}`,
42
+ // Calendar labels
43
+ calendarWeekNumberHeaderLabel: 'Astea zenbakia',
44
+ calendarWeekNumberHeaderText: '#',
45
+ calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} astea`,
46
+ calendarWeekNumberText: weekNumber => `${weekNumber}`,
47
+ // Open picker labels
48
+ openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Data aukeratu, aukeratutako data ${utils.format(value, 'fullDate')} da` : 'Data aukeratu',
49
+ openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Ordua aukeratu, aukeratutako ordua ${utils.format(value, 'fullTime')} da` : 'Ordua aukeratu',
50
+ fieldClearLabel: 'Balioa garbitu',
51
+ // Table labels
52
+ timeTableLabel: 'ordua aukeratu',
53
+ dateTableLabel: 'data aukeratu',
54
+ // Field section placeholders
55
+ fieldYearPlaceholder: params => 'Y'.repeat(params.digitAmount),
56
+ fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
57
+ fieldDayPlaceholder: () => 'DD',
58
+ fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
59
+ fieldHoursPlaceholder: () => 'hh',
60
+ fieldMinutesPlaceholder: () => 'mm',
61
+ fieldSecondsPlaceholder: () => 'ss',
62
+ fieldMeridiemPlaceholder: () => 'aa'
63
+ };
64
+ const eu = exports.eu = (0, _getPickersLocalization.getPickersLocalization)(euPickers);
@@ -80,6 +80,17 @@ Object.keys(_esES).forEach(function (key) {
80
80
  }
81
81
  });
82
82
  });
83
+ var _eu = require("./eu");
84
+ Object.keys(_eu).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _eu[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _eu[key];
91
+ }
92
+ });
93
+ });
83
94
  var _faIR = require("./faIR");
84
95
  Object.keys(_faIR).forEach(function (key) {
85
96
  if (key === "default" || key === "__esModule") return;
@@ -33,8 +33,6 @@ const renderTimeViewClock = ({
33
33
  minutesStep,
34
34
  ampm,
35
35
  ampmInClock,
36
- components,
37
- componentsProps,
38
36
  slots,
39
37
  slotProps,
40
38
  readOnly,
@@ -65,8 +63,6 @@ const renderTimeViewClock = ({
65
63
  minutesStep: minutesStep,
66
64
  ampm: ampm,
67
65
  ampmInClock: ampmInClock,
68
- components: components,
69
- componentsProps: componentsProps,
70
66
  slots: slots,
71
67
  slotProps: slotProps,
72
68
  readOnly: readOnly,
@@ -98,8 +94,6 @@ const renderDigitalClockTimeView = ({
98
94
  shouldDisableClock,
99
95
  minutesStep,
100
96
  ampm,
101
- components,
102
- componentsProps,
103
97
  slots,
104
98
  slotProps,
105
99
  readOnly,
@@ -130,8 +124,6 @@ const renderDigitalClockTimeView = ({
130
124
  shouldDisableClock: shouldDisableClock,
131
125
  minutesStep: minutesStep,
132
126
  ampm: ampm,
133
- components: components,
134
- componentsProps: componentsProps,
135
127
  slots: slots,
136
128
  slotProps: slotProps,
137
129
  readOnly: readOnly,
@@ -164,8 +156,6 @@ const renderMultiSectionDigitalClockTimeView = ({
164
156
  shouldDisableClock,
165
157
  minutesStep,
166
158
  ampm,
167
- components,
168
- componentsProps,
169
159
  slots,
170
160
  slotProps,
171
161
  readOnly,
@@ -196,8 +186,6 @@ const renderMultiSectionDigitalClockTimeView = ({
196
186
  shouldDisableClock: shouldDisableClock,
197
187
  minutesStep: minutesStep,
198
188
  ampm: ampm,
199
- components: components,
200
- componentsProps: componentsProps,
201
189
  slots: slots,
202
190
  slotProps: slotProps,
203
191
  readOnly: readOnly,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.18.1",
3
+ "version": "7.0.0-alpha.0",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -11,6 +11,6 @@ export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponent
11
11
  onViewChange?: (view: TView) => void;
12
12
  views: readonly TView[];
13
13
  };
14
- export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, ampmInClock, components, componentsProps, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TDate, TimeView>>) => React.JSX.Element;
15
- export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, components, componentsProps, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<"hours", Omit<DigitalClockProps<TDate>, "timeStep"> & Pick<TimePickerProps<TDate>, "timeSteps">>) => React.JSX.Element;
16
- export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, components, componentsProps, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps<TDate>>) => React.JSX.Element;
14
+ export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TDate, TimeView>>) => React.JSX.Element;
15
+ export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<"hours", Omit<DigitalClockProps<TDate>, "timeStep"> & Pick<TimePickerProps<TDate>, "timeSteps">>) => React.JSX.Element;
16
+ export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps<TDate>>) => React.JSX.Element;
@@ -25,8 +25,6 @@ export const renderTimeViewClock = ({
25
25
  minutesStep,
26
26
  ampm,
27
27
  ampmInClock,
28
- components,
29
- componentsProps,
30
28
  slots,
31
29
  slotProps,
32
30
  readOnly,
@@ -57,8 +55,6 @@ export const renderTimeViewClock = ({
57
55
  minutesStep: minutesStep,
58
56
  ampm: ampm,
59
57
  ampmInClock: ampmInClock,
60
- components: components,
61
- componentsProps: componentsProps,
62
58
  slots: slots,
63
59
  slotProps: slotProps,
64
60
  readOnly: readOnly,
@@ -89,8 +85,6 @@ export const renderDigitalClockTimeView = ({
89
85
  shouldDisableClock,
90
86
  minutesStep,
91
87
  ampm,
92
- components,
93
- componentsProps,
94
88
  slots,
95
89
  slotProps,
96
90
  readOnly,
@@ -121,8 +115,6 @@ export const renderDigitalClockTimeView = ({
121
115
  shouldDisableClock: shouldDisableClock,
122
116
  minutesStep: minutesStep,
123
117
  ampm: ampm,
124
- components: components,
125
- componentsProps: componentsProps,
126
118
  slots: slots,
127
119
  slotProps: slotProps,
128
120
  readOnly: readOnly,
@@ -154,8 +146,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
154
146
  shouldDisableClock,
155
147
  minutesStep,
156
148
  ampm,
157
- components,
158
- componentsProps,
159
149
  slots,
160
150
  slotProps,
161
151
  readOnly,
@@ -186,8 +176,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
186
176
  shouldDisableClock: shouldDisableClock,
187
177
  minutesStep: minutesStep,
188
178
  ampm: ampm,
189
- components: components,
190
- componentsProps: componentsProps,
191
179
  slots: slots,
192
180
  slotProps: slotProps,
193
181
  readOnly: readOnly,
@@ -1,36 +0,0 @@
1
- type OptionalKeys<T extends object> = Exclude<{
2
- [K in keyof T]: {} extends Pick<T, K> ? K : never;
3
- }[keyof T], undefined>;
4
- type UncapitalizeKeys<T extends object> = Uncapitalize<keyof T & string>;
5
- export type UncapitalizeObjectKeys<T extends object> = {
6
- [key in UncapitalizeKeys<Pick<T, OptionalKeys<T>>>]?: Capitalize<key> extends keyof T ? T[Capitalize<key>] : never;
7
- } & {
8
- [key in UncapitalizeKeys<Omit<T, OptionalKeys<T>>>]: Capitalize<key> extends keyof T ? T[Capitalize<key>] : never;
9
- };
10
- export interface SlotsAndSlotProps<TSlots extends object, TSlotProps> {
11
- /**
12
- * Overridable components.
13
- * @default {}
14
- * @deprecated Please use `slots`.
15
- */
16
- components?: TSlots;
17
- /**
18
- * The props used for each component slot.
19
- * @default {}
20
- * @deprecated Please use `slotProps`.
21
- */
22
- componentsProps?: TSlotProps;
23
- /**
24
- * Overridable component slots.
25
- * @default {}
26
- */
27
- slots?: UncapitalizeObjectKeys<TSlots>;
28
- /**
29
- * The props used for each component slot.
30
- * @default {}
31
- */
32
- slotProps?: TSlotProps;
33
- }
34
- type ObjectWithUnCapitalizedKeys<TInputType> = TInputType extends object ? UncapitalizeObjectKeys<TInputType> : undefined;
35
- export declare const uncapitalizeObjectKeys: <TInputType extends object>(capitalizedObject: TInputType | undefined) => ObjectWithUnCapitalizedKeys<TInputType> | undefined;
36
- export {};
@@ -1,13 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- // TODO v7: This file exist only to simplify typing between
3
- // components/componentsProps and slots/slotProps
4
- // Should be deleted when components/componentsProps are removed
5
-
6
- export const uncapitalizeObjectKeys = capitalizedObject => {
7
- if (capitalizedObject === undefined) {
8
- return undefined;
9
- }
10
- return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
11
- [`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
12
- }), {});
13
- };
@@ -1,14 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- // TODO v7: This file exist only to simplify typing between
4
- // components/componentsProps and slots/slotProps
5
- // Should be deleted when components/componentsProps are removed
6
-
7
- export var uncapitalizeObjectKeys = function uncapitalizeObjectKeys(capitalizedObject) {
8
- if (capitalizedObject === undefined) {
9
- return undefined;
10
- }
11
- return Object.keys(capitalizedObject).reduce(function (acc, key) {
12
- return _extends({}, acc, _defineProperty({}, "".concat(key.slice(0, 1).toLowerCase()).concat(key.slice(1)), capitalizedObject[key]));
13
- }, {});
14
- };
@@ -1,13 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- // TODO v7: This file exist only to simplify typing between
3
- // components/componentsProps and slots/slotProps
4
- // Should be deleted when components/componentsProps are removed
5
-
6
- export const uncapitalizeObjectKeys = capitalizedObject => {
7
- if (capitalizedObject === undefined) {
8
- return undefined;
9
- }
10
- return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
11
- [`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
12
- }), {});
13
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.uncapitalizeObjectKeys = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- // TODO v7: This file exist only to simplify typing between
10
- // components/componentsProps and slots/slotProps
11
- // Should be deleted when components/componentsProps are removed
12
-
13
- const uncapitalizeObjectKeys = capitalizedObject => {
14
- if (capitalizedObject === undefined) {
15
- return undefined;
16
- }
17
- return Object.keys(capitalizedObject).reduce((acc, key) => (0, _extends2.default)({}, acc, {
18
- [`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
19
- }), {});
20
- };
21
- exports.uncapitalizeObjectKeys = uncapitalizeObjectKeys;