@mui/x-data-grid 7.1.1 → 7.3.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 +211 -0
- package/DataGrid/DataGrid.js +19 -0
- package/components/GridPagination.d.ts +4 -1
- package/components/GridPagination.js +60 -9
- package/components/GridRow.js +4 -1
- package/components/GridScrollArea.js +1 -1
- package/components/cell/GridCell.d.ts +1 -0
- package/components/cell/GridCell.js +4 -2
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +9 -4
- package/components/containers/GridRootStyles.js +8 -4
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/panel/GridPanel.js +3 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/constants/gridClasses.d.ts +11 -2
- package/constants/gridClasses.js +1 -1
- package/hooks/core/useGridInitialization.js +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -2
- package/hooks/core/useGridStateInitialization.js +6 -10
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -5
- package/hooks/features/columnResize/useGridColumnResize.js +75 -61
- package/hooks/features/columns/gridColumnsUtils.d.ts +2 -1
- package/hooks/features/columns/gridColumnsUtils.js +4 -3
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/density/useGridDensity.js +30 -4
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +5 -2
- package/hooks/features/editing/useGridCellEditing.js +17 -2
- package/hooks/features/editing/useGridRowEditing.js +3 -1
- package/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.js +2 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +14 -2
- package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
- package/hooks/features/pagination/gridPaginationSelector.js +7 -1
- package/hooks/features/pagination/gridPaginationUtils.d.ts +1 -2
- package/hooks/features/pagination/gridPaginationUtils.js +5 -3
- package/hooks/features/pagination/useGridPagination.d.ts +1 -1
- package/hooks/features/pagination/useGridPagination.js +5 -1
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +4 -0
- package/hooks/features/pagination/useGridPaginationMeta.js +77 -0
- package/hooks/features/pagination/useGridPaginationModel.js +2 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +0 -4
- package/hooks/features/pagination/useGridRowCount.js +32 -18
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/utils/propValidation.js +1 -1
- package/locales/daDK.js +3 -4
- package/locales/deDE.js +3 -4
- package/locales/frFR.js +5 -6
- package/locales/svSE.js +3 -4
- package/models/api/gridApiCommon.d.ts +1 -1
- package/models/api/gridCallbackDetails.d.ts +5 -0
- package/models/api/gridLocaleTextApi.d.ts +7 -3
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +7 -1
- package/models/gridPaginationProps.d.ts +3 -0
- package/models/props/DataGridProps.d.ts +26 -8
- package/modern/DataGrid/DataGrid.js +19 -0
- package/modern/components/GridPagination.js +60 -9
- package/modern/components/GridRow.js +4 -1
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/cell/GridCell.js +4 -2
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +9 -4
- package/modern/components/containers/GridRootStyles.js +8 -4
- package/modern/components/index.js +1 -1
- package/modern/components/panel/GridPanel.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/useGridInitialization.js +1 -1
- package/modern/hooks/core/useGridStateInitialization.js +6 -10
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -5
- package/modern/hooks/features/columnResize/useGridColumnResize.js +75 -61
- package/modern/hooks/features/columns/gridColumnsUtils.js +4 -3
- package/modern/hooks/features/density/useGridDensity.js +30 -4
- package/modern/hooks/features/dimensions/useGridDimensions.js +5 -2
- package/modern/hooks/features/editing/useGridCellEditing.js +17 -2
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/modern/hooks/features/export/useGridPrintExport.js +2 -2
- package/modern/hooks/features/pagination/gridPaginationSelector.js +7 -1
- package/modern/hooks/features/pagination/gridPaginationUtils.js +5 -3
- package/modern/hooks/features/pagination/useGridPagination.js +5 -1
- package/modern/hooks/features/pagination/useGridPaginationMeta.js +77 -0
- package/modern/hooks/features/pagination/useGridPaginationModel.js +2 -1
- package/modern/hooks/features/pagination/useGridRowCount.js +32 -18
- package/modern/index.js +1 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/locales/daDK.js +3 -4
- package/modern/locales/deDE.js +3 -4
- package/modern/locales/frFR.js +5 -6
- package/modern/locales/svSE.js +3 -4
- package/modern/models/api/index.js +0 -1
- package/modern/utils/cellBorderUtils.js +15 -2
- package/node/DataGrid/DataGrid.js +19 -0
- package/node/components/GridPagination.js +59 -8
- package/node/components/GridRow.js +4 -1
- package/node/components/GridScrollArea.js +1 -1
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +8 -3
- package/node/components/containers/GridRootStyles.js +8 -4
- package/node/components/index.js +27 -10
- package/node/components/panel/GridPanel.js +3 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/useGridInitialization.js +1 -1
- package/node/hooks/core/useGridStateInitialization.js +6 -10
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -5
- package/node/hooks/features/columnResize/useGridColumnResize.js +76 -62
- package/node/hooks/features/columns/gridColumnsUtils.js +4 -3
- package/node/hooks/features/density/useGridDensity.js +30 -4
- package/node/hooks/features/dimensions/useGridDimensions.js +5 -2
- package/node/hooks/features/editing/useGridCellEditing.js +17 -2
- package/node/hooks/features/editing/useGridRowEditing.js +3 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/node/hooks/features/pagination/gridPaginationUtils.js +6 -4
- package/node/hooks/features/pagination/useGridPagination.js +5 -1
- package/node/hooks/features/pagination/useGridPaginationMeta.js +87 -0
- package/node/hooks/features/pagination/useGridPaginationModel.js +2 -1
- package/node/hooks/features/pagination/useGridRowCount.js +30 -15
- package/node/index.js +1 -1
- package/node/internals/utils/propValidation.js +1 -1
- package/node/locales/daDK.js +3 -4
- package/node/locales/deDE.js +3 -4
- package/node/locales/frFR.js +5 -6
- package/node/locales/svSE.js +3 -4
- package/node/models/api/index.js +0 -11
- package/node/utils/cellBorderUtils.js +15 -2
- package/package.json +1 -1
- package/themeAugmentation/overrides.d.ts +6 -0
- package/utils/cellBorderUtils.d.ts +1 -1
- package/utils/cellBorderUtils.js +15 -2
- package/utils/getGridLocalization.d.ts +1 -1
|
@@ -242,7 +242,9 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
242
242
|
const updateRowModesModel = useEventCallback(newModel => {
|
|
243
243
|
const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
|
|
244
244
|
if (onRowModesModelChange && isNewModelDifferentFromProp) {
|
|
245
|
-
onRowModesModelChange(newModel, {
|
|
245
|
+
onRowModesModelChange(newModel, {
|
|
246
|
+
api: apiRef.current
|
|
247
|
+
});
|
|
246
248
|
}
|
|
247
249
|
if (props.rowModesModel && isNewModelDifferentFromProp) {
|
|
248
250
|
return; // The prop always win
|
|
@@ -2,12 +2,13 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
|
|
|
2
2
|
import { buildWarning } from '../../../../utils/warning';
|
|
3
3
|
function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
|
|
4
4
|
if (typeof value === 'string') {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (shouldAppendQuotes) {
|
|
6
|
+
const escapedValue = value.replace(/"/g, '""');
|
|
7
|
+
// Make sure value containing delimiter or line break won't be split into multiple rows
|
|
8
|
+
if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
|
|
9
|
+
return `"${escapedValue}"`;
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return escapedValue;
|
|
11
12
|
}
|
|
12
13
|
return value;
|
|
13
14
|
}
|
|
@@ -7,4 +7,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
|
7
7
|
* @requires useGridSorting (state)
|
|
8
8
|
* @requires useGridParamsApi (method)
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridPrintExport: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'pagination' | 'columnHeaderHeight'>) => void;
|
|
10
|
+
export declare const useGridPrintExport: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'pagination' | 'columnHeaderHeight' | 'headerFilterHeight'>) => void;
|
|
@@ -107,7 +107,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// Expand container height to accommodate all rows
|
|
110
|
-
const computedTotalHeight = rowsMeta.currentPageTotalHeight + getTotalHeaderHeight(apiRef, props
|
|
110
|
+
const computedTotalHeight = rowsMeta.currentPageTotalHeight + getTotalHeaderHeight(apiRef, props) + gridToolbarElementHeight + gridFooterElementHeight;
|
|
111
111
|
gridClone.style.height = `${computedTotalHeight}px`;
|
|
112
112
|
// The height above does not include grid border width, so we need to exclude it
|
|
113
113
|
gridClone.style.boxSizing = 'content-box';
|
|
@@ -181,7 +181,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
181
181
|
printWindow.contentWindow.print();
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
}, [apiRef, doc, props
|
|
184
|
+
}, [apiRef, doc, props]);
|
|
185
185
|
const handlePrintWindowAfterPrint = React.useCallback(printWindow => {
|
|
186
186
|
// Remove the print iframe
|
|
187
187
|
doc.current.body.removeChild(printWindow);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
import {
|
|
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: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<
|
|
6
|
+
export declare const useGridHeaderFiltering: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'signature' | 'headerFilters'>) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
import {
|
|
3
|
+
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
/**
|
|
5
5
|
* @requires useGridSorting (method) - can be after
|
|
6
6
|
* @requires useGridFilter (state) - can be after
|
|
@@ -10,4 +10,4 @@ import { DataGridProcessedPropsWithShared } from '../../../models/props/DataGrid
|
|
|
10
10
|
* @requires useGridScroll (method) - can be after
|
|
11
11
|
* @requires useGridColumnSpanning (method) - can be after
|
|
12
12
|
*/
|
|
13
|
-
export declare const useGridKeyboardNavigation: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<
|
|
13
|
+
export declare const useGridKeyboardNavigation: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'pagination' | 'paginationMode' | 'getRowId' | 'experimentalFeatures' | 'signature' | 'headerFilters'>) => void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { GridPaginationModel } from '../../../models/gridPaginationProps';
|
|
1
|
+
import { GridPaginationMeta, GridPaginationModel } from '../../../models/gridPaginationProps';
|
|
2
2
|
export interface GridPaginationState {
|
|
3
3
|
paginationModel: GridPaginationModel;
|
|
4
4
|
rowCount: number;
|
|
5
|
+
meta: GridPaginationMeta;
|
|
5
6
|
}
|
|
6
7
|
export interface GridPaginationInitialState {
|
|
7
8
|
paginationModel?: Partial<GridPaginationModel>;
|
|
8
9
|
rowCount?: number;
|
|
10
|
+
meta?: GridPaginationMeta;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* The pagination model API interface that is available in the grid `apiRef`.
|
|
@@ -37,8 +39,18 @@ export interface GridPaginationRowCountApi {
|
|
|
37
39
|
*/
|
|
38
40
|
setRowCount: (rowCount: number) => void;
|
|
39
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* The pagination meta API interface that is available in the grid `apiRef`.
|
|
44
|
+
*/
|
|
45
|
+
export interface GridPaginationMetaApi {
|
|
46
|
+
/**
|
|
47
|
+
* Sets the `paginationMeta` to a new value.
|
|
48
|
+
* @param {GridPaginationMeta} paginationMeta The new pagination meta value.
|
|
49
|
+
*/
|
|
50
|
+
setPaginationMeta: (paginationMeta: GridPaginationMeta) => void;
|
|
51
|
+
}
|
|
40
52
|
/**
|
|
41
53
|
* The pagination API interface that is available in the grid `apiRef`.
|
|
42
54
|
*/
|
|
43
|
-
export interface GridPaginationApi extends GridPaginationModelApi, GridPaginationRowCountApi {
|
|
55
|
+
export interface GridPaginationApi extends GridPaginationModelApi, GridPaginationRowCountApi, GridPaginationMetaApi {
|
|
44
56
|
}
|
|
@@ -14,6 +14,11 @@ export declare const gridPaginationModelSelector: import("../../../utils/createS
|
|
|
14
14
|
* @category Pagination
|
|
15
15
|
*/
|
|
16
16
|
export declare const gridPaginationRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the pagination meta
|
|
19
|
+
* @category Pagination
|
|
20
|
+
*/
|
|
21
|
+
export declare const gridPaginationMetaSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridPaginationMeta>;
|
|
17
22
|
/**
|
|
18
23
|
* Get the index of the page to render if the pagination is enabled
|
|
19
24
|
* @category Pagination
|
|
@@ -21,6 +21,12 @@ export const gridPaginationModelSelector = createSelector(gridPaginationSelector
|
|
|
21
21
|
*/
|
|
22
22
|
export const gridPaginationRowCountSelector = createSelector(gridPaginationSelector, pagination => pagination.rowCount);
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Get the pagination meta
|
|
26
|
+
* @category Pagination
|
|
27
|
+
*/
|
|
28
|
+
export const gridPaginationMetaSelector = createSelector(gridPaginationSelector, pagination => pagination.meta);
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* Get the index of the page to render if the pagination is enabled
|
|
26
32
|
* @category Pagination
|
|
@@ -37,7 +43,7 @@ export const gridPageSizeSelector = createSelector(gridPaginationModelSelector,
|
|
|
37
43
|
* Get the amount of pages needed to display all the rows if the pagination is enabled
|
|
38
44
|
* @category Pagination
|
|
39
45
|
*/
|
|
40
|
-
export const gridPageCountSelector = createSelector(
|
|
46
|
+
export const gridPageCountSelector = createSelector(gridPaginationModelSelector, gridPaginationRowCountSelector, (paginationModel, rowCount) => getPageCount(rowCount, paginationModel.pageSize, paginationModel.page));
|
|
41
47
|
|
|
42
48
|
/**
|
|
43
49
|
* Get the index of the first and the last row to include in the current page if the pagination is enabled.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
2
2
|
export declare const defaultPageSize: (autoPageSize: boolean) => 0 | 100;
|
|
3
|
-
export declare const getPageCount: (rowCount: number, pageSize: number) => number;
|
|
4
|
-
export declare const noRowCountInServerMode: () => void;
|
|
3
|
+
export declare const getPageCount: (rowCount: number, pageSize: number, page: number) => number;
|
|
5
4
|
export declare const getDefaultGridPaginationModel: (autoPageSize: boolean) => {
|
|
6
5
|
page: number;
|
|
7
6
|
pageSize: number;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { buildWarning } from '../../../utils/warning';
|
|
2
1
|
import { GridSignature } from '../../utils';
|
|
3
2
|
const MAX_PAGE_SIZE = 100;
|
|
4
3
|
export const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;
|
|
5
|
-
export const getPageCount = (rowCount, pageSize) => {
|
|
4
|
+
export const getPageCount = (rowCount, pageSize, page) => {
|
|
6
5
|
if (pageSize > 0 && rowCount > 0) {
|
|
7
6
|
return Math.ceil(rowCount / pageSize);
|
|
8
7
|
}
|
|
8
|
+
if (rowCount === -1) {
|
|
9
|
+
// With unknown row-count, we can assume a page after the current one
|
|
10
|
+
return page + 2;
|
|
11
|
+
}
|
|
9
12
|
return 0;
|
|
10
13
|
};
|
|
11
|
-
export const noRowCountInServerMode = buildWarning(["MUI X: the 'rowCount' prop is undefined while using paginationMode='server'", 'For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation'], 'error');
|
|
12
14
|
export const getDefaultGridPaginationModel = autoPageSize => ({
|
|
13
15
|
page: 0,
|
|
14
16
|
pageSize: autoPageSize ? 0 : 100
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
5
|
-
export declare const paginationStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'paginationModel' | 'rowCount' | 'initialState' | 'autoPageSize' | 'signature'>>;
|
|
5
|
+
export declare const paginationStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'paginationModel' | 'rowCount' | 'initialState' | 'autoPageSize' | 'signature' | 'paginationMeta'>>;
|
|
6
6
|
/**
|
|
7
7
|
* @requires useGridFilter (state)
|
|
8
8
|
* @requires useGridDimensions (event) - can be after
|
|
@@ -2,14 +2,17 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import { throwIfPageSizeExceedsTheLimit, getDefaultGridPaginationModel } from './gridPaginationUtils';
|
|
3
3
|
import { useGridPaginationModel } from './useGridPaginationModel';
|
|
4
4
|
import { useGridRowCount } from './useGridRowCount';
|
|
5
|
+
import { useGridPaginationMeta } from './useGridPaginationMeta';
|
|
5
6
|
export const paginationStateInitializer = (state, props) => {
|
|
6
7
|
const paginationModel = _extends({}, getDefaultGridPaginationModel(props.autoPageSize), props.paginationModel ?? props.initialState?.pagination?.paginationModel);
|
|
7
8
|
throwIfPageSizeExceedsTheLimit(paginationModel.pageSize, props.signature);
|
|
8
9
|
const rowCount = props.rowCount ?? props.initialState?.pagination?.rowCount;
|
|
10
|
+
const meta = props.paginationMeta ?? props.initialState?.pagination?.meta ?? {};
|
|
9
11
|
return _extends({}, state, {
|
|
10
12
|
pagination: {
|
|
11
13
|
paginationModel,
|
|
12
|
-
rowCount
|
|
14
|
+
rowCount,
|
|
15
|
+
meta
|
|
13
16
|
}
|
|
14
17
|
});
|
|
15
18
|
};
|
|
@@ -19,6 +22,7 @@ export const paginationStateInitializer = (state, props) => {
|
|
|
19
22
|
* @requires useGridDimensions (event) - can be after
|
|
20
23
|
*/
|
|
21
24
|
export const useGridPagination = (apiRef, props) => {
|
|
25
|
+
useGridPaginationMeta(apiRef, props);
|
|
22
26
|
useGridPaginationModel(apiRef, props);
|
|
23
27
|
useGridRowCount(apiRef, props);
|
|
24
28
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
+
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
|
+
export declare const useGridPaginationMeta: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'paginationMeta' | 'initialState' | 'paginationMode' | 'onPaginationMetaChange'>) => void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useGridLogger, useGridSelector, useGridApiMethod } from '../../utils';
|
|
4
|
+
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
5
|
+
import { gridPaginationMetaSelector } from './gridPaginationSelector';
|
|
6
|
+
export const useGridPaginationMeta = (apiRef, props) => {
|
|
7
|
+
const logger = useGridLogger(apiRef, 'useGridPaginationMeta');
|
|
8
|
+
const paginationMeta = useGridSelector(apiRef, gridPaginationMetaSelector);
|
|
9
|
+
apiRef.current.registerControlState({
|
|
10
|
+
stateId: 'paginationMeta',
|
|
11
|
+
propModel: props.paginationMeta,
|
|
12
|
+
propOnChange: props.onPaginationMetaChange,
|
|
13
|
+
stateSelector: gridPaginationMetaSelector,
|
|
14
|
+
changeEvent: 'paginationMetaChange'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* API METHODS
|
|
19
|
+
*/
|
|
20
|
+
const setPaginationMeta = React.useCallback(newPaginationMeta => {
|
|
21
|
+
if (paginationMeta === newPaginationMeta) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
logger.debug("Setting 'paginationMeta' to", newPaginationMeta);
|
|
25
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
26
|
+
pagination: _extends({}, state.pagination, {
|
|
27
|
+
meta: newPaginationMeta
|
|
28
|
+
})
|
|
29
|
+
}));
|
|
30
|
+
}, [apiRef, logger, paginationMeta]);
|
|
31
|
+
const paginationMetaApi = {
|
|
32
|
+
setPaginationMeta
|
|
33
|
+
};
|
|
34
|
+
useGridApiMethod(apiRef, paginationMetaApi, 'public');
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* PRE-PROCESSING
|
|
38
|
+
*/
|
|
39
|
+
const stateExportPreProcessing = React.useCallback((prevState, context) => {
|
|
40
|
+
const exportedPaginationMeta = gridPaginationMetaSelector(apiRef);
|
|
41
|
+
const shouldExportRowCount =
|
|
42
|
+
// Always export if the `exportOnlyDirtyModels` property is not activated
|
|
43
|
+
!context.exportOnlyDirtyModels ||
|
|
44
|
+
// Always export if the `paginationMeta` is controlled
|
|
45
|
+
props.paginationMeta != null ||
|
|
46
|
+
// Always export if the `paginationMeta` has been initialized
|
|
47
|
+
props.initialState?.pagination?.meta != null;
|
|
48
|
+
if (!shouldExportRowCount) {
|
|
49
|
+
return prevState;
|
|
50
|
+
}
|
|
51
|
+
return _extends({}, prevState, {
|
|
52
|
+
pagination: _extends({}, prevState.pagination, {
|
|
53
|
+
meta: exportedPaginationMeta
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}, [apiRef, props.paginationMeta, props.initialState?.pagination?.meta]);
|
|
57
|
+
const stateRestorePreProcessing = React.useCallback((params, context) => {
|
|
58
|
+
const restoredPaginationMeta = context.stateToRestore.pagination?.meta ? context.stateToRestore.pagination.meta : gridPaginationMetaSelector(apiRef);
|
|
59
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
60
|
+
pagination: _extends({}, state.pagination, {
|
|
61
|
+
meta: restoredPaginationMeta
|
|
62
|
+
})
|
|
63
|
+
}));
|
|
64
|
+
return params;
|
|
65
|
+
}, [apiRef]);
|
|
66
|
+
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
67
|
+
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* EFFECTS
|
|
71
|
+
*/
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (props.paginationMeta) {
|
|
74
|
+
apiRef.current.setPaginationMeta(props.paginationMeta);
|
|
75
|
+
}
|
|
76
|
+
}, [apiRef, props.paginationMeta]);
|
|
77
|
+
};
|
|
@@ -9,7 +9,8 @@ export const getDerivedPaginationModel = (paginationState, signature, pagination
|
|
|
9
9
|
let paginationModel = paginationState.paginationModel;
|
|
10
10
|
const rowCount = paginationState.rowCount;
|
|
11
11
|
const pageSize = paginationModelProp?.pageSize ?? paginationModel.pageSize;
|
|
12
|
-
const
|
|
12
|
+
const page = paginationModelProp?.page ?? paginationModel.page;
|
|
13
|
+
const pageCount = getPageCount(rowCount, pageSize, page);
|
|
13
14
|
if (paginationModelProp && (paginationModelProp?.page !== paginationModel.page || paginationModelProp?.pageSize !== paginationModel.pageSize)) {
|
|
14
15
|
paginationModel = paginationModelProp;
|
|
15
16
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
|
-
/**
|
|
5
|
-
* @requires useGridFilter (state)
|
|
6
|
-
* @requires useGridDimensions (event) - can be after
|
|
7
|
-
*/
|
|
8
4
|
export declare const useGridRowCount: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'rowCount' | 'initialState' | 'paginationMode' | 'onRowCountChange'>) => void;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import useLazyRef from '@mui/utils/useLazyRef';
|
|
3
4
|
import { gridFilteredTopLevelRowCountSelector } from '../filter';
|
|
4
|
-
import { useGridLogger, useGridSelector, useGridApiMethod } from '../../utils';
|
|
5
|
+
import { useGridLogger, useGridSelector, useGridApiMethod, useGridApiEventHandler } from '../../utils';
|
|
5
6
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
6
|
-
import { gridPaginationRowCountSelector } from './gridPaginationSelector';
|
|
7
|
-
import { noRowCountInServerMode } from './gridPaginationUtils';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @requires useGridFilter (state)
|
|
11
|
-
* @requires useGridDimensions (event) - can be after
|
|
12
|
-
*/
|
|
7
|
+
import { gridPaginationRowCountSelector, gridPaginationMetaSelector, gridPaginationModelSelector } from './gridPaginationSelector';
|
|
13
8
|
export const useGridRowCount = (apiRef, props) => {
|
|
14
9
|
const logger = useGridLogger(apiRef, 'useGridRowCount');
|
|
15
10
|
const visibleTopLevelRowCount = useGridSelector(apiRef, gridFilteredTopLevelRowCountSelector);
|
|
16
|
-
const
|
|
11
|
+
const rowCountState = useGridSelector(apiRef, gridPaginationRowCountSelector);
|
|
12
|
+
const paginationMeta = useGridSelector(apiRef, gridPaginationMetaSelector);
|
|
13
|
+
const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
|
|
14
|
+
const previousPageSize = useLazyRef(() => gridPaginationModelSelector(apiRef).pageSize);
|
|
17
15
|
apiRef.current.registerControlState({
|
|
18
16
|
stateId: 'paginationRowCount',
|
|
19
17
|
propModel: props.rowCount,
|
|
@@ -26,7 +24,7 @@ export const useGridRowCount = (apiRef, props) => {
|
|
|
26
24
|
* API METHODS
|
|
27
25
|
*/
|
|
28
26
|
const setRowCount = React.useCallback(newRowCount => {
|
|
29
|
-
if (
|
|
27
|
+
if (rowCountState === newRowCount) {
|
|
30
28
|
return;
|
|
31
29
|
}
|
|
32
30
|
logger.debug("Setting 'rowCount' to", newRowCount);
|
|
@@ -35,7 +33,7 @@ export const useGridRowCount = (apiRef, props) => {
|
|
|
35
33
|
rowCount: newRowCount
|
|
36
34
|
})
|
|
37
35
|
}));
|
|
38
|
-
}, [apiRef, logger,
|
|
36
|
+
}, [apiRef, logger, rowCountState]);
|
|
39
37
|
const paginationRowCountApi = {
|
|
40
38
|
setRowCount
|
|
41
39
|
};
|
|
@@ -75,20 +73,36 @@ export const useGridRowCount = (apiRef, props) => {
|
|
|
75
73
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
76
74
|
|
|
77
75
|
/**
|
|
78
|
-
*
|
|
76
|
+
* EVENTS
|
|
79
77
|
*/
|
|
80
|
-
React.
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const handlePaginationModelChange = React.useCallback(model => {
|
|
79
|
+
if (props.paginationMode === 'client' || !previousPageSize.current) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (model.pageSize !== previousPageSize.current) {
|
|
83
|
+
previousPageSize.current = model.pageSize;
|
|
84
|
+
if (rowCountState === -1) {
|
|
85
|
+
// Row count unknown and page size changed, reset the page
|
|
86
|
+
apiRef.current.setPage(0);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
|
-
}, [props.
|
|
89
|
+
}, [props.paginationMode, previousPageSize, rowCountState, apiRef]);
|
|
90
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', handlePaginationModelChange);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* EFFECTS
|
|
94
|
+
*/
|
|
87
95
|
React.useEffect(() => {
|
|
88
96
|
if (props.paginationMode === 'client') {
|
|
89
97
|
apiRef.current.setRowCount(visibleTopLevelRowCount);
|
|
90
98
|
} else if (props.rowCount != null) {
|
|
91
99
|
apiRef.current.setRowCount(props.rowCount);
|
|
92
100
|
}
|
|
93
|
-
}, [apiRef,
|
|
101
|
+
}, [apiRef, props.paginationMode, visibleTopLevelRowCount, props.rowCount]);
|
|
102
|
+
const isLastPage = paginationMeta.hasNextPage === false;
|
|
103
|
+
React.useEffect(() => {
|
|
104
|
+
if (isLastPage && rowCountState === -1) {
|
|
105
|
+
apiRef.current.setRowCount(paginationModel.pageSize * paginationModel.page + visibleTopLevelRowCount);
|
|
106
|
+
}
|
|
107
|
+
}, [apiRef, visibleTopLevelRowCount, isLastPage, rowCountState, paginationModel]);
|
|
94
108
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
2
|
+
import type { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
import { OutputSelector } from '../../utils/createSelector';
|
|
4
4
|
import { fastObjectShallowCompare } from '../../utils/fastObjectShallowCompare';
|
|
5
5
|
export declare const objectShallowCompare: typeof fastObjectShallowCompare;
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export { useTimeout } from '../hooks/utils/useTimeout';
|
|
|
65
65
|
export { useGridVisibleRows, getVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
66
66
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
67
67
|
export type { GridStateInitializer } from '../hooks/utils/useGridInitializeState';
|
|
68
|
-
export type
|
|
68
|
+
export type * from '../models/props/DataGridProps';
|
|
69
69
|
export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
|
|
70
70
|
export * from '../utils/createControllablePromise';
|
|
71
71
|
export { createSelector, createSelectorMemoized } from '../utils/createSelector';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNumber } from '../../utils/utils';
|
|
2
2
|
import { GridSignature } from '../../hooks/utils/useGridApiEventHandler';
|
|
3
|
-
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && 'MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect. `rowCount` is only meant to be used with `paginationMode="server"`.' || undefined];
|
|
3
|
+
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
|
|
4
4
|
const warnedOnceCache = new Set();
|
|
5
5
|
const warnOnce = message => {
|
|
6
6
|
if (!warnedOnceCache.has(message)) {
|
package/locales/daDK.js
CHANGED
|
@@ -30,10 +30,9 @@ const daDKGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Print',
|
|
31
31
|
toolbarExportExcel: 'Download som Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Søg',
|
|
34
|
+
columnsManagementNoColumns: 'Ingen søjler',
|
|
35
|
+
columnsManagementShowHideAllText: 'Vis/Shjul Alle',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Tilføj filter',
|
|
39
38
|
filterPanelRemoveAll: 'Fjern alle',
|
package/locales/deDE.js
CHANGED
|
@@ -30,10 +30,9 @@ const deDEGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Drucken',
|
|
31
31
|
toolbarExportExcel: 'Download als Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Suche',
|
|
34
|
+
columnsManagementNoColumns: 'Keine Spalten',
|
|
35
|
+
columnsManagementShowHideAllText: 'Alle anzeigen/verbergen',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
39
38
|
filterPanelRemoveAll: 'Alle entfernen',
|
package/locales/frFR.js
CHANGED
|
@@ -16,7 +16,7 @@ const frFRGrid = {
|
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filtres',
|
|
18
18
|
toolbarFiltersLabel: 'Afficher les filtres',
|
|
19
|
-
toolbarFiltersTooltipHide: '
|
|
19
|
+
toolbarFiltersTooltipHide: 'Masquer les filtres',
|
|
20
20
|
toolbarFiltersTooltipShow: 'Afficher les filtres',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count > 1 ? `${count} filtres actifs` : `${count} filtre actif`,
|
|
22
22
|
// Quick filter toolbar field
|
|
@@ -30,10 +30,9 @@ const frFRGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Imprimer',
|
|
31
31
|
toolbarExportExcel: 'Télécharger pour Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Rechercher',
|
|
34
|
+
columnsManagementNoColumns: 'Pas de colonnes',
|
|
35
|
+
columnsManagementShowHideAllText: 'Afficher/masquer toutes',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Ajouter un filtre',
|
|
39
38
|
filterPanelRemoveAll: 'Tout supprimer',
|
|
@@ -94,7 +93,7 @@ const frFRGrid = {
|
|
|
94
93
|
columnMenuShowColumns: 'Afficher les colonnes',
|
|
95
94
|
columnMenuManageColumns: 'Gérer les colonnes',
|
|
96
95
|
columnMenuFilter: 'Filtrer',
|
|
97
|
-
columnMenuHideColumn: '
|
|
96
|
+
columnMenuHideColumn: 'Masquer',
|
|
98
97
|
columnMenuUnsort: 'Annuler le tri',
|
|
99
98
|
columnMenuSortAsc: 'Tri ascendant',
|
|
100
99
|
columnMenuSortDesc: 'Tri descendant',
|
package/locales/svSE.js
CHANGED
|
@@ -30,10 +30,9 @@ const svSEGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Skriv ut',
|
|
31
31
|
toolbarExportExcel: 'Ladda ner som Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Sök',
|
|
34
|
+
columnsManagementNoColumns: 'Inga kolumner',
|
|
35
|
+
columnsManagementShowHideAllText: 'Visa/Dölj alla',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Lägg till filter',
|
|
39
38
|
filterPanelRemoveAll: 'Ta bort alla',
|
|
@@ -6,7 +6,7 @@ import { GridDensityApi } from './gridDensityApi';
|
|
|
6
6
|
import { GridEditingApi, GridEditingPrivateApi } from './gridEditingApi';
|
|
7
7
|
import type { GridFilterApi } from './gridFilterApi';
|
|
8
8
|
import { GridFocusApi, GridFocusPrivateApi } from './gridFocusApi';
|
|
9
|
-
import { GridLocaleTextApi } from './gridLocaleTextApi';
|
|
9
|
+
import type { GridLocaleTextApi } from './gridLocaleTextApi';
|
|
10
10
|
import type { GridParamsApi } from './gridParamsApi';
|
|
11
11
|
import { GridPreferencesPanelApi } from './gridPreferencesPanelApi';
|
|
12
12
|
import { GridPrintExportApi } from './gridPrintExportApi';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GridControlledStateReasonLookup } from '../events/gridEventLookup';
|
|
2
|
+
import { GridApiCommunity } from './gridApiCommunity';
|
|
2
3
|
/**
|
|
3
4
|
* Additional details passed to the callbacks
|
|
4
5
|
*/
|
|
@@ -7,4 +8,8 @@ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLo
|
|
|
7
8
|
* The reason for this callback to have been called.
|
|
8
9
|
*/
|
|
9
10
|
reason?: GridControlledStateReasonLookup[K];
|
|
11
|
+
/**
|
|
12
|
+
* GridApi that let you manipulate the grid.
|
|
13
|
+
*/
|
|
14
|
+
api: GridApiCommunity;
|
|
10
15
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ComponentsPropsList } from '@mui/material/styles';
|
|
3
|
-
import {
|
|
2
|
+
import type { ComponentsPropsList } from '@mui/material/styles';
|
|
3
|
+
import type { WrappedLabelDisplayedRows } from '../../components/GridPagination';
|
|
4
|
+
import type { GridColDef } from '../colDef';
|
|
5
|
+
export type MuiTablePaginationLocalizedProps = Omit<ComponentsPropsList['MuiTablePagination'], 'page' | 'count' | 'onChangePage' | 'rowsPerPage' | 'onPageChange' | 'labelDisplayedRows'> & {
|
|
6
|
+
labelDisplayedRows?: WrappedLabelDisplayedRows;
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* Set the types of the texts in the grid.
|
|
6
10
|
*/
|
|
@@ -122,7 +126,7 @@ export interface GridLocaleText {
|
|
|
122
126
|
aggregationFunctionLabelMin: string;
|
|
123
127
|
aggregationFunctionLabelMax: string;
|
|
124
128
|
aggregationFunctionLabelSize: string;
|
|
125
|
-
MuiTablePagination:
|
|
129
|
+
MuiTablePagination: MuiTablePaginationLocalizedProps;
|
|
126
130
|
}
|
|
127
131
|
export type GridTranslationKeys = keyof GridLocaleText;
|
|
128
132
|
/**
|
package/models/api/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { GridRowsMetaApi } from './gridRowsMetaApi';
|
|
|
8
8
|
export * from './gridRowSelectionApi';
|
|
9
9
|
export * from './gridSortApi';
|
|
10
10
|
export type { GridStateApi } from './gridStateApi';
|
|
11
|
-
export
|
|
11
|
+
export type { GridLocaleText, GridLocaleTextApi, GridTranslationKeys } from './gridLocaleTextApi';
|
|
12
12
|
export * from './gridCsvExportApi';
|
|
13
13
|
export type { GridFocusApi } from './gridFocusApi';
|
|
14
14
|
export * from './gridFilterApi';
|
package/models/api/index.js
CHANGED
|
@@ -4,7 +4,6 @@ export * from './gridDensityApi';
|
|
|
4
4
|
export * from './gridRowApi';
|
|
5
5
|
export * from './gridRowSelectionApi';
|
|
6
6
|
export * from './gridSortApi';
|
|
7
|
-
export * from './gridLocaleTextApi';
|
|
8
7
|
export * from './gridCsvExportApi';
|
|
9
8
|
export * from './gridFilterApi';
|
|
10
9
|
export * from './gridColumnMenuApi';
|
|
@@ -12,7 +12,7 @@ import type { GridColumnVisibilityModel } from '../../hooks/features/columns';
|
|
|
12
12
|
import type { GridStrategyProcessorName } from '../../hooks/core/strategyProcessing';
|
|
13
13
|
import { GridRowEditStartParams, GridRowEditStopParams } from '../params/gridRowParams';
|
|
14
14
|
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
15
|
-
import { GridPaginationModel } from '../gridPaginationProps';
|
|
15
|
+
import { GridPaginationMeta, GridPaginationModel } from '../gridPaginationProps';
|
|
16
16
|
import { GridDensity } from '../gridDensity';
|
|
17
17
|
export interface GridRowEventLookup {
|
|
18
18
|
/**
|
|
@@ -382,6 +382,12 @@ export interface GridControlledStateEventLookup {
|
|
|
382
382
|
densityChange: {
|
|
383
383
|
params: GridDensity;
|
|
384
384
|
};
|
|
385
|
+
/**
|
|
386
|
+
* Fired when the pagination meta change.
|
|
387
|
+
*/
|
|
388
|
+
paginationMetaChange: {
|
|
389
|
+
params: GridPaginationMeta;
|
|
390
|
+
};
|
|
385
391
|
}
|
|
386
392
|
export interface GridControlledStateReasonLookup {
|
|
387
393
|
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
|