@mui/x-data-grid 6.9.0 → 6.9.2

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 (154) hide show
  1. package/CHANGELOG.md +136 -8
  2. package/DataGrid/DataGrid.js +4 -1
  3. package/DataGrid/useDataGridComponent.js +1 -1
  4. package/README.md +1 -1
  5. package/colDef/gridActionsColDef.js +2 -1
  6. package/colDef/gridBooleanColDef.js +1 -0
  7. package/colDef/gridBooleanOperators.js +5 -6
  8. package/colDef/gridCheckboxSelectionColDef.js +1 -0
  9. package/colDef/gridDateColDef.js +2 -0
  10. package/colDef/gridDateOperators.js +14 -19
  11. package/colDef/gridNumericColDef.js +3 -1
  12. package/colDef/gridNumericOperators.d.ts +2 -2
  13. package/colDef/gridNumericOperators.js +24 -43
  14. package/colDef/gridSingleSelectOperators.js +9 -14
  15. package/colDef/gridStringColDef.js +3 -1
  16. package/colDef/gridStringOperators.d.ts +2 -2
  17. package/colDef/gridStringOperators.js +22 -36
  18. package/colDef/utils.d.ts +21 -0
  19. package/colDef/utils.js +51 -0
  20. package/components/GridPagination.js +16 -3
  21. package/components/cell/GridCell.js +1 -1
  22. package/components/cell/GridEditDateCell.js +1 -1
  23. package/components/cell/GridEditInputCell.js +3 -3
  24. package/hooks/features/columns/gridColumnsUtils.js +2 -1
  25. package/hooks/features/dimensions/useGridDimensions.js +2 -2
  26. package/hooks/features/editing/useGridEditing.js +2 -1
  27. package/hooks/features/editing/useGridRowEditing.js +2 -2
  28. package/hooks/features/filter/gridFilterState.d.ts +6 -5
  29. package/hooks/features/filter/gridFilterUtils.d.ts +8 -6
  30. package/hooks/features/filter/gridFilterUtils.js +115 -57
  31. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  32. package/hooks/features/filter/useGridFilter.js +34 -25
  33. package/hooks/features/pagination/gridPaginationSelector.js +10 -5
  34. package/hooks/features/rows/gridRowsUtils.d.ts +1 -0
  35. package/hooks/features/rows/gridRowsUtils.js +1 -0
  36. package/hooks/features/rows/useGridParamsApi.d.ts +2 -1
  37. package/hooks/features/rows/useGridParamsApi.js +31 -1
  38. package/hooks/features/rows/useGridRows.js +4 -3
  39. package/index.js +1 -1
  40. package/internals/index.d.ts +2 -1
  41. package/internals/index.js +1 -0
  42. package/joy/joySlots.js +29 -8
  43. package/legacy/DataGrid/DataGrid.js +4 -1
  44. package/legacy/DataGrid/useDataGridComponent.js +1 -1
  45. package/legacy/colDef/gridActionsColDef.js +2 -1
  46. package/legacy/colDef/gridBooleanColDef.js +1 -0
  47. package/legacy/colDef/gridBooleanOperators.js +5 -5
  48. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -0
  49. package/legacy/colDef/gridDateColDef.js +2 -0
  50. package/legacy/colDef/gridDateOperators.js +14 -16
  51. package/legacy/colDef/gridNumericColDef.js +3 -1
  52. package/legacy/colDef/gridNumericOperators.js +24 -33
  53. package/legacy/colDef/gridSingleSelectOperators.js +9 -11
  54. package/legacy/colDef/gridStringColDef.js +3 -1
  55. package/legacy/colDef/gridStringOperators.js +22 -28
  56. package/legacy/colDef/utils.js +51 -0
  57. package/legacy/components/GridPagination.js +16 -3
  58. package/legacy/components/cell/GridCell.js +2 -1
  59. package/legacy/components/cell/GridEditDateCell.js +1 -1
  60. package/legacy/components/cell/GridEditInputCell.js +3 -3
  61. package/legacy/hooks/features/columns/gridColumnsUtils.js +4 -1
  62. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
  63. package/legacy/hooks/features/editing/useGridEditing.js +2 -1
  64. package/legacy/hooks/features/editing/useGridRowEditing.js +2 -2
  65. package/legacy/hooks/features/filter/gridFilterUtils.js +115 -65
  66. package/legacy/hooks/features/filter/useGridFilter.js +32 -24
  67. package/legacy/hooks/features/pagination/gridPaginationSelector.js +10 -5
  68. package/legacy/hooks/features/rows/gridRowsUtils.js +1 -0
  69. package/legacy/hooks/features/rows/useGridParamsApi.js +29 -1
  70. package/legacy/hooks/features/rows/useGridRows.js +15 -16
  71. package/legacy/index.js +1 -1
  72. package/legacy/internals/index.js +1 -0
  73. package/legacy/joy/joySlots.js +29 -8
  74. package/legacy/locales/esES.js +3 -3
  75. package/legacy/locales/huHU.js +23 -25
  76. package/legacy/locales/roRO.js +34 -38
  77. package/locales/esES.js +3 -3
  78. package/locales/huHU.js +23 -25
  79. package/locales/roRO.js +34 -38
  80. package/models/api/gridEditingApi.d.ts +1 -1
  81. package/models/api/gridParamsApi.d.ts +22 -1
  82. package/models/colDef/gridColDef.d.ts +13 -1
  83. package/models/gridFilterOperator.d.ts +17 -2
  84. package/models/gridRows.d.ts +1 -1
  85. package/models/props/DataGridProps.d.ts +4 -1
  86. package/modern/DataGrid/DataGrid.js +4 -1
  87. package/modern/DataGrid/useDataGridComponent.js +1 -1
  88. package/modern/colDef/gridActionsColDef.js +2 -1
  89. package/modern/colDef/gridBooleanColDef.js +1 -0
  90. package/modern/colDef/gridBooleanOperators.js +5 -6
  91. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
  92. package/modern/colDef/gridDateColDef.js +2 -0
  93. package/modern/colDef/gridDateOperators.js +14 -19
  94. package/modern/colDef/gridNumericColDef.js +3 -1
  95. package/modern/colDef/gridNumericOperators.js +24 -43
  96. package/modern/colDef/gridSingleSelectOperators.js +9 -14
  97. package/modern/colDef/gridStringColDef.js +3 -1
  98. package/modern/colDef/gridStringOperators.js +22 -36
  99. package/modern/colDef/utils.js +51 -0
  100. package/modern/components/GridPagination.js +16 -2
  101. package/modern/components/cell/GridCell.js +1 -1
  102. package/modern/components/cell/GridEditDateCell.js +1 -1
  103. package/modern/components/cell/GridEditInputCell.js +3 -3
  104. package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
  105. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
  106. package/modern/hooks/features/editing/useGridEditing.js +1 -1
  107. package/modern/hooks/features/editing/useGridRowEditing.js +2 -2
  108. package/modern/hooks/features/filter/gridFilterUtils.js +110 -54
  109. package/modern/hooks/features/filter/useGridFilter.js +34 -25
  110. package/modern/hooks/features/pagination/gridPaginationSelector.js +9 -5
  111. package/modern/hooks/features/rows/gridRowsUtils.js +1 -0
  112. package/modern/hooks/features/rows/useGridParamsApi.js +29 -1
  113. package/modern/hooks/features/rows/useGridRows.js +4 -3
  114. package/modern/index.js +1 -1
  115. package/modern/internals/index.js +1 -0
  116. package/modern/joy/joySlots.js +29 -7
  117. package/modern/locales/esES.js +3 -3
  118. package/modern/locales/huHU.js +23 -25
  119. package/modern/locales/roRO.js +34 -38
  120. package/node/DataGrid/DataGrid.js +4 -1
  121. package/node/DataGrid/useDataGridComponent.js +1 -1
  122. package/node/colDef/gridActionsColDef.js +2 -1
  123. package/node/colDef/gridBooleanColDef.js +1 -0
  124. package/node/colDef/gridBooleanOperators.js +5 -6
  125. package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
  126. package/node/colDef/gridDateColDef.js +2 -0
  127. package/node/colDef/gridDateOperators.js +14 -19
  128. package/node/colDef/gridNumericColDef.js +3 -1
  129. package/node/colDef/gridNumericOperators.js +24 -43
  130. package/node/colDef/gridSingleSelectOperators.js +9 -14
  131. package/node/colDef/gridStringColDef.js +3 -1
  132. package/node/colDef/gridStringOperators.js +22 -36
  133. package/node/colDef/utils.js +64 -0
  134. package/node/components/GridPagination.js +16 -2
  135. package/node/components/cell/GridCell.js +1 -1
  136. package/node/components/cell/GridEditDateCell.js +1 -1
  137. package/node/components/cell/GridEditInputCell.js +3 -3
  138. package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
  139. package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
  140. package/node/hooks/features/editing/useGridEditing.js +1 -1
  141. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  142. package/node/hooks/features/filter/gridFilterUtils.js +110 -54
  143. package/node/hooks/features/filter/useGridFilter.js +33 -24
  144. package/node/hooks/features/pagination/gridPaginationSelector.js +9 -5
  145. package/node/hooks/features/rows/gridRowsUtils.js +3 -1
  146. package/node/hooks/features/rows/useGridParamsApi.js +29 -1
  147. package/node/hooks/features/rows/useGridRows.js +3 -2
  148. package/node/index.js +1 -1
  149. package/node/internals/index.js +13 -1
  150. package/node/joy/joySlots.js +29 -7
  151. package/node/locales/esES.js +3 -3
  152. package/node/locales/huHU.js +23 -25
  153. package/node/locales/roRO.js +34 -38
  154. package/package.json +2 -2
