@mui/x-data-grid 8.0.0-alpha.5 → 8.0.0-alpha.7
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 +206 -1
- package/DataGrid/DataGrid.js +4 -3
- package/DataGrid/useDataGridComponent.d.ts +1 -1
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +5 -3
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +3 -2
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +4 -3
- package/components/cell/GridActionsCellItem.d.ts +17 -10
- package/components/cell/GridActionsCellItem.js +5 -2
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +73 -4
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +1 -1
- package/components/containers/GridRoot.js +5 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +3 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -1
- package/components/panel/filterPanel/index.js +1 -1
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +4 -4
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +3 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridIsRtl.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/core/useGridRefs.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -2
- package/hooks/utils/useGridLogger.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/locales/nlNL.js +5 -6
- package/material/index.js +6 -0
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/gridBaseSlots.d.ts +47 -2
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +24 -7
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -3
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +5 -3
- package/modern/components/GridRow.js +3 -2
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
- package/modern/components/cell/GridActionsCellItem.js +5 -2
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +73 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/modern/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +5 -3
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/panel/GridPanel.js +3 -2
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +4 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/modern/components/virtualization/GridMainContainer.js +3 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +6 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +4 -3
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +5 -3
- package/node/components/GridRow.js +3 -2
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +4 -3
- package/node/components/cell/GridActionsCellItem.js +4 -3
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +73 -4
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/node/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +5 -3
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/panel/GridPanel.js +3 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +10 -11
- package/node/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -11
- package/node/components/toolbar/GridToolbar.js +4 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/node/components/virtualization/GridMainContainer.js +3 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +6 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
|
@@ -3,12 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
5
5
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
6
|
-
import {
|
|
6
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
7
7
|
import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
|
|
8
|
-
import {
|
|
9
|
-
import { gridRowTreeSelector } from "./gridRowsSelector.js";
|
|
10
|
-
import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
8
|
+
import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
11
9
|
import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
10
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
11
|
+
import { runIf } from "../../../utils/utils.js";
|
|
12
12
|
const EMPTY_STATE = {
|
|
13
13
|
spannedCells: {},
|
|
14
14
|
hiddenCells: {},
|
|
@@ -53,8 +53,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
53
53
|
const backwardsHiddenCells = [];
|
|
54
54
|
if (index === rangeToProcess.firstRowIndex) {
|
|
55
55
|
let prevIndex = index - 1;
|
|
56
|
-
|
|
57
|
-
while (prevIndex >= range.firstRowIndex && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
56
|
+
let prevRowEntry = visibleRows[prevIndex];
|
|
57
|
+
while (prevIndex >= range.firstRowIndex && prevRowEntry && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
58
58
|
const currentRow = visibleRows[prevIndex + 1];
|
|
59
59
|
if (hiddenCells[currentRow.id]) {
|
|
60
60
|
hiddenCells[currentRow.id][colDef.field] = true;
|
|
@@ -68,6 +68,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
68
68
|
spannedRowId = prevRowEntry.id;
|
|
69
69
|
spannedRowIndex = prevIndex;
|
|
70
70
|
prevIndex -= 1;
|
|
71
|
+
prevRowEntry = visibleRows[prevIndex];
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
backwardsHiddenCells.forEach(hiddenCellIndex => {
|
|
@@ -130,74 +131,58 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
130
131
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
131
132
|
*/
|
|
132
133
|
export const rowSpanningStateInitializer = (state, props, apiRef) => {
|
|
133
|
-
if (props.rowSpanning) {
|
|
134
|
-
const rowIds = state.rows.dataRowIds || [];
|
|
135
|
-
const orderedFields = state.columns.orderedFields || [];
|
|
136
|
-
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
137
|
-
const columnsLookup = state.columns.lookup;
|
|
138
|
-
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
139
|
-
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
140
|
-
return _extends({}, state, {
|
|
141
|
-
rowSpanning: EMPTY_STATE
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const rangeToProcess = {
|
|
145
|
-
firstRowIndex: 0,
|
|
146
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
147
|
-
};
|
|
148
|
-
const rows = rowIds.map(id => ({
|
|
149
|
-
id,
|
|
150
|
-
model: dataRowIdToModelLookup[id]
|
|
151
|
-
}));
|
|
152
|
-
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
153
|
-
const {
|
|
154
|
-
spannedCells,
|
|
155
|
-
hiddenCells,
|
|
156
|
-
hiddenCellOriginMap
|
|
157
|
-
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
134
|
+
if (!props.rowSpanning) {
|
|
158
135
|
return _extends({}, state, {
|
|
159
|
-
rowSpanning:
|
|
160
|
-
spannedCells,
|
|
161
|
-
hiddenCells,
|
|
162
|
-
hiddenCellOriginMap
|
|
163
|
-
}
|
|
136
|
+
rowSpanning: EMPTY_STATE
|
|
164
137
|
});
|
|
165
138
|
}
|
|
139
|
+
const rowIds = state.rows.dataRowIds || [];
|
|
140
|
+
const orderedFields = state.columns.orderedFields || [];
|
|
141
|
+
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
142
|
+
const columnsLookup = state.columns.lookup;
|
|
143
|
+
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
144
|
+
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
145
|
+
return _extends({}, state, {
|
|
146
|
+
rowSpanning: EMPTY_STATE
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const rangeToProcess = {
|
|
150
|
+
firstRowIndex: 0,
|
|
151
|
+
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
152
|
+
};
|
|
153
|
+
const rows = rowIds.map(id => ({
|
|
154
|
+
id,
|
|
155
|
+
model: dataRowIdToModelLookup[id]
|
|
156
|
+
}));
|
|
157
|
+
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
158
|
+
const {
|
|
159
|
+
spannedCells,
|
|
160
|
+
hiddenCells,
|
|
161
|
+
hiddenCellOriginMap
|
|
162
|
+
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
166
163
|
return _extends({}, state, {
|
|
167
|
-
rowSpanning:
|
|
164
|
+
rowSpanning: {
|
|
165
|
+
spannedCells,
|
|
166
|
+
hiddenCells,
|
|
167
|
+
hiddenCellOriginMap
|
|
168
|
+
}
|
|
168
169
|
});
|
|
169
170
|
};
|
|
170
171
|
export const useGridRowSpanning = (apiRef, props) => {
|
|
171
|
-
const {
|
|
172
|
-
range,
|
|
173
|
-
rows: visibleRows
|
|
174
|
-
} = useGridVisibleRows(apiRef, props);
|
|
175
|
-
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
176
|
-
const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
177
|
-
const tree = useGridSelector(apiRef, gridRowTreeSelector);
|
|
178
172
|
const processedRange = useLazyRef(() => {
|
|
179
173
|
return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
|
|
180
174
|
firstRowIndex: 0,
|
|
181
175
|
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(apiRef.current.state.rows.dataRowIds.length, 0))
|
|
182
176
|
} : EMPTY_RANGE;
|
|
183
177
|
});
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
(resetState = true) => {
|
|
193
|
-
if (!props.rowSpanning) {
|
|
194
|
-
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
195
|
-
apiRef.current.setState(state => _extends({}, state, {
|
|
196
|
-
rowSpanning: EMPTY_STATE
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
178
|
+
const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
|
|
179
|
+
const {
|
|
180
|
+
range,
|
|
181
|
+
rows: visibleRows
|
|
182
|
+
} = getVisibleRows(apiRef, {
|
|
183
|
+
pagination: props.pagination,
|
|
184
|
+
paginationMode: props.paginationMode
|
|
185
|
+
});
|
|
201
186
|
if (range === null || !isRowContextInitialized(renderContext)) {
|
|
202
187
|
return;
|
|
203
188
|
}
|
|
@@ -211,6 +196,7 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
211
196
|
if (rangeToProcess === null) {
|
|
212
197
|
return;
|
|
213
198
|
}
|
|
199
|
+
const colDefs = gridVisibleColumnDefinitionsSelector(apiRef);
|
|
214
200
|
const {
|
|
215
201
|
spannedCells,
|
|
216
202
|
hiddenCells,
|
|
@@ -223,7 +209,8 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
223
209
|
const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
|
|
224
210
|
const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
|
|
225
211
|
const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
|
|
226
|
-
|
|
212
|
+
const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
|
|
213
|
+
if (!shouldUpdateState || hasNoSpannedCells) {
|
|
227
214
|
return;
|
|
228
215
|
}
|
|
229
216
|
apiRef.current.setState(state => {
|
|
@@ -235,33 +222,35 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
235
222
|
}
|
|
236
223
|
});
|
|
237
224
|
});
|
|
238
|
-
}, [apiRef, props.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (
|
|
249
|
-
previousTree.current = tree;
|
|
250
|
-
updateRowSpanningState(true);
|
|
225
|
+
}, [apiRef, processedRange, props.pagination, props.paginationMode]);
|
|
226
|
+
|
|
227
|
+
// Reset events trigger a full re-computation of the row spanning state:
|
|
228
|
+
// - The `unstable_rowSpanning` prop is updated (feature flag)
|
|
229
|
+
// - The filtering is applied
|
|
230
|
+
// - The sorting is applied
|
|
231
|
+
// - The `paginationModel` is updated
|
|
232
|
+
// - The rows are updated
|
|
233
|
+
const resetRowSpanningState = React.useCallback(() => {
|
|
234
|
+
const renderContext = gridRenderContextSelector(apiRef);
|
|
235
|
+
if (!isRowContextInitialized(renderContext)) {
|
|
251
236
|
return;
|
|
252
237
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
238
|
+
updateRowSpanningState(renderContext, true);
|
|
239
|
+
}, [apiRef, updateRowSpanningState]);
|
|
240
|
+
useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', runIf(props.rowSpanning, updateRowSpanningState));
|
|
241
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
242
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
243
|
+
useGridApiEventHandler(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
244
|
+
useGridApiEventHandler(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
245
|
+
React.useEffect(() => {
|
|
246
|
+
if (!props.rowSpanning) {
|
|
247
|
+
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
248
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
249
|
+
rowSpanning: EMPTY_STATE
|
|
250
|
+
}));
|
|
261
251
|
}
|
|
262
|
-
|
|
263
|
-
|
|
252
|
+
} else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
|
|
253
|
+
resetRowSpanningState();
|
|
264
254
|
}
|
|
265
|
-
|
|
266
|
-
}, [updateRowSpanningState, renderContext, range, lastRange, tree]);
|
|
255
|
+
}, [apiRef, resetRowSpanningState, props.rowSpanning]);
|
|
267
256
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
export declare const useGridRowsPreProcessors: (apiRef: React.
|
|
3
|
+
export declare const useGridRowsPreProcessors: (apiRef: React.RefObject<GridPrivateApiCommunity>) => void;
|
|
@@ -15,7 +15,7 @@ export declare const useGridVirtualScroller: () => {
|
|
|
15
15
|
ref: (node: HTMLDivElement | null) => (() => void) | undefined;
|
|
16
16
|
};
|
|
17
17
|
getScrollerProps: () => {
|
|
18
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
18
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
19
19
|
onScroll: (event: React.UIEvent) => void;
|
|
20
20
|
onWheel: (event: React.WheelEvent) => void;
|
|
21
21
|
onTouchMove: (event: React.TouchEvent) => void;
|
|
@@ -31,11 +31,11 @@ export declare const useGridVirtualScroller: () => {
|
|
|
31
31
|
role: string;
|
|
32
32
|
};
|
|
33
33
|
getScrollbarVerticalProps: () => {
|
|
34
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
34
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
35
35
|
role: string;
|
|
36
36
|
};
|
|
37
37
|
getScrollbarHorizontalProps: () => {
|
|
38
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
38
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
39
39
|
role: string;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
@@ -86,6 +86,7 @@ export const useGridVirtualScroller = () => {
|
|
|
86
86
|
const contentHeight = dimensions.contentSize.height;
|
|
87
87
|
const columnsTotalWidth = dimensions.columnsTotalWidth;
|
|
88
88
|
const hasColSpan = useGridSelector(apiRef, gridHasColSpanSelector);
|
|
89
|
+
const previousSize = React.useRef(null);
|
|
89
90
|
const mainRefCallback = React.useCallback(node => {
|
|
90
91
|
mainRef.current = node;
|
|
91
92
|
if (!node) {
|
|
@@ -93,7 +94,10 @@ export const useGridVirtualScroller = () => {
|
|
|
93
94
|
}
|
|
94
95
|
const initialRect = node.getBoundingClientRect();
|
|
95
96
|
let lastSize = roundDimensions(initialRect);
|
|
96
|
-
|
|
97
|
+
if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
|
|
98
|
+
previousSize.current = lastSize;
|
|
99
|
+
apiRef.current.publishEvent('resize', lastSize);
|
|
100
|
+
}
|
|
97
101
|
if (typeof ResizeObserver === 'undefined') {
|
|
98
102
|
return undefined;
|
|
99
103
|
}
|
|
@@ -24,7 +24,7 @@ export function createUseGridApiEventHandler(registryContainer) {
|
|
|
24
24
|
}
|
|
25
25
|
const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());
|
|
26
26
|
const subscription = React.useRef(null);
|
|
27
|
-
const handlerRef = React.useRef();
|
|
27
|
+
const handlerRef = React.useRef(null);
|
|
28
28
|
handlerRef.current = handler;
|
|
29
29
|
const cleanupTokenRef = React.useRef(null);
|
|
30
30
|
if (!subscription.current && handlerRef.current) {
|
|
@@ -3,5 +3,5 @@ import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
|
3
3
|
type GetPublicApiType<PrivateApi> = PrivateApi extends {
|
|
4
4
|
getPublicApi: () => infer PublicApi;
|
|
5
5
|
} ? PublicApi : never;
|
|
6
|
-
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: React.
|
|
6
|
+
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: React.RefObject<PrivateApi>, apiMethods: T, visibility: V): void;
|
|
7
7
|
export {};
|
|
@@ -4,4 +4,4 @@ import { GridApiCommunity } from '../../models/api/gridApiCommunity';
|
|
|
4
4
|
/**
|
|
5
5
|
* Hook that instantiate a [[GridApiRef]].
|
|
6
6
|
*/
|
|
7
|
-
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => React.
|
|
7
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => React.RefObject<Api>;
|
|
@@ -5,6 +5,6 @@ import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
|
5
5
|
type DeepPartial<T> = {
|
|
6
6
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
7
7
|
};
|
|
8
|
-
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef: React.
|
|
9
|
-
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef: React.
|
|
8
|
+
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef: React.RefObject<PrivateApi>) => DeepPartial<PrivateApi['state']>;
|
|
9
|
+
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef: React.RefObject<PrivateApi>, props: P) => void;
|
|
10
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Logger } from '../../models/logger';
|
|
3
3
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
4
|
-
export declare function useGridLogger<PrivateApi extends GridPrivateApiCommon>(privateApiRef: React.
|
|
4
|
+
export declare function useGridLogger<PrivateApi extends GridPrivateApiCommon>(privateApiRef: React.RefObject<PrivateApi>, name: string): Logger;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
3
3
|
import type { GridApiCommon, GridRowEntry } from '../../models';
|
|
4
|
-
export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.
|
|
4
|
+
export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.RefObject<Api>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode">) => {
|
|
5
5
|
rows: GridRowEntry<import("../..").GridValidRowModel>[];
|
|
6
6
|
range: {
|
|
7
7
|
firstRowIndex: number;
|
|
@@ -15,7 +15,7 @@ export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.M
|
|
|
15
15
|
* - If the row tree has several layers, it contains up to `state.pageSize` top level rows and all their descendants.
|
|
16
16
|
* - If the row tree is flat, it only contains up to `state.pageSize` rows.
|
|
17
17
|
*/
|
|
18
|
-
export declare const useGridVisibleRows: <Api extends GridApiCommon>(apiRef: React.
|
|
18
|
+
export declare const useGridVisibleRows: <Api extends GridApiCommon>(apiRef: React.RefObject<Api>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode">) => {
|
|
19
19
|
rows: GridRowEntry<import("../..").GridValidRowModel>[];
|
|
20
20
|
range: {
|
|
21
21
|
firstRowIndex: number;
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { getValueOptions } from '../components/panel/filterPanel/filterPanelUtil
|
|
|
12
12
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
13
13
|
export type { GridPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
14
14
|
export { GridStrategyGroup, useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY, } from '../hooks/core/strategyProcessing';
|
|
15
|
-
export type { GridStrategyProcessor } from '../hooks/core/strategyProcessing';
|
|
15
|
+
export type { GridStrategyProcessor, GridStrategyProcessorName, } from '../hooks/core/strategyProcessing';
|
|
16
16
|
export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
17
17
|
export { unwrapPrivateAPI } from '../hooks/core/useGridApiInitialization';
|
|
18
18
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
package/locales/nlNL.js
CHANGED
|
@@ -45,8 +45,7 @@ const nlNLGrid = {
|
|
|
45
45
|
columnsManagementNoColumns: 'Geen kolommen',
|
|
46
46
|
columnsManagementShowHideAllText: 'Toon/Verberg Alle',
|
|
47
47
|
columnsManagementReset: 'Reset',
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
columnsManagementDeleteIconLabel: 'Verwijderen',
|
|
50
49
|
// Filter panel text
|
|
51
50
|
filterPanelAddFilter: 'Filter toevoegen',
|
|
52
51
|
filterPanelRemoveAll: 'Alles verwijderen',
|
|
@@ -60,9 +59,9 @@ const nlNLGrid = {
|
|
|
60
59
|
filterPanelInputPlaceholder: 'Filter waarde',
|
|
61
60
|
// Filter operators text
|
|
62
61
|
filterOperatorContains: 'bevat',
|
|
63
|
-
|
|
62
|
+
filterOperatorDoesNotContain: 'bevat niet',
|
|
64
63
|
filterOperatorEquals: 'gelijk aan',
|
|
65
|
-
|
|
64
|
+
filterOperatorDoesNotEqual: 'niet gelijk aan',
|
|
66
65
|
filterOperatorStartsWith: 'begint met',
|
|
67
66
|
filterOperatorEndsWith: 'eindigt met',
|
|
68
67
|
filterOperatorIs: 'is',
|
|
@@ -82,9 +81,9 @@ const nlNLGrid = {
|
|
|
82
81
|
'filterOperator<=': '<=',
|
|
83
82
|
// Header filter operators text
|
|
84
83
|
headerFilterOperatorContains: 'Bevat',
|
|
85
|
-
|
|
84
|
+
headerFilterOperatorDoesNotContain: 'Bevat niet',
|
|
86
85
|
headerFilterOperatorEquals: 'Gelijk aan',
|
|
87
|
-
|
|
86
|
+
headerFilterOperatorDoesNotEqual: 'Niet gelijk aan',
|
|
88
87
|
headerFilterOperatorStartsWith: 'Begint met',
|
|
89
88
|
headerFilterOperatorEndsWith: 'Eindigt met',
|
|
90
89
|
headerFilterOperatorIs: 'Is',
|
package/material/index.js
CHANGED
|
@@ -4,7 +4,9 @@ const _excluded = ["inert", "iconStart", "iconEnd", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import MUIBadge from '@mui/material/Badge';
|
|
6
6
|
import MUICheckbox from '@mui/material/Checkbox';
|
|
7
|
+
import MUICircularProgress from '@mui/material/CircularProgress';
|
|
7
8
|
import MUIDivider from '@mui/material/Divider';
|
|
9
|
+
import MUILinearProgress from '@mui/material/LinearProgress';
|
|
8
10
|
import MUIListItemIcon from '@mui/material/ListItemIcon';
|
|
9
11
|
import MUIListItemText from '@mui/material/ListItemText';
|
|
10
12
|
import MUIMenuList from '@mui/material/MenuList';
|
|
@@ -19,6 +21,7 @@ import MUITooltip from '@mui/material/Tooltip';
|
|
|
19
21
|
import MUIPopper from '@mui/material/Popper';
|
|
20
22
|
import MUIInputLabel from '@mui/material/InputLabel';
|
|
21
23
|
import MUIChip from '@mui/material/Chip';
|
|
24
|
+
import MUISkeleton from '@mui/material/Skeleton';
|
|
22
25
|
import { GridColumnUnsortedIcon } from "./icons/GridColumnUnsortedIcon.js";
|
|
23
26
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from "./icons/index.js";
|
|
24
27
|
import MUISelectOption from "./components/MUISelectOption.js";
|
|
@@ -63,7 +66,9 @@ const iconSlots = {
|
|
|
63
66
|
const baseSlots = {
|
|
64
67
|
baseBadge: MUIBadge,
|
|
65
68
|
baseCheckbox: MUICheckbox,
|
|
69
|
+
baseCircularProgress: MUICircularProgress,
|
|
66
70
|
baseDivider: MUIDivider,
|
|
71
|
+
baseLinearProgress: MUILinearProgress,
|
|
67
72
|
baseMenuList: MUIMenuList,
|
|
68
73
|
baseMenuItem: BaseMenuItem,
|
|
69
74
|
baseTextField: MUITextField,
|
|
@@ -76,6 +81,7 @@ const baseSlots = {
|
|
|
76
81
|
basePopper: MUIPopper,
|
|
77
82
|
baseInputLabel: MUIInputLabel,
|
|
78
83
|
baseSelectOption: MUISelectOption,
|
|
84
|
+
baseSkeleton: MUISkeleton,
|
|
79
85
|
baseChip: MUIChip
|
|
80
86
|
};
|
|
81
87
|
const materialSlots = _extends({}, baseSlots, iconSlots);
|
|
@@ -13,7 +13,7 @@ export interface GridCoreApi {
|
|
|
13
13
|
* The React ref of the grid root container div element.
|
|
14
14
|
* @ignore - do not document.
|
|
15
15
|
*/
|
|
16
|
-
rootElementRef: React.RefObject<HTMLDivElement>;
|
|
16
|
+
rootElementRef: React.RefObject<HTMLDivElement | null>;
|
|
17
17
|
/**
|
|
18
18
|
* Registers a handler for an event.
|
|
19
19
|
* @param {string} event The name of the event.
|
|
@@ -59,27 +59,27 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
|
|
|
59
59
|
/**
|
|
60
60
|
* The React ref of the grid main container div element.
|
|
61
61
|
*/
|
|
62
|
-
mainElementRef: React.
|
|
62
|
+
mainElementRef: React.RefObject<HTMLDivElement | null>;
|
|
63
63
|
/**
|
|
64
64
|
* The React ref of the grid's virtual scroller container element.
|
|
65
65
|
*/
|
|
66
|
-
virtualScrollerRef: React.RefObject<HTMLDivElement>;
|
|
66
|
+
virtualScrollerRef: React.RefObject<HTMLDivElement | null>;
|
|
67
67
|
/**
|
|
68
68
|
* The React ref of the grid's vertical virtual scrollbar container element.
|
|
69
69
|
*/
|
|
70
|
-
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement>;
|
|
70
|
+
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement | null>;
|
|
71
71
|
/**
|
|
72
72
|
* The React ref of the grid's horizontal virtual scrollbar container element.
|
|
73
73
|
*/
|
|
74
|
-
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement>;
|
|
74
|
+
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement | null>;
|
|
75
75
|
/**
|
|
76
76
|
* The React ref of the grid column container virtualized div element.
|
|
77
77
|
*/
|
|
78
|
-
columnHeadersContainerRef: React.RefObject<HTMLDivElement>;
|
|
78
|
+
columnHeadersContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
79
79
|
/**
|
|
80
80
|
* The React ref of the grid header filter row element.
|
|
81
81
|
*/
|
|
82
|
-
headerFiltersElementRef?: React.RefObject<HTMLDivElement>;
|
|
82
|
+
headerFiltersElementRef?: React.RefObject<HTMLDivElement | null>;
|
|
83
83
|
register: <V extends 'public' | 'private', T extends V extends 'public' ? Partial<GridPublicApi> : Partial<Omit<GridPrivateApi, keyof GridPublicApi>>>(visibility: V, methods: T) => void;
|
|
84
84
|
/**
|
|
85
85
|
* Returns the public API.
|
|
@@ -1,15 +1,38 @@
|
|
|
1
|
+
type Ref<T = HTMLElement> = React.RefCallback<T | null> | React.RefObject<T | null> | null;
|
|
1
2
|
export type BadgeProps = {
|
|
2
3
|
badgeContent?: React.ReactNode;
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
color?: 'primary' | 'default' | 'error';
|
|
6
|
+
invisible?: boolean;
|
|
5
7
|
overlap?: 'circular';
|
|
6
8
|
variant?: 'dot';
|
|
7
|
-
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
export type ButtonProps = {
|
|
12
|
+
ref?: Ref;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
id?: string;
|
|
17
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
18
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
19
|
+
role?: string;
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
startIcon?: React.ReactNode;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
touchRippleRef?: any;
|
|
26
|
+
};
|
|
27
|
+
export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
|
|
28
|
+
label?: string;
|
|
29
|
+
color?: 'default' | 'inherit' | 'primary';
|
|
30
|
+
edge?: 'start' | 'end' | false;
|
|
8
31
|
};
|
|
9
32
|
export type DividerProps = {};
|
|
10
33
|
export type MenuItemProps = {
|
|
11
34
|
autoFocus?: boolean;
|
|
12
|
-
children
|
|
35
|
+
children?: React.ReactNode;
|
|
13
36
|
/** For items that aren't interactive themselves (but may contain an interactive widget) */
|
|
14
37
|
inert?: boolean;
|
|
15
38
|
disabled?: boolean;
|
|
@@ -18,4 +41,26 @@ export type MenuItemProps = {
|
|
|
18
41
|
iconEnd?: React.ReactNode;
|
|
19
42
|
selected?: boolean;
|
|
20
43
|
value?: number | string | readonly string[];
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
};
|
|
46
|
+
export type CircularProgressProps = {
|
|
47
|
+
/**
|
|
48
|
+
* Pixels or CSS value.
|
|
49
|
+
* @default 40
|
|
50
|
+
*/
|
|
51
|
+
size?: number | string;
|
|
52
|
+
/** @default 'primary' */
|
|
53
|
+
color?: 'inherit' | 'primary';
|
|
54
|
+
};
|
|
55
|
+
export type LinearProgressProps = {};
|
|
56
|
+
export type SkeletonProps = {
|
|
57
|
+
variant?: 'circular' | 'text';
|
|
58
|
+
width?: number | string;
|
|
59
|
+
height?: number | string;
|
|
60
|
+
};
|
|
61
|
+
export type TooltipProps = {
|
|
62
|
+
children: React.ReactElement<any, any>;
|
|
63
|
+
enterDelay?: number;
|
|
64
|
+
title: React.ReactNode;
|
|
21
65
|
};
|
|
66
|
+
export {};
|
|
@@ -13,6 +13,11 @@ export interface GridBaseSlots {
|
|
|
13
13
|
* @default Checkbox
|
|
14
14
|
*/
|
|
15
15
|
baseCheckbox: React.JSXElementConstructor<GridSlotProps['baseCheckbox']>;
|
|
16
|
+
/**
|
|
17
|
+
* The custom CircularProgress component used in the grid.
|
|
18
|
+
* @default CircularProgress
|
|
19
|
+
*/
|
|
20
|
+
baseCircularProgress: React.JSXElementConstructor<GridSlotProps['baseCircularProgress']>;
|
|
16
21
|
/**
|
|
17
22
|
* The custom Chip component used in the grid.
|
|
18
23
|
* @default Chip
|
|
@@ -23,6 +28,11 @@ export interface GridBaseSlots {
|
|
|
23
28
|
* @default Divider
|
|
24
29
|
*/
|
|
25
30
|
baseDivider: React.JSXElementConstructor<GridSlotProps['baseDivider']>;
|
|
31
|
+
/**
|
|
32
|
+
* The custom LinearProgress component used in the grid.
|
|
33
|
+
* @default LinearProgress
|
|
34
|
+
*/
|
|
35
|
+
baseLinearProgress: React.JSXElementConstructor<GridSlotProps['baseLinearProgress']>;
|
|
26
36
|
/**
|
|
27
37
|
* The custom MenuList component used in the grid.
|
|
28
38
|
* @default MenuList
|
|
@@ -80,9 +90,14 @@ export interface GridBaseSlots {
|
|
|
80
90
|
baseInputLabel: React.JSXElementConstructor<GridSlotProps['baseInputLabel']>;
|
|
81
91
|
/**
|
|
82
92
|
* The custom SelectOption component used in the grid.
|
|
83
|
-
* @default
|
|
93
|
+
* @default SelectOption
|
|
84
94
|
*/
|
|
85
95
|
baseSelectOption: React.JSXElementConstructor<GridSlotProps['baseSelectOption']>;
|
|
96
|
+
/**
|
|
97
|
+
* The custom Skeleton component used in the grid.
|
|
98
|
+
* @default Skeleton
|
|
99
|
+
*/
|
|
100
|
+
baseSkeleton: React.JSXElementConstructor<GridSlotProps['baseSkeleton']>;
|
|
86
101
|
}
|
|
87
102
|
/**
|
|
88
103
|
* Grid components React prop interface containing all the overridable components.
|