@mui/x-data-grid 6.18.0 → 6.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +116 -5
  2. package/colDef/gridStringOperators.js +6 -1
  3. package/components/cell/GridActionsCell.js +19 -12
  4. package/components/cell/GridCell.js +4 -4
  5. package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
  6. package/hooks/features/filter/gridFilterUtils.js +10 -7
  7. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  8. package/hooks/features/filter/useGridFilter.js +2 -1
  9. package/index.js +1 -1
  10. package/internals/index.d.ts +1 -0
  11. package/internals/index.js +1 -0
  12. package/internals/utils/computeSlots.js +8 -1
  13. package/legacy/colDef/gridStringOperators.js +6 -1
  14. package/legacy/components/cell/GridActionsCell.js +21 -12
  15. package/legacy/components/cell/GridCell.js +6 -4
  16. package/legacy/hooks/features/filter/gridFilterUtils.js +10 -7
  17. package/legacy/hooks/features/filter/useGridFilter.js +2 -1
  18. package/legacy/index.js +1 -1
  19. package/legacy/internals/index.js +1 -0
  20. package/legacy/internals/utils/computeSlots.js +8 -1
  21. package/legacy/locales/arSD.js +1 -1
  22. package/legacy/locales/csCZ.js +2 -2
  23. package/legacy/locales/heIL.js +1 -2
  24. package/legacy/utils/getPublicApiRef.js +5 -0
  25. package/locales/arSD.js +1 -1
  26. package/locales/csCZ.js +2 -2
  27. package/locales/heIL.js +1 -2
  28. package/models/api/gridFilterApi.d.ts +5 -0
  29. package/modern/colDef/gridStringOperators.js +6 -1
  30. package/modern/components/cell/GridActionsCell.js +18 -12
  31. package/modern/components/cell/GridCell.js +3 -3
  32. package/modern/hooks/features/filter/gridFilterUtils.js +10 -7
  33. package/modern/hooks/features/filter/useGridFilter.js +2 -1
  34. package/modern/index.js +1 -1
  35. package/modern/internals/index.js +1 -0
  36. package/modern/internals/utils/computeSlots.js +8 -1
  37. package/modern/locales/arSD.js +1 -1
  38. package/modern/locales/csCZ.js +2 -2
  39. package/modern/locales/heIL.js +1 -2
  40. package/modern/utils/getPublicApiRef.js +5 -0
  41. package/node/colDef/gridStringOperators.js +6 -1
  42. package/node/components/cell/GridActionsCell.js +18 -12
  43. package/node/components/cell/GridCell.js +3 -3
  44. package/node/hooks/features/filter/gridFilterUtils.js +11 -7
  45. package/node/hooks/features/filter/useGridFilter.js +2 -1
  46. package/node/index.js +1 -1
  47. package/node/internals/index.js +12 -0
  48. package/node/internals/utils/computeSlots.js +8 -1
  49. package/node/locales/arSD.js +1 -1
  50. package/node/locales/csCZ.js +2 -2
  51. package/node/locales/heIL.js +1 -2
  52. package/node/utils/getPublicApiRef.js +11 -0
  53. package/package.json +1 -1
  54. package/utils/getPublicApiRef.d.ts +3 -0
  55. package/utils/getPublicApiRef.js +5 -0
@@ -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: 'הרחב',
@@ -0,0 +1,5 @@
1
+ export function getPublicApiRef(apiRef) {
2
+ return {
3
+ current: apiRef.current.getPublicApi()
4
+ };
5
+ }
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/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: 'הרחב',
@@ -1,6 +1,7 @@
1
1
  import { GridFilterModel } from '../gridFilterModel';
2
2
  import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
3
3
  import { GridControlledStateReasonLookup } from '../events';
4
+ import { DataGridProcessedProps } from '../props/DataGridProps';
4
5
  /**
5
6
  * The filter API interface that is available in the grid [[apiRef]].
6
7
  */
@@ -52,4 +53,8 @@ export interface GridFilterApi {
52
53
  * @param {any[]} values The list of element to quick filter
53
54
  */
54
55
  setQuickFilterValues: (values: any[]) => void;
56
+ /**
57
+ * Returns the value of the `ignoreDiacritics` prop.
58
+ */
59
+ ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
55
60
  }
