@mui/x-data-grid 7.0.0-alpha.1 → 7.0.0-alpha.3

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 (140) hide show
  1. package/CHANGELOG.md +607 -188
  2. package/DataGrid/DataGrid.d.ts +0 -10
  3. package/DataGrid/DataGrid.js +11 -23
  4. package/DataGrid/useDataGridProps.js +1 -1
  5. package/README.md +0 -1
  6. package/components/GridHeader.js +3 -2
  7. package/components/GridPagination.d.ts +2 -2
  8. package/components/GridRow.js +2 -4
  9. package/components/cell/GridCell.js +3 -3
  10. package/components/cell/GridEditDateCell.js +1 -20
  11. package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  12. package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  13. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  14. package/components/panel/filterPanel/GridFilterForm.js +2 -2
  15. package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  16. package/components/panel/index.d.ts +0 -1
  17. package/components/panel/index.js +0 -1
  18. package/constants/defaultGridSlotsComponents.js +1 -2
  19. package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
  20. package/hooks/features/clipboard/useGridClipboard.js +1 -1
  21. package/hooks/features/editing/useGridCellEditing.js +8 -21
  22. package/hooks/features/editing/useGridRowEditing.js +7 -21
  23. package/hooks/features/export/useGridCsvExport.d.ts +1 -1
  24. package/hooks/features/export/useGridCsvExport.js +1 -1
  25. package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
  26. package/hooks/features/filter/gridFilterUtils.js +7 -4
  27. package/hooks/features/filter/useGridFilter.js +2 -2
  28. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  29. package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  30. package/hooks/features/sorting/useGridSorting.js +6 -5
  31. package/index.js +1 -1
  32. package/internals/index.d.ts +1 -1
  33. package/internals/index.js +1 -1
  34. package/legacy/DataGrid/DataGrid.js +11 -23
  35. package/legacy/DataGrid/useDataGridProps.js +1 -1
  36. package/legacy/colDef/gridDefaultColumnTypes.js +2 -3
  37. package/legacy/components/GridHeader.js +3 -2
  38. package/legacy/components/GridPagination.js +3 -4
  39. package/legacy/components/GridRow.js +2 -4
  40. package/legacy/components/cell/GridCell.js +3 -3
  41. package/legacy/components/cell/GridEditDateCell.js +1 -20
  42. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  43. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  44. package/legacy/components/columnHeaders/GridColumnHeadersInner.js +4 -5
  45. package/legacy/components/containers/GridRootStyles.js +69 -70
  46. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  47. package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
  48. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  49. package/legacy/components/panel/index.js +0 -1
  50. package/legacy/components/toolbar/GridToolbarQuickFilter.js +4 -5
  51. package/legacy/constants/defaultGridSlotsComponents.js +1 -2
  52. package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -1
  53. package/legacy/hooks/features/editing/useGridCellEditing.js +8 -21
  54. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -23
  55. package/legacy/hooks/features/export/useGridCsvExport.js +1 -1
  56. package/legacy/hooks/features/filter/gridFilterUtils.js +7 -4
  57. package/legacy/hooks/features/filter/useGridFilter.js +2 -2
  58. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  59. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  60. package/legacy/hooks/features/sorting/useGridSorting.js +6 -5
  61. package/legacy/index.js +1 -1
  62. package/legacy/internals/index.js +1 -1
  63. package/legacy/locales/arSD.js +1 -1
  64. package/legacy/locales/bgBG.js +33 -37
  65. package/legacy/locales/heIL.js +1 -2
  66. package/legacy/models/params/gridEditCellParams.js +1 -0
  67. package/legacy/utils/domUtils.js +10 -15
  68. package/locales/arSD.js +1 -1
  69. package/locales/bgBG.js +33 -37
  70. package/locales/heIL.js +1 -2
  71. package/models/api/gridEditingApi.d.ts +2 -4
  72. package/models/api/gridSortApi.d.ts +2 -2
  73. package/models/gridFilterModel.d.ts +2 -2
  74. package/models/gridSlotsComponent.d.ts +0 -5
  75. package/models/gridSlotsComponentsProps.d.ts +0 -3
  76. package/models/params/gridEditCellParams.d.ts +3 -1
  77. package/models/params/gridEditCellParams.js +1 -0
  78. package/models/params/gridRowParams.d.ts +1 -0
  79. package/models/props/DataGridProps.d.ts +1 -1
  80. package/modern/DataGrid/DataGrid.js +11 -23
  81. package/modern/DataGrid/useDataGridProps.js +1 -1
  82. package/modern/components/GridHeader.js +2 -1
  83. package/modern/components/GridRow.js +2 -4
  84. package/modern/components/cell/GridCell.js +2 -2
  85. package/modern/components/cell/GridEditDateCell.js +1 -20
  86. package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  87. package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  88. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  89. package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
  90. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  91. package/modern/components/panel/index.js +0 -1
  92. package/modern/constants/defaultGridSlotsComponents.js +1 -2
  93. package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
  94. package/modern/hooks/features/editing/useGridCellEditing.js +8 -21
  95. package/modern/hooks/features/editing/useGridRowEditing.js +7 -21
  96. package/modern/hooks/features/export/useGridCsvExport.js +1 -1
  97. package/modern/hooks/features/filter/gridFilterUtils.js +4 -2
  98. package/modern/hooks/features/filter/useGridFilter.js +2 -2
  99. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  100. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  101. package/modern/hooks/features/sorting/useGridSorting.js +6 -5
  102. package/modern/index.js +1 -1
  103. package/modern/internals/index.js +1 -1
  104. package/modern/locales/arSD.js +1 -1
  105. package/modern/locales/bgBG.js +33 -37
  106. package/modern/locales/heIL.js +1 -2
  107. package/modern/models/params/gridEditCellParams.js +1 -0
  108. package/modern/utils/domUtils.js +10 -15
  109. package/node/DataGrid/DataGrid.js +11 -23
  110. package/node/DataGrid/useDataGridProps.js +1 -1
  111. package/node/components/GridHeader.js +2 -1
  112. package/node/components/GridRow.js +1 -3
  113. package/node/components/cell/GridCell.js +2 -2
  114. package/node/components/cell/GridEditDateCell.js +1 -20
  115. package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  116. package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  117. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  118. package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
  119. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  120. package/node/components/panel/index.js +0 -11
  121. package/node/constants/defaultGridSlotsComponents.js +0 -1
  122. package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
  123. package/node/hooks/features/editing/useGridCellEditing.js +7 -20
  124. package/node/hooks/features/editing/useGridRowEditing.js +6 -20
  125. package/node/hooks/features/export/useGridCsvExport.js +1 -1
  126. package/node/hooks/features/filter/gridFilterUtils.js +6 -3
  127. package/node/hooks/features/filter/useGridFilter.js +1 -1
  128. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  129. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  130. package/node/hooks/features/sorting/useGridSorting.js +6 -5
  131. package/node/index.js +1 -1
  132. package/node/internals/index.js +7 -0
  133. package/node/locales/arSD.js +1 -1
  134. package/node/locales/bgBG.js +33 -37
  135. package/node/locales/heIL.js +1 -2
  136. package/node/models/params/gridEditCellParams.js +1 -0
  137. package/node/utils/domUtils.js +11 -18
  138. package/package.json +6 -5
  139. package/utils/domUtils.d.ts +2 -3
  140. package/utils/domUtils.js +10 -15
