@mui/x-date-pickers 7.7.1 → 7.9.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/AdapterDateFns/AdapterDateFns.d.ts +0 -1
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +0 -1
- package/CHANGELOG.md +166 -1
- package/DateCalendar/DayCalendar.js +7 -6
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DatePicker/DatePickerToolbar.js +4 -3
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -1
- package/DateTimePicker/DateTimePickerTabs.js +4 -4
- package/DateTimePicker/DateTimePickerToolbar.js +5 -4
- package/DesktopDatePicker/DesktopDatePicker.js +4 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +7 -4
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +4 -3
- package/DigitalClock/DigitalClock.js +4 -3
- package/MobileDatePicker/MobileDatePicker.js +4 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +4 -3
- package/MobileTimePicker/MobileTimePicker.js +4 -3
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -7
- package/PickersActionBar/PickersActionBar.js +6 -6
- package/PickersCalendarHeader/PickersCalendarHeader.js +6 -5
- package/TimeClock/Clock.js +4 -3
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/TimeClock.js +9 -8
- package/TimePicker/TimePickerToolbar.js +4 -3
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useClearableField.js +3 -3
- package/hooks/usePickersTranslations.d.ts +2 -0
- package/hooks/usePickersTranslations.js +2 -0
- package/index.js +1 -1
- package/internals/components/PickerViewRoot/PickerViewRoot.d.ts +0 -1
- package/internals/hooks/date-helpers-hooks.d.ts +1 -1
- package/internals/hooks/defaultizedFieldProps.d.ts +2 -2
- package/internals/hooks/useField/useField.d.ts +3 -3
- package/internals/hooks/useField/useField.utils.d.ts +3 -3
- package/internals/hooks/useField/useFieldState.js +6 -5
- package/internals/hooks/useField/useFieldV6TextField.js +9 -3
- package/internals/hooks/useField/useFieldV7TextField.js +6 -5
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +0 -1
- package/internals/hooks/useUtils.d.ts +0 -1
- package/internals/hooks/useUtils.js +0 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/validation/extractValidationProps.d.ts +1 -1
- package/internals/utils/views.d.ts +1 -1
- package/internals/utils/warning.d.ts +1 -1
- package/modern/DateCalendar/DayCalendar.js +7 -6
- package/modern/DatePicker/DatePickerToolbar.js +4 -3
- package/modern/DateTimePicker/DateTimePickerTabs.js +4 -4
- package/modern/DateTimePicker/DateTimePickerToolbar.js +5 -4
- package/modern/DesktopDatePicker/DesktopDatePicker.js +4 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +7 -4
- package/modern/DesktopTimePicker/DesktopTimePicker.js +4 -3
- package/modern/DigitalClock/DigitalClock.js +4 -3
- package/modern/MobileDatePicker/MobileDatePicker.js +4 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +4 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +4 -3
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -7
- package/modern/PickersActionBar/PickersActionBar.js +6 -6
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +6 -5
- package/modern/TimeClock/Clock.js +4 -3
- package/modern/TimeClock/TimeClock.js +9 -8
- package/modern/TimePicker/TimePickerToolbar.js +4 -3
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useClearableField.js +3 -3
- package/modern/hooks/usePickersTranslations.js +2 -0
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useField/useFieldState.js +6 -5
- package/modern/internals/hooks/useField/useFieldV6TextField.js +9 -3
- package/modern/internals/hooks/useField/useFieldV7TextField.js +6 -5
- package/modern/internals/hooks/useUtils.js +0 -1
- package/modern/internals/index.js +1 -1
- package/node/DateCalendar/DayCalendar.js +6 -5
- package/node/DatePicker/DatePickerToolbar.js +3 -2
- package/node/DateTimePicker/DateTimePickerTabs.js +4 -4
- package/node/DateTimePicker/DateTimePickerToolbar.js +5 -4
- package/node/DesktopDatePicker/DesktopDatePicker.js +3 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -10
- package/node/DesktopTimePicker/DesktopTimePicker.js +3 -2
- package/node/DigitalClock/DigitalClock.js +3 -2
- package/node/MobileDatePicker/MobileDatePicker.js +3 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +3 -2
- package/node/MobileTimePicker/MobileTimePicker.js +3 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
- package/node/PickersActionBar/PickersActionBar.js +6 -6
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +5 -4
- package/node/TimeClock/Clock.js +3 -2
- package/node/TimeClock/TimeClock.js +8 -7
- package/node/TimePicker/TimePickerToolbar.js +3 -2
- package/node/hooks/index.js +8 -1
- package/node/hooks/useClearableField.js +3 -3
- package/node/hooks/usePickersTranslations.js +9 -0
- package/node/index.js +1 -1
- package/node/internals/hooks/useField/useFieldState.js +5 -4
- package/node/internals/hooks/useField/useFieldV6TextField.js +9 -3
- package/node/internals/hooks/useField/useFieldV7TextField.js +5 -4
- package/node/internals/hooks/useUtils.js +1 -3
- package/node/internals/index.js +0 -6
- package/package.json +3 -3
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,171 @@
|
|
|
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
|
+
## 7.9.0
|
|
7
|
+
|
|
8
|
+
_Jul 5, 2024_
|
|
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
|
+
- 🔄 Add loading overlay variants, including a skeleton loader option to the Data Grid component. See [Loading overlay docs](https://mui.com/x/react-data-grid/overlays/#loading-overlay) for more details.
|
|
13
|
+
- 🌳 Add `selectItem` and `getItemDOMElement` methods to the TreeView component public API
|
|
14
|
+
- ⛏️ Make the `usePickersTranslations` hook public in the pickers component
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
|
|
17
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@7.9.0`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Add skeleton loading overlay support (#13293) @KenanYusuf
|
|
24
|
+
- [DataGrid] Fix pagination when `pagination={undefined}` (#13349) @sai6855
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@7.9.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@7.9.0`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@7.9.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@7.9.0`.
|
|
33
|
+
|
|
34
|
+
### Date and Time Pickers
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers@7.9.0`
|
|
37
|
+
|
|
38
|
+
- [pickers] Make the `usePickersTranslations` hook public (#13657) @flaviendelangle
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@7.9.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@7.9.0`.
|
|
43
|
+
|
|
44
|
+
### Charts
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-charts@7.9.0`
|
|
47
|
+
|
|
48
|
+
- [charts] Add Heatmap (unreleased) (#13209) @alexfauquette
|
|
49
|
+
- [charts] Add initial `Zoom&Pan` to the Pro charts (unreleased) (#13405) @JCQuintas
|
|
50
|
+
- [charts] Fix Axis Highlight on horizontal bar charts regression (#13717) @JCQuintas
|
|
51
|
+
- [charts] Improve charts interaction for mobile users (#13692) @JCQuintas
|
|
52
|
+
- [charts] Add documentation on how to disable the tooltip on charts (#13724) @JCQuintas
|
|
53
|
+
|
|
54
|
+
### Tree View
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-tree-view@7.9.0`
|
|
57
|
+
|
|
58
|
+
- [TreeView] Add `selectItem` and `getItemDOMElement` methods to the public API (#13485) @flaviendelangle
|
|
59
|
+
|
|
60
|
+
### Docs
|
|
61
|
+
|
|
62
|
+
- [docs] Fix custom "no results overlay" demo in dark mode (#13715) @KenanYusuf
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [core] Add `react_next` workflow in CircleCI (#13360) @cherniavskii
|
|
67
|
+
- [core] Create a new package to share utils across X packages (#13528) @flaviendelangle
|
|
68
|
+
- [core] Fix dependency setup (#13684) @LukasTy
|
|
69
|
+
- [core] Remove `jscodeshift-add-imports` package (#13720) @LukasTy
|
|
70
|
+
- [code-infra] Cleanup monorepo and `@mui/docs` usage (#13713) @LukasTy
|
|
71
|
+
|
|
72
|
+
## 7.8.0
|
|
73
|
+
|
|
74
|
+
_Jun 28, 2024_
|
|
75
|
+
|
|
76
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
77
|
+
|
|
78
|
+
- 🛰 Introduce server-side data source for improved server integration in the Data Grid.
|
|
79
|
+
|
|
80
|
+
Supports server-side pagination, sorting and filtering on plain and tree data, and automatic caching.
|
|
81
|
+
|
|
82
|
+
To enable, provide a `getRows` function to the `unstable_dataSource` prop on the Data Grid component.
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
const dataSource = {
|
|
86
|
+
getRows: async (params: GridServerGetRowsParams) => {
|
|
87
|
+
const data = await fetch(
|
|
88
|
+
`https://api.example.com/data?${new URLSearchParams({
|
|
89
|
+
page: params.page,
|
|
90
|
+
pageSize: params.pageSize,
|
|
91
|
+
sortModel: JSON.stringify(params.sortModel),
|
|
92
|
+
filterModel: JSON.stringify(params.filterModel),
|
|
93
|
+
}).toString()}`,
|
|
94
|
+
);
|
|
95
|
+
return {
|
|
96
|
+
rows: data.rows,
|
|
97
|
+
totalRows: data.totalRows,
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
<DataGridPro
|
|
102
|
+
unstable_dataSource={dataSource}
|
|
103
|
+
{...otherProps}
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
See [server-side data documentation](https://mui.com/x/react-data-grid/server-side-data/) for more details.
|
|
108
|
+
|
|
109
|
+
- 📈 Support Date data on the BarChart component
|
|
110
|
+
- ↕️ Support custom column sort icons on the Data Grid
|
|
111
|
+
- 🖱️ Support modifying the expansion trigger on the Tree View components
|
|
112
|
+
|
|
113
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
114
|
+
|
|
115
|
+
### Data Grid
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-data-grid@7.8.0`
|
|
118
|
+
|
|
119
|
+
- [DataGrid] Add `columnHeaderSortIcon` slot (#13563) @arminmeh
|
|
120
|
+
- [DataGrid] Fix dimensions lag issue after autosize (#13587) @MBilalShafi
|
|
121
|
+
- [DataGrid] Fix print export failure when `hideFooter` option is set (#13034) @tarunrajput
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-data-grid-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
124
|
+
|
|
125
|
+
Same changes as in `@mui/x-data-grid@7.8.0`, plus:
|
|
126
|
+
|
|
127
|
+
- [DataGridPro] Fix multi-sorting indicator being cut off (#13625) @KenanYusuf
|
|
128
|
+
- [DataGridPro] Server-side tree data support (#12317) @MBilalShafi
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-data-grid-premium@7.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-data-grid-pro@7.8.0`.
|
|
133
|
+
|
|
134
|
+
### Date and Time Pickers
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-date-pickers@7.8.0`
|
|
137
|
+
|
|
138
|
+
- [fields] Fix section clearing behavior on Android (#13652) @LukasTy
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-date-pickers-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
141
|
+
|
|
142
|
+
Same changes as in `@mui/x-date-pickers@7.8.0`.
|
|
143
|
+
|
|
144
|
+
### Charts
|
|
145
|
+
|
|
146
|
+
#### `@mui/x-charts@7.8.0`
|
|
147
|
+
|
|
148
|
+
- [charts] Fix line chart props not passing correct event handlers (#13609) @JCQuintas
|
|
149
|
+
- [charts] Support BarChart with `Date` data (#13471) @alexfauquette
|
|
150
|
+
- [charts] Support RTL for y-axis (#13614) @alexfauquette
|
|
151
|
+
- [charts] Use default values instead of non-null assertion to prevent error being thrown (#13637) @JCQuintas
|
|
152
|
+
|
|
153
|
+
### Tree View
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-tree-view@7.8.0`
|
|
156
|
+
|
|
157
|
+
- [TreeView] Add `expansionTrigger` prop (#13533) @noraleonte
|
|
158
|
+
- [TreeView] Support experimental features from plugin's dependencies (#13632) @flaviendelangle
|
|
159
|
+
|
|
160
|
+
### Docs
|
|
161
|
+
|
|
162
|
+
- [docs] Add callout for `Luxon` `throwOnInvalid` support (#13621) @LukasTy
|
|
163
|
+
- [docs] Add "Overlays" section to the Data Grid documentation (#13624) @KenanYusuf
|
|
164
|
+
|
|
165
|
+
### Core
|
|
166
|
+
|
|
167
|
+
- [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
|
|
168
|
+
- [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
|
|
169
|
+
- [license] Allow usage of charts and tree view pro package for old premium licenses (#13619) @flaviendelangle
|
|
170
|
+
|
|
6
171
|
## 7.7.1
|
|
7
172
|
|
|
8
173
|
_Jun 21, 2024_
|
|
@@ -44,7 +209,7 @@ Same changes as in `@mui/x-data-grid-pro@7.7.1`.
|
|
|
44
209
|
- [pickers] Always use the same timezone in the field, the view and the layout components (#13481) @flaviendelangle
|
|
45
210
|
- [pickers] Fix `AdapterDateFnsV3` generated method types (#13464) @alexey-kozlenkov
|
|
46
211
|
- [pickers] Fix controlled `view` behavior (#13552) @LukasTy
|
|
47
|
-
- [TimePicker] Improves RTL verification for the time pickers default views
|
|
212
|
+
- [TimePicker] Improves RTL verification for the time pickers default views (#13447) @arthurbalduini
|
|
48
213
|
|
|
49
214
|
#### `@mui/x-date-pickers-pro@7.7.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
215
|
|
|
@@ -11,7 +11,8 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
11
11
|
import { unstable_composeClasses as composeClasses, unstable_useControlled as useControlled } from '@mui/utils';
|
|
12
12
|
import clsx from 'clsx';
|
|
13
13
|
import { PickersDay } from '../PickersDay/PickersDay';
|
|
14
|
-
import {
|
|
14
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
15
|
+
import { useUtils, useNow } from '../internals/hooks/useUtils';
|
|
15
16
|
import { DAY_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';
|
|
16
17
|
import { PickersSlideTransition } from './PickersSlideTransition';
|
|
17
18
|
import { useIsDateDisabled } from './useIsDateDisabled';
|
|
@@ -261,7 +262,7 @@ export function DayCalendar(inProps) {
|
|
|
261
262
|
disableFuture,
|
|
262
263
|
timezone
|
|
263
264
|
});
|
|
264
|
-
const
|
|
265
|
+
const translations = usePickersTranslations();
|
|
265
266
|
const [internalHasFocus, setInternalHasFocus] = useControlled({
|
|
266
267
|
name: 'DayCalendar',
|
|
267
268
|
state: 'hasFocus',
|
|
@@ -403,9 +404,9 @@ export function DayCalendar(inProps) {
|
|
|
403
404
|
children: [displayWeekNumber && /*#__PURE__*/_jsx(PickersCalendarWeekNumberLabel, {
|
|
404
405
|
variant: "caption",
|
|
405
406
|
role: "columnheader",
|
|
406
|
-
"aria-label":
|
|
407
|
+
"aria-label": translations.calendarWeekNumberHeaderLabel,
|
|
407
408
|
className: classes.weekNumberLabel,
|
|
408
|
-
children:
|
|
409
|
+
children: translations.calendarWeekNumberHeaderText
|
|
409
410
|
}), getWeekdays(utils, now).map((weekday, i) => /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {
|
|
410
411
|
variant: "caption",
|
|
411
412
|
role: "columnheader",
|
|
@@ -438,8 +439,8 @@ export function DayCalendar(inProps) {
|
|
|
438
439
|
children: [displayWeekNumber && /*#__PURE__*/_jsx(PickersCalendarWeekNumber, {
|
|
439
440
|
className: classes.weekNumber,
|
|
440
441
|
role: "rowheader",
|
|
441
|
-
"aria-label":
|
|
442
|
-
children:
|
|
442
|
+
"aria-label": translations.calendarWeekNumberAriaLabelText(utils.getWeekNumber(week[0])),
|
|
443
|
+
children: translations.calendarWeekNumberText(utils.getWeekNumber(week[0]))
|
|
443
444
|
}), week.map((day, dayIndex) => /*#__PURE__*/_jsx(WrappedDay, {
|
|
444
445
|
parentProps: props,
|
|
445
446
|
day: day,
|
|
@@ -22,7 +22,7 @@ interface ChangeFocusedDayPayload<TDate extends PickerValidDate> {
|
|
|
22
22
|
*/
|
|
23
23
|
withoutMonthSwitchingAnimation?: boolean;
|
|
24
24
|
}
|
|
25
|
-
export declare const createCalendarStateReducer: <TDate extends PickerValidDate>(reduceAnimations: boolean, disableSwitchToMonthOnDayFocus: boolean, utils: MuiPickersAdapter<TDate>) => (state: CalendarState<TDate>, action: ReducerAction<
|
|
25
|
+
export declare const createCalendarStateReducer: <TDate extends PickerValidDate>(reduceAnimations: boolean, disableSwitchToMonthOnDayFocus: boolean, utils: MuiPickersAdapter<TDate>) => (state: CalendarState<TDate>, action: ReducerAction<"finishMonthSwitchingAnimation"> | ReducerAction<"changeMonth", ChangeMonthPayload<TDate>> | ReducerAction<"changeFocusedDay", ChangeFocusedDayPayload<TDate>>) => CalendarState<TDate>;
|
|
26
26
|
interface UseCalendarStateParams<TDate extends PickerValidDate> extends Pick<DateCalendarDefaultizedProps<TDate>, 'value' | 'referenceDate' | 'disableFuture' | 'disablePast' | 'minDate' | 'maxDate' | 'onMonthChange' | 'reduceAnimations' | 'shouldDisableDate'> {
|
|
27
27
|
disableSwitchToMonthOnDayFocus?: boolean;
|
|
28
28
|
timezone: PickersTimezone;
|
|
@@ -8,7 +8,8 @@ import Typography from '@mui/material/Typography';
|
|
|
8
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
10
10
|
import { PickersToolbar } from '../internals/components/PickersToolbar';
|
|
11
|
-
import {
|
|
11
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
12
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
12
13
|
import { getDatePickerToolbarUtilityClass } from './datePickerToolbarClasses';
|
|
13
14
|
import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -66,7 +67,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
66
67
|
} = props,
|
|
67
68
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
68
69
|
const utils = useUtils();
|
|
69
|
-
const
|
|
70
|
+
const translations = usePickersTranslations();
|
|
70
71
|
const classes = useUtilityClasses(props);
|
|
71
72
|
const dateText = React.useMemo(() => {
|
|
72
73
|
if (!value) {
|
|
@@ -81,7 +82,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
81
82
|
const ownerState = props;
|
|
82
83
|
return /*#__PURE__*/_jsx(DatePickerToolbarRoot, _extends({
|
|
83
84
|
ref: ref,
|
|
84
|
-
toolbarTitle:
|
|
85
|
+
toolbarTitle: translations.datePickerToolbarTitle,
|
|
85
86
|
isLandscape: isLandscape,
|
|
86
87
|
className: clsx(classes.root, className)
|
|
87
88
|
}, other, {
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
3
3
|
import { DateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
4
4
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
5
|
+
import { PickerValidDate } from '../models';
|
|
5
6
|
export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
6
7
|
/**
|
|
7
8
|
* Toggles visibility of the tabs allowing view switching.
|
|
@@ -36,7 +37,7 @@ export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps
|
|
|
36
37
|
* - [DateTimePickerTabs API](https://mui.com/x/api/date-pickers/date-time-picker-tabs/)
|
|
37
38
|
*/
|
|
38
39
|
declare const DateTimePickerTabs: {
|
|
39
|
-
(inProps: DateTimePickerTabsProps): React.JSX.Element | null;
|
|
40
|
+
<TDate extends PickerValidDate>(inProps: DateTimePickerTabsProps): React.JSX.Element | null;
|
|
40
41
|
propTypes: any;
|
|
41
42
|
};
|
|
42
43
|
export { DateTimePickerTabs };
|
|
@@ -6,7 +6,7 @@ import Tabs, { tabsClasses } from '@mui/material/Tabs';
|
|
|
6
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { TimeIcon, DateRangeIcon } from '../icons';
|
|
9
|
-
import {
|
|
9
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
10
10
|
import { getDateTimePickerTabsUtilityClass } from './dateTimePickerTabsClasses';
|
|
11
11
|
import { isDatePickerView } from '../internals/utils/date-utils';
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -72,7 +72,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
72
72
|
className,
|
|
73
73
|
sx
|
|
74
74
|
} = props;
|
|
75
|
-
const
|
|
75
|
+
const translations = usePickersTranslations();
|
|
76
76
|
const classes = useUtilityClasses(props);
|
|
77
77
|
const handleChange = (event, value) => {
|
|
78
78
|
onViewChange(tabToView(value));
|
|
@@ -89,13 +89,13 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
89
89
|
sx: sx,
|
|
90
90
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
91
91
|
value: "date",
|
|
92
|
-
"aria-label":
|
|
92
|
+
"aria-label": translations.dateTableLabel,
|
|
93
93
|
icon: /*#__PURE__*/_jsx(React.Fragment, {
|
|
94
94
|
children: dateIcon
|
|
95
95
|
})
|
|
96
96
|
}), /*#__PURE__*/_jsx(Tab, {
|
|
97
97
|
value: "time",
|
|
98
|
-
"aria-label":
|
|
98
|
+
"aria-label": translations.timeTableLabel,
|
|
99
99
|
icon: /*#__PURE__*/_jsx(React.Fragment, {
|
|
100
100
|
children: timeIcon
|
|
101
101
|
})
|
|
@@ -10,13 +10,14 @@ import clsx from 'clsx';
|
|
|
10
10
|
import { PickersToolbarText } from '../internals/components/PickersToolbarText';
|
|
11
11
|
import { PickersToolbar } from '../internals/components/PickersToolbar';
|
|
12
12
|
import { PickersToolbarButton } from '../internals/components/PickersToolbarButton';
|
|
13
|
-
import {
|
|
13
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
14
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
14
15
|
import { dateTimePickerToolbarClasses, getDateTimePickerToolbarUtilityClass } from './dateTimePickerToolbarClasses';
|
|
15
16
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
16
17
|
import { MULTI_SECTION_CLOCK_SECTION_WIDTH } from '../internals/constants/dimensions';
|
|
17
18
|
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
18
19
|
import { pickersToolbarTextClasses } from '../internals/components/pickersToolbarTextClasses';
|
|
19
|
-
import { pickersToolbarClasses } from '../internals';
|
|
20
|
+
import { pickersToolbarClasses } from '../internals/components/pickersToolbarClasses';
|
|
20
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const useUtilityClasses = ownerState => {
|
|
22
23
|
const {
|
|
@@ -241,9 +242,9 @@ function DateTimePickerToolbar(inProps) {
|
|
|
241
242
|
} = useMeridiemMode(value, ampm, onChange);
|
|
242
243
|
const showAmPmControl = Boolean(ampm && !ampmInClock);
|
|
243
244
|
const isDesktop = toolbarVariant === 'desktop';
|
|
244
|
-
const
|
|
245
|
+
const translations = usePickersTranslations();
|
|
245
246
|
const classes = useUtilityClasses(ownerState);
|
|
246
|
-
const toolbarTitle = inToolbarTitle ??
|
|
247
|
+
const toolbarTitle = inToolbarTitle ?? translations.dateTimePickerToolbarTitle;
|
|
247
248
|
const formatHours = time => ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');
|
|
248
249
|
const dateText = React.useMemo(() => {
|
|
249
250
|
if (!value) {
|
|
@@ -5,7 +5,8 @@ import { resolveComponentProps } from '@mui/base/utils';
|
|
|
5
5
|
import { refType } from '@mui/utils';
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
|
|
8
|
-
import {
|
|
8
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
9
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
9
10
|
import { validateDate } from '../internals/utils/validation/validateDate';
|
|
10
11
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
11
12
|
import { CalendarIcon } from '../icons';
|
|
@@ -24,7 +25,7 @@ import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
|
24
25
|
* - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)
|
|
25
26
|
*/
|
|
26
27
|
const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {
|
|
27
|
-
const
|
|
28
|
+
const translations = usePickersTranslations();
|
|
28
29
|
const utils = useUtils();
|
|
29
30
|
|
|
30
31
|
// Props with the default values common to all date pickers
|
|
@@ -59,7 +60,7 @@ const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePick
|
|
|
59
60
|
props,
|
|
60
61
|
valueManager: singleItemValueManager,
|
|
61
62
|
valueType: 'date',
|
|
62
|
-
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ??
|
|
63
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
|
|
63
64
|
validator: validateDate
|
|
64
65
|
});
|
|
65
66
|
return renderPicker();
|
|
@@ -10,17 +10,20 @@ import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
|
10
10
|
import { DateTimeField } from '../DateTimeField';
|
|
11
11
|
import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
|
|
12
12
|
import { renderDateViewCalendar } from '../dateViewRenderers/dateViewRenderers';
|
|
13
|
-
import {
|
|
13
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
14
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
14
15
|
import { validateDateTime } from '../internals/utils/validation/validateDateTime';
|
|
15
16
|
import { CalendarIcon } from '../icons';
|
|
16
17
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
17
18
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
18
19
|
import { resolveDateTimeFormat, resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
19
20
|
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
20
|
-
import { VIEW_HEIGHT, isDatePickerView, isInternalTimeView } from '../internals';
|
|
21
21
|
import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from '../MultiSectionDigitalClock';
|
|
22
22
|
import { digitalClockClasses } from '../DigitalClock';
|
|
23
23
|
import { DesktopDateTimePickerLayout } from './DesktopDateTimePickerLayout';
|
|
24
|
+
import { VIEW_HEIGHT } from '../internals/constants/dimensions';
|
|
25
|
+
import { isInternalTimeView } from '../internals/utils/time-utils';
|
|
26
|
+
import { isDatePickerView } from '../internals/utils/date-utils';
|
|
24
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
28
|
const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
|
|
26
29
|
const {
|
|
@@ -78,7 +81,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
|
|
|
78
81
|
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
79
82
|
*/
|
|
80
83
|
const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
|
|
81
|
-
const
|
|
84
|
+
const translations = usePickersTranslations();
|
|
82
85
|
const utils = useUtils();
|
|
83
86
|
|
|
84
87
|
// Props with the default values common to all date time pickers
|
|
@@ -143,7 +146,7 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
143
146
|
props,
|
|
144
147
|
valueManager: singleItemValueManager,
|
|
145
148
|
valueType: 'date-time',
|
|
146
|
-
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ??
|
|
149
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
|
|
147
150
|
validator: validateDateTime,
|
|
148
151
|
rendererInterceptor
|
|
149
152
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PickersLayoutProps } from '../PickersLayout';
|
|
3
3
|
import { PickerValidDate } from '../models';
|
|
4
|
-
import { DateOrTimeViewWithMeridiem } from '../internals';
|
|
4
|
+
import { DateOrTimeViewWithMeridiem } from '../internals/models/common';
|
|
5
5
|
/**
|
|
6
6
|
* @ignore - internal component.
|
|
7
7
|
*/
|
|
@@ -6,7 +6,8 @@ import { refType } from '@mui/utils';
|
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { TimeField } from '../TimeField';
|
|
8
8
|
import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
|
|
9
|
-
import {
|
|
9
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
10
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
10
11
|
import { validateTime } from '../internals/utils/validation/validateTime';
|
|
11
12
|
import { ClockIcon } from '../icons';
|
|
12
13
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
@@ -25,7 +26,7 @@ import { resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
|
25
26
|
* - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
|
|
26
27
|
*/
|
|
27
28
|
const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
|
|
28
|
-
const
|
|
29
|
+
const translations = usePickersTranslations();
|
|
29
30
|
const utils = useUtils();
|
|
30
31
|
|
|
31
32
|
// Props with the default values common to all time pickers
|
|
@@ -80,7 +81,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
|
|
|
80
81
|
props,
|
|
81
82
|
valueManager: singleItemValueManager,
|
|
82
83
|
valueType: 'time',
|
|
83
|
-
getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ??
|
|
84
|
+
getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ?? translations.openTimePickerDialogue,
|
|
84
85
|
validator: validateTime
|
|
85
86
|
});
|
|
86
87
|
return renderPicker();
|
|
@@ -11,7 +11,8 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
11
11
|
import MenuItem from '@mui/material/MenuItem';
|
|
12
12
|
import MenuList from '@mui/material/MenuList';
|
|
13
13
|
import useForkRef from '@mui/utils/useForkRef';
|
|
14
|
-
import {
|
|
14
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
15
|
+
import { useUtils, useNow } from '../internals/hooks/useUtils';
|
|
15
16
|
import { createIsAfterIgnoreDatePart } from '../internals/utils/time-utils';
|
|
16
17
|
import { PickerViewRoot } from '../internals/components/PickerViewRoot';
|
|
17
18
|
import { getDigitalClockUtilityClass } from './digitalClockClasses';
|
|
@@ -147,7 +148,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
147
148
|
onChange,
|
|
148
149
|
valueManager: singleItemValueManager
|
|
149
150
|
});
|
|
150
|
-
const
|
|
151
|
+
const translations = usePickersTranslations();
|
|
151
152
|
const now = useNow(timezone);
|
|
152
153
|
const ownerState = React.useMemo(() => _extends({}, props, {
|
|
153
154
|
alreadyRendered: !!containerRef.current
|
|
@@ -240,7 +241,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
240
241
|
}, other, {
|
|
241
242
|
children: /*#__PURE__*/_jsx(DigitalClockList, {
|
|
242
243
|
role: "listbox",
|
|
243
|
-
"aria-label":
|
|
244
|
+
"aria-label": translations.timePickerToolbarTitle,
|
|
244
245
|
className: classes.list,
|
|
245
246
|
children: timeOptions.map((option, index) => {
|
|
246
247
|
if (skipDisabled && isTimeDisabled(option)) {
|
|
@@ -5,7 +5,8 @@ import { resolveComponentProps } from '@mui/base/utils';
|
|
|
5
5
|
import { refType } from '@mui/utils';
|
|
6
6
|
import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
7
7
|
import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
|
|
8
|
-
import {
|
|
8
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
9
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
9
10
|
import { validateDate } from '../internals/utils/validation/validateDate';
|
|
10
11
|
import { DateField } from '../DateField';
|
|
11
12
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
@@ -23,7 +24,7 @@ import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
|
23
24
|
* - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
|
|
24
25
|
*/
|
|
25
26
|
const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
|
|
26
|
-
const
|
|
27
|
+
const translations = usePickersTranslations();
|
|
27
28
|
const utils = useUtils();
|
|
28
29
|
|
|
29
30
|
// Props with the default values common to all date pickers
|
|
@@ -56,7 +57,7 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
|
|
|
56
57
|
props,
|
|
57
58
|
valueManager: singleItemValueManager,
|
|
58
59
|
valueType: 'date',
|
|
59
|
-
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ??
|
|
60
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
|
|
60
61
|
validator: validateDate
|
|
61
62
|
});
|
|
62
63
|
return renderPicker();
|
|
@@ -6,7 +6,8 @@ import { refType } from '@mui/utils';
|
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { DateTimeField } from '../DateTimeField';
|
|
8
8
|
import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
|
|
9
|
-
import {
|
|
9
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
10
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
10
11
|
import { validateDateTime } from '../internals/utils/validation/validateDateTime';
|
|
11
12
|
import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
12
13
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
@@ -24,7 +25,7 @@ import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
|
24
25
|
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
25
26
|
*/
|
|
26
27
|
const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
|
|
27
|
-
const
|
|
28
|
+
const translations = usePickersTranslations();
|
|
28
29
|
const utils = useUtils();
|
|
29
30
|
|
|
30
31
|
// Props with the default values common to all date time pickers
|
|
@@ -66,7 +67,7 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
66
67
|
props,
|
|
67
68
|
valueManager: singleItemValueManager,
|
|
68
69
|
valueType: 'date-time',
|
|
69
|
-
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ??
|
|
70
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? translations.openDatePickerDialogue,
|
|
70
71
|
validator: validateDateTime
|
|
71
72
|
});
|
|
72
73
|
return renderPicker();
|
|
@@ -6,7 +6,8 @@ import { refType } from '@mui/utils';
|
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { TimeField } from '../TimeField';
|
|
8
8
|
import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
|
|
9
|
-
import {
|
|
9
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
10
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
10
11
|
import { validateTime } from '../internals/utils/validation/validateTime';
|
|
11
12
|
import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
12
13
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
@@ -23,7 +24,7 @@ import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
|
23
24
|
* - [MobileTimePicker API](https://mui.com/x/api/date-pickers/mobile-time-picker/)
|
|
24
25
|
*/
|
|
25
26
|
const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
26
|
-
const
|
|
27
|
+
const translations = usePickersTranslations();
|
|
27
28
|
const utils = useUtils();
|
|
28
29
|
|
|
29
30
|
// Props with the default values common to all time pickers
|
|
@@ -59,7 +60,7 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
|
|
|
59
60
|
props,
|
|
60
61
|
valueManager: singleItemValueManager,
|
|
61
62
|
valueType: 'time',
|
|
62
|
-
getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ??
|
|
63
|
+
getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ?? translations.openTimePickerDialogue,
|
|
63
64
|
validator: validateTime
|
|
64
65
|
});
|
|
65
66
|
return renderPicker();
|
|
@@ -8,7 +8,8 @@ import { useRtl } from '@mui/system/RtlProvider';
|
|
|
8
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
|
-
import {
|
|
11
|
+
import { usePickersTranslations } from '../hooks/usePickersTranslations';
|
|
12
|
+
import { useUtils, useNow } from '../internals/hooks/useUtils';
|
|
12
13
|
import { convertValueToMeridiem, createIsAfterIgnoreDatePart } from '../internals/utils/time-utils';
|
|
13
14
|
import { useViews } from '../internals/hooks/useViews';
|
|
14
15
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
@@ -101,7 +102,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
101
102
|
onChange,
|
|
102
103
|
valueManager: singleItemValueManager
|
|
103
104
|
});
|
|
104
|
-
const
|
|
105
|
+
const translations = usePickersTranslations();
|
|
105
106
|
const now = useNow(timezone);
|
|
106
107
|
const timeSteps = React.useMemo(() => _extends({
|
|
107
108
|
hours: 1,
|
|
@@ -233,7 +234,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
233
234
|
utils,
|
|
234
235
|
isDisabled: hours => isTimeDisabled(hours, 'hours'),
|
|
235
236
|
timeStep: timeSteps.hours,
|
|
236
|
-
resolveAriaLabel:
|
|
237
|
+
resolveAriaLabel: translations.hoursClockNumberText,
|
|
237
238
|
valueOrReferenceDate
|
|
238
239
|
})
|
|
239
240
|
};
|
|
@@ -251,7 +252,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
251
252
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
252
253
|
timeStep: timeSteps.minutes,
|
|
253
254
|
hasValue: !!value,
|
|
254
|
-
resolveAriaLabel:
|
|
255
|
+
resolveAriaLabel: translations.minutesClockNumberText
|
|
255
256
|
})
|
|
256
257
|
};
|
|
257
258
|
}
|
|
@@ -268,7 +269,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
268
269
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
269
270
|
timeStep: timeSteps.seconds,
|
|
270
271
|
hasValue: !!value,
|
|
271
|
-
resolveAriaLabel:
|
|
272
|
+
resolveAriaLabel: translations.secondsClockNumberText
|
|
272
273
|
})
|
|
273
274
|
};
|
|
274
275
|
}
|
|
@@ -296,7 +297,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
296
297
|
default:
|
|
297
298
|
throw new Error(`Unknown view: ${viewToBuild} found.`);
|
|
298
299
|
}
|
|
299
|
-
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds,
|
|
300
|
+
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, translations.hoursClockNumberText, translations.minutesClockNumberText, translations.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate, isTimeDisabled, handleMeridiemChange]);
|
|
300
301
|
const viewsToRender = React.useMemo(() => {
|
|
301
302
|
if (!isRtl) {
|
|
302
303
|
return views;
|
|
@@ -333,7 +334,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
333
334
|
slots: slots,
|
|
334
335
|
slotProps: slotProps,
|
|
335
336
|
skipDisabled: skipDisabled,
|
|
336
|
-
"aria-label":
|
|
337
|
+
"aria-label": translations.selectViewText(timeView)
|
|
337
338
|
}, timeView))
|
|
338
339
|
}));
|
|
339
340
|
});
|