@mui/x-data-grid 5.17.3 → 5.17.5

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 (48) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/components/GridPagination.d.ts +43 -1
  3. package/components/GridPagination.js +1 -2
  4. package/components/GridRow.d.ts +1 -4
  5. package/components/GridRow.js +5 -5
  6. package/components/toolbar/GridToolbarFilterButton.js +8 -4
  7. package/hooks/features/editRows/useGridCellEditing.new.js +12 -7
  8. package/hooks/features/editRows/useGridRowEditing.new.js +12 -7
  9. package/hooks/features/focus/useGridFocus.js +14 -15
  10. package/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
  11. package/index.js +1 -1
  12. package/legacy/components/GridPagination.js +1 -2
  13. package/legacy/components/GridRow.js +5 -5
  14. package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
  15. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +12 -7
  16. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +12 -7
  17. package/legacy/hooks/features/focus/useGridFocus.js +14 -15
  18. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
  19. package/legacy/index.js +1 -1
  20. package/legacy/locales/faIR.js +14 -14
  21. package/legacy/locales/fiFI.js +32 -28
  22. package/legacy/locales/plPL.js +7 -7
  23. package/locales/faIR.js +14 -14
  24. package/locales/fiFI.js +28 -28
  25. package/locales/plPL.js +7 -7
  26. package/modern/components/GridPagination.js +1 -2
  27. package/modern/components/GridRow.js +5 -5
  28. package/modern/components/toolbar/GridToolbarFilterButton.js +1 -1
  29. package/modern/hooks/features/editRows/useGridCellEditing.new.js +12 -7
  30. package/modern/hooks/features/editRows/useGridRowEditing.new.js +12 -7
  31. package/modern/hooks/features/focus/useGridFocus.js +14 -15
  32. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +6 -6
  33. package/modern/index.js +1 -1
  34. package/modern/locales/faIR.js +14 -14
  35. package/modern/locales/fiFI.js +28 -28
  36. package/modern/locales/plPL.js +7 -7
  37. package/node/components/GridPagination.js +1 -2
  38. package/node/components/GridRow.js +6 -5
  39. package/node/components/toolbar/GridToolbarFilterButton.js +8 -4
  40. package/node/hooks/features/editRows/useGridCellEditing.new.js +15 -9
  41. package/node/hooks/features/editRows/useGridRowEditing.new.js +15 -9
  42. package/node/hooks/features/focus/useGridFocus.js +14 -15
  43. package/node/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
  44. package/node/index.js +1 -1
  45. package/node/locales/faIR.js +14 -14
  46. package/node/locales/fiFI.js +28 -28
  47. package/node/locales/plPL.js +7 -7
  48. package/package.json +1 -1
@@ -5,7 +5,7 @@ const _excluded = ["selected", "rowId", "row", "index", "style", "position", "ro
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
8
- import { unstable_composeClasses as composeClasses } from '@mui/material';
8
+ import { unstable_composeClasses as composeClasses, useForkRef } from '@mui/material';
9
9
  import { GridEditModes, GridRowModes, GridCellModes } from '../models/gridEditRowModel';
10
10
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
11
11
  import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
@@ -55,7 +55,7 @@ const EmptyCell = ({
55
55
  }); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
56
56
  };
57
57
 
58
- function GridRow(props) {
58
+ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
59
59
  const {
60
60
  selected,
61
61
  rowId,
@@ -88,6 +88,7 @@ function GridRow(props) {
88
88
  const sortModel = useGridSelector(apiRef, gridSortModelSelector);
89
89
  const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
90
90
  const headerGroupingMaxDepth = useGridSelector(apiRef, gridDensityHeaderGroupingMaxDepthSelector);
91
+ const handleRef = useForkRef(ref, refProp);
91
92
  const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
92
93
 
93
94
  const {
@@ -368,7 +369,7 @@ function GridRow(props) {
368
369
  onMouseLeave: publish('rowMouseLeave', onMouseLeave)
369
370
  } : null;
370
371
  return /*#__PURE__*/_jsxs("div", _extends({
371
- ref: ref,
372
+ ref: handleRef,
372
373
  "data-id": rowId,
373
374
  "data-rowindex": index,
374
375
  role: "row",
@@ -381,8 +382,7 @@ function GridRow(props) {
381
382
  width: emptyCellWidth
382
383
  })]
383
384
  }));
384
- }
385
-
385
+ });
386
386
  process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
