@mui/x-data-grid 6.0.4 → 6.2.0

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 (131) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/components/GridAutoSizer.js +3 -0
  3. package/components/GridPagination.d.ts +6 -6
  4. package/components/GridRow.js +3 -1
  5. package/components/cell/GridActionsCellItem.d.ts +2 -2
  6. package/components/cell/GridEditDateCell.js +37 -16
  7. package/components/columnHeaders/ColumnHeaderMenuIcon.js +20 -16
  8. package/components/panel/GridColumnsPanel.d.ts +8 -0
  9. package/components/panel/GridColumnsPanel.js +18 -6
  10. package/components/panel/GridPanel.d.ts +1 -1
  11. package/components/panel/filterPanel/GridFilterInputBoolean.js +37 -29
  12. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -30
  13. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  14. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  15. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  16. package/hooks/core/useGridApiInitialization.js +3 -3
  17. package/hooks/features/columns/gridColumnsSelector.d.ts +3 -3
  18. package/hooks/features/editing/useGridCellEditing.js +5 -1
  19. package/hooks/features/editing/useGridEditing.js +1 -3
  20. package/hooks/features/editing/useGridRowEditing.js +5 -1
  21. package/hooks/features/filter/gridFilterState.js +6 -1
  22. package/hooks/features/filter/useGridFilter.js +5 -0
  23. package/hooks/features/rowSelection/useGridRowSelection.js +5 -26
  24. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +36 -16
  25. package/index.js +9 -1
  26. package/legacy/components/GridAutoSizer.js +3 -0
  27. package/legacy/components/GridRow.js +4 -1
  28. package/legacy/components/cell/GridEditBooleanCell.js +19 -21
  29. package/legacy/components/cell/GridEditDateCell.js +69 -39
  30. package/legacy/components/cell/GridEditInputCell.js +25 -27
  31. package/legacy/components/cell/GridEditSingleSelectCell.js +26 -28
  32. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +20 -16
  33. package/legacy/components/panel/GridColumnsPanel.js +19 -6
  34. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +37 -29
  35. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -30
  36. package/legacy/hooks/core/useGridApiInitialization.js +3 -3
  37. package/legacy/hooks/features/columns/gridColumnsUtils.js +2 -2
  38. package/legacy/hooks/features/editing/useGridCellEditing.js +120 -120
  39. package/legacy/hooks/features/editing/useGridEditing.js +17 -21
  40. package/legacy/hooks/features/editing/useGridRowEditing.js +5 -1
  41. package/legacy/hooks/features/export/useGridPrintExport.js +45 -47
  42. package/legacy/hooks/features/filter/gridFilterState.js +6 -1
  43. package/legacy/hooks/features/filter/useGridFilter.js +5 -0
  44. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +5 -24
  45. package/legacy/hooks/features/rows/gridRowsUtils.js +2 -2
  46. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +6 -6
  47. package/legacy/index.js +9 -1
  48. package/legacy/locales/coreLocales.js +0 -1
  49. package/legacy/locales/frFR.js +7 -9
  50. package/legacy/locales/huHU.js +15 -20
  51. package/legacy/locales/jaJP.js +1 -1
  52. package/legacy/locales/nlNL.js +3 -3
  53. package/legacy/locales/ptBR.js +7 -9
  54. package/legacy/locales/ruRU.js +1 -1
  55. package/legacy/locales/urPK.js +6 -6
  56. package/legacy/models/gridColumnGrouping.js +4 -0
  57. package/legacy/models/params/gridRowParams.js +8 -0
  58. package/legacy/utils/createSelector.js +14 -22
  59. package/legacy/utils/utils.js +1 -1
  60. package/locales/coreLocales.js +0 -1
  61. package/locales/frFR.js +7 -9
  62. package/locales/huHU.js +15 -20
  63. package/locales/jaJP.js +1 -1
  64. package/locales/nlNL.js +3 -3
  65. package/locales/ptBR.js +7 -9
  66. package/locales/ruRU.js +1 -1
  67. package/locales/urPK.js +6 -6
  68. package/models/api/gridCoreApi.d.ts +3 -1
  69. package/models/api/gridEditingApi.d.ts +4 -0
  70. package/models/gridColumnGrouping.js +4 -0
  71. package/models/params/gridRowParams.js +8 -0
  72. package/modern/components/GridAutoSizer.js +3 -0
  73. package/modern/components/GridRow.js +3 -1
  74. package/modern/components/cell/GridEditDateCell.js +37 -16
  75. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
  76. package/modern/components/panel/GridColumnsPanel.js +18 -6
  77. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +36 -28
  78. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +33 -29
  79. package/modern/hooks/core/useGridApiInitialization.js +3 -3
  80. package/modern/hooks/features/editing/useGridCellEditing.js +5 -1
  81. package/modern/hooks/features/editing/useGridEditing.js +1 -3
  82. package/modern/hooks/features/editing/useGridRowEditing.js +5 -1
  83. package/modern/hooks/features/filter/gridFilterState.js +6 -1
  84. package/modern/hooks/features/filter/useGridFilter.js +5 -0
  85. package/modern/hooks/features/rowSelection/useGridRowSelection.js +5 -26
  86. package/modern/index.js +9 -1
  87. package/modern/locales/coreLocales.js +0 -1
  88. package/modern/locales/frFR.js +7 -9
  89. package/modern/locales/huHU.js +15 -20
  90. package/modern/locales/jaJP.js +1 -1
  91. package/modern/locales/nlNL.js +3 -3
  92. package/modern/locales/ptBR.js +7 -9
  93. package/modern/locales/ruRU.js +1 -1
  94. package/modern/locales/urPK.js +6 -6
  95. package/modern/models/gridColumnGrouping.js +4 -0
  96. package/modern/models/params/gridRowParams.js +8 -0
  97. package/modern/utils/createSelector.js +12 -22
  98. package/modern/utils/utils.js +1 -1
  99. package/node/components/GridAutoSizer.js +3 -1
  100. package/node/components/GridRow.js +3 -1
  101. package/node/components/cell/GridCell.js +1 -0
  102. package/node/components/cell/GridEditDateCell.js +37 -16
  103. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
  104. package/node/components/panel/GridColumnsPanel.js +18 -6
  105. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +36 -28
  106. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +32 -29
  107. package/node/hooks/core/useGridApiInitialization.js +3 -3
  108. package/node/hooks/features/editing/useGridCellEditing.js +5 -1
  109. package/node/hooks/features/editing/useGridEditing.js +1 -3
  110. package/node/hooks/features/editing/useGridRowEditing.js +5 -1
  111. package/node/hooks/features/filter/gridFilterState.js +5 -0
  112. package/node/hooks/features/filter/useGridFilter.js +5 -0
  113. package/node/hooks/features/rowSelection/useGridRowSelection.js +4 -25
  114. package/node/index.js +1 -1
  115. package/node/locales/frFR.js +7 -9
  116. package/node/locales/huHU.js +15 -20
  117. package/node/locales/jaJP.js +1 -1
  118. package/node/locales/nlNL.js +3 -3
  119. package/node/locales/ptBR.js +7 -9
  120. package/node/locales/ruRU.js +1 -1
  121. package/node/locales/urPK.js +6 -6
  122. package/node/models/gridColumnGrouping.js +4 -0
  123. package/node/models/params/gridEditCellParams.js +1 -0
  124. package/node/models/params/gridRowParams.js +9 -0
  125. package/node/utils/createSelector.js +12 -22
  126. package/node/utils/utils.js +1 -1
  127. package/package.json +1 -1
  128. package/utils/createSelector.d.ts +4 -4
  129. package/utils/createSelector.js +14 -22
  130. package/utils/utils.d.ts +1 -1
  131. package/utils/utils.js +1 -1