@@ -2,12 +2,17 @@ import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilter
2
2
  import { escapeRegExp } from '../utils/utils';
3
3
  import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
4
4
  import { convertLegacyOperators, tagInternalFilter } from './utils';
5
+ import { removeDiacritics } from '../hooks/features/filter/gridFilterUtils';
5
6
  export const getGridStringQuickFilterFn = tagInternalFilter(value => {
6
7
  if (!value) {
7
8
  return null;
8
9
  }
9
10
  const filterRegex = new RegExp(escapeRegExp(value), 'i');
10
- return columnValue => {
11
+ return (_, row, column, apiRef) => {
12
+ let columnValue = apiRef.current.getRowFormattedValue(row, column);
13
+ if (apiRef.current.ignoreDiacritics) {
14
+ columnValue = removeDiacritics(columnValue);
15
+ }
11
16
  return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
12
17
  };
13
18
  });
@@ -72,10 +72,12 @@ function GridActionsCell(props) {
72
72
  focus() {
73
73
  // If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set
74
74
  if (!ignoreCallToFocus.current) {
75
- setFocusedButtonIndex(0);
75
+ // find the first focusable button and pass the index to the state
76
+ const focusableButtonIndex = options.findIndex(o => !o.props.disabled);
77
+ setFocusedButtonIndex(focusableButtonIndex);
76
78
  }
77
79
  }
78
- }), []);
80
+ }), [options]);
79
81
  React.useEffect(() => {
80
82
  if (focusedButtonIndex >= numberOfButtons) {
81
83
  setFocusedButtonIndex(numberOfButtons - 1);
@@ -103,19 +105,23 @@ function GridActionsCell(props) {
103
105
  if (numberOfButtons <= 1) {
104
106
  return;
105
107
  }
108
+ const getNewIndex = (index, direction) => {
109
+ if (index < 0 || index > options.length) {
110
+ return index;
111
+ }
112
+
113
+ // for rtl mode we need to reverse the direction
114
+ const rtlMod = theme.direction === 'rtl' ? -1 : 1;
115
+ const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
116
+
117
+ // if the button that should receive focus is disabled go one more step
118
+ return options[index + indexMod]?.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
119
+ };
106
120
  let newIndex = focusedButtonIndex;
107
121
  if (event.key === 'ArrowRight') {
108
- if (theme.direction === 'rtl') {
109
- newIndex -= 1;
110
- } else {
111
- newIndex += 1;
112
- }
122
+ newIndex = getNewIndex(focusedButtonIndex, 'right');
113
123
  } else if (event.key === 'ArrowLeft') {
114
- if (theme.direction === 'rtl') {
115
- newIndex += 1;
116
- } else {
117
- newIndex -= 1;
118
- }
124
+ newIndex = getNewIndex(focusedButtonIndex, 'left');
119
125
  }
120
126
  if (newIndex < 0 || newIndex >= numberOfButtons) {
121
127
  return; // We're already in the first or last item = do nothing and let the grid listen the event
@@ -439,8 +439,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
439
439
  value,
440
440
  formattedValue
441
441
  } = cellParamsWithAPI;
442
- const managesOwnFocus = column.type === 'actions';
443
- const tabIndex = (cellMode === 'view' || !isEditable) && !managesOwnFocus ? cellParamsWithAPI.tabIndex : -1;
442
+ const canManageOwnFocus = column.type === 'actions' && column.getActions?.(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
443
+ const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParamsWithAPI.tabIndex : -1;
444
444
  const {
445
445
  classes: rootClasses,
446
446
  getCellClassName
@@ -578,7 +578,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
578
578
  children: valueString
579
579
  });
580
580
  }
581
- if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
581
+ if ( /*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {
582
582
  children = /*#__PURE__*/React.cloneElement(children, {
583
583
  focusElementRef
584
584
  });
@@ -3,6 +3,7 @@ import { GridLogicOperator } from '../../../models';
3
3
  import { GLOBAL_API_REF, isInternalFilter } from '../../../colDef/utils';
4
4
  import { getDefaultGridFilterModel } from './gridFilterState';
5
5
  import { buildWarning } from '../../../utils/warning';
6
+ import { getPublicApiRef } from '../../../utils/getPublicApiRef';
6
7
  import { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from '../columns';
7
8
 
8
9
  // Fixes https://github.com/mui/mui-x/issues/10056
@@ -69,7 +70,7 @@ export const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiR
69
70
  export const mergeStateWithFilterModel = (filterModel, disableMultipleColumnsFiltering, apiRef) => filteringState => _extends({}, filteringState, {
70
71
  filterModel: sanitizeFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef)
71
72
  });
72
- const removeDiacritics = value => {
73
+ export const removeDiacritics = value => {
73
74
  if (typeof value === 'string') {
74
75
  return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
75
76
  }
@@ -109,6 +110,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
109
110
  }
110
111
  const hasUserFunctionLegacy = !isInternalFilter(filterOperator.getApplyFilterFn);
111
112
  const hasUserFunctionV7 = !isInternalFilter(filterOperator.getApplyFilterFnV7);
113
+ const publicApiRef = getPublicApiRef(apiRef);
112
114
  if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
113
115
  const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
114
116
  if (typeof applyFilterOnRow !== 'function') {
@@ -122,7 +124,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
122
124
  if (ignoreDiacritics) {
123
125
  value = removeDiacritics(value);
124
126
  }
125
- return applyFilterOnRow(value, row, column, apiRef);
127
+ return applyFilterOnRow(value, row, column, publicApiRef);
126
128
  }
127
129
  };
128
130
  }
@@ -135,7 +137,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
135
137
  item: newFilterItem,
136
138
  fn: rowId => {
137
139
  const params = apiRef.current.getCellParams(rowId, newFilterItem.field);
138
- GLOBAL_API_REF.current = apiRef;
140
+ GLOBAL_API_REF.current = publicApiRef;
139
141
  if (ignoreDiacritics) {
140
142
  params.value = removeDiacritics(params.value);
141
143
  }
@@ -214,6 +216,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
214
216
  const {
215
217
  ignoreDiacritics
216
218
  } = apiRef.current.rootProps;
219
+ const publicApiRef = getPublicApiRef(apiRef);
217
220
  columnFields.forEach(field => {
218
221
  const column = apiRef.current.getColumn(field);
219
222
  const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
@@ -227,7 +230,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
227
230
  const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
228
231
  return {
229
232
  v7: true,
230
- fn: getApplyQuickFilterFnV7(value, column, apiRef)
233
+ fn: getApplyQuickFilterFnV7(value, column, publicApiRef)
231
234
  };
232
235
  })
233
236
  });
@@ -238,7 +241,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
238
241
  const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
239
242
  return {
240
243
  v7: false,
241
- fn: getApplyQuickFilterFn(value, column, apiRef)
244
+ fn: getApplyQuickFilterFn(value, column, publicApiRef)
242
245
  };
243
246
  })
