@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.
- package/CHANGELOG.md +121 -6
- package/components/GridFooter.js +1 -1
- package/components/GridPagination.js +4 -3
- package/components/GridRow.js +3 -1
- package/esm/components/GridFooter.js +1 -1
- package/esm/components/GridPagination.js +3 -2
- package/esm/components/GridRow.js +3 -1
- package/esm/hooks/features/dataSource/models.d.ts +11 -2
- package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +9 -2
- package/esm/hooks/features/editing/useGridRowEditing.js +4 -1
- package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
- package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.js +1 -0
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +3 -0
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/esm/hooks/features/rowSelection/utils.js +5 -0
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -0
- package/esm/internals/index.js +1 -0
- package/esm/locales/nnNO.js +96 -107
- package/esm/material/index.js +2 -2
- package/esm/models/gridStateCommunity.d.ts +2 -0
- package/hooks/features/dataSource/models.d.ts +11 -2
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +10 -3
- package/hooks/features/editing/useGridRowEditing.js +4 -1
- package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
- package/hooks/features/rowReorder/gridRowReorderInterfaces.js +5 -0
- package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
- package/hooks/features/rowReorder/gridRowReorderSelector.js +9 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/hooks/features/rowSelection/utils.js +5 -0
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +8 -0
- package/locales/nnNO.js +96 -107
- package/material/index.js +2 -2
- package/models/gridStateCommunity.d.ts +2 -0
- package/package.json +3 -4
package/esm/locales/nnNO.js
CHANGED
|
@@ -3,10 +3,9 @@ const nnNOGrid = {
|
|
|
3
3
|
// Root
|
|
4
4
|
noRowsLabel: 'Ingen rader',
|
|
5
5
|
noResultsOverlayLabel: 'Fann ingen resultat.',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
37
|
-
|
|
35
|
+
toolbarPivot: 'Pivot',
|
|
38
36
|
// Toolbar AI Assistant button
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
+
filterOperatorDoesNotContain: 'inneheld ikkje',
|
|
62
58
|
filterOperatorEquals: 'er lik',
|
|
63
|
-
|
|
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
|
-
|
|
79
|
+
headerFilterOperatorDoesNotContain: 'Inneheld ikkje',
|
|
84
80
|
headerFilterOperatorEquals: 'Lik',
|
|
85
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: '
|
|
156
|
-
expandDetailPanel: '
|
|
157
|
-
collapseDetailPanel: '
|
|
149
|
+
detailPanelToggle: 'Vis/gøym detaljpanel',
|
|
150
|
+
expandDetailPanel: 'Vis',
|
|
151
|
+
collapseDetailPanel: 'Gøym',
|
|
158
152
|
// Pagination
|
|
159
153
|
paginationRowsPerPage: 'Rader per side:',
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
233
|
+
promptRerun: 'Kjør på nytt',
|
|
234
|
+
promptProcessing: 'Behandlar…',
|
|
235
|
+
promptAppliedChanges: 'Brukte endringar',
|
|
247
236
|
// Prompt changes
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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);
|
package/esm/material/index.js
CHANGED
|
@@ -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 {
|
|
19
|
+
* @param {GridDataSourceFetchRowsParams} params Request parameters override.
|
|
11
20
|
*/
|
|
12
|
-
fetchRows: (parentId?: GridRowId, params?:
|
|
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?:
|
|
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
|
|
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 =>
|
|
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,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
|
|
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
package/internals/index.d.ts
CHANGED
|
@@ -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";
|
package/internals/index.js
CHANGED
|
@@ -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");
|