@mui/x-data-grid 5.17.12 → 5.17.13
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 +37 -0
- package/components/ErrorBoundary.d.ts +0 -1
- package/components/ErrorBoundary.js +1 -1
- package/components/ErrorOverlay.d.ts +1 -1
- package/components/ErrorOverlay.js +3 -3
- package/components/base/GridErrorHandler.js +3 -4
- package/hooks/core/useGridErrorHandler.js +7 -1
- package/hooks/features/rows/useGridRows.js +3 -0
- package/index.js +1 -1
- package/legacy/components/ErrorBoundary.js +1 -1
- package/legacy/components/ErrorOverlay.js +3 -3
- package/legacy/components/base/GridErrorHandler.js +3 -4
- package/legacy/hooks/core/useGridErrorHandler.js +7 -1
- package/legacy/hooks/features/rows/useGridRows.js +3 -0
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +1 -1
- package/locales/arSD.js +1 -1
- package/modern/components/ErrorBoundary.js +1 -1
- package/modern/components/ErrorOverlay.js +3 -3
- package/modern/components/base/GridErrorHandler.js +3 -4
- package/modern/hooks/core/useGridErrorHandler.js +7 -1
- package/modern/hooks/features/rows/useGridRows.js +3 -0
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +1 -1
- package/node/components/ErrorBoundary.js +1 -1
- package/node/components/ErrorOverlay.js +3 -3
- package/node/components/base/GridErrorHandler.js +3 -4
- package/node/hooks/core/useGridErrorHandler.js +7 -1
- package/node/hooks/features/rows/useGridRows.js +3 -0
- package/node/index.js +1 -1
- package/node/locales/arSD.js +1 -1
- package/package.json +1 -1
- package/themeAugmentation/props.d.ts +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
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.13
|
|
7
|
+
|
|
8
|
+
_Nov 24, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Fix support of the pickers to Shadow DOM (#6971) @flaviendelangle
|
|
13
|
+
- 💅 Improve DataGrid theme augmentation (#6980) @iigrik
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.13` / `@mui/x-data-grid-pro@v5.17.13` / `@mui/x-data-grid-premium@v5.17.13`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix `ErrorOverlay` not receiving defined input props (#6885) @banoth-ravinder
|
|
21
|
+
- [DataGrid] Improve typing for `styleOverrides` (#6980) @iigrik
|
|
22
|
+
- [DataGridPro] Fix lazy-loaded rows not working with `updateRows` API method (#6875) @cherniavskii
|
|
23
|
+
- [l10n] Fix translation of `filterOperatorBefore` in Arabic (ar-SD) locale (#6917) @HassanGhazy
|
|
24
|
+
|
|
25
|
+
### `@mui/x-date-pickers@v5.0.9` / `@mui/x-date-pickers-pro@v5.0.9`
|
|
26
|
+
|
|
27
|
+
#### Changes
|
|
28
|
+
|
|
29
|
+
- [pickers] Fix usage with Shadow DOM (#6971) @flaviendelangle
|
|
30
|
+
|
|
31
|
+
### Docs
|
|
32
|
+
|
|
33
|
+
- [docs] Add new "Expired package version" error type (#6937) @oliviertassinari
|
|
34
|
+
- [docs] Enforce values for installation options in Date / Time pickers Getting Started page (#6896) @01zulfi
|
|
35
|
+
- [docs] Fix live edit @oliviertassinari
|
|
36
|
+
- [docs] Upgrade to Next 13 (#6911) @cherniavskii
|
|
37
|
+
|
|
38
|
+
### Core
|
|
39
|
+
|
|
40
|
+
- [core] Upgrade monorepo (#6906) @cherniavskii
|
|
41
|
+
- [core] Upgrade node to v14.21 (#6939) @piwysocki
|
|
42
|
+
|
|
6
43
|
## 5.17.12
|
|
7
44
|
|
|
8
45
|
_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.
|
|
31
|
+
return this.props.render(this.state);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
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 = ["
|
|
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
|
-
|
|
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
|
|
18
|
+
const errorState = apiRef.current.state.error;
|
|
19
19
|
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
20
|
-
hasError:
|
|
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
|
-
|
|
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,
|
package/index.js
CHANGED
|
@@ -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.
|
|
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 = ["
|
|
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
|
|
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
|
|
16
|
+
var errorState = apiRef.current.state.error;
|
|
17
17
|
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
18
|
-
hasError:
|
|
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
|
-
|
|
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, {
|
package/legacy/index.js
CHANGED
package/legacy/locales/arSD.js
CHANGED
|
@@ -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: 'غير خالي',
|
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: 'غير خالي',
|
|
@@ -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.
|
|
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 = ["
|
|
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
|
-
|
|
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
|
|
18
|
+
const errorState = apiRef.current.state.error;
|
|
19
19
|
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
20
|
-
hasError:
|
|
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
|
-
|
|
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,
|
package/modern/index.js
CHANGED
package/modern/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: 'غير خالي',
|
|
@@ -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.
|
|
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 = ["
|
|
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
|
-
|
|
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
|
|
39
|
+
const errorState = apiRef.current.state.error;
|
|
40
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
41
|
-
hasError:
|
|
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
|
-
|
|
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,
|
package/node/index.js
CHANGED
package/node/locales/arSD.js
CHANGED
|
@@ -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: 'غير خالي',
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ComponentsOverrides, ComponentsProps
|
|
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
|
}
|