@mui/x-data-grid 8.0.0-alpha.2 → 8.0.0-alpha.3
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 +102 -0
- package/DataGrid/DataGrid.js +0 -8
- package/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/constants/dataGridPropsDefaultValues.js +0 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +3 -6
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridRowEditing.js +3 -3
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
- package/hooks/features/rows/gridRowsSelector.d.ts +0 -1
- package/hooks/features/rows/gridRowsSelector.js +0 -1
- package/hooks/features/rows/gridRowsUtils.js +0 -9
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.js +12 -14
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/locales/heIL.js +14 -16
- package/locales/trTR.js +12 -14
- package/models/events/gridEventLookup.d.ts +1 -0
- package/models/gridDataSource.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +0 -8
- package/modern/DataGrid/DataGrid.js +0 -8
- package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/modern/constants/dataGridPropsDefaultValues.js +0 -1
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -3
- package/modern/hooks/features/rows/gridRowsSelector.js +0 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -9
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +12 -14
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/heIL.js +14 -16
- package/modern/locales/trTR.js +12 -14
- package/node/DataGrid/DataGrid.js +0 -8
- package/node/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/node/constants/dataGridPropsDefaultValues.js +0 -1
- package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +1 -2
- package/node/hooks/features/rows/gridRowsUtils.js +0 -9
- package/node/hooks/features/rows/index.js +0 -7
- package/node/hooks/features/rows/useGridRows.js +11 -13
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/locales/heIL.js +14 -16
- package/node/locales/trTR.js +12 -14
- package/package.json +1 -1
|
@@ -64,10 +64,13 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = /*#__PURE__*/React.forwa
|
|
|
64
64
|
// Convert to an object to make O(1) checking if a row exists or not
|
|
65
65
|
// TODO create selector that returns visibleRowIds/paginatedVisibleRowIds as an object
|
|
66
66
|
return rowIds.reduce((acc, id) => {
|
|
67
|
+
if (!apiRef.current.isRowSelectable(id)) {
|
|
68
|
+
return acc;
|
|
69
|
+
}
|
|
67
70
|
acc[id] = true;
|
|
68
71
|
return acc;
|
|
69
72
|
}, {});
|
|
70
|
-
}, [rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);
|
|
73
|
+
}, [apiRef, rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);
|
|
71
74
|
|
|
72
75
|
// Amount of rows selected and that are visible in the current page
|
|
73
76
|
const currentSelectionSize = React.useMemo(() => filteredSelection.filter(id => selectionCandidates[id]).length, [filteredSelection, selectionCandidates]);
|
|
@@ -2,4 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.GridStrategyGroup = void 0;
|
|
7
|
+
let GridStrategyGroup = exports.GridStrategyGroup = /*#__PURE__*/function (GridStrategyGroup) {
|
|
8
|
+
GridStrategyGroup["DataSource"] = "dataSource";
|
|
9
|
+
GridStrategyGroup["RowTree"] = "rowTree";
|
|
10
|
+
return GridStrategyGroup;
|
|
11
|
+
}({});
|
|
@@ -9,13 +9,15 @@ exports.useGridStrategyProcessing = exports.GRID_STRATEGIES_PROCESSORS = exports
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _toPropertyKey2 = _interopRequireDefault(require("@babel/runtime/helpers/toPropertyKey"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _gridStrategyProcessingApi = require("./gridStrategyProcessingApi");
|
|
12
13
|
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
13
14
|
const GRID_DEFAULT_STRATEGY = exports.GRID_DEFAULT_STRATEGY = 'none';
|
|
14
15
|
const GRID_STRATEGIES_PROCESSORS = exports.GRID_STRATEGIES_PROCESSORS = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
dataSourceRowsUpdate: _gridStrategyProcessingApi.GridStrategyGroup.DataSource,
|
|
17
|
+
rowTreeCreation: _gridStrategyProcessingApi.GridStrategyGroup.RowTree,
|
|
18
|
+
filtering: _gridStrategyProcessingApi.GridStrategyGroup.RowTree,
|
|
19
|
+
sorting: _gridStrategyProcessingApi.GridStrategyGroup.RowTree,
|
|
20
|
+
visibleRowsLookupCreation: _gridStrategyProcessingApi.GridStrategyGroup.RowTree
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -52,10 +54,7 @@ const GRID_STRATEGIES_PROCESSORS = exports.GRID_STRATEGIES_PROCESSORS = {
|
|
|
52
54
|
* =====================================================================================================================
|
|
53
55
|
*
|
|
54
56
|
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
55
|
-
*
|
|
56
|
-
* - row tree creation algorithm.
|
|
57
|
-
* - sorting algorithm.
|
|
58
|
-
* - filtering algorithm.
|
|
57
|
+
* There are two active groups named `rowTree` and `dataSource`.
|
|
59
58
|
*/
|
|
60
59
|
const useGridStrategyProcessing = apiRef => {
|
|
61
60
|
const availableStrategies = React.useRef(new Map());
|
|
@@ -500,7 +500,8 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
500
500
|
const widthByField = extractColumnWidths(apiRef, options, columns);
|
|
501
501
|
const newColumns = columns.map(column => (0, _extends2.default)({}, column, {
|
|
502
502
|
width: widthByField[column.field],
|
|
503
|
-
computedWidth: widthByField[column.field]
|
|
503
|
+
computedWidth: widthByField[column.field],
|
|
504
|
+
flex: 0
|
|
504
505
|
}));
|
|
505
506
|
if (options.expand) {
|
|
506
507
|
const visibleColumns = state.orderedFields.map(field => state.lookup[field]).filter(c => state.columnVisibilityModel[c.field] !== false);
|
|
@@ -450,7 +450,7 @@ const useGridCellEditing = (apiRef, props) => {
|
|
|
450
450
|
|
|
451
451
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
452
452
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
453
|
-
const
|
|
453
|
+
const rowsLookup = (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef);
|
|
454
454
|
|
|
455
455
|
// Update the ref here because updateStateToStopCellEditMode may change it later
|
|
456
456
|
const copyOfPrevCellModes = prevCellModesModel.current;
|
|
@@ -459,7 +459,7 @@ const useGridCellEditing = (apiRef, props) => {
|
|
|
459
459
|
Object.entries(cellModesModel).forEach(([id, fields]) => {
|
|
460
460
|
Object.entries(fields).forEach(([field, params]) => {
|
|
461
461
|
const prevMode = copyOfPrevCellModes[id]?.[field]?.mode || _gridEditRowModel.GridCellModes.View;
|
|
462
|
-
const originalId =
|
|
462
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
463
463
|
if (params.mode === _gridEditRowModel.GridCellModes.Edit && prevMode === _gridEditRowModel.GridCellModes.View) {
|
|
464
464
|
updateStateToStartCellEditMode((0, _extends2.default)({
|
|
465
465
|
id: originalId,
|
|
@@ -579,7 +579,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
579
579
|
|
|
580
580
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
581
581
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
582
|
-
const
|
|
582
|
+
const rowsLookup = (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef);
|
|
583
583
|
|
|
584
584
|
// Update the ref here because updateStateToStopRowEditMode may change it later
|
|
585
585
|
const copyOfPrevRowModesModel = prevRowModesModel.current;
|
|
@@ -591,7 +591,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
591
591
|
mode: _gridEditRowModel.GridRowModes.View
|
|
592
592
|
};
|
|
593
593
|
const prevMode = copyOfPrevRowModesModel[id]?.mode || _gridEditRowModel.GridRowModes.View;
|
|
594
|
-
const originalId =
|
|
594
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
595
595
|
if (params.mode === _gridEditRowModel.GridRowModes.Edit && prevMode === _gridEditRowModel.GridRowModes.View) {
|
|
596
596
|
updateStateToStartRowEditMode((0, _extends2.default)({
|
|
597
597
|
id: originalId
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.gridTopLevelRowCountSelector = exports.gridRowsLookupSelector = exports.gridRowsLoadingSelector = exports.
|
|
6
|
+
exports.gridTopLevelRowCountSelector = exports.gridRowsLookupSelector = exports.gridRowsLoadingSelector = exports.gridRowTreeSelector = exports.gridRowTreeDepthsSelector = exports.gridRowMaximumTreeDepthSelector = exports.gridRowGroupsToFetchSelector = exports.gridRowGroupingNameSelector = exports.gridRowCountSelector = exports.gridPinnedRowsSelector = exports.gridPinnedRowsCountSelector = exports.gridDataRowIdsSelector = exports.gridAdditionalRowGroupsSelector = void 0;
|
|
7
7
|
var _createSelector = require("../../../utils/createSelector");
|
|
8
8
|
const gridRowsStateSelector = state => state.rows;
|
|
9
9
|
const gridRowCountSelector = exports.gridRowCountSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.totalRowCount);
|
|
@@ -12,7 +12,6 @@ const gridTopLevelRowCountSelector = exports.gridTopLevelRowCountSelector = (0,
|
|
|
12
12
|
|
|
13
13
|
// TODO rows v6: Rename
|
|
14
14
|
const gridRowsLookupSelector = exports.gridRowsLookupSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);
|
|
15
|
-
const gridRowsDataRowIdToIdLookupSelector = exports.gridRowsDataRowIdToIdLookupSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);
|
|
16
15
|
const gridRowTreeSelector = exports.gridRowTreeSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.tree);
|
|
17
16
|
const gridRowGroupsToFetchSelector = exports.gridRowGroupsToFetchSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.groupsToFetch);
|
|
18
17
|
const gridRowGroupingNameSelector = exports.gridRowGroupingNameSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.groupingName);
|
|
@@ -55,12 +55,10 @@ const createRowsInternalCache = ({
|
|
|
55
55
|
rows: []
|
|
56
56
|
};
|
|
57
57
|
const dataRowIdToModelLookup = {};
|
|
58
|
-
const dataRowIdToIdLookup = {};
|
|
59
58
|
for (let i = 0; i < rows.length; i += 1) {
|
|
60
59
|
const model = rows[i];
|
|
61
60
|
const id = getRowIdFromRowModel(model, getRowId);
|
|
62
61
|
dataRowIdToModelLookup[id] = model;
|
|
63
|
-
dataRowIdToIdLookup[id] = id;
|
|
64
62
|
updates.rows.push(id);
|
|
65
63
|
}
|
|
66
64
|
return {
|
|
@@ -68,7 +66,6 @@ const createRowsInternalCache = ({
|
|
|
68
66
|
loadingPropBeforePartialUpdates: loading,
|
|
69
67
|
rowCountPropBeforePartialUpdates: rowCount,
|
|
70
68
|
updates,
|
|
71
|
-
dataRowIdToIdLookup,
|
|
72
69
|
dataRowIdToModelLookup
|
|
73
70
|
};
|
|
74
71
|
};
|
|
@@ -102,7 +99,6 @@ const getRowsStateFromCache = ({
|
|
|
102
99
|
previousTree,
|
|
103
100
|
previousTreeDepths,
|
|
104
101
|
updates: cache.updates,
|
|
105
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
106
102
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup,
|
|
107
103
|
previousGroupsToFetch
|
|
108
104
|
});
|
|
@@ -111,7 +107,6 @@ const getRowsStateFromCache = ({
|
|
|
111
107
|
const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
112
108
|
tree: unProcessedTree,
|
|
113
109
|
treeDepths: unProcessedTreeDepths,
|
|
114
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
115
110
|
dataRowIds: unProcessedDataRowIds,
|
|
116
111
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
117
112
|
});
|
|
@@ -196,7 +191,6 @@ const updateCacheWithNewRows = ({
|
|
|
196
191
|
groupKeys
|
|
197
192
|
};
|
|
198
193
|
const dataRowIdToModelLookup = (0, _extends2.default)({}, previousCache.dataRowIdToModelLookup);
|
|
199
|
-
const dataRowIdToIdLookup = (0, _extends2.default)({}, previousCache.dataRowIdToIdLookup);
|
|
200
194
|
const alreadyAppliedActionsToRemove = {
|
|
201
195
|
insert: {},
|
|
202
196
|
modify: {},
|
|
@@ -229,7 +223,6 @@ const updateCacheWithNewRows = ({
|
|
|
229
223
|
// Remove the data row from the lookups and add it to the "delete" update.
|
|
230
224
|
partialUpdates.actions.remove.push(id);
|
|
231
225
|
delete dataRowIdToModelLookup[id];
|
|
232
|
-
delete dataRowIdToIdLookup[id];
|
|
233
226
|
return;
|
|
234
227
|
}
|
|
235
228
|
const oldRow = dataRowIdToModelLookup[id];
|
|
@@ -269,7 +262,6 @@ const updateCacheWithNewRows = ({
|
|
|
269
262
|
|
|
270
263
|
// Update the data row lookups.
|
|
271
264
|
dataRowIdToModelLookup[id] = partialRow;
|
|
272
|
-
dataRowIdToIdLookup[id] = id;
|
|
273
265
|
});
|
|
274
266
|
const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);
|
|
275
267
|
for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {
|
|
@@ -281,7 +273,6 @@ const updateCacheWithNewRows = ({
|
|
|
281
273
|
}
|
|
282
274
|
return {
|
|
283
275
|
dataRowIdToModelLookup,
|
|
284
|
-
dataRowIdToIdLookup,
|
|
285
276
|
updates: partialUpdates,
|
|
286
277
|
rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,
|
|
287
278
|
loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,
|
|
@@ -8,7 +8,6 @@ var _exportNames = {
|
|
|
8
8
|
gridRowsLoadingSelector: true,
|
|
9
9
|
gridTopLevelRowCountSelector: true,
|
|
10
10
|
gridRowsLookupSelector: true,
|
|
11
|
-
gridRowsDataRowIdToIdLookupSelector: true,
|
|
12
11
|
gridRowTreeSelector: true,
|
|
13
12
|
gridRowGroupingNameSelector: true,
|
|
14
13
|
gridRowTreeDepthsSelector: true,
|
|
@@ -66,12 +65,6 @@ Object.defineProperty(exports, "gridRowTreeSelector", {
|
|
|
66
65
|
return _gridRowsSelector.gridRowTreeSelector;
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
|
-
Object.defineProperty(exports, "gridRowsDataRowIdToIdLookupSelector", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function () {
|
|
72
|
-
return _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
68
|
Object.defineProperty(exports, "gridRowsLoadingSelector", {
|
|
76
69
|
enumerable: true,
|
|
77
70
|
get: function () {
|
|
@@ -19,6 +19,7 @@ var _gridSortingSelector = require("../sorting/gridSortingSelector");
|
|
|
19
19
|
var _gridFilterSelector = require("../filter/gridFilterSelector");
|
|
20
20
|
var _gridRowsUtils = require("./gridRowsUtils");
|
|
21
21
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
22
|
+
var _strategyProcessing = require("../../core/strategyProcessing");
|
|
22
23
|
const rowsStateInitializer = (state, props, apiRef) => {
|
|
23
24
|
const isDataSourceAvailable = !!props.unstable_dataSource;
|
|
24
25
|
apiRef.current.caches.rows = (0, _gridRowsUtils.createRowsInternalCache)({
|
|
@@ -281,7 +282,6 @@ const useGridRows = (apiRef, props) => {
|
|
|
281
282
|
}
|
|
282
283
|
const tree = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowTreeSelector)(apiRef));
|
|
283
284
|
const dataRowIdToModelLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef));
|
|
284
|
-
const dataRowIdToIdLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef));
|
|
285
285
|
const rootGroup = tree[_gridRowsUtils.GRID_ROOT_GROUP_ID];
|
|
286
286
|
const rootGroupChildren = [...rootGroup.children];
|
|
287
287
|
const seenIds = new Set();
|
|
@@ -291,7 +291,6 @@ const useGridRows = (apiRef, props) => {
|
|
|
291
291
|
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
292
292
|
if (!seenIds.has(removedRowId)) {
|
|
293
293
|
delete dataRowIdToModelLookup[removedRowId];
|
|
294
|
-
delete dataRowIdToIdLookup[removedRowId];
|
|
295
294
|
delete tree[removedRowId];
|
|
296
295
|
}
|
|
297
296
|
const rowTreeNodeConfig = {
|
|
@@ -302,7 +301,6 @@ const useGridRows = (apiRef, props) => {
|
|
|
302
301
|
groupingKey: null
|
|
303
302
|
};
|
|
304
303
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
305
|
-
dataRowIdToIdLookup[rowId] = rowId;
|
|
306
304
|
tree[rowId] = rowTreeNodeConfig;
|
|
307
305
|
seenIds.add(rowId);
|
|
308
306
|
}
|
|
@@ -313,17 +311,17 @@ const useGridRows = (apiRef, props) => {
|
|
|
313
311
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
314
312
|
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
315
313
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
316
|
-
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
317
314
|
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
318
315
|
rows: (0, _extends2.default)({}, state.rows, {
|
|
316
|
+
loading: props.loading,
|
|
317
|
+
totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
|
|
319
318
|
dataRowIdToModelLookup,
|
|
320
|
-
dataRowIdToIdLookup,
|
|
321
319
|
dataRowIds,
|
|
322
320
|
tree
|
|
323
321
|
})
|
|
324
322
|
}));
|
|
325
323
|
apiRef.current.publishEvent('rowsSet');
|
|
326
|
-
}, [apiRef, props.signature, props.getRowId]);
|
|
324
|
+
}, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
|
|
327
325
|
const rowApi = {
|
|
328
326
|
getRow,
|
|
329
327
|
setLoading,
|
|
@@ -390,7 +388,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
390
388
|
const handleStrategyActivityChange = React.useCallback(() => {
|
|
391
389
|
// `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
|
|
392
390
|
// All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
|
|
393
|
-
if (apiRef.current.getActiveStrategy(
|
|
391
|
+
if (apiRef.current.getActiveStrategy(_strategyProcessing.GridStrategyGroup.RowTree) !== (0, _gridRowsSelector.gridRowGroupingNameSelector)(apiRef)) {
|
|
394
392
|
groupRows();
|
|
395
393
|
}
|
|
396
394
|
}, [apiRef, groupRows]);
|
|
@@ -406,8 +404,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
406
404
|
tree: (0, _gridRowsSelector.gridRowTreeSelector)(state, apiRef.current.instanceId),
|
|
407
405
|
treeDepths: (0, _gridRowsSelector.gridRowTreeDepthsSelector)(state, apiRef.current.instanceId),
|
|
408
406
|
dataRowIds: (0, _gridRowsSelector.gridDataRowIdsSelector)(state, apiRef.current.instanceId),
|
|
409
|
-
dataRowIdToModelLookup: (0, _gridRowsSelector.gridRowsLookupSelector)(state, apiRef.current.instanceId)
|
|
410
|
-
dataRowIdToIdLookup: (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(state, apiRef.current.instanceId)
|
|
407
|
+
dataRowIdToModelLookup: (0, _gridRowsSelector.gridRowsLookupSelector)(state, apiRef.current.instanceId)
|
|
411
408
|
});
|
|
412
409
|
return (0, _extends2.default)({}, state, {
|
|
413
410
|
rows: (0, _extends2.default)({}, state.rows, response, {
|
|
@@ -439,7 +436,8 @@ const useGridRows = (apiRef, props) => {
|
|
|
439
436
|
isRowCountPropUpdated = true;
|
|
440
437
|
lastRowCount.current = props.rowCount;
|
|
441
438
|
}
|
|
442
|
-
const
|
|
439
|
+
const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
|
|
440
|
+
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
|
|
443
441
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
444
442
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
445
443
|
|
|
@@ -469,16 +467,16 @@ const useGridRows = (apiRef, props) => {
|
|
|
469
467
|
return;
|
|
470
468
|
}
|
|
471
469
|
}
|
|
472
|
-
logger.debug(`Updating all rows, new length ${
|
|
470
|
+
logger.debug(`Updating all rows, new length ${currentRows?.length}`);
|
|
473
471
|
throttledRowsChange({
|
|
474
472
|
cache: (0, _gridRowsUtils.createRowsInternalCache)({
|
|
475
|
-
rows:
|
|
473
|
+
rows: currentRows,
|
|
476
474
|
getRowId: props.getRowId,
|
|
477
475
|
loading: props.loading,
|
|
478
476
|
rowCount: props.rowCount
|
|
479
477
|
}),
|
|
480
478
|
throttle: false
|
|
481
479
|
});
|
|
482
|
-
}, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
|
|
480
|
+
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
|
|
483
481
|
};
|
|
484
482
|
exports.useGridRows = useGridRows;
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var _exportNames = {
|
|
|
14
14
|
getValueOptions: true,
|
|
15
15
|
isSingleSelectColDef: true,
|
|
16
16
|
useGridRegisterPipeProcessor: true,
|
|
17
|
+
GridStrategyGroup: true,
|
|
17
18
|
useGridRegisterStrategyProcessor: true,
|
|
18
19
|
GRID_DEFAULT_STRATEGY: true,
|
|
19
20
|
useGridInitialization: true,
|
|
@@ -141,6 +142,12 @@ Object.defineProperty(exports, "GridHeaders", {
|
|
|
141
142
|
return _GridHeaders.GridHeaders;
|
|
142
143
|
}
|
|
143
144
|
});
|
|
145
|
+
Object.defineProperty(exports, "GridStrategyGroup", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return _strategyProcessing.GridStrategyGroup;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
144
151
|
Object.defineProperty(exports, "GridVirtualScroller", {
|
|
145
152
|
enumerable: true,
|
|
146
153
|
get: function () {
|
package/node/locales/heIL.js
CHANGED
|
@@ -30,16 +30,15 @@ const heILGrid = {
|
|
|
30
30
|
toolbarQuickFilterLabel: 'חיפוש',
|
|
31
31
|
toolbarQuickFilterDeleteIconLabel: 'ניקוי',
|
|
32
32
|
// Prompt toolbar field
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
toolbarPromptControlPlaceholder: 'הקלד ערך…',
|
|
34
|
+
toolbarPromptControlWithRecordingPlaceholder: 'הקלד או הקלט ערך…',
|
|
35
|
+
toolbarPromptControlRecordingPlaceholder: 'ממתין להנחיה…',
|
|
36
|
+
toolbarPromptControlLabel: 'הזן ערך',
|
|
37
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'הקלטה',
|
|
38
|
+
toolbarPromptControlRecordButtonActiveLabel: 'הפסק הקלטה',
|
|
39
|
+
toolbarPromptControlSendActionLabel: 'שלח',
|
|
40
|
+
toolbarPromptControlSendActionAriaLabel: 'שלח ערך',
|
|
41
|
+
toolbarPromptControlErrorMessage: 'התרחשה שגיאה בזמן העיבוד של הבקשה. נסה שוב עם ערך אחר בבקשה.',
|
|
43
42
|
// Export selector toolbar button text
|
|
44
43
|
toolbarExport: 'ייצוא',
|
|
45
44
|
toolbarExportLabel: 'ייצוא',
|
|
@@ -51,8 +50,7 @@ const heILGrid = {
|
|
|
51
50
|
columnsManagementNoColumns: 'אין עמודות',
|
|
52
51
|
columnsManagementShowHideAllText: 'הצג/הסתר הכל',
|
|
53
52
|
columnsManagementReset: 'אתחול',
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
columnsManagementDeleteIconLabel: 'נקה',
|
|
56
54
|
// Filter panel text
|
|
57
55
|
filterPanelAddFilter: 'הוסף מסנן',
|
|
58
56
|
filterPanelRemoveAll: 'מחק הכל',
|
|
@@ -66,9 +64,9 @@ const heILGrid = {
|
|
|
66
64
|
filterPanelInputPlaceholder: 'ערך מסנן',
|
|
67
65
|
// Filter operators text
|
|
68
66
|
filterOperatorContains: 'מכיל',
|
|
69
|
-
|
|
67
|
+
filterOperatorDoesNotContain: 'לא מכיל',
|
|
70
68
|
filterOperatorEquals: 'שווה',
|
|
71
|
-
|
|
69
|
+
filterOperatorDoesNotEqual: 'לא שווה',
|
|
72
70
|
filterOperatorStartsWith: 'מתחיל ב-',
|
|
73
71
|
filterOperatorEndsWith: 'נגמר ב-',
|
|
74
72
|
filterOperatorIs: 'הינו',
|
|
@@ -88,9 +86,9 @@ const heILGrid = {
|
|
|
88
86
|
'filterOperator<=': '<=',
|
|
89
87
|
// Header filter operators text
|
|
90
88
|
headerFilterOperatorContains: 'מכיל',
|
|
91
|
-
|
|
89
|
+
headerFilterOperatorDoesNotContain: 'לא מכיל',
|
|
92
90
|
headerFilterOperatorEquals: 'שווה',
|
|
93
|
-
|
|
91
|
+
headerFilterOperatorDoesNotEqual: 'לא שווה',
|
|
94
92
|
headerFilterOperatorStartsWith: 'מתחיל ב-',
|
|
95
93
|
headerFilterOperatorEndsWith: 'נגמר ב-',
|
|
96
94
|
headerFilterOperatorIs: 'הינו',
|
package/node/locales/trTR.js
CHANGED
|
@@ -30,16 +30,15 @@ const trTRGrid = {
|
|
|
30
30
|
toolbarQuickFilterLabel: 'Ara',
|
|
31
31
|
toolbarQuickFilterDeleteIconLabel: 'Temizle',
|
|
32
32
|
// Prompt toolbar field
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
toolbarPromptControlPlaceholder: 'Bir istem yazın…',
|
|
34
|
+
toolbarPromptControlWithRecordingPlaceholder: 'Bir istem yazın veya kaydedin…',
|
|
35
|
+
toolbarPromptControlRecordingPlaceholder: 'İstem dinleniyor…',
|
|
36
|
+
toolbarPromptControlLabel: 'İstem girişi',
|
|
37
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'Kaydet',
|
|
38
|
+
toolbarPromptControlRecordButtonActiveLabel: 'Kaydı durdur',
|
|
39
|
+
toolbarPromptControlSendActionLabel: 'Gönder',
|
|
40
|
+
toolbarPromptControlSendActionAriaLabel: 'İstemi gönder',
|
|
41
|
+
toolbarPromptControlErrorMessage: 'İstek işlenirken bir hata oluştu. Lütfen farklı bir istemle tekrar deneyin.',
|
|
43
42
|
// Export selector toolbar button text
|
|
44
43
|
toolbarExport: 'Dışa aktar',
|
|
45
44
|
toolbarExportLabel: 'Dışa aktar',
|
|
@@ -51,8 +50,7 @@ const trTRGrid = {
|
|
|
51
50
|
columnsManagementNoColumns: 'Kolon yok',
|
|
52
51
|
columnsManagementShowHideAllText: 'Hepsini Göster/Gizle',
|
|
53
52
|
columnsManagementReset: 'Sıfırla',
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
columnsManagementDeleteIconLabel: 'Temizle',
|
|
56
54
|
// Filter panel text
|
|
57
55
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
58
56
|
filterPanelRemoveAll: 'Hepsini kaldır',
|
|
@@ -66,9 +64,9 @@ const trTRGrid = {
|
|
|
66
64
|
filterPanelInputPlaceholder: 'Filtre değeri',
|
|
67
65
|
// Filter operators text
|
|
68
66
|
filterOperatorContains: 'içerir',
|
|
69
|
-
|
|
67
|
+
filterOperatorDoesNotContain: 'içermiyor',
|
|
70
68
|
filterOperatorEquals: 'eşittir',
|
|
71
|
-
|
|
69
|
+
filterOperatorDoesNotEqual: 'eşit değil',
|
|
72
70
|
filterOperatorStartsWith: 'ile başlar',
|
|
73
71
|
filterOperatorEndsWith: 'ile biter',
|
|
74
72
|
filterOperatorIs: 'eşittir',
|