@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.
- package/CHANGELOG.md +246 -4
- package/DateRangeCalendar/DateRangeCalendar.js +1 -1
- package/DateRangePicker/DateRangePicker.js +1 -1
- package/DateRangePickerDay/DateRangePickerDay.d.ts +5 -0
- package/DateRangePickerDay/DateRangePickerDay.js +107 -43
- package/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
- package/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
- package/README.md +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/index.js +1 -1
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
- package/internals/models/dateTimeRange.d.ts +1 -1
- package/internals/models/timeRange.d.ts +1 -1
- package/internals/utils/date-range-manager.js +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +1 -1
- package/modern/DateRangePicker/DateRangePicker.js +1 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.js +107 -43
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
- package/modern/internals/utils/date-range-manager.js +1 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +1 -1
- package/node/DateRangePicker/DateRangePicker.js +1 -1
- package/node/DateRangePickerDay/DateRangePickerDay.js +107 -43
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +31 -15
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +2 -2
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +2 -2
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +2 -2
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -2
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +2 -2
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +2 -2
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +1 -1
- package/node/internals/utils/date-range-manager.js +1 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
77
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
78
78
|
*/
|
|
79
79
|
dayOfWeekFormatter: PropTypes.func,
|
|
80
80
|
/**
|
package/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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.
|
|
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 = "
|
|
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 (
|
|
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 (
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
|
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 (
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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 (
|
|
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
|
|
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 (
|
|
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 (
|
|
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
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
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
|
@@ -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.
|
|
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 = "
|
|
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 (
|
|
519
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
520
520
|
*/
|
|
521
521
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
522
522
|
/**
|