@etsoo/materialui 1.4.96 → 1.4.98
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/TabBox.d.ts +5 -1
- package/lib/cjs/TabBox.js +2 -2
- package/lib/cjs/TooltipClick.js +4 -2
- package/lib/cjs/app/ReactApp.js +4 -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/app/ReactApp.js +4 -0
- package/package.json +10 -10
- package/src/TabBox.tsx +10 -4
- package/src/TooltipClick.tsx +4 -2
- package/src/app/ReactApp.ts +6 -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
|
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/app/ReactApp.js
CHANGED
|
@@ -210,6 +210,10 @@ class ReactApp extends appscript_1.CoreApp {
|
|
|
210
210
|
// Destruct
|
|
211
211
|
const { onFailure = (type) => {
|
|
212
212
|
console.log(`Try login failed: ${type}.`);
|
|
213
|
+
if (globalThis.navigator.onLine &&
|
|
214
|
+
!type.includes('"title":"Failed to fetch"')) {
|
|
215
|
+
this.clearCacheToken();
|
|
216
|
+
}
|
|
213
217
|
this.toLoginPage(rest);
|
|
214
218
|
}, onSuccess, ...rest } = data ?? {};
|
|
215
219
|
// Check status
|
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/app/ReactApp.js
CHANGED
|
@@ -202,6 +202,10 @@ export class ReactApp extends CoreApp {
|
|
|
202
202
|
// Destruct
|
|
203
203
|
const { onFailure = (type) => {
|
|
204
204
|
console.log(`Try login failed: ${type}.`);
|
|
205
|
+
if (globalThis.navigator.onLine &&
|
|
206
|
+
!type.includes('"title":"Failed to fetch"')) {
|
|
207
|
+
this.clearCacheToken();
|
|
208
|
+
}
|
|
205
209
|
this.toLoginPage(rest);
|
|
206
210
|
}, onSuccess, ...rest } = data ?? {};
|
|
207
211
|
// Check status
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.98",
|
|
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.18",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.59",
|
|
45
45
|
"@etsoo/react": "^1.8.32",
|
|
46
46
|
"@etsoo/shared": "^1.2.62",
|
|
47
|
-
"@mui/icons-material": "^6.4.
|
|
48
|
-
"@mui/material": "^6.4.
|
|
49
|
-
"@mui/x-data-grid": "^7.27.
|
|
47
|
+
"@mui/icons-material": "^6.4.7",
|
|
48
|
+
"@mui/material": "^6.4.7",
|
|
49
|
+
"@mui/x-data-grid": "^7.27.3",
|
|
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.8"
|
|
87
87
|
}
|
|
88
88
|
}
|
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/app/ReactApp.ts
CHANGED
|
@@ -355,6 +355,12 @@ export class ReactApp<S extends IAppSettings, D extends IUser>
|
|
|
355
355
|
const {
|
|
356
356
|
onFailure = (type: string) => {
|
|
357
357
|
console.log(`Try login failed: ${type}.`);
|
|
358
|
+
if (
|
|
359
|
+
globalThis.navigator.onLine &&
|
|
360
|
+
!type.includes('"title":"Failed to fetch"')
|
|
361
|
+
) {
|
|
362
|
+
this.clearCacheToken();
|
|
363
|
+
}
|
|
358
364
|
this.toLoginPage(rest);
|
|
359
365
|
},
|
|
360
366
|
onSuccess,
|