@mui/x-data-grid-premium 8.11.3 → 8.12.1
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 +175 -6
- package/DataGridPremium/DataGridPremium.js +29 -1
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/DataGridPremium/useDataGridPremiumComponent.js +5 -2
- package/DataGridPremium/useDataGridPremiumProps.js +2 -1
- package/components/GridPremiumColumnMenu.d.ts +4 -4
- package/components/GridPremiumColumnMenu.js +6 -6
- package/components/GridPremiumToolbar.js +11 -0
- package/components/chartsIntegration/GridChartsIntegrationContext.d.ts +2 -0
- package/components/chartsIntegration/GridChartsIntegrationContext.js +11 -0
- package/components/chartsPanel/ChartsPanelTrigger.d.ts +33 -0
- package/components/chartsPanel/ChartsPanelTrigger.js +92 -0
- package/components/chartsPanel/GridChartsPanel.d.ts +21 -0
- package/components/chartsPanel/GridChartsPanel.js +243 -0
- package/components/chartsPanel/chart/GridChartsPanelChart.d.ts +12 -0
- package/components/chartsPanel/chart/GridChartsPanelChart.js +111 -0
- package/components/chartsPanel/customize/GridChartsPanelCustomize.d.ts +8 -0
- package/components/chartsPanel/customize/GridChartsPanelCustomize.js +147 -0
- package/components/chartsPanel/data/GridChartsPanelData.d.ts +4 -0
- package/components/chartsPanel/data/GridChartsPanelData.js +23 -0
- package/components/chartsPanel/data/GridChartsPanelDataBody.d.ts +12 -0
- package/components/chartsPanel/data/GridChartsPanelDataBody.js +380 -0
- package/components/chartsPanel/data/GridChartsPanelDataField.d.ts +25 -0
- package/components/chartsPanel/data/GridChartsPanelDataField.js +334 -0
- package/components/chartsPanel/data/GridChartsPanelDataFieldMenu.d.ts +11 -0
- package/components/chartsPanel/data/GridChartsPanelDataFieldMenu.js +179 -0
- package/components/chartsPanel/data/GridChartsPanelDataHeader.d.ts +7 -0
- package/components/chartsPanel/data/GridChartsPanelDataHeader.js +24 -0
- package/components/chartsPanel/data/GridChartsPanelDataSearch.d.ts +7 -0
- package/components/chartsPanel/data/GridChartsPanelDataSearch.js +80 -0
- package/components/chartsPanel/index.d.ts +2 -0
- package/components/chartsPanel/index.js +27 -0
- package/components/collapsible/Collapsible.d.ts +3 -1
- package/components/collapsible/Collapsible.js +4 -3
- package/components/{GridColumnMenuAggregationItem.js → columnMenu/menuItems/GridColumnMenuAggregationItem.js} +4 -4
- package/components/columnMenu/menuItems/GridColumnMenuChartsItem.d.ts +3 -0
- package/components/columnMenu/menuItems/GridColumnMenuChartsItem.js +36 -0
- package/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.d.ts +4 -0
- package/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.js +18 -0
- package/{esm/components → components/columnMenu/menuItems}/GridColumnMenuPivotItem.d.ts +1 -1
- package/components/{GridColumnMenuPivotItem.js → columnMenu/menuItems/GridColumnMenuPivotItem.js} +7 -4
- package/components/{GridColumnMenuRowGroupItem.js → columnMenu/menuItems/GridColumnMenuRowGroupItem.js} +4 -4
- package/components/{GridColumnMenuRowUngroupItem.js → columnMenu/menuItems/GridColumnMenuRowUngroupItem.js} +3 -3
- package/components/index.d.ts +3 -2
- package/components/index.js +13 -1
- package/components/pivotPanel/GridPivotPanelField.js +14 -2
- package/components/pivotPanel/GridPivotPanelHeader.js +1 -0
- package/components/pivotPanel/GridPivotPanelSearch.js +3 -0
- package/constants/columnGroups.d.ts +1 -0
- package/constants/columnGroups.js +7 -0
- package/constants/dataGridPremiumDefaultSlotsComponents.js +1 -0
- package/context/GridChartsIntegrationContextProvider.d.ts +7 -0
- package/context/GridChartsIntegrationContextProvider.js +35 -0
- package/context/GridChartsRendererProxy.d.ts +34 -0
- package/context/GridChartsRendererProxy.js +77 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +27 -0
- package/esm/DataGridPremium/DataGridPremium.js +30 -2
- package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -2
- package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -1
- package/esm/components/GridPremiumColumnMenu.d.ts +4 -4
- package/esm/components/GridPremiumColumnMenu.js +6 -6
- package/esm/components/GridPremiumToolbar.js +11 -0
- package/esm/components/chartsIntegration/GridChartsIntegrationContext.d.ts +2 -0
- package/esm/components/chartsIntegration/GridChartsIntegrationContext.js +5 -0
- package/esm/components/chartsPanel/ChartsPanelTrigger.d.ts +33 -0
- package/esm/components/chartsPanel/ChartsPanelTrigger.js +85 -0
- package/esm/components/chartsPanel/GridChartsPanel.d.ts +21 -0
- package/esm/components/chartsPanel/GridChartsPanel.js +237 -0
- package/esm/components/chartsPanel/chart/GridChartsPanelChart.d.ts +12 -0
- package/esm/components/chartsPanel/chart/GridChartsPanelChart.js +104 -0
- package/esm/components/chartsPanel/customize/GridChartsPanelCustomize.d.ts +8 -0
- package/esm/components/chartsPanel/customize/GridChartsPanelCustomize.js +139 -0
- package/esm/components/chartsPanel/data/GridChartsPanelData.d.ts +4 -0
- package/esm/components/chartsPanel/data/GridChartsPanelData.js +18 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataBody.d.ts +12 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataBody.js +374 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataField.d.ts +25 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataField.js +327 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataFieldMenu.d.ts +11 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataFieldMenu.js +173 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataHeader.d.ts +7 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataHeader.js +18 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataSearch.d.ts +7 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataSearch.js +73 -0
- package/esm/components/chartsPanel/index.d.ts +2 -0
- package/esm/components/chartsPanel/index.js +2 -0
- package/esm/components/collapsible/Collapsible.d.ts +3 -1
- package/esm/components/collapsible/Collapsible.js +4 -3
- package/esm/components/{GridColumnMenuAggregationItem.js → columnMenu/menuItems/GridColumnMenuAggregationItem.js} +4 -4
- package/esm/components/columnMenu/menuItems/GridColumnMenuChartsItem.d.ts +3 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuChartsItem.js +29 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.d.ts +4 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.js +11 -0
- package/{components → esm/components/columnMenu/menuItems}/GridColumnMenuPivotItem.d.ts +1 -1
- package/esm/components/{GridColumnMenuPivotItem.js → columnMenu/menuItems/GridColumnMenuPivotItem.js} +7 -4
- package/esm/components/{GridColumnMenuRowGroupItem.js → columnMenu/menuItems/GridColumnMenuRowGroupItem.js} +4 -4
- package/esm/components/{GridColumnMenuRowUngroupItem.js → columnMenu/menuItems/GridColumnMenuRowUngroupItem.js} +3 -3
- package/esm/components/index.d.ts +3 -2
- package/esm/components/index.js +3 -2
- package/esm/components/pivotPanel/GridPivotPanelField.js +15 -3
- package/esm/components/pivotPanel/GridPivotPanelHeader.js +1 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.js +3 -0
- package/esm/constants/columnGroups.d.ts +1 -0
- package/esm/constants/columnGroups.js +1 -0
- package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +1 -0
- package/esm/context/GridChartsIntegrationContextProvider.d.ts +7 -0
- package/esm/context/GridChartsIntegrationContextProvider.js +28 -0
- package/esm/context/GridChartsRendererProxy.d.ts +34 -0
- package/esm/context/GridChartsRendererProxy.js +71 -0
- package/esm/context/index.d.ts +2 -0
- package/esm/context/index.js +2 -0
- package/esm/hooks/features/aggregation/createAggregationLookup.js +5 -3
- package/esm/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +1 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.js +3 -0
- package/esm/hooks/features/aggregation/useGridAggregation.js +13 -1
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -1
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +1 -45
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.d.ts +65 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js +1 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +17 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +24 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +8 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.js +528 -0
- package/esm/hooks/features/chartsIntegration/utils.d.ts +5 -0
- package/esm/hooks/features/chartsIntegration/utils.js +32 -0
- package/esm/hooks/features/pivoting/useGridPivoting.js +1 -1
- package/esm/hooks/features/pivoting/utils.js +9 -7
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +3 -1
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -0
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -2
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -0
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.d.ts +1 -0
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.js +1 -0
- package/esm/hooks/utils/index.d.ts +2 -1
- package/esm/hooks/utils/index.js +2 -1
- package/esm/hooks/utils/useGridChartIntegration.d.ts +2 -0
- package/esm/hooks/utils/useGridChartIntegration.js +9 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/material/icons.d.ts +4 -1
- package/esm/material/icons.js +16 -2
- package/esm/material/index.d.ts +11 -0
- package/esm/material/index.js +13 -2
- package/esm/models/dataGridPremiumProps.d.ts +22 -1
- package/esm/models/gridApiPremium.d.ts +3 -2
- package/esm/models/gridChartsIntegration.d.ts +17 -0
- package/esm/models/gridChartsIntegration.js +1 -0
- package/esm/models/gridPremiumIconSlotsComponent.d.ts +55 -0
- package/esm/models/gridPremiumSlotProps.d.ts +8 -0
- package/esm/models/gridPremiumSlotProps.js +1 -0
- package/esm/models/gridPremiumSlotsComponent.d.ts +6 -0
- package/esm/models/gridStatePremium.d.ts +5 -2
- package/esm/typeOverloads/modules.d.ts +20 -0
- package/hooks/features/aggregation/createAggregationLookup.js +5 -3
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +1 -0
- package/hooks/features/aggregation/gridAggregationSelectors.js +3 -0
- package/hooks/features/aggregation/useGridAggregation.js +12 -0
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -1
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -44
- package/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.d.ts +65 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js +5 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +17 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +30 -0
- package/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +8 -0
- package/hooks/features/chartsIntegration/useGridChartsIntegration.js +537 -0
- package/hooks/features/chartsIntegration/utils.d.ts +5 -0
- package/hooks/features/chartsIntegration/utils.js +40 -0
- package/hooks/features/pivoting/useGridPivoting.js +1 -1
- package/hooks/features/pivoting/utils.js +9 -7
- package/hooks/features/rowGrouping/createGroupingColDef.js +3 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -2
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -0
- package/hooks/features/sidebar/gridSidebarInterfaces.d.ts +1 -0
- package/hooks/features/sidebar/gridSidebarInterfaces.js +1 -0
- package/hooks/utils/index.d.ts +2 -1
- package/hooks/utils/index.js +11 -0
- package/hooks/utils/useGridChartIntegration.d.ts +2 -0
- package/hooks/utils/useGridChartIntegration.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/material/icons.d.ts +4 -1
- package/material/icons.js +16 -2
- package/material/index.d.ts +11 -0
- package/material/index.js +12 -1
- package/models/dataGridPremiumProps.d.ts +22 -1
- package/models/gridApiPremium.d.ts +3 -2
- package/models/gridChartsIntegration.d.ts +17 -0
- package/models/gridChartsIntegration.js +5 -0
- package/models/gridPremiumIconSlotsComponent.d.ts +55 -0
- package/models/gridPremiumSlotProps.d.ts +8 -0
- package/models/gridPremiumSlotProps.js +5 -0
- package/models/gridPremiumSlotsComponent.d.ts +6 -0
- package/models/gridStatePremium.d.ts +5 -2
- package/package.json +5 -5
- package/typeOverloads/modules.d.ts +20 -0
- /package/components/{GridColumnMenuAggregationItem.d.ts → columnMenu/menuItems/GridColumnMenuAggregationItem.d.ts} +0 -0
- /package/components/{GridColumnMenuRowGroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowGroupItem.d.ts} +0 -0
- /package/components/{GridColumnMenuRowUngroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowUngroupItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuAggregationItem.d.ts → columnMenu/menuItems/GridColumnMenuAggregationItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuRowGroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowGroupItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuRowUngroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowUngroupItem.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { isLeaf, gridStringOrNumberComparator } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { getDefaultColTypeDef } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { COLUMN_GROUP_ID_SEPARATOR } from "../../../constants/columnGroups.js";
|
|
4
5
|
import { isGroupingColumn } from "../rowGrouping/index.js";
|
|
5
6
|
import { defaultGetAggregationPosition } from "../aggregation/gridAggregationUtils.js";
|
|
6
|
-
const columnGroupIdSeparator = '>->';
|
|
7
7
|
export const isPivotingAvailable = props => {
|
|
8
8
|
return !props.disablePivoting;
|
|
9
9
|
};
|
|
@@ -152,7 +152,7 @@ export const getPivotedData = ({
|
|
|
152
152
|
}
|
|
153
153
|
const formattedHeaderName = apiRef.current.getRowFormattedValue(row, column) || colValue;
|
|
154
154
|
columnGroupPath.push(colValue);
|
|
155
|
-
const groupId = columnGroupPath.join(
|
|
155
|
+
const groupId = columnGroupPath.join(COLUMN_GROUP_ID_SEPARATOR);
|
|
156
156
|
if (!columnGroupingModelLookup.has(groupId)) {
|
|
157
157
|
const columnGroup = {
|
|
158
158
|
groupId,
|
|
@@ -164,7 +164,7 @@ export const getPivotedData = ({
|
|
|
164
164
|
if (depth === 0) {
|
|
165
165
|
columnGroupingModel.push(columnGroup);
|
|
166
166
|
} else {
|
|
167
|
-
const parentGroupId = columnGroupPath.slice(0, -1).join(
|
|
167
|
+
const parentGroupId = columnGroupPath.slice(0, -1).join(COLUMN_GROUP_ID_SEPARATOR);
|
|
168
168
|
const parentGroup = columnGroupingModelLookup.get(parentGroupId);
|
|
169
169
|
if (parentGroup) {
|
|
170
170
|
parentGroup.children.push(columnGroup);
|
|
@@ -179,7 +179,7 @@ export const getPivotedData = ({
|
|
|
179
179
|
if (!originalColumn) {
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
const valueKey = `${columnGroupPath.join(
|
|
182
|
+
const valueKey = `${columnGroupPath.join(COLUMN_GROUP_ID_SEPARATOR)}${COLUMN_GROUP_ID_SEPARATOR}${valueField}`;
|
|
183
183
|
newRow[valueKey] = apiRef.current.getRowValue(row, originalColumn);
|
|
184
184
|
});
|
|
185
185
|
}
|
|
@@ -199,7 +199,7 @@ export const getPivotedData = ({
|
|
|
199
199
|
if (visibleValues.length === 0) {
|
|
200
200
|
// If there are no visible values, there are no actual columns added to the data grid, which leads to column groups not being visible.
|
|
201
201
|
// Adding an empty column to each column group ensures that the column groups are visible.
|
|
202
|
-
const emptyColumnField = `${columnGroup.groupId}${
|
|
202
|
+
const emptyColumnField = `${columnGroup.groupId}${COLUMN_GROUP_ID_SEPARATOR}empty`;
|
|
203
203
|
const emptyColumn = {
|
|
204
204
|
field: emptyColumnField,
|
|
205
205
|
headerName: '',
|
|
@@ -219,11 +219,13 @@ export const getPivotedData = ({
|
|
|
219
219
|
} else {
|
|
220
220
|
visibleValues.forEach(pivotValue => {
|
|
221
221
|
const valueField = pivotValue.field;
|
|
222
|
-
const mapValueKey = `${columnGroup.groupId}${
|
|
223
|
-
const overrides = typeof pivotingColDef === 'function' ? pivotingColDef(valueField, columnGroup.groupId.split(
|
|
222
|
+
const mapValueKey = `${columnGroup.groupId}${COLUMN_GROUP_ID_SEPARATOR}${valueField}`;
|
|
223
|
+
const overrides = typeof pivotingColDef === 'function' ? pivotingColDef(valueField, columnGroup.groupId.split(COLUMN_GROUP_ID_SEPARATOR)) : pivotingColDef;
|
|
224
224
|
const column = _extends({
|
|
225
225
|
headerName: String(valueField)
|
|
226
226
|
}, getAttributesFromInitialColumn(pivotValue.field), overrides, {
|
|
227
|
+
// pivoting values are always numbers
|
|
228
|
+
type: 'number',
|
|
227
229
|
field: mapValueKey,
|
|
228
230
|
aggregable: false,
|
|
229
231
|
groupable: false,
|
|
@@ -14,7 +14,9 @@ import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector
|
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const GROUPING_COL_DEF_DEFAULT_PROPERTIES = _extends({}, GRID_STRING_COL_DEF, {
|
|
16
16
|
type: 'custom',
|
|
17
|
-
disableReorder: true
|
|
17
|
+
disableReorder: true,
|
|
18
|
+
chartable: false,
|
|
19
|
+
aggregable: false
|
|
18
20
|
});
|
|
19
21
|
const GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT = {
|
|
20
22
|
editable: false,
|
|
@@ -11,6 +11,7 @@ interface FilterRowTreeFromTreeDataParams {
|
|
|
11
11
|
rowTree: GridRowTreeConfig;
|
|
12
12
|
isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
|
|
13
13
|
filterModel: GridFilterModel;
|
|
14
|
+
filterValueGetter: (row: GridRowModel, column: GridColDef) => any;
|
|
14
15
|
apiRef: RefObject<GridPrivateApiPremium>;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -30,7 +30,8 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
30
30
|
apiRef,
|
|
31
31
|
rowTree,
|
|
32
32
|
isRowMatchingFilters,
|
|
33
|
-
filterModel
|
|
33
|
+
filterModel,
|
|
34
|
+
filterValueGetter
|
|
34
35
|
} = params;
|
|
35
36
|
const filteredRowsLookup = {};
|
|
36
37
|
const filteredChildrenCountLookup = {};
|
|
@@ -67,7 +68,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
67
68
|
isPassingFiltering = filteredDescendantCount > 0;
|
|
68
69
|
} else {
|
|
69
70
|
const allResults = [...ancestorsResults, filterResults];
|
|
70
|
-
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef, filterCache);
|
|
71
|
+
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, filterValueGetter, params.apiRef, filterCache);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
if (!isPassingFiltering) {
|
|
@@ -126,6 +126,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
126
126
|
rowTree,
|
|
127
127
|
isRowMatchingFilters: params.isRowMatchingFilters,
|
|
128
128
|
filterModel: params.filterModel,
|
|
129
|
+
filterValueGetter: params.filterValueGetter,
|
|
129
130
|
apiRef
|
|
130
131
|
});
|
|
131
132
|
}, [apiRef]);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./useKeepGroupedColumnsHidden.js";
|
|
1
|
+
export * from "./useKeepGroupedColumnsHidden.js";
|
|
2
|
+
export * from "./useGridChartIntegration.js";
|
package/esm/hooks/utils/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./useKeepGroupedColumnsHidden.js";
|
|
1
|
+
export * from "./useKeepGroupedColumnsHidden.js";
|
|
2
|
+
export * from "./useGridChartIntegration.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridChartsIntegrationContext } from "../../components/chartsIntegration/GridChartsIntegrationContext.js";
|
|
3
|
+
export const useGridChartsIntegrationContext = (ignoreError = false) => {
|
|
4
|
+
const context = React.useContext(GridChartsIntegrationContext);
|
|
5
|
+
if (!context && !ignoreError) {
|
|
6
|
+
throw new Error(['MUI X: Could not find the Data Grid charts integration context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the Data Grid.'].join('\n'));
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
package/esm/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./DataGridPremium/index.js";
|
|
|
14
14
|
export * from "./hooks/index.js";
|
|
15
15
|
export * from "./models/index.js";
|
|
16
16
|
export * from "./components/index.js";
|
|
17
|
+
export * from "./context/index.js";
|
|
17
18
|
export { GridColumnHeaders } from '@mui/x-data-grid-pro';
|
|
18
19
|
export type { GridColumnHeadersProps } from '@mui/x-data-grid-pro';
|
|
19
20
|
export type { DataGridPremiumProps, GridExperimentalPremiumFeatures } from "./models/dataGridPremiumProps.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-data-grid-premium v8.
|
|
2
|
+
* @mui/x-data-grid-premium v8.12.1
|
|
3
3
|
*
|
|
4
4
|
* @license SEE LICENSE IN LICENSE
|
|
5
5
|
* This source code is licensed under the SEE LICENSE IN LICENSE license found in the
|
|
@@ -21,6 +21,7 @@ export * from "./DataGridPremium/index.js";
|
|
|
21
21
|
export * from "./hooks/index.js";
|
|
22
22
|
export * from "./models/index.js";
|
|
23
23
|
export * from "./components/index.js";
|
|
24
|
+
export * from "./context/index.js";
|
|
24
25
|
export { GridColumnHeaders } from '@mui/x-data-grid-pro';
|
|
25
26
|
export { useGridApiContext, useGridApiRef, useGridRootProps } from "./typeOverloads/reexports.js";
|
|
26
27
|
export { GridColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from "./components/reexports.js";
|
package/esm/material/icons.d.ts
CHANGED
|
@@ -12,4 +12,7 @@ export declare const GridPivotIcon: (props: import("@mui/x-data-grid").GridBaseI
|
|
|
12
12
|
export declare const GridAssistantIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
13
13
|
export declare const GridPromptIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
14
14
|
export declare const GridRerunIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
15
|
-
export declare const GridHistoryIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
15
|
+
export declare const GridHistoryIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
16
|
+
export declare const GridChartsIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
17
|
+
export declare const GridSyncIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
18
|
+
export declare const GridSyncDisabledIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
package/esm/material/icons.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createSvgIcon } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
export const GridWorkspacesIcon = createSvgIcon(/*#__PURE__*/_jsx("g", {
|
|
5
5
|
children: /*#__PURE__*/_jsx("path", {
|
|
6
6
|
d: "M6,13c-2.2,0-4,1.8-4,4s1.8,4,4,4s4-1.8,4-4S8.2,13,6,13z M12,3C9.8,3,8,4.8,8,7s1.8,4,4,4s4-1.8,4-4S14.2,3,12,3z M18,13 c-2.2,0-4,1.8-4,4s1.8,4,4,4s4-1.8,4-4S20.2,13,18,13z"
|
|
@@ -44,4 +44,18 @@ export const GridRerunIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
|
|
|
44
44
|
}), 'Rerun');
|
|
45
45
|
export const GridHistoryIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
|
|
46
46
|
d: "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"
|
|
47
|
-
}), 'History');
|
|
47
|
+
}), 'History');
|
|
48
|
+
export const GridChartsIcon = createSvgIcon(/*#__PURE__*/_jsxs("g", {
|
|
49
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
50
|
+
d: "M0 0h24v24H0z",
|
|
51
|
+
fill: "none"
|
|
52
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
53
|
+
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"
|
|
54
|
+
})]
|
|
55
|
+
}), 'Charts');
|
|
56
|
+
export const GridSyncIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
|
|
57
|
+
d: "M10 4.26v2.09C7.67 7.18 6 9.39 6 12c0 1.77.78 3.34 2 4.44V14h2v6H4v-2h2.73C5.06 16.54 4 14.4 4 12c0-3.73 2.55-6.85 6-7.74M20 4h-6v6h2V7.56c1.22 1.1 2 2.67 2 4.44h2c0-2.4-1.06-4.54-2.73-6H20zm0 13v-1c0-1.1-.9-2-2-2s-2 .9-2 2v1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1m-1 0h-2v-1c0-.55.45-1 1-1s1 .45 1 1z"
|
|
58
|
+
}), 'Sync');
|
|
59
|
+
export const GridSyncDisabledIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
|
|
60
|
+
d: "M10 6.35V4.26c-.8.21-1.55.54-2.23.96l1.46 1.46c.25-.12.5-.24.77-.33m-7.14-.94 2.36 2.36C4.45 8.99 4 10.44 4 12c0 2.21.91 4.2 2.36 5.64L4 20h6v-6l-2.24 2.24C6.68 15.15 6 13.66 6 12c0-1 .25-1.94.68-2.77l8.08 8.08c-.25.13-.5.25-.77.34v2.09c.8-.21 1.55-.54 2.23-.96l2.36 2.36 1.27-1.27L4.14 4.14zM20 4h-6v6l2.24-2.24C17.32 8.85 18 10.34 18 12c0 1-.25 1.94-.68 2.77l1.46 1.46C19.55 15.01 20 13.56 20 12c0-2.21-.91-4.2-2.36-5.64z"
|
|
61
|
+
}), 'SyncDisabled');
|
package/esm/material/index.d.ts
CHANGED
|
@@ -30,5 +30,16 @@ declare const materialSlots: {
|
|
|
30
30
|
promptPivotIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
31
31
|
promptAggregationIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
32
32
|
promptChangesToggleIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
33
|
+
chartsIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
34
|
+
chartsSearchIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
35
|
+
chartsSearchClearIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
36
|
+
chartsMenuMoveUpIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
37
|
+
chartsMenuMoveDownIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
38
|
+
chartsMenuMoveToTopIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
39
|
+
chartsMenuMoveToBottomIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
40
|
+
chartsMenuAddIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
41
|
+
chartsMenuRemoveIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
42
|
+
chartsSyncIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
43
|
+
chartsSyncDisabledIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
33
44
|
};
|
|
34
45
|
export default materialSlots;
|
package/esm/material/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridSearchIcon, GridClearIcon, GridAddIcon, GridCheckIcon, GridExpandMoreIcon, GridDeleteIcon, GridCloseIcon } from '@mui/x-data-grid';
|
|
3
3
|
import { GridArrowDownwardIcon, GridArrowUpwardIcon, GridFilterAltIcon } from '@mui/x-data-grid-pro';
|
|
4
|
-
import { GridWorkspacesIcon, GridGroupWorkIcon, GridFunctionsIcon, GridMoveToTopIcon, GridMoveToBottomIcon, GridExpandLessIcon, GridPivotIcon, GridSendIcon, GridMicIcon, GridMicOffIcon, GridAssistantIcon, GridPromptIcon, GridRerunIcon, GridHistoryIcon } from "./icons.js";
|
|
4
|
+
import { GridWorkspacesIcon, GridGroupWorkIcon, GridFunctionsIcon, GridMoveToTopIcon, GridMoveToBottomIcon, GridExpandLessIcon, GridPivotIcon, GridSendIcon, GridMicIcon, GridMicOffIcon, GridAssistantIcon, GridPromptIcon, GridRerunIcon, GridHistoryIcon, GridChartsIcon, GridSyncDisabledIcon, GridSyncIcon } from "./icons.js";
|
|
5
5
|
const iconsSlots = {
|
|
6
6
|
collapsibleIcon: GridExpandMoreIcon,
|
|
7
7
|
columnMenuUngroupIcon: GridWorkspacesIcon,
|
|
@@ -33,7 +33,18 @@ const iconsSlots = {
|
|
|
33
33
|
promptPivotIcon: GridPivotIcon,
|
|
34
34
|
promptAggregationIcon: GridFunctionsIcon,
|
|
35
35
|
promptGroupIcon: GridGroupWorkIcon,
|
|
36
|
-
promptChangesToggleIcon: GridExpandMoreIcon
|
|
36
|
+
promptChangesToggleIcon: GridExpandMoreIcon,
|
|
37
|
+
chartsIcon: GridChartsIcon,
|
|
38
|
+
chartsSearchIcon: GridSearchIcon,
|
|
39
|
+
chartsSearchClearIcon: GridClearIcon,
|
|
40
|
+
chartsMenuMoveUpIcon: GridExpandLessIcon,
|
|
41
|
+
chartsMenuMoveDownIcon: GridExpandMoreIcon,
|
|
42
|
+
chartsMenuMoveToTopIcon: GridMoveToTopIcon,
|
|
43
|
+
chartsMenuMoveToBottomIcon: GridMoveToBottomIcon,
|
|
44
|
+
chartsMenuAddIcon: GridAddIcon,
|
|
45
|
+
chartsMenuRemoveIcon: GridDeleteIcon,
|
|
46
|
+
chartsSyncIcon: GridSyncIcon,
|
|
47
|
+
chartsSyncDisabledIcon: GridSyncDisabledIcon
|
|
37
48
|
};
|
|
38
49
|
const materialSlots = _extends({}, iconsSlots);
|
|
39
50
|
export default materialSlots;
|
|
@@ -4,13 +4,16 @@ import { GridExperimentalProFeatures, DataGridProPropsWithDefaultValue, DataGrid
|
|
|
4
4
|
import type { GridRowGroupingModel } from "../hooks/features/rowGrouping/index.js";
|
|
5
5
|
import type { GridAggregationModel, GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationPosition } from "../hooks/features/aggregation/index.js";
|
|
6
6
|
import { GridPremiumSlotsComponent } from "./gridPremiumSlotsComponent.js";
|
|
7
|
+
import { GridPremiumSlotProps } from "./gridPremiumSlotProps.js";
|
|
7
8
|
import { GridInitialStatePremium } from "./gridStatePremium.js";
|
|
8
9
|
import { GridApiPremium } from "./gridApiPremium.js";
|
|
9
10
|
import { GridCellSelectionModel } from "../hooks/features/cellSelection/index.js";
|
|
10
11
|
import type { GridPivotingColDefOverrides, GridPivotModel } from "../hooks/features/pivoting/gridPivotingInterfaces.js";
|
|
11
12
|
import { GridDataSourcePremium as GridDataSource, GridGetRowsParamsPremium as GridGetRowsParams } from "../hooks/features/dataSource/models.js";
|
|
12
13
|
import { Conversation, PromptResponse, PromptSuggestion } from "../hooks/features/aiAssistant/gridAiAssistantInterfaces.js";
|
|
13
|
-
export interface GridExperimentalPremiumFeatures extends GridExperimentalProFeatures {
|
|
14
|
+
export interface GridExperimentalPremiumFeatures extends GridExperimentalProFeatures {
|
|
15
|
+
charts?: boolean;
|
|
16
|
+
}
|
|
14
17
|
export interface DataGridPremiumPropsWithComplexDefaultValueBeforeProcessing extends Pick<DataGridPropsWithComplexDefaultValueBeforeProcessing, 'localeText'> {
|
|
15
18
|
/**
|
|
16
19
|
* Overridable components.
|
|
@@ -102,6 +105,11 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
|
|
|
102
105
|
* @default false
|
|
103
106
|
*/
|
|
104
107
|
aiAssistant: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* If `true`, the charts integration feature is enabled.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
chartsIntegration: boolean;
|
|
105
113
|
}
|
|
106
114
|
export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridProPropsWithoutDefaultValue<R>, 'initialState' | 'apiRef' | 'dataSource' | 'onDataSourceError'> {
|
|
107
115
|
/**
|
|
@@ -114,6 +122,10 @@ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowM
|
|
|
114
122
|
* If one of the data in `initialState` is also being controlled, then the control state wins.
|
|
115
123
|
*/
|
|
116
124
|
initialState?: GridInitialStatePremium;
|
|
125
|
+
/**
|
|
126
|
+
* Overridable components props dynamically passed to the component at rendering.
|
|
127
|
+
*/
|
|
128
|
+
slotProps?: GridPremiumSlotProps;
|
|
117
129
|
/**
|
|
118
130
|
* Set the row grouping model of the grid.
|
|
119
131
|
*/
|
|
@@ -270,4 +282,13 @@ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowM
|
|
|
270
282
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
271
283
|
*/
|
|
272
284
|
onSidebarOpen?: GridEventListener<'sidebarOpen'>;
|
|
285
|
+
/**
|
|
286
|
+
* The id of the active chart.
|
|
287
|
+
*/
|
|
288
|
+
activeChartId?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Callback fired when the active chart changes.
|
|
291
|
+
* @param {string} activeChartId The new active chart id.
|
|
292
|
+
*/
|
|
293
|
+
onActiveChartIdChange?: (activeChartId: string) => void;
|
|
273
294
|
}
|
|
@@ -10,9 +10,10 @@ import type { GridAggregationPrivateApi } from "../hooks/features/aggregation/gr
|
|
|
10
10
|
import type { GridPivotingApi, GridPivotingPrivateApi } from "../hooks/features/pivoting/gridPivotingInterfaces.js";
|
|
11
11
|
import { GridAiAssistantApi } from "../hooks/features/aiAssistant/gridAiAssistantInterfaces.js";
|
|
12
12
|
import { GridSidebarApi } from "../hooks/features/sidebar/gridSidebarInterfaces.js";
|
|
13
|
+
import { GridChartsIntegrationApi, GridChartsIntegrationPrivateApi } from "../hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js";
|
|
13
14
|
/**
|
|
14
15
|
* The api of Data Grid Premium.
|
|
15
16
|
* TODO: Do not redefine manually the pro features
|
|
16
17
|
*/
|
|
17
|
-
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi, GridDetailPanelApi, GridRowGroupingApi, GridExcelExportApi, GridAggregationApi, GridRowPinningApi, GridDataSourceApiPremium, GridCellSelectionApi, GridPivotingApi, GridAiAssistantApi, GridSidebarApi, GridRowMultiSelectionApi, GridColumnReorderApi {}
|
|
18
|
-
export interface GridPrivateApiPremium extends GridApiPremium, GridPrivateOnlyApiCommon<GridApiPremium, GridPrivateApiPremium, DataGridPremiumProcessedProps>, GridDataSourcePremiumPrivateApi, GridAggregationPrivateApi, GridDetailPanelPrivateApi, GridRowReorderPrivateApi, GridPivotingPrivateApi {}
|
|
18
|
+
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi, GridDetailPanelApi, GridRowGroupingApi, GridExcelExportApi, GridAggregationApi, GridRowPinningApi, GridDataSourceApiPremium, GridCellSelectionApi, GridPivotingApi, GridAiAssistantApi, GridSidebarApi, GridChartsIntegrationApi, GridRowMultiSelectionApi, GridColumnReorderApi {}
|
|
19
|
+
export interface GridPrivateApiPremium extends GridApiPremium, GridPrivateOnlyApiCommon<GridApiPremium, GridPrivateApiPremium, DataGridPremiumProcessedProps>, GridDataSourcePremiumPrivateApi, GridAggregationPrivateApi, GridDetailPanelPrivateApi, GridRowReorderPrivateApi, GridPivotingPrivateApi, GridChartsIntegrationPrivateApi {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Dataset } from '@mui/x-internals/types';
|
|
2
|
+
export type ChartState = {
|
|
3
|
+
label?: string;
|
|
4
|
+
synced: boolean;
|
|
5
|
+
dimensions: Dataset<string | number | null>;
|
|
6
|
+
values: Dataset<number | null>;
|
|
7
|
+
type: string;
|
|
8
|
+
configuration: Record<string, string | number | boolean | null>;
|
|
9
|
+
dimensionsLabel?: string;
|
|
10
|
+
valuesLabel?: string;
|
|
11
|
+
maxDimensions?: number;
|
|
12
|
+
maxValues?: number;
|
|
13
|
+
};
|
|
14
|
+
export interface GridChartsIntegrationContextValue {
|
|
15
|
+
chartStateLookup: Record<string, ChartState>;
|
|
16
|
+
setChartState: (id: string, state: Partial<ChartState>) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -157,5 +157,60 @@ export interface GridPremiumIconSlotsComponent {
|
|
|
157
157
|
* @default GridExpandMoreIcon
|
|
158
158
|
*/
|
|
159
159
|
promptChangesToggleIcon: React.JSXElementConstructor<IconProps>;
|
|
160
|
+
/**
|
|
161
|
+
* Icon used for the charts configuration button
|
|
162
|
+
* @default GridChartsIcon
|
|
163
|
+
*/
|
|
164
|
+
chartsIcon: React.JSXElementConstructor<IconProps>;
|
|
165
|
+
/**
|
|
166
|
+
* Icon used for the search icon in the sidebar search field in the charts configuration panel
|
|
167
|
+
* @default GridSearchIcon
|
|
168
|
+
*/
|
|
169
|
+
chartsSearchIcon: React.JSXElementConstructor<IconProps>;
|
|
170
|
+
/**
|
|
171
|
+
* Icon used for the clear button in the sidebar search field in the charts configuration panel
|
|
172
|
+
* @default GridClearIcon
|
|
173
|
+
*/
|
|
174
|
+
chartsSearchClearIcon: React.JSXElementConstructor<IconProps>;
|
|
175
|
+
/**
|
|
176
|
+
* Icon used for the move up button in the charts configuration panel menu
|
|
177
|
+
* @default GridExpandLessIcon
|
|
178
|
+
*/
|
|
179
|
+
chartsMenuMoveUpIcon: React.JSXElementConstructor<IconProps>;
|
|
180
|
+
/**
|
|
181
|
+
* Icon used for the move down button in the charts configuration panel menu
|
|
182
|
+
* @default GridExpandMoreIcon
|
|
183
|
+
*/
|
|
184
|
+
chartsMenuMoveDownIcon: React.JSXElementConstructor<IconProps>;
|
|
185
|
+
/**
|
|
186
|
+
* Icon used for the move to top button in the charts configuration panel menu
|
|
187
|
+
* @default GridMoveToTopIcon
|
|
188
|
+
*/
|
|
189
|
+
chartsMenuMoveToTopIcon: React.JSXElementConstructor<IconProps>;
|
|
190
|
+
/**
|
|
191
|
+
* Icon used for the move to bottom button in the charts configuration panel menu
|
|
192
|
+
* @default GridMoveToBottomIcon
|
|
193
|
+
*/
|
|
194
|
+
chartsMenuMoveToBottomIcon: React.JSXElementConstructor<IconProps>;
|
|
195
|
+
/**
|
|
196
|
+
* Icon used for the add button in the charts configuration panel menu
|
|
197
|
+
* @default GridAddIcon
|
|
198
|
+
*/
|
|
199
|
+
chartsMenuAddIcon: React.JSXElementConstructor<IconProps>;
|
|
200
|
+
/**
|
|
201
|
+
* Icon used for the remove button in the charts configuration panel menu
|
|
202
|
+
* @default GridDeleteIcon
|
|
203
|
+
*/
|
|
204
|
+
chartsMenuRemoveIcon: React.JSXElementConstructor<IconProps>;
|
|
205
|
+
/**
|
|
206
|
+
* Icon used for the sync button in the charts configuration panel when sync is enabled
|
|
207
|
+
* @default GridSyncIcon
|
|
208
|
+
*/
|
|
209
|
+
chartsSyncIcon: React.JSXElementConstructor<IconProps>;
|
|
210
|
+
/**
|
|
211
|
+
* Icon used for the sync button in the charts configuration panel when sync is disabled
|
|
212
|
+
* @default GridSyncDisabledIcon
|
|
213
|
+
*/
|
|
214
|
+
chartsSyncDisabledIcon: React.JSXElementConstructor<IconProps>;
|
|
160
215
|
}
|
|
161
216
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridProSlotProps } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import type { GridChartsPanelProps } from "../components/chartsPanel/GridChartsPanel.js";
|
|
3
|
+
export interface GridChartsPanelPropsOverrides {}
|
|
4
|
+
type SlotProps<Props, Overrides> = Partial<Props & Overrides>;
|
|
5
|
+
export interface GridPremiumSlotProps extends GridProSlotProps {
|
|
6
|
+
chartsPanel?: SlotProps<GridChartsPanelProps, GridChartsPanelPropsOverrides>;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,12 @@ export interface GridPremiumSlotsComponent extends GridProSlotsComponent, GridPr
|
|
|
11
11
|
* @default null
|
|
12
12
|
*/
|
|
13
13
|
aiAssistantPanel: React.JSXElementConstructor<any> | null;
|
|
14
|
+
/**
|
|
15
|
+
* Component rendered when charts panel is open. Only needed when `chartsIntegration` prop is passed to the grid.
|
|
16
|
+
* Pass `GridChartsPanel` to render the default charts panel.
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
chartsPanel: React.JSXElementConstructor<any> | null;
|
|
14
20
|
/**
|
|
15
21
|
* Component rendered when pivot mode is enabled but no rows are defined.
|
|
16
22
|
* @default GridEmptyPivotOverlay
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GridInitialState as GridInitialStatePro, GridState as GridStatePro } from '@mui/x-data-grid-pro';
|
|
2
2
|
import type { GridRowGroupingState, GridRowGroupingInitialState, GridAggregationState, GridAggregationInitialState, GridCellSelectionModel } from "../hooks/index.js";
|
|
3
3
|
import type { GridPivotingInitialState, GridPivotingState } from "../hooks/features/pivoting/gridPivotingInterfaces.js";
|
|
4
|
-
import { GridAiAssistantInitialState, GridAiAssistantState } from "../hooks/features/aiAssistant/gridAiAssistantInterfaces.js";
|
|
5
|
-
import { GridSidebarInitialState, GridSidebarState } from "../hooks/features/sidebar/gridSidebarState.js";
|
|
4
|
+
import type { GridAiAssistantInitialState, GridAiAssistantState } from "../hooks/features/aiAssistant/gridAiAssistantInterfaces.js";
|
|
5
|
+
import type { GridSidebarInitialState, GridSidebarState } from "../hooks/features/sidebar/gridSidebarState.js";
|
|
6
|
+
import type { GridChartsIntegrationState, GridChartsIntegrationInitialState } from "../hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js";
|
|
6
7
|
/**
|
|
7
8
|
* The state of Data Grid Premium.
|
|
8
9
|
*/
|
|
@@ -13,6 +14,7 @@ export interface GridStatePremium extends GridStatePro {
|
|
|
13
14
|
pivoting: GridPivotingState;
|
|
14
15
|
aiAssistant: GridAiAssistantState;
|
|
15
16
|
sidebar: GridSidebarState;
|
|
17
|
+
chartsIntegration: GridChartsIntegrationState;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* The initial state of Data Grid Premium.
|
|
@@ -24,4 +26,5 @@ export interface GridInitialStatePremium extends GridInitialStatePro {
|
|
|
24
26
|
pivoting?: GridPivotingInitialState;
|
|
25
27
|
aiAssistant?: GridAiAssistantInitialState;
|
|
26
28
|
sidebar?: GridSidebarInitialState;
|
|
29
|
+
chartsIntegration?: GridChartsIntegrationInitialState;
|
|
27
30
|
}
|
|
@@ -59,6 +59,12 @@ export interface GridControlledStateEventLookupPremium {
|
|
|
59
59
|
aiAssistantActiveConversationIndexChange: {
|
|
60
60
|
params: number;
|
|
61
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Fired when the active chart id changes.
|
|
64
|
+
*/
|
|
65
|
+
activeChartIdChange: {
|
|
66
|
+
params: string;
|
|
67
|
+
};
|
|
62
68
|
}
|
|
63
69
|
interface GridEventLookupPremium extends GridEventLookupPro {
|
|
64
70
|
/**
|
|
@@ -89,6 +95,15 @@ interface GridEventLookupPremium extends GridEventLookupPro {
|
|
|
89
95
|
value: GridSidebarValue;
|
|
90
96
|
};
|
|
91
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Fired when the chart synchronization state changes.
|
|
100
|
+
*/
|
|
101
|
+
chartSynchronizationStateChange: {
|
|
102
|
+
params: {
|
|
103
|
+
chartId: string;
|
|
104
|
+
synced: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
92
107
|
}
|
|
93
108
|
export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F = V> {
|
|
94
109
|
/**
|
|
@@ -123,6 +138,11 @@ export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F
|
|
|
123
138
|
* @default true
|
|
124
139
|
*/
|
|
125
140
|
pivotable?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* If `false`, the column will not be available for charts integration.
|
|
143
|
+
* @default true
|
|
144
|
+
*/
|
|
145
|
+
chartable?: boolean;
|
|
126
146
|
}
|
|
127
147
|
export interface GridRenderCellParamsPremium<R extends GridValidRowModel = any, V = any, F = V> {
|
|
128
148
|
aggregation?: GridAggregationCellMeta;
|
|
@@ -10,7 +10,7 @@ const shouldApplySorting = (aggregationRules, aggregatedFields) => {
|
|
|
10
10
|
return aggregatedFields.some(field => aggregationRules[field].aggregationFunction.applySorting);
|
|
11
11
|
};
|
|
12
12
|
exports.shouldApplySorting = shouldApplySorting;
|
|
13
|
-
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, publicApi, groupAggregatedValuesLookup) => {
|
|
13
|
+
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, publicApi, groupAggregatedValuesLookup, columnsLookup) => {
|
|
14
14
|
const groupAggregationLookup = {};
|
|
15
15
|
const aggregatedValues = [];
|
|
16
16
|
for (let i = 0; i < aggregatedFields.length; i += 1) {
|
|
@@ -80,12 +80,14 @@ const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregat
|
|
|
80
80
|
groupId,
|
|
81
81
|
field: aggregatedField // Added per user request in https://github.com/mui/mui-x/issues/6995#issuecomment-1327423455
|
|
82
82
|
}, publicApi);
|
|
83
|
+
const formattedValue = aggregationFunction.valueFormatter ? aggregationFunction.valueFormatter(value, rowLookup[groupId], columnsLookup[aggregatedField], apiRef) : undefined;
|
|
83
84
|
|
|
84
85
|
// Only add to groupAggregationLookup if position is not null
|
|
85
86
|
if (position !== null) {
|
|
86
87
|
groupAggregationLookup[aggregatedField] = {
|
|
87
88
|
position,
|
|
88
|
-
value
|
|
89
|
+
value,
|
|
90
|
+
formattedValue
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -149,7 +151,7 @@ const createAggregationLookup = ({
|
|
|
149
151
|
aggregationLookup[groupNode.id] = getGroupAggregatedValueDataSource(groupNode.id, apiRef, aggregatedFields, position);
|
|
150
152
|
}
|
|
151
153
|
} else if (groupNode.children.length) {
|
|
152
|
-
const result = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, apiRef.current, groupAggregatedValuesLookup);
|
|
154
|
+
const result = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, apiRef.current, groupAggregatedValuesLookup, columnsLookup);
|
|
153
155
|
// Always populate groupAggregatedValuesLookup for groups with children
|
|
154
156
|
// This ensures parent groups can access child aggregated values even when position is null
|
|
155
157
|
groupAggregatedValuesLookup.set(groupNode.id, result.aggregatedValues);
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.useGridAggregation = exports.aggregationStateInitializer = void 0;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _isObjectEmpty = require("@mui/x-internals/isObjectEmpty");
|
|
12
13
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
13
14
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
14
15
|
var _gridAggregationSelectors = require("./gridAggregationSelectors");
|
|
@@ -54,6 +55,7 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
54
55
|
abortControllerRef.current = abortController;
|
|
55
56
|
const aggregationRules = (0, _gridAggregationUtils.getAggregationRules)((0, _xDataGridPro.gridColumnLookupSelector)(apiRef), (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef), props.aggregationFunctions, !!props.dataSource);
|
|
56
57
|
const aggregatedFields = Object.keys(aggregationRules);
|
|
58
|
+
const currentAggregationLookup = (0, _gridAggregationSelectors.gridAggregationLookupSelector)(apiRef);
|
|
57
59
|
const needsSorting = (0, _createAggregationLookup.shouldApplySorting)(aggregationRules, aggregatedFields);
|
|
58
60
|
if (reason === 'sort' && !needsSorting) {
|
|
59
61
|
// no need to re-apply aggregation on `sortedRowsSet` if sorting is not needed
|
|
@@ -123,6 +125,16 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
123
125
|
}, 0);
|
|
124
126
|
};
|
|
125
127
|
processChunk();
|
|
128
|
+
|
|
129
|
+
// processChunk() does nothing if there are no aggregated fields
|
|
130
|
+
// make sure that the lookup is empty in this case
|
|
131
|
+
if (aggregatedFields.length === 0 && !(0, _isObjectEmpty.isObjectEmpty)(currentAggregationLookup)) {
|
|
132
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
133
|
+
aggregation: (0, _extends2.default)({}, state.aggregation, {
|
|
134
|
+
lookup: {}
|
|
135
|
+
})
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
126
138
|
}, [apiRef, props.getAggregationPosition, props.aggregationFunctions, props.aggregationRowsScope, props.dataSource]);
|
|
127
139
|
React.useEffect(() => {
|
|
128
140
|
return () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RefObject } from '@mui/x-internals/types';
|
|
3
3
|
import { GridColDef } from '@mui/x-data-grid-pro';
|
|
4
|
-
import {
|
|
4
|
+
import type { GridBaseColDef } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { GridApiPremium } from "../../../models/gridApiPremium.js";
|
|
6
6
|
import type { GridAggregationRule } from "./gridAggregationInterfaces.js";
|
|
7
7
|
/**
|
|
@@ -59,4 +59,5 @@ export declare const unwrapColumnFromAggregation: (column: GridColDef) => GridBa
|
|
|
59
59
|
groupingValueSetter?: import("../../../index.js").GridGroupingValueSetter<import("@mui/x-data-grid").GridValidRowModel> | undefined;
|
|
60
60
|
pastedValueParser?: import("../../../index.js").GridPastedValueParser<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
|
|
61
61
|
pivotable?: boolean;
|
|
62
|
+
chartable?: boolean;
|
|
62
63
|
};
|