@mui/x-data-grid 5.17.14 → 5.17.17

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,83 @@
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
+ ## 5.17.17
7
+
8
+ _Dec 23, 2022_
9
+
10
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Improve Russian (ru-RU) and Korean (ko-KR) locales
13
+ - 🐞 Bugfixes
14
+
15
+ ### `@mui/x-data-grid@5.17.17` / `@mui/x-data-grid-pro@5.17.17` / `@mui/x-data-grid-premium@5.17.17`
16
+
17
+ #### Changes
18
+
19
+ - [DataGrid] Update Russian (ru-RU) locale (#7291) @VeceluXa
20
+ - [DataGridPro] Use row ID as `key` of the detail panels (#7311) @m4theushw
21
+ - [DataGridPremium] Fix `exceljs` import with parcel (#7285) @alexfauquette
22
+
23
+ ### `@mui/x-date-pickers@5.0.12` / `@mui/x-date-pickers-pro@5.0.12`
24
+
25
+ #### Changes
26
+
27
+ - [pickers] Improve Korean (ko-KR) locale (#7283) @hanbin9775
28
+
29
+ ## 5.17.16
30
+
31
+ _Dec 16, 2022_
32
+
33
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
34
+
35
+ - 🐞 Bugfixes
36
+
37
+ ### `@mui/x-data-grid@v5.17.16` / `@mui/x-data-grid-pro@v5.17.16` / `@mui/x-data-grid-premium@v5.17.16`
38
+
39
+ #### Changes
40
+
41
+ - [DataGrid] Display sort column menu items as per `sortingOrder` prop (#7125) @hanbin9775
42
+ - [DataGrid] Fix flickering on mount (#7155) @cherniavskii
43
+ - [DataGridPremium] Use separate cache for aggregation columns pre-processor (#7174) @m4theushw
44
+
45
+ ### `@mui/x-date-pickers@v5.0.11` / `@mui/x-date-pickers-pro@v5.0.11`
46
+
47
+ #### Changes
48
+
49
+ - [DateTimePicker] Update export pattern (#7172) @kealjones-wk
50
+
51
+ ### Docs
52
+
53
+ - [docs] Document aggregation selectors (#7151) @cherniavskii
54
+
55
+ ## 5.17.15
56
+
57
+ _Dec 8, 2022_
58
+
59
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
60
+
61
+ - ✨ Fix lazy-loading not working in `DataGridPremium` (#7130) @m4theushw
62
+ - 🐞 Bugfixes
63
+
64
+ ### `@mui/x-data-grid@v5.17.15` / `@mui/x-data-grid-pro@v5.17.15` / `@mui/x-data-grid-premium@v5.17.15`
65
+
66
+ #### Changes
67
+
68
+ - [DataGridPremium] Add support for lazy-loading (#7130) @m4theushw
69
+ - [DataGridPremium] Pass `groupId` to the aggregation function (#7143) @m4theushw
70
+
71
+ ### `@mui/x-date-pickers@v5.0.10` / `@mui/x-date-pickers-pro@v5.0.10`
72
+
73
+ #### Changes
74
+
75
+ - [pickers] Initialize date without time when selecting year or month (#7136) @LukasTy
76
+
77
+ ### Docs
78
+
79
+ - [docs] Fix the nested import on the api pages (#7134) @flaviendelangle
80
+ - [docs] Keep track of the localization completion (#7099) @alexfauquette
81
+ - [docs] Update localization doc to use existing locale (#7104) @LukasTy
82
+
6
83
  ## 5.17.14
7
84
 
8
85
  _Dec 1, 2022_
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { GridFilterItemProps } from './GridFilterItemProps';
3
- declare const SortGridMenuItems: {
4
- (props: GridFilterItemProps): JSX.Element | null;
5
- propTypes: any;
6
- };
3
+ declare function SortGridMenuItems(props: GridFilterItemProps): JSX.Element | null;
4
+ declare namespace SortGridMenuItems {
5
+ var propTypes: any;
6
+ }
7
7
  export { SortGridMenuItems };
@@ -4,16 +4,21 @@ import MenuItem from '@mui/material/MenuItem';
4
4
  import { useGridSelector } from '../../../hooks/utils/useGridSelector';
5
5
  import { gridSortModelSelector } from '../../../hooks/features/sorting/gridSortingSelector';
6
6
  import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
7
+ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
 
10
- const SortGridMenuItems = props => {
11
+ function SortGridMenuItems(props) {
12
+ var _column$sortingOrder;
13
+
11
14
  const {
12
15
  column,
13
16
  onClick
14
17
  } = props;
15
18
  const apiRef = useGridApiContext();
16
19
  const sortModel = useGridSelector(apiRef, gridSortModelSelector);
20
+ const rootProps = useGridRootProps();
21
+ const sortingOrder = (_column$sortingOrder = column.sortingOrder) != null ? _column$sortingOrder : rootProps.sortingOrder;
17
22
  const sortDirection = React.useMemo(() => {
18
23
  if (!column) {
19
24
  return null;
@@ -33,23 +38,23 @@ const SortGridMenuItems = props => {
33
38
  }
34
39
 
35
40
  return /*#__PURE__*/_jsxs(React.Fragment, {
36
- children: [/*#__PURE__*/_jsx(MenuItem, {
41
+ children: [sortingOrder.includes(null) ? /*#__PURE__*/_jsx(MenuItem, {
37
42
  onClick: onSortMenuItemClick,
38
43
  disabled: sortDirection == null,
39
44
  children: apiRef.current.getLocaleText('columnMenuUnsort')
40
- }), /*#__PURE__*/_jsx(MenuItem, {
45
+ }) : null, sortingOrder.includes('asc') ? /*#__PURE__*/_jsx(MenuItem, {
41
46
  onClick: onSortMenuItemClick,
42
47
  "data-value": "asc",
43
48
  disabled: sortDirection === 'asc',
44
49
  children: apiRef.current.getLocaleText('columnMenuSortAsc')
45
- }), /*#__PURE__*/_jsx(MenuItem, {
50
+ }) : null, sortingOrder.includes('desc') ? /*#__PURE__*/_jsx(MenuItem, {
46
51
  onClick: onSortMenuItemClick,
47
52
  "data-value": "desc",
48
53
  disabled: sortDirection === 'desc',
49
54
  children: apiRef.current.getLocaleText('columnMenuSortDesc')
50
- })]
55
+ }) : null]
51
56
  });
52
- };
57
+ }
53
58
 
54
59
  process.env.NODE_ENV !== "production" ? SortGridMenuItems.propTypes = {
55
60
  // ----------------------------- Warning --------------------------------
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["style"];
4
4
  import * as React from 'react';
5
5
  import * as ReactDOM from 'react-dom';
6
- import { useForkRef } from '@mui/material/utils';
6
+ import { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
7
7
  import { useGridApiContext } from '../../utils/useGridApiContext';
8
8
  import { useGridRootProps } from '../../utils/useGridRootProps';
9
9
  import { useGridSelector } from '../../utils/useGridSelector';
@@ -158,7 +158,7 @@ export const useGridVirtualScroller = props => {
158
158
  lastColumnIndex
159
159
  };
160
160
  }, [disableVirtualization, getNearestIndexToRender, rowsMeta.positions.length, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerWidth]);
161
- React.useEffect(() => {
161
+ useEnhancedEffect(() => {
162
162
  if (disableVirtualization) {
163
163
  renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
164
164
  } else {
@@ -167,7 +167,7 @@ export const useGridVirtualScroller = props => {
167
167
  rootRef.current.scrollTop = 0;
168
168
  }
169
169
  }, [disableVirtualization]);
170
- React.useEffect(() => {
170
+ useEnhancedEffect(() => {
171
171
  setContainerWidth(rootRef.current.clientWidth);
172
172
  }, [rowsMeta.currentPageTotalHeight]);
173
173
  const handleResize = React.useCallback(params => {
@@ -228,7 +228,7 @@ export const useGridVirtualScroller = props => {
228
228
  });
229
229
  prevRenderContext.current = nextRenderContext;
230
230
  }, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
231
- React.useEffect(() => {
231
+ useEnhancedEffect(() => {
232
232
  if (containerWidth == null) {
233
233
  return;
234
234
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.14
1
+ /** @license MUI v5.17.17
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -4,14 +4,19 @@ import MenuItem from '@mui/material/MenuItem';
4
4
  import { useGridSelector } from '../../../hooks/utils/useGridSelector';
5
5
  import { gridSortModelSelector } from '../../../hooks/features/sorting/gridSortingSelector';
6
6
  import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
7
+ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
 
10
- var SortGridMenuItems = function SortGridMenuItems(props) {
11
+ function SortGridMenuItems(props) {
12
+ var _column$sortingOrder;
13
+
11
14
  var column = props.column,
12
15
  onClick = props.onClick;
13
16
  var apiRef = useGridApiContext();
14
17
  var sortModel = useGridSelector(apiRef, gridSortModelSelector);
18
+ var rootProps = useGridRootProps();
19
+ var sortingOrder = (_column$sortingOrder = column.sortingOrder) != null ? _column$sortingOrder : rootProps.sortingOrder;
15
20
  var sortDirection = React.useMemo(function () {
16
21
  if (!column) {
17
22
  return null;
@@ -33,23 +38,23 @@ var SortGridMenuItems = function SortGridMenuItems(props) {
33
38
  }
34
39
 
35
40
  return /*#__PURE__*/_jsxs(React.Fragment, {
36
- children: [/*#__PURE__*/_jsx(MenuItem, {
41
+ children: [sortingOrder.includes(null) ? /*#__PURE__*/_jsx(MenuItem, {
37
42
  onClick: onSortMenuItemClick,
38
43
  disabled: sortDirection == null,
39
44
  children: apiRef.current.getLocaleText('columnMenuUnsort')
40
- }), /*#__PURE__*/_jsx(MenuItem, {
45
+ }) : null, sortingOrder.includes('asc') ? /*#__PURE__*/_jsx(MenuItem, {
41
46
  onClick: onSortMenuItemClick,
42
47
  "data-value": "asc",
43
48
  disabled: sortDirection === 'asc',
44
49
  children: apiRef.current.getLocaleText('columnMenuSortAsc')
45
- }), /*#__PURE__*/_jsx(MenuItem, {
50
+ }) : null, sortingOrder.includes('desc') ? /*#__PURE__*/_jsx(MenuItem, {
46
51
  onClick: onSortMenuItemClick,
47
52
  "data-value": "desc",
48
53
  disabled: sortDirection === 'desc',
49
54
  children: apiRef.current.getLocaleText('columnMenuSortDesc')
50
- })]
55
+ }) : null]
51
56
  });
52
- };
57
+ }
53
58
 
54
59
  process.env.NODE_ENV !== "production" ? SortGridMenuItems.propTypes = {
55
60
  // ----------------------------- Warning --------------------------------
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  var _excluded = ["style"];
5
5
  import * as React from 'react';
6
6
  import * as ReactDOM from 'react-dom';
7
- import { useForkRef } from '@mui/material/utils';
7
+ import { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
8
8
  import { useGridApiContext } from '../../utils/useGridApiContext';
9
9
  import { useGridRootProps } from '../../utils/useGridRootProps';
10
10
  import { useGridSelector } from '../../utils/useGridSelector';
@@ -174,7 +174,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
174
174
  lastColumnIndex: lastColumnIndex
175
175
  };
176
176
  }, [disableVirtualization, getNearestIndexToRender, rowsMeta.positions.length, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerWidth]);
177
- React.useEffect(function () {
177
+ useEnhancedEffect(function () {
178
178
  if (disableVirtualization) {
179
179
  renderZoneRef.current.style.transform = "translate3d(0px, 0px, 0px)";
180
180
  } else {
@@ -183,7 +183,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
183
183
  rootRef.current.scrollTop = 0;
184
184
  }
185
185
  }, [disableVirtualization]);
186
- React.useEffect(function () {
186
+ useEnhancedEffect(function () {
187
187
  setContainerWidth(rootRef.current.clientWidth);
188
188
  }, [rowsMeta.currentPageTotalHeight]);
189
189
  var handleResize = React.useCallback(function (params) {
@@ -256,7 +256,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
256
256
  });
257
257
  prevRenderContext.current = nextRenderContext;
258
258
  }, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
259
- React.useEffect(function () {
259
+ useEnhancedEffect(function () {
260
260
  if (containerWidth == null) {
261
261
  return;
262
262
  }
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.14
1
+ /** @license MUI v5.17.17
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -50,7 +50,7 @@ var ruRUGrid = {
50
50
  // Filter panel text
51
51
  filterPanelAddFilter: 'Добавить фильтр',
52
52
  filterPanelDeleteIconLabel: 'Удалить',
53
- // filterPanelLinkOperator: 'Logic operator',
53
+ filterPanelLinkOperator: 'Логические операторы',
54
54
  filterPanelOperators: 'Операторы',
55
55
  // TODO v6: rename to filterPanelOperator
56
56
  filterPanelOperatorAnd: 'И',
@@ -120,10 +120,10 @@ var ruRUGrid = {
120
120
  },
121
121
  // Checkbox selection text
122
122
  checkboxSelectionHeaderName: 'Выбор флажка',
123
- // checkboxSelectionSelectAllRows: 'Select all rows',
124
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
125
- // checkboxSelectionSelectRow: 'Select row',
126
- // checkboxSelectionUnselectRow: 'Unselect row',
123
+ checkboxSelectionSelectAllRows: 'Выбрать все строки',
124
+ checkboxSelectionUnselectAllRows: 'Отменить выбор всех строк',
125
+ checkboxSelectionSelectRow: 'Выбрать строку',
126
+ checkboxSelectionUnselectRow: 'Отменить выбор строки',
127
127
  // Boolean cell text
128
128
  booleanCellTrueLabel: 'истина',
129
129
  booleanCellFalseLabel: 'ложь',
@@ -146,17 +146,17 @@ var ruRUGrid = {
146
146
  return "\u0420\u0430\u0437\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E ".concat(name);
147
147
  },
148
148
  // Master/detail
149
- // detailPanelToggle: 'Detail panel toggle',
149
+ detailPanelToggle: 'Детали',
150
150
  expandDetailPanel: 'Развернуть',
151
- collapseDetailPanel: 'Свернуть' // Row reordering text
152
- // rowReorderingHeaderName: 'Row reordering',
151
+ collapseDetailPanel: 'Свернуть',
152
+ // Row reordering text
153
+ rowReorderingHeaderName: 'Изменение порядка строк',
153
154
  // Aggregation
154
- // aggregationMenuItemHeader: 'Aggregation',
155
- // aggregationFunctionLabelSum: 'sum',
156
- // aggregationFunctionLabelAvg: 'avg',
157
- // aggregationFunctionLabelMin: 'min',
158
- // aggregationFunctionLabelMax: 'max',
159
- // aggregationFunctionLabelSize: 'size',
160
-
155
+ aggregationMenuItemHeader: 'Объединение данных',
156
+ aggregationFunctionLabelSum: 'сумм',
157
+ aggregationFunctionLabelAvg: 'срзнач',
158
+ aggregationFunctionLabelMin: 'мин',
159
+ aggregationFunctionLabelMax: 'макс',
160
+ aggregationFunctionLabelSize: 'счет'
161
161
  };
162
162
  export var ruRU = getGridLocalization(ruRUGrid, ruRUCore);
package/locales/ruRU.js CHANGED
@@ -50,7 +50,7 @@ const ruRUGrid = {
50
50
  // Filter panel text
51
51
  filterPanelAddFilter: 'Добавить фильтр',
52
52
  filterPanelDeleteIconLabel: 'Удалить',
53
- // filterPanelLinkOperator: 'Logic operator',
53
+ filterPanelLinkOperator: 'Логические операторы',
54
54
  filterPanelOperators: 'Операторы',
55
55
  // TODO v6: rename to filterPanelOperator
56
56
  filterPanelOperatorAnd: 'И',
@@ -118,10 +118,10 @@ const ruRUGrid = {
118
118
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} из ${totalCount.toLocaleString()}`,
119
119
  // Checkbox selection text
120
120
  checkboxSelectionHeaderName: 'Выбор флажка',
121
- // checkboxSelectionSelectAllRows: 'Select all rows',
122
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
123
- // checkboxSelectionSelectRow: 'Select row',
124
- // checkboxSelectionUnselectRow: 'Unselect row',
121
+ checkboxSelectionSelectAllRows: 'Выбрать все строки',
122
+ checkboxSelectionUnselectAllRows: 'Отменить выбор всех строк',
123
+ checkboxSelectionSelectRow: 'Выбрать строку',
124
+ checkboxSelectionUnselectRow: 'Отменить выбор строки',
125
125
  // Boolean cell text
126
126
  booleanCellTrueLabel: 'истина',
127
127
  booleanCellFalseLabel: 'ложь',
@@ -140,17 +140,17 @@ const ruRUGrid = {
140
140
  groupColumn: name => `Сгруппировать по ${name}`,
141
141
  unGroupColumn: name => `Разгруппировать по ${name}`,
142
142
  // Master/detail
143
- // detailPanelToggle: 'Detail panel toggle',
143
+ detailPanelToggle: 'Детали',
144
144
  expandDetailPanel: 'Развернуть',
145
- collapseDetailPanel: 'Свернуть' // Row reordering text
146
- // rowReorderingHeaderName: 'Row reordering',
145
+ collapseDetailPanel: 'Свернуть',
146
+ // Row reordering text
147
+ rowReorderingHeaderName: 'Изменение порядка строк',
147
148
  // Aggregation
148
- // aggregationMenuItemHeader: 'Aggregation',
149
- // aggregationFunctionLabelSum: 'sum',
150
- // aggregationFunctionLabelAvg: 'avg',
151
- // aggregationFunctionLabelMin: 'min',
152
- // aggregationFunctionLabelMax: 'max',
153
- // aggregationFunctionLabelSize: 'size',
154
-
149
+ aggregationMenuItemHeader: 'Объединение данных',
150
+ aggregationFunctionLabelSum: 'сумм',
151
+ aggregationFunctionLabelAvg: 'срзнач',
152
+ aggregationFunctionLabelMin: 'мин',
153
+ aggregationFunctionLabelMax: 'макс',
154
+ aggregationFunctionLabelSize: 'счет'
155
155
  };
156
156
  export const ruRU = getGridLocalization(ruRUGrid, ruRUCore);
@@ -4,16 +4,19 @@ import MenuItem from '@mui/material/MenuItem';
4
4
  import { useGridSelector } from '../../../hooks/utils/useGridSelector';
5
5
  import { gridSortModelSelector } from '../../../hooks/features/sorting/gridSortingSelector';
6
6
  import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
7
+ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
 
10
- const SortGridMenuItems = props => {
11
+ function SortGridMenuItems(props) {
11
12
  const {
12
13
  column,
13
14
  onClick
14
15
  } = props;
15
16
  const apiRef = useGridApiContext();
16
17
  const sortModel = useGridSelector(apiRef, gridSortModelSelector);
18
+ const rootProps = useGridRootProps();
19
+ const sortingOrder = column.sortingOrder ?? rootProps.sortingOrder;
17
20
  const sortDirection = React.useMemo(() => {
18
21
  if (!column) {
19
22
  return null;
@@ -33,23 +36,23 @@ const SortGridMenuItems = props => {
33
36
  }
34
37
 
35
38
  return /*#__PURE__*/_jsxs(React.Fragment, {
36
- children: [/*#__PURE__*/_jsx(MenuItem, {
39
+ children: [sortingOrder.includes(null) ? /*#__PURE__*/_jsx(MenuItem, {
37
40
  onClick: onSortMenuItemClick,
38
41
  disabled: sortDirection == null,
39
42
  children: apiRef.current.getLocaleText('columnMenuUnsort')
40
- }), /*#__PURE__*/_jsx(MenuItem, {
43
+ }) : null, sortingOrder.includes('asc') ? /*#__PURE__*/_jsx(MenuItem, {
41
44
  onClick: onSortMenuItemClick,
42
45
  "data-value": "asc",
43
46
  disabled: sortDirection === 'asc',
44
47
  children: apiRef.current.getLocaleText('columnMenuSortAsc')
45
- }), /*#__PURE__*/_jsx(MenuItem, {
48
+ }) : null, sortingOrder.includes('desc') ? /*#__PURE__*/_jsx(MenuItem, {
46
49
  onClick: onSortMenuItemClick,
47
50
  "data-value": "desc",
48
51
  disabled: sortDirection === 'desc',
49
52
  children: apiRef.current.getLocaleText('columnMenuSortDesc')
50
- })]
53
+ }) : null]
51
54
  });
52
- };
55
+ }
53
56
 
54
57
  process.env.NODE_ENV !== "production" ? SortGridMenuItems.propTypes = {
55
58
  // ----------------------------- Warning --------------------------------
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["style"];
4
4
  import * as React from 'react';
5
5
  import * as ReactDOM from 'react-dom';
6
- import { useForkRef } from '@mui/material/utils';
6
+ import { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
7
7
  import { useGridApiContext } from '../../utils/useGridApiContext';
8
8
  import { useGridRootProps } from '../../utils/useGridRootProps';
9
9
  import { useGridSelector } from '../../utils/useGridSelector';
@@ -154,7 +154,7 @@ export const useGridVirtualScroller = props => {
154
154
  lastColumnIndex
155
155
  };
156
156
  }, [disableVirtualization, getNearestIndexToRender, rowsMeta.positions.length, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerWidth]);
157
- React.useEffect(() => {
157
+ useEnhancedEffect(() => {
158
158
  if (disableVirtualization) {
159
159
  renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
160
160
  } else {
@@ -163,7 +163,7 @@ export const useGridVirtualScroller = props => {
163
163
  rootRef.current.scrollTop = 0;
164
164
  }
165
165
  }, [disableVirtualization]);
166
- React.useEffect(() => {
166
+ useEnhancedEffect(() => {
167
167
  setContainerWidth(rootRef.current.clientWidth);
168
168
  }, [rowsMeta.currentPageTotalHeight]);
169
169
  const handleResize = React.useCallback(params => {
@@ -224,7 +224,7 @@ export const useGridVirtualScroller = props => {
224
224
  });
225
225
  prevRenderContext.current = nextRenderContext;
226
226
  }, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
227
- React.useEffect(() => {
227
+ useEnhancedEffect(() => {
228
228
  if (containerWidth == null) {
229
229
  return;
230
230
  }
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.14
1
+ /** @license MUI v5.17.17
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -50,7 +50,7 @@ const ruRUGrid = {
50
50
  // Filter panel text
51
51
  filterPanelAddFilter: 'Добавить фильтр',
52
52
  filterPanelDeleteIconLabel: 'Удалить',
53
- // filterPanelLinkOperator: 'Logic operator',
53
+ filterPanelLinkOperator: 'Логические операторы',
54
54
  filterPanelOperators: 'Операторы',
55
55
  // TODO v6: rename to filterPanelOperator
56
56
  filterPanelOperatorAnd: 'И',
@@ -118,10 +118,10 @@ const ruRUGrid = {
118
118
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} из ${totalCount.toLocaleString()}`,
119
119
  // Checkbox selection text
120
120
  checkboxSelectionHeaderName: 'Выбор флажка',
121
- // checkboxSelectionSelectAllRows: 'Select all rows',
122
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
123
- // checkboxSelectionSelectRow: 'Select row',
124
- // checkboxSelectionUnselectRow: 'Unselect row',
121
+ checkboxSelectionSelectAllRows: 'Выбрать все строки',
122
+ checkboxSelectionUnselectAllRows: 'Отменить выбор всех строк',
123
+ checkboxSelectionSelectRow: 'Выбрать строку',
124
+ checkboxSelectionUnselectRow: 'Отменить выбор строки',
125
125
  // Boolean cell text
126
126
  booleanCellTrueLabel: 'истина',
127
127
  booleanCellFalseLabel: 'ложь',
@@ -140,17 +140,17 @@ const ruRUGrid = {
140
140
  groupColumn: name => `Сгруппировать по ${name}`,
141
141
  unGroupColumn: name => `Разгруппировать по ${name}`,
142
142
  // Master/detail
143
- // detailPanelToggle: 'Detail panel toggle',
143
+ detailPanelToggle: 'Детали',
144
144
  expandDetailPanel: 'Развернуть',
145
- collapseDetailPanel: 'Свернуть' // Row reordering text
146
- // rowReorderingHeaderName: 'Row reordering',
145
+ collapseDetailPanel: 'Свернуть',
146
+ // Row reordering text
147
+ rowReorderingHeaderName: 'Изменение порядка строк',
147
148
  // Aggregation
148
- // aggregationMenuItemHeader: 'Aggregation',
149
- // aggregationFunctionLabelSum: 'sum',
150
- // aggregationFunctionLabelAvg: 'avg',
151
- // aggregationFunctionLabelMin: 'min',
152
- // aggregationFunctionLabelMax: 'max',
153
- // aggregationFunctionLabelSize: 'size',
154
-
149
+ aggregationMenuItemHeader: 'Объединение данных',
150
+ aggregationFunctionLabelSum: 'сумм',
151
+ aggregationFunctionLabelAvg: 'срзнач',
152
+ aggregationFunctionLabelMin: 'мин',
153
+ aggregationFunctionLabelMax: 'макс',
154
+ aggregationFunctionLabelSize: 'счет'
155
155
  };
156
156
  export const ruRU = getGridLocalization(ruRUGrid, ruRUCore);
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.SortGridMenuItems = void 0;
8
+ exports.SortGridMenuItems = SortGridMenuItems;
9
9
 
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
 
@@ -19,19 +19,25 @@ var _gridSortingSelector = require("../../../hooks/features/sorting/gridSortingS
19
19
 
20
20
  var _useGridApiContext = require("../../../hooks/utils/useGridApiContext");
21
21
 
22
+ var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
23
+
22
24
  var _jsxRuntime = require("react/jsx-runtime");
23
25
 
24
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
27
 
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
29
 
28
- const SortGridMenuItems = props => {
30
+ function SortGridMenuItems(props) {
31
+ var _column$sortingOrder;
32
+
29
33
  const {
30
34
  column,
31
35
  onClick
32
36
  } = props;
33
37
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
34
38
  const sortModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortModelSelector);
39
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
40
+ const sortingOrder = (_column$sortingOrder = column.sortingOrder) != null ? _column$sortingOrder : rootProps.sortingOrder;
35
41
  const sortDirection = React.useMemo(() => {
36
42
  if (!column) {
37
43
  return null;
@@ -51,25 +57,24 @@ const SortGridMenuItems = props => {
51
57
  }
52
58
 
53
59
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
54
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
60
+ children: [sortingOrder.includes(null) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
55
61
  onClick: onSortMenuItemClick,
56
62
  disabled: sortDirection == null,
57
63
  children: apiRef.current.getLocaleText('columnMenuUnsort')
58
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
64
+ }) : null, sortingOrder.includes('asc') ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
59
65
  onClick: onSortMenuItemClick,
60
66
  "data-value": "asc",
61
67
  disabled: sortDirection === 'asc',
62
68
  children: apiRef.current.getLocaleText('columnMenuSortAsc')
63
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
69
+ }) : null, sortingOrder.includes('desc') ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
64
70
  onClick: onSortMenuItemClick,
65
71
  "data-value": "desc",
66
72
  disabled: sortDirection === 'desc',
67
73
  children: apiRef.current.getLocaleText('columnMenuSortDesc')
68
- })]
74
+ }) : null]
69
75
  });
70
- };
76
+ }
71
77
 
72
- exports.SortGridMenuItems = SortGridMenuItems;
73
78
  process.env.NODE_ENV !== "production" ? SortGridMenuItems.propTypes = {
74
79
  // ----------------------------- Warning --------------------------------
75
80
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -195,7 +195,7 @@ const useGridVirtualScroller = props => {
195
195
  lastColumnIndex
196
196
  };
197
197
  }, [disableVirtualization, getNearestIndexToRender, rowsMeta.positions.length, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerWidth]);
198
- React.useEffect(() => {
198
+ (0, _utils.unstable_useEnhancedEffect)(() => {
199
199
  if (disableVirtualization) {
200
200
  renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
201
201
  } else {
@@ -204,7 +204,7 @@ const useGridVirtualScroller = props => {
204
204
  rootRef.current.scrollTop = 0;
205
205
  }
206
206
  }, [disableVirtualization]);
207
- React.useEffect(() => {
207
+ (0, _utils.unstable_useEnhancedEffect)(() => {
208
208
  setContainerWidth(rootRef.current.clientWidth);
209
209
  }, [rowsMeta.currentPageTotalHeight]);
210
210
  const handleResize = React.useCallback(params => {
@@ -265,7 +265,7 @@ const useGridVirtualScroller = props => {
265
265
  });
266
266
  prevRenderContext.current = nextRenderContext;
267
267
  }, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
268
- React.useEffect(() => {
268
+ (0, _utils.unstable_useEnhancedEffect)(() => {
269
269
  if (containerWidth == null) {
270
270
  return;
271
271
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.14
1
+ /** @license MUI v5.17.17
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -59,7 +59,7 @@ const ruRUGrid = {
59
59
  // Filter panel text
60
60
  filterPanelAddFilter: 'Добавить фильтр',
61
61
  filterPanelDeleteIconLabel: 'Удалить',
62
- // filterPanelLinkOperator: 'Logic operator',
62
+ filterPanelLinkOperator: 'Логические операторы',
63
63
  filterPanelOperators: 'Операторы',
64
64
  // TODO v6: rename to filterPanelOperator
65
65
  filterPanelOperatorAnd: 'И',
@@ -127,10 +127,10 @@ const ruRUGrid = {
127
127
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} из ${totalCount.toLocaleString()}`,
128
128
  // Checkbox selection text
129
129
  checkboxSelectionHeaderName: 'Выбор флажка',
130
- // checkboxSelectionSelectAllRows: 'Select all rows',
131
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
132
- // checkboxSelectionSelectRow: 'Select row',
133
- // checkboxSelectionUnselectRow: 'Unselect row',
130
+ checkboxSelectionSelectAllRows: 'Выбрать все строки',
131
+ checkboxSelectionUnselectAllRows: 'Отменить выбор всех строк',
132
+ checkboxSelectionSelectRow: 'Выбрать строку',
133
+ checkboxSelectionUnselectRow: 'Отменить выбор строки',
134
134
  // Boolean cell text
135
135
  booleanCellTrueLabel: 'истина',
136
136
  booleanCellFalseLabel: 'ложь',
@@ -149,18 +149,18 @@ const ruRUGrid = {
149
149
  groupColumn: name => `Сгруппировать по ${name}`,
150
150
  unGroupColumn: name => `Разгруппировать по ${name}`,
151
151
  // Master/detail
152
- // detailPanelToggle: 'Detail panel toggle',
152
+ detailPanelToggle: 'Детали',
153
153
  expandDetailPanel: 'Развернуть',
154
- collapseDetailPanel: 'Свернуть' // Row reordering text
155
- // rowReorderingHeaderName: 'Row reordering',
154
+ collapseDetailPanel: 'Свернуть',
155
+ // Row reordering text
156
+ rowReorderingHeaderName: 'Изменение порядка строк',
156
157
  // Aggregation
157
- // aggregationMenuItemHeader: 'Aggregation',
158
- // aggregationFunctionLabelSum: 'sum',
159
- // aggregationFunctionLabelAvg: 'avg',
160
- // aggregationFunctionLabelMin: 'min',
161
- // aggregationFunctionLabelMax: 'max',
162
- // aggregationFunctionLabelSize: 'size',
163
-
158
+ aggregationMenuItemHeader: 'Объединение данных',
159
+ aggregationFunctionLabelSum: 'сумм',
160
+ aggregationFunctionLabelAvg: 'срзнач',
161
+ aggregationFunctionLabelMin: 'мин',
162
+ aggregationFunctionLabelMax: 'макс',
163
+ aggregationFunctionLabelSize: 'счет'
164
164
  };
165
165
  const ruRU = (0, _getGridLocalization.getGridLocalization)(ruRUGrid, _locale.ruRU);
166
166
  exports.ruRU = ruRU;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "5.17.14",
3
+ "version": "5.17.17",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",