@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/DataGrid/DataGrid.js +0 -8
  3. package/components/columnSelection/GridHeaderCheckbox.js +4 -1
  4. package/constants/dataGridPropsDefaultValues.js +0 -1
  5. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
  6. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
  7. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +3 -6
  8. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  9. package/hooks/features/columnResize/useGridColumnResize.js +2 -1
  10. package/hooks/features/editing/useGridCellEditing.js +3 -3
  11. package/hooks/features/editing/useGridRowEditing.js +3 -3
  12. package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
  13. package/hooks/features/rows/gridRowsSelector.d.ts +0 -1
  14. package/hooks/features/rows/gridRowsSelector.js +0 -1
  15. package/hooks/features/rows/gridRowsUtils.js +0 -9
  16. package/hooks/features/rows/index.d.ts +1 -1
  17. package/hooks/features/rows/index.js +1 -1
  18. package/hooks/features/rows/useGridRows.js +12 -14
  19. package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
  20. package/index.js +1 -1
  21. package/internals/index.d.ts +1 -1
  22. package/internals/index.js +1 -1
  23. package/locales/heIL.js +14 -16
  24. package/locales/trTR.js +12 -14
  25. package/models/events/gridEventLookup.d.ts +1 -0
  26. package/models/gridDataSource.d.ts +1 -1
  27. package/models/props/DataGridProps.d.ts +0 -8
  28. package/modern/DataGrid/DataGrid.js +0 -8
  29. package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -1
  30. package/modern/constants/dataGridPropsDefaultValues.js +0 -1
  31. package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
  32. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  33. package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
  34. package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
  35. package/modern/hooks/features/editing/useGridRowEditing.js +3 -3
  36. package/modern/hooks/features/rows/gridRowsSelector.js +0 -1
  37. package/modern/hooks/features/rows/gridRowsUtils.js +0 -9
  38. package/modern/hooks/features/rows/index.js +1 -1
  39. package/modern/hooks/features/rows/useGridRows.js +12 -14
  40. package/modern/index.js +1 -1
  41. package/modern/internals/index.js +1 -1
  42. package/modern/locales/heIL.js +14 -16
  43. package/modern/locales/trTR.js +12 -14
  44. package/node/DataGrid/DataGrid.js +0 -8
  45. package/node/components/columnSelection/GridHeaderCheckbox.js +4 -1
  46. package/node/constants/dataGridPropsDefaultValues.js +0 -1
  47. package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
  48. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  49. package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
  50. package/node/hooks/features/editing/useGridCellEditing.js +2 -2
  51. package/node/hooks/features/editing/useGridRowEditing.js +2 -2
  52. package/node/hooks/features/rows/gridRowsSelector.js +1 -2
  53. package/node/hooks/features/rows/gridRowsUtils.js +0 -9
  54. package/node/hooks/features/rows/index.js +0 -7
  55. package/node/hooks/features/rows/useGridRows.js +11 -13
  56. package/node/index.js +1 -1
  57. package/node/internals/index.js +7 -0
  58. package/node/locales/heIL.js +14 -16
  59. package/node/locales/trTR.js +12 -14
  60. 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]);
@@ -51,7 +51,6 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
51
51
  resizeThrottleMs: 60,
52
52
  rowBufferPx: 150,
53
53
  rowHeight: 52,
54
- rowPositionsDebounceMs: 166,
55
54
  rows: [],
56
55
  rowSelection: true,
57
56
  rowSpacingType: 'margin',
