@mui/x-data-grid 7.6.2 → 7.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/components/columnHeaders/GridColumnGroupHeader.js +1 -1
  3. package/hooks/features/filter/gridFilterUtils.js +1 -3
  4. package/hooks/features/filter/useGridFilter.js +16 -8
  5. package/hooks/features/rows/useGridRowsMeta.js +1 -1
  6. package/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
  7. package/index.js +1 -1
  8. package/locales/beBY.js +8 -8
  9. package/locales/faIR.js +1 -2
  10. package/locales/ptBR.js +1 -2
  11. package/locales/ruRU.js +26 -30
  12. package/locales/ukUA.js +6 -5
  13. package/models/api/gridFilterApi.d.ts +7 -0
  14. package/modern/components/columnHeaders/GridColumnGroupHeader.js +1 -1
  15. package/modern/hooks/features/filter/gridFilterUtils.js +1 -3
  16. package/modern/hooks/features/filter/useGridFilter.js +16 -8
  17. package/modern/hooks/features/rows/useGridRowsMeta.js +1 -1
  18. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
  19. package/modern/index.js +1 -1
  20. package/modern/locales/beBY.js +8 -8
  21. package/modern/locales/faIR.js +1 -2
  22. package/modern/locales/ptBR.js +1 -2
  23. package/modern/locales/ruRU.js +26 -30
  24. package/modern/locales/ukUA.js +6 -5
  25. package/modern/utils/fastObjectShallowCompare.js +0 -4
  26. package/node/components/columnHeaders/GridColumnGroupHeader.js +1 -1
  27. package/node/hooks/features/filter/gridFilterUtils.js +1 -3
  28. package/node/hooks/features/filter/useGridFilter.js +16 -8
  29. package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
  30. package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
  31. package/node/index.js +1 -1
  32. package/node/locales/beBY.js +8 -8
  33. package/node/locales/faIR.js +1 -2
  34. package/node/locales/ptBR.js +1 -2
  35. package/node/locales/ruRU.js +26 -30
  36. package/node/locales/ukUA.js +6 -5
  37. package/node/utils/fastObjectShallowCompare.js +0 -4
  38. package/package.json +2 -2
  39. package/utils/fastObjectShallowCompare.js +0 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,87 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.7.0
