@mui/x-data-grid-premium 8.0.0-alpha.0 → 8.0.0-alpha.10
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 +2215 -119
- package/DataGridPremium/DataGridPremium.js +40 -40
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/DataGridPremium/useDataGridPremiumComponent.js +4 -2
- package/DataGridPremium/useDataGridPremiumProps.js +5 -3
- package/README.md +3 -3
- package/components/GridAggregationHeader.js +6 -1
- package/components/GridColumnMenuAggregationItem.js +77 -49
- package/components/GridColumnMenuRowGroupItem.js +5 -11
- package/components/GridColumnMenuRowUngroupItem.js +10 -19
- package/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/components/GridPremiumColumnMenu.d.ts +1 -1
- package/components/GridPremiumColumnMenu.js +5 -5
- package/components/index.d.ts +1 -0
- package/components/index.js +12 -0
- package/components/promptControl/GridToolbarPromptControl.d.ts +26 -0
- package/components/promptControl/GridToolbarPromptControl.js +220 -0
- package/components/promptControl/RecordButton.d.ts +16 -0
- package/components/promptControl/RecordButton.js +119 -0
- package/components/promptControl/index.d.ts +1 -0
- package/components/promptControl/index.js +12 -0
- package/esm/DataGridPremium/DataGridPremium.js +42 -42
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -3
- package/esm/DataGridPremium/useDataGridPremiumProps.js +6 -4
- package/esm/components/GridAggregationHeader.js +6 -1
- package/esm/components/GridColumnMenuAggregationItem.js +75 -47
- package/esm/components/GridColumnMenuRowGroupItem.js +6 -11
- package/esm/components/GridColumnMenuRowUngroupItem.js +11 -19
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/esm/components/GridPremiumColumnMenu.js +5 -5
- package/esm/components/index.js +1 -0
- package/esm/components/promptControl/GridToolbarPromptControl.js +213 -0
- package/esm/components/promptControl/RecordButton.js +111 -0
- package/esm/components/promptControl/index.js +1 -0
- package/esm/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/esm/hooks/features/aggregation/index.js +0 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +5 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/esm/hooks/features/dataSource/cache.js +3 -0
- package/esm/hooks/features/dataSource/models.js +1 -0
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
- package/esm/hooks/features/index.js +2 -1
- package/esm/hooks/features/promptControl/api.js +22 -0
- package/esm/hooks/features/promptControl/index.js +1 -0
- package/esm/hooks/features/promptControl/types.js +1 -0
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/esm/hooks/utils/useGridAriaAttributes.js +1 -3
- package/esm/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/esm/material/icons.js +7 -1
- package/esm/material/index.js +4 -2
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/createAggregationLookup.d.ts +7 -6
- package/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +18 -5
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +2 -2
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +12 -13
- package/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/hooks/features/aggregation/index.d.ts +1 -1
- package/hooks/features/aggregation/index.js +0 -12
- package/hooks/features/aggregation/useGridAggregation.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +4 -2
- package/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +3 -3
- package/hooks/features/cellSelection/useGridCellSelection.d.ts +2 -2
- package/hooks/features/cellSelection/useGridCellSelection.js +4 -5
- package/hooks/features/clipboard/useGridClipboardImport.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/hooks/features/dataSource/cache.d.ts +2 -0
- package/hooks/features/dataSource/cache.js +9 -0
- package/hooks/features/dataSource/models.d.ts +47 -0
- package/hooks/features/dataSource/models.js +5 -0
- package/hooks/features/dataSource/useGridDataSourcePremium.d.ts +4 -0
- package/hooks/features/dataSource/useGridDataSourcePremium.js +62 -0
- package/hooks/features/export/serializer/excelSerializer.d.ts +3 -2
- package/hooks/features/export/useGridExcelExport.d.ts +2 -2
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +11 -0
- package/hooks/features/promptControl/api.d.ts +2 -0
- package/hooks/features/promptControl/api.js +28 -0
- package/hooks/features/promptControl/index.d.ts +2 -0
- package/hooks/features/promptControl/index.js +12 -0
- package/hooks/features/promptControl/types.d.ts +25 -0
- package/hooks/features/promptControl/types.js +5 -0
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +2 -2
- package/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +2 -2
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +4 -4
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -1
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/hooks/utils/useGridApiContext.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +3 -1
- package/hooks/utils/useGridAriaAttributes.js +1 -3
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useKeepGroupedColumnsHidden.d.ts +2 -2
- package/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/material/icons.d.ts +6 -0
- package/material/icons.js +8 -2
- package/material/index.d.ts +2 -0
- package/material/index.js +3 -1
- package/models/dataGridPremiumProps.d.ts +8 -12
- package/models/gridApiPremium.d.ts +5 -3
- package/models/gridGroupingValueGetter.d.ts +2 -1
- package/models/gridPastedValueParser.d.ts +2 -1
- package/models/gridPremiumIconSlotsComponent.d.ts +10 -0
- package/modern/DataGridPremium/DataGridPremium.js +42 -42
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +5 -3
- package/modern/DataGridPremium/useDataGridPremiumProps.js +6 -4
- package/modern/components/GridAggregationHeader.js +6 -1
- package/modern/components/GridColumnMenuAggregationItem.js +75 -47
- package/modern/components/GridColumnMenuRowGroupItem.js +6 -11
- package/modern/components/GridColumnMenuRowUngroupItem.js +11 -19
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/modern/components/GridPremiumColumnMenu.js +5 -5
- package/modern/components/index.js +1 -0
- package/modern/components/promptControl/GridToolbarPromptControl.js +213 -0
- package/modern/components/promptControl/RecordButton.js +111 -0
- package/modern/components/promptControl/index.js +1 -0
- package/modern/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/modern/hooks/features/aggregation/index.js +0 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +5 -6
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/modern/hooks/features/dataSource/cache.js +3 -0
- package/modern/hooks/features/dataSource/models.js +1 -0
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/promptControl/api.js +22 -0
- package/modern/hooks/features/promptControl/index.js +1 -0
- package/modern/hooks/features/promptControl/types.js +1 -0
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/modern/hooks/utils/useGridAriaAttributes.js +1 -3
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/modern/index.js +1 -1
- package/modern/material/icons.js +7 -1
- package/modern/material/index.js +4 -2
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +8 -8
- package/utils/releaseInfo.js +1 -1
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridApiCommon } from '@mui/x-data-grid';
|
|
1
3
|
import { GridApiPremium } from '../../models/gridApiPremium';
|
|
2
|
-
export declare const useGridApiRef: () =>
|
|
4
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiPremium>() => RefObject<Api | null>;
|
|
@@ -9,13 +9,11 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
10
10
|
var _gridRowGroupingSelector = require("../features/rowGrouping/gridRowGroupingSelector");
|
|
11
11
|
var _useGridPrivateApiContext = require("./useGridPrivateApiContext");
|
|
12
|
-
var _useGridRootProps = require("./useGridRootProps");
|
|
13
12
|
const useGridAriaAttributes = () => {
|
|
14
|
-
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
15
13
|
const ariaAttributesPro = (0, _internals.useGridAriaAttributes)();
|
|
16
14
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
17
15
|
const gridRowGroupingModel = (0, _internals.useGridSelector)(apiRef, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector);
|
|
18
|
-
const ariaAttributesPremium =
|
|
16
|
+
const ariaAttributesPremium = gridRowGroupingModel.length > 0 ? {
|
|
19
17
|
role: 'treegrid'
|
|
20
18
|
} : {};
|
|
21
19
|
return (0, _extends2.default)({}, ariaAttributesPro, ariaAttributesPremium);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridPrivateApiPremium } from '../../models/gridApiPremium';
|
|
2
|
-
export declare const useGridPrivateApiContext: () => import("react").
|
|
2
|
+
export declare const useGridPrivateApiContext: () => import("react").RefObject<GridPrivateApiPremium>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApi } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridInitialStatePremium } from '../../models/gridStatePremium';
|
|
4
4
|
import { DataGridPremiumProps } from '../../models/dataGridPremiumProps';
|
|
@@ -8,5 +8,5 @@ import { DataGridPremiumProps } from '../../models/dataGridPremiumProps';
|
|
|
8
8
|
* Does not work when used with the `hide` property of `GridColDef`
|
|
9
9
|
*/
|
|
10
10
|
export declare const useKeepGroupedColumnsHidden: (props: {
|
|
11
|
-
apiRef:
|
|
11
|
+
apiRef: RefObject<GridApi | null>;
|
|
12
12
|
} & Pick<DataGridPremiumProps, "initialState" | "rowGroupingModel">) => GridInitialStatePremium;
|
|
@@ -33,9 +33,9 @@ const useKeepGroupedColumnsHidden = props => {
|
|
|
33
33
|
const initialProps = React.useRef(props);
|
|
34
34
|
const rowGroupingModel = React.useRef(props.rowGroupingModel ?? props.initialState?.rowGrouping?.model);
|
|
35
35
|
React.useEffect(() => {
|
|
36
|
-
props.apiRef.current
|
|
36
|
+
props.apiRef.current?.subscribeEvent('rowGroupingModelChange', newModel => {
|
|
37
37
|
const columnVisibilityModel = updateColumnVisibilityModel((0, _xDataGridPro.gridColumnVisibilityModelSelector)(props.apiRef), newModel, rowGroupingModel.current);
|
|
38
|
-
props.apiRef.current
|
|
38
|
+
props.apiRef.current?.setColumnVisibilityModel(columnVisibilityModel);
|
|
39
39
|
rowGroupingModel.current = newModel;
|
|
40
40
|
});
|
|
41
41
|
}, [props.apiRef]);
|
package/index.d.ts
CHANGED
|
@@ -27,3 +27,5 @@ export type { DataGridPremiumProps, GridExperimentalPremiumFeatures, } from './m
|
|
|
27
27
|
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
28
28
|
export type { GridApi, GridInitialState, GridState } from './typeOverloads/reexports';
|
|
29
29
|
export { GridColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS, } from './components/reexports';
|
|
30
|
+
export type { GridDataSourceCache } from '@mui/x-data-grid-pro';
|
|
31
|
+
export type { GridGetRowsParamsPremium as GridGetRowsParams, GridGetRowsResponsePremium as GridGetRowsResponse, GridDataSourcePremium as GridDataSource, GridDataSourceApiPremium as GridDataSourceApi, GridDataSourceApiBasePremium as GridDataSourceApiBase, GridDataSourcePremiumPrivateApi as GridDataSourcePrivateApi, } from './hooks/features/dataSource/models';
|
package/index.js
CHANGED
package/material/icons.d.ts
CHANGED
|
@@ -7,3 +7,9 @@ export declare const GridGroupWorkIcon: import("@mui/material/OverridableCompone
|
|
|
7
7
|
export declare const GridFunctionsIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
8
8
|
muiName: string;
|
|
9
9
|
};
|
|
10
|
+
export declare const GridSendPromptIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
11
|
+
muiName: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const GridRecordPromptIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
14
|
+
muiName: string;
|
|
15
|
+
};
|
package/material/icons.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.GridWorkspacesIcon = exports.GridGroupWorkIcon = exports.GridFunctionsIcon = void 0;
|
|
7
|
+
exports.GridWorkspacesIcon = exports.GridSendPromptIcon = exports.GridRecordPromptIcon = exports.GridGroupWorkIcon = exports.GridFunctionsIcon = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _utils = require("@mui/material/utils");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -18,4 +18,10 @@ const GridGroupWorkIcon = exports.GridGroupWorkIcon = (0, _utils.createSvgIcon)(
|
|
|
18
18
|
}), 'GroupWork');
|
|
19
19
|
const GridFunctionsIcon = exports.GridFunctionsIcon = (0, _utils.createSvgIcon)(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
20
20
|
d: "M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"
|
|
21
|
-
}), 'Functions');
|
|
21
|
+
}), 'Functions');
|
|
22
|
+
const GridSendPromptIcon = exports.GridSendPromptIcon = (0, _utils.createSvgIcon)(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
23
|
+
d: "M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"
|
|
24
|
+
}), 'SendPrompt');
|
|
25
|
+
const GridRecordPromptIcon = exports.GridRecordPromptIcon = (0, _utils.createSvgIcon)(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
26
|
+
d: "M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"
|
|
27
|
+
}), 'RecordPrompt');
|
package/material/index.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ declare const materialSlots: {
|
|
|
2
2
|
columnMenuUngroupIcon: React.JSXElementConstructor<any>;
|
|
3
3
|
columnMenuGroupIcon: React.JSXElementConstructor<any>;
|
|
4
4
|
columnMenuAggregationIcon: React.JSXElementConstructor<any>;
|
|
5
|
+
toolbarPromptSendIcon: React.JSXElementConstructor<any>;
|
|
6
|
+
toolbarPromptRecordIcon: React.JSXElementConstructor<any>;
|
|
5
7
|
};
|
|
6
8
|
export default materialSlots;
|
package/material/index.js
CHANGED
|
@@ -10,7 +10,9 @@ var _icons = require("./icons");
|
|
|
10
10
|
const iconsSlots = {
|
|
11
11
|
columnMenuUngroupIcon: _icons.GridWorkspacesIcon,
|
|
12
12
|
columnMenuGroupIcon: _icons.GridGroupWorkIcon,
|
|
13
|
-
columnMenuAggregationIcon: _icons.GridFunctionsIcon
|
|
13
|
+
columnMenuAggregationIcon: _icons.GridFunctionsIcon,
|
|
14
|
+
toolbarPromptSendIcon: _icons.GridSendPromptIcon,
|
|
15
|
+
toolbarPromptRecordIcon: _icons.GridRecordPromptIcon
|
|
14
16
|
};
|
|
15
17
|
const materialSlots = (0, _extends2.default)({}, iconsSlots);
|
|
16
18
|
var _default = exports.default = materialSlots;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridCallbackDetails, GridValidRowModel, GridGroupNode, GridEventListener } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridExperimentalProFeatures, DataGridProPropsWithDefaultValue, DataGridProPropsWithoutDefaultValue, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing, DataGridPremiumSharedPropsWithDefaultValue } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import type { GridRowGroupingModel } from '../hooks/features/rowGrouping';
|
|
5
|
-
import type { GridAggregationModel, GridAggregationFunction, GridAggregationPosition } from '../hooks/features/aggregation';
|
|
5
|
+
import type { GridAggregationModel, GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationPosition } from '../hooks/features/aggregation';
|
|
6
6
|
import { GridPremiumSlotsComponent } from './gridPremiumSlotsComponent';
|
|
7
7
|
import { GridInitialStatePremium } from './gridStatePremium';
|
|
8
8
|
import { GridApiPremium } from './gridApiPremium';
|
|
9
9
|
import { GridCellSelectionModel } from '../hooks/features/cellSelection';
|
|
10
|
+
import { GridDataSourcePremium as GridDataSource } from '../hooks/features/dataSource/models';
|
|
10
11
|
export interface GridExperimentalPremiumFeatures extends GridExperimentalProFeatures {
|
|
11
|
-
/**
|
|
12
|
-
* Enables accessibility improvements that will be enabled by default in V8.
|
|
13
|
-
* If you rely on the v7 ARIA attributes (e.g. for CSS selectors), this might be a breaking change.
|
|
14
|
-
* @default false
|
|
15
|
-
*/
|
|
16
|
-
ariaV8: boolean;
|
|
17
12
|
}
|
|
18
13
|
export interface DataGridPremiumPropsWithComplexDefaultValueBeforeProcessing extends Pick<DataGridPropsWithComplexDefaultValueBeforeProcessing, 'localeText'> {
|
|
19
14
|
/**
|
|
@@ -59,9 +54,9 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
|
|
|
59
54
|
rowGroupingColumnMode: 'single' | 'multiple';
|
|
60
55
|
/**
|
|
61
56
|
* Aggregation functions available on the grid.
|
|
62
|
-
* @default GRID_AGGREGATION_FUNCTIONS
|
|
57
|
+
* @default GRID_AGGREGATION_FUNCTIONS when `unstable_dataSource` is not provided, `{}` when `unstable_dataSource` is provided
|
|
63
58
|
*/
|
|
64
|
-
aggregationFunctions: Record<string, GridAggregationFunction>;
|
|
59
|
+
aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
|
|
65
60
|
/**
|
|
66
61
|
* Rows used to generate the aggregated value.
|
|
67
62
|
* If `filtered`, the aggregated values are generated using only the rows currently passing the filtering process.
|
|
@@ -89,11 +84,11 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
|
|
|
89
84
|
*/
|
|
90
85
|
splitClipboardPastedText: (text: string) => string[][] | null;
|
|
91
86
|
}
|
|
92
|
-
export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridProPropsWithoutDefaultValue<R>, 'initialState' | 'apiRef'> {
|
|
87
|
+
export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridProPropsWithoutDefaultValue<R>, 'initialState' | 'apiRef' | 'unstable_dataSource'> {
|
|
93
88
|
/**
|
|
94
89
|
* The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
95
90
|
*/
|
|
96
|
-
apiRef?:
|
|
91
|
+
apiRef?: RefObject<GridApiPremium | null>;
|
|
97
92
|
/**
|
|
98
93
|
* The initial state of the DataGridPremium.
|
|
99
94
|
* The data in it is set in the state on initialization but isn't controlled.
|
|
@@ -158,4 +153,5 @@ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowM
|
|
|
158
153
|
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
159
154
|
*/
|
|
160
155
|
experimentalFeatures?: Partial<GridExperimentalPremiumFeatures>;
|
|
156
|
+
unstable_dataSource?: GridDataSource;
|
|
161
157
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { GridPrivateOnlyApiCommon } from '@mui/x-data-grid/internals';
|
|
2
|
-
import { GridApiCommon, GridColumnPinningApi, GridDetailPanelApi, GridDetailPanelPrivateApi, GridRowPinningApi, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi
|
|
2
|
+
import { GridApiCommon, GridColumnPinningApi, GridDetailPanelApi, GridDetailPanelPrivateApi, GridRowPinningApi, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridInitialStatePremium, GridStatePremium } from './gridStatePremium';
|
|
4
4
|
import type { GridRowGroupingApi, GridExcelExportApi, GridAggregationApi } from '../hooks';
|
|
5
5
|
import { GridCellSelectionApi } from '../hooks/features/cellSelection/gridCellSelectionInterfaces';
|
|
6
6
|
import type { DataGridPremiumProcessedProps } from './dataGridPremiumProps';
|
|
7
|
+
import type { GridDataSourcePremiumPrivateApi, GridDataSourceApiPremium } from '../hooks/features/dataSource/models';
|
|
8
|
+
import type { GridAggregationPrivateApi } from '../hooks/features/aggregation/gridAggregationInterfaces';
|
|
7
9
|
/**
|
|
8
10
|
* The api of Data Grid Premium.
|
|
9
11
|
* TODO: Do not redefine manually the pro features
|
|
10
12
|
*/
|
|
11
|
-
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi, GridDetailPanelApi, GridRowGroupingApi, GridExcelExportApi, GridAggregationApi, GridRowPinningApi,
|
|
13
|
+
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi, GridDetailPanelApi, GridRowGroupingApi, GridExcelExportApi, GridAggregationApi, GridRowPinningApi, GridDataSourceApiPremium, GridCellSelectionApi, GridRowMultiSelectionApi, GridColumnReorderApi {
|
|
12
14
|
}
|
|
13
|
-
export interface GridPrivateApiPremium extends GridApiPremium, GridPrivateOnlyApiCommon<GridApiPremium, GridPrivateApiPremium, DataGridPremiumProcessedProps>,
|
|
15
|
+
export interface GridPrivateApiPremium extends GridApiPremium, GridPrivateOnlyApiCommon<GridApiPremium, GridPrivateApiPremium, DataGridPremiumProcessedProps>, GridDataSourcePremiumPrivateApi, GridAggregationPrivateApi, GridDetailPanelPrivateApi {
|
|
14
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import { GridValidRowModel, GridColDef, GridKeyValue } from '@mui/x-data-grid-pro';
|
|
2
3
|
import { GridApiPremium } from './gridApiPremium';
|
|
3
|
-
export type GridGroupingValueGetter<R extends GridValidRowModel = GridValidRowModel, TValue = never> = (value: TValue, row: R, column: GridColDef<R>, apiRef:
|
|
4
|
+
export type GridGroupingValueGetter<R extends GridValidRowModel = GridValidRowModel, TValue = never> = (value: TValue, row: R, column: GridColDef<R>, apiRef: RefObject<GridApiPremium>) => GridKeyValue | null | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import { GridColDef, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
3
|
import { GridApiPremium } from './gridApiPremium';
|
|
3
|
-
export type GridPastedValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: string, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
4
|
+
export type GridPastedValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: string, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiPremium>) => V | undefined;
|
|
@@ -15,4 +15,14 @@ export interface GridPremiumIconSlotsComponent {
|
|
|
15
15
|
* @default GridFunctionsIcon
|
|
16
16
|
*/
|
|
17
17
|
columnMenuAggregationIcon: React.JSXElementConstructor<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Icon used for the button that sends a prompt
|
|
20
|
+
* @default GridFunctionsIcon
|
|
21
|
+
*/
|
|
22
|
+
toolbarPromptSendIcon: React.JSXElementConstructor<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Icon used for the button that starts/stops recording the prompt
|
|
25
|
+
* @default GridFunctionsIcon
|
|
26
|
+
*/
|
|
27
|
+
toolbarPromptRecordIcon: React.JSXElementConstructor<any>;
|
|
18
28
|
}
|
|
@@ -4,14 +4,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
|
-
import {
|
|
7
|
+
import { GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
|
|
8
8
|
import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
|
|
10
11
|
import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
|
|
11
12
|
import { getReleaseInfo } from "../utils/releaseInfo.js";
|
|
12
13
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
13
14
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
14
|
-
import { jsx as _jsx
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
const configuration = {
|
|
16
17
|
hooks: {
|
|
17
18
|
useGridAriaAttributes,
|
|
@@ -23,7 +24,7 @@ let dataGridPremiumPropValidators;
|
|
|
23
24
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
25
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
25
26
|
}
|
|
26
|
-
const DataGridPremiumRaw =
|
|
27
|
+
const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
27
28
|
const props = useDataGridPremiumProps(inProps);
|
|
28
29
|
const privateApiRef = useDataGridPremiumComponent(props.apiRef, props);
|
|
29
30
|
useLicenseVerifier('x-data-grid-premium', releaseInfo);
|
|
@@ -34,18 +35,16 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
34
35
|
privateApiRef: privateApiRef,
|
|
35
36
|
configuration: configuration,
|
|
36
37
|
props: props,
|
|
37
|
-
children: /*#__PURE__*/
|
|
38
|
+
children: /*#__PURE__*/_jsx(GridRoot, _extends({
|
|
38
39
|
className: props.className,
|
|
39
40
|
style: props.style,
|
|
40
|
-
sx: props.sx
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
41
|
+
sx: props.sx
|
|
42
|
+
}, props.slotProps?.root, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
children: /*#__PURE__*/_jsx(Watermark, {
|
|
45
|
+
packageName: "x-data-grid-premium",
|
|
46
|
+
releaseInfo: releaseInfo
|
|
47
|
+
})
|
|
49
48
|
}))
|
|
50
49
|
});
|
|
51
50
|
});
|
|
@@ -56,7 +55,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
56
55
|
// ----------------------------------------------------------------------
|
|
57
56
|
/**
|
|
58
57
|
* Aggregation functions available on the grid.
|
|
59
|
-
* @default GRID_AGGREGATION_FUNCTIONS
|
|
58
|
+
* @default GRID_AGGREGATION_FUNCTIONS when `unstable_dataSource` is not provided, `{}` when `unstable_dataSource` is provided
|
|
60
59
|
*/
|
|
61
60
|
aggregationFunctions: PropTypes.object,
|
|
62
61
|
/**
|
|
@@ -74,7 +73,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
74
73
|
* The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
75
74
|
*/
|
|
76
75
|
apiRef: PropTypes.shape({
|
|
77
|
-
current: PropTypes.object
|
|
76
|
+
current: PropTypes.object
|
|
78
77
|
}),
|
|
79
78
|
/**
|
|
80
79
|
* The label of the Data Grid.
|
|
@@ -109,6 +108,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
109
108
|
*/
|
|
110
109
|
autosizeOptions: PropTypes.shape({
|
|
111
110
|
columns: PropTypes.arrayOf(PropTypes.string),
|
|
111
|
+
disableColumnVirtualization: PropTypes.bool,
|
|
112
112
|
expand: PropTypes.bool,
|
|
113
113
|
includeHeaders: PropTypes.bool,
|
|
114
114
|
includeOutliers: PropTypes.bool,
|
|
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
186
186
|
/**
|
|
187
187
|
* The row ids to show the detail panel.
|
|
188
188
|
*/
|
|
189
|
-
detailPanelExpandedRowIds: PropTypes
|
|
189
|
+
detailPanelExpandedRowIds: PropTypes /* @typescript-to-proptypes-ignore */.instanceOf(Set),
|
|
190
190
|
/**
|
|
191
191
|
* If `true`, aggregation is disabled.
|
|
192
192
|
* @default false
|
|
@@ -304,7 +304,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
304
304
|
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
305
305
|
*/
|
|
306
306
|
experimentalFeatures: PropTypes.shape({
|
|
307
|
-
ariaV8: PropTypes.bool,
|
|
308
307
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
309
308
|
}),
|
|
310
309
|
/**
|
|
@@ -333,11 +332,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
333
332
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
334
333
|
quickFilterValues: PropTypes.array
|
|
335
334
|
}),
|
|
336
|
-
/**
|
|
337
|
-
* Forwarded props for the Data Grid root element.
|
|
338
|
-
* @ignore - do not document.
|
|
339
|
-
*/
|
|
340
|
-
forwardedProps: PropTypes.object,
|
|
341
335
|
/**
|
|
342
336
|
* Determines the position of an aggregated value.
|
|
343
337
|
* @param {GridGroupNode} groupNode The current group.
|
|
@@ -452,14 +446,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
452
446
|
clipboardExport: PropTypes.bool,
|
|
453
447
|
csvExport: PropTypes.bool
|
|
454
448
|
}), PropTypes.bool]),
|
|
455
|
-
/**
|
|
456
|
-
* If `select`, a group header checkbox in indeterminate state (like "Select All" checkbox)
|
|
457
|
-
* will select all the rows under it.
|
|
458
|
-
* If `deselect`, it will deselect all the rows under it.
|
|
459
|
-
* Works only if `checkboxSelection` is enabled.
|
|
460
|
-
* @default "deselect"
|
|
461
|
-
*/
|
|
462
|
-
indeterminateCheckboxAction: PropTypes.oneOf(['deselect', 'select']),
|
|
463
449
|
/**
|
|
464
450
|
* The initial state of the DataGridPremium.
|
|
465
451
|
* The data in it is set in the state on initialization but isn't controlled.
|
|
@@ -927,14 +913,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
927
913
|
* Controls the modes of the rows.
|
|
928
914
|
*/
|
|
929
915
|
rowModesModel: PropTypes.object,
|
|
930
|
-
/**
|
|
931
|
-
* The milliseconds delay to wait after measuring the row height before recalculating row positions.
|
|
932
|
-
* Setting it to a lower value could be useful when using dynamic row height,
|
|
933
|
-
* but might reduce performance when displaying a large number of rows.
|
|
934
|
-
* @default 166
|
|
935
|
-
* @deprecated
|
|
936
|
-
*/
|
|
937
|
-
rowPositionsDebounceMs: PropTypes.number,
|
|
938
916
|
/**
|
|
939
917
|
* If `true`, the reordering of rows is enabled.
|
|
940
918
|
* @default false
|
|
@@ -964,7 +942,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
964
942
|
* - Deselecting a descendant of a selected parent deselects the parent automatically.
|
|
965
943
|
*
|
|
966
944
|
* Works with tree data and row grouping on the client-side only.
|
|
967
|
-
* @default { parents:
|
|
945
|
+
* @default { parents: true, descendants: true }
|
|
968
946
|
*/
|
|
969
947
|
rowSelectionPropagation: PropTypes.shape({
|
|
970
948
|
descendants: PropTypes.bool,
|
|
@@ -974,7 +952,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
974
952
|
* Loading rows can be processed on the server or client-side.
|
|
975
953
|
* Set it to 'client' if you would like enable infnite loading.
|
|
976
954
|
* Set it to 'server' if you would like to enable lazy loading.
|
|
977
|
-
*
|
|
955
|
+
* @default "client"
|
|
978
956
|
*/
|
|
979
957
|
rowsLoadingMode: PropTypes.oneOf(['client', 'server']),
|
|
980
958
|
/**
|
|
@@ -982,12 +960,18 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
982
960
|
* @default "margin"
|
|
983
961
|
*/
|
|
984
962
|
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
963
|
+
/**
|
|
964
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
965
|
+
* @default false
|
|
966
|
+
*/
|
|
967
|
+
rowSpanning: PropTypes.bool,
|
|
985
968
|
/**
|
|
986
969
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
987
970
|
*/
|
|
988
971
|
scrollbarSize: PropTypes.number,
|
|
989
972
|
/**
|
|
990
973
|
* Set the area in `px` at the bottom of the grid viewport where onRowsScrollEnd is called.
|
|
974
|
+
* If combined with `unstable_lazyLoading`, it defines the area where the next data request is triggered.
|
|
991
975
|
* @default 80
|
|
992
976
|
*/
|
|
993
977
|
scrollEndThreshold: PropTypes.number,
|
|
@@ -1051,6 +1035,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1051
1035
|
*/
|
|
1052
1036
|
treeData: PropTypes.bool,
|
|
1053
1037
|
unstable_dataSource: PropTypes.shape({
|
|
1038
|
+
getAggregatedValue: PropTypes.func,
|
|
1054
1039
|
getChildrenCount: PropTypes.func,
|
|
1055
1040
|
getGroupKey: PropTypes.func,
|
|
1056
1041
|
getRows: PropTypes.func.isRequired,
|
|
@@ -1061,6 +1046,18 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1061
1046
|
get: PropTypes.func.isRequired,
|
|
1062
1047
|
set: PropTypes.func.isRequired
|
|
1063
1048
|
}),
|
|
1049
|
+
/**
|
|
1050
|
+
* Used together with `unstable_dataSource` to enable lazy loading.
|
|
1051
|
+
* If enabled, the grid stops adding `paginationModel` to the data requests (`getRows`)
|
|
1052
|
+
* and starts sending `start` and `end` values depending on the loading mode and the scroll position.
|
|
1053
|
+
* @default false
|
|
1054
|
+
*/
|
|
1055
|
+
unstable_lazyLoading: PropTypes.bool,
|
|
1056
|
+
/**
|
|
1057
|
+
* If positive, the Data Grid will throttle data source requests on rendered rows interval change.
|
|
1058
|
+
* @default 500
|
|
1059
|
+
*/
|
|
1060
|
+
unstable_lazyLoadingRequestThrottleMs: PropTypes.number,
|
|
1064
1061
|
/**
|
|
1065
1062
|
* Definition of the column rendered when the `unstable_listView` prop is enabled.
|
|
1066
1063
|
*/
|
|
@@ -1078,10 +1075,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1078
1075
|
unstable_listView: PropTypes.bool,
|
|
1079
1076
|
unstable_onDataSourceError: PropTypes.func,
|
|
1080
1077
|
/**
|
|
1081
|
-
* If `true`, the Data Grid
|
|
1078
|
+
* If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
|
|
1079
|
+
* By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
|
|
1080
|
+
* For datasets with a large number of columns, this can cause performance issues.
|
|
1081
|
+
* The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
|
|
1082
1082
|
* @default false
|
|
1083
1083
|
*/
|
|
1084
|
-
|
|
1084
|
+
virtualizeColumnsWithAutoRowHeight: PropTypes.bool
|
|
1085
1085
|
} : void 0;
|
|
1086
1086
|
/**
|
|
1087
1087
|
* Demos:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors,
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, useGridDataSourceLazyLoader, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import { useGridDataSourcePremium as useGridDataSource } from "../hooks/features/dataSource/useGridDataSourcePremium.js";
|
|
2
3
|
// Premium-only features
|
|
3
4
|
import { useGridAggregation, aggregationStateInitializer } from "../hooks/features/aggregation/useGridAggregation.js";
|
|
4
5
|
import { useGridAggregationPreProcessors } from "../hooks/features/aggregation/useGridAggregationPreProcessors.js";
|
|
@@ -42,6 +43,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
42
43
|
useGridInitializeState(columnPinningStateInitializer, apiRef, props);
|
|
43
44
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
44
45
|
useGridInitializeState(rowPinningStateInitializer, apiRef, props);
|
|
46
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
45
47
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
46
48
|
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
47
49
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
@@ -52,7 +54,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
52
54
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
53
55
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
54
56
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
55
|
-
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
56
57
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
57
58
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
58
59
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
@@ -63,6 +64,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
63
64
|
useGridHeaderFiltering(apiRef, props);
|
|
64
65
|
useGridTreeData(apiRef, props);
|
|
65
66
|
useGridAggregation(apiRef, props);
|
|
67
|
+
useGridDataSource(apiRef, props);
|
|
66
68
|
useGridKeyboardNavigation(apiRef, props);
|
|
67
69
|
useGridRowSelection(apiRef, props);
|
|
68
70
|
useGridCellSelection(apiRef, props);
|
|
@@ -90,6 +92,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
90
92
|
useGridScroll(apiRef, props);
|
|
91
93
|
useGridInfiniteLoader(apiRef, props);
|
|
92
94
|
useGridLazyLoader(apiRef, props);
|
|
95
|
+
useGridDataSourceLazyLoader(apiRef, props);
|
|
93
96
|
useGridColumnMenu(apiRef);
|
|
94
97
|
useGridCsvExport(apiRef, props);
|
|
95
98
|
useGridPrintExport(apiRef, props);
|
|
@@ -98,7 +101,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
98
101
|
useGridDimensions(apiRef, props);
|
|
99
102
|
useGridEvents(apiRef, props);
|
|
100
103
|
useGridStatePersistence(apiRef);
|
|
101
|
-
useGridDataSource(apiRef, props);
|
|
102
104
|
useGridVirtualization(apiRef, props);
|
|
103
105
|
useGridListView(apiRef, props);
|
|
104
106
|
return apiRef;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT, GridSignature } from '@mui/x-data-grid-pro';
|
|
5
|
-
import { computeSlots
|
|
5
|
+
import { computeSlots } from '@mui/x-data-grid-pro/internals';
|
|
6
6
|
import { GRID_AGGREGATION_FUNCTIONS } from "../hooks/features/aggregation/index.js";
|
|
7
7
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridPremiumDefaultSlotsComponents.js";
|
|
8
8
|
const getDataGridPremiumForcedProps = themedProps => _extends({
|
|
@@ -34,18 +34,20 @@ export const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO
|
|
|
34
34
|
});
|
|
35
35
|
const defaultSlots = DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS;
|
|
36
36
|
export const useDataGridPremiumProps = inProps => {
|
|
37
|
-
const themedProps =
|
|
37
|
+
const themedProps =
|
|
38
38
|
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
39
39
|
useThemeProps({
|
|
40
40
|
props: inProps,
|
|
41
41
|
name: 'MuiDataGrid'
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
43
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
44
44
|
const slots = React.useMemo(() => computeSlots({
|
|
45
45
|
defaultSlots,
|
|
46
46
|
slots: themedProps.slots
|
|
47
47
|
}), [themedProps.slots]);
|
|
48
|
-
return React.useMemo(() => _extends({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps
|
|
48
|
+
return React.useMemo(() => _extends({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps.unstable_dataSource ? {
|
|
49
|
+
aggregationFunctions: {}
|
|
50
|
+
} : {}, themedProps, {
|
|
49
51
|
localeText,
|
|
50
52
|
slots
|
|
51
53
|
}, getDataGridPremiumForcedProps(themedProps)), [themedProps, localeText, slots]);
|
|
@@ -12,7 +12,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
const GridAggregationHeaderRoot = styled('div', {
|
|
13
13
|
name: 'MuiDataGrid',
|
|
14
14
|
slot: 'AggregationColumnHeader',
|
|
15
|
-
overridesResolver: (
|
|
15
|
+
overridesResolver: (props, styles) => {
|
|
16
|
+
const {
|
|
17
|
+
ownerState
|
|
18
|
+
} = props;
|
|
19
|
+
return [styles.aggregationColumnHeader, ownerState.colDef.headerAlign === 'left' && styles['aggregationColumnHeader--alignLeft'], ownerState.colDef.headerAlign === 'center' && styles['aggregationColumnHeader--alignCenter'], ownerState.colDef.headerAlign === 'right' && styles['aggregationColumnHeader--alignRight']];
|
|
20
|
+
}
|
|
16
21
|
})({
|
|
17
22
|
display: 'flex',
|
|
18
23
|
flexDirection: 'column',
|