@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
3
|
+
import { gridChartsPanelOpenSelector } from "../../../hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js";
|
|
4
|
+
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
5
|
+
import { useGridApiContext } from "../../../hooks/utils/useGridApiContext.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function GridColumnMenuChartsItem(props) {
|
|
8
|
+
const {
|
|
9
|
+
onClick
|
|
10
|
+
} = props;
|
|
11
|
+
const rootProps = useGridRootProps();
|
|
12
|
+
const apiRef = useGridApiContext();
|
|
13
|
+
const isChartsPanelOpen = useGridSelector(apiRef, gridChartsPanelOpenSelector);
|
|
14
|
+
const openChartsSettings = event => {
|
|
15
|
+
onClick(event);
|
|
16
|
+
apiRef.current.setChartsPanelOpen(true);
|
|
17
|
+
};
|
|
18
|
+
if (!rootProps.experimentalFeatures?.charts || !rootProps.chartsIntegration) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
22
|
+
onClick: openChartsSettings,
|
|
23
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.chartsIcon, {
|
|
24
|
+
fontSize: "small"
|
|
25
|
+
}),
|
|
26
|
+
disabled: isChartsPanelOpen,
|
|
27
|
+
children: apiRef.current.getLocaleText('columnMenuManageCharts')
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { GridColumnMenuPivotItem } from "./GridColumnMenuPivotItem.js";
|
|
4
|
+
import { GridColumnMenuChartsItem } from "./GridColumnMenuChartsItem.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
function GridColumnMenuManagePanelItem(props) {
|
|
7
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
8
|
+
children: [/*#__PURE__*/_jsx(GridColumnMenuPivotItem, _extends({}, props)), /*#__PURE__*/_jsx(GridColumnMenuChartsItem, _extends({}, props))]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export { GridColumnMenuManagePanelItem };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuItemProps } from '@mui/x-data-grid-pro';
|
|
3
|
-
export declare function GridColumnMenuPivotItem(props: GridColumnMenuItemProps): React.JSX.Element;
|
|
3
|
+
export declare function GridColumnMenuPivotItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { gridPivotPanelOpenSelector } from "
|
|
4
|
-
import { useGridRootProps } from "
|
|
5
|
-
import { useGridApiContext } from "
|
|
6
|
-
import { GridSidebarValue } from "
|
|
3
|
+
import { gridPivotPanelOpenSelector } from "../../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
4
|
+
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
5
|
+
import { useGridApiContext } from "../../../hooks/utils/useGridApiContext.js";
|
|
6
|
+
import { GridSidebarValue } from "../../../hooks/features/sidebar/index.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export function GridColumnMenuPivotItem(props) {
|
|
9
9
|
const {
|
|
@@ -16,6 +16,9 @@ export function GridColumnMenuPivotItem(props) {
|
|
|
16
16
|
onClick(event);
|
|
17
17
|
apiRef.current.showSidebar(GridSidebarValue.Pivot);
|
|
18
18
|
};
|
|
19
|
+
if (rootProps.disablePivoting) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
19
22
|
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
20
23
|
onClick: openPivotSettings,
|
|
21
24
|
iconStart: /*#__PURE__*/_jsx(rootProps.slots.pivotIcon, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useGridSelector, gridColumnLookupSelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { useGridApiContext } from "
|
|
4
|
-
import { gridRowGroupingSanitizedModelSelector } from "
|
|
5
|
-
import { getRowGroupingCriteriaFromGroupingField, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, isGroupingColumn } from "
|
|
6
|
-
import { useGridRootProps } from "
|
|
3
|
+
import { useGridApiContext } from "../../../hooks/utils/useGridApiContext.js";
|
|
4
|
+
import { gridRowGroupingSanitizedModelSelector } from "../../../hooks/features/rowGrouping/gridRowGroupingSelector.js";
|
|
5
|
+
import { getRowGroupingCriteriaFromGroupingField, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, isGroupingColumn } from "../../../hooks/features/rowGrouping/gridRowGroupingUtils.js";
|
|
6
|
+
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export function GridColumnMenuRowGroupItem(props) {
|
|
9
9
|
const {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { gridColumnLookupSelector, useGridSelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { useGridApiContext } from "
|
|
4
|
-
import { gridRowGroupingSanitizedModelSelector } from "
|
|
5
|
-
import { useGridRootProps } from "
|
|
3
|
+
import { useGridApiContext } from "../../../hooks/utils/useGridApiContext.js";
|
|
4
|
+
import { gridRowGroupingSanitizedModelSelector } from "../../../hooks/features/rowGrouping/gridRowGroupingSelector.js";
|
|
5
|
+
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export function GridColumnMenuRowUngroupItem(props) {
|
|
8
8
|
const {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export * from "./GridExcelExportMenuItem.js";
|
|
2
2
|
export * from "../material/icons.js";
|
|
3
|
-
export * from "./GridColumnMenuAggregationItem.js";
|
|
3
|
+
export * from "./columnMenu/menuItems/GridColumnMenuAggregationItem.js";
|
|
4
4
|
export * from "./promptField/index.js";
|
|
5
5
|
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
6
6
|
export * from "./export/index.js";
|
|
7
7
|
export * from "./GridEmptyPivotOverlay.js";
|
|
8
8
|
export * from "./pivotPanel/index.js";
|
|
9
|
-
export * from "./aiAssistantPanel/index.js";
|
|
9
|
+
export * from "./aiAssistantPanel/index.js";
|
|
10
|
+
export * from "./chartsPanel/index.js";
|
package/esm/components/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export * from "./GridExcelExportMenuItem.js";
|
|
2
2
|
export * from "../material/icons.js";
|
|
3
|
-
export * from "./GridColumnMenuAggregationItem.js";
|
|
3
|
+
export * from "./columnMenu/menuItems/GridColumnMenuAggregationItem.js";
|
|
4
4
|
export * from "./promptField/index.js";
|
|
5
5
|
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
6
6
|
export * from "./export/index.js";
|
|
7
7
|
export * from "./GridEmptyPivotOverlay.js";
|
|
8
8
|
export * from "./pivotPanel/index.js";
|
|
9
|
-
export * from "./aiAssistantPanel/index.js";
|
|
9
|
+
export * from "./aiAssistantPanel/index.js";
|
|
10
|
+
export * from "./chartsPanel/index.js";
|
|
@@ -8,7 +8,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
8
8
|
import { GridColumnSortButton, NotRendered, vars } from '@mui/x-data-grid-pro/internals';
|
|
9
9
|
import useId from '@mui/utils/useId';
|
|
10
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
11
|
-
import { getAvailableAggregationFunctions } from "../../hooks/features/aggregation/gridAggregationUtils.js";
|
|
11
|
+
import { getAggregationFunctionLabel, getAvailableAggregationFunctions } from "../../hooks/features/aggregation/gridAggregationUtils.js";
|
|
12
12
|
import { GridPivotPanelFieldMenu } from "./GridPivotPanelFieldMenu.js";
|
|
13
13
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
14
14
|
import { gridPivotInitialColumnsSelector } from "../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
@@ -152,7 +152,13 @@ function AggregationSelect({
|
|
|
152
152
|
};
|
|
153
153
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
154
154
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseChip, {
|
|
155
|
-
label:
|
|
155
|
+
label: getAggregationFunctionLabel({
|
|
156
|
+
apiRef,
|
|
157
|
+
aggregationRule: {
|
|
158
|
+
aggregationFunctionName: aggFunc,
|
|
159
|
+
aggregationFunction: rootProps.aggregationFunctions[aggFunc]
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
156
162
|
size: "small",
|
|
157
163
|
variant: "outlined",
|
|
158
164
|
ref: aggregationMenuTriggerRef,
|
|
@@ -175,7 +181,13 @@ function AggregationSelect({
|
|
|
175
181
|
selected: aggFunc === func,
|
|
176
182
|
onClick: () => handleClick(func)
|
|
177
183
|
}, rootProps.slotProps?.baseMenuItem, {
|
|
178
|
-
children:
|
|
184
|
+
children: getAggregationFunctionLabel({
|
|
185
|
+
apiRef,
|
|
186
|
+
aggregationRule: {
|
|
187
|
+
aggregationFunctionName: func,
|
|
188
|
+
aggregationFunction: rootProps.aggregationFunctions[func]
|
|
189
|
+
}
|
|
190
|
+
})
|
|
179
191
|
}), func))
|
|
180
192
|
}))
|
|
181
193
|
})]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COLUMN_GROUP_ID_SEPARATOR = ">->";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COLUMN_GROUP_ID_SEPARATOR = '>->';
|
|
@@ -7,6 +7,7 @@ import { GridEmptyPivotOverlay } from "../components/GridEmptyPivotOverlay.js";
|
|
|
7
7
|
import { GridPremiumToolbar } from "../components/GridPremiumToolbar.js";
|
|
8
8
|
export const DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
9
9
|
aiAssistantPanel: null,
|
|
10
|
+
chartsPanel: null,
|
|
10
11
|
columnMenu: GridPremiumColumnMenu,
|
|
11
12
|
bottomContainer: GridBottomContainer,
|
|
12
13
|
emptyPivotOverlay: GridEmptyPivotOverlay,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridChartsIntegrationContextProviderProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function GridChartsIntegrationContextProvider({
|
|
6
|
+
children
|
|
7
|
+
}: GridChartsIntegrationContextProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { GridChartsIntegrationContext } from "../components/chartsIntegration/GridChartsIntegrationContext.js";
|
|
6
|
+
import { EMPTY_CHART_INTEGRATION_CONTEXT_STATE } from "../hooks/features/chartsIntegration/useGridChartsIntegration.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export function GridChartsIntegrationContextProvider({
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
const [chartStateLookup, setChartStateLookup] = React.useState({});
|
|
12
|
+
const setChartState = React.useCallback((id, state) => {
|
|
13
|
+
if (id === '') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setChartStateLookup(prev => _extends({}, prev, {
|
|
17
|
+
[id]: _extends({}, prev[id] || EMPTY_CHART_INTEGRATION_CONTEXT_STATE, state)
|
|
18
|
+
}));
|
|
19
|
+
}, []);
|
|
20
|
+
const value = React.useMemo(() => ({
|
|
21
|
+
chartStateLookup,
|
|
22
|
+
setChartState
|
|
23
|
+
}), [chartStateLookup, setChartState]);
|
|
24
|
+
return /*#__PURE__*/_jsx(GridChartsIntegrationContext.Provider, {
|
|
25
|
+
value: value,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartState } from "../models/gridChartsIntegration.js";
|
|
3
|
+
export type GridChartsRendererProxyRendererCallback = (type: string, props: Record<string, any>, Component: React.ComponentType<any>) => React.ReactNode;
|
|
4
|
+
type GridChartsRendererProxyRenderer = React.ComponentType<{
|
|
5
|
+
dimensions: ChartState['dimensions'];
|
|
6
|
+
values: ChartState['values'];
|
|
7
|
+
chartType: ChartState['type'];
|
|
8
|
+
configuration: ChartState['configuration'];
|
|
9
|
+
onRender?: GridChartsRendererProxyRendererCallback;
|
|
10
|
+
}>;
|
|
11
|
+
export interface GridChartsRendererProxyProps {
|
|
12
|
+
/**
|
|
13
|
+
* The unique identifier for the chart.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* The label for the chart.
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The renderer component that will render the chart.
|
|
22
|
+
*/
|
|
23
|
+
renderer: GridChartsRendererProxyRenderer;
|
|
24
|
+
/**
|
|
25
|
+
* Callback function called when the chart is about to be rendered.
|
|
26
|
+
* Use this to check and modify the chart props before it is rendered.
|
|
27
|
+
*/
|
|
28
|
+
onRender?: GridChartsRendererProxyRendererCallback;
|
|
29
|
+
}
|
|
30
|
+
declare function GridChartsRendererProxy(props: GridChartsRendererProxyProps): React.JSX.Element | null;
|
|
31
|
+
declare namespace GridChartsRendererProxy {
|
|
32
|
+
var propTypes: any;
|
|
33
|
+
}
|
|
34
|
+
export { GridChartsRendererProxy };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useGridChartsIntegrationContext } from "../hooks/utils/useGridChartIntegration.js";
|
|
7
|
+
import { EMPTY_CHART_INTEGRATION_CONTEXT_STATE } from "../hooks/features/chartsIntegration/useGridChartsIntegration.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
function GridChartsRendererProxy(props) {
|
|
10
|
+
const {
|
|
11
|
+
renderer: Renderer,
|
|
12
|
+
id,
|
|
13
|
+
label,
|
|
14
|
+
onRender
|
|
15
|
+
} = props;
|
|
16
|
+
const {
|
|
17
|
+
chartStateLookup,
|
|
18
|
+
setChartState
|
|
19
|
+
} = useGridChartsIntegrationContext();
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (!chartStateLookup[id]) {
|
|
22
|
+
// With this, the proxy "registers" the chart to the context
|
|
23
|
+
setChartState(id, _extends({}, EMPTY_CHART_INTEGRATION_CONTEXT_STATE, {
|
|
24
|
+
label
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
return () => {
|
|
28
|
+
delete chartStateLookup[id];
|
|
29
|
+
};
|
|
30
|
+
}, [id, label, setChartState, chartStateLookup]);
|
|
31
|
+
if (!chartStateLookup[id]) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const {
|
|
35
|
+
dimensions,
|
|
36
|
+
values,
|
|
37
|
+
type,
|
|
38
|
+
configuration
|
|
39
|
+
} = chartStateLookup[id];
|
|
40
|
+
return /*#__PURE__*/_jsx(Renderer, {
|
|
41
|
+
dimensions: dimensions,
|
|
42
|
+
values: values,
|
|
43
|
+
chartType: type,
|
|
44
|
+
configuration: configuration,
|
|
45
|
+
onRender: onRender
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
process.env.NODE_ENV !== "production" ? GridChartsRendererProxy.propTypes = {
|
|
49
|
+
// ----------------------------- Warning --------------------------------
|
|
50
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
51
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
52
|
+
// ----------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* The unique identifier for the chart.
|
|
55
|
+
*/
|
|
56
|
+
id: PropTypes.string.isRequired,
|
|
57
|
+
/**
|
|
58
|
+
* The label for the chart.
|
|
59
|
+
*/
|
|
60
|
+
label: PropTypes.string,
|
|
61
|
+
/**
|
|
62
|
+
* Callback function called when the chart is about to be rendered.
|
|
63
|
+
* Use this to check and modify the chart props before it is rendered.
|
|
64
|
+
*/
|
|
65
|
+
onRender: PropTypes.func,
|
|
66
|
+
/**
|
|
67
|
+
* The renderer component that will render the chart.
|
|
68
|
+
*/
|
|
69
|
+
renderer: PropTypes.func.isRequired
|
|
70
|
+
} : void 0;
|
|
71
|
+
export { GridChartsRendererProxy };
|
|
@@ -3,7 +3,7 @@ import { getVisibleRows } from '@mui/x-data-grid/internals';
|
|
|
3
3
|
export const shouldApplySorting = (aggregationRules, aggregatedFields) => {
|
|
4
4
|
return aggregatedFields.some(field => aggregationRules[field].aggregationFunction.applySorting);
|
|
5
5
|
};
|
|
6
|
-
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, publicApi, groupAggregatedValuesLookup) => {
|
|
6
|
+
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, publicApi, groupAggregatedValuesLookup, columnsLookup) => {
|
|
7
7
|
const groupAggregationLookup = {};
|
|
8
8
|
const aggregatedValues = [];
|
|
9
9
|
for (let i = 0; i < aggregatedFields.length; i += 1) {
|
|
@@ -73,12 +73,14 @@ const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregat
|
|
|
73
73
|
groupId,
|
|
74
74
|
field: aggregatedField // Added per user request in https://github.com/mui/mui-x/issues/6995#issuecomment-1327423455
|
|
75
75
|
}, publicApi);
|
|
76
|
+
const formattedValue = aggregationFunction.valueFormatter ? aggregationFunction.valueFormatter(value, rowLookup[groupId], columnsLookup[aggregatedField], apiRef) : undefined;
|
|
76
77
|
|
|
77
78
|
// Only add to groupAggregationLookup if position is not null
|
|
78
79
|
if (position !== null) {
|
|
79
80
|
groupAggregationLookup[aggregatedField] = {
|
|
80
81
|
position,
|
|
81
|
-
value
|
|
82
|
+
value,
|
|
83
|
+
formattedValue
|
|
82
84
|
};
|
|
83
85
|
}
|
|
84
86
|
}
|
|
@@ -142,7 +144,7 @@ export const createAggregationLookup = ({
|
|
|
142
144
|
aggregationLookup[groupNode.id] = getGroupAggregatedValueDataSource(groupNode.id, apiRef, aggregatedFields, position);
|
|
143
145
|
}
|
|
144
146
|
} else if (groupNode.children.length) {
|
|
145
|
-
const result = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, apiRef.current, groupAggregatedValuesLookup);
|
|
147
|
+
const result = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position, applySorting, valueGetters, apiRef.current, groupAggregatedValuesLookup, columnsLookup);
|
|
146
148
|
// Always populate groupAggregatedValuesLookup for groups with children
|
|
147
149
|
// This ensures parent groups can access child aggregated values even when position is null
|
|
148
150
|
groupAggregatedValuesLookup.set(groupNode.id, result.aggregatedValues);
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
|
|
5
6
|
import { gridColumnLookupSelector, useGridEvent, useGridApiMethod, useRunOncePerLoop, gridRenderContextSelector, gridVisibleColumnFieldsSelector, gridSortModelSelector } from '@mui/x-data-grid-pro';
|
|
6
7
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
7
|
-
import { gridAggregationModelSelector } from "./gridAggregationSelectors.js";
|
|
8
|
+
import { gridAggregationLookupSelector, gridAggregationModelSelector } from "./gridAggregationSelectors.js";
|
|
8
9
|
import { getAggregationRules, mergeStateWithAggregationModel, areAggregationRulesEqual } from "./gridAggregationUtils.js";
|
|
9
10
|
import { createAggregationLookup, shouldApplySorting } from "./createAggregationLookup.js";
|
|
10
11
|
export const aggregationStateInitializer = (state, props, apiRef) => {
|
|
@@ -46,6 +47,7 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
46
47
|
abortControllerRef.current = abortController;
|
|
47
48
|
const aggregationRules = getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
|
|
48
49
|
const aggregatedFields = Object.keys(aggregationRules);
|
|
50
|
+
const currentAggregationLookup = gridAggregationLookupSelector(apiRef);
|
|
49
51
|
const needsSorting = shouldApplySorting(aggregationRules, aggregatedFields);
|
|
50
52
|
if (reason === 'sort' && !needsSorting) {
|
|
51
53
|
// no need to re-apply aggregation on `sortedRowsSet` if sorting is not needed
|
|
@@ -115,6 +117,16 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
115
117
|
}, 0);
|
|
116
118
|
};
|
|
117
119
|
processChunk();
|
|
120
|
+
|
|
121
|
+
// processChunk() does nothing if there are no aggregated fields
|
|
122
|
+
// make sure that the lookup is empty in this case
|
|
123
|
+
if (aggregatedFields.length === 0 && !isObjectEmpty(currentAggregationLookup)) {
|
|
124
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
125
|
+
aggregation: _extends({}, state.aggregation, {
|
|
126
|
+
lookup: {}
|
|
127
|
+
})
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
118
130
|
}, [apiRef, props.getAggregationPosition, props.aggregationFunctions, props.aggregationRowsScope, props.dataSource]);
|
|
119
131
|
React.useEffect(() => {
|
|
120
132
|
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
|
};
|
|
@@ -2,54 +2,12 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["aggregationWrappedProperties"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { gridRowNodeSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridAggregationLookupSelector } from "./gridAggregationSelectors.js";
|
|
7
7
|
import { GridFooterCell } from "../../../components/GridFooterCell.js";
|
|
8
8
|
import { GridAggregationHeader } from "../../../components/GridAggregationHeader.js";
|
|
9
9
|
import { gridPivotActiveSelector } from "../pivoting/gridPivotingSelectors.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const getAggregationValueWrappedValueGetter = ({
|
|
12
|
-
value: valueGetter,
|
|
13
|
-
getCellAggregationResult
|
|
14
|
-
}) => {
|
|
15
|
-
const wrappedValueGetter = (value, row, column, apiRef) => {
|
|
16
|
-
const rowId = gridRowIdSelector(apiRef, row);
|
|
17
|
-
const cellAggregationResult = rowId ? getCellAggregationResult(rowId, column.field) : null;
|
|
18
|
-
if (cellAggregationResult != null) {
|
|
19
|
-
return cellAggregationResult?.value ?? null;
|
|
20
|
-
}
|
|
21
|
-
if (valueGetter) {
|
|
22
|
-
return valueGetter(value, row, column, apiRef);
|
|
23
|
-
}
|
|
24
|
-
return row[column.field];
|
|
25
|
-
};
|
|
26
|
-
return wrappedValueGetter;
|
|
27
|
-
};
|
|
28
|
-
const getAggregationValueWrappedValueFormatter = ({
|
|
29
|
-
value: valueFormatter,
|
|
30
|
-
aggregationRule,
|
|
31
|
-
getCellAggregationResult
|
|
32
|
-
}) => {
|
|
33
|
-
// If neither the inline aggregation function nor the footer aggregation function have a custom value formatter,
|
|
34
|
-
// Then we don't wrap the column value formatter
|
|
35
|
-
if (!aggregationRule.aggregationFunction.valueFormatter) {
|
|
36
|
-
return valueFormatter;
|
|
37
|
-
}
|
|
38
|
-
const wrappedValueFormatter = (value, row, column, apiRef) => {
|
|
39
|
-
const rowId = gridRowIdSelector(apiRef, row);
|
|
40
|
-
if (rowId != null) {
|
|
41
|
-
const cellAggregationResult = getCellAggregationResult(rowId, column.field);
|
|
42
|
-
if (cellAggregationResult != null) {
|
|
43
|
-
return aggregationRule.aggregationFunction.valueFormatter?.(value, row, column, apiRef);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (valueFormatter) {
|
|
47
|
-
return valueFormatter(value, row, column, apiRef);
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
};
|
|
51
|
-
return wrappedValueFormatter;
|
|
52
|
-
};
|
|
53
11
|
const getAggregationValueWrappedRenderCell = ({
|
|
54
12
|
value: renderCell,
|
|
55
13
|
aggregationRule,
|
|
@@ -161,8 +119,6 @@ export const wrapColumnWithAggregationValue = (column, aggregationRule, apiRef)
|
|
|
161
119
|
});
|
|
162
120
|
}
|
|
163
121
|
};
|
|
164
|
-
wrapColumnProperty('valueGetter', getAggregationValueWrappedValueGetter);
|
|
165
|
-
wrapColumnProperty('valueFormatter', getAggregationValueWrappedValueFormatter);
|
|
166
122
|
wrapColumnProperty('renderCell', getAggregationValueWrappedRenderCell);
|
|
167
123
|
wrapColumnProperty('renderHeader', getWrappedRenderHeader);
|
|
168
124
|
if (!didWrapSomeProperty) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { GridColDef } from '@mui/x-data-grid-pro';
|
|
2
|
+
import type { ChartState } from "../../../models/gridChartsIntegration.js";
|
|
3
|
+
export type GridChartsIntegrationSection = 'dimensions' | 'values' | null;
|
|
4
|
+
export type GridChartsIntegrationItem = {
|
|
5
|
+
field: GridColDef['field'];
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface GridChartsIntegrationState {
|
|
9
|
+
activeChartId: string;
|
|
10
|
+
charts: Record<string, {
|
|
11
|
+
dimensions: GridChartsIntegrationItem[];
|
|
12
|
+
values: GridChartsIntegrationItem[];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export interface GridChartsIntegrationInitialState {
|
|
16
|
+
activeChartId?: string;
|
|
17
|
+
charts?: Record<string, {
|
|
18
|
+
dimensions?: GridChartsIntegrationItem[] | GridColDef['field'][];
|
|
19
|
+
values?: GridChartsIntegrationItem[] | GridColDef['field'][];
|
|
20
|
+
chartType?: ChartState['type'];
|
|
21
|
+
configuration?: ChartState['configuration'];
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface GridChartsIntegrationApi {
|
|
25
|
+
/**
|
|
26
|
+
* Sets whether the charts side panel is open.
|
|
27
|
+
* @param {boolean | ((prev: boolean) => boolean)} open - The new value of the charts side panel open state.
|
|
28
|
+
*/
|
|
29
|
+
setChartsPanelOpen: (open: boolean | ((prev: boolean) => boolean)) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the active chart id.
|
|
32
|
+
* @param {string} chartId - The id of the chart to set as active.
|
|
33
|
+
*/
|
|
34
|
+
setActiveChartId: (chartId: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the chart type for the active chart.
|
|
37
|
+
* @param {string} chartId - The id of the chart to set the type for.
|
|
38
|
+
* @param {string} type - The new type of the chart.
|
|
39
|
+
*/
|
|
40
|
+
setChartType: (chartId: string, type: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the synchronization state for a chart.
|
|
43
|
+
* @param {string} chartId - The id of the chart to set the synchronization state for.
|
|
44
|
+
* @param {boolean} synced - The new synchronization state.
|
|
45
|
+
*/
|
|
46
|
+
setChartSynchronizationState: (chartId: string, synced: boolean) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Updates the dimensions data selection for the charts integration.
|
|
49
|
+
* @param {string} chartId - The id of the chart to update the dimensions for.
|
|
50
|
+
* @param {GridChartsIntegrationItem[] | ((prev: GridChartsIntegrationItem[]) => GridChartsIntegrationItem[])} dimensions - The new dimensions selection or a function that returns the new dimensions selection.
|
|
51
|
+
*/
|
|
52
|
+
updateChartDimensionsData: (chartId: string, dimensions: GridChartsIntegrationItem[] | ((prev: GridChartsIntegrationItem[]) => GridChartsIntegrationItem[])) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Updates the values data selection for the charts integration.
|
|
55
|
+
* @param {string} chartId - The id of the chart to update the values for.
|
|
56
|
+
* @param {GridChartsIntegrationItem[] | ((prev: GridChartsIntegrationItem[]) => GridChartsIntegrationItem[])} values - The new values selection or a function that returns the new values selection.
|
|
57
|
+
*/
|
|
58
|
+
updateChartValuesData: (chartId: string, values: GridChartsIntegrationItem[] | ((prev: GridChartsIntegrationItem[]) => GridChartsIntegrationItem[])) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface GridChartsIntegrationPrivateApi {
|
|
61
|
+
chartsIntegration: {
|
|
62
|
+
updateDataReference: (field: string, originSection: GridChartsIntegrationSection, targetSection: GridChartsIntegrationSection, targetField?: string, placementRelativeToTargetField?: 'top' | 'bottom') => void;
|
|
63
|
+
getColumnName: (field: string) => string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GridColumnLookup } from '@mui/x-data-grid';
|
|
2
|
+
import { GridStatePremium } from "../../../models/gridStatePremium.js";
|
|
3
|
+
export declare const gridChartsIntegrationActiveChartIdSelector: (args_0: import("react").RefObject<{
|
|
4
|
+
state: GridStatePremium;
|
|
5
|
+
} | null>) => string;
|
|
6
|
+
export declare const gridChartsPanelOpenSelector: (args_0: import("react").RefObject<{
|
|
7
|
+
state: GridStatePremium;
|
|
8
|
+
} | null>) => boolean;
|
|
9
|
+
export declare const gridChartableColumnsSelector: (args_0: import("react").RefObject<{
|
|
10
|
+
state: GridStatePremium;
|
|
11
|
+
} | null>) => GridColumnLookup;
|
|
12
|
+
export declare const gridChartsDimensionsSelector: (args_0: import("react").RefObject<{
|
|
13
|
+
state: GridStatePremium;
|
|
14
|
+
} | null>, chartId: any) => import("./gridChartsIntegrationInterfaces.js").GridChartsIntegrationItem[];
|
|
15
|
+
export declare const gridChartsValuesSelector: (args_0: import("react").RefObject<{
|
|
16
|
+
state: GridStatePremium;
|
|
17
|
+
} | null>, chartId: any) => import("./gridChartsIntegrationInterfaces.js").GridChartsIntegrationItem[];
|