@mui/x-data-grid 6.0.3 → 6.1.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 (162) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/components/GridAutoSizer.js +3 -0
  3. package/components/GridPagination.d.ts +6 -6
  4. package/components/GridRow.js +4 -2
  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/columnHeaders/GridColumnHeaderTitle.js +5 -5
  9. package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
  10. package/components/menu/columnMenu/GridColumnMenu.d.ts +5 -5
  11. package/components/menu/columnMenu/GridColumnMenu.js +30 -30
  12. package/components/menu/columnMenu/GridColumnMenuProps.d.ts +1 -1
  13. package/components/panel/GridColumnsPanel.d.ts +8 -0
  14. package/components/panel/GridColumnsPanel.js +18 -6
  15. package/components/panel/GridPanel.d.ts +1 -1
  16. package/components/panel/filterPanel/GridFilterPanel.js +1 -1
  17. package/components/reexportable.d.ts +1 -1
  18. package/components/reexportable.js +1 -1
  19. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  20. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  21. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  22. package/hooks/core/useGridApiInitialization.js +3 -3
  23. package/hooks/features/columnMenu/columnMenuInterfaces.d.ts +11 -11
  24. package/hooks/features/columnMenu/{useGridColumnMenuComponents.d.ts → useGridColumnMenuSlots.d.ts} +4 -4
  25. package/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +21 -26
  26. package/hooks/features/columns/gridColumnsSelector.d.ts +3 -3
  27. package/hooks/features/columns/useGridColumns.js +1 -1
  28. package/hooks/features/editing/useGridCellEditing.js +5 -1
  29. package/hooks/features/editing/useGridEditing.js +1 -3
  30. package/hooks/features/editing/useGridRowEditing.js +5 -1
  31. package/hooks/features/filter/gridFilterState.js +6 -1
  32. package/hooks/features/filter/useGridFilter.js +6 -1
  33. package/hooks/features/sorting/useGridSorting.js +1 -1
  34. package/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
  35. package/index.d.ts +1 -1
  36. package/index.js +10 -2
  37. package/legacy/components/GridAutoSizer.js +3 -0
  38. package/legacy/components/GridRow.js +5 -2
  39. package/legacy/components/cell/GridEditBooleanCell.js +19 -21
  40. package/legacy/components/cell/GridEditDateCell.js +69 -39
  41. package/legacy/components/cell/GridEditInputCell.js +25 -27
  42. package/legacy/components/cell/GridEditSingleSelectCell.js +26 -28
  43. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +20 -16
  44. package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
  45. package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
  46. package/legacy/components/menu/columnMenu/GridColumnMenu.js +32 -32
  47. package/legacy/components/panel/GridColumnsPanel.js +19 -6
  48. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
  49. package/legacy/components/reexportable.js +1 -1
  50. package/legacy/hooks/core/useGridApiInitialization.js +3 -3
  51. package/legacy/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +25 -30
  52. package/legacy/hooks/features/columns/gridColumnsUtils.js +2 -2
  53. package/legacy/hooks/features/columns/useGridColumns.js +1 -1
  54. package/legacy/hooks/features/editing/useGridCellEditing.js +120 -120
  55. package/legacy/hooks/features/editing/useGridEditing.js +17 -21
  56. package/legacy/hooks/features/editing/useGridRowEditing.js +5 -1
  57. package/legacy/hooks/features/export/useGridPrintExport.js +45 -47
  58. package/legacy/hooks/features/filter/gridFilterState.js +6 -1
  59. package/legacy/hooks/features/filter/useGridFilter.js +6 -1
  60. package/legacy/hooks/features/rows/gridRowsUtils.js +2 -2
  61. package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
  62. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
  63. package/legacy/index.js +10 -2
  64. package/legacy/locales/coreLocales.js +0 -1
  65. package/legacy/locales/daDK.js +16 -21
  66. package/legacy/locales/esES.js +1 -1
  67. package/legacy/locales/huHU.js +15 -20
  68. package/legacy/locales/jaJP.js +1 -1
  69. package/legacy/locales/nbNO.js +10 -12
  70. package/legacy/locales/nlNL.js +3 -3
  71. package/legacy/locales/ptBR.js +7 -9
  72. package/legacy/locales/ruRU.js +1 -1
  73. package/legacy/locales/svSE.js +2 -2
  74. package/legacy/models/gridColumnGrouping.js +4 -0
  75. package/legacy/models/params/gridRowParams.js +8 -0
  76. package/legacy/utils/createSelector.js +14 -22
  77. package/locales/coreLocales.js +0 -1
  78. package/locales/daDK.js +16 -21
  79. package/locales/esES.js +1 -1
  80. package/locales/huHU.js +15 -20
  81. package/locales/jaJP.js +1 -1
  82. package/locales/nbNO.js +10 -12
  83. package/locales/nlNL.js +3 -3
  84. package/locales/ptBR.js +7 -9
  85. package/locales/ruRU.js +1 -1
  86. package/locales/svSE.js +2 -2
  87. package/models/api/gridCoreApi.d.ts +3 -1
  88. package/models/api/gridEditingApi.d.ts +4 -0
  89. package/models/gridColumnGrouping.js +4 -0
  90. package/models/params/gridRowParams.js +8 -0
  91. package/modern/components/GridAutoSizer.js +3 -0
  92. package/modern/components/GridRow.js +4 -2
  93. package/modern/components/cell/GridEditDateCell.js +37 -16
  94. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
  95. package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
  96. package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
  97. package/modern/components/menu/columnMenu/GridColumnMenu.js +30 -30
  98. package/modern/components/panel/GridColumnsPanel.js +18 -6
  99. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
  100. package/modern/components/reexportable.js +1 -1
  101. package/modern/hooks/core/useGridApiInitialization.js +3 -3
  102. package/modern/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +21 -26
  103. package/modern/hooks/features/columns/useGridColumns.js +1 -1
  104. package/modern/hooks/features/editing/useGridCellEditing.js +5 -1
  105. package/modern/hooks/features/editing/useGridEditing.js +1 -3
  106. package/modern/hooks/features/editing/useGridRowEditing.js +5 -1
  107. package/modern/hooks/features/filter/gridFilterState.js +6 -1
  108. package/modern/hooks/features/filter/useGridFilter.js +6 -1
  109. package/modern/hooks/features/sorting/useGridSorting.js +1 -1
  110. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
  111. package/modern/index.js +10 -2
  112. package/modern/locales/coreLocales.js +0 -1
  113. package/modern/locales/daDK.js +16 -21
  114. package/modern/locales/esES.js +1 -1
  115. package/modern/locales/huHU.js +15 -20
  116. package/modern/locales/jaJP.js +1 -1
  117. package/modern/locales/nbNO.js +10 -12
  118. package/modern/locales/nlNL.js +3 -3
  119. package/modern/locales/ptBR.js +7 -9
  120. package/modern/locales/ruRU.js +1 -1
  121. package/modern/locales/svSE.js +2 -2
  122. package/modern/models/gridColumnGrouping.js +4 -0
  123. package/modern/models/params/gridRowParams.js +8 -0
  124. package/modern/utils/createSelector.js +12 -22
  125. package/node/components/GridAutoSizer.js +3 -1
  126. package/node/components/GridRow.js +4 -2
  127. package/node/components/cell/GridCell.js +1 -0
  128. package/node/components/cell/GridEditDateCell.js +37 -16
  129. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
  130. package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
  131. package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
  132. package/node/components/menu/columnMenu/GridColumnMenu.js +33 -33
  133. package/node/components/panel/GridColumnsPanel.js +18 -6
  134. package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
  135. package/node/components/reexportable.js +4 -4
  136. package/node/hooks/core/useGridApiInitialization.js +3 -3
  137. package/node/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +22 -27
  138. package/node/hooks/features/columns/useGridColumns.js +1 -1
  139. package/node/hooks/features/editing/useGridCellEditing.js +5 -1
  140. package/node/hooks/features/editing/useGridEditing.js +1 -3
  141. package/node/hooks/features/editing/useGridRowEditing.js +5 -1
  142. package/node/hooks/features/filter/gridFilterState.js +5 -0
  143. package/node/hooks/features/filter/useGridFilter.js +6 -1
  144. package/node/hooks/features/sorting/useGridSorting.js +1 -1
  145. package/node/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
  146. package/node/index.js +7 -7
  147. package/node/locales/daDK.js +16 -21
  148. package/node/locales/esES.js +1 -1
  149. package/node/locales/huHU.js +15 -20
  150. package/node/locales/jaJP.js +1 -1
  151. package/node/locales/nbNO.js +10 -12
  152. package/node/locales/nlNL.js +3 -3
  153. package/node/locales/ptBR.js +7 -9
  154. package/node/locales/ruRU.js +1 -1
  155. package/node/locales/svSE.js +2 -2
  156. package/node/models/gridColumnGrouping.js +4 -0
  157. package/node/models/params/gridEditCellParams.js +1 -0
  158. package/node/models/params/gridRowParams.js +9 -0
  159. package/node/utils/createSelector.js +12 -22
  160. package/package.json +1 -1
  161. package/utils/createSelector.d.ts +4 -4
  162. package/utils/createSelector.js +14 -22
