@mui/x-date-pickers-pro 8.0.0-beta.0 → 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 (99) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +2 -7
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
  4. package/DateRangePicker/DateRangePicker.js +3 -1
  5. package/DateRangePicker/shared.js +2 -7
  6. package/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
  7. package/DateRangePickerDay/DateRangePickerDay.js +89 -57
  8. package/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
  9. package/DateRangePickerDay/DateRangePickerDay.types.js +5 -0
  10. package/DateRangePickerDay/index.d.ts +1 -1
  11. package/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
  12. package/DateTimeRangePicker/shared.js +2 -11
  13. package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
  14. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
  15. package/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
  16. package/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
  17. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
  18. package/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
  19. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  20. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -16
  21. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  22. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -16
  23. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  24. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -16
  25. package/TimeRangePicker/TimeRangePicker.js +3 -1
  26. package/TimeRangePicker/shared.js +2 -3
  27. package/esm/DateRangeCalendar/DateRangeCalendar.js +3 -8
  28. package/esm/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
  29. package/esm/DateRangePicker/DateRangePicker.js +3 -1
  30. package/esm/DateRangePicker/shared.js +3 -8
  31. package/esm/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
  32. package/esm/DateRangePickerDay/DateRangePickerDay.js +90 -58
  33. package/esm/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
  34. package/esm/DateRangePickerDay/DateRangePickerDay.types.js +1 -0
  35. package/esm/DateRangePickerDay/index.d.ts +1 -1
  36. package/esm/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
  37. package/esm/DateTimeRangePicker/shared.js +3 -12
  38. package/esm/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
  39. package/esm/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
  40. package/esm/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
  41. package/esm/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
  42. package/esm/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
  43. package/esm/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
  44. package/esm/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  45. package/esm/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -17
  46. package/esm/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  47. package/esm/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -17
  48. package/esm/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  49. package/esm/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -17
  50. package/esm/TimeRangePicker/TimeRangePicker.js +3 -1
  51. package/esm/TimeRangePicker/shared.js +3 -4
  52. package/esm/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
  53. package/esm/hooks/useMultiInputRangeField/useTextFieldProps.js +4 -16
  54. package/esm/index.js +1 -1
  55. package/esm/internals/utils/releaseInfo.js +1 -1
  56. package/esm/managers/useDateRangeManager.js +12 -13
  57. package/esm/managers/useDateTimeRangeManager.js +13 -13
  58. package/esm/managers/useTimeRangeManager.js +13 -11
  59. package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
  60. package/hooks/useMultiInputRangeField/useTextFieldProps.js +3 -15
  61. package/index.js +1 -1
  62. package/internals/utils/releaseInfo.js +1 -1
  63. package/managers/useDateRangeManager.js +11 -12
  64. package/managers/useDateTimeRangeManager.js +12 -12
  65. package/managers/useTimeRangeManager.js +12 -10
  66. package/modern/DateRangeCalendar/DateRangeCalendar.js +3 -8
  67. package/modern/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
  68. package/modern/DateRangePicker/DateRangePicker.js +3 -1
  69. package/modern/DateRangePicker/shared.js +3 -8
  70. package/modern/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
  71. package/modern/DateRangePickerDay/DateRangePickerDay.js +90 -58
  72. package/modern/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
  73. package/modern/DateRangePickerDay/DateRangePickerDay.types.js +1 -0
  74. package/modern/DateRangePickerDay/index.d.ts +1 -1
  75. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
  76. package/modern/DateTimeRangePicker/shared.js +3 -12
  77. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
  78. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
  79. package/modern/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
  80. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
  81. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
  82. package/modern/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
  83. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  84. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -17
  85. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  86. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -17
  87. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  88. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -17
  89. package/modern/TimeRangePicker/TimeRangePicker.js +3 -1
  90. package/modern/TimeRangePicker/shared.js +3 -4
  91. package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
  92. package/modern/hooks/useMultiInputRangeField/useTextFieldProps.js +4 -16
  93. package/modern/index.js +1 -1
  94. package/modern/internals/utils/releaseInfo.js +1 -1
  95. package/modern/managers/useDateRangeManager.js +12 -13
  96. package/modern/managers/useDateTimeRangeManager.js +13 -13
  97. package/modern/managers/useTimeRangeManager.js +13 -11
  98. package/package.json +4 -4
  99. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,177 @@
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
+
102
+ ## 8.0.0-beta.1
103
+
104
+ _Mar 21, 2025_
105
+
106
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
107
+
108
+ - 🐞 Bugfixes
109
+
110
+ Special thanks go out to the community members for their valuable contributions:
111
+ @jyash97.
112
+ Following are all team members who have contributed to this release:
113
+ @alexfauquette, @arminmeh, @flaviendelangle, @JCQuintas, @KenanYusuf.
114
+
115
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
116
+
117
+ ### Data Grid
118
+
119
+ #### `@mui/x-data-grid@8.0.0-beta.1`
120
+
121
+ - [DataGrid] Fix error caused by `forwardRef` to `ClickAwayListener` (#17049) @arminmeh
122
+ - [DataGrid] Fix error while editing rows with custom id (#17048) @arminmeh
123
+
124
+ #### `@mui/x-data-grid-pro@8.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
125
+
126
+ Same changes as in `@mui/x-data-grid@8.0.0-beta.1`, plus:
127
+
128
+ - [DataGridPro] Fix header select checkbox state with `checkboxSelectionVisibleOnly` and `paginationMode="server"` (#17026) @arminmeh
129
+
130
+ #### `@mui/x-data-grid-premium@8.0.0-beta.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
131
+
132
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-beta.1`, plus:
133
+
134
+ - [DataGridPremium] Update column state correctly when grouping mode is updated with one grouping column (#17069) @arminmeh
135
+
136
+ ### Date and Time Pickers
137
+
138
+ #### `@mui/x-date-pickers@8.0.0-beta.1`
139
+
140
+ - [fields] Clean the `useField` hook (part 1) (#16944) @flaviendelangle
141
+ - [fields] Improve the check for year in `doesSectionFormatHaveLeadingZeros` (#17051) @flaviendelangle
142
+ - [pickers] Deprecate the `disableOpenPicker` prop (#17040) @flaviendelangle
143
+ - [pickers] Simplify the `cleanLeadingZeros` method (#17063) @flaviendelangle
144
+ - [pickers] Use the new `ownerState` in `PickersDay` and `DateRangePickerDay` (#17035) @flaviendelangle
145
+
146
+ #### `@mui/x-date-pickers-pro@8.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
147
+
148
+ Same changes as in `@mui/x-date-pickers@8.0.0-beta.1`, plus:
149
+
150
+ - [DateRangePicker] Use desktop media query constant on range pickers (#17052) @flaviendelangle
151
+
152
+ ### Charts
153
+
154
+ #### `@mui/x-charts@8.0.0-beta.1`
155
+
156
+ - [charts] Fix horizontal bar with multiple axes (#17059) @alexfauquette
157
+
158
+ #### `@mui/x-charts-pro@8.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
159
+
160
+ Same changes as in `@mui/x-charts@8.0.0-beta.1`, plus:
161
+
162
+ - [charts-pro] Allow disabling Heatmap tooltip (#17060) @JCQuintas
163
+
164
+ ### Tree View
165
+
166
+ #### `@mui/x-tree-view@8.0.0-beta.1`
167
+
168
+ Internal changes.
169
+
170
+ #### `@mui/x-tree-view-pro@8.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
171
+
172
+ Same changes as in `@mui/x-tree-view@8.0.0-beta.1`.
173
+
174
+ ### Docs
175
+
176
+ - [docs] Fix 404 (#17033) @alexfauquette
177
+ - [docs] Fix Data Grid advanced list view demo (#17064) @KenanYusuf
178
+
8
179
  ## 8.0.0-beta.0
9
180
 
10
181
  <img width="100%" alt="MUI X v8 Beta is live" src="https://github.com/user-attachments/assets/61ec4dd8-c946-456b-8b45-d51de8772f5d">
@@ -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']
@@ -5,7 +5,7 @@ import { Theme } from '@mui/material/styles';
5
5
  import { DefaultizedProps } from '@mui/x-internals/types';
6
6
  import { PickerOwnerState, PickerValidDate, TimezoneProps } from '@mui/x-date-pickers/models';
7
7
  import { PickersCalendarHeader, PickersCalendarHeaderSlots, PickersCalendarHeaderSlotProps } from '@mui/x-date-pickers/PickersCalendarHeader';
8
- import { PickerDayOwnerState } from '@mui/x-date-pickers/DateCalendar';
8
+ import { PickerDayOwnerState } from '@mui/x-date-pickers/PickersDay';
9
9
  import { BaseDateValidationProps, ExportedDayCalendarProps, DayCalendarSlots, DayCalendarSlotProps, PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps, ExportedUseViewsOptions, PickerRangeValue, FormProps } from '@mui/x-date-pickers/internals';
10
10
  import { RangePosition } from "../models/index.js";
11
11
  import { DateRangeCalendarClasses } from "./dateRangeCalendarClasses.js";
@@ -13,6 +13,7 @@ var React = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
15
15
  var _styles = require("@mui/material/styles");
16
+ var _internals = require("@mui/x-date-pickers/internals");
16
17
  var _utils = require("@mui/utils");
17
18
  var _DesktopDateRangePicker = require("../DesktopDateRangePicker");
18
19
  var _MobileDateRangePicker = require("../MobileDateRangePicker");
@@ -34,7 +35,7 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/React.forwardRef(
34
35
  name: 'MuiDateRangePicker'
35
36
  });
36
37
  const {
37
- desktopModeMediaQuery = '@media (pointer: fine)'
38
+ desktopModeMediaQuery = _internals.DEFAULT_DESKTOP_MODE_MEDIA_QUERY
38
39
  } = props,
39
40
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
40
41
 
@@ -131,6 +132,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
131
132
  disableHighlightToday: _propTypes.default.bool,
132
133
  /**
133
134
  * If `true`, the button to open the Picker will not be rendered (it will only render the field).
135
+ * @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
134
136
  * @default false
135
137
  */
136
138
  disableOpenPicker: _propTypes.default.bool,
@@ -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)
@@ -1,45 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PickersDayProps } from '@mui/x-date-pickers/PickersDay';
3
- import { DateRangePickerDayClasses } from "./dateRangePickerDayClasses.js";
4
- export interface DateRangePickerDayProps extends Omit<PickersDayProps, 'classes' | 'onBlur' | 'onFocus' | 'onKeyDown'> {
5
- /**
6
- * Set to `true` if the `day` is in a highlighted date range.
7
- */
8
- isHighlighting: boolean;
9
- /**
10
- * Set to `true` if the `day` is the end of a highlighted date range.
11
- */
12
- isEndOfHighlighting: boolean;
13
- /**
14
- * Set to `true` if the `day` is the start of a highlighted date range.
15
- */
16
- isStartOfHighlighting: boolean;
17
- /**
18
- * Set to `true` if the `day` is in a preview date range.
19
- */
20
- isPreviewing: boolean;
21
- /**
22
- * Set to `true` if the `day` is the end of a previewing date range.
23
- */
24
- isEndOfPreviewing: boolean;
25
- /**
26
- * Set to `true` if the `day` is the start of a previewing date range.
27
- */
28
- isStartOfPreviewing: boolean;
29
- /**
30
- * Override or extend the styles applied to the component.
31
- */
32
- classes?: Partial<DateRangePickerDayClasses>;
33
- /**
34
- * Indicates if the day should be visually selected.
35
- */
36
- isVisuallySelected?: boolean;
37
- /**
38
- * If `true`, the day can be dragged to change the current date range.
39
- * @default false
40
- */
41
- draggable?: boolean;
42
- }
2
+ import { DateRangePickerDayProps } from "./DateRangePickerDay.types.js";
43
3
  type DateRangePickerDayComponent = (props: DateRangePickerDayProps & React.RefAttributes<HTMLButtonElement>) => React.JSX.Element;
44
4
  /**
45
5
  * Demos:
@@ -20,29 +20,31 @@ var _PickersDay = require("@mui/x-date-pickers/PickersDay");
20
20
  var _dateRangePickerDayClasses = require("./dateRangePickerDayClasses");
21
21
  var _releaseInfo = require("../internals/utils/releaseInfo");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["className", "day", "outsideCurrentMonth", "isEndOfHighlighting", "isEndOfPreviewing", "isHighlighting", "isPreviewing", "isStartOfHighlighting", "isStartOfPreviewing", "selected", "isVisuallySelected", "sx", "draggable", "isFirstVisibleCell", "isLastVisibleCell"];
23
+ const _excluded = ["className", "classes", "isEndOfHighlighting", "isEndOfPreviewing", "isHighlighting", "isPreviewing", "isStartOfHighlighting", "isStartOfPreviewing", "isVisuallySelected", "sx", "draggable", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "disableMargin", "disableHighlightToday", "showDaysOutsideCurrentMonth"];
24
24
  const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
25
- const useUtilityClasses = ownerState => {
25
+ const useUtilityClasses = (classes, ownerState) => {
26
26
  const {
27
- isHighlighting,
28
- outsideCurrentMonth,
29
- isStartOfHighlighting,
30
- isStartOfMonth,
31
- isEndOfHighlighting,
32
- isEndOfMonth,
33
- isPreviewing,
34
- isStartOfPreviewing,
35
- isEndOfPreviewing,
36
- isFirstVisibleCell,
37
- isLastVisibleCell,
38
- isHiddenDayFiller,
39
- selected,
40
- classes
27
+ // Properties shared with PickersDay
28
+ isDaySelected,
29
+ isDayOutsideMonth,
30
+ // Range-specific properties (present in the Base UI implementation)
31
+ isDaySelectionStart,
32
+ isDaySelectionEnd,
33
+ isDayInsideSelection,
34
+ isDayPreviewStart,
35
+ isDayPreviewEnd,
36
+ isDayPreviewed,
37
+ // Range-specific properties (specific to the MUI implementation)
38
+ isDayStartOfMonth,
39
+ isDayEndOfMonth,
40
+ isDayFirstVisibleCell,
41
+ isDayLastVisibleCell,
42
+ isDayFillerCell
41
43
  } = ownerState;
42
44
  const slots = {
43
- root: ['root', isHighlighting && 'rangeIntervalDayHighlight', isStartOfHighlighting && 'rangeIntervalDayHighlightStart', isEndOfHighlighting && 'rangeIntervalDayHighlightEnd', outsideCurrentMonth && 'outsideCurrentMonth', isStartOfMonth && 'startOfMonth', isEndOfMonth && 'endOfMonth', isFirstVisibleCell && 'firstVisibleCell', isLastVisibleCell && 'lastVisibleCell', isHiddenDayFiller && 'hiddenDayFiller'],
44
- rangeIntervalPreview: ['rangeIntervalPreview', isPreviewing && 'rangeIntervalDayPreview', (isStartOfPreviewing || isStartOfMonth) && 'rangeIntervalDayPreviewStart', (isEndOfPreviewing || isEndOfMonth) && 'rangeIntervalDayPreviewEnd'],
45
- day: ['day', !selected && 'notSelectedDate', !isHighlighting && 'dayOutsideRangeInterval', !selected && isHighlighting && 'dayInsideRangeInterval']
45
+ root: ['root', isDaySelected && 'rangeIntervalDayHighlight', isDaySelectionStart && 'rangeIntervalDayHighlightStart', isDaySelectionEnd && 'rangeIntervalDayHighlightEnd', isDayOutsideMonth && 'outsideCurrentMonth', isDayStartOfMonth && 'startOfMonth', isDayEndOfMonth && 'endOfMonth', isDayFirstVisibleCell && 'firstVisibleCell', isDayLastVisibleCell && 'lastVisibleCell', isDayFillerCell && 'hiddenDayFiller'],
46
+ rangeIntervalPreview: ['rangeIntervalPreview', isDayPreviewed && 'rangeIntervalDayPreview', (isDayPreviewStart || isDayStartOfMonth) && 'rangeIntervalDayPreviewStart', (isDayPreviewEnd || isDayEndOfMonth) && 'rangeIntervalDayPreviewEnd'],
47
+ day: ['day', !isDaySelected && 'notSelectedDate', !isDaySelected && 'dayOutsideRangeInterval', !isDayInsideSelection && 'dayInsideRangeInterval']
46
48
  };
47
49
  return (0, _composeClasses.default)(slots, _dateRangePickerDayClasses.getDateRangePickerDayUtilityClass, classes);
48
50
  };
@@ -81,7 +83,7 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
81
83
  }) => ({
82
84
  variants: [{
83
85
  props: {
84
- isHiddenDayFiller: false
86
+ isDayFillerCell: false
85
87
  },
86
88
  style: {
87
89
  [`&:first-of-type .${_dateRangePickerDayClasses.dateRangePickerDayClasses.rangeIntervalDayPreview}`]: (0, _extends2.default)({}, startBorderStyle, {
@@ -93,8 +95,8 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
93
95
  }
94
96
  }, {
95
97
  props: {
96
- isHiddenDayFiller: false,
97
- isHighlighting: true
98
+ isDayFillerCell: false,
99
+ isDaySelected: true
98
100
  },
99
101
  style: {
100
102
  borderRadius: 0,
@@ -106,22 +108,22 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
106
108
  }, {
107
109
  props: ({
108
110
  ownerState: {
109
- isHiddenDayFiller,
110
- isStartOfHighlighting,
111
- isFirstVisibleCell
111
+ isDayFillerCell,
112
+ isDaySelectionStart,
113
+ isDayFirstVisibleCell
112
114
  }
113
- }) => !isHiddenDayFiller && (isStartOfHighlighting || isFirstVisibleCell),
115
+ }) => !isDayFillerCell && (isDaySelectionStart || isDayFirstVisibleCell),
114
116
  style: (0, _extends2.default)({}, startBorderStyle, {
115
117
  paddingLeft: 0
116
118
  })
117
119
  }, {
118
120
  props: ({
119
121
  ownerState: {
120
- isHiddenDayFiller,
121
- isEndOfHighlighting,
122
- isLastVisibleCell
122
+ isDayFillerCell,
123
+ isDaySelectionEnd,
124
+ isDayLastVisibleCell
123
125
  }
124
- }) => !isHiddenDayFiller && (isEndOfHighlighting || isLastVisibleCell),
126
+ }) => !isDayFillerCell && (isDaySelectionEnd || isDayLastVisibleCell),
125
127
  style: (0, _extends2.default)({}, endBorderStyle, {
126
128
  paddingRight: 0
127
129
  })
@@ -144,8 +146,8 @@ const DateRangePickerDayRangeIntervalPreview = (0, _styles.styled)('div', {
144
146
  border: '2px solid transparent',
145
147
  variants: [{
146
148
  props: {
147
- isPreviewing: true,
148
- isHiddenDayFiller: false
149
+ isDayPreviewed: true,
150
+ isDayFillerCell: false
149
151
  },
150
152
  style: {
151
153
  borderRadius: 0,
@@ -156,24 +158,24 @@ const DateRangePickerDayRangeIntervalPreview = (0, _styles.styled)('div', {
156
158
  }, {
157
159
  props: ({
158
160
  ownerState: {
159
- isPreviewing,
160
- isHiddenDayFiller,
161
- isStartOfPreviewing,
162
- isFirstVisibleCell
161
+ isDayPreviewed,
162
+ isDayFillerCell,
163
+ isDayPreviewStart,
164
+ isDayFirstVisibleCell
163
165
  }
164
- }) => isPreviewing && !isHiddenDayFiller && (isStartOfPreviewing || isFirstVisibleCell),
166
+ }) => isDayPreviewed && !isDayFillerCell && (isDayPreviewStart || isDayFirstVisibleCell),
165
167
  style: (0, _extends2.default)({
166
168
  borderLeftColor: (theme.vars || theme).palette.divider
167
169
  }, startBorderStyle)
168
170
  }, {
169
171
  props: ({
170
172
  ownerState: {
171
- isPreviewing,
172
- isHiddenDayFiller,
173
- isEndOfPreviewing,
174
- isLastVisibleCell
173
+ isDayPreviewed,
174
+ isDayFillerCell,
175
+ isDayPreviewEnd,
176
+ isDayLastVisibleCell
175
177
  }
176
- }) => isPreviewing && !isHiddenDayFiller && (isEndOfPreviewing || isLastVisibleCell),
178
+ }) => isDayPreviewed && !isDayFillerCell && (isDayPreviewEnd || isDayLastVisibleCell),
177
179
  style: (0, _extends2.default)({
178
180
  borderRightColor: (theme.vars || theme).palette.divider
179
181
  }, endBorderStyle)
@@ -212,34 +214,60 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
212
214
  });
213
215
  const {
214
216
  className,
215
- day,
216
- outsideCurrentMonth,
217
+ classes: classesProp,
218
+ isEndOfHighlighting,
219
+ isEndOfPreviewing,
217
220
  isHighlighting,
218
221
  isPreviewing,
219
- selected = false,
222
+ isStartOfHighlighting,
223
+ isStartOfPreviewing,
220
224
  isVisuallySelected,
221
225
  sx,
222
226
  draggable,
223
227
  isFirstVisibleCell,
224
- isLastVisibleCell
228
+ isLastVisibleCell,
229
+ day,
230
+ selected,
231
+ disabled,
232
+ today,
233
+ outsideCurrentMonth,
234
+ disableMargin,
235
+ disableHighlightToday,
236
+ showDaysOutsideCurrentMonth
225
237
  } = props,
226
238
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
227
239
  (0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', releaseInfo);
228
240
  const utils = (0, _internals.useUtils)();
229
- const isEndOfMonth = utils.isSameDay(day, utils.endOfMonth(day));
230
- const isStartOfMonth = utils.isSameDay(day, utils.startOfMonth(day));
231
241
  const shouldRenderHighlight = isHighlighting && !outsideCurrentMonth;
232
242
  const shouldRenderPreview = isPreviewing && !outsideCurrentMonth;
233
- const ownerState = (0, _extends2.default)({}, props, {
243
+ const pickersDayOwnerState = (0, _internals.usePickerDayOwnerState)({
244
+ day,
234
245
  selected,
235
- isStartOfMonth,
236
- isEndOfMonth,
237
- draggable,
238
- isFirstVisibleCell,
239
- isLastVisibleCell,
240
- isHiddenDayFiller: outsideCurrentMonth && !other.showDaysOutsideCurrentMonth
246
+ disabled,
247
+ today,
248
+ outsideCurrentMonth,
249
+ disableMargin,
250
+ disableHighlightToday,
251
+ showDaysOutsideCurrentMonth
252
+ });
253
+ const ownerState = (0, _extends2.default)({}, pickersDayOwnerState, {
254
+ // Properties that the Base UI implementation will have
255
+ isDaySelectionStart: isStartOfHighlighting,
256
+ isDaySelectionEnd: isEndOfHighlighting,
257
+ isDayInsideSelection: isHighlighting && !isStartOfHighlighting && !isEndOfHighlighting,
258
+ isDaySelected: isHighlighting,
259
+ isDayPreviewed: isPreviewing,
260
+ isDayPreviewStart: isStartOfPreviewing,
261
+ isDayPreviewEnd: isEndOfPreviewing,
262
+ isDayInsidePreview: isPreviewing && !isStartOfPreviewing && !isEndOfPreviewing,
263
+ // Properties specific to the MUI implementation (some might be removed in the next major)
264
+ isDayStartOfMonth: utils.isSameDay(day, utils.startOfMonth(day)),
265
+ isDayEndOfMonth: utils.isSameDay(day, utils.endOfMonth(day)),
266
+ isDayFirstVisibleCell: isFirstVisibleCell,
267
+ isDayLastVisibleCell: isLastVisibleCell,
268
+ isDayFillerCell: outsideCurrentMonth && !showDaysOutsideCurrentMonth
241
269
  });
242
- const classes = useUtilityClasses(ownerState);
270
+ const classes = useUtilityClasses(classesProp, ownerState);
243
271
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(DateRangePickerDayRoot, {
244
272
  className: (0, _clsx.default)(classes.root, className),
245
273
  ownerState: ownerState,
@@ -249,10 +277,14 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
249
277
  ownerState: ownerState,
250
278
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DateRangePickerDayDay, (0, _extends2.default)({}, other, {
251
279
  ref: ref,
252
- disableMargin: true,
253
280
  day: day,
254
281
  selected: isVisuallySelected,
282
+ disabled: disabled,
283
+ today: today,
255
284
  outsideCurrentMonth: outsideCurrentMonth,
285
+ disableMargin: true,
286
+ disableHighlightToday: disableHighlightToday,
287
+ showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,
256
288
  className: classes.day,
257
289
  ownerState: ownerState,
258
290
  draggable: draggable,
@@ -0,0 +1,91 @@
1
+ import { PickerDayOwnerState, PickersDayProps } from '@mui/x-date-pickers/PickersDay';
2
+ import { DateRangePickerDayClasses } from "./dateRangePickerDayClasses.js";
3
+ export interface DateRangePickerDayProps extends Omit<PickersDayProps, 'classes' | 'onBlur' | 'onFocus' | 'onKeyDown'> {
4
+ /**
5
+ * Set to `true` if the `day` is in a highlighted date range.
6
+ */
7
+ isHighlighting: boolean;
8
+ /**
9
+ * Set to `true` if the `day` is the end of a highlighted date range.
10
+ */
11
+ isEndOfHighlighting: boolean;
12
+ /**
13
+ * Set to `true` if the `day` is the start of a highlighted date range.
14
+ */
15
+ isStartOfHighlighting: boolean;
16
+ /**
17
+ * Set to `true` if the `day` is in a preview date range.
18
+ */
19
+ isPreviewing: boolean;
20
+ /**
21
+ * Set to `true` if the `day` is the end of a previewing date range.
22
+ */
23
+ isEndOfPreviewing: boolean;
24
+ /**
25
+ * Set to `true` if the `day` is the start of a previewing date range.
26
+ */
27
+ isStartOfPreviewing: boolean;
28
+ /**
29
+ * Override or extend the styles applied to the component.
30
+ */
31
+ classes?: Partial<DateRangePickerDayClasses>;
32
+ /**
33
+ * Indicates if the day should be visually selected.
34
+ */
35
+ isVisuallySelected?: boolean;
36
+ /**
37
+ * If `true`, the day can be dragged to change the current date range.
38
+ * @default false
39
+ */
40
+ draggable?: boolean;
41
+ }
42
+ export interface DateRangePickerDayOwnerState extends PickerDayOwnerState {
43
+ /**
44
+ * Whether the day is the first day of the selected range.
45
+ */
46
+ isDaySelectionStart: boolean;
47
+ /**
48
+ * Whether the day is the last day of the selected range.
49
+ */
50
+ isDaySelectionEnd: boolean;
51
+ /**
52
+ * Whether the day is within the selected range and is not its first or last day.
53
+ */
54
+ isDayInsideSelection: boolean;
55
+ /**
56
+ * Whether the day is within the preview range.
57
+ */
58
+ isDayPreviewed: boolean;
59
+ /**
60
+ * Whether the day is the first day of the preview range.
61
+ */
62
+ isDayPreviewStart: boolean;
63
+ /**
64
+ * Whether the day is the last day of the preview range.
65
+ */
66
+ isDayPreviewEnd: boolean;
67
+ /**
68
+ * Whether the day is within the preview range and is not its first or last day.
69
+ */
70
+ isDayInsidePreview: boolean;
71
+ /**
72
+ * Whether the day is the first day of the month.
73
+ */
74
+ isDayStartOfMonth: boolean;
75
+ /**
76
+ * Whether the day is the last day of the month.
77
+ */
78
+ isDayEndOfMonth: boolean;
79
+ /**
80
+ * Whether the day is the first visible cell of the month it's being rendered in.
81
+ */
82
+ isDayFirstVisibleCell: boolean;
83
+ /**
84
+ * Whether the day is the last visible cell of the month it's being rendered in.
85
+ */
86
+ isDayLastVisibleCell: boolean;
87
+ /**
88
+ * Whether the day is a filler day (its content is hidden).
89
+ */
90
+ isDayFillerCell: boolean;
91
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,4 +1,4 @@
1
1
  export { DateRangePickerDay } from "./DateRangePickerDay.js";
2
- export type { DateRangePickerDayProps } from './DateRangePickerDay';
2
+ export type { DateRangePickerDayProps, DateRangePickerDayOwnerState } from './DateRangePickerDay.types';
3
3
  export { getDateRangePickerDayUtilityClass, dateRangePickerDayClasses } from "./dateRangePickerDayClasses.js";
4
4
  export type { DateRangePickerDayClasses, DateRangePickerDayClassKey } from './dateRangePickerDayClasses';