@mui/x-date-pickers-pro 7.8.0 → 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/CHANGELOG.md +66 -0
- package/DateRangePicker/DateRangePickerToolbar.js +6 -5
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +2 -1
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +5 -4
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +5 -4
- package/index.js +1 -1
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +5 -4
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -3
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/DateRangePicker/DateRangePickerToolbar.js +6 -5
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +5 -4
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +5 -4
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +5 -4
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -3
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/DateRangePicker/DateRangePickerToolbar.js +5 -4
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +9 -8
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -3
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +4 -3
- package/node/index.js +1 -1
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -3
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -2
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,72 @@
|
|
|
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
|
+
|
|
6
72
|
## 7.8.0
|
|
7
73
|
|
|
8
74
|
_Jun 28, 2024_
|
|
@@ -7,7 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
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
|
-
import { PickersToolbar, PickersToolbarButton, useUtils
|
|
10
|
+
import { PickersToolbar, PickersToolbarButton, useUtils } from '@mui/x-date-pickers/internals';
|
|
11
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
11
12
|
import { getDateRangePickerToolbarUtilityClass } from './dateRangePickerToolbarClasses';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
const useUtilityClasses = ownerState => {
|
|
@@ -57,13 +58,13 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
57
58
|
className
|
|
58
59
|
} = props,
|
|
59
60
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60
|
-
const
|
|
61
|
-
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) :
|
|
62
|
-
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) :
|
|
61
|
+
const translations = usePickersTranslations();
|
|
62
|
+
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : translations.start;
|
|
63
|
+
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : translations.end;
|
|
63
64
|
const ownerState = props;
|
|
64
65
|
const classes = useUtilityClasses(ownerState);
|
|
65
66
|
return /*#__PURE__*/_jsx(DateRangePickerToolbarRoot, _extends({}, other, {
|
|
66
|
-
toolbarTitle:
|
|
67
|
+
toolbarTitle: translations.dateRangePickerToolbarTitle,
|
|
67
68
|
isLandscape: false,
|
|
68
69
|
className: clsx(className, classes.root),
|
|
69
70
|
ownerState: ownerState,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
3
|
import { DateOrTimeViewWithMeridiem, BaseTabsProps, ExportedBaseTabsProps } from '@mui/x-date-pickers/internals';
|
|
3
4
|
import { DateTimeRangePickerTabsClasses } from './dateTimeRangePickerTabsClasses';
|
|
4
5
|
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
@@ -26,7 +27,7 @@ export interface ExportedDateTimeRangePickerTabsProps extends ExportedBaseTabsPr
|
|
|
26
27
|
export interface DateTimeRangePickerTabsProps extends ExportedDateTimeRangePickerTabsProps, BaseTabsProps<DateOrTimeViewWithMeridiem>, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
|
|
27
28
|
}
|
|
28
29
|
declare const DateTimeRangePickerTabs: {
|
|
29
|
-
(inProps: DateTimeRangePickerTabsProps): React.JSX.Element | null;
|
|
30
|
+
<TDate extends PickerValidDate>(inProps: DateTimeRangePickerTabsProps): React.JSX.Element | null;
|
|
30
31
|
propTypes: any;
|
|
31
32
|
};
|
|
32
33
|
export { DateTimeRangePickerTabs };
|
|
@@ -5,7 +5,8 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import { TimeIcon, DateRangeIcon, ArrowLeftIcon, ArrowRightIcon } from '@mui/x-date-pickers/icons';
|
|
8
|
-
import {
|
|
8
|
+
import { isDatePickerView } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
10
|
import IconButton from '@mui/material/IconButton';
|
|
10
11
|
import Button from '@mui/material/Button';
|
|
11
12
|
import { getDateTimeRangePickerTabsUtilityClass } from './dateTimeRangePickerTabsClasses';
|
|
@@ -78,7 +79,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
78
79
|
className,
|
|
79
80
|
sx
|
|
80
81
|
} = props;
|
|
81
|
-
const
|
|
82
|
+
const translations = usePickersTranslations();
|
|
82
83
|
const classes = useUtilityClasses(props);
|
|
83
84
|
const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
|
|
84
85
|
const isPreviousHidden = value === 'start-date';
|
|
@@ -86,17 +87,17 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
86
87
|
const tabLabel = React.useMemo(() => {
|
|
87
88
|
switch (value) {
|
|
88
89
|
case 'start-date':
|
|
89
|
-
return
|
|
90
|
+
return translations.startDate;
|
|
90
91
|
case 'start-time':
|
|
91
|
-
return
|
|
92
|
+
return translations.startTime;
|
|
92
93
|
case 'end-date':
|
|
93
|
-
return
|
|
94
|
+
return translations.endDate;
|
|
94
95
|
case 'end-time':
|
|
95
|
-
return
|
|
96
|
+
return translations.endTime;
|
|
96
97
|
default:
|
|
97
98
|
return '';
|
|
98
99
|
}
|
|
99
|
-
}, [
|
|
100
|
+
}, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
|
|
100
101
|
const handleRangePositionChange = useEventCallback(newTab => {
|
|
101
102
|
if (newTab.includes('start')) {
|
|
102
103
|
onRangePositionChange('start');
|
|
@@ -124,7 +125,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
124
125
|
children: [!isPreviousHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
125
126
|
onClick: changeToPreviousTab,
|
|
126
127
|
className: classes.navigationButton,
|
|
127
|
-
title:
|
|
128
|
+
title: translations.openPreviousView,
|
|
128
129
|
children: /*#__PURE__*/_jsx(ArrowLeftIcon, {})
|
|
129
130
|
}) : /*#__PURE__*/_jsx(DateTimeRangePickerTabFiller, {
|
|
130
131
|
className: classes.filler
|
|
@@ -136,7 +137,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
136
137
|
}), !isNextHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
137
138
|
onClick: changeToNextTab,
|
|
138
139
|
className: classes.navigationButton,
|
|
139
|
-
title:
|
|
140
|
+
title: translations.openNextView,
|
|
140
141
|
children: /*#__PURE__*/_jsx(ArrowRightIcon, {})
|
|
141
142
|
}) : /*#__PURE__*/_jsx(DateTimeRangePickerTabFiller, {
|
|
142
143
|
className: classes.filler
|
|
@@ -6,7 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
|
-
import {
|
|
9
|
+
import { useUtils } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
11
|
import { DateTimePickerToolbar } from '@mui/x-date-pickers/DateTimePicker';
|
|
11
12
|
import { getDateTimeRangePickerToolbarUtilityClass } from './dateTimeRangePickerToolbarClasses';
|
|
12
13
|
import { calculateRangeChange } from '../internals/utils/date-range-manager';
|
|
@@ -102,7 +103,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
102
103
|
toolbarFormat,
|
|
103
104
|
toolbarPlaceholder
|
|
104
105
|
};
|
|
105
|
-
const
|
|
106
|
+
const translations = usePickersTranslations();
|
|
106
107
|
const ownerState = props;
|
|
107
108
|
const classes = useUtilityClasses(ownerState);
|
|
108
109
|
const handleStartRangeViewChange = React.useCallback(newView => {
|
|
@@ -149,7 +150,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
149
150
|
children: [/*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
|
|
150
151
|
value: start,
|
|
151
152
|
onViewChange: handleStartRangeViewChange,
|
|
152
|
-
toolbarTitle:
|
|
153
|
+
toolbarTitle: translations.start,
|
|
153
154
|
ownerState: ownerState,
|
|
154
155
|
toolbarVariant: "desktop",
|
|
155
156
|
view: rangePosition === 'start' ? view : undefined,
|
|
@@ -159,7 +160,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
159
160
|
}, commonToolbarProps)), /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
|
|
160
161
|
value: end,
|
|
161
162
|
onViewChange: handleEndRangeViewChange,
|
|
162
|
-
toolbarTitle:
|
|
163
|
+
toolbarTitle: translations.end,
|
|
163
164
|
ownerState: ownerState,
|
|
164
165
|
toolbarVariant: "desktop",
|
|
165
166
|
view: rangePosition === 'end' ? view : undefined,
|
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
8
|
-
import { PickersArrowSwitcher,
|
|
8
|
+
import { PickersArrowSwitcher, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSwitcher)({
|
|
11
12
|
padding: '12px 16px 4px 16px',
|
|
@@ -15,7 +16,7 @@ const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSw
|
|
|
15
16
|
});
|
|
16
17
|
const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersRangeCalendarHeader(props, ref) {
|
|
17
18
|
const utils = useUtils();
|
|
18
|
-
const
|
|
19
|
+
const translations = usePickersTranslations();
|
|
19
20
|
const {
|
|
20
21
|
calendars,
|
|
21
22
|
month,
|
|
@@ -59,10 +60,10 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
|
|
|
59
60
|
onGoToNext: selectNextMonth,
|
|
60
61
|
isPreviousHidden: monthIndex !== 0,
|
|
61
62
|
isPreviousDisabled: isPreviousMonthDisabled,
|
|
62
|
-
previousLabel:
|
|
63
|
+
previousLabel: translations.previousMonth,
|
|
63
64
|
isNextHidden: monthIndex !== calendars - 1,
|
|
64
65
|
isNextDisabled: isNextMonthDisabled,
|
|
65
|
-
nextLabel:
|
|
66
|
+
nextLabel: translations.nextMonth,
|
|
66
67
|
slots: slots,
|
|
67
68
|
slotProps: slotProps,
|
|
68
69
|
labelId: labelId,
|
package/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import useForkRef from '@mui/utils/useForkRef';
|
|
8
|
-
import {
|
|
8
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
|
+
import { onSpaceOrEnter } from '@mui/x-date-pickers/internals';
|
|
9
10
|
const useMultiInputFieldSlotProps = ({
|
|
10
11
|
wrapperVariant,
|
|
11
12
|
open,
|
|
@@ -27,7 +28,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
27
28
|
startFieldRef,
|
|
28
29
|
endFieldRef
|
|
29
30
|
}) => {
|
|
30
|
-
const
|
|
31
|
+
const translations = usePickersTranslations();
|
|
31
32
|
const handleStartFieldRef = useForkRef(fieldProps.unstableStartFieldRef, startFieldRef);
|
|
32
33
|
const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
|
|
33
34
|
const previousRangePosition = React.useRef(rangePosition);
|
|
@@ -91,7 +92,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
91
92
|
let InputProps;
|
|
92
93
|
if (ownerState.position === 'start') {
|
|
93
94
|
textFieldProps = _extends({
|
|
94
|
-
label: inLocaleText?.start ??
|
|
95
|
+
label: inLocaleText?.start ?? translations.start,
|
|
95
96
|
onKeyDown: onSpaceOrEnter(openRangeStartSelection),
|
|
96
97
|
onFocus: handleFocusStart,
|
|
97
98
|
focused: open ? rangePosition === 'start' : undefined
|
|
@@ -107,7 +108,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
107
108
|
}
|
|
108
109
|
} else {
|
|
109
110
|
textFieldProps = _extends({
|
|
110
|
-
label: inLocaleText?.end ??
|
|
111
|
+
label: inLocaleText?.end ?? translations.end,
|
|
111
112
|
onKeyDown: onSpaceOrEnter(openRangeEndSelection),
|
|
112
113
|
onFocus: handleFocusEnd,
|
|
113
114
|
focused: open ? rangePosition === 'end' : undefined
|
|
@@ -6,7 +6,8 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
6
6
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
7
7
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
8
8
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
9
|
-
import { usePicker, PickersModalDialog
|
|
9
|
+
import { usePicker, PickersModalDialog } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
11
|
import useId from '@mui/utils/useId';
|
|
11
12
|
import { useEnrichedRangePickerFieldProps } from '../useEnrichedRangePickerFieldProps';
|
|
12
13
|
import { getReleaseInfo } from '../../utils/releaseInfo';
|
|
@@ -46,7 +47,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
46
47
|
onRangePositionChange
|
|
47
48
|
} = useRangePosition(props, fieldType === 'single-input' ? startFieldRef : undefined);
|
|
48
49
|
const labelId = useId();
|
|
49
|
-
const
|
|
50
|
+
const contextTranslations = usePickersTranslations();
|
|
50
51
|
const {
|
|
51
52
|
open,
|
|
52
53
|
actions,
|
|
@@ -115,7 +116,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
115
116
|
})
|
|
116
117
|
});
|
|
117
118
|
const Layout = slots?.layout ?? PickersLayout;
|
|
118
|
-
const finalLocaleText = _extends({},
|
|
119
|
+
const finalLocaleText = _extends({}, contextTranslations, localeText);
|
|
119
120
|
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
120
121
|
if (isToolbarHidden) {
|
|
121
122
|
const labels = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyMDEyNjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -7,7 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
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
|
-
import { PickersToolbar, PickersToolbarButton, useUtils
|
|
10
|
+
import { PickersToolbar, PickersToolbarButton, useUtils } from '@mui/x-date-pickers/internals';
|
|
11
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
11
12
|
import { getDateRangePickerToolbarUtilityClass } from './dateRangePickerToolbarClasses';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
const useUtilityClasses = ownerState => {
|
|
@@ -57,13 +58,13 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
57
58
|
className
|
|
58
59
|
} = props,
|
|
59
60
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60
|
-
const
|
|
61
|
-
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) :
|
|
62
|
-
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) :
|
|
61
|
+
const translations = usePickersTranslations();
|
|
62
|
+
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : translations.start;
|
|
63
|
+
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : translations.end;
|
|
63
64
|
const ownerState = props;
|
|
64
65
|
const classes = useUtilityClasses(ownerState);
|
|
65
66
|
return /*#__PURE__*/_jsx(DateRangePickerToolbarRoot, _extends({}, other, {
|
|
66
|
-
toolbarTitle:
|
|
67
|
+
toolbarTitle: translations.dateRangePickerToolbarTitle,
|
|
67
68
|
isLandscape: false,
|
|
68
69
|
className: clsx(className, classes.root),
|
|
69
70
|
ownerState: ownerState,
|
|
@@ -5,7 +5,8 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import { TimeIcon, DateRangeIcon, ArrowLeftIcon, ArrowRightIcon } from '@mui/x-date-pickers/icons';
|
|
8
|
-
import {
|
|
8
|
+
import { isDatePickerView } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
10
|
import IconButton from '@mui/material/IconButton';
|
|
10
11
|
import Button from '@mui/material/Button';
|
|
11
12
|
import { getDateTimeRangePickerTabsUtilityClass } from './dateTimeRangePickerTabsClasses';
|
|
@@ -78,7 +79,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
78
79
|
className,
|
|
79
80
|
sx
|
|
80
81
|
} = props;
|
|
81
|
-
const
|
|
82
|
+
const translations = usePickersTranslations();
|
|
82
83
|
const classes = useUtilityClasses(props);
|
|
83
84
|
const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
|
|
84
85
|
const isPreviousHidden = value === 'start-date';
|
|
@@ -86,17 +87,17 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
86
87
|
const tabLabel = React.useMemo(() => {
|
|
87
88
|
switch (value) {
|
|
88
89
|
case 'start-date':
|
|
89
|
-
return
|
|
90
|
+
return translations.startDate;
|
|
90
91
|
case 'start-time':
|
|
91
|
-
return
|
|
92
|
+
return translations.startTime;
|
|
92
93
|
case 'end-date':
|
|
93
|
-
return
|
|
94
|
+
return translations.endDate;
|
|
94
95
|
case 'end-time':
|
|
95
|
-
return
|
|
96
|
+
return translations.endTime;
|
|
96
97
|
default:
|
|
97
98
|
return '';
|
|
98
99
|
}
|
|
99
|
-
}, [
|
|
100
|
+
}, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
|
|
100
101
|
const handleRangePositionChange = useEventCallback(newTab => {
|
|
101
102
|
if (newTab.includes('start')) {
|
|
102
103
|
onRangePositionChange('start');
|
|
@@ -124,7 +125,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
124
125
|
children: [!isPreviousHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
125
126
|
onClick: changeToPreviousTab,
|
|
126
127
|
className: classes.navigationButton,
|
|
127
|
-
title:
|
|
128
|
+
title: translations.openPreviousView,
|
|
128
129
|
children: /*#__PURE__*/_jsx(ArrowLeftIcon, {})
|
|
129
130
|
}) : /*#__PURE__*/_jsx(DateTimeRangePickerTabFiller, {
|
|
130
131
|
className: classes.filler
|
|
@@ -136,7 +137,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
136
137
|
}), !isNextHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
137
138
|
onClick: changeToNextTab,
|
|
138
139
|
className: classes.navigationButton,
|
|
139
|
-
title:
|
|
140
|
+
title: translations.openNextView,
|
|
140
141
|
children: /*#__PURE__*/_jsx(ArrowRightIcon, {})
|
|
141
142
|
}) : /*#__PURE__*/_jsx(DateTimeRangePickerTabFiller, {
|
|
142
143
|
className: classes.filler
|
|
@@ -6,7 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
|
-
import {
|
|
9
|
+
import { useUtils } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
11
|
import { DateTimePickerToolbar } from '@mui/x-date-pickers/DateTimePicker';
|
|
11
12
|
import { getDateTimeRangePickerToolbarUtilityClass } from './dateTimeRangePickerToolbarClasses';
|
|
12
13
|
import { calculateRangeChange } from '../internals/utils/date-range-manager';
|
|
@@ -102,7 +103,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
102
103
|
toolbarFormat,
|
|
103
104
|
toolbarPlaceholder
|
|
104
105
|
};
|
|
105
|
-
const
|
|
106
|
+
const translations = usePickersTranslations();
|
|
106
107
|
const ownerState = props;
|
|
107
108
|
const classes = useUtilityClasses(ownerState);
|
|
108
109
|
const handleStartRangeViewChange = React.useCallback(newView => {
|
|
@@ -149,7 +150,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
149
150
|
children: [/*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
|
|
150
151
|
value: start,
|
|
151
152
|
onViewChange: handleStartRangeViewChange,
|
|
152
|
-
toolbarTitle:
|
|
153
|
+
toolbarTitle: translations.start,
|
|
153
154
|
ownerState: ownerState,
|
|
154
155
|
toolbarVariant: "desktop",
|
|
155
156
|
view: rangePosition === 'start' ? view : undefined,
|
|
@@ -159,7 +160,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
159
160
|
}, commonToolbarProps)), /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
|
|
160
161
|
value: end,
|
|
161
162
|
onViewChange: handleEndRangeViewChange,
|
|
162
|
-
toolbarTitle:
|
|
163
|
+
toolbarTitle: translations.end,
|
|
163
164
|
ownerState: ownerState,
|
|
164
165
|
toolbarVariant: "desktop",
|
|
165
166
|
view: rangePosition === 'end' ? view : undefined,
|
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
8
|
-
import { PickersArrowSwitcher,
|
|
8
|
+
import { PickersArrowSwitcher, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSwitcher)({
|
|
11
12
|
padding: '12px 16px 4px 16px',
|
|
@@ -15,7 +16,7 @@ const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSw
|
|
|
15
16
|
});
|
|
16
17
|
const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersRangeCalendarHeader(props, ref) {
|
|
17
18
|
const utils = useUtils();
|
|
18
|
-
const
|
|
19
|
+
const translations = usePickersTranslations();
|
|
19
20
|
const {
|
|
20
21
|
calendars,
|
|
21
22
|
month,
|
|
@@ -59,10 +60,10 @@ const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function Picker
|
|
|
59
60
|
onGoToNext: selectNextMonth,
|
|
60
61
|
isPreviousHidden: monthIndex !== 0,
|
|
61
62
|
isPreviousDisabled: isPreviousMonthDisabled,
|
|
62
|
-
previousLabel:
|
|
63
|
+
previousLabel: translations.previousMonth,
|
|
63
64
|
isNextHidden: monthIndex !== calendars - 1,
|
|
64
65
|
isNextDisabled: isNextMonthDisabled,
|
|
65
|
-
nextLabel:
|
|
66
|
+
nextLabel: translations.nextMonth,
|
|
66
67
|
slots: slots,
|
|
67
68
|
slotProps: slotProps,
|
|
68
69
|
labelId: labelId,
|
package/modern/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import useForkRef from '@mui/utils/useForkRef';
|
|
8
|
-
import {
|
|
8
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
|
+
import { onSpaceOrEnter } from '@mui/x-date-pickers/internals';
|
|
9
10
|
const useMultiInputFieldSlotProps = ({
|
|
10
11
|
wrapperVariant,
|
|
11
12
|
open,
|
|
@@ -27,7 +28,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
27
28
|
startFieldRef,
|
|
28
29
|
endFieldRef
|
|
29
30
|
}) => {
|
|
30
|
-
const
|
|
31
|
+
const translations = usePickersTranslations();
|
|
31
32
|
const handleStartFieldRef = useForkRef(fieldProps.unstableStartFieldRef, startFieldRef);
|
|
32
33
|
const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
|
|
33
34
|
const previousRangePosition = React.useRef(rangePosition);
|
|
@@ -91,7 +92,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
91
92
|
let InputProps;
|
|
92
93
|
if (ownerState.position === 'start') {
|
|
93
94
|
textFieldProps = _extends({
|
|
94
|
-
label: inLocaleText?.start ??
|
|
95
|
+
label: inLocaleText?.start ?? translations.start,
|
|
95
96
|
onKeyDown: onSpaceOrEnter(openRangeStartSelection),
|
|
96
97
|
onFocus: handleFocusStart,
|
|
97
98
|
focused: open ? rangePosition === 'start' : undefined
|
|
@@ -107,7 +108,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
107
108
|
}
|
|
108
109
|
} else {
|
|
109
110
|
textFieldProps = _extends({
|
|
110
|
-
label: inLocaleText?.end ??
|
|
111
|
+
label: inLocaleText?.end ?? translations.end,
|
|
111
112
|
onKeyDown: onSpaceOrEnter(openRangeEndSelection),
|
|
112
113
|
onFocus: handleFocusEnd,
|
|
113
114
|
focused: open ? rangePosition === 'end' : undefined
|
|
@@ -6,7 +6,8 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
6
6
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
7
7
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
8
8
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
9
|
-
import { usePicker, PickersModalDialog
|
|
9
|
+
import { usePicker, PickersModalDialog } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
11
|
import useId from '@mui/utils/useId';
|
|
11
12
|
import { useEnrichedRangePickerFieldProps } from '../useEnrichedRangePickerFieldProps';
|
|
12
13
|
import { getReleaseInfo } from '../../utils/releaseInfo';
|
|
@@ -46,7 +47,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
46
47
|
onRangePositionChange
|
|
47
48
|
} = useRangePosition(props, fieldType === 'single-input' ? startFieldRef : undefined);
|
|
48
49
|
const labelId = useId();
|
|
49
|
-
const
|
|
50
|
+
const contextTranslations = usePickersTranslations();
|
|
50
51
|
const {
|
|
51
52
|
open,
|
|
52
53
|
actions,
|
|
@@ -115,7 +116,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
115
116
|
})
|
|
116
117
|
});
|
|
117
118
|
const Layout = slots?.layout ?? PickersLayout;
|
|
118
|
-
const finalLocaleText = _extends({},
|
|
119
|
+
const finalLocaleText = _extends({}, contextTranslations, localeText);
|
|
119
120
|
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
120
121
|
if (isToolbarHidden) {
|
|
121
122
|
const labels = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyMDEyNjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -14,6 +14,7 @@ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _utils = require("@mui/utils");
|
|
16
16
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
17
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
17
18
|
var _dateRangePickerToolbarClasses = require("./dateRangePickerToolbarClasses");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "onViewChange", "view", "views"];
|
|
@@ -66,13 +67,13 @@ const DateRangePickerToolbar = exports.DateRangePickerToolbar = /*#__PURE__*/Rea
|
|
|
66
67
|
className
|
|
67
68
|
} = props,
|
|
68
69
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
69
|
-
const
|
|
70
|
-
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) :
|
|
71
|
-
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) :
|
|
70
|
+
const translations = (0, _hooks.usePickersTranslations)();
|
|
71
|
+
const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : translations.start;
|
|
72
|
+
const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : translations.end;
|
|
72
73
|
const ownerState = props;
|
|
73
74
|
const classes = useUtilityClasses(ownerState);
|
|
74
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DateRangePickerToolbarRoot, (0, _extends2.default)({}, other, {
|
|
75
|
-
toolbarTitle:
|
|
76
|
+
toolbarTitle: translations.dateRangePickerToolbarTitle,
|
|
76
77
|
isLandscape: false,
|
|
77
78
|
className: (0, _clsx.default)(className, classes.root),
|
|
78
79
|
ownerState: ownerState,
|
|
@@ -13,6 +13,7 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
13
13
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
14
14
|
var _icons = require("@mui/x-date-pickers/icons");
|
|
15
15
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
16
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
16
17
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
17
18
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
18
19
|
var _dateTimeRangePickerTabsClasses = require("./dateTimeRangePickerTabsClasses");
|
|
@@ -87,7 +88,7 @@ const DateTimeRangePickerTabs = exports.DateTimeRangePickerTabs = function DateT
|
|
|
87
88
|
className,
|
|
88
89
|
sx
|
|
89
90
|
} = props;
|
|
90
|
-
const
|
|
91
|
+
const translations = (0, _hooks.usePickersTranslations)();
|
|
91
92
|
const classes = useUtilityClasses(props);
|
|
92
93
|
const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
|
|
93
94
|
const isPreviousHidden = value === 'start-date';
|
|
@@ -95,17 +96,17 @@ const DateTimeRangePickerTabs = exports.DateTimeRangePickerTabs = function DateT
|
|
|
95
96
|
const tabLabel = React.useMemo(() => {
|
|
96
97
|
switch (value) {
|
|
97
98
|
case 'start-date':
|
|
98
|
-
return
|
|
99
|
+
return translations.startDate;
|
|
99
100
|
case 'start-time':
|
|
100
|
-
return
|
|
101
|
+
return translations.startTime;
|
|
101
102
|
case 'end-date':
|
|
102
|
-
return
|
|
103
|
+
return translations.endDate;
|
|
103
104
|
case 'end-time':
|
|
104
|
-
return
|
|
105
|
+
return translations.endTime;
|
|
105
106
|
default:
|
|
106
107
|
return '';
|
|
107
108
|
}
|
|
108
|
-
}, [
|
|
109
|
+
}, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
|
|
109
110
|
const handleRangePositionChange = (0, _useEventCallback.default)(newTab => {
|
|
110
111
|
if (newTab.includes('start')) {
|
|
111
112
|
onRangePositionChange('start');
|
|
@@ -133,7 +134,7 @@ const DateTimeRangePickerTabs = exports.DateTimeRangePickerTabs = function DateT
|
|
|
133
134
|
children: [!isPreviousHidden ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
134
135
|
onClick: changeToPreviousTab,
|
|
135
136
|
className: classes.navigationButton,
|
|
136
|
-
title:
|
|
137
|
+
title: translations.openPreviousView,
|
|
137
138
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowLeftIcon, {})
|
|
138
139
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerTabFiller, {
|
|
139
140
|
className: classes.filler
|
|
@@ -145,7 +146,7 @@ const DateTimeRangePickerTabs = exports.DateTimeRangePickerTabs = function DateT
|
|
|
145
146
|
}), !isNextHidden ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
146
147
|
onClick: changeToNextTab,
|
|
147
148
|
className: classes.navigationButton,
|
|
148
|
-
title:
|
|
149
|
+
title: translations.openNextView,
|
|
149
150
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightIcon, {})
|
|
150
151
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerTabFiller, {
|
|
151
152
|
className: classes.filler
|
|
@@ -13,6 +13,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
13
13
|
var _styles = require("@mui/material/styles");
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
16
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
16
17
|
var _DateTimePicker = require("@mui/x-date-pickers/DateTimePicker");
|
|
17
18
|
var _dateTimeRangePickerToolbarClasses = require("./dateTimeRangePickerToolbarClasses");
|
|
18
19
|
var _dateRangeManager = require("../internals/utils/date-range-manager");
|
|
@@ -111,7 +112,7 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
111
112
|
toolbarFormat,
|
|
112
113
|
toolbarPlaceholder
|
|
113
114
|
};
|
|
114
|
-
const
|
|
115
|
+
const translations = (0, _hooks.usePickersTranslations)();
|
|
115
116
|
const ownerState = props;
|
|
116
117
|
const classes = useUtilityClasses(ownerState);
|
|
117
118
|
const handleStartRangeViewChange = React.useCallback(newView => {
|
|
@@ -158,7 +159,7 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
158
159
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerToolbarStart, (0, _extends2.default)({
|
|
159
160
|
value: start,
|
|
160
161
|
onViewChange: handleStartRangeViewChange,
|
|
161
|
-
toolbarTitle:
|
|
162
|
+
toolbarTitle: translations.start,
|
|
162
163
|
ownerState: ownerState,
|
|
163
164
|
toolbarVariant: "desktop",
|
|
164
165
|
view: rangePosition === 'start' ? view : undefined,
|
|
@@ -168,7 +169,7 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
168
169
|
}, commonToolbarProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerToolbarEnd, (0, _extends2.default)({
|
|
169
170
|
value: end,
|
|
170
171
|
onViewChange: handleEndRangeViewChange,
|
|
171
|
-
toolbarTitle:
|
|
172
|
+
toolbarTitle: translations.end,
|
|
172
173
|
ownerState: ownerState,
|
|
173
174
|
toolbarVariant: "desktop",
|
|
174
175
|
view: rangePosition === 'end' ? view : undefined,
|
|
@@ -12,6 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
13
|
var _PickersCalendarHeader = require("@mui/x-date-pickers/PickersCalendarHeader");
|
|
14
14
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
15
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
const _excluded = ["calendars", "month", "monthIndex", "labelId"];
|
|
17
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -24,7 +25,7 @@ const PickersRangeCalendarHeaderContentMultipleCalendars = (0, _styles.styled)(_
|
|
|
24
25
|
});
|
|
25
26
|
const PickersRangeCalendarHeader = exports.PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersRangeCalendarHeader(props, ref) {
|
|
26
27
|
const utils = (0, _internals.useUtils)();
|
|
27
|
-
const
|
|
28
|
+
const translations = (0, _hooks.usePickersTranslations)();
|
|
28
29
|
const {
|
|
29
30
|
calendars,
|
|
30
31
|
month,
|
|
@@ -68,10 +69,10 @@ const PickersRangeCalendarHeader = exports.PickersRangeCalendarHeader = /*#__PUR
|
|
|
68
69
|
onGoToNext: selectNextMonth,
|
|
69
70
|
isPreviousHidden: monthIndex !== 0,
|
|
70
71
|
isPreviousDisabled: isPreviousMonthDisabled,
|
|
71
|
-
previousLabel:
|
|
72
|
+
previousLabel: translations.previousMonth,
|
|
72
73
|
isNextHidden: monthIndex !== calendars - 1,
|
|
73
74
|
isNextDisabled: isNextMonthDisabled,
|
|
74
|
-
nextLabel:
|
|
75
|
+
nextLabel: translations.nextMonth,
|
|
75
76
|
slots: slots,
|
|
76
77
|
slotProps: slotProps,
|
|
77
78
|
labelId: labelId,
|
package/node/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _utils = require("@mui/base/utils");
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
13
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
14
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
14
15
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
15
16
|
const _excluded = ["clearable", "onClear"];
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -36,7 +37,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
36
37
|
startFieldRef,
|
|
37
38
|
endFieldRef
|
|
38
39
|
}) => {
|
|
39
|
-
const
|
|
40
|
+
const translations = (0, _hooks.usePickersTranslations)();
|
|
40
41
|
const handleStartFieldRef = (0, _useForkRef.default)(fieldProps.unstableStartFieldRef, startFieldRef);
|
|
41
42
|
const handleEndFieldRef = (0, _useForkRef.default)(fieldProps.unstableEndFieldRef, endFieldRef);
|
|
42
43
|
const previousRangePosition = React.useRef(rangePosition);
|
|
@@ -100,7 +101,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
100
101
|
let InputProps;
|
|
101
102
|
if (ownerState.position === 'start') {
|
|
102
103
|
textFieldProps = (0, _extends2.default)({
|
|
103
|
-
label: inLocaleText?.start ??
|
|
104
|
+
label: inLocaleText?.start ?? translations.start,
|
|
104
105
|
onKeyDown: (0, _internals.onSpaceOrEnter)(openRangeStartSelection),
|
|
105
106
|
onFocus: handleFocusStart,
|
|
106
107
|
focused: open ? rangePosition === 'start' : undefined
|
|
@@ -116,7 +117,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
116
117
|
}
|
|
117
118
|
} else {
|
|
118
119
|
textFieldProps = (0, _extends2.default)({
|
|
119
|
-
label: inLocaleText?.end ??
|
|
120
|
+
label: inLocaleText?.end ?? translations.end,
|
|
120
121
|
onKeyDown: (0, _internals.onSpaceOrEnter)(openRangeEndSelection),
|
|
121
122
|
onFocus: handleFocusEnd,
|
|
122
123
|
focused: open ? rangePosition === 'end' : undefined
|
|
@@ -13,6 +13,7 @@ var _xLicense = require("@mui/x-license");
|
|
|
13
13
|
var _LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
14
14
|
var _PickersLayout = require("@mui/x-date-pickers/PickersLayout");
|
|
15
15
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
16
|
+
var _hooks = require("@mui/x-date-pickers/hooks");
|
|
16
17
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
17
18
|
var _useEnrichedRangePickerFieldProps = require("../useEnrichedRangePickerFieldProps");
|
|
18
19
|
var _releaseInfo = require("../../utils/releaseInfo");
|
|
@@ -55,7 +56,7 @@ const useMobileRangePicker = _ref => {
|
|
|
55
56
|
onRangePositionChange
|
|
56
57
|
} = (0, _useRangePosition.useRangePosition)(props, fieldType === 'single-input' ? startFieldRef : undefined);
|
|
57
58
|
const labelId = (0, _useId.default)();
|
|
58
|
-
const
|
|
59
|
+
const contextTranslations = (0, _hooks.usePickersTranslations)();
|
|
59
60
|
const {
|
|
60
61
|
open,
|
|
61
62
|
actions,
|
|
@@ -124,7 +125,7 @@ const useMobileRangePicker = _ref => {
|
|
|
124
125
|
})
|
|
125
126
|
});
|
|
126
127
|
const Layout = slots?.layout ?? _PickersLayout.PickersLayout;
|
|
127
|
-
const finalLocaleText = (0, _extends2.default)({},
|
|
128
|
+
const finalLocaleText = (0, _extends2.default)({}, contextTranslations, localeText);
|
|
128
129
|
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
129
130
|
if (isToolbarHidden) {
|
|
130
131
|
const labels = [];
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcyMDEyNjgwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers-pro",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.9.0",
|
|
4
4
|
"description": "The Pro plan edition of the Date and Time Picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.24.7",
|
|
36
36
|
"@mui/base": "^5.0.0-beta.40",
|
|
37
|
-
"@mui/system": "^5.
|
|
38
|
-
"@mui/utils": "^5.
|
|
37
|
+
"@mui/system": "^5.16.0",
|
|
38
|
+
"@mui/utils": "^5.16.0",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
|
-
"@mui/x-date-pickers": "7.
|
|
43
|
-
"@mui/x-license": "7.
|
|
42
|
+
"@mui/x-date-pickers": "7.9.0",
|
|
43
|
+
"@mui/x-license": "7.9.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@emotion/react": "^11.9.0",
|