@mui/x-data-grid 5.12.2 → 5.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +160 -6
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/colDef/gridDateOperators.js +4 -2
  4. package/colDef/gridNumericOperators.js +4 -2
  5. package/colDef/gridStringOperators.d.ts +1 -1
  6. package/colDef/gridStringOperators.js +15 -8
  7. package/components/GridRow.js +1 -1
  8. package/components/cell/GridActionsCellItem.d.ts +2 -2
  9. package/components/cell/GridBooleanCell.js +4 -3
  10. package/components/cell/GridEditBooleanCell.js +4 -3
  11. package/components/cell/GridEditDateCell.js +4 -3
  12. package/components/cell/GridEditInputCell.js +4 -3
  13. package/components/cell/GridEditSingleSelectCell.js +9 -7
  14. package/components/panel/GridColumnsPanel.js +1 -1
  15. package/components/panel/GridPanel.d.ts +1 -1
  16. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  17. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  18. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  19. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +5 -9
  20. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +42 -19
  21. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  22. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  23. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  24. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  25. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  26. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  27. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  28. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  29. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  30. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  31. package/hooks/features/dimensions/useGridDimensions.js +28 -15
  32. package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  33. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  34. package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  35. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  36. package/hooks/features/filter/gridFilterUtils.js +8 -5
  37. package/hooks/features/filter/useGridFilter.js +19 -1
  38. package/hooks/features/rows/useGridRows.js +16 -3
  39. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  40. package/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  41. package/hooks/utils/useGridApiContext.js +1 -1
  42. package/hooks/utils/useGridRootProps.js +1 -1
  43. package/index.js +1 -1
  44. package/legacy/DataGrid/DataGrid.js +4 -4
  45. package/legacy/colDef/gridDateOperators.js +4 -2
  46. package/legacy/colDef/gridNumericOperators.js +4 -2
  47. package/legacy/colDef/gridStringOperators.js +17 -7
  48. package/legacy/components/GridRow.js +1 -1
  49. package/legacy/components/cell/GridBooleanCell.js +3 -1
  50. package/legacy/components/cell/GridEditBooleanCell.js +4 -2
  51. package/legacy/components/cell/GridEditDateCell.js +4 -2
  52. package/legacy/components/cell/GridEditInputCell.js +4 -2
  53. package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
  54. package/legacy/components/panel/GridColumnsPanel.js +3 -1
  55. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  56. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  57. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  58. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +34 -12
  59. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  60. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  61. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  62. package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
  63. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  64. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  65. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  66. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  67. package/legacy/hooks/features/filter/gridFilterUtils.js +8 -5
  68. package/legacy/hooks/features/filter/useGridFilter.js +19 -1
  69. package/legacy/hooks/features/rows/useGridRows.js +18 -3
  70. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  71. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
  72. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  73. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  74. package/legacy/index.js +1 -1
  75. package/legacy/locales/deDE.js +4 -4
  76. package/legacy/locales/frFR.js +11 -11
  77. package/legacy/locales/index.js +3 -0
  78. package/legacy/locales/nlNL.js +15 -15
  79. package/legacy/locales/ptBR.js +11 -11
  80. package/legacy/locales/roRO.js +128 -0
  81. package/legacy/locales/skSK.js +16 -16
  82. package/legacy/locales/svSE.js +128 -0
  83. package/legacy/utils/keyboardUtils.js +4 -3
  84. package/locales/deDE.js +4 -4
  85. package/locales/frFR.js +11 -11
  86. package/locales/index.d.ts +3 -0
  87. package/locales/index.js +3 -0
  88. package/locales/nlNL.js +15 -15
  89. package/locales/ptBR.js +11 -11
  90. package/locales/roRO.d.ts +2 -0
  91. package/locales/roRO.js +116 -0
  92. package/locales/skSK.js +16 -16
  93. package/locales/svSE.d.ts +2 -0
  94. package/locales/svSE.js +116 -0
  95. package/models/gridFilterOperator.d.ts +6 -0
  96. package/modern/DataGrid/DataGrid.js +4 -4
  97. package/modern/colDef/gridDateOperators.js +4 -2
  98. package/modern/colDef/gridNumericOperators.js +4 -2
  99. package/modern/colDef/gridStringOperators.js +15 -8
  100. package/modern/components/GridRow.js +1 -1
  101. package/modern/components/cell/GridBooleanCell.js +4 -3
  102. package/modern/components/cell/GridEditBooleanCell.js +4 -3
  103. package/modern/components/cell/GridEditDateCell.js +4 -3
  104. package/modern/components/cell/GridEditInputCell.js +4 -3
  105. package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
  106. package/modern/components/panel/GridColumnsPanel.js +1 -1
  107. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  108. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  109. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  110. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -13
  111. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  112. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  113. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  114. package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
  115. package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  116. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  117. package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  118. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  119. package/modern/hooks/features/filter/gridFilterUtils.js +8 -5
  120. package/modern/hooks/features/filter/useGridFilter.js +17 -1
  121. package/modern/hooks/features/rows/useGridRows.js +16 -3
  122. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  123. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -3
  124. package/modern/hooks/utils/useGridApiContext.js +1 -1
  125. package/modern/hooks/utils/useGridRootProps.js +1 -1
  126. package/modern/index.js +1 -1
  127. package/modern/locales/deDE.js +4 -4
  128. package/modern/locales/frFR.js +11 -11
  129. package/modern/locales/index.js +3 -0
  130. package/modern/locales/nlNL.js +15 -15
  131. package/modern/locales/ptBR.js +11 -11
  132. package/modern/locales/roRO.js +116 -0
  133. package/modern/locales/skSK.js +16 -16
  134. package/modern/locales/svSE.js +116 -0
  135. package/modern/utils/keyboardUtils.js +4 -3
  136. package/node/DataGrid/DataGrid.js +4 -4
  137. package/node/colDef/gridDateOperators.js +4 -2
  138. package/node/colDef/gridNumericOperators.js +4 -2
  139. package/node/colDef/gridStringOperators.js +15 -8
  140. package/node/components/GridRow.js +1 -1
  141. package/node/components/cell/GridBooleanCell.js +5 -3
  142. package/node/components/cell/GridEditBooleanCell.js +5 -3
  143. package/node/components/cell/GridEditDateCell.js +5 -3
  144. package/node/components/cell/GridEditInputCell.js +5 -3
  145. package/node/components/cell/GridEditSingleSelectCell.js +10 -7
  146. package/node/components/panel/GridColumnsPanel.js +1 -1
  147. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  148. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  149. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  150. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +43 -20
  151. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  152. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  153. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  154. package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
  155. package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  156. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  157. package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  158. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  159. package/node/hooks/features/filter/gridFilterUtils.js +7 -4
  160. package/node/hooks/features/filter/useGridFilter.js +19 -1
  161. package/node/hooks/features/rows/useGridRows.js +16 -3
  162. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  163. package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  164. package/node/hooks/utils/useGridApiContext.js +1 -1
  165. package/node/hooks/utils/useGridRootProps.js +1 -1
  166. package/node/index.js +1 -1
  167. package/node/locales/deDE.js +4 -4
  168. package/node/locales/frFR.js +11 -11
  169. package/node/locales/index.js +39 -0
  170. package/node/locales/nlNL.js +15 -15
  171. package/node/locales/ptBR.js +11 -11
  172. package/node/locales/roRO.js +126 -0
  173. package/node/locales/skSK.js +16 -16
  174. package/node/locales/svSE.js +126 -0
  175. package/node/utils/keyboardUtils.js +4 -3
  176. package/package.json +4 -4
  177. package/utils/keyboardUtils.js +4 -3
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { GridLinkOperator } from '../../../models';
3
3
  import { buildWarning } from '../../../utils/warning';
