@mui/x-data-grid 6.18.1 → 6.18.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 (79) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/components/GridRow.js +2 -4
  3. package/components/cell/GridEditDateCell.js +1 -20
  4. package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  5. package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  6. package/components/panel/filterPanel/GridFilterForm.js +2 -2
  7. package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  8. package/hooks/features/editing/useGridCellEditing.js +8 -21
  9. package/hooks/features/editing/useGridRowEditing.js +7 -21
  10. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  11. package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  12. package/index.js +1 -1
  13. package/internals/index.d.ts +1 -1
  14. package/internals/index.js +1 -1
  15. package/legacy/components/GridRow.js +2 -4
  16. package/legacy/components/cell/GridEditDateCell.js +1 -20
  17. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  18. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  19. package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
  20. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  21. package/legacy/hooks/features/editing/useGridCellEditing.js +8 -21
  22. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -23
  23. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  24. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  25. package/legacy/index.js +1 -1
  26. package/legacy/internals/index.js +1 -1
  27. package/legacy/locales/arSD.js +1 -1
  28. package/legacy/locales/bgBG.js +33 -37
  29. package/legacy/locales/csCZ.js +2 -2
  30. package/legacy/locales/heIL.js +1 -2
  31. package/legacy/models/params/gridEditCellParams.js +1 -0
  32. package/legacy/utils/domUtils.js +10 -1
  33. package/locales/arSD.js +1 -1
  34. package/locales/bgBG.js +33 -37
  35. package/locales/csCZ.js +2 -2
  36. package/locales/heIL.js +1 -2
  37. package/models/api/gridEditingApi.d.ts +2 -4
  38. package/models/params/gridEditCellParams.d.ts +3 -1
  39. package/models/params/gridEditCellParams.js +1 -0
  40. package/models/params/gridRowParams.d.ts +1 -0
  41. package/modern/components/GridRow.js +2 -4
  42. package/modern/components/cell/GridEditDateCell.js +1 -20
  43. package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  44. package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  45. package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
  46. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  47. package/modern/hooks/features/editing/useGridCellEditing.js +8 -21
  48. package/modern/hooks/features/editing/useGridRowEditing.js +7 -21
  49. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  50. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  51. package/modern/index.js +1 -1
  52. package/modern/internals/index.js +1 -1
  53. package/modern/locales/arSD.js +1 -1
  54. package/modern/locales/bgBG.js +33 -37
  55. package/modern/locales/csCZ.js +2 -2
  56. package/modern/locales/heIL.js +1 -2
  57. package/modern/models/params/gridEditCellParams.js +1 -0
  58. package/modern/utils/domUtils.js +10 -1
  59. package/node/components/GridRow.js +1 -3
  60. package/node/components/cell/GridEditDateCell.js +1 -20
  61. package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  62. package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  63. package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
  64. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  65. package/node/hooks/features/editing/useGridCellEditing.js +7 -20
  66. package/node/hooks/features/editing/useGridRowEditing.js +6 -20
  67. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  68. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  69. package/node/index.js +1 -1
  70. package/node/internals/index.js +7 -0
  71. package/node/locales/arSD.js +1 -1
  72. package/node/locales/bgBG.js +33 -37
  73. package/node/locales/csCZ.js +2 -2
  74. package/node/locales/heIL.js +1 -2
  75. package/node/models/params/gridEditCellParams.js +1 -0
  76. package/node/utils/domUtils.js +11 -1
  77. package/package.json +1 -1
  78. package/utils/domUtils.d.ts +2 -0
  79. package/utils/domUtils.js +10 -1
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  var _excluded = ["id"],
7
7
  _excluded2 = ["id"];
8
8
  import * as React from 'react';
