@mui/x-data-grid 7.24.0 → 7.24.1
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 +71 -0
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- package/components/panel/GridPanel.js +2 -1
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/context/GridContextProvider.d.ts +2 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +2 -2
- package/hooks/core/useGridApiInitialization.d.ts +2 -2
- package/hooks/core/useGridInitialization.d.ts +2 -2
- package/hooks/core/useGridIsRtl.d.ts +2 -2
- package/hooks/core/useGridLocaleText.d.ts +2 -2
- package/hooks/core/useGridLoggerFactory.d.ts +2 -2
- package/hooks/core/useGridRefs.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
- package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
- package/hooks/features/editing/useGridEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
- package/hooks/features/events/useGridEvents.d.ts +2 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.d.ts +2 -2
- package/hooks/features/export/utils.d.ts +2 -2
- package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.d.ts +2 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/utils.d.ts +3 -3
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/hooks/features/preferencesPanel/index.d.ts +1 -1
- package/hooks/features/preferencesPanel/index.js +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +3 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
- package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
- package/hooks/features/scroll/useGridScroll.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +2 -2
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +1 -8
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
- package/hooks/utils/useGridApiMethod.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridApiRef.js +3 -1
- package/hooks/utils/useGridInitializeState.d.ts +3 -3
- package/hooks/utils/useGridLogger.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
- package/hooks/utils/useGridSelector.d.ts +3 -3
- package/hooks/utils/useGridVisibleRows.d.ts +3 -3
- package/index.js +1 -1
- package/locales/faIR.js +5 -6
- package/models/colDef/gridColDef.d.ts +9 -8
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterOperator.d.ts +2 -1
- package/models/props/DataGridProps.d.ts +2 -1
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- package/modern/components/panel/GridPanel.js +2 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/modern/hooks/features/preferencesPanel/index.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +1 -8
- package/modern/hooks/utils/useGridApiRef.js +3 -1
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +5 -6
- package/modern/utils/isJSDOM.js +1 -0
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/node/components/panel/GridPanel.js +2 -1
- package/node/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
- package/node/hooks/features/preferencesPanel/index.js +11 -10
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -10
- package/node/hooks/utils/useGridApiRef.js +3 -1
- package/node/index.js +1 -1
- package/node/locales/faIR.js +5 -6
- package/node/utils/isJSDOM.js +7 -0
- package/package.json +2 -2
- package/utils/createSelector.d.ts +3 -3
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridFilterItem, GridFilterModel } from '../../../models';
|
|
3
3
|
import type { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
@@ -6,18 +6,18 @@ import { GridAggregatedFilterItemApplier, GridFilterItemResult, GridQuickFilterV
|
|
|
6
6
|
/**
|
|
7
7
|
* Adds default values to the optional fields of a filter items.
|
|
8
8
|
* @param {GridFilterItem} item The raw filter item.
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
10
10
|
* @return {GridFilterItem} The clean filter item with an uniq ID and an always-defined operator.
|
|
11
11
|
* TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.
|
|
12
12
|
*/
|
|
13
|
-
export declare const cleanFilterItem: (item: GridFilterItem, apiRef:
|
|
14
|
-
export declare const sanitizeFilterModel: (model: GridFilterModel, disableMultipleColumnsFiltering: boolean, apiRef:
|
|
15
|
-
export declare const mergeStateWithFilterModel: (filterModel: GridFilterModel, disableMultipleColumnsFiltering: boolean, apiRef:
|
|
13
|
+
export declare const cleanFilterItem: (item: GridFilterItem, apiRef: RefObject<GridPrivateApiCommunity>) => GridFilterItem;
|
|
14
|
+
export declare const sanitizeFilterModel: (model: GridFilterModel, disableMultipleColumnsFiltering: boolean, apiRef: RefObject<GridPrivateApiCommunity>) => GridFilterModel;
|
|
15
|
+
export declare const mergeStateWithFilterModel: (filterModel: GridFilterModel, disableMultipleColumnsFiltering: boolean, apiRef: RefObject<GridPrivateApiCommunity>) => (filteringState: GridStateCommunity["filter"]) => GridStateCommunity["filter"];
|
|
16
16
|
export declare const removeDiacritics: (value: unknown) => unknown;
|
|
17
17
|
export declare const shouldQuickFilterExcludeHiddenColumns: (filterModel: GridFilterModel) => boolean;
|
|
18
|
-
export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef:
|
|
18
|
+
export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: RefObject<GridPrivateApiCommunity>, disableEval: boolean) => GridAggregatedFilterItemApplier;
|
|
19
19
|
type FilterCache = {
|
|
20
20
|
cleanedFilterItems?: GridFilterItem[];
|
|
21
21
|
};
|
|
22
|
-
export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel, apiRef:
|
|
22
|
+
export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel, apiRef: RefObject<GridPrivateApiCommunity>, cache: FilterCache) => boolean;
|
|
23
23
|
export {};
|
|
@@ -19,7 +19,7 @@ function getHasEval() {
|
|
|
19
19
|
/**
|
|
20
20
|
* Adds default values to the optional fields of a filter items.
|
|
21
21
|
* @param {GridFilterItem} item The raw filter item.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
23
23
|
* @return {GridFilterItem} The clean filter item with an uniq ID and an always-defined operator.
|
|
24
24
|
* TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.
|
|
25
25
|
*/
|
|
@@ -133,7 +133,7 @@ let filterItemsApplierId = 1;
|
|
|
133
133
|
/**
|
|
134
134
|
* Generates a method to easily check if a row is matching the current filter model.
|
|
135
135
|
* @param {GridFilterModel} filterModel The model with which we want to filter the rows.
|
|
136
|
-
* @param {
|
|
136
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
137
137
|
* @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
|
|
138
138
|
*/
|
|
139
139
|
const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) => {
|
|
@@ -181,7 +181,7 @@ export const shouldQuickFilterExcludeHiddenColumns = filterModel => {
|
|
|
181
181
|
/**
|
|
182
182
|
* Generates a method to easily check if a row is matching the current quick filter.
|
|
183
183
|
* @param {any[]} filterModel The model with which we want to filter the rows.
|
|
184
|
-
* @param {
|
|
184
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
185
185
|
* @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
|
|
186
186
|
*/
|
|
187
187
|
const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -8,4 +8,4 @@ export declare const filterStateInitializer: GridStateInitializer<Pick<DataGridP
|
|
|
8
8
|
* @requires useGridParamsApi (method)
|
|
9
9
|
* @requires useGridRows (event)
|
|
10
10
|
*/
|
|
11
|
-
export declare const useGridFilter: (apiRef:
|
|
11
|
+
export declare const useGridFilter: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "initialState" | "filterModel" | "getRowId" | "onFilterModelChange" | "filterMode" | "disableMultipleColumnsFiltering" | "slots" | "slotProps" | "disableColumnFilter" | "disableEval" | "ignoreDiacritics">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -8,4 +8,4 @@ export declare const focusStateInitializer: GridStateInitializer;
|
|
|
8
8
|
* @requires useGridRows (method)
|
|
9
9
|
* @requires useGridEditing (event)
|
|
10
10
|
*/
|
|
11
|
-
export declare const useGridFocus: (apiRef:
|
|
11
|
+
export declare const useGridFocus: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode">) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
5
5
|
export declare const headerFilteringStateInitializer: GridStateInitializer;
|
|
6
|
-
export declare const useGridHeaderFiltering: (apiRef:
|
|
6
|
+
export declare const useGridHeaderFiltering: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "signature" | "headerFilters">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
/**
|
|
@@ -10,4 +10,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
|
10
10
|
* @requires useGridScroll (method) - can be after
|
|
11
11
|
* @requires useGridColumnSpanning (method) - can be after
|
|
12
12
|
*/
|
|
13
|
-
export declare const useGridKeyboardNavigation: (apiRef:
|
|
13
|
+
export declare const useGridKeyboardNavigation: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "experimentalFeatures" | "signature" | "headerFilters" | "unstable_listView">) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridColDef, GridRowEntry, GridRowId } from '../../../models';
|
|
3
3
|
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
|
-
export declare function enrichPageRowsWithPinnedRows(apiRef:
|
|
4
|
+
export declare function enrichPageRowsWithPinnedRows(apiRef: RefObject<GridApiCommunity>, rows: GridRowEntry[]): GridRowEntry<import("../../..").GridValidRowModel>[];
|
|
5
5
|
export declare const getLeftColumnIndex: ({ currentColIndex, firstColIndex, lastColIndex, isRtl, }: {
|
|
6
6
|
currentColIndex: number;
|
|
7
7
|
firstColIndex: number;
|
|
@@ -14,4 +14,4 @@ export declare const getRightColumnIndex: ({ currentColIndex, firstColIndex, las
|
|
|
14
14
|
lastColIndex: number;
|
|
15
15
|
isRtl: boolean;
|
|
16
16
|
}) => number | null;
|
|
17
|
-
export declare function findNonRowSpannedCell(apiRef:
|
|
17
|
+
export declare function findNonRowSpannedCell(apiRef: RefObject<GridApiCommunity>, rowId: GridRowId, field: GridColDef['field'], rowSpanScanDirection: 'up' | 'down'): GridRowId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import type { GridListColDef } from '../../../models/colDef/gridColDef';
|
|
3
3
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
4
4
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
@@ -7,4 +7,4 @@ export type GridListViewState = (GridListColDef & {
|
|
|
7
7
|
computedWidth: number;
|
|
8
8
|
}) | undefined;
|
|
9
9
|
export declare const listViewStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_listColumn'>>;
|
|
10
|
-
export declare function useGridListView(apiRef:
|
|
10
|
+
export declare function useGridListView(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView' | 'unstable_listColumn'>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -7,4 +7,4 @@ export declare const paginationStateInitializer: GridStateInitializer<Pick<DataG
|
|
|
7
7
|
* @requires useGridFilter (state)
|
|
8
8
|
* @requires useGridDimensions (event) - can be after
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridPagination: (apiRef:
|
|
10
|
+
export declare const useGridPagination: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
|
-
export declare const useGridPaginationMeta: (apiRef:
|
|
4
|
+
export declare const useGridPaginationMeta: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationMeta" | "initialState" | "paginationMode" | "onPaginationMetaChange">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridPaginationState } from './gridPaginationInterfaces';
|
|
@@ -8,4 +8,4 @@ export declare const getDerivedPaginationModel: (paginationState: GridPagination
|
|
|
8
8
|
* @requires useGridFilter (state)
|
|
9
9
|
* @requires useGridDimensions (event) - can be after
|
|
10
10
|
*/
|
|
11
|
-
export declare const useGridPaginationModel: (apiRef:
|
|
11
|
+
export declare const useGridPaginationModel: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationModel" | "onPaginationModelChange" | "autoPageSize" | "initialState" | "paginationMode" | "pagination" | "signature" | "rowHeight">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
|
-
export declare const useGridRowCount: (apiRef:
|
|
4
|
+
export declare const useGridRowCount: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rowCount" | "initialState" | "paginationMode" | "onRowCountChange">) => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
2
2
|
export declare const gridPreferencePanelStateSelector: (state: GridStateCommunity) => import("./gridPreferencePanelState").GridPreferencePanelState;
|
|
3
|
+
export declare const gridPreferencePanelSelectorWithLabel: import("../../../utils/createSelector").OutputSelectorV8<GridStateCommunity, string, boolean>;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { createSelectorV8 } from "../../../utils/createSelector.js";
|
|
2
|
+
export const gridPreferencePanelStateSelector = state => state.preferencePanel;
|
|
3
|
+
export const gridPreferencePanelSelectorWithLabel = createSelectorV8(gridPreferencePanelStateSelector, (panel, labelId) => {
|
|
4
|
+
if (panel.open && panel.labelId === labelId) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
return false;
|
|
8
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -6,4 +6,4 @@ export declare const preferencePanelStateInitializer: GridStateInitializer<Pick<
|
|
|
6
6
|
/**
|
|
7
7
|
* TODO: Add a single `setPreferencePanel` method to avoid multiple `setState`
|
|
8
8
|
*/
|
|
9
|
-
export declare const useGridPreferencesPanel: (apiRef:
|
|
9
|
+
export declare const useGridPreferencesPanel: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "initialState">) => void;
|
|
@@ -15,42 +15,29 @@ export const preferencePanelStateInitializer = (state, props) => _extends({}, st
|
|
|
15
15
|
*/
|
|
16
16
|
export const useGridPreferencesPanel = (apiRef, props) => {
|
|
17
17
|
const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
|
|
18
|
-
const hideTimeout = React.useRef(undefined);
|
|
19
|
-
const immediateTimeout = React.useRef(undefined);
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
20
|
* API METHODS
|
|
23
21
|
*/
|
|
24
22
|
const hidePreferences = React.useCallback(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
apiRef.current.setState(state => {
|
|
24
|
+
if (!state.preferencePanel.open) {
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
logger.debug('Hiding Preferences Panel');
|
|
28
|
+
const preferencePanelState = gridPreferencePanelStateSelector(state);
|
|
28
29
|
apiRef.current.publishEvent('preferencePanelClose', {
|
|
29
30
|
openedPanelValue: preferencePanelState.openedPanelValue
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
apiRef.current.forceUpdate();
|
|
32
|
+
return _extends({}, state, {
|
|
33
|
+
preferencePanel: {
|
|
34
|
+
open: false
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
38
|
}, [apiRef, logger]);
|
|
39
|
-
|
|
40
|
-
// This is to prevent the preferences from closing when you open a select box or another panel,
|
|
41
|
-
// The issue is in MUI core V4 => Fixed in V5
|
|
42
|
-
const doNotHidePanel = React.useCallback(() => {
|
|
43
|
-
immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
// This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,
|
|
47
|
-
// we can cancel the action if the trigger element still need the panel...
|
|
48
|
-
const hidePreferencesDelayed = React.useCallback(() => {
|
|
49
|
-
hideTimeout.current = setTimeout(hidePreferences, 100);
|
|
50
|
-
}, [hidePreferences]);
|
|
51
39
|
const showPreferences = React.useCallback((newValue, panelId, labelId) => {
|
|
52
40
|
logger.debug('Opening Preferences Panel');
|
|
53
|
-
doNotHidePanel();
|
|
54
41
|
apiRef.current.setState(state => _extends({}, state, {
|
|
55
42
|
preferencePanel: _extends({}, state.preferencePanel, {
|
|
56
43
|
open: true,
|
|
@@ -62,11 +49,10 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
62
49
|
apiRef.current.publishEvent('preferencePanelOpen', {
|
|
63
50
|
openedPanelValue: newValue
|
|
64
51
|
});
|
|
65
|
-
|
|
66
|
-
}, [logger, doNotHidePanel, apiRef]);
|
|
52
|
+
}, [logger, apiRef]);
|
|
67
53
|
useGridApiMethod(apiRef, {
|
|
68
54
|
showPreferences,
|
|
69
|
-
hidePreferences
|
|
55
|
+
hidePreferences
|
|
70
56
|
}, 'public');
|
|
71
57
|
|
|
72
58
|
/**
|
|
@@ -99,14 +85,4 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
99
85
|
}, [apiRef]);
|
|
100
86
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
101
87
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* EFFECTS
|
|
105
|
-
*/
|
|
106
|
-
React.useEffect(() => {
|
|
107
|
-
return () => {
|
|
108
|
-
clearTimeout(hideTimeout.current);
|
|
109
|
-
clearTimeout(immediateTimeout.current);
|
|
110
|
-
};
|
|
111
|
-
}, []);
|
|
112
88
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -9,4 +9,4 @@ export declare const rowSelectionStateInitializer: GridStateInitializer<Pick<Dat
|
|
|
9
9
|
* @requires useGridFocus (state) - can be after
|
|
10
10
|
* @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
|
|
11
11
|
*/
|
|
12
|
-
export declare const useGridRowSelection: (apiRef:
|
|
12
|
+
export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
|
-
export declare const useGridRowSelectionPreProcessors: (apiRef:
|
|
4
|
+
export declare const useGridRowSelectionPreProcessors: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import type { GridRowId, GridRowTreeConfig } from '../../../models/gridRows';
|
|
2
3
|
import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
4
|
import type { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
@@ -8,5 +9,5 @@ export declare function getCheckboxPropsSelector(groupId: GridRowId, autoSelectP
|
|
|
8
9
|
isChecked: boolean;
|
|
9
10
|
}>;
|
|
10
11
|
export declare function isMultipleRowSelectionEnabled(props: Pick<DataGridProcessedProps, 'signature' | 'disableMultipleRowSelection' | 'checkboxSelection'>): boolean;
|
|
11
|
-
export declare const findRowsToSelect: (apiRef:
|
|
12
|
-
export declare const findRowsToDeselect: (apiRef:
|
|
12
|
+
export declare const findRowsToSelect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, selectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, addRow: (rowId: GridRowId) => void) => void;
|
|
13
|
+
export declare const findRowsToDeselect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, deselectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, removeRow: (rowId: GridRowId) => void) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import type { GridRenderContext } from '../../../models';
|
|
3
3
|
import type { GridValidRowModel } from '../../../models/gridRows';
|
|
4
4
|
import type { GridColDef } from '../../../models/colDef';
|
|
@@ -7,4 +7,4 @@ import type { RowRange } from './useGridRowSpanning';
|
|
|
7
7
|
export declare function getUnprocessedRange(testRange: RowRange, processedRange: RowRange): RowRange | null;
|
|
8
8
|
export declare function isRowContextInitialized(renderContext: GridRenderContext): boolean;
|
|
9
9
|
export declare function isRowRangeUpdated(range1: RowRange, range2: RowRange): boolean;
|
|
10
|
-
export declare const getCellValue: (row: GridValidRowModel, colDef: GridColDef, apiRef:
|
|
10
|
+
export declare const getCellValue: (row: GridValidRowModel, colDef: GridColDef, apiRef: RefObject<GridApiCommunity>) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridAutoGeneratedGroupNode, GridAutoGeneratedPinnedRowNode, GridFooterNode, GridGroupNode, GridRowId, GridRowIdGetter, GridRowModel, GridRowModelUpdate, GridRowTreeConfig, GridSkeletonRowNode, GridTreeNode } from '../../../models';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridApiCommunity, GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
@@ -20,7 +20,7 @@ export declare const getTopLevelRowCount: ({ tree, rowCountProp, }: {
|
|
|
20
20
|
rowCountProp: DataGridProcessedProps["rowCount"];
|
|
21
21
|
}) => number;
|
|
22
22
|
export declare const getRowsStateFromCache: ({ apiRef, rowCountProp, loadingProp, previousTree, previousTreeDepths, previousGroupsToFetch, }: Pick<GridRowTreeCreationParams, "previousTree" | "previousTreeDepths" | "previousGroupsToFetch"> & {
|
|
23
|
-
apiRef:
|
|
23
|
+
apiRef: RefObject<GridPrivateApiCommunity>;
|
|
24
24
|
rowCountProp: number | undefined;
|
|
25
25
|
loadingProp: boolean | undefined;
|
|
26
26
|
}) => GridRowsState;
|
|
@@ -33,12 +33,12 @@ export declare const updateCacheWithNewRows: ({ previousCache, getRowId, updates
|
|
|
33
33
|
updates: GridRowModelUpdate[];
|
|
34
34
|
groupKeys?: string[];
|
|
35
35
|
}) => GridRowsInternalCache;
|
|
36
|
-
export declare function calculatePinnedRowsHeight(apiRef:
|
|
36
|
+
export declare function calculatePinnedRowsHeight(apiRef: RefObject<GridApiCommunity>): {
|
|
37
37
|
top: number;
|
|
38
38
|
bottom: number;
|
|
39
39
|
};
|
|
40
40
|
export declare const minimalContentHeight = "var(--DataGrid-overlayHeight, calc(var(--height) * 2))";
|
|
41
|
-
export declare function computeRowsUpdates(apiRef:
|
|
41
|
+
export declare function computeRowsUpdates(apiRef: RefObject<GridApiCommunity>, updates: GridRowModelUpdate[], getRowId: DataGridProcessedProps['getRowId']): GridRowModelUpdate[];
|
|
42
42
|
export declare const getValidRowHeight: (rowHeightProp: any, defaultRowHeight: number, warningMessage: string) => number;
|
|
43
43
|
export declare const rowHeightWarning: string;
|
|
44
44
|
export declare const getRowHeightWarning: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
export declare class MissingRowIdError extends Error {
|
|
@@ -11,4 +11,4 @@ export declare class MissingRowIdError extends Error {
|
|
|
11
11
|
* TODO: Impossible priority - useGridEditing also needs to be after useGridParamsApi
|
|
12
12
|
* TODO: Impossible priority - useGridFocus also needs to be after useGridParamsApi
|
|
13
13
|
*/
|
|
14
|
-
export declare function useGridParamsApi(apiRef:
|
|
14
|
+
export declare function useGridParamsApi(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView'>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import type { GridColDef } from '../../../models/colDef';
|
|
3
3
|
import type { GridRowId } from '../../../models/gridRows';
|
|
4
4
|
import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
@@ -24,4 +24,4 @@ export type RowRange = {
|
|
|
24
24
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
25
25
|
*/
|
|
26
26
|
export declare const rowSpanningStateInitializer: GridStateInitializer;
|
|
27
|
-
export declare const useGridRowSpanning: (apiRef:
|
|
27
|
+
export declare const useGridRowSpanning: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "unstable_rowSpanning" | "pagination" | "paginationMode">) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
5
5
|
export declare const rowsStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_dataSource' | 'rows' | 'rowCount' | 'getRowId' | 'loading'>>;
|
|
6
|
-
export declare const useGridRows: (apiRef:
|
|
6
|
+
export declare const useGridRows: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "unstable_dataSource">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -7,4 +7,4 @@ export declare const rowsMetaStateInitializer: GridStateInitializer;
|
|
|
7
7
|
* @requires useGridPageSize (method)
|
|
8
8
|
* @requires useGridPage (method)
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridRowsMeta: (apiRef:
|
|
10
|
+
export declare const useGridRowsMeta: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "getRowHeight" | "getEstimatedRowHeight" | "getRowSpacing" | "pagination" | "paginationMode" | "rowHeight" | "rowPositionsDebounceMs">) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
export declare const useGridRowsPreProcessors: (apiRef:
|
|
3
|
+
export declare const useGridRowsPreProcessors: (apiRef: RefObject<GridPrivateApiCommunity>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
/**
|
|
@@ -9,4 +9,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
|
9
9
|
* @requires useGridFilter (state)
|
|
10
10
|
* @requires useGridColumnSpanning (method)
|
|
11
11
|
*/
|
|
12
|
-
export declare const useGridScroll: (apiRef:
|
|
12
|
+
export declare const useGridScroll: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "unstable_listView">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridSortingModelApplier } from './gridSortingState';
|
|
3
3
|
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
@@ -8,10 +8,10 @@ export declare const mergeStateWithSortModel: (sortModel: GridSortModel, disable
|
|
|
8
8
|
/**
|
|
9
9
|
* Generates a method to easily sort a list of rows according to the current sort model.
|
|
10
10
|
* @param {GridSortModel} sortModel The model with which we want to sort the rows.
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
12
12
|
* @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.
|
|
13
13
|
*/
|
|
14
|
-
export declare const buildAggregatedSortingApplier: (sortModel: GridSortModel, apiRef:
|
|
14
|
+
export declare const buildAggregatedSortingApplier: (sortModel: GridSortModel, apiRef: RefObject<GridApiCommunity>) => GridSortingModelApplier | null;
|
|
15
15
|
export declare const getNextGridSortDirection: (sortingOrder: readonly GridSortDirection[], current?: GridSortDirection) => GridSortDirection;
|
|
16
16
|
export declare const gridStringOrNumberComparator: GridComparatorFn;
|
|
17
17
|
export declare const gridNumberComparator: GridComparatorFn;
|
|
@@ -19,7 +19,7 @@ const isDesc = direction => direction === 'desc';
|
|
|
19
19
|
/**
|
|
20
20
|
* Transform an item of the sorting model into a method comparing two rows.
|
|
21
21
|
* @param {GridSortItem} sortItem The sort item we want to apply.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
23
23
|
* @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
|
|
24
24
|
*/
|
|
25
25
|
const parseSortItem = (sortItem, apiRef) => {
|
|
@@ -72,7 +72,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
|
|
|
72
72
|
/**
|
|
73
73
|
* Generates a method to easily sort a list of rows according to the current sort model.
|
|
74
74
|
* @param {GridSortModel} sortModel The model with which we want to sort the rows.
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
76
76
|
* @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.
|
|
77
77
|
*/
|
|
78
78
|
export const buildAggregatedSortingApplier = (sortModel, apiRef) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -7,4 +7,4 @@ export declare const sortingStateInitializer: GridStateInitializer<Pick<DataGrid
|
|
|
7
7
|
* @requires useGridRows (event)
|
|
8
8
|
* @requires useGridColumns (event)
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridSorting: (apiRef:
|
|
10
|
+
export declare const useGridSorting: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "initialState" | "sortModel" | "onSortModelChange" | "sortingOrder" | "sortingMode" | "disableColumnSorting" | "disableMultipleColumnsSorting">) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
export declare const useGridStatePersistence: (apiRef:
|
|
3
|
+
export declare const useGridStatePersistence: (apiRef: RefObject<GridPrivateApiCommunity>) => void;
|
|
@@ -26,6 +26,7 @@ import { gridRowSpanningHiddenCellsOriginMapSelector } from "../rows/gridRowSpan
|
|
|
26
26
|
import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
|
|
27
27
|
import { minimalContentHeight } from "../rows/gridRowsUtils.js";
|
|
28
28
|
import { gridFocusedVirtualCellSelector } from "./gridFocusedVirtualCellSelector.js";
|
|
29
|
+
import { isJSDOM } from "../../../utils/isJSDOM.js";
|
|
29
30
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
31
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
31
32
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -45,14 +46,6 @@ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, h
|
|
|
45
46
|
direction: ScrollDirection.NONE,
|
|
46
47
|
buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
47
48
|
});
|
|
48
|
-
let isJSDOM = false;
|
|
49
|
-
try {
|
|
50
|
-
if (typeof window !== 'undefined') {
|
|
51
|
-
isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
52
|
-
}
|
|
53
|
-
} catch (_) {
|
|
54
|
-
/* ignore */
|
|
55
|
-
}
|
|
56
49
|
export const useGridVirtualScroller = () => {
|
|
57
50
|
const apiRef = useGridPrivateApiContext();
|
|
58
51
|
const rootProps = useGridRootProps();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridRenderContext } from '../../../models';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
@@ -17,5 +17,5 @@ export declare const EMPTY_RENDER_CONTEXT: {
|
|
|
17
17
|
lastColumnIndex: number;
|
|
18
18
|
};
|
|
19
19
|
export declare const virtualizationStateInitializer: GridStateInitializer<RootProps>;
|
|
20
|
-
export declare function useGridVirtualization(apiRef:
|
|
20
|
+
export declare function useGridVirtualization(apiRef: RefObject<GridPrivateApiCommunity>, props: RootProps): void;
|
|
21
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
|
-
export declare function useGridApiContext<Api extends GridApiCommon = GridApiCommunity>():
|
|
4
|
+
export declare function useGridApiContext<Api extends GridApiCommon = GridApiCommunity>(): RefObject<Api>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { EventListenerOptions } from '@mui/x-internals/EventManager';
|
|
3
3
|
import { GridEventListener, GridEvents } from '../../models/events';
|
|
4
4
|
import { CleanupTracking } from '../../utils/cleanupTracking/CleanupTracking';
|
|
@@ -15,8 +15,8 @@ declare enum GridSignature {
|
|
|
15
15
|
interface RegistryContainer {
|
|
16
16
|
registry: CleanupTracking | null;
|
|
17
17
|
}
|
|
18
|
-
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
18
|
+
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
19
19
|
export declare const unstable_resetCleanupTracking: () => void;
|
|
20
|
-
export declare const useGridApiEventHandler: <Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
21
|
-
export declare function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
20
|
+
export declare const useGridApiEventHandler: <Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
21
|
+
export declare function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>): void;
|
|
22
22
|
export { GridSignature };
|