@mui/x-date-pickers-pro 5.0.1 → 5.0.3
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 +70 -2
- package/DateRangePicker/DateRangePicker.js +3 -3
- package/DateRangePicker/DateRangePickerInput.d.ts +4 -2
- package/DateRangePicker/DateRangePickerInput.js +31 -5
- package/DateRangePicker/DateRangePickerToolbar.d.ts +4 -4
- package/DateRangePicker/DateRangePickerToolbar.js +31 -8
- package/DateRangePicker/DateRangePickerView.d.ts +2 -2
- package/DateRangePicker/DateRangePickerViewDesktop.d.ts +4 -3
- package/DateRangePicker/DateRangePickerViewDesktop.js +38 -6
- package/DateRangePicker/DateRangePickerViewMobile.d.ts +1 -1
- package/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/DateRangePicker/dateRangePickerInputClasses.d.ts +7 -0
- package/DateRangePicker/dateRangePickerInputClasses.js +5 -0
- package/DateRangePicker/dateRangePickerToolbarClasses.d.ts +9 -0
- package/DateRangePicker/dateRangePickerToolbarClasses.js +5 -0
- package/DateRangePicker/dateRangePickerViewDesktopClasses.d.ts +9 -0
- package/DateRangePicker/dateRangePickerViewDesktopClasses.js +5 -0
- package/DateRangePicker/index.d.ts +6 -0
- package/DateRangePicker/index.js +4 -1
- package/DateRangePicker/shared.d.ts +2 -2
- package/DateRangePickerDay/DateRangePickerDay.js +30 -5
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +3 -3
- package/MobileDateRangePicker/MobileDateRangePicker.js +3 -3
- package/StaticDateRangePicker/StaticDateRangePicker.js +8 -6
- package/index.js +1 -1
- package/internal/utils/releaseInfo.js +1 -1
- package/legacy/DateRangePicker/DateRangePicker.js +3 -3
- package/legacy/DateRangePicker/DateRangePickerInput.js +30 -4
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +31 -8
- package/legacy/DateRangePicker/DateRangePickerViewDesktop.js +40 -5
- package/legacy/DateRangePicker/DateRangePickerViewMobile.js +2 -1
- package/legacy/DateRangePicker/dateRangePickerInputClasses.js +5 -0
- package/legacy/DateRangePicker/dateRangePickerToolbarClasses.js +5 -0
- package/legacy/DateRangePicker/dateRangePickerViewDesktopClasses.js +5 -0
- package/legacy/DateRangePicker/index.js +4 -1
- package/legacy/DateRangePickerDay/DateRangePickerDay.js +27 -16
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +3 -3
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +3 -3
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +7 -5
- package/legacy/index.js +1 -1
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/modern/DateRangePicker/DateRangePicker.js +3 -3
- package/modern/DateRangePicker/DateRangePickerInput.js +31 -5
- package/modern/DateRangePicker/DateRangePickerToolbar.js +31 -8
- package/modern/DateRangePicker/DateRangePickerViewDesktop.js +38 -6
- package/modern/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/modern/DateRangePicker/dateRangePickerInputClasses.js +5 -0
- package/modern/DateRangePicker/dateRangePickerToolbarClasses.js +5 -0
- package/modern/DateRangePicker/dateRangePickerViewDesktopClasses.js +5 -0
- package/modern/DateRangePicker/index.js +4 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.js +30 -5
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +3 -3
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +3 -3
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +8 -6
- package/modern/index.js +1 -1
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/node/DateRangePicker/DateRangePicker.js +3 -3
- package/node/DateRangePicker/DateRangePickerInput.js +31 -4
- package/node/DateRangePicker/DateRangePickerToolbar.js +30 -9
- package/node/DateRangePicker/DateRangePickerViewDesktop.js +38 -5
- package/node/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/node/DateRangePicker/dateRangePickerInputClasses.js +16 -0
- package/node/DateRangePicker/dateRangePickerToolbarClasses.js +16 -0
- package/node/DateRangePicker/dateRangePickerViewDesktopClasses.js +16 -0
- package/node/DateRangePicker/index.js +43 -1
- package/node/DateRangePickerDay/DateRangePickerDay.js +28 -4
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +3 -3
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +3 -3
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +8 -6
- package/node/index.js +1 -1
- package/node/internal/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +38 -3
- package/themeAugmentation/overrides.d.ts +10 -0
- package/themeAugmentation/props.d.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,74 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## v5.17.4
|
|
7
|
+
|
|
8
|
+
_Sep 22, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Finnish (fi-FI) locale to the pickers (#6230) @PetroSilenius
|
|
13
|
+
- 🌍 Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.4` / `@mui/x-data-grid-pro@v5.17.4` / `@mui/x-data-grid-premium@v5.17.4`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Do not publish `cellFocusOut` event if the row was removed (#6251) @cherniavskii
|
|
21
|
+
- [DataGrid] Improve Polish (pl-PL) locale on the data grid (#6245) @grzegorz-bach
|
|
22
|
+
|
|
23
|
+
### `@mui/x-date-pickers@v5.0.3` / `@mui/x-date-pickers-pro@v5.0.3`
|
|
24
|
+
|
|
25
|
+
#### Changes
|
|
26
|
+
|
|
27
|
+
- [pickers] Add Finnish (fi-FI) locale to pickers (#6219) (#6230) @PetroSilenius
|
|
28
|
+
- [pickers] Add Persian (fa-IR) locale to the pickers (#6181) @fakhamatia
|
|
29
|
+
- [pickers] Fix usage with Typescript 4.8 (#6229) @flaviendelangle
|
|
30
|
+
- [YearPicker] Scroll to the current year even with `autoFocus=false` (#6224) @alexfauquette
|
|
31
|
+
|
|
32
|
+
### Docs
|
|
33
|
+
|
|
34
|
+
- [docs] Fix 301 link (#6239) @oliviertassinari
|
|
35
|
+
|
|
36
|
+
### Core
|
|
37
|
+
|
|
38
|
+
- [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
|
|
39
|
+
|
|
40
|
+
## 5.17.3
|
|
41
|
+
|
|
42
|
+
_Sep 16, 2022_
|
|
43
|
+
|
|
44
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
45
|
+
|
|
46
|
+
- 📝 Fix lost characters when typing into fields in the DataGrid (#5646) @m4theushw
|
|
47
|
+
- 🌏 New locale and improvements for pickers
|
|
48
|
+
- 🎁 Improve support to theme augmentation for pickers
|
|
49
|
+
|
|
50
|
+
### `@mui/x-data-grid@v5.17.3` / `@mui/x-data-grid-pro@v5.17.3` / `@mui/x-data-grid-premium@v5.17.3`
|
|
51
|
+
|
|
52
|
+
#### Changes
|
|
53
|
+
|
|
54
|
+
- [DataGrid] Only update input with value prop if debounce is off (#5646) @m4theushw
|
|
55
|
+
|
|
56
|
+
### `@mui/x-date-pickers@v5.0.2` / `@mui/x-date-pickers-pro@v5.0.2`
|
|
57
|
+
|
|
58
|
+
#### Changes
|
|
59
|
+
|
|
60
|
+
- [pickers] Add Icelandic (is-IS) locale (#6137) @elvatli
|
|
61
|
+
- [pickers] Fix `@mui/x-date-pickers` theme augmentation and style overriding (#6156) @LukasTy
|
|
62
|
+
- [pickers] Fix `@mui/x-date-pickers-pro` theme augmentation (#6096) @LukasTy
|
|
63
|
+
- [pickers] Improve German (de-DE) locale (#6138) @alexfauquette
|
|
64
|
+
|
|
65
|
+
### Docs
|
|
66
|
+
|
|
67
|
+
- [docs] Improve main demo to show new functionalities (#5292) @joserodolfofreitas
|
|
68
|
+
|
|
69
|
+
### Core
|
|
70
|
+
|
|
71
|
+
- [core] Update to typescript 4.8.3 (#6136) @flaviendelangle
|
|
72
|
+
- [core] Update RFC template (#6100) @bytasv
|
|
73
|
+
|
|
6
74
|
## 5.17.2
|
|
7
75
|
|
|
8
76
|
_Sep 9, 2022_
|
|
@@ -11,7 +79,7 @@ This release will the last regular release for our `v5` packages.
|
|
|
11
79
|
From now on, we'll be focusing on developing MUI X v6.
|
|
12
80
|
You can check the [roadmap](https://github.com/mui/mui-x/projects/1) for more details on what's coming next.
|
|
13
81
|
|
|
14
|
-
And if you'd like to help, please consider volunteering to give us a [user interview](https://
|
|
82
|
+
And if you'd like to help, please consider volunteering to give us a [user interview](https://forms.gle/vsBv6CLPz9h57xg8A).
|
|
15
83
|
We'd love to know more about your use cases, pain points and expectations for the future.
|
|
16
84
|
|
|
17
85
|
The `v5` packages will only get new versions to patch critical bug fixes.
|
|
@@ -67,7 +135,7 @@ We'd like to offer a big thanks to the 3 contributors who made this release poss
|
|
|
67
135
|
|
|
68
136
|
_Sep 2, 2022_
|
|
69
137
|
|
|
70
|
-
🎉 We are excited to finally introduce a stable release (v5.0.0) for the `@mui/x-date-pickers` and
|
|
138
|
+
🎉 We are excited to finally introduce a stable release (v5.0.0) for the `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` packages!
|
|
71
139
|
|
|
72
140
|
If you are still using picker components from the `lab`, take a look at the [migration guide](https://mui.com/x/react-date-pickers/migration-lab/).
|
|
73
141
|
|
|
@@ -170,7 +170,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
170
170
|
/**
|
|
171
171
|
* Text for end input label and toolbar placeholder.
|
|
172
172
|
* @default 'End'
|
|
173
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
173
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
|
|
174
174
|
*/
|
|
175
175
|
endText: PropTypes.node,
|
|
176
176
|
|
|
@@ -188,7 +188,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
188
188
|
* Get aria-label text for switching between views button.
|
|
189
189
|
* @param {CalendarPickerView} currentView The view from which we want to get the button text.
|
|
190
190
|
* @returns {string} The label of the view.
|
|
191
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
191
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
|
|
192
192
|
*/
|
|
193
193
|
getViewSwitchingButtonText: PropTypes.func,
|
|
194
194
|
ignoreInvalidInputs: PropTypes.bool,
|
|
@@ -422,7 +422,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
422
422
|
/**
|
|
423
423
|
* Text for start input label and toolbar placeholder.
|
|
424
424
|
* @default 'Start'
|
|
425
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
425
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
|
|
426
426
|
*/
|
|
427
427
|
startText: PropTypes.node,
|
|
428
428
|
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { DateInputProps, ExportedDateInputProps, MuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { CurrentlySelectingRangeEndProps, DateRange } from '../internal/models/dateRange';
|
|
4
4
|
import { DateRangeValidationError } from '../internal/hooks/validation/useDateRangeValidation';
|
|
5
|
+
import { DateRangePickerInputClasses } from './dateRangePickerInputClasses';
|
|
5
6
|
export interface ExportedDateRangePickerInputProps<TInputDate, TDate> extends Omit<ExportedDateInputProps<TInputDate, TDate>, 'renderInput'> {
|
|
6
7
|
/**
|
|
7
8
|
* The `renderInput` prop allows you to customize the rendered input.
|
|
@@ -27,13 +28,14 @@ export interface ExportedDateRangePickerInputProps<TInputDate, TDate> extends Om
|
|
|
27
28
|
renderInput: (startProps: MuiTextFieldProps, endProps: MuiTextFieldProps) => React.ReactElement;
|
|
28
29
|
onChange: (date: DateRange<TDate>, keyboardInputValue?: string) => void;
|
|
29
30
|
}
|
|
30
|
-
export interface
|
|
31
|
+
export interface DateRangePickerInputProps<TInputDate, TDate> extends ExportedDateRangePickerInputProps<TInputDate, TDate>, Omit<DateInputProps<TInputDate, TDate>, keyof ExportedDateRangePickerInputProps<TInputDate, TDate> | 'rawValue' | 'validationError'>, CurrentlySelectingRangeEndProps {
|
|
31
32
|
startText: React.ReactNode;
|
|
32
33
|
endText: React.ReactNode;
|
|
33
34
|
validationError: DateRangeValidationError;
|
|
34
35
|
rawValue: DateRange<TInputDate>;
|
|
36
|
+
classes?: Partial<DateRangePickerInputClasses>;
|
|
35
37
|
}
|
|
36
|
-
declare type DatePickerInputComponent = <TInputDate, TDate>(props:
|
|
38
|
+
declare type DatePickerInputComponent = <TInputDate, TDate>(props: DateRangePickerInputProps<TInputDate, TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
37
39
|
/**
|
|
38
40
|
* @ignore - internal component.
|
|
39
41
|
*/
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["currentlySelectingRangeEnd", "disableOpenPicker", "endText", "onBlur", "onChange", "open", "openPicker", "rawValue", "rawValue", "readOnly", "renderInput", "setCurrentlySelectingRangeEnd", "startText", "TextFieldProps", "validationError"];
|
|
3
|
+
const _excluded = ["currentlySelectingRangeEnd", "disableOpenPicker", "endText", "onBlur", "onChange", "open", "openPicker", "rawValue", "rawValue", "readOnly", "renderInput", "setCurrentlySelectingRangeEnd", "startText", "TextFieldProps", "validationError", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
8
|
import { useUtils, executeInTheNextEventLoopTick, useMaskedInput, onSpaceOrEnter } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { getDateRangePickerInputUtilityClass } from './dateRangePickerInputClasses';
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
11
|
+
|
|
12
|
+
const useUtilityClasses = ownerState => {
|
|
13
|
+
const {
|
|
14
|
+
classes
|
|
15
|
+
} = ownerState;
|
|
16
|
+
const slots = {
|
|
17
|
+
root: ['root']
|
|
18
|
+
};
|
|
19
|
+
return composeClasses(slots, getDateRangePickerInputUtilityClass, classes);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const DateRangePickerInputRoot = styled('div', {
|
|
23
|
+
name: 'MuiDateRangePickerInput',
|
|
24
|
+
slot: 'Root',
|
|
25
|
+
overridesResolver: (_, styles) => styles.root
|
|
26
|
+
})(({
|
|
9
27
|
theme
|
|
10
28
|
}) => ({
|
|
11
29
|
display: 'flex',
|
|
@@ -19,7 +37,12 @@ const DateRangePickerInputRoot = styled('div')(({
|
|
|
19
37
|
/**
|
|
20
38
|
* @ignore - internal component.
|
|
21
39
|
*/
|
|
22
|
-
export const DateRangePickerInput = /*#__PURE__*/React.forwardRef(function DateRangePickerInput(
|
|
40
|
+
export const DateRangePickerInput = /*#__PURE__*/React.forwardRef(function DateRangePickerInput(inProps, ref) {
|
|
41
|
+
const props = useThemeProps({
|
|
42
|
+
props: inProps,
|
|
43
|
+
name: 'MuiDateRangePickerInput'
|
|
44
|
+
});
|
|
45
|
+
|
|
23
46
|
const {
|
|
24
47
|
currentlySelectingRangeEnd,
|
|
25
48
|
disableOpenPicker,
|
|
@@ -34,13 +57,15 @@ export const DateRangePickerInput = /*#__PURE__*/React.forwardRef(function DateR
|
|
|
34
57
|
setCurrentlySelectingRangeEnd,
|
|
35
58
|
startText,
|
|
36
59
|
TextFieldProps,
|
|
37
|
-
validationError: [startValidationError, endValidationError]
|
|
60
|
+
validationError: [startValidationError, endValidationError],
|
|
61
|
+
className
|
|
38
62
|
} = props,
|
|
39
63
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
64
|
|
|
41
65
|
const utils = useUtils();
|
|
42
66
|
const startRef = React.useRef(null);
|
|
43
67
|
const endRef = React.useRef(null);
|
|
68
|
+
const classes = useUtilityClasses(props);
|
|
44
69
|
React.useEffect(() => {
|
|
45
70
|
if (!open) {
|
|
46
71
|
return;
|
|
@@ -135,6 +160,7 @@ export const DateRangePickerInput = /*#__PURE__*/React.forwardRef(function DateR
|
|
|
135
160
|
return /*#__PURE__*/_jsx(DateRangePickerInputRoot, {
|
|
136
161
|
onBlur: onBlur,
|
|
137
162
|
ref: ref,
|
|
163
|
+
className: clsx(classes.root, className),
|
|
138
164
|
children: renderInput(startInputProps, endInputProps)
|
|
139
165
|
});
|
|
140
166
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseToolbarProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DateRange, CurrentlySelectingRangeEndProps } from '../internal/models';
|
|
4
|
-
|
|
5
|
-
interface DateRangePickerToolbarProps<TDate> extends CurrentlySelectingRangeEndProps, Pick<BaseToolbarProps<TDate, DateRange<TDate>>, 'isMobileKeyboardViewOpen' | 'toggleMobileKeyboardView' | 'toolbarTitle' | 'toolbarFormat' | 'parsedValue'> {
|
|
4
|
+
import { DateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
|
|
5
|
+
export interface DateRangePickerToolbarProps<TDate> extends CurrentlySelectingRangeEndProps, Pick<BaseToolbarProps<TDate, DateRange<TDate>>, 'isMobileKeyboardViewOpen' | 'toggleMobileKeyboardView' | 'toolbarTitle' | 'toolbarFormat' | 'parsedValue'> {
|
|
6
6
|
startText: React.ReactNode;
|
|
7
7
|
endText: React.ReactNode;
|
|
8
|
+
classes?: Partial<DateRangePickerToolbarClasses>;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* @ignore - internal component.
|
|
11
12
|
*/
|
|
12
|
-
export declare const DateRangePickerToolbar: <
|
|
13
|
-
export {};
|
|
13
|
+
export declare const DateRangePickerToolbar: React.ForwardRefExoticComponent<DateRangePickerToolbarProps<unknown> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,30 +1,50 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import Typography from '@mui/material/Typography';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
import {
|
|
3
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
4
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
5
5
|
import { PickersToolbar, PickersToolbarButton, pickersToolbarClasses, useUtils, useLocaleText } from '@mui/x-date-pickers/internals';
|
|
6
|
+
import { getDateRangePickerToolbarUtilityClass } from './dateRangePickerToolbarClasses';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
const useUtilityClasses = ownerState => {
|
|
11
|
+
const {
|
|
12
|
+
classes
|
|
13
|
+
} = ownerState;
|
|
14
|
+
const slots = {
|
|
15
|
+
root: ['root'],
|
|
16
|
+
container: ['container']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getDateRangePickerToolbarUtilityClass, classes);
|
|
19
|
+
};
|
|
20
|
+
|
|
9
21
|
const DateRangePickerToolbarRoot = styled(PickersToolbar, {
|
|
10
22
|
name: 'MuiDateRangePickerToolbar',
|
|
11
23
|
slot: 'Root',
|
|
12
|
-
overridesResolver: (
|
|
24
|
+
overridesResolver: (_, styles) => styles.root
|
|
13
25
|
})({
|
|
14
26
|
[`& .${pickersToolbarClasses.penIconButton}`]: {
|
|
15
27
|
position: 'relative',
|
|
16
28
|
top: 4
|
|
17
29
|
}
|
|
18
30
|
});
|
|
19
|
-
const DateRangePickerToolbarContainer = styled('div'
|
|
31
|
+
const DateRangePickerToolbarContainer = styled('div', {
|
|
32
|
+
name: 'MuiDateRangePickerToolbar',
|
|
33
|
+
slot: 'Container',
|
|
34
|
+
overridesResolver: (_, styles) => styles.container
|
|
35
|
+
})({
|
|
20
36
|
display: 'flex'
|
|
21
37
|
});
|
|
22
38
|
/**
|
|
23
39
|
* @ignore - internal component.
|
|
24
40
|
*/
|
|
25
41
|
|
|
26
|
-
export const DateRangePickerToolbar =
|
|
42
|
+
export const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangePickerToolbar(inProps, ref) {
|
|
27
43
|
const utils = useUtils();
|
|
44
|
+
const props = useThemeProps({
|
|
45
|
+
props: inProps,
|
|
46
|
+
name: 'MuiDateRangePickerToolbar'
|
|
47
|
+
});
|
|
28
48
|
const {
|
|
29
49
|
currentlySelectingRangeEnd,
|
|
30
50
|
parsedValue: [start, end],
|
|
@@ -41,14 +61,17 @@ export const DateRangePickerToolbar = props => {
|
|
|
41
61
|
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : startText;
|
|
42
62
|
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : endText;
|
|
43
63
|
const ownerState = props;
|
|
64
|
+
const classes = useUtilityClasses(ownerState);
|
|
44
65
|
return /*#__PURE__*/_jsx(DateRangePickerToolbarRoot, {
|
|
45
66
|
toolbarTitle: toolbarTitle,
|
|
46
67
|
isMobileKeyboardViewOpen: isMobileKeyboardViewOpen,
|
|
47
68
|
toggleMobileKeyboardView: toggleMobileKeyboardView,
|
|
48
69
|
isLandscape: false,
|
|
49
|
-
className:
|
|
70
|
+
className: classes.root,
|
|
50
71
|
ownerState: ownerState,
|
|
72
|
+
ref: ref,
|
|
51
73
|
children: /*#__PURE__*/_jsxs(DateRangePickerToolbarContainer, {
|
|
74
|
+
className: classes.container,
|
|
52
75
|
children: [/*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
53
76
|
variant: start !== null ? 'h5' : 'h6',
|
|
54
77
|
value: startDateValue,
|
|
@@ -65,4 +88,4 @@ export const DateRangePickerToolbar = props => {
|
|
|
65
88
|
})]
|
|
66
89
|
})
|
|
67
90
|
});
|
|
68
|
-
};
|
|
91
|
+
});
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ExportedCalendarPickerProps, PickerStatePickerProps, BaseDateValidationProps, DayValidationProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DateRange, CurrentlySelectingRangeEndProps, DayRangeValidationProps } from '../internal/models/dateRange';
|
|
4
4
|
import { DateRangePickerViewMobileSlotsComponent, DateRangePickerViewMobileSlotsComponentsProps } from './DateRangePickerViewMobile';
|
|
5
|
-
import {
|
|
5
|
+
import { DateRangePickerInputProps } from './DateRangePickerInput';
|
|
6
6
|
import { ExportedDesktopDateRangeCalendarProps } from './DateRangePickerViewDesktop';
|
|
7
7
|
export interface DateRangePickerViewSlotsComponent extends DateRangePickerViewMobileSlotsComponent {
|
|
8
8
|
}
|
|
@@ -47,7 +47,7 @@ interface DateRangePickerViewProps<TInputDate, TDate> extends CurrentlySelecting
|
|
|
47
47
|
open: boolean;
|
|
48
48
|
startText: React.ReactNode;
|
|
49
49
|
endText: React.ReactNode;
|
|
50
|
-
DateInputProps:
|
|
50
|
+
DateInputProps: DateRangePickerInputProps<TInputDate, TDate>;
|
|
51
51
|
}
|
|
52
52
|
declare type DateRangePickerViewComponent = (<TInputDate, TDate = TInputDate>(props: DateRangePickerViewProps<TInputDate, TDate>) => JSX.Element) & {
|
|
53
53
|
propTypes?: any;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ExportedArrowSwitcherProps, DayPickerProps, DayValidationProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DateRange } from '../internal/models';
|
|
4
4
|
import { DateRangePickerDayProps } from '../DateRangePickerDay';
|
|
5
|
+
import { DateRangePickerViewDesktopClasses } from './dateRangePickerViewDesktopClasses';
|
|
5
6
|
export interface ExportedDesktopDateRangeCalendarProps<TDate> {
|
|
6
7
|
/**
|
|
7
8
|
* The number of calendars that render on **desktop**.
|
|
@@ -18,14 +19,14 @@ export interface ExportedDesktopDateRangeCalendarProps<TDate> {
|
|
|
18
19
|
*/
|
|
19
20
|
renderDay?: (day: TDate, dateRangePickerDayProps: DateRangePickerDayProps<TDate>) => JSX.Element;
|
|
20
21
|
}
|
|
21
|
-
interface DesktopDateRangeCalendarProps<TDate> extends ExportedDesktopDateRangeCalendarProps<TDate>, Omit<DayPickerProps<TDate>, 'selectedDays' | 'renderDay' | 'onFocusedDayChange'>, DayValidationProps<TDate>, ExportedArrowSwitcherProps {
|
|
22
|
+
export interface DesktopDateRangeCalendarProps<TDate> extends ExportedDesktopDateRangeCalendarProps<TDate>, Omit<DayPickerProps<TDate>, 'selectedDays' | 'renderDay' | 'onFocusedDayChange' | 'classes'>, DayValidationProps<TDate>, ExportedArrowSwitcherProps {
|
|
22
23
|
calendars: 1 | 2 | 3;
|
|
23
24
|
parsedValue: DateRange<TDate>;
|
|
24
25
|
changeMonth: (date: TDate) => void;
|
|
25
26
|
currentlySelectingRangeEnd: 'start' | 'end';
|
|
27
|
+
classes?: Partial<DateRangePickerViewDesktopClasses>;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* @ignore - internal component.
|
|
29
31
|
*/
|
|
30
|
-
export declare function DateRangePickerViewDesktop<TDate>(
|
|
31
|
-
export {};
|
|
32
|
+
export declare function DateRangePickerViewDesktop<TDate>(inProps: DesktopDateRangeCalendarProps<TDate>): JSX.Element;
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["calendars", "changeMonth", "components", "componentsProps", "currentlySelectingRangeEnd", "currentMonth", "parsedValue", "disableFuture", "disablePast", "leftArrowButtonText", "maxDate", "minDate", "onSelectedDaysChange", "renderDay", "rightArrowButtonText"];
|
|
3
|
+
const _excluded = ["calendars", "changeMonth", "components", "componentsProps", "currentlySelectingRangeEnd", "currentMonth", "parsedValue", "disableFuture", "disablePast", "leftArrowButtonText", "maxDate", "minDate", "onSelectedDaysChange", "renderDay", "rightArrowButtonText", "className", "classes"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
8
|
import { useDefaultDates, useUtils, useLocaleText, PickersArrowSwitcher, usePreviousMonthDisabled, useNextMonthDisabled, DayPicker, buildDeprecatedPropsWarning, DAY_MARGIN } from '@mui/x-date-pickers/internals';
|
|
7
9
|
import { calculateRangePreview } from './date-range-manager';
|
|
8
10
|
import { DateRangePickerDay } from '../DateRangePickerDay';
|
|
9
11
|
import { isWithinRange, isStartOfRange, isEndOfRange } from '../internal/utils/date-utils';
|
|
10
12
|
import { doNothing } from '../internal/utils/utils';
|
|
13
|
+
import { getDateRangePickerViewDesktopUtilityClass } from './dateRangePickerViewDesktopClasses';
|
|
11
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
15
|
import { createElement as _createElement } from "react";
|
|
13
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
17
|
+
|
|
18
|
+
const useUtilityClasses = ownerState => {
|
|
19
|
+
const {
|
|
20
|
+
classes
|
|
21
|
+
} = ownerState;
|
|
22
|
+
const slots = {
|
|
23
|
+
root: ['root'],
|
|
24
|
+
container: ['container']
|
|
25
|
+
};
|
|
26
|
+
return composeClasses(slots, getDateRangePickerViewDesktopUtilityClass, classes);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const DateRangePickerViewDesktopRoot = styled('div', {
|
|
30
|
+
name: 'MuiDateRangePickerViewDesktop',
|
|
31
|
+
slot: 'Root',
|
|
32
|
+
overridesResolver: (_, styles) => styles.root
|
|
33
|
+
})({
|
|
15
34
|
display: 'flex',
|
|
16
35
|
flexDirection: 'row'
|
|
17
36
|
});
|
|
18
|
-
const DateRangePickerViewDesktopContainer = styled('div'
|
|
37
|
+
const DateRangePickerViewDesktopContainer = styled('div', {
|
|
38
|
+
name: 'MuiDateRangePickerViewDesktop',
|
|
39
|
+
slot: 'Container',
|
|
40
|
+
overridesResolver: (_, styles) => styles.container
|
|
41
|
+
})(({
|
|
19
42
|
theme
|
|
20
43
|
}) => ({
|
|
21
44
|
'&:not(:last-of-type)': {
|
|
@@ -57,7 +80,12 @@ const deprecatedPropsWarning = buildDeprecatedPropsWarning('Props for translatio
|
|
|
57
80
|
* @ignore - internal component.
|
|
58
81
|
*/
|
|
59
82
|
|
|
60
|
-
export function DateRangePickerViewDesktop(
|
|
83
|
+
export function DateRangePickerViewDesktop(inProps) {
|
|
84
|
+
const props = useThemeProps({
|
|
85
|
+
props: inProps,
|
|
86
|
+
name: 'MuiDateRangePickerViewDesktop'
|
|
87
|
+
});
|
|
88
|
+
|
|
61
89
|
const {
|
|
62
90
|
calendars,
|
|
63
91
|
changeMonth,
|
|
@@ -73,7 +101,8 @@ export function DateRangePickerViewDesktop(props) {
|
|
|
73
101
|
minDate: minDateProp,
|
|
74
102
|
onSelectedDaysChange,
|
|
75
103
|
renderDay = (_, dateRangeProps) => /*#__PURE__*/_jsx(DateRangePickerDay, _extends({}, dateRangeProps)),
|
|
76
|
-
rightArrowButtonText: rightArrowButtonTextProp
|
|
104
|
+
rightArrowButtonText: rightArrowButtonTextProp,
|
|
105
|
+
className
|
|
77
106
|
} = props,
|
|
78
107
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
79
108
|
|
|
@@ -85,6 +114,7 @@ export function DateRangePickerViewDesktop(props) {
|
|
|
85
114
|
const leftArrowButtonText = leftArrowButtonTextProp != null ? leftArrowButtonTextProp : localeText.previousMonth;
|
|
86
115
|
const rightArrowButtonText = rightArrowButtonTextProp != null ? rightArrowButtonTextProp : localeText.nextMonth;
|
|
87
116
|
const utils = useUtils();
|
|
117
|
+
const classes = useUtilityClasses(props);
|
|
88
118
|
const defaultDates = useDefaultDates();
|
|
89
119
|
const minDate = minDateProp != null ? minDateProp : defaultDates.minDate;
|
|
90
120
|
const maxDate = maxDateProp != null ? maxDateProp : defaultDates.maxDate;
|
|
@@ -126,9 +156,11 @@ export function DateRangePickerViewDesktop(props) {
|
|
|
126
156
|
changeMonth(utils.getPreviousMonth(currentMonth));
|
|
127
157
|
}, [changeMonth, currentMonth, utils]);
|
|
128
158
|
return /*#__PURE__*/_jsx(DateRangePickerViewDesktopRoot, {
|
|
159
|
+
className: clsx(className, classes.root),
|
|
129
160
|
children: getCalendarsArray(calendars).map((_, index) => {
|
|
130
161
|
const monthOnIteration = utils.setMonth(currentMonth, utils.getMonth(currentMonth) + index);
|
|
131
162
|
return /*#__PURE__*/_jsxs(DateRangePickerViewDesktopContainer, {
|
|
163
|
+
className: classes.container,
|
|
132
164
|
children: [/*#__PURE__*/_jsx(DateRangePickerViewDesktopArrowSwitcher, {
|
|
133
165
|
onLeftClick: selectPreviousMonth,
|
|
134
166
|
onRightClick: selectNextMonth,
|
|
@@ -8,7 +8,7 @@ export interface DateRangePickerViewMobileSlotsComponentsProps extends PickersCa
|
|
|
8
8
|
}
|
|
9
9
|
export interface ExportedMobileDateRangeCalendarProps<TDate> extends Pick<ExportedDesktopDateRangeCalendarProps<TDate>, 'renderDay'> {
|
|
10
10
|
}
|
|
11
|
-
interface DesktopDateRangeCalendarProps<TDate> extends ExportedMobileDateRangeCalendarProps<TDate>, Omit<DayPickerProps<TDate>, 'selectedDays' | 'renderDay' | 'onFocusedDayChange'>, DayValidationProps<TDate>, ExportedCalendarHeaderProps<TDate> {
|
|
11
|
+
interface DesktopDateRangeCalendarProps<TDate> extends ExportedMobileDateRangeCalendarProps<TDate>, Omit<DayPickerProps<TDate>, 'selectedDays' | 'renderDay' | 'onFocusedDayChange' | 'classes'>, DayValidationProps<TDate>, ExportedCalendarHeaderProps<TDate> {
|
|
12
12
|
/**
|
|
13
13
|
* Overrideable components.
|
|
14
14
|
* @default {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["changeMonth", "components", "componentsProps", "parsedValue", "leftArrowButtonText", "maxDate", "minDate", "onSelectedDaysChange", "renderDay", "rightArrowButtonText", "disabled", "readOnly"];
|
|
3
|
+
const _excluded = ["changeMonth", "components", "componentsProps", "parsedValue", "leftArrowButtonText", "maxDate", "minDate", "onSelectedDaysChange", "renderDay", "rightArrowButtonText", "disabled", "readOnly", "classes"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { PickersCalendarHeader, useDefaultDates, useUtils, DayPicker } from '@mui/x-date-pickers/internals';
|
|
6
6
|
import { doNothing } from '../internal/utils/utils';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface DateRangePickerInputClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type DateRangePickerInputClassKey = keyof DateRangePickerInputClasses;
|
|
6
|
+
export declare function getDateRangePickerInputUtilityClass(slot: string): string;
|
|
7
|
+
export declare const dateRangePickerInputClasses: DateRangePickerInputClasses;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/material';
|
|
2
|
+
export function getDateRangePickerInputUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiDateRangePickerInput', slot);
|
|
4
|
+
}
|
|
5
|
+
export const dateRangePickerInputClasses = generateUtilityClasses('MuiDateRangePickerInput', ['root']);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DateRangePickerToolbarClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the container element. */
|
|
5
|
+
container: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type DateRangePickerToolbarClassKey = keyof DateRangePickerToolbarClasses;
|
|
8
|
+
export declare function getDateRangePickerToolbarUtilityClass(slot: string): string;
|
|
9
|
+
export declare const dateRangePickerToolbarClasses: DateRangePickerToolbarClasses;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/material';
|
|
2
|
+
export function getDateRangePickerToolbarUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiDateRangePickerToolbar', slot);
|
|
4
|
+
}
|
|
5
|
+
export const dateRangePickerToolbarClasses = generateUtilityClasses('MuiDateRangePickerToolbar', ['root', 'container']);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DateRangePickerViewDesktopClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the container element. */
|
|
5
|
+
container: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type DateRangePickerViewDesktopClassKey = keyof DateRangePickerViewDesktopClasses;
|
|
8
|
+
export declare function getDateRangePickerViewDesktopUtilityClass(slot: string): string;
|
|
9
|
+
export declare const dateRangePickerViewDesktopClasses: DateRangePickerViewDesktopClasses;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/material';
|
|
2
|
+
export function getDateRangePickerViewDesktopUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiDateRangePickerViewDesktop', slot);
|
|
4
|
+
}
|
|
5
|
+
export const dateRangePickerViewDesktopClasses = generateUtilityClasses('MuiDateRangePickerViewDesktop', ['root', 'container']);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export { DateRangePicker } from './DateRangePicker';
|
|
2
2
|
export type { DateRangePickerProps } from './DateRangePicker';
|
|
3
|
+
export { getDateRangePickerInputUtilityClass, dateRangePickerInputClasses, } from './dateRangePickerInputClasses';
|
|
4
|
+
export type { DateRangePickerInputClasses, DateRangePickerInputClassKey, } from './dateRangePickerInputClasses';
|
|
5
|
+
export { getDateRangePickerToolbarUtilityClass, dateRangePickerToolbarClasses, } from './dateRangePickerToolbarClasses';
|
|
6
|
+
export type { DateRangePickerToolbarClasses, DateRangePickerToolbarClassKey, } from './dateRangePickerToolbarClasses';
|
|
7
|
+
export { getDateRangePickerViewDesktopUtilityClass, dateRangePickerViewDesktopClasses, } from './dateRangePickerViewDesktopClasses';
|
|
8
|
+
export type { DateRangePickerViewDesktopClasses, DateRangePickerViewDesktopClassKey, } from './dateRangePickerViewDesktopClasses';
|
|
3
9
|
export type { DateRange } from '../internal/models';
|
package/DateRangePicker/index.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export { DateRangePicker } from './DateRangePicker';
|
|
1
|
+
export { DateRangePicker } from './DateRangePicker';
|
|
2
|
+
export { getDateRangePickerInputUtilityClass, dateRangePickerInputClasses } from './dateRangePickerInputClasses';
|
|
3
|
+
export { getDateRangePickerToolbarUtilityClass, dateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
|
|
4
|
+
export { getDateRangePickerViewDesktopUtilityClass, dateRangePickerViewDesktopClasses } from './dateRangePickerViewDesktopClasses';
|
|
@@ -8,7 +8,7 @@ export interface BaseDateRangePickerProps<TInputDate, TDate> extends Omit<BasePi
|
|
|
8
8
|
/**
|
|
9
9
|
* Text for end input label and toolbar placeholder.
|
|
10
10
|
* @default 'End'
|
|
11
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
11
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
|
|
12
12
|
*/
|
|
13
13
|
endText?: React.ReactNode;
|
|
14
14
|
/**
|
|
@@ -26,7 +26,7 @@ export interface BaseDateRangePickerProps<TInputDate, TDate> extends Omit<BasePi
|
|
|
26
26
|
/**
|
|
27
27
|
* Text for start input label and toolbar placeholder.
|
|
28
28
|
* @default 'Start'
|
|
29
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
29
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
|
|
30
30
|
*/
|
|
31
31
|
startText?: React.ReactNode;
|
|
32
32
|
}
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
8
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
8
|
+
import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
10
10
|
import { DAY_MARGIN, useUtils, areDayPropsEqual } from '@mui/x-date-pickers/internals';
|
|
11
11
|
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
|
|
@@ -47,7 +47,13 @@ const startBorderStyle = {
|
|
|
47
47
|
const DateRangePickerDayRoot = styled('div', {
|
|
48
48
|
name: 'MuiDateRangePickerDay',
|
|
49
49
|
slot: 'Root',
|
|
50
|
-
overridesResolver: (
|
|
50
|
+
overridesResolver: (_, styles) => [{
|
|
51
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayHighlight}`]: styles.rangeIntervalDayHighlight
|
|
52
|
+
}, {
|
|
53
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayHighlightStart}`]: styles.rangeIntervalDayHighlightStart
|
|
54
|
+
}, {
|
|
55
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayHighlightEnd}`]: styles.rangeIntervalDayHighlightEnd
|
|
56
|
+
}, styles.root]
|
|
51
57
|
})(({
|
|
52
58
|
theme,
|
|
53
59
|
ownerState
|
|
@@ -80,7 +86,14 @@ DateRangePickerDayRoot.propTypes = {
|
|
|
80
86
|
};
|
|
81
87
|
const DateRangePickerDayRangeIntervalPreview = styled('div', {
|
|
82
88
|
name: 'MuiDateRangePickerDay',
|
|
83
|
-
slot: 'RangeIntervalPreview'
|
|
89
|
+
slot: 'RangeIntervalPreview',
|
|
90
|
+
overridesResolver: (_, styles) => [{
|
|
91
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayPreview}`]: styles.rangeIntervalDayPreview
|
|
92
|
+
}, {
|
|
93
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayPreviewStart}`]: styles.rangeIntervalDayPreviewStart
|
|
94
|
+
}, {
|
|
95
|
+
[`&.${dateRangePickerDayClasses.rangeIntervalDayPreviewEnd}`]: styles.rangeIntervalDayPreviewEnd
|
|
96
|
+
}, styles.rangeIntervalPreview]
|
|
84
97
|
})(({
|
|
85
98
|
theme,
|
|
86
99
|
ownerState
|
|
@@ -106,7 +119,14 @@ DateRangePickerDayRangeIntervalPreview.propTypes = {
|
|
|
106
119
|
};
|
|
107
120
|
const DateRangePickerDayDay = styled(PickersDay, {
|
|
108
121
|
name: 'MuiDateRangePickerDay',
|
|
109
|
-
slot: 'Day'
|
|
122
|
+
slot: 'Day',
|
|
123
|
+
overridesResolver: (_, styles) => [{
|
|
124
|
+
[`&.${dateRangePickerDayClasses.dayInsideRangeInterval}`]: styles.dayInsideRangeInterval
|
|
125
|
+
}, {
|
|
126
|
+
[`&.${dateRangePickerDayClasses.dayOutsideRangeInterval}`]: styles.dayOutsideRangeInterval
|
|
127
|
+
}, {
|
|
128
|
+
[`&.${dateRangePickerDayClasses.notSelectedDate}`]: styles.notSelectedDate
|
|
129
|
+
}, styles.day]
|
|
110
130
|
})(({
|
|
111
131
|
theme,
|
|
112
132
|
ownerState
|
|
@@ -125,7 +145,12 @@ const DateRangePickerDayDay = styled(PickersDay, {
|
|
|
125
145
|
}, !ownerState.selected && ownerState.isHighlighting && {
|
|
126
146
|
color: theme.palette.getContrastText(alpha(theme.palette.primary.light, 0.6))
|
|
127
147
|
}));
|
|
128
|
-
const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePickerDay(
|
|
148
|
+
const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePickerDay(inProps, ref) {
|
|
149
|
+
const props = useThemeProps({
|
|
150
|
+
props: inProps,
|
|
151
|
+
name: 'MuiDateRangePickerDay'
|
|
152
|
+
});
|
|
153
|
+
|
|
129
154
|
const {
|
|
130
155
|
className,
|
|
131
156
|
day,
|