@etsoo/materialui 1.5.6 → 1.5.7
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.
|
@@ -38,6 +38,10 @@ export interface EditPageProps extends Omit<CommonPageProps, "onSubmit"> {
|
|
|
38
38
|
* Operation message handler
|
|
39
39
|
*/
|
|
40
40
|
operationMessageHandler?: OperationMessageHandlerAll;
|
|
41
|
+
/**
|
|
42
|
+
* Grid spacing
|
|
43
|
+
*/
|
|
44
|
+
gridSpacing?: number | Record<string, string | number>;
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
47
|
* Add / Edit page
|
|
@@ -20,12 +20,12 @@ const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
|
20
20
|
*/
|
|
21
21
|
function EditPage(props) {
|
|
22
22
|
// Destruct
|
|
23
|
-
const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal_1.MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, ...rest } = props;
|
|
23
|
+
const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal_1.MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, gridSpacing = MUGlobal_1.MUGlobal.pagePaddings, ...rest } = props;
|
|
24
24
|
// Labels
|
|
25
25
|
const labels = Labels_1.Labels.CommonPage;
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(CommonPage_1.CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: operationMessageHandler })), topPart, (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, justifyContent: "left", spacing:
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(CommonPage_1.CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: operationMessageHandler })), topPart, (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, justifyContent: "left", spacing: gridSpacing, paddingTop: 1, children: children }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, position: "sticky", display: "flex", gap: gridSpacing, sx: {
|
|
27
27
|
top: "auto",
|
|
28
|
-
bottom: (theme) => MUGlobal_1.MUGlobal.updateWithTheme(
|
|
29
|
-
paddingTop:
|
|
28
|
+
bottom: (theme) => MUGlobal_1.MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
|
|
29
|
+
paddingTop: gridSpacing
|
|
30
30
|
}, children: [isEditing && onDelete && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "primary", variant: "outlined", onClick: () => onDelete(), startIcon: (0, jsx_runtime_1.jsx)(Delete_1.default, { color: "warning" }), children: labels.delete })), (0, jsx_runtime_1.jsx)(Button_1.default, { variant: "contained", type: "submit", startIcon: (0, jsx_runtime_1.jsx)(Save_1.default, {}), sx: { flexGrow: 1 }, disabled: submitDisabled, children: labels.save }), supportBack && (0, jsx_runtime_1.jsx)(BackButton_1.BackButton, { title: labels.back })] })] }), bottomPart] }));
|
|
31
31
|
}
|
|
@@ -38,6 +38,10 @@ export interface EditPageProps extends Omit<CommonPageProps, "onSubmit"> {
|
|
|
38
38
|
* Operation message handler
|
|
39
39
|
*/
|
|
40
40
|
operationMessageHandler?: OperationMessageHandlerAll;
|
|
41
|
+
/**
|
|
42
|
+
* Grid spacing
|
|
43
|
+
*/
|
|
44
|
+
gridSpacing?: number | Record<string, string | number>;
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
47
|
* Add / Edit page
|
|
@@ -14,12 +14,12 @@ import Button from "@mui/material/Button";
|
|
|
14
14
|
*/
|
|
15
15
|
export function EditPage(props) {
|
|
16
16
|
// Destruct
|
|
17
|
-
const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, ...rest } = props;
|
|
17
|
+
const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, gridSpacing = MUGlobal.pagePaddings, ...rest } = props;
|
|
18
18
|
// Labels
|
|
19
19
|
const labels = Labels.CommonPage;
|
|
20
|
-
return (_jsxs(CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: operationMessageHandler })), topPart, _jsxs("form", { onSubmit: onSubmit, children: [_jsx(Grid, { container: true, justifyContent: "left", spacing:
|
|
20
|
+
return (_jsxs(CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: operationMessageHandler })), topPart, _jsxs("form", { onSubmit: onSubmit, children: [_jsx(Grid, { container: true, justifyContent: "left", spacing: gridSpacing, paddingTop: 1, children: children }), _jsxs(Grid, { container: true, position: "sticky", display: "flex", gap: gridSpacing, sx: {
|
|
21
21
|
top: "auto",
|
|
22
|
-
bottom: (theme) => MUGlobal.updateWithTheme(
|
|
23
|
-
paddingTop:
|
|
22
|
+
bottom: (theme) => MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
|
|
23
|
+
paddingTop: gridSpacing
|
|
24
24
|
}, children: [isEditing && onDelete && (_jsx(Button, { color: "primary", variant: "outlined", onClick: () => onDelete(), startIcon: _jsx(DeleteIcon, { color: "warning" }), children: labels.delete })), _jsx(Button, { variant: "contained", type: "submit", startIcon: _jsx(SaveIcon, {}), sx: { flexGrow: 1 }, disabled: submitDisabled, children: labels.save }), supportBack && _jsx(BackButton, { title: labels.back })] })] }), bottomPart] }));
|
|
25
25
|
}
|
package/package.json
CHANGED
package/src/pages/EditPage.tsx
CHANGED
|
@@ -54,6 +54,11 @@ export interface EditPageProps extends Omit<CommonPageProps, "onSubmit"> {
|
|
|
54
54
|
* Operation message handler
|
|
55
55
|
*/
|
|
56
56
|
operationMessageHandler?: OperationMessageHandlerAll;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Grid spacing
|
|
60
|
+
*/
|
|
61
|
+
gridSpacing?: number | Record<string, string | number>;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
/**
|
|
@@ -74,6 +79,7 @@ export function EditPage(props: EditPageProps) {
|
|
|
74
79
|
bottomPart,
|
|
75
80
|
topPart,
|
|
76
81
|
operationMessageHandler,
|
|
82
|
+
gridSpacing = MUGlobal.pagePaddings,
|
|
77
83
|
...rest
|
|
78
84
|
} = props;
|
|
79
85
|
|
|
@@ -87,19 +93,24 @@ export function EditPage(props: EditPageProps) {
|
|
|
87
93
|
)}
|
|
88
94
|
{topPart}
|
|
89
95
|
<form onSubmit={onSubmit}>
|
|
90
|
-
<Grid
|
|
96
|
+
<Grid
|
|
97
|
+
container
|
|
98
|
+
justifyContent="left"
|
|
99
|
+
spacing={gridSpacing}
|
|
100
|
+
paddingTop={1}
|
|
101
|
+
>
|
|
91
102
|
{children}
|
|
92
103
|
</Grid>
|
|
93
104
|
<Grid
|
|
94
105
|
container
|
|
95
106
|
position="sticky"
|
|
96
107
|
display="flex"
|
|
97
|
-
gap={
|
|
108
|
+
gap={gridSpacing}
|
|
98
109
|
sx={{
|
|
99
110
|
top: "auto",
|
|
100
111
|
bottom: (theme) =>
|
|
101
|
-
MUGlobal.updateWithTheme(
|
|
102
|
-
paddingTop:
|
|
112
|
+
MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
|
|
113
|
+
paddingTop: gridSpacing
|
|
103
114
|
}}
|
|
104
115
|
>
|
|
105
116
|
{isEditing && onDelete && (
|