7
+
8
+ _Jun 13, 2024_
9
+
10
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Allow customization of the Pickers month and the year buttons
13
+ - 🌍 Improve Persian (fa-IR), Portuguese (pt-PT), and Russian (ru-RU) locales on the Data Grid
14
+ - 🌍 Improve Korean (ko-KR) and Persian (fa-IR) locales on the Date and Time Pickers
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@7.7.0`
23
+
24
+ - [DataGrid] Add `getFilterState` method (#13418) @cherniavskii
25
+ - [DataGrid] Do not show resize separators for column groups (#13455) @cherniavskii
26
+ - [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
27
+ - [l10n] Improve Portuguese (pt-PT) locale (#13384) @olavocarvalho
28
+ - [l10n] Improve Russian (ru-RU) locale (#11210) @dastan-akhmetov-scity
29
+
30
+ #### `@mui/x-data-grid-pro@7.7.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@7.7.0`, plus:
33
+
34
+ - [DataGridPro] Do not render detail panel if the focused cell is not visible (#13456) @cherniavskii
35
+
36
+ #### `@mui/x-data-grid-premium@7.7.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@7.7.0`.
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@7.7.0`
43
+
44
+ - [l10n] Improve Korean (ko-KR) locale (#13452) @ryxxn
45
+ - [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
46
+ - [pickers] Allow to customize the month and the year buttons (#13321) @flaviendelangle
47
+
48
+ #### `@mui/x-date-pickers-pro@7.7.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-date-pickers@7.7.0`.
51
+
52
+ ### Charts
53
+
54
+ #### `@mui/x-charts@7.7.0`
55
+
56
+ - [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
57
+ - [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
58
+ - [charts] Fix eslint for react compiler (#13444) @alexfauquette
59
+ - [charts] Improve themeAugmentation typing (#13433) @noraleonte
60
+ - [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
61
+ - [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
62
+
63
+ ### Tree View
64
+
65
+ #### `@mui/x-tree-view@7.7.0`
66
+
67
+ - [TreeView] Improve TypeScript for plugins (#13380) @flaviendelangle
68
+ - [TreeView] Improve the typing of the cancelable events (#13152) @flaviendelangle
69
+ - [TreeView] Prepare support for PigmentCSS (#13412) @flaviendelangle
70
+ - [TreeView] Refactor the tree view internals to prepare for headless API (#13311) @flaviendelangle
71
+
72
+ ### Docs
73
+
74
+ - [docs] Add `renderHeader` recipe to the Master Details docs (#13370) @michelengelen
75
+ - [docs] Add lazy loading detail panel demo (#13453) @cherniavskii
76
+ - [docs] Add small edits to the Data Grid overview page (#13060) @danilo-leal
77
+ - [docs] Update a11y pages description (#13417) @danilo-leal
78
+ - [docs] improve the writing on the "Quick filter outside of the grid" example (#13155) @michelengelen
79
+
80
+ ### Core
81
+
82
+ - [core] Add `eslint-plugin-react-compiler` experimental version and rules (#13415) @JCQuintas
83
+ - [core] Minor setup cleanup (#13467) @LukasTy
84
+ - [infra] Adjust CI setup (#13448) @LukasTy
85
+ - [test] Add tests for the custom slots of `TreeItem2` (#13314) @flaviendelangle
86
+
6
87
  ## 7.6.2
7
88
 
8
89
  _Jun 6, 2024_
@@ -127,7 +127,7 @@ function GridColumnGroupHeader(props) {
127
127
  width: width,
128
128
  columnMenuIconButton: null,
129
129
  columnTitleIconButtons: null,
130
- resizable: true,
130
+ resizable: false,
131
131
  label: label,
132
132
  "aria-colspan": fields.length
133
133
  // The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
@@ -210,7 +210,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
210
210
  return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
211
211
  const result = {};
212
212
 
213
- /* eslint-disable no-restricted-syntax, no-labels */
213
+ /* eslint-disable no-labels */
214
214
  outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
215
215
  const filterValue = quickFilterValues[v];
216
216
  for (let i = 0; i < appliersPerField.length; i += 1) {
@@ -240,8 +240,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
240
240
  }
241
241
  result[filterValue] = false;
242
242
  }
243
- /* eslint-enable no-restricted-syntax, no-labels */
244
-
245
243
  return result;
246
244
  };
247
245
  };
@@ -59,13 +59,9 @@ export const useGridFilter = (apiRef, props) => {
59
59
  const updateFilteredRows = React.useCallback(() => {
60
60
  apiRef.current.setState(state => {
61
61
  const filterModel = gridFilterModelSelector(state, apiRef.current.instanceId);
62
- const isRowMatchingFilters = props.filterMode === 'client' ? buildAggregatedFilterApplier(filterModel, apiRef, props.disableEval) : null;
63
- const filteringResult = apiRef.current.applyStrategyProcessor('filtering', {
64
- isRowMatchingFilters,
65
- filterModel: filterModel ?? getDefaultGridFilterModel()
66
- });
62
+ const filterState = apiRef.current.getFilterState(filterModel);
67
63
  const newState = _extends({}, state, {
68
- filter: _extends({}, state.filter, filteringResult)
64
+ filter: _extends({}, state.filter, filterState)
69
65
  });
70
66
  const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
71
67
  return _extends({}, newState, {
@@ -73,7 +69,7 @@ export const useGridFilter = (apiRef, props) => {
73
69
  });
74
70
  });
75
71
  apiRef.current.publishEvent('filteredRowsSet');
76
- }, [apiRef, props.filterMode, props.disableEval]);
72
+ }, [apiRef]);
77
73
  const addColumnMenuItem = React.useCallback((columnMenuItems, colDef) => {
78
74
  if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
79
75
  return columnMenuItems;
@@ -203,6 +199,17 @@ export const useGridFilter = (apiRef, props) => {
203
199
  apiRef.current.unstable_applyFilters();
204
200
  }
205
201
  }, [apiRef, logger, props.disableMultipleColumnsFiltering]);
202
+ const getFilterState = React.useCallback(inputFilterModel => {
203
+ const filterModel = sanitizeFilterModel(inputFilterModel, props.disableMultipleColumnsFiltering, apiRef);
204
+ const isRowMatchingFilters = props.filterMode === 'client' ? buildAggregatedFilterApplier(filterModel, apiRef, props.disableEval) : null;
205
+ const filterResult = apiRef.current.applyStrategyProcessor('filtering', {
206
+ isRowMatchingFilters,
207
+ filterModel: filterModel ?? getDefaultGridFilterModel()
208
+ });
209
+ return _extends({}, filterResult, {
210
+ filterModel
211
+ });
212
+ }, [props.disableMultipleColumnsFiltering, props.filterMode, props.disableEval, apiRef]);
206
213
  const filterApi = {
207
214
  setFilterLogicOperator,
208
215
  unstable_applyFilters: applyFilters,
@@ -213,7 +220,8 @@ export const useGridFilter = (apiRef, props) => {
213
220
  showFilterPanel,
214
221
  hideFilterPanel,
215
222
  setQuickFilterValues,
216
- ignoreDiacritics: props.ignoreDiacritics
223
+ ignoreDiacritics: props.ignoreDiacritics,
224
+ getFilterState
217
225
  };
218
226
  useGridApiMethod(apiRef, filterApi, 'public');
219
227
 
@@ -128,7 +128,7 @@ export const useGridRowsMeta = (apiRef, props) => {
128
128
  positions.push(acc);
129
129
  let otherSizes = 0;
130
130
  const processedSizes = calculateRowProcessedSizes(row);
131
- /* eslint-disable-next-line no-restricted-syntax, guard-for-in */
131
+ /* eslint-disable-next-line guard-for-in */
132
132
  for (const key in processedSizes) {
133
133
  const value = processedSizes[key];
134
134
  if (key !== 'baseCenter') {
@@ -340,6 +340,9 @@ export const useGridVirtualScroller = () => {
340
340
  isLastVisible: isLastVisible,
341
341
  isNotVisible: isNotVisible
342
342
  }, rowProps), id));
343
+ if (isNotVisible) {
344
+ return;
345
+ }
343
346
  const panel = panels.get(id);
344
347
  if (panel) {
345
348
  rows.push(panel);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.6.2
2
+ * @mui/x-data-grid v7.7.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/locales/beBY.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { beBYCore } from './coreLocales';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
3
  const getPluralForm = (count, options) => {
4
- let pluralForm = options.other;
4
+ let pluralForm = options.many;
5
5
  const lastDigit = count % 10;
6
6
  if (lastDigit > 1 && lastDigit < 5 && (count < 10 || count > 20)) {
7
- pluralForm = options.twoToFour;
7
+ pluralForm = options.few;
8
8
  } else if (lastDigit === 1 && count % 100 !== 11) {
9
9
  pluralForm = options.one;
10
10
  }
@@ -30,8 +30,8 @@ const beBYGrid = {
30
30
  toolbarFiltersTooltipShow: 'Паказаць фільтры',
31
31
  toolbarFiltersTooltipActive: count => getPluralForm(count, {
32
32
  one: 'актыўны фільтр',
33
- twoToFour: 'актыўных фільтра',
34
- other: 'актыўных фільтраў'
33
+ few: 'актыўных фільтра',
34
+ many: 'актыўных фільтраў'
35
35
  }),
36
36
  // Quick filter toolbar field
37
37
  toolbarQuickFilterPlaceholder: 'Пошук…',
@@ -118,16 +118,16 @@ const beBYGrid = {
118
118
  // Column header text
119
119
  columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
120
120
  one: 'актыўны фільтр',
121
- twoToFour: 'актыўных фільтра',
122
- other: 'актыўных фільтраў'
121
+ few: 'актыўных фільтра',
122
+ many: 'актыўных фільтраў'
123
123
  }),
124
124
  columnHeaderFiltersLabel: 'Паказаць фільтры',
125
125
  columnHeaderSortIconLabel: 'Сартыраваць',
126
126
  // Rows selected footer text
127
127
  footerRowSelected: count => getPluralForm(count, {
128
128
  one: 'абраны радок',
129
- twoToFour: 'абраных радка',
130
- other: 'абраных радкоў'
129
+ few: 'абраных радка',
130
+ many: 'абраных радкоў'
131
131
  }),
132
132
  // Total row amount footer text
133
133
  footerTotalRows: 'Усяго радкоў:',
package/locales/faIR.js CHANGED
@@ -33,8 +33,7 @@ const faIRGrid = {
33
33
  columnsManagementSearchTitle: 'جستجو',
34
34
  columnsManagementNoColumns: 'بدون سطر',
35
35
  columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'بازنشانی',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'افزودن فیلتر',
40
39
  filterPanelRemoveAll: 'حذف همه',
package/locales/ptBR.js CHANGED
@@ -33,8 +33,7 @@ const ptBRGrid = {
33
33
  columnsManagementSearchTitle: 'Buscar',
34
34
  columnsManagementNoColumns: 'Nenhuma coluna',
35
35
  columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'Redefinir',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Adicionar filtro',
40
39
  filterPanelRemoveAll: 'Remover todos',
package/locales/ruRU.js CHANGED
@@ -1,5 +1,16 @@
1
1
  import { ruRU as ruRUCore } from '@mui/material/locale';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
+ function getPluralForm(count, options) {
4
+ const penultimateDigit = Math.floor(count / 10) % 10;
5
+ const lastDigit = count % 10;
6
+ let pluralForm = options.many;
7
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
8
+ pluralForm = options.few;
9
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
10
+ pluralForm = options.one;
11
+ }
12
+ return `${count} ${pluralForm}`;
13
+ }
3
14
  const ruRUGrid = {
4
15
  // Root
5
16
  noRowsLabel: 'Нет строк',
@@ -18,16 +29,11 @@ const ruRUGrid = {
18
29
  toolbarFiltersLabel: 'Показать фильтры',
19
30
  toolbarFiltersTooltipHide: 'Скрыть фильтры',
20
31
  toolbarFiltersTooltipShow: 'Показать фильтры',
21
- toolbarFiltersTooltipActive: count => {
22
- let pluralForm = 'активных фильтров';
23
- const lastDigit = count % 10;
24
- if (lastDigit > 1 && lastDigit < 5) {
25
- pluralForm = 'активных фильтра';
26
- } else if (lastDigit === 1) {
27
- pluralForm = 'активный фильтр';
28
- }
29
- return `${count} ${pluralForm}`;
30
- },
32
+ toolbarFiltersTooltipActive: count => getPluralForm(count, {
33
+ one: 'активный фильтр',
34
+ few: 'активных фильтра',
35
+ many: 'активных фильтров'
36
+ }),
31
37
  // Quick filter toolbar field
32
38
  toolbarQuickFilterPlaceholder: 'Поиск…',
33
39
  toolbarQuickFilterLabel: 'Поиск',
@@ -109,29 +115,19 @@ const ruRUGrid = {
109
115
  columnMenuSortAsc: 'Сортировать по возрастанию',
110
116
  columnMenuSortDesc: 'Сортировать по убыванию',
111
117
  // Column header text
112
- columnHeaderFiltersTooltipActive: count => {
113
- let pluralForm = 'активных фильтров';
114
- const lastDigit = count % 10;
115
- if (lastDigit > 1 && lastDigit < 5) {
116
- pluralForm = 'активных фильтра';
117
- } else if (lastDigit === 1) {
118
- pluralForm = 'активный фильтр';
119
- }
120
- return `${count} ${pluralForm}`;
121
- },
118
+ columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
119
+ one: 'активный фильтр',
120
+ few: 'активных фильтра',
121
+ many: 'активных фильтров'
122
+ }),
122
123
  columnHeaderFiltersLabel: 'Показать фильтры',
123
124
  columnHeaderSortIconLabel: 'Сортировать',
124
125
  // Rows selected footer text
125
- footerRowSelected: count => {
126
- let pluralForm = 'строк выбрано';
127
- const lastDigit = count % 10;
128
- if (lastDigit > 1 && lastDigit < 5) {
129
- pluralForm = 'строки выбраны';
130
- } else if (lastDigit === 1) {
131
- pluralForm = 'строка выбрана';
132
- }
133
- return `${count} ${pluralForm}`;
134
- },
126
+ footerRowSelected: count => getPluralForm(count, {
127
+ one: 'строка выбрана',
128
+ few: 'строки выбраны',
129
+ many: 'строк выбрано'
130
+ }),
135
131
  // Total row amount footer text
136
132
  footerTotalRows: 'Всего строк:',
137
133
  // Total visible row amount footer text
package/locales/ukUA.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { ukUA as ukUACore } from '@mui/material/locale';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
- const getPluralForm = (count, options) => {
4
- let pluralForm = options.many;
3
+ function getPluralForm(count, options) {
4
+ const penultimateDigit = Math.floor(count / 10) % 10;
5
5
  const lastDigit = count % 10;
6
- if (lastDigit > 1 && lastDigit < 5) {
6
+ let pluralForm = options.many;
7
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
7
8
  pluralForm = options.few;
8
- } else if (lastDigit === 1) {
9
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
9
10
  pluralForm = options.one;
10
11
  }
11
12
  return `${count} ${pluralForm}`;
12
- };
13
+ }
13
14
  const ukUAGrid = {
14
15
  // Root
15
16
  noRowsLabel: 'Немає рядків',
@@ -2,6 +2,7 @@ import { GridFilterModel } from '../gridFilterModel';
2
2
  import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
3
3
  import { GridControlledStateReasonLookup } from '../events';
4
4
  import type { DataGridProcessedProps } from '../props/DataGridProps';
5
+ import { GridStateCommunity } from '../gridStateCommunity';
5
6
  /**
6
7
  * The filter API interface that is available in the grid [[apiRef]].
7
8
  */
@@ -57,4 +58,10 @@ export interface GridFilterApi {
57
58
  * Returns the value of the `ignoreDiacritics` prop.
58
59
  */
59
60
  ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
61
+ /**
62
+ * Returns the filter state for the given filter model without applying it to the data grid.
63
+ * @param {GridFilterModel} filterModel The filter model to get the state for.
64
+ * @returns {GridStateCommunity['filter']} The filter state.
65
+ */
66
+ getFilterState: (filterModel: GridFilterModel) => GridStateCommunity['filter'];
60
67
  }
@@ -127,7 +127,7 @@ function GridColumnGroupHeader(props) {
127
127
  width: width,
128
128
  columnMenuIconButton: null,
129
129
  columnTitleIconButtons: null,
130
- resizable: true,
130
+ resizable: false,
131
131
  label: label,
132
132
  "aria-colspan": fields.length
133
133
  // The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
@@ -210,7 +210,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
210
210
  return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
211
211
  const result = {};
212
212
 
213
- /* eslint-disable no-restricted-syntax, no-labels */
213
+ /* eslint-disable no-labels */
214
214
  outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
215
215
  const filterValue = quickFilterValues[v];
216
216
  for (let i = 0; i < appliersPerField.length; i += 1) {
@@ -240,8 +240,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
240
240
  }
241
241
  result[filterValue] = false;
242
242
  }
243
- /* eslint-enable no-restricted-syntax, no-labels */
244
-
245
243
  return result;
246
244
  };
247
245
  };
@@ -59,13 +59,9 @@ export const useGridFilter = (apiRef, props) => {
59
59
  const updateFilteredRows = React.useCallback(() => {
60
60
  apiRef.current.setState(state => {
61
61
  const filterModel = gridFilterModelSelector(state, apiRef.current.instanceId);
62
- const isRowMatchingFilters = props.filterMode === 'client' ? buildAggregatedFilterApplier(filterModel, apiRef, props.disableEval) : null;
63
- const filteringResult = apiRef.current.applyStrategyProcessor('filtering', {
64
- isRowMatchingFilters,
65
- filterModel: filterModel ?? getDefaultGridFilterModel()
66
- });
62
+ const filterState = apiRef.current.getFilterState(filterModel);
67
63
  const newState = _extends({}, state, {
68
- filter: _extends({}, state.filter, filteringResult)
64
+ filter: _extends({}, state.filter, filterState)
69
65
  });
70
66
  const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
71
67
  return _extends({}, newState, {
@@ -73,7 +69,7 @@ export const useGridFilter = (apiRef, props) => {
73
69
  });
74
70
  });
75
71
  apiRef.current.publishEvent('filteredRowsSet');
76
- }, [apiRef, props.filterMode, props.disableEval]);
72
+ }, [apiRef]);
77
73
  const addColumnMenuItem = React.useCallback((columnMenuItems, colDef) => {
78
74
  if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
79
75
  return columnMenuItems;
@@ -203,6 +199,17 @@ export const useGridFilter = (apiRef, props) => {
203
199
  apiRef.current.unstable_applyFilters();
204
200
  }
205
201
  }, [apiRef, logger, props.disableMultipleColumnsFiltering]);
202
+ const getFilterState = React.useCallback(inputFilterModel => {
203
+ const filterModel = sanitizeFilterModel(inputFilterModel, props.disableMultipleColumnsFiltering, apiRef);
204
+ const isRowMatchingFilters = props.filterMode === 'client' ? buildAggregatedFilterApplier(filterModel, apiRef, props.disableEval) : null;
205
+ const filterResult = apiRef.current.applyStrategyProcessor('filtering', {
206
+ isRowMatchingFilters,
207
+ filterModel: filterModel ?? getDefaultGridFilterModel()
208
+ });
209
+ return _extends({}, filterResult, {
210
+ filterModel
211
+ });
212
+ }, [props.disableMultipleColumnsFiltering, props.filterMode, props.disableEval, apiRef]);
206
213
  const filterApi = {
207
214
  setFilterLogicOperator,
208
215
  unstable_applyFilters: applyFilters,
@@ -213,7 +220,8 @@ export const useGridFilter = (apiRef, props) => {
213
220
  showFilterPanel,
214
221
  hideFilterPanel,
215
222
  setQuickFilterValues,
216
- ignoreDiacritics: props.ignoreDiacritics
223
+ ignoreDiacritics: props.ignoreDiacritics,
224
+ getFilterState
217
225
  };
218
226
  useGridApiMethod(apiRef, filterApi, 'public');
219
227
 
@@ -128,7 +128,7 @@ export const useGridRowsMeta = (apiRef, props) => {
128
128
  positions.push(acc);
129
129
  let otherSizes = 0;
130
130
  const processedSizes = calculateRowProcessedSizes(row);
131
- /* eslint-disable-next-line no-restricted-syntax, guard-for-in */
131
+ /* eslint-disable-next-line guard-for-in */
132
132
  for (const key in processedSizes) {
133
133
  const value = processedSizes[key];
134
134
  if (key !== 'baseCenter') {
@@ -340,6 +340,9 @@ export const useGridVirtualScroller = () => {
340
340
  isLastVisible: isLastVisible,
341
341
  isNotVisible: isNotVisible
342
342
  }, rowProps), id));
343
+ if (isNotVisible) {
344
+ return;
345
+ }
343
346
  const panel = panels.get(id);
344
347
  if (panel) {
345
348
  rows.push(panel);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.6.2
2
+ * @mui/x-data-grid v7.7.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,10 +1,10 @@
1
1
  import { beBYCore } from './coreLocales';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
3
  const getPluralForm = (count, options) => {
4
- let pluralForm = options.other;
4
+ let pluralForm = options.many;
5
5
  const lastDigit = count % 10;
6
6
  if (lastDigit > 1 && lastDigit < 5 && (count < 10 || count > 20)) {
7
- pluralForm = options.twoToFour;
7
+ pluralForm = options.few;
8
8
  } else if (lastDigit === 1 && count % 100 !== 11) {
9
9
  pluralForm = options.one;
10
10
  }
@@ -30,8 +30,8 @@ const beBYGrid = {
30
30
  toolbarFiltersTooltipShow: 'Паказаць фільтры',
31
31
  toolbarFiltersTooltipActive: count => getPluralForm(count, {
32
32
  one: 'актыўны фільтр',
33
- twoToFour: 'актыўных фільтра',
34
- other: 'актыўных фільтраў'
33
+ few: 'актыўных фільтра',
34
+ many: 'актыўных фільтраў'
35
35
  }),
36
36
  // Quick filter toolbar field
37
37
  toolbarQuickFilterPlaceholder: 'Пошук…',
@@ -118,16 +118,16 @@ const beBYGrid = {
118
118
  // Column header text
119
119
  columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
120
120
  one: 'актыўны фільтр',
121
- twoToFour: 'актыўных фільтра',
122
- other: 'актыўных фільтраў'
121
+ few: 'актыўных фільтра',
122
+ many: 'актыўных фільтраў'
123
123
  }),
124
124
  columnHeaderFiltersLabel: 'Паказаць фільтры',
125
125
  columnHeaderSortIconLabel: 'Сартыраваць',
126
126
  // Rows selected footer text
127
127
  footerRowSelected: count => getPluralForm(count, {
128
128
  one: 'абраны радок',
129
- twoToFour: 'абраных радка',
130
- other: 'абраных радкоў'
129
+ few: 'абраных радка',
130
+ many: 'абраных радкоў'
131
131
  }),
132
132
  // Total row amount footer text
133
133
  footerTotalRows: 'Усяго радкоў:',
@@ -33,8 +33,7 @@ const faIRGrid = {
33
33
  columnsManagementSearchTitle: 'جستجو',
34
34
  columnsManagementNoColumns: 'بدون سطر',
35
35
  columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'بازنشانی',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'افزودن فیلتر',
40
39
  filterPanelRemoveAll: 'حذف همه',
@@ -33,8 +33,7 @@ const ptBRGrid = {
33
33
  columnsManagementSearchTitle: 'Buscar',
34
34
  columnsManagementNoColumns: 'Nenhuma coluna',
35
35
  columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'Redefinir',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Adicionar filtro',
40
39
  filterPanelRemoveAll: 'Remover todos',
@@ -1,5 +1,16 @@
1
1
  import { ruRU as ruRUCore } from '@mui/material/locale';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
+ function getPluralForm(count, options) {
4
+ const penultimateDigit = Math.floor(count / 10) % 10;
5
+ const lastDigit = count % 10;
6
+ let pluralForm = options.many;
7
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
8
+ pluralForm = options.few;
9
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
10
+ pluralForm = options.one;
11
+ }
12
+ return `${count} ${pluralForm}`;
13
+ }
3
14
  const ruRUGrid = {
4
15
  // Root
5
16
  noRowsLabel: 'Нет строк',
@@ -18,16 +29,11 @@ const ruRUGrid = {
18
29
  toolbarFiltersLabel: 'Показать фильтры',
19
30
  toolbarFiltersTooltipHide: 'Скрыть фильтры',
20
31
  toolbarFiltersTooltipShow: 'Показать фильтры',
21
- toolbarFiltersTooltipActive: count => {
22
- let pluralForm = 'активных фильтров';
23
- const lastDigit = count % 10;
24
- if (lastDigit > 1 && lastDigit < 5) {
25
- pluralForm = 'активных фильтра';
26
- } else if (lastDigit === 1) {
27
- pluralForm = 'активный фильтр';
28
- }
29
- return `${count} ${pluralForm}`;
30
- },
32
+ toolbarFiltersTooltipActive: count => getPluralForm(count, {
33
+ one: 'активный фильтр',
34
+ few: 'активных фильтра',
35
+ many: 'активных фильтров'
36
+ }),
31
37
  // Quick filter toolbar field
32
38
  toolbarQuickFilterPlaceholder: 'Поиск…',
33
39
  toolbarQuickFilterLabel: 'Поиск',
@@ -109,29 +115,19 @@ const ruRUGrid = {
109
115
  columnMenuSortAsc: 'Сортировать по возрастанию',
110
116
  columnMenuSortDesc: 'Сортировать по убыванию',
111
117
  // Column header text
112
- columnHeaderFiltersTooltipActive: count => {
113
- let pluralForm = 'активных фильтров';
114
- const lastDigit = count % 10;
115
- if (lastDigit > 1 && lastDigit < 5) {
116
- pluralForm = 'активных фильтра';
117
- } else if (lastDigit === 1) {
118
- pluralForm = 'активный фильтр';
119
- }
120
- return `${count} ${pluralForm}`;
121
- },
118
+ columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
119
+ one: 'активный фильтр',
120
+ few: 'активных фильтра',
121
+ many: 'активных фильтров'
122
+ }),
122
123
  columnHeaderFiltersLabel: 'Показать фильтры',
123
124
  columnHeaderSortIconLabel: 'Сортировать',
124
125
  // Rows selected footer text
125
- footerRowSelected: count => {
126
- let pluralForm = 'строк выбрано';
127
- const lastDigit = count % 10;
128
- if (lastDigit > 1 && lastDigit < 5) {
129
- pluralForm = 'строки выбраны';
130
- } else if (lastDigit === 1) {
131
- pluralForm = 'строка выбрана';
132
- }
133
- return `${count} ${pluralForm}`;
134
- },
126
+ footerRowSelected: count => getPluralForm(count, {
127
+ one: 'строка выбрана',
128
+ few: 'строки выбраны',
129
+ many: 'строк выбрано'
130
+ }),
135
131
  // Total row amount footer text
136
132
  footerTotalRows: 'Всего строк:',
137
133
  // Total visible row amount footer text
@@ -1,15 +1,16 @@
1
1
  import { ukUA as ukUACore } from '@mui/material/locale';
2
2
  import { getGridLocalization } from '../utils/getGridLocalization';
3
- const getPluralForm = (count, options) => {
4
- let pluralForm = options.many;
3
+ function getPluralForm(count, options) {
4
+ const penultimateDigit = Math.floor(count / 10) % 10;
5
5
  const lastDigit = count % 10;
6
- if (lastDigit > 1 && lastDigit < 5) {
6
+ let pluralForm = options.many;
7
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
7
8
  pluralForm = options.few;
8
- } else if (lastDigit === 1) {
9
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
9
10
  pluralForm = options.one;
10
11
  }
11
12
  return `${count} ${pluralForm}`;
12
- };
13
+ }
13
14
  const ukUAGrid = {
14
15
  // Root
15
16
  noRowsLabel: 'Немає рядків',
@@ -9,7 +9,6 @@ export function fastObjectShallowCompare(a, b) {
9
9
  let aLength = 0;
10
10
  let bLength = 0;
11
11
 
12
- /* eslint-disable no-restricted-syntax */
13
12
  /* eslint-disable guard-for-in */
14
13
  for (const key in a) {
15
14
  aLength += 1;
@@ -25,8 +24,5 @@ export function fastObjectShallowCompare(a, b) {
25
24
  for (const _ in b) {
26
25
  bLength += 1;
27
26
  }
28
- /* eslint-enable no-restricted-syntax */
29
- /* eslint-enable guard-for-in */
30
-
31
27
  return aLength === bLength;
32
28
  }
@@ -136,7 +136,7 @@ function GridColumnGroupHeader(props) {
136
136
  width: width,
137
137
  columnMenuIconButton: null,
138
138
  columnTitleIconButtons: null,
139
- resizable: true,
139
+ resizable: false,
140
140
  label: label,
141
141
  "aria-colspan": fields.length
142
142
  // The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
@@ -222,7 +222,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
222
222
  return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
223
223
  const result = {};
224
224
 
225
- /* eslint-disable no-restricted-syntax, no-labels */
225
+ /* eslint-disable no-labels */
226
226
  outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
227
227
  const filterValue = quickFilterValues[v];
228
228
  for (let i = 0; i < appliersPerField.length; i += 1) {
@@ -252,8 +252,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
252
252
  }
253
253
  result[filterValue] = false;
254
254
  }
255
- /* eslint-enable no-restricted-syntax, no-labels */
256
-
257
255
  return result;
258
256
  };
259
257
  };
@@ -69,13 +69,9 @@ const useGridFilter = (apiRef, props) => {
69
69
  const updateFilteredRows = React.useCallback(() => {
70
70
  apiRef.current.setState(state => {
71
71
  const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(state, apiRef.current.instanceId);
72
- const isRowMatchingFilters = props.filterMode === 'client' ? (0, _gridFilterUtils.buildAggregatedFilterApplier)(filterModel, apiRef, props.disableEval) : null;
73
- const filteringResult = apiRef.current.applyStrategyProcessor('filtering', {
74
- isRowMatchingFilters,
75
- filterModel: filterModel ?? (0, _gridFilterState.getDefaultGridFilterModel)()
76
- });
72
+ const filterState = apiRef.current.getFilterState(filterModel);
77
73
  const newState = (0, _extends2.default)({}, state, {
78
- filter: (0, _extends2.default)({}, state.filter, filteringResult)
74
+ filter: (0, _extends2.default)({}, state.filter, filterState)
79
75
  });
80
76
  const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
81
77
  return (0, _extends2.default)({}, newState, {
@@ -83,7 +79,7 @@ const useGridFilter = (apiRef, props) => {
83
79
  });
84
80
  });
85
81
  apiRef.current.publishEvent('filteredRowsSet');
86
- }, [apiRef, props.filterMode, props.disableEval]);
82
+ }, [apiRef]);
87
83
  const addColumnMenuItem = React.useCallback((columnMenuItems, colDef) => {
88
84
  if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
89
85
  return columnMenuItems;
@@ -213,6 +209,17 @@ const useGridFilter = (apiRef, props) => {
213
209
  apiRef.current.unstable_applyFilters();
214
210
  }
215
211
  }, [apiRef, logger, props.disableMultipleColumnsFiltering]);
212
+ const getFilterState = React.useCallback(inputFilterModel => {
213
+ const filterModel = (0, _gridFilterUtils.sanitizeFilterModel)(inputFilterModel, props.disableMultipleColumnsFiltering, apiRef);
214
+ const isRowMatchingFilters = props.filterMode === 'client' ? (0, _gridFilterUtils.buildAggregatedFilterApplier)(filterModel, apiRef, props.disableEval) : null;
215
+ const filterResult = apiRef.current.applyStrategyProcessor('filtering', {
216
+ isRowMatchingFilters,
217
+ filterModel: filterModel ?? (0, _gridFilterState.getDefaultGridFilterModel)()
218
+ });
219
+ return (0, _extends2.default)({}, filterResult, {
220
+ filterModel
221
+ });
222
+ }, [props.disableMultipleColumnsFiltering, props.filterMode, props.disableEval, apiRef]);
216
223
  const filterApi = {
217
224
  setFilterLogicOperator,
218
225
  unstable_applyFilters: applyFilters,
@@ -223,7 +230,8 @@ const useGridFilter = (apiRef, props) => {
223
230
  showFilterPanel,
224
231
  hideFilterPanel,
225
232
  setQuickFilterValues,
226
- ignoreDiacritics: props.ignoreDiacritics
233
+ ignoreDiacritics: props.ignoreDiacritics,
234
+ getFilterState
227
235
  };
228
236
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, filterApi, 'public');
229
237
 
@@ -137,7 +137,7 @@ const useGridRowsMeta = (apiRef, props) => {
137
137
  positions.push(acc);
138
138
  let otherSizes = 0;
139
139
  const processedSizes = calculateRowProcessedSizes(row);
140
- /* eslint-disable-next-line no-restricted-syntax, guard-for-in */
140
+ /* eslint-disable-next-line guard-for-in */
141
141
  for (const key in processedSizes) {
142
142
  const value = processedSizes[key];
143
143
  if (key !== 'baseCenter') {
@@ -352,6 +352,9 @@ const useGridVirtualScroller = () => {
352
352
  isLastVisible: isLastVisible,
353
353
  isNotVisible: isNotVisible
354
354
  }, rowProps), id));
355
+ if (isNotVisible) {
356
+ return;
357
+ }
355
358
  const panel = panels.get(id);
356
359
  if (panel) {
357
360
  rows.push(panel);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.6.2
2
+ * @mui/x-data-grid v7.7.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -7,10 +7,10 @@ exports.beBY = void 0;
7
7
  var _coreLocales = require("./coreLocales");
8
8
  var _getGridLocalization = require("../utils/getGridLocalization");
9
9
  const getPluralForm = (count, options) => {
10
- let pluralForm = options.other;
10
+ let pluralForm = options.many;
11
11
  const lastDigit = count % 10;
12
12
  if (lastDigit > 1 && lastDigit < 5 && (count < 10 || count > 20)) {
13
- pluralForm = options.twoToFour;
13
+ pluralForm = options.few;
14
14
  } else if (lastDigit === 1 && count % 100 !== 11) {
15
15
  pluralForm = options.one;
16
16
  }
@@ -36,8 +36,8 @@ const beBYGrid = {
36
36
  toolbarFiltersTooltipShow: 'Паказаць фільтры',
37
37
  toolbarFiltersTooltipActive: count => getPluralForm(count, {
38
38
  one: 'актыўны фільтр',
39
- twoToFour: 'актыўных фільтра',
40
- other: 'актыўных фільтраў'
39
+ few: 'актыўных фільтра',
40
+ many: 'актыўных фільтраў'
41
41
  }),
42
42
  // Quick filter toolbar field
43
43
  toolbarQuickFilterPlaceholder: 'Пошук…',
@@ -124,16 +124,16 @@ const beBYGrid = {
124
124
  // Column header text
125
125
  columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
126
126
  one: 'актыўны фільтр',
127
- twoToFour: 'актыўных фільтра',
128
- other: 'актыўных фільтраў'
127
+ few: 'актыўных фільтра',
128
+ many: 'актыўных фільтраў'
129
129
  }),
130
130
  columnHeaderFiltersLabel: 'Паказаць фільтры',
131
131
  columnHeaderSortIconLabel: 'Сартыраваць',
132
132
  // Rows selected footer text
133
133
  footerRowSelected: count => getPluralForm(count, {
134
134
  one: 'абраны радок',
135
- twoToFour: 'абраных радка',
136
- other: 'абраных радкоў'
135
+ few: 'абраных радка',
136
+ many: 'абраных радкоў'
137
137
  }),
138
138
  // Total row amount footer text
139
139
  footerTotalRows: 'Усяго радкоў:',
@@ -39,8 +39,7 @@ const faIRGrid = {
39
39
  columnsManagementSearchTitle: 'جستجو',
40
40
  columnsManagementNoColumns: 'بدون سطر',
41
41
  columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
42
- // columnsManagementReset: 'Reset',
43
-
42
+ columnsManagementReset: 'بازنشانی',
44
43
  // Filter panel text
45
44
  filterPanelAddFilter: 'افزودن فیلتر',
46
45
  filterPanelRemoveAll: 'حذف همه',
@@ -39,8 +39,7 @@ const ptBRGrid = {
39
39
  columnsManagementSearchTitle: 'Buscar',
40
40
  columnsManagementNoColumns: 'Nenhuma coluna',
41
41
  columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
42
- // columnsManagementReset: 'Reset',
43
-
42
+ columnsManagementReset: 'Redefinir',
44
43
  // Filter panel text
45
44
  filterPanelAddFilter: 'Adicionar filtro',
46
45
  filterPanelRemoveAll: 'Remover todos',
@@ -6,6 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ruRU = void 0;
7
7
  var _locale = require("@mui/material/locale");
8
8
  var _getGridLocalization = require("../utils/getGridLocalization");
9
+ function getPluralForm(count, options) {
10
+ const penultimateDigit = Math.floor(count / 10) % 10;
11
+ const lastDigit = count % 10;
12
+ let pluralForm = options.many;
13
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
14
+ pluralForm = options.few;
15
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
16
+ pluralForm = options.one;
17
+ }
18
+ return `${count} ${pluralForm}`;
19
+ }
9
20
  const ruRUGrid = {
10
21
  // Root
11
22
  noRowsLabel: 'Нет строк',
@@ -24,16 +35,11 @@ const ruRUGrid = {
24
35
  toolbarFiltersLabel: 'Показать фильтры',
25
36
  toolbarFiltersTooltipHide: 'Скрыть фильтры',
26
37
  toolbarFiltersTooltipShow: 'Показать фильтры',
27
- toolbarFiltersTooltipActive: count => {
28
- let pluralForm = 'активных фильтров';
29
- const lastDigit = count % 10;
30
- if (lastDigit > 1 && lastDigit < 5) {
31
- pluralForm = 'активных фильтра';
32
- } else if (lastDigit === 1) {
33
- pluralForm = 'активный фильтр';
34
- }
35
- return `${count} ${pluralForm}`;
36
- },
38
+ toolbarFiltersTooltipActive: count => getPluralForm(count, {
39
+ one: 'активный фильтр',
40
+ few: 'активных фильтра',
41
+ many: 'активных фильтров'
42
+ }),
37
43
  // Quick filter toolbar field
38
44
  toolbarQuickFilterPlaceholder: 'Поиск…',
39
45
  toolbarQuickFilterLabel: 'Поиск',
@@ -115,29 +121,19 @@ const ruRUGrid = {
115
121
  columnMenuSortAsc: 'Сортировать по возрастанию',
116
122
  columnMenuSortDesc: 'Сортировать по убыванию',
117
123
  // Column header text
118
- columnHeaderFiltersTooltipActive: count => {
119
- let pluralForm = 'активных фильтров';
120
- const lastDigit = count % 10;
121
- if (lastDigit > 1 && lastDigit < 5) {
122
- pluralForm = 'активных фильтра';
123
- } else if (lastDigit === 1) {
124
- pluralForm = 'активный фильтр';
125
- }
126
- return `${count} ${pluralForm}`;
127
- },
124
+ columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
125
+ one: 'активный фильтр',
126
+ few: 'активных фильтра',
127
+ many: 'активных фильтров'
128
+ }),
128
129
  columnHeaderFiltersLabel: 'Показать фильтры',
129
130
  columnHeaderSortIconLabel: 'Сортировать',
130
131
  // Rows selected footer text
131
- footerRowSelected: count => {
132
- let pluralForm = 'строк выбрано';
133
- const lastDigit = count % 10;
134
- if (lastDigit > 1 && lastDigit < 5) {
135
- pluralForm = 'строки выбраны';
136
- } else if (lastDigit === 1) {
137
- pluralForm = 'строка выбрана';
138
- }
139
- return `${count} ${pluralForm}`;
140
- },
132
+ footerRowSelected: count => getPluralForm(count, {
133
+ one: 'строка выбрана',
134
+ few: 'строки выбраны',
135
+ many: 'строк выбрано'
136
+ }),
141
137
  // Total row amount footer text
142
138
  footerTotalRows: 'Всего строк:',
143
139
  // Total visible row amount footer text
@@ -6,16 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ukUA = void 0;
7
7
  var _locale = require("@mui/material/locale");
8
8
  var _getGridLocalization = require("../utils/getGridLocalization");
9
- const getPluralForm = (count, options) => {
10
- let pluralForm = options.many;
9
+ function getPluralForm(count, options) {
10
+ const penultimateDigit = Math.floor(count / 10) % 10;
11
11
  const lastDigit = count % 10;
12
- if (lastDigit > 1 && lastDigit < 5) {
12
+ let pluralForm = options.many;
13
+ if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
13
14
  pluralForm = options.few;
14
- } else if (lastDigit === 1) {
15
+ } else if (penultimateDigit !== 1 && lastDigit === 1) {
15
16
  pluralForm = options.one;
16
17
  }
17
18
  return `${count} ${pluralForm}`;
18
- };
19
+ }
19
20
  const ukUAGrid = {
20
21
  // Root
21
22
  noRowsLabel: 'Немає рядків',
@@ -15,7 +15,6 @@ function fastObjectShallowCompare(a, b) {
15
15
  let aLength = 0;
16
16
  let bLength = 0;
17
17
 
18
- /* eslint-disable no-restricted-syntax */
19
18
  /* eslint-disable guard-for-in */
20
19
  for (const key in a) {
21
20
  aLength += 1;
@@ -31,8 +30,5 @@ function fastObjectShallowCompare(a, b) {
31
30
  for (const _ in b) {
32
31
  bLength += 1;
33
32
  }
34
- /* eslint-enable no-restricted-syntax */
35
- /* eslint-enable guard-for-in */
36
-
37
33
  return aLength === bLength;
38
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.6.2",
3
+ "version": "7.7.0",
4
4
  "description": "The Community plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -37,7 +37,7 @@
37
37
  "directory": "packages/x-data-grid"
38
38
  },
39
39
  "dependencies": {
40
- "@babel/runtime": "^7.24.6",
40
+ "@babel/runtime": "^7.24.7",
41
41
  "@mui/system": "^5.15.15",
42
42
  "@mui/utils": "^5.15.14",
43
43
  "clsx": "^2.1.1",
@@ -9,7 +9,6 @@ export function fastObjectShallowCompare(a, b) {
9
9
  let aLength = 0;
10
10
  let bLength = 0;
11
11
 
12
- /* eslint-disable no-restricted-syntax */
13
12
  /* eslint-disable guard-for-in */
14
13
  for (const key in a) {
15
14
  aLength += 1;
@@ -25,8 +24,5 @@ export function fastObjectShallowCompare(a, b) {
25
24
  for (const _ in b) {
26
25
  bLength += 1;
27
26
  }
28
- /* eslint-enable no-restricted-syntax */
29
- /* eslint-enable guard-for-in */
30
-
31
27
  return aLength === bLength;
32
28
  }