@mui/x-date-pickers-pro 7.7.0 → 7.7.1

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 (35) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +8 -3
  3. package/DateRangePicker/DateRangePicker.js +2 -0
  4. package/DateTimeRangePicker/DateTimeRangePicker.js +2 -0
  5. package/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -0
  6. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -0
  7. package/MobileDateRangePicker/MobileDateRangePicker.js +2 -0
  8. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -0
  9. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +9 -2
  10. package/StaticDateRangePicker/StaticDateRangePicker.js +2 -0
  11. package/index.js +1 -1
  12. package/internals/utils/releaseInfo.js +1 -1
  13. package/modern/DateRangeCalendar/DateRangeCalendar.js +8 -3
  14. package/modern/DateRangePicker/DateRangePicker.js +2 -0
  15. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -0
  16. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -0
  17. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -0
  18. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +2 -0
  19. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -0
  20. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +9 -2
  21. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +2 -0
  22. package/modern/index.js +1 -1
  23. package/modern/internals/utils/releaseInfo.js +1 -1
  24. package/node/DateRangeCalendar/DateRangeCalendar.js +9 -4
  25. package/node/DateRangePicker/DateRangePicker.js +2 -0
  26. package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -0
  27. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -0
  28. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -0
  29. package/node/MobileDateRangePicker/MobileDateRangePicker.js +2 -0
  30. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -0
  31. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +9 -2
  32. package/node/StaticDateRangePicker/StaticDateRangePicker.js +2 -0
  33. package/node/index.js +1 -1
  34. package/node/internals/utils/releaseInfo.js +1 -1
  35. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,88 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.7.1
