@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.
- package/CHANGELOG.md +50 -0
- package/colDef/gridDateOperators.js +4 -2
- package/colDef/gridNumericOperators.js +4 -2
- package/colDef/gridStringOperators.js +4 -2
- package/hooks/features/editRows/useGridCellEditing.new.js +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +1 -1
- package/hooks/features/filter/useGridFilter.js +19 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
- package/index.js +1 -1
- package/legacy/colDef/gridDateOperators.js +4 -2
- package/legacy/colDef/gridNumericOperators.js +4 -2
- package/legacy/colDef/gridStringOperators.js +4 -2
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +1 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +1 -1
- package/legacy/hooks/features/filter/useGridFilter.js +19 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
- package/legacy/index.js +1 -1
- package/legacy/locales/deDE.js +4 -4
- package/legacy/locales/frFR.js +11 -11
- package/legacy/locales/nlNL.js +15 -15
- package/legacy/locales/ptBR.js +11 -11
- package/legacy/locales/roRO.js +4 -4
- package/locales/deDE.js +4 -4
- package/locales/frFR.js +11 -11
- package/locales/nlNL.js +15 -15
- package/locales/ptBR.js +11 -11
- package/locales/roRO.js +4 -4
- package/models/gridFilterOperator.d.ts +6 -0
- package/modern/colDef/gridDateOperators.js +4 -2
- package/modern/colDef/gridNumericOperators.js +4 -2
- package/modern/colDef/gridStringOperators.js +4 -2
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +1 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +1 -1
- package/modern/hooks/features/filter/useGridFilter.js +17 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -3
- package/modern/index.js +1 -1
- package/modern/locales/deDE.js +4 -4
- package/modern/locales/frFR.js +11 -11
- package/modern/locales/nlNL.js +15 -15
- package/modern/locales/ptBR.js +11 -11
- package/modern/locales/roRO.js +4 -4
- package/node/colDef/gridDateOperators.js +4 -2
- package/node/colDef/gridNumericOperators.js +4 -2
- package/node/colDef/gridStringOperators.js +4 -2
- package/node/hooks/features/editRows/useGridCellEditing.new.js +1 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +1 -1
- package/node/hooks/features/filter/useGridFilter.js +19 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
- package/node/index.js +1 -1
- package/node/locales/deDE.js +4 -4
- package/node/locales/frFR.js +11 -11
- package/node/locales/nlNL.js +15 -15
- package/node/locales/ptBR.js +11 -11
- package/node/locales/roRO.js +4 -4
- 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 =>
|
|
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
|
-
|
|
127
|
-
|
|
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
package/node/locales/deDE.js
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
119
|
+
detailPanelToggle: 'Detailansicht Kippschalter',
|
|
120
120
|
expandDetailPanel: 'Aufklappen',
|
|
121
121
|
collapseDetailPanel: 'Zuklappen',
|
|
122
122
|
// Row reordering text
|
package/node/locales/frFR.js
CHANGED
|
@@ -38,7 +38,7 @@ const frFRGrid = {
|
|
|
38
38
|
toolbarExportLabel: 'Exporter',
|
|
39
39
|
toolbarExportCSV: 'Télécharger en CSV',
|
|
40
40
|
toolbarExportPrint: 'Imprimer',
|
|
41
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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}
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
123
|
-
|
|
123
|
+
rowReorderingHeaderName: 'Positionnement des lignes'
|
|
124
124
|
};
|
|
125
125
|
const frFR = (0, _getGridLocalization.getGridLocalization)(frFRGrid, _locale.frFR);
|
|
126
126
|
exports.frFR = frFR;
|
package/node/locales/nlNL.js
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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}
|
|
117
|
+
unGroupColumn: name => `Stop groeperen op ${name}`,
|
|
118
|
+
// Master/detail
|
|
118
119
|
// detailPanelToggle: 'Detail panel toggle',
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
expandDetailPanel: 'Uitklappen',
|
|
121
|
+
collapseDetailPanel: 'Inklappen',
|
|
121
122
|
// Row reordering text
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
rowReorderingHeaderName: 'Rijen hersorteren'
|
|
124
124
|
};
|
|
125
125
|
const nlNL = (0, _getGridLocalization.getGridLocalization)(nlNLGrid, _locale.nlNL);
|
|
126
126
|
exports.nlNL = nlNL;
|
package/node/locales/ptBR.js
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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: '
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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'
|
|
122
|
-
//
|
|
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;
|
package/node/locales/roRO.js
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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",
|