@mui/x-data-grid-premium 6.4.0 → 6.6.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 +134 -2
- package/DataGridPremium/DataGridPremium.js +15 -3
- package/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/DataGridPremium/useDataGridPremiumProps.js +5 -12
- package/README.md +2 -2
- package/components/GridAggregationHeader.d.ts +2 -2
- package/components/GridColumnMenuAggregationItem.d.ts +2 -2
- package/components/GridColumnMenuRowGroupItem.d.ts +2 -2
- package/components/GridColumnMenuRowUngroupItem.d.ts +2 -2
- package/components/GridExcelExportMenuItem.d.ts +2 -2
- package/components/GridFooterCell.d.ts +2 -2
- package/components/GridGroupingColumnFooterCell.d.ts +2 -2
- package/components/GridGroupingColumnLeafCell.d.ts +2 -2
- package/components/GridGroupingCriteriaCell.d.ts +2 -2
- package/components/GridPremiumColumnMenu.d.ts +1 -1
- package/hooks/features/aggregation/gridAggregationUtils.js +1 -0
- package/hooks/features/export/gridExcelExportInterface.d.ts +1 -1
- package/hooks/features/export/serializer/excelSerializer.d.ts +7 -7
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -8
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +3 -1
- package/index.js +1 -1
- package/legacy/DataGridPremium/DataGridPremium.js +15 -3
- package/legacy/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/legacy/DataGridPremium/useDataGridPremiumProps.js +8 -8
- package/legacy/hooks/features/aggregation/gridAggregationUtils.js +1 -0
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -8
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +3 -1
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +15 -3
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/modern/DataGridPremium/useDataGridPremiumProps.js +5 -12
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +1 -0
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -8
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +3 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPremium/DataGridPremium.js +15 -3
- package/node/DataGridPremium/useDataGridPremiumComponent.js +2 -0
- package/node/DataGridPremium/useDataGridPremiumProps.js +4 -11
- package/node/hooks/features/aggregation/gridAggregationUtils.js +1 -0
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -8
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -0
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +7 -7
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,138 @@
|
|
|
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
|
+
## 6.6.0
|
|
7
|
+
|
|
8
|
+
_Jun 1, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 New date time picking UI on [`DesktopDateTimePicker`](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
13
|
+
|
|
14
|
+
<img src="https://user-images.githubusercontent.com/4941090/242533399-2b106390-8158-4aba-9ca4-b621c6310977.gif" width="628" />
|
|
15
|
+
|
|
16
|
+
- 🚀 Performance improvements
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
- 📚 Documentation improvements
|
|
19
|
+
- 🌍 Improve Dutch (nl-NL) and French (fr-FR) locales on the data grid
|
|
20
|
+
- 🌍 Add Vietnamese (vi-VN) locale on the pickers
|
|
21
|
+
|
|
22
|
+
### `@mui/x-data-grid@v6.6.0` / `@mui/x-data-grid-pro@v6.6.0` / `@mui/x-data-grid-premium@v6.6.0`
|
|
23
|
+
|
|
24
|
+
#### Changes
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Support data attributes (#8845) @romgrk
|
|
27
|
+
- [DataGrid] Avoid allocations in `hydrateRowsMeta` (#9121) @romgrk
|
|
28
|
+
- [DataGrid] Fix filter input select accessibility (#9018) @Jul13nT
|
|
29
|
+
- [DataGrid] Fix accessibility issues in panels and toolbar buttons (#8862) @romgrk
|
|
30
|
+
- [DataGrid] Fix `onCellEditStop` not invoked (#8857) @romgrk
|
|
31
|
+
- [DataGridPro] Fix auto-scroll when reordering columns (#8856) @m4theushw
|
|
32
|
+
- [DataGridPro] Fix row ID type casting in detail panels lookup (#8976) @minchaej
|
|
33
|
+
- [DataGridPro] Emit `columnWidthChange` event on `touchEnd` of column resize (#8669) @MBilalShafi
|
|
34
|
+
- [DataGridPro] Do not apply filters on `rowExpansionChange` (#8671) @cherniavskii
|
|
35
|
+
- [DataGridPro] Prevent click event on sorting after a resize (#9117) @romgrk
|
|
36
|
+
- [DataGridPremium] Improve Excel export interface (#9128) @TiagoPortfolio
|
|
37
|
+
- [l10n] Improve Dutch (nl-NL) locale (#9043) @thedutchruben
|
|
38
|
+
- [l10n] Improve French (fr-FR) locale (#9109) @Jul13nT
|
|
39
|
+
|
|
40
|
+
### `@mui/x-date-pickers@v6.6.0` / `@mui/x-date-pickers-pro@v6.6.0`
|
|
41
|
+
|
|
42
|
+
#### Changes
|
|
43
|
+
|
|
44
|
+
- [fields] Allow to explicitly define the reference value and improve its default value (#9019) @flaviendelangle
|
|
45
|
+
- [l10n] Add Vietnamese (vi-VN) locale (#9099) @nhannt201
|
|
46
|
+
- [pickers] Add `DigitalClock` to `DesktopDateTimePicker` (#8946) @LukasTy
|
|
47
|
+
- [pickers] Add support for timezones on the adapters (#9068) @flaviendelangle
|
|
48
|
+
- [pickers] Fix `MonthCalendar` and `YearCalendar` disabled validation (#9149) @LukasTy
|
|
49
|
+
- [pickers] Fix bug when fields have a unique section (#9110) @alexfauquette
|
|
50
|
+
- [pickers] Fix focus jumping on Safari (#9072) @LukasTy
|
|
51
|
+
- [pickers] Use the locale start of the week in `getWeekArray` (#9176) @flaviendelangle
|
|
52
|
+
|
|
53
|
+
### Docs
|
|
54
|
+
|
|
55
|
+
- [docs] Add single input range picker demo (#9159) @LukasTy
|
|
56
|
+
- [docs] Align `DateCalendar` demo views with labels (#9152) @LukasTy
|
|
57
|
+
- [docs] Clarify the peer dependency with React (#9067) @oliviertassinari
|
|
58
|
+
- [docs] Fix Norwegian locale typo (#9168) @LukasTy
|
|
59
|
+
- [docs] Fix column menu item demo (#9071) @MBilalShafi
|
|
60
|
+
- [docs] Improve localization table progress bars (#9033) @noraleonte
|
|
61
|
+
- [docs] Smooth performance animation (#8986) @oliviertassinari
|
|
62
|
+
- [docs] Use responsive time and date time pickers and the views sections (#9127) @flaviendelangle
|
|
63
|
+
- [docs] Reduce layout shift in grid demo (#9132) @oliviertassinari
|
|
64
|
+
- [docs] Fix tree data children lazy-loading demo (#8840) @yaredtsy
|
|
65
|
+
- [docs] Improve filtering docs discoverability (#9074) @MBilalShafi
|
|
66
|
+
|
|
67
|
+
### Core
|
|
68
|
+
|
|
69
|
+
- [core] Allow string literals as keys in `localesText` (#9045) @MBilalShafi
|
|
70
|
+
- [core] Fix `randomInt` producing values exceeding `max` value (#9086) @cherniavskii
|
|
71
|
+
- [core] Fix flaky test on `dateWithTimezone` adapter test (#9129) @flaviendelangle
|
|
72
|
+
- [core] Lock `@types/node` on v18 (#9107) @LukasTy
|
|
73
|
+
- [core] Remove `cross-fetch` dependency (#9108) @LukasTy
|
|
74
|
+
- [core] Remove `createDetectElementResize()` replaced with `ResizeObserver` (#9015) @oliviertassinari
|
|
75
|
+
- [core] Upgrade monorepo (#9027) @m4theushw
|
|
76
|
+
- [core] Upgrade monorepo (#9106) @LukasTy
|
|
77
|
+
- [charts] Fix proptypes (#9125) @LukasTy
|
|
78
|
+
- [charts] Generate the charts proptypes (#9010) @alexfauquette
|
|
79
|
+
- [charts] Manage series stacking (#8888) @alexfauquette
|
|
80
|
+
- [license] List side effects in the license package (#9092) @cherniavskii
|
|
81
|
+
|
|
82
|
+
## v6.5.0
|
|
83
|
+
|
|
84
|
+
_May 19, 2023_
|
|
85
|
+
|
|
86
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
87
|
+
|
|
88
|
+
- 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
|
|
89
|
+
|
|
90
|
+
https://github.com/mui/mui-x/assets/12609561/c4c2bfec-59cf-4cab-932d-dc1983081de9
|
|
91
|
+
|
|
92
|
+
See [the documentation](https://mui.com/x/react-data-grid/filtering/#header-filters) for more information
|
|
93
|
+
|
|
94
|
+
- 🌍 Improve Hebrew (he-IL) and Czech (cs-CZ) locales
|
|
95
|
+
- 📝 Support for editing on pinned rows
|
|
96
|
+
- 🚀 Performance improvements
|
|
97
|
+
- 🐞 Bugfixes
|
|
98
|
+
- 📚 Documentation improvements
|
|
99
|
+
|
|
100
|
+
### `@mui/x-data-grid@6.5.0` / `@mui/x-data-grid-pro@6.5.0` / `@mui/x-data-grid-premium@6.5.0`
|
|
101
|
+
|
|
102
|
+
#### Changes
|
|
103
|
+
|
|
104
|
+
- [DataGrid] Fix grid size calculation when `.MuiDataGrid-main` has border (#8882) @cherniavskii
|
|
105
|
+
- [DataGridPro] Filtering on Column Header (#7760) @MBilalShafi
|
|
106
|
+
- [DataGridPro] Improve `treeData` and `rowGrouping` performance (#8990) @MBilalShafi
|
|
107
|
+
- [DataGridPro] Support pinned rows editing (#8921) @cherniavskii
|
|
108
|
+
- [l10n] Improve Hebrew (he-IL) locale (#8943) @Itzik-Tech
|
|
109
|
+
- [l10n] Improve Czech (cs-CZ) locale (#8829) @harastaivan
|
|
110
|
+
- [l10n] Improve Czech (cs-CZ) locale (#8956) @davidzemancz
|
|
111
|
+
|
|
112
|
+
### `@mui/x-date-pickers@6.5.0` / `@mui/x-date-pickers-pro@6.5.0`
|
|
113
|
+
|
|
114
|
+
#### Changes
|
|
115
|
+
|
|
116
|
+
- [fields] Select the first section instead of last when clicking right of content (#9005) @noraleonte
|
|
117
|
+
- [fields] Refactor prop drilling in fields (#8660) @flaviendelangle
|
|
118
|
+
- [pickers] Allow to render the months before `currentMonth` instead of the one after (#8592) @flaviendelangle
|
|
119
|
+
- [pickers] Fix view management when `openTo` or `views` is modified (#8997) @alexfauquette
|
|
120
|
+
- [l10n] Improve Czech (cs-CZ) locale (#8829) @harastaivan
|
|
121
|
+
|
|
122
|
+
### Docs
|
|
123
|
+
|
|
124
|
+
- [docs] Clarify what Controlled / Uncontrolled means (#8926) @flaviendelangle
|
|
125
|
+
- [docs] Fix docs using wrong service worker (#9030) @cherniavskii
|
|
126
|
+
- [docs] Remove prop-types from JS demos (#9008) @flaviendelangle
|
|
127
|
+
|
|
128
|
+
### Core
|
|
129
|
+
|
|
130
|
+
- [core] Add assertion about checkbox rerenders (#8974) @oliviertassinari
|
|
131
|
+
- [core] Allow selecting a section by type in field tests (#9009) @flaviendelangle
|
|
132
|
+
- [core] Fix `yarn.lock` (#8988) @flaviendelangle
|
|
133
|
+
- [core] Fix flacky adapter test (#8995) @flaviendelangle
|
|
134
|
+
- [charts] Clean the axis rendering (#8948) @alexfauquette
|
|
135
|
+
- [DataGrid] Memoize root props for better performance (#8942) @romgrk
|
|
136
|
+
- [test] Skip flaky unit tests in JSDOM (#8994) @cherniavskii
|
|
137
|
+
|
|
6
138
|
## v6.4.0
|
|
7
139
|
|
|
8
140
|
_May 12, 2023_
|
|
@@ -46,7 +178,7 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
46
178
|
|
|
47
179
|
### Docs
|
|
48
180
|
|
|
49
|
-
- [docs] Fix date pickers typo in the docs
|
|
181
|
+
- [docs] Fix date pickers typo in the docs (#8939) @richbustos
|
|
50
182
|
- [docs] Fix master detail demo (#8894) @m4theushw
|
|
51
183
|
- [docs] Fix typo in clipboard docs (#8971) @MBilalShafi
|
|
52
184
|
- [docs] Reduce list of dependencies in Codesandbox/Stackblitz demos (#8535) @cherniavskii
|
|
@@ -4384,7 +4516,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4384
4516
|
|
|
4385
4517
|
- 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
|
|
4386
4518
|
|
|
4387
|
-
- 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering
|
|
4519
|
+
- 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/quick-filter/).
|
|
4388
4520
|
|
|
4389
4521
|
<img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
|
|
4390
4522
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { useLicenseVerifier, Watermark } from '@mui/x-license-pro';
|
|
@@ -18,11 +19,12 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
18
19
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
19
20
|
privateApiRef: privateApiRef,
|
|
20
21
|
props: props,
|
|
21
|
-
children: /*#__PURE__*/_jsxs(GridRoot, {
|
|
22
|
+
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
22
23
|
className: props.className,
|
|
23
24
|
style: props.style,
|
|
24
25
|
sx: props.sx,
|
|
25
|
-
ref: ref
|
|
26
|
+
ref: ref
|
|
27
|
+
}, props.forwardedProps, {
|
|
26
28
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
27
29
|
VirtualScrollerComponent: DataGridProVirtualScroller,
|
|
28
30
|
ColumnHeadersProps: {
|
|
@@ -33,7 +35,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
33
35
|
releaseInfo: releaseInfo
|
|
34
36
|
})
|
|
35
37
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
36
|
-
})
|
|
38
|
+
}))
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
export const DataGridPremium = /*#__PURE__*/React.memo(DataGridPremiumRaw);
|
|
@@ -286,6 +288,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
286
288
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
287
289
|
quickFilterValues: PropTypes.array
|
|
288
290
|
}),
|
|
291
|
+
/**
|
|
292
|
+
* Forwarded props for the grid root element.
|
|
293
|
+
* @ignore - do not document.
|
|
294
|
+
*/
|
|
295
|
+
forwardedProps: PropTypes.object,
|
|
289
296
|
/**
|
|
290
297
|
* Determines the position of an aggregated value.
|
|
291
298
|
* @param {GridGroupNode} groupNode The current group.
|
|
@@ -909,6 +916,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
909
916
|
* Set the cell selection model of the grid.
|
|
910
917
|
*/
|
|
911
918
|
unstable_cellSelectionModel: PropTypes.object,
|
|
919
|
+
/**
|
|
920
|
+
* If `true`, enables the data grid filtering on header feature.
|
|
921
|
+
* @default false
|
|
922
|
+
*/
|
|
923
|
+
unstable_headerFilters: PropTypes.bool,
|
|
912
924
|
/**
|
|
913
925
|
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
914
926
|
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -29,6 +29,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
29
29
|
/**
|
|
30
30
|
* Register all state initializers here.
|
|
31
31
|
*/
|
|
32
|
+
useGridInitializeState(headerFilteringStateInitializer, privateApiRef, props);
|
|
32
33
|
useGridInitializeState(rowGroupingStateInitializer, privateApiRef, props);
|
|
33
34
|
useGridInitializeState(aggregationStateInitializer, privateApiRef, props);
|
|
34
35
|
useGridInitializeState(rowSelectionStateInitializer, privateApiRef, props);
|
|
@@ -51,6 +52,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
51
52
|
useGridInitializeState(columnMenuStateInitializer, privateApiRef, props);
|
|
52
53
|
useGridInitializeState(columnGroupsStateInitializer, privateApiRef, props);
|
|
53
54
|
useGridRowGrouping(privateApiRef, props);
|
|
55
|
+
useGridHeaderFiltering(privateApiRef, props);
|
|
54
56
|
useGridTreeData(privateApiRef);
|
|
55
57
|
useGridAggregation(privateApiRef, props);
|
|
56
58
|
useGridKeyboardNavigation(privateApiRef, props);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["components", "componentsProps"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
4
|
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
7
|
-
import { computeSlots, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
8
6
|
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
9
7
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';
|
|
10
8
|
|
|
@@ -24,15 +22,10 @@ export const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO
|
|
|
24
22
|
});
|
|
25
23
|
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS);
|
|
26
24
|
export const useDataGridPremiumProps = inProps => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
components,
|
|
33
|
-
componentsProps
|
|
34
|
-
} = _useThemeProps,
|
|
35
|
-
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
25
|
+
const [components, componentsProps, themedProps] = useProps(useThemeProps({
|
|
26
|
+
props: inProps,
|
|
27
|
+
name: 'MuiDataGrid'
|
|
28
|
+
}));
|
|
36
29
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
37
30
|
const slots = React.useMemo(() => computeSlots({
|
|
38
31
|
defaultSlots,
|
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ This component has the following peer dependencies that you will need to install
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@mui/material": "^5.4.1",
|
|
23
23
|
"@mui/system": "^5.4.1",
|
|
24
|
-
"react": "^17.0.
|
|
25
|
-
"react-dom": "^17.0.
|
|
24
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
25
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
26
26
|
},
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridColumnHeaderParams } from '@mui/x-data-grid';
|
|
3
|
-
declare function GridAggregationHeader(props: GridColumnHeaderParams): JSX.Element | null;
|
|
3
|
+
declare function GridAggregationHeader(props: GridColumnHeaderParams): React.JSX.Element | null;
|
|
4
4
|
export { GridAggregationHeader };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
|
-
declare function GridColumnMenuAggregationItem(props: GridColumnMenuItemProps): JSX.Element;
|
|
3
|
+
declare function GridColumnMenuAggregationItem(props: GridColumnMenuItemProps): React.JSX.Element;
|
|
4
4
|
declare namespace GridColumnMenuAggregationItem {
|
|
5
5
|
var propTypes: any;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
|
-
declare function GridColumnMenuRowGroupItem(props: GridColumnMenuItemProps): JSX.Element | null;
|
|
3
|
+
declare function GridColumnMenuRowGroupItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
|
|
4
4
|
declare namespace GridColumnMenuRowGroupItem {
|
|
5
5
|
var propTypes: any;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
|
-
declare function GridColumnMenuRowUngroupItem(props: GridColumnMenuItemProps): JSX.Element | null;
|
|
3
|
+
declare function GridColumnMenuRowUngroupItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
|
|
4
4
|
declare namespace GridColumnMenuRowUngroupItem {
|
|
5
5
|
var propTypes: any;
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridExportMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridExcelExportOptions } from '../hooks/features/export';
|
|
4
4
|
export type GridExcelExportMenuItemProps = GridExportMenuItemProps<GridExcelExportOptions>;
|
|
5
|
-
declare function GridExcelExportMenuItem(props: GridExcelExportMenuItemProps): JSX.Element;
|
|
5
|
+
declare function GridExcelExportMenuItem(props: GridExcelExportMenuItemProps): React.JSX.Element;
|
|
6
6
|
declare namespace GridExcelExportMenuItem {
|
|
7
7
|
var propTypes: any;
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
4
|
import { SxProps } from '@mui/system';
|
|
5
5
|
interface GridFooterCellProps extends GridRenderCellParams {
|
|
6
6
|
sx?: SxProps<Theme>;
|
|
7
7
|
}
|
|
8
|
-
declare function GridFooterCell(props: GridFooterCellProps): JSX.Element;
|
|
8
|
+
declare function GridFooterCell(props: GridFooterCellProps): React.JSX.Element;
|
|
9
9
|
export { GridFooterCell };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams } from '@mui/x-data-grid-pro';
|
|
3
|
-
declare function GridGroupingColumnFooterCell(props: GridRenderCellParams): JSX.Element;
|
|
3
|
+
declare function GridGroupingColumnFooterCell(props: GridRenderCellParams): React.JSX.Element;
|
|
4
4
|
export { GridGroupingColumnFooterCell };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams } from '@mui/x-data-grid-pro';
|
|
3
|
-
declare function GridGroupingColumnLeafCell(props: GridRenderCellParams): JSX.Element;
|
|
3
|
+
declare function GridGroupingColumnLeafCell(props: GridRenderCellParams): React.JSX.Element;
|
|
4
4
|
export { GridGroupingColumnLeafCell };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams, GridGroupNode } from '@mui/x-data-grid-pro';
|
|
3
3
|
interface GridGroupingCriteriaCellProps extends GridRenderCellParams<any, any, any, GridGroupNode> {
|
|
4
4
|
hideDescendantCount?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare function GridGroupingCriteriaCell(props: GridGroupingCriteriaCellProps): JSX.Element;
|
|
6
|
+
export declare function GridGroupingCriteriaCell(props: GridGroupingCriteriaCellProps): React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuProps, GridColumnMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridColumnMenuAggregationItem } from './GridColumnMenuAggregationItem';
|
|
4
|
-
export declare function GridColumnMenuGroupingItem(props: GridColumnMenuItemProps): JSX.Element | null;
|
|
4
|
+
export declare function GridColumnMenuGroupingItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
|
|
5
5
|
export declare const GRID_COLUMN_MENU_SLOTS_PREMIUM: {
|
|
6
6
|
columnMenuAggregationItem: typeof GridColumnMenuAggregationItem;
|
|
7
7
|
columnMenuGroupingItem: typeof GridColumnMenuGroupingItem;
|
|
@@ -22,18 +22,18 @@ export declare const serializeColumn: (column: GridColDef, columnsStyles: Column
|
|
|
22
22
|
headerText: string;
|
|
23
23
|
width: number;
|
|
24
24
|
style: {
|
|
25
|
-
numFmt
|
|
26
|
-
font
|
|
27
|
-
alignment
|
|
28
|
-
protection
|
|
29
|
-
border
|
|
30
|
-
fill
|
|
25
|
+
numFmt?: string | undefined;
|
|
26
|
+
font?: Partial<Excel.Font> | undefined;
|
|
27
|
+
alignment?: Partial<Excel.Alignment> | undefined;
|
|
28
|
+
protection?: Partial<Excel.Protection> | undefined;
|
|
29
|
+
border?: Partial<Excel.Borders> | undefined;
|
|
30
|
+
fill?: Excel.Fill | undefined;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
type SerializedColumns = Array<{
|
|
34
34
|
key: string;
|
|
35
35
|
width: number;
|
|
36
|
-
style: Excel.Style
|
|
36
|
+
style: Partial<Excel.Style>;
|
|
37
37
|
headerText: string;
|
|
38
38
|
}>;
|
|
39
39
|
export declare function serializeColumns(columns: GridStateColDef[], styles: ColumnsStylesInterface): SerializedColumns;
|
|
@@ -40,7 +40,6 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
40
40
|
isRowMatchingFilters,
|
|
41
41
|
filterModel
|
|
42
42
|
} = params;
|
|
43
|
-
const visibleRowsLookup = {};
|
|
44
43
|
const filteredRowsLookup = {};
|
|
45
44
|
const filteredDescendantCountLookup = {};
|
|
46
45
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -72,13 +71,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
72
71
|
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef);
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
|
|
76
74
|
filteredRowsLookup[node.id] = isPassingFiltering;
|
|
77
|
-
|
|
78
|
-
// TODO rows v6: Should we keep storing the visibility status of footer independently or rely on the group visibility in the selector ?
|
|
79
|
-
if (node.type === 'group' && node.footerId != null) {
|
|
80
|
-
visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
|
|
81
|
-
}
|
|
82
75
|
if (!isPassingFiltering) {
|
|
83
76
|
return 0;
|
|
84
77
|
}
|
|
@@ -96,7 +89,6 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
return {
|
|
99
|
-
visibleRowsLookup,
|
|
100
92
|
filteredRowsLookup,
|
|
101
93
|
filteredDescendantCountLookup
|
|
102
94
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { gridColumnLookupSelector, gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree } from '@mui/x-data-grid-pro/internals';
|
|
3
|
+
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree, getVisibleRowsLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
|
|
5
5
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from './createGroupingColDef';
|
|
6
6
|
import { filterRowTreeFromGroupingColumns, getColDefOverrides, ROW_GROUPING_STRATEGY, isGroupingColumn, setStrategyAvailability, getCellGroupingCriteria, getGroupingRules } from './gridRowGroupingUtils';
|
|
@@ -96,6 +96,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
96
96
|
};
|
|
97
97
|
if (params.updates.type === 'full') {
|
|
98
98
|
return createRowTree({
|
|
99
|
+
previousTree: params.previousTree,
|
|
99
100
|
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
100
101
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
101
102
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
@@ -137,6 +138,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
137
138
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
138
139
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'filtering', filterRows);
|
|
139
140
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'sorting', sortRows);
|
|
141
|
+
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
140
142
|
|
|
141
143
|
/**
|
|
142
144
|
* 1ST RENDER
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { useLicenseVerifier, Watermark } from '@mui/x-license-pro';
|
|
@@ -18,11 +19,12 @@ var DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremium(
|
|
|
18
19
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
19
20
|
privateApiRef: privateApiRef,
|
|
20
21
|
props: props,
|
|
21
|
-
children: /*#__PURE__*/_jsxs(GridRoot, {
|
|
22
|
+
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
22
23
|
className: props.className,
|
|
23
24
|
style: props.style,
|
|
24
25
|
sx: props.sx,
|
|
25
|
-
ref: ref
|
|
26
|
+
ref: ref
|
|
27
|
+
}, props.forwardedProps, {
|
|
26
28
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
27
29
|
VirtualScrollerComponent: DataGridProVirtualScroller,
|
|
28
30
|
ColumnHeadersProps: {
|
|
@@ -33,7 +35,7 @@ var DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremium(
|
|
|
33
35
|
releaseInfo: releaseInfo
|
|
34
36
|
})
|
|
35
37
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
36
|
-
})
|
|
38
|
+
}))
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
export var DataGridPremium = /*#__PURE__*/React.memo(DataGridPremiumRaw);
|
|
@@ -286,6 +288,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
286
288
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
287
289
|
quickFilterValues: PropTypes.array
|
|
288
290
|
}),
|
|
291
|
+
/**
|
|
292
|
+
* Forwarded props for the grid root element.
|
|
293
|
+
* @ignore - do not document.
|
|
294
|
+
*/
|
|
295
|
+
forwardedProps: PropTypes.object,
|
|
289
296
|
/**
|
|
290
297
|
* Determines the position of an aggregated value.
|
|
291
298
|
* @param {GridGroupNode} groupNode The current group.
|
|
@@ -909,6 +916,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
909
916
|
* Set the cell selection model of the grid.
|
|
910
917
|
*/
|
|
911
918
|
unstable_cellSelectionModel: PropTypes.object,
|
|
919
|
+
/**
|
|
920
|
+
* If `true`, enables the data grid filtering on header feature.
|
|
921
|
+
* @default false
|
|
922
|
+
*/
|
|
923
|
+
unstable_headerFilters: PropTypes.bool,
|
|
912
924
|
/**
|
|
913
925
|
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
914
926
|
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -29,6 +29,7 @@ export var useDataGridPremiumComponent = function useDataGridPremiumComponent(in
|
|
|
29
29
|
/**
|
|
30
30
|
* Register all state initializers here.
|
|
31
31
|
*/
|
|
32
|
+
useGridInitializeState(headerFilteringStateInitializer, privateApiRef, props);
|
|
32
33
|
useGridInitializeState(rowGroupingStateInitializer, privateApiRef, props);
|
|
33
34
|
useGridInitializeState(aggregationStateInitializer, privateApiRef, props);
|
|
34
35
|
useGridInitializeState(rowSelectionStateInitializer, privateApiRef, props);
|
|
@@ -51,6 +52,7 @@ export var useDataGridPremiumComponent = function useDataGridPremiumComponent(in
|
|
|
51
52
|
useGridInitializeState(columnMenuStateInitializer, privateApiRef, props);
|
|
52
53
|
useGridInitializeState(columnGroupsStateInitializer, privateApiRef, props);
|
|
53
54
|
useGridRowGrouping(privateApiRef, props);
|
|
55
|
+
useGridHeaderFiltering(privateApiRef, props);
|
|
54
56
|
useGridTreeData(privateApiRef);
|
|
55
57
|
useGridAggregation(privateApiRef, props);
|
|
56
58
|
useGridKeyboardNavigation(privateApiRef, props);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["components", "componentsProps"];
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
5
|
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
7
|
-
import { computeSlots, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
6
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
8
7
|
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
9
8
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';
|
|
10
9
|
|
|
@@ -30,13 +29,14 @@ export var DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO_P
|
|
|
30
29
|
});
|
|
31
30
|
var defaultSlots = uncapitalizeObjectKeys(DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS);
|
|
32
31
|
export var useDataGridPremiumProps = function useDataGridPremiumProps(inProps) {
|
|
33
|
-
var
|
|
32
|
+
var _useProps = useProps(useThemeProps({
|
|
34
33
|
props: inProps,
|
|
35
34
|
name: 'MuiDataGrid'
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
})),
|
|
36
|
+
_useProps2 = _slicedToArray(_useProps, 3),
|
|
37
|
+
components = _useProps2[0],
|
|
38
|
+
componentsProps = _useProps2[1],
|
|
39
|
+
themedProps = _useProps2[2];
|
|
40
40
|
var localeText = React.useMemo(function () {
|
|
41
41
|
return _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText);
|
|
42
42
|
}, [themedProps.localeText]);
|
|
@@ -41,7 +41,6 @@ export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGrouping
|
|
|
41
41
|
var rowTree = params.rowTree,
|
|
42
42
|
isRowMatchingFilters = params.isRowMatchingFilters,
|
|
43
43
|
filterModel = params.filterModel;
|
|
44
|
-
var visibleRowsLookup = {};
|
|
45
44
|
var filteredRowsLookup = {};
|
|
46
45
|
var filteredDescendantCountLookup = {};
|
|
47
46
|
var filterTreeNode = function filterTreeNode(node, areAncestorsExpanded, ancestorsResults) {
|
|
@@ -79,13 +78,7 @@ export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGrouping
|
|
|
79
78
|
}), filterModel, params.apiRef);
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
|
|
83
81
|
filteredRowsLookup[node.id] = isPassingFiltering;
|
|
84
|
-
|
|
85
|
-
// TODO rows v6: Should we keep storing the visibility status of footer independently or rely on the group visibility in the selector ?
|
|
86
|
-
if (node.type === 'group' && node.footerId != null) {
|
|
87
|
-
visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
|
|
88
|
-
}
|
|
89
82
|
if (!isPassingFiltering) {
|
|
90
83
|
return 0;
|
|
91
84
|
}
|
|
@@ -103,7 +96,6 @@ export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGrouping
|
|
|
103
96
|
}
|
|
104
97
|
}
|
|
105
98
|
return {
|
|
106
|
-
visibleRowsLookup: visibleRowsLookup,
|
|
107
99
|
filteredRowsLookup: filteredRowsLookup,
|
|
108
100
|
filteredDescendantCountLookup: filteredDescendantCountLookup
|
|
109
101
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { gridColumnLookupSelector, gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid-pro';
|
|
4
|
-
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree, getVisibleRowsLookup } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
|
|
6
6
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from './createGroupingColDef';
|
|
7
7
|
import { filterRowTreeFromGroupingColumns, getColDefOverrides, ROW_GROUPING_STRATEGY, isGroupingColumn, setStrategyAvailability, getCellGroupingCriteria, getGroupingRules } from './gridRowGroupingUtils';
|
|
@@ -107,6 +107,7 @@ export var useGridRowGroupingPreProcessors = function useGridRowGroupingPreProce
|
|
|
107
107
|
};
|
|
108
108
|
if (params.updates.type === 'full') {
|
|
109
109
|
return createRowTree({
|
|
110
|
+
previousTree: params.previousTree,
|
|
110
111
|
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
111
112
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
112
113
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
@@ -148,6 +149,7 @@ export var useGridRowGroupingPreProcessors = function useGridRowGroupingPreProce
|
|
|
148
149
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
149
150
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'filtering', filterRows);
|
|
150
151
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'sorting', sortRows);
|
|
152
|
+
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
151
153
|
|
|
152
154
|
/**
|
|
153
155
|
* 1ST RENDER
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4NTU3MDQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { useLicenseVerifier, Watermark } from '@mui/x-license-pro';
|
|
@@ -18,11 +19,12 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
18
19
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
19
20
|
privateApiRef: privateApiRef,
|
|
20
21
|
props: props,
|
|
21
|
-
children: /*#__PURE__*/_jsxs(GridRoot, {
|
|
22
|
+
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
22
23
|
className: props.className,
|
|
23
24
|
style: props.style,
|
|
24
25
|
sx: props.sx,
|
|
25
|
-
ref: ref
|
|
26
|
+
ref: ref
|
|
27
|
+
}, props.forwardedProps, {
|
|
26
28
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
27
29
|
VirtualScrollerComponent: DataGridProVirtualScroller,
|
|
28
30
|
ColumnHeadersProps: {
|
|
@@ -33,7 +35,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
33
35
|
releaseInfo: releaseInfo
|
|
34
36
|
})
|
|
35
37
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
36
|
-
})
|
|
38
|
+
}))
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
export const DataGridPremium = /*#__PURE__*/React.memo(DataGridPremiumRaw);
|
|
@@ -286,6 +288,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
286
288
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
287
289
|
quickFilterValues: PropTypes.array
|
|
288
290
|
}),
|
|
291
|
+
/**
|
|
292
|
+
* Forwarded props for the grid root element.
|
|
293
|
+
* @ignore - do not document.
|
|
294
|
+
*/
|
|
295
|
+
forwardedProps: PropTypes.object,
|
|
289
296
|
/**
|
|
290
297
|
* Determines the position of an aggregated value.
|
|
291
298
|
* @param {GridGroupNode} groupNode The current group.
|
|
@@ -909,6 +916,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
909
916
|
* Set the cell selection model of the grid.
|
|
910
917
|
*/
|
|
911
918
|
unstable_cellSelectionModel: PropTypes.object,
|
|
919
|
+
/**
|
|
920
|
+
* If `true`, enables the data grid filtering on header feature.
|
|
921
|
+
* @default false
|
|
922
|
+
*/
|
|
923
|
+
unstable_headerFilters: PropTypes.bool,
|
|
912
924
|
/**
|
|
913
925
|
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
914
926
|
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -29,6 +29,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
29
29
|
/**
|
|
30
30
|
* Register all state initializers here.
|
|
31
31
|
*/
|
|
32
|
+
useGridInitializeState(headerFilteringStateInitializer, privateApiRef, props);
|
|
32
33
|
useGridInitializeState(rowGroupingStateInitializer, privateApiRef, props);
|
|
33
34
|
useGridInitializeState(aggregationStateInitializer, privateApiRef, props);
|
|
34
35
|
useGridInitializeState(rowSelectionStateInitializer, privateApiRef, props);
|
|
@@ -51,6 +52,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
51
52
|
useGridInitializeState(columnMenuStateInitializer, privateApiRef, props);
|
|
52
53
|
useGridInitializeState(columnGroupsStateInitializer, privateApiRef, props);
|
|
53
54
|
useGridRowGrouping(privateApiRef, props);
|
|
55
|
+
useGridHeaderFiltering(privateApiRef, props);
|
|
54
56
|
useGridTreeData(privateApiRef);
|
|
55
57
|
useGridAggregation(privateApiRef, props);
|
|
56
58
|
useGridKeyboardNavigation(privateApiRef, props);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["components", "componentsProps"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
4
|
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
7
|
-
import { computeSlots, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '@mui/x-data-grid-pro/internals';
|
|
8
6
|
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
9
7
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';
|
|
10
8
|
|
|
@@ -24,15 +22,10 @@ export const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO
|
|
|
24
22
|
});
|
|
25
23
|
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS);
|
|
26
24
|
export const useDataGridPremiumProps = inProps => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
components,
|
|
33
|
-
componentsProps
|
|
34
|
-
} = _useThemeProps,
|
|
35
|
-
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
25
|
+
const [components, componentsProps, themedProps] = useProps(useThemeProps({
|
|
26
|
+
props: inProps,
|
|
27
|
+
name: 'MuiDataGrid'
|
|
28
|
+
}));
|
|
36
29
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
37
30
|
const slots = React.useMemo(() => computeSlots({
|
|
38
31
|
defaultSlots,
|
|
@@ -40,7 +40,6 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
40
40
|
isRowMatchingFilters,
|
|
41
41
|
filterModel
|
|
42
42
|
} = params;
|
|
43
|
-
const visibleRowsLookup = {};
|
|
44
43
|
const filteredRowsLookup = {};
|
|
45
44
|
const filteredDescendantCountLookup = {};
|
|
46
45
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -72,13 +71,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
72
71
|
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef);
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
|
|
76
74
|
filteredRowsLookup[node.id] = isPassingFiltering;
|
|
77
|
-
|
|
78
|
-
// TODO rows v6: Should we keep storing the visibility status of footer independently or rely on the group visibility in the selector ?
|
|
79
|
-
if (node.type === 'group' && node.footerId != null) {
|
|
80
|
-
visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
|
|
81
|
-
}
|
|
82
75
|
if (!isPassingFiltering) {
|
|
83
76
|
return 0;
|
|
84
77
|
}
|
|
@@ -96,7 +89,6 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
return {
|
|
99
|
-
visibleRowsLookup,
|
|
100
92
|
filteredRowsLookup,
|
|
101
93
|
filteredDescendantCountLookup
|
|
102
94
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { gridColumnLookupSelector, gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree } from '@mui/x-data-grid-pro/internals';
|
|
3
|
+
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree, getVisibleRowsLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
|
|
5
5
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from './createGroupingColDef';
|
|
6
6
|
import { filterRowTreeFromGroupingColumns, getColDefOverrides, ROW_GROUPING_STRATEGY, isGroupingColumn, setStrategyAvailability, getCellGroupingCriteria, getGroupingRules } from './gridRowGroupingUtils';
|
|
@@ -96,6 +96,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
96
96
|
};
|
|
97
97
|
if (params.updates.type === 'full') {
|
|
98
98
|
return createRowTree({
|
|
99
|
+
previousTree: params.previousTree,
|
|
99
100
|
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
100
101
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
101
102
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
@@ -137,6 +138,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
137
138
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
138
139
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'filtering', filterRows);
|
|
139
140
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'sorting', sortRows);
|
|
141
|
+
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
140
142
|
|
|
141
143
|
/**
|
|
142
144
|
* 1ST RENDER
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4NTU3MDQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.DataGridPremium = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _xLicensePro = require("@mui/x-license-pro");
|
|
@@ -26,11 +27,12 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridContextProvider, {
|
|
27
28
|
privateApiRef: privateApiRef,
|
|
28
29
|
props: props,
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_xDataGridPro.GridRoot, {
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_xDataGridPro.GridRoot, (0, _extends2.default)({
|
|
30
31
|
className: props.className,
|
|
31
32
|
style: props.style,
|
|
32
33
|
sx: props.sx,
|
|
33
|
-
ref: ref
|
|
34
|
+
ref: ref
|
|
35
|
+
}, props.forwardedProps, {
|
|
34
36
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridBody, {
|
|
35
37
|
VirtualScrollerComponent: _internals.DataGridProVirtualScroller,
|
|
36
38
|
ColumnHeadersProps: {
|
|
@@ -41,7 +43,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
41
43
|
releaseInfo: releaseInfo
|
|
42
44
|
})
|
|
43
45
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridFooterPlaceholder, {})]
|
|
44
|
-
})
|
|
46
|
+
}))
|
|
45
47
|
});
|
|
46
48
|
});
|
|
47
49
|
const DataGridPremium = /*#__PURE__*/React.memo(DataGridPremiumRaw);
|
|
@@ -295,6 +297,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
295
297
|
quickFilterLogicOperator: _propTypes.default.oneOf(['and', 'or']),
|
|
296
298
|
quickFilterValues: _propTypes.default.array
|
|
297
299
|
}),
|
|
300
|
+
/**
|
|
301
|
+
* Forwarded props for the grid root element.
|
|
302
|
+
* @ignore - do not document.
|
|
303
|
+
*/
|
|
304
|
+
forwardedProps: _propTypes.default.object,
|
|
298
305
|
/**
|
|
299
306
|
* Determines the position of an aggregated value.
|
|
300
307
|
* @param {GridGroupNode} groupNode The current group.
|
|
@@ -918,6 +925,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
918
925
|
* Set the cell selection model of the grid.
|
|
919
926
|
*/
|
|
920
927
|
unstable_cellSelectionModel: _propTypes.default.object,
|
|
928
|
+
/**
|
|
929
|
+
* If `true`, enables the data grid filtering on header feature.
|
|
930
|
+
* @default false
|
|
931
|
+
*/
|
|
932
|
+
unstable_headerFilters: _propTypes.default.bool,
|
|
921
933
|
/**
|
|
922
934
|
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
923
935
|
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
@@ -36,6 +36,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
36
36
|
/**
|
|
37
37
|
* Register all state initializers here.
|
|
38
38
|
*/
|
|
39
|
+
(0, _internals.useGridInitializeState)(_internals.headerFilteringStateInitializer, privateApiRef, props);
|
|
39
40
|
(0, _internals.useGridInitializeState)(_useGridRowGrouping.rowGroupingStateInitializer, privateApiRef, props);
|
|
40
41
|
(0, _internals.useGridInitializeState)(_useGridAggregation.aggregationStateInitializer, privateApiRef, props);
|
|
41
42
|
(0, _internals.useGridInitializeState)(_internals.rowSelectionStateInitializer, privateApiRef, props);
|
|
@@ -58,6 +59,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
58
59
|
(0, _internals.useGridInitializeState)(_internals.columnMenuStateInitializer, privateApiRef, props);
|
|
59
60
|
(0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, privateApiRef, props);
|
|
60
61
|
(0, _useGridRowGrouping.useGridRowGrouping)(privateApiRef, props);
|
|
62
|
+
(0, _internals.useGridHeaderFiltering)(privateApiRef, props);
|
|
61
63
|
(0, _internals.useGridTreeData)(privateApiRef);
|
|
62
64
|
(0, _useGridAggregation.useGridAggregation)(privateApiRef, props);
|
|
63
65
|
(0, _internals.useGridKeyboardNavigation)(privateApiRef, props);
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useDataGridPremiumProps = exports.DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = void 0;
|
|
8
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _styles = require("@mui/material/styles");
|
|
@@ -13,7 +12,6 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
|
13
12
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
14
13
|
var _aggregation = require("../hooks/features/aggregation");
|
|
15
14
|
var _dataGridPremiumDefaultSlotsComponents = require("../constants/dataGridPremiumDefaultSlotsComponents");
|
|
16
|
-
const _excluded = ["components", "componentsProps"];
|
|
17
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
17
|
/**
|
|
@@ -33,15 +31,10 @@ const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = (0, _extends2.default)({}, _xData
|
|
|
33
31
|
exports.DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES;
|
|
34
32
|
const defaultSlots = (0, _internals.uncapitalizeObjectKeys)(_dataGridPremiumDefaultSlotsComponents.DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS);
|
|
35
33
|
const useDataGridPremiumProps = inProps => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
components,
|
|
42
|
-
componentsProps
|
|
43
|
-
} = _useThemeProps,
|
|
44
|
-
themedProps = (0, _objectWithoutPropertiesLoose2.default)(_useThemeProps, _excluded);
|
|
34
|
+
const [components, componentsProps, themedProps] = (0, _internals.useProps)((0, _styles.useThemeProps)({
|
|
35
|
+
props: inProps,
|
|
36
|
+
name: 'MuiDataGrid'
|
|
37
|
+
}));
|
|
45
38
|
const localeText = React.useMemo(() => (0, _extends2.default)({}, _xDataGridPro.GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
46
39
|
const slots = React.useMemo(() => (0, _internals.computeSlots)({
|
|
47
40
|
defaultSlots,
|
|
@@ -52,7 +52,6 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
52
52
|
isRowMatchingFilters,
|
|
53
53
|
filterModel
|
|
54
54
|
} = params;
|
|
55
|
-
const visibleRowsLookup = {};
|
|
56
55
|
const filteredRowsLookup = {};
|
|
57
56
|
const filteredDescendantCountLookup = {};
|
|
58
57
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -84,13 +83,7 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
84
83
|
isPassingFiltering = (0, _internals.passFilterLogic)(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
|
|
88
86
|
filteredRowsLookup[node.id] = isPassingFiltering;
|
|
89
|
-
|
|
90
|
-
// TODO rows v6: Should we keep storing the visibility status of footer independently or rely on the group visibility in the selector ?
|
|
91
|
-
if (node.type === 'group' && node.footerId != null) {
|
|
92
|
-
visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
|
|
93
|
-
}
|
|
94
87
|
if (!isPassingFiltering) {
|
|
95
88
|
return 0;
|
|
96
89
|
}
|
|
@@ -108,7 +101,6 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
108
101
|
}
|
|
109
102
|
}
|
|
110
103
|
return {
|
|
111
|
-
visibleRowsLookup,
|
|
112
104
|
filteredRowsLookup,
|
|
113
105
|
filteredDescendantCountLookup
|
|
114
106
|
};
|
|
@@ -104,6 +104,7 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
104
104
|
};
|
|
105
105
|
if (params.updates.type === 'full') {
|
|
106
106
|
return (0, _internals.createRowTree)({
|
|
107
|
+
previousTree: params.previousTree,
|
|
107
108
|
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
108
109
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
109
110
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
@@ -145,6 +146,7 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
145
146
|
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.ROW_GROUPING_STRATEGY, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
146
147
|
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.ROW_GROUPING_STRATEGY, 'filtering', filterRows);
|
|
147
148
|
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.ROW_GROUPING_STRATEGY, 'sorting', sortRows);
|
|
149
|
+
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.ROW_GROUPING_STRATEGY, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
|
|
148
150
|
|
|
149
151
|
/**
|
|
150
152
|
* 1ST RENDER
|
package/node/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTY4NTU3MDQwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "The Premium plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.21.0",
|
|
35
|
-
"@mui/utils": "^5.
|
|
36
|
-
"@mui/x-data-grid": "6.
|
|
37
|
-
"@mui/x-data-grid-pro": "6.
|
|
38
|
-
"@mui/x-license-pro": "6.0
|
|
35
|
+
"@mui/utils": "^5.13.1",
|
|
36
|
+
"@mui/x-data-grid": "6.6.0",
|
|
37
|
+
"@mui/x-data-grid-pro": "6.6.0",
|
|
38
|
+
"@mui/x-license-pro": "6.6.0",
|
|
39
39
|
"@types/format-util": "^1.0.2",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"exceljs": "^4.3.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@mui/material": "^5.4.1",
|
|
47
47
|
"@mui/system": "^5.4.1",
|
|
48
|
-
"react": "^17.0.
|
|
49
|
-
"react-dom": "^17.0.
|
|
48
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
49
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"setupFiles": [
|
|
52
52
|
"<rootDir>/src/setupTests.js"
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4NTU3MDQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|