@mui/x-data-grid-premium 8.14.1 → 8.16.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 +207 -0
- package/DataGridPremium/DataGridPremium.js +4 -1
- package/DataGridPremium/useDataGridPremiumComponent.js +1 -1
- package/components/prompt/GridPrompt.js +11 -1
- package/esm/DataGridPremium/DataGridPremium.js +4 -1
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +1 -1
- package/esm/components/prompt/GridPrompt.js +11 -1
- package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +5 -0
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.d.ts +1 -1
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.js +79 -12
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +6 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +1 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +1 -1
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.js +76 -13
- package/esm/hooks/features/dataSource/models.d.ts +4 -2
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +31 -8
- package/esm/hooks/features/dataSource/utils.d.ts +3 -2
- package/esm/hooks/features/dataSource/utils.js +13 -1
- package/esm/hooks/features/editing/useGridCellEditable.d.ts +8 -0
- package/esm/hooks/features/editing/useGridCellEditable.js +35 -0
- package/esm/hooks/features/export/gridExcelExportInterface.d.ts +1 -1
- package/esm/hooks/features/export/serializer/excelSerializer.d.ts +1 -1
- package/esm/hooks/features/export/serializer/utils.d.ts +1 -1
- package/esm/hooks/features/export/serializer/utils.js +1 -1
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +3 -3
- package/esm/index.js +1 -1
- package/esm/material/index.d.ts +1 -0
- package/esm/material/index.js +1 -0
- package/esm/models/gridPremiumIconSlotsComponent.d.ts +5 -0
- package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +5 -0
- package/hooks/features/aiAssistant/useGridAiAssistant.d.ts +1 -1
- package/hooks/features/aiAssistant/useGridAiAssistant.js +78 -11
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +6 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +2 -1
- package/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +1 -1
- package/hooks/features/chartsIntegration/useGridChartsIntegration.js +75 -12
- package/hooks/features/dataSource/models.d.ts +4 -2
- package/hooks/features/dataSource/useGridDataSourcePremium.js +28 -5
- package/hooks/features/dataSource/utils.d.ts +3 -2
- package/hooks/features/dataSource/utils.js +15 -2
- package/hooks/features/editing/useGridCellEditable.d.ts +8 -0
- package/hooks/features/editing/useGridCellEditable.js +41 -0
- package/hooks/features/export/gridExcelExportInterface.d.ts +1 -1
- package/hooks/features/export/serializer/excelSerializer.d.ts +1 -1
- package/hooks/features/export/serializer/utils.d.ts +1 -1
- package/hooks/features/export/serializer/utils.js +1 -1
- package/hooks/features/rowGrouping/createGroupingColDef.js +3 -3
- package/index.js +1 -1
- package/material/index.d.ts +1 -0
- package/material/index.js +1 -0
- package/models/gridPremiumIconSlotsComponent.d.ts +5 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,213 @@
|
|
|
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.16.0
|
|
9
|
+
|
|
10
|
+
_Oct 29, 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
|
+
- 🖌️ Add `brush` zoom interaction to charts
|
|
15
|
+
- 🔁 [Server-side update](https://mui.com/x/react-data-grid/server-side-data/#updating-server-side-data) in a grid with tree data/row grouping and aggregation will trigger re-fetch for all parent levels of that row to update aggregated values. See the [demo](https://mui.com/x/react-data-grid/server-side-data/aggregation/#usage-with-tree-data).
|
|
16
|
+
|
|
17
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
18
|
+
@felix-wg, @frncesc, @sai6855
|
|
19
|
+
|
|
20
|
+
The following are all team members who have contributed to this release:
|
|
21
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @brijeshb42, @flaviendelangle, @JCQuintas, @MBilalShafi, @mbrookes, @michelengelen, @noraleonte, @rita-codes
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.16.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Ignore `Ctrl+A` key combination for the row selection in the community version (#20110) @felix-wg
|
|
28
|
+
- [DataGrid][l10n] Improve Spanish (es-ES) locale (#20134) @frncesc
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@8.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@8.16.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Add explicit return type to `getVisibleRowsLookup()` to fix the build with `tsc` (#20116) @arminmeh
|
|
35
|
+
- [DataGridPro] Retain the expansion state with expansion configuration props (#20126) @MBilalShafi
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-premium@8.16.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid-pro@8.16.0`, plus:
|
|
40
|
+
|
|
41
|
+
- [DataGridPremium] Export and restore chart integration state (#20079) @arminmeh
|
|
42
|
+
- [DataGridPremium] Fix grouping column `valueFormatter()` crash (#20070) @sai6855
|
|
43
|
+
- [DataGridPremium] Refetch aggregation data after row update with server-side aggregation (#20039) @arminmeh
|
|
44
|
+
|
|
45
|
+
### Date and Time Pickers
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers@8.16.0`
|
|
48
|
+
|
|
49
|
+
- [pickers] Prevent blur event propagation on individual sections (#19825) @michelengelen
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@8.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@8.16.0`.
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@8.16.0`
|
|
58
|
+
|
|
59
|
+
- [charts] Allow tooltip to anchor items (#19954) @alexfauquette
|
|
60
|
+
- [charts] Fix behavior of grouped axis (#20118) @JCQuintas
|
|
61
|
+
- [charts] Move scale symlog inside scales (#20137) @JCQuintas
|
|
62
|
+
- [charts] Fix AreaChartConnectNulls demo height not correctly resizing (#20078) @sai6855
|
|
63
|
+
- [charts] Fix charts resizing overflow (#20080) @alexfauquette
|
|
64
|
+
- [charts] Fix tooltip not showing on first render (#20115) @bernardobelchior
|
|
65
|
+
- [charts] Handle `undefined` id and color in series (#20087) @bernardobelchior
|
|
66
|
+
- [charts] Remove `useMemo` from isZoomOn*Enabled and isPanOn*Enabled hooks (#20132) @Copilot
|
|
67
|
+
- [charts] Use static data for perf (#20072) @JCQuintas
|
|
68
|
+
- [charts] Move scale symlog inside scales (#20137) @JCQuintas
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-charts-pro@8.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-charts@8.16.0`, plus:
|
|
73
|
+
|
|
74
|
+
- [charts-pro] Add `brush` zoom interaction (#19899) @JCQuintas
|
|
75
|
+
- [charts-pro] Add sankey performance check (#20069) @JCQuintas
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-charts-premium@8.16.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
78
|
+
|
|
79
|
+
Same changes as in `@mui/x-charts-pro@8.16.0`.
|
|
80
|
+
|
|
81
|
+
### Tree View
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-tree-view@8.16.0`
|
|
84
|
+
|
|
85
|
+
Internal changes.
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-tree-view-pro@8.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-tree-view@8.16.0`.
|
|
90
|
+
|
|
91
|
+
### Codemod
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-codemod@8.16.0`
|
|
94
|
+
|
|
95
|
+
Internal changes.
|
|
96
|
+
|
|
97
|
+
### Core
|
|
98
|
+
|
|
99
|
+
- [code-infra] Setup eslint compat plugin (#20105) @brijeshb42
|
|
100
|
+
- [code-infra] Improve store types (#20129) @JCQuintas
|
|
101
|
+
- [docs] Update the callout in `rows` prop documentation (#20127) @MBilalShafi
|
|
102
|
+
- [docs-infra] Refine changelog contributor acknowledgment messages (#20123) @mbrookes
|
|
103
|
+
|
|
104
|
+
### Miscellaneous
|
|
105
|
+
|
|
106
|
+
- [x-telemetry] Skip telemetry tests on browser mode (#20122) @bernardobelchior
|
|
107
|
+
|
|
108
|
+
## 8.15.0
|
|
109
|
+
|
|
110
|
+
_Oct 23, 2025_
|
|
111
|
+
|
|
112
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
113
|
+
|
|
114
|
+
- 🖌️ Add new [`brush` charts interaction](https://mui.com/x/react-charts/brush/) for building custom behavior.
|
|
115
|
+

|
|
116
|
+
- ⚡️ Performance improvements for large bar charts
|
|
117
|
+
- 🤖 Data Grid AI assistant can now [visualize the query results](https://mui.com/x/react-data-grid/ai-assistant/#data-visualization) by controlling the chart integration settings
|
|
118
|
+
- 📦 DataGrid uses an internal MUI fork of ExcelJS that does not depend on vulnerable versions of NPM packages
|
|
119
|
+
- 🐞 Bugfixes
|
|
120
|
+
- 📚 Documentation improvements
|
|
121
|
+
|
|
122
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
123
|
+
@ZagrebaAlex
|
|
124
|
+
|
|
125
|
+
The following are all team members who have contributed to this release:
|
|
126
|
+
@alexfauquette, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @prakhargupta1, @rita-codes, @siriwatknp, @arminmeh, @brijeshb42, @noraleonte
|
|
127
|
+
|
|
128
|
+
### Data Grid
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-data-grid@8.15.0`
|
|
131
|
+
|
|
132
|
+
- [DataGrid] Fix `dataSource.fetchRows` API's return type (#20068) @arminmeh
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-data-grid-pro@8.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
135
|
+
|
|
136
|
+
Same changes as in `@mui/x-data-grid@8.15.0`, plus:
|
|
137
|
+
|
|
138
|
+
- [DataGridPro] Keep children in the tree after parent row is re-fetched with the data source (#19934) @arminmeh
|
|
139
|
+
- [DataGridPro] Support scroll shadows customization (#19982) @KenanYusuf
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-data-grid-premium@8.15.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-data-grid-pro@8.15.0`, plus:
|
|
144
|
+
|
|
145
|
+
- [DataGridPremium] Use ExcelJS fork (#19796) @cherniavskii
|
|
146
|
+
- [DataGridPremium] Support data visualization in AI Assistant (#19831) @arminmeh
|
|
147
|
+
|
|
148
|
+
### Date and Time Pickers
|
|
149
|
+
|
|
150
|
+
#### `@mui/x-date-pickers@8.15.0`
|
|
151
|
+
|
|
152
|
+
Internal changes.
|
|
153
|
+
|
|
154
|
+
#### `@mui/x-date-pickers-pro@8.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
155
|
+
|
|
156
|
+
Same changes as in `@mui/x-date-pickers@8.15.0`.
|
|
157
|
+
|
|
158
|
+
### Charts
|
|
159
|
+
|
|
160
|
+
#### `@mui/x-charts@8.15.0`
|
|
161
|
+
|
|
162
|
+
- [charts] Add `ChartsBrushOverlay` and allow brush configuration (#19956) @JCQuintas
|
|
163
|
+
- [charts] Add `getStringSize` benchmark. Remove benchmarks from built package. (#19995) @bernardobelchior
|
|
164
|
+
- [charts] Batch string size measurement (#19994) @bernardobelchior
|
|
165
|
+
- [charts] Fix console issue (#20025) @JCQuintas
|
|
166
|
+
- [charts] Fix is[ZoomFeature]Enabled type (#20058) @alexfauquette
|
|
167
|
+
- [charts] Fix reference line middle spacing (#20004) @JCQuintas
|
|
168
|
+
- [charts] Improve `getStringSize` and `batchMeasureStrings` performance (#19996) @bernardobelchior
|
|
169
|
+
- [charts] Improve deep export script (#20007) @JCQuintas
|
|
170
|
+
- [charts] Improve string measurement benchmarks (#19999) @bernardobelchior
|
|
171
|
+
- [charts] Measure string sizes using SVG elements (#19981) @bernardobelchior
|
|
172
|
+
- [l10n] Improve Greek (gr-GR) locale (#20060) @ZagrebaAlex
|
|
173
|
+
|
|
174
|
+
#### `@mui/x-charts-pro@8.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
175
|
+
|
|
176
|
+
Same changes as in `@mui/x-charts@8.15.0`, plus:
|
|
177
|
+
|
|
178
|
+
- [charts-pro] Fix pan with `axis.reverse` (#20031) @JCQuintas
|
|
179
|
+
|
|
180
|
+
#### `@mui/x-charts-premium@8.15.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
181
|
+
|
|
182
|
+
Same changes as in `@mui/x-charts-pro@8.15.0`.
|
|
183
|
+
|
|
184
|
+
### Tree View
|
|
185
|
+
|
|
186
|
+
#### `@mui/x-tree-view@8.15.0`
|
|
187
|
+
|
|
188
|
+
- [tree view] Multi character type-ahead (#19942) @noraleonte
|
|
189
|
+
|
|
190
|
+
#### `@mui/x-tree-view-pro@8.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
191
|
+
|
|
192
|
+
Same changes as in `@mui/x-tree-view@8.15.0`.
|
|
193
|
+
|
|
194
|
+
### Codemod
|
|
195
|
+
|
|
196
|
+
#### `@mui/x-codemod@8.14.0`
|
|
197
|
+
|
|
198
|
+
Internal changes.
|
|
199
|
+
|
|
200
|
+
### Docs
|
|
201
|
+
|
|
202
|
+
- [docs] Add overview section for scatter chart and heatmap (#19888) @prakhargupta1
|
|
203
|
+
- [docs] Add charts bell curve example (#20003) @JCQuintas
|
|
204
|
+
- [docs] Add grouped multiple fields for Data Grid row grouping recipe (#19964) @siriwatknp
|
|
205
|
+
- [docs] Add Data Grid loading state recipe (#19958) @siriwatknp
|
|
206
|
+
|
|
207
|
+
### Core
|
|
208
|
+
|
|
209
|
+
- [code-infra] Remove @mui/monorepo usage for react versioning (#19894) @Janpot
|
|
210
|
+
- [code-infra] Remove invalid `environment: 'browser'` from vitest browser config (#19993) @bernardobelchior
|
|
211
|
+
- [code-infra] Remove unused babel aliases (#19987) @Janpot
|
|
212
|
+
- [code-infra] Turn on all testing-library eslint rules (#19946) @brijeshb42
|
|
213
|
+
- [docs-infra] Fix broken hash link (#20062) @Janpot
|
|
214
|
+
|
|
8
215
|
## 8.14.1
|
|
9
216
|
|
|
10
217
|
_Oct 16, 2025_
|
|
@@ -25,6 +25,7 @@ var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
|
25
25
|
var _useGridRowsOverridableMethods = require("../hooks/features/rows/useGridRowsOverridableMethods");
|
|
26
26
|
var _useGridParamsOverridableMethods = require("../hooks/features/rows/useGridParamsOverridableMethods");
|
|
27
27
|
var _sidebar2 = require("../hooks/features/sidebar");
|
|
28
|
+
var _useGridCellEditable = require("../hooks/features/editing/useGridCellEditable");
|
|
28
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
30
|
const configuration = {
|
|
30
31
|
hooks: {
|
|
@@ -44,11 +45,12 @@ const configuration = {
|
|
|
44
45
|
}
|
|
45
46
|
return (0, _internals.getRowValue)(row, column, apiRef);
|
|
46
47
|
},
|
|
48
|
+
useIsCellEditable: _useGridCellEditable.useIsCellEditable,
|
|
47
49
|
useGridRowsOverridableMethods: _useGridRowsOverridableMethods.useGridRowsOverridableMethods,
|
|
48
50
|
useGridParamsOverridableMethods: _useGridParamsOverridableMethods.useGridParamsOverridableMethods
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
|
-
const releaseInfo = "
|
|
53
|
+
const releaseInfo = "MTc2MTY5NjAwMDAwMA==";
|
|
52
54
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
53
55
|
packageName: "x-data-grid-premium",
|
|
54
56
|
releaseInfo: releaseInfo
|
|
@@ -127,6 +129,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
127
129
|
helperText: _propTypes.default.string,
|
|
128
130
|
response: _propTypes.default.shape({
|
|
129
131
|
aggregation: _propTypes.default.object.isRequired,
|
|
132
|
+
chart: _propTypes.default.object,
|
|
130
133
|
conversationId: _propTypes.default.string.isRequired,
|
|
131
134
|
filterOperator: _propTypes.default.oneOf(['and', 'or']),
|
|
132
135
|
filters: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
@@ -120,7 +120,7 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
120
120
|
(0, _internals.useGridColumnSpanning)(apiRef);
|
|
121
121
|
(0, _internals.useGridColumnGrouping)(apiRef, props);
|
|
122
122
|
(0, _useGridClipboardImport.useGridClipboardImport)(apiRef, props);
|
|
123
|
-
(0, _internals.useGridEditing)(apiRef, props);
|
|
123
|
+
(0, _internals.useGridEditing)(apiRef, props, configuration);
|
|
124
124
|
(0, _internals.useGridFocus)(apiRef, props);
|
|
125
125
|
(0, _internals.useGridPreferencesPanel)(apiRef, props);
|
|
126
126
|
(0, _internals.useGridFilter)(apiRef, props, configuration);
|
|
@@ -277,6 +277,13 @@ function GridPrompt(props) {
|
|
|
277
277
|
}
|
|
278
278
|
return changes;
|
|
279
279
|
}, [apiRef, getColumnName, rootProps.slots]);
|
|
280
|
+
const getChartChanges = React.useCallback(chart => {
|
|
281
|
+
return {
|
|
282
|
+
label: apiRef.current.getLocaleText('toolbarCharts'),
|
|
283
|
+
description: apiRef.current.getLocaleText('promptChangeChartsLabel')(chart.dimensions.length, chart.values.length),
|
|
284
|
+
icon: rootProps.slots.promptChartsIcon
|
|
285
|
+
};
|
|
286
|
+
}, [apiRef, rootProps.slots.promptChartsIcon]);
|
|
280
287
|
const changeList = React.useMemo(() => {
|
|
281
288
|
if (!response) {
|
|
282
289
|
return [];
|
|
@@ -297,8 +304,11 @@ function GridPrompt(props) {
|
|
|
297
304
|
if (response.pivoting && 'columns' in response.pivoting) {
|
|
298
305
|
changes.push(...getPivotingChanges(response.pivoting));
|
|
299
306
|
}
|
|
307
|
+
if (response.chart) {
|
|
308
|
+
changes.push(getChartChanges(response.chart));
|
|
309
|
+
}
|
|
300
310
|
return changes;
|
|
301
|
-
}, [response, getGroupingChanges, getAggregationChanges, getFilterChanges, getSortingChanges, getPivotingChanges]);
|
|
311
|
+
}, [response, getGroupingChanges, getAggregationChanges, getFilterChanges, getSortingChanges, getPivotingChanges, getChartChanges]);
|
|
302
312
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PromptItem, {
|
|
303
313
|
ownerState: ownerState,
|
|
304
314
|
className: classes.root,
|
|
@@ -18,6 +18,7 @@ import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
|
18
18
|
import { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
|
|
19
19
|
import { useGridParamsOverridableMethods } from "../hooks/features/rows/useGridParamsOverridableMethods.js";
|
|
20
20
|
import { gridSidebarOpenSelector } from "../hooks/features/sidebar/index.js";
|
|
21
|
+
import { useIsCellEditable } from "../hooks/features/editing/useGridCellEditable.js";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
const configuration = {
|
|
23
24
|
hooks: {
|
|
@@ -37,11 +38,12 @@ const configuration = {
|
|
|
37
38
|
}
|
|
38
39
|
return getRowValue(row, column, apiRef);
|
|
39
40
|
},
|
|
41
|
+
useIsCellEditable,
|
|
40
42
|
useGridRowsOverridableMethods,
|
|
41
43
|
useGridParamsOverridableMethods
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
|
-
const releaseInfo = "
|
|
46
|
+
const releaseInfo = "MTc2MTY5NjAwMDAwMA==";
|
|
45
47
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
46
48
|
packageName: "x-data-grid-premium",
|
|
47
49
|
releaseInfo: releaseInfo
|
|
@@ -120,6 +122,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
120
122
|
helperText: PropTypes.string,
|
|
121
123
|
response: PropTypes.shape({
|
|
122
124
|
aggregation: PropTypes.object.isRequired,
|
|
125
|
+
chart: PropTypes.object,
|
|
123
126
|
conversationId: PropTypes.string.isRequired,
|
|
124
127
|
filterOperator: PropTypes.oneOf(['and', 'or']),
|
|
125
128
|
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
@@ -112,7 +112,7 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
|
|
|
112
112
|
useGridColumnSpanning(apiRef);
|
|
113
113
|
useGridColumnGrouping(apiRef, props);
|
|
114
114
|
useGridClipboardImport(apiRef, props);
|
|
115
|
-
useGridEditing(apiRef, props);
|
|
115
|
+
useGridEditing(apiRef, props, configuration);
|
|
116
116
|
useGridFocus(apiRef, props);
|
|
117
117
|
useGridPreferencesPanel(apiRef, props);
|
|
118
118
|
useGridFilter(apiRef, props, configuration);
|
|
@@ -270,6 +270,13 @@ function GridPrompt(props) {
|
|
|
270
270
|
}
|
|
271
271
|
return changes;
|
|
272
272
|
}, [apiRef, getColumnName, rootProps.slots]);
|
|
273
|
+
const getChartChanges = React.useCallback(chart => {
|
|
274
|
+
return {
|
|
275
|
+
label: apiRef.current.getLocaleText('toolbarCharts'),
|
|
276
|
+
description: apiRef.current.getLocaleText('promptChangeChartsLabel')(chart.dimensions.length, chart.values.length),
|
|
277
|
+
icon: rootProps.slots.promptChartsIcon
|
|
278
|
+
};
|
|
279
|
+
}, [apiRef, rootProps.slots.promptChartsIcon]);
|
|
273
280
|
const changeList = React.useMemo(() => {
|
|
274
281
|
if (!response) {
|
|
275
282
|
return [];
|
|
@@ -290,8 +297,11 @@ function GridPrompt(props) {
|
|
|
290
297
|
if (response.pivoting && 'columns' in response.pivoting) {
|
|
291
298
|
changes.push(...getPivotingChanges(response.pivoting));
|
|
292
299
|
}
|
|
300
|
+
if (response.chart) {
|
|
301
|
+
changes.push(getChartChanges(response.chart));
|
|
302
|
+
}
|
|
293
303
|
return changes;
|
|
294
|
-
}, [response, getGroupingChanges, getAggregationChanges, getFilterChanges, getSortingChanges, getPivotingChanges]);
|
|
304
|
+
}, [response, getGroupingChanges, getAggregationChanges, getFilterChanges, getSortingChanges, getPivotingChanges, getChartChanges]);
|
|
295
305
|
return /*#__PURE__*/_jsxs(PromptItem, {
|
|
296
306
|
ownerState: ownerState,
|
|
297
307
|
className: classes.root,
|
|
@@ -39,6 +39,10 @@ type Pivoting = {
|
|
|
39
39
|
rows: string[];
|
|
40
40
|
values: Aggregation[];
|
|
41
41
|
} | {};
|
|
42
|
+
type Chart = {
|
|
43
|
+
dimensions: string[];
|
|
44
|
+
values: string[];
|
|
45
|
+
};
|
|
42
46
|
export type PromptResponse = {
|
|
43
47
|
conversationId: string;
|
|
44
48
|
select: number;
|
|
@@ -48,6 +52,7 @@ export type PromptResponse = {
|
|
|
48
52
|
sorting: ColumnSort[];
|
|
49
53
|
grouping: Grouping[];
|
|
50
54
|
pivoting: Pivoting;
|
|
55
|
+
chart: Chart | null;
|
|
51
56
|
};
|
|
52
57
|
export type PromptResolverOptions = {
|
|
53
58
|
/**
|
|
@@ -3,4 +3,4 @@ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
|
3
3
|
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
4
4
|
import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
5
5
|
export declare const aiAssistantStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'initialState' | 'aiAssistantConversations' | 'aiAssistant'>>;
|
|
6
|
-
export declare const useGridAiAssistant: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aiAssistant" | "aiAssistantConversations" | "aiAssistantActiveConversationIndex" | "allowAiAssistantDataSampling" | "onAiAssistantConversationsChange" | "onAiAssistantActiveConversationIndexChange" | "onPrompt" | "slots" | "disableColumnFilter" | "disableRowGrouping" | "disableAggregation" | "disableColumnSorting" | "disablePivoting">) => void;
|
|
6
|
+
export declare const useGridAiAssistant: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aiAssistant" | "aiAssistantConversations" | "aiAssistantActiveConversationIndex" | "allowAiAssistantDataSampling" | "onAiAssistantConversationsChange" | "onAiAssistantActiveConversationIndexChange" | "onPrompt" | "slots" | "rowSelection" | "disableColumnFilter" | "disableRowGrouping" | "disableAggregation" | "disableColumnSorting" | "disablePivoting" | "chartsIntegration" | "experimentalFeatures" | "getPivotDerivedColumns">) => void;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
|
|
6
|
+
import { gridColumnLookupSelector, GridLogicOperator, gridRowsLookupSelector, useGridApiMethod, GRID_CHECKBOX_SELECTION_FIELD, GridPreferencePanelsValue, gridColumnGroupsUnwrappedModelSelector, gridVisibleRowsSelector } from '@mui/x-data-grid-pro';
|
|
6
7
|
import { getValueOptions, getVisibleRows, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
7
8
|
import { gridAiAssistantConversationsSelector, gridAiAssistantActiveConversationSelector, gridAiAssistantActiveConversationIndexSelector } from "./gridAiAssistantSelectors.js";
|
|
9
|
+
import { gridChartsIntegrationActiveChartIdSelector } from "../chartsIntegration/gridChartsIntegrationSelectors.js";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
const DEFAULT_SAMPLE_COUNT = 5;
|
|
12
|
+
const MAX_CHART_DATA_POINTS = 1000;
|
|
10
13
|
export const aiAssistantStateInitializer = (state, props) => {
|
|
11
14
|
if (!props.aiAssistant) {
|
|
12
15
|
return _extends({}, state, {
|
|
@@ -28,12 +31,18 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
28
31
|
onPrompt,
|
|
29
32
|
allowAiAssistantDataSampling,
|
|
30
33
|
slots,
|
|
34
|
+
rowSelection,
|
|
31
35
|
disableColumnFilter,
|
|
32
36
|
disableRowGrouping,
|
|
33
37
|
disableAggregation,
|
|
34
38
|
disableColumnSorting,
|
|
35
|
-
disablePivoting
|
|
39
|
+
disablePivoting,
|
|
40
|
+
chartsIntegration,
|
|
41
|
+
experimentalFeatures,
|
|
42
|
+
getPivotDerivedColumns
|
|
36
43
|
} = props;
|
|
44
|
+
const previousUnwrappedGroupingModel = React.useRef([]);
|
|
45
|
+
const activeChartId = gridChartsIntegrationActiveChartIdSelector(apiRef);
|
|
37
46
|
const columnsLookup = gridColumnLookupSelector(apiRef);
|
|
38
47
|
const columns = Object.values(columnsLookup);
|
|
39
48
|
const rows = Object.values(gridRowsLookupSelector(apiRef));
|
|
@@ -78,15 +87,38 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
78
87
|
return '';
|
|
79
88
|
}
|
|
80
89
|
const examples = allowDataSampling ? collectSampleData() : {};
|
|
81
|
-
const columnsContext = columns.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
const columnsContext = columns.reduce((acc, column) => {
|
|
91
|
+
const columnContextWithoutExamples = {
|
|
92
|
+
field: column.field,
|
|
93
|
+
description: column.description ?? null,
|
|
94
|
+
examples: [],
|
|
95
|
+
type: column.type ?? 'string',
|
|
96
|
+
allowedOperators: column.filterOperators?.map(operator => operator.value) ?? []
|
|
97
|
+
};
|
|
98
|
+
acc.push(_extends({}, columnContextWithoutExamples, {
|
|
99
|
+
examples: examples[column.field] ?? column.examples ?? []
|
|
100
|
+
}));
|
|
101
|
+
if (disablePivoting) {
|
|
102
|
+
return acc;
|
|
103
|
+
}
|
|
104
|
+
(getPivotDerivedColumns?.(column, apiRef.current.getLocaleText) || []).forEach(col => acc.push(_extends({}, columnContextWithoutExamples, col, {
|
|
105
|
+
derivedFrom: column.field
|
|
106
|
+
})));
|
|
107
|
+
return acc;
|
|
108
|
+
}, []);
|
|
88
109
|
return JSON.stringify(columnsContext);
|
|
89
|
-
}, [columns, collectSampleData, isAiAssistantAvailable]);
|
|
110
|
+
}, [apiRef, columns, collectSampleData, getPivotDerivedColumns, isAiAssistantAvailable, disablePivoting]);
|
|
111
|
+
const updateChart = React.useCallback(result => {
|
|
112
|
+
if (!result.chart) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
apiRef.current.updateChartDimensionsData(activeChartId, result.chart.dimensions.map(item => ({
|
|
116
|
+
field: item
|
|
117
|
+
})));
|
|
118
|
+
apiRef.current.updateChartValuesData(activeChartId, result.chart.values.map(item => ({
|
|
119
|
+
field: item
|
|
120
|
+
})));
|
|
121
|
+
}, [apiRef, activeChartId]);
|
|
90
122
|
const applyPromptResult = React.useCallback(result => {
|
|
91
123
|
if (!isAiAssistantAvailable) {
|
|
92
124
|
return;
|
|
@@ -115,6 +147,8 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
115
147
|
quickFilterValues: []
|
|
116
148
|
});
|
|
117
149
|
interestColumns.push(...result.filters.map(f => f.column));
|
|
150
|
+
} else {
|
|
151
|
+
result.filters = [];
|
|
118
152
|
}
|
|
119
153
|
let appliedPivoting = false;
|
|
120
154
|
if (!disablePivoting && 'columns' in result.pivoting) {
|
|
@@ -138,6 +172,7 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
138
172
|
appliedPivoting = true;
|
|
139
173
|
} else if ('columns' in result.pivoting) {
|
|
140
174
|
// if pivoting is disabled and there are pivoting results, try to move them into grouping and aggregation
|
|
175
|
+
apiRef.current.setPivotActive(false);
|
|
141
176
|
result.pivoting.columns.forEach(c => {
|
|
142
177
|
result.grouping.push({
|
|
143
178
|
column: c.column
|
|
@@ -154,26 +189,58 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
154
189
|
});
|
|
155
190
|
// remove the pivoting results data
|
|
156
191
|
result.pivoting = {};
|
|
192
|
+
} else {
|
|
193
|
+
apiRef.current.setPivotActive(false);
|
|
157
194
|
}
|
|
158
195
|
if (!disableRowGrouping && !appliedPivoting) {
|
|
159
196
|
apiRef.current.setRowGroupingModel(result.grouping.map(g => g.column));
|
|
197
|
+
} else {
|
|
198
|
+
result.grouping = [];
|
|
160
199
|
}
|
|
161
200
|
if (!disableAggregation && !appliedPivoting) {
|
|
162
201
|
apiRef.current.setAggregationModel(result.aggregation);
|
|
163
202
|
interestColumns.push(...Object.keys(result.aggregation));
|
|
203
|
+
} else {
|
|
204
|
+
result.aggregation = {};
|
|
164
205
|
}
|
|
165
206
|
if (!disableColumnSorting) {
|
|
166
207
|
apiRef.current.setSortModel(result.sorting.map(s => ({
|
|
167
208
|
field: s.column,
|
|
168
209
|
sort: s.direction
|
|
169
210
|
})));
|
|
211
|
+
} else {
|
|
212
|
+
result.sorting = [];
|
|
213
|
+
}
|
|
214
|
+
if (experimentalFeatures?.charts && chartsIntegration && activeChartId && result.chart) {
|
|
215
|
+
if (appliedPivoting) {
|
|
216
|
+
const unsubscribe = apiRef.current.subscribeEvent('rowsSet', () => {
|
|
217
|
+
const unwrappedGroupingModel = Object.keys(gridColumnGroupsUnwrappedModelSelector(apiRef));
|
|
218
|
+
// wait until unwrapped grouping model changes
|
|
219
|
+
if (!result.chart || unwrappedGroupingModel.length === 0 || isDeepEqual(previousUnwrappedGroupingModel.current, unwrappedGroupingModel)) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
previousUnwrappedGroupingModel.current = unwrappedGroupingModel;
|
|
223
|
+
const visibleRowsCount = gridVisibleRowsSelector(apiRef).rows.length;
|
|
224
|
+
const maxColumns = Math.floor(MAX_CHART_DATA_POINTS / visibleRowsCount);
|
|
225
|
+
|
|
226
|
+
// we assume that the pivoting was adjusted to what needs to be shown in the chart
|
|
227
|
+
// so we can just pick up all the columns that were created by pivoting
|
|
228
|
+
// to avoid rendering issues, set the limit to MAX_CHART_DATA_POINTS data points (rows * columns)
|
|
229
|
+
result.chart.values = unwrappedGroupingModel.slice(0, maxColumns);
|
|
230
|
+
updateChart(result);
|
|
231
|
+
unsubscribe();
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
updateChart(result);
|
|
235
|
+
}
|
|
170
236
|
}
|
|
171
237
|
const visibleRowsData = getVisibleRows(apiRef);
|
|
172
238
|
const rowSelectionModel = {
|
|
173
239
|
type: 'include',
|
|
174
240
|
ids: new Set()
|
|
175
241
|
};
|
|
176
|
-
|
|
242
|
+
const selection = rowSelection ? result.select : -1;
|
|
243
|
+
if (selection !== -1) {
|
|
177
244
|
for (let i = 0; i < result.select; i += 1) {
|
|
178
245
|
const row = visibleRowsData.rows[i];
|
|
179
246
|
const id = apiRef.current.getRowId(row);
|
|
@@ -183,7 +250,7 @@ export const useGridAiAssistant = (apiRef, props) => {
|
|
|
183
250
|
apiRef.current.setRowSelectionModel(rowSelectionModel);
|
|
184
251
|
const targetIndex = Number(columnsLookup[GRID_CHECKBOX_SELECTION_FIELD] !== undefined) + Number(result.grouping.length);
|
|
185
252
|
interestColumns.reverse().forEach(c => apiRef.current.setColumnIndex(c, targetIndex));
|
|
186
|
-
}, [apiRef, disableColumnFilter, disableRowGrouping, disableAggregation, disableColumnSorting, disablePivoting, columnsLookup, isAiAssistantAvailable]);
|
|
253
|
+
}, [apiRef, updateChart, rowSelection, disableColumnFilter, disableRowGrouping, disableAggregation, disableColumnSorting, disablePivoting, columnsLookup, isAiAssistantAvailable, activeChartId, chartsIntegration, experimentalFeatures?.charts]);
|
|
187
254
|
const setActiveConversationId = React.useCallback(id => {
|
|
188
255
|
if (!isAiAssistantAvailable) {
|
|
189
256
|
return;
|
|
@@ -3,6 +3,12 @@ import { GridStatePremium } from "../../../models/gridStatePremium.js";
|
|
|
3
3
|
export declare const gridChartsIntegrationActiveChartIdSelector: (args_0: import("react").RefObject<{
|
|
4
4
|
state: GridStatePremium;
|
|
5
5
|
} | null>) => string;
|
|
6
|
+
export declare const gridChartsIntegrationChartsLookupSelector: (args_0: import("react").RefObject<{
|
|
7
|
+
state: GridStatePremium;
|
|
8
|
+
} | null>) => Record<string, {
|
|
9
|
+
dimensions: import("./gridChartsIntegrationInterfaces.js").GridChartsIntegrationItem[];
|
|
10
|
+
values: import("./gridChartsIntegrationInterfaces.js").GridChartsIntegrationItem[];
|
|
11
|
+
}>;
|
|
6
12
|
export declare const gridChartsPanelOpenSelector: (args_0: import("react").RefObject<{
|
|
7
13
|
state: GridStatePremium;
|
|
8
14
|
} | null>) => boolean;
|
|
@@ -3,6 +3,7 @@ import { gridSidebarStateSelector, GridSidebarValue } from "../sidebar/index.js"
|
|
|
3
3
|
import { gridPivotModelSelector } from "../pivoting/gridPivotingSelectors.js";
|
|
4
4
|
const gridChartsIntegrationStateSelector = createRootSelector(state => state.chartsIntegration);
|
|
5
5
|
export const gridChartsIntegrationActiveChartIdSelector = createSelector(gridChartsIntegrationStateSelector, chartsIntegration => chartsIntegration.activeChartId);
|
|
6
|
+
export const gridChartsIntegrationChartsLookupSelector = createSelector(gridChartsIntegrationStateSelector, chartsIntegration => chartsIntegration.charts);
|
|
6
7
|
export const gridChartsPanelOpenSelector = createSelector(gridSidebarStateSelector, sidebar => sidebar.value === GridSidebarValue.Charts && sidebar.open);
|
|
7
8
|
export const gridChartableColumnsSelector = createSelectorMemoized(gridColumnLookupSelector, gridPivotActiveSelector, gridPivotModelSelector, (columns, pivotActive, pivotModel) => {
|
|
8
9
|
let chartableColumns = Object.values(columns).filter(column => column.chartable);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
3
3
|
import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
4
|
+
import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
5
5
|
import { ChartState } from "../../../models/gridChartsIntegration.js";
|
|
6
6
|
export declare const EMPTY_CHART_INTEGRATION_CONTEXT_STATE: ChartState;
|
|
7
7
|
export declare const chartsIntegrationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'chartsIntegration' | 'initialState' | 'activeChartId' | 'rowGroupingModel' | 'pivotModel' | 'experimentalFeatures'>, GridPrivateApiPremium>;
|