@mui/x-date-pickers-pro 7.0.0 → 7.1.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 (66) hide show
  1. package/CHANGELOG.md +246 -4
  2. package/DateRangeCalendar/DateRangeCalendar.js +1 -1
  3. package/DateRangePicker/DateRangePicker.js +1 -1
  4. package/DateRangePickerDay/DateRangePickerDay.d.ts +5 -0
  5. package/DateRangePickerDay/DateRangePickerDay.js +107 -43
  6. package/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  7. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
  8. package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
  9. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
  10. package/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
  11. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
  12. package/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  13. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
  14. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
  15. package/README.md +1 -1
  16. package/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  17. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
  18. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
  19. package/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
  20. package/index.js +1 -1
  21. package/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
  22. package/internals/models/dateTimeRange.d.ts +1 -1
  23. package/internals/models/timeRange.d.ts +1 -1
  24. package/internals/utils/date-range-manager.js +1 -1
  25. package/internals/utils/releaseInfo.js +1 -1
  26. package/modern/DateRangeCalendar/DateRangeCalendar.js +1 -1
  27. package/modern/DateRangePicker/DateRangePicker.js +1 -1
  28. package/modern/DateRangePickerDay/DateRangePickerDay.js +107 -43
  29. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  30. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
  31. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
  32. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
  33. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
  34. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
  35. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  36. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
  37. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
  38. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  39. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
  40. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
  41. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
  42. package/modern/index.js +1 -1
  43. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
  44. package/modern/internals/utils/date-range-manager.js +1 -1
  45. package/modern/internals/utils/releaseInfo.js +1 -1
  46. package/node/DateRangeCalendar/DateRangeCalendar.js +1 -1
  47. package/node/DateRangePicker/DateRangePicker.js +1 -1
  48. package/node/DateRangePickerDay/DateRangePickerDay.js +107 -43
  49. package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
  50. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
  51. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
  52. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
  53. package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
  54. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
  55. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  56. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
  57. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
  58. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  59. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
  60. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
  61. package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
  62. package/node/index.js +1 -1
  63. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
  64. package/node/internals/utils/date-range-manager.js +1 -1
  65. package/node/internals/utils/releaseInfo.js +1 -1
  66. package/package.json +4 -4
@@ -133,7 +133,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
133
133
  // ----------------------------------------------------------------------
134
134
  /**
135
135
  * 12h/24h view for hour selection clock.
136
- * @default `utils.is12HourCycleInCurrentLocale()`
136
+ * @default utils.is12HourCycleInCurrentLocale()
137
137
  */
138
138
  ampm: PropTypes.bool,
139
139
  /**
@@ -277,7 +277,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
277
277
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
278
278
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
279
279
  *
280
- * @default `false`
280
+ * @default false
281
281
  */
282
282
  shouldRespectLeadingZeros: PropTypes.bool,
283
283
  /**
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MUI X Date Pickers Pro
2
2
 
3
- This package is the commercial edition of the date and time picker components.
3
+ This package is the Pro plan edition of the Date and Time Picker Components.
4
4
  It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
5
5
 
6
6
  ## Installation
@@ -267,7 +267,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
267
267
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
268
268
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
269
269
  *
270
- * @default `false`
270
+ * @default false
271
271
  */
272
272
  shouldRespectLeadingZeros: PropTypes.bool,
273
273
  /**
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: PropTypes.bool,
71
71
  /**
@@ -308,7 +308,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
308
308
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
309
309
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
310
310
  *
311
- * @default `false`
311
+ * @default false
312
312
  */
313
313
  shouldRespectLeadingZeros: PropTypes.bool,
314
314
  /**
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: PropTypes.bool,
71
71
  /**
@@ -281,7 +281,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
281
281
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
282
282
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
283
283
  *
284
- * @default `false`
284
+ * @default false
285
285
  */
286
286
  shouldRespectLeadingZeros: PropTypes.bool,
