@etsoo/materialui 1.4.91 → 1.4.93
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/FlexBox.d.ts +6 -0
- package/lib/cjs/FlexBox.js +9 -0
- package/lib/cjs/pages/ViewPage.js +7 -6
- package/lib/mjs/FlexBox.d.ts +6 -0
- package/lib/mjs/FlexBox.js +8 -0
- package/lib/mjs/pages/ViewPage.js +7 -6
- package/package.json +3 -3
- package/src/FlexBox.tsx +18 -1
- package/src/pages/ViewPage.tsx +9 -7
package/lib/cjs/FlexBox.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ import { StackProps } from "@mui/material";
|
|
|
5
5
|
* @returns Component
|
|
6
6
|
*/
|
|
7
7
|
export declare function HBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Horizonal box with list items
|
|
10
|
+
* @param props Props
|
|
11
|
+
* @returns Component
|
|
12
|
+
*/
|
|
13
|
+
export declare function HBoxList(props: Omit<StackProps, "direction">): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
/**
|
|
9
15
|
* Vertial box
|
|
10
16
|
* @param props Props
|
package/lib/cjs/FlexBox.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HBox = HBox;
|
|
4
|
+
exports.HBoxList = HBoxList;
|
|
4
5
|
exports.VBox = VBox;
|
|
5
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
const material_1 = require("@mui/material");
|
|
@@ -12,6 +13,14 @@ const material_1 = require("@mui/material");
|
|
|
12
13
|
function HBox(props) {
|
|
13
14
|
return (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", width: "100%", ...props });
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Horizonal box with list items
|
|
18
|
+
* @param props Props
|
|
19
|
+
* @returns Component
|
|
20
|
+
*/
|
|
21
|
+
function HBoxList(props) {
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: 1, gap: 1, direction: "row", flexWrap: "wrap", width: "100%", ...props }));
|
|
23
|
+
}
|
|
15
24
|
/**
|
|
16
25
|
* Vertial box
|
|
17
26
|
* @param props Props
|
|
@@ -247,17 +247,18 @@ function ViewPage(props) {
|
|
|
247
247
|
MessageUtils_1.MessageUtils.offRefresh(refreshHandler);
|
|
248
248
|
};
|
|
249
249
|
}, [refresh]);
|
|
250
|
-
|
|
250
|
+
let leftResult;
|
|
251
|
+
return ((0, jsx_runtime_1.jsx)(CommonPage_1.CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, sx: {
|
|
252
|
+
".MuiTypography-subtitle2": {
|
|
253
|
+
fontWeight: "bold"
|
|
254
|
+
}
|
|
255
|
+
}, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? ((0, jsx_runtime_1.jsx)(material_1.LinearProgress, {})) : ((0, jsx_runtime_1.jsxs)(react_3.default.Fragment, { children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
251
256
|
? [
|
|
252
257
|
operationMessageHandler.types,
|
|
253
258
|
refresh,
|
|
254
259
|
operationMessageHandler.id
|
|
255
260
|
]
|
|
256
|
-
: operationMessageHandler })), titleBar && titleBar(data), (0, jsx_runtime_1.jsxs)(material_1.Grid2, { container: true, justifyContent: "left", className: "ET-ViewPage", ref: gridRef, spacing: spacing,
|
|
257
|
-
".MuiTypography-subtitle2": {
|
|
258
|
-
fontWeight: "bold"
|
|
259
|
-
}
|
|
260
|
-
}, children: [leftContainer && ((0, jsx_runtime_1.jsxs)(react_3.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftContainer(data) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }), actions !== null && ((0, jsx_runtime_1.jsx)(material_1.Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings, children: actions != null && shared_1.Utils.getResult(actions, data, refresh) })), shared_1.Utils.getResult(children, data, refresh), pullToRefresh && ((0, jsx_runtime_1.jsx)(PullToRefreshUI_1.PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
261
|
+
: operationMessageHandler })), titleBar && titleBar(data), (0, jsx_runtime_1.jsxs)(material_1.Grid2, { container: true, justifyContent: "left", className: "ET-ViewPage", ref: gridRef, spacing: spacing, children: [leftContainer && (leftResult = leftContainer(data)) != null && ((0, jsx_runtime_1.jsxs)(react_3.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }), actions !== null && ((0, jsx_runtime_1.jsx)(material_1.Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings, children: actions != null && shared_1.Utils.getResult(actions, data, refresh) })), shared_1.Utils.getResult(children, data, refresh), pullToRefresh && ((0, jsx_runtime_1.jsx)(PullToRefreshUI_1.PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
261
262
|
const container = document.querySelector(pullContainer);
|
|
262
263
|
return !container?.scrollTop;
|
|
263
264
|
} })), (0, jsx_runtime_1.jsx)(react_2.ScrollRestoration, {})] })) }));
|
package/lib/mjs/FlexBox.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ import { StackProps } from "@mui/material";
|
|
|
5
5
|
* @returns Component
|
|
6
6
|
*/
|
|
7
7
|
export declare function HBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Horizonal box with list items
|
|
10
|
+
* @param props Props
|
|
11
|
+
* @returns Component
|
|
12
|
+
*/
|
|
13
|
+
export declare function HBoxList(props: Omit<StackProps, "direction">): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
/**
|
|
9
15
|
* Vertial box
|
|
10
16
|
* @param props Props
|
package/lib/mjs/FlexBox.js
CHANGED
|
@@ -8,6 +8,14 @@ import { Stack } from "@mui/material";
|
|
|
8
8
|
export function HBox(props) {
|
|
9
9
|
return _jsx(Stack, { direction: "row", width: "100%", ...props });
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Horizonal box with list items
|
|
13
|
+
* @param props Props
|
|
14
|
+
* @returns Component
|
|
15
|
+
*/
|
|
16
|
+
export function HBoxList(props) {
|
|
17
|
+
return (_jsx(Stack, { spacing: 1, gap: 1, direction: "row", flexWrap: "wrap", width: "100%", ...props }));
|
|
18
|
+
}
|
|
11
19
|
/**
|
|
12
20
|
* Vertial box
|
|
13
21
|
* @param props Props
|
|
@@ -239,17 +239,18 @@ export function ViewPage(props) {
|
|
|
239
239
|
MessageUtils.offRefresh(refreshHandler);
|
|
240
240
|
};
|
|
241
241
|
}, [refresh]);
|
|
242
|
-
|
|
242
|
+
let leftResult;
|
|
243
|
+
return (_jsx(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, sx: {
|
|
244
|
+
".MuiTypography-subtitle2": {
|
|
245
|
+
fontWeight: "bold"
|
|
246
|
+
}
|
|
247
|
+
}, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? (_jsx(LinearProgress, {})) : (_jsxs(React.Fragment, { children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
243
248
|
? [
|
|
244
249
|
operationMessageHandler.types,
|
|
245
250
|
refresh,
|
|
246
251
|
operationMessageHandler.id
|
|
247
252
|
]
|
|
248
|
-
: operationMessageHandler })), titleBar && titleBar(data), _jsxs(Grid2, { container: true, justifyContent: "left", className: "ET-ViewPage", ref: gridRef, spacing: spacing,
|
|
249
|
-
".MuiTypography-subtitle2": {
|
|
250
|
-
fontWeight: "bold"
|
|
251
|
-
}
|
|
252
|
-
}, children: [leftContainer && (_jsxs(React.Fragment, { children: [_jsx(Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftContainer(data) }), _jsx(Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }), actions !== null && (_jsx(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings, children: actions != null && Utils.getResult(actions, data, refresh) })), Utils.getResult(children, data, refresh), pullToRefresh && (_jsx(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
253
|
+
: operationMessageHandler })), titleBar && titleBar(data), _jsxs(Grid2, { container: true, justifyContent: "left", className: "ET-ViewPage", ref: gridRef, spacing: spacing, children: [leftContainer && (leftResult = leftContainer(data)) != null && (_jsxs(React.Fragment, { children: [_jsx(Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), _jsx(Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }), actions !== null && (_jsx(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings, children: actions != null && Utils.getResult(actions, data, refresh) })), Utils.getResult(children, data, refresh), pullToRefresh && (_jsx(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
253
254
|
const container = document.querySelector(pullContainer);
|
|
254
255
|
return !container?.scrollTop;
|
|
255
256
|
} })), _jsx(ScrollRestoration, {})] })) }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.93",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"@types/pica": "^9.0.5",
|
|
77
77
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
78
78
|
"@types/react": "^18.3.18",
|
|
79
|
-
"@types/react-avatar-editor": "^13.0.
|
|
79
|
+
"@types/react-avatar-editor": "^13.0.4",
|
|
80
80
|
"@types/react-dom": "^18.3.5",
|
|
81
81
|
"@types/react-input-mask": "^3.0.6",
|
|
82
82
|
"@types/react-window": "^1.8.8",
|
|
83
83
|
"@vitejs/plugin-react": "^4.3.4",
|
|
84
84
|
"jsdom": "^26.0.0",
|
|
85
85
|
"typescript": "^5.7.3",
|
|
86
|
-
"vitest": "^3.0.
|
|
86
|
+
"vitest": "^3.0.7"
|
|
87
87
|
}
|
|
88
88
|
}
|
package/src/FlexBox.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Stack, StackProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Horizonal box
|
|
@@ -10,6 +9,24 @@ export function HBox(props: Omit<StackProps, "ref">) {
|
|
|
10
9
|
return <Stack direction="row" width="100%" {...props} />;
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Horizonal box with list items
|
|
14
|
+
* @param props Props
|
|
15
|
+
* @returns Component
|
|
16
|
+
*/
|
|
17
|
+
export function HBoxList(props: Omit<StackProps, "direction">) {
|
|
18
|
+
return (
|
|
19
|
+
<Stack
|
|
20
|
+
spacing={1}
|
|
21
|
+
gap={1}
|
|
22
|
+
direction="row"
|
|
23
|
+
flexWrap="wrap"
|
|
24
|
+
width="100%"
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
/**
|
|
14
31
|
* Vertial box
|
|
15
32
|
* @param props Props
|
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -481,11 +481,18 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
481
481
|
};
|
|
482
482
|
}, [refresh]);
|
|
483
483
|
|
|
484
|
+
let leftResult: React.ReactNode;
|
|
485
|
+
|
|
484
486
|
return (
|
|
485
487
|
<CommonPage
|
|
486
488
|
paddings={paddings}
|
|
487
489
|
onRefresh={supportRefresh ? refresh : undefined}
|
|
488
490
|
onUpdate={supportRefresh ? undefined : refresh}
|
|
491
|
+
sx={{
|
|
492
|
+
".MuiTypography-subtitle2": {
|
|
493
|
+
fontWeight: "bold"
|
|
494
|
+
}
|
|
495
|
+
}}
|
|
489
496
|
{...rest}
|
|
490
497
|
scrollContainer={globalThis}
|
|
491
498
|
fabColumnDirection={fabColumnDirection}
|
|
@@ -516,13 +523,8 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
516
523
|
className="ET-ViewPage"
|
|
517
524
|
ref={gridRef}
|
|
518
525
|
spacing={spacing}
|
|
519
|
-
sx={{
|
|
520
|
-
".MuiTypography-subtitle2": {
|
|
521
|
-
fontWeight: "bold"
|
|
522
|
-
}
|
|
523
|
-
}}
|
|
524
526
|
>
|
|
525
|
-
{leftContainer && (
|
|
527
|
+
{leftContainer && (leftResult = leftContainer(data)) != null && (
|
|
526
528
|
<React.Fragment>
|
|
527
529
|
<Grid2
|
|
528
530
|
container
|
|
@@ -531,7 +533,7 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
531
533
|
size={size}
|
|
532
534
|
{...leftContainerPropsRest}
|
|
533
535
|
>
|
|
534
|
-
{
|
|
536
|
+
{leftResult}
|
|
535
537
|
</Grid2>
|
|
536
538
|
<Grid2
|
|
537
539
|
container
|