@mui/x-date-pickers-pro 8.0.0-beta.0 → 8.0.0-beta.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 +77 -0
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
- package/DateRangePicker/DateRangePicker.js +3 -1
- package/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
- package/DateRangePickerDay/DateRangePickerDay.js +88 -56
- package/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
- package/DateRangePickerDay/DateRangePickerDay.types.js +5 -0
- package/DateRangePickerDay/index.d.ts +1 -1
- package/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
- package/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
- package/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -16
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -16
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -16
- package/TimeRangePicker/TimeRangePicker.js +3 -1
- package/esm/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
- package/esm/DateRangePicker/DateRangePicker.js +3 -1
- package/esm/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
- package/esm/DateRangePickerDay/DateRangePickerDay.js +89 -57
- package/esm/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
- package/esm/DateRangePickerDay/DateRangePickerDay.types.js +1 -0
- package/esm/DateRangePickerDay/index.d.ts +1 -1
- package/esm/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
- package/esm/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/esm/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
- package/esm/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
- package/esm/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/esm/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
- package/esm/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
- package/esm/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/esm/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -17
- package/esm/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/esm/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -17
- package/esm/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/esm/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -17
- package/esm/TimeRangePicker/TimeRangePicker.js +3 -1
- package/esm/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
- package/esm/hooks/useMultiInputRangeField/useTextFieldProps.js +4 -16
- package/esm/index.js +1 -1
- package/esm/internals/utils/releaseInfo.js +1 -1
- package/esm/managers/useDateRangeManager.js +3 -3
- package/esm/managers/useDateTimeRangeManager.js +3 -3
- package/esm/managers/useTimeRangeManager.js +3 -3
- package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
- package/hooks/useMultiInputRangeField/useTextFieldProps.js +3 -15
- package/index.js +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/managers/useDateRangeManager.js +3 -3
- package/managers/useDateTimeRangeManager.js +3 -3
- package/managers/useTimeRangeManager.js +3 -3
- package/modern/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
- package/modern/DateRangePicker/DateRangePicker.js +3 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.d.ts +1 -41
- package/modern/DateRangePickerDay/DateRangePickerDay.js +89 -57
- package/modern/DateRangePickerDay/DateRangePickerDay.types.d.ts +91 -0
- package/modern/DateRangePickerDay/DateRangePickerDay.types.js +1 -0
- package/modern/DateRangePickerDay/index.d.ts +1 -1
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +3 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +1 -0
- package/modern/DesktopTimeRangePicker/DesktopTimeRangePicker.js +1 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +1 -0
- package/modern/MobileTimeRangePicker/MobileTimeRangePicker.js +1 -0
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -17
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -17
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -17
- package/modern/TimeRangePicker/TimeRangePicker.js +3 -1
- package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +2 -2
- package/modern/hooks/useMultiInputRangeField/useTextFieldProps.js +4 -16
- package/modern/index.js +1 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/managers/useDateRangeManager.js +3 -3
- package/modern/managers/useDateTimeRangeManager.js +3 -3
- package/modern/managers/useTimeRangeManager.js +3 -3
- package/package.json +4 -4
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,83 @@
|
|
|
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.1
|
|
9
|
+
|
|
10
|
+
_Mar 21, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
17
|
+
@jyash97.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@alexfauquette, @arminmeh, @flaviendelangle, @JCQuintas, @KenanYusuf.
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.0.0-beta.1`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix error caused by `forwardRef` to `ClickAwayListener` (#17049) @arminmeh
|
|
28
|
+
- [DataGrid] Fix error while editing rows with custom id (#17048) @arminmeh
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@8.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@8.0.0-beta.1`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Fix header select checkbox state with `checkboxSelectionVisibleOnly` and `paginationMode="server"` (#17026) @arminmeh
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@8.0.0-beta.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-beta.1`, plus:
|
|
39
|
+
|
|
40
|
+
- [DataGridPremium] Update column state correctly when grouping mode is updated with one grouping column (#17069) @arminmeh
|
|
41
|
+
|
|
42
|
+
### Date and Time Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@8.0.0-beta.1`
|
|
45
|
+
|
|
46
|
+
- [fields] Clean the `useField` hook (part 1) (#16944) @flaviendelangle
|
|
47
|
+
- [fields] Improve the check for year in `doesSectionFormatHaveLeadingZeros` (#17051) @flaviendelangle
|
|
48
|
+
- [pickers] Deprecate the `disableOpenPicker` prop (#17040) @flaviendelangle
|
|
49
|
+
- [pickers] Simplify the `cleanLeadingZeros` method (#17063) @flaviendelangle
|
|
50
|
+
- [pickers] Use the new `ownerState` in `PickersDay` and `DateRangePickerDay` (#17035) @flaviendelangle
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers-pro@8.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
53
|
+
|
|
54
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-beta.1`, plus:
|
|
55
|
+
|
|
56
|
+
- [DateRangePicker] Use desktop media query constant on range pickers (#17052) @flaviendelangle
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@8.0.0-beta.1`
|
|
61
|
+
|
|
62
|
+
- [charts] Fix horizontal bar with multiple axes (#17059) @alexfauquette
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts-pro@8.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-charts@8.0.0-beta.1`, plus:
|
|
67
|
+
|
|
68
|
+
- [charts-pro] Allow disabling Heatmap tooltip (#17060) @JCQuintas
|
|
69
|
+
|
|
70
|
+
### Tree View
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-tree-view@8.0.0-beta.1`
|
|
73
|
+
|
|
74
|
+
Internal changes.
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-tree-view-pro@8.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-tree-view@8.0.0-beta.1`.
|
|
79
|
+
|
|
80
|
+
### Docs
|
|
81
|
+
|
|
82
|
+
- [docs] Fix 404 (#17033) @alexfauquette
|
|
83
|
+
- [docs] Fix Data Grid advanced list view demo (#17064) @KenanYusuf
|
|
84
|
+
|
|
8
85
|
## 8.0.0-beta.0
|
|
9
86
|
|
|
10
87
|
<img width="100%" alt="MUI X v8 Beta is live" src="https://github.com/user-attachments/assets/61ec4dd8-c946-456b-8b45-d51de8772f5d">
|
|
@@ -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/
|
|
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 =
|
|
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,
|
|
@@ -1,45 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
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", "
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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',
|
|
44
|
-
rangeIntervalPreview: ['rangeIntervalPreview',
|
|
45
|
-
day: ['day', !
|
|
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
|
-
|
|
86
|
+
isDayFillerCell: false
|
|
85
87
|
},
|
|
86
88
|
style: {
|
|
87
89
|
[`&:first-of-type .${_dateRangePickerDayClasses.dateRangePickerDayClasses.rangeIntervalDayPreview}`]: (0, _extends2.default)({}, startBorderStyle, {
|
|
@@ -93,7 +95,7 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
|
|
|
93
95
|
}
|
|
94
96
|
}, {
|
|
95
97
|
props: {
|
|
96
|
-
|
|
98
|
+
isDayFillerCell: false,
|
|
97
99
|
isHighlighting: true
|
|
98
100
|
},
|
|
99
101
|
style: {
|
|
@@ -106,22 +108,22 @@ const DateRangePickerDayRoot = (0, _styles.styled)('div', {
|
|
|
106
108
|
}, {
|
|
107
109
|
props: ({
|
|
108
110
|
ownerState: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
isDayFillerCell,
|
|
112
|
+
isDaySelectionStart,
|
|
113
|
+
isDayFirstVisibleCell
|
|
112
114
|
}
|
|
113
|
-
}) => !
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
isDayFillerCell,
|
|
123
|
+
isDaySelectionEnd,
|
|
124
|
+
isDayLastVisibleCell
|
|
123
125
|
}
|
|
124
|
-
}) => !
|
|
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
|
-
|
|
148
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
isDayPreviewed,
|
|
162
|
+
isDayFillerCell,
|
|
163
|
+
isDayPreviewStart,
|
|
164
|
+
isDayFirstVisibleCell
|
|
163
165
|
}
|
|
164
|
-
}) =>
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
isDayPreviewed,
|
|
174
|
+
isDayFillerCell,
|
|
175
|
+
isDayPreviewEnd,
|
|
176
|
+
isDayLastVisibleCell
|
|
175
177
|
}
|
|
176
|
-
}) =>
|
|
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
|
-
|
|
216
|
-
|
|
217
|
+
classes: classesProp,
|
|
218
|
+
isEndOfHighlighting,
|
|
219
|
+
isEndOfPreviewing,
|
|
217
220
|
isHighlighting,
|
|
218
221
|
isPreviewing,
|
|
219
|
-
|
|
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
|
|
243
|
+
const pickersDayOwnerState = (0, _internals.usePickerDayOwnerState)({
|
|
244
|
+
day,
|
|
234
245
|
selected,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
+
}
|
|
@@ -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';
|
|
@@ -14,6 +14,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
|
+
var _internals = require("@mui/x-date-pickers/internals");
|
|
17
18
|
var _DesktopDateTimeRangePicker = require("../DesktopDateTimeRangePicker");
|
|
18
19
|
var _MobileDateTimeRangePicker = require("../MobileDateTimeRangePicker");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -34,7 +35,7 @@ const DateTimeRangePicker = exports.DateTimeRangePicker = /*#__PURE__*/React.for
|
|
|
34
35
|
name: 'MuiDateTimeRangePicker'
|
|
35
36
|
});
|
|
36
37
|
const {
|
|
37
|
-
desktopModeMediaQuery =
|
|
38
|
+
desktopModeMediaQuery = _internals.DEFAULT_DESKTOP_MODE_MEDIA_QUERY
|
|
38
39
|
} = props,
|
|
39
40
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
40
41
|
|
|
@@ -141,6 +142,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
141
142
|
disableIgnoringDatePartForTimeValidation: _propTypes.default.bool,
|
|
142
143
|
/**
|
|
143
144
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
145
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
144
146
|
* @default false
|
|
145
147
|
*/
|
|
146
148
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -145,6 +145,7 @@ DesktopDateRangePicker.propTypes = {
|
|
|
145
145
|
disableHighlightToday: _propTypes.default.bool,
|
|
146
146
|
/**
|
|
147
147
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
148
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
148
149
|
* @default false
|
|
149
150
|
*/
|
|
150
151
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -223,6 +223,7 @@ DesktopDateTimeRangePicker.propTypes = {
|
|
|
223
223
|
disableIgnoringDatePartForTimeValidation: _propTypes.default.bool,
|
|
224
224
|
/**
|
|
225
225
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
226
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
226
227
|
* @default false
|
|
227
228
|
*/
|
|
228
229
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -164,6 +164,7 @@ DesktopTimeRangePicker.propTypes = {
|
|
|
164
164
|
disableIgnoringDatePartForTimeValidation: _propTypes.default.bool,
|
|
165
165
|
/**
|
|
166
166
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
167
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
167
168
|
* @default false
|
|
168
169
|
*/
|
|
169
170
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -137,6 +137,7 @@ MobileDateRangePicker.propTypes = {
|
|
|
137
137
|
disableHighlightToday: _propTypes.default.bool,
|
|
138
138
|
/**
|
|
139
139
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
140
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
140
141
|
* @default false
|
|
141
142
|
*/
|
|
142
143
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -223,6 +223,7 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
223
223
|
disableIgnoringDatePartForTimeValidation: _propTypes.default.bool,
|
|
224
224
|
/**
|
|
225
225
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
226
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
226
227
|
* @default false
|
|
227
228
|
*/
|
|
228
229
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -154,6 +154,7 @@ MobileTimeRangePicker.propTypes = {
|
|
|
154
154
|
disableIgnoringDatePartForTimeValidation: _propTypes.default.bool,
|
|
155
155
|
/**
|
|
156
156
|
* If `true`, the button to open the Picker will not be rendered (it will only render the field).
|
|
157
|
+
* @deprecated Use the [field component](https://next.mui.com/x/react-date-pickers/fields/) instead.
|
|
157
158
|
* @default false
|
|
158
159
|
*/
|
|
159
160
|
disableOpenPicker: _propTypes.default.bool,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UseSingleInputDateRangeFieldProps } from "./SingleInputDateRangeField.types.js";
|
|
2
|
-
export declare const useSingleInputDateRangeField: <TEnableAccessibleFieldDOMStructure extends boolean,
|
|
2
|
+
export declare const useSingleInputDateRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseSingleInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure>>(props: TProps) => import("@mui/x-date-pickers/internals").UseFieldReturnValue<TEnableAccessibleFieldDOMStructure, TProps>;
|
|
@@ -6,26 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useSingleInputDateRangeField = void 0;
|
|
8
8
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
9
|
-
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
10
9
|
var _managers = require("../managers");
|
|
11
10
|
const useSingleInputDateRangeField = props => {
|
|
12
11
|
const manager = (0, _managers.useDateRangeManager)(props);
|
|
13
|
-
const {
|
|
14
|
-
forwardedProps,
|
|
15
|
-
internalProps
|
|
16
|
-
} = (0, _hooks.useSplitFieldProps)(props, 'date');
|
|
17
|
-
const internalPropsWithDefaults = (0, _internals.useFieldInternalPropsWithDefaults)({
|
|
18
|
-
manager,
|
|
19
|
-
internalProps
|
|
20
|
-
});
|
|
21
12
|
return (0, _internals.useField)({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
valueManager: manager.internal_valueManager,
|
|
25
|
-
fieldValueManager: manager.internal_fieldValueManager,
|
|
26
|
-
validator: manager.validator,
|
|
27
|
-
valueType: manager.valueType,
|
|
28
|
-
getOpenPickerButtonAriaLabel: manager.internal_useOpenPickerButtonAriaLabel()
|
|
13
|
+
manager,
|
|
14
|
+
props
|
|
29
15
|
});
|
|
30
16
|
};
|
|
31
17
|
exports.useSingleInputDateRangeField = useSingleInputDateRangeField;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UseSingleInputDateTimeRangeFieldProps } from "./SingleInputDateTimeRangeField.types.js";
|
|
2
|
-
export declare const useSingleInputDateTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean,
|
|
2
|
+
export declare const useSingleInputDateTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseSingleInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure>>(props: TProps) => import("@mui/x-date-pickers/internals").UseFieldReturnValue<TEnableAccessibleFieldDOMStructure, TProps>;
|