@@ -22,17 +22,15 @@ var huHUGrid = {
22
22
  return "".concat(count, " akt\xEDv sz\u0171r\u0151");
23
23
  },
24
24
  // Quick filter toolbar field
25
- // toolbarQuickFilterPlaceholder: 'Search…',
26
- // toolbarQuickFilterLabel: 'Search',
27
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
28
-
25
+ toolbarQuickFilterPlaceholder: 'Keresés…',
26
+ toolbarQuickFilterLabel: 'Keresés',
27
+ toolbarQuickFilterDeleteIconLabel: 'Törlés',
29
28
  // Export selector toolbar button text
30
29
  toolbarExport: 'Exportálás',
31
30
  toolbarExportLabel: 'Exportálás',
32
31
  toolbarExportCSV: 'Mentés CSV fájlként',
33
32
  toolbarExportPrint: 'Nyomtatás',
34
- // toolbarExportExcel: 'Download as Excel',
35
-
33
+ toolbarExportExcel: 'Mentés Excel fájlként',
36
34
  // Columns panel text
37
35
  columnsPanelTextFieldLabel: 'Oszlop keresése',
38
36
  columnsPanelTextFieldPlaceholder: 'Oszlop neve',
@@ -41,7 +39,7 @@ var huHUGrid = {
41
39
  columnsPanelHideAllButton: 'Összes elrejtése',
42
40
  // Filter panel text
43
41
  filterPanelAddFilter: 'Szűrő hozzáadása',
44
- // filterPanelRemoveAll: 'Remove all',
42
+ filterPanelRemoveAll: 'Összes törlése',
45
43
  filterPanelDeleteIconLabel: 'Törlés',
46
44
  filterPanelLogicOperator: 'Logikai operátor',
47
45
  filterPanelOperator: 'Operátorok',
@@ -71,7 +69,7 @@ var huHUGrid = {
71
69
  // Column menu text
72
70
  columnMenuLabel: 'Menü',
73
71
  columnMenuShowColumns: 'Oszlopok megjelenítése',
74
- // columnMenuManageColumns: 'Manage columns',
72
+ columnMenuManageColumns: 'Oszlopok kezelése',
75
73
  columnMenuFilter: 'Szűrők',
76
74
  columnMenuHideColumn: 'Elrejtés',
77
75
  columnMenuUnsort: 'Sorrend visszaállítása',
@@ -121,20 +119,17 @@ var huHUGrid = {
121
119
  return "".concat(name, " szerinti csoportos\xEDt\xE1s t\xF6rl\xE9se");
122
120
  },
123
121
  // Master/detail
124
- // detailPanelToggle: 'Detail panel toggle',
122
+ detailPanelToggle: 'Részletek panel váltása',
125
123
  expandDetailPanel: 'Kibontás',
126
- collapseDetailPanel: 'Összecsukás'
127
-
124
+ collapseDetailPanel: 'Összecsukás',
128
125
  // Row reordering text
129
- // rowReorderingHeaderName: 'Row reordering',
130
-
126
+ rowReorderingHeaderName: 'Sorok újrarendezése',
131
127
  // Aggregation
132
- // aggregationMenuItemHeader: 'Aggregation',
133
- // aggregationFunctionLabelSum: 'sum',
134
- // aggregationFunctionLabelAvg: 'avg',
135
- // aggregationFunctionLabelMin: 'min',
136
- // aggregationFunctionLabelMax: 'max',
137
- // aggregationFunctionLabelSize: 'size',
128
+ aggregationMenuItemHeader: 'Összesítés',
129
+ aggregationFunctionLabelSum: 'Összeg',
130
+ aggregationFunctionLabelAvg: 'Átlag',
131
+ aggregationFunctionLabelMin: 'Minimum',
132
+ aggregationFunctionLabelMax: 'Maximum',
133
+ aggregationFunctionLabelSize: 'Darabszám'
138
134
  };
139
-
140
135
  export var huHU = getGridLocalization(huHUGrid, huHUCore);
@@ -39,7 +39,7 @@ var jaJPGrid = {
39
39
  columnsPanelHideAllButton: 'すべて非表示',
40
40
  // Filter panel text
41
41
  filterPanelAddFilter: 'フィルター追加',
42
- // filterPanelRemoveAll: 'Remove all',
42
+ filterPanelRemoveAll: 'すべて削除',
43
43
  filterPanelDeleteIconLabel: '削除',
44
44
  filterPanelLogicOperator: '論理演算子',
45
45
  filterPanelOperator: '演算子',
@@ -39,7 +39,7 @@ var nlNLGrid = {
39
39
  columnsPanelHideAllButton: 'Alles verbergen',
40
40
  // Filter panel text
41
41
  filterPanelAddFilter: 'Filter toevoegen',
42
- // filterPanelRemoveAll: 'Remove all',
42
+ filterPanelRemoveAll: 'Alles verwijderen',
43
43
  filterPanelDeleteIconLabel: 'Verwijderen',
44
44
  filterPanelLogicOperator: 'Logische operator',
45
45
  filterPanelOperator: 'Operatoren',
@@ -69,7 +69,7 @@ var nlNLGrid = {
69
69
  // Column menu text
70
70
  columnMenuLabel: 'Menu',
71
71
  columnMenuShowColumns: 'Toon kolommen',
72
- // columnMenuManageColumns: 'Manage columns',
72
+ columnMenuManageColumns: 'Kolommen beheren',
73
73
  columnMenuFilter: 'Filteren',
74
74
  columnMenuHideColumn: 'Verbergen',
75
75
  columnMenuUnsort: 'Annuleer sortering',
@@ -119,7 +119,7 @@ var nlNLGrid = {
119
119
  return "Stop groeperen op ".concat(name);
120
120
  },
121
121
  // Master/detail
122
- // detailPanelToggle: 'Detail panel toggle',
122
+ detailPanelToggle: 'Detailmenu in- of uitklappen',
123
123
  expandDetailPanel: 'Uitklappen',
124
124
  collapseDetailPanel: 'Inklappen',
125
125
  // Row reordering text
@@ -123,15 +123,13 @@ var ptBRGrid = {
123
123
  expandDetailPanel: 'Expandir',
124
124
  collapseDetailPanel: 'Esconder',
125
125
  // Row reordering text
126
- rowReorderingHeaderName: 'Reorganizar linhas'
127
-
126
+ rowReorderingHeaderName: 'Reorganizar linhas',
128
127
  // Aggregation
129
- // aggregationMenuItemHeader: 'Aggregation',
130
- // aggregationFunctionLabelSum: 'sum',
131
- // aggregationFunctionLabelAvg: 'avg',
132
- // aggregationFunctionLabelMin: 'min',
133
- // aggregationFunctionLabelMax: 'max',
134
- // aggregationFunctionLabelSize: 'size',
128
+ aggregationMenuItemHeader: 'Agrupar',
129
+ aggregationFunctionLabelSum: 'soma',
130
+ aggregationFunctionLabelAvg: 'média',
131
+ aggregationFunctionLabelMin: 'mín',
132
+ aggregationFunctionLabelMax: 'máx',
133
+ aggregationFunctionLabelSize: 'tamanho'
135
134
  };
136
-
137
135
  export var ptBR = getGridLocalization(ptBRGrid, ptBRCore);
@@ -76,7 +76,7 @@ var ruRUGrid = {
76
76
  // Column menu text
77
77
  columnMenuLabel: 'Меню',
78
78
  columnMenuShowColumns: 'Показать столбцы',
79
- // columnMenuManageColumns: 'Manage columns',
79
+ columnMenuManageColumns: 'Управление колонками',
80
80
  columnMenuFilter: 'Фильтр',
81
81
  columnMenuHideColumn: 'Скрыть',
82
82
  columnMenuUnsort: 'Отменить сортировку',
@@ -125,11 +125,11 @@ var urPKGrid = {
125
125
  // Row reordering text
126
126
  rowReorderingHeaderName: 'قطاروں کی ترتیب تبدیل کریں',
127
127
  // Aggregation
128
- aggregationMenuItemHeader: 'Aggregation',
129
- aggregationFunctionLabelSum: 'sum',
130
- aggregationFunctionLabelAvg: 'avg',
131
- aggregationFunctionLabelMin: 'min',
132
- aggregationFunctionLabelMax: 'max',
133
- aggregationFunctionLabelSize: 'size'
128
+ aggregationMenuItemHeader: 'ایگریگیشن',
129
+ aggregationFunctionLabelSum: 'کل',
130
+ aggregationFunctionLabelAvg: 'اوسط',
131
+ aggregationFunctionLabelMin: 'کم از کم',
132
+ aggregationFunctionLabelMax: 'زیادہ سے زیادہ',
133
+ aggregationFunctionLabelSize: 'سائز'
134
134
  };
135
135
  export var urPK = getGridLocalization(urPKGrid, urPKCore);
@@ -4,4 +4,8 @@ export function isLeaf(node) {
4
4
 
5
5
  /**
6
6
  * A function used to process headerClassName params.
7
+ */
8
+
9
+ /**
10
+ * The union type representing the [[GridColDef]] column header class type.
7
11
  */
@@ -32,5 +32,13 @@ var GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {
32
32
  GridRowEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
33
33
  return GridRowEditStopReasons;
34
34
  }(GridRowEditStopReasons || {});
35
+ /**
36
+ * Object passed as parameter in the row `getRowSpacing` callback prop.
37
+ * @demos
38
+ * - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
39
+ */
40
+ /**
41
+ * The getRowSpacing return value.
42
+ */
35
43
  // https://github.com/mui/mui-x/pull/3738#discussion_r798504277
36
44
  export { GridRowEditStartReasons, GridRowEditStopReasons };
@@ -1,44 +1,42 @@
1
1
  import { createSelector as reselectCreateSelector } from 'reselect';
2
2
  import { buildWarning } from './warning';
3
3
  var cacheContainer = {
4
- cache: null
4
+ cache: new WeakMap()
5
5
  };
6
6
  var missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);
7
7
  export var createSelector = function createSelector() {
8
8
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9
9
  args[_key] = arguments[_key];
10
10
  }
11
- if (cacheContainer.cache === null) {
12
- cacheContainer.cache = {};
13
- }
14
11
  var selector = function selector() {
12
+ var _cache$get, _cache$get3;
15
13
  for (var _len2 = arguments.length, selectorArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
16
14
  selectorArgs[_key2] = arguments[_key2];
17
15
  }
18
16
  var stateOrApiRef = selectorArgs[0],
19
17
  instanceId = selectorArgs[1];
20
18
  var isApiRef = !!stateOrApiRef.current;
21
- var cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';
19
+ var cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : {
20
+ id: 'default'
21
+ };
22
22
  var state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
23
23
  if (process.env.NODE_ENV !== 'production') {
24
- if (cacheKey === 'default') {
24
+ if (cacheKey.id === 'default') {
25
25
  missingInstanceIdWarning();
26
26
  }
27
27
  }
28
- if (cacheContainer.cache === null) {
29
- cacheContainer.cache = {};
30
- }
31
28
  var cache = cacheContainer.cache;
32
- if (cache[cacheKey] && cache[cacheKey].get(args)) {
29
+ if (cache.get(cacheKey) && (_cache$get = cache.get(cacheKey)) != null && _cache$get.get(args)) {
30
+ var _cache$get2;
33
31
  // We pass the cache key because the called selector might have as
34
32
  // dependency another selector created with this `createSelector`.
35
- return cache[cacheKey].get(args)(state, cacheKey);
33
+ return (_cache$get2 = cache.get(cacheKey)) == null ? void 0 : _cache$get2.get(args)(state, cacheKey);
36
34
  }
37
35
  var newSelector = reselectCreateSelector.apply(void 0, args);
38
- if (!cache[cacheKey]) {
39
- cache[cacheKey] = new Map();
36
+ if (!cache.get(cacheKey)) {
37
+ cache.set(cacheKey, new Map());
40
38
  }
41
- cache[cacheKey].set(args, newSelector);
39
+ (_cache$get3 = cache.get(cacheKey)) == null ? void 0 : _cache$get3.set(args, newSelector);
42
40
  return newSelector(state, cacheKey);
43
41
  };
44
42
 
@@ -49,12 +47,6 @@ export var createSelector = function createSelector() {
49
47
  };
50
48
 
51
49
  // eslint-disable-next-line @typescript-eslint/naming-convention
52
- export var unstable_resetCreateSelectorCache = function unstable_resetCreateSelectorCache(cacheKey) {
53
- if (typeof cacheKey !== 'undefined') {
54
- if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {
55
- delete cacheContainer.cache[cacheKey];
56
- }
57
- } else {
58
- cacheContainer.cache = null;
59
- }
50
+ export var unstable_resetCreateSelectorCache = function unstable_resetCreateSelectorCache() {
51
+ cacheContainer.cache = new WeakMap();
60
52
  };
@@ -36,7 +36,7 @@ export var clamp = function clamp(value, min, max) {
36
36
  /**
37
37
  * Based on `fast-deep-equal`
38
38
  *
39
- * MIT License
39
+ * MIT License
40
40
  *
41
41
  * Copyright (c) 2017 Evgeny Poberezkin
42
42
  *
@@ -3,7 +3,6 @@
3
3
  // This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
4
4
  // in broader compatibility between the packages.
5
5
  // See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
6
-
7
6
  export const beBYCore = {
8
7
  components: {
9
8
  MuiTablePagination: {
package/locales/frFR.js CHANGED
@@ -111,15 +111,13 @@ const frFRGrid = {
111
111
  expandDetailPanel: 'Afficher',
112
112
  collapseDetailPanel: 'Masquer',
113
113
  // Row reordering text
114
- rowReorderingHeaderName: 'Positionnement des lignes'
115
-
114
+ rowReorderingHeaderName: 'Positionnement des lignes',
116
115
  // Aggregation
117
- // aggregationMenuItemHeader: 'Aggregation',
118
- // aggregationFunctionLabelSum: 'sum',
119
- // aggregationFunctionLabelAvg: 'avg',
120
- // aggregationFunctionLabelMin: 'min',
121
- // aggregationFunctionLabelMax: 'max',
122
- // aggregationFunctionLabelSize: 'size',
116
+ aggregationMenuItemHeader: 'Agrégation',
117
+ aggregationFunctionLabelSum: 'Somme',
118
+ aggregationFunctionLabelAvg: 'Moyenne',
119
+ aggregationFunctionLabelMin: 'Minimum',
120
+ aggregationFunctionLabelMax: 'Maximum',
121
+ aggregationFunctionLabelSize: "Nombre d'éléments"
123
122
  };
124
-
125
123
  export const frFR = getGridLocalization(frFRGrid, frFRCore);
package/locales/huHU.js CHANGED
@@ -20,17 +20,15 @@ const huHUGrid = {
20
20
  toolbarFiltersTooltipShow: 'Szűrők megjelenítése',
21
21
  toolbarFiltersTooltipActive: count => `${count} aktív szűrő`,
22
22
  // Quick filter toolbar field
23
- // toolbarQuickFilterPlaceholder: 'Search…',
24
- // toolbarQuickFilterLabel: 'Search',
25
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
26
-
23
+ toolbarQuickFilterPlaceholder: 'Keresés…',
24
+ toolbarQuickFilterLabel: 'Keresés',
25
+ toolbarQuickFilterDeleteIconLabel: 'Törlés',
27
26
  // Export selector toolbar button text
28
27
  toolbarExport: 'Exportálás',
29
28
  toolbarExportLabel: 'Exportálás',
30
29
  toolbarExportCSV: 'Mentés CSV fájlként',
31
30
  toolbarExportPrint: 'Nyomtatás',
32
- // toolbarExportExcel: 'Download as Excel',
33
-
31
+ toolbarExportExcel: 'Mentés Excel fájlként',
34
32
  // Columns panel text
35
33
  columnsPanelTextFieldLabel: 'Oszlop keresése',
36
34
  columnsPanelTextFieldPlaceholder: 'Oszlop neve',
@@ -39,7 +37,7 @@ const huHUGrid = {
39
37
  columnsPanelHideAllButton: 'Összes elrejtése',
40
38
  // Filter panel text
41
39
  filterPanelAddFilter: 'Szűrő hozzáadása',
42
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: 'Összes törlése',
43
41
  filterPanelDeleteIconLabel: 'Törlés',
44
42
  filterPanelLogicOperator: 'Logikai operátor',
45
43
  filterPanelOperator: 'Operátorok',
@@ -69,7 +67,7 @@ const huHUGrid = {
69
67
  // Column menu text
70
68
  columnMenuLabel: 'Menü',
71
69
  columnMenuShowColumns: 'Oszlopok megjelenítése',
72
- // columnMenuManageColumns: 'Manage columns',
70
+ columnMenuManageColumns: 'Oszlopok kezelése',
73
71
  columnMenuFilter: 'Szűrők',
74
72
  columnMenuHideColumn: 'Elrejtés',
75
73
  columnMenuUnsort: 'Sorrend visszaállítása',
@@ -109,20 +107,17 @@ const huHUGrid = {
109
107
  groupColumn: name => `Csoportosítás ${name} szerint`,
110
108
  unGroupColumn: name => `${name} szerinti csoportosítás törlése`,
111
109
  // Master/detail
112
- // detailPanelToggle: 'Detail panel toggle',
110
+ detailPanelToggle: 'Részletek panel váltása',
113
111
  expandDetailPanel: 'Kibontás',
114
- collapseDetailPanel: 'Összecsukás'
115
-
112
+ collapseDetailPanel: 'Összecsukás',
116
113
  // Row reordering text
117
- // rowReorderingHeaderName: 'Row reordering',
118
-
114
+ rowReorderingHeaderName: 'Sorok újrarendezése',
119
115
  // Aggregation
120
- // aggregationMenuItemHeader: 'Aggregation',
121
- // aggregationFunctionLabelSum: 'sum',
122
- // aggregationFunctionLabelAvg: 'avg',
123
- // aggregationFunctionLabelMin: 'min',
124
- // aggregationFunctionLabelMax: 'max',
125
- // aggregationFunctionLabelSize: 'size',
116
+ aggregationMenuItemHeader: 'Összesítés',
117
+ aggregationFunctionLabelSum: 'Összeg',
118
+ aggregationFunctionLabelAvg: 'Átlag',
119
+ aggregationFunctionLabelMin: 'Minimum',
120
+ aggregationFunctionLabelMax: 'Maximum',
121
+ aggregationFunctionLabelSize: 'Darabszám'
126
122
  };
127
-
128
123
  export const huHU = getGridLocalization(huHUGrid, huHUCore);
package/locales/jaJP.js CHANGED
@@ -37,7 +37,7 @@ const jaJPGrid = {
37
37
  columnsPanelHideAllButton: 'すべて非表示',
38
38
  // Filter panel text
39
39
  filterPanelAddFilter: 'フィルター追加',
40
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: 'すべて削除',
41
41
  filterPanelDeleteIconLabel: '削除',
42
42
  filterPanelLogicOperator: '論理演算子',
43
43
  filterPanelOperator: '演算子',
package/locales/nlNL.js CHANGED
@@ -37,7 +37,7 @@ const nlNLGrid = {
37
37
  columnsPanelHideAllButton: 'Alles verbergen',
38
38
  // Filter panel text
39
39
  filterPanelAddFilter: 'Filter toevoegen',
40
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: 'Alles verwijderen',
41
41
  filterPanelDeleteIconLabel: 'Verwijderen',
42
42
  filterPanelLogicOperator: 'Logische operator',
43
43
  filterPanelOperator: 'Operatoren',
@@ -67,7 +67,7 @@ const nlNLGrid = {
67
67
  // Column menu text
68
68
  columnMenuLabel: 'Menu',
69
69
  columnMenuShowColumns: 'Toon kolommen',
70
- // columnMenuManageColumns: 'Manage columns',
70
+ columnMenuManageColumns: 'Kolommen beheren',
71
71
  columnMenuFilter: 'Filteren',
72
72
  columnMenuHideColumn: 'Verbergen',
73
73
  columnMenuUnsort: 'Annuleer sortering',
@@ -107,7 +107,7 @@ const nlNLGrid = {
107
107
  groupColumn: name => `Groepeer op ${name}`,
108
108
  unGroupColumn: name => `Stop groeperen op ${name}`,
109
109
  // Master/detail
110
- // detailPanelToggle: 'Detail panel toggle',
110
+ detailPanelToggle: 'Detailmenu in- of uitklappen',
111
111
  expandDetailPanel: 'Uitklappen',
112
112
  collapseDetailPanel: 'Inklappen',
113
113
  // Row reordering text
package/locales/ptBR.js CHANGED
@@ -111,15 +111,13 @@ const ptBRGrid = {
111
111
  expandDetailPanel: 'Expandir',
112
112
  collapseDetailPanel: 'Esconder',
113
113
  // Row reordering text
114
- rowReorderingHeaderName: 'Reorganizar linhas'
115
-
114
+ rowReorderingHeaderName: 'Reorganizar linhas',
116
115
  // Aggregation
117
- // aggregationMenuItemHeader: 'Aggregation',
118
- // aggregationFunctionLabelSum: 'sum',
119
- // aggregationFunctionLabelAvg: 'avg',
120
- // aggregationFunctionLabelMin: 'min',
121
- // aggregationFunctionLabelMax: 'max',
122
- // aggregationFunctionLabelSize: 'size',
116
+ aggregationMenuItemHeader: 'Agrupar',
117
+ aggregationFunctionLabelSum: 'soma',
118
+ aggregationFunctionLabelAvg: 'média',
119
+ aggregationFunctionLabelMin: 'mín',
120
+ aggregationFunctionLabelMax: 'máx',
121
+ aggregationFunctionLabelSize: 'tamanho'
123
122
  };
124
-
125
123
  export const ptBR = getGridLocalization(ptBRGrid, ptBRCore);
package/locales/ruRU.js CHANGED
@@ -76,7 +76,7 @@ const ruRUGrid = {
76
76
  // Column menu text
77
77
  columnMenuLabel: 'Меню',
78
78
  columnMenuShowColumns: 'Показать столбцы',
79
- // columnMenuManageColumns: 'Manage columns',
79
+ columnMenuManageColumns: 'Управление колонками',
80
80
  columnMenuFilter: 'Фильтр',
81
81
  columnMenuHideColumn: 'Скрыть',
82
82
  columnMenuUnsort: 'Отменить сортировку',
package/locales/urPK.js CHANGED
@@ -113,11 +113,11 @@ const urPKGrid = {
113
113
  // Row reordering text
114
114
  rowReorderingHeaderName: 'قطاروں کی ترتیب تبدیل کریں',
115
115
  // Aggregation
116
- aggregationMenuItemHeader: 'Aggregation',
117
- aggregationFunctionLabelSum: 'sum',
118
- aggregationFunctionLabelAvg: 'avg',
119
- aggregationFunctionLabelMin: 'min',
120
- aggregationFunctionLabelMax: 'max',
121
- aggregationFunctionLabelSize: 'size'
116
+ aggregationMenuItemHeader: 'ایگریگیشن',
117
+ aggregationFunctionLabelSum: 'کل',
118
+ aggregationFunctionLabelAvg: 'اوسط',
119
+ aggregationFunctionLabelMin: 'کم از کم',
120
+ aggregationFunctionLabelMax: 'زیادہ سے زیادہ',
121
+ aggregationFunctionLabelSize: 'سائز'
122
122
  };
123
123
  export const urPK = getGridLocalization(urPKGrid, urPKCore);
@@ -31,7 +31,9 @@ export interface GridCoreApi {
31
31
  * Unique identifier for each component instance in a page.
32
32
  * @ignore - do not document.
33
33
  */
34
- instanceId: number;
34
+ instanceId: {
35
+ id: number;
36
+ };
35
37
  }
36
38
  export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPrivateApi extends GridPrivateApiCommon> {
37
39
  /**
@@ -18,6 +18,10 @@ export type GridRowModesModelProps = ({
18
18
  export type GridRowModesModel = Record<GridRowId, GridRowModesModelProps>;
19
19
  export interface GridEditCellMeta {
20
20
  changeReason?: 'debouncedSetEditCellValue' | 'setEditCellValue';
21
+ /**
22
+ * Determines if `setEditCellValue` should be called on the first render to sync the value.
23
+ */
24
+ unstable_updateValueOnRender?: boolean;
21
25
  }
22
26
  export interface GridEditingSharedApi {
23
27
  /**
@@ -4,4 +4,8 @@ export function isLeaf(node) {
4
4
 
5
5
  /**
6
6
  * A function used to process headerClassName params.
7
+ */
8
+
9
+ /**
10
+ * The union type representing the [[GridColDef]] column header class type.
7
11
  */
@@ -32,5 +32,13 @@ var GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {
32
32
  GridRowEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
33
33
  return GridRowEditStopReasons;
34
34
  }(GridRowEditStopReasons || {});
35
+ /**
36
+ * Object passed as parameter in the row `getRowSpacing` callback prop.
37
+ * @demos
38
+ * - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
39
+ */
40
+ /**
41
+ * The getRowSpacing return value.
42
+ */
35
43
  // https://github.com/mui/mui-x/pull/3738#discussion_r798504277
36
44
  export { GridRowEditStartReasons, GridRowEditStopReasons };
@@ -6,6 +6,9 @@ import PropTypes from 'prop-types';
6
6
  import { unstable_useForkRef as useForkRef, unstable_ownerWindow as ownerWindow, unstable_useEventCallback as useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
7
7
  import createDetectElementResize from '../lib/createDetectElementResize';
8
8
  // TODO replace with https://caniuse.com/resizeobserver.
9
+
10
+ // Credit to https://github.com/bvaughn/react-virtualized/blob/master/source/AutoSizer/AutoSizer.js
11
+ // for the sources.
9
12
  import { jsx as _jsx } from "react/jsx-runtime";
10
13
  const GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {
11
14
  const {
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"],
4
- _excluded2 = ["changeReason"];
4
+ _excluded2 = ["changeReason", "unstable_updateValueOnRender"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -210,6 +210,8 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
210
210
  }
211
211
  if (editCellState != null && column.renderEditCell) {
212
212
  const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
213
+
214
+ // eslint-disable-next-line @typescript-eslint/naming-convention
213
215
  const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded2);
214
216
  const params = _extends({}, cellParams, {
215
217
  row: updatedRow
@@ -63,22 +63,25 @@ function GridEditDateCell(props) {
63
63
  classes: rootProps.classes
64
64
  };
65
65
  const classes = useUtilityClasses(ownerState);
66
+ const hasUpdatedEditValueOnMount = React.useRef(false);
67
+ const parseValueToDate = React.useCallback(value => {
68
+ if (value === '') {
69
+ return null;
70
+ }
71
+ const [date, time] = value.split('T');
72
+ const [year, month, day] = date.split('-');
73
+ const parsedDate = new Date();
74
+ parsedDate.setFullYear(Number(year), Number(month) - 1, Number(day));
75
+ parsedDate.setHours(0, 0, 0, 0);
76
+ if (time) {
77
+ const [hours, minutes] = time.split(':');
78
+ parsedDate.setHours(Number(hours), Number(minutes), 0, 0);
79
+ }
80
+ return parsedDate;
81
+ }, []);
66
82
  const handleChange = React.useCallback(async event => {
67
83
  const newFormattedDate = event.target.value;
68
- let newParsedDate;
69
- if (newFormattedDate === '') {
70
- newParsedDate = null;
71
- } else {
72
- const [date, time] = newFormattedDate.split('T');
73
- const [year, month, day] = date.split('-');
74
- newParsedDate = new Date();
75
- newParsedDate.setFullYear(Number(year), Number(month) - 1, Number(day));
76
- newParsedDate.setHours(0, 0, 0, 0);
77
- if (time) {
78
- const [hours, minutes] = time.split(':');
79
- newParsedDate.setHours(Number(hours), Number(minutes), 0, 0);
80
- }
81
- }
84
+ const newParsedDate = parseValueToDate(newFormattedDate);
82
85
  if (onValueChange) {
83
86
  await onValueChange(event, newParsedDate);
84
87
  }
@@ -91,7 +94,7 @@ function GridEditDateCell(props) {
91
94
  field,
92
95
  value: newParsedDate
93
96
  }, event);
94
- }, [apiRef, field, id, onValueChange]);
97
+ }, [apiRef, field, id, onValueChange, parseValueToDate]);
95
98
  React.useEffect(() => {
96
99
  setValueState(state => {
97
100
  if (valueTransformed.parsed !== state.parsed && valueTransformed.parsed?.getTime() !== state.parsed?.getTime()) {
@@ -105,8 +108,26 @@ function GridEditDateCell(props) {
105
108
  inputRef.current.focus();
106
109
  }
107
110
  }, [hasFocus]);
111
+ const meta = apiRef.current.unstable_getEditCellMeta(id, field);
112
+ const handleInputRef = el => {
113
+ inputRef.current = el;
114
+ if (meta.unstable_updateValueOnRender && !hasUpdatedEditValueOnMount.current) {
115
+ const inputValue = inputRef.current.value;
116
+ const parsedDate = parseValueToDate(inputValue);
117
+ setValueState({
118
+ parsed: parsedDate,
119
+ formatted: inputValue
120
+ });
121
+ apiRef.current.setEditCellValue({
122
+ id,
123
+ field,
124
+ value: parsedDate
125
+ });
126
+ hasUpdatedEditValueOnMount.current = true;
127
+ }
128
+ };
108
129
  return /*#__PURE__*/_jsx(StyledInputBase, _extends({
109
- inputRef: inputRef,
130
+ inputRef: handleInputRef,
110
131
  fullWidth: true,
111
132
  className: classes.root,
112
133
  type: isDateTime ? 'datetime-local' : 'date',