@mui/x-data-grid 8.9.2 → 8.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +121 -6
  2. package/components/GridFooter.js +1 -1
  3. package/components/GridPagination.js +4 -3
  4. package/components/GridRow.js +3 -1
  5. package/esm/components/GridFooter.js +1 -1
  6. package/esm/components/GridPagination.js +3 -2
  7. package/esm/components/GridRow.js +3 -1
  8. package/esm/hooks/features/dataSource/models.d.ts +11 -2
  9. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  10. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +9 -2
  11. package/esm/hooks/features/editing/useGridRowEditing.js +4 -1
  12. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
  13. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.js +1 -0
  14. package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
  15. package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +3 -0
  16. package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  17. package/esm/hooks/features/rowSelection/utils.js +5 -0
  18. package/esm/index.js +1 -1
  19. package/esm/internals/index.d.ts +2 -0
  20. package/esm/internals/index.js +1 -0
  21. package/esm/locales/nnNO.js +96 -107
  22. package/esm/material/index.js +2 -2
  23. package/esm/models/gridStateCommunity.d.ts +2 -0
  24. package/hooks/features/dataSource/models.d.ts +11 -2
  25. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  26. package/hooks/features/dataSource/useGridDataSourceBase.js +10 -3
  27. package/hooks/features/editing/useGridRowEditing.js +4 -1
  28. package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
  29. package/hooks/features/rowReorder/gridRowReorderInterfaces.js +5 -0
  30. package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
  31. package/hooks/features/rowReorder/gridRowReorderSelector.js +9 -0
  32. package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  33. package/hooks/features/rowSelection/utils.js +5 -0
  34. package/index.js +1 -1
  35. package/internals/index.d.ts +2 -0
  36. package/internals/index.js +8 -0
  37. package/locales/nnNO.js +96 -107
  38. package/material/index.js +2 -2
  39. package/models/gridStateCommunity.d.ts +2 -0
  40. package/package.json +3 -4