7
+
8
+ _Jun 21, 2024_
9
+
10
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Improve Portuguese (pt-PT) locale on the Data Grid
13
+ - 🌍 Improve Danish (da-DK) locale on the Date and Time Pickers
14
+ - 🐞 Bugfixes
15
+ - 📚 Documentation improvements
16
+
17
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
18
+
19
+ ### Data Grid
20
+
21
+ #### `@mui/x-data-grid@7.7.1`
22
+
23
+ - [DataGrid][docs] Clarify enabling pagination (#13350) @oliviertassinari
24
+ - [DataGrid] Fix CSV export escaping for non-string values (#13560) @joeycumines-scw
25
+ - [l10n] Improve Portuguese (pt-PT) locale (#13348) @joaosreis
26
+
27
+ #### `@mui/x-data-grid-pro@7.7.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
28
+
29
+ Same changes as in `@mui/x-data-grid@7.7.1`, plus:
30
+
31
+ - [DataGrid] Warn about `getTreeDataPath` reference (#13519) @cherniavskii
32
+
33
+ #### `@mui/x-data-grid-premium@7.7.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
34
+
35
+ Same changes as in `@mui/x-data-grid-pro@7.7.1`.
36
+
37
+ ### Date and Time Pickers
38
+
39
+ #### `@mui/x-date-pickers@7.7.1`
40
+
41
+ - [fields] Prevent digit editing on the `Space` key down (#13510) @flaviendelangle
42
+ - [l10n] Improve Danish (da-DK) locale (#13375) @jacrowland1
43
+ - [pickers] Add context to `onAccept` callback (#13511) @flaviendelangle
44
+ - [pickers] Always use the same timezone in the field, the view and the layout components (#13481) @flaviendelangle
45
+ - [pickers] Fix `AdapterDateFnsV3` generated method types (#13464) @alexey-kozlenkov
46
+ - [pickers] Fix controlled `view` behavior (#13552) @LukasTy
47
+ - [TimePicker] Improves RTL verification for the time pickers default views (#13447) @arthurbalduini
48
+
49
+ #### `@mui/x-date-pickers-pro@7.7.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-date-pickers@7.7.1`, plus:
52
+
53
+ - [DateRangePicker] Add accessible name to calendar grid (#13538) @LukasTy
54
+
55
+ ### Charts
56
+
57
+ #### `@mui/x-charts@7.7.1`
58
+
59
+ - [charts] Divide `CartesianProvider` to use logic in Pro package (#13531) @JCQuintas
60
+ - [charts] Do not publish the pro package (#13539) @alexfauquette
61
+ - [charts] Export `Pro` versions of regular charts (#13547) @JCQuintas
62
+ - [charts] Prepare `ChartContainerPro` for future Zoom changes (#13532) @JCQuintas
63
+ - [charts] Remove unnecessary proptypes from internal component (#13518) @JCQuintas
64
+
65
+ ### Tree View
66
+
67
+ #### `@mui/x-tree-view@7.7.1`
68
+
69
+ - [TreeView] Improve typing to support optional dependencies in plugins and in the item (#13523) @flaviendelangle
70
+ - [TreeView] Move `useTreeViewId` to the core plugins (#13566) @flaviendelangle
71
+ - [TreeView] Remove unused state from `useTreeViewId` (#13579) @flaviendelangle
72
+ - [TreeView] Support `itemId` with escaping characters when using `SimpleTreeView` (#13487) @oukunan
73
+
74
+ ### Docs
75
+
76
+ - [docs] Add section about the new uncovered product watermark (#13568) @michelengelen
77
+ - [docs] Document the `PickerValidDate` type override (#13476) @flaviendelangle
78
+ - [docs] Fix typo (#13507) @anshtiwatne
79
+ - [docs] Remove "-" in heat-map and tree-map urls (#13569) @alexfauquette
80
+ - [docs] Use dedicated tab for weather dataset (#13513) @alexfauquette
81
+ - [x-license] license update proposal (#13459) @michelengelen
82
+
83
+ ### Core
84
+
85
+ - [core] Fix failing CI test (#13574) @alexfauquette
86
+ - [infra] Remove explicit `@testing-library/react` dependency (#13478) @LukasTy
87
+
6
88
  ## 7.7.0
7
89
 
8
90
  _Jun 13, 2024_
@@ -9,7 +9,8 @@ import useEventCallback from '@mui/utils/useEventCallback';
9
9
  import useMediaQuery from '@mui/material/useMediaQuery';
10
10
  import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
12
+ import composeClasses from '@mui/utils/composeClasses';
13
+ import useId from '@mui/utils/useId';
13
14
  import { Watermark } from '@mui/x-license';
14
15
  import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, buildWarning, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
15
16
  import { getReleaseInfo } from '../internals/utils/releaseInfo';
@@ -184,6 +185,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
184
185
  });
185
186
  const utils = useUtils();
186
187
  const now = useNow(timezone);
188
+ const id = useId();
187
189
  const {
188
190
  rangePosition,
189
191
  onRangePositionChange
@@ -437,11 +439,13 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
437
439
  releaseInfo: releaseInfo
438
440
  }), calendarMonths.map(monthIndex => {
439
441
  const month = visibleMonths[monthIndex];
442
+ const labelId = `${id}-grid-${monthIndex}-label`;
440
443
  return /*#__PURE__*/_jsxs(DateRangeCalendarMonthContainer, {
441
444
  className: classes.monthContainer,
442
445
  children: [/*#__PURE__*/_jsx(CalendarHeader, _extends({}, calendarHeaderProps, {
443
446
  month: month,
444
- monthIndex: monthIndex
447
+ monthIndex: monthIndex,
448
+ labelId: labelId
445
449
  })), /*#__PURE__*/_jsx(DayCalendarForRange, _extends({
446
450
  className: classes.dayCalendar
447
451
  }, calendarState, baseDateValidationProps, commonViewProps, {
@@ -462,7 +466,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
462
466
  autoFocus: month === focusedMonth,
463
467
  fixedWeekNumber: fixedWeekNumber,
464
468
  displayWeekNumber: displayWeekNumber,
465
- timezone: timezone
469
+ timezone: timezone,
470
+ gridLabelId: labelId
466
471
  }))]
467
472
  }, monthIndex);
468
473
  })]
@@ -190,7 +190,9 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
190
190
  /**
191
191
  * Callback fired when the value is accepted.
192
192
  * @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.
193
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
193
194
  * @param {TValue} value The value that was just accepted.
195
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
194
196
  */
195
197
  onAccept: PropTypes.func,
196
198
  /**
@@ -223,7 +223,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
223
223
  /**
224
224
  * Callback fired when the value is accepted.
225
225
  * @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.
226
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
226
227
  * @param {TValue} value The value that was just accepted.
228
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
227
229
  */
228
230
  onAccept: PropTypes.func,
229
231
  /**
@@ -195,7 +195,9 @@ DesktopDateRangePicker.propTypes = {
195
195
  /**
196
196
  * Callback fired when the value is accepted.
197
197
  * @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.
198
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
198
199
  * @param {TValue} value The value that was just accepted.
200
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
199
201
  */
200
202
  onAccept: PropTypes.func,
201
203
  /**
@@ -301,7 +301,9 @@ DesktopDateTimeRangePicker.propTypes = {
301
301
  /**
302
302
  * Callback fired when the value is accepted.
303
303
  * @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.
304
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
304
305
  * @param {TValue} value The value that was just accepted.
306
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
305
307
  */
306
308
  onAccept: PropTypes.func,
307
309
  /**
@@ -191,7 +191,9 @@ MobileDateRangePicker.propTypes = {
191
191
  /**
192
192
  * Callback fired when the value is accepted.
193
193
  * @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.
194
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
194
195
  * @param {TValue} value The value that was just accepted.
196
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
195
197
  */
196
198
  onAccept: PropTypes.func,
197
199
  /**
@@ -295,7 +295,9 @@ MobileDateTimeRangePicker.propTypes = {
295
295
  /**
296
296
  * Callback fired when the value is accepted.
297
297
  * @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.
298
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
298
299
  * @param {TValue} value The value that was just accepted.
300
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
299
301
  */
300
302
  onAccept: PropTypes.func,
301
303
  /**
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["calendars", "month", "monthIndex"];
3
+ const _excluded = ["calendars", "month", "monthIndex", "labelId"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
@@ -19,7 +19,8 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
19
19
  const {
20
20
  calendars,
21
21
  month,
22
- monthIndex
22
+ monthIndex,
23
+ labelId
23
24
  } = props,
24
25
  other = _objectWithoutPropertiesLoose(props, _excluded);
25
26
  const {
@@ -46,6 +47,7 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
46
47
  });
47
48
  if (calendars === 1) {
48
49
  return /*#__PURE__*/_jsx(PickersCalendarHeader, _extends({}, other, {
50
+ labelId: labelId,
49
51
  ref: ref
50
52
  }));
51
53
  }
@@ -63,6 +65,7 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
63
65
  nextLabel: localeText.nextMonth,
64
66
  slots: slots,
65
67
  slotProps: slotProps,
68
+ labelId: labelId,
66
69
  children: utils.formatByString(month, format ?? `${utils.formats.month} ${utils.formats.year}`)
67
70
  });
68
71
  });
@@ -89,6 +92,10 @@ process.env.NODE_ENV !== "production" ? PickersRangeCalendarHeader.propTypes = {
89
92
  * @default `${adapter.formats.month} ${adapter.formats.year}`
90
93
  */
91
94
  format: PropTypes.string,
95
+ /**
96
+ * Id of the calendar text element.
97
+ * It is used to establish an `aria-labelledby` relationship with the calendar `grid` element.
98
+ */
92
99
  labelId: PropTypes.string,
93
100
  maxDate: PropTypes.object.isRequired,
94
101
  minDate: PropTypes.object.isRequired,
@@ -154,7 +154,9 @@ StaticDateRangePicker.propTypes = {
154
154
  /**
155
155
  * Callback fired when the value is accepted.
156
156
  * @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.
157
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
157
158
  * @param {TValue} value The value that was just accepted.
159
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
158
160
  */
159
161
  onAccept: PropTypes.func,
160
162
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.0
2
+ * @mui/x-date-pickers-pro v7.7.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxODIyNjAwMDAwMA==";
3
+ const releaseInfo = "MTcxODkyMDgwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -9,7 +9,8 @@ import useEventCallback from '@mui/utils/useEventCallback';
9
9
  import useMediaQuery from '@mui/material/useMediaQuery';
10
10
  import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
12
+ import composeClasses from '@mui/utils/composeClasses';
13
+ import useId from '@mui/utils/useId';
13
14
  import { Watermark } from '@mui/x-license';
14
15
  import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, buildWarning, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
15
16
  import { getReleaseInfo } from '../internals/utils/releaseInfo';
@@ -184,6 +185,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
184
185
  });
185
186
  const utils = useUtils();
186
187
  const now = useNow(timezone);
188
+ const id = useId();
187
189
  const {
188
190
  rangePosition,
189
191
  onRangePositionChange
@@ -437,11 +439,13 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
437
439
  releaseInfo: releaseInfo
438
440
  }), calendarMonths.map(monthIndex => {
439
441
  const month = visibleMonths[monthIndex];
442
+ const labelId = `${id}-grid-${monthIndex}-label`;
440
443
  return /*#__PURE__*/_jsxs(DateRangeCalendarMonthContainer, {
441
444
  className: classes.monthContainer,
442
445
  children: [/*#__PURE__*/_jsx(CalendarHeader, _extends({}, calendarHeaderProps, {
443
446
  month: month,
444
- monthIndex: monthIndex
447
+ monthIndex: monthIndex,
448
+ labelId: labelId
445
449
  })), /*#__PURE__*/_jsx(DayCalendarForRange, _extends({
446
450
  className: classes.dayCalendar
447
451
  }, calendarState, baseDateValidationProps, commonViewProps, {
@@ -462,7 +466,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
462
466
  autoFocus: month === focusedMonth,
463
467
  fixedWeekNumber: fixedWeekNumber,
464
468
  displayWeekNumber: displayWeekNumber,
465
- timezone: timezone
469
+ timezone: timezone,
470
+ gridLabelId: labelId
466
471
  }))]
467
472
  }, monthIndex);
468
473
  })]
@@ -190,7 +190,9 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
190
190
  /**
191
191
  * Callback fired when the value is accepted.
192
192
  * @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.
193
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
193
194
  * @param {TValue} value The value that was just accepted.
195
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
194
196
  */
195
197
  onAccept: PropTypes.func,
196
198
  /**
@@ -223,7 +223,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
223
223
  /**
224
224
  * Callback fired when the value is accepted.
225
225
  * @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.
226
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
226
227
  * @param {TValue} value The value that was just accepted.
228
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
227
229
  */
228
230
  onAccept: PropTypes.func,
229
231
  /**
@@ -195,7 +195,9 @@ DesktopDateRangePicker.propTypes = {
195
195
  /**
196
196
  * Callback fired when the value is accepted.
197
197
  * @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.
198
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
198
199
  * @param {TValue} value The value that was just accepted.
200
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
199
201
  */
200
202
  onAccept: PropTypes.func,
201
203
  /**
@@ -301,7 +301,9 @@ DesktopDateTimeRangePicker.propTypes = {
301
301
  /**
302
302
  * Callback fired when the value is accepted.
303
303
  * @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.
304
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
304
305
  * @param {TValue} value The value that was just accepted.
306
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
305
307
  */
306
308
  onAccept: PropTypes.func,
307
309
  /**
@@ -191,7 +191,9 @@ MobileDateRangePicker.propTypes = {
191
191
  /**
192
192
  * Callback fired when the value is accepted.
193
193
  * @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.
194
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
194
195
  * @param {TValue} value The value that was just accepted.
196
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
195
197
  */
196
198
  onAccept: PropTypes.func,
197
199
  /**
@@ -295,7 +295,9 @@ MobileDateTimeRangePicker.propTypes = {
295
295
  /**
296
296
  * Callback fired when the value is accepted.
297
297
  * @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.
298
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
298
299
  * @param {TValue} value The value that was just accepted.
300
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
299
301
  */
300
302
  onAccept: PropTypes.func,
301
303
  /**
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["calendars", "month", "monthIndex"];
3
+ const _excluded = ["calendars", "month", "monthIndex", "labelId"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
@@ -19,7 +19,8 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
19
19
  const {
20
20
  calendars,
21
21
  month,
22
- monthIndex
22
+ monthIndex,
23
+ labelId
23
24
  } = props,
24
25
  other = _objectWithoutPropertiesLoose(props, _excluded);
25
26
  const {
@@ -46,6 +47,7 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
46
47
  });
47
48
  if (calendars === 1) {
48
49
  return /*#__PURE__*/_jsx(PickersCalendarHeader, _extends({}, other, {
50
+ labelId: labelId,
49
51
  ref: ref
50
52
  }));
51
53
  }
@@ -63,6 +65,7 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
63
65
  nextLabel: localeText.nextMonth,
64
66
  slots: slots,
65
67
  slotProps: slotProps,
68
+ labelId: labelId,
66
69
  children: utils.formatByString(month, format ?? `${utils.formats.month} ${utils.formats.year}`)
67
70
  });
68
71
  });
@@ -89,6 +92,10 @@ process.env.NODE_ENV !== "production" ? PickersRangeCalendarHeader.propTypes = {
89
92
  * @default `${adapter.formats.month} ${adapter.formats.year}`
90
93
  */
91
94
  format: PropTypes.string,
95
+ /**
96
+ * Id of the calendar text element.
97
+ * It is used to establish an `aria-labelledby` relationship with the calendar `grid` element.
98
+ */
92
99
  labelId: PropTypes.string,
93
100
  maxDate: PropTypes.object.isRequired,
94
101
  minDate: PropTypes.object.isRequired,
@@ -154,7 +154,9 @@ StaticDateRangePicker.propTypes = {
154
154
  /**
155
155
  * Callback fired when the value is accepted.
156
156
  * @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.
157
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
157
158
  * @param {TValue} value The value that was just accepted.
159
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
158
160
  */
159
161
  onAccept: PropTypes.func,
160
162
  /**
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.0
2
+ * @mui/x-date-pickers-pro v7.7.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxODIyNjAwMDAwMA==";
3
+ const releaseInfo = "MTcxODkyMDgwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -14,7 +14,8 @@ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallb
14
14
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
15
15
  var _utils = require("@mui/base/utils");
16
16
  var _styles = require("@mui/material/styles");
17
- var _utils2 = require("@mui/utils");
17
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
18
+ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
18
19
  var _xLicense = require("@mui/x-license");
19
20
  var _internals = require("@mui/x-date-pickers/internals");
20
21
  var _releaseInfo = require("../internals/utils/releaseInfo");
@@ -111,7 +112,7 @@ const useUtilityClasses = ownerState => {
111
112
  monthContainer: ['monthContainer'],
112
113
  dayCalendar: [isDragging && 'dayDragging']
113
114
  };
114
- return (0, _utils2.unstable_composeClasses)(slots, _dateRangeCalendarClasses.getDateRangeCalendarUtilityClass, classes);
115
+ return (0, _composeClasses.default)(slots, _dateRangeCalendarClasses.getDateRangeCalendarUtilityClass, classes);
115
116
  };
116
117
  /**
117
118
  * Demos:
@@ -193,6 +194,7 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
193
194
  });
194
195
  const utils = (0, _internals.useUtils)();
195
196
  const now = (0, _internals.useNow)(timezone);
197
+ const id = (0, _useId.default)();
196
198
  const {
197
199
  rangePosition,
198
200
  onRangePositionChange
@@ -446,11 +448,13 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
446
448
  releaseInfo: releaseInfo
447
449
  }), calendarMonths.map(monthIndex => {
448
450
  const month = visibleMonths[monthIndex];
451
+ const labelId = `${id}-grid-${monthIndex}-label`;
449
452
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateRangeCalendarMonthContainer, {
450
453
  className: classes.monthContainer,
451
454
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarHeader, (0, _extends2.default)({}, calendarHeaderProps, {
452
455
  month: month,
453
- monthIndex: monthIndex
456
+ monthIndex: monthIndex,
457
+ labelId: labelId
454
458
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(DayCalendarForRange, (0, _extends2.default)({
455
459
  className: classes.dayCalendar
456
460
  }, calendarState, baseDateValidationProps, commonViewProps, {
@@ -471,7 +475,8 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
471
475
  autoFocus: month === focusedMonth,
472
476
  fixedWeekNumber: fixedWeekNumber,
473
477
  displayWeekNumber: displayWeekNumber,
474
- timezone: timezone
478
+ timezone: timezone,
479
+ gridLabelId: labelId
475
480
  }))]
476
481
  }, monthIndex);
477
482
  })]
@@ -199,7 +199,9 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
199
199
  /**
200
200
  * Callback fired when the value is accepted.
201
201
  * @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.
202
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
202
203
  * @param {TValue} value The value that was just accepted.
204
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
203
205
  */
204
206
  onAccept: _propTypes.default.func,
205
207
  /**
@@ -232,7 +232,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
232
232
  /**
233
233
  * Callback fired when the value is accepted.
234
234
  * @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.
235
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
235
236
  * @param {TValue} value The value that was just accepted.
237
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
236
238
  */
237
239
  onAccept: _propTypes.default.func,
238
240
  /**
@@ -204,7 +204,9 @@ DesktopDateRangePicker.propTypes = {
204
204
  /**
205
205
  * Callback fired when the value is accepted.
206
206
  * @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.
207
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
207
208
  * @param {TValue} value The value that was just accepted.
209
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
208
210
  */
209
211
  onAccept: _propTypes.default.func,
210
212
  /**
@@ -310,7 +310,9 @@ DesktopDateTimeRangePicker.propTypes = {
310
310
  /**
311
311
  * Callback fired when the value is accepted.
312
312
  * @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.
313
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
313
314
  * @param {TValue} value The value that was just accepted.
315
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
314
316
  */
315
317
  onAccept: _propTypes.default.func,
316
318
  /**
@@ -200,7 +200,9 @@ MobileDateRangePicker.propTypes = {
200
200
  /**
201
201
  * Callback fired when the value is accepted.
202
202
  * @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.
203
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
203
204
  * @param {TValue} value The value that was just accepted.
205
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
204
206
  */
205
207
  onAccept: _propTypes.default.func,
206
208
  /**
@@ -304,7 +304,9 @@ MobileDateTimeRangePicker.propTypes = {
304
304
  /**
305
305
  * Callback fired when the value is accepted.
306
306
  * @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.
307
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
307
308
  * @param {TValue} value The value that was just accepted.
309
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
308
310
  */
309
311
  onAccept: _propTypes.default.func,
310
312
  /**
@@ -13,7 +13,7 @@ var _styles = require("@mui/material/styles");
13
13
  var _PickersCalendarHeader = require("@mui/x-date-pickers/PickersCalendarHeader");
14
14
  var _internals = require("@mui/x-date-pickers/internals");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["calendars", "month", "monthIndex"];
16
+ const _excluded = ["calendars", "month", "monthIndex", "labelId"];
17
17
  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); }
18
18
  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 && {}.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; }
19
19
  const PickersRangeCalendarHeaderContentMultipleCalendars = (0, _styles.styled)(_internals.PickersArrowSwitcher)({
@@ -28,7 +28,8 @@ const PickersRangeCalendarHeader = exports.PickersRangeCalendarHeader = /*#__PUR
28
28
  const {
29
29
  calendars,
30
30
  month,
31
- monthIndex
31
+ monthIndex,
32
+ labelId
32
33
  } = props,
33
34
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
34
35
  const {
@@ -55,6 +56,7 @@ const PickersRangeCalendarHeader = exports.PickersRangeCalendarHeader = /*#__PUR
55
56
  });
56
57
  if (calendars === 1) {
57
58
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersCalendarHeader.PickersCalendarHeader, (0, _extends2.default)({}, other, {
59
+ labelId: labelId,
58
60
  ref: ref
59
61
  }));
60
62
  }
@@ -72,6 +74,7 @@ const PickersRangeCalendarHeader = exports.PickersRangeCalendarHeader = /*#__PUR
72
74
  nextLabel: localeText.nextMonth,
73
75
  slots: slots,
74
76
  slotProps: slotProps,
77
+ labelId: labelId,
75
78
  children: utils.formatByString(month, format ?? `${utils.formats.month} ${utils.formats.year}`)
76
79
  });
77
80
  });
@@ -98,6 +101,10 @@ process.env.NODE_ENV !== "production" ? PickersRangeCalendarHeader.propTypes = {
98
101
  * @default `${adapter.formats.month} ${adapter.formats.year}`
99
102
  */
100
103
  format: _propTypes.default.string,
104
+ /**
105
+ * Id of the calendar text element.
106
+ * It is used to establish an `aria-labelledby` relationship with the calendar `grid` element.
107
+ */
101
108
  labelId: _propTypes.default.string,
102
109
  maxDate: _propTypes.default.object.isRequired,
103
110
  minDate: _propTypes.default.object.isRequired,
@@ -163,7 +163,9 @@ StaticDateRangePicker.propTypes = {
163
163
  /**
164
164
  * Callback fired when the value is accepted.
165
165
  * @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.
166
+ * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
166
167
  * @param {TValue} value The value that was just accepted.
168
+ * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
167
169
  */
168
170
  onAccept: _propTypes.default.func,
169
171
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.0
2
+ * @mui/x-date-pickers-pro v7.7.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTcxODIyNjAwMDAwMA==";
9
+ const releaseInfo = "MTcxODkyMDgwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers-pro",
3
- "version": "7.7.0",
3
+ "version": "7.7.1",
4
4
  "description": "The Pro plan edition of the Date and Time Picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -34,13 +34,13 @@
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.24.7",
36
36
  "@mui/base": "^5.0.0-beta.40",
37
- "@mui/system": "^5.15.15",
38
- "@mui/utils": "^5.15.14",
37
+ "@mui/system": "^5.15.20",
38
+ "@mui/utils": "^5.15.20",
39
39
  "clsx": "^2.1.1",
40
40
  "prop-types": "^15.8.1",
41
41
  "react-transition-group": "^4.4.5",
42
- "@mui/x-date-pickers": "7.7.0",
43
- "@mui/x-license": "7.7.0"
42
+ "@mui/x-date-pickers": "7.7.1",
43
+ "@mui/x-license": "7.7.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@emotion/react": "^11.9.0",