@mui/x-date-pickers 6.17.0 → 6.18.0
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 +61 -0
- package/DateCalendar/DateCalendar.d.ts +3 -2
- package/DateCalendar/DateCalendar.js +3 -2
- package/MonthCalendar/MonthCalendar.d.ts +9 -0
- package/MonthCalendar/MonthCalendar.js +9 -0
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -62
- package/PickersCalendarHeader/PickersCalendarHeader.js +17 -6
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +75 -0
- package/PickersCalendarHeader/PickersCalendarHeader.types.js +1 -0
- package/PickersCalendarHeader/index.d.ts +1 -1
- package/YearCalendar/YearCalendar.d.ts +9 -0
- package/YearCalendar/YearCalendar.js +9 -0
- package/index.js +1 -1
- package/legacy/DateCalendar/DateCalendar.js +3 -2
- package/legacy/MonthCalendar/MonthCalendar.js +9 -0
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +18 -6
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.types.js +1 -0
- package/legacy/YearCalendar/YearCalendar.js +9 -0
- package/legacy/index.js +1 -1
- package/modern/DateCalendar/DateCalendar.js +3 -2
- package/modern/MonthCalendar/MonthCalendar.js +9 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +16 -5
- package/modern/PickersCalendarHeader/PickersCalendarHeader.types.js +1 -0
- package/modern/YearCalendar/YearCalendar.js +9 -0
- package/modern/index.js +1 -1
- package/node/DateCalendar/DateCalendar.js +3 -2
- package/node/MonthCalendar/MonthCalendar.js +9 -0
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +17 -4
- package/node/PickersCalendarHeader/PickersCalendarHeader.types.js +5 -0
- package/node/YearCalendar/YearCalendar.js +9 -0
- package/node/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,67 @@
|
|
|
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
|
+
## 6.18.0
|
|
7
|
+
|
|
8
|
+
_Nov 3, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 The Charts package is now officially stable!
|
|
13
|
+
- 🥧 Pie charts are now animated.
|
|
14
|
+
- 📈 Line charts now support partial data, and can interpolate missing data.
|
|
15
|
+
|
|
16
|
+
<img width="380" alt="line charts with partial data" src="https://github.com/mui/mui-x/assets/45398769/385ecf77-19b2-4a03-8aef-5d547db1d9ad">
|
|
17
|
+
|
|
18
|
+
- ✨ Allow to ignore [diacritics](https://en.wikipedia.org/wiki/Diacritic) when filtering
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@6.18.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Allow to ignore [diacritics](https://en.wikipedia.org/wiki/Diacritic) when filtering (#10569) @cherniavskii
|
|
26
|
+
- [DataGrid] Fix a typo in `gridFilterApi` (#10786) @vu-dao-93
|
|
27
|
+
- [DataGrid] Fix `undefined` row id (#10670) @romgrk
|
|
28
|
+
- [DataGrid] Make column autosizing work with dynamic row height (#10693) @cherniavskii
|
|
29
|
+
- [l10n] Allow to customize sorting label per column (#10839) @JerryWu1234
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@6.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@6.18.0`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@6.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.0`.
|
|
38
|
+
|
|
39
|
+
### Date Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@6.18.0`
|
|
42
|
+
|
|
43
|
+
- [pickers] Add reference links to calendar components (#10644) @michelengelen
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-date-pickers-pro@6.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-date-pickers@6.18.0`.
|
|
48
|
+
|
|
49
|
+
### Charts / `@mui/x-charts@6.18.0`
|
|
50
|
+
|
|
51
|
+
- [charts] Add animation on pie chart (#10782) @alexfauquette
|
|
52
|
+
- [charts] Add reference links to shared/misc chart components (#10660) @michelengelen
|
|
53
|
+
- [charts] Allows to connect nulls (#10803) @alexfauquette
|
|
54
|
+
- [charts] Fix axis highlight in dark mode (#10820) @LukasTy
|
|
55
|
+
|
|
56
|
+
### Docs
|
|
57
|
+
|
|
58
|
+
- [docs] Add a data grid recipe for autosizing columns after fetching row-data (#10822) @michelengelen
|
|
59
|
+
- [docs] Add a data grid recipe showing how to remove cell outline on `focus` (#10843) @michelengelen
|
|
60
|
+
- [docs] Add demo about how to use charts margin (#10886) @alexfauquette
|
|
61
|
+
- [docs] Improve custom field input demos readability (#10559) @LukasTy
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [core] Generate `slot` API descriptions based on `slots` or `components` (#10879) @LukasTy
|
|
66
|
+
|
|
6
67
|
## 6.17.0
|
|
7
68
|
|
|
8
69
|
_Oct 27, 2023_
|
|
@@ -4,10 +4,11 @@ type DateCalendarComponent = (<TDate>(props: DateCalendarProps<TDate> & React.Re
|
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
7
|
* Demos:
|
|
9
8
|
*
|
|
10
|
-
* - [
|
|
9
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
10
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
11
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
11
12
|
*
|
|
12
13
|
* API:
|
|
13
14
|
*
|
|
@@ -72,10 +72,11 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
72
72
|
overridesResolver: (props, styles) => styles.viewTransitionContainer
|
|
73
73
|
})({});
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
76
75
|
* Demos:
|
|
77
76
|
*
|
|
78
|
-
* - [
|
|
77
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
78
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
79
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
79
80
|
*
|
|
80
81
|
* API:
|
|
81
82
|
*
|
|
@@ -5,5 +5,14 @@ export declare function useMonthCalendarDefaultizedProps<TDate>(props: MonthCale
|
|
|
5
5
|
type MonthCalendarComponent = (<TDate>(props: MonthCalendarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
6
6
|
propTypes?: any;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Demos:
|
|
10
|
+
*
|
|
11
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
12
|
+
*
|
|
13
|
+
* API:
|
|
14
|
+
*
|
|
15
|
+
* - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)
|
|
16
|
+
*/
|
|
8
17
|
export declare const MonthCalendar: MonthCalendarComponent;
|
|
9
18
|
export {};
|
|
@@ -53,6 +53,15 @@ const MonthCalendarRoot = styled('div', {
|
|
|
53
53
|
// avoid padding increasing width over defined
|
|
54
54
|
boxSizing: 'border-box'
|
|
55
55
|
});
|
|
56
|
+
/**
|
|
57
|
+
* Demos:
|
|
58
|
+
*
|
|
59
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
60
|
+
*
|
|
61
|
+
* API:
|
|
62
|
+
*
|
|
63
|
+
* - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)
|
|
64
|
+
*/
|
|
56
65
|
export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
|
|
57
66
|
const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
58
67
|
const {
|
|
@@ -1,66 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { SlotComponentProps } from '@mui/base/utils';
|
|
4
|
-
import IconButton from '@mui/material/IconButton';
|
|
5
|
-
import SvgIcon from '@mui/material/SvgIcon';
|
|
6
|
-
import { SlideDirection } from '../DateCalendar/PickersSlideTransition';
|
|
7
|
-
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
8
|
-
import { MonthValidationOptions } from '../internals/hooks/date-helpers-hooks';
|
|
9
|
-
import { DateView } from '../models';
|
|
10
|
-
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
11
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
12
|
-
export type ExportedPickersCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes' | 'slots' | 'slotProps'>;
|
|
13
|
-
export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitcherSlotsComponent {
|
|
14
|
-
/**
|
|
15
|
-
* Button displayed to switch between different calendar views.
|
|
16
|
-
* @default IconButton
|
|
17
|
-
*/
|
|
18
|
-
SwitchViewButton?: React.ElementType;
|
|
19
|
-
/**
|
|
20
|
-
* Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is 'year'.
|
|
21
|
-
* @default ArrowDropDown
|
|
22
|
-
*/
|
|
23
|
-
SwitchViewIcon?: React.ElementType;
|
|
24
|
-
}
|
|
25
|
-
export interface PickersCalendarHeaderComponentsPropsOverrides {
|
|
26
|
-
}
|
|
27
|
-
type PickersCalendarHeaderOwnerState<TDate> = PickersCalendarHeaderProps<TDate>;
|
|
28
|
-
export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends PickersArrowSwitcherSlotsComponentsProps {
|
|
29
|
-
switchViewButton?: SlotComponentProps<typeof IconButton, PickersCalendarHeaderComponentsPropsOverrides, PickersCalendarHeaderOwnerState<TDate>>;
|
|
30
|
-
switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
|
|
31
|
-
}
|
|
32
|
-
export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, MonthValidationOptions<TDate> {
|
|
33
|
-
/**
|
|
34
|
-
* Overridable component slots.
|
|
35
|
-
* @default {}
|
|
36
|
-
*/
|
|
37
|
-
slots?: UncapitalizeObjectKeys<PickersCalendarHeaderSlotsComponent>;
|
|
38
|
-
/**
|
|
39
|
-
* The props used for each component slot.
|
|
40
|
-
* @default {}
|
|
41
|
-
*/
|
|
42
|
-
slotProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
43
|
-
currentMonth: TDate;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
views: readonly DateView[];
|
|
46
|
-
onMonthChange: (date: TDate, slideDirection: SlideDirection) => void;
|
|
47
|
-
view: DateView;
|
|
48
|
-
reduceAnimations: boolean;
|
|
49
|
-
onViewChange?: (view: DateView) => void;
|
|
50
|
-
labelId?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Override or extend the styles applied to the component.
|
|
53
|
-
*/
|
|
54
|
-
classes?: Partial<PickersCalendarHeaderClasses>;
|
|
55
|
-
/**
|
|
56
|
-
* className applied to the root element.
|
|
57
|
-
*/
|
|
58
|
-
className?: string;
|
|
59
|
-
/**
|
|
60
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
61
|
-
*/
|
|
62
|
-
sx?: SxProps<Theme>;
|
|
63
|
-
}
|
|
2
|
+
import { PickersCalendarHeaderProps } from './PickersCalendarHeader.types';
|
|
64
3
|
type PickersCalendarHeaderComponent = (<TDate>(props: PickersCalendarHeaderProps<TDate> & React.RefAttributes<HTMLButtonElement>) => React.JSX.Element) & {
|
|
65
4
|
propTypes?: any;
|
|
66
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -16,8 +16,6 @@ import { ArrowDropDownIcon } from '../icons';
|
|
|
16
16
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
17
17
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
18
18
|
import { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
19
|
-
|
|
20
|
-
// We keep the interface to allow module augmentation
|
|
21
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
21
|
const useUtilityClasses = ownerState => {
|
|
@@ -106,7 +104,7 @@ const PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
106
104
|
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
107
105
|
*/
|
|
108
106
|
const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
109
|
-
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
107
|
+
var _ref, _slots$switchViewButt, _ref2, _slots$switchViewIcon;
|
|
110
108
|
const localeText = useLocaleText();
|
|
111
109
|
const utils = useUtils();
|
|
112
110
|
const props = useThemeProps({
|
|
@@ -116,6 +114,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
116
114
|
const {
|
|
117
115
|
slots,
|
|
118
116
|
slotProps,
|
|
117
|
+
components,
|
|
119
118
|
currentMonth: month,
|
|
120
119
|
disabled,
|
|
121
120
|
disableFuture,
|
|
@@ -134,7 +133,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
134
133
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
135
134
|
const ownerState = props;
|
|
136
135
|
const classes = useUtilityClasses(props);
|
|
137
|
-
const SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
136
|
+
const SwitchViewButton = (_ref = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : components == null ? void 0 : components.SwitchViewButton) != null ? _ref : PickersCalendarHeaderSwitchViewButton;
|
|
138
137
|
const switchViewButtonProps = useSlotProps({
|
|
139
138
|
elementType: SwitchViewButton,
|
|
140
139
|
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
@@ -145,7 +144,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
145
144
|
ownerState,
|
|
146
145
|
className: classes.switchViewButton
|
|
147
146
|
});
|
|
148
|
-
const SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
147
|
+
const SwitchViewIcon = (_ref2 = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : components == null ? void 0 : components.SwitchViewIcon) != null ? _ref2 : PickersCalendarHeaderSwitchViewIcon;
|
|
149
148
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
150
149
|
const _useSlotProps = useSlotProps({
|
|
151
150
|
elementType: SwitchViewIcon,
|
|
@@ -235,6 +234,18 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
235
234
|
* className applied to the root element.
|
|
236
235
|
*/
|
|
237
236
|
className: PropTypes.string,
|
|
237
|
+
/**
|
|
238
|
+
* Overridable components.
|
|
239
|
+
* @default {}
|
|
240
|
+
* @deprecated Please use `slots`.
|
|
241
|
+
*/
|
|
242
|
+
components: PropTypes.object,
|
|
243
|
+
/**
|
|
244
|
+
* The props used for each component slot.
|
|
245
|
+
* @default {}
|
|
246
|
+
* @deprecated Please use `slotProps`.
|
|
247
|
+
*/
|
|
248
|
+
componentsProps: PropTypes.object,
|
|
238
249
|
currentMonth: PropTypes.any.isRequired,
|
|
239
250
|
disabled: PropTypes.bool,
|
|
240
251
|
disableFuture: PropTypes.bool,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
|
+
import IconButton from '@mui/material/IconButton';
|
|
4
|
+
import SvgIcon from '@mui/material/SvgIcon';
|
|
5
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
6
|
+
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
7
|
+
import { MonthValidationOptions } from '../internals/hooks/date-helpers-hooks';
|
|
8
|
+
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
9
|
+
import { DateView } from '../models/views';
|
|
10
|
+
import { SlideDirection } from '../DateCalendar/PickersSlideTransition';
|
|
11
|
+
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
12
|
+
export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitcherSlotsComponent {
|
|
13
|
+
/**
|
|
14
|
+
* Button displayed to switch between different calendar views.
|
|
15
|
+
* @default IconButton
|
|
16
|
+
*/
|
|
17
|
+
SwitchViewButton?: React.ElementType;
|
|
18
|
+
/**
|
|
19
|
+
* Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is 'year'.
|
|
20
|
+
* @default ArrowDropDown
|
|
21
|
+
*/
|
|
22
|
+
SwitchViewIcon?: React.ElementType;
|
|
23
|
+
}
|
|
24
|
+
export interface PickersCalendarHeaderComponentsPropsOverrides {
|
|
25
|
+
}
|
|
26
|
+
export type PickersCalendarHeaderOwnerState<TDate> = PickersCalendarHeaderProps<TDate>;
|
|
27
|
+
export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends PickersArrowSwitcherSlotsComponentsProps {
|
|
28
|
+
switchViewButton?: SlotComponentProps<typeof IconButton, PickersCalendarHeaderComponentsPropsOverrides, PickersCalendarHeaderOwnerState<TDate>>;
|
|
29
|
+
switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
|
|
30
|
+
}
|
|
31
|
+
export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, MonthValidationOptions<TDate> {
|
|
32
|
+
/**
|
|
33
|
+
* Overridable components.
|
|
34
|
+
* @default {}
|
|
35
|
+
* @deprecated Please use `slots`.
|
|
36
|
+
*/
|
|
37
|
+
components?: PickersCalendarHeaderSlotsComponent;
|
|
38
|
+
/**
|
|
39
|
+
* The props used for each component slot.
|
|
40
|
+
* @default {}
|
|
41
|
+
* @deprecated Please use `slotProps`.
|
|
42
|
+
*/
|
|
43
|
+
componentsProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
44
|
+
/**
|
|
45
|
+
* Overridable component slots.
|
|
46
|
+
* @default {}
|
|
47
|
+
*/
|
|
48
|
+
slots?: UncapitalizeObjectKeys<PickersCalendarHeaderSlotsComponent>;
|
|
49
|
+
/**
|
|
50
|
+
* The props used for each component slot.
|
|
51
|
+
* @default {}
|
|
52
|
+
*/
|
|
53
|
+
slotProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
54
|
+
currentMonth: TDate;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
views: readonly DateView[];
|
|
57
|
+
onMonthChange: (date: TDate, slideDirection: SlideDirection) => void;
|
|
58
|
+
view: DateView;
|
|
59
|
+
reduceAnimations: boolean;
|
|
60
|
+
onViewChange?: (view: DateView) => void;
|
|
61
|
+
labelId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Override or extend the styles applied to the component.
|
|
64
|
+
*/
|
|
65
|
+
classes?: Partial<PickersCalendarHeaderClasses>;
|
|
66
|
+
/**
|
|
67
|
+
* className applied to the root element.
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
72
|
+
*/
|
|
73
|
+
sx?: SxProps<Theme>;
|
|
74
|
+
}
|
|
75
|
+
export type ExportedPickersCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes' | 'slots' | 'slotProps'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
2
2
|
export type { PickersCalendarHeaderClassKey, PickersCalendarHeaderClasses, } from './pickersCalendarHeaderClasses';
|
|
3
3
|
export { PickersCalendarHeader } from './PickersCalendarHeader';
|
|
4
|
-
export type { PickersCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps, ExportedPickersCalendarHeaderProps, } from './PickersCalendarHeader';
|
|
4
|
+
export type { PickersCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps, ExportedPickersCalendarHeaderProps, } from './PickersCalendarHeader.types';
|
|
@@ -3,5 +3,14 @@ import { YearCalendarProps } from './YearCalendar.types';
|
|
|
3
3
|
type YearCalendarComponent = (<TDate>(props: YearCalendarProps<TDate>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
10
|
+
*
|
|
11
|
+
* API:
|
|
12
|
+
*
|
|
13
|
+
* - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)
|
|
14
|
+
*/
|
|
6
15
|
export declare const YearCalendar: YearCalendarComponent;
|
|
7
16
|
export {};
|
|
@@ -59,6 +59,15 @@ const YearCalendarRoot = styled('div', {
|
|
|
59
59
|
boxSizing: 'border-box',
|
|
60
60
|
position: 'relative'
|
|
61
61
|
});
|
|
62
|
+
/**
|
|
63
|
+
* Demos:
|
|
64
|
+
*
|
|
65
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
66
|
+
*
|
|
67
|
+
* API:
|
|
68
|
+
*
|
|
69
|
+
* - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)
|
|
70
|
+
*/
|
|
62
71
|
export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(inProps, ref) {
|
|
63
72
|
const props = useYearCalendarDefaultizedProps(inProps, 'MuiYearCalendar');
|
|
64
73
|
const {
|
package/index.js
CHANGED
|
@@ -76,10 +76,11 @@ var DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
76
76
|
}
|
|
77
77
|
})({});
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
80
79
|
* Demos:
|
|
81
80
|
*
|
|
82
|
-
* - [
|
|
81
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
82
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
83
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
83
84
|
*
|
|
84
85
|
* API:
|
|
85
86
|
*
|
|
@@ -54,6 +54,15 @@ var MonthCalendarRoot = styled('div', {
|
|
|
54
54
|
// avoid padding increasing width over defined
|
|
55
55
|
boxSizing: 'border-box'
|
|
56
56
|
});
|
|
57
|
+
/**
|
|
58
|
+
* Demos:
|
|
59
|
+
*
|
|
60
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
61
|
+
*
|
|
62
|
+
* API:
|
|
63
|
+
*
|
|
64
|
+
* - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)
|
|
65
|
+
*/
|
|
57
66
|
export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
|
|
58
67
|
var props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
59
68
|
var className = props.className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
4
|
+
var _excluded = ["slots", "slotProps", "components", "componentsProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
5
5
|
_excluded2 = ["ownerState"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -17,8 +17,6 @@ import { ArrowDropDownIcon } from '../icons';
|
|
|
17
17
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
18
18
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
19
19
|
import { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
20
|
-
|
|
21
|
-
// We keep the interface to allow module augmentation
|
|
22
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
22
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
@@ -116,7 +114,7 @@ var PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
116
114
|
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
117
115
|
*/
|
|
118
116
|
var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
119
|
-
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
117
|
+
var _ref5, _slots$switchViewButt, _ref6, _slots$switchViewIcon;
|
|
120
118
|
var localeText = useLocaleText();
|
|
121
119
|
var utils = useUtils();
|
|
122
120
|
var props = useThemeProps({
|
|
@@ -125,6 +123,8 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
125
123
|
});
|
|
126
124
|
var slots = props.slots,
|
|
127
125
|
slotProps = props.slotProps,
|
|
126
|
+
components = props.components,
|
|
127
|
+
componentsProps = props.componentsProps,
|
|
128
128
|
month = props.currentMonth,
|
|
129
129
|
disabled = props.disabled,
|
|
130
130
|
disableFuture = props.disableFuture,
|
|
@@ -142,7 +142,7 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
142
142
|
other = _objectWithoutProperties(props, _excluded);
|
|
143
143
|
var ownerState = props;
|
|
144
144
|
var classes = useUtilityClasses(props);
|
|
145
|
-
var SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
145
|
+
var SwitchViewButton = (_ref5 = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : components == null ? void 0 : components.SwitchViewButton) != null ? _ref5 : PickersCalendarHeaderSwitchViewButton;
|
|
146
146
|
var switchViewButtonProps = useSlotProps({
|
|
147
147
|
elementType: SwitchViewButton,
|
|
148
148
|
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
@@ -153,7 +153,7 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
153
153
|
ownerState: ownerState,
|
|
154
154
|
className: classes.switchViewButton
|
|
155
155
|
});
|
|
156
|
-
var SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
156
|
+
var SwitchViewIcon = (_ref6 = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : components == null ? void 0 : components.SwitchViewIcon) != null ? _ref6 : PickersCalendarHeaderSwitchViewIcon;
|
|
157
157
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
158
158
|
var _useSlotProps = useSlotProps({
|
|
159
159
|
elementType: SwitchViewIcon,
|
|
@@ -250,6 +250,18 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
250
250
|
* className applied to the root element.
|
|
251
251
|
*/
|
|
252
252
|
className: PropTypes.string,
|
|
253
|
+
/**
|
|
254
|
+
* Overridable components.
|
|
255
|
+
* @default {}
|
|
256
|
+
* @deprecated Please use `slots`.
|
|
257
|
+
*/
|
|
258
|
+
components: PropTypes.object,
|
|
259
|
+
/**
|
|
260
|
+
* The props used for each component slot.
|
|
261
|
+
* @default {}
|
|
262
|
+
* @deprecated Please use `slotProps`.
|
|
263
|
+
*/
|
|
264
|
+
componentsProps: PropTypes.object,
|
|
253
265
|
currentMonth: PropTypes.any.isRequired,
|
|
254
266
|
disabled: PropTypes.bool,
|
|
255
267
|
disableFuture: PropTypes.bool,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -60,6 +60,15 @@ var YearCalendarRoot = styled('div', {
|
|
|
60
60
|
boxSizing: 'border-box',
|
|
61
61
|
position: 'relative'
|
|
62
62
|
});
|
|
63
|
+
/**
|
|
64
|
+
* Demos:
|
|
65
|
+
*
|
|
66
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
67
|
+
*
|
|
68
|
+
* API:
|
|
69
|
+
*
|
|
70
|
+
* - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)
|
|
71
|
+
*/
|
|
63
72
|
export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(inProps, ref) {
|
|
64
73
|
var props = useYearCalendarDefaultizedProps(inProps, 'MuiYearCalendar');
|
|
65
74
|
var autoFocus = props.autoFocus,
|
package/legacy/index.js
CHANGED
|
@@ -71,10 +71,11 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
71
71
|
overridesResolver: (props, styles) => styles.viewTransitionContainer
|
|
72
72
|
})({});
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
74
|
* Demos:
|
|
76
75
|
*
|
|
77
|
-
* - [
|
|
76
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
77
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
78
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
78
79
|
*
|
|
79
80
|
* API:
|
|
80
81
|
*
|
|
@@ -53,6 +53,15 @@ const MonthCalendarRoot = styled('div', {
|
|
|
53
53
|
// avoid padding increasing width over defined
|
|
54
54
|
boxSizing: 'border-box'
|
|
55
55
|
});
|
|
56
|
+
/**
|
|
57
|
+
* Demos:
|
|
58
|
+
*
|
|
59
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
60
|
+
*
|
|
61
|
+
* API:
|
|
62
|
+
*
|
|
63
|
+
* - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)
|
|
64
|
+
*/
|
|
56
65
|
export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
|
|
57
66
|
const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
58
67
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -16,8 +16,6 @@ import { ArrowDropDownIcon } from '../icons';
|
|
|
16
16
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
17
17
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
18
18
|
import { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
19
|
-
|
|
20
|
-
// We keep the interface to allow module augmentation
|
|
21
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
21
|
const useUtilityClasses = ownerState => {
|
|
@@ -115,6 +113,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
115
113
|
const {
|
|
116
114
|
slots,
|
|
117
115
|
slotProps,
|
|
116
|
+
components,
|
|
118
117
|
currentMonth: month,
|
|
119
118
|
disabled,
|
|
120
119
|
disableFuture,
|
|
@@ -133,7 +132,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
133
132
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
134
133
|
const ownerState = props;
|
|
135
134
|
const classes = useUtilityClasses(props);
|
|
136
|
-
const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
135
|
+
const SwitchViewButton = slots?.switchViewButton ?? components?.SwitchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
137
136
|
const switchViewButtonProps = useSlotProps({
|
|
138
137
|
elementType: SwitchViewButton,
|
|
139
138
|
externalSlotProps: slotProps?.switchViewButton,
|
|
@@ -144,7 +143,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
144
143
|
ownerState,
|
|
145
144
|
className: classes.switchViewButton
|
|
146
145
|
});
|
|
147
|
-
const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
146
|
+
const SwitchViewIcon = slots?.switchViewIcon ?? components?.SwitchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
148
147
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
149
148
|
const _useSlotProps = useSlotProps({
|
|
150
149
|
elementType: SwitchViewIcon,
|
|
@@ -234,6 +233,18 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
234
233
|
* className applied to the root element.
|
|
235
234
|
*/
|
|
236
235
|
className: PropTypes.string,
|
|
236
|
+
/**
|
|
237
|
+
* Overridable components.
|
|
238
|
+
* @default {}
|
|
239
|
+
* @deprecated Please use `slots`.
|
|
240
|
+
*/
|
|
241
|
+
components: PropTypes.object,
|
|
242
|
+
/**
|
|
243
|
+
* The props used for each component slot.
|
|
244
|
+
* @default {}
|
|
245
|
+
* @deprecated Please use `slotProps`.
|
|
246
|
+
*/
|
|
247
|
+
componentsProps: PropTypes.object,
|
|
237
248
|
currentMonth: PropTypes.any.isRequired,
|
|
238
249
|
disabled: PropTypes.bool,
|
|
239
250
|
disableFuture: PropTypes.bool,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -58,6 +58,15 @@ const YearCalendarRoot = styled('div', {
|
|
|
58
58
|
boxSizing: 'border-box',
|
|
59
59
|
position: 'relative'
|
|
60
60
|
});
|
|
61
|
+
/**
|
|
62
|
+
* Demos:
|
|
63
|
+
*
|
|
64
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
65
|
+
*
|
|
66
|
+
* API:
|
|
67
|
+
*
|
|
68
|
+
* - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)
|
|
69
|
+
*/
|
|
61
70
|
export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(inProps, ref) {
|
|
62
71
|
const props = useYearCalendarDefaultizedProps(inProps, 'MuiYearCalendar');
|
|
63
72
|
const {
|
package/modern/index.js
CHANGED
|
@@ -79,10 +79,11 @@ const DateCalendarViewTransitionContainer = (0, _styles.styled)(_PickersFadeTran
|
|
|
79
79
|
overridesResolver: (props, styles) => styles.viewTransitionContainer
|
|
80
80
|
})({});
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
82
|
* Demos:
|
|
84
83
|
*
|
|
85
|
-
* - [
|
|
84
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
85
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
86
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
86
87
|
*
|
|
87
88
|
* API:
|
|
88
89
|
*
|
|
@@ -63,6 +63,15 @@ const MonthCalendarRoot = (0, _styles.styled)('div', {
|
|
|
63
63
|
// avoid padding increasing width over defined
|
|
64
64
|
boxSizing: 'border-box'
|
|
65
65
|
});
|
|
66
|
+
/**
|
|
67
|
+
* Demos:
|
|
68
|
+
*
|
|
69
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
70
|
+
*
|
|
71
|
+
* API:
|
|
72
|
+
*
|
|
73
|
+
* - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)
|
|
74
|
+
*/
|
|
66
75
|
const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
|
|
67
76
|
const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
68
77
|
const {
|
|
@@ -22,8 +22,8 @@ var _PickersArrowSwitcher = require("../internals/components/PickersArrowSwitche
|
|
|
22
22
|
var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
23
23
|
var _pickersCalendarHeaderClasses = require("./pickersCalendarHeaderClasses");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
const _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
26
|
-
_excluded2 = ["ownerState"];
|
|
25
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
26
|
+
_excluded2 = ["ownerState"];
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
29
|
const useUtilityClasses = ownerState => {
|
|
@@ -121,6 +121,7 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
121
121
|
const {
|
|
122
122
|
slots,
|
|
123
123
|
slotProps,
|
|
124
|
+
components,
|
|
124
125
|
currentMonth: month,
|
|
125
126
|
disabled,
|
|
126
127
|
disableFuture,
|
|
@@ -139,7 +140,7 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
139
140
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
140
141
|
const ownerState = props;
|
|
141
142
|
const classes = useUtilityClasses(props);
|
|
142
|
-
const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
143
|
+
const SwitchViewButton = slots?.switchViewButton ?? components?.SwitchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
143
144
|
const switchViewButtonProps = (0, _utils.useSlotProps)({
|
|
144
145
|
elementType: SwitchViewButton,
|
|
145
146
|
externalSlotProps: slotProps?.switchViewButton,
|
|
@@ -150,7 +151,7 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
150
151
|
ownerState,
|
|
151
152
|
className: classes.switchViewButton
|
|
152
153
|
});
|
|
153
|
-
const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
154
|
+
const SwitchViewIcon = slots?.switchViewIcon ?? components?.SwitchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
154
155
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
155
156
|
const _useSlotProps = (0, _utils.useSlotProps)({
|
|
156
157
|
elementType: SwitchViewIcon,
|
|
@@ -240,6 +241,18 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
240
241
|
* className applied to the root element.
|
|
241
242
|
*/
|
|
242
243
|
className: _propTypes.default.string,
|
|
244
|
+
/**
|
|
245
|
+
* Overridable components.
|
|
246
|
+
* @default {}
|
|
247
|
+
* @deprecated Please use `slots`.
|
|
248
|
+
*/
|
|
249
|
+
components: _propTypes.default.object,
|
|
250
|
+
/**
|
|
251
|
+
* The props used for each component slot.
|
|
252
|
+
* @default {}
|
|
253
|
+
* @deprecated Please use `slotProps`.
|
|
254
|
+
*/
|
|
255
|
+
componentsProps: _propTypes.default.object,
|
|
243
256
|
currentMonth: _propTypes.default.any.isRequired,
|
|
244
257
|
disabled: _propTypes.default.bool,
|
|
245
258
|
disableFuture: _propTypes.default.bool,
|
|
@@ -67,6 +67,15 @@ const YearCalendarRoot = (0, _styles.styled)('div', {
|
|
|
67
67
|
boxSizing: 'border-box',
|
|
68
68
|
position: 'relative'
|
|
69
69
|
});
|
|
70
|
+
/**
|
|
71
|
+
* Demos:
|
|
72
|
+
*
|
|
73
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
74
|
+
*
|
|
75
|
+
* API:
|
|
76
|
+
*
|
|
77
|
+
* - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)
|
|
78
|
+
*/
|
|
70
79
|
const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(inProps, ref) {
|
|
71
80
|
const props = useYearCalendarDefaultizedProps(inProps, 'MuiYearCalendar');
|
|
72
81
|
const {
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
4
|
"description": "The community edition of the date picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.23.2",
|
|
37
|
-
"@mui/base": "^5.0.0-beta.
|
|
38
|
-
"@mui/utils": "^5.14.
|
|
37
|
+
"@mui/base": "^5.0.0-beta.22",
|
|
38
|
+
"@mui/utils": "^5.14.16",
|
|
39
39
|
"@types/react-transition-group": "^4.4.8",
|
|
40
40
|
"clsx": "^2.0.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|