@@ -182,6 +182,10 @@ var buildAggregatedFilterItemsApplier = function buildAggregatedFilterItemsAppli
182
182
  filterItemsApplierId += 1;
183
183
  return filterItem;
184
184
  };
185
+ export var shouldQuickFilterExcludeHiddenColumns = function shouldQuickFilterExcludeHiddenColumns(filterModel) {
186
+ var _filterModel$quickFil;
187
+ return (_filterModel$quickFil = filterModel.quickFilterExcludeHiddenColumns) != null ? _filterModel$quickFil : true;
188
+ };
185
189
 
186
190
  /**
187
191
  * Generates a method to easily check if a row is matching the current quick filter.
@@ -190,13 +194,12 @@ var buildAggregatedFilterItemsApplier = function buildAggregatedFilterItemsAppli
190
194
  * @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
191
195
  */
192
196
  var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilterApplier(filterModel, apiRef) {
193
- var _filterModel$quickFil, _filterModel$quickFil2, _filterModel$quickFil3;
194
- var quickFilterValues = (_filterModel$quickFil = (_filterModel$quickFil2 = filterModel.quickFilterValues) == null ? void 0 : _filterModel$quickFil2.filter(Boolean)) != null ? _filterModel$quickFil : [];
197
+ var _filterModel$quickFil2, _filterModel$quickFil3;
198
+ var quickFilterValues = (_filterModel$quickFil2 = (_filterModel$quickFil3 = filterModel.quickFilterValues) == null ? void 0 : _filterModel$quickFil3.filter(Boolean)) != null ? _filterModel$quickFil2 : [];
195
199
  if (quickFilterValues.length === 0) {
196
200
  return null;
197
201
  }
198
- var quickFilterExcludeHiddenColumns = (_filterModel$quickFil3 = filterModel.quickFilterExcludeHiddenColumns) != null ? _filterModel$quickFil3 : false;
199
- var columnFields = quickFilterExcludeHiddenColumns ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);
202
+ var columnFields = shouldQuickFilterExcludeHiddenColumns(filterModel) ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);
200
203
  var appliersPerField = [];