287
287
  /**
@@ -74,7 +74,7 @@ StaticDateRangePicker.propTypes = {
74
74
  * Formats the day of week displayed in the calendar header.
75
75
  * @param {TDate} date The date of the day of week provided by the adapter.
76
76
  * @returns {string} The name to display.
77
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
77
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
78
78
  */
79
79
  dayOfWeekFormatter: PropTypes.func,
80
80
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.0.0
2
+ * @mui/x-date-pickers-pro v7.1.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -221,7 +221,7 @@ const useSingleInputFieldSlotProps = ({
221
221
  InputProps: _extends({
222
222
  ref: anchorRef
223
223
  }, fieldProps?.InputProps),
224
- focused: open
224
+ focused: open ? true : undefined
225
225
  }, labelId != null && {
226
226
  id: labelId
227
227
  }, wrapperVariant === 'mobile' && {
@@ -5,7 +5,7 @@ import { DateTimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldS
5
5
  export interface UseDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, DateTimeValidationProps<TDate> {
6
6
  /**
7
7
  * 12h/24h view for hour selection clock.
8
- * @default `utils.is12HourCycleInCurrentLocale()`
8
+ * @default utils.is12HourCycleInCurrentLocale()
9
9
  */
10
10
  ampm?: boolean;
11
11
  }
@@ -4,7 +4,7 @@ import { TimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldSepar
4
4
  export interface UseTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, TimeValidationProps<TDate>, BaseTimeValidationProps {
5
5
  /**
6
6
  * 12h/24h view for hour selection clock.
7
- * @default `utils.is12HourCycleInCurrentLocale()`
7
+ * @default utils.is12HourCycleInCurrentLocale()
8
8
  */
9
9
  ampm?: boolean;
10
10
  }
@@ -37,7 +37,7 @@ export function calculateRangeChange({
37
37
  nextSelection: 'end',
38
38
  newRange: [selectedDate, null]
39
39
  };
40
- return Boolean(start) && utils.isBefore(selectedDate, start) ? truthyResult : {
40
+ return Boolean(start) && utils.isBeforeDay(selectedDate, start) ? truthyResult : {
41
41
  nextSelection: 'start',
42
42
  newRange: [start, selectedDate]
43
43
  };
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxMTA1ODQwMDAwMA==";
3
+ const releaseInfo = "MTcxMjI2NDQwMDAwMA==";
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
@@ -508,7 +508,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
508
508
  * Formats the day of week displayed in the calendar header.
509
509
  * @param {TDate} date The date of the day of week provided by the adapter.
510
510
  * @returns {string} The name to display.
511
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
511
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
512
512
  */
513
513
  dayOfWeekFormatter: PropTypes.func,
514
514
  /**
@@ -74,7 +74,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
74
74
  * Formats the day of week displayed in the calendar header.
75
75
  * @param {TDate} date The date of the day of week provided by the adapter.
76
76
  * @returns {string} The name to display.
77
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
77
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
78
78
  */
79
79
  dayOfWeekFormatter: PropTypes.func,
80
80
  /**
@@ -68,26 +68,56 @@ const DateRangePickerDayRoot = styled('div', {
68
68
  [`&.${dateRangePickerDayClasses.hiddenDayFiller}`]: styles.hiddenDayFiller
69
69
  }, styles.root]
70
70
  })(({
71
- theme,
72
- ownerState
73
- }) => ownerState.isHiddenDayFiller ? {} : _extends({
74
- [`&:first-of-type .${dateRangePickerDayClasses.rangeIntervalDayPreview}`]: _extends({}, startBorderStyle, {
75
- borderLeftColor: (theme.vars || theme).palette.divider
76
- }),
77
- [`&:last-of-type .${dateRangePickerDayClasses.rangeIntervalDayPreview}`]: _extends({}, endBorderStyle, {
78
- borderRightColor: (theme.vars || theme).palette.divider
79
- })
80
- }, ownerState.isHighlighting && {
81
- borderRadius: 0,
82
- color: (theme.vars || theme).palette.primary.contrastText,
83
- backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.focusOpacity),
84
- '&:first-of-type': startBorderStyle,
85
- '&:last-of-type': endBorderStyle
86
- }, (ownerState.isStartOfHighlighting || ownerState.isFirstVisibleCell) && _extends({}, startBorderStyle, {
87
- paddingLeft: 0
88
- }), (ownerState.isEndOfHighlighting || ownerState.isLastVisibleCell) && _extends({}, endBorderStyle, {
89
- paddingRight: 0
90
- })));
71
+ theme
72
+ }) => ({
73
+ variants: [{
74
+ props: {
75
+ isHiddenDayFiller: false
76
+ },
77
+ style: {
78
+ [`&:first-of-type .${dateRangePickerDayClasses.rangeIntervalDayPreview}`]: _extends({}, startBorderStyle, {
79
+ borderLeftColor: (theme.vars || theme).palette.divider
80
+ }),
81
+ [`&:last-of-type .${dateRangePickerDayClasses.rangeIntervalDayPreview}`]: _extends({}, endBorderStyle, {
82
+ borderRightColor: (theme.vars || theme).palette.divider
83
+ })
84
+ }
85
+ }, {
86
+ props: {
87
+ isHiddenDayFiller: false,
88
+ isHighlighting: true
89
+ },
90
+ style: {
91
+ borderRadius: 0,
92
+ color: (theme.vars || theme).palette.primary.contrastText,
93
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.focusOpacity),
94
+ '&:first-of-type': startBorderStyle,
95
+ '&:last-of-type': endBorderStyle
96
+ }
97
+ }, {
98
+ props: ({
99
+ ownerState: {
100
+ isHiddenDayFiller,
101
+ isStartOfHighlighting,
102
+ isFirstVisibleCell
103
+ }
104
+ }) => !isHiddenDayFiller && (isStartOfHighlighting || isFirstVisibleCell),
105
+ style: _extends({}, startBorderStyle, {
106
+ paddingLeft: 0
107
+ })
108
+ }, {
109
+ props: ({
110
+ ownerState: {
111
+ isHiddenDayFiller,
112
+ isEndOfHighlighting,
113
+ isLastVisibleCell
114
+ }
115
+ }) => !isHiddenDayFiller && (isEndOfHighlighting || isLastVisibleCell),
116
+ style: _extends({}, endBorderStyle, {
117
+ paddingRight: 0
118
+ })
119
+ }]
120
+ }));
91
121
  DateRangePickerDayRoot.propTypes = {
92
122
  // ----------------------------- Warning --------------------------------
93
123
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -106,21 +136,47 @@ const DateRangePickerDayRangeIntervalPreview = styled('div', {
106
136
  [`&.${dateRangePickerDayClasses.rangeIntervalDayPreviewEnd}`]: styles.rangeIntervalDayPreviewEnd
107
137
  }, styles.rangeIntervalPreview]
108
138
  })(({
109
- theme,
110
- ownerState
111
- }) => _extends({
139
+ theme
140
+ }) => ({
112
141
  // replace default day component margin with transparent border to avoid jumping on preview
113
- border: '2px solid transparent'
114
- }, ownerState.isPreviewing && !ownerState.isHiddenDayFiller && _extends({
115
- borderRadius: 0,
116
- border: `2px dashed ${(theme.vars || theme).palette.divider}`,
117
- borderLeftColor: 'transparent',
118
- borderRightColor: 'transparent'
119
- }, (ownerState.isStartOfPreviewing || ownerState.isFirstVisibleCell) && _extends({
120
- borderLeftColor: (theme.vars || theme).palette.divider
121
- }, startBorderStyle), (ownerState.isEndOfPreviewing || ownerState.isLastVisibleCell) && _extends({
122
- borderRightColor: (theme.vars || theme).palette.divider
123
- }, endBorderStyle))));
142
+ border: '2px solid transparent',
143
+ variants: [{
144
+ props: {
145
+ isPreviewing: true,
146
+ isHiddenDayFiller: false
147
+ },
148
+ style: {
149
+ borderRadius: 0,
150
+ border: `2px dashed ${(theme.vars || theme).palette.divider}`,
151
+ borderLeftColor: 'transparent',
152
+ borderRightColor: 'transparent'
153
+ }
154
+ }, {
155
+ props: ({
156
+ ownerState: {
157
+ isPreviewing,
158
+ isHiddenDayFiller,
159
+ isStartOfPreviewing,
160
+ isFirstVisibleCell
161
+ }
162
+ }) => isPreviewing && !isHiddenDayFiller && (isStartOfPreviewing || isFirstVisibleCell),
163
+ style: _extends({
164
+ borderLeftColor: (theme.vars || theme).palette.divider
165
+ }, startBorderStyle)
166
+ }, {
167
+ props: ({
168
+ ownerState: {
169
+ isPreviewing,
170
+ isHiddenDayFiller,
171
+ isEndOfPreviewing,
172
+ isLastVisibleCell
173
+ }
174
+ }) => isPreviewing && !isHiddenDayFiller && (isEndOfPreviewing || isLastVisibleCell),
175
+ style: _extends({
176
+ borderRightColor: (theme.vars || theme).palette.divider
177
+ }, endBorderStyle)
178
+ }]
179
+ }));
124
180
  DateRangePickerDayRangeIntervalPreview.propTypes = {
125
181
  // ----------------------------- Warning --------------------------------
126
182
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -138,19 +194,22 @@ const DateRangePickerDayDay = styled(PickersDay, {
138
194
  }, {
139
195
  [`&.${dateRangePickerDayClasses.notSelectedDate}`]: styles.notSelectedDate
140
196
  }, styles.day]
141
- })(({
142
- ownerState
143
- }) => _extends({
197
+ })({
144
198
  // Required to overlap preview border
145
199
  transform: 'scale(1.1)',
146
200
  '& > *': {
147
201
  transform: 'scale(0.9)'
148
- }
149
- }, ownerState.draggable && {
150
- cursor: 'grab'
151
- }, ownerState.draggable && {
152
- touchAction: 'none'
153
- }));
202
+ },
203
+ variants: [{
204
+ props: {
205
+ draggable: true
206
+ },
207
+ style: {
208
+ cursor: 'grab',
209
+ touchAction: 'none'
210
+ }
211
+ }]
212
+ });
154
213
  const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePickerDay(inProps, ref) {
155
214
  const props = useThemeProps({
156
215
  props: inProps,
@@ -266,6 +325,11 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
266
325
  * @default false
267
326
  */
268
327
  disableTouchRipple: PropTypes.bool,
328
+ /**
329
+ * If `true`, the day can be dragged to change the current date range.
330
+ * @default false
331
+ */
332
+ draggable: PropTypes.bool,
269
333
  /**
270
334
  * If `true`, the base button will have a keyboard focus ripple.
271
335
  * @default false
@@ -49,7 +49,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
49
49
  // ----------------------------------------------------------------------
50
50
  /**
51
51
  * 12h/24h view for hour selection clock.
52
- * @default `utils.is12HourCycleInCurrentLocale()`
52
+ * @default utils.is12HourCycleInCurrentLocale()
53
53
  */
54
54
  ampm: PropTypes.bool,
55
55
  /**
@@ -79,7 +79,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
79
79
  * Formats the day of week displayed in the calendar header.
80
80
  * @param {TDate} date The date of the day of week provided by the adapter.
81
81
  * @returns {string} The name to display.
82
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
82
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
83
83
  */
84
84
  dayOfWeekFormatter: PropTypes.func,
85
85
  /**
@@ -1,5 +1,5 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "ampm", "disabled", "readOnly", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
@@ -35,24 +35,40 @@ const DateTimeRangePickerToolbarStart = styled(DateTimePickerToolbar, {
35
35
  name: 'MuiDateTimeRangePickerToolbar',
36
36
  slot: 'StartToolbar',
37
37
  overridesResolver: (_, styles) => styles.startToolbar
38
- })(({
39
- ownerState
40
- }) => _extends({
41
- borderBottom: 'none'
42
- }, ownerState?.toolbarVariant !== 'desktop' ? {
43
- padding: '12px 8px 0 12px'
44
- } : {
45
- paddingBottom: 0
46
- }));
38
+ })({
39
+ borderBottom: 'none',
40
+ variants: [{
41
+ props: ({
42
+ toolbarVariant
43
+ }) => toolbarVariant !== 'desktop',
44
+ style: {
45
+ padding: '12px 8px 0 12px'
46
+ }
47
+ }, {
48
+ props: {
49
+ toolbarVariant: 'desktop'
50
+ },
51
+ style: {
52
+ paddingBottom: 0
53
+ }
54
+ }]
55
+ });
47
56
  const DateTimeRangePickerToolbarEnd = styled(DateTimePickerToolbar, {
48
57
  name: 'MuiDateTimeRangePickerToolbar',
49
58
  slot: 'EndToolbar',
50
59
  overridesResolver: (_, styles) => styles.endToolbar
51
- })(({
52
- ownerState
53
- }) => ({
54
- padding: ownerState?.toolbarVariant !== 'desktop' ? '12px 8px 12px 12px' : undefined
55
- }));
60
+ })({
61
+ variants: [{
62
+ props: ({
63
+ ownerState: {
64
+ toolbarVariant
65
+ }
66
+ }) => toolbarVariant !== 'desktop',
67
+ style: {
68
+ padding: '12px 8px 12px 12px'
69
+ }
70
+ }]
71
+ });
56
72
  const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTimeRangePickerToolbar(inProps, ref) {
57
73
  const props = useThemeProps({
58
74
  props: inProps,
@@ -85,7 +85,7 @@ DesktopDateRangePicker.propTypes = {
85
85
  * Formats the day of week displayed in the calendar header.
86
86
  * @param {TDate} date The date of the day of week provided by the adapter.
87
87
  * @returns {string} The name to display.
88
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
88
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
89
89
  */
90
90
  dayOfWeekFormatter: PropTypes.func,
91
91
  /**
@@ -125,7 +125,7 @@ DesktopDateTimeRangePicker.propTypes = {
125
125
  // ----------------------------------------------------------------------
126
126
  /**
127
127
  * 12h/24h view for hour selection clock.
128
- * @default `utils.is12HourCycleInCurrentLocale()`
128
+ * @default utils.is12HourCycleInCurrentLocale()
129
129
  */
130
130
  ampm: PropTypes.bool,
131
131
  /**
@@ -155,7 +155,7 @@ DesktopDateTimeRangePicker.propTypes = {
155
155
  * Formats the day of week displayed in the calendar header.
156
156
  * @param {TDate} date The date of the day of week provided by the adapter.
157
157
  * @returns {string} The name to display.
158
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
158
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
159
159
  */
160
160
  dayOfWeekFormatter: PropTypes.func,
161
161
  /**
@@ -81,7 +81,7 @@ MobileDateRangePicker.propTypes = {
81
81
  * Formats the day of week displayed in the calendar header.
82
82
  * @param {TDate} date The date of the day of week provided by the adapter.
83
83
  * @returns {string} The name to display.
84
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
84
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
85
85
  */
86
86
  dayOfWeekFormatter: PropTypes.func,
87
87
  /**
@@ -132,7 +132,7 @@ MobileDateTimeRangePicker.propTypes = {
132
132
  // ----------------------------------------------------------------------
133
133
  /**
134
134
  * 12h/24h view for hour selection clock.
135
- * @default `utils.is12HourCycleInCurrentLocale()`
135
+ * @default utils.is12HourCycleInCurrentLocale()
136
136
  */
137
137
  ampm: PropTypes.bool,
138
138
  /**
@@ -157,7 +157,7 @@ MobileDateTimeRangePicker.propTypes = {
157
157
  * Formats the day of week displayed in the calendar header.
158
158
  * @param {TDate} date The date of the day of week provided by the adapter.
159
159
  * @returns {string} The name to display.
160
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
160
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
161
161
  */
162
162
  dayOfWeekFormatter: PropTypes.func,
163
163
  /**
@@ -263,7 +263,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
263
263
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
264
264
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
265
265
  *
266
- * @default `false`
266
+ * @default false
267
267
  */
268
268
  shouldRespectLeadingZeros: PropTypes.bool,
269
269
  /**
@@ -133,7 +133,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
133
133
  // ----------------------------------------------------------------------
134
134
  /**
135
135
  * 12h/24h view for hour selection clock.
136
- * @default `utils.is12HourCycleInCurrentLocale()`
136
+ * @default utils.is12HourCycleInCurrentLocale()
137
137
  */
138
138
  ampm: PropTypes.bool,
139
139
  /**
@@ -304,7 +304,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
304
304
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
305
305
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
306
306
  *
307
- * @default `false`
307
+ * @default false
308
308
  */
309
309
  shouldRespectLeadingZeros: PropTypes.bool,
310
310
  /**
@@ -133,7 +133,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
133
133
  // ----------------------------------------------------------------------
134
134
  /**
135
135
  * 12h/24h view for hour selection clock.
136
- * @default `utils.is12HourCycleInCurrentLocale()`
136
+ * @default utils.is12HourCycleInCurrentLocale()
137
137
  */
138
138
  ampm: PropTypes.bool,
139
139
  /**
@@ -277,7 +277,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
277
277
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
278
278
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
279
279
  *
280
- * @default `false`
280
+ * @default false
281
281
  */
282
282
  shouldRespectLeadingZeros: PropTypes.bool,
283
283
  /**
@@ -267,7 +267,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
267
267
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
268
268
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
269
269
  *
270
- * @default `false`
270
+ * @default false
271
271
  */
272
272
  shouldRespectLeadingZeros: PropTypes.bool,
273
273
  /**
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: PropTypes.bool,
71
71
  /**
@@ -308,7 +308,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
308
308
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
309
309
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
310
310
  *
311
- * @default `false`
311
+ * @default false
312
312
  */
313
313
  shouldRespectLeadingZeros: PropTypes.bool,
314
314
  /**
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: PropTypes.bool,
71
71
  /**
@@ -281,7 +281,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
281
281
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
282
282
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
283
283
  *
284
- * @default `false`
284
+ * @default false
285
285
  */
286
286
  shouldRespectLeadingZeros: PropTypes.bool,
287
287
  /**
@@ -74,7 +74,7 @@ StaticDateRangePicker.propTypes = {
74
74
  * Formats the day of week displayed in the calendar header.
75
75
  * @param {TDate} date The date of the day of week provided by the adapter.
76
76
  * @returns {string} The name to display.
77
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
77
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
78
78
  */
79
79
  dayOfWeekFormatter: PropTypes.func,
80
80
  /**
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.0.0
2
+ * @mui/x-date-pickers-pro v7.1.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -221,7 +221,7 @@ const useSingleInputFieldSlotProps = ({
221
221
  InputProps: _extends({
222
222
  ref: anchorRef
223
223
  }, fieldProps?.InputProps),
224
- focused: open
224
+ focused: open ? true : undefined
225
225
  }, labelId != null && {
226
226
  id: labelId
227
227
  }, wrapperVariant === 'mobile' && {
@@ -37,7 +37,7 @@ export function calculateRangeChange({
37
37
  nextSelection: 'end',
38
38
  newRange: [selectedDate, null]
39
39
  };
40
- return Boolean(start) && utils.isBefore(selectedDate, start) ? truthyResult : {
40
+ return Boolean(start) && utils.isBeforeDay(selectedDate, start) ? truthyResult : {
41
41
  nextSelection: 'start',
42
42
  newRange: [start, selectedDate]
43
43
  };
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxMTA1ODQwMDAwMA==";
3
+ const releaseInfo = "MTcxMjI2NDQwMDAwMA==";
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
@@ -516,7 +516,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
516
516
  * Formats the day of week displayed in the calendar header.
517
517
  * @param {TDate} date The date of the day of week provided by the adapter.
518
518
  * @returns {string} The name to display.
519
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
519
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
520
520
  */
521
521
  dayOfWeekFormatter: _propTypes.default.func,
522
522
  /**