@mui/x-data-grid 5.17.13 → 5.17.16

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,77 @@
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.16
7
+
8
+ _Dec 16, 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
+ - 🐞 Bugfixes
13
+
14
+ ### `@mui/x-data-grid@v5.17.16` / `@mui/x-data-grid-pro@v5.17.16` / `@mui/x-data-grid-premium@v5.17.16`
15
+
16
+ #### Changes
17
+
18
+ - [DataGrid] Display sort column menu items as per `sortingOrder` prop (#7125) @hanbin9775
19
+ - [DataGrid] Fix flickering on mount (#7155) @cherniavskii
20
+ - [DataGridPremium] Use separate cache for aggregation columns pre-processor (#7174) @m4theushw
21
+
22
+ ### `@mui/x-date-pickers@v5.0.11` / `@mui/x-date-pickers-pro@v5.0.11`
23
+
24
+ #### Changes
25
+
26
+ - [DateTimePicker] Update export pattern (#7172) @kealjones-wk
27
+
28
+ ### Docs
29
+
30
+ - [docs] Document aggregation selectors (#7151) @cherniavskii
31
+
32
+ ## 5.17.15
33
+
34
+ _Dec 8, 2022_
35
+
36
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
37
+
38
+ - ✨ Fix lazy-loading not working in `DataGridPremium` (#7130) @m4theushw
39
+ - 🐞 Bugfixes
40
+
41
+ ### `@mui/x-data-grid@v5.17.15` / `@mui/x-data-grid-pro@v5.17.15` / `@mui/x-data-grid-premium@v5.17.15`
42
+
43
+ #### Changes
44
+
45
+ - [DataGridPremium] Add support for lazy-loading (#7130) @m4theushw
46
+ - [DataGridPremium] Pass `groupId` to the aggregation function (#7143) @m4theushw
47
+
48
+ ### `@mui/x-date-pickers@v5.0.10` / `@mui/x-date-pickers-pro@v5.0.10`
49
+
50
+ #### Changes
51
+
52
+ - [pickers] Initialize date without time when selecting year or month (#7136) @LukasTy
53
+
54
+ ### Docs
55
+
56
+ - [docs] Fix the nested import on the api pages (#7134) @flaviendelangle
57
+ - [docs] Keep track of the localization completion (#7099) @alexfauquette
58
+ - [docs] Update localization doc to use existing locale (#7104) @LukasTy
59
+
60
+ ## 5.17.14
61
+
62
+ _Dec 1, 2022_
63
+
64
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
65
+
66
+ - 🌍 Improve Ukrainian (uk-UA) locale (#7035) @rettoua
67
+ - 🐞 Bugfixes
68
+
69
+ ### `@mui/x-data-grid@v5.17.14` / `@mui/x-data-grid-pro@v5.17.14` / `@mui/x-data-grid-premium@v5.17.14`
70
+
71
+ #### Changes
72
+
73
+ - [DataGrid] Fix row selection when clicking blank cell (#7056) @yami03
74
+ - [DataGridPremium] Update cache before hydrating columns (#7043) @m4theushw
75
+ - [l10n] Improve Ukrainian (uk-UA) locale (#7035) @rettoua
76
+
6
77
  ## 5.17.13
7
78
 
8
79
  _Nov 24, 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 --------------------------------
@@ -13,6 +13,7 @@ import { GridCellModes } from '../../../models/gridEditRowModel';
13
13
  import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
14
14
  import { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';
15
15
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
16
+ import { gridClasses } from '../../../constants/gridClasses';
16
17
 
17
18
  const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
18
19
  if (selectionModelProp == null) {
@@ -248,30 +249,36 @@ export const useGridSelection = (apiRef, props) => {
248
249
  apiRef.current.selectRow(id, !isSelected, false);
249
250
  }
250
251
  }, [apiRef, canHaveMultipleSelection, checkboxSelection]);
251
- const handleCellClick = React.useCallback((params, event) => {
252
+ const handleRowClick = React.useCallback((params, event) => {
253
+ var _closest;
254
+
252
255
  if (disableSelectionOnClick) {
253
256
  return;
254
257
  }
255
258
 
256
- if (params.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
259
+ const field = (_closest = event.target.closest(`.${gridClasses.cell}`)) == null ? void 0 : _closest.getAttribute('data-field');
260
+
261
+ if (field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
257
262
  // click on checkbox should not trigger row selection
258
263
  return;
259
264
  }
260
265
 
261
- if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
266
+ if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
262
267
  // click to open the detail panel should not select the row
263
268
  return;
264
269
  }
265
270
 
266
- if (params.field) {
267
- const column = apiRef.current.getColumn(params.field);
271
+ if (field) {
272
+ const column = apiRef.current.getColumn(field);
268
273
 
269
274
  if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
270
275
  return;
271
276
  }
272
277
  }
273
278
 
274
- if (params.rowNode.isPinned) {
279
+ const rowNode = apiRef.current.getRowNode(params.id);
280
+
281
+ if (rowNode.isPinned) {
275
282
  return;
276
283
  }
277
284
 
@@ -371,7 +378,7 @@ export const useGridSelection = (apiRef, props) => {
371
378
  }
372
379
  }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);
373
380
  useGridApiEventHandler(apiRef, 'sortedRowsSet', removeOutdatedSelection);
374
- useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);
381
+ useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
375
382
  useGridApiEventHandler(apiRef, 'rowSelectionCheckboxChange', handleRowSelectionCheckboxChange);
376
383
  useGridApiEventHandler(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);
377
384
  useGridApiEventHandler(apiRef, 'cellMouseDown', preventSelectionOnShift);
@@ -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.13
1
+ /** @license MUI v5.17.16
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 --------------------------------
@@ -14,6 +14,7 @@ import { GridCellModes } from '../../../models/gridEditRowModel';
14
14
  import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
15
15
  import { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';
16
16
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
17
+ import { gridClasses } from '../../../constants/gridClasses';
17
18
 
18
19
  var getSelectionModelPropValue = function getSelectionModelPropValue(selectionModelProp, prevSelectionModel) {
19
20
  if (selectionModelProp == null) {
@@ -273,30 +274,36 @@ export var useGridSelection = function useGridSelection(apiRef, props) {
273
274
  apiRef.current.selectRow(id, !isSelected, false);
274
275
  }
275
276
  }, [apiRef, canHaveMultipleSelection, checkboxSelection]);
276
- var handleCellClick = React.useCallback(function (params, event) {
277
+ var handleRowClick = React.useCallback(function (params, event) {
278
+ var _closest;
279
+
277
280
  if (disableSelectionOnClick) {
278
281
  return;
279
282
  }
280
283
 
281
- if (params.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
284
+ var field = (_closest = event.target.closest(".".concat(gridClasses.cell))) == null ? void 0 : _closest.getAttribute('data-field');
285
+
286
+ if (field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
282
287
  // click on checkbox should not trigger row selection
283
288
  return;
284
289
  }
285
290
 
286
- if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
291
+ if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
287
292
  // click to open the detail panel should not select the row
288
293
  return;
289
294
  }
290
295
 
291
- if (params.field) {
292
- var column = apiRef.current.getColumn(params.field);
296
+ if (field) {
297
+ var column = apiRef.current.getColumn(field);
293
298
 
294
299
  if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
295
300
  return;
296
301
  }
297
302
  }
298
303
 
299
- if (params.rowNode.isPinned) {
304
+ var rowNode = apiRef.current.getRowNode(params.id);
305
+
306
+ if (rowNode.isPinned) {
300
307
  return;
301
308
  }
302
309
 
@@ -398,7 +405,7 @@ export var useGridSelection = function useGridSelection(apiRef, props) {
398
405
  }
399
406
  }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);
400
407
  useGridApiEventHandler(apiRef, 'sortedRowsSet', removeOutdatedSelection);
401
- useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);
408
+ useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
402
409
  useGridApiEventHandler(apiRef, 'rowSelectionCheckboxChange', handleRowSelectionCheckboxChange);
403
410
  useGridApiEventHandler(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);
404
411
  useGridApiEventHandler(apiRef, 'cellMouseDown', preventSelectionOnShift);
@@ -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.13
1
+ /** @license MUI v5.17.16
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.
@@ -41,15 +41,15 @@ var ukUAGrid = {
41
41
  });
42
42
  },
43
43
  // Quick filter toolbar field
44
- // toolbarQuickFilterPlaceholder: 'Search…',
45
- // toolbarQuickFilterLabel: 'Search',
46
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
44
+ toolbarQuickFilterPlaceholder: 'Пошук…',
45
+ toolbarQuickFilterLabel: 'Пошук',
46
+ toolbarQuickFilterDeleteIconLabel: 'Очистити',
47
47
  // Export selector toolbar button text
48
48
  toolbarExport: 'Експорт',
49
49
  toolbarExportLabel: 'Експорт',
50
50
  toolbarExportCSV: 'Завантажити у форматі CSV',
51
51
  toolbarExportPrint: 'Друк',
52
- // toolbarExportExcel: 'Download as Excel',
52
+ toolbarExportExcel: 'Завантажити у форматі Excel',
53
53
  // Columns panel text
54
54
  columnsPanelTextFieldLabel: 'Знайти стовпець',
55
55
  columnsPanelTextFieldPlaceholder: 'Заголовок стовпця',
@@ -59,7 +59,7 @@ var ukUAGrid = {
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: 'І',
@@ -80,7 +80,7 @@ var ukUAGrid = {
80
80
  filterOperatorOnOrBefore: 'менше або дорівнює',
81
81
  filterOperatorIsEmpty: 'порожній',
82
82
  filterOperatorIsNotEmpty: 'не порожній',
83
- // filterOperatorIsAnyOf: 'is any of',
83
+ filterOperatorIsAnyOf: 'будь-що із',
84
84
  // Filter values text
85
85
  filterValueAny: 'будь-який',
86
86
  filterValueTrue: 'так',
@@ -119,10 +119,10 @@ var ukUAGrid = {
119
119
  },
120
120
  // Checkbox selection text
121
121
  checkboxSelectionHeaderName: 'Вибір прапорця',
122
- // checkboxSelectionSelectAllRows: 'Select all rows',
123
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
124
- // checkboxSelectionSelectRow: 'Select row',
125
- // checkboxSelectionUnselectRow: 'Unselect row',
122
+ checkboxSelectionSelectAllRows: 'Вибрати всі рядки',
123
+ checkboxSelectionUnselectAllRows: 'Скасувати вибір всіх рядків',
124
+ checkboxSelectionSelectRow: 'Вибрати рядок',
125
+ checkboxSelectionUnselectRow: 'Скасувати вибір рядка',
126
126
  // Boolean cell text
127
127
  booleanCellTrueLabel: 'так',
128
128
  booleanCellFalseLabel: 'ні',
@@ -135,19 +135,23 @@ var ukUAGrid = {
135
135
  // Tree Data
136
136
  treeDataGroupingHeaderName: 'Група',
137
137
  treeDataExpand: 'показати дочірні елементи',
138
- treeDataCollapse: 'приховати дочірні елементи' // Grouping columns
139
- // groupingColumnHeaderName: 'Group',
140
- // groupColumn: name => `Group by ${name}`,
141
- // unGroupColumn: name => `Stop grouping by ${name}`,
138
+ treeDataCollapse: 'приховати дочірні елементи',
139
+ // Grouping columns
140
+ groupingColumnHeaderName: 'Група',
141
+ groupColumn: function groupColumn(name) {
142
+ return "\u0413\u0440\u0443\u043F\u0443\u0432\u0430\u0442\u0438 \u0437\u0430 ".concat(name);
143
+ },
144
+ unGroupColumn: function unGroupColumn(name) {
145
+ return "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u0433\u0440\u0443\u043F\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u0430 ".concat(name);
146
+ },
142
147
  // Master/detail
143
- // detailPanelToggle: 'Detail panel toggle',
144
- // expandDetailPanel: 'Expand',
145
- // collapseDetailPanel: 'Collapse',
148
+ detailPanelToggle: 'Перемикач панелі деталей',
149
+ expandDetailPanel: 'Показати',
150
+ collapseDetailPanel: 'Приховати',
146
151
  // Row reordering text
147
- // rowReorderingHeaderName: 'Row reordering',
152
+ rowReorderingHeaderName: 'Порядок рядків',
148
153
  // Aggregation
149
- // aggregationMenuItemHeader: 'Aggregation',
150
- // aggregationFunctionLabelSum: 'sum',
154
+ aggregationMenuItemHeader: 'Агрегація' // aggregationFunctionLabelSum: 'sum',
151
155
  // aggregationFunctionLabelAvg: 'avg',
152
156
  // aggregationFunctionLabelMin: 'min',
153
157
  // aggregationFunctionLabelMax: 'max',
package/locales/ukUA.js CHANGED
@@ -39,15 +39,15 @@ const ukUAGrid = {
39
39
  many: 'активних фільтрів'
40
40
  }),
41
41
  // Quick filter toolbar field
42
- // toolbarQuickFilterPlaceholder: 'Search…',
43
- // toolbarQuickFilterLabel: 'Search',
44
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
42
+ toolbarQuickFilterPlaceholder: 'Пошук…',
43
+ toolbarQuickFilterLabel: 'Пошук',
44
+ toolbarQuickFilterDeleteIconLabel: 'Очистити',
45
45
  // Export selector toolbar button text
46
46
  toolbarExport: 'Експорт',
47
47
  toolbarExportLabel: 'Експорт',
48
48
  toolbarExportCSV: 'Завантажити у форматі CSV',
49
49
  toolbarExportPrint: 'Друк',
50
- // toolbarExportExcel: 'Download as Excel',
50
+ toolbarExportExcel: 'Завантажити у форматі Excel',
51
51
  // Columns panel text
52
52
  columnsPanelTextFieldLabel: 'Знайти стовпець',
53
53
  columnsPanelTextFieldPlaceholder: 'Заголовок стовпця',
@@ -57,7 +57,7 @@ const ukUAGrid = {
57
57
  // Filter panel text
58
58
  filterPanelAddFilter: 'Додати фільтр',
59
59
  filterPanelDeleteIconLabel: 'Видалити',
60
- // filterPanelLinkOperator: 'Logic operator',
60
+ filterPanelLinkOperator: 'Логічна функція',
61
61
  filterPanelOperators: 'Оператори',
62
62
  // TODO v6: rename to filterPanelOperator
63
63
  filterPanelOperatorAnd: 'І',
@@ -78,7 +78,7 @@ const ukUAGrid = {
78
78
  filterOperatorOnOrBefore: 'менше або дорівнює',
79
79
  filterOperatorIsEmpty: 'порожній',
80
80
  filterOperatorIsNotEmpty: 'не порожній',
81
- // filterOperatorIsAnyOf: 'is any of',
81
+ filterOperatorIsAnyOf: 'будь-що із',
82
82
  // Filter values text
83
83
  filterValueAny: 'будь-який',
84
84
  filterValueTrue: 'так',
@@ -111,10 +111,10 @@ const ukUAGrid = {
111
111
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} з ${totalCount.toLocaleString()}`,
112
112
  // Checkbox selection text
113
113
  checkboxSelectionHeaderName: 'Вибір прапорця',
114
- // checkboxSelectionSelectAllRows: 'Select all rows',
115
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
116
- // checkboxSelectionSelectRow: 'Select row',
117
- // checkboxSelectionUnselectRow: 'Unselect row',
114
+ checkboxSelectionSelectAllRows: 'Вибрати всі рядки',
115
+ checkboxSelectionUnselectAllRows: 'Скасувати вибір всіх рядків',
116
+ checkboxSelectionSelectRow: 'Вибрати рядок',
117
+ checkboxSelectionUnselectRow: 'Скасувати вибір рядка',
118
118
  // Boolean cell text
119
119
  booleanCellTrueLabel: 'так',
120
120
  booleanCellFalseLabel: 'ні',
@@ -127,19 +127,19 @@ const ukUAGrid = {
127
127
  // Tree Data
128
128
  treeDataGroupingHeaderName: 'Група',
129
129
  treeDataExpand: 'показати дочірні елементи',
130
- treeDataCollapse: 'приховати дочірні елементи' // Grouping columns
131
- // groupingColumnHeaderName: 'Group',
132
- // groupColumn: name => `Group by ${name}`,
133
- // unGroupColumn: name => `Stop grouping by ${name}`,
130
+ treeDataCollapse: 'приховати дочірні елементи',
131
+ // Grouping columns
132
+ groupingColumnHeaderName: 'Група',
133
+ groupColumn: name => `Групувати за ${name}`,
134
+ unGroupColumn: name => `Відмінити групування за ${name}`,
134
135
  // Master/detail
135
- // detailPanelToggle: 'Detail panel toggle',
136
- // expandDetailPanel: 'Expand',
137
- // collapseDetailPanel: 'Collapse',
136
+ detailPanelToggle: 'Перемикач панелі деталей',
137
+ expandDetailPanel: 'Показати',
138
+ collapseDetailPanel: 'Приховати',
138
139
  // Row reordering text
139
- // rowReorderingHeaderName: 'Row reordering',
140
+ rowReorderingHeaderName: 'Порядок рядків',
140
141
  // Aggregation
141
- // aggregationMenuItemHeader: 'Aggregation',
142
- // aggregationFunctionLabelSum: 'sum',
142
+ aggregationMenuItemHeader: 'Агрегація' // aggregationFunctionLabelSum: 'sum',
143
143
  // aggregationFunctionLabelAvg: 'avg',
144
144
  // aggregationFunctionLabelMin: 'min',
145
145
  // aggregationFunctionLabelMax: 'max',
@@ -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 --------------------------------
@@ -13,6 +13,7 @@ import { GridCellModes } from '../../../models/gridEditRowModel';
13
13
  import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
14
14
  import { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';
15
15
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
16
+ import { gridClasses } from '../../../constants/gridClasses';
16
17
 
17
18
  const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
18
19
  if (selectionModelProp == null) {
@@ -242,30 +243,34 @@ export const useGridSelection = (apiRef, props) => {
242
243
  apiRef.current.selectRow(id, !isSelected, false);
243
244
  }
244
245
  }, [apiRef, canHaveMultipleSelection, checkboxSelection]);
245
- const handleCellClick = React.useCallback((params, event) => {
246
+ const handleRowClick = React.useCallback((params, event) => {
246
247
  if (disableSelectionOnClick) {
247
248
  return;
248
249
  }
249
250
 
250
- if (params.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
251
+ const field = event.target.closest(`.${gridClasses.cell}`)?.getAttribute('data-field');
252
+
253
+ if (field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
251
254
  // click on checkbox should not trigger row selection
252
255
  return;
253
256
  }
254
257
 
255
- if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
258
+ if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
256
259
  // click to open the detail panel should not select the row
257
260
  return;
258
261
  }
259
262
 
260
- if (params.field) {
261
- const column = apiRef.current.getColumn(params.field);
263
+ if (field) {
264
+ const column = apiRef.current.getColumn(field);
262
265
 
263
266
  if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
264
267
  return;
265
268
  }
266
269
  }
267
270
 
268
- if (params.rowNode.isPinned) {
271
+ const rowNode = apiRef.current.getRowNode(params.id);
272
+
273
+ if (rowNode.isPinned) {
269
274
  return;
270
275
  }
271
276
 
@@ -363,7 +368,7 @@ export const useGridSelection = (apiRef, props) => {
363
368
  }
364
369
  }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);
365
370
  useGridApiEventHandler(apiRef, 'sortedRowsSet', removeOutdatedSelection);
366
- useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);
371
+ useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
367
372
  useGridApiEventHandler(apiRef, 'rowSelectionCheckboxChange', handleRowSelectionCheckboxChange);
368
373
  useGridApiEventHandler(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);
369
374
  useGridApiEventHandler(apiRef, 'cellMouseDown', preventSelectionOnShift);
@@ -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.13
1
+ /** @license MUI v5.17.16
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.
@@ -39,15 +39,15 @@ const ukUAGrid = {
39
39
  many: 'активних фільтрів'
40
40
  }),
41
41
  // Quick filter toolbar field
42
- // toolbarQuickFilterPlaceholder: 'Search…',
43
- // toolbarQuickFilterLabel: 'Search',
44
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
42
+ toolbarQuickFilterPlaceholder: 'Пошук…',
43
+ toolbarQuickFilterLabel: 'Пошук',
44
+ toolbarQuickFilterDeleteIconLabel: 'Очистити',
45
45
  // Export selector toolbar button text
46
46
  toolbarExport: 'Експорт',
47
47
  toolbarExportLabel: 'Експорт',
48
48
  toolbarExportCSV: 'Завантажити у форматі CSV',
49
49
  toolbarExportPrint: 'Друк',
50
- // toolbarExportExcel: 'Download as Excel',
50
+ toolbarExportExcel: 'Завантажити у форматі Excel',
51
51
  // Columns panel text
52
52
  columnsPanelTextFieldLabel: 'Знайти стовпець',
53
53
  columnsPanelTextFieldPlaceholder: 'Заголовок стовпця',
@@ -57,7 +57,7 @@ const ukUAGrid = {
57
57
  // Filter panel text
58
58
  filterPanelAddFilter: 'Додати фільтр',
59
59
  filterPanelDeleteIconLabel: 'Видалити',
60
- // filterPanelLinkOperator: 'Logic operator',
60
+ filterPanelLinkOperator: 'Логічна функція',
61
61
  filterPanelOperators: 'Оператори',
62
62
  // TODO v6: rename to filterPanelOperator
63
63
  filterPanelOperatorAnd: 'І',
@@ -78,7 +78,7 @@ const ukUAGrid = {
78
78
  filterOperatorOnOrBefore: 'менше або дорівнює',
79
79
  filterOperatorIsEmpty: 'порожній',
80
80
  filterOperatorIsNotEmpty: 'не порожній',
81
- // filterOperatorIsAnyOf: 'is any of',
81
+ filterOperatorIsAnyOf: 'будь-що із',
82
82
  // Filter values text
83
83
  filterValueAny: 'будь-який',
84
84
  filterValueTrue: 'так',
@@ -111,10 +111,10 @@ const ukUAGrid = {
111
111
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} з ${totalCount.toLocaleString()}`,
112
112
  // Checkbox selection text
113
113
  checkboxSelectionHeaderName: 'Вибір прапорця',
114
- // checkboxSelectionSelectAllRows: 'Select all rows',
115
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
116
- // checkboxSelectionSelectRow: 'Select row',
117
- // checkboxSelectionUnselectRow: 'Unselect row',
114
+ checkboxSelectionSelectAllRows: 'Вибрати всі рядки',
115
+ checkboxSelectionUnselectAllRows: 'Скасувати вибір всіх рядків',
116
+ checkboxSelectionSelectRow: 'Вибрати рядок',
117
+ checkboxSelectionUnselectRow: 'Скасувати вибір рядка',
118
118
  // Boolean cell text
119
119
  booleanCellTrueLabel: 'так',
120
120
  booleanCellFalseLabel: 'ні',
@@ -127,19 +127,19 @@ const ukUAGrid = {
127
127
  // Tree Data
128
128
  treeDataGroupingHeaderName: 'Група',
129
129
  treeDataExpand: 'показати дочірні елементи',
130
- treeDataCollapse: 'приховати дочірні елементи' // Grouping columns
131
- // groupingColumnHeaderName: 'Group',
132
- // groupColumn: name => `Group by ${name}`,
133
- // unGroupColumn: name => `Stop grouping by ${name}`,
130
+ treeDataCollapse: 'приховати дочірні елементи',
131
+ // Grouping columns
132
+ groupingColumnHeaderName: 'Група',
133
+ groupColumn: name => `Групувати за ${name}`,
134
+ unGroupColumn: name => `Відмінити групування за ${name}`,
134
135
  // Master/detail
135
- // detailPanelToggle: 'Detail panel toggle',
136
- // expandDetailPanel: 'Expand',
137
- // collapseDetailPanel: 'Collapse',
136
+ detailPanelToggle: 'Перемикач панелі деталей',
137
+ expandDetailPanel: 'Показати',
138
+ collapseDetailPanel: 'Приховати',
138
139
  // Row reordering text
139
- // rowReorderingHeaderName: 'Row reordering',
140
+ rowReorderingHeaderName: 'Порядок рядків',
140
141
  // Aggregation
141
- // aggregationMenuItemHeader: 'Aggregation',
142
- // aggregationFunctionLabelSum: 'sum',
142
+ aggregationMenuItemHeader: 'Агрегація' // aggregationFunctionLabelSum: 'sum',
143
143
  // aggregationFunctionLabelAvg: 'avg',
144
144
  // aggregationFunctionLabelMin: 'min',
145
145
  // aggregationFunctionLabelMax: 'max',
@@ -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 |
@@ -37,6 +37,8 @@ var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
37
37
 
38
38
  var _gridDetailPanelToggleField = require("../../../constants/gridDetailPanelToggleField");
39
39
 
40
+ var _gridClasses = require("../../../constants/gridClasses");
41
+
40
42
  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); }
41
43
 
42
44
  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; }
@@ -276,30 +278,36 @@ const useGridSelection = (apiRef, props) => {
276
278
  apiRef.current.selectRow(id, !isSelected, false);
277
279
  }
278
280
  }, [apiRef, canHaveMultipleSelection, checkboxSelection]);
279
- const handleCellClick = React.useCallback((params, event) => {
281
+ const handleRowClick = React.useCallback((params, event) => {
282
+ var _closest;
283
+
280
284
  if (disableSelectionOnClick) {
281
285
  return;
282
286
  }
283
287
 
284
- if (params.field === _colDef.GRID_CHECKBOX_SELECTION_COL_DEF.field) {
288
+ const field = (_closest = event.target.closest(`.${_gridClasses.gridClasses.cell}`)) == null ? void 0 : _closest.getAttribute('data-field');
289
+
290
+ if (field === _colDef.GRID_CHECKBOX_SELECTION_COL_DEF.field) {
285
291
  // click on checkbox should not trigger row selection
286
292
  return;
287
293
  }
288
294
 
289
- if (params.field === _gridDetailPanelToggleField.GRID_DETAIL_PANEL_TOGGLE_FIELD) {
295
+ if (field === _gridDetailPanelToggleField.GRID_DETAIL_PANEL_TOGGLE_FIELD) {
290
296
  // click to open the detail panel should not select the row
291
297
  return;
292
298
  }
293
299
 
294
- if (params.field) {
295
- const column = apiRef.current.getColumn(params.field);
300
+ if (field) {
301
+ const column = apiRef.current.getColumn(field);
296
302
 
297
303
  if (column.type === _colDef.GRID_ACTIONS_COLUMN_TYPE) {
298
304
  return;
299
305
  }
300
306
  }
301
307
 
302
- if (params.rowNode.isPinned) {
308
+ const rowNode = apiRef.current.getRowNode(params.id);
309
+
310
+ if (rowNode.isPinned) {
303
311
  return;
304
312
  }
305
313
 
@@ -399,7 +407,7 @@ const useGridSelection = (apiRef, props) => {
399
407
  }
400
408
  }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);
401
409
  (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'sortedRowsSet', removeOutdatedSelection);
402
- (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'cellClick', handleCellClick);
410
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'rowClick', handleRowClick);
403
411
  (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'rowSelectionCheckboxChange', handleRowSelectionCheckboxChange);
404
412
  (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);
405
413
  (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'cellMouseDown', preventSelectionOnShift);
@@ -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.13
1
+ /** @license MUI v5.17.16
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.
@@ -47,15 +47,15 @@ const ukUAGrid = {
47
47
  many: 'активних фільтрів'
48
48
  }),
49
49
  // Quick filter toolbar field
50
- // toolbarQuickFilterPlaceholder: 'Search…',
51
- // toolbarQuickFilterLabel: 'Search',
52
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
50
+ toolbarQuickFilterPlaceholder: 'Пошук…',
51
+ toolbarQuickFilterLabel: 'Пошук',
52
+ toolbarQuickFilterDeleteIconLabel: 'Очистити',
53
53
  // Export selector toolbar button text
54
54
  toolbarExport: 'Експорт',
55
55
  toolbarExportLabel: 'Експорт',
56
56
  toolbarExportCSV: 'Завантажити у форматі CSV',
57
57
  toolbarExportPrint: 'Друк',
58
- // toolbarExportExcel: 'Download as Excel',
58
+ toolbarExportExcel: 'Завантажити у форматі Excel',
59
59
  // Columns panel text
60
60
  columnsPanelTextFieldLabel: 'Знайти стовпець',
61
61
  columnsPanelTextFieldPlaceholder: 'Заголовок стовпця',
@@ -65,7 +65,7 @@ const ukUAGrid = {
65
65
  // Filter panel text
66
66
  filterPanelAddFilter: 'Додати фільтр',
67
67
  filterPanelDeleteIconLabel: 'Видалити',
68
- // filterPanelLinkOperator: 'Logic operator',
68
+ filterPanelLinkOperator: 'Логічна функція',
69
69
  filterPanelOperators: 'Оператори',
70
70
  // TODO v6: rename to filterPanelOperator
71
71
  filterPanelOperatorAnd: 'І',
@@ -86,7 +86,7 @@ const ukUAGrid = {
86
86
  filterOperatorOnOrBefore: 'менше або дорівнює',
87
87
  filterOperatorIsEmpty: 'порожній',
88
88
  filterOperatorIsNotEmpty: 'не порожній',
89
- // filterOperatorIsAnyOf: 'is any of',
89
+ filterOperatorIsAnyOf: 'будь-що із',
90
90
  // Filter values text
91
91
  filterValueAny: 'будь-який',
92
92
  filterValueTrue: 'так',
@@ -119,10 +119,10 @@ const ukUAGrid = {
119
119
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} з ${totalCount.toLocaleString()}`,
120
120
  // Checkbox selection text
121
121
  checkboxSelectionHeaderName: 'Вибір прапорця',
122
- // checkboxSelectionSelectAllRows: 'Select all rows',
123
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
124
- // checkboxSelectionSelectRow: 'Select row',
125
- // checkboxSelectionUnselectRow: 'Unselect row',
122
+ checkboxSelectionSelectAllRows: 'Вибрати всі рядки',
123
+ checkboxSelectionUnselectAllRows: 'Скасувати вибір всіх рядків',
124
+ checkboxSelectionSelectRow: 'Вибрати рядок',
125
+ checkboxSelectionUnselectRow: 'Скасувати вибір рядка',
126
126
  // Boolean cell text
127
127
  booleanCellTrueLabel: 'так',
128
128
  booleanCellFalseLabel: 'ні',
@@ -135,19 +135,19 @@ const ukUAGrid = {
135
135
  // Tree Data
136
136
  treeDataGroupingHeaderName: 'Група',
137
137
  treeDataExpand: 'показати дочірні елементи',
138
- treeDataCollapse: 'приховати дочірні елементи' // Grouping columns
139
- // groupingColumnHeaderName: 'Group',
140
- // groupColumn: name => `Group by ${name}`,
141
- // unGroupColumn: name => `Stop grouping by ${name}`,
138
+ treeDataCollapse: 'приховати дочірні елементи',
139
+ // Grouping columns
140
+ groupingColumnHeaderName: 'Група',
141
+ groupColumn: name => `Групувати за ${name}`,
142
+ unGroupColumn: name => `Відмінити групування за ${name}`,
142
143
  // Master/detail
143
- // detailPanelToggle: 'Detail panel toggle',
144
- // expandDetailPanel: 'Expand',
145
- // collapseDetailPanel: 'Collapse',
144
+ detailPanelToggle: 'Перемикач панелі деталей',
145
+ expandDetailPanel: 'Показати',
146
+ collapseDetailPanel: 'Приховати',
146
147
  // Row reordering text
147
- // rowReorderingHeaderName: 'Row reordering',
148
+ rowReorderingHeaderName: 'Порядок рядків',
148
149
  // Aggregation
149
- // aggregationMenuItemHeader: 'Aggregation',
150
- // aggregationFunctionLabelSum: 'sum',
150
+ aggregationMenuItemHeader: 'Агрегація' // aggregationFunctionLabelSum: 'sum',
151
151
  // aggregationFunctionLabelAvg: 'avg',
152
152
  // aggregationFunctionLabelMin: 'min',
153
153
  // aggregationFunctionLabelMax: 'max',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "5.17.13",
3
+ "version": "5.17.16",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",