@mui/x-date-pickers 6.13.0 → 6.14.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 +79 -1
- package/DateCalendar/DateCalendar.js +2 -2
- package/DateField/DateField.js +2 -3
- package/DatePicker/DatePicker.js +2 -3
- package/DateTimeField/DateTimeField.js +2 -3
- package/DateTimePicker/DateTimePicker.js +2 -3
- package/DesktopDatePicker/DesktopDatePicker.js +2 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
- package/DesktopTimePicker/DesktopTimePicker.js +2 -3
- package/MobileDatePicker/MobileDatePicker.js +2 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
- package/MobileTimePicker/MobileTimePicker.js +2 -3
- package/MonthCalendar/MonthCalendar.js +9 -3
- package/MonthCalendar/MonthCalendar.types.d.ts +1 -0
- package/MonthCalendar/PickersMonth.d.ts +1 -0
- package/MonthCalendar/PickersMonth.js +7 -2
- package/README.md +4 -4
- package/TimeClock/Clock.js +29 -8
- package/TimeClock/clockClasses.d.ts +2 -0
- package/TimeClock/clockClasses.js +1 -1
- package/TimeField/TimeField.js +2 -3
- package/TimePicker/TimePicker.js +2 -3
- package/YearCalendar/PickersYear.js +3 -0
- package/YearCalendar/YearCalendar.js +7 -3
- package/YearCalendar/YearCalendar.types.d.ts +1 -0
- package/index.js +1 -1
- package/internals/components/PickersPopper.d.ts +2 -2
- package/internals/components/PickersPopper.js +3 -3
- package/legacy/DateCalendar/DateCalendar.js +2 -2
- package/legacy/DateField/DateField.js +2 -3
- package/legacy/DatePicker/DatePicker.js +2 -3
- package/legacy/DateTimeField/DateTimeField.js +2 -3
- package/legacy/DateTimePicker/DateTimePicker.js +2 -3
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +2 -3
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +2 -3
- package/legacy/MobileDatePicker/MobileDatePicker.js +2 -3
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
- package/legacy/MobileTimePicker/MobileTimePicker.js +2 -3
- package/legacy/MonthCalendar/MonthCalendar.js +8 -2
- package/legacy/MonthCalendar/PickersMonth.js +5 -1
- package/legacy/TimeClock/Clock.js +31 -8
- package/legacy/TimeClock/clockClasses.js +1 -1
- package/legacy/TimeField/TimeField.js +2 -3
- package/legacy/TimePicker/TimePicker.js +2 -3
- package/legacy/YearCalendar/PickersYear.js +2 -0
- package/legacy/YearCalendar/YearCalendar.js +6 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersPopper.js +3 -3
- package/modern/DateCalendar/DateCalendar.js +2 -2
- package/modern/DateField/DateField.js +2 -3
- package/modern/DatePicker/DatePicker.js +2 -3
- package/modern/DateTimeField/DateTimeField.js +2 -3
- package/modern/DateTimePicker/DateTimePicker.js +2 -3
- package/modern/DesktopDatePicker/DesktopDatePicker.js +2 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +2 -3
- package/modern/MobileDatePicker/MobileDatePicker.js +2 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +2 -3
- package/modern/MonthCalendar/MonthCalendar.js +9 -3
- package/modern/MonthCalendar/PickersMonth.js +7 -2
- package/modern/TimeClock/Clock.js +29 -8
- package/modern/TimeClock/clockClasses.js +1 -1
- package/modern/TimeField/TimeField.js +2 -3
- package/modern/TimePicker/TimePicker.js +2 -3
- package/modern/YearCalendar/PickersYear.js +3 -0
- package/modern/YearCalendar/YearCalendar.js +7 -3
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersPopper.js +3 -3
- package/node/DateCalendar/DateCalendar.js +2 -2
- package/node/DateField/DateField.js +2 -3
- package/node/DatePicker/DatePicker.js +4 -5
- package/node/DateTimeField/DateTimeField.js +2 -3
- package/node/DateTimePicker/DateTimePicker.js +4 -5
- package/node/DesktopDatePicker/DesktopDatePicker.js +2 -3
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
- package/node/DesktopTimePicker/DesktopTimePicker.js +2 -3
- package/node/MobileDatePicker/MobileDatePicker.js +2 -3
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
- package/node/MobileTimePicker/MobileTimePicker.js +2 -3
- package/node/MonthCalendar/MonthCalendar.js +9 -3
- package/node/MonthCalendar/PickersMonth.js +7 -2
- package/node/TimeClock/Clock.js +28 -7
- package/node/TimeClock/clockClasses.js +1 -1
- package/node/TimeField/TimeField.js +2 -3
- package/node/TimePicker/TimePicker.js +4 -5
- package/node/YearCalendar/PickersYear.js +3 -0
- package/node/YearCalendar/YearCalendar.js +7 -3
- package/node/index.js +1 -1
- package/node/internals/components/PickersPopper.js +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,83 @@
|
|
|
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.14.0
|
|
7
|
+
|
|
8
|
+
_Sep 14, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Fix `YearCalendar` and `MonthCalendar` accessibility (#10312) @LukasTy
|
|
13
|
+
|
|
14
|
+
The `YearCalendar` and `MonthCalendar` items role has been changed from `button` to `radio` in order to improve the component's a11y support.
|
|
15
|
+
If you were relying on the mentioned components having a `button` role for items, you will need to update your usage to expect a `radio` role instead.
|
|
16
|
+
|
|
17
|
+
- 🌍 Improve Japanese (ja-JP), Persian (fa-IR), and Vietnamese (vi-VN) locales on the data grid
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@6.14.0`
|
|
24
|
+
|
|
25
|
+
- [l10n] Improve Japanese (ja-JP) locale (#10299) @makoto14
|
|
26
|
+
- [l10n] Improve Persian (fa-IR) locale (#10277) @aminsaedi
|
|
27
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#10280) @khangnguyen2100
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-pro@6.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid@6.14.0`.
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-premium@6.14.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid-pro@6.14.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPremium] Fix clipboard import cutting off at 100 rows (#9930) @gitstart
|
|
38
|
+
|
|
39
|
+
### Date Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@6.14.0`
|
|
42
|
+
|
|
43
|
+
- [pickers] Fix `YearCalendar` and `MonthCalendar` a11y (#10312) @LukasTy
|
|
44
|
+
- [pickers] Localize `TimeClock` meridiem text (#10324) @LukasTy
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers-pro@6.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-date-pickers@6.14.0`.
|
|
49
|
+
|
|
50
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.11`
|
|
51
|
+
|
|
52
|
+
- [charts] Add default `barGapRatio` and increase `categoryGapRatio` (#10317) @LukasTy
|
|
53
|
+
- [charts] Enable `eslint` on the package (#10330) @LukasTy
|
|
54
|
+
|
|
55
|
+
### Tree View / `@mui/x-tree-view@6.0.0-alpha.3`
|
|
56
|
+
|
|
57
|
+
- [TreeView] Fix box-sizing dependency (#10255) @oliviertassinari
|
|
58
|
+
|
|
59
|
+
### Docs
|
|
60
|
+
|
|
61
|
+
- [docs] Add conditional range picker props example (#10227) @LukasTy
|
|
62
|
+
- [docs] Add toolbar to the multi-filters demo (#10223) @MBilalShafi
|
|
63
|
+
- [docs] Avoid the use of "We" @oliviertassinari
|
|
64
|
+
- [docs] Clarify MUI vs. MUI Core difference @oliviertassinari
|
|
65
|
+
- [docs] Enable `ariaV7` flag for demos using `useDemoData` hook (#10204) @cherniavskii
|
|
66
|
+
- [docs] Fix Tree View link to API references (#10282) @oliviertassinari
|
|
67
|
+
- [docs] Fix image layout shift (#10313) @oliviertassinari
|
|
68
|
+
- [docs] Fix link to MUI X from readme logo @oliviertassinari
|
|
69
|
+
- [docs] Fix redirection to Base UI URLs @oliviertassinari
|
|
70
|
+
- [docs] Improve Tree View demos (#10268) @oliviertassinari
|
|
71
|
+
- [docs] Improve docs for ref type props (#10273) @michelengelen
|
|
72
|
+
- [docs] Improve npm package README (#10269) @oliviertassinari
|
|
73
|
+
- [docs] Improve the clarity of the npm links @oliviertassinari
|
|
74
|
+
- [docs] Keep installation readme simple @oliviertassinari
|
|
75
|
+
- [docs] Make each component feel more standalone @oliviertassinari
|
|
76
|
+
|
|
77
|
+
### Core
|
|
78
|
+
|
|
79
|
+
- [core] Add types extension for clarity @oliviertassinari
|
|
80
|
+
- [core] Set logo height to fix layout shift in GitHub @oliviertassinari
|
|
81
|
+
- [core] TrapFocus was renamed to FocusTrap @oliviertassinari
|
|
82
|
+
|
|
6
83
|
## 6.13.0
|
|
7
84
|
|
|
8
85
|
_Sep 8, 2023_
|
|
@@ -12,6 +89,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
12
89
|
- 🎁 Fix `anchorRef` behavior on range pickers (#10077) @LukasTy
|
|
13
90
|
|
|
14
91
|
The range picker popup will now be anchored to the first input element and left aligned like other pickers.
|
|
92
|
+
|
|
15
93
|
- 🌍 Improve Slovak (sk-SK) locale on the data grid
|
|
16
94
|
- 🐞 Bugfixes
|
|
17
95
|
- 📚 Documentation improvements
|
|
@@ -1838,7 +1916,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
1838
1916
|
#### Changes
|
|
1839
1917
|
|
|
1840
1918
|
- [DataGrid] Add interface for `singleSelect` column (#7685) @m4theushw
|
|
1841
|
-
- [DataGrid] Allow to pass props to the `
|
|
1919
|
+
- [DataGrid] Allow to pass props to the `FocusTrap` inside the panel wrapper (#7733) @ivek-Prajapatii
|
|
1842
1920
|
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7857) @cherniavskii
|
|
1843
1921
|
- [DataGridPro] Change cursor when dragging a column (#7725) @sai6855
|
|
1844
1922
|
- [DataGridPremium] Fix `leafField` to have correct focus value (#7950) @MBilalShafi
|
|
@@ -277,7 +277,8 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
277
277
|
disableHighlightToday,
|
|
278
278
|
readOnly,
|
|
279
279
|
disabled,
|
|
280
|
-
timezone
|
|
280
|
+
timezone,
|
|
281
|
+
gridLabelId
|
|
281
282
|
};
|
|
282
283
|
const prevOpenViewRef = React.useRef(view);
|
|
283
284
|
React.useEffect(() => {
|
|
@@ -331,7 +332,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
331
332
|
shouldDisableYear: shouldDisableYear,
|
|
332
333
|
hasFocus: hasFocus,
|
|
333
334
|
onFocusedViewChange: isViewFocused => setFocusedView('day', isViewFocused),
|
|
334
|
-
gridLabelId: gridLabelId,
|
|
335
335
|
showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,
|
|
336
336
|
fixedWeekNumber: fixedWeekNumber,
|
|
337
337
|
dayOfWeekFormatter: dayOfWeekFormatter,
|
package/DateField/DateField.js
CHANGED
|
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import MuiTextField from '@mui/material/TextField';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
11
|
+
import { refType } from '@mui/utils';
|
|
11
12
|
import { useDateField } from './useDateField';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
|
|
@@ -175,9 +176,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
175
176
|
/**
|
|
176
177
|
* Pass a ref to the `input` element.
|
|
177
178
|
*/
|
|
178
|
-
inputRef:
|
|
179
|
-
current: PropTypes.any.isRequired
|
|
180
|
-
})]),
|
|
179
|
+
inputRef: refType,
|
|
181
180
|
/**
|
|
182
181
|
* The label content.
|
|
183
182
|
*/
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import { refType } from '@mui/utils';
|
|
8
9
|
import { DesktopDatePicker } from '../DesktopDatePicker';
|
|
9
10
|
import { MobileDatePicker } from '../MobileDatePicker';
|
|
10
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
@@ -136,9 +137,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
136
137
|
/**
|
|
137
138
|
* Pass a ref to the `input` element.
|
|
138
139
|
*/
|
|
139
|
-
inputRef:
|
|
140
|
-
current: PropTypes.object
|
|
141
|
-
})]),
|
|
140
|
+
inputRef: refType,
|
|
142
141
|
/**
|
|
143
142
|
* The label content.
|
|
144
143
|
*/
|
|
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import MuiTextField from '@mui/material/TextField';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
11
|
+
import { refType } from '@mui/utils';
|
|
11
12
|
import { useDateTimeField } from './useDateTimeField';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inProps, ref) {
|
|
@@ -185,9 +186,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
185
186
|
/**
|
|
186
187
|
* Pass a ref to the `input` element.
|
|
187
188
|
*/
|
|
188
|
-
inputRef:
|
|
189
|
-
current: PropTypes.any.isRequired
|
|
190
|
-
})]),
|
|
189
|
+
inputRef: refType,
|
|
191
190
|
/**
|
|
192
191
|
* The label content.
|
|
193
192
|
*/
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import { refType } from '@mui/utils';
|
|
8
9
|
import { DesktopDateTimePicker } from '../DesktopDateTimePicker';
|
|
9
10
|
import { MobileDateTimePicker } from '../MobileDateTimePicker';
|
|
10
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
@@ -151,9 +152,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
151
152
|
/**
|
|
152
153
|
* Pass a ref to the `input` element.
|
|
153
154
|
*/
|
|
154
|
-
inputRef:
|
|
155
|
-
current: PropTypes.object
|
|
156
|
-
})]),
|
|
155
|
+
inputRef: refType,
|
|
157
156
|
/**
|
|
158
157
|
* The label content.
|
|
159
158
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
6
7
|
import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
|
|
7
8
|
import { useLocaleText, useUtils, validateDate } from '../internals';
|
|
@@ -154,9 +155,7 @@ DesktopDatePicker.propTypes = {
|
|
|
154
155
|
/**
|
|
155
156
|
* Pass a ref to the `input` element.
|
|
156
157
|
*/
|
|
157
|
-
inputRef:
|
|
158
|
-
current: PropTypes.object
|
|
159
|
-
})]),
|
|
158
|
+
inputRef: refType,
|
|
160
159
|
/**
|
|
161
160
|
* The label content.
|
|
162
161
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
6
7
|
import { DateTimeField } from '../DateTimeField';
|
|
7
8
|
import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
|
|
@@ -205,9 +206,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
205
206
|
/**
|
|
206
207
|
* Pass a ref to the `input` element.
|
|
207
208
|
*/
|
|
208
|
-
inputRef:
|
|
209
|
-
current: PropTypes.object
|
|
210
|
-
})]),
|
|
209
|
+
inputRef: refType,
|
|
211
210
|
/**
|
|
212
211
|
* The label content.
|
|
213
212
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
6
7
|
import { TimeField } from '../TimeField';
|
|
7
8
|
import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
|
|
@@ -166,9 +167,7 @@ DesktopTimePicker.propTypes = {
|
|
|
166
167
|
/**
|
|
167
168
|
* Pass a ref to the `input` element.
|
|
168
169
|
*/
|
|
169
|
-
inputRef:
|
|
170
|
-
current: PropTypes.object
|
|
171
|
-
})]),
|
|
170
|
+
inputRef: refType,
|
|
172
171
|
/**
|
|
173
172
|
* The label content.
|
|
174
173
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
6
7
|
import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
|
|
7
8
|
import { useLocaleText, useUtils, validateDate } from '../internals';
|
|
@@ -151,9 +152,7 @@ MobileDatePicker.propTypes = {
|
|
|
151
152
|
/**
|
|
152
153
|
* Pass a ref to the `input` element.
|
|
153
154
|
*/
|
|
154
|
-
inputRef:
|
|
155
|
-
current: PropTypes.object
|
|
156
|
-
})]),
|
|
155
|
+
inputRef: refType,
|
|
157
156
|
/**
|
|
158
157
|
* The label content.
|
|
159
158
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
6
7
|
import { DateTimeField } from '../DateTimeField';
|
|
7
8
|
import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
|
|
@@ -177,9 +178,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
177
178
|
/**
|
|
178
179
|
* Pass a ref to the `input` element.
|
|
179
180
|
*/
|
|
180
|
-
inputRef:
|
|
181
|
-
current: PropTypes.object
|
|
182
|
-
})]),
|
|
181
|
+
inputRef: refType,
|
|
183
182
|
/**
|
|
184
183
|
* The label content.
|
|
185
184
|
*/
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { refType } from '@mui/utils';
|
|
5
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
6
7
|
import { TimeField } from '../TimeField';
|
|
7
8
|
import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
|
|
@@ -144,9 +145,7 @@ MobileTimePicker.propTypes = {
|
|
|
144
145
|
/**
|
|
145
146
|
* Pass a ref to the `input` element.
|
|
146
147
|
*/
|
|
147
|
-
inputRef:
|
|
148
|
-
current: PropTypes.object
|
|
149
|
-
})]),
|
|
148
|
+
inputRef: refType,
|
|
150
149
|
/**
|
|
151
150
|
* The label content.
|
|
152
151
|
*/
|
|
@@ -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 = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone"];
|
|
3
|
+
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -71,7 +71,8 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
71
71
|
hasFocus,
|
|
72
72
|
onFocusedViewChange,
|
|
73
73
|
monthsPerRow = 3,
|
|
74
|
-
timezone: timezoneProp
|
|
74
|
+
timezone: timezoneProp,
|
|
75
|
+
gridLabelId
|
|
75
76
|
} = props,
|
|
76
77
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
77
78
|
const {
|
|
@@ -193,11 +194,14 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
193
194
|
return /*#__PURE__*/_jsx(MonthCalendarRoot, _extends({
|
|
194
195
|
ref: ref,
|
|
195
196
|
className: clsx(classes.root, className),
|
|
196
|
-
ownerState: ownerState
|
|
197
|
+
ownerState: ownerState,
|
|
198
|
+
role: "radiogroup",
|
|
199
|
+
"aria-labelledby": gridLabelId
|
|
197
200
|
}, other, {
|
|
198
201
|
children: getMonthsInYear(utils, value != null ? value : referenceDate).map(month => {
|
|
199
202
|
const monthNumber = utils.getMonth(month);
|
|
200
203
|
const monthText = utils.format(month, 'monthShort');
|
|
204
|
+
const monthLabel = utils.format(month, 'month');
|
|
201
205
|
const isSelected = monthNumber === selectedMonth;
|
|
202
206
|
const isDisabled = disabled || isMonthDisabled(month);
|
|
203
207
|
return /*#__PURE__*/_jsx(PickersMonth, {
|
|
@@ -211,6 +215,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
211
215
|
onFocus: handleMonthFocus,
|
|
212
216
|
onBlur: handleMonthBlur,
|
|
213
217
|
"aria-current": todayMonth === monthNumber ? 'date' : undefined,
|
|
218
|
+
"aria-label": monthLabel,
|
|
214
219
|
monthsPerRow: monthsPerRow,
|
|
215
220
|
children: monthText
|
|
216
221
|
}, monthText);
|
|
@@ -255,6 +260,7 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
255
260
|
* @default false
|
|
256
261
|
*/
|
|
257
262
|
disablePast: PropTypes.bool,
|
|
263
|
+
gridLabelId: PropTypes.string,
|
|
258
264
|
hasFocus: PropTypes.bool,
|
|
259
265
|
/**
|
|
260
266
|
* Maximal selectable date.
|
|
@@ -5,6 +5,7 @@ export interface ExportedPickersMonthProps {
|
|
|
5
5
|
}
|
|
6
6
|
export interface PickersMonthProps extends ExportedPickersMonthProps {
|
|
7
7
|
'aria-current'?: React.AriaAttributes['aria-current'];
|
|
8
|
+
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
8
9
|
autoFocus: boolean;
|
|
9
10
|
children: React.ReactNode;
|
|
10
11
|
disabled?: boolean;
|
|
@@ -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 = ["autoFocus", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "monthsPerRow"];
|
|
3
|
+
const _excluded = ["autoFocus", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { styled, alpha, useThemeProps } from '@mui/material/styles';
|
|
6
6
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
@@ -85,13 +85,15 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
85
85
|
autoFocus,
|
|
86
86
|
children,
|
|
87
87
|
disabled,
|
|
88
|
+
selected,
|
|
88
89
|
value,
|
|
89
90
|
tabIndex,
|
|
90
91
|
onClick,
|
|
91
92
|
onKeyDown,
|
|
92
93
|
onFocus,
|
|
93
94
|
onBlur,
|
|
94
|
-
'aria-current': ariaCurrent
|
|
95
|
+
'aria-current': ariaCurrent,
|
|
96
|
+
'aria-label': ariaLabel
|
|
95
97
|
// We don't want to forward this prop to the root element
|
|
96
98
|
} = props,
|
|
97
99
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -111,8 +113,11 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
111
113
|
ref: ref,
|
|
112
114
|
disabled: disabled,
|
|
113
115
|
type: "button",
|
|
116
|
+
role: "radio",
|
|
114
117
|
tabIndex: disabled ? -1 : tabIndex,
|
|
115
118
|
"aria-current": ariaCurrent,
|
|
119
|
+
"aria-checked": selected,
|
|
120
|
+
"aria-label": ariaLabel,
|
|
116
121
|
onClick: event => onClick(event, value),
|
|
117
122
|
onKeyDown: event => onKeyDown(event, value),
|
|
118
123
|
onFocus: event => onFocus(event, value),
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MUI X Date Pickers
|
|
2
2
|
|
|
3
3
|
This package is the community edition of the date and time picker components.
|
|
4
|
-
It's part of MUI X, an open-core extension of MUI, with advanced components.
|
|
4
|
+
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ npm install @mui/x-date-pickers
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Then install the date library of your choice (if not already installed).
|
|
15
|
-
|
|
15
|
+
The pickers currently support the following date libraries:
|
|
16
16
|
|
|
17
17
|
- [date-fns](https://date-fns.org/)
|
|
18
18
|
- [Day.js](https://day.js.org/)
|
|
@@ -62,4 +62,4 @@ function App({ children }) {
|
|
|
62
62
|
|
|
63
63
|
## Documentation
|
|
64
64
|
|
|
65
|
-
[
|
|
65
|
+
Visit [https://mui.com/x/react-date-pickers/](https://mui.com/x/react-date-pickers/) to view the full documentation.
|
package/TimeClock/Clock.js
CHANGED
|
@@ -7,8 +7,9 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
7
7
|
import { unstable_useEnhancedEffect as useEnhancedEffect, unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { ClockPointer } from './ClockPointer';
|
|
9
9
|
import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
|
|
10
|
-
import { getHours, getMinutes } from './shared';
|
|
10
|
+
import { CLOCK_HOUR_WIDTH, getHours, getMinutes } from './shared';
|
|
11
11
|
import { getClockUtilityClass } from './clockClasses';
|
|
12
|
+
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
const useUtilityClasses = ownerState => {
|
|
@@ -22,7 +23,8 @@ const useUtilityClasses = ownerState => {
|
|
|
22
23
|
squareMask: ['squareMask'],
|
|
23
24
|
pin: ['pin'],
|
|
24
25
|
amButton: ['amButton'],
|
|
25
|
-
pmButton: ['pmButton']
|
|
26
|
+
pmButton: ['pmButton'],
|
|
27
|
+
meridiemText: ['meridiemText']
|
|
26
28
|
};
|
|
27
29
|
return composeClasses(slots, getClockUtilityClass, classes);
|
|
28
30
|
};
|
|
@@ -111,7 +113,10 @@ const ClockAmButton = styled(IconButton, {
|
|
|
111
113
|
zIndex: 1,
|
|
112
114
|
position: 'absolute',
|
|
113
115
|
bottom: 8,
|
|
114
|
-
left: 8
|
|
116
|
+
left: 8,
|
|
117
|
+
paddingLeft: 4,
|
|
118
|
+
paddingRight: 4,
|
|
119
|
+
width: CLOCK_HOUR_WIDTH
|
|
115
120
|
}, ownerState.meridiemMode === 'am' && {
|
|
116
121
|
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
117
122
|
color: (theme.vars || theme).palette.primary.contrastText,
|
|
@@ -130,7 +135,10 @@ const ClockPmButton = styled(IconButton, {
|
|
|
130
135
|
zIndex: 1,
|
|
131
136
|
position: 'absolute',
|
|
132
137
|
bottom: 8,
|
|
133
|
-
right: 8
|
|
138
|
+
right: 8,
|
|
139
|
+
paddingLeft: 4,
|
|
140
|
+
paddingRight: 4,
|
|
141
|
+
width: CLOCK_HOUR_WIDTH
|
|
134
142
|
}, ownerState.meridiemMode === 'pm' && {
|
|
135
143
|
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
136
144
|
color: (theme.vars || theme).palette.primary.contrastText,
|
|
@@ -138,6 +146,15 @@ const ClockPmButton = styled(IconButton, {
|
|
|
138
146
|
backgroundColor: (theme.vars || theme).palette.primary.light
|
|
139
147
|
}
|
|
140
148
|
}));
|
|
149
|
+
const ClockMeridiemText = styled(Typography, {
|
|
150
|
+
name: 'MuiClock',
|
|
151
|
+
slot: 'meridiemText',
|
|
152
|
+
overridesResolver: (_, styles) => styles.meridiemText
|
|
153
|
+
})({
|
|
154
|
+
overflow: 'hidden',
|
|
155
|
+
whiteSpace: 'nowrap',
|
|
156
|
+
textOverflow: 'ellipsis'
|
|
157
|
+
});
|
|
141
158
|
|
|
142
159
|
/**
|
|
143
160
|
* @ignore - internal component.
|
|
@@ -298,18 +315,22 @@ export function Clock(inProps) {
|
|
|
298
315
|
disabled: disabled || meridiemMode === null,
|
|
299
316
|
ownerState: ownerState,
|
|
300
317
|
className: classes.amButton,
|
|
301
|
-
|
|
318
|
+
title: formatMeridiem(utils, 'am'),
|
|
319
|
+
children: /*#__PURE__*/_jsx(ClockMeridiemText, {
|
|
302
320
|
variant: "caption",
|
|
303
|
-
|
|
321
|
+
className: classes.meridiemText,
|
|
322
|
+
children: formatMeridiem(utils, 'am')
|
|
304
323
|
})
|
|
305
324
|
}), /*#__PURE__*/_jsx(ClockPmButton, {
|
|
306
325
|
disabled: disabled || meridiemMode === null,
|
|
307
326
|
onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
|
|
308
327
|
ownerState: ownerState,
|
|
309
328
|
className: classes.pmButton,
|
|
310
|
-
|
|
329
|
+
title: formatMeridiem(utils, 'pm'),
|
|
330
|
+
children: /*#__PURE__*/_jsx(ClockMeridiemText, {
|
|
311
331
|
variant: "caption",
|
|
312
|
-
|
|
332
|
+
className: classes.meridiemText,
|
|
333
|
+
children: formatMeridiem(utils, 'pm')
|
|
313
334
|
})
|
|
314
335
|
})]
|
|
315
336
|
})]
|
|
@@ -13,6 +13,8 @@ export interface ClockClasses {
|
|
|
13
13
|
amButton: string;
|
|
14
14
|
/** Styles applied to the pm button element. */
|
|
15
15
|
pmButton: string;
|
|
16
|
+
/** Styles applied to the meridiem typography element. */
|
|
17
|
+
meridiemText: string;
|
|
16
18
|
}
|
|
17
19
|
export type ClockClassKey = keyof ClockClasses;
|
|
18
20
|
export declare function getClockUtilityClass(slot: string): string;
|
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generat
|
|
|
2
2
|
export function getClockUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiClock', slot);
|
|
4
4
|
}
|
|
5
|
-
export const clockClasses = generateUtilityClasses('MuiClock', ['root', 'clock', 'wrapper', 'squareMask', 'pin', 'amButton', 'pmButton']);
|
|
5
|
+
export const clockClasses = generateUtilityClasses('MuiClock', ['root', 'clock', 'wrapper', 'squareMask', 'pin', 'amButton', 'pmButton', 'meridiemText']);
|
package/TimeField/TimeField.js
CHANGED
|
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import MuiTextField from '@mui/material/TextField';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
11
|
+
import { refType } from '@mui/utils';
|
|
11
12
|
import { useTimeField } from './useTimeField';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref) {
|
|
@@ -185,9 +186,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
185
186
|
/**
|
|
186
187
|
* Pass a ref to the `input` element.
|
|
187
188
|
*/
|
|
188
|
-
inputRef:
|
|
189
|
-
current: PropTypes.any.isRequired
|
|
190
|
-
})]),
|
|
189
|
+
inputRef: refType,
|
|
191
190
|
/**
|
|
192
191
|
* The label content.
|
|
193
192
|
*/
|
package/TimePicker/TimePicker.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import { refType } from '@mui/utils';
|
|
8
9
|
import { DesktopTimePicker } from '../DesktopTimePicker';
|
|
9
10
|
import { MobileTimePicker } from '../MobileTimePicker';
|
|
10
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
@@ -125,9 +126,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
125
126
|
/**
|
|
126
127
|
* Pass a ref to the `input` element.
|
|
127
128
|
*/
|
|
128
|
-
inputRef:
|
|
129
|
-
current: PropTypes.object
|
|
130
|
-
})]),
|
|
129
|
+
inputRef: refType,
|
|
131
130
|
/**
|
|
132
131
|
* The label content.
|
|
133
132
|
*/
|
|
@@ -87,6 +87,7 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
|
|
|
87
87
|
className,
|
|
88
88
|
children,
|
|
89
89
|
disabled,
|
|
90
|
+
selected,
|
|
90
91
|
value,
|
|
91
92
|
tabIndex,
|
|
92
93
|
onClick,
|
|
@@ -115,8 +116,10 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
|
|
|
115
116
|
ref: ref,
|
|
116
117
|
disabled: disabled,
|
|
117
118
|
type: "button",
|
|
119
|
+
role: "radio",
|
|
118
120
|
tabIndex: disabled ? -1 : tabIndex,
|
|
119
121
|
"aria-current": ariaCurrent,
|
|
122
|
+
"aria-checked": selected,
|
|
120
123
|
onClick: event => onClick(event, value),
|
|
121
124
|
onKeyDown: event => onKeyDown(event, value),
|
|
122
125
|
onFocus: event => onFocus(event, value),
|
|
@@ -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 = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow", "timezone"];
|
|
3
|
+
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow", "timezone", "gridLabelId"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -77,7 +77,8 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
77
77
|
hasFocus,
|
|
78
78
|
onFocusedViewChange,
|
|
79
79
|
yearsPerRow = 3,
|
|
80
|
-
timezone: timezoneProp
|
|
80
|
+
timezone: timezoneProp,
|
|
81
|
+
gridLabelId
|
|
81
82
|
} = props,
|
|
82
83
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
83
84
|
const {
|
|
@@ -222,7 +223,9 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
222
223
|
return /*#__PURE__*/_jsx(YearCalendarRoot, _extends({
|
|
223
224
|
ref: handleRef,
|
|
224
225
|
className: clsx(classes.root, className),
|
|
225
|
-
ownerState: ownerState
|
|
226
|
+
ownerState: ownerState,
|
|
227
|
+
role: "radiogroup",
|
|
228
|
+
"aria-labelledby": gridLabelId
|
|
226
229
|
}, other, {
|
|
227
230
|
children: utils.getYearRange(minDate, maxDate).map(year => {
|
|
228
231
|
const yearNumber = utils.getYear(year);
|
|
@@ -283,6 +286,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
283
286
|
* @default false
|
|
284
287
|
*/
|
|
285
288
|
disablePast: PropTypes.bool,
|
|
289
|
+
gridLabelId: PropTypes.string,
|
|
286
290
|
hasFocus: PropTypes.bool,
|
|
287
291
|
/**
|
|
288
292
|
* Maximal selectable date.
|