@mui/x-data-grid 7.24.1 → 7.26.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 +148 -0
- package/DataGrid/DataGrid.js +1 -7
- package/DataGrid/useDataGridComponent.js +2 -2
- package/components/GridRow.d.ts +0 -1
- package/components/GridRow.js +32 -20
- package/components/GridScrollArea.d.ts +5 -2
- package/components/GridScrollArea.js +32 -25
- package/components/GridSkeletonLoadingOverlay.js +2 -1
- package/components/cell/GridCell.d.ts +9 -6
- package/components/cell/GridCell.js +29 -52
- package/components/containers/GridRoot.js +11 -9
- package/components/containers/GridRootStyles.js +138 -40
- package/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/components/virtualization/GridMainContainer.d.ts +10 -0
- package/components/virtualization/GridMainContainer.js +10 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/components/virtualization/GridVirtualScroller.js +36 -16
- package/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/hooks/core/useGridStateInitialization.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +0 -5
- package/hooks/features/columns/gridColumnsSelector.js +0 -12
- package/hooks/features/columns/useGridColumns.js +7 -3
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +16 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/hooks/features/dimensions/index.d.ts +1 -1
- package/hooks/features/dimensions/index.js +1 -2
- package/hooks/features/dimensions/useGridDimensions.js +102 -77
- package/hooks/features/editing/gridEditingSelectors.d.ts +10 -0
- package/hooks/features/editing/gridEditingSelectors.js +12 -1
- package/hooks/features/editing/index.d.ts +1 -1
- package/hooks/features/editing/index.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridRowEditing.js +8 -9
- package/hooks/features/filter/gridFilterState.d.ts +5 -0
- package/hooks/features/filter/gridFilterState.js +5 -0
- package/hooks/features/filter/useGridFilter.js +6 -13
- package/hooks/features/focus/useGridFocus.js +3 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/hooks/features/keyboardNavigation/utils.d.ts +1 -2
- package/hooks/features/keyboardNavigation/utils.js +0 -5
- package/hooks/features/listView/useGridListView.js +2 -1
- package/hooks/features/pagination/useGridPagination.js +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +4 -4
- package/hooks/features/rowSelection/utils.js +1 -1
- package/hooks/features/rows/gridRowsMetaState.d.ts +8 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +0 -4
- package/hooks/features/rows/gridRowsUtils.js +0 -16
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
- package/hooks/features/rows/useGridParamsApi.js +33 -14
- package/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/hooks/features/rows/useGridRows.js +7 -8
- package/hooks/features/rows/useGridRowsMeta.js +36 -19
- package/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +15 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +74 -72
- package/hooks/utils/useGridSelector.d.ts +8 -1
- package/hooks/utils/useGridSelector.js +42 -8
- package/hooks/utils/useIsSSR.d.ts +1 -0
- package/hooks/utils/useIsSSR.js +5 -0
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +2 -1
- package/models/api/gridApiCommon.d.ts +2 -2
- package/models/api/gridParamsApi.d.ts +29 -2
- package/models/api/gridStateApi.d.ts +1 -0
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +6 -0
- package/modern/DataGrid/DataGrid.js +1 -7
- package/modern/DataGrid/useDataGridComponent.js +2 -2
- package/modern/components/GridRow.js +32 -20
- package/modern/components/GridScrollArea.js +32 -25
- package/modern/components/GridSkeletonLoadingOverlay.js +2 -1
- package/modern/components/cell/GridCell.js +29 -52
- package/modern/components/containers/GridRoot.js +11 -9
- package/modern/components/containers/GridRootStyles.js +138 -40
- package/modern/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/modern/components/virtualization/GridMainContainer.js +10 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/modern/components/virtualization/GridVirtualScroller.js +36 -16
- package/modern/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/modern/hooks/core/useGridStateInitialization.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/gridColumnsSelector.js +0 -12
- package/modern/hooks/features/columns/useGridColumns.js +7 -3
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/modern/hooks/features/dimensions/index.js +1 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +102 -77
- package/modern/hooks/features/editing/gridEditingSelectors.js +12 -1
- package/modern/hooks/features/editing/index.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +8 -9
- package/modern/hooks/features/filter/gridFilterState.js +5 -0
- package/modern/hooks/features/filter/useGridFilter.js +6 -13
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/modern/hooks/features/keyboardNavigation/utils.js +0 -5
- package/modern/hooks/features/listView/useGridListView.js +2 -1
- package/modern/hooks/features/pagination/useGridPagination.js +1 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +4 -4
- package/modern/hooks/features/rowSelection/utils.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -16
- package/modern/hooks/features/rows/useGridParamsApi.js +33 -14
- package/modern/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/modern/hooks/features/rows/useGridRows.js +7 -8
- package/modern/hooks/features/rows/useGridRowsMeta.js +36 -19
- package/modern/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +74 -72
- package/modern/hooks/utils/useGridSelector.js +42 -8
- package/modern/hooks/utils/useIsSSR.js +5 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -1
- package/modern/models/api/index.js +0 -1
- package/modern/utils/roundToDecimalPlaces.js +3 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +1 -7
- package/node/DataGrid/useDataGridComponent.js +2 -2
- package/node/components/GridRow.js +28 -17
- package/node/components/GridScrollArea.js +31 -24
- package/node/components/GridSkeletonLoadingOverlay.js +2 -1
- package/node/components/cell/GridCell.js +27 -50
- package/node/components/containers/GridRoot.js +10 -8
- package/node/components/containers/GridRootStyles.js +138 -40
- package/node/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/node/components/virtualization/GridMainContainer.js +10 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/node/components/virtualization/GridVirtualScroller.js +36 -16
- package/node/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/node/hooks/core/useGridStateInitialization.js +3 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/columns/gridColumnsSelector.js +1 -13
- package/node/hooks/features/columns/useGridColumns.js +7 -3
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +38 -2
- package/node/hooks/features/dimensions/index.js +13 -11
- package/node/hooks/features/dimensions/useGridDimensions.js +99 -74
- package/node/hooks/features/editing/gridEditingSelectors.js +12 -2
- package/node/hooks/features/editing/index.js +7 -11
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +6 -7
- package/node/hooks/features/filter/gridFilterState.js +6 -1
- package/node/hooks/features/filter/useGridFilter.js +5 -12
- package/node/hooks/features/focus/useGridFocus.js +3 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -15
- package/node/hooks/features/keyboardNavigation/utils.js +0 -6
- package/node/hooks/features/listView/useGridListView.js +2 -1
- package/node/hooks/features/pagination/useGridPagination.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +3 -3
- package/node/hooks/features/rowSelection/utils.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +0 -17
- package/node/hooks/features/rows/useGridParamsApi.js +33 -14
- package/node/hooks/features/rows/useGridRowSpanning.js +92 -89
- package/node/hooks/features/rows/useGridRows.js +7 -8
- package/node/hooks/features/rows/useGridRowsMeta.js +36 -19
- package/node/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +73 -71
- package/node/hooks/utils/useGridSelector.js +42 -8
- package/node/hooks/utils/useIsSSR.js +12 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +20 -7
- package/node/models/api/index.js +0 -11
- package/node/utils/roundToDecimalPlaces.js +9 -0
- package/node/utils/utils.js +8 -1
- package/package.json +3 -2
- package/utils/roundToDecimalPlaces.d.ts +1 -0
- package/utils/roundToDecimalPlaces.js +3 -0
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
|
@@ -401,6 +401,12 @@ export interface GridControlledStateReasonLookup {
|
|
|
401
401
|
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
|
|
402
402
|
}
|
|
403
403
|
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
404
|
+
/**
|
|
405
|
+
* Fired when rootElementRef.current becomes available.
|
|
406
|
+
*/
|
|
407
|
+
rootMount: {
|
|
408
|
+
params: HTMLElement;
|
|
409
|
+
};
|
|
404
410
|
/**
|
|
405
411
|
* Fired when the grid is unmounted.
|
|
406
412
|
*/
|
|
@@ -18,17 +18,11 @@ const configuration = {
|
|
|
18
18
|
useGridRowAriaAttributes
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
let propValidators;
|
|
22
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
23
|
-
propValidators = [...propValidatorsDataGrid,
|
|
24
|
-
// Only validate in MIT version
|
|
25
|
-
props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
|
|
26
|
-
}
|
|
27
21
|
const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
|
|
28
22
|
const props = useDataGridProps(inProps);
|
|
29
23
|
const privateApiRef = useDataGridComponent(props.apiRef, props);
|
|
30
24
|
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
-
validateProps(props,
|
|
25
|
+
validateProps(props, propValidatorsDataGrid);
|
|
32
26
|
}
|
|
33
27
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
34
28
|
privateApiRef: privateApiRef,
|
|
@@ -41,7 +41,6 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
41
41
|
/**
|
|
42
42
|
* Register all state initializers here.
|
|
43
43
|
*/
|
|
44
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
45
44
|
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
46
45
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
47
46
|
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
@@ -54,10 +53,11 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
53
|
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
56
55
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
57
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
59
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
61
61
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
62
62
|
useGridKeyboardNavigation(apiRef, props);
|
|
63
63
|
useGridRowSelection(apiRef, props);
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "
|
|
5
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetLeft", "columnsTotalWidth", "firstColumnIndex", "lastColumnIndex", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "scrollbarWidth", "gridHasFiller", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import clsx from 'clsx';
|
|
7
9
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
8
10
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
11
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
|
-
import {
|
|
12
|
+
import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
|
|
13
|
+
import { GridEditModes, GridCellModes } from "../models/gridEditRowModel.js";
|
|
11
14
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
12
15
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
13
16
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
14
17
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
15
18
|
import { gridColumnPositionsSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
16
|
-
import { useGridSelector, objectShallowCompare } from "../hooks/utils/useGridSelector.js";
|
|
19
|
+
import { useGridSelector, objectShallowCompare, useGridSelectorV8 } from "../hooks/utils/useGridSelector.js";
|
|
17
20
|
import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
18
21
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
19
22
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
@@ -21,12 +24,20 @@ import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
|
21
24
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../internals/constants.js";
|
|
22
25
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
23
26
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
24
|
-
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
27
|
+
import { gridEditRowsStateSelector, gridRowIsEditingSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
25
28
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
26
29
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
27
30
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
28
31
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
32
|
+
import { createSelectorV8 } from "../utils/createSelector.js";
|
|
29
33
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
const isRowReorderingEnabledSelector = createSelectorV8(gridEditRowsStateSelector, (editRows, rowReordering) => {
|
|
35
|
+
if (!rowReordering) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const isEditingRows = !isObjectEmpty(editRows);
|
|
39
|
+
return !isEditingRows;
|
|
40
|
+
});
|
|
30
41
|
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
31
42
|
const {
|
|
32
43
|
selected,
|
|
@@ -65,10 +76,14 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
65
76
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
66
77
|
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
67
78
|
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
68
|
-
const
|
|
79
|
+
const rowReordering = rootProps.rowReordering;
|
|
80
|
+
const isRowReorderingEnabled = useGridSelectorV8(apiRef, isRowReorderingEnabledSelector, rowReordering);
|
|
69
81
|
const handleRef = useForkRef(ref, refProp);
|
|
70
82
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
71
|
-
const editing = apiRef
|
|
83
|
+
const editing = useGridSelectorV8(apiRef, gridRowIsEditingSelector, {
|
|
84
|
+
rowId,
|
|
85
|
+
editMode: rootProps.editMode
|
|
86
|
+
});
|
|
72
87
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
73
88
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
74
89
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
@@ -145,7 +160,6 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
145
160
|
slotProps,
|
|
146
161
|
disableColumnReorder
|
|
147
162
|
} = rootProps;
|
|
148
|
-
const rowReordering = rootProps.rowReordering;
|
|
149
163
|
const heightEntry = useGridSelector(apiRef, () => _extends({}, apiRef.current.getRowHeightEntry(rowId)), objectShallowCompare);
|
|
150
164
|
const style = React.useMemo(() => {
|
|
151
165
|
if (isNotVisible) {
|
|
@@ -188,6 +202,11 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
188
202
|
});
|
|
189
203
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
190
204
|
}
|
|
205
|
+
|
|
206
|
+
/* Start of rendering */
|
|
207
|
+
if (!rowNode) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
191
210
|
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedColumnPosition.NONE) => {
|
|
192
211
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
193
212
|
if (cellColSpanInfo?.spannedByColSpan) {
|
|
@@ -205,14 +224,12 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
205
224
|
align: column.align
|
|
206
225
|
}, column.field);
|
|
207
226
|
}
|
|
208
|
-
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
209
227
|
|
|
210
228
|
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
211
229
|
// fixes https://github.com/mui/mui-x/issues/11126
|
|
212
230
|
const isReorderCell = column.field === '__reorder__';
|
|
213
|
-
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
214
231
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
215
|
-
const canReorderRow =
|
|
232
|
+
const canReorderRow = isRowReorderingEnabled && !sortModel.length && treeDepth <= 1;
|
|
216
233
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
217
234
|
const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
|
|
218
235
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
@@ -225,20 +242,15 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
225
242
|
colIndex: indexRelativeToAllColumns,
|
|
226
243
|
colSpan: colSpan,
|
|
227
244
|
disableDragEvents: disableDragEvents,
|
|
228
|
-
editCellState: editCellState,
|
|
229
245
|
isNotVisible: cellIsNotVisible,
|
|
230
246
|
pinnedOffset: pinnedOffset,
|
|
231
247
|
pinnedPosition: pinnedPosition,
|
|
232
248
|
showLeftBorder: showLeftBorder,
|
|
233
|
-
showRightBorder: showRightBorder
|
|
249
|
+
showRightBorder: showRightBorder,
|
|
250
|
+
row: row,
|
|
251
|
+
rowNode: rowNode
|
|
234
252
|
}, slotProps?.cell), column.field);
|
|
235
253
|
};
|
|
236
|
-
|
|
237
|
-
/* Start of rendering */
|
|
238
|
-
|
|
239
|
-
if (!rowNode) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
254
|
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
243
255
|
const indexRelativeToAllColumns = i;
|
|
244
256
|
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, PinnedColumnPosition.LEFT);
|
|
@@ -289,7 +301,8 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
289
301
|
role: "presentation",
|
|
290
302
|
className: clsx(gridClasses.cell, gridClasses.cellEmpty)
|
|
291
303
|
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/_jsx(ScrollbarFiller, {
|
|
292
|
-
pinnedRight: pinnedColumns.right.length > 0
|
|
304
|
+
pinnedRight: pinnedColumns.right.length > 0,
|
|
305
|
+
borderTop: !isFirstVisible
|
|
293
306
|
})]
|
|
294
307
|
}));
|
|
295
308
|
});
|
|
@@ -316,7 +329,6 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
316
329
|
isNotVisible: PropTypes.bool.isRequired,
|
|
317
330
|
lastColumnIndex: PropTypes.number.isRequired,
|
|
318
331
|
offsetLeft: PropTypes.number.isRequired,
|
|
319
|
-
offsetTop: PropTypes.number,
|
|
320
332
|
onClick: PropTypes.func,
|
|
321
333
|
onDoubleClick: PropTypes.func,
|
|
322
334
|
onMouseEnter: PropTypes.func,
|
|
@@ -8,12 +8,12 @@ import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
|
8
8
|
import { getDataGridUtilityClass, gridClasses } from "../constants/index.js";
|
|
9
9
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
10
|
import { useGridApiEventHandler } from "../hooks/utils/useGridApiEventHandler.js";
|
|
11
|
-
import { useGridSelector } from "../hooks/utils/useGridSelector.js";
|
|
12
|
-
import { gridDimensionsSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
11
|
+
import { useGridSelector, useGridSelectorV8 } from "../hooks/utils/useGridSelector.js";
|
|
12
|
+
import { gridDimensionsSelector, gridColumnsTotalWidthSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
13
13
|
import { gridDensityFactorSelector } from "../hooks/features/density/densitySelector.js";
|
|
14
|
-
import { gridColumnsTotalWidthSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
15
14
|
import { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
16
15
|
import { getTotalHeaderHeight } from "../hooks/features/columns/gridColumnsUtils.js";
|
|
16
|
+
import { createSelectorV8 } from "../utils/createSelector.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
const CLIFF = 1;
|
|
19
19
|
const SLOP = 1.5;
|
|
@@ -48,21 +48,38 @@ const GridScrollAreaRawRoot = styled('div', {
|
|
|
48
48
|
right: 0
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
51
|
-
|
|
51
|
+
const offsetSelector = createSelectorV8(gridDimensionsSelector, (dimensions, direction) => {
|
|
52
|
+
if (direction === 'left') {
|
|
53
|
+
return dimensions.leftPinnedWidth;
|
|
54
|
+
}
|
|
55
|
+
if (direction === 'right') {
|
|
56
|
+
return dimensions.rightPinnedWidth + (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
});
|
|
60
|
+
function GridScrollAreaWrapper(props) {
|
|
61
|
+
const apiRef = useGridApiContext();
|
|
62
|
+
const [dragging, setDragging] = React.useState(false);
|
|
63
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', () => setDragging(true));
|
|
64
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', () => setDragging(false));
|
|
65
|
+
if (!dragging) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/_jsx(GridScrollAreaContent, _extends({}, props));
|
|
69
|
+
}
|
|
70
|
+
function GridScrollAreaContent(props) {
|
|
52
71
|
const {
|
|
53
|
-
scrollDirection
|
|
72
|
+
scrollDirection,
|
|
73
|
+
scrollPosition
|
|
54
74
|
} = props;
|
|
55
75
|
const rootRef = React.useRef(null);
|
|
56
76
|
const apiRef = useGridApiContext();
|
|
57
77
|
const timeout = useTimeout();
|
|
58
78
|
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
59
79
|
const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
|
|
60
|
-
const
|
|
61
|
-
const scrollPosition = React.useRef({
|
|
62
|
-
left: 0,
|
|
63
|
-
top: 0
|
|
64
|
-
});
|
|
80
|
+
const sideOffset = useGridSelectorV8(apiRef, offsetSelector, scrollDirection);
|
|
65
81
|
const getCanScrollMore = () => {
|
|
82
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
66
83
|
if (scrollDirection === 'left') {
|
|
67
84
|
// Only render if the user has not reached yet the start of the list
|
|
68
85
|
return scrollPosition.current.left > 0;
|
|
@@ -74,7 +91,6 @@ function GridScrollAreaRaw(props) {
|
|
|
74
91
|
}
|
|
75
92
|
return false;
|
|
76
93
|
};
|
|
77
|
-
const [dragging, setDragging] = React.useState(false);
|
|
78
94
|
const [canScrollMore, setCanScrollMore] = React.useState(getCanScrollMore);
|
|
79
95
|
const rootProps = useGridRootProps();
|
|
80
96
|
const ownerState = _extends({}, rootProps, {
|
|
@@ -88,12 +104,11 @@ function GridScrollAreaRaw(props) {
|
|
|
88
104
|
top: totalHeaderHeight - headerHeight
|
|
89
105
|
};
|
|
90
106
|
if (scrollDirection === 'left') {
|
|
91
|
-
style.left =
|
|
107
|
+
style.left = sideOffset;
|
|
92
108
|
} else if (scrollDirection === 'right') {
|
|
93
|
-
style.right =
|
|
109
|
+
style.right = sideOffset;
|
|
94
110
|
}
|
|
95
|
-
const handleScrolling =
|
|
96
|
-
scrollPosition.current = newScrollPosition;
|
|
111
|
+
const handleScrolling = () => {
|
|
97
112
|
setCanScrollMore(getCanScrollMore);
|
|
98
113
|
};
|
|
99
114
|
const handleDragOver = useEventCallback(event => {
|
|
@@ -118,16 +133,8 @@ function GridScrollAreaRaw(props) {
|
|
|
118
133
|
});
|
|
119
134
|
});
|
|
120
135
|
});
|
|
121
|
-
const handleColumnHeaderDragStart = useEventCallback(() => {
|
|
122
|
-
setDragging(true);
|
|
123
|
-
});
|
|
124
|
-
const handleColumnHeaderDragEnd = useEventCallback(() => {
|
|
125
|
-
setDragging(false);
|
|
126
|
-
});
|
|
127
136
|
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
128
|
-
|
|
129
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleColumnHeaderDragEnd);
|
|
130
|
-
if (!dragging || !canScrollMore) {
|
|
137
|
+
if (!canScrollMore) {
|
|
131
138
|
return null;
|
|
132
139
|
}
|
|
133
140
|
return /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
@@ -138,4 +145,4 @@ function GridScrollAreaRaw(props) {
|
|
|
138
145
|
style: style
|
|
139
146
|
});
|
|
140
147
|
}
|
|
141
|
-
export const GridScrollArea = fastMemo(
|
|
148
|
+
export const GridScrollArea = fastMemo(GridScrollAreaWrapper);
|
|
@@ -8,8 +8,9 @@ import { useRtl } from '@mui/system/RtlProvider';
|
|
|
8
8
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
9
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
10
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
11
|
-
import { gridColumnPositionsSelector,
|
|
11
|
+
import { gridColumnPositionsSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from "../hooks/index.js";
|
|
12
12
|
import { PinnedColumnPosition } from "../internals/constants.js";
|
|
13
|
+
import { gridColumnsTotalWidthSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
13
14
|
import { getDataGridUtilityClass, gridClasses } from "../constants/gridClasses.js";
|
|
14
15
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
15
16
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["column", "rowId", "
|
|
3
|
+
const _excluded = ["column", "row", "rowId", "rowNode", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "showRightBorder", "showLeftBorder", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
4
4
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -12,13 +12,14 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
12
12
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
13
13
|
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
|
|
14
14
|
import { GridCellModes } from "../../models/index.js";
|
|
15
|
-
import { useGridSelector,
|
|
16
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
15
|
+
import { useGridSelector, useGridSelectorV8 } from "../../hooks/utils/useGridSelector.js";
|
|
17
16
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
18
|
-
import { gridFocusCellSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
|
|
17
|
+
import { gridFocusCellSelector, gridTabIndexCellSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
|
|
19
18
|
import { GridPinnedColumnPosition } from "../../hooks/features/columns/gridColumnsInterfaces.js";
|
|
20
19
|
import { PinnedColumnPosition } from "../../internals/constants.js";
|
|
21
20
|
import { gridRowSpanningHiddenCellsSelector, gridRowSpanningSpannedCellsSelector } from "../../hooks/features/rows/gridRowSpanningSelectors.js";
|
|
21
|
+
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
22
|
+
import { gridEditCellStateSelector } from "../../hooks/features/editing/gridEditingSelectors.js";
|
|
22
23
|
import { attachPinnedStyle } from "../../internals/utils/index.js";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
export const gridPinnedColumnPositionLookup = {
|
|
@@ -27,30 +28,6 @@ export const gridPinnedColumnPositionLookup = {
|
|
|
27
28
|
[PinnedColumnPosition.NONE]: undefined,
|
|
28
29
|
[PinnedColumnPosition.VIRTUAL]: undefined
|
|
29
30
|
};
|
|
30
|
-
const EMPTY_CELL_PARAMS = {
|
|
31
|
-
id: -1,
|
|
32
|
-
field: '__unset__',
|
|
33
|
-
row: {},
|
|
34
|
-
rowNode: {
|
|
35
|
-
id: -1,
|
|
36
|
-
depth: 0,
|
|
37
|
-
type: 'leaf',
|
|
38
|
-
parent: -1,
|
|
39
|
-
groupingKey: null
|
|
40
|
-
},
|
|
41
|
-
colDef: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
field: '__unset__',
|
|
44
|
-
computedWidth: 0
|
|
45
|
-
},
|
|
46
|
-
cellMode: GridCellModes.View,
|
|
47
|
-
hasFocus: false,
|
|
48
|
-
tabIndex: -1,
|
|
49
|
-
value: null,
|
|
50
|
-
formattedValue: '__unset__',
|
|
51
|
-
isEditable: false,
|
|
52
|
-
api: {}
|
|
53
|
-
};
|
|
54
31
|
const useUtilityClasses = ownerState => {
|
|
55
32
|
const {
|
|
56
33
|
align,
|
|
@@ -74,8 +51,9 @@ let warnedOnce = false;
|
|
|
74
51
|
const GridCell = forwardRef(function GridCell(props, ref) {
|
|
75
52
|
const {
|
|
76
53
|
column,
|
|
54
|
+
row,
|
|
77
55
|
rowId,
|
|
78
|
-
|
|
56
|
+
rowNode,
|
|
79
57
|
align,
|
|
80
58
|
colIndex,
|
|
81
59
|
width,
|
|
@@ -99,22 +77,29 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
99
77
|
onDragOver
|
|
100
78
|
} = props,
|
|
101
79
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
102
|
-
const apiRef =
|
|
80
|
+
const apiRef = useGridPrivateApiContext();
|
|
103
81
|
const rootProps = useGridRootProps();
|
|
104
82
|
const isRtl = useRtl();
|
|
105
83
|
const field = column.field;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
84
|
+
const editCellState = useGridSelectorV8(apiRef, gridEditCellStateSelector, {
|
|
85
|
+
rowId,
|
|
86
|
+
field
|
|
87
|
+
});
|
|
88
|
+
const cellMode = editCellState ? GridCellModes.Edit : GridCellModes.View;
|
|
89
|
+
const cellParams = apiRef.current.getCellParamsForRow(rowId, field, row, {
|
|
90
|
+
colDef: column,
|
|
91
|
+
cellMode,
|
|
92
|
+
rowNode: rowNode,
|
|
93
|
+
tabIndex: useGridSelector(apiRef, () => {
|
|
94
|
+
const cellTabIndex = gridTabIndexCellSelector(apiRef);
|
|
95
|
+
return cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === rowId ? 0 : -1;
|
|
96
|
+
}),
|
|
97
|
+
hasFocus: useGridSelector(apiRef, () => {
|
|
98
|
+
const focus = gridFocusCellSelector(apiRef);
|
|
99
|
+
return focus?.id === rowId && focus.field === field;
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
cellParams.api = apiRef.current;
|
|
118
103
|
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
119
104
|
id: rowId,
|
|
120
105
|
field
|
|
@@ -122,7 +107,6 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
122
107
|
const hiddenCells = useGridSelector(apiRef, gridRowSpanningHiddenCellsSelector);
|
|
123
108
|
const spannedCells = useGridSelector(apiRef, gridRowSpanningSpannedCellsSelector);
|
|
124
109
|
const {
|
|
125
|
-
cellMode,
|
|
126
110
|
hasFocus,
|
|
127
111
|
isEditable = false,
|
|
128
112
|
value
|
|
@@ -244,9 +228,6 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
244
228
|
}, style)
|
|
245
229
|
});
|
|
246
230
|
}
|
|
247
|
-
if (cellParams === EMPTY_CELL_PARAMS) {
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
231
|
let handleFocus = other.onFocus;
|
|
251
232
|
if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {
|
|
252
233
|
handleFocus = event => {
|
|
@@ -330,16 +311,12 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
330
311
|
colSpan: PropTypes.number,
|
|
331
312
|
column: PropTypes.object.isRequired,
|
|
332
313
|
disableDragEvents: PropTypes.bool,
|
|
333
|
-
editCellState: PropTypes.shape({
|
|
334
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
335
|
-
isProcessingProps: PropTypes.bool,
|
|
336
|
-
isValidating: PropTypes.bool,
|
|
337
|
-
value: PropTypes.any
|
|
338
|
-
}),
|
|
339
314
|
isNotVisible: PropTypes.bool.isRequired,
|
|
340
315
|
pinnedOffset: PropTypes.number,
|
|
341
316
|
pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
|
|
317
|
+
row: PropTypes.object.isRequired,
|
|
342
318
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
319
|
+
rowNode: PropTypes.object.isRequired,
|
|
343
320
|
showLeftBorder: PropTypes.bool.isRequired,
|
|
344
321
|
showRightBorder: PropTypes.bool.isRequired,
|
|
345
322
|
width: PropTypes.number.isRequired
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { unstable_useForkRef as useForkRef,
|
|
7
|
+
import { unstable_useForkRef as useForkRef, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
10
|
import { GridRootStyles } from "./GridRootStyles.js";
|
|
@@ -13,6 +13,7 @@ import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiCon
|
|
|
13
13
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
14
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
15
15
|
import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
|
|
16
|
+
import { useIsSSR } from "../../hooks/utils/useIsSSR.js";
|
|
16
17
|
import { GridHeader } from "../GridHeader.js";
|
|
17
18
|
import { GridBody, GridFooterPlaceholder } from "../base/index.js";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -37,16 +38,17 @@ const GridRoot = forwardRef(function GridRoot(props, ref) {
|
|
|
37
38
|
const apiRef = useGridPrivateApiContext();
|
|
38
39
|
const density = useGridSelector(apiRef, gridDensitySelector);
|
|
39
40
|
const rootElementRef = apiRef.current.rootElementRef;
|
|
40
|
-
const
|
|
41
|
+
const rootMountCallback = React.useCallback(node => {
|
|
42
|
+
if (node === null) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
apiRef.current.publishEvent('rootMount', node);
|
|
46
|
+
}, [apiRef]);
|
|
47
|
+
const handleRef = useForkRef(rootElementRef, ref, rootMountCallback);
|
|
41
48
|
const ownerState = rootProps;
|
|
42
49
|
const classes = useUtilityClasses(ownerState, density);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const [mountedState, setMountedState] = React.useState(false);
|
|
46
|
-
useEnhancedEffect(() => {
|
|
47
|
-
setMountedState(true);
|
|
48
|
-
}, []);
|
|
49
|
-
if (!mountedState) {
|
|
50
|
+
const isSSR = useIsSSR();
|
|
51
|
+
if (isSSR) {
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
54
|
return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
|