@mui/x-date-pickers 6.19.4 → 6.19.6
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 +112 -10
- package/DateCalendar/DateCalendar.js +3 -0
- package/DateCalendar/DateCalendar.types.d.ts +3 -0
- package/DateCalendar/DayCalendar.d.ts +3 -0
- package/DateCalendar/PickersFadeTransitionGroup.d.ts +3 -0
- package/DateCalendar/PickersSlideTransition.d.ts +3 -0
- package/DateCalendar/useCalendarState.js +2 -3
- package/DatePicker/DatePickerToolbar.d.ts +5 -4
- package/DatePicker/DatePickerToolbar.js +11 -3
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +2 -2
- package/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/PickersLayout/PickersLayout.js +6 -0
- package/PickersLayout/PickersLayout.types.d.ts +6 -0
- package/TimePicker/TimePickerToolbar.d.ts +5 -4
- package/TimePicker/TimePickerToolbar.js +11 -3
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +3 -0
- package/internals/components/PickersPopper.d.ts +3 -0
- package/internals/models/props/tabs.d.ts +6 -0
- package/internals/models/props/toolbar.d.ts +3 -0
- package/legacy/DateCalendar/DateCalendar.js +3 -0
- package/legacy/DateCalendar/useCalendarState.js +2 -3
- package/legacy/DatePicker/DatePickerToolbar.js +10 -2
- package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/legacy/PickersLayout/PickersLayout.js +6 -0
- package/legacy/TimePicker/TimePickerToolbar.js +10 -2
- package/legacy/index.js +1 -1
- package/legacy/locales/koKR.js +1 -2
- package/legacy/locales/zhCN.js +2 -3
- package/locales/koKR.js +1 -2
- package/locales/zhCN.js +2 -3
- package/modern/DateCalendar/DateCalendar.js +3 -0
- package/modern/DateCalendar/useCalendarState.js +2 -3
- package/modern/DatePicker/DatePickerToolbar.js +11 -3
- package/modern/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/modern/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/modern/PickersLayout/PickersLayout.js +6 -0
- package/modern/TimePicker/TimePickerToolbar.js +11 -3
- package/modern/index.js +1 -1
- package/modern/locales/koKR.js +1 -2
- package/modern/locales/zhCN.js +2 -3
- package/node/DateCalendar/DateCalendar.js +3 -0
- package/node/DateCalendar/useCalendarState.js +1 -2
- package/node/DatePicker/DatePickerToolbar.js +11 -3
- package/node/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/node/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/node/PickersLayout/PickersLayout.js +6 -0
- package/node/TimePicker/TimePickerToolbar.js +11 -3
- package/node/index.js +1 -1
- package/node/locales/koKR.js +1 -2
- package/node/locales/zhCN.js +2 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,109 @@
|
|
|
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
|
+
## 6.19.6
|
|
7
|
+
|
|
8
|
+
_Mar 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@6.19.6`
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix error when existing rows are passed to `replaceRows` (@martijn-basesoft)
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@6.19.6`.
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-premium@6.19.6` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.6`, plus:
|
|
29
|
+
|
|
30
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12255) @MBilalShafi
|
|
31
|
+
|
|
32
|
+
### Date Pickers
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers@6.19.6`
|
|
35
|
+
|
|
36
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12250) @headironc
|
|
37
|
+
- [l10n] Improve Korean (ko-KR) locale (#12186) @Luzi
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-date-pickers@6.19.6`.
|
|
42
|
+
|
|
43
|
+
### Docs
|
|
44
|
+
|
|
45
|
+
- [docs] Update lazy loading demo to show skeleton rows during initial rows fetch (#12062) @cherniavskii
|
|
46
|
+
|
|
47
|
+
## 6.19.5
|
|
48
|
+
|
|
49
|
+
_Feb 23, 2024_
|
|
50
|
+
|
|
51
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
52
|
+
|
|
53
|
+
- 🐞 Bugfixes
|
|
54
|
+
- 📚 Documentation improvements
|
|
55
|
+
|
|
56
|
+
### Data Grid
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-data-grid@6.19.5`
|
|
59
|
+
|
|
60
|
+
- [DataGrid] Fix styling grid filter input single select (#12079) @FreakDroid
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-data-grid-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-data-grid@6.19.5`.
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-data-grid-premium@6.19.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
67
|
+
|
|
68
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.5`.
|
|
69
|
+
|
|
70
|
+
### Date Pickers
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-date-pickers@6.19.5`
|
|
73
|
+
|
|
74
|
+
- [pickers] Fix `referenceDate` day calendar focus (#12136) @LukasTy
|
|
75
|
+
- [pickers] Fix styling props propagation to `DateTimePickerTabs` (#12131) @LukasTy
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-date-pickers-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
78
|
+
|
|
79
|
+
Same changes as in `@mui/x-date-pickers@6.19.5`.
|
|
80
|
+
|
|
81
|
+
### Charts / `@mui/x-charts@6.19.5`
|
|
82
|
+
|
|
83
|
+
- [charts] Allow to skip animation on sparkline bar (#12160) @alexfauquette
|
|
84
|
+
|
|
85
|
+
### Docs
|
|
86
|
+
|
|
87
|
+
- [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
|
|
88
|
+
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
89
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
90
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
91
|
+
- [docs] Fix 404 links to translation source @oliviertassinari
|
|
92
|
+
- [docs] Fix dead link to translations @oliviertassinari
|
|
93
|
+
- [docs] Fix the Treemap illustration (#12189) @danilo-leal
|
|
94
|
+
- [docs] Fix typo for `AdapterDateFnsV3` (#12037) @flaviendelangle
|
|
95
|
+
- [docs] Improve performance on Charts entry point @oliviertassinari
|
|
96
|
+
- [docs] Move Heatmap to pro (#12170) @alexfauquette
|
|
97
|
+
- [docs] Remove Charts installation next tag call-out (#12133) @LukasTy
|
|
98
|
+
- [docs] Removed `focused` prop from demo (#12126) @michelengelen
|
|
99
|
+
- [docs] Add missing Heatmap pro icon @oliviertassinari
|
|
100
|
+
- [docs] Add more illustrations to the Overview page (#12041) @danilo-leal
|
|
101
|
+
- [docs] Avoid use of shorthand (#12009) @oliviertassinari
|
|
102
|
+
|
|
103
|
+
### Core
|
|
104
|
+
|
|
105
|
+
- [core] Fix CI @oliviertassinari
|
|
106
|
+
- [core] Fix docs link check (#12137) @LukasTy
|
|
107
|
+
|
|
108
|
+
## 6.19.4
|
|
7
109
|
|
|
8
110
|
_Feb 9, 2024_
|
|
9
111
|
|
|
@@ -15,7 +117,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
15
117
|
|
|
16
118
|
### Data Grid
|
|
17
119
|
|
|
18
|
-
#### `@mui/x-data-grid@
|
|
120
|
+
#### `@mui/x-data-grid@6.19.4`
|
|
19
121
|
|
|
20
122
|
- [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
|
|
21
123
|
- [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
|
|
@@ -23,28 +125,28 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
23
125
|
- [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
|
|
24
126
|
- [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
|
|
25
127
|
|
|
26
|
-
#### `@mui/x-data-grid-pro@
|
|
128
|
+
#### `@mui/x-data-grid-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
129
|
|
|
28
|
-
Same changes as in `@mui/x-data-grid@
|
|
130
|
+
Same changes as in `@mui/x-data-grid@6.19.4`.
|
|
29
131
|
|
|
30
|
-
#### `@mui/x-data-grid-premium@
|
|
132
|
+
#### `@mui/x-data-grid-premium@6.19.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
133
|
|
|
32
|
-
Same changes as in `@mui/x-data-grid-pro@
|
|
134
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.4`, plus:
|
|
33
135
|
|
|
34
136
|
- [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
|
|
35
137
|
- [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
|
|
36
138
|
|
|
37
139
|
### Date Pickers
|
|
38
140
|
|
|
39
|
-
#### `@mui/x-date-pickers@
|
|
141
|
+
#### `@mui/x-date-pickers@6.19.4`
|
|
40
142
|
|
|
41
143
|
- [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
|
|
42
144
|
|
|
43
|
-
#### `@mui/x-date-pickers-pro@
|
|
145
|
+
#### `@mui/x-date-pickers-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
44
146
|
|
|
45
|
-
Same changes as in `@mui/x-date-pickers@
|
|
147
|
+
Same changes as in `@mui/x-date-pickers@6.19.4`.
|
|
46
148
|
|
|
47
|
-
### Charts / `@mui/x-charts@
|
|
149
|
+
### Charts / `@mui/x-charts@6.19.4`
|
|
48
150
|
|
|
49
151
|
- [charts] Add `reverse` property to axes (#11959) @alexfauquette
|
|
50
152
|
- [charts] Allow series ids to be numbers (#11960) @alexfauquette
|
|
@@ -362,6 +362,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
362
362
|
* - the `input` element if there is a field rendered.
|
|
363
363
|
*/
|
|
364
364
|
autoFocus: PropTypes.bool,
|
|
365
|
+
/**
|
|
366
|
+
* Override or extend the styles applied to the component.
|
|
367
|
+
*/
|
|
365
368
|
classes: PropTypes.object,
|
|
366
369
|
className: PropTypes.string,
|
|
367
370
|
/**
|
|
@@ -80,6 +80,9 @@ export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDat
|
|
|
80
80
|
*/
|
|
81
81
|
referenceDate?: TDate;
|
|
82
82
|
className?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Override or extend the styles applied to the component.
|
|
85
|
+
*/
|
|
83
86
|
classes?: Partial<DateCalendarClasses>;
|
|
84
87
|
/**
|
|
85
88
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -72,6 +72,9 @@ export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>
|
|
|
72
72
|
hasFocus?: boolean;
|
|
73
73
|
onFocusedViewChange?: (newHasFocus: boolean) => void;
|
|
74
74
|
gridLabelId?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Override or extend the styles applied to the component.
|
|
77
|
+
*/
|
|
75
78
|
classes?: Partial<DayCalendarClasses>;
|
|
76
79
|
}
|
|
77
80
|
/**
|
|
@@ -5,6 +5,9 @@ export interface PickersFadeTransitionGroupProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
reduceAnimations: boolean;
|
|
7
7
|
transKey: React.Key;
|
|
8
|
+
/**
|
|
9
|
+
* Override or extend the styles applied to the component.
|
|
10
|
+
*/
|
|
8
11
|
classes?: Partial<PickersFadeTransitionGroupClasses>;
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
@@ -3,6 +3,9 @@ import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
|
3
3
|
import { PickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
4
4
|
export type SlideDirection = 'right' | 'left';
|
|
5
5
|
export interface ExportedSlideTransitionProps {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
6
9
|
classes?: Partial<PickersSlideTransitionClasses>;
|
|
7
10
|
}
|
|
8
11
|
export interface SlideTransitionProps extends Omit<CSSTransitionProps, 'timeout'>, ExportedSlideTransitionProps {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useIsDateDisabled } from './useIsDateDisabled';
|
|
5
|
-
import { useUtils
|
|
5
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
|
|
8
8
|
export const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {
|
|
@@ -49,7 +49,6 @@ export const useCalendarState = params => {
|
|
|
49
49
|
shouldDisableDate,
|
|
50
50
|
timezone
|
|
51
51
|
} = params;
|
|
52
|
-
const now = useNow(timezone);
|
|
53
52
|
const utils = useUtils();
|
|
54
53
|
const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
|
|
55
54
|
const referenceDate = React.useMemo(() => {
|
|
@@ -72,7 +71,7 @@ export const useCalendarState = params => {
|
|
|
72
71
|
);
|
|
73
72
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
74
73
|
isMonthSwitchingAnimating: false,
|
|
75
|
-
focusedDay:
|
|
74
|
+
focusedDay: referenceDate,
|
|
76
75
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
77
76
|
slideDirection: 'left'
|
|
78
77
|
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
4
3
|
import { DateView } from '../models';
|
|
5
4
|
import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
6
|
-
export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView
|
|
7
|
-
classes?: Partial<DatePickerToolbarClasses>;
|
|
8
|
-
sx?: SxProps<Theme>;
|
|
5
|
+
export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView>, ExportedDatePickerToolbarProps {
|
|
9
6
|
}
|
|
10
7
|
export interface ExportedDatePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
|
+
/**
|
|
9
|
+
* Override or extend the styles applied to the component.
|
|
10
|
+
*/
|
|
11
|
+
classes?: Partial<DatePickerToolbarClasses>;
|
|
11
12
|
}
|
|
12
13
|
type DatePickerToolbarComponent = (<TDate>(props: DatePickerToolbarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
13
14
|
propTypes?: any;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
|
|
3
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Typography from '@mui/material/Typography';
|
|
7
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
@@ -55,7 +56,8 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
55
56
|
isLandscape,
|
|
56
57
|
toolbarFormat,
|
|
57
58
|
toolbarPlaceholder = '––',
|
|
58
|
-
views
|
|
59
|
+
views,
|
|
60
|
+
className
|
|
59
61
|
} = props,
|
|
60
62
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
61
63
|
const utils = useUtils();
|
|
@@ -76,7 +78,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
76
78
|
ref: ref,
|
|
77
79
|
toolbarTitle: localeText.datePickerToolbarTitle,
|
|
78
80
|
isLandscape: isLandscape,
|
|
79
|
-
className: classes.root
|
|
81
|
+
className: clsx(classes.root, className)
|
|
80
82
|
}, other, {
|
|
81
83
|
children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
|
|
82
84
|
variant: "h4",
|
|
@@ -92,6 +94,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
92
94
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
93
95
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
94
96
|
// ----------------------------------------------------------------------
|
|
97
|
+
/**
|
|
98
|
+
* Override or extend the styles applied to the component.
|
|
99
|
+
*/
|
|
95
100
|
classes: PropTypes.object,
|
|
96
101
|
/**
|
|
97
102
|
* className applied to the root component.
|
|
@@ -112,6 +117,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
112
117
|
*/
|
|
113
118
|
onViewChange: PropTypes.func.isRequired,
|
|
114
119
|
readOnly: PropTypes.bool,
|
|
120
|
+
/**
|
|
121
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
122
|
+
*/
|
|
115
123
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
116
124
|
titleId: PropTypes.string,
|
|
117
125
|
/**
|
|
@@ -18,13 +18,13 @@ export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
|
18
18
|
* @default Time
|
|
19
19
|
*/
|
|
20
20
|
timeIcon?: React.ReactNode;
|
|
21
|
-
}
|
|
22
|
-
export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps, BaseTabsProps<DateOrTimeViewWithMeridiem> {
|
|
23
21
|
/**
|
|
24
22
|
* Override or extend the styles applied to the component.
|
|
25
23
|
*/
|
|
26
24
|
classes?: Partial<DateTimePickerTabsClasses>;
|
|
27
25
|
}
|
|
26
|
+
export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps, BaseTabsProps<DateOrTimeViewWithMeridiem> {
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Demos:
|
|
30
30
|
*
|
|
@@ -70,7 +70,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
70
70
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
71
71
|
view,
|
|
72
72
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
73
|
-
className
|
|
73
|
+
className,
|
|
74
|
+
sx
|
|
74
75
|
} = props;
|
|
75
76
|
const localeText = useLocaleText();
|
|
76
77
|
const classes = useUtilityClasses(props);
|
|
@@ -86,6 +87,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
86
87
|
value: viewToTab(view),
|
|
87
88
|
onChange: handleChange,
|
|
88
89
|
className: clsx(className, classes.root),
|
|
90
|
+
sx: sx,
|
|
89
91
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
90
92
|
value: "date",
|
|
91
93
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -127,6 +129,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
127
129
|
* @param {TView} view The view to open
|
|
128
130
|
*/
|
|
129
131
|
onViewChange: PropTypes.func.isRequired,
|
|
132
|
+
/**
|
|
133
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
134
|
+
*/
|
|
135
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
130
136
|
/**
|
|
131
137
|
* Time tab icon.
|
|
132
138
|
* @default Time
|
|
@@ -5,12 +5,12 @@ import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models'
|
|
|
5
5
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
|
|
10
8
|
/**
|
|
11
9
|
* Override or extend the styles applied to the component.
|
|
12
10
|
*/
|
|
13
11
|
classes?: Partial<DateTimePickerToolbarClasses>;
|
|
12
|
+
}
|
|
13
|
+
export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
|
|
14
14
|
toolbarVariant?: WrapperVariant;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -327,6 +327,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
327
327
|
*/
|
|
328
328
|
onViewChange: PropTypes.func.isRequired,
|
|
329
329
|
readOnly: PropTypes.bool,
|
|
330
|
+
/**
|
|
331
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
332
|
+
*/
|
|
330
333
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
331
334
|
titleId: PropTypes.string,
|
|
332
335
|
/**
|
|
@@ -122,6 +122,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
122
122
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
123
123
|
// ----------------------------------------------------------------------
|
|
124
124
|
children: PropTypes.node,
|
|
125
|
+
/**
|
|
126
|
+
* Override or extend the styles applied to the component.
|
|
127
|
+
*/
|
|
125
128
|
classes: PropTypes.object,
|
|
126
129
|
className: PropTypes.string,
|
|
127
130
|
/**
|
|
@@ -164,6 +167,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
164
167
|
* @default {}
|
|
165
168
|
*/
|
|
166
169
|
slots: PropTypes.object,
|
|
170
|
+
/**
|
|
171
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
172
|
+
*/
|
|
167
173
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
168
174
|
value: PropTypes.any,
|
|
169
175
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
@@ -71,11 +71,17 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
|
|
|
71
71
|
value?: TValue;
|
|
72
72
|
className?: string;
|
|
73
73
|
children?: React.ReactNode;
|
|
74
|
+
/**
|
|
75
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
76
|
+
*/
|
|
74
77
|
sx?: SxProps<Theme>;
|
|
75
78
|
/**
|
|
76
79
|
* Ref to pass to the root element
|
|
77
80
|
*/
|
|
78
81
|
ref?: React.Ref<HTMLDivElement>;
|
|
82
|
+
/**
|
|
83
|
+
* Override or extend the styles applied to the component.
|
|
84
|
+
*/
|
|
79
85
|
classes?: Partial<PickersLayoutClasses>;
|
|
80
86
|
/**
|
|
81
87
|
* Overridable components.
|
|
@@ -2,14 +2,15 @@ import * as React from 'react';
|
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { TimePickerToolbarClasses } from './timePickerToolbarClasses';
|
|
4
4
|
import { TimeViewWithMeridiem } from '../internals/models';
|
|
5
|
-
export interface TimePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, TimeViewWithMeridiem
|
|
5
|
+
export interface TimePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, TimeViewWithMeridiem>, ExportedTimePickerToolbarProps {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
|
8
|
-
classes?: Partial<TimePickerToolbarClasses>;
|
|
9
8
|
}
|
|
10
9
|
export interface ExportedTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Override or extend the styles applied to the component.
|
|
12
|
+
*/
|
|
13
|
+
classes?: Partial<TimePickerToolbarClasses>;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Demos:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
|
|
3
|
+
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import { useTheme, styled, useThemeProps } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
@@ -132,7 +133,8 @@ function TimePickerToolbar(inProps) {
|
|
|
132
133
|
onViewChange,
|
|
133
134
|
views,
|
|
134
135
|
disabled,
|
|
135
|
-
readOnly
|
|
136
|
+
readOnly,
|
|
137
|
+
className
|
|
136
138
|
} = props,
|
|
137
139
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
138
140
|
const utils = useUtils();
|
|
@@ -160,7 +162,7 @@ function TimePickerToolbar(inProps) {
|
|
|
160
162
|
toolbarTitle: localeText.timePickerToolbarTitle,
|
|
161
163
|
isLandscape: isLandscape,
|
|
162
164
|
ownerState: ownerState,
|
|
163
|
-
className: classes.root
|
|
165
|
+
className: clsx(classes.root, className)
|
|
164
166
|
}, other, {
|
|
165
167
|
children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
|
|
166
168
|
className: classes.hourMinuteLabel,
|
|
@@ -213,6 +215,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
213
215
|
// ----------------------------------------------------------------------
|
|
214
216
|
ampm: PropTypes.bool,
|
|
215
217
|
ampmInClock: PropTypes.bool,
|
|
218
|
+
/**
|
|
219
|
+
* Override or extend the styles applied to the component.
|
|
220
|
+
*/
|
|
216
221
|
classes: PropTypes.object,
|
|
217
222
|
/**
|
|
218
223
|
* className applied to the root component.
|
|
@@ -233,6 +238,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
233
238
|
*/
|
|
234
239
|
onViewChange: PropTypes.func.isRequired,
|
|
235
240
|
readOnly: PropTypes.bool,
|
|
241
|
+
/**
|
|
242
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
243
|
+
*/
|
|
236
244
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
237
245
|
titleId: PropTypes.string,
|
|
238
246
|
/**
|
package/index.js
CHANGED
|
@@ -15,6 +15,9 @@ export interface ExportedPickersArrowSwitcherProps {
|
|
|
15
15
|
* @default {}
|
|
16
16
|
*/
|
|
17
17
|
slotProps?: PickersArrowSwitcherSlotsComponentsProps;
|
|
18
|
+
/**
|
|
19
|
+
* Override or extend the styles applied to the component.
|
|
20
|
+
*/
|
|
18
21
|
classes?: Partial<PickersArrowSwitcherClasses>;
|
|
19
22
|
}
|
|
20
23
|
export interface PickersArrowSwitcherProps extends ExportedPickersArrowSwitcherProps, Omit<React.HTMLProps<HTMLDivElement>, 'ref' | 'as'> {
|
|
@@ -60,6 +60,9 @@ export interface PickerPopperProps extends UsePickerValueActions {
|
|
|
60
60
|
onBlur?: () => void;
|
|
61
61
|
slots?: UncapitalizeObjectKeys<PickersPopperSlotsComponent>;
|
|
62
62
|
slotProps?: PickersPopperSlotsComponentsProps;
|
|
63
|
+
/**
|
|
64
|
+
* Override or extend the styles applied to the component.
|
|
65
|
+
*/
|
|
63
66
|
classes?: Partial<PickersPopperClasses>;
|
|
64
67
|
shouldRestoreFocus?: () => boolean;
|
|
65
68
|
reduceAnimations?: boolean;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SxProps } from '@mui/system';
|
|
2
|
+
import { Theme } from '@mui/material/styles';
|
|
1
3
|
import { DateOrTimeViewWithMeridiem } from '../common';
|
|
2
4
|
export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
|
|
3
5
|
/**
|
|
@@ -11,6 +13,10 @@ export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
|
|
|
11
13
|
*/
|
|
12
14
|
onViewChange: (view: TView) => void;
|
|
13
15
|
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
18
|
+
*/
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
14
20
|
}
|
|
15
21
|
export interface ExportedBaseTabsProps {
|
|
16
22
|
}
|
|
@@ -371,6 +371,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
371
371
|
* - the `input` element if there is a field rendered.
|
|
372
372
|
*/
|
|
373
373
|
autoFocus: PropTypes.bool,
|
|
374
|
+
/**
|
|
375
|
+
* Override or extend the styles applied to the component.
|
|
376
|
+
*/
|
|
374
377
|
classes: PropTypes.object,
|
|
375
378
|
className: PropTypes.string,
|
|
376
379
|
/**
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
5
|
import { useIsDateDisabled } from './useIsDateDisabled';
|
|
6
|
-
import { useUtils
|
|
6
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
7
7
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
8
8
|
import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
|
|
9
9
|
export var createCalendarStateReducer = function createCalendarStateReducer(reduceAnimations, disableSwitchToMonthOnDayFocus, utils) {
|
|
@@ -51,7 +51,6 @@ export var useCalendarState = function useCalendarState(params) {
|
|
|
51
51
|
reduceAnimations = params.reduceAnimations,
|
|
52
52
|
shouldDisableDate = params.shouldDisableDate,
|
|
53
53
|
timezone = params.timezone;
|
|
54
|
-
var now = useNow(timezone);
|
|
55
54
|
var utils = useUtils();
|
|
56
55
|
var reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
|
|
57
56
|
var referenceDate = React.useMemo(function () {
|
|
@@ -74,7 +73,7 @@ export var useCalendarState = function useCalendarState(params) {
|
|
|
74
73
|
);
|
|
75
74
|
var _React$useReducer = React.useReducer(reducerFn, {
|
|
76
75
|
isMonthSwitchingAnimating: false,
|
|
77
|
-
focusedDay:
|
|
76
|
+
focusedDay: referenceDate,
|
|
78
77
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
79
78
|
slideDirection: 'left'
|
|
80
79
|
}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
|
|
3
|
+
var _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Typography from '@mui/material/Typography';
|
|
7
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
@@ -60,6 +61,7 @@ export var DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePicker
|
|
|
60
61
|
_props$toolbarPlaceho = props.toolbarPlaceholder,
|
|
61
62
|
toolbarPlaceholder = _props$toolbarPlaceho === void 0 ? '––' : _props$toolbarPlaceho,
|
|
62
63
|
views = props.views,
|
|
64
|
+
className = props.className,
|
|
63
65
|
other = _objectWithoutProperties(props, _excluded);
|
|
64
66
|
var utils = useUtils();
|
|
65
67
|
var localeText = useLocaleText();
|
|
@@ -79,7 +81,7 @@ export var DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePicker
|
|
|
79
81
|
ref: ref,
|
|
80
82
|
toolbarTitle: localeText.datePickerToolbarTitle,
|
|
81
83
|
isLandscape: isLandscape,
|
|
82
|
-
className: classes.root
|
|
84
|
+
className: clsx(classes.root, className)
|
|
83
85
|
}, other, {
|
|
84
86
|
children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
|
|
85
87
|
variant: "h4",
|
|
@@ -95,6 +97,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
95
97
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
96
98
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
97
99
|
// ----------------------------------------------------------------------
|
|
100
|
+
/**
|
|
101
|
+
* Override or extend the styles applied to the component.
|
|
102
|
+
*/
|
|
98
103
|
classes: PropTypes.object,
|
|
99
104
|
/**
|
|
100
105
|
* className applied to the root component.
|
|
@@ -115,6 +120,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
115
120
|
*/
|
|
116
121
|
onViewChange: PropTypes.func.isRequired,
|
|
117
122
|
readOnly: PropTypes.bool,
|
|
123
|
+
/**
|
|
124
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
125
|
+
*/
|
|
118
126
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
119
127
|
titleId: PropTypes.string,
|
|
120
128
|
/**
|