244
247
  });
@@ -263,7 +266,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
263
266
  continue;
264
267
  }
265
268
  const applier = appliers[v];
266
- let value = apiRef.current.getRowFormattedValue(row, column);
269
+ let value = apiRef.current.getRowValue(row, column);
267
270
  if (applier.fn === null) {
268
271
  continue;
269
272
  }
@@ -271,7 +274,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
271
274
  if (ignoreDiacritics) {
272
275
  value = removeDiacritics(value);
273
276
  }
274
- const isMatching = applier.fn(value, row, column, apiRef);
277
+ const isMatching = applier.fn(value, row, column, publicApiRef);
275
278
  if (isMatching) {
276
279
  result[filterValue] = true;
277
280
  continue outer;
@@ -212,7 +212,8 @@ export const useGridFilter = (apiRef, props) => {
212
212
  setFilterModel,
213
213
  showFilterPanel,
214
214
  hideFilterPanel,
215
- setQuickFilterValues
215
+ setQuickFilterValues,
216
+ ignoreDiacritics: props.ignoreDiacritics
216
217
  };
217
218
  useGridApiMethod(apiRef, filterApi, 'public');
218
219
 
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.18.0
2
+ * @mui/x-data-grid v6.18.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -59,6 +59,7 @@ export { isNavigationKey } from '../utils/keyboardUtils';
59
59
  export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
60
60
  export { buildWarning } from '../utils/warning';
61
61
  export { exportAs } from '../utils/exportAs';
62
+ export * from '../utils/getPublicApiRef';
62
63
  export { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
63
64
  export * from '../hooks/utils/useOnMount';
64
65
  export { serializeCellValue } from '../hooks/features/export/serializers/csvSerializer';
@@ -13,5 +13,12 @@ export function computeSlots({
13
13
  if (!overrides || Object.keys(overrides).length === 0) {
14
14
  return defaultSlots;
15
15
  }
16
- return _extends({}, defaultSlots, overrides);
16
+ const result = _extends({}, defaultSlots);
17
+ Object.keys(overrides).forEach(key => {
18
+ const k = key;
19
+ if (overrides[k] !== undefined) {
20
+ result[k] = overrides[k];
21
+ }
22
+ });
23
+ return result;
17
24
  }
@@ -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: 'الغاء الفرز',
@@ -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',
@@ -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: 'הרחב',
@@ -0,0 +1,5 @@
1
+ export function getPublicApiRef(apiRef) {
2
+ return {
3
+ current: apiRef.current.getPublicApi()
4
+ };
5
+ }
@@ -8,12 +8,17 @@ var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterI
8
8
  var _utils = require("../utils/utils");
9
9
  var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
10
10
  var _utils2 = require("./utils");
11
+ var _gridFilterUtils = require("../hooks/features/filter/gridFilterUtils");
11
12
  const getGridStringQuickFilterFn = exports.getGridStringQuickFilterFn = (0, _utils2.tagInternalFilter)(value => {
12
13
  if (!value) {
13
14
  return null;
14
15
  }
15
16
  const filterRegex = new RegExp((0, _utils.escapeRegExp)(value), 'i');
16
- return columnValue => {
17
+ return (_, row, column, apiRef) => {
18
+ let columnValue = apiRef.current.getRowFormattedValue(row, column);
19
+ if (apiRef.current.ignoreDiacritics) {
20
+ columnValue = (0, _gridFilterUtils.removeDiacritics)(columnValue);
21
+ }
17
22
  return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
18
23
  };
19
24
  });
@@ -81,10 +81,12 @@ function GridActionsCell(props) {
81
81
  focus() {
82
82
  // If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set
83
83
  if (!ignoreCallToFocus.current) {
84
- setFocusedButtonIndex(0);
84
+ // find the first focusable button and pass the index to the state
85
+ const focusableButtonIndex = options.findIndex(o => !o.props.disabled);
86
+ setFocusedButtonIndex(focusableButtonIndex);
85
87
  }
86
88
  }
87
- }), []);
89
+ }), [options]);
88
90
  React.useEffect(() => {
89
91
  if (focusedButtonIndex >= numberOfButtons) {
90
92
  setFocusedButtonIndex(numberOfButtons - 1);
@@ -112,19 +114,23 @@ function GridActionsCell(props) {
112
114
  if (numberOfButtons <= 1) {
113
115
  return;
114
116
  }
117
+ const getNewIndex = (index, direction) => {
118
+ if (index < 0 || index > options.length) {
119
+ return index;
120
+ }
121
+
122
+ // for rtl mode we need to reverse the direction
123
+ const rtlMod = theme.direction === 'rtl' ? -1 : 1;
124
+ const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
125
+
126
+ // if the button that should receive focus is disabled go one more step
127
+ return options[index + indexMod]?.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
128
+ };
115
129
  let newIndex = focusedButtonIndex;
116
130
  if (event.key === 'ArrowRight') {
117
- if (theme.direction === 'rtl') {
118
- newIndex -= 1;
119
- } else {
120
- newIndex += 1;
121
- }
131
+ newIndex = getNewIndex(focusedButtonIndex, 'right');
122
132
  } else if (event.key === 'ArrowLeft') {
123
- if (theme.direction === 'rtl') {
124
- newIndex += 1;
125
- } else {
126
- newIndex -= 1;
127
- }
133
+ newIndex = getNewIndex(focusedButtonIndex, 'left');
128
134
  }
129
135
  if (newIndex < 0 || newIndex >= numberOfButtons) {
130
136
  return; // We're already in the first or last item = do nothing and let the grid listen the event
@@ -447,8 +447,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
447
447
  value,
448
448
  formattedValue
449
449
  } = cellParamsWithAPI;
450
- const managesOwnFocus = column.type === 'actions';
451
- const tabIndex = (cellMode === 'view' || !isEditable) && !managesOwnFocus ? cellParamsWithAPI.tabIndex : -1;
450
+ const canManageOwnFocus = column.type === 'actions' && column.getActions?.(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
451
+ const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParamsWithAPI.tabIndex : -1;
452
452
  const {
453
453
  classes: rootClasses,
454
454
  getCellClassName
@@ -586,7 +586,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
586
586
  children: valueString
587
587
  });
588
588
  }
589
- if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
589
+ if ( /*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {
590
590
  children = /*#__PURE__*/React.cloneElement(children, {
591
591
  focusElementRef
592
592
  });
@@ -4,12 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.sanitizeFilterModel = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
7
+ exports.sanitizeFilterModel = exports.removeDiacritics = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _models = require("../../../models");
10
10
  var _utils = require("../../../colDef/utils");
11
11
  var _gridFilterState = require("./gridFilterState");
12
12
  var _warning = require("../../../utils/warning");
13
+ var _getPublicApiRef = require("../../../utils/getPublicApiRef");
13
14
  var _columns = require("../columns");
14
15
  // Fixes https://github.com/mui/mui-x/issues/10056
15
16
  const globalScope = typeof window === 'undefined' ? globalThis : window;
@@ -84,6 +85,7 @@ const removeDiacritics = value => {
84
85
  }
85
86
  return value;
86
87
  };
88
+ exports.removeDiacritics = removeDiacritics;
87
89
  const getFilterCallbackFromItem = (filterItem, apiRef) => {
88
90
  if (!filterItem.field || !filterItem.operator) {
89
91
  return null;
@@ -118,6 +120,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
118
120
  }
119
121
  const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFn);
120
122
  const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFnV7);
123
+ const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
121
124
  if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
122
125
  const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
123
126
  if (typeof applyFilterOnRow !== 'function') {
@@ -131,7 +134,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
131
134
  if (ignoreDiacritics) {
132
135
  value = removeDiacritics(value);
133
136
  }
134
- return applyFilterOnRow(value, row, column, apiRef);
137
+ return applyFilterOnRow(value, row, column, publicApiRef);
135
138
  }
136
139
  };
137
140
  }
