@mui/x-data-grid-premium 8.12.1 → 8.13.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 +121 -0
- package/DataGridPremium/DataGridPremium.js +16 -11
- package/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/esm/DataGridPremium/DataGridPremium.js +18 -13
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +9 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +1 -1
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.js +16 -18
- package/esm/hooks/features/rows/useGridParamsOverridableMethods.d.ts +7 -0
- package/esm/hooks/features/rows/useGridParamsOverridableMethods.js +24 -0
- package/esm/index.js +1 -1
- package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +9 -0
- package/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +1 -1
- package/hooks/features/chartsIntegration/useGridChartsIntegration.js +15 -17
- package/hooks/features/rows/useGridParamsOverridableMethods.d.ts +7 -0
- package/hooks/features/rows/useGridParamsOverridableMethods.js +32 -0
- package/index.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,127 @@
|
|
|
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.13.0
|
|
9
|
+
|
|
10
|
+
_Oct 1, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 The chart zoom now supports the `tapAndDrag` gesture. Zoom in/out by tapping twice and dragging vertically.
|
|
15
|
+
- 🔎 Charts now allow [fine-grained control for zoom interactions](https://mui.com/x/react-charts/zoom-and-pan/#zoom-interactions-configuration).
|
|
16
|
+
```jsx
|
|
17
|
+
<BarChartPro
|
|
18
|
+
zoomInteractionConfig={{
|
|
19
|
+
// Only zoom when Control key is pressed
|
|
20
|
+
zoom: [{ type: 'wheel', keys: ['Control'] }],
|
|
21
|
+
// Only pan when Shift key is pressed
|
|
22
|
+
pan: [{ type: 'drag', keys: ['Shift'] }],
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
- ➡️ Data Grid grouping rows now persist their expansion state when the rows are updated.
|
|
27
|
+
- 📜 Updated Data Grid vertical scrollbar to include pinned rows and aggregation sections.
|
|
28
|
+
- 📌 Improved the appearance of [pinned columns](https://mui.com/x/react-data-grid/column-pinning/#pinned-columns-appearance) and [pinned rows](https://mui.com/x/react-data-grid/row-pinning/#pinned-rows-appearance) sections in the Data Grid.
|
|
29
|
+
- 🚀 Tree View now fetches the children of expanded items on mount when using lazy loading.
|
|
30
|
+
- 🐞 Bugfixes
|
|
31
|
+
- 📚 Documentation improvements
|
|
32
|
+
|
|
33
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
34
|
+
@sai6855
|
|
35
|
+
|
|
36
|
+
The following are all team members who have contributed to this release:
|
|
37
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @hasdfa, @Janpot, @JCQuintas, @KenanYusuf, @mapache-salvaje, @MBilalShafi, @mnajdova, @rita-codes, @siriwatknp
|
|
38
|
+
|
|
39
|
+
### Data Grid
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid@8.13.0`
|
|
42
|
+
|
|
43
|
+
- [DataGrid] Add scroll shadows and fix scrollbar overlap (#16476) @KenanYusuf
|
|
44
|
+
- [DataGrid] Fix row spanning stale state issue (#19733) @MBilalShafi
|
|
45
|
+
- [DataGrid] Fix toolbar `slotProps` not being applied (#19769) @sai6855
|
|
46
|
+
- [DataGrid] Skip calling `fetchRows()` when strategy is not initialized (#19728) @MBilalShafi
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-data-grid-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-data-grid@8.13.0`, plus:
|
|
51
|
+
|
|
52
|
+
- [DataGridPro] Retain expansion state on rows update (#19697) @MBilalShafi
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-data-grid-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-data-grid-pro@8.13.0`, plus:
|
|
57
|
+
|
|
58
|
+
- [DataGridPremium] Add `metadata.referenceId` to AI assistant prompt resolver (#19695) @hasdfa
|
|
59
|
+
- [DataGridPremium] Fix aggregation value retrieval (#19724) @arminmeh
|
|
60
|
+
- [DataGridPremium] Get correct active chart id while rebuilding data (#19720) @arminmeh
|
|
61
|
+
|
|
62
|
+
### Date and Time Pickers
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
65
|
+
|
|
66
|
+
Internal changes.
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
71
|
+
|
|
72
|
+
### Charts
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-charts@8.13.0`
|
|
75
|
+
|
|
76
|
+
- [charts] Add `tapAndDrag` zoom gesture (#19727) @JCQuintas
|
|
77
|
+
- [charts] Add arc focus indicator that follows the arc form (#19696) @mnajdova
|
|
78
|
+
- [charts] Fix outline color (#19752) @alexfauquette
|
|
79
|
+
- [charts] Improve tooltip doc (#19731) @JCQuintas
|
|
80
|
+
- [charts] Make axis highlight reflect the keyboard interaction (#19631) @alexfauquette
|
|
81
|
+
- [charts] Prevent horizontal scroll on keyboard navigation (#19704) @alexfauquette
|
|
82
|
+
- [charts] Simplify gestures by removing bindings (#19767) @JCQuintas
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-charts-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
85
|
+
|
|
86
|
+
Same changes as in `@mui/x-charts@8.13.0`, plus:
|
|
87
|
+
|
|
88
|
+
- [charts-pro] Allow zoom interactions to be configured (#18646) @JCQuintas
|
|
89
|
+
- [charts-pro] Fix zoom preview having wrong domain in some cases (#19723) @bernardobelchior
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-charts-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-charts-pro@8.13.0`.
|
|
94
|
+
|
|
95
|
+
### Tree View
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view@8.13.0`
|
|
98
|
+
|
|
99
|
+
- [tree view] Export the `apiRef` type of each Tree View component (#19543) @flaviendelangle
|
|
100
|
+
- [tree view] Fix indeterminate checkbox state (#19544) @flaviendelangle
|
|
101
|
+
- [tree view] Improve the lazy loading initial expansion (#19284) @flaviendelangle
|
|
102
|
+
- [tree view] Use Base UI utils whenever possible (#19502) @flaviendelangle
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-tree-view-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-tree-view@8.13.0`.
|
|
107
|
+
|
|
108
|
+
### Codemod
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-codemod@8.12.0`
|
|
111
|
+
|
|
112
|
+
Internal changes.
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
|
|
116
|
+
- [docs] Add a recipe to customize editing component with Autocomplete (#19651) @siriwatknp
|
|
117
|
+
- [docs] Refine the electricity scatter tooltip (#19689) @alexfauquette
|
|
118
|
+
- [docs] Revise the Axis doc (#19052) @mapache-salvaje
|
|
119
|
+
- [docs] Remove reference to nonexistent `FocusedMark` API page (#19773) @bernardobelchior
|
|
120
|
+
|
|
121
|
+
### Core
|
|
122
|
+
|
|
123
|
+
- [code-infra] Change charts codspeed integration to use walltime (#19729) @JCQuintas
|
|
124
|
+
- [code-infra] Port stylelint from core repo (#19633) @Janpot
|
|
125
|
+
- [code-infra] Stabilize fake timers in regression tests (#19719) @Janpot
|
|
126
|
+
- [code-infra] Stabilize size for bundles with `releaseInfo` (#19674) @Janpot
|
|
127
|
+
- [code-infra] Fix `pnpm-lock.yaml` broken lockfile (#19755) @bernardobelchior
|
|
128
|
+
|
|
8
129
|
## 8.12.1
|
|
9
130
|
|
|
10
131
|
_Sep 25, 2025_
|
|
@@ -23,6 +23,7 @@ var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAt
|
|
|
23
23
|
var _gridAggregationSelectors = require("../hooks/features/aggregation/gridAggregationSelectors");
|
|
24
24
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
25
25
|
var _useGridRowsOverridableMethods = require("../hooks/features/rows/useGridRowsOverridableMethods");
|
|
26
|
+
var _useGridParamsOverridableMethods = require("../hooks/features/rows/useGridParamsOverridableMethods");
|
|
26
27
|
var _sidebar2 = require("../hooks/features/sidebar");
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
29
|
const configuration = {
|
|
@@ -37,23 +38,17 @@ const configuration = {
|
|
|
37
38
|
field
|
|
38
39
|
});
|
|
39
40
|
},
|
|
40
|
-
useSortValueGetter: apiRef => (id, field) => (0, _gridAggregationSelectors.gridCellAggregationResultSelector)(apiRef, {
|
|
41
|
-
id,
|
|
42
|
-
field
|
|
43
|
-
})?.value ?? apiRef.current.getCellValue(id, field),
|
|
44
41
|
useFilterValueGetter: (apiRef, props) => (row, column) => {
|
|
45
|
-
if (props.aggregationRowsScope === '
|
|
42
|
+
if (props.aggregationRowsScope === 'all') {
|
|
46
43
|
return apiRef.current.getRowValue(row, column);
|
|
47
44
|
}
|
|
48
|
-
return (0,
|
|
49
|
-
id: (0, _xDataGridPro.gridRowIdSelector)(apiRef, row),
|
|
50
|
-
field: column.field
|
|
51
|
-
})?.value ?? apiRef.current.getRowValue(row, column);
|
|
45
|
+
return (0, _internals.getRowValue)(row, column, apiRef);
|
|
52
46
|
},
|
|
53
|
-
useGridRowsOverridableMethods: _useGridRowsOverridableMethods.useGridRowsOverridableMethods
|
|
47
|
+
useGridRowsOverridableMethods: _useGridRowsOverridableMethods.useGridRowsOverridableMethods,
|
|
48
|
+
useGridParamsOverridableMethods: _useGridParamsOverridableMethods.useGridParamsOverridableMethods
|
|
54
49
|
}
|
|
55
50
|
};
|
|
56
|
-
const releaseInfo = "
|
|
51
|
+
const releaseInfo = "MTc1OTI3NjgwMDAwMA==";
|
|
57
52
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
58
53
|
packageName: "x-data-grid-premium",
|
|
59
54
|
releaseInfo: releaseInfo
|
|
@@ -1099,6 +1094,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1099
1094
|
* The column fields to display pinned to left or right.
|
|
1100
1095
|
*/
|
|
1101
1096
|
pinnedColumns: _propTypes.default.object,
|
|
1097
|
+
/**
|
|
1098
|
+
* Sets the type of separator between pinned columns and non-pinned columns.
|
|
1099
|
+
* @default 'border-and-shadow'
|
|
1100
|
+
*/
|
|
1101
|
+
pinnedColumnsSectionSeparator: _propTypes.default.oneOf(['border-and-shadow', 'border', 'shadow']),
|
|
1102
1102
|
/**
|
|
1103
1103
|
* Rows data to pin on top or bottom.
|
|
1104
1104
|
*/
|
|
@@ -1106,6 +1106,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1106
1106
|
bottom: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
1107
1107
|
top: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
1108
1108
|
}),
|
|
1109
|
+
/**
|
|
1110
|
+
* Sets the type of separator between pinned rows and non-pinned rows.
|
|
1111
|
+
* @default 'border-and-shadow'
|
|
1112
|
+
*/
|
|
1113
|
+
pinnedRowsSectionSeparator: _propTypes.default.oneOf(['border-and-shadow', 'border']),
|
|
1109
1114
|
/**
|
|
1110
1115
|
* If `true`, the data grid will show data in pivot mode using the `pivotModel`.
|
|
1111
1116
|
* @default false
|
|
@@ -115,7 +115,7 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
115
115
|
(0, _internals.useGridColumns)(apiRef, props);
|
|
116
116
|
(0, _internals.useGridRows)(apiRef, props, configuration);
|
|
117
117
|
(0, _internals.useGridRowSpanning)(apiRef, props);
|
|
118
|
-
(0, _internals.useGridParamsApi)(apiRef, props);
|
|
118
|
+
(0, _internals.useGridParamsApi)(apiRef, props, configuration);
|
|
119
119
|
(0, _internals.useGridDetailPanel)(apiRef, props);
|
|
120
120
|
(0, _internals.useGridColumnSpanning)(apiRef);
|
|
121
121
|
(0, _internals.useGridColumnGrouping)(apiRef, props);
|
|
@@ -124,7 +124,7 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
124
124
|
(0, _internals.useGridFocus)(apiRef, props);
|
|
125
125
|
(0, _internals.useGridPreferencesPanel)(apiRef, props);
|
|
126
126
|
(0, _internals.useGridFilter)(apiRef, props, configuration);
|
|
127
|
-
(0, _internals.useGridSorting)(apiRef, props
|
|
127
|
+
(0, _internals.useGridSorting)(apiRef, props);
|
|
128
128
|
(0, _internals.useGridDensity)(apiRef, props);
|
|
129
129
|
(0, _internals.useGridColumnReorder)(apiRef, props);
|
|
130
130
|
(0, _internals.useGridColumnResize)(apiRef, props);
|
|
@@ -4,8 +4,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
|
-
import { GridRoot, GridContextProvider, useGridSelector
|
|
8
|
-
import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps, useGridApiInitialization } from '@mui/x-data-grid-pro/internals';
|
|
7
|
+
import { GridRoot, GridContextProvider, useGridSelector } from '@mui/x-data-grid-pro';
|
|
8
|
+
import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps, useGridApiInitialization, getRowValue } from '@mui/x-data-grid-pro/internals';
|
|
9
9
|
import { useMaterialCSSVariables } from '@mui/x-data-grid/material';
|
|
10
10
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
11
11
|
import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
|
|
@@ -16,6 +16,7 @@ import { useGridRowAriaAttributesPremium } from "../hooks/features/rows/useGridR
|
|
|
16
16
|
import { gridCellAggregationResultSelector } from "../hooks/features/aggregation/gridAggregationSelectors.js";
|
|
17
17
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
18
18
|
import { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
|
|
19
|
+
import { useGridParamsOverridableMethods } from "../hooks/features/rows/useGridParamsOverridableMethods.js";
|
|
19
20
|
import { gridSidebarOpenSelector } from "../hooks/features/sidebar/index.js";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const configuration = {
|
|
@@ -30,23 +31,17 @@ const configuration = {
|
|
|
30
31
|
field
|
|
31
32
|
});
|
|
32
33
|
},
|
|
33
|
-
useSortValueGetter: apiRef => (id, field) => gridCellAggregationResultSelector(apiRef, {
|
|
34
|
-
id,
|
|
35
|
-
field
|
|
36
|
-
})?.value ?? apiRef.current.getCellValue(id, field),
|
|
37
34
|
useFilterValueGetter: (apiRef, props) => (row, column) => {
|
|
38
|
-
if (props.aggregationRowsScope === '
|
|
35
|
+
if (props.aggregationRowsScope === 'all') {
|
|
39
36
|
return apiRef.current.getRowValue(row, column);
|
|
40
37
|
}
|
|
41
|
-
return
|
|
42
|
-
id: gridRowIdSelector(apiRef, row),
|
|
43
|
-
field: column.field
|
|
44
|
-
})?.value ?? apiRef.current.getRowValue(row, column);
|
|
38
|
+
return getRowValue(row, column, apiRef);
|
|
45
39
|
},
|
|
46
|
-
useGridRowsOverridableMethods
|
|
40
|
+
useGridRowsOverridableMethods,
|
|
41
|
+
useGridParamsOverridableMethods
|
|
47
42
|
}
|
|
48
43
|
};
|
|
49
|
-
const releaseInfo = "
|
|
44
|
+
const releaseInfo = "MTc1OTI3NjgwMDAwMA==";
|
|
50
45
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
51
46
|
packageName: "x-data-grid-premium",
|
|
52
47
|
releaseInfo: releaseInfo
|
|
@@ -1092,6 +1087,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1092
1087
|
* The column fields to display pinned to left or right.
|
|
1093
1088
|
*/
|
|
1094
1089
|
pinnedColumns: PropTypes.object,
|
|
1090
|
+
/**
|
|
1091
|
+
* Sets the type of separator between pinned columns and non-pinned columns.
|
|
1092
|
+
* @default 'border-and-shadow'
|
|
1093
|
+
*/
|
|
1094
|
+
pinnedColumnsSectionSeparator: PropTypes.oneOf(['border-and-shadow', 'border', 'shadow']),
|
|
1095
1095
|
/**
|
|
1096
1096
|
* Rows data to pin on top or bottom.
|
|
1097
1097
|
*/
|
|
@@ -1099,6 +1099,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1099
1099
|
bottom: PropTypes.arrayOf(PropTypes.object),
|
|
1100
1100
|
top: PropTypes.arrayOf(PropTypes.object)
|
|
1101
1101
|
}),
|
|
1102
|
+
/**
|
|
1103
|
+
* Sets the type of separator between pinned rows and non-pinned rows.
|
|
1104
|
+
* @default 'border-and-shadow'
|
|
1105
|
+
*/
|
|
1106
|
+
pinnedRowsSectionSeparator: PropTypes.oneOf(['border-and-shadow', 'border']),
|
|
1102
1107
|
/**
|
|
1103
1108
|
* If `true`, the data grid will show data in pivot mode using the `pivotModel`.
|
|
1104
1109
|
* @default false
|
|
@@ -107,7 +107,7 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
107
107
|
useGridColumns(apiRef, props);
|
|
108
108
|
useGridRows(apiRef, props, configuration);
|
|
109
109
|
useGridRowSpanning(apiRef, props);
|
|
110
|
-
useGridParamsApi(apiRef, props);
|
|
110
|
+
useGridParamsApi(apiRef, props, configuration);
|
|
111
111
|
useGridDetailPanel(apiRef, props);
|
|
112
112
|
useGridColumnSpanning(apiRef);
|
|
113
113
|
useGridColumnGrouping(apiRef, props);
|
|
@@ -116,7 +116,7 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
116
116
|
useGridFocus(apiRef, props);
|
|
117
117
|
useGridPreferencesPanel(apiRef, props);
|
|
118
118
|
useGridFilter(apiRef, props, configuration);
|
|
119
|
-
useGridSorting(apiRef, props
|
|
119
|
+
useGridSorting(apiRef, props);
|
|
120
120
|
useGridDensity(apiRef, props);
|
|
121
121
|
useGridColumnReorder(apiRef, props);
|
|
122
122
|
useGridColumnResize(apiRef, props);
|
|
@@ -59,6 +59,15 @@ export type PromptResolverOptions = {
|
|
|
59
59
|
* Additional context to make the processing results more accurate.
|
|
60
60
|
*/
|
|
61
61
|
additionalContext?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Additional metadata to track the usage for each unique user.
|
|
64
|
+
*/
|
|
65
|
+
metadata?: {
|
|
66
|
+
/**
|
|
67
|
+
* The reference ID that would be stored for you to identify the entity that made the request and then to be able to track the usage for each unique user/entity.
|
|
68
|
+
*/
|
|
69
|
+
referenceId?: string;
|
|
70
|
+
};
|
|
62
71
|
};
|
|
63
72
|
/**
|
|
64
73
|
* The prompt API interface that is available in the grid [[apiRef]].
|
|
@@ -3,6 +3,6 @@ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
|
3
3
|
import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
4
|
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
5
5
|
import { ChartState } from "../../../models/gridChartsIntegration.js";
|
|
6
|
-
export declare const chartsIntegrationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'chartsIntegration' | 'initialState' | 'activeChartId' | 'rowGroupingModel' | 'pivotModel' | 'experimentalFeatures'>, GridPrivateApiPremium>;
|
|
7
6
|
export declare const EMPTY_CHART_INTEGRATION_CONTEXT_STATE: ChartState;
|
|
7
|
+
export declare const chartsIntegrationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'chartsIntegration' | 'initialState' | 'activeChartId' | 'rowGroupingModel' | 'pivotModel' | 'experimentalFeatures'>, GridPrivateApiPremium>;
|
|
8
8
|
export declare const useGridChartsIntegration: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "chartsIntegration" | "activeChartId" | "onActiveChartIdChange" | "initialState" | "slots" | "slotProps" | "aggregationFunctions" | "dataSource" | "experimentalFeatures">) => void;
|
|
@@ -12,9 +12,20 @@ import { isBlockedForSection } from "./utils.js";
|
|
|
12
12
|
import { gridRowGroupingSanitizedModelSelector } from "../rowGrouping/gridRowGroupingSelector.js";
|
|
13
13
|
import { GridSidebarValue } from "../sidebar/index.js";
|
|
14
14
|
import { getAggregationFunctionLabel, getAvailableAggregationFunctions } from "../aggregation/gridAggregationUtils.js";
|
|
15
|
-
import { gridAggregationModelSelector
|
|
15
|
+
import { gridAggregationModelSelector } from "../aggregation/gridAggregationSelectors.js";
|
|
16
16
|
import { gridPivotModelSelector } from "../pivoting/gridPivotingSelectors.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
const EMPTY_CHART_INTEGRATION_CONTEXT = {
|
|
19
|
+
chartStateLookup: {},
|
|
20
|
+
setChartState: () => {}
|
|
21
|
+
};
|
|
22
|
+
export const EMPTY_CHART_INTEGRATION_CONTEXT_STATE = {
|
|
23
|
+
synced: true,
|
|
24
|
+
dimensions: [],
|
|
25
|
+
values: [],
|
|
26
|
+
type: '',
|
|
27
|
+
configuration: {}
|
|
28
|
+
};
|
|
18
29
|
export const chartsIntegrationStateInitializer = (state, props) => {
|
|
19
30
|
if (!props.chartsIntegration || !props.experimentalFeatures?.charts) {
|
|
20
31
|
return _extends({}, state, {
|
|
@@ -44,17 +55,6 @@ export const chartsIntegrationStateInitializer = (state, props) => {
|
|
|
44
55
|
}
|
|
45
56
|
});
|
|
46
57
|
};
|
|
47
|
-
const EMPTY_CHART_INTEGRATION_CONTEXT = {
|
|
48
|
-
chartStateLookup: {},
|
|
49
|
-
setChartState: () => {}
|
|
50
|
-
};
|
|
51
|
-
export const EMPTY_CHART_INTEGRATION_CONTEXT_STATE = {
|
|
52
|
-
synced: true,
|
|
53
|
-
dimensions: [],
|
|
54
|
-
values: [],
|
|
55
|
-
type: '',
|
|
56
|
-
configuration: {}
|
|
57
|
-
};
|
|
58
58
|
export const useGridChartsIntegration = (apiRef, props) => {
|
|
59
59
|
const visibleDimensions = React.useRef({});
|
|
60
60
|
const visibleValues = React.useRef({});
|
|
@@ -173,7 +173,8 @@ export const useGridChartsIntegration = (apiRef, props) => {
|
|
|
173
173
|
const rowGroupingModel = gridRowGroupingSanitizedModelSelector(apiRef);
|
|
174
174
|
const rowTree = gridRowTreeSelector(apiRef);
|
|
175
175
|
const rowsPerDepth = gridFilteredSortedDepthRowEntriesSelector(apiRef);
|
|
176
|
-
const
|
|
176
|
+
const currentChartId = gridChartsIntegrationActiveChartIdSelector(apiRef);
|
|
177
|
+
const defaultDepth = Math.max(0, (visibleDimensions.current[currentChartId]?.length ?? 0) - 1);
|
|
177
178
|
const rowsAtDefaultDepth = (rowsPerDepth[defaultDepth] ?? []).length;
|
|
178
179
|
|
|
179
180
|
// keep only unique columns and transform the grouped column to carry the correct field name to get the grouped value
|
|
@@ -205,10 +206,7 @@ export const useGridChartsIntegration = (apiRef, props) => {
|
|
|
205
206
|
const rowId = gridRowIdSelector(apiRef, targetRow);
|
|
206
207
|
targetRow = gridRowNodeSelector(apiRef, rowTree[rowId].parent);
|
|
207
208
|
}
|
|
208
|
-
const value =
|
|
209
|
-
id: gridRowIdSelector(apiRef, targetRow),
|
|
210
|
-
field: dataColumns[j].field
|
|
211
|
-
})?.value ?? apiRef.current.getRowValue(targetRow, dataColumns[j]);
|
|
209
|
+
const value = apiRef.current.getRowValue(targetRow, dataColumns[j]);
|
|
212
210
|
if (value !== null) {
|
|
213
211
|
data[dataColumns[j].dataFieldName].push(typeof value === 'object' && 'label' in value ? value.label : value);
|
|
214
212
|
}
|
|
@@ -228,7 +226,7 @@ export const useGridChartsIntegration = (apiRef, props) => {
|
|
|
228
226
|
}))
|
|
229
227
|
});
|
|
230
228
|
});
|
|
231
|
-
}, [apiRef,
|
|
229
|
+
}, [apiRef, orderedFields, getColumnName, getValueDatasetLabel, setChartState]);
|
|
232
230
|
const debouncedHandleRowDataUpdate = React.useMemo(() => debounce(handleRowDataUpdate, 0), [handleRowDataUpdate]);
|
|
233
231
|
const handleColumnDataUpdate = React.useCallback((chartIds, updatedChartStateLookup) => {
|
|
234
232
|
// if there are no charts, skip the data processing
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
+
export declare const useGridParamsOverridableMethods: (apiRef: RefObject<GridPrivateApiPremium>) => {
|
|
4
|
+
getCellValue: <V = any>(id: import("@mui/x-data-grid").GridRowId, field: string) => V;
|
|
5
|
+
getRowValue: <V = any>(row: import("@mui/x-data-grid").GridRowModel, colDef: import("@mui/x-data-grid").GridColDef) => V;
|
|
6
|
+
getRowFormattedValue: <V = any>(row: import("@mui/x-data-grid").GridRowModel, colDef: import("@mui/x-data-grid").GridColDef) => V;
|
|
7
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { gridRowIdSelector } from '@mui/x-data-grid-pro';
|
|
3
|
+
import { useGridParamsOverridableMethods as useGridParamsOverridableMethodsCommunity } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { gridCellAggregationResultSelector } from "../aggregation/gridAggregationSelectors.js";
|
|
5
|
+
export const useGridParamsOverridableMethods = apiRef => {
|
|
6
|
+
const communityMethods = useGridParamsOverridableMethodsCommunity(apiRef);
|
|
7
|
+
const getCellValue = React.useCallback((id, field) => gridCellAggregationResultSelector(apiRef, {
|
|
8
|
+
id,
|
|
9
|
+
field
|
|
10
|
+
})?.value ?? communityMethods.getCellValue(id, field), [apiRef, communityMethods]);
|
|
11
|
+
const getRowValue = React.useCallback((row, colDef) => gridCellAggregationResultSelector(apiRef, {
|
|
12
|
+
id: gridRowIdSelector(apiRef, row),
|
|
13
|
+
field: colDef.field
|
|
14
|
+
})?.value ?? communityMethods.getRowValue(row, colDef), [apiRef, communityMethods]);
|
|
15
|
+
const getRowFormattedValue = React.useCallback((row, colDef) => gridCellAggregationResultSelector(apiRef, {
|
|
16
|
+
id: gridRowIdSelector(apiRef, row),
|
|
17
|
+
field: colDef.field
|
|
18
|
+
})?.formattedValue ?? communityMethods.getRowFormattedValue(row, colDef), [apiRef, communityMethods]);
|
|
19
|
+
return {
|
|
20
|
+
getCellValue,
|
|
21
|
+
getRowValue,
|
|
22
|
+
getRowFormattedValue
|
|
23
|
+
};
|
|
24
|
+
};
|
package/esm/index.js
CHANGED
|
@@ -59,6 +59,15 @@ export type PromptResolverOptions = {
|
|
|
59
59
|
* Additional context to make the processing results more accurate.
|
|
60
60
|
*/
|
|
61
61
|
additionalContext?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Additional metadata to track the usage for each unique user.
|
|
64
|
+
*/
|
|
65
|
+
metadata?: {
|
|
66
|
+
/**
|
|
67
|
+
* The reference ID that would be stored for you to identify the entity that made the request and then to be able to track the usage for each unique user/entity.
|
|
68
|
+
*/
|
|
69
|
+
referenceId?: string;
|
|
70
|
+
};
|
|
62
71
|
};
|
|
63
72
|
/**
|
|
64
73
|
* The prompt API interface that is available in the grid [[apiRef]].
|
|
@@ -3,6 +3,6 @@ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
|
3
3
|
import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
4
|
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
5
5
|
import { ChartState } from "../../../models/gridChartsIntegration.js";
|
|
6
|
-
export declare const chartsIntegrationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'chartsIntegration' | 'initialState' | 'activeChartId' | 'rowGroupingModel' | 'pivotModel' | 'experimentalFeatures'>, GridPrivateApiPremium>;
|
|
7
6
|
export declare const EMPTY_CHART_INTEGRATION_CONTEXT_STATE: ChartState;
|
|
7
|
+
export declare const chartsIntegrationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'chartsIntegration' | 'initialState' | 'activeChartId' | 'rowGroupingModel' | 'pivotModel' | 'experimentalFeatures'>, GridPrivateApiPremium>;
|
|
8
8
|
export declare const useGridChartsIntegration: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "chartsIntegration" | "activeChartId" | "onActiveChartIdChange" | "initialState" | "slots" | "slotProps" | "aggregationFunctions" | "dataSource" | "experimentalFeatures">) => void;
|
|
@@ -22,6 +22,17 @@ var _gridAggregationUtils = require("../aggregation/gridAggregationUtils");
|
|
|
22
22
|
var _gridAggregationSelectors = require("../aggregation/gridAggregationSelectors");
|
|
23
23
|
var _gridPivotingSelectors = require("../pivoting/gridPivotingSelectors");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
const EMPTY_CHART_INTEGRATION_CONTEXT = {
|
|
26
|
+
chartStateLookup: {},
|
|
27
|
+
setChartState: () => {}
|
|
28
|
+
};
|
|
29
|
+
const EMPTY_CHART_INTEGRATION_CONTEXT_STATE = exports.EMPTY_CHART_INTEGRATION_CONTEXT_STATE = {
|
|
30
|
+
synced: true,
|
|
31
|
+
dimensions: [],
|
|
32
|
+
values: [],
|
|
33
|
+
type: '',
|
|
34
|
+
configuration: {}
|
|
35
|
+
};
|
|
25
36
|
const chartsIntegrationStateInitializer = (state, props) => {
|
|
26
37
|
if (!props.chartsIntegration || !props.experimentalFeatures?.charts) {
|
|
27
38
|
return (0, _extends2.default)({}, state, {
|
|
@@ -52,17 +63,6 @@ const chartsIntegrationStateInitializer = (state, props) => {
|
|
|
52
63
|
});
|
|
53
64
|
};
|
|
54
65
|
exports.chartsIntegrationStateInitializer = chartsIntegrationStateInitializer;
|
|
55
|
-
const EMPTY_CHART_INTEGRATION_CONTEXT = {
|
|
56
|
-
chartStateLookup: {},
|
|
57
|
-
setChartState: () => {}
|
|
58
|
-
};
|
|
59
|
-
const EMPTY_CHART_INTEGRATION_CONTEXT_STATE = exports.EMPTY_CHART_INTEGRATION_CONTEXT_STATE = {
|
|
60
|
-
synced: true,
|
|
61
|
-
dimensions: [],
|
|
62
|
-
values: [],
|
|
63
|
-
type: '',
|
|
64
|
-
configuration: {}
|
|
65
|
-
};
|
|
66
66
|
const useGridChartsIntegration = (apiRef, props) => {
|
|
67
67
|
const visibleDimensions = React.useRef({});
|
|
68
68
|
const visibleValues = React.useRef({});
|
|
@@ -181,7 +181,8 @@ const useGridChartsIntegration = (apiRef, props) => {
|
|
|
181
181
|
const rowGroupingModel = (0, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector)(apiRef);
|
|
182
182
|
const rowTree = (0, _xDataGridPro.gridRowTreeSelector)(apiRef);
|
|
183
183
|
const rowsPerDepth = (0, _internals.gridFilteredSortedDepthRowEntriesSelector)(apiRef);
|
|
184
|
-
const
|
|
184
|
+
const currentChartId = (0, _gridChartsIntegrationSelectors.gridChartsIntegrationActiveChartIdSelector)(apiRef);
|
|
185
|
+
const defaultDepth = Math.max(0, (visibleDimensions.current[currentChartId]?.length ?? 0) - 1);
|
|
185
186
|
const rowsAtDefaultDepth = (rowsPerDepth[defaultDepth] ?? []).length;
|
|
186
187
|
|
|
187
188
|
// keep only unique columns and transform the grouped column to carry the correct field name to get the grouped value
|
|
@@ -213,10 +214,7 @@ const useGridChartsIntegration = (apiRef, props) => {
|
|
|
213
214
|
const rowId = (0, _xDataGridPro.gridRowIdSelector)(apiRef, targetRow);
|
|
214
215
|
targetRow = (0, _xDataGridPro.gridRowNodeSelector)(apiRef, rowTree[rowId].parent);
|
|
215
216
|
}
|
|
216
|
-
const value = (
|
|
217
|
-
id: (0, _xDataGridPro.gridRowIdSelector)(apiRef, targetRow),
|
|
218
|
-
field: dataColumns[j].field
|
|
219
|
-
})?.value ?? apiRef.current.getRowValue(targetRow, dataColumns[j]);
|
|
217
|
+
const value = apiRef.current.getRowValue(targetRow, dataColumns[j]);
|
|
220
218
|
if (value !== null) {
|
|
221
219
|
data[dataColumns[j].dataFieldName].push(typeof value === 'object' && 'label' in value ? value.label : value);
|
|
222
220
|
}
|
|
@@ -236,7 +234,7 @@ const useGridChartsIntegration = (apiRef, props) => {
|
|
|
236
234
|
}))
|
|
237
235
|
});
|
|
238
236
|
});
|
|
239
|
-
}, [apiRef,
|
|
237
|
+
}, [apiRef, orderedFields, getColumnName, getValueDatasetLabel, setChartState]);
|
|
240
238
|
const debouncedHandleRowDataUpdate = React.useMemo(() => (0, _debounce.default)(handleRowDataUpdate, 0), [handleRowDataUpdate]);
|
|
241
239
|
const handleColumnDataUpdate = React.useCallback((chartIds, updatedChartStateLookup) => {
|
|
242
240
|
// if there are no charts, skip the data processing
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
+
export declare const useGridParamsOverridableMethods: (apiRef: RefObject<GridPrivateApiPremium>) => {
|
|
4
|
+
getCellValue: <V = any>(id: import("@mui/x-data-grid").GridRowId, field: string) => V;
|
|
5
|
+
getRowValue: <V = any>(row: import("@mui/x-data-grid").GridRowModel, colDef: import("@mui/x-data-grid").GridColDef) => V;
|
|
6
|
+
getRowFormattedValue: <V = any>(row: import("@mui/x-data-grid").GridRowModel, colDef: import("@mui/x-data-grid").GridColDef) => V;
|
|
7
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridParamsOverridableMethods = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
10
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
11
|
+
var _gridAggregationSelectors = require("../aggregation/gridAggregationSelectors");
|
|
12
|
+
const useGridParamsOverridableMethods = apiRef => {
|
|
13
|
+
const communityMethods = (0, _internals.useGridParamsOverridableMethods)(apiRef);
|
|
14
|
+
const getCellValue = React.useCallback((id, field) => (0, _gridAggregationSelectors.gridCellAggregationResultSelector)(apiRef, {
|
|
15
|
+
id,
|
|
16
|
+
field
|
|
17
|
+
})?.value ?? communityMethods.getCellValue(id, field), [apiRef, communityMethods]);
|
|
18
|
+
const getRowValue = React.useCallback((row, colDef) => (0, _gridAggregationSelectors.gridCellAggregationResultSelector)(apiRef, {
|
|
19
|
+
id: (0, _xDataGridPro.gridRowIdSelector)(apiRef, row),
|
|
20
|
+
field: colDef.field
|
|
21
|
+
})?.value ?? communityMethods.getRowValue(row, colDef), [apiRef, communityMethods]);
|
|
22
|
+
const getRowFormattedValue = React.useCallback((row, colDef) => (0, _gridAggregationSelectors.gridCellAggregationResultSelector)(apiRef, {
|
|
23
|
+
id: (0, _xDataGridPro.gridRowIdSelector)(apiRef, row),
|
|
24
|
+
field: colDef.field
|
|
25
|
+
})?.formattedValue ?? communityMethods.getRowFormattedValue(row, colDef), [apiRef, communityMethods]);
|
|
26
|
+
return {
|
|
27
|
+
getCellValue,
|
|
28
|
+
getRowValue,
|
|
29
|
+
getRowFormattedValue
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.useGridParamsOverridableMethods = useGridParamsOverridableMethods;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Premium plan edition of the MUI X Data Grid Components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"directory": "packages/x-data-grid-premium"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "^7.28.
|
|
36
|
+
"@babel/runtime": "^7.28.4",
|
|
37
37
|
"@mui/utils": "^7.3.2",
|
|
38
38
|
"@types/format-util": "^1.0.4",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
|
-
"@mui/x-data-grid
|
|
42
|
+
"@mui/x-data-grid": "8.13.0",
|
|
43
43
|
"@mui/x-internals": "8.12.0",
|
|
44
44
|
"@mui/x-license": "8.12.0",
|
|
45
|
-
"@mui/x-data-grid": "8.
|
|
45
|
+
"@mui/x-data-grid-pro": "8.13.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|