4
- import { gridColumnFieldsSelector } from '../columns';
4
+ import { gridColumnFieldsSelector, gridColumnLookupSelector } from '../columns';
5
5
 
6
6
  /**
7
7
  * Adds default values to the optional fields of a filter items.
@@ -18,8 +18,9 @@ export var cleanFilterItem = function cleanFilterItem(item, apiRef) {
18
18
  }
19
19
 
20
20
  if (cleanItem.operatorValue == null) {
21
- // we select a default operator
22
- var column = apiRef.current.getColumn(cleanItem.columnField);
21
+ // Selects a default operator
22
+ // We don't use `apiRef.current.getColumn` because it is not ready during state initialization
23
+ var column = gridColumnLookupSelector(apiRef)[cleanItem.columnField];
23
24
  cleanItem.operatorValue = column && column.filterOperators[0].value;
24
25
  }
25
26
 
@@ -212,15 +213,17 @@ export var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilt
212
213
  });
213
214
  return function (rowId, shouldApplyFilter) {
214
215
  var usedCellParams = {};
216
+ var columnsFieldsToFilter = [];
215
217
  Object.keys(appliersPerColumnField).forEach(function (columnField) {
216
218
  if (!shouldApplyFilter || shouldApplyFilter(columnField)) {
217
219
  usedCellParams[columnField] = apiRef.current.getCellParams(rowId, columnField);
220
+ columnsFieldsToFilter.push(columnField);
218
221
  }
219
222
  }); // Return `false` as soon as we have a quick filter value that does not match any column
220
223
 
221
224
  if (quickFilterLogicOperator === GridLinkOperator.And) {
222
225
  return sanitizedQuickFilterValues.every(function (value, index) {
223
- return Object.keys(appliersPerColumnField).some(function (field) {
226
+ return columnsFieldsToFilter.some(function (field) {
224
227
  var _appliersPerColumnFie, _appliersPerColumnFie2;
225
228
 
226
229
  if (appliersPerColumnField[field][index] == null) {
@@ -234,7 +237,7 @@ export var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilt
234
237
 
235
238
 
236
239
  return sanitizedQuickFilterValues.some(function (value, index) {
237
- return Object.keys(appliersPerColumnField).some(function (field) {
240
+ return columnsFieldsToFilter.some(function (field) {
238
241
  var _appliersPerColumnFie3, _appliersPerColumnFie4;
239
242
 
240
243
  if (appliersPerColumnField[field][index] == null) {
@@ -125,7 +125,25 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
125
125
  if (targetColumnField) {
126
126
  var filterModel = gridFilterModelSelector(apiRef);
127
127
  var filterItemsWithValue = filterModel.items.filter(function (item) {
128
- return item.value !== undefined;
128
+ var _column$filterOperato;
129
+
130
+ if (item.value !== undefined) {
131
+ return true;
132
+ }
133
+
134
+ var column = apiRef.current.getColumn(item.columnField);
135
+ var filterOperator = (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.find(function (operator) {
136
+ return operator.value === item.operatorValue;
137
+ });
138
+ var requiresFilterValue = typeof (filterOperator == null ? void 0 : filterOperator.requiresFilterValue) === 'undefined' ? true : filterOperator == null ? void 0 : filterOperator.requiresFilterValue; // Operators like `isEmpty` don't have and don't require `item.value`.
139
+ // So we don't want to remove them from the filter model if `item.value === undefined`.
140
+ // See https://github.com/mui/mui-x/issues/5402
141
+
142
+ if (requiresFilterValue) {
143
+ return false;
144
+ }
145
+
146
+ return true;
129
147
  });
130
148
  var newFilterItems;
131
149
  var filterItemOnTarget = filterItemsWithValue.find(function (item) {
@@ -102,7 +102,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
102
102
  var updateRows = React.useCallback(function (updates) {
103
103
  if (props.signature === GridSignature.DataGrid && updates.length > 1) {
104
104
  // TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
105
- throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to the DataGridPro component to unlock this feature.'].join('\n'));
105
+ throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
106
106
  } // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
107
107
 
108
108
 
@@ -348,10 +348,25 @@ export var useGridRows = function useGridRows(apiRef, props) {
348
348
  if (isFirstRender.current) {
349
349
  isFirstRender.current = false;
350
350
  return;
351
- } // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
351
+ }
352
352
 
353
+ var areNewRowsAlreadyInState = apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows;
354
+ var isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
355
+
356
+ if (areNewRowsAlreadyInState) {
357
+ // If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`
358
+ if (!isNewLoadingAlreadyInState) {
359
+ apiRef.current.setState(function (state) {
360
+ return _extends({}, state, {
361
+ rows: _extends({}, state.rows, {
362
+ loading: props.loading
363
+ })
364
+ });
365
+ });
366
+ apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates = props.loading;
367
+ apiRef.current.forceUpdate();
368
+ }
353
369
 
354
- if (apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows && apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading) {
355
370
  return;
356
371
  }
357
372
 
@@ -10,7 +10,7 @@ var flatRowTreeCreationMethod = function flatRowTreeCreationMethod(_ref) {
10
10
  for (var i = 0; i < ids.length; i += 1) {
11
11
  var rowId = ids[i];
12
12
 
13
- if (previousTree && previousTree[rowId]) {
13
+ if (previousTree && previousTree[rowId] && previousTree[rowId].depth === 0 && previousTree[rowId].parent == null) {
14
14
  tree[rowId] = previousTree[rowId];
15
15
  } else {
16
16
  tree[rowId] = {
@@ -57,6 +57,8 @@ export var getRenderableIndexes = function getRenderableIndexes(_ref) {
57
57
  return [clamp(firstIndex - buffer, minFirstIndex, maxLastIndex), clamp(lastIndex + buffer, minFirstIndex, maxLastIndex)];
58
58
  };
59
59
  export var useGridVirtualScroller = function useGridVirtualScroller(props) {
60
+ var _currentPage$range3, _currentPage$range4;
61
+
60
62
  var apiRef = useGridApiContext();
61
63
  var rootProps = useGridRootProps();
62
64
  var visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
@@ -99,9 +101,18 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
99
101
 
100
102
  var prevTotalWidth = React.useRef(columnsTotalWidth);
101
103
  var getNearestIndexToRender = React.useCallback(function (offset) {
102
- var lastMeasuredIndex = Math.max(0, apiRef.current.unstable_getLastMeasuredRowIndex());
104
+ var _currentPage$range, _currentPage$range2;
105
+
106
+ var lastMeasuredIndexRelativeToAllRows = apiRef.current.unstable_getLastMeasuredRowIndex();
107
+ var lastMeasuredIndexRelativeToCurrentPage = lastMeasuredIndexRelativeToAllRows - (((_currentPage$range = currentPage.range) == null ? void 0 : _currentPage$range.firstRowIndex) || 0);
108
+ var lastMeasuredIndex = Math.max(0, lastMeasuredIndexRelativeToCurrentPage);
103
109
  var allRowsMeasured = lastMeasuredIndex === Infinity;
104
110
 
111
+ if ((_currentPage$range2 = currentPage.range) != null && _currentPage$range2.lastRowIndex && !allRowsMeasured) {
112
+ // Check if all rows in this page are already measured
113
+ allRowsMeasured = lastMeasuredIndex >= currentPage.range.lastRowIndex;
114
+ }
115
+
105
116
  if (allRowsMeasured || rowsMeta.positions[lastMeasuredIndex] >= offset) {
106
117
  // If all rows were measured (when no row has "auto" as height) or all rows before the offset
107
118
  // were measured, then use a binary search because it's faster.
@@ -113,7 +124,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
113
124
 
114
125
 
115
126
  return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndex);
116
- }, [apiRef, rowsMeta.positions]);
127
+ }, [apiRef, (_currentPage$range3 = currentPage.range) == null ? void 0 : _currentPage$range3.firstRowIndex, (_currentPage$range4 = currentPage.range) == null ? void 0 : _currentPage$range4.lastRowIndex, rowsMeta.positions]);
117
128
  var computeRenderContext = React.useCallback(function () {
118
129
  if (disableVirtualization) {
119
130
  return {
@@ -355,13 +366,13 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
355
366
  var renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);
356
367
  var rows = [];
357
368
 
358
- for (var _i = 0; _i < renderedRows.length; _i += 1) {
369
+ for (var i = 0; i < renderedRows.length; i += 1) {
359
370
  var _rootProps$components;
360
371
 
361
- var _renderedRows$_i = renderedRows[_i],
362
- _id = _renderedRows$_i.id,
363
- _model = _renderedRows$_i.model;
364
- var lastVisibleRowIndex = firstRowToRender + _i === currentPage.rows.length - 1;
372
+ var _renderedRows$i = renderedRows[i],
373
+ _id = _renderedRows$i.id,
374
+ _model = _renderedRows$i.model;
375
+ var lastVisibleRowIndex = firstRowToRender + i === currentPage.rows.length - 1;
365
376
  var baseRowHeight = !apiRef.current.unstable_rowHasAutoHeight(_id) || ignoreAutoHeight ? apiRef.current.unstable_getRowHeight(_id) : 'auto';
366
377
  var isSelected = void 0;
367
378
 
@@ -388,7 +399,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
388
399
  firstColumnToRender: firstColumnToRender,
389
400
  lastColumnToRender: lastColumnToRender,
390
401
  selected: isSelected,
391
- index: currentPage.range.firstRowIndex + firstRowToRender + _i,
402
+ index: currentPage.range.firstRowIndex + firstRowToRender + i,
392
403
  containerWidth: availableSpace,
393
404
  isLastVisible: lastVisibleRowIndex
394
405
  }, typeof getRowProps === 'function' ? getRowProps(_id, _model) : {}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.row), _id));
@@ -4,7 +4,7 @@ export function useGridApiContext() {
4
4
  var apiRef = React.useContext(GridApiContext);
5
5
 
6
6
  if (apiRef === undefined) {
7
- throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid or DataGridPro parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
7
+ throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
8
8
  }
9
9
 
10
10
  return apiRef;
@@ -4,7 +4,7 @@ export var useGridRootProps = function useGridRootProps() {
4
4
  var contextValue = React.useContext(GridRootPropsContext);
5
5
 
6
6
  if (!contextValue) {
7
- throw new Error('MUI: useGridRootProps should only be used inside the DataGrid/DataGridPro component.');
7
+ throw new Error('MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.');
8
8
  }
9
9
 
10
10
  return contextValue;
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.12.2
1
+ /** @license MUI v5.13.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -23,9 +23,9 @@ var deDEGrid = {
23
23
  return count !== 1 ? "".concat(count, " aktive Filter") : "".concat(count, " aktiver Filter");
24
24
  },
25
25
  // Quick filter toolbar field
26
- // toolbarQuickFilterPlaceholder: 'Search...',
27
- // toolbarQuickFilterLabel: 'Search',
28
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
26
+ toolbarQuickFilterPlaceholder: 'Suchen...',
27
+ toolbarQuickFilterLabel: 'Suchen',
28
+ toolbarQuickFilterDeleteIconLabel: 'Löschen',
29
29
  // Export selector toolbar button text
30
30
  toolbarExport: 'Exportieren',
31
31
  toolbarExportLabel: 'Exportieren',
@@ -119,7 +119,7 @@ var deDEGrid = {
119
119
  return "Gruppierung nach ".concat(name, " aufheben");
120
120
  },
121
121
  // Master/detail
122
- // detailPanelToggle: 'Detail panel toggle',
122
+ detailPanelToggle: 'Detailansicht Kippschalter',
123
123
  expandDetailPanel: 'Aufklappen',
124
124
  collapseDetailPanel: 'Zuklappen',
125
125
  // Row reordering text
@@ -31,7 +31,7 @@ var frFRGrid = {
31
31
  toolbarExportLabel: 'Exporter',
32
32
  toolbarExportCSV: 'Télécharger en CSV',
33
33
  toolbarExportPrint: 'Imprimer',
34
- // toolbarExportExcel: 'Download as Excel',
34
+ toolbarExportExcel: 'Télécharger pour Excel',
35
35
  // Columns panel text
36
36
  columnsPanelTextFieldLabel: 'Chercher colonne',
37
37
  columnsPanelTextFieldPlaceholder: 'Titre de la colonne',
@@ -93,10 +93,10 @@ var frFRGrid = {
93
93
  },
94
94
  // Checkbox selection text
95
95
  checkboxSelectionHeaderName: 'Sélection',
96
- // checkboxSelectionSelectAllRows: 'Select all rows',
97
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
98
- // checkboxSelectionSelectRow: 'Select row',
99
- // checkboxSelectionUnselectRow: 'Unselect row',
96
+ checkboxSelectionSelectAllRows: 'Sélectionner toutes les lignes',
97
+ checkboxSelectionUnselectAllRows: 'Désélectionner toutes les lignes',
98
+ checkboxSelectionSelectRow: 'Sélectionner la ligne',
99
+ checkboxSelectionUnselectRow: 'Désélectionner la ligne',
100
100
  // Boolean cell text
101
101
  booleanCellTrueLabel: 'vrai',
102
102
  booleanCellFalseLabel: 'faux',
@@ -117,12 +117,12 @@ var frFRGrid = {
117
117
  },
118
118
  unGroupColumn: function unGroupColumn(name) {
119
119
  return "Arr\xEAter de grouper par ".concat(name);
120
- } // Master/detail
121
- // detailPanelToggle: 'Detail panel toggle',
122
- // expandDetailPanel: 'Expand',
123
- // collapseDetailPanel: 'Collapse',
120
+ },
121
+ // Master/detail
122
+ detailPanelToggle: 'Afficher/masquer les détails',
123
+ expandDetailPanel: 'Afficher',
124
+ collapseDetailPanel: 'Masquer',
124
125
  // Row reordering text
125
- // rowReorderingHeaderName: 'Row reordering',
126
-
126
+ rowReorderingHeaderName: 'Positionnement des lignes'
127
127
  };
128
128
  export var frFR = getGridLocalization(frFRGrid, frFRCore);
@@ -15,11 +15,14 @@ export * from './huHU';
15
15
  export * from './itIT';
16
16
  export * from './jaJP';
17
17
  export * from './koKR';
18
+ export * from './nbNO';
18
19
  export * from './nlNL';
19
20
  export * from './plPL';
20
21
  export * from './ptBR';
22
+ export * from './roRO';
21
23
  export * from './ruRU';
22
24
  export * from './skSK';
25
+ export * from './svSE';
23
26
  export * from './trTR';
24
27
  export * from './ukUA';
25
28
  export * from './viVN';
@@ -23,15 +23,15 @@ var nlNLGrid = {
23
23
  return count > 1 ? "".concat(count, " actieve filters") : "".concat(count, " filter actief");
24
24
  },
25
25
  // Quick filter toolbar field
26
- // toolbarQuickFilterPlaceholder: 'Search...',
27
- // toolbarQuickFilterLabel: 'Search',
28
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
26
+ toolbarQuickFilterPlaceholder: 'Zoeken...',
27
+ toolbarQuickFilterLabel: 'Zoeken',
28
+ toolbarQuickFilterDeleteIconLabel: 'Wissen',
29
29
  // Export selector toolbar button text
30
30
  toolbarExport: 'Exporteren',
31
31
  toolbarExportLabel: 'Exporteren',
32
32
  toolbarExportCSV: 'Exporteer naar CSV',
33
33
  toolbarExportPrint: 'Print',
34
- // toolbarExportExcel: 'Download as Excel',
34
+ toolbarExportExcel: 'Downloaden als Excel-bestand',
35
35
  // Columns panel text
36
36
  columnsPanelTextFieldLabel: 'Zoek kolom',
37
37
  columnsPanelTextFieldPlaceholder: 'Kolomtitel',
@@ -41,7 +41,7 @@ var nlNLGrid = {
41
41
  // Filter panel text
42
42
  filterPanelAddFilter: 'Filter toevoegen',
43
43
  filterPanelDeleteIconLabel: 'Verwijderen',
44
- // filterPanelLinkOperator: 'Logic operator',
44
+ filterPanelLinkOperator: 'Logische operator',
45
45
  filterPanelOperators: 'Operatoren',
46
46
  // TODO v6: rename to filterPanelOperator
47
47
  filterPanelOperatorAnd: 'En',
@@ -62,7 +62,7 @@ var nlNLGrid = {
62
62
  filterOperatorOnOrBefore: 'is gelijk of er voor',
63
63
  filterOperatorIsEmpty: 'is leeg',
64
64
  filterOperatorIsNotEmpty: 'is niet leeg',
65
- // filterOperatorIsAnyOf: 'is any of',
65
+ filterOperatorIsAnyOf: 'is een van',
66
66
  // Filter values text
67
67
  filterValueAny: 'alles',
68
68
  filterValueTrue: 'waar',
@@ -93,10 +93,10 @@ var nlNLGrid = {
93
93
  },
94
94
  // Checkbox selection text
95
95
  checkboxSelectionHeaderName: 'Checkbox selectie',
96
- // checkboxSelectionSelectAllRows: 'Select all rows',
97
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
98
- // checkboxSelectionSelectRow: 'Select row',
99
- // checkboxSelectionUnselectRow: 'Unselect row',
96
+ checkboxSelectionSelectAllRows: 'Alle rijen selecteren',
97
+ checkboxSelectionUnselectAllRows: 'Alle rijen de-selecteren',
98
+ checkboxSelectionSelectRow: 'Rij selecteren',
99
+ checkboxSelectionUnselectRow: 'Rij de-selecteren',
100
100
  // Boolean cell text
101
101
  booleanCellTrueLabel: 'waar',
102
102
  booleanCellFalseLabel: 'onwaar',
@@ -117,12 +117,12 @@ var nlNLGrid = {
117
117
  },
118
118
  unGroupColumn: function unGroupColumn(name) {
119
119
  return "Stop groeperen op ".concat(name);
120
- } // Master/detail
120
+ },
121
+ // Master/detail
121
122
  // detailPanelToggle: 'Detail panel toggle',
122
- // expandDetailPanel: 'Expand',
123
- // collapseDetailPanel: 'Collapse',
123
+ expandDetailPanel: 'Uitklappen',
124
+ collapseDetailPanel: 'Inklappen',
124
125
  // Row reordering text
125
- // rowReorderingHeaderName: 'Row reordering',
126
-
126
+ rowReorderingHeaderName: 'Rijen hersorteren'
127
127
  };
128
128
  export var nlNL = getGridLocalization(nlNLGrid, nlNLCore);
@@ -23,14 +23,14 @@ var ptBRGrid = {
23
23
  return "".concat(count, " ").concat(count !== 1 ? 'filtros' : 'filtro', " ").concat(count !== 1 ? 'ativos' : 'ativo');
24
24
  },
25
25
  // Quick filter toolbar field
26
- // toolbarQuickFilterPlaceholder: 'Search...',
27
- // toolbarQuickFilterLabel: 'Search',
28
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
26
+ toolbarQuickFilterPlaceholder: 'Procurar...',
27
+ toolbarQuickFilterLabel: 'Procurar',
28
+ toolbarQuickFilterDeleteIconLabel: 'Limpar',
29
29
  // Export selector toolbar button text
30
30
  toolbarExport: 'Exportar',
31
31
  toolbarExportLabel: 'Exportar',
32
32
  toolbarExportCSV: 'Baixar como CSV',
33
- toolbarExportPrint: 'Print',
33
+ toolbarExportPrint: 'Imprimir',
34
34
  toolbarExportExcel: 'Baixar como Excel',
35
35
  // Columns panel text
36
36
  columnsPanelTextFieldLabel: 'Localizar coluna',
@@ -62,7 +62,7 @@ var ptBRGrid = {
62
62
  filterOperatorOnOrBefore: 'em ou antes de',
63
63
  filterOperatorIsEmpty: 'está vazio',
64
64
  filterOperatorIsNotEmpty: 'não está vazio',
65
- // filterOperatorIsAnyOf: 'is any of',
65
+ filterOperatorIsAnyOf: 'é qualquer um dos',
66
66
  // Filter values text
67
67
  filterValueAny: 'qualquer',
68
68
  filterValueTrue: 'verdadeiro',
@@ -107,9 +107,9 @@ var ptBRGrid = {
107
107
  pinToRight: 'Fixar à direita',
108
108
  unpin: 'Desafixar',
109
109
  // Tree Data
110
- // treeDataGroupingHeaderName: 'Group',
111
- // treeDataExpand: 'see children',
112
- // treeDataCollapse: 'hide children',
110
+ treeDataGroupingHeaderName: 'Grupo',
111
+ treeDataExpand: 'mostrar filhos',
112
+ treeDataCollapse: 'esconder filhos',
113
113
  // Grouping columns
114
114
  groupingColumnHeaderName: 'Grupo',
115
115
  groupColumn: function groupColumn(name) {
@@ -121,8 +121,8 @@ var ptBRGrid = {
121
121
  // Master/detail
122
122
  detailPanelToggle: 'Painel de detalhes',
123
123
  expandDetailPanel: 'Expandir',
124
- collapseDetailPanel: 'Esconder' // Row reordering text
125
- // rowReorderingHeaderName: 'Row reordering',
126
-
124
+ collapseDetailPanel: 'Esconder',
125
+ // Row reordering text
126
+ rowReorderingHeaderName: 'Reorganizar linhas'
127
127
  };
128
128
  export var ptBR = getGridLocalization(ptBRGrid, ptBRCore);
@@ -0,0 +1,128 @@
1
+ import { roRO as roROCore } from '@mui/material/locale';
2
+ import { getGridLocalization } from '../utils/getGridLocalization';
3
+ var roROGrid = {
4
+ // Root
5
+ noRowsLabel: 'Lipsă date',
6
+ noResultsOverlayLabel: 'Nu au fost găsite rezultate.',
7
+ errorOverlayDefaultLabel: 'A apărut o eroare neașteptată.',
8
+ // Density selector toolbar button text
9
+ toolbarDensity: 'Înălțime rând',
10
+ toolbarDensityLabel: 'Înălțime rând',
11
+ toolbarDensityCompact: 'Compact',
12
+ toolbarDensityStandard: 'Standard',
13
+ toolbarDensityComfortable: 'Lat',
14
+ // Columns selector toolbar button text
15
+ toolbarColumns: 'Coloane',
16
+ toolbarColumnsLabel: 'Afișează selecție coloane',
17
+ // Filters toolbar button text
18
+ toolbarFilters: 'Filtru',
19
+ toolbarFiltersLabel: 'Afișează filtru',
20
+ toolbarFiltersTooltipHide: 'Ascunde filtru',
21
+ toolbarFiltersTooltipShow: 'Afișează filtru',
22
+ toolbarFiltersTooltipActive: function toolbarFiltersTooltipActive(count) {
23
+ return count !== 1 ? "".concat(count, " filtru activ") : "".concat(count, " filtru activ");
24
+ },
25
+ // Quick filter toolbar field
26
+ toolbarQuickFilterPlaceholder: 'Căutare...',
27
+ toolbarQuickFilterLabel: 'Căutare',
28
+ toolbarQuickFilterDeleteIconLabel: 'Ștergere',
29
+ // Export selector toolbar button text
30
+ toolbarExport: 'Export',
31
+ toolbarExportLabel: 'Export',
32
+ toolbarExportCSV: 'Download în format CSV',
33
+ toolbarExportPrint: 'Printare',
34
+ toolbarExportExcel: 'Download în format Excel',
35
+ // Columns panel text
36
+ columnsPanelTextFieldLabel: 'Găsește coloana',
37
+ columnsPanelTextFieldPlaceholder: 'Titlu coloană',
38
+ columnsPanelDragIconLabel: 'Resortare coloană',
39
+ columnsPanelShowAllButton: 'Afișează tot',
40
+ columnsPanelHideAllButton: 'Ascunde tot',
41
+ // Filter panel text
42
+ filterPanelAddFilter: 'Adăugare filtru',
43
+ filterPanelDeleteIconLabel: 'Ștergere',
44
+ filterPanelLinkOperator: 'Operatori logici',
45
+ filterPanelOperators: 'Operatori',
46
+ // TODO v6: rename to filterPanelOperator
47
+ filterPanelOperatorAnd: 'Și',
48
+ filterPanelOperatorOr: 'Sau',
49
+ filterPanelColumns: 'Coloane',
50
+ filterPanelInputLabel: 'Valoare',
51
+ filterPanelInputPlaceholder: 'Filtrare valoare',
52
+ // Filter operators text
53
+ filterOperatorContains: 'conține',
54
+ filterOperatorEquals: 'este egal cu',
55
+ filterOperatorStartsWith: 'începe cu',
56
+ filterOperatorEndsWith: 'se termină cu',
57
+ filterOperatorIs: 'este',
58
+ filterOperatorNot: 'nu este',
59
+ filterOperatorAfter: 'este după',
60
+ filterOperatorOnOrAfter: 'este la sau după',
61
+ filterOperatorBefore: 'este înainte de',
62
+ filterOperatorOnOrBefore: 'este la sau înainte de',
63
+ filterOperatorIsEmpty: 'este gol',
64
+ filterOperatorIsNotEmpty: 'nu este gol',
65
+ filterOperatorIsAnyOf: 'este una din valori',
66
+ // Filter values text
67
+ filterValueAny: 'Aleatoriu',
68
+ filterValueTrue: 'Da',
69
+ filterValueFalse: 'Nu',
70
+ // Column menu text
71
+ columnMenuLabel: 'Meniu',
72
+ columnMenuShowColumns: 'Afișează toate coloanele',
73
+ columnMenuFilter: 'Filtru',
74
+ columnMenuHideColumn: 'Ascunde',
75
+ columnMenuUnsort: 'Dezactivare sortare',
76
+ columnMenuSortAsc: 'Sortează crescător',
77
+ columnMenuSortDesc: 'Sortează descrescător',
78
+ // Column header text
79
+ columnHeaderFiltersTooltipActive: function columnHeaderFiltersTooltipActive(count) {
80
+ return count !== 1 ? "".concat(count, " filtru activ") : "".concat(count, " filtru activ");
81
+ },
82
+ columnHeaderFiltersLabel: 'Afișează filtru',
83
+ columnHeaderSortIconLabel: 'Sortare',
84
+ // Rows selected footer text
85
+ footerRowSelected: function footerRowSelected(count) {
86
+ return count !== 1 ? "".concat(count.toLocaleString(), " \xCEnregistr\u0103ri selectate") : "".concat(count.toLocaleString(), " \xCEnregistrare selectat\u0103");
87
+ },
88
+ // Total row amount footer text
89
+ footerTotalRows: 'Total:',
90
+ // Total visible row amount footer text
91
+ footerTotalVisibleRows: function footerTotalVisibleRows(visibleCount, totalCount) {
92
+ return "".concat(visibleCount.toLocaleString(), " din ").concat(totalCount.toLocaleString());
93
+ },
94
+ // Checkbox selection text
95
+ checkboxSelectionHeaderName: 'Checkbox Selecție',
96
+ checkboxSelectionSelectAllRows: 'Selectare toate rândurile',
97
+ checkboxSelectionUnselectAllRows: 'Deselectare toate rândurile',
98
+ checkboxSelectionSelectRow: 'Selectare rând',
99
+ checkboxSelectionUnselectRow: 'Deselectare rând',
100
+ // Boolean cell text
101
+ booleanCellTrueLabel: 'Da',
102
+ booleanCellFalseLabel: 'Nu',
103
+ // Actions cell more text
104
+ actionsCellMore: 'Mai multe',
105
+ // Column pinning text
106
+ pinToLeft: 'Fixare în stânga',
107
+ pinToRight: 'Fixare în dreapta',
108
+ unpin: 'Anulare fixare',
109
+ // Tree Data
110
+ treeDataGroupingHeaderName: 'Grup',
111
+ treeDataExpand: 'Afișare copii',
112
+ treeDataCollapse: 'Ascundere copii',
113
+ // Grouping columns
114
+ groupingColumnHeaderName: 'Grupare',
115
+ groupColumn: function groupColumn(name) {
116
+ return "Grupare dup\u0103 ".concat(name);
117
+ },
118
+ unGroupColumn: function unGroupColumn(name) {
119
+ return "Anulare Grupare dup\u0103 ".concat(name);
120
+ },
121
+ // Master/detail
122
+ detailPanelToggle: 'Comutare panou detalii',
123
+ expandDetailPanel: 'Extindere',
124
+ collapseDetailPanel: 'Restrângere',
125
+ // Row reordering text
126
+ rowReorderingHeaderName: 'Reordonare rânduri'
127
+ };
128
+ export var roRO = getGridLocalization(roROGrid, roROCore);
@@ -31,15 +31,15 @@ var skSKGrid = {
31
31
  return "".concat(count, " ").concat(pluralForm);
32
32
  },
33
33
  // Quick filter toolbar field
34
- // toolbarQuickFilterPlaceholder: 'Search...',
35
- // toolbarQuickFilterLabel: 'Search',
36
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
34
+ toolbarQuickFilterPlaceholder: 'Vyhľadať...',
35
+ toolbarQuickFilterLabel: 'Vyhľadať',
36
+ toolbarQuickFilterDeleteIconLabel: 'Vymazať',
37
37
  // Export selector toolbar button text
38
38
  toolbarExport: 'Export',
39
39
  toolbarExportLabel: 'Export',
40
40
  toolbarExportCSV: 'Stiahnuť ako CSV',
41
41
  toolbarExportPrint: 'Vytlačiť',
42
- // toolbarExportExcel: 'Download as Excel',
42
+ toolbarExportExcel: 'Stiahnuť ako Excel',
43
43
  // Columns panel text
44
44
  columnsPanelTextFieldLabel: 'Nájsť stĺpec',
45
45
  columnsPanelTextFieldPlaceholder: 'Názov stĺpca',
@@ -49,7 +49,7 @@ var skSKGrid = {
49
49
  // Filter panel text
50
50
  filterPanelAddFilter: 'Pridať filter',
51
51
  filterPanelDeleteIconLabel: 'Odstrániť',
52
- // filterPanelLinkOperator: 'Logic operator',
52
+ filterPanelLinkOperator: 'Logický operátor',
53
53
  filterPanelOperators: 'Operátory',
54
54
  // TODO v6: rename to filterPanelOperator
55
55
  filterPanelOperatorAnd: 'A',
@@ -70,7 +70,7 @@ var skSKGrid = {
70
70
  filterOperatorOnOrBefore: 'je na alebo skôr',
71
71
  filterOperatorIsEmpty: 'je prázdny',
72
72
  filterOperatorIsNotEmpty: 'nie je prázdny',
73
- // filterOperatorIsAnyOf: 'is any of',
73
+ filterOperatorIsAnyOf: 'je jeden z',
74
74
  // Filter values text
75
75
  filterValueAny: 'akýkoľvek',
76
76
  filterValueTrue: 'áno',
@@ -120,10 +120,10 @@ var skSKGrid = {
120
120
  },
121
121
  // Checkbox selection text
122
122
  checkboxSelectionHeaderName: 'Výber riadku',
123
- // checkboxSelectionSelectAllRows: 'Select all rows',
124
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
125
- // checkboxSelectionSelectRow: 'Select row',
126
- // checkboxSelectionUnselectRow: 'Unselect row',
123
+ checkboxSelectionSelectAllRows: 'Vybrať všetky riadky',
124
+ checkboxSelectionUnselectAllRows: 'Zrušiť výber všetkých riadkov',
125
+ checkboxSelectionSelectRow: 'Vyber riadok',
126
+ checkboxSelectionUnselectRow: 'Zruš výber riadku',
127
127
  // Boolean cell text
128
128
  booleanCellTrueLabel: 'áno',
129
129
  booleanCellFalseLabel: 'nie',
@@ -144,12 +144,12 @@ var skSKGrid = {
144
144
  },
145
145
  unGroupColumn: function unGroupColumn(name) {
146
146
  return "Presta\u0165 zoskupova\u0165 pod\u013Ea ".concat(name);
147
- } // Master/detail
148
- // detailPanelToggle: 'Detail panel toggle',
149
- // expandDetailPanel: 'Expand',
150
- // collapseDetailPanel: 'Collapse',
147
+ },
148
+ // Master/detail
149
+ detailPanelToggle: 'Prepnúť detail panelu',
150
+ expandDetailPanel: 'Rozbaliť',
151
+ collapseDetailPanel: 'Zbaliť',
151
152
  // Row reordering text
152
- // rowReorderingHeaderName: 'Row reordering',
153
-
153
+ rowReorderingHeaderName: 'Preusporiadávanie riadkov'
154
154
  };
155
155
  export var skSK = getGridLocalization(skSKGrid, skSKCore);