@mui/x-data-grid 5.17.12 → 5.17.14

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 (41) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/components/ErrorBoundary.d.ts +0 -1
  3. package/components/ErrorBoundary.js +1 -1
  4. package/components/ErrorOverlay.d.ts +1 -1
  5. package/components/ErrorOverlay.js +3 -3
  6. package/components/base/GridErrorHandler.js +3 -4
  7. package/hooks/core/useGridErrorHandler.js +7 -1
  8. package/hooks/features/rows/useGridRows.js +3 -0
  9. package/hooks/features/selection/useGridSelection.js +14 -7
  10. package/index.js +1 -1
  11. package/legacy/components/ErrorBoundary.js +1 -1
  12. package/legacy/components/ErrorOverlay.js +3 -3
  13. package/legacy/components/base/GridErrorHandler.js +3 -4
  14. package/legacy/hooks/core/useGridErrorHandler.js +7 -1
  15. package/legacy/hooks/features/rows/useGridRows.js +3 -0
  16. package/legacy/hooks/features/selection/useGridSelection.js +14 -7
  17. package/legacy/index.js +1 -1
  18. package/legacy/locales/arSD.js +1 -1
  19. package/legacy/locales/ukUA.js +24 -20
  20. package/locales/arSD.js +1 -1
  21. package/locales/ukUA.js +20 -20
  22. package/modern/components/ErrorBoundary.js +1 -1
  23. package/modern/components/ErrorOverlay.js +3 -3
  24. package/modern/components/base/GridErrorHandler.js +3 -4
  25. package/modern/hooks/core/useGridErrorHandler.js +7 -1
  26. package/modern/hooks/features/rows/useGridRows.js +3 -0
  27. package/modern/hooks/features/selection/useGridSelection.js +12 -7
  28. package/modern/index.js +1 -1
  29. package/modern/locales/arSD.js +1 -1
  30. package/modern/locales/ukUA.js +20 -20
  31. package/node/components/ErrorBoundary.js +1 -1
  32. package/node/components/ErrorOverlay.js +3 -3
  33. package/node/components/base/GridErrorHandler.js +3 -4
  34. package/node/hooks/core/useGridErrorHandler.js +7 -1
  35. package/node/hooks/features/rows/useGridRows.js +3 -0
  36. package/node/hooks/features/selection/useGridSelection.js +15 -7
  37. package/node/index.js +1 -1
  38. package/node/locales/arSD.js +1 -1
  39. package/node/locales/ukUA.js +20 -20
  40. package/package.json +1 -1
  41. package/themeAugmentation/props.d.ts +3 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,60 @@
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.14
7
+
8
+ _Dec 1, 2022_
9
+
10
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Improve Ukrainian (uk-UA) locale (#7035) @rettoua
13
+ - 🐞 Bugfixes
14
+
15
+ ### `@mui/x-data-grid@v5.17.14` / `@mui/x-data-grid-pro@v5.17.14` / `@mui/x-data-grid-premium@v5.17.14`
16
+
17
+ #### Changes
18
+
19
+ - [DataGrid] Fix row selection when clicking blank cell (#7056) @yami03
20
+ - [DataGridPremium] Update cache before hydrating columns (#7043) @m4theushw
21
+ - [l10n] Improve Ukrainian (uk-UA) locale (#7035) @rettoua
22
+
23
+ ## 5.17.13
24
+
25
+ _Nov 24, 2022_
26
+
27
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
28
+
29
+ - 🚀 Fix support of the pickers to Shadow DOM (#6971) @flaviendelangle
30
+ - 💅 Improve DataGrid theme augmentation (#6980) @iigrik
31
+ - 🐞 Bugfixes
32
+
33
+ ### `@mui/x-data-grid@v5.17.13` / `@mui/x-data-grid-pro@v5.17.13` / `@mui/x-data-grid-premium@v5.17.13`
34
+
35
+ #### Changes
36
+
37
+ - [DataGrid] Fix `ErrorOverlay` not receiving defined input props (#6885) @banoth-ravinder
38
+ - [DataGrid] Improve typing for `styleOverrides` (#6980) @iigrik
39
+ - [DataGridPro] Fix lazy-loaded rows not working with `updateRows` API method (#6875) @cherniavskii
40
+ - [l10n] Fix translation of `filterOperatorBefore` in Arabic (ar-SD) locale (#6917) @HassanGhazy
41
+
42
+ ### `@mui/x-date-pickers@v5.0.9` / `@mui/x-date-pickers-pro@v5.0.9`
43
+
44
+ #### Changes
45
+
46
+ - [pickers] Fix usage with Shadow DOM (#6971) @flaviendelangle
47
+
48
+ ### Docs
49
+
50
+ - [docs] Add new "Expired package version" error type (#6937) @oliviertassinari
51
+ - [docs] Enforce values for installation options in Date / Time pickers Getting Started page (#6896) @01zulfi
52
+ - [docs] Fix live edit @oliviertassinari
53
+ - [docs] Upgrade to Next 13 (#6911) @cherniavskii
54
+
55
+ ### Core
56
+
57
+ - [core] Upgrade monorepo (#6906) @cherniavskii
58
+ - [core] Upgrade node to v14.21 (#6939) @piwysocki
59
+
6
60
  ## 5.17.12
7
61
 
8
62
  _Nov 17, 2022_
@@ -7,7 +7,6 @@ export interface ErrorBoundaryProps {
7
7
  render: ({ error }: any) => React.ReactNode;
8
8
  api: React.MutableRefObject<GridApiCommunity>;
9
9
  hasError: boolean;
10
- componentProps?: any[];
11
10
  children?: React.ReactNode;
12
11
  }
13
12
  export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, any> {
@@ -28,7 +28,7 @@ export class ErrorBoundary extends React.Component {
28
28
 
29
29
  if (this.props.hasError || (_this$state = this.state) != null && _this$state.hasError) {
30
30
  // You can render any custom fallback UI
31
- return this.props.render(this.props.componentProps || this.state);
31
+ return this.props.render(this.state);
32
32
  }
33
33
 
34
34
  return this.props.children;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { GridOverlayProps } from './containers/GridOverlay';
3
3
  export interface ErrorOverlayProps extends GridOverlayProps {
4
- message?: string;
4
+ error?: Error;
5
5
  hasError: boolean;
6
6
  errorInfo: any;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["message", "hasError", "errorInfo"];
3
+ const _excluded = ["error", "hasError", "errorInfo"];
4
4
  import * as React from 'react';
5
5
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
6
6
  import { GridOverlay } from './containers/GridOverlay';
@@ -10,7 +10,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  // TODO v6: rename to GridErrorOverlay
11
11
  export const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(props, ref) {
12
12
  const {
13
- message
13
+ error
14
14
  } = props,
15
15
  other = _objectWithoutPropertiesLoose(props, _excluded);
16
16
 
@@ -24,6 +24,6 @@ export const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(
24
24
  minHeight: 2 * rowHeight
25
25
  }
26
26
  }, other, {
27
- children: message || defaultLabel
27
+ children: (error == null ? void 0 : error.message) || defaultLabel
28
28
  }));
29
29
  });
@@ -15,17 +15,16 @@ function GridErrorHandler(props) {
15
15
  const apiRef = useGridApiContext();
16
16
  const logger = useGridLogger(apiRef, 'GridErrorHandler');
17
17
  const rootProps = useGridRootProps();
18
- const error = apiRef.current.state.error;
18
+ const errorState = apiRef.current.state.error;
19
19
  return /*#__PURE__*/_jsx(ErrorBoundary, {
20
- hasError: error != null,
21
- componentProps: error,
20
+ hasError: errorState != null,
22
21
  api: apiRef,
23
22
  logger: logger,
24
23
  render: errorProps => {
25
24
  var _rootProps$components;
26
25
 
27
26
  return /*#__PURE__*/_jsx(GridMainContainer, {
28
- children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
27
+ children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, errorState, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
29
28
  });
30
29
  },
31
30
  children: children
@@ -9,7 +9,13 @@ export function useGridErrorHandler(apiRef, props) {
9
9
  }));
10
10
  }, [apiRef]);
11
11
  React.useEffect(() => {
12
- handleError(props.error);
12
+ if (props.error) {
13
+ handleError({
14
+ error: props.error
15
+ });
16
+ } else {
17
+ handleError(null);
18
+ }
13
19
  }, [handleError, props.error]);
14
20
  useGridApiEventHandler(apiRef, 'componentError', handleError);
15
21
  }
@@ -296,6 +296,9 @@ export const useGridRows = (apiRef, props) => {
296
296
  updatedIdToIdLookup[row.id] = row.id;
297
297
  updatedTree[row.id] = rowTreeNodeConfig;
298
298
  });
299
+ apiRef.current.unstable_caches.rows.idRowsLookup = updatedIdRowsLookup;
300
+ apiRef.current.unstable_caches.rows.idToIdLookup = updatedIdToIdLookup;
301
+ apiRef.current.unstable_caches.rows.ids = updatedRows;
299
302
  apiRef.current.setState(state => _extends({}, state, {
300
303
  rows: _extends({}, state.rows, {
301
304
  idRowsLookup: updatedIdRowsLookup,
@@ -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);
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.12
1
+ /** @license MUI v5.17.14
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.
@@ -44,7 +44,7 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
44
44
 
45
45
  if (this.props.hasError || (_this$state = this.state) != null && _this$state.hasError) {
46
46
  // You can render any custom fallback UI
47
- return this.props.render(this.props.componentProps || this.state);
47
+ return this.props.render(this.state);
48
48
  }
49
49
 
50
50
  return this.props.children;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["message", "hasError", "errorInfo"];
3
+ var _excluded = ["error", "hasError", "errorInfo"];
4
4
  import * as React from 'react';
5
5
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
6
6
  import { GridOverlay } from './containers/GridOverlay';
@@ -9,7 +9,7 @@ import { gridDensityRowHeightSelector } from '../hooks/features/density/densityS
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  // TODO v6: rename to GridErrorOverlay
11
11
  export var ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(props, ref) {
12
- var message = props.message,
12
+ var error = props.error,
13
13
  hasError = props.hasError,
14
14
  errorInfo = props.errorInfo,
15
15
  other = _objectWithoutProperties(props, _excluded);
@@ -24,6 +24,6 @@ export var ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(pr
24
24
  minHeight: 2 * rowHeight
25
25
  }
26
26
  }, other, {
27
- children: message || defaultLabel
27
+ children: (error == null ? void 0 : error.message) || defaultLabel
28
28
  }));
29
29
  });
@@ -13,17 +13,16 @@ function GridErrorHandler(props) {
13
13
  var apiRef = useGridApiContext();
14
14
  var logger = useGridLogger(apiRef, 'GridErrorHandler');
15
15
  var rootProps = useGridRootProps();
16
- var error = apiRef.current.state.error;
16
+ var errorState = apiRef.current.state.error;
17
17
  return /*#__PURE__*/_jsx(ErrorBoundary, {
18
- hasError: error != null,
19
- componentProps: error,
18
+ hasError: errorState != null,
20
19
  api: apiRef,
21
20
  logger: logger,
22
21
  render: function render(errorProps) {
23
22
  var _rootProps$components;
24
23
 
25
24
  return /*#__PURE__*/_jsx(GridMainContainer, {
26
- children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
25
+ children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, errorState, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
27
26
  });
28
27
  },
29
28
  children: children
@@ -11,7 +11,13 @@ export function useGridErrorHandler(apiRef, props) {
11
11
  });
12
12
  }, [apiRef]);
13
13
  React.useEffect(function () {
14
- handleError(props.error);
14
+ if (props.error) {
15
+ handleError({
16
+ error: props.error
17
+ });
18
+ } else {
19
+ handleError(null);
20
+ }
15
21
  }, [handleError, props.error]);
16
22
  useGridApiEventHandler(apiRef, 'componentError', handleError);
17
23
  }
@@ -325,6 +325,9 @@ export var useGridRows = function useGridRows(apiRef, props) {
325
325
  updatedIdToIdLookup[row.id] = row.id;
326
326
  updatedTree[row.id] = rowTreeNodeConfig;
327
327
  });
328
+ apiRef.current.unstable_caches.rows.idRowsLookup = updatedIdRowsLookup;
329
+ apiRef.current.unstable_caches.rows.idToIdLookup = updatedIdToIdLookup;
330
+ apiRef.current.unstable_caches.rows.ids = updatedRows;
328
331
  apiRef.current.setState(function (state) {
329
332
  return _extends({}, state, {
330
333
  rows: _extends({}, state.rows, {
@@ -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);
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.12
1
+ /** @license MUI v5.17.14
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.
@@ -58,7 +58,7 @@ var arSDGrid = {
58
58
  filterOperatorNot: 'ليس',
59
59
  filterOperatorAfter: 'بعد',
60
60
  filterOperatorOnOrAfter: 'عند أو بعد',
61
- filterOperatorBefore: 'بعد',
61
+ filterOperatorBefore: 'قبل',
62
62
  filterOperatorOnOrBefore: 'عند أو قبل',
63
63
  filterOperatorIsEmpty: 'خالي',
64
64
  filterOperatorIsNotEmpty: 'غير خالي',
@@ -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/arSD.js CHANGED
@@ -56,7 +56,7 @@ const arSDGrid = {
56
56
  filterOperatorNot: 'ليس',
57
57
  filterOperatorAfter: 'بعد',
58
58
  filterOperatorOnOrAfter: 'عند أو بعد',
59
- filterOperatorBefore: 'بعد',
59
+ filterOperatorBefore: 'قبل',
60
60
  filterOperatorOnOrBefore: 'عند أو قبل',
61
61
  filterOperatorIsEmpty: 'خالي',
62
62
  filterOperatorIsNotEmpty: 'غير خالي',
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',
@@ -26,7 +26,7 @@ export class ErrorBoundary extends React.Component {
26
26
  render() {
27
27
  if (this.props.hasError || this.state?.hasError) {
28
28
  // You can render any custom fallback UI
29
- return this.props.render(this.props.componentProps || this.state);
29
+ return this.props.render(this.state);
30
30
  }
31
31
 
32
32
  return this.props.children;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["message", "hasError", "errorInfo"];
3
+ const _excluded = ["error", "hasError", "errorInfo"];
4
4
  import * as React from 'react';
5
5
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
6
6
  import { GridOverlay } from './containers/GridOverlay';
@@ -10,7 +10,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  // TODO v6: rename to GridErrorOverlay
11
11
  export const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(props, ref) {
12
12
  const {
13
- message
13
+ error
14
14
  } = props,
15
15
  other = _objectWithoutPropertiesLoose(props, _excluded);
16
16
 
@@ -24,6 +24,6 @@ export const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(
24
24
  minHeight: 2 * rowHeight
25
25
  }
26
26
  }, other, {
27
- children: message || defaultLabel
27
+ children: error?.message || defaultLabel
28
28
  }));
29
29
  });
@@ -15,14 +15,13 @@ function GridErrorHandler(props) {
15
15
  const apiRef = useGridApiContext();
16
16
  const logger = useGridLogger(apiRef, 'GridErrorHandler');
17
17
  const rootProps = useGridRootProps();
18
- const error = apiRef.current.state.error;
18
+ const errorState = apiRef.current.state.error;
19
19
  return /*#__PURE__*/_jsx(ErrorBoundary, {
20
- hasError: error != null,
21
- componentProps: error,
20
+ hasError: errorState != null,
22
21
  api: apiRef,
23
22
  logger: logger,
24
23
  render: errorProps => /*#__PURE__*/_jsx(GridMainContainer, {
25
- children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, rootProps.componentsProps?.errorOverlay))
24
+ children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, errorState, rootProps.componentsProps?.errorOverlay))
26
25
  }),
27
26
  children: children
28
27
  });
@@ -9,7 +9,13 @@ export function useGridErrorHandler(apiRef, props) {
9
9
  }));
10
10
  }, [apiRef]);
11
11
  React.useEffect(() => {
12
- handleError(props.error);
12
+ if (props.error) {
13
+ handleError({
14
+ error: props.error
15
+ });
16
+ } else {
17
+ handleError(null);
18
+ }
13
19
  }, [handleError, props.error]);
14
20
  useGridApiEventHandler(apiRef, 'componentError', handleError);
15
21
  }
@@ -288,6 +288,9 @@ export const useGridRows = (apiRef, props) => {
288
288
  updatedIdToIdLookup[row.id] = row.id;
289
289
  updatedTree[row.id] = rowTreeNodeConfig;
290
290
  });
291
+ apiRef.current.unstable_caches.rows.idRowsLookup = updatedIdRowsLookup;
292
+ apiRef.current.unstable_caches.rows.idToIdLookup = updatedIdToIdLookup;
293
+ apiRef.current.unstable_caches.rows.ids = updatedRows;
291
294
  apiRef.current.setState(state => _extends({}, state, {
292
295
  rows: _extends({}, state.rows, {
293
296
  idRowsLookup: updatedIdRowsLookup,
@@ -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);
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.12
1
+ /** @license MUI v5.17.14
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.
@@ -56,7 +56,7 @@ const arSDGrid = {
56
56
  filterOperatorNot: 'ليس',
57
57
  filterOperatorAfter: 'بعد',
58
58
  filterOperatorOnOrAfter: 'عند أو بعد',
59
- filterOperatorBefore: 'بعد',
59
+ filterOperatorBefore: 'قبل',
60
60
  filterOperatorOnOrBefore: 'عند أو قبل',
61
61
  filterOperatorIsEmpty: 'خالي',
62
62
  filterOperatorIsNotEmpty: 'غير خالي',
@@ -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',
@@ -40,7 +40,7 @@ class ErrorBoundary extends React.Component {
40
40
 
41
41
  if (this.props.hasError || (_this$state = this.state) != null && _this$state.hasError) {
42
42
  // You can render any custom fallback UI
43
- return this.props.render(this.props.componentProps || this.state);
43
+ return this.props.render(this.state);
44
44
  }
45
45
 
46
46
  return this.props.children;
@@ -23,7 +23,7 @@ var _densitySelector = require("../hooks/features/density/densitySelector");
23
23
 
24
24
  var _jsxRuntime = require("react/jsx-runtime");
25
25
 
26
- const _excluded = ["message", "hasError", "errorInfo"];
26
+ const _excluded = ["error", "hasError", "errorInfo"];
27
27
 
28
28
  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); }
29
29
 
@@ -32,7 +32,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
32
32
  // TODO v6: rename to GridErrorOverlay
33
33
  const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(props, ref) {
34
34
  const {
35
- message
35
+ error
36
36
  } = props,
37
37
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
38
38
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
@@ -45,7 +45,7 @@ const ErrorOverlay = /*#__PURE__*/React.forwardRef(function ErrorOverlay(props,
45
45
  minHeight: 2 * rowHeight
46
46
  }
47
47
  }, other, {
48
- children: message || defaultLabel
48
+ children: (error == null ? void 0 : error.message) || defaultLabel
49
49
  }));
50
50
  });
51
51
  exports.ErrorOverlay = ErrorOverlay;
@@ -36,17 +36,16 @@ function GridErrorHandler(props) {
36
36
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
37
37
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'GridErrorHandler');
38
38
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
39
- const error = apiRef.current.state.error;
39
+ const errorState = apiRef.current.state.error;
40
40
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary, {
41
- hasError: error != null,
42
- componentProps: error,
41
+ hasError: errorState != null,
43
42
  api: apiRef,
44
43
  logger: logger,
45
44
  render: errorProps => {
46
45
  var _rootProps$components;
47
46
 
48
47
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMainContainer.GridMainContainer, {
49
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.ErrorOverlay, (0, _extends2.default)({}, errorProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
48
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.ErrorOverlay, (0, _extends2.default)({}, errorProps, errorState, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))
50
49
  });
51
50
  },
52
51
  children: children
@@ -25,7 +25,13 @@ function useGridErrorHandler(apiRef, props) {
25
25
  }));
26
26
  }, [apiRef]);
27
27
  React.useEffect(() => {
28
- handleError(props.error);
28
+ if (props.error) {
29
+ handleError({
30
+ error: props.error
31
+ });
32
+ } else {
33
+ handleError(null);
34
+ }
29
35
  }, [handleError, props.error]);
30
36
  (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'componentError', handleError);
31
37
  }
@@ -318,6 +318,9 @@ const useGridRows = (apiRef, props) => {
318
318
  updatedIdToIdLookup[row.id] = row.id;
319
319
  updatedTree[row.id] = rowTreeNodeConfig;
320
320
  });
321
+ apiRef.current.unstable_caches.rows.idRowsLookup = updatedIdRowsLookup;
322
+ apiRef.current.unstable_caches.rows.idToIdLookup = updatedIdToIdLookup;
323
+ apiRef.current.unstable_caches.rows.ids = updatedRows;
321
324
  apiRef.current.setState(state => (0, _extends2.default)({}, state, {
322
325
  rows: (0, _extends2.default)({}, state.rows, {
323
326
  idRowsLookup: updatedIdRowsLookup,
@@ -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);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.17.12
1
+ /** @license MUI v5.17.14
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.
@@ -65,7 +65,7 @@ const arSDGrid = {
65
65
  filterOperatorNot: 'ليس',
66
66
  filterOperatorAfter: 'بعد',
67
67
  filterOperatorOnOrAfter: 'عند أو بعد',
68
- filterOperatorBefore: 'بعد',
68
+ filterOperatorBefore: 'قبل',
69
69
  filterOperatorOnOrBefore: 'عند أو قبل',
70
70
  filterOperatorIsEmpty: 'خالي',
71
71
  filterOperatorIsNotEmpty: 'غير خالي',
@@ -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.12",
3
+ "version": "5.17.14",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -1,9 +1,9 @@
1
- import { ComponentsOverrides, ComponentsProps, Theme } from '@mui/material/styles';
1
+ import { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
2
2
  import { DataGridProps } from '../models/props/DataGridProps';
3
3
  export interface DataGridComponentsPropsList {
4
4
  MuiDataGrid: DataGridProps;
5
5
  }
6
- export interface DataGridComponents {
6
+ export interface DataGridComponents<Theme = unknown> {
7
7
  MuiDataGrid?: {
8
8
  defaultProps?: ComponentsProps['MuiDataGrid'];
9
9
  styleOverrides?: ComponentsOverrides<Theme>['MuiDataGrid'];
@@ -12,8 +12,6 @@ export interface DataGridComponents {
12
12
  declare module '@mui/material/styles' {
13
13
  interface ComponentsPropsList extends DataGridComponentsPropsList {
14
14
  }
15
- }
16
- declare module '@mui/material/styles/components' {
17
- interface Components extends DataGridComponents {
15
+ interface Components<Theme = unknown> extends DataGridComponents<Theme> {
18
16
  }
19
17
  }