@@ -21,11 +21,14 @@ import JoySelect from '@mui/joy/Select';
21
21
  import JoyOption from '@mui/joy/Option';
22
22
  import JoyBox from '@mui/joy/Box';
23
23
  import JoyTypography from '@mui/joy/Typography';
24
+ import JoyCircularProgress from '@mui/joy/CircularProgress';
25
+ import JoyTooltip from '@mui/joy/Tooltip';
24
26
  import { unstable_useForkRef as useForkRef } from '@mui/utils';
25
27
  import joyIconSlots, { GridKeyboardArrowRight, GridKeyboardArrowLeft } from './icons';
26
28
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
27
29
  import { useGridRootProps } from '../hooks/utils/useGridRootProps';
28
30
  import { gridFilteredTopLevelRowCountSelector, gridPaginationModelSelector } from '../hooks';
31
+ import { GridOverlay } from '../components/containers/GridOverlay';
29
32
  import { jsx as _jsx } from "react/jsx-runtime";
30
33
  import { jsxs as _jsxs } from "react/jsx-runtime";
31
34
  function convertColor(color) {
@@ -290,7 +293,6 @@ var getLabelDisplayedRowsTo = function getLabelDisplayedRowsTo(_ref11) {
290
293
  return pageSize === -1 ? rowCount : Math.min(rowCount, (page + 1) * pageSize);
291
294
  };
292
295
  var Pagination = /*#__PURE__*/React.forwardRef(function (props, ref) {
293
- var _rootProps$pageSizeOp;
294
296
  var apiRef = useGridApiContext();
295
297
  var rootProps = useGridRootProps();
296
298
  var paginationModel = gridPaginationModelSelector(apiRef);
@@ -307,7 +309,20 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (props, ref) {
307
309
  }, [apiRef]);
308
310
  var page = paginationModel.page <= lastPage ? paginationModel.page : lastPage;
309
311
  var pageSize = paginationModel.pageSize;
310
- var pageSizeOptions = (_rootProps$pageSizeOp = rootProps.pageSizeOptions) != null && _rootProps$pageSizeOp.includes(pageSize) ? rootProps.pageSizeOptions : [];
312
+ var isPageSizeIncludedInPageSizeOptions = function isPageSizeIncludedInPageSizeOptions() {
313
+ for (var i = 0; i < rootProps.pageSizeOptions.length; i += 1) {
314
+ var option = rootProps.pageSizeOptions[i];
315
+ if (typeof option === 'number') {
316
+ if (option === pageSize) {
317
+ return true;
318
+ }
319
+ } else if (option.value === pageSize) {
320
+ return true;
321
+ }
322
+ }
323
+ return false;
324
+ };
325
+ var pageSizeOptions = isPageSizeIncludedInPageSizeOptions() ? rootProps.pageSizeOptions : [];
311
326
  var handleChangeRowsPerPage = function handleChangeRowsPerPage(event, newValue) {
312
327
  var newPageSize = Number(newValue);
313
328
  apiRef.current.setPageSize(newPageSize);
@@ -331,9 +346,9 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (props, ref) {
331
346
  value: pageSize,
332
347
  children: pageSizeOptions.map(function (option) {
333
348
  return /*#__PURE__*/_jsx(Option, {
334
- value: option,
335
- children: option
336
- }, option);
349
+ value: typeof option !== 'number' && option.value ? option.value : option,
350
+ children: typeof option !== 'number' && option.label ? option.label : "".concat(option)
351
+ }, typeof option !== 'number' && option.label ? option.label : "".concat(option));
337
352
  })
338
353
  })]
