@mui/x-data-grid 5.17.2 → 5.17.4
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 +70 -2
- package/colDef/gridNumericOperators.d.ts +1 -1
- package/colDef/gridSingleSelectOperators.d.ts +1 -1
- package/colDef/gridStringOperators.d.ts +1 -1
- package/components/GridRow.js +5 -2
- package/components/cell/GridEditBooleanCell.js +1 -0
- package/components/cell/GridEditDateCell.js +1 -0
- package/components/cell/GridEditInputCell.js +21 -7
- package/components/cell/GridEditSingleSelectCell.js +1 -0
- package/hooks/features/editRows/useGridCellEditing.new.js +6 -3
- package/hooks/features/editRows/useGridEditing.new.js +9 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +6 -3
- package/hooks/features/focus/useGridFocus.js +14 -15
- package/hooks/utils/useGridInitializeState.d.ts +1 -1
- package/index.js +1 -1
- package/legacy/components/GridRow.js +6 -2
- package/legacy/components/cell/GridEditBooleanCell.js +1 -0
- package/legacy/components/cell/GridEditDateCell.js +1 -0
- package/legacy/components/cell/GridEditInputCell.js +23 -9
- package/legacy/components/cell/GridEditSingleSelectCell.js +1 -0
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +5 -4
- package/legacy/hooks/features/editRows/useGridEditing.new.js +9 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +6 -3
- package/legacy/hooks/features/focus/useGridFocus.js +14 -15
- package/legacy/index.js +1 -1
- package/legacy/locales/faIR.js +14 -14
- package/legacy/locales/fiFI.js +32 -28
- package/legacy/locales/plPL.js +7 -7
- package/locales/faIR.js +14 -14
- package/locales/fiFI.js +28 -28
- package/locales/plPL.js +7 -7
- package/models/api/gridEditingApi.d.ts +10 -0
- package/models/gridEditRowModel.d.ts +2 -0
- package/models/gridRows.d.ts +1 -1
- package/models/params/gridEditCellParams.d.ts +7 -3
- package/modern/components/GridRow.js +5 -2
- package/modern/components/cell/GridEditBooleanCell.js +1 -0
- package/modern/components/cell/GridEditDateCell.js +1 -0
- package/modern/components/cell/GridEditInputCell.js +18 -6
- package/modern/components/cell/GridEditSingleSelectCell.js +1 -0
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +6 -3
- package/modern/hooks/features/editRows/useGridEditing.new.js +9 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +6 -3
- package/modern/hooks/features/focus/useGridFocus.js +14 -15
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +14 -14
- package/modern/locales/fiFI.js +28 -28
- package/modern/locales/plPL.js +7 -7
- package/node/components/GridRow.js +4 -2
- package/node/components/cell/GridEditBooleanCell.js +1 -0
- package/node/components/cell/GridEditDateCell.js +1 -0
- package/node/components/cell/GridEditInputCell.js +21 -7
- package/node/components/cell/GridEditSingleSelectCell.js +1 -0
- package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -3
- package/node/hooks/features/editRows/useGridEditing.new.js +10 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +6 -3
- package/node/hooks/features/focus/useGridFocus.js +14 -15
- package/node/index.js +1 -1
- package/node/locales/faIR.js +14 -14
- package/node/locales/fiFI.js +28 -28
- package/node/locales/plPL.js +7 -7
- package/package.json +2 -2
|
@@ -30,6 +30,14 @@ export var focusStateInitializer = function focusStateInitializer(state) {
|
|
|
30
30
|
export var useGridFocus = function useGridFocus(apiRef, props) {
|
|
31
31
|
var logger = useGridLogger(apiRef, 'useGridFocus');
|
|
32
32
|
var lastClickedCell = React.useRef(null);
|
|
33
|
+
var publishCellFocusOut = React.useCallback(function (cell, event) {
|
|
34
|
+
if (cell) {
|
|
35
|
+
// The row might have been deleted
|
|
36
|
+
if (apiRef.current.getRow(cell.id)) {
|
|
37
|
+
apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(cell.id, cell.field), event);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, [apiRef]);
|
|
33
41
|
var setCellFocus = React.useCallback(function (id, field) {
|
|
34
42
|
var focusedCell = gridFocusCellSelector(apiRef);
|
|
35
43
|
|
|
@@ -65,19 +73,15 @@ export var useGridFocus = function useGridFocus(apiRef, props) {
|
|
|
65
73
|
if (focusedCell) {
|
|
66
74
|
// There's a focused cell but another cell was clicked
|
|
67
75
|
// Publishes an event to notify that the focus was lost
|
|
68
|
-
|
|
76
|
+
publishCellFocusOut(focusedCell, {});
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
apiRef.current.publishEvent('cellFocusIn', apiRef.current.getCellParams(id, field));
|
|
72
|
-
}, [apiRef, logger]);
|
|
80
|
+
}, [apiRef, logger, publishCellFocusOut]);
|
|
73
81
|
var setColumnHeaderFocus = React.useCallback(function (field) {
|
|
74
82
|
var event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
75
83
|
var cell = gridFocusCellSelector(apiRef);
|
|
76
|
-
|
|
77
|
-
if (cell) {
|
|
78
|
-
apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(cell.id, cell.field), event);
|
|
79
|
-
}
|
|
80
|
-
|
|
84
|
+
publishCellFocusOut(cell, event);
|
|
81
85
|
apiRef.current.setState(function (state) {
|
|
82
86
|
logger.debug("Focusing on column header with colIndex=".concat(field));
|
|
83
87
|
return _extends({}, state, {
|
|
@@ -96,7 +100,7 @@ export var useGridFocus = function useGridFocus(apiRef, props) {
|
|
|
96
100
|
});
|
|
97
101
|
});
|
|
98
102
|
apiRef.current.forceUpdate();
|
|
99
|
-
}, [apiRef, logger]);
|
|
103
|
+
}, [apiRef, logger, publishCellFocusOut]);
|
|
100
104
|
var moveFocusToRelativeCell = React.useCallback(function (id, field, direction) {
|
|
101
105
|
var columnIndexToFocus = apiRef.current.getColumnIndex(field);
|
|
102
106
|
var rowIndexToFocus = apiRef.current.getRowIndexRelativeToVisibleRows(id);
|
|
@@ -206,11 +210,6 @@ export var useGridFocus = function useGridFocus(apiRef, props) {
|
|
|
206
210
|
|
|
207
211
|
if (cellElement != null && cellElement.contains(event.target)) {
|
|
208
212
|
return;
|
|
209
|
-
} // The row might have been deleted during the click
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (!apiRef.current.getRow(focusedCell.id)) {
|
|
213
|
-
return;
|
|
214
213
|
}
|
|
215
214
|
|
|
216
215
|
if (cellParams) {
|
|
@@ -227,9 +226,9 @@ export var useGridFocus = function useGridFocus(apiRef, props) {
|
|
|
227
226
|
apiRef.current.forceUpdate(); // There's a focused cell but another element (not a cell) was clicked
|
|
228
227
|
// Publishes an event to notify that the focus was lost
|
|
229
228
|
|
|
230
|
-
|
|
229
|
+
publishCellFocusOut(focusedCell, event);
|
|
231
230
|
}
|
|
232
|
-
}, [apiRef]);
|
|
231
|
+
}, [apiRef, publishCellFocusOut]);
|
|
233
232
|
var handleCellModeChange = React.useCallback(function (params) {
|
|
234
233
|
if (params.cellMode === 'view') {
|
|
235
234
|
return;
|
package/legacy/index.js
CHANGED
package/legacy/locales/faIR.js
CHANGED
|
@@ -23,15 +23,15 @@ var faIRGrid = {
|
|
|
23
23
|
return count !== 1 ? "".concat(count, " \u0641\u06CC\u0644\u062A\u0631\u0647\u0627\u06CC \u0641\u0639\u0627\u0644") : "".concat(count, " \u0641\u06CC\u0644\u062A\u0631 \u0641\u0639\u0627\u0644");
|
|
24
24
|
},
|
|
25
25
|
// Quick filter toolbar field
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
toolbarQuickFilterPlaceholder: 'جستجو...',
|
|
27
|
+
toolbarQuickFilterLabel: 'جستجو',
|
|
28
|
+
toolbarQuickFilterDeleteIconLabel: 'حذف',
|
|
29
29
|
// Export selector toolbar button text
|
|
30
30
|
toolbarExport: 'خروجی',
|
|
31
31
|
toolbarExportLabel: 'خروجی',
|
|
32
32
|
toolbarExportCSV: 'دانلود به صورت CSV',
|
|
33
33
|
toolbarExportPrint: 'چاپ',
|
|
34
|
-
|
|
34
|
+
toolbarExportExcel: 'دانلود به صورت اکسل',
|
|
35
35
|
// Columns panel text
|
|
36
36
|
columnsPanelTextFieldLabel: 'پیداکردن ستون',
|
|
37
37
|
columnsPanelTextFieldPlaceholder: 'عنوان ستون',
|
|
@@ -119,17 +119,17 @@ var faIRGrid = {
|
|
|
119
119
|
return "\u0644\u063A\u0648 \u06AF\u0631\u0648\u0647\u200C\u0628\u0646\u062F\u06CC \u0628\u0631\u0627\u0633\u0627\u0633 ".concat(name);
|
|
120
120
|
},
|
|
121
121
|
// Master/detail
|
|
122
|
-
|
|
122
|
+
detailPanelToggle: 'پنل جزئیات',
|
|
123
123
|
expandDetailPanel: 'بازکردن پنل جزئیات',
|
|
124
|
-
collapseDetailPanel: 'بستن پنل جزئیات'
|
|
125
|
-
//
|
|
124
|
+
collapseDetailPanel: 'بستن پنل جزئیات',
|
|
125
|
+
// Row reordering text
|
|
126
|
+
rowReorderingHeaderName: 'ترتیب مجدد سطر',
|
|
126
127
|
// Aggregation
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
aggregationMenuItemHeader: 'تجمیع',
|
|
129
|
+
aggregationFunctionLabelSum: 'جمع',
|
|
130
|
+
aggregationFunctionLabelAvg: 'میانگین',
|
|
131
|
+
aggregationFunctionLabelMin: 'حداقل',
|
|
132
|
+
aggregationFunctionLabelMax: 'حداکثر',
|
|
133
|
+
aggregationFunctionLabelSize: 'اندازه'
|
|
134
134
|
};
|
|
135
135
|
export var faIR = getGridLocalization(faIRGrid, faIRCore);
|
package/legacy/locales/fiFI.js
CHANGED
|
@@ -6,7 +6,7 @@ var fiFIGrid = {
|
|
|
6
6
|
noResultsOverlayLabel: 'Ei tuloksia.',
|
|
7
7
|
errorOverlayDefaultLabel: 'Tapahtui virhe.',
|
|
8
8
|
// Density selector toolbar button text
|
|
9
|
-
toolbarDensity: '
|
|
9
|
+
toolbarDensity: 'Tiiveys',
|
|
10
10
|
toolbarDensityLabel: 'Tiiveys',
|
|
11
11
|
toolbarDensityCompact: 'Kompakti',
|
|
12
12
|
toolbarDensityStandard: 'Vakio',
|
|
@@ -23,15 +23,15 @@ var fiFIGrid = {
|
|
|
23
23
|
return count !== 1 ? "".concat(count, " aktiivista suodatinta") : "".concat(count, " aktiivinen suodatin");
|
|
24
24
|
},
|
|
25
25
|
// Quick filter toolbar field
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
toolbarQuickFilterPlaceholder: 'Hae…',
|
|
27
|
+
toolbarQuickFilterLabel: 'Hae',
|
|
28
|
+
toolbarQuickFilterDeleteIconLabel: 'Tyhjennä',
|
|
29
29
|
// Export selector toolbar button text
|
|
30
|
-
toolbarExport: '
|
|
31
|
-
toolbarExportLabel: '
|
|
30
|
+
toolbarExport: 'Vie',
|
|
31
|
+
toolbarExportLabel: 'Vie',
|
|
32
32
|
toolbarExportCSV: 'Lataa CSV-muodossa',
|
|
33
33
|
toolbarExportPrint: 'Tulosta',
|
|
34
|
-
|
|
34
|
+
toolbarExportExcel: 'Lataa Excel-muodossa',
|
|
35
35
|
// Columns panel text
|
|
36
36
|
columnsPanelTextFieldLabel: 'Etsi sarake',
|
|
37
37
|
columnsPanelTextFieldPlaceholder: 'Sarakkeen otsikko',
|
|
@@ -41,7 +41,7 @@ var fiFIGrid = {
|
|
|
41
41
|
// Filter panel text
|
|
42
42
|
filterPanelAddFilter: 'Lisää suodatin',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Poista',
|
|
44
|
-
|
|
44
|
+
filterPanelLinkOperator: 'Logiikkaoperaattori',
|
|
45
45
|
filterPanelOperators: 'Operaattorit',
|
|
46
46
|
// TODO v6: rename to filterPanelOperator
|
|
47
47
|
filterPanelOperatorAnd: 'Ja',
|
|
@@ -62,7 +62,7 @@ var fiFIGrid = {
|
|
|
62
62
|
filterOperatorOnOrBefore: 'on sama tai ennen',
|
|
63
63
|
filterOperatorIsEmpty: 'on tyhjä',
|
|
64
64
|
filterOperatorIsNotEmpty: 'ei ole tyhjä',
|
|
65
|
-
|
|
65
|
+
filterOperatorIsAnyOf: 'mikä tahansa seuraavista',
|
|
66
66
|
// Filter values text
|
|
67
67
|
filterValueAny: 'mikä tahansa',
|
|
68
68
|
filterValueTrue: 'tosi',
|
|
@@ -93,10 +93,10 @@ var fiFIGrid = {
|
|
|
93
93
|
},
|
|
94
94
|
// Checkbox selection text
|
|
95
95
|
checkboxSelectionHeaderName: 'Valintaruutu',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
checkboxSelectionSelectAllRows: 'Valitse kaikki rivit',
|
|
97
|
+
checkboxSelectionUnselectAllRows: 'Poista kaikkien rivien valinta',
|
|
98
|
+
checkboxSelectionSelectRow: 'Valitse rivi',
|
|
99
|
+
checkboxSelectionUnselectRow: 'Poista rivin valinta',
|
|
100
100
|
// Boolean cell text
|
|
101
101
|
booleanCellTrueLabel: 'tosi',
|
|
102
102
|
booleanCellFalseLabel: 'epätosi',
|
|
@@ -109,23 +109,27 @@ var fiFIGrid = {
|
|
|
109
109
|
// Tree Data
|
|
110
110
|
treeDataGroupingHeaderName: 'Ryhmä',
|
|
111
111
|
treeDataExpand: 'Laajenna',
|
|
112
|
-
treeDataCollapse: 'Supista'
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
treeDataCollapse: 'Supista',
|
|
113
|
+
// Grouping columns
|
|
114
|
+
groupingColumnHeaderName: 'Ryhmä',
|
|
115
|
+
groupColumn: function groupColumn(name) {
|
|
116
|
+
return "Ryhmittelyperuste ".concat(name);
|
|
117
|
+
},
|
|
118
|
+
unGroupColumn: function unGroupColumn(name) {
|
|
119
|
+
return "Poista ryhmittelyperuste ".concat(name);
|
|
120
|
+
},
|
|
116
121
|
// Master/detail
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
detailPanelToggle: 'Yksityiskohtapaneelin vaihto',
|
|
123
|
+
expandDetailPanel: 'Laajenna',
|
|
124
|
+
collapseDetailPanel: 'Tiivistä',
|
|
120
125
|
// Row reordering text
|
|
121
|
-
|
|
126
|
+
rowReorderingHeaderName: 'Rivien uudelleenjärjestely',
|
|
122
127
|
// Aggregation
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
aggregationMenuItemHeader: 'Koostaminen',
|
|
129
|
+
aggregationFunctionLabelSum: 'summa',
|
|
130
|
+
aggregationFunctionLabelAvg: 'ka.',
|
|
131
|
+
aggregationFunctionLabelMin: 'min.',
|
|
132
|
+
aggregationFunctionLabelMax: 'maks.',
|
|
133
|
+
aggregationFunctionLabelSize: 'koko'
|
|
130
134
|
};
|
|
131
135
|
export var fiFI = getGridLocalization(fiFIGrid, fiFICore);
|
package/legacy/locales/plPL.js
CHANGED
|
@@ -23,15 +23,15 @@ var plPLGrid = {
|
|
|
23
23
|
return "Liczba aktywnych filtr\xF3w: ".concat(count);
|
|
24
24
|
},
|
|
25
25
|
// Quick filter toolbar field
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
toolbarQuickFilterPlaceholder: 'Wyszukaj…',
|
|
27
|
+
toolbarQuickFilterLabel: 'Szukaj',
|
|
28
|
+
toolbarQuickFilterDeleteIconLabel: 'Wyczyść',
|
|
29
29
|
// Export selector toolbar button text
|
|
30
30
|
toolbarExport: 'Eksportuj',
|
|
31
31
|
toolbarExportLabel: 'Eksportuj',
|
|
32
32
|
toolbarExportCSV: 'Pobierz jako plik CSV',
|
|
33
33
|
toolbarExportPrint: 'Drukuj',
|
|
34
|
-
|
|
34
|
+
toolbarExportExcel: 'Pobierz jako plik Excel',
|
|
35
35
|
// Columns panel text
|
|
36
36
|
columnsPanelTextFieldLabel: 'Znajdź kolumnę',
|
|
37
37
|
columnsPanelTextFieldPlaceholder: 'Tytuł kolumny',
|
|
@@ -121,9 +121,9 @@ var plPLGrid = {
|
|
|
121
121
|
// Master/detail
|
|
122
122
|
// detailPanelToggle: 'Detail panel toggle',
|
|
123
123
|
expandDetailPanel: 'Rozwiń',
|
|
124
|
-
collapseDetailPanel: 'Zwiń'
|
|
125
|
-
//
|
|
126
|
-
// Aggregation
|
|
124
|
+
collapseDetailPanel: 'Zwiń',
|
|
125
|
+
// Row reordering text
|
|
126
|
+
rowReorderingHeaderName: 'Porządkowanie wierszy' // Aggregation
|
|
127
127
|
// aggregationMenuItemHeader: 'Aggregation',
|
|
128
128
|
// aggregationFunctionLabelSum: 'sum',
|
|
129
129
|
// aggregationFunctionLabelAvg: 'avg',
|
package/locales/faIR.js
CHANGED
|
@@ -21,15 +21,15 @@ const faIRGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: 'نمایش فیلترها',
|
|
22
22
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} فیلترهای فعال` : `${count} فیلتر فعال`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'جستجو...',
|
|
25
|
+
toolbarQuickFilterLabel: 'جستجو',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: 'حذف',
|
|
27
27
|
// Export selector toolbar button text
|
|
28
28
|
toolbarExport: 'خروجی',
|
|
29
29
|
toolbarExportLabel: 'خروجی',
|
|
30
30
|
toolbarExportCSV: 'دانلود به صورت CSV',
|
|
31
31
|
toolbarExportPrint: 'چاپ',
|
|
32
|
-
|
|
32
|
+
toolbarExportExcel: 'دانلود به صورت اکسل',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: 'پیداکردن ستون',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: 'عنوان ستون',
|
|
@@ -107,17 +107,17 @@ const faIRGrid = {
|
|
|
107
107
|
groupColumn: name => `گروهبندی براساس ${name}`,
|
|
108
108
|
unGroupColumn: name => `لغو گروهبندی براساس ${name}`,
|
|
109
109
|
// Master/detail
|
|
110
|
-
|
|
110
|
+
detailPanelToggle: 'پنل جزئیات',
|
|
111
111
|
expandDetailPanel: 'بازکردن پنل جزئیات',
|
|
112
|
-
collapseDetailPanel: 'بستن پنل جزئیات'
|
|
113
|
-
//
|
|
112
|
+
collapseDetailPanel: 'بستن پنل جزئیات',
|
|
113
|
+
// Row reordering text
|
|
114
|
+
rowReorderingHeaderName: 'ترتیب مجدد سطر',
|
|
114
115
|
// Aggregation
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'تجمیع',
|
|
117
|
+
aggregationFunctionLabelSum: 'جمع',
|
|
118
|
+
aggregationFunctionLabelAvg: 'میانگین',
|
|
119
|
+
aggregationFunctionLabelMin: 'حداقل',
|
|
120
|
+
aggregationFunctionLabelMax: 'حداکثر',
|
|
121
|
+
aggregationFunctionLabelSize: 'اندازه'
|
|
122
122
|
};
|
|
123
123
|
export const faIR = getGridLocalization(faIRGrid, faIRCore);
|
package/locales/fiFI.js
CHANGED
|
@@ -6,7 +6,7 @@ const fiFIGrid = {
|
|
|
6
6
|
noResultsOverlayLabel: 'Ei tuloksia.',
|
|
7
7
|
errorOverlayDefaultLabel: 'Tapahtui virhe.',
|
|
8
8
|
// Density selector toolbar button text
|
|
9
|
-
toolbarDensity: '
|
|
9
|
+
toolbarDensity: 'Tiiveys',
|
|
10
10
|
toolbarDensityLabel: 'Tiiveys',
|
|
11
11
|
toolbarDensityCompact: 'Kompakti',
|
|
12
12
|
toolbarDensityStandard: 'Vakio',
|
|
@@ -21,15 +21,15 @@ const fiFIGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: 'Näytä suodattimet',
|
|
22
22
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktiivista suodatinta` : `${count} aktiivinen suodatin`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'Hae…',
|
|
25
|
+
toolbarQuickFilterLabel: 'Hae',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: 'Tyhjennä',
|
|
27
27
|
// Export selector toolbar button text
|
|
28
|
-
toolbarExport: '
|
|
29
|
-
toolbarExportLabel: '
|
|
28
|
+
toolbarExport: 'Vie',
|
|
29
|
+
toolbarExportLabel: 'Vie',
|
|
30
30
|
toolbarExportCSV: 'Lataa CSV-muodossa',
|
|
31
31
|
toolbarExportPrint: 'Tulosta',
|
|
32
|
-
|
|
32
|
+
toolbarExportExcel: 'Lataa Excel-muodossa',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: 'Etsi sarake',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: 'Sarakkeen otsikko',
|
|
@@ -39,7 +39,7 @@ const fiFIGrid = {
|
|
|
39
39
|
// Filter panel text
|
|
40
40
|
filterPanelAddFilter: 'Lisää suodatin',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Poista',
|
|
42
|
-
|
|
42
|
+
filterPanelLinkOperator: 'Logiikkaoperaattori',
|
|
43
43
|
filterPanelOperators: 'Operaattorit',
|
|
44
44
|
// TODO v6: rename to filterPanelOperator
|
|
45
45
|
filterPanelOperatorAnd: 'Ja',
|
|
@@ -60,7 +60,7 @@ const fiFIGrid = {
|
|
|
60
60
|
filterOperatorOnOrBefore: 'on sama tai ennen',
|
|
61
61
|
filterOperatorIsEmpty: 'on tyhjä',
|
|
62
62
|
filterOperatorIsNotEmpty: 'ei ole tyhjä',
|
|
63
|
-
|
|
63
|
+
filterOperatorIsAnyOf: 'mikä tahansa seuraavista',
|
|
64
64
|
// Filter values text
|
|
65
65
|
filterValueAny: 'mikä tahansa',
|
|
66
66
|
filterValueTrue: 'tosi',
|
|
@@ -85,10 +85,10 @@ const fiFIGrid = {
|
|
|
85
85
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} / ${totalCount.toLocaleString()}`,
|
|
86
86
|
// Checkbox selection text
|
|
87
87
|
checkboxSelectionHeaderName: 'Valintaruutu',
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
checkboxSelectionSelectAllRows: 'Valitse kaikki rivit',
|
|
89
|
+
checkboxSelectionUnselectAllRows: 'Poista kaikkien rivien valinta',
|
|
90
|
+
checkboxSelectionSelectRow: 'Valitse rivi',
|
|
91
|
+
checkboxSelectionUnselectRow: 'Poista rivin valinta',
|
|
92
92
|
// Boolean cell text
|
|
93
93
|
booleanCellTrueLabel: 'tosi',
|
|
94
94
|
booleanCellFalseLabel: 'epätosi',
|
|
@@ -101,23 +101,23 @@ const fiFIGrid = {
|
|
|
101
101
|
// Tree Data
|
|
102
102
|
treeDataGroupingHeaderName: 'Ryhmä',
|
|
103
103
|
treeDataExpand: 'Laajenna',
|
|
104
|
-
treeDataCollapse: 'Supista'
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
treeDataCollapse: 'Supista',
|
|
105
|
+
// Grouping columns
|
|
106
|
+
groupingColumnHeaderName: 'Ryhmä',
|
|
107
|
+
groupColumn: name => `Ryhmittelyperuste ${name}`,
|
|
108
|
+
unGroupColumn: name => `Poista ryhmittelyperuste ${name}`,
|
|
108
109
|
// Master/detail
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
detailPanelToggle: 'Yksityiskohtapaneelin vaihto',
|
|
111
|
+
expandDetailPanel: 'Laajenna',
|
|
112
|
+
collapseDetailPanel: 'Tiivistä',
|
|
112
113
|
// Row reordering text
|
|
113
|
-
|
|
114
|
+
rowReorderingHeaderName: 'Rivien uudelleenjärjestely',
|
|
114
115
|
// Aggregation
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Koostaminen',
|
|
117
|
+
aggregationFunctionLabelSum: 'summa',
|
|
118
|
+
aggregationFunctionLabelAvg: 'ka.',
|
|
119
|
+
aggregationFunctionLabelMin: 'min.',
|
|
120
|
+
aggregationFunctionLabelMax: 'maks.',
|
|
121
|
+
aggregationFunctionLabelSize: 'koko'
|
|
122
122
|
};
|
|
123
123
|
export const fiFI = getGridLocalization(fiFIGrid, fiFICore);
|
package/locales/plPL.js
CHANGED
|
@@ -21,15 +21,15 @@ const plPLGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: 'Pokaż filtry',
|
|
22
22
|
toolbarFiltersTooltipActive: count => `Liczba aktywnych filtrów: ${count}`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'Wyszukaj…',
|
|
25
|
+
toolbarQuickFilterLabel: 'Szukaj',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: 'Wyczyść',
|
|
27
27
|
// Export selector toolbar button text
|
|
28
28
|
toolbarExport: 'Eksportuj',
|
|
29
29
|
toolbarExportLabel: 'Eksportuj',
|
|
30
30
|
toolbarExportCSV: 'Pobierz jako plik CSV',
|
|
31
31
|
toolbarExportPrint: 'Drukuj',
|
|
32
|
-
|
|
32
|
+
toolbarExportExcel: 'Pobierz jako plik Excel',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: 'Znajdź kolumnę',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: 'Tytuł kolumny',
|
|
@@ -109,9 +109,9 @@ const plPLGrid = {
|
|
|
109
109
|
// Master/detail
|
|
110
110
|
// detailPanelToggle: 'Detail panel toggle',
|
|
111
111
|
expandDetailPanel: 'Rozwiń',
|
|
112
|
-
collapseDetailPanel: 'Zwiń'
|
|
113
|
-
//
|
|
114
|
-
// Aggregation
|
|
112
|
+
collapseDetailPanel: 'Zwiń',
|
|
113
|
+
// Row reordering text
|
|
114
|
+
rowReorderingHeaderName: 'Porządkowanie wierszy' // Aggregation
|
|
115
115
|
// aggregationMenuItemHeader: 'Aggregation',
|
|
116
116
|
// aggregationFunctionLabelSum: 'sum',
|
|
117
117
|
// aggregationFunctionLabelAvg: 'avg',
|
|
@@ -16,6 +16,9 @@ export declare type GridRowModesModelProps = ({
|
|
|
16
16
|
mode: GridRowModes.Edit;
|
|
17
17
|
} & Omit<GridStartRowEditModeParams, 'id' | 'field'>);
|
|
18
18
|
export declare type GridRowModesModel = Record<GridRowId, GridRowModesModelProps>;
|
|
19
|
+
export interface GridEditCellMeta {
|
|
20
|
+
changeReason?: 'debouncedSetEditCellValue' | 'setEditCellValue';
|
|
21
|
+
}
|
|
19
22
|
export interface GridNewEditingSharedApi {
|
|
20
23
|
/**
|
|
21
24
|
* Controls if a cell is editable.
|
|
@@ -46,6 +49,13 @@ export interface GridNewEditingSharedApi {
|
|
|
46
49
|
* @ignore - do not document.
|
|
47
50
|
*/
|
|
48
51
|
unstable_getRowWithUpdatedValues: (id: GridRowId, field: string) => GridRowModel;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the meta information for the edit cell.
|
|
54
|
+
* @param {GridRowId} id The row id being edited.
|
|
55
|
+
* @param {string} field The field being edited.
|
|
56
|
+
* @ignore - do not document.
|
|
57
|
+
*/
|
|
58
|
+
unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta;
|
|
49
59
|
}
|
|
50
60
|
/**
|
|
51
61
|
* The shared methods used by the cell and row editing API.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { GridEditCellMeta } from './api/gridEditingApi';
|
|
1
2
|
export interface GridEditCellProps<V = any> {
|
|
2
3
|
value?: V | undefined;
|
|
3
4
|
isValidating?: boolean;
|
|
4
5
|
isProcessingProps?: boolean;
|
|
6
|
+
changeReason?: GridEditCellMeta['changeReason'];
|
|
5
7
|
[prop: string]: any;
|
|
6
8
|
}
|
|
7
9
|
export declare type GridEditRowProps = {
|
package/models/gridRows.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { GridKeyValue } from './colDef/gridColDef';
|
|
|
2
2
|
export declare type GridValidRowModel = {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
};
|
|
5
|
-
export declare type GridRowsProp<R = GridValidRowModel> = Readonly<GridRowModel<R>[]>;
|
|
5
|
+
export declare type GridRowsProp<R extends GridValidRowModel = GridValidRowModel> = Readonly<GridRowModel<R>[]>;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated prefer GridRowModel.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GridEditCellProps } from '../gridEditRowModel';
|
|
2
|
-
import { GridRowId } from '../gridRows';
|
|
2
|
+
import { GridRowId, GridValidRowModel } from '../gridRows';
|
|
3
3
|
import { GridCellParams } from './gridCellParams';
|
|
4
4
|
export interface GridEditCellPropsParams {
|
|
5
5
|
id: GridRowId;
|
|
@@ -26,6 +26,10 @@ export interface GridEditCellValueParams {
|
|
|
26
26
|
* The debounce time in milliseconds.
|
|
27
27
|
*/
|
|
28
28
|
debounceMs?: number;
|
|
29
|
+
/**
|
|
30
|
+
* TBD
|
|
31
|
+
*/
|
|
32
|
+
unstable_skipValueParser?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export interface GridCommitCellChangeParams {
|
|
31
35
|
id: GridRowId;
|
|
@@ -45,7 +49,7 @@ declare enum GridCellEditStartReasons {
|
|
|
45
49
|
/**
|
|
46
50
|
* Params passed to the `cellEditStart` event.
|
|
47
51
|
*/
|
|
48
|
-
export interface GridCellEditStartParams<V = any, R =
|
|
52
|
+
export interface GridCellEditStartParams<V = any, R extends GridValidRowModel = GridValidRowModel, F = V> extends GridCellParams<V, R, F> {
|
|
49
53
|
/**
|
|
50
54
|
* The reason for this event to be triggered.
|
|
51
55
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
@@ -62,7 +66,7 @@ declare enum GridCellEditStopReasons {
|
|
|
62
66
|
/**
|
|
63
67
|
* Params passed to the `cellEditStop event.
|
|
64
68
|
*/
|
|
65
|
-
export interface GridCellEditStopParams<V = any, R =
|
|
69
|
+
export interface GridCellEditStopParams<V = any, R extends GridValidRowModel = GridValidRowModel, F = V> extends GridCellParams<V, R, F> {
|
|
66
70
|
/**
|
|
67
71
|
* The reason for this event to be triggered.
|
|
68
72
|
* Only available if `props.experimentalFeatures.newEditingApi: true`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "cellFocus", "cellTabIndex", "editRowsState", "isLastVisible", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"]
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "cellFocus", "cellTabIndex", "editRowsState", "isLastVisible", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"],
|
|
4
|
+
_excluded2 = ["changeReason"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import clsx from 'clsx';
|
|
@@ -223,9 +224,11 @@ function GridRow(props) {
|
|
|
223
224
|
updatedRow = apiRef.current.unstable_getRowWithUpdatedValues(rowId, column.field);
|
|
224
225
|
}
|
|
225
226
|
|
|
227
|
+
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded2);
|
|
228
|
+
|
|
226
229
|
const params = _extends({}, cellParams, {
|
|
227
230
|
row: updatedRow
|
|
228
|
-
},
|
|
231
|
+
}, editCellStateRest, {
|
|
229
232
|
api: apiRef.current
|
|
230
233
|
});
|
|
231
234
|
|
|
@@ -93,6 +93,7 @@ process.env.NODE_ENV !== "production" ? GridEditBooleanCell.propTypes = {
|
|
|
93
93
|
* The mode of the cell.
|
|
94
94
|
*/
|
|
95
95
|
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
96
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
99
|
* The column of the row that the current cell belongs to.
|
|
@@ -147,6 +147,7 @@ process.env.NODE_ENV !== "production" ? GridEditDateCell.propTypes = {
|
|
|
147
147
|
* The mode of the cell.
|
|
148
148
|
*/
|
|
149
149
|
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
150
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
150
151
|
|
|
151
152
|
/**
|
|
152
153
|
* The column of the row that the current cell belongs to.
|
|
@@ -66,17 +66,28 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
66
66
|
await onValueChange(event, newValue);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
const column = apiRef.current.getColumn(field);
|
|
70
|
+
let parsedValue = newValue;
|
|
71
|
+
|
|
72
|
+
if (column.valueParser && rootProps.experimentalFeatures?.newEditingApi) {
|
|
73
|
+
parsedValue = column.valueParser(newValue, apiRef.current.getCellParams(id, field));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setValueState(parsedValue);
|
|
70
77
|
apiRef.current.setEditCellValue({
|
|
71
78
|
id,
|
|
72
79
|
field,
|
|
73
|
-
value:
|
|
74
|
-
debounceMs
|
|
80
|
+
value: parsedValue,
|
|
81
|
+
debounceMs,
|
|
82
|
+
unstable_skipValueParser: true
|
|
75
83
|
}, event);
|
|
76
|
-
}, [apiRef, debounceMs, field, id, onValueChange]);
|
|
84
|
+
}, [apiRef, debounceMs, field, id, onValueChange, rootProps.experimentalFeatures?.newEditingApi]);
|
|
85
|
+
const meta = apiRef.current.unstable_getEditCellMeta ? apiRef.current.unstable_getEditCellMeta(id, field) : {};
|
|
77
86
|
React.useEffect(() => {
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
if (meta.changeReason !== 'debouncedSetEditCellValue') {
|
|
88
|
+
setValueState(value);
|
|
89
|
+
}
|
|
90
|
+
}, [meta.changeReason, value]);
|
|
80
91
|
useEnhancedEffect(() => {
|
|
81
92
|
if (hasFocus) {
|
|
82
93
|
inputRef.current.focus();
|
|
@@ -109,6 +120,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
109
120
|
* The mode of the cell.
|
|
110
121
|
*/
|
|
111
122
|
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
123
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
112
124
|
|
|
113
125
|
/**
|
|
114
126
|
* The column of the row that the current cell belongs to.
|
|
@@ -187,6 +187,7 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
187
187
|
* The mode of the cell.
|
|
188
188
|
*/
|
|
189
189
|
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
190
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
190
191
|
|
|
191
192
|
/**
|
|
192
193
|
* The column of the row that the current cell belongs to.
|