@@ -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
- rowTreeCreation: 'rowTree',
16
- filtering: 'rowTree',
17
- sorting: 'rowTree',
18
- visibleRowsLookupCreation: 'rowTree'
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
- * For now, there is only one strategy group named `rowTree` which customize
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 idToIdLookup = (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef);
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 = idToIdLookup[id] ?? id;
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 idToIdLookup = (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef);
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 = idToIdLookup[id] ?? id;
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.gridRowsDataRowIdToIdLookupSelector = exports.gridRowTreeSelector = exports.gridRowTreeDepthsSelector = exports.gridRowMaximumTreeDepthSelector = exports.gridRowGroupsToFetchSelector = exports.gridRowGroupingNameSelector = exports.gridRowCountSelector = exports.gridPinnedRowsSelector = exports.gridPinnedRowsCountSelector = exports.gridDataRowIdsSelector = exports.gridAdditionalRowGroupsSelector = void 0;
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('rowTree') !== (0, _gridRowsSelector.gridRowGroupingNameSelector)(apiRef)) {
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 areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows;
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 ${props.rows?.length}`);
470
+ logger.debug(`Updating all rows, new length ${currentRows?.length}`);
473
471
  throttledRowsChange({
474
472
  cache: (0, _gridRowsUtils.createRowsInternalCache)({
475
- rows: props.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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.0.0-alpha.2
2
+ * @mui/x-data-grid v8.0.0-alpha.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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 () {
@@ -30,16 +30,15 @@ const heILGrid = {
30
30
  toolbarQuickFilterLabel: 'חיפוש',
31
31
  toolbarQuickFilterDeleteIconLabel: 'ניקוי',
32
32
  // Prompt toolbar field
33
- // toolbarPromptControlPlaceholder: 'Type a prompt…',
34
- // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…',
35
- // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…',
36
- // toolbarPromptControlLabel: 'Prompt input',
37
- // toolbarPromptControlRecordButtonDefaultLabel: 'Record',
38
- // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording',
39
- // toolbarPromptControlSendActionLabel: 'Send',
40
- // toolbarPromptControlSendActionAriaLabel: 'Send prompt',
41
- // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.',
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
- // columnsManagementDeleteIconLabel: 'Clear',
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
- // filterOperatorDoesNotContain: 'does not contain',
67
+ filterOperatorDoesNotContain: 'לא מכיל',
70
68
  filterOperatorEquals: 'שווה',
71
- // filterOperatorDoesNotEqual: 'does not equal',
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
- // headerFilterOperatorDoesNotContain: 'Does not contain',
89
+ headerFilterOperatorDoesNotContain: 'לא מכיל',
92
90
  headerFilterOperatorEquals: 'שווה',
93
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
91
+ headerFilterOperatorDoesNotEqual: 'לא שווה',
94
92
  headerFilterOperatorStartsWith: 'מתחיל ב-',
95
93
  headerFilterOperatorEndsWith: 'נגמר ב-',
96
94
  headerFilterOperatorIs: 'הינו',
@@ -30,16 +30,15 @@ const trTRGrid = {
30
30
  toolbarQuickFilterLabel: 'Ara',
31
31
  toolbarQuickFilterDeleteIconLabel: 'Temizle',
32
32
  // Prompt toolbar field
33
- // toolbarPromptControlPlaceholder: 'Type a prompt…',
34
- // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…',
35
- // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…',
36
- // toolbarPromptControlLabel: 'Prompt input',
37
- // toolbarPromptControlRecordButtonDefaultLabel: 'Record',
38
- // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording',
39
- // toolbarPromptControlSendActionLabel: 'Send',
40
- // toolbarPromptControlSendActionAriaLabel: 'Send prompt',
41
- // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.',
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
- // columnsManagementDeleteIconLabel: 'Clear',
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
- // filterOperatorDoesNotContain: 'does not contain',
67
+ filterOperatorDoesNotContain: 'içermiyor',
70
68
  filterOperatorEquals: 'eşittir',
71
- // filterOperatorDoesNotEqual: 'does not equal',
69
+ filterOperatorDoesNotEqual: 'eşit değil',
72
70
  filterOperatorStartsWith: 'ile başlar',
73
71
  filterOperatorEndsWith: 'ile biter',
74
72
  filterOperatorIs: 'eşittir',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.0.0-alpha.2",
3
+ "version": "8.0.0-alpha.3",
4
4
  "description": "The Community plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",