@mui/x-data-grid 7.11.0 → 7.11.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 +84 -0
- package/components/panel/GridPreferencesPanel.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.js +3 -4
- package/hooks/core/useGridApiInitialization.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +2 -3
- package/hooks/features/editing/useGridRowEditing.js +2 -3
- package/hooks/features/export/serializers/csvSerializer.js +7 -8
- package/hooks/features/filter/gridFilterUtils.js +12 -9
- package/hooks/features/sorting/gridSortingUtils.js +2 -3
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -0
- package/hooks/utils/useGridSelector.js +2 -3
- package/index.js +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -1
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/internals/utils/propValidation.d.ts +0 -1
- package/internals/utils/propValidation.js +4 -13
- package/internals/utils/warning.d.ts +2 -0
- package/internals/utils/warning.js +21 -0
- package/locales/deDE.js +1 -2
- package/locales/index.d.ts +2 -0
- package/locales/index.js +3 -1
- package/locales/isIS.d.ts +2 -0
- package/locales/isIS.js +149 -0
- package/locales/nbNO.js +30 -32
- package/locales/nnNO.d.ts +2 -0
- package/locales/nnNO.js +148 -0
- package/modern/components/panel/GridPreferencesPanel.js +3 -4
- package/modern/hooks/core/useGridApiInitialization.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +2 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -3
- package/modern/hooks/features/export/serializers/csvSerializer.js +7 -8
- package/modern/hooks/features/filter/gridFilterUtils.js +12 -9
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -3
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -0
- package/modern/hooks/utils/useGridSelector.js +2 -3
- package/modern/index.js +1 -1
- package/modern/internals/index.js +0 -1
- package/modern/internals/utils/index.js +2 -1
- package/modern/internals/utils/propValidation.js +4 -13
- package/modern/internals/utils/warning.js +21 -0
- package/modern/locales/deDE.js +1 -2
- package/modern/locales/index.js +3 -1
- package/modern/locales/isIS.js +149 -0
- package/modern/locales/nbNO.js +30 -32
- package/modern/locales/nnNO.js +148 -0
- package/modern/utils/createSelector.js +2 -3
- package/node/components/panel/GridPreferencesPanel.js +4 -5
- package/node/hooks/core/useGridApiInitialization.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +2 -3
- package/node/hooks/features/export/serializers/csvSerializer.js +7 -8
- package/node/hooks/features/filter/gridFilterUtils.js +12 -9
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -3
- package/node/hooks/utils/useGridApiEventHandler.js +1 -0
- package/node/hooks/utils/useGridSelector.js +2 -3
- package/node/index.js +1 -1
- package/node/internals/index.js +0 -8
- package/node/internals/utils/index.js +11 -0
- package/node/internals/utils/propValidation.js +4 -14
- package/node/internals/utils/warning.js +28 -0
- package/node/locales/deDE.js +1 -2
- package/node/locales/index.js +22 -0
- package/node/locales/isIS.js +155 -0
- package/node/locales/nbNO.js +30 -32
- package/node/locales/nnNO.js +154 -0
- package/node/utils/createSelector.js +2 -3
- package/package.json +4 -4
- package/utils/createSelector.js +2 -3
- package/modern/utils/warning.js +0 -24
- package/node/utils/warning.js +0 -32
- package/utils/warning.d.ts +0 -2
- package/utils/warning.js +0 -24
package/locales/nbNO.js
CHANGED
|
@@ -16,7 +16,7 @@ const nbNOGrid = {
|
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filter',
|
|
18
18
|
toolbarFiltersLabel: 'Vis filter',
|
|
19
|
-
toolbarFiltersTooltipHide: 'Skjul
|
|
19
|
+
toolbarFiltersTooltipHide: 'Skjul filter',
|
|
20
20
|
toolbarFiltersTooltipShow: 'Vis filter',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
|
|
22
22
|
// Quick filter toolbar field
|
|
@@ -39,7 +39,7 @@ const nbNOGrid = {
|
|
|
39
39
|
filterPanelRemoveAll: 'Fjern alle',
|
|
40
40
|
filterPanelDeleteIconLabel: 'Slett',
|
|
41
41
|
filterPanelLogicOperator: 'Logisk operator',
|
|
42
|
-
filterPanelOperator: '
|
|
42
|
+
filterPanelOperator: 'Operator',
|
|
43
43
|
filterPanelOperatorAnd: 'Og',
|
|
44
44
|
filterPanelOperatorOr: 'Eller',
|
|
45
45
|
filterPanelColumns: 'Kolonner',
|
|
@@ -59,34 +59,32 @@ const nbNOGrid = {
|
|
|
59
59
|
filterOperatorIsEmpty: 'er tom',
|
|
60
60
|
filterOperatorIsNotEmpty: 'er ikke tom',
|
|
61
61
|
filterOperatorIsAnyOf: 'er en av',
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
'filterOperator=': '=',
|
|
63
|
+
'filterOperator!=': '!=',
|
|
64
|
+
'filterOperator>': '>',
|
|
65
|
+
'filterOperator>=': '>=',
|
|
66
|
+
'filterOperator<': '<',
|
|
67
|
+
'filterOperator<=': '<=',
|
|
69
68
|
// Header filter operators text
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
headerFilterOperatorContains: 'Inneholder',
|
|
70
|
+
headerFilterOperatorEquals: 'Lik',
|
|
71
|
+
headerFilterOperatorStartsWith: 'Starter på',
|
|
72
|
+
headerFilterOperatorEndsWith: 'Slutter på',
|
|
73
|
+
headerFilterOperatorIs: 'Er',
|
|
74
|
+
headerFilterOperatorNot: 'Er ikke',
|
|
75
|
+
headerFilterOperatorAfter: 'Er etter',
|
|
76
|
+
headerFilterOperatorOnOrAfter: 'Er på eller etter',
|
|
77
|
+
headerFilterOperatorBefore: 'Er før',
|
|
78
|
+
headerFilterOperatorOnOrBefore: 'Er på eller før',
|
|
79
|
+
headerFilterOperatorIsEmpty: 'Er tom',
|
|
80
|
+
headerFilterOperatorIsNotEmpty: 'Er ikke tom',
|
|
81
|
+
headerFilterOperatorIsAnyOf: 'Er en av',
|
|
82
|
+
'headerFilterOperator=': 'Lik',
|
|
83
|
+
'headerFilterOperator!=': 'Ikke lik',
|
|
84
|
+
'headerFilterOperator>': 'Større enn',
|
|
85
|
+
'headerFilterOperator>=': 'Større enn eller lik',
|
|
86
|
+
'headerFilterOperator<': 'Mindre enn',
|
|
87
|
+
'headerFilterOperator<=': 'Mindre enn eller lik',
|
|
90
88
|
// Filter values text
|
|
91
89
|
filterValueAny: 'noen',
|
|
92
90
|
filterValueTrue: 'sant',
|
|
@@ -111,7 +109,7 @@ const nbNOGrid = {
|
|
|
111
109
|
// Total visible row amount footer text
|
|
112
110
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} av ${totalCount.toLocaleString()}`,
|
|
113
111
|
// Checkbox selection text
|
|
114
|
-
checkboxSelectionHeaderName: 'Avmerkingsboks
|
|
112
|
+
checkboxSelectionHeaderName: 'Avmerkingsboks',
|
|
115
113
|
checkboxSelectionSelectAllRows: 'Velg alle rader',
|
|
116
114
|
checkboxSelectionUnselectAllRows: 'Velg bort alle rader',
|
|
117
115
|
checkboxSelectionSelectRow: 'Velg rad',
|
|
@@ -132,13 +130,13 @@ const nbNOGrid = {
|
|
|
132
130
|
// Grouping columns
|
|
133
131
|
groupingColumnHeaderName: 'Grupper',
|
|
134
132
|
groupColumn: name => `Grupper på ${name}`,
|
|
135
|
-
unGroupColumn: name => `
|
|
133
|
+
unGroupColumn: name => `Slutt å grupper på ${name}`,
|
|
136
134
|
// Master/detail
|
|
137
135
|
detailPanelToggle: 'Utvid/kollaps detalj panel',
|
|
138
136
|
expandDetailPanel: 'Utvid',
|
|
139
137
|
collapseDetailPanel: 'Kollaps',
|
|
140
138
|
// Row reordering text
|
|
141
|
-
rowReorderingHeaderName: '
|
|
139
|
+
rowReorderingHeaderName: 'Radreorganisering',
|
|
142
140
|
// Aggregation
|
|
143
141
|
aggregationMenuItemHeader: 'Aggregering',
|
|
144
142
|
aggregationFunctionLabelSum: 'sum',
|
package/locales/nnNO.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { nnNO as nnNOCore } from '@mui/material/locale';
|
|
2
|
+
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
|
+
const nnNOGrid = {
|
|
4
|
+
// Root
|
|
5
|
+
noRowsLabel: 'Ingen rader',
|
|
6
|
+
noResultsOverlayLabel: 'Fann ingen resultat.',
|
|
7
|
+
// Density selector toolbar button text
|
|
8
|
+
toolbarDensity: 'Tettheit',
|
|
9
|
+
toolbarDensityLabel: 'Tettheit',
|
|
10
|
+
toolbarDensityCompact: 'Kompakt',
|
|
11
|
+
toolbarDensityStandard: 'Standard',
|
|
12
|
+
toolbarDensityComfortable: 'Komfortabelt',
|
|
13
|
+
// Columns selector toolbar button text
|
|
14
|
+
toolbarColumns: 'Kolonner',
|
|
15
|
+
toolbarColumnsLabel: 'Vel kolonner',
|
|
16
|
+
// Filters toolbar button text
|
|
17
|
+
toolbarFilters: 'Filter',
|
|
18
|
+
toolbarFiltersLabel: 'Vis filter',
|
|
19
|
+
toolbarFiltersTooltipHide: 'Skjul filter',
|
|
20
|
+
toolbarFiltersTooltipShow: 'Vis filter',
|
|
21
|
+
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
|
|
22
|
+
// Quick filter toolbar field
|
|
23
|
+
toolbarQuickFilterPlaceholder: 'Søk…',
|
|
24
|
+
toolbarQuickFilterLabel: 'Søk',
|
|
25
|
+
toolbarQuickFilterDeleteIconLabel: 'Slett',
|
|
26
|
+
// Export selector toolbar button text
|
|
27
|
+
toolbarExport: 'Eksporter',
|
|
28
|
+
toolbarExportLabel: 'Eksporter',
|
|
29
|
+
toolbarExportCSV: 'Last ned som CSV',
|
|
30
|
+
toolbarExportPrint: 'Skriv ut',
|
|
31
|
+
toolbarExportExcel: 'Last ned som Excel',
|
|
32
|
+
// Columns management text
|
|
33
|
+
columnsManagementSearchTitle: 'Søk',
|
|
34
|
+
columnsManagementNoColumns: 'Ingen kolonner',
|
|
35
|
+
columnsManagementShowHideAllText: 'Vis/skjul alle',
|
|
36
|
+
columnsManagementReset: 'Nullstill',
|
|
37
|
+
// Filter panel text
|
|
38
|
+
filterPanelAddFilter: 'Legg til filter',
|
|
39
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
40
|
+
filterPanelDeleteIconLabel: 'Slett',
|
|
41
|
+
filterPanelLogicOperator: 'Logisk operator',
|
|
42
|
+
filterPanelOperator: 'Operator',
|
|
43
|
+
filterPanelOperatorAnd: 'Og',
|
|
44
|
+
filterPanelOperatorOr: 'Eller',
|
|
45
|
+
filterPanelColumns: 'Kolonner',
|
|
46
|
+
filterPanelInputLabel: 'Verdi',
|
|
47
|
+
filterPanelInputPlaceholder: 'Filter verdi',
|
|
48
|
+
// Filter operators text
|
|
49
|
+
filterOperatorContains: 'inneheld',
|
|
50
|
+
filterOperatorEquals: 'er lik',
|
|
51
|
+
filterOperatorStartsWith: 'startar med',
|
|
52
|
+
filterOperatorEndsWith: 'sluttar med',
|
|
53
|
+
filterOperatorIs: 'er',
|
|
54
|
+
filterOperatorNot: 'er ikkje',
|
|
55
|
+
filterOperatorAfter: 'er etter',
|
|
56
|
+
filterOperatorOnOrAfter: 'er på eller etter',
|
|
57
|
+
filterOperatorBefore: 'er før',
|
|
58
|
+
filterOperatorOnOrBefore: 'er på eller før',
|
|
59
|
+
filterOperatorIsEmpty: 'er tom',
|
|
60
|
+
filterOperatorIsNotEmpty: 'er ikkje tom',
|
|
61
|
+
filterOperatorIsAnyOf: 'er ein av',
|
|
62
|
+
'filterOperator=': '=',
|
|
63
|
+
'filterOperator!=': '!=',
|
|
64
|
+
'filterOperator>': '>',
|
|
65
|
+
'filterOperator>=': '>=',
|
|
66
|
+
'filterOperator<': '<',
|
|
67
|
+
'filterOperator<=': '<=',
|
|
68
|
+
// Header filter operators text
|
|
69
|
+
headerFilterOperatorContains: 'Inneheld',
|
|
70
|
+
headerFilterOperatorEquals: 'Lik',
|
|
71
|
+
headerFilterOperatorStartsWith: 'Startar på',
|
|
72
|
+
headerFilterOperatorEndsWith: 'Sluttar på',
|
|
73
|
+
headerFilterOperatorIs: 'Er',
|
|
74
|
+
headerFilterOperatorNot: 'Er ikkje',
|
|
75
|
+
headerFilterOperatorAfter: 'Er etter',
|
|
76
|
+
headerFilterOperatorOnOrAfter: 'Er på eller etter',
|
|
77
|
+
headerFilterOperatorBefore: 'Er før',
|
|
78
|
+
headerFilterOperatorOnOrBefore: 'Er på eller før',
|
|
79
|
+
headerFilterOperatorIsEmpty: 'Er tom',
|
|
80
|
+
headerFilterOperatorIsNotEmpty: 'Er ikkje tom',
|
|
81
|
+
headerFilterOperatorIsAnyOf: 'Er ein av',
|
|
82
|
+
'headerFilterOperator=': 'Lik',
|
|
83
|
+
'headerFilterOperator!=': 'Ikkje lik',
|
|
84
|
+
'headerFilterOperator>': 'Større enn',
|
|
85
|
+
'headerFilterOperator>=': 'Større enn eller lik',
|
|
86
|
+
'headerFilterOperator<': 'Mindre enn',
|
|
87
|
+
'headerFilterOperator<=': 'Mindre enn eller lik',
|
|
88
|
+
// Filter values text
|
|
89
|
+
filterValueAny: 'nokon',
|
|
90
|
+
filterValueTrue: 'sant',
|
|
91
|
+
filterValueFalse: 'usant',
|
|
92
|
+
// Column menu text
|
|
93
|
+
columnMenuLabel: 'Meny',
|
|
94
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
95
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
96
|
+
columnMenuFilter: 'Filter',
|
|
97
|
+
columnMenuHideColumn: 'Skjul',
|
|
98
|
+
columnMenuUnsort: 'Usorter',
|
|
99
|
+
columnMenuSortAsc: 'Sorter AUKANDE',
|
|
100
|
+
columnMenuSortDesc: 'Sorter SYNKANDE',
|
|
101
|
+
// Column header text
|
|
102
|
+
columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
|
|
103
|
+
columnHeaderFiltersLabel: 'Vis filter',
|
|
104
|
+
columnHeaderSortIconLabel: 'Sorter',
|
|
105
|
+
// Rows selected footer text
|
|
106
|
+
footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} rader valt` : `${count.toLocaleString()} rad valt`,
|
|
107
|
+
// Total row amount footer text
|
|
108
|
+
footerTotalRows: 'Totalt tal rader:',
|
|
109
|
+
// Total visible row amount footer text
|
|
110
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} av ${totalCount.toLocaleString()}`,
|
|
111
|
+
// Checkbox selection text
|
|
112
|
+
checkboxSelectionHeaderName: 'Avmerkingsboks',
|
|
113
|
+
checkboxSelectionSelectAllRows: 'Vel alle rader',
|
|
114
|
+
checkboxSelectionUnselectAllRows: 'Vel vekk alle rader',
|
|
115
|
+
checkboxSelectionSelectRow: 'Vel rad',
|
|
116
|
+
checkboxSelectionUnselectRow: 'Vel vekk rad',
|
|
117
|
+
// Boolean cell text
|
|
118
|
+
booleanCellTrueLabel: 'sant',
|
|
119
|
+
booleanCellFalseLabel: 'usant',
|
|
120
|
+
// Actions cell more text
|
|
121
|
+
actionsCellMore: 'meir',
|
|
122
|
+
// Column pinning text
|
|
123
|
+
pinToLeft: 'Fest til venstre',
|
|
124
|
+
pinToRight: 'Fest til høgre',
|
|
125
|
+
unpin: 'Lausne',
|
|
126
|
+
// Tree Data
|
|
127
|
+
treeDataGroupingHeaderName: 'Grupper',
|
|
128
|
+
treeDataExpand: 'vis barn',
|
|
129
|
+
treeDataCollapse: 'skjul barn',
|
|
130
|
+
// Grouping columns
|
|
131
|
+
groupingColumnHeaderName: 'Grupper',
|
|
132
|
+
groupColumn: name => `Grupper på ${name}`,
|
|
133
|
+
unGroupColumn: name => `Slutt å grupper på ${name}`,
|
|
134
|
+
// Master/detail
|
|
135
|
+
detailPanelToggle: 'Utvid/kollaps detalj panel',
|
|
136
|
+
expandDetailPanel: 'Utvid',
|
|
137
|
+
collapseDetailPanel: 'Kolaps',
|
|
138
|
+
// Row reordering text
|
|
139
|
+
rowReorderingHeaderName: 'Radreorganisering',
|
|
140
|
+
// Aggregation
|
|
141
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
142
|
+
aggregationFunctionLabelSum: 'sum',
|
|
143
|
+
aggregationFunctionLabelAvg: 'snitt',
|
|
144
|
+
aggregationFunctionLabelMin: 'min',
|
|
145
|
+
aggregationFunctionLabelMax: 'maks',
|
|
146
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
147
|
+
};
|
|
148
|
+
export const nnNO = getGridLocalization(nnNOGrid, nnNOCore);
|
|
@@ -7,19 +7,18 @@ import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel
|
|
|
7
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export
|
|
10
|
+
export function GridPreferencesPanel() {
|
|
11
11
|
const apiRef = useGridApiContext();
|
|
12
12
|
const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);
|
|
13
13
|
const rootProps = useGridRootProps();
|
|
14
14
|
const preferencePanelState = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
15
15
|
const panelContent = apiRef.current.unstable_applyPipeProcessors('preferencePanel', null, preferencePanelState.openedPanelValue ?? GridPreferencePanelsValue.filters);
|
|
16
16
|
return /*#__PURE__*/_jsx(rootProps.slots.panel, _extends({
|
|
17
|
-
ref: ref,
|
|
18
17
|
as: rootProps.slots.basePopper,
|
|
19
18
|
open: columns.length > 0 && preferencePanelState.open,
|
|
20
19
|
id: preferencePanelState.panelId,
|
|
21
20
|
"aria-labelledby": preferencePanelState.labelId
|
|
22
|
-
}, rootProps.slotProps?.panel,
|
|
21
|
+
}, rootProps.slotProps?.panel, rootProps.slotProps?.basePopper, {
|
|
23
22
|
children: panelContent
|
|
24
23
|
}));
|
|
25
|
-
}
|
|
24
|
+
}
|
|
@@ -82,7 +82,7 @@ export function useGridApiInitialization(inputApiRef, props) {
|
|
|
82
82
|
if (isSyntheticEvent(event) && event.isPropagationStopped()) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const details = props.signature === GridSignature.DataGridPro ? {
|
|
85
|
+
const details = props.signature === GridSignature.DataGridPro || props.signature === GridSignature.DataGridPremium ? {
|
|
86
86
|
api: privateApiRef.current.getPublicApi()
|
|
87
87
|
} : {};
|
|
88
88
|
privateApiRef.current.eventManager.emit(name, params, event, details);
|
|
@@ -10,11 +10,10 @@ import { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';
|
|
|
10
10
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
11
11
|
import { gridEditRowsStateSelector } from './gridEditingSelectors';
|
|
12
12
|
import { isPrintableKey, isPasteShortcut } from '../../../utils/keyboardUtils';
|
|
13
|
-
import {
|
|
13
|
+
import { warnOnce } from '../../../internals/utils/warning';
|
|
14
14
|
import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
|
|
15
15
|
import { deepClone } from '../../../utils/utils';
|
|
16
16
|
import { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../models/params/gridEditCellParams';
|
|
17
|
-
const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
18
17
|
export const useGridCellEditing = (apiRef, props) => {
|
|
19
18
|
const [cellModesModel, setCellModesModel] = React.useState({});
|
|
20
19
|
const cellModesModelRef = React.useRef(cellModesModel);
|
|
@@ -336,7 +335,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
336
335
|
if (onProcessRowUpdateError) {
|
|
337
336
|
onProcessRowUpdateError(errorThrown);
|
|
338
337
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
339
|
-
|
|
338
|
+
warnOnce(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
340
339
|
}
|
|
341
340
|
};
|
|
342
341
|
try {
|
|
@@ -11,12 +11,11 @@ import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
|
11
11
|
import { gridEditRowsStateSelector } from './gridEditingSelectors';
|
|
12
12
|
import { isPrintableKey, isPasteShortcut } from '../../../utils/keyboardUtils';
|
|
13
13
|
import { gridColumnFieldsSelector, gridVisibleColumnFieldsSelector } from '../columns/gridColumnsSelector';
|
|
14
|
-
import {
|
|
14
|
+
import { warnOnce } from '../../../internals/utils/warning';
|
|
15
15
|
import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
|
|
16
16
|
import { deepClone } from '../../../utils/utils';
|
|
17
17
|
import { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models/params/gridRowParams';
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
|
|
19
|
-
const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
20
19
|
export const useGridRowEditing = (apiRef, props) => {
|
|
21
20
|
const [rowModesModel, setRowModesModel] = React.useState({});
|
|
22
21
|
const rowModesModelRef = React.useRef(rowModesModel);
|
|
@@ -389,7 +388,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
389
388
|
if (onProcessRowUpdateError) {
|
|
390
389
|
onProcessRowUpdateError(errorThrown);
|
|
391
390
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
392
|
-
|
|
391
|
+
warnOnce(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
393
392
|
}
|
|
394
393
|
};
|
|
395
394
|
try {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
|
|
2
|
-
import {
|
|
2
|
+
import { warnOnce } from '../../../../internals/utils/warning';
|
|
3
3
|
function sanitizeCellValue(value, csvOptions) {
|
|
4
4
|
const valueStr = typeof value === 'string' ? value : `${value}`;
|
|
5
5
|
if (csvOptions.shouldAppendQuotes || csvOptions.escapeFormulas) {
|
|
6
6
|
const escapedValue = valueStr.replace(/"/g, '""');
|
|
7
|
-
// Make sure value containing delimiter or line break won't be split into multiple cells
|
|
8
|
-
if ([csvOptions.delimiter, '\n', '\r', '"'].some(delimiter => valueStr.includes(delimiter))) {
|
|
9
|
-
return `"${escapedValue}"`;
|
|
10
|
-
}
|
|
11
7
|
if (csvOptions.escapeFormulas) {
|
|
12
8
|
// See https://owasp.org/www-community/attacks/CSV_Injection
|
|
13
9
|
if (['=', '+', '-', '@', '\t', '\r'].includes(escapedValue[0])) {
|
|
14
|
-
return `'${escapedValue}`;
|
|
10
|
+
return `"'${escapedValue}"`;
|
|
15
11
|
}
|
|
16
12
|
}
|
|
13
|
+
// Make sure value containing delimiter or line break won't be split into multiple cells
|
|
14
|
+
if ([csvOptions.delimiter, '\n', '\r', '"'].some(delimiter => valueStr.includes(delimiter))) {
|
|
15
|
+
return `"${escapedValue}"`;
|
|
16
|
+
}
|
|
17
17
|
return escapedValue;
|
|
18
18
|
}
|
|
19
19
|
return valueStr;
|
|
@@ -40,7 +40,6 @@ export const serializeCellValue = (cellParams, options) => {
|
|
|
40
40
|
}
|
|
41
41
|
return sanitizeCellValue(value, csvOptions);
|
|
42
42
|
};
|
|
43
|
-
const objectFormattedValueWarning = buildWarning(['MUI X: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
44
43
|
class CSVRow {
|
|
45
44
|
constructor(options) {
|
|
46
45
|
this.options = void 0;
|
|
@@ -79,7 +78,7 @@ const serializeRow = ({
|
|
|
79
78
|
const cellParams = getCellParams(id, column.field);
|
|
80
79
|
if (process.env.NODE_ENV !== 'production') {
|
|
81
80
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
82
|
-
|
|
81
|
+
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
row.addValue(serializeCellValue(cellParams, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridLogicOperator } from '../../../models';
|
|
3
3
|
import { getDefaultGridFilterModel } from './gridFilterState';
|
|
4
|
-
import {
|
|
4
|
+
import { warnOnce } from '../../../internals/utils/warning';
|
|
5
5
|
import { getPublicApiRef } from '../../../utils/getPublicApiRef';
|
|
6
6
|
import { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from '../columns';
|
|
7
7
|
let hasEval;
|
|
@@ -36,25 +36,28 @@ export const cleanFilterItem = (item, apiRef) => {
|
|
|
36
36
|
}
|
|
37
37
|
return cleanItem;
|
|
38
38
|
};
|
|
39
|
-
const filterModelDisableMultiColumnsFilteringWarning = buildWarning(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');
|
|
40
|
-
const filterModelMissingItemIdWarning = buildWarning('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.', 'error');
|
|
41
|
-
const filterModelMissingItemOperatorWarning = buildWarning('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.', 'error');
|
|
42
39
|
export const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiRef) => {
|
|
43
40
|
const hasSeveralItems = model.items.length > 1;
|
|
44
41
|
let items;
|
|
45
42
|
if (hasSeveralItems && disableMultipleColumnsFiltering) {
|
|
46
|
-
|
|
43
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
44
|
+
warnOnce(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');
|
|
45
|
+
}
|
|
47
46
|
items = [model.items[0]];
|
|
48
47
|
} else {
|
|
49
48
|
items = model.items;
|
|
50
49
|
}
|
|
51
50
|
const hasItemsWithoutIds = hasSeveralItems && items.some(item => item.id == null);
|
|
52
51
|
const hasItemWithoutOperator = items.some(item => item.operator == null);
|
|
53
|
-
if (
|
|
54
|
-
|
|
52
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
53
|
+
if (hasItemsWithoutIds) {
|
|
54
|
+
warnOnce('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.', 'error');
|
|
55
|
+
}
|
|
55
56
|
}
|
|
56
|
-
if (
|
|
57
|
-
|
|
57
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58
|
+
if (hasItemWithoutOperator) {
|
|
59
|
+
warnOnce('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.', 'error');
|
|
60
|
+
}
|
|
58
61
|
}
|
|
59
62
|
if (hasItemWithoutOperator || hasItemsWithoutIds) {
|
|
60
63
|
return _extends({}, model, {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import {
|
|
3
|
-
const sortModelDisableMultiColumnsSortingWarning = buildWarning(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');
|
|
2
|
+
import { warnOnce } from '../../../internals/utils/warning';
|
|
4
3
|
export const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {
|
|
5
4
|
if (disableMultipleColumnsSorting && model.length > 1) {
|
|
6
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
7
|
-
|
|
6
|
+
warnOnce(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the `DataGrid`, this prop is always `true`.'], 'error');
|
|
8
7
|
}
|
|
9
8
|
return [model[0]];
|
|
10
9
|
}
|
|
@@ -8,6 +8,7 @@ import { FinalizationRegistryBasedCleanupTracking } from '../../utils/cleanupTra
|
|
|
8
8
|
var GridSignature = /*#__PURE__*/function (GridSignature) {
|
|
9
9
|
GridSignature["DataGrid"] = "DataGrid";
|
|
10
10
|
GridSignature["DataGridPro"] = "DataGridPro";
|
|
11
|
+
GridSignature["DataGridPremium"] = "DataGridPremium";
|
|
11
12
|
return GridSignature;
|
|
12
13
|
}(GridSignature || {});
|
|
13
14
|
// We use class to make it easier to detect in heap snapshots by name
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useLazyRef } from './useLazyRef';
|
|
3
3
|
import { useOnMount } from './useOnMount';
|
|
4
|
-
import {
|
|
4
|
+
import { warnOnce } from '../../internals/utils/warning';
|
|
5
5
|
import { fastObjectShallowCompare } from '../../utils/fastObjectShallowCompare';
|
|
6
|
-
const stateNotInitializedWarning = buildWarning(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
7
6
|
function isOutputSelector(selector) {
|
|
8
7
|
return selector.acceptsApiRef;
|
|
9
8
|
}
|
|
@@ -23,7 +22,7 @@ const createRefs = () => ({
|
|
|
23
22
|
export const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
|
|
24
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
24
|
if (!apiRef.current.state) {
|
|
26
|
-
|
|
25
|
+
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
const refs = useLazyRef(createRefs);
|
package/modern/index.js
CHANGED
|
@@ -60,7 +60,6 @@ export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal
|
|
|
60
60
|
export { isNavigationKey, isPasteShortcut } from '../utils/keyboardUtils';
|
|
61
61
|
export * from '../utils/utils';
|
|
62
62
|
export * from '../utils/fastMemo';
|
|
63
|
-
export { buildWarning } from '../utils/warning';
|
|
64
63
|
export { exportAs } from '../utils/exportAs';
|
|
65
64
|
export * from '../utils/getPublicApiRef';
|
|
66
65
|
export * from '../utils/cellBorderUtils';
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
+
import { warnOnce } from './warning';
|
|
1
2
|
import { isNumber } from '../../utils/utils';
|
|
2
3
|
import { GridSignature } from '../../hooks/utils/useGridApiEventHandler';
|
|
3
4
|
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.unstable_dataSource && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
|
|
4
|
-
const warnedOnceCache = new Set();
|
|
5
|
-
function warnOnce(message) {
|
|
6
|
-
if (!warnedOnceCache.has(message)) {
|
|
7
|
-
console.error(message);
|
|
8
|
-
warnedOnceCache.add(message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
5
|
export function validateProps(props, validators) {
|
|
12
6
|
validators.forEach(validator => {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
warnOnce(
|
|
7
|
+
const message = validator(props);
|
|
8
|
+
if (message) {
|
|
9
|
+
warnOnce(message, 'error');
|
|
16
10
|
}
|
|
17
11
|
});
|
|
18
|
-
}
|
|
19
|
-
export function clearWarningsCache() {
|
|
20
|
-
warnedOnceCache.clear();
|
|
21
12
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const warnedOnceCache = new Set();
|
|
2
|
+
|
|
3
|
+
// TODO move to @mui/x-internals
|
|
4
|
+
// TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
|
|
5
|
+
export function warnOnce(message, gravity = 'warning') {
|
|
6
|
+
if (process.env.NODE_ENV === 'production') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
|
|
10
|
+
if (!warnedOnceCache.has(cleanMessage)) {
|
|
11
|
+
warnedOnceCache.add(cleanMessage);
|
|
12
|
+
if (gravity === 'error') {
|
|
13
|
+
console.error(cleanMessage);
|
|
14
|
+
} else {
|
|
15
|
+
console.warn(cleanMessage);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function clearWarningsCache() {
|
|
20
|
+
warnedOnceCache.clear();
|
|
21
|
+
}
|
package/modern/locales/deDE.js
CHANGED
|
@@ -33,8 +33,7 @@ const deDEGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Suche',
|
|
34
34
|
columnsManagementNoColumns: 'Keine Spalten',
|
|
35
35
|
columnsManagementShowHideAllText: 'Alle anzeigen/verbergen',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'Zurücksetzen',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
40
39
|
filterPanelRemoveAll: 'Alle entfernen',
|
package/modern/locales/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from './jaJP';
|
|
|
18
18
|
export * from './koKR';
|
|
19
19
|
export * from './nbNO';
|
|
20
20
|
export * from './nlNL';
|
|
21
|
+
export * from './nnNO';
|
|
21
22
|
export * from './plPL';
|
|
22
23
|
export * from './ptBR';
|
|
23
24
|
export * from './roRO';
|
|
@@ -32,4 +33,5 @@ export * from './zhCN';
|
|
|
32
33
|
export * from './zhTW';
|
|
33
34
|
export * from './hrHR';
|
|
34
35
|
export * from './ptPT';
|
|
35
|
-
export * from './zhHK';
|
|
36
|
+
export * from './zhHK';
|
|
37
|
+
export * from './isIS';
|