@mui/x-date-pickers-pro 8.0.0-beta.1 → 8.0.0-beta.2

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 (33) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +2 -7
  3. package/DateRangePicker/shared.js +2 -7
  4. package/DateRangePickerDay/DateRangePickerDay.js +1 -1
  5. package/DateTimeRangePicker/shared.js +2 -11
  6. package/TimeRangePicker/shared.js +2 -3
  7. package/esm/DateRangeCalendar/DateRangeCalendar.js +3 -8
  8. package/esm/DateRangePicker/shared.js +3 -8
  9. package/esm/DateRangePickerDay/DateRangePickerDay.js +1 -1
  10. package/esm/DateTimeRangePicker/shared.js +3 -12
  11. package/esm/TimeRangePicker/shared.js +3 -4
  12. package/esm/index.js +1 -1
  13. package/esm/internals/utils/releaseInfo.js +1 -1
  14. package/esm/managers/useDateRangeManager.js +9 -10
  15. package/esm/managers/useDateTimeRangeManager.js +10 -10
  16. package/esm/managers/useTimeRangeManager.js +10 -8
  17. package/index.js +1 -1
  18. package/internals/utils/releaseInfo.js +1 -1
  19. package/managers/useDateRangeManager.js +8 -9
  20. package/managers/useDateTimeRangeManager.js +9 -9
  21. package/managers/useTimeRangeManager.js +9 -7
  22. package/modern/DateRangeCalendar/DateRangeCalendar.js +3 -8
  23. package/modern/DateRangePicker/shared.js +3 -8
  24. package/modern/DateRangePickerDay/DateRangePickerDay.js +1 -1
  25. package/modern/DateTimeRangePicker/shared.js +3 -12
  26. package/modern/TimeRangePicker/shared.js +3 -4
  27. package/modern/index.js +1 -1
  28. package/modern/internals/utils/releaseInfo.js +1 -1
  29. package/modern/managers/useDateRangeManager.js +9 -10
  30. package/modern/managers/useDateTimeRangeManager.js +10 -10
  31. package/modern/managers/useTimeRangeManager.js +10 -8
  32. package/package.json +4 -4
  33. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,100 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.0.0-beta.2
