@mui/x-data-grid 5.13.0 → 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 (55) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/colDef/gridDateOperators.js +4 -2
  3. package/colDef/gridNumericOperators.js +4 -2
  4. package/colDef/gridStringOperators.js +4 -2
  5. package/hooks/features/editRows/useGridCellEditing.new.js +1 -1
  6. package/hooks/features/editRows/useGridRowEditing.new.js +1 -1
  7. package/hooks/features/filter/useGridFilter.js +19 -1
  8. package/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  9. package/index.js +1 -1
  10. package/legacy/colDef/gridDateOperators.js +4 -2
  11. package/legacy/colDef/gridNumericOperators.js +4 -2
  12. package/legacy/colDef/gridStringOperators.js +4 -2
  13. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +1 -1
  14. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +1 -1
  15. package/legacy/hooks/features/filter/useGridFilter.js +19 -1
  16. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
  17. package/legacy/index.js +1 -1
  18. package/legacy/locales/deDE.js +4 -4
  19. package/legacy/locales/frFR.js +11 -11
  20. package/legacy/locales/nlNL.js +15 -15
  21. package/legacy/locales/ptBR.js +11 -11
  22. package/legacy/locales/roRO.js +4 -4
  23. package/locales/deDE.js +4 -4
  24. package/locales/frFR.js +11 -11
  25. package/locales/nlNL.js +15 -15
  26. package/locales/ptBR.js +11 -11
  27. package/locales/roRO.js +4 -4
  28. package/models/gridFilterOperator.d.ts +6 -0
  29. package/modern/colDef/gridDateOperators.js +4 -2
  30. package/modern/colDef/gridNumericOperators.js +4 -2
  31. package/modern/colDef/gridStringOperators.js +4 -2
  32. package/modern/hooks/features/editRows/useGridCellEditing.new.js +1 -1
  33. package/modern/hooks/features/editRows/useGridRowEditing.new.js +1 -1
  34. package/modern/hooks/features/filter/useGridFilter.js +17 -1
  35. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -3
  36. package/modern/index.js +1 -1
  37. package/modern/locales/deDE.js +4 -4
  38. package/modern/locales/frFR.js +11 -11
  39. package/modern/locales/nlNL.js +15 -15
  40. package/modern/locales/ptBR.js +11 -11
  41. package/modern/locales/roRO.js +4 -4
  42. package/node/colDef/gridDateOperators.js +4 -2
  43. package/node/colDef/gridNumericOperators.js +4 -2
  44. package/node/colDef/gridStringOperators.js +4 -2
  45. package/node/hooks/features/editRows/useGridCellEditing.new.js +1 -1
  46. package/node/hooks/features/editRows/useGridRowEditing.new.js +1 -1
  47. package/node/hooks/features/filter/useGridFilter.js +19 -1
  48. package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  49. package/node/index.js +1 -1
  50. package/node/locales/deDE.js +4 -4
  51. package/node/locales/frFR.js +11 -11
  52. package/node/locales/nlNL.js +15 -15
  53. package/node/locales/ptBR.js +11 -11
  54. package/node/locales/roRO.js +4 -4
  55. package/package.json +2 -2