@@ -144,7 +147,7 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
144
147
  item: newFilterItem,
145
148
  fn: rowId => {
146
149
  const params = apiRef.current.getCellParams(rowId, newFilterItem.field);
147
- _utils.GLOBAL_API_REF.current = apiRef;
150
+ _utils.GLOBAL_API_REF.current = publicApiRef;
148
151
  if (ignoreDiacritics) {
149
152
  params.value = removeDiacritics(params.value);
150
153
  }
@@ -223,6 +226,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
223
226
  const {
224
227
  ignoreDiacritics
225
228
  } = apiRef.current.rootProps;
229
+ const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
226
230
  columnFields.forEach(field => {
227
231
  const column = apiRef.current.getColumn(field);
228
232
  const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
@@ -236,7 +240,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
236
240
  const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
237
241
  return {
238
242
  v7: true,
239
- fn: getApplyQuickFilterFnV7(value, column, apiRef)
243
+ fn: getApplyQuickFilterFnV7(value, column, publicApiRef)
240
244
  };
241
245
  })
242
246
  });
@@ -247,7 +251,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
247
251
  const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
248
252
  return {
249
253
  v7: false,
250
- fn: getApplyQuickFilterFn(value, column, apiRef)
254
+ fn: getApplyQuickFilterFn(value, column, publicApiRef)
251
255
  };