9
+
10
+ _Mar 27, 2025_
11
+
12
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🔍 Update the Data Grid quick filter to be collapsed when not in use
15
+ - 🐞 Bugfixes
16
+
17
+ Special thanks go out to the community members for their valuable contributions:
18
+ @lhilgert9.
19
+ Following are all team members who have contributed to this release:
20
+ @alexfauquette, @arminmeh, @flaviendelangle, @hasdfa, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @michelengelen, @mnajdova, @romgrk.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@8.0.0-beta.2`
27
+
28
+ - [DataGrid] Fix error caused by trying to render rows that are not in the state anymore (#17057) @arminmeh
29
+ - [DataGrid] Refactor: remove more material (#16922) @romgrk
30
+ - [DataGrid] Update Quick Filter component to be expandable (#16862) @KenanYusuf
31
+ - [DataGrid] Fix crash when used with `@mui/styled-engine-sc` (#17154) @KenanYusuf
32
+
33
+ #### `@mui/x-data-grid-pro@8.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@8.0.0-beta.2`, plus:
36
+
37
+ - [DataGridPro] Data source: Allow expanding groups with unknown children (#17144) @MBilalShafi
38
+
39
+ #### `@mui/x-data-grid-premium@8.0.0-beta.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
40
+
41
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-beta.2`.
42
+
43
+ ### Date and Time Pickers
44
+
45
+ #### `@mui/x-date-pickers@8.0.0-beta.2`
46
+
47
+ - [fields] Extract the props of each field slot into a standalone hook for easier re-use (#17114) @flaviendelangle
48
+ - [pickers] Fix visual regression in Date Range Calendar's day (#17148) @flaviendelangle
49
+ - [pickers] Remove all code duplication to apply default values to validation props (#17038) @flaviendelangle
50
+
51
+ #### `@mui/x-date-pickers-pro@8.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
52
+
53
+ Same changes as in `@mui/x-date-pickers@8.0.0-beta.2`.
54
+
55
+ ### Charts
56
+
57
+ #### `@mui/x-charts@8.0.0-beta.2`
58
+
59
+ - [charts] Memoize axes and series with default (#17156) @alexfauquette
60
+ - [charts] Add pie benchmark (#17115) @JCQuintas
61
+ - [charts] Fix CSS vars support for dark theme (#17106) @alexfauquette
62
+ - [charts] Fix radar hover (#17134) @alexfauquette
63
+ - [charts] Move axis interaction to selectors (#17039) @alexfauquette
64
+ - [charts] Fix Pie benchmark (#17125) @JCQuintas
65
+
66
+ #### `@mui/x-charts-pro@8.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
67
+
68
+ Same changes as in `@mui/x-charts@8.0.0-beta.2`.
69
+
70
+ ### Tree View
71
+
72
+ #### `@mui/x-tree-view@8.0.0-beta.2`
73
+
74
+ Internal changes.
75
+
76
+ #### `@mui/x-tree-view-pro@8.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
77
+
78
+ Same changes as in `@mui/x-tree-view@8.0.0-beta.2`.
79
+
80
+ ### `@mui/x-codemod@8.0.0-beta.1`
81
+
82
+ - [codemod] Add Data Grid codemods (#17121, #17124) @MBilalShafi
83
+
84
+ ### Docs
85
+
86
+ - [docs] Fix example import for `ExportExcel` component (#17110) @KenanYusuf
87
+
88
+ ### Core
89
+
90
+ - [code-infra] Remove `@mui/styles` dependency & patches (#17071) @mnajdova
91
+ - [code-infra] Add more tests to slow screenshot tests (#17075) @JCQuintas
92
+ - [code-infra] Fix pickers codecov (#17120) @JCQuintas
93
+ - [code-infra] Move `isDeepEqual` to @mui/x-internals (#17129) @JCQuintas
94
+ - [code-infra] Remove `test_regressions` step from React 18 pipeline (#17108) @LukasTy
95
+ - [code-infra] Update some data-grid tests for vitest (#17078, #17104, #17146) @JCQuintas
96
+ - [code-infra] Update some date-pickers tests for vitest (#17083) @JCQuintas
97
+ - [infra] Update `issue-status-label-handler.yml` @michelengelen
98
+ - [infra] Added reusable issue status label handler workflow (#17145) @michelengelen
99
+ - [infra] Switch to reusable 'stale issues/PRs' workflow (#17107) @michelengelen
100
+ - [telemetry] Improve request body size, update dependencies, and optimize SSR handling (#17008) @hasdfa
101
+
8
102
  ## 8.0.0-beta.1
9
103
 
10
104
  _Mar 21, 2025_
@@ -81,25 +81,20 @@ const InnerDayCalendarForRange = (0, _styles.styled)(_internals.DayCalendar)(({
81
81
  }));
82
82
  const DayCalendarForRange = InnerDayCalendarForRange;
83
83
  function useDateRangeCalendarDefaultizedProps(props, name) {
84
- const utils = (0, _internals.useUtils)();
85
- const defaultDates = (0, _internals.useDefaultDates)();
86
84
  const themeProps = (0, _styles.useThemeProps)({
87
85
  props,
88
86
  name
89
87
  });
90
88
  const reduceAnimations = (0, _internals.useReduceAnimations)(themeProps.reduceAnimations);
91
- return (0, _extends2.default)({}, themeProps, {
89
+ const validationProps = (0, _internals.useApplyDefaultValuesToDateValidationProps)(themeProps);
90
+ return (0, _extends2.default)({}, themeProps, validationProps, {
92
91
  renderLoading: themeProps.renderLoading ?? (() => /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
93
92
  children: "..."
94
93
  })),
95
94
  reduceAnimations,
96
95
  loading: props.loading ?? false,
97
- disablePast: props.disablePast ?? false,
98
- disableFuture: props.disableFuture ?? false,
99
96
  openTo: themeProps.openTo ?? 'day',
100
97
  views: themeProps.views ?? ['day'],
101
- minDate: (0, _internals.applyDefaultDate)(utils, themeProps.minDate, defaultDates.minDate),
102
- maxDate: (0, _internals.applyDefaultDate)(utils, themeProps.maxDate, defaultDates.maxDate),
103
98
  calendars: themeProps.calendars ?? 2,
104
99
  disableDragEditing: themeProps.disableDragEditing ?? false,
105
100
  availableRangePositions: themeProps.availableRangePositions ?? ['start', 'end']
@@ -12,12 +12,11 @@ var _styles = require("@mui/material/styles");
12
12
  var _internals = require("@mui/x-date-pickers/internals");
13
13
  var _DateRangePickerToolbar = require("./DateRangePickerToolbar");
14
14
  function useDateRangePickerDefaultizedProps(props, name) {
15
- const utils = (0, _internals.useUtils)();
16
- const defaultDates = (0, _internals.useDefaultDates)();
17
15
  const themeProps = (0, _styles.useThemeProps)({
18
16
  props,
19
17
  name
20
18
  });
19
+ const validationProps = (0, _internals.useApplyDefaultValuesToDateValidationProps)(themeProps);
21
20
  const localeText = React.useMemo(() => {
22
21
  if (themeProps.localeText?.toolbarTitle == null) {
23
22
  return themeProps.localeText;
@@ -26,12 +25,8 @@ function useDateRangePickerDefaultizedProps(props, name) {
26
25
  dateRangePickerToolbarTitle: themeProps.localeText.toolbarTitle
27
26
  });
28
27
  }, [themeProps.localeText]);
29
- return (0, _extends2.default)({}, themeProps, {
28
+ return (0, _extends2.default)({}, themeProps, validationProps, {
30
29
  localeText,
31
- disableFuture: themeProps.disableFuture ?? false,
32
- disablePast: themeProps.disablePast ?? false,
33
- minDate: (0, _internals.applyDefaultDate)(utils, themeProps.minDate, defaultDates.minDate),
34
- maxDate: (0, _internals.applyDefaultDate)(utils, themeProps.maxDate, defaultDates.maxDate),
35
30
  slots: (0, _extends2.default)({
36
31
  toolbar: _DateRangePickerToolbar.DateRangePickerToolbar
37
32
  }, themeProps.slots)
@@ -96,7 +96,7 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
96
96
  }, {
97
97
  props: {
98
98
  isDayFillerCell: false,
99
- isHighlighting: true
99
+ isDaySelected: true
100
100
  },
101
101
  style: {
102
102
  borderRadius: 0,
@@ -12,11 +12,11 @@ var _DateTimeRangePickerToolbar = require("./DateTimeRangePickerToolbar");
12
12
  var _DateTimeRangePickerTabs = require("./DateTimeRangePickerTabs");
13
13
  function useDateTimeRangePickerDefaultizedProps(props, name) {
14
14
  const utils = (0, _internals.useUtils)();
15
- const defaultDates = (0, _internals.useDefaultDates)();
16
15
  const themeProps = (0, _styles.useThemeProps)({
17
16
  props,
18
17
  name
19
18
  });
19
+ const validationProps = (0, _internals.useApplyDefaultValuesToDateTimeValidationProps)(themeProps);
20
20
  const ampm = themeProps.ampm ?? utils.is12HourCycleInCurrentLocale();
21
21
  const {
22
22
  openTo,
@@ -38,22 +38,13 @@ function useDateTimeRangePickerDefaultizedProps(props, name) {
38
38
  timeSteps: themeProps.timeSteps,
39
39
  views: defaultViews
40
40
  });
41
- return (0, _extends2.default)({}, themeProps, {
41
+ return (0, _extends2.default)({}, themeProps, validationProps, {
42
42
  timeSteps,
43
43
  openTo,
44
44
  shouldRenderTimeInASingleColumn,
45
45
  thresholdToRenderTimeInASingleColumn,
46
46
  views,
47
47
  ampm,
48
- disableFuture: themeProps.disableFuture ?? false,
49
- disablePast: themeProps.disablePast ?? false,
50
- minDate: (0, _internals.applyDefaultDate)(utils, themeProps.minDateTime ?? themeProps.minDate, defaultDates.minDate),
51
- maxDate: (0, _internals.applyDefaultDate)(utils, themeProps.maxDateTime ?? themeProps.maxDate, defaultDates.maxDate),
52
- minTime: themeProps.minDateTime ?? themeProps.minTime,
53
- maxTime: themeProps.maxDateTime ?? themeProps.maxTime,
54
- disableIgnoringDatePartForTimeValidation: themeProps.disableIgnoringDatePartForTimeValidation ?? Boolean(themeProps.minDateTime || themeProps.maxDateTime ||
55
- // allow digital clocks to correctly check time validity: https://github.com/mui/mui-x/issues/12048
56
- themeProps.disablePast || themeProps.disableFuture),
57
48
  slots: (0, _extends2.default)({
58
49
  tabs: _DateTimeRangePickerTabs.DateTimeRangePickerTabs,
59
50
  toolbar: _DateTimeRangePickerToolbar.DateTimeRangePickerToolbar
@@ -18,6 +18,7 @@ function useTimeRangePickerDefaultizedProps(props, name) {
18
18
  props,
19
19
  name
20
20
  });
21
+ const validationProps = (0, _internals.useApplyDefaultValuesToTimeValidationProps)(themeProps);
21
22
  const ampm = themeProps.ampm ?? utils.is12HourCycleInCurrentLocale();
22
23
  const {
23
24
  openTo,
@@ -47,7 +48,7 @@ function useTimeRangePickerDefaultizedProps(props, name) {
47
48
  timeSteps: themeProps.timeSteps,
48
49
  views: defaultViews
49
50
  });
50
- return (0, _extends2.default)({}, themeProps, {
51
+ return (0, _extends2.default)({}, themeProps, validationProps, {
51
52
  localeText,
52
53
  timeSteps,
53
54
  openTo,
@@ -55,8 +56,6 @@ function useTimeRangePickerDefaultizedProps(props, name) {
55
56
  thresholdToRenderTimeInASingleColumn,
56
57
  views,
57
58
  ampm,
58
- disableFuture: themeProps.disableFuture ?? false,
59
- disablePast: themeProps.disablePast ?? false,
60
59
  slots: (0, _extends2.default)({
61
60
  tabs: _TimeRangePickerTabs.TimeRangePickerTabs,
62
61
  toolbar: _TimeRangePickerToolbar.TimeRangePickerToolbar
@@ -15,7 +15,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
15
15
  import composeClasses from '@mui/utils/composeClasses';
16
16
  import useId from '@mui/utils/useId';
17
17
  import { Watermark } from '@mui/x-license';
18
- import { applyDefaultDate, DayCalendar, useReduceAnimations, useCalendarState, useDefaultDates, useUtils, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, useControlledValue, useViews, usePickerPrivateContext, areDatesEqual } from '@mui/x-date-pickers/internals';
18
+ import { DayCalendar, useReduceAnimations, useCalendarState, useUtils, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, useControlledValue, useViews, usePickerPrivateContext, areDatesEqual, useApplyDefaultValuesToDateValidationProps } from '@mui/x-date-pickers/internals';
19
19
  import { warnOnce } from '@mui/x-internals/warning';
20
20
  import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
21
21
  import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from "./dateRangeCalendarClasses.js";
@@ -74,25 +74,20 @@ const InnerDayCalendarForRange = styled(DayCalendar)(({
74
74
  }));
75
75
  const DayCalendarForRange = InnerDayCalendarForRange;
76
76
  function useDateRangeCalendarDefaultizedProps(props, name) {
77
- const utils = useUtils();
78
- const defaultDates = useDefaultDates();
79
77
  const themeProps = useThemeProps({
80
78
  props,
81
79
  name
82
80
  });
83
81
  const reduceAnimations = useReduceAnimations(themeProps.reduceAnimations);
84
- return _extends({}, themeProps, {
82
+ const validationProps = useApplyDefaultValuesToDateValidationProps(themeProps);
83
+ return _extends({}, themeProps, validationProps, {
85
84
  renderLoading: themeProps.renderLoading ?? (() => /*#__PURE__*/_jsx("span", {
86
85
  children: "..."
87
86
  })),
88
87
  reduceAnimations,
89
88
  loading: props.loading ?? false,
90
- disablePast: props.disablePast ?? false,
91
- disableFuture: props.disableFuture ?? false,
92
89
  openTo: themeProps.openTo ?? 'day',
93
90
  views: themeProps.views ?? ['day'],
94
- minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
95
- maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),
96
91
  calendars: themeProps.calendars ?? 2,
97
92
  disableDragEditing: themeProps.disableDragEditing ?? false,
98
93
  availableRangePositions: themeProps.availableRangePositions ?? ['start', 'end']
@@ -1,15 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
- import { useDefaultDates, useUtils, applyDefaultDate } from '@mui/x-date-pickers/internals';
4
+ import { useApplyDefaultValuesToDateValidationProps } from '@mui/x-date-pickers/internals';
5
5
  import { DateRangePickerToolbar } from "./DateRangePickerToolbar.js";
6
6
  export function useDateRangePickerDefaultizedProps(props, name) {
7
- const utils = useUtils();
8
- const defaultDates = useDefaultDates();
9
7
  const themeProps = useThemeProps({
10
8
  props,
11
9
  name
12
10
  });
11
+ const validationProps = useApplyDefaultValuesToDateValidationProps(themeProps);
13
12
  const localeText = React.useMemo(() => {
14
13
  if (themeProps.localeText?.toolbarTitle == null) {
15
14
  return themeProps.localeText;
@@ -18,12 +17,8 @@ export function useDateRangePickerDefaultizedProps(props, name) {
18
17
  dateRangePickerToolbarTitle: themeProps.localeText.toolbarTitle
19
18
  });
20
19
  }, [themeProps.localeText]);
21
- return _extends({}, themeProps, {
20
+ return _extends({}, themeProps, validationProps, {
22
21
  localeText,
23
- disableFuture: themeProps.disableFuture ?? false,
24
- disablePast: themeProps.disablePast ?? false,
25
- minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
26
- maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),
27
22
  slots: _extends({
28
23
  toolbar: DateRangePickerToolbar
29
24
  }, themeProps.slots)
@@ -89,7 +89,7 @@ const DateRangePickerDayRoot = styled('div', {
89
89
  }, {
90
90
  props: {
91
91
  isDayFillerCell: false,
92
- isHighlighting: true
92
+ isDaySelected: true
93
93
  },
94
94
  style: {
95
95
  borderRadius: 0,
@@ -1,15 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { useThemeProps } from '@mui/material/styles';
3
- import { useDefaultDates, useUtils, applyDefaultDate, applyDefaultViewProps, resolveTimeViewsResponse } from '@mui/x-date-pickers/internals';
3
+ import { useUtils, applyDefaultViewProps, resolveTimeViewsResponse, useApplyDefaultValuesToDateTimeValidationProps } from '@mui/x-date-pickers/internals';
4
4
  import { DateTimeRangePickerToolbar } from "./DateTimeRangePickerToolbar.js";
5
5
  import { DateTimeRangePickerTabs } from "./DateTimeRangePickerTabs.js";
6
6
  export function useDateTimeRangePickerDefaultizedProps(props, name) {
7
7
  const utils = useUtils();
8
- const defaultDates = useDefaultDates();
9
8
  const themeProps = useThemeProps({
10
9
  props,
11
10
  name
12
11
  });
12
+ const validationProps = useApplyDefaultValuesToDateTimeValidationProps(themeProps);
13
13
  const ampm = themeProps.ampm ?? utils.is12HourCycleInCurrentLocale();
14
14
  const {
15
15
  openTo,
@@ -31,22 +31,13 @@ export function useDateTimeRangePickerDefaultizedProps(props, name) {
31
31
  timeSteps: themeProps.timeSteps,
32
32
  views: defaultViews
33
33
  });
34
- return _extends({}, themeProps, {
34
+ return _extends({}, themeProps, validationProps, {
35
35
  timeSteps,
36
36
  openTo,
37
37
  shouldRenderTimeInASingleColumn,
38
38
  thresholdToRenderTimeInASingleColumn,
39
39
  views,
40
40
  ampm,
41
- disableFuture: themeProps.disableFuture ?? false,
42
- disablePast: themeProps.disablePast ?? false,
43
- minDate: applyDefaultDate(utils, themeProps.minDateTime ?? themeProps.minDate, defaultDates.minDate),
44
- maxDate: applyDefaultDate(utils, themeProps.maxDateTime ?? themeProps.maxDate, defaultDates.maxDate),
45
- minTime: themeProps.minDateTime ?? themeProps.minTime,
46
- maxTime: themeProps.maxDateTime ?? themeProps.maxTime,
47
- disableIgnoringDatePartForTimeValidation: themeProps.disableIgnoringDatePartForTimeValidation ?? Boolean(themeProps.minDateTime || themeProps.maxDateTime ||
48
- // allow digital clocks to correctly check time validity: https://github.com/mui/mui-x/issues/12048
49
- themeProps.disablePast || themeProps.disableFuture),
50
41
  slots: _extends({
51
42
  tabs: DateTimeRangePickerTabs,
52
43
  toolbar: DateTimeRangePickerToolbar
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
- import { useUtils, applyDefaultViewProps, resolveTimeViewsResponse } from '@mui/x-date-pickers/internals';
4
+ import { useUtils, applyDefaultViewProps, resolveTimeViewsResponse, useApplyDefaultValuesToTimeValidationProps } from '@mui/x-date-pickers/internals';
5
5
  import { TimeRangePickerToolbar } from "./TimeRangePickerToolbar.js";
6
6
  import { TimeRangePickerTabs } from "./TimeRangePickerTabs.js";
7
7
  export function useTimeRangePickerDefaultizedProps(props, name) {
@@ -10,6 +10,7 @@ export function useTimeRangePickerDefaultizedProps(props, name) {
10
10
  props,
11
11
  name
12
12
  });
13
+ const validationProps = useApplyDefaultValuesToTimeValidationProps(themeProps);
13
14
  const ampm = themeProps.ampm ?? utils.is12HourCycleInCurrentLocale();
14
15
  const {
15
16
  openTo,
@@ -39,7 +40,7 @@ export function useTimeRangePickerDefaultizedProps(props, name) {
39
40
  timeSteps: themeProps.timeSteps,
40
41
  views: defaultViews
41
42
  });
42
- return _extends({}, themeProps, {
43
+ return _extends({}, themeProps, validationProps, {
43
44
  localeText,
44
45
  timeSteps,
45
46
  openTo,
@@ -47,8 +48,6 @@ export function useTimeRangePickerDefaultizedProps(props, name) {
47
48
  thresholdToRenderTimeInASingleColumn,
48
49
  views,
49
50
  ampm,
50
- disableFuture: themeProps.disableFuture ?? false,
51
- disablePast: themeProps.disablePast ?? false,
52
51
  slots: _extends({
53
52
  tabs: TimeRangePickerTabs,
54
53
  toolbar: TimeRangePickerToolbar
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v8.0.0-beta.1
2
+ * @mui/x-date-pickers-pro v8.0.0-beta.2
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 = "MTc0MjUxNTIwMDAwMA==";
3
+ const releaseInfo = "MTc0MzExMjgwMDAwMA==";
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
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
6
- import { getDateFieldInternalPropsDefaults, useUtils } from '@mui/x-date-pickers/internals';
6
+ import { useApplyDefaultValuesToDateValidationProps, useUtils } from '@mui/x-date-pickers/internals';
7
7
  import { getRangeFieldValueManager, rangeValueManager } from "../internals/utils/valueManagers.js";
8
8
  import { validateDateRange } from "../validation/index.js";
9
9
  import { formatRange } from "../internals/utils/date-utils.js";
@@ -20,15 +20,7 @@ export function useDateRangeManager(parameters = {}) {
20
20
  dateSeparator
21
21
  }),
22
22
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
23
- internal_applyDefaultsToFieldInternalProps: ({
24
- internalProps,
25
- utils,
26
- defaultDates
27
- }) => _extends({}, internalProps, getDateFieldInternalPropsDefaults({
28
- defaultDates,
29
- utils,
30
- internalProps
31
- })),
23
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToDateRangeFieldInternalProps,
32
24
  internal_useOpenPickerButtonAriaLabel: useOpenPickerButtonAriaLabel
33
25
  }), [enableAccessibleFieldDOMStructure, dateSeparator]);
34
26
  }
@@ -38,4 +30,11 @@ function useOpenPickerButtonAriaLabel(value) {
38
30
  return React.useMemo(() => {
39
31
  return translations.openRangePickerDialogue(formatRange(utils, value, 'fullDate'));
40
32
  }, [value, translations, utils]);
33
+ }
34
+ function useApplyDefaultValuesToDateRangeFieldInternalProps(internalProps) {
35
+ const utils = useUtils();
36
+ const validationProps = useApplyDefaultValuesToDateValidationProps(internalProps);
37
+ return React.useMemo(() => _extends({}, internalProps, validationProps, {
38
+ format: internalProps.format ?? utils.formats.keyboardDate
39
+ }), [internalProps, validationProps, utils]);
41
40
  }
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
6
- import { getDateTimeFieldInternalPropsDefaults, useUtils } from '@mui/x-date-pickers/internals';
6
+ import { useApplyDefaultValuesToDateTimeValidationProps, useUtils } from '@mui/x-date-pickers/internals';
7
7
  import { getRangeFieldValueManager, rangeValueManager } from "../internals/utils/valueManagers.js";
8
8
  import { validateDateTimeRange } from "../validation/index.js";
9
9
  import { formatRange } from "../internals/utils/date-utils.js";
@@ -20,15 +20,7 @@ export function useDateTimeRangeManager(parameters = {}) {
20
20
  dateSeparator
21
21
  }),
22
22
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
23
- internal_applyDefaultsToFieldInternalProps: ({
24
- internalProps,
25
- utils,
26
- defaultDates
27
- }) => _extends({}, internalProps, getDateTimeFieldInternalPropsDefaults({
28
- internalProps,
29
- utils,
30
- defaultDates
31
- })),
23
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToDateTimeRangeFieldInternalProps,
32
24
  internal_useOpenPickerButtonAriaLabel: useOpenPickerButtonAriaLabel
33
25
  }), [enableAccessibleFieldDOMStructure, dateSeparator]);
34
26
  }
@@ -38,4 +30,12 @@ function useOpenPickerButtonAriaLabel(value) {
38
30
  return React.useMemo(() => {
39
31
  return translations.openRangePickerDialogue(formatRange(utils, value, 'fullDate'));
40
32
  }, [value, translations, utils]);
33
+ }
34
+ function useApplyDefaultValuesToDateTimeRangeFieldInternalProps(internalProps) {
35
+ const utils = useUtils();
36
+ const validationProps = useApplyDefaultValuesToDateTimeValidationProps(internalProps);
37
+ const ampm = React.useMemo(() => internalProps.ampm ?? utils.is12HourCycleInCurrentLocale(), [internalProps.ampm, utils]);
38
+ return React.useMemo(() => _extends({}, internalProps, validationProps, {
39
+ format: internalProps.format ?? (ampm ? utils.formats.keyboardDateTime12h : utils.formats.keyboardDateTime24h)
40
+ }), [internalProps, validationProps, ampm, utils]);
41
41
  }
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
6
- import { getTimeFieldInternalPropsDefaults, useUtils } from '@mui/x-date-pickers/internals';
6
+ import { useApplyDefaultValuesToTimeValidationProps, useUtils } from '@mui/x-date-pickers/internals';
7
7
  import { getRangeFieldValueManager, rangeValueManager } from "../internals/utils/valueManagers.js";
8
8
  import { validateTimeRange } from "../validation/index.js";
9
9
  import { formatRange } from "../internals/utils/date-utils.js";
@@ -21,13 +21,7 @@ export function useTimeRangeManager(parameters = {}) {
21
21
  dateSeparator
22
22
  }),
23
23
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
24
- internal_applyDefaultsToFieldInternalProps: ({
25
- internalProps,
26
- utils
27
- }) => _extends({}, internalProps, getTimeFieldInternalPropsDefaults({
28
- utils,
29
- internalProps
30
- })),
24
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToTimeRangeFieldInternalProps,
31
25
  internal_useOpenPickerButtonAriaLabel: createUseOpenPickerButtonAriaLabel(ampm)
32
26
  }), [enableAccessibleFieldDOMStructure, dateSeparator, ampm]);
33
27
  }
@@ -40,4 +34,12 @@ function createUseOpenPickerButtonAriaLabel(ampm) {
40
34
  return translations.openRangePickerDialogue(formatRange(utils, value, formatKey));
41
35
  }, [value, translations, utils]);
42
36
  };
37
+ }
38
+ function useApplyDefaultValuesToTimeRangeFieldInternalProps(internalProps) {
39
+ const utils = useUtils();
40
+ const validationProps = useApplyDefaultValuesToTimeValidationProps(internalProps);
41
+ const ampm = React.useMemo(() => internalProps.ampm ?? utils.is12HourCycleInCurrentLocale(), [internalProps.ampm, utils]);
42
+ return React.useMemo(() => _extends({}, internalProps, validationProps, {
43
+ format: internalProps.format ?? (ampm ? utils.formats.fullTime12h : utils.formats.fullTime24h)
44
+ }), [internalProps, validationProps, ampm, utils]);
43
45
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v8.0.0-beta.1
2
+ * @mui/x-date-pickers-pro v8.0.0-beta.2
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 = "MTc0MjUxNTIwMDAwMA==";
9
+ const releaseInfo = "MTc0MzExMjgwMDAwMA==";
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
@@ -27,15 +27,7 @@ function useDateRangeManager(parameters = {}) {
27
27
  dateSeparator
28
28
  }),
29
29
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
30
- internal_applyDefaultsToFieldInternalProps: ({
31
- internalProps,
32
- utils,
33
- defaultDates
34
- }) => (0, _extends2.default)({}, internalProps, (0, _internals.getDateFieldInternalPropsDefaults)({
35
- defaultDates,
36
- utils,
37
- internalProps
38
- })),
30
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToDateRangeFieldInternalProps,
39
31
  internal_useOpenPickerButtonAriaLabel: useOpenPickerButtonAriaLabel
40
32
  }), [enableAccessibleFieldDOMStructure, dateSeparator]);
41
33
  }
@@ -45,4 +37,11 @@ function useOpenPickerButtonAriaLabel(value) {
45
37
  return React.useMemo(() => {
46
38
  return translations.openRangePickerDialogue((0, _dateUtils.formatRange)(utils, value, 'fullDate'));
47
39
  }, [value, translations, utils]);
40
+ }
41
+ function useApplyDefaultValuesToDateRangeFieldInternalProps(internalProps) {
42
+ const utils = (0, _internals.useUtils)();
43
+ const validationProps = (0, _internals.useApplyDefaultValuesToDateValidationProps)(internalProps);
44
+ return React.useMemo(() => (0, _extends2.default)({}, internalProps, validationProps, {
45
+ format: internalProps.format ?? utils.formats.keyboardDate
46
+ }), [internalProps, validationProps, utils]);
48
47
  }
@@ -27,15 +27,7 @@ function useDateTimeRangeManager(parameters = {}) {
27
27
  dateSeparator
28
28
  }),
29
29
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
30
- internal_applyDefaultsToFieldInternalProps: ({
31
- internalProps,
32
- utils,
33
- defaultDates
34
- }) => (0, _extends2.default)({}, internalProps, (0, _internals.getDateTimeFieldInternalPropsDefaults)({
35
- internalProps,
36
- utils,
37
- defaultDates
38
- })),
30
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToDateTimeRangeFieldInternalProps,
39
31
  internal_useOpenPickerButtonAriaLabel: useOpenPickerButtonAriaLabel
40
32
  }), [enableAccessibleFieldDOMStructure, dateSeparator]);
41
33
  }
@@ -45,4 +37,12 @@ function useOpenPickerButtonAriaLabel(value) {
45
37
  return React.useMemo(() => {
46
38
  return translations.openRangePickerDialogue((0, _dateUtils.formatRange)(utils, value, 'fullDate'));
47
39
  }, [value, translations, utils]);
40
+ }
41
+ function useApplyDefaultValuesToDateTimeRangeFieldInternalProps(internalProps) {
42
+ const utils = (0, _internals.useUtils)();
43
+ const validationProps = (0, _internals.useApplyDefaultValuesToDateTimeValidationProps)(internalProps);
44
+ const ampm = React.useMemo(() => internalProps.ampm ?? utils.is12HourCycleInCurrentLocale(), [internalProps.ampm, utils]);
45
+ return React.useMemo(() => (0, _extends2.default)({}, internalProps, validationProps, {
46
+ format: internalProps.format ?? (ampm ? utils.formats.keyboardDateTime12h : utils.formats.keyboardDateTime24h)
47
+ }), [internalProps, validationProps, ampm, utils]);
48
48
  }
@@ -28,13 +28,7 @@ function useTimeRangeManager(parameters = {}) {
28
28
  dateSeparator
29
29
  }),
30
30
  internal_enableAccessibleFieldDOMStructure: enableAccessibleFieldDOMStructure,
31
- internal_applyDefaultsToFieldInternalProps: ({
32
- internalProps,
33
- utils
34
- }) => (0, _extends2.default)({}, internalProps, (0, _internals.getTimeFieldInternalPropsDefaults)({
35
- utils,
36
- internalProps
37
- })),
31
+ internal_useApplyDefaultValuesToFieldInternalProps: useApplyDefaultValuesToTimeRangeFieldInternalProps,
38
32
  internal_useOpenPickerButtonAriaLabel: createUseOpenPickerButtonAriaLabel(ampm)
39
33
  }), [enableAccessibleFieldDOMStructure, dateSeparator, ampm]);
40
34
  }
@@ -47,4 +41,12 @@ function createUseOpenPickerButtonAriaLabel(ampm) {
47
41
  return translations.openRangePickerDialogue((0, _dateUtils.formatRange)(utils, value, formatKey));
48
42
  }, [value, translations, utils]);
49
43
  };
44
+ }
45
+ function useApplyDefaultValuesToTimeRangeFieldInternalProps(internalProps) {
46
+ const utils = (0, _internals.useUtils)();
47
+ const validationProps = (0, _internals.useApplyDefaultValuesToTimeValidationProps)(internalProps);
48
+ const ampm = React.useMemo(() => internalProps.ampm ?? utils.is12HourCycleInCurrentLocale(), [internalProps.ampm, utils]);
49
+ return React.useMemo(() => (0, _extends2.default)({}, internalProps, validationProps, {
50
+ format: internalProps.format ?? (ampm ? utils.formats.fullTime12h : utils.formats.fullTime24h)
51
+ }), [internalProps, validationProps, ampm, utils]);
50
52
  }