@mui/x-data-grid 7.0.0-beta.7 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +266 -12
- package/DataGrid/DataGrid.js +18 -17
- package/DataGrid/useDataGridProps.js +4 -5
- package/README.md +1 -1
- package/components/GridFooter.js +2 -3
- package/components/GridHeader.js +1 -2
- package/components/GridPagination.d.ts +6 -5
- package/components/GridPagination.js +12 -4
- package/components/GridRow.js +13 -17
- package/components/base/GridFooterPlaceholder.js +1 -2
- package/components/base/GridOverlays.js +3 -6
- package/components/cell/GridActionsCell.js +4 -6
- package/components/cell/GridActionsCellItem.d.ts +8 -25
- package/components/cell/GridActionsCellItem.js +8 -5
- package/components/cell/GridBooleanCell.d.ts +1 -0
- package/components/cell/GridBooleanCell.js +3 -2
- package/components/cell/GridCell.js +7 -8
- package/components/cell/GridEditBooleanCell.js +1 -2
- package/components/cell/GridEditDateCell.js +2 -3
- package/components/cell/GridEditInputCell.js +2 -2
- package/components/cell/GridEditSingleSelectCell.js +5 -8
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
- package/components/columnHeaders/GridColumnGroupHeader.js +4 -5
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
- package/components/columnHeaders/GridColumnHeaderItem.js +8 -7
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +4 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
- package/components/columnSelection/GridHeaderCheckbox.js +1 -2
- package/components/columnsManagement/GridColumnsManagement.js +17 -21
- package/components/containers/GridRoot.js +3 -3
- package/components/menu/GridMenu.js +4 -6
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanel.d.ts +1 -10
- package/components/panel/GridPanel.js +1 -2
- package/components/panel/GridPreferencesPanel.js +2 -3
- package/components/panel/filterPanel/GridFilterForm.js +24 -27
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
- package/components/panel/filterPanel/GridFilterPanel.js +5 -9
- package/components/panel/filterPanel/filterPanelUtils.js +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -5
- package/components/toolbar/GridToolbarDensitySelector.js +8 -10
- package/components/toolbar/GridToolbarExport.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +3 -5
- package/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/components/toolbar/GridToolbarQuickFilter.js +21 -7
- package/components/virtualization/GridVirtualScrollerContent.js +1 -2
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -2
- package/hooks/core/useGridApiInitialization.js +4 -6
- package/hooks/features/clipboard/useGridClipboard.js +6 -5
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -8
- package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +9 -19
- package/hooks/features/columns/gridColumnsSelector.js +1 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
- package/hooks/features/columns/gridColumnsUtils.js +2 -22
- package/hooks/features/columns/useGridColumnSpanning.js +1 -2
- package/hooks/features/columns/useGridColumns.js +11 -19
- package/hooks/features/density/densitySelector.d.ts +4 -2
- package/hooks/features/density/densitySelector.js +8 -2
- package/hooks/features/density/densityState.d.ts +1 -4
- package/hooks/features/density/useGridDensity.d.ts +2 -4
- package/hooks/features/density/useGridDensity.js +21 -29
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +6 -7
- package/hooks/features/editing/useGridCellEditing.js +4 -6
- package/hooks/features/editing/useGridEditing.js +1 -2
- package/hooks/features/editing/useGridRowEditing.js +17 -10
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
- package/hooks/features/export/serializers/csvSerializer.js +25 -16
- package/hooks/features/export/useGridCsvExport.js +9 -10
- package/hooks/features/export/useGridPrintExport.js +9 -15
- package/hooks/features/export/utils.js +2 -3
- package/hooks/features/filter/gridFilterSelector.js +15 -22
- package/hooks/features/filter/gridFilterUtils.js +10 -16
- package/hooks/features/filter/useGridFilter.js +9 -15
- package/hooks/features/focus/useGridFocus.js +5 -6
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +1 -4
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +12 -17
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
- package/hooks/features/pagination/gridPaginationSelector.js +1 -2
- package/hooks/features/pagination/useGridPagination.js +2 -3
- package/hooks/features/pagination/useGridPaginationModel.js +6 -11
- package/hooks/features/pagination/useGridRowCount.js +3 -6
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
- package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
- package/hooks/features/rows/gridRowsSelector.js +11 -19
- package/hooks/features/rows/gridRowsUtils.js +7 -9
- package/hooks/features/rows/useGridParamsApi.js +1 -1
- package/hooks/features/rows/useGridRows.js +4 -13
- package/hooks/features/rows/useGridRowsMeta.js +7 -13
- package/hooks/features/scroll/useGridScroll.js +2 -3
- package/hooks/features/sorting/gridSortingSelector.js +4 -7
- package/hooks/features/sorting/useGridSorting.js +8 -14
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
- package/hooks/utils/useGridApiEventHandler.js +5 -10
- package/hooks/utils/useGridNativeEventListener.js +1 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +1 -0
- package/internals/utils/useProps.js +1 -2
- package/joy/joySlots.js +7 -13
- package/models/api/gridRowsMetaApi.d.ts +1 -1
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +7 -0
- package/models/gridExport.d.ts +6 -0
- package/models/gridStateCommunity.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +26 -25
- package/modern/DataGrid/DataGrid.js +18 -17
- package/modern/DataGrid/useDataGridProps.js +4 -5
- package/modern/components/GridPagination.js +11 -2
- package/modern/components/cell/GridActionsCell.js +1 -1
- package/modern/components/cell/GridActionsCellItem.js +4 -0
- package/modern/components/cell/GridBooleanCell.js +3 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +3 -1
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -1
- package/modern/components/containers/GridRoot.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
- package/modern/components/toolbar/GridToolbarQuickFilter.js +17 -2
- package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +1 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +0 -19
- package/modern/hooks/features/density/densitySelector.js +8 -2
- package/modern/hooks/features/density/useGridDensity.js +21 -29
- package/modern/hooks/features/dimensions/useGridDimensions.js +3 -2
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +14 -5
- package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/modern/hooks/features/export/useGridCsvExport.js +2 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -0
- package/modern/models/api/index.js +0 -1
- package/modern/utils/createSelector.js +1 -1
- package/modern/utils/domUtils.js +1 -1
- package/modern/utils/keyboardUtils.js +1 -1
- package/modern/utils/throttle.js +19 -0
- package/node/DataGrid/DataGrid.js +18 -17
- package/node/DataGrid/useDataGridProps.js +4 -5
- package/node/components/GridPagination.js +9 -1
- package/node/components/cell/GridActionsCell.js +1 -1
- package/node/components/cell/GridActionsCellItem.js +4 -0
- package/node/components/cell/GridBooleanCell.js +3 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +3 -1
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -1
- package/node/components/containers/GridRoot.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
- package/node/components/toolbar/GridToolbarQuickFilter.js +17 -2
- package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +1 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +0 -20
- package/node/hooks/features/density/densitySelector.js +9 -3
- package/node/hooks/features/density/useGridDensity.js +22 -30
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -1
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +14 -5
- package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/node/hooks/features/export/useGridCsvExport.js +2 -1
- package/node/hooks/features/filter/gridFilterUtils.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
- package/node/index.js +1 -1
- package/node/internals/index.js +12 -0
- package/node/models/api/index.js +0 -11
- package/node/utils/createSelector.js +1 -1
- package/node/utils/domUtils.js +1 -1
- package/node/utils/keyboardUtils.js +1 -1
- package/node/utils/throttle.js +25 -0
- package/package.json +4 -4
- package/utils/createSelector.js +9 -9
- package/utils/domUtils.js +4 -7
- package/utils/getGridLocalization.js +9 -12
- package/utils/keyboardUtils.js +1 -1
- package/utils/throttle.d.ts +4 -0
- package/utils/throttle.js +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,260 @@
|
|
|
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.1.0
|
|
7
|
+
|
|
8
|
+
_Mar 28, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Add `resizeThrottleMs` prop (#12556) @romgrk
|
|
13
|
+
- 🌍 Improve Chinese (Hong Kong) (zh-HK) and Italian (it-IT) locale on the Pickers
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@7.1.0`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Add `resizeThrottleMs` prop (#12556) @romgrk
|
|
22
|
+
- [DataGrid] Do not publish `rowEditStop` event if row has fields with errors (#11383) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix bug in suspense (#12553) @romgrk
|
|
24
|
+
- [DataGrid] Fix missing class name in the `GridToolbarQuickFilter` component (#12484) @jhawkins11
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@7.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@7.1.0`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@7.1.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@7.1.0`.
|
|
33
|
+
|
|
34
|
+
### Date and Time Pickers
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers@7.1.0`
|
|
37
|
+
|
|
38
|
+
- [fields] Fix placeholder override (#12589) @flaviendelangle
|
|
39
|
+
- [l10n] Improve Chinese (Hong Kong) (zh-HK) locale (#12547) @samchiu90
|
|
40
|
+
- [l10n] Improve Italian (it-IT) locale (#12549) @antomanc
|
|
41
|
+
- [pickers] Prepare compatibility with `@mui/zero-runtime` (stop using `ownerState` in `styled`) (#12003) @flaviendelangle
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-date-pickers-pro@7.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
44
|
+
|
|
45
|
+
Same changes as in `@mui/x-date-pickers@7.1.0`, plus:
|
|
46
|
+
|
|
47
|
+
- [DateRangePicker] Fix selection behavior with single input field when `readOnly` (#12593) @LukasTy
|
|
48
|
+
|
|
49
|
+
### Charts
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-charts@7.1.0`
|
|
52
|
+
|
|
53
|
+
- [charts] Fix tooltip causing crash on data change (#12571) @Rishi556
|
|
54
|
+
|
|
55
|
+
### Tree View
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-tree-view@7.1.0`
|
|
58
|
+
|
|
59
|
+
- [TreeView] Do not use outdated version of the state to compute new label first char in `RichTreeView` (#12512) @flaviendelangle
|
|
60
|
+
|
|
61
|
+
### Docs
|
|
62
|
+
|
|
63
|
+
- [docs] Add example to add a second icon next to the field's opening button (#12524) @flaviendelangle
|
|
64
|
+
- [docs] Add missing note to Data Grid migration guide (#12557) @romgrk
|
|
65
|
+
- [docs] Fix Charts title for SEO (#12545) @oliviertassinari
|
|
66
|
+
- [docs] Fix small typo (#12558) @diogoparente
|
|
67
|
+
- [docs] Improve codemod related documentation (#12582) @MBilalShafi
|
|
68
|
+
- [docs] Reduce noise in migration docs side navigation (#12552) @cherniavskii
|
|
69
|
+
- [docs] Sync static images from core repository (#12525) @LukasTy
|
|
70
|
+
|
|
71
|
+
### Core
|
|
72
|
+
|
|
73
|
+
- [core] Fix `l10n` script on Windows (#12550) @LukasTy
|
|
74
|
+
- [core] Include `DateTimeRangePicker` tag in `releaseChangelog` (#12526) @LukasTy
|
|
75
|
+
- [core] Upgrade monorepo (#12536) @cherniavskii
|
|
76
|
+
|
|
77
|
+
## v7.0.0
|
|
78
|
+
|
|
79
|
+
_Mar 22, 2024_
|
|
80
|
+
|
|
81
|
+
We're excited to [announce the first v7 stable release](https://mui.com/blog/mui-x-v7/)! 🎉🚀
|
|
82
|
+
|
|
83
|
+
This is now the officially supported major version, where we'll keep rolling out new features, bug fixes, and improvements.
|
|
84
|
+
Migration guides are available with a complete list of the breaking changes:
|
|
85
|
+
|
|
86
|
+
- [Data Grid](https://mui.com/x/migration/migration-data-grid-v6/)
|
|
87
|
+
- [Date and Time Pickers](https://mui.com/x/migration/migration-pickers-v6/)
|
|
88
|
+
- [Tree View](https://mui.com/x/migration/migration-tree-view-v6/)
|
|
89
|
+
- [Charts](https://mui.com/x/migration/migration-charts-v6/)
|
|
90
|
+
|
|
91
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
92
|
+
|
|
93
|
+
- 🚀 Improve the usage of custom `viewRenderers` on `DateTimePicker` (#12441) @LukasTy
|
|
94
|
+
- ✨ Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
95
|
+
- 🕹️ Support controlled `density` for the Data Grid (#12332) @MBilalShafi
|
|
96
|
+
- 🎁 Dynamic virtualization range for the Data Grid (#12353) @romgrk
|
|
97
|
+
- 🐞 Bugfixes
|
|
98
|
+
- 📚 Documentation improvements
|
|
99
|
+
|
|
100
|
+
### Data Grid
|
|
101
|
+
|
|
102
|
+
#### Breaking changes
|
|
103
|
+
|
|
104
|
+
- The `density` is a [controlled prop](https://mui.com/x/react-data-grid/accessibility/#set-the-density-programmatically) now, if you were previously passing the `density` prop to the Data Grid, you will need to do one of the following:
|
|
105
|
+
|
|
106
|
+
1. Move it to the `initialState.density` to initialize it.
|
|
107
|
+
|
|
108
|
+
```diff
|
|
109
|
+
<DataGrid
|
|
110
|
+
- density="compact"
|
|
111
|
+
+ initialState={{ density: "compact" }}
|
|
112
|
+
/>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. Move it to the state and use `onDensityChange` callback to update the `density` prop accordingly for it to work as expected.
|
|
116
|
+
|
|
117
|
+
```diff
|
|
118
|
+
+ const [density, setDensity] = React.useState<GridDensity>('compact');
|
|
119
|
+
<DataGrid
|
|
120
|
+
- density="compact"
|
|
121
|
+
+ density={density}
|
|
122
|
+
+ onDensityChange={(newDensity) => setDensity(newDensity)}
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- The selector `gridDensityValueSelector` was removed, use the `gridDensitySelector` instead.
|
|
127
|
+
|
|
128
|
+
- The props `rowBuffer` and `columnBuffer` were renamed to `rowBufferPx` and `columnBufferPx`.
|
|
129
|
+
Their value is now a pixel value rather than a number of items. Their default value is now `150`.
|
|
130
|
+
|
|
131
|
+
- The props `rowThreshold` and `columnThreshold` have been removed.
|
|
132
|
+
If you had the `rowThreshold` prop set to `0` to force new rows to be rendered more often – this is no longer necessary.
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-data-grid@7.0.0`
|
|
135
|
+
|
|
136
|
+
- [DataGrid] Allow to control the grid density (#12332) @MBilalShafi
|
|
137
|
+
- [DataGrid] Dynamic virtualization range (#12353) @romgrk
|
|
138
|
+
- [DataGrid] Fix `ElementType` usage (#12479) @cherniavskii
|
|
139
|
+
- [DataGrid] Fix cell value formatting on copy (#12357) @sai6855
|
|
140
|
+
- [DataGrid] Fix checkbox selection is keeping selection when filtering (#11751) @g1mishra
|
|
141
|
+
- [DataGrid] Make `rows` an optional prop (#12478) @MBilalShafi
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid@7.0.0`.
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-data-grid-premium@7.0.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
148
|
+
|
|
149
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0`, plus:
|
|
150
|
+
|
|
151
|
+
- [DataGridPremium] Add support for confirmation before clipboard paste (#12225) @cherniavskii
|
|
152
|
+
- [DataGridPremium] Fix single grouping column sorting (#9679) @cherniavskii
|
|
153
|
+
- [DataGridPremium] Fix boolean cell not rendered in group rows (#12492) @sai6855
|
|
154
|
+
|
|
155
|
+
### Date and Time Pickers
|
|
156
|
+
|
|
157
|
+
#### Breaking changes
|
|
158
|
+
|
|
159
|
+
- The `DesktopDateTimePicker` view rendering has been optimized by using the same technique as for `DesktopDateTimeRangePicker`.
|
|
160
|
+
- The `dateTimeViewRenderers` have been removed in favor of reusing existing time view renderers (`renderTimeViewClock`, `renderDigitalClockTimeView` and `renderMultiSectionDigitalClockTimeView`) and date view renderer (`renderDateViewCalendar`).
|
|
161
|
+
- Passing `renderTimeViewClock` to time view renderers will no longer revert to the old behavior of rendering only date or time view.
|
|
162
|
+
|
|
163
|
+
#### `@mui/x-date-pickers@7.0.0`
|
|
164
|
+
|
|
165
|
+
- [fields] Allow to override the separator between the start and the end date in all range fields (#12174) @flaviendelangle
|
|
166
|
+
- [fields] Support format without separator (#12489) @flaviendelangle
|
|
167
|
+
- [pickers] Use renderer interceptor on `DesktopDateTimePicker` (#12441) @LukasTy
|
|
168
|
+
|
|
169
|
+
#### `@mui/x-date-pickers-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
170
|
+
|
|
171
|
+
Same changes as in `@mui/x-date-pickers@7.0.0`, plus:
|
|
172
|
+
|
|
173
|
+
- [DateTimeRangePicker] Add component `JSDoc` (#12518) @LukasTy
|
|
174
|
+
- [DateTimeRangePicker] Fix views behavior regression (#12529) @LukasTy
|
|
175
|
+
|
|
176
|
+
### Charts
|
|
177
|
+
|
|
178
|
+
#### `@mui/x-charts@7.0.0`
|
|
179
|
+
|
|
180
|
+
- [charts] Fix small typo in `CartesianContextProvider` (#12461) @Janpot
|
|
181
|
+
|
|
182
|
+
### Tree View
|
|
183
|
+
|
|
184
|
+
#### Breaking changes
|
|
185
|
+
|
|
186
|
+
- The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency:
|
|
187
|
+
|
|
188
|
+
```diff
|
|
189
|
+
<TreeView>
|
|
190
|
+
- <TreeItem label="Item 1" nodeId="one">
|
|
191
|
+
+ <TreeItem label="Item 1" itemId="one">
|
|
192
|
+
</TreeView>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
- The focus is now applied to the Tree Item root element instead of the Tree View root element.
|
|
196
|
+
|
|
197
|
+
This change will allow new features that require the focus to be on the Tree Item,
|
|
198
|
+
like the drag and drop reordering of items.
|
|
199
|
+
It also solves several issues with focus management,
|
|
200
|
+
like the inability to scroll to the focused item when a lot of items are rendered.
|
|
201
|
+
|
|
202
|
+
This will mostly impact how you write tests to interact with the Tree View:
|
|
203
|
+
|
|
204
|
+
For example, if you were writing a test with `react-testing-library`, here is what the changes could look like:
|
|
205
|
+
|
|
206
|
+
```diff
|
|
207
|
+
it('test example on first item', () => {
|
|
208
|
+
- const { getByRole } = render(
|
|
209
|
+
+ const { getAllByRole } = render(
|
|
210
|
+
<SimpleTreeView>
|
|
211
|
+
<TreeItem nodeId="one" />
|
|
212
|
+
<TreeItem nodeId="two" />
|
|
213
|
+
</SimpleTreeView>
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
- const tree = getByRole('tree');
|
|
217
|
+
+ const firstTreeItem = getAllByRole('treeitem')[0];
|
|
218
|
+
act(() => {
|
|
219
|
+
- tree.focus();
|
|
220
|
+
+ firstTreeItem.focus();
|
|
221
|
+
});
|
|
222
|
+
- fireEvent.keyDown(tree, { key: 'ArrowDown' });
|
|
223
|
+
+ fireEvent.keyDown(firstTreeItem, { key: 'ArrowDown' });
|
|
224
|
+
})
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### `@mui/x-tree-view@7.0.0`
|
|
228
|
+
|
|
229
|
+
- [TreeView] Rename `nodeId` to `itemId` (#12418) @noraleonte
|
|
230
|
+
- [TreeView] Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
231
|
+
- [TreeView] Update JSDoc of the `ContentComponent` prop to avoid using the word "node" (#12476) @flaviendelangle
|
|
232
|
+
|
|
233
|
+
### `@mui/x-codemod@7.0.0`
|
|
234
|
+
|
|
235
|
+
- [codemod] Add a codemod and update the grid migration guide (#12488) @MBilalShafi
|
|
236
|
+
|
|
237
|
+
### Docs
|
|
238
|
+
|
|
239
|
+
- [docs] Finalize migration guide (#12501) @noraleonte
|
|
240
|
+
- [docs] Fix nested cells alignment in the popular features demo (#12450) @cherniavskii
|
|
241
|
+
- [docs] Fix some Vale errors (#12469) @oliviertassinari
|
|
242
|
+
- [docs] Remove mentions of pre release (#12513) @noraleonte
|
|
243
|
+
- [docs] Update branch name and tags (#12498) @cherniavskii
|
|
244
|
+
- [docs] Update links to v6 (#12496) @cherniavskii
|
|
245
|
+
- [docs] Update links to v7 docs (#12500) @noraleonte
|
|
246
|
+
- [docs] Update supported versions (#12508) @joserodolfofreitas
|
|
247
|
+
- [docs] Update "What's new in MUI X" page #12527 @cherniavskii
|
|
248
|
+
|
|
249
|
+
### Core
|
|
250
|
+
|
|
251
|
+
- [core] Bump `@mui/material` peer dependency for all packages (#12516) @LukasTy
|
|
252
|
+
- [core] Fix `no-restricted-imports` ESLint rule not working for Data Grid packages (#12477) @cherniavskii
|
|
253
|
+
- [core] Lower the frequency of `no-response` action runs (#12491) @michaldudak
|
|
254
|
+
- [core] Remove leftover `legacy` `browserlistrc` entry (#12415) @LukasTy
|
|
255
|
+
- [core] Update NPM tag (#12511) @cherniavskii
|
|
256
|
+
- [core] Update supported browsers (browserlistrc) (#12521) @LukasTy
|
|
257
|
+
- [core] Use Circle CI context @oliviertassinari
|
|
258
|
+
- [license] Fix grammar on expired license error message (#12460) @joserodolfofreitas
|
|
259
|
+
|
|
6
260
|
## 7.0.0-beta.7
|
|
7
261
|
|
|
8
262
|
_Mar 14, 2024_
|
|
@@ -90,7 +344,7 @@ The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
|
|
|
90
344
|
- [docs] Add `legacy` bundle drop mention in migration pages (#12424) @LukasTy
|
|
91
345
|
- [docs] Add missing luxon `Info` import (#12427) @LukasTy
|
|
92
346
|
- [docs] Improve slots definitions for charts (#12408) @alexfauquette
|
|
93
|
-
- [docs] Polish What's new in MUI
|
|
347
|
+
- [docs] Polish What's new in MUI X blog titles (#12309) @oliviertassinari
|
|
94
348
|
- [docs] Replace `rel="noreferrer"` by `rel="noopener"` @oliviertassinari
|
|
95
349
|
- [docs] Update `date-fns` `weekStarsOn` overriding example (#12416) @LukasTy
|
|
96
350
|
|
|
@@ -252,7 +506,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
252
506
|
### Docs
|
|
253
507
|
|
|
254
508
|
- [docs] Fix image layout shift when loading @oliviertassinari
|
|
255
|
-
- [docs] Match Material
|
|
509
|
+
- [docs] Match Material UI repo comment for redirections @oliviertassinari
|
|
256
510
|
- [docs] Non breaking spaces @oliviertassinari
|
|
257
511
|
- [docs] Polish the Date Picker playground (#11869) @zanivan
|
|
258
512
|
- [docs] Standardize WAI-ARIA references @oliviertassinari
|
|
@@ -263,9 +517,9 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
263
517
|
- [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
|
|
264
518
|
- [core] Remove `window.` reference for common globals @oliviertassinari
|
|
265
519
|
- [core] Use runtime agnostic setTimeout type @oliviertassinari
|
|
266
|
-
- [docs-infra] Fix Stack
|
|
520
|
+
- [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
|
|
267
521
|
- [docs-infra] Fix missing non breaking spaces @oliviertassinari
|
|
268
|
-
- [
|
|
522
|
+
- [infra] Update `no-response` workflow (#12193) @MBilalShafi
|
|
269
523
|
- [infra] Fix missing permission reset @oliviertassinari
|
|
270
524
|
|
|
271
525
|
## 7.0.0-beta.4
|
|
@@ -282,7 +536,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
282
536
|
|
|
283
537
|
### Breaking changes
|
|
284
538
|
|
|
285
|
-
- The support for IE11 has been removed from all MUI
|
|
539
|
+
- The support for IE11 has been removed from all MUI X packages. The `legacy` bundle that used to support old browsers like IE11 is no longer included.
|
|
286
540
|
|
|
287
541
|
### Data Grid
|
|
288
542
|
|
|
@@ -324,7 +578,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
324
578
|
- The headless field hooks (e.g.: `useDateField`) now returns a new prop called `enableAccessibleFieldDOMStructure`.
|
|
325
579
|
This property is utilized to determine whether the anticipated UI is constructed using an accessible DOM structure. Learn more about this new [accessible DOM structure](/x/react-date-pickers/fields/#accessible-dom-structure).
|
|
326
580
|
|
|
327
|
-
|
|
581
|
+
When building a custom UI, you are most-likely only supporting one DOM structure, so you can remove `enableAccessibleFieldDOMStructure` before it is passed to the DOM:
|
|
328
582
|
|
|
329
583
|
```diff
|
|
330
584
|
function MyCustomTextField(props) {
|
|
@@ -392,7 +646,7 @@ These components are no longer exported from `@mui/x-charts`:
|
|
|
392
646
|
### Docs
|
|
393
647
|
|
|
394
648
|
- [docs] Add recipe for hiding separator on non-resizable columns (#12134) @michelengelen
|
|
395
|
-
- [docs] Add small improvements to the Gauge
|
|
649
|
+
- [docs] Add small improvements to the Gauge page (#12076) @danilo-leal
|
|
396
650
|
- [docs] Add the 'point' scaleType to the axis documentation (#12179) @alexfauquette
|
|
397
651
|
- [docs] Clarify Pickers 'Component composition' section (#12097) @LukasTy
|
|
398
652
|
- [docs] Fix "Licensing" page link (#12156) @LukasTy
|
|
@@ -975,7 +1229,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
|
|
|
975
1229
|
|
|
976
1230
|
- [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11689) @alexfauquette
|
|
977
1231
|
- [charts] Fix default `stackOffset` for `LineChart` (#11647) @alexfauquette
|
|
978
|
-
- [charts] Remove a
|
|
1232
|
+
- [charts] Remove a TypeScript ignore (#11688) @alexfauquette
|
|
979
1233
|
|
|
980
1234
|
### Tree View
|
|
981
1235
|
|
|
@@ -1404,7 +1658,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
|
|
|
1404
1658
|
- [core] Fix release changelog (#11496) @romgrk
|
|
1405
1659
|
- [core] Fix use of ::before & ::after (#11515) @oliviertassinari
|
|
1406
1660
|
- [core] Localize the issue template to MUI X (#11511) @oliviertassinari
|
|
1407
|
-
- [core]
|
|
1661
|
+
- [core] Regenerate API files (#11542) @flaviendelangle
|
|
1408
1662
|
- [core] Remove issue emoji @oliviertassinari
|
|
1409
1663
|
- [core] Sync the release instructions with MUI Core @oliviertassinari
|
|
1410
1664
|
- [core] Yaml format match most common convention @oliviertassinari
|
|
@@ -1447,7 +1701,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
1447
1701
|
|
|
1448
1702
|
- The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
|
|
1449
1703
|
The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
|
|
1450
|
-
but all updates to the `filterModel` coming from the UI (
|
|
1704
|
+
but all updates to the `filterModel` coming from the UI (for example filter panel) will set the value as a `Date` object.
|
|
1451
1705
|
|
|
1452
1706
|
#### `@mui/x-data-grid@7.0.0-alpha.6`
|
|
1453
1707
|
|
|
@@ -1658,7 +1912,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.5`, plus:
|
|
|
1658
1912
|
### Core
|
|
1659
1913
|
|
|
1660
1914
|
- [core] Automate cherry-pick of PRs from `next` -> `master` (#11382) @MBilalShafi
|
|
1661
|
-
- [
|
|
1915
|
+
- [infra] Update `no-response` workflow (#11369) @MBilalShafi
|
|
1662
1916
|
- [test] Fix flaky screenshots (#11388) @cherniavskii
|
|
1663
1917
|
|
|
1664
1918
|
## 7.0.0-alpha.4
|
|
@@ -1896,7 +2150,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
|
|
|
1896
2150
|
|
|
1897
2151
|
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11144) @michelengelen
|
|
1898
2152
|
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
1899
|
-
- [charts] Fix
|
|
2153
|
+
- [charts] Fix TypeScript config (#11259) @alexfauquette
|
|
1900
2154
|
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
1901
2155
|
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
1902
2156
|
- [charts] Remove outdated prop-types (#11045) @alexfauquette
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -101,10 +101,10 @@ DataGridRaw.propTypes = {
|
|
|
101
101
|
*/
|
|
102
102
|
clipboardCopyCellDelimiter: PropTypes.string,
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @default
|
|
104
|
+
* Column region in pixels to render before/after the viewport
|
|
105
|
+
* @default 150
|
|
106
106
|
*/
|
|
107
|
-
|
|
107
|
+
columnBufferPx: PropTypes.number,
|
|
108
108
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
109
109
|
/**
|
|
110
110
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -115,11 +115,6 @@ DataGridRaw.propTypes = {
|
|
|
115
115
|
* Set of columns of type [[GridColDef]][].
|
|
116
116
|
*/
|
|
117
117
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
118
|
-
/**
|
|
119
|
-
* Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
|
|
120
|
-
* @default 3
|
|
121
|
-
*/
|
|
122
|
-
columnThreshold: PropTypes.number,
|
|
123
118
|
/**
|
|
124
119
|
* Set the column visibility model of the Data Grid.
|
|
125
120
|
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
|
|
@@ -467,6 +462,11 @@ DataGridRaw.propTypes = {
|
|
|
467
462
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
468
463
|
*/
|
|
469
464
|
onColumnWidthChange: PropTypes.func,
|
|
465
|
+
/**
|
|
466
|
+
* Callback fired when the density changes.
|
|
467
|
+
* @param {GridDensity} density New density value.
|
|
468
|
+
*/
|
|
469
|
+
onDensityChange: PropTypes.func,
|
|
470
470
|
/**
|
|
471
471
|
* Callback fired when the Filter model changes before the filters are applied.
|
|
472
472
|
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
|
|
@@ -609,10 +609,15 @@ DataGridRaw.propTypes = {
|
|
|
609
609
|
*/
|
|
610
610
|
processRowUpdate: PropTypes.func,
|
|
611
611
|
/**
|
|
612
|
-
*
|
|
613
|
-
* @default
|
|
612
|
+
* The milliseconds throttle delay for resizing the grid.
|
|
613
|
+
* @default 60
|
|
614
614
|
*/
|
|
615
|
-
|
|
615
|
+
resizeThrottleMs: PropTypes.number,
|
|
616
|
+
/**
|
|
617
|
+
* Row region in pixels to render before/after the viewport
|
|
618
|
+
* @default 150
|
|
619
|
+
*/
|
|
620
|
+
rowBufferPx: PropTypes.number,
|
|
616
621
|
/**
|
|
617
622
|
* Set the total number of rows, if it is different from the length of the value `rows` prop.
|
|
618
623
|
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
|
|
@@ -636,8 +641,9 @@ DataGridRaw.propTypes = {
|
|
|
636
641
|
rowPositionsDebounceMs: PropTypes.number,
|
|
637
642
|
/**
|
|
638
643
|
* Set of rows of type [[GridRowsProp]].
|
|
644
|
+
* @default []
|
|
639
645
|
*/
|
|
640
|
-
rows: PropTypes.arrayOf(PropTypes.object)
|
|
646
|
+
rows: PropTypes.arrayOf(PropTypes.object),
|
|
641
647
|
/**
|
|
642
648
|
* If `false`, the row selection mode is disabled.
|
|
643
649
|
* @default true
|
|
@@ -652,11 +658,6 @@ DataGridRaw.propTypes = {
|
|
|
652
658
|
* @default "margin"
|
|
653
659
|
*/
|
|
654
660
|
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
655
|
-
/**
|
|
656
|
-
* Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
|
|
657
|
-
* @default 3
|
|
658
|
-
*/
|
|
659
|
-
rowThreshold: PropTypes.number,
|
|
660
661
|
/**
|
|
661
662
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
662
663
|
*/
|
|
@@ -25,12 +25,10 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
25
25
|
autoPageSize: false,
|
|
26
26
|
checkboxSelection: false,
|
|
27
27
|
checkboxSelectionVisibleOnly: false,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
rowThreshold: 3,
|
|
28
|
+
columnBufferPx: 150,
|
|
29
|
+
rowBufferPx: 150,
|
|
30
|
+
rows: [],
|
|
32
31
|
rowSelection: true,
|
|
33
|
-
density: 'standard',
|
|
34
32
|
disableColumnFilter: false,
|
|
35
33
|
disableColumnMenu: false,
|
|
36
34
|
disableColumnSelector: false,
|
|
@@ -56,6 +54,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
56
54
|
pagination: false,
|
|
57
55
|
paginationMode: 'client',
|
|
58
56
|
rowHeight: 52,
|
|
57
|
+
resizeThrottleMs: 60,
|
|
59
58
|
pageSizeOptions: [25, 50, 100],
|
|
60
59
|
rowSpacingType: 'margin',
|
|
61
60
|
showCellVerticalBorder: false,
|
package/README.md
CHANGED
package/components/GridFooter.js
CHANGED
|
@@ -12,7 +12,6 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
|
|
15
|
-
var _rootProps$slotProps, _rootProps$slotProps2;
|
|
16
15
|
const apiRef = useGridApiContext();
|
|
17
16
|
const rootProps = useGridRootProps();
|
|
18
17
|
const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
|
|
@@ -21,11 +20,11 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
21
20
|
const selectedRowCountElement = !rootProps.hideFooterSelectedRowCount && selectedRowCount > 0 ? /*#__PURE__*/_jsx(GridSelectedRowCount, {
|
|
22
21
|
selectedRowCount: selectedRowCount
|
|
23
22
|
}) : /*#__PURE__*/_jsx("div", {});
|
|
24
|
-
const rowCountElement = !rootProps.hideFooterRowCount && !rootProps.pagination ? /*#__PURE__*/_jsx(rootProps.slots.footerRowCount, _extends({},
|
|
23
|
+
const rowCountElement = !rootProps.hideFooterRowCount && !rootProps.pagination ? /*#__PURE__*/_jsx(rootProps.slots.footerRowCount, _extends({}, rootProps.slotProps?.footerRowCount, {
|
|
25
24
|
rowCount: totalTopLevelRowCount,
|
|
26
25
|
visibleRowCount: visibleTopLevelRowCount
|
|
27
26
|
})) : null;
|
|
28
|
-
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({},
|
|
27
|
+
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
|
|
29
28
|
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
|
|
30
29
|
ref: ref
|
|
31
30
|
}, props, {
|
package/components/GridHeader.js
CHANGED
|
@@ -5,9 +5,8 @@ import { GridPreferencesPanel } from './panel/GridPreferencesPanel';
|
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
export function GridHeader() {
|
|
8
|
-
var _rootProps$slotProps;
|
|
9
8
|
const rootProps = useGridRootProps();
|
|
10
9
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
11
|
-
children: [/*#__PURE__*/_jsx(GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({},
|
|
10
|
+
children: [/*#__PURE__*/_jsx(GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, rootProps.slotProps?.toolbar))]
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { TablePaginationProps } from '@mui/material/TablePagination';
|
|
3
|
+
interface GridPaginationOwnProps {
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
}
|
|
6
|
+
declare const GridPagination: React.ForwardRefExoticComponent<Omit<Partial<Omit<TablePaginationProps, "component">> & GridPaginationOwnProps, "ref"> & React.RefAttributes<unknown>>;
|
|
7
|
+
export { GridPagination };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';
|
|
4
5
|
import { styled } from '@mui/material/styles';
|
|
5
6
|
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
@@ -26,7 +27,7 @@ const GridPaginationRoot = styled(TablePagination)(({
|
|
|
26
27
|
|
|
27
28
|
// A mutable version of a readonly array.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
|
|
30
31
|
const apiRef = useGridApiContext();
|
|
31
32
|
const rootProps = useGridRootProps();
|
|
32
33
|
const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
|
|
@@ -56,10 +57,9 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
56
57
|
return false;
|
|
57
58
|
};
|
|
58
59
|
if (process.env.NODE_ENV !== 'production') {
|
|
59
|
-
var _rootProps$pagination, _rootProps$pagination2;
|
|
60
60
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
61
61
|
const warnedOnceMissingInPageSizeOptions = React.useRef(false);
|
|
62
|
-
const pageSize =
|
|
62
|
+
const pageSize = rootProps.paginationModel?.pageSize ?? paginationModel.pageSize;
|
|
63
63
|
if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !isPageSizeIncludedInPageSizeOptions(pageSize)) {
|
|
64
64
|
console.warn([`MUI X: The page size \`${paginationModel.pageSize}\` is not preset in the \`pageSizeOptions\`.`, `Add it to show the pagination select.`].join('\n'));
|
|
65
65
|
warnedOnceMissingInPageSizeOptions.current = true;
|
|
@@ -80,4 +80,12 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
80
80
|
onPageChange: handlePageChange,
|
|
81
81
|
onRowsPerPageChange: handlePageSizeChange
|
|
82
82
|
}, apiRef.current.getLocaleText('MuiTablePagination'), props));
|
|
83
|
-
});
|
|
83
|
+
});
|
|
84
|
+
process.env.NODE_ENV !== "production" ? GridPagination.propTypes = {
|
|
85
|
+
// ----------------------------- Warning --------------------------------
|
|
86
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
87
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
88
|
+
// ----------------------------------------------------------------------
|
|
89
|
+
component: PropTypes.elementType
|
|
90
|
+
} : void 0;
|
|
91
|
+
export { GridPagination };
|