9
- import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
9
+ import { unstable_useEventCallback as useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
10
10
  import { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';
11
11
  import { GridEditModes, GridRowModes } from '../../../models/gridEditRowModel';
12
12
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
@@ -179,7 +179,6 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
179
179
  var rowParams = apiRef.current.getRowParams(params.id);
180
180
  var _newParams = _extends({}, rowParams, {
181
181
  field: params.field,
182
- key: event.key,
183
182
  reason: _reason
184
183
  });
185
184
  apiRef.current.publishEvent('rowEditStart', _newParams, event);
@@ -189,25 +188,12 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
189
188
  var handleRowEditStart = React.useCallback(function (params) {
190
189
  var id = params.id,
191
190
  field = params.field,
192
- reason = params.reason,
193
- key = params.key,
194
- columns = params.columns;
191
+ reason = params.reason;
195
192
  var startRowEditModeParams = {
196
193
  id: id,
197
194
  fieldToFocus: field
198
195
  };
199
- if (reason === GridRowEditStartReasons.printableKeyDown) {
200
- if (React.version.startsWith('17')) {
201
- // In React 17, cleaning the input is enough.
202
- // The sequence of events makes the key pressed by the end-users update the textbox directly.
203
- startRowEditModeParams.deleteValue = !!field;
204
- } else {
205
- var colDef = columns.find(function (col) {
206
- return col.field === field;
207
- });
208
- startRowEditModeParams.initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
209
- }
210
- } else if (reason === GridRowEditStartReasons.deleteKeyDown) {
196
+ if (reason === GridRowEditStartReasons.printableKeyDown || reason === GridRowEditStartReasons.deleteKeyDown) {
211
197
  startRowEditModeParams.deleteValue = !!field;
212
198
  }
213
199
  apiRef.current.startRowEditMode(startRowEditModeParams);
@@ -322,17 +308,13 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
322
308
  return acc;
323
309
  }
324
310
  var newValue = apiRef.current.getCellValue(id, field);
325
- // eslint-disable-next-line @typescript-eslint/naming-convention
326
- var unstable_updateValueOnRender = false;
327
311
  if (fieldToFocus === field && (deleteValue || initialValue)) {
328
312
  newValue = deleteValue ? '' : initialValue;
329
- unstable_updateValueOnRender = true;
330
313
  }
331
314
  acc[field] = {
332
315
  value: newValue,
333
316
  error: false,
334
- isProcessingProps: false,
335
- unstable_updateValueOnRender: unstable_updateValueOnRender
317
+ isProcessingProps: false
336
318
  };
337
319
  return acc;
338
320
  }, {});
@@ -559,7 +541,9 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
559
541
  updateRowModesModel(rowModesModelProp);
560
542
  }
561
543
  }, [rowModesModelProp, updateRowModesModel]);
