@mui/x-data-grid-pro 8.0.0-beta.3 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +282 -96
- package/DataGridPro/DataGridPro.js +8 -7
- package/DataGridPro/useDataGridProComponent.d.ts +2 -2
- package/DataGridPro/useDataGridProComponent.js +2 -3
- package/esm/DataGridPro/DataGridPro.js +9 -8
- package/esm/DataGridPro/useDataGridProComponent.d.ts +2 -2
- package/esm/DataGridPro/useDataGridProComponent.js +2 -3
- package/esm/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +3 -6
- package/esm/hooks/features/dataSource/useGridDataSourceBasePro.js +36 -8
- package/esm/hooks/features/dataSource/utils.d.ts +3 -2
- package/esm/hooks/features/dataSource/utils.js +13 -1
- package/esm/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
- package/esm/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +1 -1
- package/esm/hooks/features/rowPinning/useGridRowPinning.d.ts +1 -1
- package/esm/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +38 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +1 -0
- package/esm/internals/index.js +1 -0
- package/esm/material/icons.d.ts +3 -6
- package/esm/material/icons.js +1 -1
- package/esm/material/index.d.ts +2 -2
- package/esm/models/dataGridProProps.d.ts +3 -3
- package/esm/models/gridProIconSlotsComponent.d.ts +6 -3
- package/esm/package.json +1 -1
- package/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +3 -6
- package/hooks/features/dataSource/useGridDataSourceBasePro.js +34 -6
- package/hooks/features/dataSource/utils.d.ts +3 -2
- package/hooks/features/dataSource/utils.js +15 -2
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +1 -1
- package/hooks/features/rowPinning/useGridRowPinning.d.ts +1 -1
- package/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +37 -0
- package/index.js +1 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +15 -7
- package/material/icons.d.ts +3 -6
- package/material/icons.js +3 -3
- package/material/index.d.ts +2 -2
- package/models/dataGridProProps.d.ts +3 -3
- package/models/gridProIconSlotsComponent.d.ts +6 -3
- package/package.json +8 -14
- package/esm/utils/releaseInfo.d.ts +0 -1
- package/esm/utils/releaseInfo.js +0 -13
- package/modern/DataGridPro/DataGrid.d.ts +0 -8
- package/modern/DataGridPro/DataGrid.js +0 -19
- package/modern/DataGridPro/DataGridPro.d.ts +0 -16
- package/modern/DataGridPro/DataGridPro.js +0 -1020
- package/modern/DataGridPro/index.d.ts +0 -3
- package/modern/DataGridPro/index.js +0 -3
- package/modern/DataGridPro/useDataGridProComponent.d.ts +0 -4
- package/modern/DataGridPro/useDataGridProComponent.js +0 -105
- package/modern/DataGridPro/useDataGridProProps.d.ts +0 -7
- package/modern/DataGridPro/useDataGridProProps.js +0 -54
- package/modern/components/GridColumnHeaders.d.ts +0 -5
- package/modern/components/GridColumnHeaders.js +0 -92
- package/modern/components/GridColumnMenuPinningItem.d.ts +0 -7
- package/modern/components/GridColumnMenuPinningItem.js +0 -77
- package/modern/components/GridDataSourceTreeDataGroupingCell.d.ts +0 -12
- package/modern/components/GridDataSourceTreeDataGroupingCell.js +0 -107
- package/modern/components/GridDetailPanel.d.ts +0 -14
- package/modern/components/GridDetailPanel.js +0 -53
- package/modern/components/GridDetailPanelToggleCell.d.ts +0 -7
- package/modern/components/GridDetailPanelToggleCell.js +0 -121
- package/modern/components/GridDetailPanels.d.ts +0 -3
- package/modern/components/GridDetailPanels.js +0 -67
- package/modern/components/GridPinnedRows.d.ts +0 -6
- package/modern/components/GridPinnedRows.js +0 -40
- package/modern/components/GridProColumnMenu.d.ts +0 -24
- package/modern/components/GridProColumnMenu.js +0 -21
- package/modern/components/GridRowReorderCell.d.ts +0 -8
- package/modern/components/GridRowReorderCell.js +0 -140
- package/modern/components/GridTreeDataGroupingCell.d.ts +0 -15
- package/modern/components/GridTreeDataGroupingCell.js +0 -133
- package/modern/components/headerFiltering/GridHeaderFilterCell.d.ts +0 -26
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +0 -362
- package/modern/components/headerFiltering/GridHeaderFilterClearButton.d.ts +0 -6
- package/modern/components/headerFiltering/GridHeaderFilterClearButton.js +0 -17
- package/modern/components/headerFiltering/GridHeaderFilterMenu.d.ts +0 -30
- package/modern/components/headerFiltering/GridHeaderFilterMenu.js +0 -137
- package/modern/components/headerFiltering/GridHeaderFilterMenuContainer.d.ts +0 -17
- package/modern/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -138
- package/modern/components/headerFiltering/index.d.ts +0 -3
- package/modern/components/headerFiltering/index.js +0 -3
- package/modern/components/index.d.ts +0 -6
- package/modern/components/index.js +0 -7
- package/modern/components/reexports.d.ts +0 -1
- package/modern/components/reexports.js +0 -1
- package/modern/constants/dataGridProDefaultSlotsComponents.d.ts +0 -2
- package/modern/constants/dataGridProDefaultSlotsComponents.js +0 -17
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -12
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -143
- package/modern/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +0 -40
- package/modern/hooks/features/columnPinning/gridColumnPinningInterface.js +0 -1
- package/modern/hooks/features/columnPinning/index.d.ts +0 -1
- package/modern/hooks/features/columnPinning/index.js +0 -1
- package/modern/hooks/features/columnPinning/useGridColumnPinning.d.ts +0 -6
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +0 -228
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +0 -4
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +0 -105
- package/modern/hooks/features/columnReorder/columnReorderInterfaces.d.ts +0 -6
- package/modern/hooks/features/columnReorder/columnReorderInterfaces.js +0 -1
- package/modern/hooks/features/columnReorder/columnReorderSelector.d.ts +0 -3
- package/modern/hooks/features/columnReorder/columnReorderSelector.js +0 -3
- package/modern/hooks/features/columnReorder/index.d.ts +0 -2
- package/modern/hooks/features/columnReorder/index.js +0 -2
- package/modern/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -9
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +0 -242
- package/modern/hooks/features/dataSource/gridDataSourceSelector.d.ts +0 -7
- package/modern/hooks/features/dataSource/gridDataSourceSelector.js +0 -6
- package/modern/hooks/features/dataSource/models.d.ts +0 -75
- package/modern/hooks/features/dataSource/models.js +0 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +0 -33
- package/modern/hooks/features/dataSource/useGridDataSourceBasePro.js +0 -179
- package/modern/hooks/features/dataSource/useGridDataSourcePro.d.ts +0 -6
- package/modern/hooks/features/dataSource/useGridDataSourcePro.js +0 -35
- package/modern/hooks/features/dataSource/utils.d.ts +0 -29
- package/modern/hooks/features/dataSource/utils.js +0 -82
- package/modern/hooks/features/detailPanel/gridDetailPanelInterface.d.ts +0 -41
- package/modern/hooks/features/detailPanel/gridDetailPanelInterface.js +0 -1
- package/modern/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +0 -14
- package/modern/hooks/features/detailPanel/gridDetailPanelSelector.js +0 -5
- package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.d.ts +0 -4
- package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +0 -34
- package/modern/hooks/features/detailPanel/index.d.ts +0 -3
- package/modern/hooks/features/detailPanel/index.js +0 -3
- package/modern/hooks/features/detailPanel/useGridDetailPanel.d.ts +0 -6
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +0 -191
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +0 -4
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +0 -43
- package/modern/hooks/features/index.d.ts +0 -7
- package/modern/hooks/features/index.js +0 -8
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -9
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +0 -104
- package/modern/hooks/features/lazyLoader/useGridLazyLoader.d.ts +0 -10
- package/modern/hooks/features/lazyLoader/useGridLazyLoader.js +0 -90
- package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +0 -5
- package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +0 -34
- package/modern/hooks/features/lazyLoader/utils.d.ts +0 -18
- package/modern/hooks/features/lazyLoader/utils.js +0 -34
- package/modern/hooks/features/rowPinning/gridRowPinningInterface.d.ts +0 -17
- package/modern/hooks/features/rowPinning/gridRowPinningInterface.js +0 -1
- package/modern/hooks/features/rowPinning/gridRowPinningSelector.d.ts +0 -1
- package/modern/hooks/features/rowPinning/gridRowPinningSelector.js +0 -1
- package/modern/hooks/features/rowPinning/index.d.ts +0 -1
- package/modern/hooks/features/rowPinning/index.js +0 -1
- package/modern/hooks/features/rowPinning/useGridRowPinning.d.ts +0 -6
- package/modern/hooks/features/rowPinning/useGridRowPinning.js +0 -52
- package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +0 -38
- package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +0 -119
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.d.ts +0 -2
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +0 -20
- package/modern/hooks/features/rowReorder/index.d.ts +0 -1
- package/modern/hooks/features/rowReorder/index.js +0 -1
- package/modern/hooks/features/rowReorder/useGridRowReorder.d.ts +0 -8
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +0 -141
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +0 -4
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +0 -46
- package/modern/hooks/features/rows/index.d.ts +0 -1
- package/modern/hooks/features/rows/index.js +0 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -3
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -37
- package/modern/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.d.ts +0 -10
- package/modern/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +0 -325
- package/modern/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +0 -4
- package/modern/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +0 -148
- package/modern/hooks/features/serverSideTreeData/utils.d.ts +0 -7
- package/modern/hooks/features/serverSideTreeData/utils.js +0 -18
- package/modern/hooks/features/treeData/gridTreeDataGroupColDef.d.ts +0 -8
- package/modern/hooks/features/treeData/gridTreeDataGroupColDef.js +0 -27
- package/modern/hooks/features/treeData/gridTreeDataUtils.d.ts +0 -22
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +0 -95
- package/modern/hooks/features/treeData/index.d.ts +0 -1
- package/modern/hooks/features/treeData/index.js +0 -1
- package/modern/hooks/features/treeData/useGridTreeData.d.ts +0 -4
- package/modern/hooks/features/treeData/useGridTreeData.js +0 -22
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +0 -4
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +0 -148
- package/modern/hooks/index.d.ts +0 -1
- package/modern/hooks/index.js +0 -1
- package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
- package/modern/hooks/utils/useGridApiContext.js +0 -2
- package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
- package/modern/hooks/utils/useGridApiRef.js +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.js +0 -11
- package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
- package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
- package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
- package/modern/hooks/utils/useGridRootProps.js +0 -2
- package/modern/index.d.ts +0 -22
- package/modern/index.js +0 -25
- package/modern/internals/index.d.ts +0 -33
- package/modern/internals/index.js +0 -38
- package/modern/internals/propValidation.d.ts +0 -3
- package/modern/internals/propValidation.js +0 -2
- package/modern/locales.d.ts +0 -1
- package/modern/locales.js +0 -1
- package/modern/material/icons.d.ts +0 -6
- package/modern/material/icons.js +0 -17
- package/modern/material/index.d.ts +0 -5
- package/modern/material/index.js +0 -8
- package/modern/models/dataGridProProps.d.ts +0 -222
- package/modern/models/dataGridProProps.js +0 -1
- package/modern/models/gridApiPro.d.ts +0 -11
- package/modern/models/gridApiPro.js +0 -1
- package/modern/models/gridFetchRowsParams.d.ts +0 -22
- package/modern/models/gridFetchRowsParams.js +0 -1
- package/modern/models/gridGroupingColDefOverride.d.ts +0 -30
- package/modern/models/gridGroupingColDefOverride.js +0 -1
- package/modern/models/gridProIconSlotsComponent.d.ts +0 -13
- package/modern/models/gridProIconSlotsComponent.js +0 -1
- package/modern/models/gridProSlotProps.d.ts +0 -8
- package/modern/models/gridProSlotProps.js +0 -1
- package/modern/models/gridProSlotsComponent.d.ts +0 -18
- package/modern/models/gridProSlotsComponent.js +0 -1
- package/modern/models/gridRowOrderChangeParams.d.ts +0 -18
- package/modern/models/gridRowOrderChangeParams.js +0 -1
- package/modern/models/gridRowScrollEndParams.d.ts +0 -18
- package/modern/models/gridRowScrollEndParams.js +0 -1
- package/modern/models/gridStatePro.d.ts +0 -19
- package/modern/models/gridStatePro.js +0 -1
- package/modern/models/index.d.ts +0 -7
- package/modern/models/index.js +0 -7
- package/modern/package.json +0 -1
- package/modern/themeAugmentation/index.d.ts +0 -2
- package/modern/themeAugmentation/index.js +0 -4
- package/modern/themeAugmentation/overrides.d.ts +0 -7
- package/modern/themeAugmentation/overrides.js +0 -1
- package/modern/themeAugmentation/props.d.ts +0 -15
- package/modern/themeAugmentation/props.js +0 -1
- package/modern/typeOverloads/index.d.ts +0 -1
- package/modern/typeOverloads/index.js +0 -1
- package/modern/typeOverloads/modules.d.ts +0 -70
- package/modern/typeOverloads/modules.js +0 -1
- package/modern/typeOverloads/reexports.d.ts +0 -17
- package/modern/typeOverloads/reexports.js +0 -15
- package/modern/utils/index.d.ts +0 -1
- package/modern/utils/index.js +0 -1
- package/modern/utils/releaseInfo.d.ts +0 -1
- package/modern/utils/releaseInfo.js +0 -13
- package/modern/utils/tree/createRowTree.d.ts +0 -17
- package/modern/utils/tree/createRowTree.js +0 -37
- package/modern/utils/tree/index.d.ts +0 -1
- package/modern/utils/tree/index.js +0 -1
- package/modern/utils/tree/insertDataRowInTree.d.ts +0 -69
- package/modern/utils/tree/insertDataRowInTree.js +0 -141
- package/modern/utils/tree/models.d.ts +0 -14
- package/modern/utils/tree/models.js +0 -1
- package/modern/utils/tree/removeDataRowFromTree.d.ts +0 -45
- package/modern/utils/tree/removeDataRowFromTree.js +0 -94
- package/modern/utils/tree/sortRowTree.d.ts +0 -15
- package/modern/utils/tree/sortRowTree.js +0 -114
- package/modern/utils/tree/updateRowTree.d.ts +0 -20
- package/modern/utils/tree/updateRowTree.js +0 -88
- package/modern/utils/tree/utils.d.ts +0 -54
- package/modern/utils/tree/utils.js +0 -197
- package/tsconfig.build.tsbuildinfo +0 -1
- package/utils/releaseInfo.d.ts +0 -1
- package/utils/releaseInfo.js +0 -20
|
@@ -17,7 +17,6 @@ var _material = require("@mui/x-data-grid/material");
|
|
|
17
17
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
18
18
|
var _useDataGridProComponent = require("./useDataGridProComponent");
|
|
19
19
|
var _useDataGridProProps = require("./useDataGridProProps");
|
|
20
|
-
var _releaseInfo = require("../utils/releaseInfo");
|
|
21
20
|
var _propValidation = require("../internals/propValidation");
|
|
22
21
|
var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
|
|
23
22
|
var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
|
|
@@ -26,17 +25,19 @@ const configuration = {
|
|
|
26
25
|
hooks: {
|
|
27
26
|
useCSSVariables: _material.useMaterialCSSVariables,
|
|
28
27
|
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributes,
|
|
29
|
-
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes
|
|
28
|
+
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes,
|
|
29
|
+
useCellAggregationResult: () => null
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const releaseInfo =
|
|
32
|
+
const releaseInfo = "MTc0NDg0MDgwMDAwMA==";
|
|
33
33
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
34
34
|
packageName: "x-data-grid-pro",
|
|
35
35
|
releaseInfo: releaseInfo
|
|
36
36
|
});
|
|
37
37
|
const DataGridProRaw = (0, _forwardRef.forwardRef)(function DataGridPro(inProps, ref) {
|
|
38
38
|
const props = (0, _useDataGridProProps.useDataGridProProps)(inProps);
|
|
39
|
-
const privateApiRef = (0,
|
|
39
|
+
const privateApiRef = (0, _internals.useGridApiInitialization)(props.apiRef, props);
|
|
40
|
+
(0, _useDataGridProComponent.useDataGridProComponent)(privateApiRef, props);
|
|
40
41
|
(0, _xLicense.useLicenseVerifier)('x-data-grid-pro', releaseInfo);
|
|
41
42
|
if (process.env.NODE_ENV !== 'production') {
|
|
42
43
|
(0, _internals.validateProps)(props, _propValidation.propValidatorsDataGridPro);
|
|
@@ -674,7 +675,7 @@ DataGridProRaw.propTypes = {
|
|
|
674
675
|
* @param {GridFetchRowsParams} params With all properties from [[GridFetchRowsParams]].
|
|
675
676
|
* @param {MuiEvent<{}>} event The event object.
|
|
676
677
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
677
|
-
* @deprecated Use the {@link https://
|
|
678
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
678
679
|
*/
|
|
679
680
|
onFetchRows: _propTypes.default.func,
|
|
680
681
|
/**
|
|
@@ -796,7 +797,7 @@ DataGridProRaw.propTypes = {
|
|
|
796
797
|
* @param {GridRowScrollEndParams} params With all properties from [[GridRowScrollEndParams]].
|
|
797
798
|
* @param {MuiEvent<{}>} event The event object.
|
|
798
799
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
799
|
-
* @deprecated Use the {@link https://
|
|
800
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading Server-side data-Infinite loading} instead.
|
|
800
801
|
*/
|
|
801
802
|
onRowsScrollEnd: _propTypes.default.func,
|
|
802
803
|
/**
|
|
@@ -935,7 +936,7 @@ DataGridProRaw.propTypes = {
|
|
|
935
936
|
* Set it to 'client' if you would like enable infnite loading.
|
|
936
937
|
* Set it to 'server' if you would like to enable lazy loading.
|
|
937
938
|
* @default "client"
|
|
938
|
-
* @deprecated Use the {@link https://
|
|
939
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
939
940
|
*/
|
|
940
941
|
rowsLoadingMode: _propTypes.default.oneOf(['client', 'server']),
|
|
941
942
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import {
|
|
2
|
+
import { GridPrivateApiPro } from "../models/gridApiPro.js";
|
|
3
3
|
import { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
4
|
-
export declare const useDataGridProComponent: (
|
|
4
|
+
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
@@ -24,8 +24,8 @@ var _useGridDataSourcePro = require("../hooks/features/dataSource/useGridDataSou
|
|
|
24
24
|
var _useGridDataSourceLazyLoader = require("../hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader");
|
|
25
25
|
// Pro-only features
|
|
26
26
|
|
|
27
|
-
const useDataGridProComponent = (
|
|
28
|
-
|
|
27
|
+
const useDataGridProComponent = (apiRef, props) => {
|
|
28
|
+
(0, _internals.useGridInitialization)(apiRef, props);
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Register all pre-processors called during state initialization here.
|
|
@@ -108,6 +108,5 @@ const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
108
108
|
(0, _internals.useGridVirtualization)(apiRef, props);
|
|
109
109
|
(0, _useGridDataSourcePro.useGridDataSourcePro)(apiRef, props);
|
|
110
110
|
(0, _internals.useGridListView)(apiRef, props);
|
|
111
|
-
return apiRef;
|
|
112
111
|
};
|
|
113
112
|
exports.useDataGridProComponent = useDataGridProComponent;
|
|
@@ -5,12 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
7
|
import { GridRoot, GridContextProvider } from '@mui/x-data-grid';
|
|
8
|
-
import { validateProps } from '@mui/x-data-grid/internals';
|
|
8
|
+
import { validateProps, useGridApiInitialization } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { useMaterialCSSVariables } from '@mui/x-data-grid/material';
|
|
10
10
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
11
11
|
import { useDataGridProComponent } from "./useDataGridProComponent.js";
|
|
12
12
|
import { useDataGridProProps } from "./useDataGridProProps.js";
|
|
13
|
-
import { getReleaseInfo } from "../utils/releaseInfo.js";
|
|
14
13
|
import { propValidatorsDataGridPro } from "../internals/propValidation.js";
|
|
15
14
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
16
15
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
@@ -19,17 +18,19 @@ const configuration = {
|
|
|
19
18
|
hooks: {
|
|
20
19
|
useCSSVariables: useMaterialCSSVariables,
|
|
21
20
|
useGridAriaAttributes,
|
|
22
|
-
useGridRowAriaAttributes
|
|
21
|
+
useGridRowAriaAttributes,
|
|
22
|
+
useCellAggregationResult: () => null
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const releaseInfo =
|
|
25
|
+
const releaseInfo = "MTc0NDg0MDgwMDAwMA==";
|
|
26
26
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
27
27
|
packageName: "x-data-grid-pro",
|
|
28
28
|
releaseInfo: releaseInfo
|
|
29
29
|
});
|
|
30
30
|
const DataGridProRaw = forwardRef(function DataGridPro(inProps, ref) {
|
|
31
31
|
const props = useDataGridProProps(inProps);
|
|
32
|
-
const privateApiRef =
|
|
32
|
+
const privateApiRef = useGridApiInitialization(props.apiRef, props);
|
|
33
|
+
useDataGridProComponent(privateApiRef, props);
|
|
33
34
|
useLicenseVerifier('x-data-grid-pro', releaseInfo);
|
|
34
35
|
if (process.env.NODE_ENV !== 'production') {
|
|
35
36
|
validateProps(props, propValidatorsDataGridPro);
|
|
@@ -667,7 +668,7 @@ DataGridProRaw.propTypes = {
|
|
|
667
668
|
* @param {GridFetchRowsParams} params With all properties from [[GridFetchRowsParams]].
|
|
668
669
|
* @param {MuiEvent<{}>} event The event object.
|
|
669
670
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
670
|
-
* @deprecated Use the {@link https://
|
|
671
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
671
672
|
*/
|
|
672
673
|
onFetchRows: PropTypes.func,
|
|
673
674
|
/**
|
|
@@ -789,7 +790,7 @@ DataGridProRaw.propTypes = {
|
|
|
789
790
|
* @param {GridRowScrollEndParams} params With all properties from [[GridRowScrollEndParams]].
|
|
790
791
|
* @param {MuiEvent<{}>} event The event object.
|
|
791
792
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
792
|
-
* @deprecated Use the {@link https://
|
|
793
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading Server-side data-Infinite loading} instead.
|
|
793
794
|
*/
|
|
794
795
|
onRowsScrollEnd: PropTypes.func,
|
|
795
796
|
/**
|
|
@@ -928,7 +929,7 @@ DataGridProRaw.propTypes = {
|
|
|
928
929
|
* Set it to 'client' if you would like enable infnite loading.
|
|
929
930
|
* Set it to 'server' if you would like to enable lazy loading.
|
|
930
931
|
* @default "client"
|
|
931
|
-
* @deprecated Use the {@link https://
|
|
932
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
932
933
|
*/
|
|
933
934
|
rowsLoadingMode: PropTypes.oneOf(['client', 'server']),
|
|
934
935
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import {
|
|
2
|
+
import { GridPrivateApiPro } from "../models/gridApiPro.js";
|
|
3
3
|
import { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
4
|
-
export declare const useDataGridProComponent: (
|
|
4
|
+
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
@@ -17,8 +17,8 @@ import { useGridRowPinning, rowPinningStateInitializer } from "../hooks/features
|
|
|
17
17
|
import { useGridRowPinningPreProcessors } from "../hooks/features/rowPinning/useGridRowPinningPreProcessors.js";
|
|
18
18
|
import { useGridDataSourcePro as useGridDataSource, dataSourceStateInitializer } from "../hooks/features/dataSource/useGridDataSourcePro.js";
|
|
19
19
|
import { useGridDataSourceLazyLoader } from "../hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js";
|
|
20
|
-
export const useDataGridProComponent = (
|
|
21
|
-
|
|
20
|
+
export const useDataGridProComponent = (apiRef, props) => {
|
|
21
|
+
useGridInitialization(apiRef, props);
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Register all pre-processors called during state initialization here.
|
|
@@ -101,5 +101,4 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
101
101
|
useGridVirtualization(apiRef, props);
|
|
102
102
|
useGridDataSource(apiRef, props);
|
|
103
103
|
useGridListView(apiRef, props);
|
|
104
|
-
return apiRef;
|
|
105
104
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import {
|
|
3
|
-
import { CacheChunkManager, DataSourceRowsUpdateStrategy } from '@mui/x-data-grid/internals';
|
|
2
|
+
import { CacheChunkManager, DataSourceRowsUpdateStrategy, GridDataSourceBaseOptions } from '@mui/x-data-grid/internals';
|
|
4
3
|
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
5
4
|
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
6
5
|
import { GridDataSourceApiPro, GridDataSourcePrivateApiPro } from "./models.js";
|
|
@@ -8,14 +7,12 @@ export declare const INITIAL_STATE: {
|
|
|
8
7
|
loading: {};
|
|
9
8
|
errors: {};
|
|
10
9
|
};
|
|
11
|
-
export declare const useGridDataSourceBasePro: <Api extends GridPrivateApiPro>(apiRef: RefObject<Api>, props: DataGridProProcessedProps, options?: {
|
|
12
|
-
cacheOptions?: GridDataSourceCacheDefaultConfig;
|
|
13
|
-
fetchRowChildren?: (parentId: GridRowId) => void;
|
|
14
|
-
}) => {
|
|
10
|
+
export declare const useGridDataSourceBasePro: <Api extends GridPrivateApiPro>(apiRef: RefObject<Api>, props: DataGridProProcessedProps, options?: GridDataSourceBaseOptions) => {
|
|
15
11
|
api: {
|
|
16
12
|
public: GridDataSourceApiPro;
|
|
17
13
|
private: GridDataSourcePrivateApiPro;
|
|
18
14
|
};
|
|
15
|
+
debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: Partial<import("@mui/x-data-grid").GridGetRowsParams>) => void) & import("@mui/utils/debounce").Cancelable;
|
|
19
16
|
strategyProcessor: {
|
|
20
17
|
strategyName: DataSourceRowsUpdateStrategy;
|
|
21
18
|
group: "dataSourceRowsUpdate";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
|
|
3
4
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
-
import { useGridSelector, GridGetRowsError } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridSelector, GridGetRowsError, gridRowIdSelector, gridRowNodeSelector, gridRowTreeSelector } from '@mui/x-data-grid';
|
|
5
6
|
import { gridRowGroupsToFetchSelector, useGridDataSourceBase, CacheChunkManager, gridGetRowsParamsSelector, DataSourceRowsUpdateStrategy, GridStrategyGroup } from '@mui/x-data-grid/internals';
|
|
6
7
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
7
|
-
import { NestedDataManager, RequestStatus } from "./utils.js";
|
|
8
|
+
import { NestedDataManager, RequestStatus, getGroupKeys } from "./utils.js";
|
|
8
9
|
import { gridDataSourceErrorsSelector } from "./gridDataSourceSelector.js";
|
|
9
10
|
export const INITIAL_STATE = {
|
|
10
11
|
loading: {},
|
|
@@ -23,16 +24,26 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
|
|
|
23
24
|
}
|
|
24
25
|
return null;
|
|
25
26
|
}, [apiRef, nestedDataManager]);
|
|
27
|
+
const handleEditRow = React.useCallback((params, updatedRow) => {
|
|
28
|
+
const groupKeys = getGroupKeys(gridRowTreeSelector(apiRef), params.rowId);
|
|
29
|
+
apiRef.current.updateNestedRows([updatedRow], groupKeys);
|
|
30
|
+
if (updatedRow && !isDeepEqual(updatedRow, params.previousRow)) {
|
|
31
|
+
// Reset the outdated cache, only if the row is _actually_ updated
|
|
32
|
+
apiRef.current.dataSource.cache.clear();
|
|
33
|
+
}
|
|
34
|
+
}, [apiRef]);
|
|
26
35
|
const {
|
|
27
36
|
api,
|
|
37
|
+
debouncedFetchRows,
|
|
28
38
|
strategyProcessor,
|
|
29
39
|
events,
|
|
30
40
|
cacheChunkManager,
|
|
31
41
|
cache
|
|
32
|
-
} = useGridDataSourceBase(apiRef, props, _extends({
|
|
42
|
+
} = useGridDataSourceBase(apiRef, props, _extends({
|
|
33
43
|
fetchRowChildren: nestedDataManager.queue,
|
|
34
|
-
clearDataSourceState
|
|
35
|
-
|
|
44
|
+
clearDataSourceState,
|
|
45
|
+
handleEditRow
|
|
46
|
+
}, options));
|
|
36
47
|
const setStrategyAvailability = React.useCallback(() => {
|
|
37
48
|
apiRef.current.setStrategyAvailability(GridStrategyGroup.DataSource, DataSourceRowsUpdateStrategy.Default, props.dataSource && !props.lazyLoading ? () => true : () => false);
|
|
38
49
|
}, [apiRef, props.dataSource, props.lazyLoading]);
|
|
@@ -62,7 +73,7 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
|
|
|
62
73
|
if (cachedData !== undefined) {
|
|
63
74
|
const rows = cachedData.rows;
|
|
64
75
|
nestedDataManager.setRequestSettled(id);
|
|
65
|
-
apiRef.current.
|
|
76
|
+
apiRef.current.updateNestedRows(rows, rowNode.path);
|
|
66
77
|
apiRef.current.setRowCount(cachedData.rowCount === undefined ? -1 : cachedData.rowCount);
|
|
67
78
|
apiRef.current.setRowChildrenExpansion(id, true);
|
|
68
79
|
apiRef.current.dataSource.setChildrenLoading(id, false);
|
|
@@ -89,7 +100,23 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
|
|
|
89
100
|
cache.set(key, response);
|
|
90
101
|
});
|
|
91
102
|
apiRef.current.setRowCount(getRowsResponse.rowCount === undefined ? -1 : getRowsResponse.rowCount);
|
|
92
|
-
|
|
103
|
+
// Remove existing outdated rows before setting the new ones
|
|
104
|
+
const rowsToDelete = [];
|
|
105
|
+
getRowsResponse.rows.forEach(row => {
|
|
106
|
+
const rowId = gridRowIdSelector(apiRef, row);
|
|
107
|
+
const treeNode = gridRowNodeSelector(apiRef, rowId);
|
|
108
|
+
if (treeNode) {
|
|
109
|
+
rowsToDelete.push({
|
|
110
|
+
id: rowId,
|
|
111
|
+
_action: 'delete'
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
if (rowsToDelete.length > 0) {
|
|
116
|
+
// TODO: Make this happen in a single pass by modifying the pre-processing of the rows
|
|
117
|
+
apiRef.current.updateNestedRows(rowsToDelete, rowNode.path);
|
|
118
|
+
}
|
|
119
|
+
apiRef.current.updateNestedRows(getRowsResponse.rows, rowNode.path);
|
|
93
120
|
apiRef.current.setRowChildrenExpansion(id, true);
|
|
94
121
|
} catch (error) {
|
|
95
122
|
const childrenFetchError = error;
|
|
@@ -101,7 +128,7 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
|
|
|
101
128
|
cause: childrenFetchError
|
|
102
129
|
}));
|
|
103
130
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
104
|
-
warnOnce(['MUI X: A call to `dataSource.getRows()` threw an error which was not handled because `
|
|
131
|
+
warnOnce(['MUI X: A call to `dataSource.getRows()` threw an error which was not handled because `onDataSourceError()` is missing.', 'To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling.'], 'error');
|
|
105
132
|
}
|
|
106
133
|
} finally {
|
|
107
134
|
apiRef.current.dataSource.setChildrenLoading(id, false);
|
|
@@ -170,6 +197,7 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
|
|
|
170
197
|
public: dataSourceApi,
|
|
171
198
|
private: dataSourcePrivateApi
|
|
172
199
|
},
|
|
200
|
+
debouncedFetchRows,
|
|
173
201
|
strategyProcessor,
|
|
174
202
|
events,
|
|
175
203
|
setStrategyAvailability,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridRowId } from '@mui/x-data-grid';
|
|
2
|
+
import { GridKeyValue, GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
3
3
|
import { GridPrivateApiPro } from "../../../models/index.js";
|
|
4
4
|
export declare enum RequestStatus {
|
|
5
5
|
QUEUED = 0,
|
|
@@ -26,4 +26,5 @@ export declare class NestedDataManager {
|
|
|
26
26
|
clearPendingRequest: (id: GridRowId) => void;
|
|
27
27
|
getRequestStatus: (id: GridRowId) => RequestStatus;
|
|
28
28
|
getActiveRequestsCount: () => number;
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
|
+
export declare const getGroupKeys: (tree: GridRowTreeConfig, rowId: GridRowId) => GridKeyValue[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
|
|
2
3
|
const MAX_CONCURRENT_REQUESTS = Infinity;
|
|
3
4
|
export let RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
4
5
|
RequestStatus[RequestStatus["QUEUED"] = 0] = "QUEUED";
|
|
@@ -79,4 +80,15 @@ export class NestedDataManager {
|
|
|
79
80
|
this.api = privateApiRef.current;
|
|
80
81
|
this.maxConcurrentRequests = maxConcurrentRequests;
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
+
}
|
|
84
|
+
export const getGroupKeys = (tree, rowId) => {
|
|
85
|
+
const rowNode = tree[rowId];
|
|
86
|
+
let currentNodeId = rowNode.parent;
|
|
87
|
+
const groupKeys = [];
|
|
88
|
+
while (currentNodeId && currentNodeId !== GRID_ROOT_GROUP_ID) {
|
|
89
|
+
const currentNode = tree[currentNodeId];
|
|
90
|
+
groupKeys.push(currentNode.groupingKey ?? '');
|
|
91
|
+
currentNodeId = currentNode.parent;
|
|
92
|
+
}
|
|
93
|
+
return groupKeys.reverse();
|
|
94
|
+
};
|
|
@@ -7,4 +7,4 @@ import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
|
7
7
|
* @requires useGridDimensions (method) - can be after
|
|
8
8
|
* @requires useGridScroll (method
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridLazyLoader: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onFetchRows" | "rowsLoadingMode" | "pagination" | "paginationMode"
|
|
10
|
+
export declare const useGridLazyLoader: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onFetchRows" | "rowsLoadingMode" | "pagination" | "paginationMode">) => void;
|
|
@@ -2,4 +2,4 @@ import { RefObject } from '@mui/x-internals/types';
|
|
|
2
2
|
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
3
3
|
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
4
4
|
export declare const GRID_SKELETON_ROW_ROOT_ID = "auto-generated-skeleton-row-root";
|
|
5
|
-
export declare const useGridLazyLoaderPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowCount" | "rowsLoadingMode"
|
|
5
|
+
export declare const useGridLazyLoaderPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowCount" | "rowsLoadingMode">) => void;
|
|
@@ -2,5 +2,5 @@ import { RefObject } from '@mui/x-internals/types';
|
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
4
4
|
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
5
|
-
export declare const rowPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedRows' | 'getRowId'
|
|
5
|
+
export declare const rowPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedRows' | 'getRowId'>>;
|
|
6
6
|
export declare const useGridRowPinning: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "pinnedRows" | "getRowId">) => void;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { throttle } from '@mui/x-internals/throttle';
|
|
4
4
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
5
|
-
import { useGridEvent, gridSortModelSelector, gridFilterModelSelector, GRID_ROOT_GROUP_ID, gridPaginationModelSelector, gridDimensionsSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridEvent, gridSortModelSelector, gridFilterModelSelector, GRID_ROOT_GROUP_ID, gridPaginationModelSelector, gridDimensionsSelector, gridFilteredSortedRowIdsSelector, gridRowIdSelector } from '@mui/x-data-grid';
|
|
6
6
|
import { getVisibleRows, gridRenderContextSelector, GridStrategyGroup, useGridRegisterStrategyProcessor, runIf, DataSourceRowsUpdateStrategy } from '@mui/x-data-grid/internals';
|
|
7
7
|
import { findSkeletonRowsSection } from "../lazyLoader/utils.js";
|
|
8
8
|
import { GRID_SKELETON_ROW_ROOT_ID } from "../lazyLoader/useGridLazyLoaderPreProcessors.js";
|
|
@@ -176,6 +176,8 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
176
176
|
fetchParams
|
|
177
177
|
} = params;
|
|
178
178
|
const pageRowCount = privateApiRef.current.state.pagination.rowCount;
|
|
179
|
+
const tree = privateApiRef.current.state.rows.tree;
|
|
180
|
+
const dataRowIdToModelLookup = privateApiRef.current.state.rows.dataRowIdToModelLookup;
|
|
179
181
|
if (response.rowCount !== undefined || pageRowCount === undefined) {
|
|
180
182
|
privateApiRef.current.setRowCount(response.rowCount === undefined ? -1 : response.rowCount);
|
|
181
183
|
}
|
|
@@ -188,8 +190,43 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
188
190
|
// the rows can safely be replaced. skeleton rows will be added later
|
|
189
191
|
privateApiRef.current.setRows(response.rows);
|
|
190
192
|
} else {
|
|
193
|
+
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
194
|
+
const rootGroupChildren = [...rootGroup.children];
|
|
191
195
|
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(privateApiRef);
|
|
192
196
|
const startingIndex = typeof fetchParams.start === 'string' ? Math.max(filteredSortedRowIds.indexOf(fetchParams.start), 0) : fetchParams.start;
|
|
197
|
+
|
|
198
|
+
// Check for duplicate rows
|
|
199
|
+
let duplicateRowCount = 0;
|
|
200
|
+
response.rows.forEach(row => {
|
|
201
|
+
const rowId = gridRowIdSelector(privateApiRef, row);
|
|
202
|
+
if (tree[rowId] || dataRowIdToModelLookup[rowId]) {
|
|
203
|
+
const index = rootGroupChildren.indexOf(rowId);
|
|
204
|
+
if (index !== -1) {
|
|
205
|
+
const skeletonId = getSkeletonRowId(index);
|
|
206
|
+
rootGroupChildren[index] = skeletonId;
|
|
207
|
+
tree[skeletonId] = {
|
|
208
|
+
type: 'skeletonRow',
|
|
209
|
+
id: skeletonId,
|
|
210
|
+
parent: GRID_ROOT_GROUP_ID,
|
|
211
|
+
depth: 0
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
delete tree[rowId];
|
|
215
|
+
delete dataRowIdToModelLookup[rowId];
|
|
216
|
+
duplicateRowCount += 1;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
if (duplicateRowCount > 0) {
|
|
220
|
+
tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
|
|
221
|
+
children: rootGroupChildren
|
|
222
|
+
});
|
|
223
|
+
privateApiRef.current.setState(state => _extends({}, state, {
|
|
224
|
+
rows: _extends({}, state.rows, {
|
|
225
|
+
tree,
|
|
226
|
+
dataRowIdToModelLookup
|
|
227
|
+
})
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
193
230
|
privateApiRef.current.unstable_replaceRows(startingIndex, response.rows);
|
|
194
231
|
}
|
|
195
232
|
rowsStale.current = false;
|
package/esm/index.js
CHANGED
package/esm/internals/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { useGridDataSourceLazyLoader } from "../hooks/features/serverSideLazyLoa
|
|
|
23
23
|
export { dataSourceStateInitializer } from "../hooks/features/dataSource/useGridDataSourcePro.js";
|
|
24
24
|
export { useGridDataSourceBasePro } from "../hooks/features/dataSource/useGridDataSourceBasePro.js";
|
|
25
25
|
export { gridDataSourceErrorSelector, gridDataSourceLoadingIdSelector } from "../hooks/features/dataSource/gridDataSourceSelector.js";
|
|
26
|
+
export { getGroupKeys } from "../hooks/features/dataSource/utils.js";
|
|
26
27
|
export type { GridExperimentalProFeatures, DataGridProPropsWithoutDefaultValue, DataGridProPropsWithDefaultValue } from '../models/dataGridProProps';
|
|
27
28
|
export { createRowTree } from "../utils/tree/createRowTree.js";
|
|
28
29
|
export { updateRowTree } from "../utils/tree/updateRowTree.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export { useGridDataSourceLazyLoader } from "../hooks/features/serverSideLazyLoa
|
|
|
30
30
|
export { dataSourceStateInitializer } from "../hooks/features/dataSource/useGridDataSourcePro.js";
|
|
31
31
|
export { useGridDataSourceBasePro } from "../hooks/features/dataSource/useGridDataSourceBasePro.js";
|
|
32
32
|
export { gridDataSourceErrorSelector, gridDataSourceLoadingIdSelector } from "../hooks/features/dataSource/gridDataSourceSelector.js";
|
|
33
|
+
export { getGroupKeys } from "../hooks/features/dataSource/utils.js";
|
|
33
34
|
export { createRowTree } from "../utils/tree/createRowTree.js";
|
|
34
35
|
export { updateRowTree } from "../utils/tree/updateRowTree.js";
|
|
35
36
|
export { sortRowTree } from "../utils/tree/sortRowTree.js";
|
package/esm/material/icons.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const GridPushPinLeftIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
5
|
-
muiName: string;
|
|
6
|
-
};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const GridPushPinRightIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
|
3
|
+
export declare const GridPushPinLeftIcon: (props: import("@mui/x-data-grid").GridBaseIconProps) => React.ReactNode;
|
package/esm/material/icons.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createSvgIcon } from '@mui/
|
|
2
|
+
import { createSvgIcon } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
export const GridPushPinRightIcon = createSvgIcon(/*#__PURE__*/_jsx("g", {
|
|
5
5
|
transform: "rotate(-30 15 10)",
|
package/esm/material/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const materialSlots: {
|
|
2
|
-
columnMenuPinLeftIcon: React.JSXElementConstructor<
|
|
3
|
-
columnMenuPinRightIcon: React.JSXElementConstructor<
|
|
2
|
+
columnMenuPinLeftIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
3
|
+
columnMenuPinRightIcon: React.JSXElementConstructor<import("@mui/x-data-grid/models/gridBaseSlots").IconProps>;
|
|
4
4
|
};
|
|
5
5
|
export default materialSlots;
|
|
@@ -90,7 +90,7 @@ export interface DataGridProPropsWithDefaultValue<R extends GridValidRowModel =
|
|
|
90
90
|
* Set it to 'client' if you would like enable infnite loading.
|
|
91
91
|
* Set it to 'server' if you would like to enable lazy loading.
|
|
92
92
|
* @default "client"
|
|
93
|
-
* @deprecated Use the {@link https://
|
|
93
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
94
94
|
*/
|
|
95
95
|
rowsLoadingMode: GridFeatureMode;
|
|
96
96
|
/**
|
|
@@ -149,7 +149,7 @@ export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel
|
|
|
149
149
|
* @param {GridRowScrollEndParams} params With all properties from [[GridRowScrollEndParams]].
|
|
150
150
|
* @param {MuiEvent<{}>} event The event object.
|
|
151
151
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
152
|
-
* @deprecated Use the {@link https://
|
|
152
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading Server-side data-Infinite loading} instead.
|
|
153
153
|
*/
|
|
154
154
|
onRowsScrollEnd?: GridEventListener<'rowsScrollEnd'>;
|
|
155
155
|
/**
|
|
@@ -194,7 +194,7 @@ export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel
|
|
|
194
194
|
* @param {GridFetchRowsParams} params With all properties from [[GridFetchRowsParams]].
|
|
195
195
|
* @param {MuiEvent<{}>} event The event object.
|
|
196
196
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
197
|
-
* @deprecated Use the {@link https://
|
|
197
|
+
* @deprecated Use the {@link https://mui.com/x/react-data-grid/server-side-data/lazy-loading/#viewport-loading Server-side data-Viewport loading} instead.
|
|
198
198
|
*/
|
|
199
199
|
onFetchRows?: GridEventListener<'fetchRows'>;
|
|
200
200
|
/**
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BaseSlots } from '@mui/x-data-grid/internals';
|
|
3
|
+
type IconProps = BaseSlots.IconProps;
|
|
2
4
|
export interface GridProIconSlotsComponent {
|
|
3
5
|
/**
|
|
4
6
|
* Icon displayed in column menu for left pinning
|
|
5
7
|
* @default GridPushPinLeftIcon
|
|
6
8
|
*/
|
|
7
|
-
columnMenuPinLeftIcon: React.JSXElementConstructor<
|
|
9
|
+
columnMenuPinLeftIcon: React.JSXElementConstructor<IconProps>;
|
|
8
10
|
/**
|
|
9
11
|
* Icon displayed in column menu for right pinning
|
|
10
12
|
* @default GridPushPinRightIcon
|
|
11
13
|
*/
|
|
12
|
-
columnMenuPinRightIcon: React.JSXElementConstructor<
|
|
13
|
-
}
|
|
14
|
+
columnMenuPinRightIcon: React.JSXElementConstructor<IconProps>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","sideEffects":
|
|
1
|
+
{"type":"module","sideEffects":["**/*.css"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import {
|
|
3
|
-
import { CacheChunkManager, DataSourceRowsUpdateStrategy } from '@mui/x-data-grid/internals';
|
|
2
|
+
import { CacheChunkManager, DataSourceRowsUpdateStrategy, GridDataSourceBaseOptions } from '@mui/x-data-grid/internals';
|
|
4
3
|
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
5
4
|
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
6
5
|
import { GridDataSourceApiPro, GridDataSourcePrivateApiPro } from "./models.js";
|
|
@@ -8,14 +7,12 @@ export declare const INITIAL_STATE: {
|
|
|
8
7
|
loading: {};
|
|
9
8
|
errors: {};
|
|
10
9
|
};
|
|
11
|
-
export declare const useGridDataSourceBasePro: <Api extends GridPrivateApiPro>(apiRef: RefObject<Api>, props: DataGridProProcessedProps, options?: {
|
|
12
|
-
cacheOptions?: GridDataSourceCacheDefaultConfig;
|
|
13
|
-
fetchRowChildren?: (parentId: GridRowId) => void;
|
|
14
|
-
}) => {
|
|
10
|
+
export declare const useGridDataSourceBasePro: <Api extends GridPrivateApiPro>(apiRef: RefObject<Api>, props: DataGridProProcessedProps, options?: GridDataSourceBaseOptions) => {
|
|
15
11
|
api: {
|
|
16
12
|
public: GridDataSourceApiPro;
|
|
17
13
|
private: GridDataSourcePrivateApiPro;
|
|
18
14
|
};
|
|
15
|
+
debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: Partial<import("@mui/x-data-grid").GridGetRowsParams>) => void) & import("@mui/utils/debounce").Cancelable;
|
|
19
16
|
strategyProcessor: {
|
|
20
17
|
strategyName: DataSourceRowsUpdateStrategy;
|
|
21
18
|
group: "dataSourceRowsUpdate";
|