201
204
  var ignoreDiacritics = apiRef.current.rootProps.ignoreDiacritics;
202
205
  var publicApiRef = getPublicApiRef(apiRef);
@@ -15,7 +15,7 @@ import { useFirstRender } from '../../utils/useFirstRender';
15
15
  import { gridRowsLookupSelector } from '../rows';
16
16
  import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
17
17
  import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from '../../core/strategyProcessing';
18
- import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic } from './gridFilterUtils';
18
+ import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns } from './gridFilterUtils';
19
19
  import { isDeepEqual } from '../../../utils/utils';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  export var filterStateInitializer = function filterStateInitializer(state, props, apiRef) {
@@ -354,7 +354,7 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
354
354
  useGridApiEventHandler(apiRef, 'rowExpansionChange', updateVisibleRowsLookupState);
355
355
  useGridApiEventHandler(apiRef, 'columnVisibilityModelChange', function () {
356
356
  var filterModel = gridFilterModelSelector(apiRef);
357
- if (filterModel.quickFilterValues && filterModel.quickFilterExcludeHiddenColumns) {
357
+ if (filterModel.quickFilterValues && shouldQuickFilterExcludeHiddenColumns(filterModel)) {
358
358
  // re-apply filters because the quick filter results may have changed
359
359
  apiRef.current.unstable_applyFilters();
360
360
  }
@@ -16,6 +16,7 @@ import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
16
16
  import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
17
17
  import { unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
18
18
  import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
19
+ import { isEventTargetInPortal } from '../../../utils/domUtils';
19
20
  function enrichPageRowsWithPinnedRows(apiRef, rows) {
20
21
  var pinnedRows = gridPinnedRowsSelector(apiRef) || {};
21
22
  return [].concat(_toConsumableArray(pinnedRows.top || []), _toConsumableArray(rows), _toConsumableArray(pinnedRows.bottom || []));
@@ -412,7 +413,7 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
412
413
  }, [apiRef, currentPageRows.length, goToHeader, goToGroupHeader, goToCell, getRowIdFromIndex]);
413
414
  var handleCellKeyDown = React.useCallback(function (params, event) {
414
415
  // Ignore portal
415
- if (!event.currentTarget.contains(event.target)) {
416
+ if (isEventTargetInPortal(event)) {
416
417
  return;
417
418
  }
418
419
 
@@ -15,6 +15,7 @@ import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
15
15
  import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
16
16
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
17
17
  import { gridClasses } from '../../../constants/gridClasses';
18
+ import { isEventTargetInPortal } from '../../../utils/domUtils';
18
19
  var getSelectionModelPropValue = function getSelectionModelPropValue(selectionModelProp, prevSelectionModel) {
19
20
  if (selectionModelProp == null) {
20
21
  return selectionModelProp;
@@ -312,7 +313,7 @@ export var useGridRowSelection = function useGridRowSelection(apiRef, props) {
312
313
 
313
314
  // Ignore portal
314
315
  // Do not apply shortcuts if the focus is not on the cell root component
315
- if (!event.currentTarget.contains(event.target)) {
316
+ if (isEventTargetInPortal(event)) {
316
317
  return;
317
318
  }
318
319
  if (isNavigationKey(event.key) && event.shiftKey) {
@@ -123,7 +123,8 @@ export var useGridSorting = function useGridSorting(apiRef, props) {
123
123
  apiRef.current.applySorting();
124
124
  }
125
125
  }, [apiRef, logger, props.disableMultipleColumnsSorting]);
126
- var sortColumn = React.useCallback(function (column, direction, allowMultipleSorting) {
126
+ var sortColumn = React.useCallback(function (field, direction, allowMultipleSorting) {
127
+ var column = apiRef.current.getColumn(field);
127
128
  if (!column.sortable) {
128
129
  return;
129
130
  }
@@ -216,15 +217,15 @@ export var useGridSorting = function useGridSorting(apiRef, props) {
216
217
  * EVENTS
217
218
  */
218
219
  var handleColumnHeaderClick = React.useCallback(function (_ref2, event) {
219
- var colDef = _ref2.colDef;
220
+ var field = _ref2.field;
220
221
  var allowMultipleSorting = event.shiftKey || event.metaKey || event.ctrlKey;
221
- sortColumn(colDef, undefined, allowMultipleSorting);
222
+ sortColumn(field, undefined, allowMultipleSorting);
222
223
  }, [sortColumn]);
223
224
  var handleColumnHeaderKeyDown = React.useCallback(function (_ref3, event) {
224
- var colDef = _ref3.colDef;
225
+ var field = _ref3.field;
225
226
  // Ctrl + Enter opens the column menu
226
227
  if (isEnterKey(event.key) && !event.ctrlKey && !event.metaKey) {
227
- sortColumn(colDef, undefined, event.shiftKey);
228
+ sortColumn(field, undefined, event.shiftKey);
228
229
  }
229
230
  }, [sortColumn]);
230
231
  var handleColumnsChange = React.useCallback(function () {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.0.0-alpha.1
2
+ * @mui/x-data-grid v7.0.0-alpha.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -54,7 +54,7 @@ export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
54
54
  export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
55
55
  export * from '../utils/createControllablePromise';
56
56
  export { createSelector, createSelectorMemoized, unstable_resetCreateSelectorCache } from '../utils/createSelector';
57
- export { findParentElementFromClassName, getActiveElement } from '../utils/domUtils';
57
+ export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal } from '../utils/domUtils';
58
58
  export { isNavigationKey } from '../utils/keyboardUtils';
59
59
  export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
60
60
  export { buildWarning } from '../utils/warning';
@@ -95,7 +95,7 @@ var arSDGrid = {
95
95
  // Column menu text
96
96
  columnMenuLabel: 'القائمة',
97
97
  columnMenuShowColumns: 'إظهار الأعمدة',
98
- // columnMenuManageColumns: 'Manage columns',
98
+ columnMenuManageColumns: 'إدارة الأعمدة',
99
99
  columnMenuFilter: 'المرشِح',
100
100
  columnMenuHideColumn: 'إخفاء',
101
101
  columnMenuUnsort: 'الغاء الفرز',
@@ -62,34 +62,32 @@ var bgBGGrid = {
62
62
  filterOperatorIsEmpty: 'е празен',
63
63
  filterOperatorIsNotEmpty: 'не е празен',
64
64
  filterOperatorIsAnyOf: 'е някой от',
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: 'Съдържа',
73
+ headerFilterOperatorEquals: 'Равнo',
74
+ headerFilterOperatorStartsWith: 'Започва с',
75
+ headerFilterOperatorEndsWith: 'Завършва с',
76
+ headerFilterOperatorIs: 'Равно е на',
77
+ headerFilterOperatorNot: 'Не се равнява на',
78
+ headerFilterOperatorAfter: 'След',
79
+ headerFilterOperatorOnOrAfter: 'След (включително)',
80
+ headerFilterOperatorBefore: 'Преди',
81
+ headerFilterOperatorOnOrBefore: 'Преди (включително)',
82
+ headerFilterOperatorIsEmpty: 'Празен',
83
+ headerFilterOperatorIsNotEmpty: 'Не е празен',
84
+ headerFilterOperatorIsAnyOf: 'Всичко от',
85
+ 'headerFilterOperator=': 'Равно',
86
+ 'headerFilterOperator!=': 'Различно',
87
+ 'headerFilterOperator>': 'По-голямо от',
88
+ 'headerFilterOperator>=': 'По-голямо или равно на',
89
+ 'headerFilterOperator<': 'По-малко от',
90
+ 'headerFilterOperator<=': 'По-малко или равно на',
93
91
  // Filter values text
94
92
  filterValueAny: 'всякакви',
95
93
  filterValueTrue: 'вярно',
@@ -147,19 +145,17 @@ var bgBGGrid = {
147
145
  return "\u0421\u043F\u0440\u0438 \u0433\u0440\u0443\u043F\u0438\u0440\u0430\u043D\u0435 \u043F\u043E ".concat(name);
148
146
  },
149
147
  // Master/detail
150
- // detailPanelToggle: 'Detail panel toggle',
148
+ detailPanelToggle: 'Превключване на панела с детайли',
151
149
  expandDetailPanel: 'Разгъване',
152
150
  collapseDetailPanel: 'Свиване',
153
151
  // Row reordering text
154
- rowReorderingHeaderName: 'Подредба на редове'
155
-
152
+ rowReorderingHeaderName: 'Подредба на редове',
156
153
  // Aggregation
157
- // aggregationMenuItemHeader: 'Aggregation',
158
- // aggregationFunctionLabelSum: 'sum',
159
- // aggregationFunctionLabelAvg: 'avg',
160
- // aggregationFunctionLabelMin: 'min',
161
- // aggregationFunctionLabelMax: 'max',
162
- // aggregationFunctionLabelSize: 'size',
154
+ aggregationMenuItemHeader: 'Агрегиране',
155
+ aggregationFunctionLabelSum: 'сума',
156
+ aggregationFunctionLabelAvg: 'срст',
157
+ aggregationFunctionLabelMin: 'мин',
158
+ aggregationFunctionLabelMax: 'макс',
159
+ aggregationFunctionLabelSize: 'размер'
163
160
  };
164
-
165
161
  export var bgBG = getGridLocalization(bgBGGrid, bgBGCore);
@@ -132,8 +132,7 @@ var heILGrid = {
132
132
  // Column pinning text
133
133
  pinToLeft: 'נעץ משמאל',
134
134
  pinToRight: 'נעץ מימין',
135
- // unpin: 'Unpin',
136
-
135
+ unpin: 'הסר נעיצה',
137
136
  // Tree Data
138
137
  treeDataGroupingHeaderName: 'קבוצה',
139
138
  treeDataExpand: 'הרחב',
@@ -6,6 +6,7 @@ var GridCellEditStartReasons = /*#__PURE__*/function (GridCellEditStartReasons)
6
6
  GridCellEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
7
7
  GridCellEditStartReasons["printableKeyDown"] = "printableKeyDown";
8
8
  GridCellEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
9
+ GridCellEditStartReasons["pasteKeyDown"] = "pasteKeyDown";
9
10
  return GridCellEditStartReasons;
10
11
  }(GridCellEditStartReasons || {});
11
12
  /**
@@ -5,20 +5,6 @@ export function isOverflown(element) {
5
5
  export function findParentElementFromClassName(elem, className) {
6
6
  return elem.closest(".".concat(className));
7
7
  }
8
- export function getRowEl(cell) {
9
- if (!cell) {
10
- return null;
11
- }
12
- return findParentElementFromClassName(cell, gridClasses.row);
13
- }
14
-
15
- // TODO remove
16
- export function isGridCellRoot(elem) {
17
- return elem != null && elem.classList.contains(gridClasses.cell);
18
- }
19
- export function isGridHeaderCellRoot(elem) {
20
- return elem != null && elem.classList.contains(gridClasses.columnHeader);
21
- }
22
8
  function escapeOperandAttributeSelector(operand) {
23
9
  return operand.replace(/["\\]/g, '\\$&');
24
10
  }
@@ -51,4 +37,13 @@ export var getActiveElement = function getActiveElement() {
51
37
  return getActiveElement(activeEl.shadowRoot);
52
38
  }
53
39
  return activeEl;
54
- };
40
+ };
41
+ export function isEventTargetInPortal(event) {
42
+ if (
43
+ // The target is not an element when triggered by a Select inside the cell
44
+ // See https://github.com/mui/material-ui/issues/10534
45
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
46
+ return true;
47
+ }
48
+ return false;
49
+ }
package/locales/arSD.js CHANGED
@@ -93,7 +93,7 @@ const arSDGrid = {
93
93
  // Column menu text
94
94
  columnMenuLabel: 'القائمة',
95
95
  columnMenuShowColumns: 'إظهار الأعمدة',
96
- // columnMenuManageColumns: 'Manage columns',
96
+ columnMenuManageColumns: 'إدارة الأعمدة',
97
97
  columnMenuFilter: 'المرشِح',
98
98
  columnMenuHideColumn: 'إخفاء',
99
99
  columnMenuUnsort: 'الغاء الفرز',
package/locales/bgBG.js CHANGED
@@ -60,34 +60,32 @@ const bgBGGrid = {
60
60
  filterOperatorIsEmpty: 'е празен',
61
61
  filterOperatorIsNotEmpty: 'не е празен',
62
62
  filterOperatorIsAnyOf: 'е някой от',
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: 'Съдържа',
71
+ headerFilterOperatorEquals: 'Равнo',
72
+ headerFilterOperatorStartsWith: 'Започва с',
73
+ headerFilterOperatorEndsWith: 'Завършва с',
74
+ headerFilterOperatorIs: 'Равно е на',
75
+ headerFilterOperatorNot: 'Не се равнява на',
76
+ headerFilterOperatorAfter: 'След',
77
+ headerFilterOperatorOnOrAfter: 'След (включително)',
78
+ headerFilterOperatorBefore: 'Преди',
79
+ headerFilterOperatorOnOrBefore: 'Преди (включително)',
80
+ headerFilterOperatorIsEmpty: 'Празен',
81
+ headerFilterOperatorIsNotEmpty: 'Не е празен',
82
+ headerFilterOperatorIsAnyOf: 'Всичко от',
83
+ 'headerFilterOperator=': 'Равно',
84
+ 'headerFilterOperator!=': 'Различно',
85
+ 'headerFilterOperator>': 'По-голямо от',
86
+ 'headerFilterOperator>=': 'По-голямо или равно на',
87
+ 'headerFilterOperator<': 'По-малко от',
88
+ 'headerFilterOperator<=': 'По-малко или равно на',
91
89
  // Filter values text
92
90
  filterValueAny: 'всякакви',
93
91
  filterValueTrue: 'вярно',
@@ -135,19 +133,17 @@ const bgBGGrid = {
135
133
  groupColumn: name => `Групирай по ${name}`,
136
134
  unGroupColumn: name => `Спри групиране по ${name}`,
137
135
  // Master/detail
138
- // detailPanelToggle: 'Detail panel toggle',
136
+ detailPanelToggle: 'Превключване на панела с детайли',
139
137
  expandDetailPanel: 'Разгъване',
140
138
  collapseDetailPanel: 'Свиване',
141
139
  // Row reordering text
142
- rowReorderingHeaderName: 'Подредба на редове'
143
-
140
+ rowReorderingHeaderName: 'Подредба на редове',
144
141
  // Aggregation
145
- // aggregationMenuItemHeader: 'Aggregation',
146
- // aggregationFunctionLabelSum: 'sum',
147
- // aggregationFunctionLabelAvg: 'avg',
148
- // aggregationFunctionLabelMin: 'min',
149
- // aggregationFunctionLabelMax: 'max',
150
- // aggregationFunctionLabelSize: 'size',
142
+ aggregationMenuItemHeader: 'Агрегиране',
143
+ aggregationFunctionLabelSum: 'сума',
144
+ aggregationFunctionLabelAvg: 'срст',
145
+ aggregationFunctionLabelMin: 'мин',
146
+ aggregationFunctionLabelMax: 'макс',
147
+ aggregationFunctionLabelSize: 'размер'
151
148
  };
152
-
153
149
  export const bgBG = getGridLocalization(bgBGGrid, bgBGCore);
package/locales/heIL.js CHANGED
@@ -124,8 +124,7 @@ const heILGrid = {
124
124
  // Column pinning text
125
125
  pinToLeft: 'נעץ משמאל',
126
126
  pinToRight: 'נעץ מימין',
127
- // unpin: 'Unpin',
128
-
127
+ unpin: 'הסר נעיצה',
129
128
  // Tree Data
130
129
  treeDataGroupingHeaderName: 'קבוצה',
131
130
  treeDataExpand: 'הרחב',
@@ -18,10 +18,6 @@ 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;
25
21
  }
26
22
  export interface GridEditingSharedApi {
27
23
  /**
@@ -81,6 +77,7 @@ export interface GridStartCellEditModeParams {
81
77
  /**
82
78
  * The initial value for the field.
83
79
  * If `deleteValue` is also true, this value is not used.
80
+ * @deprecated No longer needed.
84
81
  */
85
82
  initialValue?: any;
86
83
  }
@@ -126,6 +123,7 @@ export interface GridStartRowEditModeParams {
126
123
  /**
127
124
  * The initial value for the given `fieldToFocus`.
128
125
  * If `deleteValue` is also true, this value is not used.
126
+ * @deprecated No longer needed.
129
127
  */
130
128
  initialValue?: string;
131
129
  }
@@ -21,11 +21,11 @@ export interface GridSortApi {
21
21
  setSortModel: (model: GridSortModel) => void;
22
22
  /**
23
23
  * Sorts a column.
24
- * @param {GridColDef} column The [[GridColDef]] of the column to be sorted.
24
+ * @param {GridColDef['field']} field The field identifier of the column to be sorted.
25
25
  * @param {GridSortDirection} direction The direction to be sorted. By default, the next in the `sortingOrder` prop.
26
26
  * @param {boolean} allowMultipleSorting Whether to keep the existing [[GridSortItem]]. Default is `false`.
27
27
  */
28
- sortColumn: (column: GridColDef, direction?: GridSortDirection, allowMultipleSorting?: boolean) => void;
28
+ sortColumn: (field: GridColDef['field'], direction?: GridSortDirection, allowMultipleSorting?: boolean) => void;
29
29
  /**
30
30
  * Returns all rows sorted according to the active sort model.
31
31
  * @returns {GridRowModel[]} The sorted [[GridRowModel]] objects.
@@ -27,8 +27,8 @@ export interface GridFilterModel {
27
27
  */
28
28
  quickFilterLogicOperator?: GridLogicOperator;
29
29
  /**
30
- * If `true`, the quick filter will skip cell values from hidden columns.
31
- * @default false
30
+ * If `false`, the quick filter will also consider cell values from hidden columns.
31
+ * @default true
32
32
  */
33
33
  quickFilterExcludeHiddenColumns?: boolean;
34
34
  }
@@ -116,11 +116,6 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
116
116
  * @default null
117
117
  */
118
118
  toolbar: React.JSXElementConstructor<any> | null;
119
- /**
120
- * PreferencesPanel component rendered inside the Header component.
121
- * @default GridPreferencesPanel
122
- */
123
- preferencesPanel: React.JSXElementConstructor<any>;
124
119
  /**
125
120
  * Loading overlay component rendered when the grid is in a loading state.
126
121
  * @default GridLoadingOverlay
@@ -72,8 +72,6 @@ export interface NoRowsOverlayPropsOverrides {
72
72
  }
73
73
  export interface PanelPropsOverrides {
74
74
  }
75
- export interface PreferencesPanelPropsOverrides {
76
- }
77
75
  export interface RowPropsOverrides {
78
76
  }
79
77
  type SlotProps<Props, Overrides> = Partial<Props & Overrides>;
@@ -109,7 +107,6 @@ export interface GridSlotsComponentsProps {
109
107
  noRowsOverlay?: SlotProps<GridOverlayProps, NoRowsOverlayPropsOverrides>;
110
108
  pagination?: SlotProps<TablePaginationProps, PaginationPropsOverrides>;
111
109
  panel?: SlotProps<GridPanelProps, PanelPropsOverrides>;
112
- preferencesPanel?: SlotProps<React.HTMLAttributes<HTMLDivElement>, PreferencesPanelPropsOverrides>;
113
110
  row?: SlotProps<GridRowProps, RowPropsOverrides>;
114
111
  toolbar?: SlotProps<GridToolbarProps, ToolbarPropsOverrides>;
115
112
  }
@@ -29,7 +29,8 @@ declare enum GridCellEditStartReasons {
29
29
  enterKeyDown = "enterKeyDown",
30
30
  cellDoubleClick = "cellDoubleClick",
31
31
  printableKeyDown = "printableKeyDown",
32
- deleteKeyDown = "deleteKeyDown"
32
+ deleteKeyDown = "deleteKeyDown",
33
+ pasteKeyDown = "pasteKeyDown"
33
34
  }
34
35
  /**
35
36
  * Params passed to the `cellEditStart` event.
@@ -41,6 +42,7 @@ export interface GridCellEditStartParams<R extends GridValidRowModel = any, V =
41
42
  reason?: GridCellEditStartReasons;
42
43
  /**
43
44
  * If the reason is related to a keyboard event, it contains which key was pressed.
45
+ * @deprecated No longer needed.
44
46
  */
45
47
  key?: string;
46
48
  }
@@ -6,6 +6,7 @@ var GridCellEditStartReasons = /*#__PURE__*/function (GridCellEditStartReasons)
6
6
  GridCellEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
7
7
  GridCellEditStartReasons["printableKeyDown"] = "printableKeyDown";
8
8
  GridCellEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
9
+ GridCellEditStartReasons["pasteKeyDown"] = "pasteKeyDown";
9
10
  return GridCellEditStartReasons;
10
11
  }(GridCellEditStartReasons || {});
11
12
  /**
@@ -74,6 +74,7 @@ export interface GridRowEditStartParams<R extends GridValidRowModel = any> exten
74
74
  reason?: GridRowEditStartReasons;
75
75
  /**
76
76
  * If the reason is related to a keyboard event, it contains which key was pressed.
77
+ * @deprecated No longer needed.
77
78
  */
78
79
  key?: string;
79
80
  }
@@ -331,7 +331,7 @@ export interface DataGridPropsWithDefaultValues {
331
331
  * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
332
332
  * @default false
333
333
  */
334
- unstable_ignoreValueFormatterDuringExport: boolean | {
334
+ ignoreValueFormatterDuringExport: boolean | {
335
335
  csvExport?: boolean;
336
336
  clipboardExport?: boolean;
337
337
  };
@@ -5,7 +5,7 @@ import { chainPropTypes } from '@mui/utils';
5
5
  import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot } from '../components';
6
6
  import { GridContextProvider } from '../context/GridContextProvider';
7
7
  import { useDataGridComponent } from './useDataGridComponent';
8
- import { useDataGridProps, DATA_GRID_PROPS_DEFAULT_VALUES } from './useDataGridProps';
8
+ import { useDataGridProps } from './useDataGridProps';
9
9
  import { DataGridVirtualScroller } from '../components/DataGridVirtualScroller';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -35,18 +35,6 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
35
35
  * - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
36
36
  */
37
37
  export const DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
38
-
39
- /**
40
- * Remove at v7
41
- * @deprecated
42
- */
43
- export const SUBMIT_FILTER_STROKE_TIME = DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
44
-
45
- /**
46
- * Remove at v7
47
- * @deprecated
48
- */
49
- export const SUBMIT_FILTER_DATE_STROKE_TIME = DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
50
38
  DataGridRaw.propTypes = {
51
39
  // ----------------------------- Warning --------------------------------
52
40
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -274,6 +262,15 @@ DataGridRaw.propTypes = {
274
262
  * @default false
275
263
  */
276
264
  ignoreDiacritics: PropTypes.bool,
265
+ /**
266
+ * If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
267
+ * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
268
+ * @default false
269
+ */
270
+ ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
271
+ clipboardExport: PropTypes.bool,
272
+ csvExport: PropTypes.bool
273
+ }), PropTypes.bool]),
277
274
  /**
278
275
  * The initial state of the DataGrid.
279
276
  * The data in it will be set in the state on initialization but will not be controlled.
@@ -666,14 +663,5 @@ DataGridRaw.propTypes = {
666
663
  /**
667
664
  * The system prop that allows defining system overrides as well as additional CSS styles.
668
665
  */
669
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
670
- /**
671
- * If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
672
- * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
673
- * @default false
674
- */
675
- unstable_ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
676
- clipboardExport: PropTypes.bool,
677
- csvExport: PropTypes.bool
678
- }), PropTypes.bool])
666
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
679
667
  };
@@ -68,7 +68,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
68
68
  disableColumnResize: false,
69
69
  keepNonExistentRowsSelected: false,
70
70
  keepColumnPositionIfDraggedOutside: false,
71
- unstable_ignoreValueFormatterDuringExport: false,
71
+ ignoreValueFormatterDuringExport: false,
72
72
  clipboardCopyCellDelimiter: '\t',
73
73
  rowPositionsDebounceMs: 166
74
74
  };
@@ -1,11 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useGridRootProps } from '../hooks/utils/useGridRootProps';
4
+ import { GridPreferencesPanel } from './panel/GridPreferencesPanel';
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
7
  export function GridHeader() {
7
8
  const rootProps = useGridRootProps();
8
9
  return /*#__PURE__*/_jsxs(React.Fragment, {
9
- children: [/*#__PURE__*/_jsx(rootProps.slots.preferencesPanel, _extends({}, rootProps.slotProps?.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, rootProps.slotProps?.toolbar))]
10
+ children: [/*#__PURE__*/_jsx(GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, rootProps.slotProps?.toolbar))]
10
11
  });
11
12
  }