Skip to content

Commit 6b1cbec

Browse files
committed
revert export gridRowHeightSelector
1 parent 3aea7f0 commit 6b1cbec

File tree

8 files changed

+7
-26
lines changed

8 files changed

+7
-26
lines changed

docs/data/data-grid/style/RowGroupingStyling.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import {
55
useKeepGroupedColumnsHidden,
66
gridRowNodeSelector,
77
gridRowSelector,
8-
gridRowHeightSelector,
98
} from '@mui/x-data-grid-premium';
109
import { useMovieData } from '@mui/x-data-grid-generator';
1110

1211
const EXPECTED_GROSS = 2000000000;
12+
const ROW_HEIGHT = 52;
1313

1414
export default function RowGroupingStyling() {
1515
const apiRef = useGridApiRef();
1616
const data = useMovieData();
17-
const rowHeight = apiRef.current ? gridRowHeightSelector(apiRef) : 52;
1817
const getRowClassName = React.useCallback(
1918
(params) => {
2019
const node = gridRowNodeSelector(apiRef, params.id);
@@ -72,8 +71,8 @@ export default function RowGroupingStyling() {
7271
position: 'absolute',
7372
left: 0,
7473
width: 4,
75-
height: `calc(${rowHeight}px * 0.8)`,
76-
marginTop: `calc(${rowHeight}px * 0.1)`,
74+
height: `calc(${ROW_HEIGHT}px * 0.8)`,
75+
marginTop: `calc(${ROW_HEIGHT}px * 0.1)`,
7776
backgroundColor: 'success.main',
7877
borderTopRightRadius: 4,
7978
borderBottomRightRadius: 4,

docs/data/data-grid/style/RowGroupingStyling.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ import {
66
GridRowClassNameParams,
77
gridRowNodeSelector,
88
gridRowSelector,
9-
gridRowHeightSelector,
109
} from '@mui/x-data-grid-premium';
1110
import { useMovieData } from '@mui/x-data-grid-generator';
1211

1312
type Movie = ReturnType<typeof useMovieData>['rows'][number];
1413

1514
const EXPECTED_GROSS = 2000000000;
15+
const ROW_HEIGHT = 52;
1616

1717
export default function RowGroupingStyling() {
1818
const apiRef = useGridApiRef();
1919
const data = useMovieData();
20-
const rowHeight = apiRef.current ? gridRowHeightSelector(apiRef) : 52;
2120
const getRowClassName = React.useCallback(
2221
(params: GridRowClassNameParams<Movie>) => {
2322
const node = gridRowNodeSelector(apiRef, params.id);
@@ -75,8 +74,8 @@ export default function RowGroupingStyling() {
7574
position: 'absolute',
7675
left: 0,
7776
width: 4,
78-
height: `calc(${rowHeight}px * 0.8)`,
79-
marginTop: `calc(${rowHeight}px * 0.1)`,
77+
height: `calc(${ROW_HEIGHT}px * 0.8)`,
78+
marginTop: `calc(${ROW_HEIGHT}px * 0.1)`,
8079
backgroundColor: 'success.main',
8180
borderTopRightRadius: 4,
8281
borderBottomRightRadius: 4,

docs/pages/x/api/data-grid/selectors.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,6 @@
291291
},
292292
{ "name": "gridRowGroupingNameSelector", "returnType": "string", "description": "" },
293293
{ "name": "gridRowGroupingSanitizedModelSelector", "returnType": "string[]", "description": "" },
294-
{
295-
"name": "gridRowHeightSelector",
296-
"returnType": "number",
297-
"category": "Rows",
298-
"description": "Get the row height."
299-
},
300294
{
301295
"name": "gridRowIdSelector",
302296
"returnType": "GridRowId",

packages/x-data-grid/src/hooks/features/dimensions/gridDimensionsSelectors.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export const gridColumnsTotalWidthSelector = createSelector(
1414
(dimensions) => dimensions.columnsTotalWidth,
1515
);
1616

17-
/**
18-
* Get the row height.
19-
* @category Rows
20-
*/
2117
export const gridRowHeightSelector = createSelector(
2218
gridDimensionsSelector,
2319
(dimensions) => dimensions.rowHeight,
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
export type { GridDimensionsState } from './useGridDimensions';
2-
export {
3-
gridDimensionsSelector,
4-
gridColumnsTotalWidthSelector,
5-
gridRowHeightSelector,
6-
} from './gridDimensionsSelectors';
2+
export { gridDimensionsSelector, gridColumnsTotalWidthSelector } from './gridDimensionsSelectors';
73
export type { GridDimensions, GridDimensionsApi } from './gridDimensionsApi';

scripts/x-data-grid-premium.exports.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@
564564
{ "name": "GridRowGroupingState", "kind": "Interface" },
565565
{ "name": "GridRowHeightParams", "kind": "Interface" },
566566
{ "name": "GridRowHeightReturnValue", "kind": "TypeAlias" },
567-
{ "name": "gridRowHeightSelector", "kind": "Variable" },
568567
{ "name": "GridRowId", "kind": "TypeAlias" },
569568
{ "name": "GridRowIdGetter", "kind": "TypeAlias" },
570569
{ "name": "gridRowIdSelector", "kind": "Variable" },

scripts/x-data-grid-pro.exports.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@
493493
{ "name": "gridRowGroupingNameSelector", "kind": "Variable" },
494494
{ "name": "GridRowHeightParams", "kind": "Interface" },
495495
{ "name": "GridRowHeightReturnValue", "kind": "TypeAlias" },
496-
{ "name": "gridRowHeightSelector", "kind": "Variable" },
497496
{ "name": "GridRowId", "kind": "TypeAlias" },
498497
{ "name": "GridRowIdGetter", "kind": "TypeAlias" },
499498
{ "name": "gridRowIdSelector", "kind": "Variable" },

scripts/x-data-grid.exports.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@
456456
{ "name": "gridRowGroupingNameSelector", "kind": "Variable" },
457457
{ "name": "GridRowHeightParams", "kind": "Interface" },
458458
{ "name": "GridRowHeightReturnValue", "kind": "TypeAlias" },
459-
{ "name": "gridRowHeightSelector", "kind": "Variable" },
460459
{ "name": "GridRowId", "kind": "TypeAlias" },
461460
{ "name": "GridRowIdGetter", "kind": "TypeAlias" },
462461
{ "name": "gridRowIdSelector", "kind": "Variable" },

0 commit comments

Comments
 (0)