@etsoo/materialui 1.4.98 → 1.4.99
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/cjs/ErrorAlert.d.ts +16 -0
- package/lib/cjs/ErrorAlert.js +19 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/mjs/ErrorAlert.d.ts +16 -0
- package/lib/mjs/ErrorAlert.js +16 -0
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +7 -7
- package/src/ErrorAlert.tsx +32 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
/**
|
|
3
|
+
* Error alert props
|
|
4
|
+
*/
|
|
5
|
+
export type ErrorAlertProps = AlertProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Message to display
|
|
8
|
+
*/
|
|
9
|
+
message?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Error alert component
|
|
13
|
+
* @param props Props
|
|
14
|
+
* @returns Component
|
|
15
|
+
*/
|
|
16
|
+
export declare function ErrorAlert(props: ErrorAlertProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorAlert = ErrorAlert;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
7
|
+
/**
|
|
8
|
+
* Error alert component
|
|
9
|
+
* @param props Props
|
|
10
|
+
* @returns Component
|
|
11
|
+
*/
|
|
12
|
+
function ErrorAlert(props) {
|
|
13
|
+
// Global app
|
|
14
|
+
const app = (0, ReactApp_1.useAppContext)();
|
|
15
|
+
// Destruct
|
|
16
|
+
const { message = app?.get("idError"), ...alertProps } = props;
|
|
17
|
+
// Layout
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", ...alertProps, children: message }));
|
|
19
|
+
}
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./DialogButton";
|
|
|
53
53
|
export * from "./DnDList";
|
|
54
54
|
export * from "./DraggablePaperComponent";
|
|
55
55
|
export * from "./EmailInput";
|
|
56
|
+
export * from "./ErrorAlert";
|
|
56
57
|
export * from "./FabBox";
|
|
57
58
|
export * from "./FieldSetEx";
|
|
58
59
|
export * from "./FileUploadButton";
|
package/lib/cjs/index.js
CHANGED
|
@@ -69,6 +69,7 @@ __exportStar(require("./DialogButton"), exports);
|
|
|
69
69
|
__exportStar(require("./DnDList"), exports);
|
|
70
70
|
__exportStar(require("./DraggablePaperComponent"), exports);
|
|
71
71
|
__exportStar(require("./EmailInput"), exports);
|
|
72
|
+
__exportStar(require("./ErrorAlert"), exports);
|
|
72
73
|
__exportStar(require("./FabBox"), exports);
|
|
73
74
|
__exportStar(require("./FieldSetEx"), exports);
|
|
74
75
|
__exportStar(require("./FileUploadButton"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
/**
|
|
3
|
+
* Error alert props
|
|
4
|
+
*/
|
|
5
|
+
export type ErrorAlertProps = AlertProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Message to display
|
|
8
|
+
*/
|
|
9
|
+
message?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Error alert component
|
|
13
|
+
* @param props Props
|
|
14
|
+
* @returns Component
|
|
15
|
+
*/
|
|
16
|
+
export declare function ErrorAlert(props: ErrorAlertProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Alert } from "@mui/material";
|
|
3
|
+
import { useAppContext } from "./app/ReactApp";
|
|
4
|
+
/**
|
|
5
|
+
* Error alert component
|
|
6
|
+
* @param props Props
|
|
7
|
+
* @returns Component
|
|
8
|
+
*/
|
|
9
|
+
export function ErrorAlert(props) {
|
|
10
|
+
// Global app
|
|
11
|
+
const app = useAppContext();
|
|
12
|
+
// Destruct
|
|
13
|
+
const { message = app?.get("idError"), ...alertProps } = props;
|
|
14
|
+
// Layout
|
|
15
|
+
return (_jsx(Alert, { severity: "error", ...alertProps, children: message }));
|
|
16
|
+
}
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./DialogButton";
|
|
|
53
53
|
export * from "./DnDList";
|
|
54
54
|
export * from "./DraggablePaperComponent";
|
|
55
55
|
export * from "./EmailInput";
|
|
56
|
+
export * from "./ErrorAlert";
|
|
56
57
|
export * from "./FabBox";
|
|
57
58
|
export * from "./FieldSetEx";
|
|
58
59
|
export * from "./FileUploadButton";
|
package/lib/mjs/index.js
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./DialogButton";
|
|
|
53
53
|
export * from "./DnDList";
|
|
54
54
|
export * from "./DraggablePaperComponent";
|
|
55
55
|
export * from "./EmailInput";
|
|
56
|
+
export * from "./ErrorAlert";
|
|
56
57
|
export * from "./FabBox";
|
|
57
58
|
export * from "./FieldSetEx";
|
|
58
59
|
export * from "./FileUploadButton";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.99",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@dnd-kit/sortable": "^10.0.0",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.0",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
43
|
+
"@etsoo/appscript": "^1.6.19",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.59",
|
|
45
|
-
"@etsoo/react": "^1.8.
|
|
45
|
+
"@etsoo/react": "^1.8.33",
|
|
46
46
|
"@etsoo/shared": "^1.2.62",
|
|
47
|
-
"@mui/icons-material": "^6.4.
|
|
48
|
-
"@mui/material": "^6.4.
|
|
49
|
-
"@mui/x-data-grid": "^7.
|
|
47
|
+
"@mui/icons-material": "^6.4.8",
|
|
48
|
+
"@mui/material": "^6.4.8",
|
|
49
|
+
"@mui/x-data-grid": "^7.28.0",
|
|
50
50
|
"chart.js": "^4.4.8",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"eventemitter3": "^5.0.1",
|
|
@@ -83,6 +83,6 @@
|
|
|
83
83
|
"@vitejs/plugin-react": "^4.3.4",
|
|
84
84
|
"jsdom": "^26.0.0",
|
|
85
85
|
"typescript": "^5.8.2",
|
|
86
|
-
"vitest": "^3.0.
|
|
86
|
+
"vitest": "^3.0.9"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Alert, AlertProps } from "@mui/material";
|
|
2
|
+
import { useAppContext } from "./app/ReactApp";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Error alert props
|
|
6
|
+
*/
|
|
7
|
+
export type ErrorAlertProps = AlertProps & {
|
|
8
|
+
/**
|
|
9
|
+
* Message to display
|
|
10
|
+
*/
|
|
11
|
+
message?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Error alert component
|
|
16
|
+
* @param props Props
|
|
17
|
+
* @returns Component
|
|
18
|
+
*/
|
|
19
|
+
export function ErrorAlert(props: ErrorAlertProps) {
|
|
20
|
+
// Global app
|
|
21
|
+
const app = useAppContext();
|
|
22
|
+
|
|
23
|
+
// Destruct
|
|
24
|
+
const { message = app?.get("idError"), ...alertProps } = props;
|
|
25
|
+
|
|
26
|
+
// Layout
|
|
27
|
+
return (
|
|
28
|
+
<Alert severity="error" {...alertProps}>
|
|
29
|
+
{message}
|
|
30
|
+
</Alert>
|
|
31
|
+
);
|
|
32
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./DialogButton";
|
|
|
58
58
|
export * from "./DnDList";
|
|
59
59
|
export * from "./DraggablePaperComponent";
|
|
60
60
|
export * from "./EmailInput";
|
|
61
|
+
export * from "./ErrorAlert";
|
|
61
62
|
export * from "./FabBox";
|
|
62
63
|
export * from "./FieldSetEx";
|
|
63
64
|
export * from "./FileUploadButton";
|