@mui/x-date-pickers-pro 8.0.0-alpha.1 → 8.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +228 -7
- package/DateRangePicker/DateRangePicker.types.d.ts +2 -2
- package/DateRangePicker/shared.d.ts +3 -2
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +8 -7
- package/DateTimeRangePicker/shared.d.ts +4 -3
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -12
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +12 -10
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -12
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +11 -9
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -12
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +11 -9
- package/README.md +7 -4
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +5 -5
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +11 -10
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +5 -5
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +11 -10
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -5
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +10 -9
- package/index.js +1 -1
- package/internals/hooks/models/useRangePicker.d.ts +1 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +12 -2
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +13 -12
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +10 -11
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +13 -3
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +6 -7
- package/internals/hooks/useRangePosition.d.ts +3 -2
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +1 -2
- package/internals/models/dateTimeRange.d.ts +2 -2
- package/internals/models/fields.d.ts +6 -6
- package/internals/models/timeRange.d.ts +2 -2
- package/internals/utils/date-fields-utils.d.ts +6 -6
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.d.ts +4 -3
- package/models/dateRange.d.ts +3 -3
- package/models/fields.d.ts +6 -9
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/models/range.d.ts +0 -1
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +8 -7
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -12
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -12
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -12
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +5 -5
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +5 -5
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -5
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +12 -2
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +10 -11
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +13 -3
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.js +2 -1
- package/modern/validation/validateDateRange.js +8 -0
- package/modern/validation/validateDateTimeRange.js +4 -0
- package/modern/validation/validateTimeRange.js +8 -0
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -6
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -11
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -11
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -11
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +4 -4
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +4 -4
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +4 -4
- package/node/index.js +1 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +12 -2
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +10 -11
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +13 -3
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/validation/validateDateRange.js +8 -0
- package/node/validation/validateDateTimeRange.js +4 -0
- package/node/validation/validateTimeRange.js +8 -0
- package/package.json +4 -4
- package/validation/validateDateRange.d.ts +9 -1
- package/validation/validateDateRange.js +8 -0
- package/validation/validateDateTimeRange.d.ts +6 -2
- package/validation/validateDateTimeRange.js +4 -0
- package/validation/validateTimeRange.d.ts +9 -1
- package/validation/validateTimeRange.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,133 @@
|
|
|
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
|
+
## v8.0.0-alpha.2
|
|
9
|
+
|
|
10
|
+
_Nov 29, 2024_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 👨🏽💻 Improve resize performance on the Data Gird.
|
|
15
|
+
- `<ChartDataProvider />` and `<ChartsSurface />` components are now fully divided — [Learn more](https://next.mui.com/x/react-charts/composition/#overview).
|
|
16
|
+
- Users can create their own HTML components using chart data — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
|
|
17
|
+
- 🌍 Improve Spanish, Portuguese, Chinese locales on the Data Grid component.
|
|
18
|
+
- 🌍 Improve Dutch locale on the Date and Time Pickers components.
|
|
19
|
+
- 🐞 Bugfixes
|
|
20
|
+
- 📚 Documentation improvements
|
|
21
|
+
|
|
22
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
23
|
+
@dloeda, @headironc, @jedesroches, @k-rajat19, @lauri865, @mathzdev, @nphmuller, @zinoroman.
|
|
24
|
+
Following are all team members who have contributed to this release:
|
|
25
|
+
@arminmeh, @alexfauquette, @cherniavskii, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @oliviertassinari.
|
|
26
|
+
|
|
27
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### Breaking changes
|
|
32
|
+
|
|
33
|
+
- The `<GridOverlays />` component is not exported anymore.
|
|
34
|
+
- The `indeterminateCheckboxAction` prop has been removed. Clicking on an indeterminate checkbox "selects" the unselected descendants.
|
|
35
|
+
- The `apiRef.current.resize()` method was removed.
|
|
36
|
+
- The default value of the `rowSelectionPropagation` prop has been changed to `{ parents: true, descendants: true }` which means that the selection will be propagated to the parents and descendants by default.
|
|
37
|
+
To revert to the previous behavior, pass `rowSelectionPropagation` as `{ parents: false, descendants: false }`.
|
|
38
|
+
- If `estimatedRowCount` is used, the text provided to the [Table Pagination](/material-ui/api/table-pagination/) component from the Material UI library is updated and requires additional translations. Check the example at the end of [Index-based pagination section](/x/react-data-grid/pagination/#index-based-pagination).
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid@v8.0.0-alpha.2`
|
|
41
|
+
|
|
42
|
+
- [DataGrid] Change test dom check from `/jsdom/` to `/jsdom|HappyDOM/`. (#15634) @jedesroches
|
|
43
|
+
- [DataGrid] Clear timers on unmount (#15620) @cherniavskii
|
|
44
|
+
- [DataGrid] Fix order of spread props on toolbar items (#15556) @KenanYusuf
|
|
45
|
+
- [DataGrid] Improve resize performance (#15549) @lauri865
|
|
46
|
+
- [DataGrid] Make estimation label more accurate (#15632) @arminmeh
|
|
47
|
+
- [DataGrid] Remove `<GridOverlays />` export (#15573) @k-rajat19
|
|
48
|
+
- [DataGrid] Remove `indeterminateCheckboxAction` prop (#15522) @MBilalShafi
|
|
49
|
+
- [DataGrid] Remove try/catch from `<GridCell />` due to performance issues (#15616) @lauri865
|
|
50
|
+
- [DataGrid] Remove unused `resize` method (#15599) @cherniavskii
|
|
51
|
+
- [DataGrid] Support column virtualization with dynamic row height (#15541) @cherniavskii
|
|
52
|
+
- [DataGrid] Update the default value for `rowSelectionPropagation` (#15523) @MBilalShafi
|
|
53
|
+
- [l10n] Improve Chinese (zh-CN) locale (#15570) @headironc
|
|
54
|
+
- [l10n] Improve Portuguese (pt-PT) locale (#15561) @mathzdev
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-data-grid-pro@v8.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-data-grid@v8.0.0-alpha.2`, plus:
|
|
59
|
+
|
|
60
|
+
- [DataGridPro] Fix header filtering with `boolean` column type (#15528) @k-rajat19
|
|
61
|
+
- [DataGridPro] Fix pagination state not updating if the data source response has no rows (#15622) @zinoroman
|
|
62
|
+
- [DataGridPro] Fix selection propagation issue on initialization (#15461) @MBilalShafi
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-data-grid-premium@v8.0.0-alpha.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-data-grid-pro@v8.0.0-alpha.2`.
|
|
67
|
+
|
|
68
|
+
### Date and Time Pickers
|
|
69
|
+
|
|
70
|
+
#### Breaking changes
|
|
71
|
+
|
|
72
|
+
- The props received by the `layout` and the `toolbar` slots have been reworked — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#do-not-pass-the-section-type-as-a-generic).
|
|
73
|
+
|
|
74
|
+
- The `TSection` generic of the `FieldRef` type has been replaced with the `TValue` generic — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slots-breaking-changes).
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-date-pickers@v8.0.0-alpha.2`
|
|
77
|
+
|
|
78
|
+
- [l10n] Improve Dutch (nl-NL) locale (#15564) @nphmuller
|
|
79
|
+
- [pickers] Fix DST issue with `America/Asuncion` timezone and `AdapterMoment` (#15552) @flaviendelangle
|
|
80
|
+
- [pickers] Improve validation internals (#15419) @flaviendelangle
|
|
81
|
+
- [pickers] Remove `TSection` and strictly type `TValue` (#15434) @flaviendelangle
|
|
82
|
+
- [pickers] Remove `orientation`, `isLandscape`, `isRtl`, `wrapperVariant` and `disabled` props from `PickersLayout` (#15494) @flaviendelangle
|
|
83
|
+
- [pickers] Use the new `ownerState` in `<PickersCalendarHeader />`, `<PickersArrowSwitcher />` and `<DayCalendarSkeleton />` (#15499) @flaviendelangle
|
|
84
|
+
- [pickers] Use the new `ownerState` object in all the field components (#15510) @flaviendelangle
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-date-pickers-pro@v8.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
87
|
+
|
|
88
|
+
Same changes as in `@mui/x-date-pickers@v8.0.0-alpha.2`.
|
|
89
|
+
|
|
90
|
+
### Charts
|
|
91
|
+
|
|
92
|
+
#### Breaking changes
|
|
93
|
+
|
|
94
|
+
- Charts Container don't have a `<div />` wrapping them anymore. All props are now passed to the root `<svg />` instead of the `<div />`.
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-charts@v8.0.0-alpha.2`
|
|
97
|
+
|
|
98
|
+
- [charts] Allow the creation of custom HTML components using charts data (#15511) @JCQuintas
|
|
99
|
+
- [charts] Flatten imports from `@mui/utils` and `@mui/system` (#15603) @alexfauquette
|
|
100
|
+
- [charts] Introduce the plugin system (#15513) @alexfauquette
|
|
101
|
+
- [charts] Prevent invalid `releasePointerCapture` (#15602) @alexfauquette
|
|
102
|
+
- [charts] Fix custom Tooltip demos (#15631) @alexfauquette
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-charts-pro@v8.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-charts@v8.0.0-alpha.2`.
|
|
107
|
+
|
|
108
|
+
### Tree View
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-tree-view@v8.0.0-alpha.2`
|
|
111
|
+
|
|
112
|
+
- [TreeView] Flatten import from `@mui/utils` and `@mui/system` (#15604) @alexfauquette
|
|
113
|
+
|
|
114
|
+
#### `@mui/x-tree-view-pro@v8.0.0-alpha.2`
|
|
115
|
+
|
|
116
|
+
Same changes as in `@mui/x-tree-view@v8.0.0-alpha.2`.
|
|
117
|
+
|
|
118
|
+
### Docs
|
|
119
|
+
|
|
120
|
+
- [docs] Fix 404 links (#15575) @oliviertassinari
|
|
121
|
+
- [docs] Fix bash comments (#15571) @oliviertassinari
|
|
122
|
+
- [docs] Fix Pickers theme augmentation example (#15672) @LukasTy
|
|
123
|
+
- [docs] Replace use of "e.g." with "for example" (#15572) @oliviertassinari
|
|
124
|
+
- [docs] Update stale `new` and `preview` tags in v8 docs (#15547) @JCQuintas
|
|
125
|
+
- [docs] Fix layout shift image on Tree View docs (#15626) @oliviertassinari
|
|
126
|
+
- [docs] Fix `anchorEl` API page for charts (#15625) @oliviertassinari
|
|
127
|
+
- [docs] Add documentation for the list view feature (#15344) @KenanYusuf
|
|
128
|
+
|
|
129
|
+
### Core
|
|
130
|
+
|
|
131
|
+
- [core] Follow `()` function convention for docs @oliviertassinari
|
|
132
|
+
- [core] Remove dead translation key (#15566) @oliviertassinari
|
|
133
|
+
- [code-infra] Auto-merge `@types/node` bumps (#15591) @LukasTy
|
|
134
|
+
|
|
8
135
|
## v8.0.0-alpha.1
|
|
9
136
|
|
|
10
137
|
_Nov 22, 2024_
|
|
@@ -17,8 +144,6 @@ We'd like to offer a big thanks to the 16 contributors who made this release pos
|
|
|
17
144
|
- 🐞 Bugfixes
|
|
18
145
|
- 📚 Documentation improvements
|
|
19
146
|
|
|
20
|
-
### Breaking change
|
|
21
|
-
|
|
22
147
|
Special thanks go out to the community contributors who have helped make this release possible:
|
|
23
148
|
@CarlosLopezLg, @headironc, @hendrikpeilke, @k-rajat19, @lhilgert9, @viktormelin.
|
|
24
149
|
Following are all team members who have contributed to this release:
|
|
@@ -56,7 +181,7 @@ Same changes as in `@mui/x-data-grid-pro@v8.0.0-alpha.1`, plus:
|
|
|
56
181
|
#### Breaking change
|
|
57
182
|
|
|
58
183
|
- The `FieldValueType` type has been renamed to `PickerValueType` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables).
|
|
59
|
-
- The `toolbar` and `layout` slots no longer receive the
|
|
184
|
+
- The `toolbar` and `layout` slots no longer receive the `disabled` and `readOnly` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slots-breaking-changes).
|
|
60
185
|
|
|
61
186
|
#### `@mui/x-date-pickers@v8.0.0-alpha.1`
|
|
62
187
|
|
|
@@ -64,9 +189,9 @@ Same changes as in `@mui/x-data-grid-pro@v8.0.0-alpha.1`, plus:
|
|
|
64
189
|
- [pickers] React 19 support (#15342) @arminmeh
|
|
65
190
|
- [pickers] Add new properties to `PickerOwnerState` and `PickerContextValue` (#15415) @flaviendelangle
|
|
66
191
|
- [pickers] Always use `props.value` when it changes (#15490) @flaviendelangle
|
|
67
|
-
- [pickers] Ensure internal value timezone is updated
|
|
192
|
+
- [pickers] Ensure internal value timezone is updated (#15435) @LukasTy
|
|
68
193
|
- [pickers] Fix unused code in `<PickersToolbar />` component (#15515) @LukasTy
|
|
69
|
-
- [pickers] Remove
|
|
194
|
+
- [pickers] Remove `FieldValueType` in favor of `PickerValueType` (#15259) @arthurbalduini
|
|
70
195
|
- [pickers] Remove the form props from the layout and the toolbar slots (#15492) @flaviendelangle
|
|
71
196
|
- [pickers] Use `props.referenceDate` timezone when `props.value` and `props.defaultValue` are not defined (#15532) @flaviendelangle
|
|
72
197
|
- [TimePicker] Prevent mouse events after `touchend` event (#15346) @arthurbalduini
|
|
@@ -82,12 +207,14 @@ Same changes as in `@mui/x-date-pickers@v8.0.0-alpha.1`, plus:
|
|
|
82
207
|
#### Breaking change
|
|
83
208
|
|
|
84
209
|
- The DX of the Tooltip customization has been refactored
|
|
210
|
+
|
|
85
211
|
- The `tooltip` prop has been removed in favor of `slotProps.tooltip` for consistency.
|
|
86
|
-
- The `popper`, `axisContent`,
|
|
212
|
+
- The `popper`, `axisContent`, and `itemContent` slots have been removed in favor of the `tooltip` slot which overrides the entire tooltip.
|
|
87
213
|
- To override the tooltip content, use the `useItemTooltip` or `useAxisTooltip` hook to get the data, and wrap your component in `ChartsTooltipContainer` to follow the pointer position.
|
|
88
214
|
- To override the tooltip placement, use the `ChartsItemTooltipContent` or `ChartsItemTooltipContent` to get default data and place them in your custom tooltip.
|
|
89
215
|
|
|
90
216
|
- The library now uses the SVG `filter` attribute instead of `d3-color` for color manipulation.
|
|
217
|
+
|
|
91
218
|
- This modification impacts the `LinePlot`, `AreaPlot`, and `BarPlot` components.
|
|
92
219
|
If you've customized the `fill` of those elements, you might need to override it by using the CSS `filter`.
|
|
93
220
|
- The `theme.styleOverride` is removed for `MuiLineElement`, `MuiAreaElement`, and `MuiBarElement` to improve performance.
|
|
@@ -338,6 +465,100 @@ Same changes as in `@mui/x-charts@8.0.0-alpha.0`.
|
|
|
338
465
|
- [release] v8 preparation (#15054) @michelengelen
|
|
339
466
|
- [test] Fix advanced list view regression test snapshot (#15260) @KenanYusuf
|
|
340
467
|
|
|
468
|
+
## 7.23.0
|
|
469
|
+
|
|
470
|
+
_Nov 29, 2024_
|
|
471
|
+
|
|
472
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
473
|
+
|
|
474
|
+
- ✨ Support for a new display mode on the Data Grid with the [List View feature](https://mui.com/x/react-data-grid/list-view/), offering an extremely flexible way to render datasets and enabling developers to adapt how data is displayed across different screen sizes.
|
|
475
|
+
|
|
476
|
+
https://github.com/user-attachments/assets/61286adc-03fc-4323-9739-8ca726fcc16c
|
|
477
|
+
|
|
478
|
+
- ⚛️ React 19 support
|
|
479
|
+
- 📚 Documentation improvements
|
|
480
|
+
- 🌍 Improve Spanish, Portuguese, Chinese locales on the Data Grid component.
|
|
481
|
+
- 🌍 Improve Dutch locale on the Date and Time Picker components.
|
|
482
|
+
- 🐞 Bugfixes
|
|
483
|
+
|
|
484
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
485
|
+
@dloeda, @headironc, @mathzdev, @nphmuller, @lhilgert9, @lauri865.
|
|
486
|
+
Following are all team members who have contributed to this release:
|
|
487
|
+
@oliviertassinari, @arminmeh, @KenanYusuf, @flaviendelangle, @MBilalShafi.
|
|
488
|
+
|
|
489
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
490
|
+
|
|
491
|
+
### Data Grid
|
|
492
|
+
|
|
493
|
+
#### `@mui/x-data-grid@v7.23.0`
|
|
494
|
+
|
|
495
|
+
- [DataGrid] React 19 support (#15557) @arminmeh
|
|
496
|
+
- [DataGrid] Change test dom check from `/jsdom/` to `/jsdom|HappyDOM/`. (#15642) @jedesroches
|
|
497
|
+
- [DataGrid] Fix last separator not being hidden when grid is scrollable (#15551) @KenanYusuf
|
|
498
|
+
- [DataGrid] Fix order of spread props on toolbar items (#15556) @KenanYusuf
|
|
499
|
+
- [DataGrid] Fix row-spanning in combination with column-pinning (#15460) @lhilgert9
|
|
500
|
+
- [DataGrid] Improve resize performance (#15592) @lauri865
|
|
501
|
+
- [DataGrid] Support column virtualization with dynamic row height (#15567) @cherniavskii
|
|
502
|
+
- [DataGrid] Improve `GridCell` performance (#15621) @lauri865
|
|
503
|
+
- [l10n] Improve Chinese (zh-CN) locale (#15570) @headironc
|
|
504
|
+
- [l10n] Improve Portuguese (pt-PT) locale (#15561) @mathzdev
|
|
505
|
+
|
|
506
|
+
#### `@mui/x-data-grid-pro@v7.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
507
|
+
|
|
508
|
+
Same changes as in `@mui/x-data-grid@v7.23.0`, plus:
|
|
509
|
+
|
|
510
|
+
- [DataGridPro] Fix header filtering with `boolean` column type (#15640) @k-rajat19
|
|
511
|
+
- [DataGridPro] Fix pagination state not updating if the data source response has no rows (#15643) @zinoroman
|
|
512
|
+
- [DataGridPro] Fix selection propagation issue on initialization (#15593) @MBilalShafi
|
|
513
|
+
|
|
514
|
+
#### `@mui/x-data-grid-premium@v7.23.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
515
|
+
|
|
516
|
+
Same changes as in `@mui/x-data-grid-pro@v7.23.0`.
|
|
517
|
+
|
|
518
|
+
### Date and Time Pickers
|
|
519
|
+
|
|
520
|
+
#### `@mui/x-date-pickers@v7.23.0`
|
|
521
|
+
|
|
522
|
+
- [pickers] React 19 support (#15557) @arminmeh
|
|
523
|
+
- [pickers] Fix DST issue with `America/Asuncion` timezone and `AdapterMoment` (#15653) @flaviendelangle
|
|
524
|
+
- [pickers] Use `props.referenceDate` timezone when `props.value` and `props.defaultValue` are not defined (#15544) @flaviendelangle
|
|
525
|
+
- [l10n] Improve Dutch (nl-NL) locale (#15564) @nphmuller
|
|
526
|
+
|
|
527
|
+
#### `@mui/x-date-pickers-pro@v7.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
528
|
+
|
|
529
|
+
Same changes as in `@mui/x-date-pickers@v7.23.0`.
|
|
530
|
+
|
|
531
|
+
### Charts
|
|
532
|
+
|
|
533
|
+
#### `@mui/x-charts@v7.23.0`
|
|
534
|
+
|
|
535
|
+
- [charts] React 19 support (#15557) @arminmeh
|
|
536
|
+
- [charts] Prevent invalid `releasePointerCapture` (#15609) @alexfauquette
|
|
537
|
+
|
|
538
|
+
#### `@mui/x-charts-pro@v7.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
539
|
+
|
|
540
|
+
Same changes as in `@mui/x-charts@v7.23.0`.
|
|
541
|
+
|
|
542
|
+
### Tree View
|
|
543
|
+
|
|
544
|
+
#### `@mui/x-tree-view@v7.23.0`
|
|
545
|
+
|
|
546
|
+
- [TreeView] React 19 support (#15557) @arminmeh
|
|
547
|
+
|
|
548
|
+
#### `@mui/x-tree-view-pro@7.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
549
|
+
|
|
550
|
+
Same changes as in `@mui/x-tree-view@7.23.0`.
|
|
551
|
+
|
|
552
|
+
### Docs
|
|
553
|
+
|
|
554
|
+
- [docs] Add data caching to lazy loaded detail panel demo (#15555) @cherniavskii
|
|
555
|
+
- [docs] Remove selectors section from list view docs (#15639) @KenanYusuf
|
|
556
|
+
- [docs] Add documentation for the list view feature (#15344) @KenanYusuf
|
|
557
|
+
|
|
558
|
+
### Core
|
|
559
|
+
|
|
560
|
+
- [core] Update @mui/monorepo (#15574) @oliviertassinari
|
|
561
|
+
|
|
341
562
|
## v7.22.3
|
|
342
563
|
|
|
343
564
|
_Nov 21, 2024_
|
|
@@ -4803,7 +5024,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.
|
|
|
4803
5024
|
|
|
4804
5025
|
The `useClearableField` hook API has been simplified to now take a `props` parameter instead of a `fieldProps`, `InputProps`, `clearable`, `onClear`, `slots` and `slotProps` parameters.
|
|
4805
5026
|
|
|
4806
|
-
You should now be able to directly pass the returned value from your field hook (
|
|
5027
|
+
You should now be able to directly pass the returned value from your field hook (for example `useDateField`) to `useClearableField`
|
|
4807
5028
|
|
|
4808
5029
|
```diff
|
|
4809
5030
|
const fieldResponse = useDateField(props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseSingleInputFieldProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { DesktopDateRangePickerProps, DesktopDateRangePickerSlots, DesktopDateRangePickerSlotProps } from '../DesktopDateRangePicker';
|
|
3
3
|
import { MobileDateRangePickerProps, MobileDateRangePickerSlots, MobileDateRangePickerSlotProps } from '../MobileDateRangePicker';
|
|
4
|
-
import { DateRangeValidationError
|
|
4
|
+
import { DateRangeValidationError } from '../models';
|
|
5
5
|
import { ValidateDateRangeProps } from '../validation';
|
|
6
6
|
export interface DateRangePickerSlots extends DesktopDateRangePickerSlots, MobileDateRangePickerSlots {
|
|
7
7
|
}
|
|
@@ -28,4 +28,4 @@ export interface DateRangePickerProps<TEnableAccessibleFieldDOMStructure extends
|
|
|
28
28
|
/**
|
|
29
29
|
* Props the field can receive when used inside a date range picker (<DateRangePicker />, <DesktopDateRangePicker /> or <MobileDateRangePicker /> component).
|
|
30
30
|
*/
|
|
31
|
-
export type DateRangePickerFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = ValidateDateRangeProps & BaseSingleInputFieldProps<PickerRangeValue,
|
|
31
|
+
export type DateRangePickerFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = ValidateDateRangeProps & BaseSingleInputFieldProps<PickerRangeValue, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
import { LocalizedComponent } from '@mui/x-date-pickers/locales';
|
|
4
|
-
import {
|
|
4
|
+
import { BasePickerInputProps, PickerViewRendererLookup, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { DateRangeValidationError } from '../models';
|
|
6
6
|
import { DateRangeCalendarSlots, DateRangeCalendarSlotProps, ExportedDateRangeCalendarProps } from '../DateRangeCalendar';
|
|
7
7
|
import { DateRangePickerToolbarProps, ExportedDateRangePickerToolbarProps } from './DateRangePickerToolbar';
|
|
8
8
|
import { DateRangeViewRendererProps } from '../dateRangeViewRenderers';
|
|
9
|
+
import { ValidateDateRangePropsToDefault } from '../validation/validateDateRange';
|
|
9
10
|
export interface BaseDateRangePickerSlots extends DateRangeCalendarSlots {
|
|
10
11
|
/**
|
|
11
12
|
* Custom component for the toolbar rendered above the views.
|
|
@@ -34,6 +35,6 @@ export interface BaseDateRangePickerProps extends Omit<BasePickerInputProps<Pick
|
|
|
34
35
|
*/
|
|
35
36
|
viewRenderers?: Partial<PickerViewRendererLookup<PickerRangeValue, 'day', DateRangeViewRendererProps<'day'>, {}>>;
|
|
36
37
|
}
|
|
37
|
-
type UseDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps> = LocalizedComponent<DefaultizedProps<Props,
|
|
38
|
+
type UseDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps> = LocalizedComponent<DefaultizedProps<Props, ValidateDateRangePropsToDefault>>;
|
|
38
39
|
export declare function useDateRangePickerDefaultizedProps<Props extends BaseDateRangePickerProps>(props: Props, name: string): UseDateRangePickerDefaultizedProps<Props>;
|
|
39
40
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseSingleInputFieldProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { DesktopDateTimeRangePickerProps, DesktopDateTimeRangePickerSlots, DesktopDateTimeRangePickerSlotProps } from '../DesktopDateTimeRangePicker';
|
|
3
3
|
import { MobileDateTimeRangePickerProps, MobileDateTimeRangePickerSlots, MobileDateTimeRangePickerSlotProps } from '../MobileDateTimeRangePicker';
|
|
4
|
-
import { DateTimeRangeValidationError
|
|
4
|
+
import { DateTimeRangeValidationError } from '../models';
|
|
5
5
|
import type { ValidateDateTimeRangeProps } from '../validation';
|
|
6
6
|
export interface DateTimeRangePickerSlots extends DesktopDateTimeRangePickerSlots, MobileDateTimeRangePickerSlots {
|
|
7
7
|
}
|
|
@@ -28,4 +28,4 @@ export interface DateTimeRangePickerProps<TEnableAccessibleFieldDOMStructure ext
|
|
|
28
28
|
/**
|
|
29
29
|
* Props the field can receive when used inside a date time range picker (<DateTimeRangePicker />, <DesktopDateTimeRangePicker /> or <MobileDateTimeRangePicker /> component).
|
|
30
30
|
*/
|
|
31
|
-
export type DateTimeRangePickerFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = ValidateDateTimeRangeProps & BaseSingleInputFieldProps<PickerRangeValue,
|
|
31
|
+
export type DateTimeRangePickerFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = ValidateDateTimeRangeProps & BaseSingleInputFieldProps<PickerRangeValue, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>;
|
|
@@ -7,7 +7,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
9
9
|
import { TimeIcon, DateRangeIcon, ArrowLeftIcon, ArrowRightIcon } from '@mui/x-date-pickers/icons';
|
|
10
|
-
import { isDatePickerView } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { isDatePickerView, usePickerPrivateContext } from '@mui/x-date-pickers/internals';
|
|
11
11
|
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
12
12
|
import IconButton from '@mui/material/IconButton';
|
|
13
13
|
import Button from '@mui/material/Button';
|
|
@@ -25,10 +25,7 @@ const tabToView = tab => {
|
|
|
25
25
|
}
|
|
26
26
|
return 'hours';
|
|
27
27
|
};
|
|
28
|
-
const useUtilityClasses =
|
|
29
|
-
const {
|
|
30
|
-
classes
|
|
31
|
-
} = ownerState;
|
|
28
|
+
const useUtilityClasses = classes => {
|
|
32
29
|
const slots = {
|
|
33
30
|
root: ['root'],
|
|
34
31
|
tabButton: ['tabButton'],
|
|
@@ -79,10 +76,14 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
79
76
|
rangePosition,
|
|
80
77
|
onRangePositionChange,
|
|
81
78
|
className,
|
|
79
|
+
classes: classesProp,
|
|
82
80
|
sx
|
|
83
81
|
} = props;
|
|
84
82
|
const translations = usePickerTranslations();
|
|
85
|
-
const
|
|
83
|
+
const {
|
|
84
|
+
ownerState
|
|
85
|
+
} = usePickerPrivateContext();
|
|
86
|
+
const classes = useUtilityClasses(classesProp);
|
|
86
87
|
const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
|
|
87
88
|
const isPreviousHidden = value === 'start-date';
|
|
88
89
|
const isNextHidden = value === 'end-time';
|
|
@@ -121,7 +122,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
121
122
|
return null;
|
|
122
123
|
}
|
|
123
124
|
return /*#__PURE__*/_jsxs(DateTimeRangePickerTabsRoot, {
|
|
124
|
-
ownerState:
|
|
125
|
+
ownerState: ownerState,
|
|
125
126
|
className: clsx(classes.root, className),
|
|
126
127
|
sx: sx,
|
|
127
128
|
children: [!isPreviousHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
import { LocalizedComponent } from '@mui/x-date-pickers/locales';
|
|
4
|
-
import {
|
|
4
|
+
import { BasePickerInputProps, PickerViewRendererLookup, BaseClockProps, DesktopOnlyTimePickerProps, TimeViewWithMeridiem, UseViewsOptions, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { TimeViewRendererProps } from '@mui/x-date-pickers/timeViewRenderers';
|
|
6
6
|
import { DigitalClockSlots, DigitalClockSlotProps } from '@mui/x-date-pickers/DigitalClock';
|
|
7
7
|
import { MultiSectionDigitalClockSlots, MultiSectionDigitalClockSlotProps } from '@mui/x-date-pickers/MultiSectionDigitalClock';
|
|
@@ -11,6 +11,7 @@ import { DateRangeCalendarSlots, DateRangeCalendarSlotProps, ExportedDateRangeCa
|
|
|
11
11
|
import { DateTimeRangePickerToolbarProps, ExportedDateTimeRangePickerToolbarProps } from './DateTimeRangePickerToolbar';
|
|
12
12
|
import { DateRangeViewRendererProps } from '../dateRangeViewRenderers';
|
|
13
13
|
import { DateTimeRangePickerTabsProps, ExportedDateTimeRangePickerTabsProps } from './DateTimeRangePickerTabs';
|
|
14
|
+
import { ExportedValidateDateTimeRangeProps, ValidateDateTimeRangePropsToDefault } from '../validation/validateDateTimeRange';
|
|
14
15
|
export interface BaseDateTimeRangePickerSlots extends DateRangeCalendarSlots, DigitalClockSlots, MultiSectionDigitalClockSlots {
|
|
15
16
|
/**
|
|
16
17
|
* Tabs enabling toggling between date and time pickers.
|
|
@@ -36,7 +37,7 @@ export interface BaseDateTimeRangePickerSlotProps extends DateRangeCalendarSlotP
|
|
|
36
37
|
export type DateTimeRangePickerRenderers<TView extends DateOrTimeViewWithMeridiem, TAdditionalProps extends {} = {}> = PickerViewRendererLookup<PickerRangeValue, TView, Omit<DateRangeViewRendererProps<'day'>, 'view' | 'slots' | 'slotProps'> & Omit<TimeViewRendererProps<TimeViewWithMeridiem, BaseClockProps<TimeViewWithMeridiem>>, 'view' | 'slots' | 'slotProps'> & {
|
|
37
38
|
view: TView;
|
|
38
39
|
}, TAdditionalProps>;
|
|
39
|
-
export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<PickerRangeValue, DateTimeRangePickerView, DateTimeRangeValidationError>, 'orientation' | 'views' | 'openTo'>, ExportedDateRangeCalendarProps,
|
|
40
|
+
export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<PickerRangeValue, DateTimeRangePickerView, DateTimeRangeValidationError>, 'orientation' | 'views' | 'openTo'>, ExportedDateRangeCalendarProps, ExportedValidateDateTimeRangeProps, DesktopOnlyTimePickerProps, Partial<Pick<UseViewsOptions<PickerRangeValue, DateTimeRangePickerViewExternal>, 'openTo' | 'views'>> {
|
|
40
41
|
/**
|
|
41
42
|
* Overridable component slots.
|
|
42
43
|
* @default {}
|
|
@@ -54,7 +55,7 @@ export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<
|
|
|
54
55
|
*/
|
|
55
56
|
viewRenderers?: Partial<DateTimeRangePickerRenderers<DateTimeRangePickerView>>;
|
|
56
57
|
}
|
|
57
|
-
type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' |
|
|
58
|
+
type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' | ValidateDateTimeRangePropsToDefault>, 'views'>> & {
|
|
58
59
|
shouldRenderTimeInASingleColumn: boolean;
|
|
59
60
|
views: readonly DateTimeRangePickerView[];
|
|
60
61
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
5
|
+
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -12,17 +12,14 @@ import Typography from '@mui/material/Typography';
|
|
|
12
12
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
13
13
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
14
|
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
15
|
+
import { convertFieldResponseIntoMuiTextFieldProps, useFieldOwnerState } from '@mui/x-date-pickers/internals';
|
|
16
16
|
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
17
|
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
18
|
import { useMultiInputDateRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
21
21
|
export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
22
|
-
const useUtilityClasses =
|
|
23
|
-
const {
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
22
|
+
const useUtilityClasses = classes => {
|
|
26
23
|
const slots = {
|
|
27
24
|
root: ['root'],
|
|
28
25
|
separator: ['separator']
|
|
@@ -70,11 +67,12 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
70
67
|
slotProps,
|
|
71
68
|
unstableStartFieldRef,
|
|
72
69
|
unstableEndFieldRef,
|
|
73
|
-
className
|
|
70
|
+
className,
|
|
71
|
+
classes: classesProp
|
|
74
72
|
} = forwardedProps,
|
|
75
73
|
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
76
|
-
const ownerState =
|
|
77
|
-
const classes = useUtilityClasses(
|
|
74
|
+
const ownerState = useFieldOwnerState(internalProps);
|
|
75
|
+
const classes = useUtilityClasses(classesProp);
|
|
78
76
|
const Root = slots?.root ?? MultiInputDateRangeFieldRoot;
|
|
79
77
|
const rootProps = useSlotProps({
|
|
80
78
|
elementType: Root,
|
|
@@ -258,10 +256,10 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
258
256
|
*/
|
|
259
257
|
shouldDisableDate: PropTypes.func,
|
|
260
258
|
/**
|
|
261
|
-
* If `true`, the format will respect the leading zeroes (
|
|
262
|
-
* If `false`, the format will always add leading zeroes (
|
|
259
|
+
* If `true`, the format will respect the leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
260
|
+
* If `false`, the format will always add leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
263
261
|
*
|
|
264
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (
|
|
262
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (for example "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
265
263
|
*
|
|
266
264
|
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
267
265
|
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import type { TypographyProps } from '@mui/material/Typography';
|
|
3
|
+
import type { StackProps } from '@mui/material/Stack';
|
|
4
|
+
import type { TextFieldProps } from '@mui/material/TextField';
|
|
5
|
+
import { FieldOwnerState } from '@mui/x-date-pickers/models';
|
|
6
|
+
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
7
|
+
import { PickersTextFieldProps } from '@mui/x-date-pickers/PickersTextField';
|
|
6
8
|
import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
|
|
7
9
|
import { MultiInputFieldRefs, MultiInputRangeFieldClasses, RangePosition, UseDateRangeFieldProps } from '../models';
|
|
8
10
|
export type UseMultiInputDateRangeFieldParams<TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure>, TTextFieldSlotProps>;
|
|
@@ -24,7 +26,7 @@ export interface MultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructur
|
|
|
24
26
|
* The props used for each component slot.
|
|
25
27
|
* @default {}
|
|
26
28
|
*/
|
|
27
|
-
slotProps?: MultiInputDateRangeFieldSlotProps
|
|
29
|
+
slotProps?: MultiInputDateRangeFieldSlotProps;
|
|
28
30
|
}
|
|
29
31
|
export interface MultiInputDateRangeFieldSlots {
|
|
30
32
|
/**
|
|
@@ -35,7 +37,7 @@ export interface MultiInputDateRangeFieldSlots {
|
|
|
35
37
|
/**
|
|
36
38
|
* Form control with an input to render a date.
|
|
37
39
|
* It is rendered twice: once for the start date and once for the end date.
|
|
38
|
-
* @default TextField from '@mui/material'
|
|
40
|
+
* @default <PickersTextField />, or <TextField /> from '@mui/material' if `enableAccessibleFieldDOMStructure` is `false`.
|
|
39
41
|
*/
|
|
40
42
|
textField?: React.ElementType;
|
|
41
43
|
/**
|
|
@@ -44,10 +46,10 @@ export interface MultiInputDateRangeFieldSlots {
|
|
|
44
46
|
*/
|
|
45
47
|
separator?: React.ElementType;
|
|
46
48
|
}
|
|
47
|
-
export interface MultiInputDateRangeFieldSlotProps
|
|
48
|
-
root?:
|
|
49
|
-
textField?:
|
|
49
|
+
export interface MultiInputDateRangeFieldSlotProps {
|
|
50
|
+
root?: SlotComponentPropsFromProps<StackProps, {}, FieldOwnerState>;
|
|
51
|
+
textField?: SlotComponentPropsFromProps<PickersTextFieldProps | TextFieldProps, {}, FieldOwnerState & {
|
|
50
52
|
position: RangePosition;
|
|
51
53
|
}>;
|
|
52
|
-
separator?:
|
|
54
|
+
separator?: SlotComponentPropsFromProps<TypographyProps, {}, FieldOwnerState>;
|
|
53
55
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
5
|
+
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -12,17 +12,14 @@ import Typography from '@mui/material/Typography';
|
|
|
12
12
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
13
13
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
14
|
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
15
|
+
import { convertFieldResponseIntoMuiTextFieldProps, useFieldOwnerState } from '@mui/x-date-pickers/internals';
|
|
16
16
|
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
17
|
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
18
|
import { useMultiInputDateTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
export const multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
|
|
21
21
|
export const getMultiInputDateTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
|
|
22
|
-
const useUtilityClasses =
|
|
23
|
-
const {
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
22
|
+
const useUtilityClasses = classes => {
|
|
26
23
|
const slots = {
|
|
27
24
|
root: ['root'],
|
|
28
25
|
separator: ['separator']
|
|
@@ -70,11 +67,12 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
70
67
|
slotProps,
|
|
71
68
|
unstableStartFieldRef,
|
|
72
69
|
unstableEndFieldRef,
|
|
73
|
-
className
|
|
70
|
+
className,
|
|
71
|
+
classes: classesProp
|
|
74
72
|
} = forwardedProps,
|
|
75
73
|
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
76
|
-
const ownerState = themeProps;
|
|
77
|
-
const classes = useUtilityClasses(
|
|
74
|
+
const ownerState = useFieldOwnerState(themeProps);
|
|
75
|
+
const classes = useUtilityClasses(classesProp);
|
|
78
76
|
const Root = slots?.root ?? MultiInputDateTimeRangeFieldRoot;
|
|
79
77
|
const rootProps = useSlotProps({
|
|
80
78
|
elementType: Root,
|
|
@@ -298,10 +296,10 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
298
296
|
*/
|
|
299
297
|
shouldDisableTime: PropTypes.func,
|
|
300
298
|
/**
|
|
301
|
-
* If `true`, the format will respect the leading zeroes (
|
|
302
|
-
* If `false`, the format will always add leading zeroes (
|
|
299
|
+
* If `true`, the format will respect the leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
300
|
+
* If `false`, the format will always add leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
303
301
|
*
|
|
304
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (
|
|
302
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (for example "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
305
303
|
*
|
|
306
304
|
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
307
305
|
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import type { TypographyProps } from '@mui/material/Typography';
|
|
3
|
+
import type { StackProps } from '@mui/material/Stack';
|
|
4
|
+
import type { TextFieldProps } from '@mui/material/TextField';
|
|
5
|
+
import { FieldOwnerState } from '@mui/x-date-pickers/models';
|
|
6
|
+
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
7
|
+
import { PickersTextFieldProps } from '@mui/x-date-pickers/PickersTextField';
|
|
6
8
|
import { UseDateTimeRangeFieldProps } from '../internals/models/dateTimeRange';
|
|
7
9
|
import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
|
|
8
10
|
import { MultiInputFieldRefs, MultiInputRangeFieldClasses, RangePosition } from '../models';
|
|
@@ -25,7 +27,7 @@ export interface MultiInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStru
|
|
|
25
27
|
* The props used for each component slot.
|
|
26
28
|
* @default {}
|
|
27
29
|
*/
|
|
28
|
-
slotProps?: MultiInputDateTimeRangeFieldSlotProps
|
|
30
|
+
slotProps?: MultiInputDateTimeRangeFieldSlotProps;
|
|
29
31
|
}
|
|
30
32
|
export interface MultiInputDateTimeRangeFieldSlots {
|
|
31
33
|
/**
|
|
@@ -45,10 +47,10 @@ export interface MultiInputDateTimeRangeFieldSlots {
|
|
|
45
47
|
*/
|
|
46
48
|
separator?: React.ElementType;
|
|
47
49
|
}
|
|
48
|
-
export interface MultiInputDateTimeRangeFieldSlotProps
|
|
49
|
-
root?:
|
|
50
|
-
textField?:
|
|
50
|
+
export interface MultiInputDateTimeRangeFieldSlotProps {
|
|
51
|
+
root?: SlotComponentPropsFromProps<StackProps, {}, FieldOwnerState>;
|
|
52
|
+
textField?: SlotComponentPropsFromProps<PickersTextFieldProps | TextFieldProps, {}, FieldOwnerState & {
|
|
51
53
|
position: RangePosition;
|
|
52
54
|
}>;
|
|
53
|
-
separator?:
|
|
55
|
+
separator?: SlotComponentPropsFromProps<TypographyProps, {}, FieldOwnerState>;
|
|
54
56
|
}
|