@mui/x-data-grid 8.0.0-alpha.1 → 8.0.0-alpha.3
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 +330 -7
- package/DataGrid/DataGrid.js +9 -17
- package/components/GridPagination.js +2 -1
- package/components/base/GridOverlays.d.ts +4 -3
- package/components/base/GridOverlays.js +2 -24
- package/components/base/index.d.ts +0 -1
- package/components/base/index.js +1 -2
- package/components/cell/GridCell.js +7 -10
- package/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- package/components/columnSelection/GridHeaderCheckbox.js +6 -4
- package/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/components/toolbar/GridToolbarFilterButton.d.ts +2 -0
- package/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/components/virtualization/GridVirtualScroller.js +5 -3
- package/constants/dataGridPropsDefaultValues.js +2 -4
- package/constants/localeTextConstants.js +0 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +3 -6
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +0 -4
- package/hooks/features/dimensions/useGridDimensions.js +3 -19
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridRowEditing.js +3 -3
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/listView/gridListViewSelectors.d.ts +3 -1
- package/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/hooks/features/listView/index.d.ts +1 -0
- package/hooks/features/listView/index.js +1 -0
- package/hooks/features/overlays/useGridOverlays.d.ts +7 -4
- package/hooks/features/overlays/useGridOverlays.js +19 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/hooks/features/rowSelection/utils.js +2 -2
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
- package/hooks/features/rows/gridRowsSelector.d.ts +0 -1
- package/hooks/features/rows/gridRowsSelector.js +0 -1
- package/hooks/features/rows/gridRowsUtils.js +0 -9
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.js +12 -14
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +55 -15
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/locales/arSD.js +0 -1
- package/locales/beBY.js +0 -1
- package/locales/bgBG.js +0 -1
- package/locales/csCZ.js +0 -1
- package/locales/daDK.js +0 -1
- package/locales/deDE.js +10 -13
- package/locales/elGR.js +0 -1
- package/locales/esES.js +10 -13
- package/locales/faIR.js +0 -1
- package/locales/fiFI.js +0 -1
- package/locales/frFR.js +0 -1
- package/locales/heIL.js +14 -17
- package/locales/hrHR.js +0 -1
- package/locales/huHU.js +0 -1
- package/locales/isIS.js +0 -1
- package/locales/itIT.js +0 -1
- package/locales/jaJP.js +0 -1
- package/locales/koKR.js +0 -1
- package/locales/nbNO.js +0 -1
- package/locales/nlNL.js +0 -1
- package/locales/nnNO.js +0 -1
- package/locales/plPL.js +0 -1
- package/locales/ptBR.js +10 -13
- package/locales/ptPT.js +10 -13
- package/locales/roRO.js +0 -1
- package/locales/ruRU.js +0 -1
- package/locales/skSK.js +0 -1
- package/locales/svSE.js +0 -1
- package/locales/trTR.js +12 -15
- package/locales/ukUA.js +0 -1
- package/locales/urPK.js +0 -1
- package/locales/viVN.js +0 -1
- package/locales/zhCN.js +10 -13
- package/locales/zhHK.js +0 -1
- package/locales/zhTW.js +0 -1
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +0 -1
- package/models/colDef/gridColDef.d.ts +24 -24
- package/models/events/gridEventLookup.d.ts +1 -0
- package/models/gridDataSource.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +9 -17
- package/modern/DataGrid/DataGrid.js +9 -17
- package/modern/components/GridPagination.js +2 -1
- package/modern/components/base/GridOverlays.js +2 -24
- package/modern/components/base/index.js +1 -2
- package/modern/components/cell/GridCell.js +7 -10
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/modern/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/modern/components/virtualization/GridVirtualScroller.js +5 -3
- package/modern/constants/dataGridPropsDefaultValues.js +2 -4
- package/modern/constants/localeTextConstants.js +0 -1
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +3 -19
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -3
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/modern/hooks/features/listView/index.js +1 -0
- package/modern/hooks/features/overlays/useGridOverlays.js +19 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/modern/hooks/features/rowSelection/utils.js +2 -2
- package/modern/hooks/features/rows/gridRowsSelector.js +0 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -9
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +12 -14
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +55 -15
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/arSD.js +0 -1
- package/modern/locales/beBY.js +0 -1
- package/modern/locales/bgBG.js +0 -1
- package/modern/locales/csCZ.js +0 -1
- package/modern/locales/daDK.js +0 -1
- package/modern/locales/deDE.js +10 -13
- package/modern/locales/elGR.js +0 -1
- package/modern/locales/esES.js +10 -13
- package/modern/locales/faIR.js +0 -1
- package/modern/locales/fiFI.js +0 -1
- package/modern/locales/frFR.js +0 -1
- package/modern/locales/heIL.js +14 -17
- package/modern/locales/hrHR.js +0 -1
- package/modern/locales/huHU.js +0 -1
- package/modern/locales/isIS.js +0 -1
- package/modern/locales/itIT.js +0 -1
- package/modern/locales/jaJP.js +0 -1
- package/modern/locales/koKR.js +0 -1
- package/modern/locales/nbNO.js +0 -1
- package/modern/locales/nlNL.js +0 -1
- package/modern/locales/nnNO.js +0 -1
- package/modern/locales/plPL.js +0 -1
- package/modern/locales/ptBR.js +10 -13
- package/modern/locales/ptPT.js +10 -13
- package/modern/locales/roRO.js +0 -1
- package/modern/locales/ruRU.js +0 -1
- package/modern/locales/skSK.js +0 -1
- package/modern/locales/svSE.js +0 -1
- package/modern/locales/trTR.js +12 -15
- package/modern/locales/ukUA.js +0 -1
- package/modern/locales/urPK.js +0 -1
- package/modern/locales/viVN.js +0 -1
- package/modern/locales/zhCN.js +10 -13
- package/modern/locales/zhHK.js +0 -1
- package/modern/locales/zhTW.js +0 -1
- package/node/DataGrid/DataGrid.js +9 -17
- package/node/components/GridPagination.js +2 -1
- package/node/components/base/GridOverlays.js +2 -24
- package/node/components/base/index.js +0 -11
- package/node/components/cell/GridCell.js +7 -10
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- package/node/components/columnSelection/GridHeaderCheckbox.js +6 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/node/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/node/components/virtualization/GridVirtualScroller.js +5 -3
- package/node/constants/dataGridPropsDefaultValues.js +2 -4
- package/node/constants/localeTextConstants.js +0 -1
- package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -18
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +2 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/node/hooks/features/listView/index.js +16 -0
- package/node/hooks/features/overlays/useGridOverlays.js +21 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/node/hooks/features/rowSelection/utils.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +1 -2
- package/node/hooks/features/rows/gridRowsUtils.js +0 -9
- package/node/hooks/features/rows/index.js +0 -7
- package/node/hooks/features/rows/useGridRows.js +11 -13
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +55 -15
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/locales/arSD.js +0 -1
- package/node/locales/beBY.js +0 -1
- package/node/locales/bgBG.js +0 -1
- package/node/locales/csCZ.js +0 -1
- package/node/locales/daDK.js +0 -1
- package/node/locales/deDE.js +10 -13
- package/node/locales/elGR.js +0 -1
- package/node/locales/esES.js +10 -13
- package/node/locales/faIR.js +0 -1
- package/node/locales/fiFI.js +0 -1
- package/node/locales/frFR.js +0 -1
- package/node/locales/heIL.js +14 -17
- package/node/locales/hrHR.js +0 -1
- package/node/locales/huHU.js +0 -1
- package/node/locales/isIS.js +0 -1
- package/node/locales/itIT.js +0 -1
- package/node/locales/jaJP.js +0 -1
- package/node/locales/koKR.js +0 -1
- package/node/locales/nbNO.js +0 -1
- package/node/locales/nlNL.js +0 -1
- package/node/locales/nnNO.js +0 -1
- package/node/locales/plPL.js +0 -1
- package/node/locales/ptBR.js +10 -13
- package/node/locales/ptPT.js +10 -13
- package/node/locales/roRO.js +0 -1
- package/node/locales/ruRU.js +0 -1
- package/node/locales/skSK.js +0 -1
- package/node/locales/svSE.js +0 -1
- package/node/locales/trTR.js +12 -15
- package/node/locales/ukUA.js +0 -1
- package/node/locales/urPK.js +0 -1
- package/node/locales/viVN.js +0 -1
- package/node/locales/zhCN.js +10 -13
- package/node/locales/zhHK.js +0 -1
- package/node/locales/zhTW.js +0 -1
- package/package.json +2 -2
|
@@ -42,7 +42,7 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
42
42
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
43
43
|
title: apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
44
44
|
enterDelay: 1000
|
|
45
|
-
},
|
|
45
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
46
46
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
47
47
|
ref: handleRef,
|
|
48
48
|
size: "small",
|
|
@@ -51,10 +51,9 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
51
51
|
"aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
52
52
|
"aria-haspopup": "menu",
|
|
53
53
|
"aria-controls": open ? exportMenuId : undefined,
|
|
54
|
-
id: exportButtonId
|
|
55
|
-
}, buttonProps, {
|
|
54
|
+
id: exportButtonId,
|
|
56
55
|
onClick: handleMenuOpen
|
|
57
|
-
}, rootProps.slotProps?.baseButton, {
|
|
56
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
58
57
|
children: apiRef.current.getLocaleText('toolbarExport')
|
|
59
58
|
}))
|
|
60
59
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
3
|
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
import { BadgeProps } from '@mui/material/Badge';
|
|
4
5
|
export interface GridToolbarFilterButtonProps {
|
|
5
6
|
/**
|
|
6
7
|
* The props used for each slot inside.
|
|
@@ -9,6 +10,7 @@ export interface GridToolbarFilterButtonProps {
|
|
|
9
10
|
slotProps?: {
|
|
10
11
|
button?: Partial<ButtonProps>;
|
|
11
12
|
tooltip?: Partial<TooltipProps>;
|
|
13
|
+
badge?: Partial<BadgeProps>;
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
16
|
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<GridToolbarFilterButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -37,6 +37,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
37
37
|
} = props;
|
|
38
38
|
const buttonProps = slotProps.button || {};
|
|
39
39
|
const tooltipProps = slotProps.tooltip || {};
|
|
40
|
+
const badgeProps = slotProps.badge || {};
|
|
40
41
|
const apiRef = useGridApiContext();
|
|
41
42
|
const rootProps = useGridRootProps();
|
|
42
43
|
const activeFilters = useGridSelector(apiRef, gridFilterActiveItemsSelector);
|
|
@@ -94,7 +95,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
94
95
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
95
96
|
title: tooltipContentNode,
|
|
96
97
|
enterDelay: 1000
|
|
97
|
-
},
|
|
98
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
98
99
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
99
100
|
ref: ref,
|
|
100
101
|
id: filterButtonId,
|
|
@@ -103,14 +104,14 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
103
104
|
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
104
105
|
"aria-expanded": isOpen,
|
|
105
106
|
"aria-haspopup": true,
|
|
106
|
-
startIcon: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
107
|
+
startIcon: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, _extends({
|
|
107
108
|
badgeContent: activeFilters.length,
|
|
108
|
-
color: "primary"
|
|
109
|
+
color: "primary"
|
|
110
|
+
}, rootProps.slotProps?.baseBadge, badgeProps, {
|
|
109
111
|
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {})
|
|
110
|
-
})
|
|
111
|
-
}, buttonProps, {
|
|
112
|
+
})),
|
|
112
113
|
onClick: toggleFilter
|
|
113
|
-
}, rootProps.slotProps?.baseButton, {
|
|
114
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
114
115
|
children: apiRef.current.getLocaleText('toolbarFilters')
|
|
115
116
|
}))
|
|
116
117
|
}));
|
|
@@ -78,6 +78,7 @@ function GridToolbarQuickFilter(props) {
|
|
|
78
78
|
apiRef.current.setQuickFilterValues(newQuickFilterValues);
|
|
79
79
|
}, [apiRef, quickFilterParser]);
|
|
80
80
|
const debouncedUpdateSearchValue = React.useMemo(() => debounce(updateSearchValue, debounceMs), [updateSearchValue, debounceMs]);
|
|
81
|
+
React.useEffect(() => debouncedUpdateSearchValue.clear, [debouncedUpdateSearchValue]);
|
|
81
82
|
const handleSearchValueChange = React.useCallback(event => {
|
|
82
83
|
const newSearchValue = event.target.value;
|
|
83
84
|
setSearchValue(newSearchValue);
|
|
@@ -10,7 +10,6 @@ import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
|
10
10
|
import { gridDimensionsSelector } from "../../hooks/features/dimensions/index.js";
|
|
11
11
|
import { useGridVirtualScroller } from "../../hooks/features/virtualization/useGridVirtualScroller.js";
|
|
12
12
|
import { useGridOverlays } from "../../hooks/features/overlays/useGridOverlays.js";
|
|
13
|
-
import { GridOverlays as Overlays } from "../base/GridOverlays.js";
|
|
14
13
|
import { GridHeaders } from "../GridHeaders.js";
|
|
15
14
|
import { GridMainContainer as Container } from "./GridMainContainer.js";
|
|
16
15
|
import { GridTopContainer as TopContainer } from "./GridTopContainer.js";
|
|
@@ -55,7 +54,10 @@ function GridVirtualScroller(props) {
|
|
|
55
54
|
const apiRef = useGridApiContext();
|
|
56
55
|
const rootProps = useGridRootProps();
|
|
57
56
|
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
58
|
-
const
|
|
57
|
+
const {
|
|
58
|
+
getOverlay,
|
|
59
|
+
overlaysProps
|
|
60
|
+
} = useGridOverlays();
|
|
59
61
|
const classes = useUtilityClasses(rootProps, dimensions, overlaysProps.loadingOverlayVariant);
|
|
60
62
|
const virtualScroller = useGridVirtualScroller();
|
|
61
63
|
const {
|
|
@@ -84,7 +86,7 @@ function GridVirtualScroller(props) {
|
|
|
84
86
|
position: "top",
|
|
85
87
|
virtualScroller: virtualScroller
|
|
86
88
|
})]
|
|
87
|
-
}),
|
|
89
|
+
}), getOverlay(), /*#__PURE__*/_jsx(Content, _extends({}, getContentProps(), {
|
|
88
90
|
children: /*#__PURE__*/_jsxs(RenderZone, _extends({}, getRenderZoneProps(), {
|
|
89
91
|
children: [rows, /*#__PURE__*/_jsx(rootProps.slots.detailPanels, {
|
|
90
92
|
virtualScroller: virtualScroller
|
|
@@ -34,8 +34,6 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
34
34
|
hideFooterSelectedRowCount: false,
|
|
35
35
|
ignoreDiacritics: false,
|
|
36
36
|
ignoreValueFormatterDuringExport: false,
|
|
37
|
-
// TODO v8: Update to 'select'
|
|
38
|
-
indeterminateCheckboxAction: 'deselect',
|
|
39
37
|
keepColumnPositionIfDraggedOutside: false,
|
|
40
38
|
keepNonExistentRowsSelected: false,
|
|
41
39
|
loading: false,
|
|
@@ -47,7 +45,6 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
47
45
|
resizeThrottleMs: 60,
|
|
48
46
|
rowBufferPx: 150,
|
|
49
47
|
rowHeight: 52,
|
|
50
|
-
rowPositionsDebounceMs: 166,
|
|
51
48
|
rows: [],
|
|
52
49
|
rowSelection: true,
|
|
53
50
|
rowSpacingType: 'margin',
|
|
@@ -56,5 +53,6 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
56
53
|
sortingMode: 'client',
|
|
57
54
|
sortingOrder: ['asc', 'desc', null],
|
|
58
55
|
throttleRowsMs: 0,
|
|
59
|
-
unstable_rowSpanning: false
|
|
56
|
+
unstable_rowSpanning: false,
|
|
57
|
+
virtualizeColumnsWithAutoRowHeight: false
|
|
60
58
|
};
|
|
@@ -26,7 +26,6 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
26
26
|
toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…',
|
|
27
27
|
toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…',
|
|
28
28
|
toolbarPromptControlLabel: 'Prompt input',
|
|
29
|
-
toolbarPromptControlDeleteIconLabel: 'Clear',
|
|
30
29
|
toolbarPromptControlRecordButtonDefaultLabel: 'Record',
|
|
31
30
|
toolbarPromptControlRecordButtonActiveLabel: 'Stop recording',
|
|
32
31
|
toolbarPromptControlSendActionLabel: 'Send',
|
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import { GridRowTreeCreationParams, GridRowTreeCreationValue, GridRowsState } from '../../features/rows/gridRowsInterfaces';
|
|
2
2
|
import { GridFilteringMethodParams, GridFilteringMethodValue, GridFilterState, GridVisibleRowsLookupState } from '../../features/filter/gridFilterState';
|
|
3
3
|
import { GridSortingMethodParams, GridSortingMethodValue } from '../../features/sorting/gridSortingState';
|
|
4
|
+
import { GridGetRowsParams, GridGetRowsResponse } from '../../../models/gridDataSource';
|
|
4
5
|
export type GridStrategyProcessorName = keyof GridStrategyProcessingLookup;
|
|
5
|
-
export
|
|
6
|
+
export declare enum GridStrategyGroup {
|
|
7
|
+
DataSource = "dataSource",
|
|
8
|
+
RowTree = "rowTree"
|
|
9
|
+
}
|
|
10
|
+
export type GridStrategyGroupValue = `${GridStrategyGroup}`;
|
|
6
11
|
export interface GridStrategyProcessingLookup {
|
|
12
|
+
dataSourceRowsUpdate: {
|
|
13
|
+
group: GridStrategyGroup.DataSource;
|
|
14
|
+
params: {
|
|
15
|
+
response: GridGetRowsResponse;
|
|
16
|
+
fetchParams: GridGetRowsParams;
|
|
17
|
+
} | {
|
|
18
|
+
error: Error;
|
|
19
|
+
fetchParams: GridGetRowsParams;
|
|
20
|
+
};
|
|
21
|
+
value: void;
|
|
22
|
+
};
|
|
7
23
|
rowTreeCreation: {
|
|
8
|
-
group:
|
|
24
|
+
group: GridStrategyGroup.RowTree;
|
|
9
25
|
params: GridRowTreeCreationParams;
|
|
10
26
|
value: GridRowTreeCreationValue;
|
|
11
27
|
};
|
|
12
28
|
filtering: {
|
|
13
|
-
group:
|
|
29
|
+
group: GridStrategyGroup.RowTree;
|
|
14
30
|
params: GridFilteringMethodParams;
|
|
15
31
|
value: GridFilteringMethodValue;
|
|
16
32
|
};
|
|
17
33
|
sorting: {
|
|
18
|
-
group:
|
|
34
|
+
group: GridStrategyGroup.RowTree;
|
|
19
35
|
params: GridSortingMethodParams;
|
|
20
36
|
value: GridSortingMethodValue;
|
|
21
37
|
};
|
|
22
38
|
visibleRowsLookupCreation: {
|
|
23
|
-
group:
|
|
39
|
+
group: GridStrategyGroup.RowTree;
|
|
24
40
|
params: {
|
|
25
41
|
tree: GridRowsState['tree'];
|
|
26
42
|
filteredRowsLookup: GridFilterState['filteredRowsLookup'];
|
|
@@ -42,17 +58,17 @@ export interface GridStrategyProcessingApi {
|
|
|
42
58
|
registerStrategyProcessor: <P extends GridStrategyProcessorName>(strategyName: string, processorName: P, processor: GridStrategyProcessor<P>) => () => void;
|
|
43
59
|
/**
|
|
44
60
|
* Set a callback to know if a strategy is available.
|
|
45
|
-
* @param {
|
|
61
|
+
* @param {GridStrategyGroupValue} strategyGroup The group for which we set strategy availability.
|
|
46
62
|
* @param {string} strategyName The name of the strategy.
|
|
47
63
|
* @param {boolean} callback A callback to know if this strategy is available.
|
|
48
64
|
*/
|
|
49
|
-
setStrategyAvailability: (strategyGroup:
|
|
65
|
+
setStrategyAvailability: (strategyGroup: GridStrategyGroupValue, strategyName: string, callback: () => boolean) => void;
|
|
50
66
|
/**
|
|
51
67
|
* Returns the name of the active strategy of a given strategy group
|
|
52
|
-
* @param {
|
|
68
|
+
* @param {GridStrategyGroupValue} strategyGroup The group from which we want the active strategy.
|
|
53
69
|
* @returns {string} The name of the active strategy.
|
|
54
70
|
*/
|
|
55
|
-
getActiveStrategy: (strategyGroup:
|
|
71
|
+
getActiveStrategy: (strategyGroup: GridStrategyGroupValue) => string;
|
|
56
72
|
/**
|
|
57
73
|
* Run the processor registered for the active strategy.
|
|
58
74
|
* @param {GridStrategyProcessorName} processorName The name of the processor to run.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../../models/api/gridApiCommon';
|
|
3
|
-
import { GridStrategyProcessorName,
|
|
3
|
+
import { GridStrategyProcessorName, GridStrategyGroupValue } from './gridStrategyProcessingApi';
|
|
4
4
|
export declare const GRID_DEFAULT_STRATEGY = "none";
|
|
5
5
|
export declare const GRID_STRATEGIES_PROCESSORS: {
|
|
6
|
-
[P in GridStrategyProcessorName]:
|
|
6
|
+
[P in GridStrategyProcessorName]: GridStrategyGroupValue;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -40,9 +40,6 @@ export declare const GRID_STRATEGIES_PROCESSORS: {
|
|
|
40
40
|
* =====================================================================================================================
|
|
41
41
|
*
|
|
42
42
|
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
43
|
-
*
|
|
44
|
-
* - row tree creation algorithm.
|
|
45
|
-
* - sorting algorithm.
|
|
46
|
-
* - filtering algorithm.
|
|
43
|
+
* There are two active groups named `rowTree` and `dataSource`.
|
|
47
44
|
*/
|
|
48
45
|
export declare const useGridStrategyProcessing: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { GridStrategyGroup } from "./gridStrategyProcessingApi.js";
|
|
4
5
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
6
|
export const GRID_DEFAULT_STRATEGY = 'none';
|
|
6
7
|
export const GRID_STRATEGIES_PROCESSORS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
dataSourceRowsUpdate: GridStrategyGroup.DataSource,
|
|
9
|
+
rowTreeCreation: GridStrategyGroup.RowTree,
|
|
10
|
+
filtering: GridStrategyGroup.RowTree,
|
|
11
|
+
sorting: GridStrategyGroup.RowTree,
|
|
12
|
+
visibleRowsLookupCreation: GridStrategyGroup.RowTree
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -44,10 +46,7 @@ export const GRID_STRATEGIES_PROCESSORS = {
|
|
|
44
46
|
* =====================================================================================================================
|
|
45
47
|
*
|
|
46
48
|
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
47
|
-
*
|
|
48
|
-
* - row tree creation algorithm.
|
|
49
|
-
* - sorting algorithm.
|
|
50
|
-
* - filtering algorithm.
|
|
49
|
+
* There are two active groups named `rowTree` and `dataSource`.
|
|
51
50
|
*/
|
|
52
51
|
export const useGridStrategyProcessing = apiRef => {
|
|
53
52
|
const availableStrategies = React.useRef(new Map());
|
|
@@ -491,7 +491,8 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
491
491
|
const widthByField = extractColumnWidths(apiRef, options, columns);
|
|
492
492
|
const newColumns = columns.map(column => _extends({}, column, {
|
|
493
493
|
width: widthByField[column.field],
|
|
494
|
-
computedWidth: widthByField[column.field]
|
|
494
|
+
computedWidth: widthByField[column.field],
|
|
495
|
+
flex: 0
|
|
495
496
|
}));
|
|
496
497
|
if (options.expand) {
|
|
497
498
|
const visibleColumns = state.orderedFields.map(field => state.lookup[field]).filter(c => state.columnVisibilityModel[c.field] !== false);
|
|
@@ -83,10 +83,6 @@ export interface GridDimensions {
|
|
|
83
83
|
bottomContainerHeight: number;
|
|
84
84
|
}
|
|
85
85
|
export interface GridDimensionsApi {
|
|
86
|
-
/**
|
|
87
|
-
* Triggers a resize of the component and recalculation of width and height.
|
|
88
|
-
*/
|
|
89
|
-
resize: () => void;
|
|
90
86
|
/**
|
|
91
87
|
* Returns the dimensions of the grid
|
|
92
88
|
* @returns {GridDimensions} The dimension information of the grid. If `null`, the grid is not ready yet.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback
|
|
3
|
+
import { unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
4
4
|
import { throttle } from '@mui/x-internals/throttle';
|
|
5
5
|
import { useGridApiEventHandler, useGridApiOptionHandler } from "../../utils/useGridApiEventHandler.js";
|
|
6
6
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
@@ -66,28 +66,13 @@ export function useGridDimensions(apiRef, props) {
|
|
|
66
66
|
const rightPinnedWidth = pinnedColumns.right.reduce((w, col) => w + col.computedWidth, 0);
|
|
67
67
|
const [savedSize, setSavedSize] = React.useState();
|
|
68
68
|
const debouncedSetSavedSize = React.useMemo(() => throttle(setSavedSize, props.resizeThrottleMs), [props.resizeThrottleMs]);
|
|
69
|
-
|
|
69
|
+
React.useEffect(() => debouncedSetSavedSize.clear, [debouncedSetSavedSize]);
|
|
70
70
|
const getRootDimensions = () => apiRef.current.state.dimensions;
|
|
71
71
|
const setDimensions = useEventCallback(dimensions => {
|
|
72
72
|
apiRef.current.setState(state => _extends({}, state, {
|
|
73
73
|
dimensions
|
|
74
74
|
}));
|
|
75
75
|
});
|
|
76
|
-
const resize = React.useCallback(() => {
|
|
77
|
-
const element = apiRef.current.mainElementRef.current;
|
|
78
|
-
if (!element) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const computedStyle = ownerWindow(element).getComputedStyle(element);
|
|
82
|
-
const newSize = {
|
|
83
|
-
width: parseFloat(computedStyle.width) || 0,
|
|
84
|
-
height: parseFloat(computedStyle.height) || 0
|
|
85
|
-
};
|
|
86
|
-
if (!previousSize.current || !areElementSizesEqual(previousSize.current, newSize)) {
|
|
87
|
-
apiRef.current.publishEvent('resize', newSize);
|
|
88
|
-
previousSize.current = newSize;
|
|
89
|
-
}
|
|
90
|
-
}, [apiRef]);
|
|
91
76
|
const getViewportPageSize = React.useCallback(() => {
|
|
92
77
|
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
93
78
|
if (!dimensions.isReady) {
|
|
@@ -198,7 +183,6 @@ export function useGridDimensions(apiRef, props) {
|
|
|
198
183
|
apiRef.current.updateRenderContext?.();
|
|
199
184
|
}, [apiRef, setDimensions, props.scrollbarSize, props.autoHeight, rowsMeta.currentPageTotalHeight, rowHeight, headerHeight, groupHeaderHeight, headerFilterHeight, columnsTotalWidth, headersTotalHeight, leftPinnedWidth, rightPinnedWidth]);
|
|
200
185
|
const apiPublic = {
|
|
201
|
-
resize,
|
|
202
186
|
getRootDimensions
|
|
203
187
|
};
|
|
204
188
|
const apiPrivate = {
|
|
@@ -238,7 +222,7 @@ export function useGridDimensions(apiRef, props) {
|
|
|
238
222
|
rootDimensionsRef.current = size;
|
|
239
223
|
|
|
240
224
|
// jsdom has no layout capabilities
|
|
241
|
-
const isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
225
|
+
const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
242
226
|
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
243
227
|
logger.error(['The parent DOM element of the Data Grid has an empty height.', 'Please make sure that this element has an intrinsic height.', 'The grid displays with a height of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
244
228
|
errorShown.current = true;
|
|
@@ -11,7 +11,7 @@ import { GridEditModes, GridCellModes } from "../../../models/gridEditRowModel.j
|
|
|
11
11
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
12
12
|
import { gridEditRowsStateSelector } from "./gridEditingSelectors.js";
|
|
13
13
|
import { isPrintableKey, isPasteShortcut } from "../../../utils/keyboardUtils.js";
|
|
14
|
-
import {
|
|
14
|
+
import { gridRowsLookupSelector } from "../rows/gridRowsSelector.js";
|
|
15
15
|
import { deepClone } from "../../../utils/utils.js";
|
|
16
16
|
import { GridCellEditStartReasons, GridCellEditStopReasons } from "../../../models/params/gridEditCellParams.js";
|
|
17
17
|
import { getDefaultCellValue } from "./utils.js";
|
|
@@ -442,7 +442,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
442
442
|
|
|
443
443
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
444
444
|
useEnhancedEffect(() => {
|
|
445
|
-
const
|
|
445
|
+
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
446
446
|
|
|
447
447
|
// Update the ref here because updateStateToStopCellEditMode may change it later
|
|
448
448
|
const copyOfPrevCellModes = prevCellModesModel.current;
|
|
@@ -451,7 +451,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
451
451
|
Object.entries(cellModesModel).forEach(([id, fields]) => {
|
|
452
452
|
Object.entries(fields).forEach(([field, params]) => {
|
|
453
453
|
const prevMode = copyOfPrevCellModes[id]?.[field]?.mode || GridCellModes.View;
|
|
454
|
-
const originalId =
|
|
454
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
455
455
|
if (params.mode === GridCellModes.Edit && prevMode === GridCellModes.View) {
|
|
456
456
|
updateStateToStartCellEditMode(_extends({
|
|
457
457
|
id: originalId,
|
|
@@ -12,7 +12,7 @@ import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
|
12
12
|
import { gridEditRowsStateSelector } from "./gridEditingSelectors.js";
|
|
13
13
|
import { isPrintableKey, isPasteShortcut } from "../../../utils/keyboardUtils.js";
|
|
14
14
|
import { gridColumnFieldsSelector, gridVisibleColumnFieldsSelector } from "../columns/gridColumnsSelector.js";
|
|
15
|
-
import {
|
|
15
|
+
import { gridRowsLookupSelector } from "../rows/gridRowsSelector.js";
|
|
16
16
|
import { deepClone } from "../../../utils/utils.js";
|
|
17
17
|
import { GridRowEditStopReasons, GridRowEditStartReasons } from "../../../models/params/gridRowParams.js";
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../../../colDef/index.js";
|
|
@@ -571,7 +571,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
571
571
|
|
|
572
572
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
573
573
|
useEnhancedEffect(() => {
|
|
574
|
-
const
|
|
574
|
+
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
575
575
|
|
|
576
576
|
// Update the ref here because updateStateToStopRowEditMode may change it later
|
|
577
577
|
const copyOfPrevRowModesModel = prevRowModesModel.current;
|
|
@@ -583,7 +583,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
583
583
|
mode: GridRowModes.View
|
|
584
584
|
};
|
|
585
585
|
const prevMode = copyOfPrevRowModesModel[id]?.mode || GridRowModes.View;
|
|
586
|
-
const originalId =
|
|
586
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
587
587
|
if (params.mode === GridRowModes.Edit && prevMode === GridRowModes.View) {
|
|
588
588
|
updateStateToStartRowEditMode(_extends({
|
|
589
589
|
id: originalId
|
package/hooks/features/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./density/index.js";
|
|
|
7
7
|
export * from "./editing/index.js";
|
|
8
8
|
export * from "./filter/index.js";
|
|
9
9
|
export * from "./focus/index.js";
|
|
10
|
+
export * from "./listView/index.js";
|
|
10
11
|
export * from "./pagination/index.js";
|
|
11
12
|
export * from "./preferencesPanel/index.js";
|
|
12
13
|
export * from "./rows/index.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
2
2
|
/**
|
|
3
|
-
* Get
|
|
3
|
+
* Get the list column definition
|
|
4
|
+
* @category List View
|
|
5
|
+
* @ignore - Do not document
|
|
4
6
|
*/
|
|
5
7
|
export declare const gridListColumnSelector: (state: GridStateCommunity) => import("./useGridListView").GridListViewState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gridListViewSelectors';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gridListViewSelectors.js";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { GridLoadingOverlayVariant } from '../../../components/GridLoadingOverlay';
|
|
2
|
-
import {
|
|
3
|
-
export type GridOverlayType = keyof Pick<GridSlotsComponent, 'noRowsOverlay' | 'noResultsOverlay' | 'loadingOverlay'> | null;
|
|
3
|
+
import type { GridOverlayType } from '../../../components/base/GridOverlays';
|
|
4
4
|
/**
|
|
5
5
|
* Uses the grid state to determine which overlay to display.
|
|
6
6
|
* Returns the active overlay type and the active loading overlay variant.
|
|
7
7
|
*/
|
|
8
8
|
export declare const useGridOverlays: () => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
getOverlay: () => React.JSX.Element | null;
|
|
10
|
+
overlaysProps: {
|
|
11
|
+
overlayType: GridOverlayType;
|
|
12
|
+
loadingOverlayVariant: GridLoadingOverlayVariant | null;
|
|
13
|
+
};
|
|
11
14
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
1
3
|
import { useGridSelector } from "../../utils/index.js";
|
|
2
4
|
import { useGridApiContext } from "../../utils/useGridApiContext.js";
|
|
3
5
|
import { useGridRootProps } from "../../utils/useGridRootProps.js";
|
|
4
6
|
import { gridExpandedRowCountSelector } from "../filter/index.js";
|
|
5
7
|
import { gridRowCountSelector, gridRowsLoadingSelector } from "../rows/index.js";
|
|
8
|
+
import { GridOverlayWrapper } from "../../../components/base/GridOverlays.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
10
|
/**
|
|
7
11
|
* Uses the grid state to determine which overlay to display.
|
|
8
12
|
* Returns the active overlay type and the active loading overlay variant.
|
|
@@ -28,8 +32,22 @@ export const useGridOverlays = () => {
|
|
|
28
32
|
overlayType = 'loadingOverlay';
|
|
29
33
|
loadingOverlayVariant = rootProps.slotProps?.loadingOverlay?.[noRows ? 'noRowsVariant' : 'variant'] || null;
|
|
30
34
|
}
|
|
31
|
-
|
|
35
|
+
const overlaysProps = {
|
|
32
36
|
overlayType,
|
|
33
37
|
loadingOverlayVariant
|
|
34
38
|
};
|
|
39
|
+
const getOverlay = () => {
|
|
40
|
+
if (!overlayType) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const Overlay = rootProps.slots?.[overlayType];
|
|
44
|
+
const overlayProps = rootProps.slotProps?.[overlayType];
|
|
45
|
+
return /*#__PURE__*/_jsx(GridOverlayWrapper, _extends({}, overlaysProps, {
|
|
46
|
+
children: /*#__PURE__*/_jsx(Overlay, _extends({}, overlayProps))
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
getOverlay,
|
|
51
|
+
overlaysProps
|
|
52
|
+
};
|
|
35
53
|
};
|
|
@@ -248,11 +248,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
248
248
|
/*
|
|
249
249
|
* EVENTS
|
|
250
250
|
*/
|
|
251
|
-
const isFirstRender = React.useRef(true);
|
|
252
251
|
const removeOutdatedSelection = React.useCallback((sortModelUpdated = false) => {
|
|
253
|
-
if (isFirstRender.current) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
252
|
const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);
|
|
257
253
|
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
258
254
|
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
@@ -480,9 +476,4 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
480
476
|
React.useEffect(() => {
|
|
481
477
|
runIfRowSelectionIsEnabled(removeOutdatedSelection);
|
|
482
478
|
}, [removeOutdatedSelection, runIfRowSelectionIsEnabled]);
|
|
483
|
-
React.useEffect(() => {
|
|
484
|
-
if (isFirstRender.current) {
|
|
485
|
-
isFirstRender.current = false;
|
|
486
|
-
}
|
|
487
|
-
}, []);
|
|
488
479
|
};
|
|
@@ -6,8 +6,8 @@ import { selectedIdsLookupSelector } from "./gridRowSelectionSelector.js";
|
|
|
6
6
|
import { gridRowTreeSelector } from "../rows/gridRowsSelector.js";
|
|
7
7
|
import { createSelector } from "../../../utils/createSelector.js";
|
|
8
8
|
export const ROW_SELECTION_PROPAGATION_DEFAULT = {
|
|
9
|
-
parents:
|
|
10
|
-
descendants:
|
|
9
|
+
parents: true,
|
|
10
|
+
descendants: true
|
|
11
11
|
};
|
|
12
12
|
function getGridRowGroupSelectableDescendants(apiRef, groupId) {
|
|
13
13
|
const rowTree = gridRowTreeSelector(apiRef);
|
|
@@ -18,10 +18,6 @@ export interface GridRowsInternalCache {
|
|
|
18
18
|
* Lookup containing the latest model at all time (even those not stored in the state yet).
|
|
19
19
|
*/
|
|
20
20
|
dataRowIdToModelLookup: GridRowIdToModelLookup;
|
|
21
|
-
/**
|
|
22
|
-
* Lookup containing the latest ids at all time (even those not stored in the state yet).
|
|
23
|
-
*/
|
|
24
|
-
dataRowIdToIdLookup: GridRowIdToIdLookup;
|
|
25
21
|
/**
|
|
26
22
|
* List of updates (partial or full) applied since the last time the state was synced with the cache.
|
|
27
23
|
* It is used to build the tree.
|
|
@@ -59,7 +55,6 @@ export interface GridRowsState {
|
|
|
59
55
|
*/
|
|
60
56
|
totalTopLevelRowCount: number;
|
|
61
57
|
dataRowIdToModelLookup: GridRowIdToModelLookup;
|
|
62
|
-
dataRowIdToIdLookup: GridRowIdToIdLookup;
|
|
63
58
|
additionalRowGroups?: {
|
|
64
59
|
pinnedRows?: GridPinnedRowsState;
|
|
65
60
|
};
|
|
@@ -74,7 +69,6 @@ export interface GridRowTreeCreationParams {
|
|
|
74
69
|
previousTree: GridRowTreeConfig | null;
|
|
75
70
|
previousTreeDepths: GridTreeDepths | null;
|
|
76
71
|
updates: GridRowsPartialUpdates | GridRowsFullUpdate;
|
|
77
|
-
dataRowIdToIdLookup: GridRowIdToIdLookup;
|
|
78
72
|
dataRowIdToModelLookup: GridRowIdToModelLookup;
|
|
79
73
|
previousGroupsToFetch?: GridRowId[];
|
|
80
74
|
}
|
|
@@ -91,10 +85,9 @@ export type GridRowTreeUpdatedGroupsManager = {
|
|
|
91
85
|
export type GridRowTreeCreationValue = Pick<GridRowsState, 'groupingName' | 'tree' | 'treeDepths' | 'dataRowIds' | 'groupsToFetch'> & {
|
|
92
86
|
updatedGroupsManager?: GridRowTreeUpdatedGroupsManager;
|
|
93
87
|
};
|
|
94
|
-
export type GridHydrateRowsValue = Pick<GridRowsState, 'tree' | 'treeDepths' | 'dataRowIds' | '
|
|
88
|
+
export type GridHydrateRowsValue = Pick<GridRowsState, 'tree' | 'treeDepths' | 'dataRowIds' | 'dataRowIdToModelLookup' | 'additionalRowGroups'>;
|
|
95
89
|
export type GridRowsPartialUpdateAction = 'insert' | 'modify' | 'remove';
|
|
96
90
|
export type GridRowIdToModelLookup<R extends GridValidRowModel = GridValidRowModel> = Record<string, R>;
|
|
97
|
-
export type GridRowIdToIdLookup = Record<string, GridRowId>;
|
|
98
91
|
export type GridTreeDepths = {
|
|
99
92
|
[depth: number]: number;
|
|
100
93
|
};
|
|
@@ -3,7 +3,6 @@ export declare const gridRowCountSelector: import("../../..").OutputSelector<Gri
|
|
|
3
3
|
export declare const gridRowsLoadingSelector: import("../../..").OutputSelector<GridStateCommunity, boolean | undefined>;
|
|
4
4
|
export declare const gridTopLevelRowCountSelector: import("../../..").OutputSelector<GridStateCommunity, number>;
|
|
5
5
|
export declare const gridRowsLookupSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridRowsInterfaces").GridRowIdToModelLookup<import("../../..").GridValidRowModel>>;
|
|
6
|
-
export declare const gridRowsDataRowIdToIdLookupSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridRowsInterfaces").GridRowIdToIdLookup>;
|
|
7
6
|
export declare const gridRowTreeSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowTreeConfig>;
|
|
8
7
|
export declare const gridRowGroupsToFetchSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowId[] | undefined>;
|
|
9
8
|
export declare const gridRowGroupingNameSelector: import("../../..").OutputSelector<GridStateCommunity, string>;
|
|
@@ -6,7 +6,6 @@ export const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector
|
|
|
6
6
|
|
|
7
7
|
// TODO rows v6: Rename
|
|
8
8
|
export const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);
|
|
9
|
-
export const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);
|
|
10
9
|
export const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);
|
|
11
10
|
export const gridRowGroupsToFetchSelector = createSelector(gridRowsStateSelector, rows => rows.groupsToFetch);
|
|
12
11
|
export const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);
|