@etsoo/materialui 1.4.97 → 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/LICENSE +1 -1
- package/lib/cjs/ErrorAlert.d.ts +16 -0
- package/lib/cjs/ErrorAlert.js +19 -0
- package/lib/cjs/TabBox.d.ts +5 -1
- package/lib/cjs/TabBox.js +2 -2
- package/lib/cjs/TooltipClick.js +4 -2
- 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/TabBox.d.ts +5 -1
- package/lib/mjs/TabBox.js +2 -2
- package/lib/mjs/TooltipClick.js +4 -2
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +11 -11
- package/src/ErrorAlert.tsx +32 -0
- package/src/TabBox.tsx +10 -4
- package/src/TooltipClick.tsx +4 -2
- package/src/index.ts +1 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2004-
|
|
3
|
+
Copyright (c) 2004-2025 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -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/TabBox.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface TabBoxPanel extends Omit<TabProps, "value" | "children"> {
|
|
|
11
11
|
/**
|
|
12
12
|
* Panel box props
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
panelProps?: Omit<BoxProps, "hidden">;
|
|
15
15
|
/**
|
|
16
16
|
* To URL
|
|
17
17
|
*/
|
|
@@ -41,6 +41,10 @@ export interface TabBoxPros extends BoxProps {
|
|
|
41
41
|
* Root props
|
|
42
42
|
*/
|
|
43
43
|
root?: BoxProps;
|
|
44
|
+
/**
|
|
45
|
+
* Shared tab props
|
|
46
|
+
*/
|
|
47
|
+
tabProps?: Omit<BoxProps, "hidden">;
|
|
44
48
|
/**
|
|
45
49
|
* Tabs
|
|
46
50
|
*/
|
package/lib/cjs/TabBox.js
CHANGED
|
@@ -16,7 +16,7 @@ const react_router_1 = require("react-router");
|
|
|
16
16
|
*/
|
|
17
17
|
function TabBox(props) {
|
|
18
18
|
// Destruct
|
|
19
|
-
const { index, inputName, root, container = {}, defaultIndex = 0, tabs } = props;
|
|
19
|
+
const { index, inputName, root, container = {}, defaultIndex = 0, tabProps, tabs } = props;
|
|
20
20
|
const { onChange, ...rest } = container;
|
|
21
21
|
// State
|
|
22
22
|
const [value, setValue] = react_1.default.useState(defaultIndex);
|
|
@@ -30,5 +30,5 @@ function TabBox(props) {
|
|
|
30
30
|
setValue(newValue);
|
|
31
31
|
if (onChange)
|
|
32
32
|
onChange(event, newValue);
|
|
33
|
-
}, ...rest, children: tabs.map(({ children,
|
|
33
|
+
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: index, LinkComponent: tabRest.to ? react_router_1.Link : undefined, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => ((0, jsx_runtime_1.jsx)(material_1.Box, { hidden: value !== index, ...tabProps, ...panelProps, children: shared_1.Utils.getResult(children, value === index) }, index)))] }));
|
|
34
34
|
}
|
package/lib/cjs/TooltipClick.js
CHANGED
|
@@ -36,8 +36,10 @@ function TooltipClick(props) {
|
|
|
36
36
|
};
|
|
37
37
|
}, []);
|
|
38
38
|
// Layout
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: () => setOpen(false), children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, {
|
|
40
|
-
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: () => setOpen(false), children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { slotProps: {
|
|
40
|
+
popper: {
|
|
41
|
+
disablePortal: true
|
|
42
|
+
}
|
|
41
43
|
}, onClose: (event) => {
|
|
42
44
|
setOpen(false);
|
|
43
45
|
if (onClose)
|
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/TabBox.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface TabBoxPanel extends Omit<TabProps, "value" | "children"> {
|
|
|
11
11
|
/**
|
|
12
12
|
* Panel box props
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
panelProps?: Omit<BoxProps, "hidden">;
|
|
15
15
|
/**
|
|
16
16
|
* To URL
|
|
17
17
|
*/
|
|
@@ -41,6 +41,10 @@ export interface TabBoxPros extends BoxProps {
|
|
|
41
41
|
* Root props
|
|
42
42
|
*/
|
|
43
43
|
root?: BoxProps;
|
|
44
|
+
/**
|
|
45
|
+
* Shared tab props
|
|
46
|
+
*/
|
|
47
|
+
tabProps?: Omit<BoxProps, "hidden">;
|
|
44
48
|
/**
|
|
45
49
|
* Tabs
|
|
46
50
|
*/
|
package/lib/mjs/TabBox.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Link } from "react-router";
|
|
|
10
10
|
*/
|
|
11
11
|
export function TabBox(props) {
|
|
12
12
|
// Destruct
|
|
13
|
-
const { index, inputName, root, container = {}, defaultIndex = 0, tabs } = props;
|
|
13
|
+
const { index, inputName, root, container = {}, defaultIndex = 0, tabProps, tabs } = props;
|
|
14
14
|
const { onChange, ...rest } = container;
|
|
15
15
|
// State
|
|
16
16
|
const [value, setValue] = React.useState(defaultIndex);
|
|
@@ -24,5 +24,5 @@ export function TabBox(props) {
|
|
|
24
24
|
setValue(newValue);
|
|
25
25
|
if (onChange)
|
|
26
26
|
onChange(event, newValue);
|
|
27
|
-
}, ...rest, children: tabs.map(({ children,
|
|
27
|
+
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => (_jsx(Tab, { value: index, LinkComponent: tabRest.to ? Link : undefined, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => (_jsx(Box, { hidden: value !== index, ...tabProps, ...panelProps, children: Utils.getResult(children, value === index) }, index)))] }));
|
|
28
28
|
}
|
package/lib/mjs/TooltipClick.js
CHANGED
|
@@ -30,8 +30,10 @@ export function TooltipClick(props) {
|
|
|
30
30
|
};
|
|
31
31
|
}, []);
|
|
32
32
|
// Layout
|
|
33
|
-
return (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(Tooltip, {
|
|
34
|
-
|
|
33
|
+
return (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(Tooltip, { slotProps: {
|
|
34
|
+
popper: {
|
|
35
|
+
disablePortal: true
|
|
36
|
+
}
|
|
35
37
|
}, onClose: (event) => {
|
|
36
38
|
setOpen(false);
|
|
37
39
|
if (onClose)
|
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",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@babel/cli": "^7.26.4",
|
|
69
|
-
"@babel/core": "^7.26.
|
|
70
|
-
"@babel/plugin-transform-runtime": "^7.26.
|
|
69
|
+
"@babel/core": "^7.26.10",
|
|
70
|
+
"@babel/plugin-transform-runtime": "^7.26.10",
|
|
71
71
|
"@babel/preset-env": "^7.26.9",
|
|
72
72
|
"@babel/preset-react": "^7.26.3",
|
|
73
73
|
"@babel/preset-typescript": "^7.26.0",
|
|
74
|
-
"@babel/runtime-corejs3": "^7.26.
|
|
74
|
+
"@babel/runtime-corejs3": "^7.26.10",
|
|
75
75
|
"@testing-library/react": "^16.2.0",
|
|
76
76
|
"@types/pica": "^9.0.5",
|
|
77
77
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/react-window": "^1.8.8",
|
|
83
83
|
"@vitejs/plugin-react": "^4.3.4",
|
|
84
84
|
"jsdom": "^26.0.0",
|
|
85
|
-
"typescript": "^5.
|
|
86
|
-
"vitest": "^3.0.
|
|
85
|
+
"typescript": "^5.8.2",
|
|
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/TabBox.tsx
CHANGED
|
@@ -15,7 +15,7 @@ export interface TabBoxPanel extends Omit<TabProps, "value" | "children"> {
|
|
|
15
15
|
/**
|
|
16
16
|
* Panel box props
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
panelProps?: Omit<BoxProps, "hidden">;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* To URL
|
|
@@ -52,6 +52,11 @@ export interface TabBoxPros extends BoxProps {
|
|
|
52
52
|
*/
|
|
53
53
|
root?: BoxProps;
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Shared tab props
|
|
57
|
+
*/
|
|
58
|
+
tabProps?: Omit<BoxProps, "hidden">;
|
|
59
|
+
|
|
55
60
|
/**
|
|
56
61
|
* Tabs
|
|
57
62
|
*/
|
|
@@ -71,6 +76,7 @@ export function TabBox(props: TabBoxPros) {
|
|
|
71
76
|
root,
|
|
72
77
|
container = {},
|
|
73
78
|
defaultIndex = 0,
|
|
79
|
+
tabProps,
|
|
74
80
|
tabs
|
|
75
81
|
} = props;
|
|
76
82
|
const { onChange, ...rest } = container;
|
|
@@ -96,7 +102,7 @@ export function TabBox(props: TabBoxPros) {
|
|
|
96
102
|
}}
|
|
97
103
|
{...rest}
|
|
98
104
|
>
|
|
99
|
-
{tabs.map(({ children,
|
|
105
|
+
{tabs.map(({ children, panelProps, ...tabRest }, index) => (
|
|
100
106
|
<Tab
|
|
101
107
|
key={index}
|
|
102
108
|
value={index}
|
|
@@ -106,8 +112,8 @@ export function TabBox(props: TabBoxPros) {
|
|
|
106
112
|
))}
|
|
107
113
|
</Tabs>
|
|
108
114
|
</Box>
|
|
109
|
-
{tabs.map(({ children,
|
|
110
|
-
<Box key={index} hidden={value !== index} {...
|
|
115
|
+
{tabs.map(({ children, panelProps }, index) => (
|
|
116
|
+
<Box key={index} hidden={value !== index} {...tabProps} {...panelProps}>
|
|
111
117
|
{Utils.getResult(children, value === index)}
|
|
112
118
|
</Box>
|
|
113
119
|
))}
|
package/src/TooltipClick.tsx
CHANGED
|
@@ -60,8 +60,10 @@ export function TooltipClick(props: TooltipClickProps) {
|
|
|
60
60
|
return (
|
|
61
61
|
<ClickAwayListener onClickAway={() => setOpen(false)}>
|
|
62
62
|
<Tooltip
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
slotProps={{
|
|
64
|
+
popper: {
|
|
65
|
+
disablePortal: true
|
|
66
|
+
}
|
|
65
67
|
}}
|
|
66
68
|
onClose={(event) => {
|
|
67
69
|
setOpen(false);
|
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";
|