339
354
  }), /*#__PURE__*/_jsx(JoyTypography, {
@@ -382,6 +397,12 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (props, ref) {
382
397
  })]
383
398
  });
384
399
  });
400
+ var LoadingOverlay = /*#__PURE__*/React.forwardRef(function (props, ref) {
401
+ return /*#__PURE__*/_jsx(GridOverlay, _extends({}, props, {
402
+ ref: ref,
403
+ children: /*#__PURE__*/_jsx(JoyCircularProgress, {})
404
+ }));
405
+ });
385
406
  var joySlots = _extends({}, joyIconSlots, {
386
407
  baseCheckbox: Checkbox,
387
408
  baseTextField: TextField,
@@ -392,8 +413,8 @@ var joySlots = _extends({}, joyIconSlots, {
392
413
  baseSelectOption: Option,
393
414
  baseInputLabel: InputLabel,
394
415
  baseFormControl: JoyFormControl,
395
- // BaseTooltip: MUITooltip,
396
- // BasePopper: MUIPopper,
397
- pagination: Pagination
416
+ baseTooltip: JoyTooltip,
417
+ pagination: Pagination,
418
+ loadingOverlay: LoadingOverlay
398
419
  });
399
420
  export default joySlots;
@@ -8,8 +8,8 @@ var esESGrid = {
8
8
  toolbarDensity: 'Densidad',
9
9
  toolbarDensityLabel: 'Densidad',
10
10
  toolbarDensityCompact: 'Compacta',
11
- toolbarDensityStandard: 'Standard',
12
- toolbarDensityComfortable: 'Comoda',
11
+ toolbarDensityStandard: 'Estándar',
12
+ toolbarDensityComfortable: 'Cómoda',
13
13
  // Columns selector toolbar button text
14
14
  toolbarColumns: 'Columnas',
15
15
  toolbarColumnsLabel: 'Seleccionar columnas',
@@ -39,7 +39,7 @@ var esESGrid = {
39
39
  columnsPanelHideAllButton: 'Ocultar todo',
40
40
  // Filter panel text
41
41
  filterPanelAddFilter: 'Agregar filtro',
42
- // filterPanelRemoveAll: 'Remove all',
42
+ filterPanelRemoveAll: 'Remover todos',
43
43
  filterPanelDeleteIconLabel: 'Borrar',
44
44
  filterPanelLogicOperator: 'Operador lógico',
45
45
  filterPanelOperator: 'Operadores',
@@ -62,34 +62,32 @@ var huHUGrid = {
62
62
  filterOperatorIsEmpty: 'üres',
63
63
  filterOperatorIsNotEmpty: 'nem üres',
64
64
  filterOperatorIsAnyOf: 'a következők egyike:',
65
- // 'filterOperator=': '=',
66
- // 'filterOperator!=': '!=',
67
- // 'filterOperator>': '>',
68
- // 'filterOperator>=': '>=',
69
- // 'filterOperator<': '<',
70
- // 'filterOperator<=': '<=',
71
-
65
+ 'filterOperator=': '=',
66
+ 'filterOperator!=': '!=',
67
+ 'filterOperator>': '>',
68
+ 'filterOperator>=': '>=',
69
+ 'filterOperator<': '<',
70
+ 'filterOperator<=': '<=',
72
71
  // Header filter operators text
73
- // headerFilterOperatorContains: 'Contains',
74
- // headerFilterOperatorEquals: 'Equals',
75
- // headerFilterOperatorStartsWith: 'Starts with',
76
- // headerFilterOperatorEndsWith: 'Ends with',
72
+ headerFilterOperatorContains: 'Tartalmazza:',
73
+ headerFilterOperatorEquals: 'Egyenlő ezzel:',
74
+ headerFilterOperatorStartsWith: 'Ezzel kezdődik:',
75
+ headerFilterOperatorEndsWith: 'Ezzel végződik:',
77
76
  // headerFilterOperatorIs: 'Is',
78
77
  // headerFilterOperatorNot: 'Is not',
79
- // headerFilterOperatorAfter: 'Is after',
80
- // headerFilterOperatorOnOrAfter: 'Is on or after',
81
- // headerFilterOperatorBefore: 'Is before',
82
- // headerFilterOperatorOnOrBefore: 'Is on or before',
83
- // headerFilterOperatorIsEmpty: 'Is empty',
84
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
85
- // headerFilterOperatorIsAnyOf: 'Is any of',
86
- // 'headerFilterOperator=': 'Equals',
87
- // 'headerFilterOperator!=': 'Not equals',
88
- // 'headerFilterOperator>': 'Greater than',
89
- // 'headerFilterOperator>=': 'Greater than or equal to',
90
- // 'headerFilterOperator<': 'Less than',
91
- // 'headerFilterOperator<=': 'Less than or equal to',
92
-
78
+ headerFilterOperatorAfter: 'Ezutáni:',
79
+ headerFilterOperatorOnOrAfter: 'Ekkozori vagy ezutáni:',
80
+ headerFilterOperatorBefore: 'Ezelőtti:',
81
+ headerFilterOperatorOnOrBefore: 'Ekkori vagy ezelőtti:',
82
+ headerFilterOperatorIsEmpty: 'Üres',
83
+ headerFilterOperatorIsNotEmpty: 'Nem üres',
84
+ headerFilterOperatorIsAnyOf: 'A következők egyike:',
85
+ 'headerFilterOperator=': 'Egyenlő',
86
+ 'headerFilterOperator!=': 'Nem egyenlő',
87
+ 'headerFilterOperator>': 'Nagyobb mint',
88
+ 'headerFilterOperator>=': 'Nagyobb vagy egyenlő',
89
+ 'headerFilterOperator<': 'Kissebb mint',
90
+ 'headerFilterOperator<=': 'Kissebb vagy enygenlő',
93
91
  // Filter values text
94
92
  filterValueAny: 'bármilyen',
95
93
  filterValueTrue: 'igaz',
@@ -39,7 +39,7 @@ var roROGrid = {
39
39
  columnsPanelHideAllButton: 'Ascunde tot',
40
40
  // Filter panel text
41
41
  filterPanelAddFilter: 'Adăugare filtru',
42
- // filterPanelRemoveAll: 'Remove all',
42
+ filterPanelRemoveAll: 'Șterge tot',
43
43
  filterPanelDeleteIconLabel: 'Ștergere',
44
44
  filterPanelLogicOperator: 'Operatori logici',
45
45
  filterPanelOperator: 'Operatori',
@@ -62,34 +62,32 @@ var roROGrid = {
62
62
  filterOperatorIsEmpty: 'este gol',
63
63
  filterOperatorIsNotEmpty: 'nu este gol',
64
64
  filterOperatorIsAnyOf: 'este una din valori',
65
- // 'filterOperator=': '=',
66
- // 'filterOperator!=': '!=',
67
- // 'filterOperator>': '>',
68
- // 'filterOperator>=': '>=',
69
- // 'filterOperator<': '<',
70
- // 'filterOperator<=': '<=',
71
-
65
+ 'filterOperator=': '=',
66
+ 'filterOperator!=': '!=',
67
+ 'filterOperator>': '>',
68
+ 'filterOperator>=': '>=',
69
+ 'filterOperator<': '<',
70
+ 'filterOperator<=': '<=',
72
71
  // Header filter operators text
73
- // headerFilterOperatorContains: 'Contains',
74
- // headerFilterOperatorEquals: 'Equals',
75
- // headerFilterOperatorStartsWith: 'Starts with',
76
- // headerFilterOperatorEndsWith: 'Ends with',
77
- // headerFilterOperatorIs: 'Is',
78
- // headerFilterOperatorNot: 'Is not',
79
- // headerFilterOperatorAfter: 'Is after',
80
- // headerFilterOperatorOnOrAfter: 'Is on or after',
81
- // headerFilterOperatorBefore: 'Is before',
82
- // headerFilterOperatorOnOrBefore: 'Is on or before',
83
- // headerFilterOperatorIsEmpty: 'Is empty',
84
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
85
- // headerFilterOperatorIsAnyOf: 'Is any of',
86
- // 'headerFilterOperator=': 'Equals',
87
- // 'headerFilterOperator!=': 'Not equals',
88
- // 'headerFilterOperator>': 'Greater than',
89
- // 'headerFilterOperator>=': 'Greater than or equal to',
90
- // 'headerFilterOperator<': 'Less than',
91
- // 'headerFilterOperator<=': 'Less than or equal to',
92
-
72
+ headerFilterOperatorContains: 'Conține',
73
+ headerFilterOperatorEquals: 'Egal cu',
74
+ headerFilterOperatorStartsWith: 'Începe cu',
75
+ headerFilterOperatorEndsWith: 'Se termină cu',
76
+ headerFilterOperatorIs: 'Este',
77
+ headerFilterOperatorNot: 'Nu este',
78
+ headerFilterOperatorAfter: 'Este după',
79
+ headerFilterOperatorOnOrAfter: 'Este la sau „după”',
80
+ headerFilterOperatorBefore: 'Este înainte de',
81
+ headerFilterOperatorOnOrBefore: 'este la sau înainte de',
82
+ headerFilterOperatorIsEmpty: 'Este gol',
83
+ headerFilterOperatorIsNotEmpty: 'Nu este gol',
84
+ headerFilterOperatorIsAnyOf: 'Este una din valori',
85
+ 'headerFilterOperator=': 'Egal cu',
86
+ 'headerFilterOperator!=': 'Nu este egal cu',
87
+ 'headerFilterOperator>': 'Mai mare decât',
88
+ 'headerFilterOperator>=': 'Mai mare sau egal cu',
89
+ 'headerFilterOperator<': 'Mai mic decât',
90
+ 'headerFilterOperator<=': 'Mai mic sau egal cu',
93
91
  // Filter values text
94
92
  filterValueAny: 'Aleatoriu',
95
93
  filterValueTrue: 'Da',
@@ -97,7 +95,7 @@ var roROGrid = {
97
95
  // Column menu text
98
96
  columnMenuLabel: 'Meniu',
99
97
  columnMenuShowColumns: 'Afișează toate coloanele',
100
- // columnMenuManageColumns: 'Manage columns',
98
+ columnMenuManageColumns: 'Gestionează coloane',
101
99
  columnMenuFilter: 'Filtru',
102
100
  columnMenuHideColumn: 'Ascunde',
103
101
  columnMenuUnsort: 'Dezactivare sortare',
@@ -151,15 +149,13 @@ var roROGrid = {
151
149
  expandDetailPanel: 'Extindere',
152
150
  collapseDetailPanel: 'Restrângere',
153
151
  // Row reordering text
154
- rowReorderingHeaderName: 'Reordonare rânduri'
155
-
152
+ rowReorderingHeaderName: 'Reordonare rânduri',
156
153
  // Aggregation
157
- // aggregationMenuItemHeader: 'Aggregation',
158
- // aggregationFunctionLabelSum: 'sum',
159
- // aggregationFunctionLabelAvg: 'avg',
160
- // aggregationFunctionLabelMin: 'min',
161
- // aggregationFunctionLabelMax: 'max',
162
- // aggregationFunctionLabelSize: 'size',
154
+ aggregationMenuItemHeader: 'Agregare',
155
+ aggregationFunctionLabelSum: 'Sumă',
156
+ aggregationFunctionLabelAvg: 'Medie',
157
+ aggregationFunctionLabelMin: 'Minim',
158
+ aggregationFunctionLabelMax: 'Maxim',
159
+ aggregationFunctionLabelSize: 'Numărul elementelor'
163
160
  };
164
-
165
161
  export var roRO = getGridLocalization(roROGrid, roROCore);
package/locales/esES.js CHANGED
@@ -8,8 +8,8 @@ const esESGrid = {
8
8
  toolbarDensity: 'Densidad',
9
9
  toolbarDensityLabel: 'Densidad',
10
10
  toolbarDensityCompact: 'Compacta',
11
- toolbarDensityStandard: 'Standard',
12
- toolbarDensityComfortable: 'Comoda',
11
+ toolbarDensityStandard: 'Estándar',
12
+ toolbarDensityComfortable: 'Cómoda',
13
13
  // Columns selector toolbar button text
14
14
  toolbarColumns: 'Columnas',
15
15
  toolbarColumnsLabel: 'Seleccionar columnas',
@@ -37,7 +37,7 @@ const esESGrid = {
37
37
  columnsPanelHideAllButton: 'Ocultar todo',
38
38
  // Filter panel text
39
39
  filterPanelAddFilter: 'Agregar filtro',
40
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: 'Remover todos',
41
41
  filterPanelDeleteIconLabel: 'Borrar',
42
42
  filterPanelLogicOperator: 'Operador lógico',
43
43
  filterPanelOperator: 'Operadores',
package/locales/huHU.js CHANGED
@@ -60,34 +60,32 @@ const huHUGrid = {
60
60
  filterOperatorIsEmpty: 'üres',
61
61
  filterOperatorIsNotEmpty: 'nem üres',
62
62
  filterOperatorIsAnyOf: 'a következők egyike:',
63
- // 'filterOperator=': '=',
64
- // 'filterOperator!=': '!=',
65
- // 'filterOperator>': '>',
66
- // 'filterOperator>=': '>=',
67
- // 'filterOperator<': '<',
68
- // 'filterOperator<=': '<=',
69
-
63
+ 'filterOperator=': '=',
64
+ 'filterOperator!=': '!=',
65
+ 'filterOperator>': '>',
66
+ 'filterOperator>=': '>=',
67
+ 'filterOperator<': '<',
68
+ 'filterOperator<=': '<=',
70
69
  // Header filter operators text
71
- // headerFilterOperatorContains: 'Contains',
72
- // headerFilterOperatorEquals: 'Equals',
73
- // headerFilterOperatorStartsWith: 'Starts with',
74
- // headerFilterOperatorEndsWith: 'Ends with',
70
+ headerFilterOperatorContains: 'Tartalmazza:',
71
+ headerFilterOperatorEquals: 'Egyenlő ezzel:',
72
+ headerFilterOperatorStartsWith: 'Ezzel kezdődik:',
73
+ headerFilterOperatorEndsWith: 'Ezzel végződik:',
75
74
  // headerFilterOperatorIs: 'Is',
76
75
  // headerFilterOperatorNot: 'Is not',
77
- // headerFilterOperatorAfter: 'Is after',
78
- // headerFilterOperatorOnOrAfter: 'Is on or after',
79
- // headerFilterOperatorBefore: 'Is before',
80
- // headerFilterOperatorOnOrBefore: 'Is on or before',
81
- // headerFilterOperatorIsEmpty: 'Is empty',
82
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
83
- // headerFilterOperatorIsAnyOf: 'Is any of',
84
- // 'headerFilterOperator=': 'Equals',
85
- // 'headerFilterOperator!=': 'Not equals',
86
- // 'headerFilterOperator>': 'Greater than',
87
- // 'headerFilterOperator>=': 'Greater than or equal to',
88
- // 'headerFilterOperator<': 'Less than',
89
- // 'headerFilterOperator<=': 'Less than or equal to',
90
-
76
+ headerFilterOperatorAfter: 'Ezutáni:',
77
+ headerFilterOperatorOnOrAfter: 'Ekkozori vagy ezutáni:',
78
+ headerFilterOperatorBefore: 'Ezelőtti:',
79
+ headerFilterOperatorOnOrBefore: 'Ekkori vagy ezelőtti:',
80
+ headerFilterOperatorIsEmpty: 'Üres',
81
+ headerFilterOperatorIsNotEmpty: 'Nem üres',
82
+ headerFilterOperatorIsAnyOf: 'A következők egyike:',
83
+ 'headerFilterOperator=': 'Egyenlő',
84
+ 'headerFilterOperator!=': 'Nem egyenlő',
85
+ 'headerFilterOperator>': 'Nagyobb mint',
86
+ 'headerFilterOperator>=': 'Nagyobb vagy egyenlő',
87
+ 'headerFilterOperator<': 'Kissebb mint',
88
+ 'headerFilterOperator<=': 'Kissebb vagy enygenlő',
91
89
  // Filter values text
92
90
  filterValueAny: 'bármilyen',
93
91
  filterValueTrue: 'igaz',
package/locales/roRO.js CHANGED
@@ -37,7 +37,7 @@ const roROGrid = {
37
37
  columnsPanelHideAllButton: 'Ascunde tot',
38
38
  // Filter panel text
39
39
  filterPanelAddFilter: 'Adăugare filtru',
40
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: 'Șterge tot',
41
41
  filterPanelDeleteIconLabel: 'Ștergere',
42
42
  filterPanelLogicOperator: 'Operatori logici',
43
43
  filterPanelOperator: 'Operatori',
@@ -60,34 +60,32 @@ const roROGrid = {
60
60
  filterOperatorIsEmpty: 'este gol',
61
61
  filterOperatorIsNotEmpty: 'nu este gol',
62
62
  filterOperatorIsAnyOf: 'este una din valori',
63
- // 'filterOperator=': '=',
64
- // 'filterOperator!=': '!=',
65
- // 'filterOperator>': '>',
66
- // 'filterOperator>=': '>=',
67
- // 'filterOperator<': '<',
68
- // 'filterOperator<=': '<=',
69
-
63
+ 'filterOperator=': '=',
64
+ 'filterOperator!=': '!=',
65
+ 'filterOperator>': '>',
66
+ 'filterOperator>=': '>=',
67
+ 'filterOperator<': '<',
68
+ 'filterOperator<=': '<=',
70
69
  // Header filter operators text
71
- // headerFilterOperatorContains: 'Contains',
72
- // headerFilterOperatorEquals: 'Equals',
73
- // headerFilterOperatorStartsWith: 'Starts with',
74
- // headerFilterOperatorEndsWith: 'Ends with',
75
- // headerFilterOperatorIs: 'Is',
76
- // headerFilterOperatorNot: 'Is not',
77
- // headerFilterOperatorAfter: 'Is after',
78
- // headerFilterOperatorOnOrAfter: 'Is on or after',
79
- // headerFilterOperatorBefore: 'Is before',
80
- // headerFilterOperatorOnOrBefore: 'Is on or before',
81
- // headerFilterOperatorIsEmpty: 'Is empty',
82
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
83
- // headerFilterOperatorIsAnyOf: 'Is any of',
84
- // 'headerFilterOperator=': 'Equals',
85
- // 'headerFilterOperator!=': 'Not equals',
86
- // 'headerFilterOperator>': 'Greater than',
87
- // 'headerFilterOperator>=': 'Greater than or equal to',
88
- // 'headerFilterOperator<': 'Less than',
89
- // 'headerFilterOperator<=': 'Less than or equal to',
90
-
70
+ headerFilterOperatorContains: 'Conține',
71
+ headerFilterOperatorEquals: 'Egal cu',
72
+ headerFilterOperatorStartsWith: 'Începe cu',
73
+ headerFilterOperatorEndsWith: 'Se termină cu',
74
+ headerFilterOperatorIs: 'Este',
75
+ headerFilterOperatorNot: 'Nu este',
76
+ headerFilterOperatorAfter: 'Este după',
77
+ headerFilterOperatorOnOrAfter: 'Este la sau „după”',
78
+ headerFilterOperatorBefore: 'Este înainte de',
79
+ headerFilterOperatorOnOrBefore: 'este la sau înainte de',
80
+ headerFilterOperatorIsEmpty: 'Este gol',
81
+ headerFilterOperatorIsNotEmpty: 'Nu este gol',
82
+ headerFilterOperatorIsAnyOf: 'Este una din valori',
83
+ 'headerFilterOperator=': 'Egal cu',
84
+ 'headerFilterOperator!=': 'Nu este egal cu',
85
+ 'headerFilterOperator>': 'Mai mare decât',
86
+ 'headerFilterOperator>=': 'Mai mare sau egal cu',
87
+ 'headerFilterOperator<': 'Mai mic decât',
88
+ 'headerFilterOperator<=': 'Mai mic sau egal cu',
91
89
  // Filter values text
92
90
  filterValueAny: 'Aleatoriu',
93
91
  filterValueTrue: 'Da',
@@ -95,7 +93,7 @@ const roROGrid = {
95
93
  // Column menu text
96
94
  columnMenuLabel: 'Meniu',
97
95
  columnMenuShowColumns: 'Afișează toate coloanele',
98
- // columnMenuManageColumns: 'Manage columns',
96
+ columnMenuManageColumns: 'Gestionează coloane',
99
97
  columnMenuFilter: 'Filtru',
100
98
  columnMenuHideColumn: 'Ascunde',
101
99
  columnMenuUnsort: 'Dezactivare sortare',
@@ -139,15 +137,13 @@ const roROGrid = {
139
137
  expandDetailPanel: 'Extindere',
140
138
  collapseDetailPanel: 'Restrângere',
141
139
  // Row reordering text
142
- rowReorderingHeaderName: 'Reordonare rânduri'
143
-
140
+ rowReorderingHeaderName: 'Reordonare rânduri',
144
141
  // Aggregation
145
- // aggregationMenuItemHeader: 'Aggregation',
146
- // aggregationFunctionLabelSum: 'sum',
147
- // aggregationFunctionLabelAvg: 'avg',
148
- // aggregationFunctionLabelMin: 'min',
149
- // aggregationFunctionLabelMax: 'max',
150
- // aggregationFunctionLabelSize: 'size',
142
+ aggregationMenuItemHeader: 'Agregare',
143
+ aggregationFunctionLabelSum: 'Sumă',
144
+ aggregationFunctionLabelAvg: 'Medie',
145
+ aggregationFunctionLabelMin: 'Minim',
146
+ aggregationFunctionLabelMax: 'Maxim',
147
+ aggregationFunctionLabelSize: 'Numărul elementelor'
151
148
  };
152
-
153
149
  export const roRO = getGridLocalization(roROGrid, roROCore);
@@ -52,7 +52,7 @@ export interface GridEditingSharedApi {
52
52
  * @param {string} field The field being edited.
53
53
  * @ignore - do not document.
54
54
  */
55
- unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta;
55
+ unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta | null;
56
56
  }
57
57
  export interface GridEditingSharedPrivateApi {
58
58
  /**
@@ -1,4 +1,5 @@
1
- import { GridValidRowModel, GridRowId, GridTreeNode } from '../gridRows';
1
+ import { GridColDef } from '../colDef';
2
+ import { GridValidRowModel, GridRowId, GridTreeNode, GridRowModel } from '../gridRows';
2
3
  import { GridCellParams } from '../params/gridCellParams';
3
4
  import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
4
5
  import { GridRowParams } from '../params/gridRowParams';
@@ -11,6 +12,26 @@ export interface GridParamsApi {
11
12
  * @returns {v} The cell value.
12
13
  */
13
14
  getCellValue: <V extends any = any>(id: GridRowId, field: string) => V;
15
+ /**
16
+ * Gets the cell value.
17
+ * Use it instead of `getCellValue` for better performance if you have `row` and `colDef`.
18
+ * @template V
19
+ * @param {GridRowModel} row The row model.
20
+ * @param {GridColDef} colDef The column definition.
21
+ * @returns {v} The cell value.
22
+ * @ignore - do not document
23
+ */
24
+ getRowValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
25
+ /**
26
+ * Gets the cell formatted value
27
+ * Use it instead of `getCellParams` for better performance if you only need the formatted value.
28
+ * @template V
29
+ * @param {GridRowModel} row The row model.
30
+ * @param {GridColDef} colDef The column definition.
31
+ * @returns {v} The cell value.
32
+ * @ignore - do not document
33
+ */
34
+ getRowFormattedValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
14
35
  /**
15
36
  * Gets the underlying DOM element for a cell at the given `id` and `field`.
16
37
  * @param {GridRowId} id The id of the row.
@@ -24,6 +24,9 @@ export type ValueOptions = string | number | {
24
24
  * Value that can be used as a key for grouping rows
25
25
  */
26
26
  export type GridKeyValue = string | number | boolean;
27
+ export type GridApplyQuickFilterV7<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
28
+ export type GetApplyQuickFilterFnLegacy<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | ((params: GridCellParams<R, V, F>) => boolean);
29
+ export type GetApplyQuickFilterFnV7<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | GridApplyQuickFilterV7<R, V>;
27
30
  /**
28
31
  * Column Definition base interface.
29
32
  */
@@ -207,7 +210,16 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
207
210
  * @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
208
211
  * @returns {null | ((params: GridCellParams) => boolean)} The function to call to check if a row pass this filter value or not.
209
212
  */
210
- getApplyQuickFilterFn?: (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | ((params: GridCellParams<R, V, F>) => boolean);
213
+ getApplyQuickFilterFn?: GetApplyQuickFilterFnLegacy<R, V, F>;
214
+ /**
215
+ * The callback that generates a filtering function for a given quick filter value.
216
+ * This function can return `null` to skip filtering for this value and column.
217
+ * @param {any} value The value with which we want to filter the column.
218
+ * @param {GridStateColDef} colDef The column from which we want to filter the rows.
219
+ * @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
220
+ * @returns {null | GridApplyQuickFilterV7} The function to call to check if a row pass this filter value or not.
221
+ */
222
+ getApplyQuickFilterFnV7?: GetApplyQuickFilterFnV7<R, V>;
211
223
  /**
212
224
  * If `true`, this column cannot be reordered.
213
225
  * @default false
@@ -3,6 +3,11 @@ import { GridFilterItem } from './gridFilterItem';
3
3
  import { GridCellParams } from './params/gridCellParams';
4
4
  import type { GridColDef } from './colDef/gridColDef';
5
5
  import type { GridValidRowModel } from './gridRows';
6
+ import type { GridApiCommunity } from './api/gridApiCommunity';
7
+ type ApplyFilterFnLegacy<R extends GridValidRowModel = any, V = any, F = V> = (params: GridCellParams<R, V, F>) => boolean;
8
+ type ApplyFilterFnV7<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
9
+ export type GetApplyFilterFnV7<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFnV7<R, V, F>;
10
+ export type GetApplyFilterFnLegacy<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFnLegacy<R, V, F>;
6
11
  /**
7
12
  * Filter operator definition interface.
8
13
  * @demos
@@ -27,9 +32,18 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
27
32
  * This function can return `null` to skip filtering for this item and column.
28
33
  * @param {GridFilterItem} filterItem The filter item with which we want to filter the column.
29
34
  * @param {GridColDef} column The column from which we want to filter the rows.
30
- * @returns {null | ((params: GridCellParams) => boolean)} The function to call to check if a row pass this filter item or not.
35
+ * @returns {null | ApplyFilterFnLegacy} The function to call to check if a row pass this filter item or not.
31
36
  */
32
- getApplyFilterFn: (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ((params: GridCellParams<R, V, F>) => boolean);
37
+ getApplyFilterFn: GetApplyFilterFnLegacy<R, V, F>;
38
+ /**
39
+ * The callback that generates a filtering function for a given filter item and column.
40
+ * This function can return `null` to skip filtering for this item and column.
41
+ * This function uses the more performant V7 API.
42
+ * @param {GridFilterItem} filterItem The filter item with which we want to filter the column.
43
+ * @param {GridColDef} column The column from which we want to filter the rows.
44
+ * @returns {null | ApplyFilterFnV7} The function to call to check if a row pass this filter item or not.
45
+ */
46
+ getApplyFilterFnV7?: GetApplyFilterFnV7<R, V, F>;
33
47
  /**
34
48
  * The input component to render in the filter panel for this filter operator.
35
49
  */
@@ -51,3 +65,4 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
51
65
  */
52
66
  requiresFilterValue?: boolean;
53
67
  }
68
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { GridKeyValue } from './colDef/gridColDef';
2
2
  export type GridValidRowModel = {
3
- [key: string]: any;
3
+ [key: string | symbol]: any;
4
4
  };
5
5
  export type GridRowsProp<R extends GridValidRowModel = GridValidRowModel> = Readonly<GridRowModel<R>[]>;
6
6
  /**
@@ -256,7 +256,10 @@ export interface DataGridPropsWithDefaultValues {
256
256
  * Select the pageSize dynamically using the component UI.
257
257
  * @default [25, 50, 100]
258
258
  */
259
- pageSizeOptions: number[];
259
+ pageSizeOptions: Array<number | {
260
+ value: number;
261
+ label: string;
262
+ }>;
260
263
  /**
261
264
  * Sets the type of space between rows added by `getRowSpacing`.
262
265
  * @default "margin"
@@ -513,7 +513,10 @@ DataGridRaw.propTypes = {
513
513
  * Select the pageSize dynamically using the component UI.
514
514
  * @default [25, 50, 100]
515
515
  */
516
- pageSizeOptions: PropTypes.arrayOf(PropTypes.number),
516
+ pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
517
+ label: PropTypes.string.isRequired,
518
+ value: PropTypes.number.isRequired
519
+ })]).isRequired),
517
520
  pagination: props => {
518
521
  if (props.pagination === false) {
519
522
  return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination.'].join('\n'));
@@ -54,7 +54,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
54
54
  useGridRowSelection(privateApiRef, props);
55
55
  useGridColumns(privateApiRef, props);
56
56
  useGridRows(privateApiRef, props);
57
- useGridParamsApi(privateApiRef);
57
+ useGridParamsApi(privateApiRef, props);
58
58
  useGridColumnSpanning(privateApiRef);
59
59
  useGridColumnGrouping(privateApiRef, props);
60
60
  useGridEditing(privateApiRef, props);
@@ -14,5 +14,6 @@ export const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
14
14
  disableColumnMenu: true,
15
15
  disableExport: true,
16
16
  renderCell: renderActionsCell,
17
- getApplyQuickFilterFn: undefined
17
+ getApplyQuickFilterFn: undefined,
18
+ getApplyQuickFilterFnV7: undefined
18
19
  });
@@ -36,6 +36,7 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
36
36
  valueFormatter: gridBooleanFormatter,
37
37
  filterOperators: getGridBooleanOperators(),
38
38
  getApplyQuickFilterFn: undefined,
39
+ getApplyQuickFilterFnV7: undefined,
39
40
  // @ts-ignore
40
41
  aggregable: false,
41
42
  // @ts-ignore