@mui/x-date-pickers-pro 8.0.0-alpha.6 → 8.0.0-alpha.7
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/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.d.ts +1 -1
- package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/package.json +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.d.ts +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/package.json +1 -1
- package/CHANGELOG.md +127 -1
- package/DateRangeCalendar/DateRangeCalendar.js +9 -7
- package/DateRangePicker/DateRangePicker.js +1 -1
- package/DateRangePicker/DateRangePicker.types.d.ts +5 -0
- package/DateRangePicker/DateRangePickerToolbar.d.ts +2 -3
- package/DateRangePicker/DateRangePickerToolbar.js +25 -17
- package/DateRangePicker/shared.d.ts +1 -1
- package/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +3 -4
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +8 -7
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -10
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +7 -5
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +2 -3
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +26 -28
- package/DateTimeRangePicker/shared.d.ts +2 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +5 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
- package/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +13 -14
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +13 -14
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +13 -14
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -2
- package/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/package.json +6 -0
- package/hooks/usePickerRangePositionContext.d.ts +7 -0
- package/hooks/usePickerRangePositionContext.js +15 -0
- package/index.d.ts +2 -0
- package/index.js +4 -2
- package/internals/hooks/models/useRangePicker.d.ts +2 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +26 -43
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -5
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +5 -5
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -35
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -5
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +10 -12
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +1 -1
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +11 -6
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +2 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +12 -7
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +2 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +13 -8
- package/internals/hooks/useNullablePickerRangePositionContext.d.ts +5 -0
- package/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
- package/internals/hooks/useRangePosition.d.ts +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +2 -2
- package/internals/utils/date-range-manager.js +2 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.js +7 -7
- package/managers/index.d.ts +6 -0
- package/managers/index.js +3 -0
- package/managers/package.json +6 -0
- package/managers/useDateRangeManager.d.ts +15 -0
- package/managers/useDateRangeManager.js +31 -0
- package/managers/useDateTimeRangeManager.d.ts +15 -0
- package/managers/useDateTimeRangeManager.js +31 -0
- package/managers/useTimeRangeManager.d.ts +15 -0
- package/managers/useTimeRangeManager.js +29 -0
- package/models/range.d.ts +0 -1
- package/modern/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/modern/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +9 -7
- package/modern/DateRangePicker/DateRangePicker.js +1 -1
- package/modern/DateRangePicker/DateRangePickerToolbar.js +25 -17
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +8 -7
- package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +7 -5
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +26 -28
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +13 -14
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +13 -14
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +13 -14
- package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/usePickerRangePositionContext.js +15 -0
- package/modern/index.js +4 -2
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +26 -43
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -35
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +11 -6
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +12 -7
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +13 -8
- package/modern/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
- package/modern/internals/utils/date-range-manager.js +2 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +7 -7
- package/modern/managers/index.js +3 -0
- package/modern/managers/useDateRangeManager.js +31 -0
- package/modern/managers/useDateTimeRangeManager.js +31 -0
- package/modern/managers/useTimeRangeManager.js +29 -0
- package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +9 -7
- package/node/DateRangePicker/DateRangePicker.js +1 -1
- package/node/DateRangePicker/DateRangePickerToolbar.js +24 -16
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -2
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +8 -7
- package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +7 -5
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +26 -28
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +9 -3
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +17 -14
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -8
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +12 -14
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +12 -14
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +12 -14
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/node/hooks/index.js +12 -0
- package/node/hooks/usePickerRangePositionContext.js +22 -0
- package/node/index.js +23 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +26 -43
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -35
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +10 -5
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +11 -6
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +12 -7
- package/node/internals/hooks/useNullablePickerRangePositionContext.js +16 -0
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -24
- package/node/internals/utils/date-range-manager.js +2 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +7 -7
- package/node/managers/index.js +26 -0
- package/node/managers/useDateRangeManager.js +38 -0
- package/node/managers/useDateTimeRangeManager.js +38 -0
- package/node/managers/useTimeRangeManager.js +36 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdapterDateFnsJalali } from '@mui/x-date-pickers/
|
|
1
|
+
export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV2';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdapterDateFnsJalali } from '@mui/x-date-pickers/
|
|
1
|
+
export { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV2';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdapterDateFns } from '@mui/x-date-pickers/
|
|
1
|
+
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV2';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdapterDateFns } from '@mui/x-date-pickers/
|
|
1
|
+
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV2';
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,132 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.0.0-alpha.7
|
|
9
|
+
|
|
10
|
+
_Jan 9, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 Charts legend is now an HTML element which can be styled more easily
|
|
15
|
+
- 💫 Support [aggregation with server-side data](/x/react-data-grid/server-side-data/aggregation/)
|
|
16
|
+
- 🏎️ Improve Data Grid aggregation performance
|
|
17
|
+
- 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
|
|
18
|
+
- 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
|
|
19
|
+
- 🐞 Bugfixes
|
|
20
|
+
|
|
21
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
22
|
+
@derek-0000, @josteinjhauge, @k-rajat19, @nusr, @tomashauser.
|
|
23
|
+
Following are all team members who have contributed to this release:
|
|
24
|
+
@cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @oliviertassinari.
|
|
25
|
+
|
|
26
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
27
|
+
|
|
28
|
+
### Data Grid
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid@8.0.0-alpha.7`
|
|
31
|
+
|
|
32
|
+
- [DataGrid] Improve React 19 support (#15769) @LukasTy
|
|
33
|
+
- [DataGrid] Add `name` attribute to the checkbox selection column (#15178) @derek-0000
|
|
34
|
+
- [DataGrid] Fix number filter field formatting values while typing (#16062) @arminmeh
|
|
35
|
+
- [DataGrid] Fix select all checkbox state reset with server side data (#16034) @MBilalShafi
|
|
36
|
+
- [DataGrid] Refactor: create base button props (#15930) @romgrk
|
|
37
|
+
- [DataGrid] Refactor: create tooltip props (#16086) @romgrk
|
|
38
|
+
- [DataGrid] Fix TS error (#16046) @cherniavskii
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.7`.
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.7` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.7`, plus:
|
|
47
|
+
|
|
48
|
+
- [DataGridPremium] Improve aggregation performance for multiple columns (#16097) @cherniavskii
|
|
49
|
+
- [DataGridPremium] Make Aggregation keyboard accessible in the column menu (#15934) @k-rajat19
|
|
50
|
+
- [DataGridPremium] Server-side aggregation with data source (#15741) @MBilalShafi
|
|
51
|
+
|
|
52
|
+
### Date and Time Pickers
|
|
53
|
+
|
|
54
|
+
#### Breaking changes
|
|
55
|
+
|
|
56
|
+
- The `date-fns` and `date-fns-jalali` date library adapters have been renamed to better align with the current stable major versions — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#✅-rename-date-fns-adapter-imports)
|
|
57
|
+
- Update default `closeOnSelect` and Action Bar `actions` values - [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#update-default-closeonselect-and-action-bar-actions-values)
|
|
58
|
+
- The component passed to the `layout` slot no longer receives the `value`, `onChange` and `onSelectShortcut` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
59
|
+
- The component passed to the `toolbar` slot no longer receives the `value`, `onChange` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
60
|
+
- The component passed to the `shortcuts` slot no longer receives the `onChange`, `isValid` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-shortcuts).
|
|
61
|
+
- The `PickerShortcutChangeImportance` type has been renamed `PickerChangeImportance` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables-and-types).
|
|
62
|
+
- The component passed to the `layout` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
63
|
+
- The component passed to the `toolbar` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
64
|
+
- The component passed to the `tabs` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-tabs).
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.7`
|
|
67
|
+
|
|
68
|
+
- [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (#15985) @LukasTy
|
|
69
|
+
- [pickers] Always use `setValue` internally to update the picker value (#16056) @flaviendelangle
|
|
70
|
+
- [pickers] Create a new context to pass the range position props to the layout components and to the views (#15846) @flaviendelangle
|
|
71
|
+
- [pickers] Introduce a new concept of `manager` (#15339) @flaviendelangle
|
|
72
|
+
- [pickers] Improve React 19 support (#15769) @LukasTy
|
|
73
|
+
- [pickers] Memoize `<PickersActionBar />` (#16071) @LukasTy
|
|
74
|
+
- [pickers] Remove `NonEmptyDateRange` type (#16035) @flaviendelangle
|
|
75
|
+
- [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (#16082) @LukasTy
|
|
76
|
+
- [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (#16044) @flaviendelangle
|
|
77
|
+
- [pickers] Support `date-fns-jalali` v4 (#16011) @LukasTy
|
|
78
|
+
- [pickers] Update `closeOnSelect` and `actionBar.actions` default values (#15944) @LukasTy
|
|
79
|
+
- [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (#15948) @flaviendelangle
|
|
80
|
+
- [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16033) @nusr
|
|
81
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#16089) @josteinjhauge
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
84
|
+
|
|
85
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.7`.
|
|
86
|
+
|
|
87
|
+
### Charts
|
|
88
|
+
|
|
89
|
+
#### Breaking changes
|
|
90
|
+
|
|
91
|
+
- Removed `DefaultChartsLegend` component, since it is now easier to create custom legends — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
|
|
92
|
+
- The default legend is now an HTML element and can be styled more easily.
|
|
93
|
+
- The `width` and `height` properties of the charts now only apply to the `svg` element, and not their wrappers, this might cause some layout shifts.
|
|
94
|
+
- `slotProps.legend.direction` now accepts `'horizontal' | 'vertical'` instead of `'row' | 'column'` — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#legend-direction-value-change-✅).
|
|
95
|
+
- The `getSeriesToDisplay` function was removed in favor of the `useLegend` hook. — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#the-getseriestodisplay-function-was-removed).
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-charts@8.0.0-alpha.7`
|
|
98
|
+
|
|
99
|
+
- [charts] New HTML legend & styles (#15733) @JCQuintas
|
|
100
|
+
- [charts] Improve React 19 support (#15769) @LukasTy
|
|
101
|
+
- [charts] Fix 301 redirection in the API documentation @oliviertassinari
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
104
|
+
|
|
105
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.7`.
|
|
106
|
+
|
|
107
|
+
### Tree View
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-tree-view@8.0.0-alpha.7`
|
|
110
|
+
|
|
111
|
+
- [TreeView] Improve React 19 support (#15769) @LukasTy
|
|
112
|
+
|
|
113
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
114
|
+
|
|
115
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.7`.
|
|
116
|
+
|
|
117
|
+
### Docs
|
|
118
|
+
|
|
119
|
+
- [docs] Fix `EditingWithDatePickers` demo (#15967) @k-rajat19
|
|
120
|
+
- [docs] Fix inconsistent multi input range field separators (#16043) @flaviendelangle
|
|
121
|
+
- [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16084) @tomashauser
|
|
122
|
+
- [docs] Refactor Data Grid with Date Pickers example (#15992) @LukasTy
|
|
123
|
+
- [docs] Unify the wording of the pickers slots breaking changes (#16036) @flaviendelangle
|
|
124
|
+
|
|
125
|
+
### Core
|
|
126
|
+
|
|
127
|
+
- [core] Clarify the release strategy (#16014) @MBilalShafi
|
|
128
|
+
- [core] Small fixes on docs @oliviertassinari
|
|
129
|
+
- [core] Sync with other repos @oliviertassinari
|
|
130
|
+
- [core] Update the `release:version` docs (#16038) @cherniavskii
|
|
131
|
+
- [code-infra] Add `testSkipIf` and `describeSkipIf` (#16049) @JCQuintas
|
|
132
|
+
- [test] Stabilize flaky Data Grid tests (#16053) @LukasTy
|
|
133
|
+
|
|
8
134
|
## 8.0.0-alpha.6
|
|
9
135
|
|
|
10
136
|
_Dec 26, 2024_
|
|
@@ -104,7 +230,7 @@ Following are all team members who have contributed to this release:
|
|
|
104
230
|
|
|
105
231
|
#### Breaking changes
|
|
106
232
|
|
|
107
|
-
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps
|
|
233
|
+
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
|
|
108
234
|
|
|
109
235
|
- For `.root` element, use `slotProps.root`.
|
|
110
236
|
- For `.main` element (the one with `role="grid"`), use `slotProps.main`.
|
|
@@ -27,6 +27,7 @@ import { useDragRange } from "./useDragRange.js";
|
|
|
27
27
|
import { useRangePosition } from "../internals/hooks/useRangePosition.js";
|
|
28
28
|
import { DAY_RANGE_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
|
|
29
29
|
import { PickersRangeCalendarHeader } from "../PickersRangeCalendarHeader/index.js";
|
|
30
|
+
import { useNullablePickerRangePositionContext } from "../internals/hooks/useNullablePickerRangePositionContext.js";
|
|
30
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
32
|
const releaseInfo = getReleaseInfo();
|
|
32
33
|
const DateRangeCalendarRoot = styled('div', {
|
|
@@ -135,8 +136,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
135
136
|
reduceAnimations,
|
|
136
137
|
onMonthChange,
|
|
137
138
|
rangePosition: rangePositionProp,
|
|
138
|
-
defaultRangePosition:
|
|
139
|
-
onRangePositionChange:
|
|
139
|
+
defaultRangePosition: defaultRangePositionProp,
|
|
140
|
+
onRangePositionChange: onRangePositionChangeProp,
|
|
140
141
|
calendars,
|
|
141
142
|
currentMonthCalendarPosition = 1,
|
|
142
143
|
slots,
|
|
@@ -161,6 +162,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
161
162
|
onViewChange
|
|
162
163
|
} = props,
|
|
163
164
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
165
|
+
const rangePositionContext = useNullablePickerRangePositionContext();
|
|
164
166
|
const {
|
|
165
167
|
value,
|
|
166
168
|
handleValueChange,
|
|
@@ -192,9 +194,9 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
192
194
|
rangePosition,
|
|
193
195
|
onRangePositionChange
|
|
194
196
|
} = useRangePosition({
|
|
195
|
-
rangePosition: rangePositionProp,
|
|
196
|
-
defaultRangePosition:
|
|
197
|
-
onRangePositionChange:
|
|
197
|
+
rangePosition: rangePositionProp ?? rangePositionContext?.rangePosition,
|
|
198
|
+
defaultRangePosition: defaultRangePositionProp,
|
|
199
|
+
onRangePositionChange: onRangePositionChangeProp ?? rangePositionContext?.onRangePositionChange
|
|
198
200
|
});
|
|
199
201
|
const handleDatePositionChange = useEventCallback(position => {
|
|
200
202
|
if (rangePosition !== position) {
|
|
@@ -228,7 +230,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
228
230
|
|
|
229
231
|
// Range going for the start of the start day to the end of the end day.
|
|
230
232
|
// This makes sure that `isWithinRange` works with any time in the start and end day.
|
|
231
|
-
const valueDayRange = React.useMemo(() => [
|
|
233
|
+
const valueDayRange = React.useMemo(() => [!utils.isValid(value[0]) ? value[0] : utils.startOfDay(value[0]), !utils.isValid(value[1]) ? value[1] : utils.endOfDay(value[1])], [value, utils]);
|
|
232
234
|
const _useDragRange = useDragRange({
|
|
233
235
|
disableDragEditing: shouldDisableDragEditing,
|
|
234
236
|
onDrop: handleDrop,
|
|
@@ -316,7 +318,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
316
318
|
const prevValue = React.useRef(null);
|
|
317
319
|
React.useEffect(() => {
|
|
318
320
|
const date = rangePosition === 'start' ? value[0] : value[1];
|
|
319
|
-
if (!
|
|
321
|
+
if (!utils.isValid(date)) {
|
|
320
322
|
return;
|
|
321
323
|
}
|
|
322
324
|
const prevDate = rangePosition === 'start' ? prevValue.current?.[0] : prevValue.current?.[1];
|
|
@@ -63,7 +63,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
63
63
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
64
64
|
className: PropTypes.string,
|
|
65
65
|
/**
|
|
66
|
-
* If `true`, the
|
|
66
|
+
* If `true`, the Picker will close after submitting the full date.
|
|
67
67
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
68
68
|
*/
|
|
69
69
|
closeOnSelect: PropTypes.bool,
|
|
@@ -24,6 +24,11 @@ export interface DateRangePickerProps<TEnableAccessibleFieldDOMStructure extends
|
|
|
24
24
|
* @default {}
|
|
25
25
|
*/
|
|
26
26
|
slotProps?: DateRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
|
|
27
|
+
/**
|
|
28
|
+
* If `true`, the Picker will close after submitting the full date.
|
|
29
|
+
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
30
|
+
*/
|
|
31
|
+
closeOnSelect?: boolean;
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
29
34
|
* Props the field can receive when used inside a date range picker (<DateRangePicker />, <DesktopDateRangePicker /> or <MobileDateRangePicker /> component).
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BaseToolbarProps, ExportedBaseToolbarProps
|
|
3
|
-
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
2
|
+
import { BaseToolbarProps, ExportedBaseToolbarProps } from '@mui/x-date-pickers/internals';
|
|
4
3
|
import { DateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
|
|
5
|
-
export interface DateRangePickerToolbarProps extends ExportedDateRangePickerToolbarProps, Omit<BaseToolbarProps
|
|
4
|
+
export interface DateRangePickerToolbarProps extends ExportedDateRangePickerToolbarProps, Omit<BaseToolbarProps, 'onChange' | 'isLandscape'> {
|
|
6
5
|
}
|
|
7
6
|
export interface ExportedDateRangePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
7
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["toolbarFormat", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -10,8 +10,9 @@ import Typography from '@mui/material/Typography';
|
|
|
10
10
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
12
|
import { PickersToolbar, PickersToolbarButton, useUtils, useToolbarOwnerState } from '@mui/x-date-pickers/internals';
|
|
13
|
-
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
13
|
+
import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
14
14
|
import { getDateRangePickerToolbarUtilityClass } from "./dateRangePickerToolbarClasses.js";
|
|
15
|
+
import { usePickerRangePositionContext } from "../hooks/index.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const useUtilityClasses = classes => {
|
|
17
18
|
const slots = {
|
|
@@ -49,38 +50,48 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
49
50
|
name: 'MuiDateRangePickerToolbar'
|
|
50
51
|
});
|
|
51
52
|
const {
|
|
52
|
-
|
|
53
|
-
rangePosition,
|
|
54
|
-
onRangePositionChange,
|
|
55
|
-
toolbarFormat,
|
|
53
|
+
toolbarFormat: toolbarFormatProp,
|
|
56
54
|
className,
|
|
57
55
|
classes: classesProp
|
|
58
56
|
} = props,
|
|
59
57
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
58
|
+
const {
|
|
59
|
+
value
|
|
60
|
+
} = usePickerContext();
|
|
60
61
|
const translations = usePickerTranslations();
|
|
61
62
|
const ownerState = useToolbarOwnerState();
|
|
63
|
+
const {
|
|
64
|
+
rangePosition,
|
|
65
|
+
onRangePositionChange
|
|
66
|
+
} = usePickerRangePositionContext();
|
|
62
67
|
const classes = useUtilityClasses(classesProp);
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
|
|
69
|
+
// This can't be a default value when spreading because it breaks the API generation.
|
|
70
|
+
const toolbarFormat = toolbarFormatProp ?? utils.formats.shortDate;
|
|
71
|
+
const formatDate = (date, fallback) => {
|
|
72
|
+
if (!utils.isValid(date)) {
|
|
73
|
+
return fallback;
|
|
74
|
+
}
|
|
75
|
+
return utils.formatByString(date, toolbarFormat);
|
|
76
|
+
};
|
|
65
77
|
return /*#__PURE__*/_jsx(DateRangePickerToolbarRoot, _extends({}, other, {
|
|
66
78
|
toolbarTitle: translations.dateRangePickerToolbarTitle,
|
|
67
|
-
isLandscape: false,
|
|
68
79
|
className: clsx(classes.root, className),
|
|
69
80
|
ownerState: ownerState,
|
|
70
81
|
ref: ref,
|
|
71
82
|
children: /*#__PURE__*/_jsxs(DateRangePickerToolbarContainer, {
|
|
72
83
|
className: classes.container,
|
|
73
84
|
children: [/*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
74
|
-
variant:
|
|
75
|
-
value:
|
|
85
|
+
variant: value[0] == null ? 'h6' : 'h5',
|
|
86
|
+
value: formatDate(value[0], translations.start),
|
|
76
87
|
selected: rangePosition === 'start',
|
|
77
88
|
onClick: () => onRangePositionChange('start')
|
|
78
89
|
}), /*#__PURE__*/_jsxs(Typography, {
|
|
79
90
|
variant: "h5",
|
|
80
91
|
children: ["\xA0", '–', "\xA0"]
|
|
81
92
|
}), /*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
82
|
-
variant:
|
|
83
|
-
value:
|
|
93
|
+
variant: value[1] == null ? 'h6' : 'h5',
|
|
94
|
+
value: formatDate(value[1], translations.end),
|
|
84
95
|
selected: rangePosition === 'end',
|
|
85
96
|
onClick: () => onRangePositionChange('end')
|
|
86
97
|
})]
|
|
@@ -102,8 +113,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
102
113
|
* @default `true` for Desktop, `false` for Mobile.
|
|
103
114
|
*/
|
|
104
115
|
hidden: PropTypes.bool,
|
|
105
|
-
onRangePositionChange: PropTypes.func.isRequired,
|
|
106
|
-
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
107
116
|
/**
|
|
108
117
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
109
118
|
*/
|
|
@@ -117,7 +126,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
117
126
|
* Toolbar value placeholder—it is displayed when the value is empty.
|
|
118
127
|
* @default "––"
|
|
119
128
|
*/
|
|
120
|
-
toolbarPlaceholder: PropTypes.node
|
|
121
|
-
value: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
129
|
+
toolbarPlaceholder: PropTypes.node
|
|
122
130
|
} : void 0;
|
|
123
131
|
export { DateRangePickerToolbar };
|
|
@@ -33,7 +33,7 @@ export interface BaseDateRangePickerProps extends Omit<BasePickerInputProps<Pick
|
|
|
33
33
|
* If `null`, the section will only have field editing.
|
|
34
34
|
* If `undefined`, internally defined view will be used.
|
|
35
35
|
*/
|
|
36
|
-
viewRenderers?: Partial<PickerViewRendererLookup<PickerRangeValue, 'day', DateRangeViewRendererProps<'day'
|
|
36
|
+
viewRenderers?: Partial<PickerViewRendererLookup<PickerRangeValue, 'day', DateRangeViewRendererProps<'day'>>>;
|
|
37
37
|
}
|
|
38
38
|
type UseDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps> = LocalizedComponent<DefaultizedProps<Props, ValidateDateRangePropsToDefault>>;
|
|
39
39
|
export declare function useDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps>(props: Props, name: string): UseDateRangePickerDefaultizedProps<Props>;
|
|
@@ -68,8 +68,8 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
68
68
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
69
69
|
className: PropTypes.string,
|
|
70
70
|
/**
|
|
71
|
-
* If `true`, the
|
|
72
|
-
* @default
|
|
71
|
+
* If `true`, the Picker will close after submitting the full date.
|
|
72
|
+
* @default false
|
|
73
73
|
*/
|
|
74
74
|
closeOnSelect: PropTypes.bool,
|
|
75
75
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ExportedBaseTabsProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DateTimeRangePickerTabsClasses } from './dateTimeRangePickerTabsClasses';
|
|
4
|
-
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
5
4
|
export interface ExportedDateTimeRangePickerTabsProps extends ExportedBaseTabsProps {
|
|
6
5
|
/**
|
|
7
6
|
* Toggles visibility of the tabs allowing view switching.
|
|
@@ -12,18 +11,18 @@ export interface ExportedDateTimeRangePickerTabsProps extends ExportedBaseTabsPr
|
|
|
12
11
|
* Date tab icon.
|
|
13
12
|
* @default DateRangeIcon
|
|
14
13
|
*/
|
|
15
|
-
dateIcon?: React.ReactElement
|
|
14
|
+
dateIcon?: React.ReactElement<any>;
|
|
16
15
|
/**
|
|
17
16
|
* Time tab icon.
|
|
18
17
|
* @default TimeIcon
|
|
19
18
|
*/
|
|
20
|
-
timeIcon?: React.ReactElement
|
|
19
|
+
timeIcon?: React.ReactElement<any>;
|
|
21
20
|
/**
|
|
22
21
|
* Override or extend the styles applied to the component.
|
|
23
22
|
*/
|
|
24
23
|
classes?: Partial<DateTimeRangePickerTabsClasses>;
|
|
25
24
|
}
|
|
26
|
-
export interface DateTimeRangePickerTabsProps extends ExportedDateTimeRangePickerTabsProps
|
|
25
|
+
export interface DateTimeRangePickerTabsProps extends ExportedDateTimeRangePickerTabsProps {
|
|
27
26
|
}
|
|
28
27
|
declare const DateTimeRangePickerTabs: {
|
|
29
28
|
(inProps: DateTimeRangePickerTabsProps): React.JSX.Element | null;
|
|
@@ -12,6 +12,7 @@ import { usePickerContext, usePickerTranslations } from '@mui/x-date-pickers/hoo
|
|
|
12
12
|
import IconButton from '@mui/material/IconButton';
|
|
13
13
|
import Button from '@mui/material/Button';
|
|
14
14
|
import { getDateTimeRangePickerTabsUtilityClass } from "./dateTimeRangePickerTabsClasses.js";
|
|
15
|
+
import { usePickerRangePositionContext } from "../hooks/index.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const viewToTab = (view, rangePosition) => {
|
|
17
18
|
if (isDatePickerView(view)) {
|
|
@@ -71,8 +72,6 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
71
72
|
dateIcon = /*#__PURE__*/_jsx(DateRangeIcon, {}),
|
|
72
73
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
73
74
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
74
|
-
rangePosition,
|
|
75
|
-
onRangePositionChange,
|
|
76
75
|
className,
|
|
77
76
|
classes: classesProp,
|
|
78
77
|
sx
|
|
@@ -83,9 +82,13 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
83
82
|
} = usePickerPrivateContext();
|
|
84
83
|
const {
|
|
85
84
|
view,
|
|
86
|
-
|
|
85
|
+
setView
|
|
87
86
|
} = usePickerContext();
|
|
88
87
|
const classes = useUtilityClasses(classesProp);
|
|
88
|
+
const {
|
|
89
|
+
rangePosition,
|
|
90
|
+
onRangePositionChange
|
|
91
|
+
} = usePickerRangePositionContext();
|
|
89
92
|
const value = React.useMemo(() => view == null ? null : viewToTab(view, rangePosition), [view, rangePosition]);
|
|
90
93
|
const isPreviousHidden = value === 'start-date';
|
|
91
94
|
const isNextHidden = value === 'end-time';
|
|
@@ -112,12 +115,12 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
112
115
|
});
|
|
113
116
|
const changeToPreviousTab = useEventCallback(() => {
|
|
114
117
|
const previousTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) - 1];
|
|
115
|
-
|
|
118
|
+
setView(tabToView(previousTab));
|
|
116
119
|
handleRangePositionChange(previousTab);
|
|
117
120
|
});
|
|
118
121
|
const changeToNextTab = useEventCallback(() => {
|
|
119
122
|
const nextTab = value == null ? tabOptions[0] : tabOptions[tabOptions.indexOf(value) + 1];
|
|
120
|
-
|
|
123
|
+
setView(tabToView(nextTab));
|
|
121
124
|
handleRangePositionChange(nextTab);
|
|
122
125
|
});
|
|
123
126
|
if (hidden) {
|
|
@@ -177,8 +180,6 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerTabs.propTypes = {
|
|
|
177
180
|
* @default `window.innerHeight < 667` for `DesktopDateTimeRangePicker` and `MobileDateTimeRangePicker`
|
|
178
181
|
*/
|
|
179
182
|
hidden: PropTypes.bool,
|
|
180
|
-
onRangePositionChange: PropTypes.func.isRequired,
|
|
181
|
-
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
182
183
|
/**
|
|
183
184
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
184
185
|
*/
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
2
|
import { PickerSelectionState, PickerViewRenderer, TimeViewWithMeridiem, BaseClockProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
view:
|
|
7
|
-
|
|
8
|
-
views: readonly TView[];
|
|
3
|
+
export type DateTimeRangePickerTimeWrapperProps<TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TimeViewWithMeridiem>, 'value' | 'defaultValue' | 'onChange'>, 'views'>> = Omit<TComponentProps, 'views' | 'view' | 'onViewChange' | 'value' | 'defaultValue' | 'onChange'> & {
|
|
4
|
+
view: TimeViewWithMeridiem;
|
|
5
|
+
onViewChange?: (view: TimeViewWithMeridiem) => void;
|
|
6
|
+
views: readonly TimeViewWithMeridiem[];
|
|
9
7
|
value?: PickerRangeValue;
|
|
10
8
|
defaultValue?: PickerRangeValue;
|
|
11
|
-
onChange?: (value: PickerRangeValue, selectionState: PickerSelectionState, selectedView:
|
|
12
|
-
viewRenderer?: PickerViewRenderer<PickerRangeValue,
|
|
13
|
-
openTo?:
|
|
9
|
+
onChange?: (value: PickerRangeValue, selectionState: PickerSelectionState, selectedView: TimeViewWithMeridiem) => void;
|
|
10
|
+
viewRenderer?: PickerViewRenderer<PickerRangeValue, TComponentProps> | null;
|
|
11
|
+
openTo?: TimeViewWithMeridiem;
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
16
14
|
* @ignore - internal component.
|
|
17
15
|
*/
|
|
18
|
-
declare function DateTimeRangePickerTimeWrapper<
|
|
16
|
+
declare function DateTimeRangePickerTimeWrapper<TComponentProps extends DefaultizedProps<Omit<BaseClockProps<TimeViewWithMeridiem>, 'value' | 'defaultValue' | 'onChange'>, 'views'>>(props: DateTimeRangePickerTimeWrapperProps<TComponentProps>): import("react").ReactNode;
|
|
19
17
|
export { DateTimeRangePickerTimeWrapper };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["viewRenderer", "value", "onChange", "defaultValue", "onViewChange", "views", "className"];
|
|
4
4
|
import { isInternalTimeView, useUtils } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { isRangeValid } from "../internals/utils/date-utils.js";
|
|
6
6
|
import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
|
|
7
|
+
import { usePickerRangePositionContext } from "../hooks/index.js";
|
|
7
8
|
/**
|
|
8
9
|
* @ignore - internal component.
|
|
9
10
|
*/
|
|
10
|
-
function DateTimeRangePickerTimeWrapper(props
|
|
11
|
+
function DateTimeRangePickerTimeWrapper(props) {
|
|
11
12
|
const utils = useUtils();
|
|
12
13
|
const {
|
|
13
|
-
rangePosition,
|
|
14
|
-
onRangePositionChange,
|
|
15
14
|
viewRenderer,
|
|
16
15
|
value,
|
|
17
16
|
onChange,
|
|
@@ -20,6 +19,10 @@ function DateTimeRangePickerTimeWrapper(props, ref) {
|
|
|
20
19
|
views
|
|
21
20
|
} = props,
|
|
22
21
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
|
+
const {
|
|
23
|
+
rangePosition,
|
|
24
|
+
onRangePositionChange
|
|
25
|
+
} = usePickerRangePositionContext();
|
|
23
26
|
if (!viewRenderer) {
|
|
24
27
|
return null;
|
|
25
28
|
}
|
|
@@ -47,7 +50,6 @@ function DateTimeRangePickerTimeWrapper(props, ref) {
|
|
|
47
50
|
onChange(newRange, isFullRangeSelected ? 'finish' : 'partial', selectedView);
|
|
48
51
|
};
|
|
49
52
|
return viewRenderer(_extends({}, other, {
|
|
50
|
-
ref,
|
|
51
53
|
views,
|
|
52
54
|
onViewChange,
|
|
53
55
|
value: currentValue,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BaseToolbarProps, ExportedBaseToolbarProps
|
|
3
|
-
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
2
|
+
import { BaseToolbarProps, ExportedBaseToolbarProps } from '@mui/x-date-pickers/internals';
|
|
4
3
|
import { DateTimeRangePickerToolbarClasses } from './dateTimeRangePickerToolbarClasses';
|
|
5
|
-
export interface DateTimeRangePickerToolbarProps extends BaseToolbarProps
|
|
4
|
+
export interface DateTimeRangePickerToolbarProps extends BaseToolbarProps, ExportedDateTimeRangePickerToolbarProps {
|
|
6
5
|
ampm?: boolean;
|
|
7
6
|
}
|
|
8
7
|
export interface ExportedDateTimeRangePickerToolbarProps extends ExportedBaseToolbarProps {
|