Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGridPro] Make @mui/x-data-grid-pro import shared code from @mui/x-data-grid #3688

Merged
merged 148 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
595aed8
[DataGrid] Differenciate the pro and community versions of GridState,…
flaviendelangle Jan 17, 2022
0e08bf9
Work
flaviendelangle Jan 17, 2022
e252740
Gen docs
flaviendelangle Jan 17, 2022
e02f987
Work
flaviendelangle Jan 17, 2022
dad3f3e
Work
flaviendelangle Jan 17, 2022
3e43030
Gen docs
flaviendelangle Jan 17, 2022
9233647
Gen docs
flaviendelangle Jan 17, 2022
2ce5214
Gen docs
flaviendelangle Jan 17, 2022
6c5e8b6
Gen docs
flaviendelangle Jan 17, 2022
84a7091
Gen docs
flaviendelangle Jan 17, 2022
6382544
Merge branch 'master' into state-pro-community
flaviendelangle Jan 18, 2022
5a4306c
Merge
flaviendelangle Jan 18, 2022
b02633a
Merge
flaviendelangle Jan 18, 2022
9e27a6b
Work
flaviendelangle Jan 18, 2022
915f766
Gen docs
flaviendelangle Jan 18, 2022
2da1d6e
Merge branch 'master' into state-pro-community
flaviendelangle Jan 19, 2022
4da768f
[DataGrid] Remove function overloading for useGridApiRef
flaviendelangle Jan 19, 2022
25b74c7
Work
flaviendelangle Jan 19, 2022
1f62ce5
Work
flaviendelangle Jan 19, 2022
f867509
Work
flaviendelangle Jan 19, 2022
5decdc6
Work
flaviendelangle Jan 19, 2022
c8927cc
Merge
flaviendelangle Jan 20, 2022
7035d40
Merge branch 'master' into apiRef-init
flaviendelangle Jan 20, 2022
a3c5d8e
Merge branch 'master' into state-pro-community
flaviendelangle Jan 21, 2022
c961398
[DataGridPro] Use module augmentation for event and pre-processing lo…
flaviendelangle Jan 21, 2022
8cf5256
Build API
flaviendelangle Jan 21, 2022
ee15df3
Work
flaviendelangle Jan 21, 2022
19ed74c
Work
flaviendelangle Jan 21, 2022
6098a30
Work
flaviendelangle Jan 21, 2022
1228b15
Work
flaviendelangle Jan 21, 2022
33ba0d8
Merge
flaviendelangle Jan 24, 2022
f96fdf6
Work
flaviendelangle Jan 24, 2022
69d45df
Work
flaviendelangle Jan 24, 2022
fa75075
Work
flaviendelangle Jan 24, 2022
56f5ed2
Work
flaviendelangle Jan 24, 2022
7fc072b
Merge
flaviendelangle Jan 25, 2022
b7ebe1a
Fix
flaviendelangle Jan 25, 2022
a442f74
Fix
flaviendelangle Jan 25, 2022
0cdaf38
Fix
flaviendelangle Jan 25, 2022
d0a978f
Work
flaviendelangle Jan 25, 2022
8fc3666
Work
flaviendelangle Jan 25, 2022
b4a992c
Merge branch 'master' into state-pro-community
flaviendelangle Jan 26, 2022
13f6e78
Code review: Andrew
flaviendelangle Jan 26, 2022
8a28913
Merge
flaviendelangle Jan 26, 2022
2f20257
Work
flaviendelangle Jan 26, 2022
fbe5fd4
Work
flaviendelangle Jan 26, 2022
3e43ede
Work
flaviendelangle Jan 27, 2022
ae77949
Work
flaviendelangle Jan 27, 2022
c8a6701
Work
flaviendelangle Jan 27, 2022
5e35055
Work
flaviendelangle Jan 27, 2022
2dafe6d
Work
flaviendelangle Jan 27, 2022
1db045b
Work
flaviendelangle Jan 27, 2022
6e1095d
Work
flaviendelangle Jan 27, 2022
3a4e714
Work
flaviendelangle Jan 27, 2022
bca5645
Work
flaviendelangle Jan 27, 2022
a64ec2e
Work
flaviendelangle Jan 27, 2022
07d4e3b
Work
flaviendelangle Jan 27, 2022
9568d0a
Work
flaviendelangle Jan 27, 2022
423fb39
Work
flaviendelangle Jan 27, 2022
1ab69b4
Work
flaviendelangle Jan 27, 2022
09e0ba7
Work
flaviendelangle Jan 27, 2022
7b79b18
Work
flaviendelangle Jan 27, 2022
95c5eba
Work
flaviendelangle Jan 27, 2022
876eac1
Work
flaviendelangle Jan 27, 2022
391b264
Work
flaviendelangle Jan 27, 2022
19875b8
Work
flaviendelangle Jan 27, 2022
c61243d
Work
flaviendelangle Jan 27, 2022
4fda6b6
Work
flaviendelangle Jan 27, 2022
98c00da
Work
flaviendelangle Jan 27, 2022
0e20238
Work
flaviendelangle Jan 27, 2022
05a2d20
Work
flaviendelangle Jan 27, 2022
7d1ffba
Work
flaviendelangle Jan 27, 2022
e93e503
Work
flaviendelangle Jan 27, 2022
35f2d0e
Work
flaviendelangle Jan 27, 2022
b4eb6d7
Merge branch 'state-pro-community' into pro-event-lookup
flaviendelangle Jan 27, 2022
d2e0f56
Work
flaviendelangle Jan 27, 2022
7a7402c
Work
flaviendelangle Jan 27, 2022
c104efd
Work
flaviendelangle Jan 27, 2022
4341a79
Work
flaviendelangle Jan 27, 2022
0cab542
Work
flaviendelangle Jan 27, 2022
b7086f2
Merge
flaviendelangle Jan 28, 2022
8492cde
Merge
flaviendelangle Jan 28, 2022
3eba08a
Merge
flaviendelangle Jan 31, 2022
40c25e0
Merge
flaviendelangle Jan 31, 2022
7f52894
Work
flaviendelangle Jan 31, 2022
15c7d5a
[core] Stop using an enum for GridPreProcessingGroup
flaviendelangle Jan 31, 2022
62aa35f
Work
flaviendelangle Jan 31, 2022
3517c3e
Work
flaviendelangle Jan 31, 2022
4e74315
Work
flaviendelangle Jan 31, 2022
55a9d3b
Work
flaviendelangle Jan 31, 2022
c23754f
Work
flaviendelangle Jan 31, 2022
7d4f650
Empty
flaviendelangle Jan 31, 2022
98eaee7
Work
flaviendelangle Jan 31, 2022
a10a1ae
Work
flaviendelangle Jan 31, 2022
c861a26
Work
flaviendelangle Jan 31, 2022
f8ddce9
Merge
flaviendelangle Jan 31, 2022
83ee0fe
Fix
flaviendelangle Jan 31, 2022
08d000e
Merge branch 'state-pro-community' into pro-event-lookup
flaviendelangle Feb 1, 2022
da77134
Merge branch 'master' into state-pro-community
flaviendelangle Feb 1, 2022
4425b38
Merge branch 'master' into pre-processor-enum
flaviendelangle Feb 1, 2022
3b7adf1
Merge branch 'pre-processor-enum' into pro-event-lookup-base
flaviendelangle Feb 1, 2022
964ec90
Merge branch 'state-pro-community' into pro-event-lookup-base
flaviendelangle Feb 1, 2022
b0ab694
Merge branch 'pro-event-lookup-base' into pro-event-lookup
flaviendelangle Feb 1, 2022
b4471ac
Work
flaviendelangle Feb 1, 2022
69cec52
Merge
flaviendelangle Feb 1, 2022
34b2bf3
Merge
flaviendelangle Feb 1, 2022
9f6dd01
Merge
flaviendelangle Feb 2, 2022
4b3ccdd
Work
flaviendelangle Feb 2, 2022
10297c1
Merge branch 'master' into state-pro-community
flaviendelangle Feb 2, 2022
d886de0
Work
flaviendelangle Feb 2, 2022
8bf1126
Merge branch 'master' into state-pro-community
flaviendelangle Feb 2, 2022
cb9497e
Work
flaviendelangle Feb 2, 2022
37646e2
Work
flaviendelangle Feb 2, 2022
702b849
Work
flaviendelangle Feb 2, 2022
88286a2
Fix
flaviendelangle Feb 2, 2022
f4d45a0
Work
flaviendelangle Feb 2, 2022
c3a4493
Work
flaviendelangle Feb 2, 2022
41904ba
Work
flaviendelangle Feb 2, 2022
892eb4b
Work
flaviendelangle Feb 2, 2022
96a0a02
Work
flaviendelangle Feb 2, 2022
13840c7
Work
flaviendelangle Feb 3, 2022
a939de6
Merge
flaviendelangle Feb 3, 2022
a1a8ccf
Merge
flaviendelangle Feb 3, 2022
1be427c
Work
flaviendelangle Feb 3, 2022
27398f8
Merge branch 'master' into state-pro-community
flaviendelangle Feb 7, 2022
aee8b32
Merge
flaviendelangle Feb 7, 2022
1fc32fd
Work
flaviendelangle Feb 7, 2022
23d759b
Merge branch 'master' into state-pro-community
flaviendelangle Feb 8, 2022
ff455b5
Work
flaviendelangle Feb 8, 2022
2d8b4a2
Merge branch 'state-pro-community' into pro-event-lookup
flaviendelangle Feb 8, 2022
5fabdaf
work
flaviendelangle Feb 9, 2022
cd5ee8a
Work
flaviendelangle Feb 9, 2022
1e093f5
Merge
flaviendelangle Feb 9, 2022
9b536a1
Merge branch 'master' into state-pro-community
flaviendelangle Feb 10, 2022
f3142ea
Merge
flaviendelangle Feb 10, 2022
176cef5
Merge branch 'master' into state-pro-community
flaviendelangle Feb 11, 2022
694bfdc
Merge branch 'master' into state-pro-community
flaviendelangle Feb 14, 2022
c706c9b
Work
flaviendelangle Feb 14, 2022
cf3e54e
Work
flaviendelangle Feb 14, 2022
24a43e3
Work
flaviendelangle Feb 14, 2022
acb5765
Work
flaviendelangle Feb 14, 2022
c7f0681
Merge branch 'master' into state-pro-community
flaviendelangle Feb 14, 2022
6187b36
Merge branch 'state-pro-community' into pro-event-lookup
flaviendelangle Feb 14, 2022
63797e3
Merge branch 'master' into pro-event-lookup
flaviendelangle Feb 15, 2022
965e0cc
Work
flaviendelangle Feb 15, 2022
4914e29
Empty
flaviendelangle Feb 15, 2022
8c46bdf
Work
flaviendelangle Feb 15, 2022
b6fc731
Empty
flaviendelangle Feb 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ ponyfillGlobal.muiDocConfig = {
csbIncludePeerDependencies: (deps, { versions }) => {
const newDeps = { ...deps };

if (newDeps['@mui/x-data-grid-pro'] || newDeps['@mui/x-data-grid']) {
if (newDeps['@mui/x-data-grid']) {
newDeps['@mui/material'] = versions['@mui/material'];
}

if (newDeps['@mui/x-data-grid-pro']) {
newDeps['@mui/material'] = versions['@mui/material'];
newDeps['@mui/x-data-grid'] = versions['@mui/x-data-grid'];
}

if (newDeps['@mui/x-data-grid-generator']) {
newDeps['@mui/material'] = versions['@mui/material'];
newDeps['@mui/icons-material'] = versions['@mui/icons-material'];
Expand Down
3 changes: 2 additions & 1 deletion docs/scripts/api/buildApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ async function run() {
});

buildEventsDocumentation({
project: projects.get('x-data-grid')!,
// TODO: Pass all the projects and add the pro icon for pro-only events
project: projects.get('x-data-grid-pro')!,
documentedInterfaces,
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"build:codesandbox": "yarn release:build",
"release:changelog": "node scripts/releaseChangelog",
"release:version": "lerna version --exact --no-changelog --no-push --no-git-tag-version",
"release:build": "yarn release:build:next && cd packages/grid/x-data-grid-pro && yarn build && cd ../x-data-grid && yarn build && cd ../x-data-grid-generator && yarn build",
"release:build": "yarn release:build:next && cd packages/grid/x-data-grid && yarn build && cd ../x-data-grid-pro && yarn build && cd ../x-data-grid-generator && yarn build",
"release:build:next": "lerna run --parallel --scope \"@mui/x-license-pro\" build",
"release:publish": "lerna publish from-package --dist-tag latest --contents build",
"release:publish:dry-run": "lerna publish from-package --dist-tag latest --contents build --registry=\"http://localhost:4873/\""
Expand Down
2 changes: 0 additions & 2 deletions packages/grid/_modules_/grid/components/cell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ export * from './GridEditInputCell';
export * from './GridEditSingleSelectCell';
export * from './GridActionsCell';
export * from './GridActionsCellItem';
export * from './GridTreeDataGroupingCell';
export * from './GridDetailPanelToggleCell';
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export * from './HideGridColMenuItem';
export * from './SortGridMenuItems';
export * from './GridColumnMenuContainer';
export * from './GridColumnMenuProps';
export * from './GridColumnPinningMenuItems';
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
} from '../../hooks/features/columns/gridColumnsSelector';
import { useGridSelector } from '../../hooks/utils/useGridSelector';
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
import { GridDragIcon } from '../icons/index';
import { GridDragIcon } from '../icons';
import { GridPanelContent } from './GridPanelContent';
import { GridPanelFooter } from './GridPanelFooter';
import { GridPanelHeader } from './GridPanelHeader';
import { GridPanelWrapper } from './GridPanelWrapper';
import { GRID_EXPERIMENTAL_ENABLED } from '../../constants';
import { GRID_EXPERIMENTAL_ENABLED } from '../../constants/envConstants';
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
import { getDataGridUtilityClass } from '../../gridClasses';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ const DEFAULT_GRID_ICON_SLOTS_COMPONENTS: GridIconSlotsComponent = {
DetailPanelCollapseIcon: GridRemoveIcon,
};

export const DEFAULT_GRID_SLOTS_COMPONENTS: GridSlotsComponent = {
/**
* TODO: Differentiate community and pro value and interface
alexfauquette marked this conversation as resolved.
Show resolved Hide resolved
*/
export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS: GridSlotsComponent = {
...DEFAULT_GRID_ICON_SLOTS_COMPONENTS,
BaseCheckbox: MUICheckbox,
BaseTextField: MUITextField,
Expand Down
1 change: 1 addition & 0 deletions packages/grid/_modules_/grid/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './envConstants';
export * from './localeTextConstants';
export * from './defaultGridSlotsComponents';
1 change: 1 addition & 0 deletions packages/grid/_modules_/grid/context/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './GridContextProvider';
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ import { GridColDef } from '../../../models/colDef/gridColDef';
import {
GridRestoreStatePreProcessingContext,
GridRestoreStatePreProcessingValue,
} from '../../features/statePersistence';
} from '../../features/statePersistence/gridStatePersistenceInterface';
import { GridFilteringMethodCollection } from '../../features/filter/gridFilterState';
import { GridSortingMethodCollection } from '../../features/sorting/gridSortingState';
import { GridCanBeReorderedPreProcessingContext } from '../../features/columnReorder/columnReorderInterfaces';
import { GridColumnsRawState } from '../../features/columns/gridColumnsInterfaces';
import { GridRowEntry } from '../../../models/gridRows';

export type PreProcessorCallback = (value: any, params?: any) => any;

export type GridPreProcessingGroup = keyof GridPreProcessingGroupLookup;

interface GridPreProcessingGroupLookup {
export interface GridPreProcessingGroupLookup {
hydrateColumns: {
value: Omit<GridColumnsRawState<any>, 'columnVisibilityModel'>;
};
scrollToIndexes: {
value: Partial<GridScrollParams>;
context: Partial<GridCellIndexCoordinates>;
};
columnMenu: { value: JSX.Element[]; context: GridColDef };
canBeReordered: {
value: boolean;
context: GridCanBeReorderedPreProcessingContext;
};
columnMenu: { value: JSX.Element[]; context: GridColDef<any> };
filteringMethod: { value: GridFilteringMethodCollection };
sortingMethod: { value: GridSortingMethodCollection };
exportState: { value: GridInitialStateCommunity };
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { GridFilteringMethod } from './gridFilterState';
import { GridPreProcessor, useGridRegisterPreProcessor } from '../../core/preProcessing';
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
import { GridApiCommon } from '../../../models';

export const useGridRegisterFilteringMethod = (
apiRef: React.MutableRefObject<GridApiCommunity>,
export const useGridRegisterFilteringMethod = <Api extends GridApiCommon>(
apiRef: React.MutableRefObject<Api>,
groupingName: string,
filteringMethod: GridFilteringMethod,
) => {
Expand Down
6 changes: 0 additions & 6 deletions packages/grid/_modules_/grid/hooks/features/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Only export the variable and types that should be publicly exposed
export * from './columnMenu';
export * from './columnReorder';
export * from './columnResize';
export * from './columnPinning';
export * from './columns';
export * from './density';
export * from './editRows';
Expand All @@ -14,7 +11,4 @@ export * from './rows';
export * from './selection';
export * from './sorting';
export * from './dimensions';
export * from './treeData';
export * from './rowGrouping';
export * from './detailPanel';
export * from './statePersistence';
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* The grid rows total height and row possitions.
* The grid rows total height and row positions.
*/
export interface GridRowsMetaState {
/**
* The sum of of all visible grid rows in the current rows.
* The sum of all visible grid rows in the current rows.
*/
currentPageTotalHeight: number;
/**
* The grid rows possitions.
* The grid rows positions.
*/
positions: number[];
}
1 change: 1 addition & 0 deletions packages/grid/_modules_/grid/hooks/features/rows/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './gridRowsMetaSelector';
export * from './gridRowsMetaState';
export * from './gridRowsSelector';
export * from './gridRowsState';
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { GridSortingMethod } from './gridSortingState';
import { GridPreProcessor, useGridRegisterPreProcessor } from '../../core/preProcessing';
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
import { GridApiCommon } from '../../../models';

export const useGridRegisterSortingMethod = (
apiRef: React.MutableRefObject<GridApiCommunity>,
export const useGridRegisterSortingMethod = <Api extends GridApiCommon>(
apiRef: React.MutableRefObject<Api>,
groupingName: string,
filteringMethod: GridSortingMethod,
) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './GridStatePersistenceApi';
export type { GridStatePersistenceApi } from './gridStatePersistenceInterface';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { GridInitialStateCommunity } from '../../../models/gridStateCommunity';
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
import { GridStatePersistenceApi } from './GridStatePersistenceApi';
import { GridStatePersistenceApi } from './gridStatePersistenceInterface';
import { useGridApiMethod } from '../../utils';

export const useGridStatePersistence = (apiRef: React.MutableRefObject<GridApiCommunity>) => {
Expand Down
1 change: 1 addition & 0 deletions packages/grid/_modules_/grid/hooks/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './useGridScrollFn';
export * from './useGridSelector';
export * from './useGridState';
export * from './useGridNativeEventListener';
export * from './useFirstRender';
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
import { GridEventListener, GridEvents, GridEventsStr } from '../../models/events';
import { GridEventListener, GridEventsStr } from '../../models/events';
import { UnregisterToken, CleanupTracking } from '../../utils/cleanupTracking/CleanupTracking';
import { EventListenerOptions } from '../../utils/EventManager';
import { TimerBasedCleanupTracking } from '../../utils/cleanupTracking/TimerBasedCleanupTracking';
import { FinalizationRegistryBasedCleanupTracking } from '../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking';
import { GridApiCommon } from '../../models';

/**
* Signal to the underlying logic what version of the public component API
Expand All @@ -23,8 +23,8 @@ class ObjectToBeRetainedByReact {}
export function createUseGridApiEventHandler(registry: CleanupTracking) {
let cleanupTokensCounter = 0;

return function useGridApiEventHandler<E extends GridEventsStr>(
apiRef: React.MutableRefObject<GridApiCommunity>,
return function useGridApiEventHandler<Api extends GridApiCommon, E extends GridEventsStr>(
apiRef: React.MutableRefObject<Api>,
eventName: E,
handler?: GridEventListener<E>,
options?: EventListenerOptions,
Expand Down Expand Up @@ -108,8 +108,8 @@ export const useGridApiEventHandler = createUseGridApiEventHandler(registry);

const optionsSubscriberOptions: EventListenerOptions = { isFirst: true };

export function useGridApiOptionHandler<E extends GridEvents>(
apiRef: React.MutableRefObject<GridApiCommunity>,
export function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEventsStr>(
apiRef: React.MutableRefObject<Api>,
eventName: E,
handler?: GridEventListener<E>,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from 'react';
import { GridEvents } from '../../models/events';
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
import { isFunction } from '../../utils/utils';
import { useGridLogger } from './useGridLogger';
import { GridApiCommon } from '../../models';

export const useGridNativeEventListener = <E extends Event>(
apiRef: React.MutableRefObject<GridApiCommunity>,
export const useGridNativeEventListener = <Api extends GridApiCommon, E extends Event>(
apiRef: React.MutableRefObject<Api>,
ref: React.MutableRefObject<HTMLDivElement | null> | (() => Element | undefined | null),
eventName: string,
handler?: (event: E) => any,
Expand Down
7 changes: 2 additions & 5 deletions packages/grid/_modules_/grid/hooks/utils/useGridRootProps.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as React from 'react';
import { GridRootPropsContext } from '../../context/GridRootPropsContext';
import type { DataGridProcessedProps } from '../../models/props/DataGridProps';
import type { DataGridProProcessedProps } from '../../models/props/DataGridProProps';

export const useGridRootProps = <
Props extends DataGridProcessedProps | DataGridProProcessedProps,
>() => {
export const useGridRootProps = () => {
const contextValue = React.useContext(GridRootPropsContext);

if (!contextValue) {
Expand All @@ -14,5 +11,5 @@ export const useGridRootProps = <
);
}

return contextValue as Props;
return contextValue as DataGridProcessedProps;
};
4 changes: 4 additions & 0 deletions packages/grid/_modules_/grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ export * from './hooks';
export * from './locales';
export * from './models';
export * from './gridClasses';
export * from './context';
export type { OutputSelector } from './utils/createSelector';

export type { GridPreProcessingGroupLookup } from './hooks/core/preProcessing/gridPreProcessingApi';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { GridStateApi } from './gridStateApi';
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
import type { GridApiCommon } from './gridApiCommon';
import type { GridStatePersistenceApi } from '../../hooks';
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';

type GridStateApiUntyped = {
[key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
Expand Down
21 changes: 0 additions & 21 deletions packages/grid/_modules_/grid/models/api/gridApiPro.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/grid/_modules_/grid/models/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export * from './gridDisableVirtualizationApi';
export * from './gridClipboardApi';
export * from './gridCallbackDetails';
export * from './gridScrollApi';
export * from './gridColumnPinningApi';
export * from './gridVirtualScrollerApi';
export * from './gridDetailPanelApi';
export * from './gridApiCommon';

export type { GridEditingApi } from './gridEditingApi';
Expand Down
Loading