252
256
  })
253
257
  });
@@ -272,7 +276,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
272
276
  continue;
273
277
  }
274
278
  const applier = appliers[v];
275
- let value = apiRef.current.getRowFormattedValue(row, column);
279
+ let value = apiRef.current.getRowValue(row, column);
276
280
  if (applier.fn === null) {
277
281
  continue;
278
282
  }
@@ -280,7 +284,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
280
284
  if (ignoreDiacritics) {
281
285
  value = removeDiacritics(value);
282
286
  }
283
- const isMatching = applier.fn(value, row, column, apiRef);
287
+ const isMatching = applier.fn(value, row, column, publicApiRef);
284
288
  if (isMatching) {
285
289
  result[filterValue] = true;
286
290
  continue outer;
@@ -222,7 +222,8 @@ const useGridFilter = (apiRef, props) => {
222
222
  setFilterModel,
223
223
  showFilterPanel,
224
224
  hideFilterPanel,
225
- setQuickFilterValues
225
+ setQuickFilterValues,
226
+ ignoreDiacritics: props.ignoreDiacritics
226
227
  };
227
228
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, filterApi, 'public');
228
229
 
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.18.0
2
+ * @mui/x-data-grid v6.18.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -716,6 +716,18 @@ var _keyboardUtils = require("../utils/keyboardUtils");
716
716
  var _utils2 = require("../utils/utils");