562
- React.useEffect(function () {
544
+
545
+ // Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
546
+ useEnhancedEffect(function () {
563
547
  var idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
564
548
 
565
549
  // Update the ref here because updateStateToStopRowEditMode may change it later
@@ -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) {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.18.1
2
+ * @mui/x-data-grid v6.18.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);
@@ -150,8 +150,8 @@ var csCZGrid = {
150
150
  // Actions cell more text
151
151
  actionsCellMore: 'více',
152
152
  // Column pinning text
153
- pinToLeft: 'Připnout na levo',
154
- pinToRight: 'Připnout na pravo',
153
+ pinToLeft: 'Připnout vlevo',
154
+ pinToRight: 'Připnout vpravo',
155
155
  unpin: 'Odepnout',
156
156
  // Tree Data
157
157
  treeDataGroupingHeaderName: 'Skupina',
@@ -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
  /**
@@ -51,4 +51,13 @@ export var getActiveElement = function getActiveElement() {
51
51
  return getActiveElement(activeEl.shadowRoot);
52
52
  }
53
53
  return activeEl;
54
- };
54
+ };
55
+ export function isEventTargetInPortal(event) {
56
+ if (
57
+ // The target is not an element when triggered by a Select inside the cell
58
+ // See https://github.com/mui/material-ui/issues/10534
59
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
60
+ return true;
61
+ }
62
+ return false;
63
+ }
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/csCZ.js CHANGED
@@ -150,8 +150,8 @@ const csCZGrid = {
150
150
  // Actions cell more text
151
151
  actionsCellMore: 'více',
152
152
  // Column pinning text
153
- pinToLeft: 'Připnout na levo',
154
- pinToRight: 'Připnout na pravo',
153
+ pinToLeft: 'Připnout vlevo',
154
+ pinToRight: 'Připnout vpravo',
155
155
  unpin: 'Odepnout',
156
156
  // Tree Data
157
157
  treeDataGroupingHeaderName: 'Skupina',
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
  }
@@ -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
  }
@@ -13,7 +13,7 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
13
13
  import { gridColumnsTotalWidthSelector } from '../hooks/features/columns/gridColumnsSelector';
14
14
  import { useGridSelector, objectShallowCompare } from '../hooks/utils/useGridSelector';
15
15
  import { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
16
- import { findParentElementFromClassName } from '../utils/domUtils';
16
+ import { findParentElementFromClassName, isEventTargetInPortal } from '../utils/domUtils';
17
17
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
18
18
  import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
19
19
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
@@ -137,9 +137,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
137
137
  }, [apiRef, currentPage.range, index, rowHeight, rowId, position]);
138
138
  const publish = React.useCallback((eventName, propHandler) => event => {
139
139
  // Ignore portal
140
- // The target is not an element when triggered by a Select inside the cell
141
- // See https://github.com/mui/material-ui/issues/10534
142
- if (event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
140
+ if (isEventTargetInPortal(event)) {
143
141
  return;
144
142
  }
145
143
 
@@ -63,7 +63,6 @@ function GridEditDateCell(props) {
63
63
  classes: rootProps.classes
64
64
  };
65
65
  const classes = useUtilityClasses(ownerState);
66
- const hasUpdatedEditValueOnMount = React.useRef(false);
67
66
  const parseValueToDate = React.useCallback(value => {
68
67
  if (value === '') {
69
68
  return null;
@@ -108,26 +107,8 @@ function GridEditDateCell(props) {
108
107
  inputRef.current.focus();
109
108
  }
110
109
  }, [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
- };
129
110
  return /*#__PURE__*/_jsx(StyledInputBase, _extends({
130
- inputRef: handleInputRef,
111
+ inputRef: inputRef,
131
112
  fullWidth: true,
132
113
  className: classes.root,
133
114
  type: isDateTime ? 'datetime-local' : 'date',
@@ -7,6 +7,7 @@ import { gridColumnGroupsLookupSelector } from '../../hooks/features/columnGroup
7
7
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
8
8
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
9
9
  import { GridGenericColumnHeaderItem } from './GridGenericColumnHeaderItem';
10
+ import { isEventTargetInPortal } from '../../utils/domUtils';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const useUtilityClasses = ownerState => {
12
13
  const {
@@ -84,7 +85,7 @@ function GridColumnGroupHeader(props) {
84
85
  const publish = React.useCallback(eventName => event => {
85
86
  // Ignore portal
86
87
  // See https://github.com/mui/mui-x/issues/1721
87
- if (!event.currentTarget.contains(event.target)) {
88
+ if (isEventTargetInPortal(event)) {
88
89
  return;
89
90
  }
90
91
  apiRef.current.publishEvent(eventName, renderParams, event);
@@ -9,6 +9,7 @@ import { GridColumnHeaderMenu } from '../menu/columnMenu/GridColumnHeaderMenu';
9
9
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
10
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
11
11
  import { GridGenericColumnHeaderItem } from './GridGenericColumnHeaderItem';
12
+ import { isEventTargetInPortal } from '../../utils/domUtils';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const useUtilityClasses = ownerState => {
@@ -67,7 +68,7 @@ function GridColumnHeaderItem(props) {
67
68
  const publish = React.useCallback(eventName => event => {
68
69
  // Ignore portal
69
70
  // See https://github.com/mui/mui-x/issues/1721
70
- if (!event.currentTarget.contains(event.target)) {
71
+ if (isEventTargetInPortal(event)) {
71
72
  return;
72
73
  }
73
74
  apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(colDef.field), event);
@@ -176,8 +176,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
176
176
  // try to keep the same operator when column change
177
177
  const newOperator = column.filterOperators.find(operator => operator.value === item.operator) || column.filterOperators[0];
178
178
 
179
- // Erase filter value if the input component is modified
180
- const eraseItemValue = !newOperator.InputComponent || newOperator.InputComponent !== currentOperator?.InputComponent;
179
+ // Erase filter value if the input component or filtered column type is modified
180
+ const eraseItemValue = !newOperator.InputComponent || newOperator.InputComponent !== currentOperator?.InputComponent || column.type !== currentColumn.type;
181
181
  applyFilterChanges(_extends({}, item, {
182
182
  field,
183
183
  operator: newOperator.value,
@@ -42,7 +42,7 @@ function GridFilterInputValue(props) {
42
42
  }, [id, applyValue, item, rootProps.filterDebounceMs, filterTimeout]);
43
43
  React.useEffect(() => {
44
44
  const itemPlusTag = item;
45
- if (itemPlusTag.fromInput !== id) {
45
+ if (itemPlusTag.fromInput !== id || item.value === undefined) {
46
46
  setFilterValueState(String(item.value ?? ''));
47
47
  }
48
48
  }, [id, item]);