@@ -436,7 +436,7 @@ const useGridVirtualScroller = props => {
436
436
  prevRootRowStyle.current = rootRowStyle;
437
437
  return rows;
438
438
  };
439
- const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth > containerDimensions.width;
439
+ const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth >= containerDimensions.width;
440
440
  const contentSize = React.useMemo(() => {
441
441
  // In cases where the columns exceed the available width,
442
442
  // the horizontal scrollbar should be shown even when there're no rows.
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.0.3
2
+ * @mui/x-data-grid v6.1.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -16,19 +16,19 @@ var _exportNames = {
16
16
  useGridRootProps: true,
17
17
  GridColumnHeaders: true,
18
18
  GridColumnMenu: true,
19
- GRID_COLUMN_MENU_COMPONENTS: true,
20
- GRID_COLUMN_MENU_COMPONENTS_PROPS: true
19
+ GRID_COLUMN_MENU_SLOTS: true,
20
+ GRID_COLUMN_MENU_SLOT_PROPS: true
21
21
  };
22
- Object.defineProperty(exports, "GRID_COLUMN_MENU_COMPONENTS", {
22
+ Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOTS", {
23
23
  enumerable: true,
24
24
  get: function () {
25
- return _reexportable.GRID_COLUMN_MENU_COMPONENTS;
25
+ return _reexportable.GRID_COLUMN_MENU_SLOTS;
26
26
  }
27
27
  });
28
- Object.defineProperty(exports, "GRID_COLUMN_MENU_COMPONENTS_PROPS", {
28
+ Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOT_PROPS", {
29
29
  enumerable: true,
30
30
  get: function () {
31
- return _reexportable.GRID_COLUMN_MENU_COMPONENTS_PROPS;
31
+ return _reexportable.GRID_COLUMN_MENU_SLOT_PROPS;
32
32
  }
33
33
  });
34
34
  Object.defineProperty(exports, "GridColumnHeaders", {
@@ -26,17 +26,15 @@ const daDKGrid = {
26
26
  toolbarFiltersTooltipShow: 'Vis filtre',
27
27
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`,
28
28
  // Quick filter toolbar field
29
- // toolbarQuickFilterPlaceholder: 'Search…',
30
- // toolbarQuickFilterLabel: 'Search',
31
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
32
-
29
+ toolbarQuickFilterPlaceholder: 'Søg…',
30
+ toolbarQuickFilterLabel: 'Søg',
31
+ toolbarQuickFilterDeleteIconLabel: 'Ryd',
33
32
  // Export selector toolbar button text
34
- // toolbarExport: 'Export',
33
+ toolbarExport: 'Eksport',
35
34
  toolbarExportLabel: 'Eksporter',
36
35
  toolbarExportCSV: 'Download som CSV',
37
36
  toolbarExportPrint: 'Print',
38
- // toolbarExportExcel: 'Download as Excel',
39
-
37
+ toolbarExportExcel: 'Download som Excel',
40
38
  // Columns panel text
41
39
  columnsPanelTextFieldLabel: 'Find kolonne',
42
40
  columnsPanelTextFieldPlaceholder: 'Kolonne titel',
@@ -45,7 +43,7 @@ const daDKGrid = {
45
43
  columnsPanelHideAllButton: 'Skjul alle',
46
44
  // Filter panel text
47
45
  filterPanelAddFilter: 'Tilføj filter',
48
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Fjern alle',
49
47
  filterPanelDeleteIconLabel: 'Slet',
50
48
  filterPanelLogicOperator: 'Logisk operator',
51
49
  filterPanelOperator: 'Operatorer',
@@ -75,7 +73,7 @@ const daDKGrid = {
75
73
  // Column menu text
76
74
  columnMenuLabel: 'Menu',
77
75
  columnMenuShowColumns: 'Vis Kolonner',
78
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Administrer kolonner',
79
77
  columnMenuFilter: 'Filtre',
80
78
  columnMenuHideColumn: 'Skjul',
81
79
  columnMenuUnsort: 'Fjern sortering',
@@ -115,21 +113,18 @@ const daDKGrid = {
115
113
  groupColumn: name => `Gruppér efter ${name}`,
116
114
  unGroupColumn: name => `Fjern gruppéring efter ${name}`,
117
115
  // Master/detail
118
- // detailPanelToggle: 'Detail panel toggle',
116
+ detailPanelToggle: 'Udvid/kollaps detaljepanel',
119
117
  expandDetailPanel: 'Udvid',
120
- collapseDetailPanel: 'Kollaps'
121
-
118
+ collapseDetailPanel: 'Kollaps',
122
119
  // Row reordering text
123
- // rowReorderingHeaderName: 'Row reordering',
124
-
120
+ rowReorderingHeaderName: 'Omarrangering af rækker',
125
121
  // Aggregation
126
- // aggregationMenuItemHeader: 'Aggregation',
127
- // aggregationFunctionLabelSum: 'sum',
128
- // aggregationFunctionLabelAvg: 'avg',
129
- // aggregationFunctionLabelMin: 'min',
130
- // aggregationFunctionLabelMax: 'max',
131
- // aggregationFunctionLabelSize: 'size',
122
+ aggregationMenuItemHeader: 'Aggregation',
123
+ aggregationFunctionLabelSum: 'sum',
124
+ aggregationFunctionLabelAvg: 'gns',
125
+ aggregationFunctionLabelMin: 'min',
126
+ aggregationFunctionLabelMax: 'max',
127
+ aggregationFunctionLabelSize: 'størrelse'
132
128
  };
133
-
134
129
  const daDK = (0, _getGridLocalization.getGridLocalization)(daDKGrid, _locale.daDK);
135
130
  exports.daDK = daDK;
@@ -73,7 +73,7 @@ const esESGrid = {
73
73
  // Column menu text
74
74
  columnMenuLabel: 'Menú',
75
75
  columnMenuShowColumns: 'Mostrar columnas',
76
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Administrar columnas',
77
77
  columnMenuFilter: 'Filtro',
78
78
  columnMenuHideColumn: 'Ocultar',
79
79
  columnMenuUnsort: 'Desordenar',
@@ -26,17 +26,15 @@ const huHUGrid = {
26
26
  toolbarFiltersTooltipShow: 'Szűrők megjelenítése',
27
27
  toolbarFiltersTooltipActive: count => `${count} aktív szűrő`,
28
28
  // Quick filter toolbar field
29
- // toolbarQuickFilterPlaceholder: 'Search…',
30
- // toolbarQuickFilterLabel: 'Search',
31
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
32
-
29
+ toolbarQuickFilterPlaceholder: 'Keresés…',
30
+ toolbarQuickFilterLabel: 'Keresés',
31
+ toolbarQuickFilterDeleteIconLabel: 'Törlés',
33
32
  // Export selector toolbar button text
34
33
  toolbarExport: 'Exportálás',
35
34
  toolbarExportLabel: 'Exportálás',
36
35
  toolbarExportCSV: 'Mentés CSV fájlként',
37
36
  toolbarExportPrint: 'Nyomtatás',
38
- // toolbarExportExcel: 'Download as Excel',
39
-
37
+ toolbarExportExcel: 'Mentés Excel fájlként',
40
38
  // Columns panel text
41
39
  columnsPanelTextFieldLabel: 'Oszlop keresése',
42
40
  columnsPanelTextFieldPlaceholder: 'Oszlop neve',
@@ -45,7 +43,7 @@ const huHUGrid = {
45
43
  columnsPanelHideAllButton: 'Összes elrejtése',
46
44
  // Filter panel text
47
45
  filterPanelAddFilter: 'Szűrő hozzáadása',
48
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Összes törlése',
49
47
  filterPanelDeleteIconLabel: 'Törlés',
50
48
  filterPanelLogicOperator: 'Logikai operátor',
51
49
  filterPanelOperator: 'Operátorok',
@@ -75,7 +73,7 @@ const huHUGrid = {
75
73
  // Column menu text
76
74
  columnMenuLabel: 'Menü',
77
75
  columnMenuShowColumns: 'Oszlopok megjelenítése',
78
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Oszlopok kezelése',
79
77
  columnMenuFilter: 'Szűrők',
80
78
  columnMenuHideColumn: 'Elrejtés',
81
79
  columnMenuUnsort: 'Sorrend visszaállítása',
@@ -115,21 +113,18 @@ const huHUGrid = {
115
113
  groupColumn: name => `Csoportosítás ${name} szerint`,
116
114
  unGroupColumn: name => `${name} szerinti csoportosítás törlése`,
117
115
  // Master/detail
118
- // detailPanelToggle: 'Detail panel toggle',
116
+ detailPanelToggle: 'Részletek panel váltása',
119
117
  expandDetailPanel: 'Kibontás',
120
- collapseDetailPanel: 'Összecsukás'
121
-
118
+ collapseDetailPanel: 'Összecsukás',
122
119
  // Row reordering text
123
- // rowReorderingHeaderName: 'Row reordering',
124
-
120
+ rowReorderingHeaderName: 'Sorok újrarendezése',
125
121
  // Aggregation
126
- // aggregationMenuItemHeader: 'Aggregation',
127
- // aggregationFunctionLabelSum: 'sum',
128
- // aggregationFunctionLabelAvg: 'avg',
129
- // aggregationFunctionLabelMin: 'min',
130
- // aggregationFunctionLabelMax: 'max',
131
- // aggregationFunctionLabelSize: 'size',
122
+ aggregationMenuItemHeader: 'Összesítés',
123
+ aggregationFunctionLabelSum: 'Összeg',
124
+ aggregationFunctionLabelAvg: 'Átlag',
125
+ aggregationFunctionLabelMin: 'Minimum',
126
+ aggregationFunctionLabelMax: 'Maximum',
127
+ aggregationFunctionLabelSize: 'Darabszám'
132
128
  };
133
-
134
129
  const huHU = (0, _getGridLocalization.getGridLocalization)(huHUGrid, _locale.huHU);
135
130
  exports.huHU = huHU;
@@ -43,7 +43,7 @@ const jaJPGrid = {
43
43
  columnsPanelHideAllButton: 'すべて非表示',
44
44
  // Filter panel text
45
45
  filterPanelAddFilter: 'フィルター追加',
46
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'すべて削除',
47
47
  filterPanelDeleteIconLabel: '削除',
48
48
  filterPanelLogicOperator: '論理演算子',
49
49
  filterPanelOperator: '演算子',
@@ -43,7 +43,7 @@ const nbNOGrid = {
43
43
  columnsPanelHideAllButton: 'Skjul alle',
44
44
  // Filter panel text
45
45
  filterPanelAddFilter: 'Legg til filter',
46
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Fjern alle',
47
47
  filterPanelDeleteIconLabel: 'Slett',
48
48
  filterPanelLogicOperator: 'Logisk operator',
49
49
  filterPanelOperator: 'Operatører',
@@ -73,7 +73,7 @@ const nbNOGrid = {
73
73
  // Column menu text
74
74
  columnMenuLabel: 'Meny',
75
75
  columnMenuShowColumns: 'Vis kolonner',
76
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Administrer kolonner',
77
77
  columnMenuFilter: 'Filter',
78
78
  columnMenuHideColumn: 'Skjul',
79
79
  columnMenuUnsort: 'Usorter',
@@ -113,20 +113,18 @@ const nbNOGrid = {
113
113
  groupColumn: name => `Grupper på ${name}`,
114
114
  unGroupColumn: name => `Stopp å grupper på ${name}`,
115
115
  // Master/detail
116
- // detailPanelToggle: 'Detail panel toggle',
116
+ detailPanelToggle: 'Utvid/kollaps detalj panel',
117
117
  expandDetailPanel: 'Utvid',
118
118
  collapseDetailPanel: 'Kollaps',
119
119
  // Row reordering text
120
- rowReorderingHeaderName: 'Rad reorganisering'
121
-
120
+ rowReorderingHeaderName: 'Rad reorganisering',
122
121
  // Aggregation
123
- // aggregationMenuItemHeader: 'Aggregation',
124
- // aggregationFunctionLabelSum: 'sum',
125
- // aggregationFunctionLabelAvg: 'avg',
126
- // aggregationFunctionLabelMin: 'min',
127
- // aggregationFunctionLabelMax: 'max',
128
- // aggregationFunctionLabelSize: 'size',
122
+ aggregationMenuItemHeader: 'Aggregering',
123
+ aggregationFunctionLabelSum: 'sum',
124
+ aggregationFunctionLabelAvg: 'snitt',
125
+ aggregationFunctionLabelMin: 'min',
126
+ aggregationFunctionLabelMax: 'maks',
127
+ aggregationFunctionLabelSize: 'størrelse'
129
128
  };
130
-
131
129
  const nbNO = (0, _getGridLocalization.getGridLocalization)(nbNOGrid, _locale.nbNO);
132
130
  exports.nbNO = nbNO;
@@ -43,7 +43,7 @@ const nlNLGrid = {
43
43
  columnsPanelHideAllButton: 'Alles verbergen',
44
44
  // Filter panel text
45
45
  filterPanelAddFilter: 'Filter toevoegen',
46
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Alles verwijderen',
47
47
  filterPanelDeleteIconLabel: 'Verwijderen',
48
48
  filterPanelLogicOperator: 'Logische operator',
49
49
  filterPanelOperator: 'Operatoren',
@@ -73,7 +73,7 @@ const nlNLGrid = {
73
73
  // Column menu text
74
74
  columnMenuLabel: 'Menu',
75
75
  columnMenuShowColumns: 'Toon kolommen',
76
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Kolommen beheren',
77
77
  columnMenuFilter: 'Filteren',
78
78
  columnMenuHideColumn: 'Verbergen',
79
79
  columnMenuUnsort: 'Annuleer sortering',
@@ -113,7 +113,7 @@ const nlNLGrid = {
113
113
  groupColumn: name => `Groepeer op ${name}`,
114
114
  unGroupColumn: name => `Stop groeperen op ${name}`,
115
115
  // Master/detail
116
- // detailPanelToggle: 'Detail panel toggle',
116
+ detailPanelToggle: 'Detailmenu in- of uitklappen',
117
117
  expandDetailPanel: 'Uitklappen',
118
118
  collapseDetailPanel: 'Inklappen',
119
119
  // Row reordering text
@@ -117,16 +117,14 @@ const ptBRGrid = {
117
117
  expandDetailPanel: 'Expandir',
118
118
  collapseDetailPanel: 'Esconder',
119
119
  // Row reordering text
120
- rowReorderingHeaderName: 'Reorganizar linhas'
121
-
120
+ rowReorderingHeaderName: 'Reorganizar linhas',
122
121
  // Aggregation
123
- // aggregationMenuItemHeader: 'Aggregation',
124
- // aggregationFunctionLabelSum: 'sum',
125
- // aggregationFunctionLabelAvg: 'avg',
126
- // aggregationFunctionLabelMin: 'min',
127
- // aggregationFunctionLabelMax: 'max',
128
- // aggregationFunctionLabelSize: 'size',
122
+ aggregationMenuItemHeader: 'Agrupar',
123
+ aggregationFunctionLabelSum: 'soma',
124
+ aggregationFunctionLabelAvg: 'média',
125
+ aggregationFunctionLabelMin: 'mín',
126
+ aggregationFunctionLabelMax: 'máx',
127
+ aggregationFunctionLabelSize: 'tamanho'
129
128
  };
130
-
131
129
  const ptBR = (0, _getGridLocalization.getGridLocalization)(ptBRGrid, _locale.ptBR);
132
130
  exports.ptBR = ptBR;
@@ -82,7 +82,7 @@ const ruRUGrid = {
82
82
  // Column menu text
83
83
  columnMenuLabel: 'Меню',
84
84
  columnMenuShowColumns: 'Показать столбцы',
85
- // columnMenuManageColumns: 'Manage columns',
85
+ columnMenuManageColumns: 'Управление колонками',
86
86
  columnMenuFilter: 'Фильтр',
87
87
  columnMenuHideColumn: 'Скрыть',
88
88
  columnMenuUnsort: 'Отменить сортировку',
@@ -43,7 +43,7 @@ const svSEGrid = {
43
43
  columnsPanelHideAllButton: 'Dölj alla',
44
44
  // Filter panel text
45
45
  filterPanelAddFilter: 'Lägg till filter',
46
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Ta bort alla',
47
47
  filterPanelDeleteIconLabel: 'Ta bort',
48
48
  filterPanelLogicOperator: 'Logisk operatör',
49
49
  filterPanelOperator: 'Operatör',
@@ -73,7 +73,7 @@ const svSEGrid = {
73
73
  // Column menu text
74
74
  columnMenuLabel: 'Meny',
75
75
  columnMenuShowColumns: 'Visa kolumner',
76
- // columnMenuManageColumns: 'Manage columns',
76
+ columnMenuManageColumns: 'Hantera kolumner',
77
77
  columnMenuFilter: 'Filtrera',
78
78
  columnMenuHideColumn: 'Dölj',
79
79
  columnMenuUnsort: 'Osortera',
@@ -10,4 +10,8 @@ function isLeaf(node) {
10
10
 
11
11
  /**
12
12
  * A function used to process headerClassName params.
13
+ */
14
+
15
+ /**
16
+ * The union type representing the [[GridColDef]] column header class type.
13
17
  */
@@ -29,4 +29,5 @@ var GridCellEditStopReasons = /*#__PURE__*/function (GridCellEditStopReasons) {
29
29
  /**
30
30
  * Params passed to the `cellEditStop event.
31
31
  */
32
+ // https://github.com/mui/mui-x/pull/3738#discussion_r798504277
32
33
  exports.GridCellEditStopReasons = GridCellEditStopReasons;
@@ -39,4 +39,13 @@ var GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {
39
39
  GridRowEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
40
40
  return GridRowEditStopReasons;
41
41
  }(GridRowEditStopReasons || {});
42
+ /**
43
+ * Object passed as parameter in the row `getRowSpacing` callback prop.
44
+ * @demos
45
+ * - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
46
+ */
47
+ /**
48
+ * The getRowSpacing return value.
49
+ */
50
+ // https://github.com/mui/mui-x/pull/3738#discussion_r798504277
42
51
  exports.GridRowEditStopReasons = GridRowEditStopReasons;
@@ -7,39 +7,35 @@ exports.unstable_resetCreateSelectorCache = exports.createSelector = void 0;
7
7
  var _reselect = require("reselect");
8
8
  var _warning = require("./warning");
9
9
  const cacheContainer = {
10
- cache: null
10
+ cache: new WeakMap()
11
11
  };
12
12
  const missingInstanceIdWarning = (0, _warning.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)`.']);
13
13
  const createSelector = (...args) => {
14
- if (cacheContainer.cache === null) {
15
- cacheContainer.cache = {};
16
- }
17
14
  const selector = (...selectorArgs) => {
18
15
  const [stateOrApiRef, instanceId] = selectorArgs;
19
16
  const isApiRef = !!stateOrApiRef.current;
20
- const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId ?? 'default';
17
+ const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId ?? {
18
+ id: 'default'
19
+ };
21
20
  const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
22
21
  if (process.env.NODE_ENV !== 'production') {
23
- if (cacheKey === 'default') {
22
+ if (cacheKey.id === 'default') {
24
23
  missingInstanceIdWarning();
25
24
  }
26
25
  }
27
- if (cacheContainer.cache === null) {
28
- cacheContainer.cache = {};
29
- }
30
26
  const {
31
27
  cache
32
28
  } = cacheContainer;
33
- if (cache[cacheKey] && cache[cacheKey].get(args)) {
29
+ if (cache.get(cacheKey) && cache.get(cacheKey)?.get(args)) {
34
30
  // We pass the cache key because the called selector might have as
35
31
  // dependency another selector created with this `createSelector`.
36
- return cache[cacheKey].get(args)(state, cacheKey);
32
+ return cache.get(cacheKey)?.get(args)(state, cacheKey);
37
33
  }
38
34
  const newSelector = (0, _reselect.createSelector)(...args);
39
- if (!cache[cacheKey]) {
40
- cache[cacheKey] = new Map();
35
+ if (!cache.get(cacheKey)) {
36
+ cache.set(cacheKey, new Map());
41
37
  }
42
- cache[cacheKey].set(args, newSelector);
38
+ cache.get(cacheKey)?.set(args, newSelector);
43
39
  return newSelector(state, cacheKey);
44
40
  };
45
41
 
@@ -51,13 +47,7 @@ const createSelector = (...args) => {
51
47
 
52
48
  // eslint-disable-next-line @typescript-eslint/naming-convention
53
49
  exports.createSelector = createSelector;
54
- const unstable_resetCreateSelectorCache = cacheKey => {
55
- if (typeof cacheKey !== 'undefined') {
56
- if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {
57
- delete cacheContainer.cache[cacheKey];
58
- }
59
- } else {
60
- cacheContainer.cache = null;
61
- }
50
+ const unstable_resetCreateSelectorCache = () => {
51
+ cacheContainer.cache = new WeakMap();
62
52
  };
63
53
  exports.unstable_resetCreateSelectorCache = unstable_resetCreateSelectorCache;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.0.3",
3
+ "version": "6.1.0",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { Selector, SelectorResultArray } from 'reselect';
3
- type CacheKey = number | string;
3
+ import type { GridCoreApi } from '../models/api/gridCoreApi';
4
4
  export interface OutputSelector<State, Result> {
5
5
  (apiRef: React.MutableRefObject<{
6
6
  state: State;
7
- instanceId: number;
7
+ instanceId: GridCoreApi['instanceId'];
8
8
  }>): Result;
9
- (state: State, instanceId?: number): Result;
9
+ (state: State, instanceId?: GridCoreApi['instanceId']): Result;
10
10
  acceptsApiRef: boolean;
11
11
  }
12
12
  type StateFromSelector<T> = T extends (first: infer F, ...args: any[]) => any ? F extends {
@@ -19,5 +19,5 @@ type StateFromSelectorList<Selectors extends readonly any[]> = Selectors extends
19
19
  type SelectorArgs<Selectors extends ReadonlyArray<Selector<any>>, Result> = [selectors: [...Selectors], combiner: (...args: SelectorResultArray<Selectors>) => Result] | [...Selectors, (...args: SelectorResultArray<Selectors>) => Result];
20
20
  type CreateSelectorFunction = <Selectors extends ReadonlyArray<Selector<any>>, Result>(...items: SelectorArgs<Selectors, Result>) => OutputSelector<StateFromSelectorList<Selectors>, Result>;
21
21
  export declare const createSelector: CreateSelectorFunction;
22
- export declare const unstable_resetCreateSelectorCache: (cacheKey?: CacheKey) => void;
22
+ export declare const unstable_resetCreateSelectorCache: () => void;
23
23
  export {};
@@ -1,39 +1,37 @@
1
1
  import { createSelector as reselectCreateSelector } from 'reselect';
2
2
  import { buildWarning } from './warning';
3
3
  const cacheContainer = {
4
- cache: null
4
+ cache: new WeakMap()
5
5
  };
6
6
  const 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 const createSelector = (...args) => {
8
- if (cacheContainer.cache === null) {
9
- cacheContainer.cache = {};
10
- }
11
8
  const selector = (...selectorArgs) => {
9
+ var _cache$get, _cache$get3;
12
10
  const [stateOrApiRef, instanceId] = selectorArgs;
13
11
  const isApiRef = !!stateOrApiRef.current;
14
- const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';
12
+ const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : {
13
+ id: 'default'
14
+ };
15
15
  const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
16
16
  if (process.env.NODE_ENV !== 'production') {
17
- if (cacheKey === 'default') {
17
+ if (cacheKey.id === 'default') {
18
18
  missingInstanceIdWarning();
19
19
  }
20
20
  }
21
- if (cacheContainer.cache === null) {
22
- cacheContainer.cache = {};
23
- }
24
21
  const {
25
22
  cache
26
23
  } = cacheContainer;
27
- if (cache[cacheKey] && cache[cacheKey].get(args)) {
24
+ if (cache.get(cacheKey) && (_cache$get = cache.get(cacheKey)) != null && _cache$get.get(args)) {
25
+ var _cache$get2;
28
26
  // We pass the cache key because the called selector might have as
29
27
  // dependency another selector created with this `createSelector`.
30
- return cache[cacheKey].get(args)(state, cacheKey);
28
+ return (_cache$get2 = cache.get(cacheKey)) == null ? void 0 : _cache$get2.get(args)(state, cacheKey);
31
29
  }
32
30
  const newSelector = reselectCreateSelector(...args);
33
- if (!cache[cacheKey]) {
34
- cache[cacheKey] = new Map();
31
+ if (!cache.get(cacheKey)) {
32
+ cache.set(cacheKey, new Map());
35
33
  }
36
- cache[cacheKey].set(args, newSelector);
34
+ (_cache$get3 = cache.get(cacheKey)) == null ? void 0 : _cache$get3.set(args, newSelector);
37
35
  return newSelector(state, cacheKey);
38
36
  };
39
37
 
@@ -44,12 +42,6 @@ export const createSelector = (...args) => {
44
42
  };
45
43
 
46
44
  // eslint-disable-next-line @typescript-eslint/naming-convention
47
- export const unstable_resetCreateSelectorCache = cacheKey => {
48
- if (typeof cacheKey !== 'undefined') {
49
- if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {
50
- delete cacheContainer.cache[cacheKey];
51
- }
52
- } else {
53
- cacheContainer.cache = null;
54
- }
45
+ export const unstable_resetCreateSelectorCache = () => {
46
+ cacheContainer.cache = new WeakMap();
55
47
  };