@etsoo/materialui 1.5.68 → 1.5.70
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/__tests__/ReactAppTests.tsx +0 -28
- package/lib/cjs/TabBox.d.ts +1 -1
- package/lib/cjs/TabBox.js +1 -1
- package/lib/mjs/TabBox.d.ts +1 -1
- package/lib/mjs/TabBox.js +1 -1
- package/package.json +10 -10
- package/setupTests.ts +24 -0
- package/src/TabBox.tsx +2 -2
- package/vite.config.mts +1 -0
|
@@ -4,34 +4,6 @@ import { DataTypes, DomUtils, IActionResult, Utils } from "@etsoo/shared";
|
|
|
4
4
|
import React, { act } from "react";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
|
|
7
|
-
if (typeof localStorage === "undefined") {
|
|
8
|
-
const mockLocalStorage = (() => {
|
|
9
|
-
let store = {} as Storage;
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
getItem(key: string) {
|
|
13
|
-
return store[key];
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
setItem(key: string, value: string) {
|
|
17
|
-
store[key] = value;
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
removeItem(key: string) {
|
|
21
|
-
delete store[key];
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
clear() {
|
|
25
|
-
store = {} as Storage;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
})();
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(globalThis, "localStorage", {
|
|
31
|
-
value: mockLocalStorage
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
7
|
// Detected country or region
|
|
36
8
|
const { detectedCountry } = DomUtils;
|
|
37
9
|
|
package/lib/cjs/TabBox.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TabProps } from "@mui/material/Tab";
|
|
|
3
3
|
import { TabsProps } from "@mui/material/Tabs";
|
|
4
4
|
import React from "react";
|
|
5
5
|
type TabBoxPanelActionType = () => void;
|
|
6
|
-
type TabBoxPanelChildrenType = TabBoxPanelActionType | ((visible: boolean) => React.ReactNode) | React.ReactNode;
|
|
6
|
+
type TabBoxPanelChildrenType = TabBoxPanelActionType | ((visible: boolean, index: number) => React.ReactNode) | React.ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Tab with box panel props
|
|
9
9
|
*/
|
package/lib/cjs/TabBox.js
CHANGED
|
@@ -50,5 +50,5 @@ function TabBox(props) {
|
|
|
50
50
|
if (onChange)
|
|
51
51
|
onChange(event, newValue);
|
|
52
52
|
}
|
|
53
|
-
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => ((0, jsx_runtime_1.jsx)(Tab_1.default, { value: index, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => ((0, jsx_runtime_1.jsx)(Box_1.default, { hidden: value !== index, ...tabProps, ...panelProps, children: isActionTab(children) ? ((0, jsx_runtime_1.jsx)(react_2.default.Fragment, {})) : (shared_1.Utils.getResult(children, value === index)) }, index)))] }));
|
|
53
|
+
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => ((0, jsx_runtime_1.jsx)(Tab_1.default, { value: index, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => ((0, jsx_runtime_1.jsx)(Box_1.default, { hidden: value !== index, ...tabProps, ...panelProps, children: isActionTab(children) ? ((0, jsx_runtime_1.jsx)(react_2.default.Fragment, {})) : (shared_1.Utils.getResult(children, value === index, index)) }, index)))] }));
|
|
54
54
|
}
|
package/lib/mjs/TabBox.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TabProps } from "@mui/material/Tab";
|
|
|
3
3
|
import { TabsProps } from "@mui/material/Tabs";
|
|
4
4
|
import React from "react";
|
|
5
5
|
type TabBoxPanelActionType = () => void;
|
|
6
|
-
type TabBoxPanelChildrenType = TabBoxPanelActionType | ((visible: boolean) => React.ReactNode) | React.ReactNode;
|
|
6
|
+
type TabBoxPanelChildrenType = TabBoxPanelActionType | ((visible: boolean, index: number) => React.ReactNode) | React.ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Tab with box panel props
|
|
9
9
|
*/
|
package/lib/mjs/TabBox.js
CHANGED
|
@@ -44,5 +44,5 @@ export function TabBox(props) {
|
|
|
44
44
|
if (onChange)
|
|
45
45
|
onChange(event, newValue);
|
|
46
46
|
}
|
|
47
|
-
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => (_jsx(Tab, { value: index, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => (_jsx(Box, { hidden: value !== index, ...tabProps, ...panelProps, children: isActionTab(children) ? (_jsx(React.Fragment, {})) : (Utils.getResult(children, value === index)) }, index)))] }));
|
|
47
|
+
}, ...rest, children: tabs.map(({ children, panelProps, ...tabRest }, index) => (_jsx(Tab, { value: index, ...tabRest }, index))) }) }), tabs.map(({ children, panelProps }, index) => (_jsx(Box, { hidden: value !== index, ...tabProps, ...panelProps, children: isActionTab(children) ? (_jsx(React.Fragment, {})) : (Utils.getResult(children, value === index, index)) }, index)))] }));
|
|
48
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.70",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.63",
|
|
45
45
|
"@etsoo/react": "^1.8.49",
|
|
46
46
|
"@etsoo/shared": "^1.2.75",
|
|
47
|
-
"@mui/icons-material": "^7.
|
|
48
|
-
"@mui/material": "^7.
|
|
49
|
-
"@mui/x-data-grid": "^8.
|
|
47
|
+
"@mui/icons-material": "^7.3.1",
|
|
48
|
+
"@mui/material": "^7.3.1",
|
|
49
|
+
"@mui/x-data-grid": "^8.10.1",
|
|
50
50
|
"chart.js": "^4.5.0",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"dompurify": "^3.2.6",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"@emotion/react": "$@emotion/react"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@babel/cli": "^7.28.
|
|
70
|
-
"@babel/core": "^7.28.
|
|
71
|
-
"@babel/plugin-transform-runtime": "^7.28.
|
|
72
|
-
"@babel/preset-env": "^7.28.
|
|
69
|
+
"@babel/cli": "^7.28.3",
|
|
70
|
+
"@babel/core": "^7.28.3",
|
|
71
|
+
"@babel/plugin-transform-runtime": "^7.28.3",
|
|
72
|
+
"@babel/preset-env": "^7.28.3",
|
|
73
73
|
"@babel/preset-react": "^7.27.1",
|
|
74
74
|
"@babel/preset-typescript": "^7.27.1",
|
|
75
|
-
"@babel/runtime-corejs3": "^7.28.
|
|
75
|
+
"@babel/runtime-corejs3": "^7.28.3",
|
|
76
76
|
"@testing-library/react": "^16.3.0",
|
|
77
77
|
"@types/pica": "^9.0.5",
|
|
78
78
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/react-dom": "^18.3.7",
|
|
82
82
|
"@types/react-input-mask": "^3.0.6",
|
|
83
83
|
"@types/react-window": "^1.8.8",
|
|
84
|
-
"@vitejs/plugin-react": "^
|
|
84
|
+
"@vitejs/plugin-react": "^5.0.1",
|
|
85
85
|
"jsdom": "^26.1.0",
|
|
86
86
|
"typescript": "^5.9.2",
|
|
87
87
|
"vitest": "^3.2.4"
|
package/setupTests.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
vi.mock("localStorage", () => {
|
|
4
|
+
let store = {} as Storage;
|
|
5
|
+
return {
|
|
6
|
+
default: {
|
|
7
|
+
getItem(key: string) {
|
|
8
|
+
return store[key];
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
setItem(key: string, value: string) {
|
|
12
|
+
store[key] = value;
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
removeItem(key: string) {
|
|
16
|
+
delete store[key];
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
clear() {
|
|
20
|
+
store = {} as Storage;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
});
|
package/src/TabBox.tsx
CHANGED
|
@@ -9,7 +9,7 @@ type TabBoxPanelActionType = () => void;
|
|
|
9
9
|
|
|
10
10
|
type TabBoxPanelChildrenType =
|
|
11
11
|
| TabBoxPanelActionType
|
|
12
|
-
| ((visible: boolean) => React.ReactNode)
|
|
12
|
+
| ((visible: boolean, index: number) => React.ReactNode)
|
|
13
13
|
| React.ReactNode;
|
|
14
14
|
|
|
15
15
|
function isActionTab(
|
|
@@ -137,7 +137,7 @@ export function TabBox(props: TabBoxProps) {
|
|
|
137
137
|
{isActionTab(children) ? (
|
|
138
138
|
<React.Fragment />
|
|
139
139
|
) : (
|
|
140
|
-
Utils.getResult(children, value === index)
|
|
140
|
+
Utils.getResult(children, value === index, index)
|
|
141
141
|
)}
|
|
142
142
|
</Box>
|
|
143
143
|
))}
|