@gpa-gemstone/common-pages 0.0.165 → 0.0.166
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/lib/ErrorBoundary.d.ts +17 -1
- package/lib/ErrorBoundary.js +5 -2
- package/package.json +4 -4
package/lib/ErrorBoundary.d.ts
CHANGED
|
@@ -5,9 +5,25 @@ interface IError {
|
|
|
5
5
|
message: string;
|
|
6
6
|
}
|
|
7
7
|
interface IProps {
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* If provided, this message will be shown instead of the default error message. This is useful for providing a more user-friendly message or additional context about the error. NOTE: This will only be applied if ErrorContent is not provided, as ErrorContent is expected to provide its own error display.
|
|
10
|
+
*/
|
|
11
|
+
ErrorMessage?: string;
|
|
12
|
+
/**
|
|
13
|
+
* If provided, this content will be shown instead of the default error content. This is useful for providing a more customized error display. NOTE: This will take precedence over ErrorMessage and ErrorIconSize, as it is expected to provide its own error display.
|
|
14
|
+
*/
|
|
15
|
+
ErrorContent?: (props: IError) => React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* If provided, this style will be applied to the error container. This is useful for customizing the appearance of the error display.
|
|
18
|
+
*/
|
|
9
19
|
Style?: CSSProperties;
|
|
20
|
+
/**
|
|
21
|
+
* If provided, this class name will be applied to the error container. This is useful for applying custom styles to the error display.
|
|
22
|
+
*/
|
|
10
23
|
ClassName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* If provided, this size will be applied to the error icon. This is useful for customizing the appearance of the error display. NOTE: This will only be applied if ErrorContent is not provided, as ErrorContent is expected to provide its own error display.
|
|
26
|
+
*/
|
|
11
27
|
ErrorIconSize?: number;
|
|
12
28
|
}
|
|
13
29
|
export default class ErrorBoundary extends React.Component<React.PropsWithChildren<IProps>, IError> {
|
package/lib/ErrorBoundary.js
CHANGED
|
@@ -77,10 +77,13 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
77
77
|
console.warn(error);
|
|
78
78
|
};
|
|
79
79
|
ErrorBoundary.prototype.render = function () {
|
|
80
|
-
var _a;
|
|
80
|
+
var _a, _b;
|
|
81
81
|
if (this.state.name.length > 0) {
|
|
82
|
+
if (this.props.ErrorContent != null) {
|
|
83
|
+
return (React.createElement("div", { className: this.props.ClassName, style: this.props.Style }, this.props.ErrorContent(this.state)));
|
|
84
|
+
}
|
|
82
85
|
return (React.createElement("div", { className: this.props.ClassName, style: this.props.Style },
|
|
83
|
-
React.createElement(react_interactive_1.ServerErrorIcon, { Show: true, Label: this.props.ErrorMessage, Size: (
|
|
86
|
+
React.createElement(react_interactive_1.ServerErrorIcon, { Show: true, Label: (_a = this.props.ErrorMessage) !== null && _a !== void 0 ? _a : "An error occurred", Size: (_b = this.props.ErrorIconSize) !== null && _b !== void 0 ? _b : 150 })));
|
|
84
87
|
}
|
|
85
88
|
else
|
|
86
89
|
return React.createElement(React.Fragment, null, this.props.children);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gpa-gemstone/common-pages",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.166",
|
|
4
4
|
"description": "Common UI pages for GPA products",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@gpa-gemstone/application-typings": "0.0.96",
|
|
50
50
|
"@gpa-gemstone/gpa-symbols": "0.0.59",
|
|
51
51
|
"@gpa-gemstone/helper-functions": "0.0.55",
|
|
52
|
-
"@gpa-gemstone/react-forms": "1.1.
|
|
53
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
|
54
|
-
"@gpa-gemstone/react-table": "1.2.
|
|
52
|
+
"@gpa-gemstone/react-forms": "1.1.112",
|
|
53
|
+
"@gpa-gemstone/react-interactive": "1.0.176",
|
|
54
|
+
"@gpa-gemstone/react-table": "1.2.99",
|
|
55
55
|
"@reduxjs/toolkit": "1.8.3",
|
|
56
56
|
"crypto-js": "^4.2.0",
|
|
57
57
|
"moment": "^2.29.4",
|