387
387
  // ----------------------------- Warning --------------------------------
388
388
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -71,7 +71,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
71
71
  children: activeFilters.map((item, index) => _extends({}, lookup[item.columnField] && /*#__PURE__*/_jsx("li", {
72
72
  children: `${lookup[item.columnField].headerName || item.columnField}
73
73
  ${getOperatorLabel(item)}
74
- ${item.value}`
74
+ ${item.value ?? ''}`
75
75
  }, index)))
76
76
  })]
77
77
  });
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  const _excluded = ["id", "field"],
5
5
  _excluded2 = ["id", "field"];
6
6
  import * as React from 'react';
7
+ import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
7
8
  import { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';
8
9
  import { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';
9
10
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
@@ -185,7 +186,7 @@ export const useGridCellEditing = (apiRef, props) => {
185
186
  const isEditing = editingState[id] && editingState[id][field];
186
187
  return isEditing ? GridCellModes.Edit : GridCellModes.View;
187
188
  }, [apiRef]);
188
- const updateCellModesModel = React.useCallback(newModel => {
189
+ const updateCellModesModel = useEventCallback(newModel => {
189
190
  const isNewModelDifferentFromProp = newModel !== props.cellModesModel;
190
191
 
191
192
  if (onCellModesModelChange && isNewModelDifferentFromProp) {
@@ -202,7 +203,7 @@ export const useGridCellEditing = (apiRef, props) => {
202
203
  setCellModesModel(newModel);
203
204
  cellModesModelRef.current = newModel;
204
205
  apiRef.current.publishEvent('cellModesModelChange', newModel);
205
- }, [apiRef, onCellModesModelChange, props.cellModesModel, signature]);
206
+ });
206
207
  const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {
207
208
  // We use the ref because it always contain the up-to-date value, different from the state
208
209
  // that needs a rerender to reflect the new value
@@ -261,7 +262,7 @@ export const useGridCellEditing = (apiRef, props) => {
261
262
  mode: GridCellModes.Edit
262
263
  }, other));
263
264
  }, [throwIfNotEditable, throwIfNotInMode, updateFieldInCellModesModel]);
264
- const updateStateToStartCellEditMode = React.useCallback(params => {
265
+ const updateStateToStartCellEditMode = useEventCallback(params => {
265
266
  const {
266
267
  id,
267
268
  field,
@@ -274,7 +275,7 @@ export const useGridCellEditing = (apiRef, props) => {
274
275
  };
275
276
  updateOrDeleteFieldState(id, field, newProps);
276
277
  apiRef.current.setCellFocus(id, field);
277
- }, [apiRef, updateOrDeleteFieldState]);
278
+ });
278
279
  const stopCellEditMode = React.useCallback(params => {
279
280
  const {
280
281
  id,
@@ -287,7 +288,7 @@ export const useGridCellEditing = (apiRef, props) => {
287
288
  mode: GridCellModes.View
288
289
  }, other));
289
290
  }, [throwIfNotInMode, updateFieldInCellModesModel]);
290
- const updateStateToStopCellEditMode = React.useCallback(async params => {
291
+ const updateStateToStopCellEditMode = useEventCallback(async params => {
291
292
  const {
292
293
  id,
293
294
  field,
@@ -332,7 +333,11 @@ export const useGridCellEditing = (apiRef, props) => {
332
333
 
333
334
  if (processRowUpdate) {
334
335
  const handleError = errorThrown => {
335
- prevCellModesModel.current[id][field].mode = GridCellModes.Edit;
336
+ prevCellModesModel.current[id][field].mode = GridCellModes.Edit; // Revert the mode in the cellModesModel prop back to "edit"
337
+
338
+ updateFieldInCellModesModel(id, field, {
339
+ mode: GridCellModes.Edit
340
+ });
336
341
 
337
342
  if (onProcessRowUpdateError) {
338
343
  onProcessRowUpdateError(errorThrown);
@@ -354,7 +359,7 @@ export const useGridCellEditing = (apiRef, props) => {
354
359
  apiRef.current.updateRows([rowUpdate]);
355
360
  finishCellEditMode();
356
361
  }
357
- }, [apiRef, onProcessRowUpdateError, processRowUpdate, throwIfNotInMode, updateFieldInCellModesModel, updateOrDeleteFieldState]);
362
+ });
358
363
  const setCellEditingEditCellValue = React.useCallback(async params => {
359
364
  const {
360
365
  id,
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  const _excluded = ["id"],
5
5
  _excluded2 = ["id"];
6
6
  import * as React from 'react';
7
+ import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
7
8
  import { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';
8
9
  import { GridEditModes, GridRowModes } from '../../../models/gridEditRowModel';
9
10
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
@@ -250,7 +251,7 @@ export const useGridRowEditing = (apiRef, props) => {
250
251
  const isEditing = editingState[id] && Object.keys(editingState[id]).length > 0;
251
252
  return isEditing ? GridRowModes.Edit : GridRowModes.View;
252
253
  }, [apiRef, props.editMode]);
253
- const updateRowModesModel = React.useCallback(newModel => {
254
+ const updateRowModesModel = useEventCallback(newModel => {
254
255
  const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
255
256
 
256
257
  if (onRowModesModelChange && isNewModelDifferentFromProp) {
@@ -267,7 +268,7 @@ export const useGridRowEditing = (apiRef, props) => {
267
268
  setRowModesModel(newModel);
268
269
  rowModesModelRef.current = newModel;
269
270
  apiRef.current.publishEvent('rowModesModelChange', newModel);
270
- }, [apiRef, onRowModesModelChange, props.rowModesModel, signature]);
271
+ });
271
272
  const updateRowInRowModesModel = React.useCallback((id, newProps) => {
272
273
  const newModel = _extends({}, rowModesModelRef.current);
273
274
 
@@ -328,7 +329,7 @@ export const useGridRowEditing = (apiRef, props) => {
328
329
  mode: GridRowModes.Edit
329
330
  }, other));
330
331
  }, [throwIfNotInMode, updateRowInRowModesModel]);
331
- const updateStateToStartRowEditMode = React.useCallback(params => {
332
+ const updateStateToStartRowEditMode = useEventCallback(params => {
332
333
  const {
333
334
  id,
334
335
  fieldToFocus,
@@ -355,7 +356,7 @@ export const useGridRowEditing = (apiRef, props) => {
355
356
  if (fieldToFocus) {
356
357
  apiRef.current.setCellFocus(id, fieldToFocus);
357
358
  }
358
- }, [apiRef, updateOrDeleteRowState]);
359
+ });
359
360
  const stopRowEditMode = React.useCallback(params => {
360
361
  const {
361
362
  id
@@ -367,7 +368,7 @@ export const useGridRowEditing = (apiRef, props) => {
367
368
  mode: GridRowModes.View
368
369
  }, other));
369
370
  }, [throwIfNotInMode, updateRowInRowModesModel]);
370
- const updateStateToStopRowEditMode = React.useCallback(params => {
371
+ const updateStateToStopRowEditMode = useEventCallback(params => {
371
372
  const {
372
373
  id,
373
374
  ignoreModifications,
@@ -414,7 +415,11 @@ export const useGridRowEditing = (apiRef, props) => {
414
415
 
415
416
  if (processRowUpdate) {
416
417
  const handleError = errorThrown => {
417
- prevRowModesModel.current[id].mode = GridRowModes.Edit;
418
+ prevRowModesModel.current[id].mode = GridRowModes.Edit; // Revert the mode in the rowModesModel prop back to "edit"
419
+
420
+ updateRowInRowModesModel(id, {
421
+ mode: GridRowModes.Edit
422
+ });
418
423
 
419
424
  if (onProcessRowUpdateError) {
420
425
  onProcessRowUpdateError(errorThrown);
@@ -435,7 +440,7 @@ export const useGridRowEditing = (apiRef, props) => {
435
440
  apiRef.current.updateRows([rowUpdate]);
436
441
  finishRowEditMode();
437
442
  }
438
- }, [apiRef, onProcessRowUpdateError, processRowUpdate, updateOrDeleteRowState, updateRowInRowModesModel]);
443
+ });
439
444
  const setRowEditingEditCellValue = React.useCallback(params => {
440
445
  const {
441
446
  id,
@@ -28,6 +28,14 @@ export const focusStateInitializer = state => _extends({}, state, {
28
28
  export const useGridFocus = (apiRef, props) => {
29
29
  const logger = useGridLogger(apiRef, 'useGridFocus');
30
30
  const lastClickedCell = React.useRef(null);
31
+ const publishCellFocusOut = React.useCallback((cell, event) => {
32
+ if (cell) {
33
+ // The row might have been deleted
34
+ if (apiRef.current.getRow(cell.id)) {
35
+ apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(cell.id, cell.field), event);
36
+ }
37
+ }
38
+ }, [apiRef]);
31
39
  const setCellFocus = React.useCallback((id, field) => {
32
40
  const focusedCell = gridFocusCellSelector(apiRef);
33
41
 
@@ -63,18 +71,14 @@ export const useGridFocus = (apiRef, props) => {
63
71
  if (focusedCell) {
64
72
  // There's a focused cell but another cell was clicked
65
73
  // Publishes an event to notify that the focus was lost
66
- apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(focusedCell.id, focusedCell.field));
74
+ publishCellFocusOut(focusedCell, {});
67
75
  }
68
76
 
69
77
  apiRef.current.publishEvent('cellFocusIn', apiRef.current.getCellParams(id, field));
70
- }, [apiRef, logger]);
78
+ }, [apiRef, logger, publishCellFocusOut]);
71
79
  const setColumnHeaderFocus = React.useCallback((field, event = {}) => {
72
80
  const cell = gridFocusCellSelector(apiRef);
73
-
74
- if (cell) {
75
- apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(cell.id, cell.field), event);
76
- }
77
-
81
+ publishCellFocusOut(cell, event);
78
82
  apiRef.current.setState(state => {
79
83
  logger.debug(`Focusing on column header with colIndex=${field}`);
80
84
  return _extends({}, state, {
@@ -93,7 +97,7 @@ export const useGridFocus = (apiRef, props) => {
93
97
  });
94
98
  });
95
99
  apiRef.current.forceUpdate();
96
- }, [apiRef, logger]);
100
+ }, [apiRef, logger, publishCellFocusOut]);
97
101
  const moveFocusToRelativeCell = React.useCallback((id, field, direction) => {
98
102
  let columnIndexToFocus = apiRef.current.getColumnIndex(field);
99
103
  let rowIndexToFocus = apiRef.current.getRowIndexRelativeToVisibleRows(id);
@@ -202,11 +206,6 @@ export const useGridFocus = (apiRef, props) => {
202
206
 
203
207
  if (cellElement?.contains(event.target)) {
204
208
  return;
205
- } // The row might have been deleted during the click
206
-
207
-
208
- if (!apiRef.current.getRow(focusedCell.id)) {
209
- return;
210
209
  }
211
210
 
212
211
  if (cellParams) {
@@ -221,9 +220,9 @@ export const useGridFocus = (apiRef, props) => {
221
220
  apiRef.current.forceUpdate(); // There's a focused cell but another element (not a cell) was clicked
222
221
  // Publishes an event to notify that the focus was lost
223
222
 
224
- apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(focusedCell.id, focusedCell.field), event);
223
+ publishCellFocusOut(focusedCell, event);
225
224
  }
226
- }, [apiRef]);
225
+ }, [apiRef, publishCellFocusOut]);
227
226
  const handleCellModeChange = React.useCallback(params => {
228
227
  if (params.cellMode === 'view') {
229
228
  return;
@@ -87,16 +87,16 @@ export const useGridVirtualScroller = props => {
87
87
  const prevTotalWidth = React.useRef(columnsTotalWidth);
88
88
  const getNearestIndexToRender = React.useCallback(offset => {
89
89
  const lastMeasuredIndexRelativeToAllRows = apiRef.current.unstable_getLastMeasuredRowIndex();
90
- const lastMeasuredIndexRelativeToCurrentPage = lastMeasuredIndexRelativeToAllRows - (currentPage.range?.firstRowIndex || 0);
91
- const lastMeasuredIndex = Math.max(0, lastMeasuredIndexRelativeToCurrentPage);
92
- let allRowsMeasured = lastMeasuredIndex === Infinity;
90
+ let allRowsMeasured = lastMeasuredIndexRelativeToAllRows === Infinity;
93
91
 
94
92
  if (currentPage.range?.lastRowIndex && !allRowsMeasured) {
95
93
  // Check if all rows in this page are already measured
96
- allRowsMeasured = lastMeasuredIndex >= currentPage.range.lastRowIndex;
94
+ allRowsMeasured = lastMeasuredIndexRelativeToAllRows >= currentPage.range.lastRowIndex;
97
95
  }
98
96
 
99
- if (allRowsMeasured || rowsMeta.positions[lastMeasuredIndex] >= offset) {
97
+ const lastMeasuredIndexRelativeToCurrentPage = clamp(lastMeasuredIndexRelativeToAllRows - (currentPage.range?.firstRowIndex || 0), 0, rowsMeta.positions.length);
98
+
99
+ if (allRowsMeasured || rowsMeta.positions[lastMeasuredIndexRelativeToCurrentPage] >= offset) {
100
100
  // If all rows were measured (when no row has "auto" as height) or all rows before the offset
101
101
  // were measured, then use a binary search because it's faster.
102
102
  return binarySearch(offset, rowsMeta.positions);
@@ -106,7 +106,7 @@ export const useGridVirtualScroller = props => {
106
106
  // Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js
107
107
 
108
108
 
109
- return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndex);
109
+ return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndexRelativeToCurrentPage);
110
110
  }, [apiRef, currentPage.range?.firstRowIndex, currentPage.range?.lastRowIndex, rowsMeta.positions]);
111
111
  const computeRenderContext = React.useCallback(() => {
112
112
  if (disableVirtualization) {
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.3
1
+ /** @license MUI v5.17.5
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.
@@ -21,15 +21,15 @@ const faIRGrid = {
21
21
  toolbarFiltersTooltipShow: 'نمایش فیلترها',
22
22
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} فیلترهای فعال` : `${count} فیلتر فعال`,
23
23
  // Quick filter toolbar field
24
- // toolbarQuickFilterPlaceholder: 'Search…',
25
- // toolbarQuickFilterLabel: 'Search',
26
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
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
- // toolbarExportExcel: 'Download as Excel',
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
- // detailPanelToggle: 'Detail panel toggle',
110
+ detailPanelToggle: 'پنل جزئیات',
111
111
  expandDetailPanel: 'بازکردن پنل جزئیات',
112
- collapseDetailPanel: 'بستن پنل جزئیات' // Row reordering text
113
- // rowReorderingHeaderName: 'Row reordering',
112
+ collapseDetailPanel: 'بستن پنل جزئیات',
113
+ // Row reordering text
114
+ rowReorderingHeaderName: 'ترتیب مجدد سطر',
114
115
  // Aggregation
115
- // aggregationMenuItemHeader: 'Aggregation',
116
- // aggregationFunctionLabelSum: 'sum',
117
- // aggregationFunctionLabelAvg: 'avg',
118
- // aggregationFunctionLabelMin: 'min',
119
- // aggregationFunctionLabelMax: 'max',
120
- // aggregationFunctionLabelSize: 'size',
121
-
116
+ aggregationMenuItemHeader: 'تجمیع',
117
+ aggregationFunctionLabelSum: 'جمع',
118
+ aggregationFunctionLabelAvg: 'میانگین',
119
+ aggregationFunctionLabelMin: 'حداقل',
120
+ aggregationFunctionLabelMax: 'حداکثر',
121
+ aggregationFunctionLabelSize: 'اندازه'
122
122
  };
123
123
  export const faIR = getGridLocalization(faIRGrid, faIRCore);
@@ -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: 'Density',
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
- // toolbarQuickFilterPlaceholder: 'Search…',
25
- // toolbarQuickFilterLabel: 'Search',
26
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
24
+ toolbarQuickFilterPlaceholder: 'Hae…',
25
+ toolbarQuickFilterLabel: 'Hae',
26
+ toolbarQuickFilterDeleteIconLabel: 'Tyhjennä',
27
27
  // Export selector toolbar button text
28
- toolbarExport: 'Export',
29
- toolbarExportLabel: 'Export',
28
+ toolbarExport: 'Vie',
29
+ toolbarExportLabel: 'Vie',
30
30
  toolbarExportCSV: 'Lataa CSV-muodossa',
31
31
  toolbarExportPrint: 'Tulosta',
32
- // toolbarExportExcel: 'Download as Excel',
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
- // filterPanelLinkOperator: 'Logic operator',
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
- // filterOperatorIsAnyOf: 'is any of',
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
- // checkboxSelectionSelectAllRows: 'Select all rows',
89
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
90
- // checkboxSelectionSelectRow: 'Select row',
91
- // checkboxSelectionUnselectRow: 'Unselect row',
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' // Grouping columns
105
- // groupingColumnHeaderName: 'Group',
106
- // groupColumn: name => `Group by ${name}`,
107
- // unGroupColumn: name => `Stop grouping by ${name}`,
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
- // detailPanelToggle: 'Detail panel toggle',
110
- // expandDetailPanel: 'Expand',
111
- // collapseDetailPanel: 'Collapse',
110
+ detailPanelToggle: 'Yksityiskohtapaneelin vaihto',
111
+ expandDetailPanel: 'Laajenna',
112
+ collapseDetailPanel: 'Tiivistä',
112
113
  // Row reordering text
113
- // rowReorderingHeaderName: 'Row reordering',
114
+ rowReorderingHeaderName: 'Rivien uudelleenjärjestely',
114
115
  // Aggregation
115
- // aggregationMenuItemHeader: 'Aggregation',
116
- // aggregationFunctionLabelSum: 'sum',
117
- // aggregationFunctionLabelAvg: 'avg',
118
- // aggregationFunctionLabelMin: 'min',
119
- // aggregationFunctionLabelMax: 'max',
120
- // aggregationFunctionLabelSize: 'size',
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);
@@ -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
- // toolbarQuickFilterPlaceholder: 'Search…',
25
- // toolbarQuickFilterLabel: 'Search',
26
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
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
- // toolbarExportExcel: 'Download as Excel',
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ń' // Row reordering text
113
- // rowReorderingHeaderName: 'Row reordering',
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',
@@ -75,8 +75,7 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
75
75
  }
76
76
 
77
77
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridPaginationRoot, (0, _extends2.default)({
78
- ref: ref // @ts-ignore
79
- ,
78
+ ref: ref,
80
79
  component: "div",
81
80
  count: paginationState.rowCount,
82
81
  page: paginationState.page <= lastPage ? paginationState.page : lastPage,
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.GridRow = GridRow;
8
+ exports.GridRow = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -89,7 +89,7 @@ const EmptyCell = ({
89
89
  }); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
90
90
  };
91
91
 
92
- function GridRow(props) {
92
+ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
93
93
  var _apiRef$current$getRo;
94
94
 
95
95
  const {
@@ -123,6 +123,7 @@ function GridRow(props) {
123
123
  const sortModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortModelSelector);
124
124
  const treeDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowTreeDepthSelector);
125
125
  const headerGroupingMaxDepth = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensityHeaderGroupingMaxDepthSelector);
126
+ const handleRef = (0, _material.useForkRef)(ref, refProp);
126
127
  const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
127
128
 
128
129
  const {
@@ -407,7 +408,7 @@ function GridRow(props) {
407
408
  onMouseLeave: publish('rowMouseLeave', onMouseLeave)
408
409
  } : null;
409
410
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
410
- ref: ref,
411
+ ref: handleRef,
411
412
  "data-id": rowId,
412
413
  "data-rowindex": index,
413
414
  role: "row",
@@ -420,8 +421,8 @@ function GridRow(props) {
420
421
  width: emptyCellWidth
421
422
  })]
422
423
  }));
423
- }
424
-
424
+ });
425
+ exports.GridRow = GridRow;
425
426
  process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
426
427
  // ----------------------------- Warning --------------------------------
427
428
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -98,11 +98,15 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
98
98
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
99
99
  children: [apiRef.current.getLocaleText('toolbarFiltersTooltipActive')(activeFilters.length), /*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarFilterListRoot, {
100
100
  className: classes.root,
101
- children: activeFilters.map((item, index) => (0, _extends2.default)({}, lookup[item.columnField] && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
102
- children: `${lookup[item.columnField].headerName || item.columnField}
101
+ children: activeFilters.map((item, index) => {
102
+ var _item$value;
103
+
104
+ return (0, _extends2.default)({}, lookup[item.columnField] && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
105
+ children: `${lookup[item.columnField].headerName || item.columnField}
103
106
  ${getOperatorLabel(item)}
104
- ${item.value}`
105
- }, index)))
107
+ ${(_item$value = item.value) != null ? _item$value : ''}`
108
+ }, index));
109
+ })
106
110
  })]
107
111
  });
108
112
  }, [apiRef, preferencePanel.open, activeFilters, lookup, classes]);