717
717
  var _warning = require("../utils/warning");
718
718
  var _exportAs = require("../utils/exportAs");
719
+ var _getPublicApiRef = require("../utils/getPublicApiRef");
720
+ Object.keys(_getPublicApiRef).forEach(function (key) {
721
+ if (key === "default" || key === "__esModule") return;
722
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
723
+ if (key in exports && exports[key] === _getPublicApiRef[key]) return;
724
+ Object.defineProperty(exports, key, {
725
+ enumerable: true,
726
+ get: function () {
727
+ return _getPublicApiRef[key];
728
+ }
729
+ });
730
+ });
719
731
  var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
720
732
  var _useOnMount = require("../hooks/utils/useOnMount");
721
733
  Object.keys(_useOnMount).forEach(function (key) {
@@ -19,5 +19,12 @@ function computeSlots({
19
19
  if (!overrides || Object.keys(overrides).length === 0) {
20
20
  return defaultSlots;
21
21
  }
22
- return (0, _extends2.default)({}, defaultSlots, overrides);
22
+ const result = (0, _extends2.default)({}, defaultSlots);
23
+ Object.keys(overrides).forEach(key => {
24
+ const k = key;
25
+ if (overrides[k] !== undefined) {
26
+ result[k] = overrides[k];
27
+ }
28
+ });
29
+ return result;
23
30
  }
@@ -99,7 +99,7 @@ const arSDGrid = {
99
99
  // Column menu text
100
100
  columnMenuLabel: 'القائمة',
101
101
  columnMenuShowColumns: 'إظهار الأعمدة',
102
- // columnMenuManageColumns: 'Manage columns',
102
+ columnMenuManageColumns: 'إدارة الأعمدة',
103
103
  columnMenuFilter: 'المرشِح',
104
104
  columnMenuHideColumn: 'إخفاء',
105
105
  columnMenuUnsort: 'الغاء الفرز',
@@ -156,8 +156,8 @@ const csCZGrid = {
156
156
  // Actions cell more text
157
157
  actionsCellMore: 'více',
158
158
  // Column pinning text
159
- pinToLeft: 'Připnout na levo',
160
- pinToRight: 'Připnout na pravo',
159
+ pinToLeft: 'Připnout vlevo',
160
+ pinToRight: 'Připnout vpravo',
161
161
  unpin: 'Odepnout',
162
162
  // Tree Data
163
163
  treeDataGroupingHeaderName: 'Skupina',
@@ -130,8 +130,7 @@ const heILGrid = {
130
130
  // Column pinning text
131
131
  pinToLeft: 'נעץ משמאל',
132
132
  pinToRight: 'נעץ מימין',
133
- // unpin: 'Unpin',
134
-
133
+ unpin: 'הסר נעיצה',
135
134
  // Tree Data
136
135
  treeDataGroupingHeaderName: 'קבוצה',
137
136
  treeDataExpand: 'הרחב',
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPublicApiRef = getPublicApiRef;
7
+ function getPublicApiRef(apiRef) {
8
+ return {
9
+ current: apiRef.current.getPublicApi()
10
+ };
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.18.0",
3
+ "version": "6.18.2",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
3
+ export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: React.MutableRefObject<PrivateApi>): import("react").MutableRefObject<ReturnType<PrivateApi["getPublicApi"]>>;
@@ -0,0 +1,5 @@
1
+ export function getPublicApiRef(apiRef) {
2
+ return {
3
+ current: apiRef.current.getPublicApi()
4
+ };
5
+ }