@mui/x-date-pickers-pro 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.
Files changed (30) hide show
  1. package/CHANGELOG.md +166 -1
  2. package/DateRangeCalendar/useDragRange.d.ts +1 -1
  3. package/DateRangePicker/DateRangePickerToolbar.js +6 -5
  4. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +2 -1
  5. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
  6. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +5 -4
  7. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +5 -4
  8. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +1 -1
  9. package/index.js +1 -1
  10. package/internals/hooks/useEnrichedRangePickerFieldProps.js +5 -4
  11. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -3
  12. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +1 -1
  13. package/internals/utils/releaseInfo.js +1 -1
  14. package/modern/DateRangePicker/DateRangePickerToolbar.js +6 -5
  15. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +10 -9
  16. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +5 -4
  17. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +5 -4
  18. package/modern/index.js +1 -1
  19. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +5 -4
  20. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -3
  21. package/modern/internals/utils/releaseInfo.js +1 -1
  22. package/node/DateRangePicker/DateRangePickerToolbar.js +5 -4
  23. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +9 -8
  24. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -3
  25. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +4 -3
  26. package/node/index.js +1 -1
  27. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -3
  28. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -2
  29. package/node/internals/utils/releaseInfo.js +1 -1
  30. package/package.json +5 -5
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` [![pro](https://mui.com/r/x-pro-svg)](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` [![premium](https://mui.com/r/x-premium-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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` [![premium](https://mui.com/r/x-premium-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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 (#13447) @arthurbalduini
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` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
215
 
@@ -28,5 +28,5 @@ interface UseDragRangeResponse<TDate extends PickerValidDate> extends UseDragRan
28
28
  rangeDragDay: TDate | null;
29
29
  draggingDatePosition: RangePosition | null;
30
30
  }
31
- export declare const useDragRange: <TDate extends PickerValidDate>({ disableDragEditing, utils, onDatePositionChange, onDrop, dateRange, timezone, }: Omit<UseDragRangeParams<TDate>, 'setRangeDragDay' | 'setIsDragging' | 'isDragging'>) => UseDragRangeResponse<TDate>;
31
+ export declare const useDragRange: <TDate extends PickerValidDate>({ disableDragEditing, utils, onDatePositionChange, onDrop, dateRange, timezone, }: Omit<UseDragRangeParams<TDate>, "setRangeDragDay" | "setIsDragging" | "isDragging">) => UseDragRangeResponse<TDate>;
32
32
  export {};
@@ -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, useLocaleText } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
61
- const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : localeText.start;
62
- const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : localeText.end;
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: localeText.dateRangePickerToolbarTitle,
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 { useLocaleText, isDatePickerView } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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 localeText.startDate;
90
+ return translations.startDate;
90
91
  case 'start-time':
91
- return localeText.startTime;
92
+ return translations.startTime;
92
93
  case 'end-date':
93
- return localeText.endDate;
94
+ return translations.endDate;
94
95
  case 'end-time':
95
- return localeText.endTime;
96
+ return translations.endTime;
96
97
  default:
97
98
  return '';
98
99
  }
99
- }, [localeText.endDate, localeText.endTime, localeText.startDate, localeText.startTime, value]);
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: localeText.openPreviousView,
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: localeText.openNextView,
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 { useLocaleText, useUtils } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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: localeText.start,
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: localeText.end,
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, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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: localeText.previousMonth,
63
+ previousLabel: translations.previousMonth,
63
64
  isNextHidden: monthIndex !== calendars - 1,
64
65
  isNextDisabled: isNextMonthDisabled,
65
- nextLabel: localeText.nextMonth,
66
+ nextLabel: translations.nextMonth,
66
67
  slots: slots,
67
68
  slotProps: slotProps,
68
69
  labelId: labelId,
@@ -9,4 +9,4 @@ export interface DateRangeViewRendererProps<TDate extends PickerValidDate, TView
9
9
  * We don't pass all the props down to `DateRangeCalendar`,
10
10
  * because otherwise some unwanted props would be passed to the HTML element.
11
11
  */
12
- export declare const renderDateRangeViewCalendar: <TDate extends PickerValidDate>({ value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, reduceAnimations, onMonthChange, rangePosition, defaultRangePosition, onRangePositionChange, calendars, currentMonthCalendarPosition, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, disableAutoMonthSwitching, sx, autoFocus, fixedWeekNumber, disableDragEditing, displayWeekNumber, timezone, availableRangePositions, views, view, onViewChange, }: DateRangeViewRendererProps<TDate, 'day'>) => React.JSX.Element;
12
+ export declare const renderDateRangeViewCalendar: <TDate extends PickerValidDate>({ value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, reduceAnimations, onMonthChange, rangePosition, defaultRangePosition, onRangePositionChange, calendars, currentMonthCalendarPosition, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, disableAutoMonthSwitching, sx, autoFocus, fixedWeekNumber, disableDragEditing, displayWeekNumber, timezone, availableRangePositions, views, view, onViewChange, }: DateRangeViewRendererProps<TDate, "day">) => React.JSX.Element;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.1
2
+ * @mui/x-date-pickers-pro v7.9.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 { onSpaceOrEnter, useLocaleText } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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 ?? localeText.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 ?? localeText.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, useLocaleText } from '@mui/x-date-pickers/internals';
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 contextLocaleText = useLocaleText();
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({}, contextLocaleText, localeText);
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 = [];
@@ -13,7 +13,7 @@ export declare const useMultiInputFieldSelectedSections: (params: UseMultiInputF
13
13
  onSelectedSectionsChange: (newSelectedSections: FieldSelectedSections) => void;
14
14
  };
15
15
  end: {
16
- unstableFieldRef: ((instance: FieldRef<RangeFieldSection> | null) => void) | null;
16
+ unstableFieldRef: ((instance: FieldRef<RangeFieldSection> | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
17
17
  selectedSections: FieldSelectedSections;
18
18
  onSelectedSectionsChange: (newSelectedSections: FieldSelectedSections) => void;
19
19
  };
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxODkyMDgwMDAwMA==";
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, useLocaleText } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
61
- const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : localeText.start;
62
- const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : localeText.end;
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: localeText.dateRangePickerToolbarTitle,
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 { useLocaleText, isDatePickerView } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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 localeText.startDate;
90
+ return translations.startDate;
90
91
  case 'start-time':
91
- return localeText.startTime;
92
+ return translations.startTime;
92
93
  case 'end-date':
93
- return localeText.endDate;
94
+ return translations.endDate;
94
95
  case 'end-time':
95
- return localeText.endTime;
96
+ return translations.endTime;
96
97
  default:
97
98
  return '';
98
99
  }
99
- }, [localeText.endDate, localeText.endTime, localeText.startDate, localeText.startTime, value]);
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: localeText.openPreviousView,
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: localeText.openNextView,
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 { useLocaleText, useUtils } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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: localeText.start,
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: localeText.end,
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, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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: localeText.previousMonth,
63
+ previousLabel: translations.previousMonth,
63
64
  isNextHidden: monthIndex !== calendars - 1,
64
65
  isNextDisabled: isNextMonthDisabled,
65
- nextLabel: localeText.nextMonth,
66
+ nextLabel: translations.nextMonth,
66
67
  slots: slots,
67
68
  slotProps: slotProps,
68
69
  labelId: labelId,
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.1
2
+ * @mui/x-date-pickers-pro v7.9.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 { onSpaceOrEnter, useLocaleText } from '@mui/x-date-pickers/internals';
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 localeText = useLocaleText();
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 ?? localeText.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 ?? localeText.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, useLocaleText } from '@mui/x-date-pickers/internals';
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 contextLocaleText = useLocaleText();
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({}, contextLocaleText, localeText);
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 = "MTcxODkyMDgwMDAwMA==";
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 localeText = (0, _internals.useLocaleText)();
70
- const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : localeText.start;
71
- const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : localeText.end;
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: localeText.dateRangePickerToolbarTitle,
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 localeText = (0, _internals.useLocaleText)();
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 localeText.startDate;
99
+ return translations.startDate;
99
100
  case 'start-time':
100
- return localeText.startTime;
101
+ return translations.startTime;
101
102
  case 'end-date':
102
- return localeText.endDate;
103
+ return translations.endDate;
103
104
  case 'end-time':
104
- return localeText.endTime;
105
+ return translations.endTime;
105
106
  default:
106
107
  return '';
107
108
  }
108
- }, [localeText.endDate, localeText.endTime, localeText.startDate, localeText.startTime, value]);
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: localeText.openPreviousView,
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: localeText.openNextView,
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 localeText = (0, _internals.useLocaleText)();
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: localeText.start,
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: localeText.end,
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 localeText = (0, _internals.useLocaleText)();
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: localeText.previousMonth,
72
+ previousLabel: translations.previousMonth,
72
73
  isNextHidden: monthIndex !== calendars - 1,
73
74
  isNextDisabled: isNextMonthDisabled,
74
- nextLabel: localeText.nextMonth,
75
+ nextLabel: translations.nextMonth,
75
76
  slots: slots,
76
77
  slotProps: slotProps,
77
78
  labelId: labelId,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.7.1
2
+ * @mui/x-date-pickers-pro v7.9.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 localeText = (0, _internals.useLocaleText)();
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 ?? localeText.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 ?? localeText.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 contextLocaleText = (0, _internals.useLocaleText)();
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)({}, contextLocaleText, localeText);
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 = "MTcxODkyMDgwMDAwMA==";
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.7.1",
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.15.20",
38
- "@mui/utils": "^5.15.20",
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.7.1",
43
- "@mui/x-license": "7.7.1"
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",