@@ -3,10 +3,9 @@ const nnNOGrid = {
3
3
  // Root
4
4
  noRowsLabel: 'Ingen rader',
5
5
  noResultsOverlayLabel: 'Fann ingen resultat.',
6
- // noColumnsOverlayLabel: 'No columns',
7
- // noColumnsOverlayManageColumns: 'Manage columns',
8
- // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
9
-
6
+ noColumnsOverlayLabel: 'Ingen kolonner',
7
+ noColumnsOverlayManageColumns: 'Vel kolonner',
8
+ emptyPivotOverlayLabel: 'Legg til felt i rader, kolonner og verdiar for å opprette ein pivot-tabell',
10
9
  // Density selector toolbar button text
11
10
  toolbarDensity: 'Tettheit',
12
11
  toolbarDensityLabel: 'Tettheit',
@@ -33,18 +32,15 @@ const nnNOGrid = {
33
32
  toolbarExportPrint: 'Skriv ut',
34
33
  toolbarExportExcel: 'Last ned som Excel',
35
34
  // Toolbar pivot button
36
- // toolbarPivot: 'Pivot',
37
-
35
+ toolbarPivot: 'Pivot',
38
36
  // Toolbar AI Assistant button
39
- // toolbarAssistant: 'AI Assistant',
40
-
37
+ toolbarAssistant: 'AI Assistent',
41
38
  // Columns management text
42
39
  columnsManagementSearchTitle: 'Søk',
43
40
  columnsManagementNoColumns: 'Ingen kolonner',
44
41
  columnsManagementShowHideAllText: 'Vis/skjul alle',
45
42
  columnsManagementReset: 'Nullstill',
46
- // columnsManagementDeleteIconLabel: 'Clear',
47
-
43
+ columnsManagementDeleteIconLabel: 'Tøm',
48
44
  // Filter panel text
49
45
  filterPanelAddFilter: 'Legg til filter',
50
46
  filterPanelRemoveAll: 'Fjern alle',
@@ -58,9 +54,9 @@ const nnNOGrid = {
58
54
  filterPanelInputPlaceholder: 'Filter verdi',
59
55
  // Filter operators text
60
56
  filterOperatorContains: 'inneheld',
61
- // filterOperatorDoesNotContain: 'does not contain',
57
+ filterOperatorDoesNotContain: 'inneheld ikkje',
62
58
  filterOperatorEquals: 'er lik',
63
- // filterOperatorDoesNotEqual: 'does not equal',
59
+ filterOperatorDoesNotEqual: 'er ikkje lik',
64
60
  filterOperatorStartsWith: 'startar med',
65
61
  filterOperatorEndsWith: 'sluttar med',
66
62
  filterOperatorIs: 'er',
@@ -80,9 +76,9 @@ const nnNOGrid = {
80
76
  'filterOperator<=': '<=',
81
77
  // Header filter operators text
82
78
  headerFilterOperatorContains: 'Inneheld',
83
- // headerFilterOperatorDoesNotContain: 'Does not contain',
79
+ headerFilterOperatorDoesNotContain: 'Inneheld ikkje',
84
80
  headerFilterOperatorEquals: 'Lik',
85
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
81
+ headerFilterOperatorDoesNotEqual: 'Er ikkje lik',
86
82
  headerFilterOperatorStartsWith: 'Startar på',
87
83
  headerFilterOperatorEndsWith: 'Sluttar på',
88
84
  headerFilterOperatorIs: 'Er',
@@ -100,15 +96,14 @@ const nnNOGrid = {
100
96
  'headerFilterOperator>=': 'Større enn eller lik',
101
97
  'headerFilterOperator<': 'Mindre enn',
102
98
  'headerFilterOperator<=': 'Mindre enn eller lik',
103
- // headerFilterClear: 'Clear filter',
104
-
99
+ headerFilterClear: 'Tøm filter',
105
100
  // Filter values text
106
101
  filterValueAny: 'nokon',
107
102
  filterValueTrue: 'sant',
108
103
  filterValueFalse: 'usant',
109
104
  // Column menu text
110
105
  columnMenuLabel: 'Meny',
111
- // columnMenuAriaLabel: (columnName: string) => `${columnName} column menu`,
106
+ columnMenuAriaLabel: columnName => `${columnName} kolonne meny`,
112
107
  columnMenuShowColumns: 'Vis kolonner',
113
108
  columnMenuManageColumns: 'Administrer kolonner',
114
109
  columnMenuFilter: 'Filter',
@@ -116,8 +111,7 @@ const nnNOGrid = {
116
111
  columnMenuUnsort: 'Usorter',
117
112
  columnMenuSortAsc: 'Sorter AUKANDE',
118
113
  columnMenuSortDesc: 'Sorter SYNKANDE',
119
- // columnMenuManagePivot: 'Manage pivot',
120
-
114
+ columnMenuManagePivot: 'Behandle pivot',
121
115
  // Column header text
122
116
  columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
123
117
  columnHeaderFiltersLabel: 'Vis filter',
@@ -152,23 +146,23 @@ const nnNOGrid = {
152
146
  groupColumn: name => `Grupper på ${name}`,
153
147
  unGroupColumn: name => `Slutt å grupper på ${name}`,
154
148
  // Master/detail
155
- detailPanelToggle: 'Utvid/kollaps detalj panel',
156
- expandDetailPanel: 'Utvid',
157
- collapseDetailPanel: 'Kolaps',
149
+ detailPanelToggle: 'Vis/gøym detaljpanel',
150
+ expandDetailPanel: 'Vis',
151
+ collapseDetailPanel: 'Gøym',
158
152
  // Pagination
159
153
  paginationRowsPerPage: 'Rader per side:',
160
- // paginationDisplayedRows: ({
161
- // from,
162
- // to,
163
- // count,
164
- // estimated
165
- // }) => {
166
- // if (!estimated) {
167
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
168
- // }
169
- // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
170
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
171
- // },
154
+ paginationDisplayedRows: ({
155
+ from,
156
+ to,
157
+ count,
158
+ estimated
159
+ }) => {
160
+ if (!estimated) {
161
+ return `${from}–${to} av ${count !== -1 ? count : `flere enn ${to}`}`;
162
+ }
163
+ const estimatedLabel = estimated && estimated > to ? `omtrent ${estimated}` : `flere enn ${to}`;
164
+ return `${from}–${to} av ${count !== -1 ? count : estimatedLabel}`;
165
+ },
172
166
  paginationItemAriaLabel: type => {
173
167
  if (type === 'first') {
174
168
  return 'Gå til første side';
@@ -190,83 +184,78 @@ const nnNOGrid = {
190
184
  aggregationFunctionLabelAvg: 'snitt',
191
185
  aggregationFunctionLabelMin: 'min',
192
186
  aggregationFunctionLabelMax: 'maks',
193
- aggregationFunctionLabelSize: 'størrelse'
194
-
187
+ aggregationFunctionLabelSize: 'størrelse',
195
188
  // Pivot panel
196
- // pivotToggleLabel: 'Pivot',
197
- // pivotRows: 'Rows',
198
- // pivotColumns: 'Columns',
199
- // pivotValues: 'Values',
200
- // pivotCloseButton: 'Close pivot settings',
201
- // pivotSearchButton: 'Search fields',
202
- // pivotSearchControlPlaceholder: 'Search fields',
203
- // pivotSearchControlLabel: 'Search fields',
204
- // pivotSearchControlClear: 'Clear search',
205
- // pivotNoFields: 'No fields',
206
- // pivotMenuMoveUp: 'Move up',
207
- // pivotMenuMoveDown: 'Move down',
208
- // pivotMenuMoveToTop: 'Move to top',
209
- // pivotMenuMoveToBottom: 'Move to bottom',
210
- // pivotMenuRows: 'Rows',
211
- // pivotMenuColumns: 'Columns',
212
- // pivotMenuValues: 'Values',
213
- // pivotMenuOptions: 'Field options',
214
- // pivotMenuAddToRows: 'Add to Rows',
215
- // pivotMenuAddToColumns: 'Add to Columns',
216
- // pivotMenuAddToValues: 'Add to Values',
217
- // pivotMenuRemove: 'Remove',
218
- // pivotDragToRows: 'Drag here to create rows',
219
- // pivotDragToColumns: 'Drag here to create columns',
220
- // pivotDragToValues: 'Drag here to create values',
221
- // pivotYearColumnHeaderName: '(Year)',
222
- // pivotQuarterColumnHeaderName: '(Quarter)',
223
-
189
+ pivotToggleLabel: 'Pivot',
190
+ pivotRows: 'Rader',
191
+ pivotColumns: 'Kolonner',
192
+ pivotValues: 'Verdiar',
193
+ pivotCloseButton: 'Lukk pivotinnstillingar',
194
+ pivotSearchButton: 'Søk felt',
195
+ pivotSearchControlPlaceholder: 'Søk felt',
196
+ pivotSearchControlLabel: 'Søk felt',
197
+ pivotSearchControlClear: 'Tøm søk',
198
+ pivotNoFields: 'Ingen felt',
199
+ pivotMenuMoveUp: 'Flytt opp',
200
+ pivotMenuMoveDown: 'Flytt ned',
201
+ pivotMenuMoveToTop: 'Flytt til toppen',
202
+ pivotMenuMoveToBottom: 'Flytt til botnen',
203
+ pivotMenuRows: 'Rader',
204
+ pivotMenuColumns: 'Kolonner',
205
+ pivotMenuValues: 'Verdiar',
206
+ pivotMenuOptions: 'Feltalternativ',
207
+ pivotMenuAddToRows: 'Legg til i Rader',
208
+ pivotMenuAddToColumns: 'Legg til i Kolonner',
209
+ pivotMenuAddToValues: 'Legg til i Verdiar',
210
+ pivotMenuRemove: 'Fjern',
211
+ pivotDragToRows: 'Dra hit for å opprette rader',
212
+ pivotDragToColumns: 'Dra hit for å opprette kolonner',
213
+ pivotDragToValues: 'Dra hit for å opprette verdiar',
214
+ pivotYearColumnHeaderName: '(År)',
215
+ pivotQuarterColumnHeaderName: '(Kvartal)',
224
216
  // AI Assistant panel
225
- // aiAssistantPanelTitle: 'AI Assistant',
226
- // aiAssistantPanelClose: 'Close AI Assistant',
227
- // aiAssistantPanelNewConversation: 'New conversation',
228
- // aiAssistantPanelConversationHistory: 'Conversation history',
229
- // aiAssistantPanelEmptyConversation: 'No prompt history',
230
- // aiAssistantSuggestions: 'Suggestions',
231
-
217
+ aiAssistantPanelTitle: 'AI Assistent',
218
+ aiAssistantPanelClose: 'Lukk AI Assistent',
219
+ aiAssistantPanelNewConversation: 'Ny samtale',
220
+ aiAssistantPanelConversationHistory: 'Samtalehistorikk',
221
+ aiAssistantPanelEmptyConversation: 'Ingen prompt-historikk',
222
+ aiAssistantSuggestions: 'Forslag',
232
223
  // Prompt field
233
- // promptFieldLabel: 'Prompt',
234
- // promptFieldPlaceholder: 'Type a prompt…',
235
- // promptFieldPlaceholderWithRecording: 'Type or record a prompt…',
236
- // promptFieldPlaceholderListening: 'Listening for prompt…',
237
- // promptFieldSpeechRecognitionNotSupported: 'Speech recognition is not supported in this browser',
238
- // promptFieldSend: 'Send',
239
- // promptFieldRecord: 'Record',
240
- // promptFieldStopRecording: 'Stop recording',
241
-
224
+ promptFieldLabel: 'Prompt',
225
+ promptFieldPlaceholder: 'Skriv ein prompt…',
226
+ promptFieldPlaceholderWithRecording: 'Skriv eller spel inn ein prompt…',
227
+ promptFieldPlaceholderListening: 'Lyttar etter prompt…',
228
+ promptFieldSpeechRecognitionNotSupported: 'Talegjenkjenning er ikkje støtta i denne nettlesaren',
229
+ promptFieldSend: 'Send',
230
+ promptFieldRecord: 'Spel inn',
231
+ promptFieldStopRecording: 'Stopp opptak',
242
232
  // Prompt
243
- // promptRerun: 'Run again',
244
- // promptProcessing: 'Processing…',
245
- // promptAppliedChanges: 'Applied changes',
246
-
233
+ promptRerun: 'Kjør på nytt',
234
+ promptProcessing: 'Behandlar…',
235
+ promptAppliedChanges: 'Brukte endringar',
247
236
  // Prompt changes
248
- // promptChangeGroupDescription: (column: string) => `Group by ${column}`,
249
- // promptChangeAggregationLabel: (column: string, aggregation: string) => `${column} (${aggregation})`,
250
- // promptChangeAggregationDescription: (column: string, aggregation: string) => `Aggregate ${column} (${aggregation})`,
251
- // promptChangeFilterLabel: (column: string, operator: string, value: string) => {
252
- // if (operator === 'is any of') {
253
- // return `${column} is any of: ${value}`;
254
- // }
255
- // return `${column} ${operator} ${value}`;
256
- // },
257
- // promptChangeFilterDescription: (column: string, operator: string, value: string) => {
258
- // if (operator === 'is any of') {
259
- // return `Filter where ${column} is any of: ${value}`;
260
- // }
261
- // return `Filter where ${column} ${operator} ${value}`;
262
- // },
263
- // promptChangeSortDescription: (column: string, direction: string) => `Sort by ${column} (${direction})`,
264
- // promptChangePivotEnableLabel: 'Pivot',
265
- // promptChangePivotEnableDescription: 'Enable pivot',
266
- // promptChangePivotColumnsLabel: (count: number) => `Columns (${count})`,
267
- // promptChangePivotColumnsDescription: (column: string, direction: string) => `${column}${direction ? ` (${direction})` : ''}`,
268
- // promptChangePivotRowsLabel: (count: number) => `Rows (${count})`,
269
- // promptChangePivotValuesLabel: (count: number) => `Values (${count})`,
270
- // promptChangePivotValuesDescription: (column: string, aggregation: string) => `${column} (${aggregation})`,
237
+ promptChangeGroupDescription: column => `Grupper etter ${column}`,
238
+ promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
239
+ promptChangeAggregationDescription: (column, aggregation) => `Aggreger ${column} (${aggregation})`,
240
+ promptChangeFilterLabel: (column, operator, value) => {
241
+ if (operator === 'is any of') {
242
+ return `${column} er ein av: ${value}`;
243
+ }
244
+ return `${column} ${operator} ${value}`;
245
+ },
246
+ promptChangeFilterDescription: (column, operator, value) => {
247
+ if (operator === 'is any of') {
248
+ return `Filter der ${column} er ein av: ${value}`;
249
+ }
250
+ return `Filter der ${column} ${operator} ${value}`;
251
+ },
252
+ promptChangeSortDescription: (column, direction) => `Sorter etter ${column} (${direction})`,
253
+ promptChangePivotEnableLabel: 'Pivot',
254
+ promptChangePivotEnableDescription: 'Aktiver pivot',
255
+ promptChangePivotColumnsLabel: count => `Kolonner (${count})`,
256
+ promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ''}`,
257
+ promptChangePivotRowsLabel: count => `Rader (${count})`,
258
+ promptChangePivotValuesLabel: count => `Verdiar (${count})`,
259
+ promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`
271
260
  };
272
261
  export const nnNO = getGridLocalization(nnNOGrid);
@@ -159,9 +159,9 @@ const BaseSelect = forwardRef(function BaseSelect(props, ref) {
159
159
  labelId: labelId,
160
160
  label: label,
161
161
  displayEmpty: true,
162
- onChange: onChange
162
+ onChange: onChange,
163
+ variant: "outlined"
163
164
  }, rest, {
164
- variant: "outlined",
165
165
  notched: true,
166
166
  inputProps: slotProps?.htmlInput,
167
167
  onOpen: onOpen,
@@ -8,6 +8,7 @@ import type { GridVisibleRowsLookupState } from "../hooks/features/filter/gridFi
8
8
  import type { GridColumnResizeState } from "../hooks/features/columnResize/index.js";
9
9
  import type { GridRowSpanningState } from "../hooks/features/rows/useGridRowSpanning.js";
10
10
  import type { GridListViewState } from "../hooks/features/listView/useGridListView.js";
11
+ import type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowReorderInterfaces.js";
11
12
  /**
12
13
  * Some props are passed on the state to enable grid selectors to select
13
14
  * and react to them.
@@ -41,6 +42,7 @@ export interface GridStateCommunity {
41
42
  columnResize: GridColumnResizeState;
42
43
  rowSpanning: GridRowSpanningState;
43
44
  listViewColumn: GridListViewState;
45
+ rowReorder: GridRowReorderState;
44
46
  }
45
47
  /**
46
48
  * The initial state of Data Grid.
@@ -1,15 +1,24 @@
1
1
  import type { GridDataSourceCache, GridGetRowsParams, GridUpdateRowParams } from "../../../models/gridDataSource.js";
2
2
  import type { GridRowId, GridRowModel } from "../../../models/gridRows.js";
3
3
  import type { GridDataSourceCacheDefaultConfig } from "./cache.js";
4
+ /**
5
+ * The parameters for the `fetchRows` method.
6
+ */
7
+ export interface GridDataSourceFetchRowsParams extends Partial<GridGetRowsParams> {
8
+ /**
9
+ * If `true`, bypasses the cache and forces a refetch of the rows from the server.
10
+ */
11
+ skipCache?: boolean;
12
+ }
4
13
  export interface GridDataSourceApiBase {
5
14
  /**
6
15
  * Fetches the rows from the server.
7
16
  * If no `parentId` option is provided, it fetches the root rows.
8
17
  * Any missing parameter from `params` will be filled from the state (sorting, filtering, etc.).
9
18
  * @param {GridRowId} parentId The id of the parent node (default: `GRID_ROOT_GROUP_ID`).
10
- * @param {Partial<GridGetRowsParams>} params Request parameters override.
19
+ * @param {GridDataSourceFetchRowsParams} params Request parameters override.
11
20
  */
12
- fetchRows: (parentId?: GridRowId, params?: Partial<GridGetRowsParams>) => void;
21
+ fetchRows: (parentId?: GridRowId, params?: GridDataSourceFetchRowsParams) => void;
13
22
  /**
14
23
  * The data source cache object.
15
24
  */
@@ -10,7 +10,7 @@ export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity
10
10
  api: {
11
11
  public: GridDataSourceApi;
12
12
  };
13
- debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: Partial<import("@mui/x-data-grid").GridGetRowsParams>) => void) & import("@mui/utils/debounce").Cancelable;
13
+ debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: import("./models.js").GridDataSourceFetchRowsParams) => void) & import("@mui/utils/debounce").Cancelable;
14
14
  strategyProcessor: {
15
15
  strategyName: DataSourceRowsUpdateStrategy;
16
16
  group: "dataSourceRowsUpdate";
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  'use client';
3
3
 
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
9
  exports.useGridDataSourceBase = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
12
  var React = _interopRequireWildcard(require("react"));
12
13
  var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
13
14
  var _debounce = _interopRequireDefault(require("@mui/utils/debounce"));
@@ -22,6 +23,7 @@ var _gridDataSourceSelector = require("./gridDataSourceSelector");
22
23
  var _utils2 = require("./utils");
23
24
  var _cache = require("./cache");
24
25
  var _gridDataSourceError = require("./gridDataSourceError");
26
+ const _excluded = ["skipCache"];
25
27
  const noopCache = {
26
28
  clear: () => {},
27
29
  get: () => undefined,
@@ -60,10 +62,15 @@ const useGridDataSourceBase = (apiRef, props, options = {}) => {
60
62
  return;
61
63
  }
62
64
  options.clearDataSourceState?.();
63
- const fetchParams = (0, _extends2.default)({}, (0, _gridDataSourceSelector.gridGetRowsParamsSelector)(apiRef), apiRef.current.unstable_applyPipeProcessors('getRowsParams', {}), params);
65
+ const _ref = params || {},
66
+ {
67
+ skipCache
68
+ } = _ref,
69
+ getRowsParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
70
+ const fetchParams = (0, _extends2.default)({}, (0, _gridDataSourceSelector.gridGetRowsParamsSelector)(apiRef), apiRef.current.unstable_applyPipeProcessors('getRowsParams', {}), getRowsParams);
64
71
  const cacheKeys = cacheChunkManager.getCacheKeys(fetchParams);
65
72
  const responses = cacheKeys.map(cacheKey => cache.get(cacheKey));
66
- if (responses.every(response => response !== undefined)) {
73
+ if (!skipCache && responses.every(response => response !== undefined)) {
67
74
  apiRef.current.applyStrategyProcessor('dataSourceRowsUpdate', {
68
75
  response: _utils2.CacheChunkManager.mergeResponses(responses),
69
76
  fetchParams
@@ -350,7 +350,10 @@ const useGridRowEditing = (apiRef, props) => {
350
350
  if (fieldToFocus) {
351
351
  apiRef.current.setCellFocus(id, fieldToFocus);
352
352
  }
353
- columns.filter(column => column.editable && !!column.preProcessEditCellProps && deleteValue).forEach(column => {
353
+ columns.filter(column => {
354
+ const isCellEditable = apiRef.current.getCellParams(id, column.field).isEditable;
355
+ return isCellEditable && column.editable && !!column.preProcessEditCellProps && deleteValue;
356
+ }).forEach(column => {
354
357
  const field = column.field;
355
358
  const value = apiRef.current.getCellValue(id, field);
356
359
  const newValue = deleteValue ? (0, _utils2.getDefaultCellValue)(column) : initialValue ?? value;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The row reorder state.
3
+ */
4
+ export interface GridRowReorderState {
5
+ /**
6
+ * Whether a row drag operation is currently active.
7
+ */
8
+ isActive: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
+ export declare const gridRowReorderStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("./gridRowReorderInterfaces.js").GridRowReorderState>;
3
+ export declare const gridIsRowDragActiveSelector: (args_0: import("react").RefObject<{
4
+ state: GridStateCommunity;
5
+ } | null>) => boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridRowReorderStateSelector = exports.gridIsRowDragActiveSelector = void 0;
7
+ var _createSelector = require("../../../utils/createSelector");
8
+ const gridRowReorderStateSelector = exports.gridRowReorderStateSelector = (0, _createSelector.createRootSelector)(state => state.rowReorder);
9
+ const gridIsRowDragActiveSelector = exports.gridIsRowDragActiveSelector = (0, _createSelector.createSelector)(gridRowReorderStateSelector, rowReorder => rowReorder?.isActive ?? false);
@@ -51,7 +51,8 @@ const useGridRowSelection = (apiRef, props) => {
51
51
  callback(...args);
52
52
  }
53
53
  }, [props.rowSelection]);
54
- const applyAutoSelection = props.signature !== _signature.GridSignature.DataGrid && (props.rowSelectionPropagation?.parents || props.rowSelectionPropagation?.descendants);
54
+ const isNestedData = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowMaximumTreeDepthSelector) > 1;
55
+ const applyAutoSelection = props.signature !== _signature.GridSignature.DataGrid && (props.rowSelectionPropagation?.parents || props.rowSelectionPropagation?.descendants) && isNestedData;
55
56
  const propRowSelectionModel = React.useMemo(() => {
56
57
  return props.rowSelectionModel;
57
58
  }, [props.rowSelectionModel]);
@@ -70,7 +71,6 @@ const useGridRowSelection = (apiRef, props) => {
70
71
  } = props;
71
72
  const canHaveMultipleSelection = (0, _utils.isMultipleRowSelectionEnabled)(props);
72
73
  const tree = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowTreeSelector);
73
- const isNestedData = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowMaximumTreeDepthSelector) > 1;
74
74
  const expandMouseRowRangeSelection = React.useCallback(id => {
75
75
  let endId = id;
76
76
  const startId = lastRowToggled.current ?? id;
@@ -144,6 +144,11 @@ const findRowsToSelect = (apiRef, tree, selectedRow, autoSelectDescendants, auto
144
144
  }
145
145
  }
146
146
  };
147
+ // For root level rows, we don't need to traverse parents
148
+ const rowNode = tree[selectedRow];
149
+ if (!rowNode || rowNode.parent === _gridRowsUtils.GRID_ROOT_GROUP_ID) {
150
+ return;
151
+ }
147
152
  traverseParents(selectedRow);
148
153
  }
149
154
  };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.9.2
2
+ * @mui/x-data-grid v8.10.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -63,6 +63,8 @@ export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hoo
63
63
  export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
64
64
  export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
65
65
  export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
66
+ export { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
67
+ export type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowReorderInterfaces.js";
66
68
  export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
67
69
  export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
68
70
  export type { GridSortingModelApplier } from "../hooks/features/sorting/gridSortingState.js";
@@ -79,6 +79,7 @@ var _exportNames = {
79
79
  useGridHeaderFiltering: true,
80
80
  useGridRowSelection: true,
81
81
  rowSelectionStateInitializer: true,
82
+ gridIsRowDragActiveSelector: true,
82
83
  useGridRowSelectionPreProcessors: true,
83
84
  useGridSorting: true,
84
85
  sortingStateInitializer: true,
@@ -420,6 +421,12 @@ Object.defineProperty(exports, "gridHeaderFilteringMenuSelector", {
420
421
  return _gridHeaderFilteringSelectors.gridHeaderFilteringMenuSelector;
421
422
  }
422
423
  });
424
+ Object.defineProperty(exports, "gridIsRowDragActiveSelector", {
425
+ enumerable: true,
426
+ get: function () {
427
+ return _gridRowReorderSelector.gridIsRowDragActiveSelector;
428
+ }
429
+ });
423
430
  Object.defineProperty(exports, "gridPinnedRowsSelector", {
424
431
  enumerable: true,
425
432
  get: function () {
@@ -905,6 +912,7 @@ var _useGridParamsApi = require("../hooks/features/rows/useGridParamsApi");
905
912
  var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
906
913
  var _useGridHeaderFiltering = require("../hooks/features/headerFiltering/useGridHeaderFiltering");
907
914
  var _useGridRowSelection = require("../hooks/features/rowSelection/useGridRowSelection");
915
+ var _gridRowReorderSelector = require("../hooks/features/rowReorder/gridRowReorderSelector");
908
916
  var _useGridRowSelectionPreProcessors = require("../hooks/features/rowSelection/useGridRowSelectionPreProcessors");
909
917
  var _useGridSorting = require("../hooks/features/sorting/useGridSorting");
910
918
  var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelector");