@mui/x-data-grid-premium 8.9.1 → 8.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -2
- package/DataGridPremium/DataGridPremium.js +27 -10
- package/DataGridPremium/useDataGridPremiumComponent.js +4 -0
- package/components/GridColumnMenuPivotItem.js +4 -3
- package/components/GridDataSourceGroupingCriteriaCell.js +3 -1
- package/components/pivotPanel/GridPivotPanelHeader.js +1 -1
- package/components/pivotPanel/PivotPanelTrigger.js +6 -1
- package/components/sidebar/Sidebar.d.ts +1 -1
- package/components/sidebar/Sidebar.js +20 -4
- package/esm/DataGridPremium/DataGridPremium.js +29 -12
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -1
- package/esm/components/GridColumnMenuPivotItem.js +3 -2
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +3 -1
- package/esm/components/pivotPanel/GridPivotPanelHeader.js +1 -1
- package/esm/components/pivotPanel/PivotPanelTrigger.js +6 -1
- package/esm/components/sidebar/Sidebar.d.ts +1 -1
- package/esm/components/sidebar/Sidebar.js +21 -5
- package/esm/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -1
- package/esm/hooks/features/aiAssistant/api.d.ts +3 -3
- package/esm/hooks/features/aiAssistant/api.js +8 -4
- package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +11 -0
- package/esm/hooks/features/export/serializer/excelSerializer.js +1 -6
- package/esm/hooks/features/index.d.ts +2 -1
- package/esm/hooks/features/index.js +2 -1
- package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +5 -0
- package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -1
- package/esm/hooks/features/pivoting/gridPivotingSelectors.js +3 -1
- package/esm/hooks/features/pivoting/useGridPivoting.d.ts +1 -1
- package/esm/hooks/features/pivoting/useGridPivoting.js +28 -9
- package/esm/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -2
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +10 -3
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -5
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -6
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/esm/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
- package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -2
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.d.ts +16 -0
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.js +4 -0
- package/esm/hooks/features/sidebar/gridSidebarSelector.d.ts +12 -0
- package/esm/hooks/features/sidebar/gridSidebarSelector.js +12 -0
- package/esm/hooks/features/sidebar/gridSidebarState.d.ts +8 -0
- package/esm/hooks/features/sidebar/gridSidebarState.js +1 -0
- package/esm/hooks/features/sidebar/index.d.ts +3 -0
- package/esm/hooks/features/sidebar/index.js +3 -0
- package/esm/hooks/features/sidebar/useGridSidebar.d.ts +6 -0
- package/esm/hooks/features/sidebar/useGridSidebar.js +72 -0
- package/esm/hooks/utils/useGridAriaAttributes.d.ts +1 -1
- package/esm/hooks/utils/useGridAriaAttributes.js +2 -2
- package/esm/index.js +1 -1
- package/esm/models/dataGridPremiumProps.d.ts +16 -0
- package/esm/models/gridApiPremium.d.ts +2 -1
- package/esm/models/gridStatePremium.d.ts +3 -0
- package/esm/typeOverloads/modules.d.ts +28 -1
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -1
- package/hooks/features/aiAssistant/api.d.ts +3 -3
- package/hooks/features/aiAssistant/api.js +8 -4
- package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +11 -0
- package/hooks/features/export/serializer/excelSerializer.js +1 -6
- package/hooks/features/index.d.ts +2 -1
- package/hooks/features/index.js +11 -0
- package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +5 -0
- package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -1
- package/hooks/features/pivoting/gridPivotingSelectors.js +3 -8
- package/hooks/features/pivoting/useGridPivoting.d.ts +1 -1
- package/hooks/features/pivoting/useGridPivoting.js +28 -9
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -2
- package/hooks/features/rowGrouping/createGroupingColDef.js +13 -6
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -5
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -8
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +6 -6
- package/hooks/features/rowGrouping/useGridRowGrouping.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +7 -7
- package/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
- package/hooks/features/rows/useGridRowAriaAttributes.js +4 -4
- package/hooks/features/sidebar/gridSidebarInterfaces.d.ts +16 -0
- package/hooks/features/sidebar/gridSidebarInterfaces.js +10 -0
- package/hooks/features/sidebar/gridSidebarSelector.d.ts +12 -0
- package/hooks/features/sidebar/gridSidebarSelector.js +18 -0
- package/hooks/features/sidebar/gridSidebarState.d.ts +8 -0
- package/hooks/features/sidebar/gridSidebarState.js +5 -0
- package/hooks/features/sidebar/index.d.ts +3 -0
- package/hooks/features/sidebar/index.js +38 -0
- package/hooks/features/sidebar/useGridSidebar.d.ts +6 -0
- package/hooks/features/sidebar/useGridSidebar.js +82 -0
- package/hooks/utils/useGridAriaAttributes.d.ts +1 -1
- package/hooks/utils/useGridAriaAttributes.js +4 -4
- package/index.js +1 -1
- package/models/dataGridPremiumProps.d.ts +16 -0
- package/models/gridApiPremium.d.ts +2 -1
- package/models/gridStatePremium.d.ts +3 -0
- package/package.json +7 -8
- package/typeOverloads/modules.d.ts +28 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,100 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.9.2
|
|
9
|
+
|
|
10
|
+
_Jul 31, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 23 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🌎 Improve French (fr-FR), Hebrew (he-IL) and Polish (pl-PL) locales on the Data Grid
|
|
15
|
+
- 🌎 Improve Korean (ko-KR) locale on the Date and Time Pickers
|
|
16
|
+
- 📈 Add symlog scale to charts
|
|
17
|
+
- 📊 Fix bar border radius on Firefox
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
22
|
+
@AmrElnaggar99, @atlanteh, @ddolcimascolo, @Jiseoup, @leonaha5, @noherczeg, @sai6855
|
|
23
|
+
|
|
24
|
+
The following are all team members who have contributed to this release:
|
|
25
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @bharatkashyap, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @mapache-salvaje, @MBilalShafi, @rita-codes, @romgrk, @siriwatknp
|
|
26
|
+
|
|
27
|
+
### Data Grid
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid@8.9.2`
|
|
30
|
+
|
|
31
|
+
- [DataGrid] Add debounce for columns panel search (#18719) @noherczeg
|
|
32
|
+
- [DataGrid] Extract virtualization engine (#18275) @romgrk
|
|
33
|
+
- [DataGrid] Improve types in `<GridEditSingleSelect />` (#18184) @sai6855
|
|
34
|
+
- [l10n] Improve French (fr-FR) locale (#18905) @ddolcimascolo
|
|
35
|
+
- [l10n] Improve Hebrew (he-IL) locale (#18665) @atlanteh
|
|
36
|
+
- [l10n] Improve Polish (pl-PL) locale (#18068) @leonaha5
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@8.9.2`, plus:
|
|
41
|
+
|
|
42
|
+
- [DataGridPro] Fix duplicate nested rows for dynamically updated row IDs (#18526) @MBilalShafi
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@8.9.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@8.9.2`, plus:
|
|
47
|
+
|
|
48
|
+
- [DataGridPremium] Add `privateMode` to AI assistant prompt resolver (#18759) @bharatkashyap
|
|
49
|
+
- [DataGridPremium] Fix empty nested group values caused by main criterial `valueFormatter()` (#18916) @cherniavskii
|
|
50
|
+
- [DataGridPremium] Sidebar content and state is managed the same way as for preference panel (#18741) @arminmeh
|
|
51
|
+
- [DataGridPremium] Make `api` param for the aggregation function optional (#18984) @arminmeh
|
|
52
|
+
|
|
53
|
+
### Date and Time Pickers
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-date-pickers@8.9.2`
|
|
56
|
+
|
|
57
|
+
- [l10n] Improve Korean (ko-KR) locale (#18664) @Jiseoup
|
|
58
|
+
- [pickers] Fix popper click-away behavior (#18804) @LukasTy
|
|
59
|
+
- [pickers] Fix usage not in main document (#18944) @LukasTy
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-date-pickers@8.9.2`.
|
|
64
|
+
|
|
65
|
+
### Charts
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts@8.9.2`
|
|
68
|
+
|
|
69
|
+
- [charts] Add symlog scale to charts (#18729) @bernardobelchior
|
|
70
|
+
- [charts] Fix bar border radius on Firefox (#18824) @bernardobelchior
|
|
71
|
+
- [charts] Fix crash when rendering large scatter dataset (#18845) @bernardobelchior
|
|
72
|
+
- [charts] Remove unnecessary type assertion in tooltip `valueFormatter()` (#18877) @sai6855
|
|
73
|
+
- [charts] Export `ChartsWrapper` from `'./ChartsWrapper'` rather than `'./internals'` (#18966) @JCQuintas
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-charts-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
76
|
+
|
|
77
|
+
Same changes as in `@mui/x-charts@8.9.2`, plus:
|
|
78
|
+
|
|
79
|
+
- [charts-pro] Fix voronoi interaction with zoom (#18950) @alexfauquette
|
|
80
|
+
- [charts-pro] Hide toolbar by default when exporting (#18764) @bernardobelchior
|
|
81
|
+
|
|
82
|
+
### Codemod
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-codemod@8.9.2`
|
|
85
|
+
|
|
86
|
+
Internal changes.
|
|
87
|
+
|
|
88
|
+
### Docs
|
|
89
|
+
|
|
90
|
+
- [docs] Add Data Grid demo pages (#18180) @KenanYusuf
|
|
91
|
+
- [docs] Copyedit the Charts Overview page (#18840) @mapache-salvaje
|
|
92
|
+
- [docs] Fix incorrect parameter name in pickers "Custom components" page from `variant` to `pickerVariant` (#18919) @AmrElnaggar99
|
|
93
|
+
|
|
94
|
+
### Miscellaneous
|
|
95
|
+
|
|
96
|
+
- [code-infra] Auto-generate deep exports to prevent asymmetric exports (#18917) @JCQuintas
|
|
97
|
+
- [docs-infra] Turn on "Edit in Chat" for X docs (#18869) @siriwatknp
|
|
98
|
+
- [infra] Add specific bundle size tracking (#18884) @Janpot
|
|
99
|
+
- [infra] Fix markdown formatting in llms generation (#18914) @Janpot
|
|
100
|
+
- [infra] Use CI action from mui-public (#18709) @brijeshb42
|
|
101
|
+
|
|
8
102
|
## 8.9.1
|
|
9
103
|
|
|
10
104
|
_Jul 21, 2025_
|
|
@@ -23,11 +117,11 @@ The following are all team members who have contributed to this release:
|
|
|
23
117
|
- [DataGrid] Move conditional list view column logic into `gridVisibleColumnDefinitionsSelector` (#18724) @KenanYusuf
|
|
24
118
|
- [DataGrid] Fix row selection "exclude" model inconsistency (#18844) @MBilalShafi
|
|
25
119
|
|
|
26
|
-
#### `@mui/x-data-grid-pro@8.9.1` [](https://mui.com/r/x-pro-svg-link
|
|
120
|
+
#### `@mui/x-data-grid-pro@8.9.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
121
|
|
|
28
122
|
Same changes as in `@mui/x-data-grid@8.9.1`.
|
|
29
123
|
|
|
30
|
-
#### `@mui/x-data-grid-premium@8.9.1` [](https://mui.com/r/x-premium-svg-link
|
|
124
|
+
#### `@mui/x-data-grid-premium@8.9.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
125
|
|
|
32
126
|
Same changes as in `@mui/x-data-grid-pro@8.9.1`.
|
|
33
127
|
|
|
@@ -18,19 +18,17 @@ var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
|
18
18
|
var _useDataGridPremiumComponent = require("./useDataGridPremiumComponent");
|
|
19
19
|
var _useDataGridPremiumProps = require("./useDataGridPremiumProps");
|
|
20
20
|
var _sidebar = require("../components/sidebar");
|
|
21
|
-
var _GridPivotPanel = require("../components/pivotPanel/GridPivotPanel");
|
|
22
21
|
var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
|
|
23
22
|
var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
|
|
24
23
|
var _gridAggregationSelectors = require("../hooks/features/aggregation/gridAggregationSelectors");
|
|
25
24
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
26
|
-
var
|
|
27
|
-
var _utils = require("../hooks/features/pivoting/utils");
|
|
25
|
+
var _sidebar2 = require("../hooks/features/sidebar");
|
|
28
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
27
|
const configuration = {
|
|
30
28
|
hooks: {
|
|
31
29
|
useCSSVariables: _material.useMaterialCSSVariables,
|
|
32
|
-
useGridAriaAttributes: _useGridAriaAttributes.
|
|
33
|
-
useGridRowAriaAttributes: _useGridRowAriaAttributes.
|
|
30
|
+
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributesPremium,
|
|
31
|
+
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributesPremium,
|
|
34
32
|
useCellAggregationResult: (id, field) => {
|
|
35
33
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
36
34
|
return (0, _xDataGridPro.useGridSelector)(apiRef, _gridAggregationSelectors.gridCellAggregationResultSelector, {
|
|
@@ -40,7 +38,7 @@ const configuration = {
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
};
|
|
43
|
-
const releaseInfo = "
|
|
41
|
+
const releaseInfo = "MTc1MzkxMjgwMDAwMA==";
|
|
44
42
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
45
43
|
packageName: "x-data-grid-premium",
|
|
46
44
|
releaseInfo: releaseInfo
|
|
@@ -54,13 +52,11 @@ const DataGridPremiumRaw = (0, _forwardRef.forwardRef)(function DataGridPremium(
|
|
|
54
52
|
const privateApiRef = (0, _internals.useGridApiInitialization)(initialProps.apiRef, initialProps);
|
|
55
53
|
const props = (0, _useDataGridPremiumComponent.useDataGridPremiumComponent)(privateApiRef, initialProps);
|
|
56
54
|
(0, _xLicense.useLicenseVerifier)('x-data-grid-premium', releaseInfo);
|
|
57
|
-
const pivotSettingsOpen = (0, _xDataGridPro.useGridSelector)(privateApiRef, _gridPivotingSelectors.gridPivotPanelOpenSelector);
|
|
58
55
|
if (process.env.NODE_ENV !== 'production') {
|
|
59
56
|
(0, _internals.validateProps)(props, dataGridPremiumPropValidators);
|
|
60
57
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
}) : null;
|
|
58
|
+
const sidebarOpen = (0, _xDataGridPro.useGridSelector)(privateApiRef, _sidebar2.gridSidebarOpenSelector);
|
|
59
|
+
const sidePanel = sidebarOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.Sidebar, {}) : null;
|
|
64
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridContextProvider, {
|
|
65
61
|
privateApiRef: privateApiRef,
|
|
66
62
|
configuration: configuration,
|
|
@@ -224,6 +220,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
224
220
|
* @default 150
|
|
225
221
|
*/
|
|
226
222
|
columnBufferPx: _propTypes.default.number,
|
|
223
|
+
/**
|
|
224
|
+
* The milliseconds delay to wait after a keystroke before triggering filtering in the columns menu.
|
|
225
|
+
* @default 150
|
|
226
|
+
*/
|
|
227
|
+
columnFilterDebounceMs: _propTypes.default.number,
|
|
227
228
|
/**
|
|
228
229
|
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
229
230
|
* Inherits the `columnHeaderHeight` value if not set.
|
|
@@ -895,6 +896,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
895
896
|
/**
|
|
896
897
|
* Callback fired when the pivot side panel open state changes.
|
|
897
898
|
* @param {boolean} pivotPanelOpen Whether the pivot side panel is visible.
|
|
899
|
+
* @deprecated Use the `sidebarOpen` and `sidebarClose` events or corresponding event handlers `onSidebarOpen()` and `onSidebarClose()` instead.
|
|
898
900
|
*/
|
|
899
901
|
onPivotPanelOpenChange: _propTypes.default.func,
|
|
900
902
|
/**
|
|
@@ -996,6 +998,20 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
996
998
|
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading Server-side data-Infinite loading} instead.
|
|
997
999
|
*/
|
|
998
1000
|
onRowsScrollEnd: _propTypes.default.func,
|
|
1001
|
+
/**
|
|
1002
|
+
* Callback fired when the sidebar is closed.
|
|
1003
|
+
* @param {GridSidebarParams} params With all properties from [[GridSidebarParams]].
|
|
1004
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
1005
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
1006
|
+
*/
|
|
1007
|
+
onSidebarClose: _propTypes.default.func,
|
|
1008
|
+
/**
|
|
1009
|
+
* Callback fired when the sidebar is opened.
|
|
1010
|
+
* @param {GridSidebarParams} params With all properties from [[GridSidebarParams]].
|
|
1011
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
1012
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
1013
|
+
*/
|
|
1014
|
+
onSidebarOpen: _propTypes.default.func,
|
|
999
1015
|
/**
|
|
1000
1016
|
* Callback fired when the sort model changes before a column is sorted.
|
|
1001
1017
|
* @param {GridSortModel} model With all properties from [[GridSortModel]].
|
|
@@ -1102,6 +1118,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1102
1118
|
/**
|
|
1103
1119
|
* If `true`, the pivot side panel is visible.
|
|
1104
1120
|
* @default false
|
|
1121
|
+
* @deprecated Use `initialState.sidebar.open` instead.
|
|
1105
1122
|
*/
|
|
1106
1123
|
pivotPanelOpen: _propTypes.default.bool,
|
|
1107
1124
|
/**
|
|
@@ -23,6 +23,7 @@ var _useGridClipboardImport = require("../hooks/features/clipboard/useGridClipbo
|
|
|
23
23
|
var _useGridPivoting = require("../hooks/features/pivoting/useGridPivoting");
|
|
24
24
|
var _gridPivotingSelectors = require("../hooks/features/pivoting/gridPivotingSelectors");
|
|
25
25
|
var _useGridAiAssistant = require("../hooks/features/aiAssistant/useGridAiAssistant");
|
|
26
|
+
var _useGridSidebar = require("../hooks/features/sidebar/useGridSidebar");
|
|
26
27
|
// Premium-only features
|
|
27
28
|
|
|
28
29
|
const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
@@ -74,6 +75,7 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
|
74
75
|
(0, _internals.useGridInitializeState)(_internals.detailPanelStateInitializer, apiRef, props);
|
|
75
76
|
(0, _internals.useGridInitializeState)(_internals.columnPinningStateInitializer, apiRef, props, key);
|
|
76
77
|
(0, _internals.useGridInitializeState)(_internals.columnsStateInitializer, apiRef, props, key);
|
|
78
|
+
(0, _internals.useGridInitializeState)(_useGridSidebar.sidebarStateInitializer, apiRef, props);
|
|
77
79
|
(0, _internals.useGridInitializeState)(_useGridPivoting.pivotingStateInitializer, apiRef, props);
|
|
78
80
|
(0, _internals.useGridInitializeState)(_internals.rowPinningStateInitializer, apiRef, props);
|
|
79
81
|
(0, _internals.useGridInitializeState)(_internals.rowsStateInitializer, apiRef, props);
|
|
@@ -95,6 +97,8 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
|
95
97
|
(0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
|
|
96
98
|
(0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
|
|
97
99
|
(0, _internals.useGridInitializeState)(_useGridAiAssistant.aiAssistantStateInitializer, apiRef, props);
|
|
100
|
+
(0, _internals.useGridVirtualizer)(apiRef, props);
|
|
101
|
+
(0, _useGridSidebar.useGridSidebar)(apiRef, props);
|
|
98
102
|
(0, _useGridPivoting.useGridPivoting)(apiRef, props, inProps.columns, inProps.rows);
|
|
99
103
|
(0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
|
|
100
104
|
(0, _internals.useGridHeaderFiltering)(apiRef, props);
|
|
@@ -7,9 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.GridColumnMenuPivotItem = GridColumnMenuPivotItem;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
10
|
-
var
|
|
10
|
+
var _gridPivotingSelectors = require("../hooks/features/pivoting/gridPivotingSelectors");
|
|
11
11
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
12
12
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
13
|
+
var _sidebar = require("../hooks/features/sidebar");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function GridColumnMenuPivotItem(props) {
|
|
15
16
|
const {
|
|
@@ -17,10 +18,10 @@ function GridColumnMenuPivotItem(props) {
|
|
|
17
18
|
} = props;
|
|
18
19
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
19
20
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
20
|
-
const isPivotPanelOpen = (0, _xDataGridPro.useGridSelector)(apiRef,
|
|
21
|
+
const isPivotPanelOpen = (0, _xDataGridPro.useGridSelector)(apiRef, _gridPivotingSelectors.gridPivotPanelOpenSelector);
|
|
21
22
|
const openPivotSettings = event => {
|
|
22
23
|
onClick(event);
|
|
23
|
-
apiRef.current.
|
|
24
|
+
apiRef.current.showSidebar(_sidebar.GridSidebarValue.Pivot);
|
|
24
25
|
};
|
|
25
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
26
27
|
onClick: openPivotSettings,
|
|
@@ -42,7 +42,9 @@ function GridGroupingCriteriaCellIcon(props) {
|
|
|
42
42
|
// always fetch/get from cache the children when the node is expanded
|
|
43
43
|
apiRef.current.dataSource.fetchRows(id);
|
|
44
44
|
} else {
|
|
45
|
-
|
|
45
|
+
// Collapse the node and remove child rows from the grid
|
|
46
|
+
apiRef.current.setRowChildrenExpansion(id, false);
|
|
47
|
+
apiRef.current.removeChildrenRows(id);
|
|
46
48
|
}
|
|
47
49
|
apiRef.current.setCellFocus(id, field);
|
|
48
50
|
event.stopPropagation();
|
|
@@ -81,7 +81,7 @@ function GridPivotPanelHeader(props) {
|
|
|
81
81
|
})
|
|
82
82
|
}, rootProps.slotProps?.baseSwitch)), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
83
83
|
onClick: () => {
|
|
84
|
-
apiRef.current.
|
|
84
|
+
apiRef.current.hideSidebar();
|
|
85
85
|
if (isEmptyPivot) {
|
|
86
86
|
apiRef.current.setPivotActive(false);
|
|
87
87
|
}
|
|
@@ -17,6 +17,7 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
|
17
17
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
18
18
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
19
|
var _gridPivotingSelectors = require("../../hooks/features/pivoting/gridPivotingSelectors");
|
|
20
|
+
var _sidebar = require("../../hooks/features/sidebar");
|
|
20
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
22
|
const _excluded = ["render", "className", "onClick", "onPointerUp"];
|
|
22
23
|
/**
|
|
@@ -50,7 +51,11 @@ const PivotPanelTrigger = exports.PivotPanelTrigger = (0, _forwardRef.forwardRef
|
|
|
50
51
|
};
|
|
51
52
|
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
52
53
|
const handleClick = event => {
|
|
53
|
-
|
|
54
|
+
if (open) {
|
|
55
|
+
apiRef.current.hideSidebar();
|
|
56
|
+
} else {
|
|
57
|
+
apiRef.current.showSidebar(_sidebar.GridSidebarValue.Pivot, panelId, buttonId);
|
|
58
|
+
}
|
|
54
59
|
onClick?.(event);
|
|
55
60
|
};
|
|
56
61
|
const element = (0, _useComponentRenderer.useComponentRenderer)(rootProps.slots.baseButton, render, (0, _extends2.default)({}, rootProps.slotProps?.baseButton, {
|
|
@@ -13,8 +13,10 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
13
13
|
var _system = require("@mui/system");
|
|
14
14
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
16
17
|
var _resizablePanel = require("../resizablePanel");
|
|
17
18
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
|
+
var _sidebar = require("../../hooks/features/sidebar");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
const _excluded = ["className", "children"];
|
|
20
22
|
const useUtilityClasses = ownerState => {
|
|
@@ -39,16 +41,30 @@ const SidebarRoot = (0, _system.styled)(_resizablePanel.ResizablePanel, {
|
|
|
39
41
|
});
|
|
40
42
|
function Sidebar(props) {
|
|
41
43
|
const {
|
|
42
|
-
className
|
|
43
|
-
children
|
|
44
|
+
className
|
|
44
45
|
} = props,
|
|
45
46
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
46
48
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
47
49
|
const classes = useUtilityClasses(rootProps);
|
|
50
|
+
const {
|
|
51
|
+
value,
|
|
52
|
+
sidebarId,
|
|
53
|
+
labelId
|
|
54
|
+
} = (0, _xDataGridPro.useGridSelector)(apiRef, _sidebar.gridSidebarContentSelector);
|
|
55
|
+
if (!value) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const sidebarContent = apiRef.current.unstable_applyPipeProcessors('sidebar', null, value);
|
|
59
|
+
if (!sidebarContent) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
48
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SidebarRoot, (0, _extends2.default)({
|
|
63
|
+
id: sidebarId,
|
|
49
64
|
className: (0, _clsx.default)(className, classes.root),
|
|
50
|
-
ownerState: rootProps
|
|
65
|
+
ownerState: rootProps,
|
|
66
|
+
"aria-labelledby": labelId
|
|
51
67
|
}, other, {
|
|
52
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_resizablePanel.ResizablePanelHandle, {}),
|
|
68
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_resizablePanel.ResizablePanelHandle, {}), sidebarContent]
|
|
53
69
|
}));
|
|
54
70
|
}
|
|
@@ -11,19 +11,17 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
11
11
|
import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
|
|
12
12
|
import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
|
|
13
13
|
import { Sidebar } from "../components/sidebar/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
14
|
+
import { useGridAriaAttributesPremium } from "../hooks/utils/useGridAriaAttributes.js";
|
|
15
|
+
import { useGridRowAriaAttributesPremium } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
17
16
|
import { gridCellAggregationResultSelector } from "../hooks/features/aggregation/gridAggregationSelectors.js";
|
|
18
17
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
19
|
-
import {
|
|
20
|
-
import { isPivotingAvailable } from "../hooks/features/pivoting/utils.js";
|
|
18
|
+
import { gridSidebarOpenSelector } from "../hooks/features/sidebar/index.js";
|
|
21
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
20
|
const configuration = {
|
|
23
21
|
hooks: {
|
|
24
22
|
useCSSVariables: useMaterialCSSVariables,
|
|
25
|
-
useGridAriaAttributes,
|
|
26
|
-
useGridRowAriaAttributes,
|
|
23
|
+
useGridAriaAttributes: useGridAriaAttributesPremium,
|
|
24
|
+
useGridRowAriaAttributes: useGridRowAriaAttributesPremium,
|
|
27
25
|
useCellAggregationResult: (id, field) => {
|
|
28
26
|
const apiRef = useGridApiContext();
|
|
29
27
|
return useGridSelector(apiRef, gridCellAggregationResultSelector, {
|
|
@@ -33,7 +31,7 @@ const configuration = {
|
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
};
|
|
36
|
-
const releaseInfo = "
|
|
34
|
+
const releaseInfo = "MTc1MzkxMjgwMDAwMA==";
|
|
37
35
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
38
36
|
packageName: "x-data-grid-premium",
|
|
39
37
|
releaseInfo: releaseInfo
|
|
@@ -47,13 +45,11 @@ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
|
47
45
|
const privateApiRef = useGridApiInitialization(initialProps.apiRef, initialProps);
|
|
48
46
|
const props = useDataGridPremiumComponent(privateApiRef, initialProps);
|
|
49
47
|
useLicenseVerifier('x-data-grid-premium', releaseInfo);
|
|
50
|
-
const pivotSettingsOpen = useGridSelector(privateApiRef, gridPivotPanelOpenSelector);
|
|
51
48
|
if (process.env.NODE_ENV !== 'production') {
|
|
52
49
|
validateProps(props, dataGridPremiumPropValidators);
|
|
53
50
|
}
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
}) : null;
|
|
51
|
+
const sidebarOpen = useGridSelector(privateApiRef, gridSidebarOpenSelector);
|
|
52
|
+
const sidePanel = sidebarOpen ? /*#__PURE__*/_jsx(Sidebar, {}) : null;
|
|
57
53
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
58
54
|
privateApiRef: privateApiRef,
|
|
59
55
|
configuration: configuration,
|
|
@@ -217,6 +213,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
217
213
|
* @default 150
|
|
218
214
|
*/
|
|
219
215
|
columnBufferPx: PropTypes.number,
|
|
216
|
+
/**
|
|
217
|
+
* The milliseconds delay to wait after a keystroke before triggering filtering in the columns menu.
|
|
218
|
+
* @default 150
|
|
219
|
+
*/
|
|
220
|
+
columnFilterDebounceMs: PropTypes.number,
|
|
220
221
|
/**
|
|
221
222
|
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
222
223
|
* Inherits the `columnHeaderHeight` value if not set.
|
|
@@ -888,6 +889,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
888
889
|
/**
|
|
889
890
|
* Callback fired when the pivot side panel open state changes.
|
|
890
891
|
* @param {boolean} pivotPanelOpen Whether the pivot side panel is visible.
|
|
892
|
+
* @deprecated Use the `sidebarOpen` and `sidebarClose` events or corresponding event handlers `onSidebarOpen()` and `onSidebarClose()` instead.
|
|
891
893
|
*/
|
|
892
894
|
onPivotPanelOpenChange: PropTypes.func,
|
|
893
895
|
/**
|
|
@@ -989,6 +991,20 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
989
991
|
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading Server-side data-Infinite loading} instead.
|
|
990
992
|
*/
|
|
991
993
|
onRowsScrollEnd: PropTypes.func,
|
|
994
|
+
/**
|
|
995
|
+
* Callback fired when the sidebar is closed.
|
|
996
|
+
* @param {GridSidebarParams} params With all properties from [[GridSidebarParams]].
|
|
997
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
998
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
999
|
+
*/
|
|
1000
|
+
onSidebarClose: PropTypes.func,
|
|
1001
|
+
/**
|
|
1002
|
+
* Callback fired when the sidebar is opened.
|
|
1003
|
+
* @param {GridSidebarParams} params With all properties from [[GridSidebarParams]].
|
|
1004
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
1005
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
1006
|
+
*/
|
|
1007
|
+
onSidebarOpen: PropTypes.func,
|
|
992
1008
|
/**
|
|
993
1009
|
* Callback fired when the sort model changes before a column is sorted.
|
|
994
1010
|
* @param {GridSortModel} model With all properties from [[GridSortModel]].
|
|
@@ -1095,6 +1111,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1095
1111
|
/**
|
|
1096
1112
|
* If `true`, the pivot side panel is visible.
|
|
1097
1113
|
* @default false
|
|
1114
|
+
* @deprecated Use `initialState.sidebar.open` instead.
|
|
1098
1115
|
*/
|
|
1099
1116
|
pivotPanelOpen: PropTypes.bool,
|
|
1100
1117
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
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, dimensionsStateInitializer, 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, useGridDataSourceLazyLoader, useGridInfiniteLoadingIntersection, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { useGridInitialization, useGridInitializeState, useGridVirtualizer, 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, dimensionsStateInitializer, 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, useGridDataSourceLazyLoader, useGridInfiniteLoadingIntersection, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
6
6
|
import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
7
7
|
import { useGridDataSourcePremium as useGridDataSource } from "../hooks/features/dataSource/useGridDataSourcePremium.js";
|
|
8
8
|
// Premium-only features
|
|
@@ -17,6 +17,7 @@ import { useGridClipboardImport } from "../hooks/features/clipboard/useGridClipb
|
|
|
17
17
|
import { pivotingStateInitializer, useGridPivoting, useGridPivotingExportState } from "../hooks/features/pivoting/useGridPivoting.js";
|
|
18
18
|
import { gridPivotPropsOverridesSelector } from "../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
19
19
|
import { useGridAiAssistant, aiAssistantStateInitializer } from "../hooks/features/aiAssistant/useGridAiAssistant.js";
|
|
20
|
+
import { useGridSidebar, sidebarStateInitializer } from "../hooks/features/sidebar/useGridSidebar.js";
|
|
20
21
|
export const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
21
22
|
const pivotPropsOverrides = useGridSelector(apiRef, gridPivotPropsOverridesSelector);
|
|
22
23
|
const props = React.useMemo(() => {
|
|
@@ -66,6 +67,7 @@ export const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
|
66
67
|
useGridInitializeState(detailPanelStateInitializer, apiRef, props);
|
|
67
68
|
useGridInitializeState(columnPinningStateInitializer, apiRef, props, key);
|
|
68
69
|
useGridInitializeState(columnsStateInitializer, apiRef, props, key);
|
|
70
|
+
useGridInitializeState(sidebarStateInitializer, apiRef, props);
|
|
69
71
|
useGridInitializeState(pivotingStateInitializer, apiRef, props);
|
|
70
72
|
useGridInitializeState(rowPinningStateInitializer, apiRef, props);
|
|
71
73
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
@@ -87,6 +89,8 @@ export const useDataGridPremiumComponent = (apiRef, inProps) => {
|
|
|
87
89
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
88
90
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
89
91
|
useGridInitializeState(aiAssistantStateInitializer, apiRef, props);
|
|
92
|
+
useGridVirtualizer(apiRef, props);
|
|
93
|
+
useGridSidebar(apiRef, props);
|
|
90
94
|
useGridPivoting(apiRef, props, inProps.columns, inProps.rows);
|
|
91
95
|
useGridRowGrouping(apiRef, props);
|
|
92
96
|
useGridHeaderFiltering(apiRef, props);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { gridPivotPanelOpenSelector } from
|
|
3
|
+
import { gridPivotPanelOpenSelector } from "../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
4
4
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
5
5
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
6
|
+
import { GridSidebarValue } from "../hooks/features/sidebar/index.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export function GridColumnMenuPivotItem(props) {
|
|
8
9
|
const {
|
|
@@ -13,7 +14,7 @@ export function GridColumnMenuPivotItem(props) {
|
|
|
13
14
|
const isPivotPanelOpen = useGridSelector(apiRef, gridPivotPanelOpenSelector);
|
|
14
15
|
const openPivotSettings = event => {
|
|
15
16
|
onClick(event);
|
|
16
|
-
apiRef.current.
|
|
17
|
+
apiRef.current.showSidebar(GridSidebarValue.Pivot);
|
|
17
18
|
};
|
|
18
19
|
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
19
20
|
onClick: openPivotSettings,
|
|
@@ -34,7 +34,9 @@ function GridGroupingCriteriaCellIcon(props) {
|
|
|
34
34
|
// always fetch/get from cache the children when the node is expanded
|
|
35
35
|
apiRef.current.dataSource.fetchRows(id);
|
|
36
36
|
} else {
|
|
37
|
-
|
|
37
|
+
// Collapse the node and remove child rows from the grid
|
|
38
|
+
apiRef.current.setRowChildrenExpansion(id, false);
|
|
39
|
+
apiRef.current.removeChildrenRows(id);
|
|
38
40
|
}
|
|
39
41
|
apiRef.current.setCellFocus(id, field);
|
|
40
42
|
event.stopPropagation();
|
|
@@ -73,7 +73,7 @@ function GridPivotPanelHeader(props) {
|
|
|
73
73
|
})
|
|
74
74
|
}, rootProps.slotProps?.baseSwitch)), /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
75
75
|
onClick: () => {
|
|
76
|
-
apiRef.current.
|
|
76
|
+
apiRef.current.hideSidebar();
|
|
77
77
|
if (isEmptyPivot) {
|
|
78
78
|
apiRef.current.setPivotActive(false);
|
|
79
79
|
}
|
|
@@ -10,6 +10,7 @@ import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
|
10
10
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
11
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
12
|
import { gridPivotPanelOpenSelector, gridPivotActiveSelector } from "../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
13
|
+
import { GridSidebarValue } from "../../hooks/features/sidebar/index.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
/**
|
|
15
16
|
* A button that opens and closes the pivot panel.
|
|
@@ -42,7 +43,11 @@ const PivotPanelTrigger = forwardRef(function PivotPanelTrigger(props, ref) {
|
|
|
42
43
|
};
|
|
43
44
|
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
44
45
|
const handleClick = event => {
|
|
45
|
-
|
|
46
|
+
if (open) {
|
|
47
|
+
apiRef.current.hideSidebar();
|
|
48
|
+
} else {
|
|
49
|
+
apiRef.current.showSidebar(GridSidebarValue.Pivot, panelId, buttonId);
|
|
50
|
+
}
|
|
46
51
|
onClick?.(event);
|
|
47
52
|
};
|
|
48
53
|
const element = useComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
|
|
@@ -4,10 +4,12 @@ const _excluded = ["className", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { styled } from '@mui/system';
|
|
7
|
-
import { getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
7
|
+
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid-pro';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
10
|
import { ResizablePanel, ResizablePanelHandle } from "../resizablePanel/index.js";
|
|
10
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
|
+
import { gridSidebarContentSelector } from "../../hooks/features/sidebar/index.js";
|
|
11
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
14
|
const useUtilityClasses = ownerState => {
|
|
13
15
|
const {
|
|
@@ -31,17 +33,31 @@ const SidebarRoot = styled(ResizablePanel, {
|
|
|
31
33
|
});
|
|
32
34
|
function Sidebar(props) {
|
|
33
35
|
const {
|
|
34
|
-
className
|
|
35
|
-
children
|
|
36
|
+
className
|
|
36
37
|
} = props,
|
|
37
38
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
39
|
+
const apiRef = useGridApiContext();
|
|
38
40
|
const rootProps = useGridRootProps();
|
|
39
41
|
const classes = useUtilityClasses(rootProps);
|
|
42
|
+
const {
|
|
43
|
+
value,
|
|
44
|
+
sidebarId,
|
|
45
|
+
labelId
|
|
46
|
+
} = useGridSelector(apiRef, gridSidebarContentSelector);
|
|
47
|
+
if (!value) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const sidebarContent = apiRef.current.unstable_applyPipeProcessors('sidebar', null, value);
|
|
51
|
+
if (!sidebarContent) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
40
54
|
return /*#__PURE__*/_jsxs(SidebarRoot, _extends({
|
|
55
|
+
id: sidebarId,
|
|
41
56
|
className: clsx(className, classes.root),
|
|
42
|
-
ownerState: rootProps
|
|
57
|
+
ownerState: rootProps,
|
|
58
|
+
"aria-labelledby": labelId
|
|
43
59
|
}, other, {
|
|
44
|
-
children: [/*#__PURE__*/_jsx(ResizablePanelHandle, {}),
|
|
60
|
+
children: [/*#__PURE__*/_jsx(ResizablePanelHandle, {}), sidebarContent]
|
|
45
61
|
}));
|
|
46
62
|
}
|
|
47
63
|
export { Sidebar };
|
|
@@ -47,7 +47,7 @@ export interface GridAggregationFunction<V = any, AV = V> {
|
|
|
47
47
|
* @param {GridApiPremium} api The grid API.
|
|
48
48
|
* @returns {AV} The aggregated value.
|
|
49
49
|
*/
|
|
50
|
-
apply: (params: GridAggregationParams<V>, api
|
|
50
|
+
apply: (params: GridAggregationParams<V>, api?: GridApiPremium) => AV | null | undefined;
|
|
51
51
|
/**
|
|
52
52
|
* Label of the aggregation function.
|
|
53
53
|
* Used for adding a label to the footer of the grouping column when this aggregation function is the only one being used.
|