@@ -146,7 +146,25 @@ const useGridFilter = (apiRef, props) => {
146
146
 
147
147
  if (targetColumnField) {
148
148
  const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
149
- const filterItemsWithValue = filterModel.items.filter(item => item.value !== undefined);
149
+ const filterItemsWithValue = filterModel.items.filter(item => {
150
+ var _column$filterOperato;
151
+
152
+ if (item.value !== undefined) {
153
+ return true;
154
+ }
155
+
156
+ const column = apiRef.current.getColumn(item.columnField);
157
+ const filterOperator = (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.find(operator => operator.value === item.operatorValue);
158
+ const 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`.
159
+ // So we don't want to remove them from the filter model if `item.value === undefined`.
160
+ // See https://github.com/mui/mui-x/issues/5402
161
+
162
+ if (requiresFilterValue) {
163
+ return false;
164
+ }
165
+
166
+ return true;
167
+ });
150
168
  let newFilterItems;
151
169
  const filterItemOnTarget = filterItemsWithValue.find(item => item.columnField === targetColumnField);
152
170
 
@@ -91,6 +91,8 @@ const getRenderableIndexes = ({
91
91
  exports.getRenderableIndexes = getRenderableIndexes;
92
92
 
93
93
  const useGridVirtualScroller = props => {
94
+ var _currentPage$range3, _currentPage$range4;
95
+
94
96
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
95
97
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
96
98
  const visibleColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector);
@@ -123,8 +125,17 @@ const useGridVirtualScroller = props => {
123
125
  const [containerWidth, setContainerWidth] = React.useState(null);
124
126
  const prevTotalWidth = React.useRef(columnsTotalWidth);
125
127
  const getNearestIndexToRender = React.useCallback(offset => {
126
- const lastMeasuredIndex = Math.max(0, apiRef.current.unstable_getLastMeasuredRowIndex());
127
- const allRowsMeasured = lastMeasuredIndex === Infinity;
128
+ var _currentPage$range, _currentPage$range2;
129
+
130
+ const lastMeasuredIndexRelativeToAllRows = apiRef.current.unstable_getLastMeasuredRowIndex();
131
+ const lastMeasuredIndexRelativeToCurrentPage = lastMeasuredIndexRelativeToAllRows - (((_currentPage$range = currentPage.range) == null ? void 0 : _currentPage$range.firstRowIndex) || 0);
132
+ const lastMeasuredIndex = Math.max(0, lastMeasuredIndexRelativeToCurrentPage);
133
+ let allRowsMeasured = lastMeasuredIndex === Infinity;
134
+
135
+ if ((_currentPage$range2 = currentPage.range) != null && _currentPage$range2.lastRowIndex && !allRowsMeasured) {
136
+ // Check if all rows in this page are already measured
137
+ allRowsMeasured = lastMeasuredIndex >= currentPage.range.lastRowIndex;
138
+ }
128
139
 
129
140
  if (allRowsMeasured || rowsMeta.positions[lastMeasuredIndex] >= offset) {
130
141
  // If all rows were measured (when no row has "auto" as height) or all rows before the offset
@@ -137,7 +148,7 @@ const useGridVirtualScroller = props => {
137
148
 
138
149
 
139
150
  return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndex);
140
- }, [apiRef, rowsMeta.positions]);
151
+ }, [apiRef, (_currentPage$range3 = currentPage.range) == null ? void 0 : _currentPage$range3.firstRowIndex, (_currentPage$range4 = currentPage.range) == null ? void 0 : _currentPage$range4.lastRowIndex, rowsMeta.positions]);
141
152
  const computeRenderContext = React.useCallback(() => {
142
153
  if (disableVirtualization) {
143
154
  return {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.13.0
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.
@@ -30,9 +30,9 @@ const deDEGrid = {
30
30
  toolbarFiltersTooltipShow: 'Zeige Filter',
31
31
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive Filter` : `${count} aktiver Filter`,
32
32
  // Quick filter toolbar field
33
- // toolbarQuickFilterPlaceholder: 'Search...',
34
- // toolbarQuickFilterLabel: 'Search',
35
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
33
+ toolbarQuickFilterPlaceholder: 'Suchen...',
34
+ toolbarQuickFilterLabel: 'Suchen',
35
+ toolbarQuickFilterDeleteIconLabel: 'Löschen',
36
36
  // Export selector toolbar button text
37
37
  toolbarExport: 'Exportieren',
38
38
  toolbarExportLabel: 'Exportieren',
@@ -116,7 +116,7 @@ const deDEGrid = {
116
116
  groupColumn: name => `Gruppieren nach ${name}`,
117
117
  unGroupColumn: name => `Gruppierung nach ${name} aufheben`,
118
118
  // Master/detail
119
- // detailPanelToggle: 'Detail panel toggle',
119
+ detailPanelToggle: 'Detailansicht Kippschalter',
120
120
  expandDetailPanel: 'Aufklappen',
121
121
  collapseDetailPanel: 'Zuklappen',
122
122
  // Row reordering text
@@ -38,7 +38,7 @@ const frFRGrid = {
38
38
  toolbarExportLabel: 'Exporter',
39
39
  toolbarExportCSV: 'Télécharger en CSV',
40
40
  toolbarExportPrint: 'Imprimer',
41
- // toolbarExportExcel: 'Download as Excel',
41
+ toolbarExportExcel: 'Télécharger pour Excel',
42
42
  // Columns panel text
43
43
  columnsPanelTextFieldLabel: 'Chercher colonne',
44
44
  columnsPanelTextFieldPlaceholder: 'Titre de la colonne',
@@ -94,10 +94,10 @@ const frFRGrid = {
94
94
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} sur ${totalCount.toLocaleString()}`,
95
95
  // Checkbox selection text
96
96
  checkboxSelectionHeaderName: 'Sélection',
97
- // checkboxSelectionSelectAllRows: 'Select all rows',
98
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
99
- // checkboxSelectionSelectRow: 'Select row',
100
- // checkboxSelectionUnselectRow: 'Unselect row',
97
+ checkboxSelectionSelectAllRows: 'Sélectionner toutes les lignes',
98
+ checkboxSelectionUnselectAllRows: 'Désélectionner toutes les lignes',
99
+ checkboxSelectionSelectRow: 'Sélectionner la ligne',
100
+ checkboxSelectionUnselectRow: 'Désélectionner la ligne',
101
101
  // Boolean cell text
102
102
  booleanCellTrueLabel: 'vrai',
103
103
  booleanCellFalseLabel: 'faux',
@@ -114,13 +114,13 @@ const frFRGrid = {
114
114
  // Grouping columns
115
115
  groupingColumnHeaderName: 'Groupe',
116
116
  groupColumn: name => `Grouper par ${name}`,
117
- unGroupColumn: name => `Arrêter de grouper par ${name}` // Master/detail
118
- // detailPanelToggle: 'Detail panel toggle',
119
- // expandDetailPanel: 'Expand',
120
- // collapseDetailPanel: 'Collapse',
117
+ unGroupColumn: name => `Arrêter de grouper par ${name}`,
118
+ // Master/detail
119
+ detailPanelToggle: 'Afficher/masquer les détails',
120
+ expandDetailPanel: 'Afficher',
121
+ collapseDetailPanel: 'Masquer',
121
122
  // Row reordering text
122
- // rowReorderingHeaderName: 'Row reordering',
123
-
123
+ rowReorderingHeaderName: 'Positionnement des lignes'
124
124
  };
125
125
  const frFR = (0, _getGridLocalization.getGridLocalization)(frFRGrid, _locale.frFR);
126
126
  exports.frFR = frFR;
@@ -30,15 +30,15 @@ const nlNLGrid = {
30
30
  toolbarFiltersTooltipShow: 'Toon filters',
31
31
  toolbarFiltersTooltipActive: count => count > 1 ? `${count} actieve filters` : `${count} filter actief`,
32
32
  // Quick filter toolbar field
33
- // toolbarQuickFilterPlaceholder: 'Search...',
34
- // toolbarQuickFilterLabel: 'Search',
35
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
33
+ toolbarQuickFilterPlaceholder: 'Zoeken...',
34
+ toolbarQuickFilterLabel: 'Zoeken',
35
+ toolbarQuickFilterDeleteIconLabel: 'Wissen',
36
36
  // Export selector toolbar button text
37
37
  toolbarExport: 'Exporteren',
38
38
  toolbarExportLabel: 'Exporteren',
39
39
  toolbarExportCSV: 'Exporteer naar CSV',
40
40
  toolbarExportPrint: 'Print',
41
- // toolbarExportExcel: 'Download as Excel',
41
+ toolbarExportExcel: 'Downloaden als Excel-bestand',
42
42
  // Columns panel text
43
43
  columnsPanelTextFieldLabel: 'Zoek kolom',
44
44
  columnsPanelTextFieldPlaceholder: 'Kolomtitel',
@@ -48,7 +48,7 @@ const nlNLGrid = {
48
48
  // Filter panel text
49
49
  filterPanelAddFilter: 'Filter toevoegen',
50
50
  filterPanelDeleteIconLabel: 'Verwijderen',
51
- // filterPanelLinkOperator: 'Logic operator',
51
+ filterPanelLinkOperator: 'Logische operator',
52
52
  filterPanelOperators: 'Operatoren',
53
53
  // TODO v6: rename to filterPanelOperator
54
54
  filterPanelOperatorAnd: 'En',
@@ -69,7 +69,7 @@ const nlNLGrid = {
69
69
  filterOperatorOnOrBefore: 'is gelijk of er voor',
70
70
  filterOperatorIsEmpty: 'is leeg',
71
71
  filterOperatorIsNotEmpty: 'is niet leeg',
72
- // filterOperatorIsAnyOf: 'is any of',
72
+ filterOperatorIsAnyOf: 'is een van',
73
73
  // Filter values text
74
74
  filterValueAny: 'alles',
75
75
  filterValueTrue: 'waar',
@@ -94,10 +94,10 @@ const nlNLGrid = {
94
94
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} van ${totalCount.toLocaleString()}`,
95
95
  // Checkbox selection text
96
96
  checkboxSelectionHeaderName: 'Checkbox selectie',
97
- // checkboxSelectionSelectAllRows: 'Select all rows',
98
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
99
- // checkboxSelectionSelectRow: 'Select row',
100
- // checkboxSelectionUnselectRow: 'Unselect row',
97
+ checkboxSelectionSelectAllRows: 'Alle rijen selecteren',
98
+ checkboxSelectionUnselectAllRows: 'Alle rijen de-selecteren',
99
+ checkboxSelectionSelectRow: 'Rij selecteren',
100
+ checkboxSelectionUnselectRow: 'Rij de-selecteren',
101
101
  // Boolean cell text
102
102
  booleanCellTrueLabel: 'waar',
103
103
  booleanCellFalseLabel: 'onwaar',
@@ -114,13 +114,13 @@ const nlNLGrid = {
114
114
  // Grouping columns
115
115
  groupingColumnHeaderName: 'Groep',
116
116
  groupColumn: name => `Groepeer op ${name}`,
117
- unGroupColumn: name => `Stop groeperen op ${name}` // Master/detail
117
+ unGroupColumn: name => `Stop groeperen op ${name}`,
118
+ // Master/detail
118
119
  // detailPanelToggle: 'Detail panel toggle',
119
- // expandDetailPanel: 'Expand',
120
- // collapseDetailPanel: 'Collapse',
120
+ expandDetailPanel: 'Uitklappen',
121
+ collapseDetailPanel: 'Inklappen',
121
122
  // Row reordering text
122
- // rowReorderingHeaderName: 'Row reordering',
123
-
123
+ rowReorderingHeaderName: 'Rijen hersorteren'
124
124
  };
125
125
  const nlNL = (0, _getGridLocalization.getGridLocalization)(nlNLGrid, _locale.nlNL);
126
126
  exports.nlNL = nlNL;
@@ -30,14 +30,14 @@ const ptBRGrid = {
30
30
  toolbarFiltersTooltipShow: 'Exibir filtros',
31
31
  toolbarFiltersTooltipActive: count => `${count} ${count !== 1 ? 'filtros' : 'filtro'} ${count !== 1 ? 'ativos' : 'ativo'}`,
32
32
  // Quick filter toolbar field
33
- // toolbarQuickFilterPlaceholder: 'Search...',
34
- // toolbarQuickFilterLabel: 'Search',
35
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
33
+ toolbarQuickFilterPlaceholder: 'Procurar...',
34
+ toolbarQuickFilterLabel: 'Procurar',
35
+ toolbarQuickFilterDeleteIconLabel: 'Limpar',
36
36
  // Export selector toolbar button text
37
37
  toolbarExport: 'Exportar',
38
38
  toolbarExportLabel: 'Exportar',
39
39
  toolbarExportCSV: 'Baixar como CSV',
40
- toolbarExportPrint: 'Print',
40
+ toolbarExportPrint: 'Imprimir',
41
41
  toolbarExportExcel: 'Baixar como Excel',
42
42
  // Columns panel text
43
43
  columnsPanelTextFieldLabel: 'Localizar coluna',
@@ -69,7 +69,7 @@ const ptBRGrid = {
69
69
  filterOperatorOnOrBefore: 'em ou antes de',
70
70
  filterOperatorIsEmpty: 'está vazio',
71
71
  filterOperatorIsNotEmpty: 'não está vazio',
72
- // filterOperatorIsAnyOf: 'is any of',
72
+ filterOperatorIsAnyOf: 'é qualquer um dos',
73
73
  // Filter values text
74
74
  filterValueAny: 'qualquer',
75
75
  filterValueTrue: 'verdadeiro',
@@ -108,9 +108,9 @@ const ptBRGrid = {
108
108
  pinToRight: 'Fixar à direita',
109
109
  unpin: 'Desafixar',
110
110
  // Tree Data
111
- // treeDataGroupingHeaderName: 'Group',
112
- // treeDataExpand: 'see children',
113
- // treeDataCollapse: 'hide children',
111
+ treeDataGroupingHeaderName: 'Grupo',
112
+ treeDataExpand: 'mostrar filhos',
113
+ treeDataCollapse: 'esconder filhos',
114
114
  // Grouping columns
115
115
  groupingColumnHeaderName: 'Grupo',
116
116
  groupColumn: name => `Agrupar por ${name}`,
@@ -118,9 +118,9 @@ const ptBRGrid = {
118
118
  // Master/detail
119
119
  detailPanelToggle: 'Painel de detalhes',
120
120
  expandDetailPanel: 'Expandir',
121
- collapseDetailPanel: 'Esconder' // Row reordering text
122
- // rowReorderingHeaderName: 'Row reordering',
123
-
121
+ collapseDetailPanel: 'Esconder',
122
+ // Row reordering text
123
+ rowReorderingHeaderName: 'Reorganizar linhas'
124
124
  };
125
125
  const ptBR = (0, _getGridLocalization.getGridLocalization)(ptBRGrid, _locale.ptBR);
126
126
  exports.ptBR = ptBR;
@@ -30,9 +30,9 @@ const roROGrid = {
30
30
  toolbarFiltersTooltipShow: 'Afișează filtru',
31
31
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} filtru activ` : `${count} filtru activ`,
32
32
  // Quick filter toolbar field
33
- // toolbarQuickFilterPlaceholder: 'Search...',
34
- // toolbarQuickFilterLabel: 'Search',
35
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
33
+ toolbarQuickFilterPlaceholder: 'Căutare...',
34
+ toolbarQuickFilterLabel: 'Căutare',
35
+ toolbarQuickFilterDeleteIconLabel: 'Ștergere',
36
36
  // Export selector toolbar button text
37
37
  toolbarExport: 'Export',
38
38
  toolbarExportLabel: 'Export',
@@ -116,7 +116,7 @@ const roROGrid = {
116
116
  groupColumn: name => `Grupare după ${name}`,
117
117
  unGroupColumn: name => `Anulare Grupare după ${name}`,
118
118
  // Master/detail
119
- // detailPanelToggle: 'Detail panel toggle',
119
+ detailPanelToggle: 'Comutare panou detalii',
120
120
  expandDetailPanel: 'Extindere',
121
121
  collapseDetailPanel: 'Restrângere',
122
122
  // Row reordering text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "5.13.0",
3
+ "version": "5.13.1",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -35,7 +35,7 @@
35
35
  "directory": "packages/grid/x-data-grid"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.17.2",
38
+ "@babel/runtime": "^7.18.6",
39
39
  "@mui/utils": "^5.4.1",
40
40
  "clsx": "^1.2.1",
41
41
  "prop-types": "^15.8.1",