@mui/x-data-grid 5.6.0 → 5.6.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 +43 -0
- package/DataGrid/DataGrid.js +18 -3
- package/DataGrid/useDataGridComponent.js +19 -15
- package/DataGrid/useDataGridProps.js +3 -2
- package/colDef/gridNumericOperators.d.ts +1 -1
- package/colDef/gridNumericOperators.js +1 -1
- package/components/ErrorBoundary.d.ts +2 -2
- package/components/GridRow.js +29 -3
- package/components/base/GridErrorHandler.d.ts +8 -2
- package/components/base/GridErrorHandler.js +13 -2
- package/components/cell/GridBooleanCell.d.ts +2 -1
- package/components/cell/GridCell.js +4 -2
- package/components/cell/GridEditBooleanCell.d.ts +2 -1
- package/components/cell/GridEditDateCell.d.ts +2 -1
- package/components/cell/GridEditInputCell.d.ts +2 -1
- package/components/cell/GridEditSingleSelectCell.d.ts +2 -1
- package/components/cell/GridEditSingleSelectCell.js +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/components/containers/GridRootStyles.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
- package/components/panel/filterPanel/filterPanelUtils.d.ts +2 -2
- package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
- package/constants/gridClasses.d.ts +5 -1
- package/constants/gridClasses.js +1 -1
- package/context/GridContextProvider.d.ts +9 -6
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -0
- package/hooks/features/columnMenu/useGridColumnMenu.js +6 -7
- package/hooks/features/columns/gridColumnsSelector.d.ts +8 -8
- package/hooks/features/columns/gridColumnsSelector.js +11 -10
- package/hooks/features/columns/gridColumnsUtils.js +7 -5
- package/hooks/features/density/useGridDensity.d.ts +2 -0
- package/hooks/features/density/useGridDensity.js +3 -4
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editRows/useGridEditing.d.ts +2 -0
- package/hooks/features/editRows/useGridEditing.js +3 -4
- package/hooks/features/export/serializers/csvSerializer.js +4 -4
- package/hooks/features/filter/gridFilterSelector.d.ts +1 -0
- package/hooks/features/filter/gridFilterSelector.js +1 -0
- package/hooks/features/focus/useGridFocus.d.ts +2 -0
- package/hooks/features/focus/useGridFocus.js +10 -11
- package/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
- package/hooks/features/pagination/useGridPage.d.ts +1 -2
- package/hooks/features/pagination/useGridPage.js +5 -17
- package/hooks/features/pagination/useGridPageSize.d.ts +1 -2
- package/hooks/features/pagination/useGridPageSize.js +5 -26
- package/hooks/features/pagination/useGridPagination.d.ts +2 -0
- package/hooks/features/pagination/useGridPagination.js +25 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +3 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +10 -11
- package/hooks/features/rows/useGridParamsApi.js +3 -10
- package/hooks/features/rows/useGridRows.js +14 -6
- package/hooks/features/rows/useGridRowsMeta.d.ts +3 -1
- package/hooks/features/rows/useGridRowsMeta.js +42 -24
- package/hooks/features/selection/gridSelectionSelector.d.ts +1 -1
- package/hooks/features/selection/useGridSelection.d.ts +2 -0
- package/hooks/features/selection/useGridSelection.js +28 -16
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/hooks/utils/useGridApi.js +10 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -1
- package/hooks/utils/useGridSelector.js +4 -4
- package/hooks/utils/useGridState.js +10 -1
- package/hooks/utils/{useCurrentPageRows.d.ts → useGridVisibleRows.d.ts} +7 -6
- package/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
- package/index.js +1 -1
- package/internals/index.d.ts +9 -12
- package/internals/index.js +9 -12
- package/legacy/DataGrid/DataGrid.js +18 -3
- package/legacy/DataGrid/useDataGridComponent.js +19 -15
- package/legacy/DataGrid/useDataGridProps.js +8 -2
- package/legacy/colDef/gridNumericOperators.js +1 -1
- package/legacy/components/GridRow.js +30 -3
- package/legacy/components/base/GridErrorHandler.js +13 -2
- package/legacy/components/cell/GridCell.js +4 -2
- package/legacy/components/cell/GridEditSingleSelectCell.js +10 -9
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/legacy/components/containers/GridRootStyles.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +29 -26
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +8 -9
- package/legacy/hooks/features/columns/gridColumnsSelector.js +13 -12
- package/legacy/hooks/features/columns/gridColumnsUtils.js +7 -5
- package/legacy/hooks/features/density/useGridDensity.js +5 -6
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/legacy/hooks/features/editRows/useGridEditing.js +5 -6
- package/legacy/hooks/features/export/serializers/csvSerializer.js +4 -4
- package/legacy/hooks/features/filter/gridFilterSelector.js +1 -0
- package/legacy/hooks/features/focus/useGridFocus.js +12 -13
- package/legacy/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
- package/legacy/hooks/features/pagination/useGridPage.js +5 -17
- package/legacy/hooks/features/pagination/useGridPageSize.js +5 -26
- package/legacy/hooks/features/pagination/useGridPagination.js +25 -2
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +10 -11
- package/legacy/hooks/features/rows/useGridParamsApi.js +3 -10
- package/legacy/hooks/features/rows/useGridRows.js +17 -6
- package/legacy/hooks/features/rows/useGridRowsMeta.js +44 -26
- package/legacy/hooks/features/selection/useGridSelection.js +29 -19
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/legacy/hooks/utils/useGridApi.js +7 -0
- package/legacy/hooks/utils/useGridSelector.js +4 -4
- package/legacy/hooks/utils/useGridState.js +7 -0
- package/legacy/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +9 -12
- package/legacy/models/colDef/gridDefaultColumnTypes.js +4 -4
- package/legacy/utils/createSelector.js +4 -4
- package/legacy/utils/getGridLocalization.js +2 -2
- package/lib/lodash/_baseGetAllKeys.d.ts +1 -1
- package/lib/lodash/_baseIsEqual.d.ts +1 -1
- package/lib/lodash/_baseIsEqualDeep.d.ts +1 -1
- package/lib/lodash/_baseKeys.d.ts +1 -1
- package/lib/lodash/_cacheHas.d.ts +1 -1
- package/lib/lodash/_equalArrays.d.ts +1 -1
- package/lib/lodash/_equalByTag.d.ts +1 -1
- package/lib/lodash/_equalObjects.d.ts +1 -1
- package/lib/lodash/_getAllKeys.d.ts +1 -1
- package/lib/lodash/_getMapData.d.ts +1 -1
- package/lib/lodash/_getNative.d.ts +1 -1
- package/lib/lodash/_getValue.d.ts +1 -1
- package/lib/lodash/_hashSet.d.ts +1 -1
- package/lib/lodash/_listCacheSet.d.ts +1 -1
- package/lib/lodash/_mapCacheSet.d.ts +1 -1
- package/lib/lodash/_mapToArray.d.ts +1 -1
- package/lib/lodash/_setCacheAdd.d.ts +1 -1
- package/lib/lodash/_setToArray.d.ts +1 -1
- package/lib/lodash/_stackSet.d.ts +1 -1
- package/lib/lodash/keys.d.ts +1 -1
- package/models/api/gridRowApi.d.ts +6 -0
- package/models/api/gridRowsMetaApi.d.ts +7 -0
- package/models/api/gridSortApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +1 -2
- package/models/colDef/gridDefaultColumnTypes.js +2 -2
- package/models/gridRows.d.ts +8 -2
- package/models/params/gridRowParams.d.ts +29 -1
- package/models/props/DataGridProps.d.ts +20 -4
- package/modern/DataGrid/DataGrid.js +18 -3
- package/modern/DataGrid/useDataGridComponent.js +19 -15
- package/modern/DataGrid/useDataGridProps.js +3 -2
- package/modern/colDef/gridNumericOperators.js +1 -1
- package/modern/components/GridRow.js +29 -3
- package/modern/components/base/GridErrorHandler.js +13 -2
- package/modern/components/cell/GridCell.js +2 -2
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -1
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/modern/components/containers/GridRootStyles.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +6 -7
- package/modern/hooks/features/columns/gridColumnsSelector.js +11 -10
- package/modern/hooks/features/columns/gridColumnsUtils.js +7 -5
- package/modern/hooks/features/density/useGridDensity.js +3 -4
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editRows/useGridEditing.js +3 -4
- package/modern/hooks/features/export/serializers/csvSerializer.js +4 -4
- package/modern/hooks/features/filter/gridFilterSelector.js +1 -0
- package/modern/hooks/features/focus/useGridFocus.js +10 -11
- package/modern/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
- package/modern/hooks/features/pagination/useGridPage.js +1 -9
- package/modern/hooks/features/pagination/useGridPageSize.js +1 -20
- package/modern/hooks/features/pagination/useGridPagination.js +23 -2
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +6 -7
- package/modern/hooks/features/rows/useGridParamsApi.js +3 -10
- package/modern/hooks/features/rows/useGridRows.js +14 -6
- package/modern/hooks/features/rows/useGridRowsMeta.js +36 -24
- package/modern/hooks/features/selection/useGridSelection.js +24 -16
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/modern/hooks/utils/useGridApi.js +10 -1
- package/modern/hooks/utils/useGridSelector.js +4 -4
- package/modern/hooks/utils/useGridState.js +10 -1
- package/modern/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
- package/modern/index.js +1 -1
- package/modern/internals/index.js +9 -12
- package/modern/models/colDef/gridDefaultColumnTypes.js +2 -2
- package/modern/utils/createSelector.js +4 -4
- package/modern/utils/getGridLocalization.js +1 -1
- package/node/DataGrid/DataGrid.js +18 -3
- package/node/DataGrid/useDataGridComponent.js +11 -9
- package/node/DataGrid/useDataGridProps.js +3 -2
- package/node/colDef/gridNumericOperators.js +1 -1
- package/node/components/GridRow.js +28 -3
- package/node/components/base/GridErrorHandler.js +11 -1
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/cell/GridEditSingleSelectCell.js +2 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/node/components/containers/GridRootStyles.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +10 -8
- package/node/hooks/features/columns/gridColumnsSelector.js +11 -9
- package/node/hooks/features/columns/gridColumnsUtils.js +7 -5
- package/node/hooks/features/density/useGridDensity.js +7 -6
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editRows/useGridEditing.js +8 -5
- package/node/hooks/features/export/serializers/csvSerializer.js +5 -4
- package/node/hooks/features/filter/gridFilterSelector.js +1 -0
- package/node/hooks/features/focus/useGridFocus.js +15 -13
- package/node/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
- package/node/hooks/features/pagination/useGridPage.js +7 -20
- package/node/hooks/features/pagination/useGridPageSize.js +6 -26
- package/node/hooks/features/pagination/useGridPagination.js +31 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +15 -13
- package/node/hooks/features/rows/useGridParamsApi.js +4 -10
- package/node/hooks/features/rows/useGridRows.js +15 -6
- package/node/hooks/features/rows/useGridRowsMeta.js +47 -26
- package/node/hooks/features/selection/useGridSelection.js +32 -18
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/node/hooks/utils/useGridApi.js +11 -1
- package/node/hooks/utils/useGridSelector.js +6 -4
- package/node/hooks/utils/useGridState.js +11 -1
- package/node/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +11 -10
- package/node/index.js +1 -1
- package/node/internals/index.js +45 -21
- package/node/models/colDef/gridDefaultColumnTypes.js +2 -2
- package/node/utils/createSelector.js +5 -4
- package/node/utils/getGridLocalization.js +2 -2
- package/package.json +2 -2
- package/utils/createSelector.js +4 -4
- package/utils/getGridLocalization.d.ts +2 -1
- package/utils/getGridLocalization.js +2 -2
- package/utils/keyboardUtils.d.ts +1 -1
- package/utils/warning.d.ts +1 -1
- package/hooks/utils/useGridStateInit.d.ts +0 -7
- package/hooks/utils/useGridStateInit.js +0 -9
- package/legacy/hooks/utils/useGridStateInit.js +0 -9
- package/modern/hooks/utils/useGridStateInit.js +0 -9
- package/node/hooks/utils/useGridStateInit.js +0 -23
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
4
4
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
5
5
|
import { useGridSelector } from '../../utils/useGridSelector';
|
|
6
6
|
import { gridDensityRowHeightSelector, gridDensityFactorSelector } from '../density/densitySelector';
|
|
7
7
|
import { gridFilterStateSelector } from '../filter/gridFilterSelector';
|
|
8
8
|
import { gridPaginationSelector } from '../pagination/gridPaginationSelector';
|
|
9
9
|
import { gridSortingStateSelector } from '../sorting/gridSortingSelector';
|
|
10
|
-
import { useGridStateInit } from '../../utils/useGridStateInit';
|
|
11
10
|
import { GridEvents } from '../../../models/events/gridEvents';
|
|
12
11
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
12
|
+
export var rowsMetaStateInitializer = function rowsMetaStateInitializer(state) {
|
|
13
|
+
return _extends({}, state, {
|
|
14
|
+
rowsMeta: {
|
|
15
|
+
currentPageTotalHeight: 0,
|
|
16
|
+
positions: []
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
13
20
|
/**
|
|
14
21
|
* @requires useGridPageSize (method)
|
|
15
22
|
* @requires useGridPage (method)
|
|
@@ -17,33 +24,19 @@ import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
|
17
24
|
|
|
18
25
|
export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
19
26
|
var getRowHeight = props.getRowHeight,
|
|
20
|
-
|
|
21
|
-
paginationMode = props.paginationMode;
|
|
27
|
+
getRowSpacing = props.getRowSpacing;
|
|
22
28
|
var rowsHeightLookup = React.useRef({});
|
|
23
29
|
var rowHeight = useGridSelector(apiRef, gridDensityRowHeightSelector);
|
|
24
30
|
var filterState = useGridSelector(apiRef, gridFilterStateSelector);
|
|
25
31
|
var paginationState = useGridSelector(apiRef, gridPaginationSelector);
|
|
26
32
|
var sortingState = useGridSelector(apiRef, gridSortingStateSelector);
|
|
27
|
-
|
|
28
|
-
return _extends({}, state, {
|
|
29
|
-
rowsMeta: {
|
|
30
|
-
currentPageTotalHeight: 0,
|
|
31
|
-
positions: []
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
33
|
+
var currentPage = useGridVisibleRows(apiRef, props);
|
|
35
34
|
var hydrateRowsMeta = React.useCallback(function () {
|
|
36
|
-
var _getCurrentPageRows = getCurrentPageRows(apiRef, {
|
|
37
|
-
pagination: pagination,
|
|
38
|
-
paginationMode: paginationMode
|
|
39
|
-
}),
|
|
40
|
-
rows = _getCurrentPageRows.rows;
|
|
41
|
-
|
|
42
35
|
apiRef.current.setState(function (state) {
|
|
43
36
|
var positions = [];
|
|
44
37
|
var densityFactor = gridDensityFactorSelector(state, apiRef.current.instanceId);
|
|
45
38
|
var currentRowHeight = gridDensityRowHeightSelector(state, apiRef.current.instanceId);
|
|
46
|
-
var currentPageTotalHeight = rows.reduce(function (acc, row) {
|
|
39
|
+
var currentPageTotalHeight = currentPage.rows.reduce(function (acc, row) {
|
|
47
40
|
positions.push(acc);
|
|
48
41
|
var baseRowHeight;
|
|
49
42
|
var isResized = rowsHeightLookup.current[row.id] && rowsHeightLookup.current[row.id].isResized || false;
|
|
@@ -62,17 +55,32 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
|
62
55
|
densityFactor: densityFactor
|
|
63
56
|
}))) != null ? _getRowHeight : currentRowHeight;
|
|
64
57
|
}
|
|
65
|
-
}
|
|
58
|
+
} // We use an object to make simple to check if a height is already added or not
|
|
66
59
|
|
|
67
|
-
|
|
60
|
+
|
|
61
|
+
var initialHeights = {
|
|
68
62
|
base: baseRowHeight
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
if (getRowSpacing) {
|
|
66
|
+
var _spacing$top, _spacing$bottom;
|
|
67
|
+
|
|
68
|
+
var index = apiRef.current.getRowIndexRelativeToVisibleRows(row.id);
|
|
69
|
+
var spacing = getRowSpacing(_extends({}, row, {
|
|
70
|
+
isFirstVisible: index === 0,
|
|
71
|
+
isLastVisible: index === currentPage.rows.length - 1
|
|
72
|
+
}));
|
|
73
|
+
initialHeights.spacingTop = (_spacing$top = spacing.top) != null ? _spacing$top : 0;
|
|
74
|
+
initialHeights.spacingBottom = (_spacing$bottom = spacing.bottom) != null ? _spacing$bottom : 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var sizes = apiRef.current.unstable_applyPreProcessors('rowHeight', initialHeights, row);
|
|
78
|
+
var finalRowHeight = Object.values(sizes).reduce(function (acc2, value) {
|
|
72
79
|
return acc2 + value;
|
|
73
80
|
}, 0);
|
|
74
81
|
rowsHeightLookup.current[row.id] = {
|
|
75
82
|
value: baseRowHeight,
|
|
83
|
+
sizes: sizes,
|
|
76
84
|
isResized: isResized
|
|
77
85
|
};
|
|
78
86
|
return acc + finalRowHeight;
|
|
@@ -85,7 +93,7 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
|
85
93
|
});
|
|
86
94
|
});
|
|
87
95
|
apiRef.current.forceUpdate();
|
|
88
|
-
}, [apiRef,
|
|
96
|
+
}, [apiRef, currentPage.rows, getRowSpacing, getRowHeight]);
|
|
89
97
|
|
|
90
98
|
var getTargetRowHeight = function getTargetRowHeight(rowId) {
|
|
91
99
|
var _rowsHeightLookup$cur;
|
|
@@ -93,10 +101,19 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
|
93
101
|
return ((_rowsHeightLookup$cur = rowsHeightLookup.current[rowId]) == null ? void 0 : _rowsHeightLookup$cur.value) || rowHeight;
|
|
94
102
|
};
|
|
95
103
|
|
|
104
|
+
var getRowInternalSizes = function getRowInternalSizes(rowId) {
|
|
105
|
+
var _rowsHeightLookup$cur2;
|
|
106
|
+
|
|
107
|
+
return (_rowsHeightLookup$cur2 = rowsHeightLookup.current[rowId]) == null ? void 0 : _rowsHeightLookup$cur2.sizes;
|
|
108
|
+
};
|
|
109
|
+
|
|
96
110
|
var setRowHeight = React.useCallback(function (id, height) {
|
|
97
111
|
rowsHeightLookup.current[id] = {
|
|
98
112
|
value: height,
|
|
99
|
-
isResized: true
|
|
113
|
+
isResized: true,
|
|
114
|
+
sizes: _extends({}, rowsHeightLookup.current[id].sizes, {
|
|
115
|
+
base: height
|
|
116
|
+
})
|
|
100
117
|
};
|
|
101
118
|
hydrateRowsMeta();
|
|
102
119
|
}, [hydrateRowsMeta]); // The effect is used to build the rows meta data - currentPageTotalHeight and positions.
|
|
@@ -115,6 +132,7 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
|
115
132
|
useGridApiEventHandler(apiRef, GridEvents.preProcessorRegister, handlePreProcessorRegister);
|
|
116
133
|
var rowsMetaApi = {
|
|
117
134
|
unstable_getRowHeight: getTargetRowHeight,
|
|
135
|
+
unstable_getRowInternalSizes: getRowInternalSizes,
|
|
118
136
|
unstable_setRowHeight: setRowHeight
|
|
119
137
|
};
|
|
120
138
|
useGridApiMethod(apiRef, rowsMetaApi, 'GridRowsMetaApi');
|
|
@@ -11,10 +11,33 @@ import { gridSelectionStateSelector, selectedGridRowsSelector, selectedIdsLookup
|
|
|
11
11
|
import { gridPaginatedVisibleSortedGridRowIdsSelector } from '../pagination';
|
|
12
12
|
import { gridVisibleSortedRowIdsSelector } from '../filter/gridFilterSelector';
|
|
13
13
|
import { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
|
|
14
|
-
import { useGridStateInit } from '../../utils/useGridStateInit';
|
|
15
14
|
import { GridCellModes } from '../../../models/gridEditRowModel';
|
|
16
15
|
import { isKeyboardEvent } from '../../../utils/keyboardUtils';
|
|
17
|
-
import {
|
|
16
|
+
import { getVisibleRows } from '../../utils/useGridVisibleRows';
|
|
17
|
+
|
|
18
|
+
var getSelectionModelPropValue = function getSelectionModelPropValue(selectionModelProp, prevSelectionModel) {
|
|
19
|
+
if (selectionModelProp == null) {
|
|
20
|
+
return selectionModelProp;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (Array.isArray(selectionModelProp)) {
|
|
24
|
+
return selectionModelProp;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (prevSelectionModel && prevSelectionModel[0] === selectionModelProp) {
|
|
28
|
+
return prevSelectionModel;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return [selectionModelProp];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export var selectionStateInitializer = function selectionStateInitializer(state, props) {
|
|
35
|
+
var _getSelectionModelPro;
|
|
36
|
+
|
|
37
|
+
return _extends({}, state, {
|
|
38
|
+
selection: (_getSelectionModelPro = getSelectionModelPropValue(props.selectionModel)) != null ? _getSelectionModelPro : []
|
|
39
|
+
});
|
|
40
|
+
};
|
|
18
41
|
/**
|
|
19
42
|
* @requires useGridRows (state, method)
|
|
20
43
|
* @requires useGridParamsApi (method)
|
|
@@ -23,21 +46,8 @@ import { getCurrentPageRows } from '../../utils/useCurrentPageRows';
|
|
|
23
46
|
export var useGridSelection = function useGridSelection(apiRef, props) {
|
|
24
47
|
var logger = useGridLogger(apiRef, 'useGridSelection');
|
|
25
48
|
var propSelectionModel = React.useMemo(function () {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (Array.isArray(props.selectionModel)) {
|
|
31
|
-
return props.selectionModel;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return [props.selectionModel];
|
|
35
|
-
}, [props.selectionModel]);
|
|
36
|
-
useGridStateInit(apiRef, function (state) {
|
|
37
|
-
return _extends({}, state, {
|
|
38
|
-
selection: propSelectionModel != null ? propSelectionModel : []
|
|
39
|
-
});
|
|
40
|
-
});
|
|
49
|
+
return getSelectionModelPropValue(props.selectionModel, gridSelectionStateSelector(apiRef.current.state));
|
|
50
|
+
}, [apiRef, props.selectionModel]);
|
|
41
51
|
var lastRowToggled = React.useRef(null);
|
|
42
52
|
apiRef.current.unstable_updateControlState({
|
|
43
53
|
stateId: 'selection',
|
|
@@ -350,11 +360,11 @@ export var useGridSelection = function useGridSelection(apiRef, props) {
|
|
|
350
360
|
var currentSelection = gridSelectionStateSelector(apiRef.current.state);
|
|
351
361
|
|
|
352
362
|
if (!canHaveMultipleSelection && currentSelection.length > 1) {
|
|
353
|
-
var
|
|
363
|
+
var _getVisibleRows = getVisibleRows(apiRef, {
|
|
354
364
|
pagination: pagination,
|
|
355
365
|
paginationMode: paginationMode
|
|
356
366
|
}),
|
|
357
|
-
currentPageRows =
|
|
367
|
+
currentPageRows = _getVisibleRows.rows;
|
|
358
368
|
|
|
359
369
|
var currentPageRowsLookup = currentPageRows.reduce(function (acc, _ref4) {
|
|
360
370
|
var id = _ref4.id;
|
|
@@ -11,7 +11,7 @@ import { gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gr
|
|
|
11
11
|
import { gridDensityRowHeightSelector } from '../density/densitySelector';
|
|
12
12
|
import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
|
|
13
13
|
import { gridEditRowsStateSelector } from '../editRows/gridEditRowsSelector';
|
|
14
|
-
import {
|
|
14
|
+
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
15
15
|
import { GridEvents } from '../../../models/events';
|
|
16
16
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
17
17
|
import { clamp } from '../../../utils/utils';
|
|
@@ -57,7 +57,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
57
57
|
var rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);
|
|
58
58
|
var editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
59
59
|
var selectedRowsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);
|
|
60
|
-
var currentPage =
|
|
60
|
+
var currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
61
61
|
var renderZoneRef = React.useRef(null);
|
|
62
62
|
var rootRef = React.useRef(null);
|
|
63
63
|
var handleRef = useForkRef(ref, rootRef);
|
|
@@ -138,7 +138,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
138
138
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
139
139
|
lastIndex: nextRenderContext.lastRowIndex,
|
|
140
140
|
minFirstIndex: 0,
|
|
141
|
-
maxLastIndex: (_currentPage$range = currentPage.range) == null ? void 0 : _currentPage$range.lastRowIndex,
|
|
141
|
+
maxLastIndex: ((_currentPage$range = currentPage.range) == null ? void 0 : _currentPage$range.lastRowIndex) || 0,
|
|
142
142
|
buffer: rootProps.rowBuffer
|
|
143
143
|
}),
|
|
144
144
|
_getRenderableIndexes2 = _slicedToArray(_getRenderableIndexes, 1),
|
|
@@ -297,7 +297,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
297
297
|
firstColumnToRender: firstColumnToRender,
|
|
298
298
|
lastColumnToRender: lastColumnToRender,
|
|
299
299
|
selected: isSelected,
|
|
300
|
-
index: currentPage.range.firstRowIndex +
|
|
300
|
+
index: currentPage.range.firstRowIndex + firstRowToRender + i,
|
|
301
301
|
containerWidth: availableSpace,
|
|
302
302
|
isLastVisible: lastVisibleRowIndex
|
|
303
303
|
}, typeof getRowProps === 'function' ? getRowProps(_id, _model) : {}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.row), _id));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { buildWarning } from '../../utils/warning';
|
|
2
|
+
var deprecationWarning = buildWarning(['MUI: The hook useGridApi is deprecated and will be removed in the next major version.', 'Access the ref content with apiRef.current instead']);
|
|
1
3
|
/**
|
|
2
4
|
* @deprecated Use `apiRef.current` instead.
|
|
3
5
|
*/
|
|
6
|
+
|
|
4
7
|
export var useGridApi = function useGridApi(apiRef) {
|
|
8
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9
|
+
deprecationWarning();
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
return apiRef.current;
|
|
6
13
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { buildWarning } from '../../utils/warning';
|
|
2
2
|
|
|
3
3
|
function isOutputSelector(selector) {
|
|
4
4
|
return selector.cache;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
var stateNotInitializedWarning = buildWarning(['MUI: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
7
8
|
export var useGridSelector = function useGridSelector(apiRef, selector) {
|
|
8
9
|
if (process.env.NODE_ENV !== 'production') {
|
|
9
|
-
if (!
|
|
10
|
-
|
|
11
|
-
console.warn(['MUI: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.'].join('\n'));
|
|
10
|
+
if (!apiRef.current.state) {
|
|
11
|
+
stateNotInitializedWarning();
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { buildWarning } from '../../utils/warning';
|
|
2
|
+
var deprecationWarning = buildWarning(['MUI: The hook useGridState is deprecated and will be removed in the next major version.', 'The two lines below are equivalent', '', 'const [state, setState, forceUpdate] = useGridState(apiRef);', 'const { state, setState, forceUpdate } = apiRef.current']);
|
|
1
3
|
/**
|
|
2
4
|
* @deprecated Use `apiRef.current.state`, `apiRef.current.setState` and `apiRef.current.forceUpdate` instead.
|
|
3
5
|
*/
|
|
6
|
+
|
|
4
7
|
export var useGridState = function useGridState(apiRef) {
|
|
8
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9
|
+
deprecationWarning();
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
return [apiRef.current.state, apiRef.current.setState, apiRef.current.forceUpdate];
|
|
6
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { gridPaginationRowRangeSelector, gridPaginatedVisibleSortedGridRowEntriesSelector } from '../features/pagination/gridPaginationSelector';
|
|
3
3
|
import { gridVisibleSortedRowEntriesSelector } from '../features/filter/gridFilterSelector';
|
|
4
|
-
export var
|
|
4
|
+
export var getVisibleRows = function getVisibleRows(apiRef, props) {
|
|
5
5
|
var rows;
|
|
6
6
|
var range;
|
|
7
7
|
|
|
@@ -27,14 +27,15 @@ export var getCurrentPageRows = function getCurrentPageRows(apiRef, props) {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* - If the
|
|
33
|
-
* - If the row tree
|
|
30
|
+
* Computes the list of rows that are reachable by scroll.
|
|
31
|
+
* Depending on whether pagination is enabled, it will return the rows in the current page.
|
|
32
|
+
* - If the pagination is disabled or in server mode, it equals all the visible rows.
|
|
33
|
+
* - If the row tree has several layers, it contains up to `state.pageSize` top level rows and all their descendants.
|
|
34
|
+
* - If the row tree is flat, it only contains up to `state.pageSize` rows.
|
|
34
35
|
*/
|
|
35
36
|
|
|
36
|
-
export var
|
|
37
|
-
var response =
|
|
37
|
+
export var useGridVisibleRows = function useGridVisibleRows(apiRef, props) {
|
|
38
|
+
var response = getVisibleRows(apiRef, props);
|
|
38
39
|
return React.useMemo(function () {
|
|
39
40
|
return {
|
|
40
41
|
rows: response.rows,
|
package/legacy/index.js
CHANGED
|
@@ -7,25 +7,23 @@ export { useGridRegisterPreProcessor } from '../hooks/core/preProcessing';
|
|
|
7
7
|
export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
8
8
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
|
9
9
|
export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
10
|
-
export { useGridColumnMenu } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
10
|
+
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
11
11
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
12
|
-
export { useGridDensity } from '../hooks/features/density/useGridDensity';
|
|
12
|
+
export { useGridDensity, densityStateInitializer } from '../hooks/features/density/useGridDensity';
|
|
13
13
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
14
14
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
15
15
|
export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
16
16
|
export { useGridRegisterFilteringMethod } from '../hooks/features/filter/useGridRegisterFilteringMethod';
|
|
17
|
-
export { useGridFocus } from '../hooks/features/focus/useGridFocus';
|
|
17
|
+
export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
|
|
18
18
|
export { useGridKeyboard } from '../hooks/features/keyboard/useGridKeyboard';
|
|
19
19
|
export { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
|
|
20
|
-
export { useGridPagination } from '../hooks/features/pagination/useGridPagination';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export { useGridPreferencesPanel } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
|
|
24
|
-
export { useGridEditing } from '../hooks/features/editRows/useGridEditing';
|
|
20
|
+
export { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
|
|
21
|
+
export { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
|
|
22
|
+
export { useGridEditing, editingStateInitializer } from '../hooks/features/editRows/useGridEditing';
|
|
25
23
|
export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
|
|
26
|
-
export { useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
|
|
24
|
+
export { useGridRowsMeta, rowsMetaStateInitializer } from '../hooks/features/rows/useGridRowsMeta';
|
|
27
25
|
export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
28
|
-
export { useGridSelection } from '../hooks/features/selection/useGridSelection';
|
|
26
|
+
export { useGridSelection, selectionStateInitializer } from '../hooks/features/selection/useGridSelection';
|
|
29
27
|
export { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';
|
|
30
28
|
export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
|
|
31
29
|
export { useGridRegisterSortingMethod } from '../hooks/features/sorting/useGridRegisterSortingMethod';
|
|
@@ -34,9 +32,8 @@ export { useGridEvents } from '../hooks/features/events/useGridEvents';
|
|
|
34
32
|
export { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';
|
|
35
33
|
export { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
36
34
|
export { useGridVirtualScroller } from '../hooks/features/virtualization/useGridVirtualScroller';
|
|
37
|
-
export {
|
|
35
|
+
export { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
38
36
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
39
|
-
export { useGridStateInit } from '../hooks/utils/useGridStateInit';
|
|
40
37
|
export { createSelector } from '../utils/createSelector';
|
|
41
38
|
export { findParentElementFromClassName } from '../utils/domUtils';
|
|
42
39
|
export { isNavigationKey } from '../utils/keyboardUtils';
|
|
@@ -7,15 +7,15 @@ import { GRID_SINGLE_SELECT_COL_DEF } from '../../colDef/gridSingleSelectColDef'
|
|
|
7
7
|
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../colDef/gridActionsColDef';
|
|
8
8
|
export var DEFAULT_GRID_COL_TYPE_KEY = '__default__';
|
|
9
9
|
export var getGridDefaultColumnTypes = function getGridDefaultColumnTypes() {
|
|
10
|
-
var
|
|
10
|
+
var _nativeColumnTypes;
|
|
11
|
+
|
|
12
|
+
var nativeColumnTypes = (_nativeColumnTypes = {
|
|
11
13
|
string: GRID_STRING_COL_DEF,
|
|
12
14
|
number: GRID_NUMERIC_COL_DEF,
|
|
13
15
|
date: GRID_DATE_COL_DEF,
|
|
14
16
|
dateTime: GRID_DATETIME_COL_DEF,
|
|
15
17
|
boolean: GRID_BOOLEAN_COL_DEF,
|
|
16
18
|
singleSelect: GRID_SINGLE_SELECT_COL_DEF
|
|
17
|
-
}, GRID_ACTIONS_COLUMN_TYPE, GRID_ACTIONS_COL_DEF);
|
|
18
|
-
|
|
19
|
-
nativeColumnTypes[DEFAULT_GRID_COL_TYPE_KEY] = GRID_STRING_COL_DEF;
|
|
19
|
+
}, _defineProperty(_nativeColumnTypes, GRID_ACTIONS_COLUMN_TYPE, GRID_ACTIONS_COL_DEF), _defineProperty(_nativeColumnTypes, DEFAULT_GRID_COL_TYPE_KEY, GRID_STRING_COL_DEF), _nativeColumnTypes);
|
|
20
20
|
return nativeColumnTypes;
|
|
21
21
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createSelector as reselectCreateSelector } from 'reselect';
|
|
2
|
+
import { buildWarning } from './warning';
|
|
2
3
|
var cache = {};
|
|
3
|
-
var
|
|
4
|
+
var missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);
|
|
4
5
|
export var createSelector = function createSelector() {
|
|
5
6
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6
7
|
args[_key] = arguments[_key];
|
|
@@ -18,9 +19,8 @@ export var createSelector = function createSelector() {
|
|
|
18
19
|
var state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
19
20
|
|
|
20
21
|
if (process.env.NODE_ENV !== 'production') {
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
warnedOnce = true;
|
|
22
|
+
if (cacheKey === 'default') {
|
|
23
|
+
missingInstanceIdWarning();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
export var getGridLocalization = function getGridLocalization(gridTranslations, coreTranslations) {
|
|
3
|
-
var _coreTranslations$com;
|
|
3
|
+
var _coreTranslations$com, _coreTranslations$com2;
|
|
4
4
|
|
|
5
5
|
return {
|
|
6
6
|
components: {
|
|
7
7
|
MuiDataGrid: {
|
|
8
8
|
defaultProps: {
|
|
9
9
|
localeText: _extends({}, gridTranslations, {
|
|
10
|
-
MuiTablePagination: (coreTranslations == null ? void 0 : (_coreTranslations$com = coreTranslations.components) == null ? void 0 : _coreTranslations$com.MuiTablePagination.defaultProps) || {}
|
|
10
|
+
MuiTablePagination: (coreTranslations == null ? void 0 : (_coreTranslations$com = coreTranslations.components) == null ? void 0 : (_coreTranslations$com2 = _coreTranslations$com.MuiTablePagination) == null ? void 0 : _coreTranslations$com2.defaultProps) || {}
|
|
11
11
|
})
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -10,4 +10,4 @@ export default baseGetAllKeys;
|
|
|
10
10
|
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
11
11
|
* @returns {Array} Returns the array of property names and symbols.
|
|
12
12
|
*/
|
|
13
|
-
declare function baseGetAllKeys(object:
|
|
13
|
+
declare function baseGetAllKeys(object: Object, keysFunc: Function, symbolsFunc: Function): any[];
|
|
@@ -13,4 +13,4 @@ export default baseIsEqual;
|
|
|
13
13
|
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
14
14
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
15
15
|
*/
|
|
16
|
-
declare function baseIsEqual(value: any, other: any, bitmask: boolean, customizer?: Function | undefined, stack?:
|
|
16
|
+
declare function baseIsEqual(value: any, other: any, bitmask: boolean, customizer?: Function | undefined, stack?: Object | undefined): boolean;
|
|
@@ -13,4 +13,4 @@ export default baseIsEqualDeep;
|
|
|
13
13
|
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
14
14
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
15
15
|
*/
|
|
16
|
-
declare function baseIsEqualDeep(object:
|
|
16
|
+
declare function baseIsEqualDeep(object: Object, other: Object, bitmask: number, customizer: Function, equalFunc: Function, stack?: Object | undefined): boolean;
|
|
@@ -7,4 +7,4 @@ export default cacheHas;
|
|
|
7
7
|
* @param {string} key The key of the entry to check.
|
|
8
8
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
9
9
|
*/
|
|
10
|
-
declare function cacheHas(cache:
|
|
10
|
+
declare function cacheHas(cache: Object, key: string): boolean;
|
|
@@ -12,4 +12,4 @@ export default equalArrays;
|
|
|
12
12
|
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
13
13
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
14
14
|
*/
|
|
15
|
-
declare function equalArrays(array: any[], other: any[], bitmask: number, customizer: Function, equalFunc: Function, stack:
|
|
15
|
+
declare function equalArrays(array: any[], other: any[], bitmask: number, customizer: Function, equalFunc: Function, stack: Object): boolean;
|
|
@@ -16,4 +16,4 @@ export default equalByTag;
|
|
|
16
16
|
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
17
17
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
18
18
|
*/
|
|
19
|
-
declare function equalByTag(object:
|
|
19
|
+
declare function equalByTag(object: Object, other: Object, tag: string, bitmask: number, customizer: Function, equalFunc: Function, stack: Object): boolean;
|
|
@@ -12,4 +12,4 @@ export default equalObjects;
|
|
|
12
12
|
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
13
13
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
14
14
|
*/
|
|
15
|
-
declare function equalObjects(object:
|
|
15
|
+
declare function equalObjects(object: Object, other: Object, bitmask: number, customizer: Function, equalFunc: Function, stack: Object): boolean;
|
|
@@ -7,4 +7,4 @@ export default getNative;
|
|
|
7
7
|
* @param {string} key The key of the method to get.
|
|
8
8
|
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
9
9
|
*/
|
|
10
|
-
declare function getNative(object:
|
|
10
|
+
declare function getNative(object: Object, key: string): any;
|
package/lib/lodash/_hashSet.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export default stackSet;
|
|
|
9
9
|
* @param {*} value The value to set.
|
|
10
10
|
* @returns {Object} Returns the stack cache instance.
|
|
11
11
|
*/
|
|
12
|
-
declare function stackSet(key: string, value: any):
|
|
12
|
+
declare function stackSet(key: string, value: any): Object;
|
|
13
13
|
declare class stackSet {
|
|
14
14
|
/**
|
|
15
15
|
* Sets the stack `key` to `value`.
|
package/lib/lodash/keys.d.ts
CHANGED
|
@@ -46,4 +46,10 @@ export interface GridRowApi {
|
|
|
46
46
|
* @param {boolean} isExpanded A boolean indicating if the row must be expanded or collapsed.
|
|
47
47
|
*/
|
|
48
48
|
setRowChildrenExpansion: (id: GridRowId, isExpanded: boolean) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the index of a row relative to the rows that are reachable by scroll.
|
|
51
|
+
* @param {GridRowId} id The row id.
|
|
52
|
+
* @returns {number} The index of the row.
|
|
53
|
+
*/
|
|
54
|
+
getRowIndexRelativeToVisibleRows: (id: GridRowId) => number;
|
|
49
55
|
}
|
|
@@ -10,6 +10,13 @@ export interface GridRowsMetaApi {
|
|
|
10
10
|
* @ignore - do not document.
|
|
11
11
|
*/
|
|
12
12
|
unstable_getRowHeight: (id: GridRowId) => number;
|
|
13
|
+
/**
|
|
14
|
+
* Gets all sizes that compose the total height that the given row takes.
|
|
15
|
+
* @param {GridRowId} id The id of the row.
|
|
16
|
+
* @returns {Record<string, number>} The object containing the sizes.
|
|
17
|
+
* @ignore - do not document.
|
|
18
|
+
*/
|
|
19
|
+
unstable_getRowInternalSizes: (id: GridRowId) => Record<string, number> | undefined;
|
|
13
20
|
/**
|
|
14
21
|
* Updates the base height of a row.
|
|
15
22
|
* @param {GridRowId} id The id of the row.
|
|
@@ -48,6 +48,7 @@ export interface GridSortApi {
|
|
|
48
48
|
* The index is based on the sorted but unfiltered row list.
|
|
49
49
|
* @param {GridRowId} id The `GridRowId` of the row.
|
|
50
50
|
* @returns {number} The index of the row.
|
|
51
|
+
* @deprecated Use `getRowIndexRelativeToVisibleRows` instead.
|
|
51
52
|
*/
|
|
52
53
|
getRowIndex: (id: GridRowId) => number;
|
|
53
54
|
}
|