@m4l/layouts 0.1.39 → 0.1.41
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/components/BaseModule/index.6309486a.js +24 -24
- package/components/MFHostApp/index.420c2626.js +58 -58
- package/components/MFIsolationApp/index.e36cf308.js +137 -117
- package/contexts/AuthContext/index.6f966215.js +118 -88
- package/hooks/index.33191825.js +4 -0
- package/hooks/useAuth/index.cb6a3420.js +7 -7
- package/hooks/useMasterDetail/index.be4908d9.js +6 -0
- package/hooks/useModule/index.b5f598b1.js +11 -0
- package/index.js +29 -27
- package/layouts/MasterDetailLayout/classes/constants.d.ts +1 -0
- package/layouts/MasterDetailLayout/classes/index.d.ts +6 -0
- package/layouts/MasterDetailLayout/classes/types.d.ts +6 -0
- package/layouts/MasterDetailLayout/index.fe6ac47b.js +163 -0
- package/layouts/MasterDetailLayout/styles.d.ts +2 -0
- package/layouts/ModuleLayout/classes/constants.d.ts +1 -0
- package/layouts/ModuleLayout/classes/index.d.ts +7 -0
- package/layouts/ModuleLayout/classes/types.d.ts +7 -0
- package/layouts/ModuleLayout/index.e7218171.js +122 -0
- package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +1 -2
- package/layouts/NoAuthModuleLayout/index.2808fa44.js +379 -0
- package/layouts/index.96a3745e.js +8 -0
- package/layouts/index.d.ts +2 -2
- package/package.json +2 -1
- package/hooks/index.a0c767ed.js +0 -4
- package/hooks/useMasterDetail/index.927c0c26.js +0 -6
- package/hooks/useModule/index.edcd7b28.js +0 -11
- package/layouts/MasterDetailLayout/index.bca0fce5.js +0 -118
- package/layouts/ModuleLayout/index.850f7dcf.js +0 -103
- package/layouts/NoAuthModuleLayout/index.eabf38c1.js +0 -345
- package/layouts/index.07aacf57.js +0 -8
- /package/layouts/MasterDetailLayout/{index.d.ts → MasterDetailLayout.d.ts} +0 -0
- /package/layouts/ModuleLayout/{index.d.ts → ModuleLayout.d.ts} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useModal, useWindowToolsMF, ModalProvider, getModalDialogComponentsDictionary } from "@m4l/components";
|
|
2
|
+
import { forwardRef, useRef, useImperativeHandle, createContext, useState, useMemo, useEffect } from "react";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
5
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
const InnerModuleRoot = styled("div")(({
|
|
8
|
+
theme
|
|
9
|
+
}) => ({
|
|
10
|
+
...theme.components?.M4LModuleLayout?.styleOverrides
|
|
11
|
+
}));
|
|
12
|
+
const componentName = "M4LModuleLayout";
|
|
13
|
+
generateUtilityClasses(componentName, [
|
|
14
|
+
"root",
|
|
15
|
+
"moduleContent"
|
|
16
|
+
]);
|
|
17
|
+
function getModuleLayoutUtilityClass(slot) {
|
|
18
|
+
return generateUtilityClass(componentName, slot);
|
|
19
|
+
}
|
|
20
|
+
const useModuleLayoutUtilityClasses = () => {
|
|
21
|
+
const slots = {
|
|
22
|
+
root: ["root"],
|
|
23
|
+
moduleContent: ["moduleContent"]
|
|
24
|
+
};
|
|
25
|
+
const composedClasses = unstable_composeClasses(slots, getModuleLayoutUtilityClass, {});
|
|
26
|
+
return {
|
|
27
|
+
...composedClasses
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const InnerModule = forwardRef((props, ref) => {
|
|
31
|
+
const {
|
|
32
|
+
children
|
|
33
|
+
} = props;
|
|
34
|
+
const {
|
|
35
|
+
openModal
|
|
36
|
+
} = useModal();
|
|
37
|
+
const divRef = useRef(null);
|
|
38
|
+
useImperativeHandle(ref, () => ({
|
|
39
|
+
openModal,
|
|
40
|
+
current: divRef.current
|
|
41
|
+
}));
|
|
42
|
+
const classes = useModuleLayoutUtilityClasses();
|
|
43
|
+
return /* @__PURE__ */ jsx(InnerModuleRoot, {
|
|
44
|
+
className: classes.root,
|
|
45
|
+
ref: divRef,
|
|
46
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: classes.moduleContent,
|
|
48
|
+
children
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
InnerModule.displayName = "InnerModule";
|
|
53
|
+
const ModuleContext = createContext(null);
|
|
54
|
+
function ModuleProvider(props) {
|
|
55
|
+
const {
|
|
56
|
+
children,
|
|
57
|
+
moduleActions,
|
|
58
|
+
moduleId,
|
|
59
|
+
version
|
|
60
|
+
} = props;
|
|
61
|
+
const [configOptions] = useState(() => ({
|
|
62
|
+
moduleId,
|
|
63
|
+
dictionary: void 0
|
|
64
|
+
}));
|
|
65
|
+
const {
|
|
66
|
+
setActions
|
|
67
|
+
} = useWindowToolsMF();
|
|
68
|
+
const [dynamicActions, setDynamicActions] = useState([]);
|
|
69
|
+
const finalModuleActions = useMemo(() => {
|
|
70
|
+
return (moduleActions || []).concat(dynamicActions);
|
|
71
|
+
}, [moduleActions, dynamicActions]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
setActions(finalModuleActions, version);
|
|
74
|
+
}, [finalModuleActions]);
|
|
75
|
+
return /* @__PURE__ */ jsx(ModuleContext.Provider, {
|
|
76
|
+
value: {
|
|
77
|
+
setDynamicActions,
|
|
78
|
+
moduleId: configOptions.moduleId
|
|
79
|
+
},
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const ModuleLayout = forwardRef((props, ref) => {
|
|
84
|
+
const {
|
|
85
|
+
moduleId,
|
|
86
|
+
moduleActions,
|
|
87
|
+
version,
|
|
88
|
+
children
|
|
89
|
+
} = props;
|
|
90
|
+
const moduleRef = useRef(null);
|
|
91
|
+
const openModal = (modalOpenProps) => {
|
|
92
|
+
moduleRef.current?.openModal(modalOpenProps);
|
|
93
|
+
};
|
|
94
|
+
useImperativeHandle(ref, () => ({
|
|
95
|
+
openModal,
|
|
96
|
+
current: moduleRef.current
|
|
97
|
+
}));
|
|
98
|
+
return /* @__PURE__ */ jsx(ModuleProvider, {
|
|
99
|
+
moduleId,
|
|
100
|
+
moduleActions,
|
|
101
|
+
version,
|
|
102
|
+
children: /* @__PURE__ */ jsx(ModalProvider, {
|
|
103
|
+
children: /* @__PURE__ */ jsx(InnerModule, {
|
|
104
|
+
ref: moduleRef,
|
|
105
|
+
children
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
ModuleLayout.displayName = "ModuleLayout";
|
|
111
|
+
function getModuleLayoutComponentsDictionary() {
|
|
112
|
+
return ["module_layout"].concat(getModalDialogComponentsDictionary());
|
|
113
|
+
}
|
|
114
|
+
const defaultModuleLayoutDictionary = {
|
|
115
|
+
module_layout: {}
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
ModuleContext as M,
|
|
119
|
+
ModuleLayout as a,
|
|
120
|
+
defaultModuleLayoutDictionary as d,
|
|
121
|
+
getModuleLayoutComponentsDictionary as g
|
|
122
|
+
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const ModuleContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
+
export declare const InnerModuleRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { useResponsiveDesktop, useLocales } from "@m4l/graphics";
|
|
2
|
+
import { LanguagePopover, Image, Typography, ScrollBar, HelmetPage } from "@m4l/components";
|
|
3
|
+
import { styled, alpha } from "@mui/material/styles";
|
|
4
|
+
import { useBase, useModuleDictionary, useDomain, useEnvironment, BaseProvider, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
|
|
5
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
6
|
+
const InnerModuleRoot = styled("div")(({
|
|
7
|
+
theme
|
|
8
|
+
}) => ({
|
|
9
|
+
display: "flex",
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
height: "100vh",
|
|
13
|
+
padding: "20px",
|
|
14
|
+
backgroundColor: theme.palette.background.background,
|
|
15
|
+
[theme.breakpoints.down("md")]: {
|
|
16
|
+
padding: "0px"
|
|
17
|
+
}
|
|
18
|
+
}));
|
|
19
|
+
const DesktopContentRoot = styled("div")(({ theme }) => ({
|
|
20
|
+
display: "flex",
|
|
21
|
+
borderRadius: "16px",
|
|
22
|
+
backgroundColor: theme.palette.background.neutral,
|
|
23
|
+
boxShadow: theme.customShadows?.z4,
|
|
24
|
+
padding: "20px 0 20px 20px",
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
maxWidth: "965px",
|
|
28
|
+
maxHeight: "900px",
|
|
29
|
+
position: "relative",
|
|
30
|
+
overflow: "auto",
|
|
31
|
+
"& .M4LanguagePopover-root": {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
top: "20px",
|
|
34
|
+
right: "20px",
|
|
35
|
+
zIndex: 1
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
const DesktopBanner = styled("div")(({ theme }) => ({
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexDirection: "column",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
borderRadius: "16px",
|
|
44
|
+
width: "100%",
|
|
45
|
+
maxWidth: "400px",
|
|
46
|
+
height: "100%",
|
|
47
|
+
backgroundColor: theme.palette.state?.focus,
|
|
48
|
+
boxShadow: theme.customShadows?.z4,
|
|
49
|
+
padding: "0 60px",
|
|
50
|
+
gap: "40px",
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
"& .MuiTypography-root": {
|
|
53
|
+
color: theme.palette.patronus?.marbleLight[10],
|
|
54
|
+
display: "flex",
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
textAlign: "center",
|
|
57
|
+
textTransform: "uppercase"
|
|
58
|
+
},
|
|
59
|
+
"& .M4LTypography-root .MuiSkeleton-root": {
|
|
60
|
+
backgroundColor: alpha(`${theme.palette.patronus?.marbleLight[10]}`, 0.24),
|
|
61
|
+
margin: "auto"
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
const ContainerLogo$1 = styled("div")(({ theme }) => ({
|
|
65
|
+
display: "flex",
|
|
66
|
+
width: "84px",
|
|
67
|
+
height: "84px",
|
|
68
|
+
borderRadius: "6px",
|
|
69
|
+
backgroundColor: theme.palette.state?.active,
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
boxShadow: `0px 4px 8px ${alpha(theme.palette.patronus?.coolGrey[70] || "", 0.16)}`,
|
|
73
|
+
"& .M4LImage-root": {
|
|
74
|
+
backgroundColor: theme.palette.patronus?.marbleLight[10],
|
|
75
|
+
borderRadius: "6px"
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
const CompanyName$1 = styled("div")(() => ({
|
|
79
|
+
display: "flex",
|
|
80
|
+
flexDirection: "column",
|
|
81
|
+
gap: "5px",
|
|
82
|
+
width: "100%"
|
|
83
|
+
}));
|
|
84
|
+
const CompanyLeyend = styled("div")(() => ({
|
|
85
|
+
display: "flex",
|
|
86
|
+
flexDirection: "column",
|
|
87
|
+
gap: "5px",
|
|
88
|
+
width: "100%"
|
|
89
|
+
}));
|
|
90
|
+
const FormContent$1 = styled("div")(() => ({
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
padding: "0 60px 0 80px",
|
|
94
|
+
margin: "auto 0",
|
|
95
|
+
width: "100%",
|
|
96
|
+
gap: "20px"
|
|
97
|
+
}));
|
|
98
|
+
const WrapperFormContent$1 = styled("div")(() => ({
|
|
99
|
+
display: "flex",
|
|
100
|
+
width: "100%",
|
|
101
|
+
height: "100%"
|
|
102
|
+
}));
|
|
103
|
+
const ContainerModuleName$1 = styled("div")(() => ({
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
width: "100%",
|
|
107
|
+
gap: "4px"
|
|
108
|
+
}));
|
|
109
|
+
const DesktopContent = () => {
|
|
110
|
+
const {
|
|
111
|
+
children,
|
|
112
|
+
companyLogoSmallUrl
|
|
113
|
+
} = useBase();
|
|
114
|
+
const {
|
|
115
|
+
getLabel
|
|
116
|
+
} = useModuleDictionary();
|
|
117
|
+
const {
|
|
118
|
+
name,
|
|
119
|
+
slogan
|
|
120
|
+
} = useDomain();
|
|
121
|
+
return /* @__PURE__ */ jsxs(DesktopContentRoot, {
|
|
122
|
+
children: [/* @__PURE__ */ jsx(LanguagePopover, {}), /* @__PURE__ */ jsxs(DesktopBanner, {
|
|
123
|
+
children: [/* @__PURE__ */ jsx(ContainerLogo$1, {
|
|
124
|
+
children: /* @__PURE__ */ jsx(Image, {
|
|
125
|
+
src: companyLogoSmallUrl,
|
|
126
|
+
ratio: "1:1",
|
|
127
|
+
width: "64px",
|
|
128
|
+
height: "64px"
|
|
129
|
+
})
|
|
130
|
+
}), /* @__PURE__ */ jsxs(CompanyName$1, {
|
|
131
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
132
|
+
variant: "subtitleDens",
|
|
133
|
+
skeletonWidth: "70%",
|
|
134
|
+
skeletongHeight: "24px",
|
|
135
|
+
children: name
|
|
136
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
137
|
+
variant: "paragraph",
|
|
138
|
+
skeletonWidth: "40%",
|
|
139
|
+
skeletongHeight: "20px",
|
|
140
|
+
children: getLabel("company_name_subtitle")
|
|
141
|
+
})]
|
|
142
|
+
}), /* @__PURE__ */ jsxs(CompanyLeyend, {
|
|
143
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
144
|
+
variant: "h5",
|
|
145
|
+
skeletonWidth: "50%",
|
|
146
|
+
skeletongHeight: "36px",
|
|
147
|
+
children: getLabel("module_leyend")
|
|
148
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
149
|
+
variant: "subtitle",
|
|
150
|
+
skeletonWidth: "80%",
|
|
151
|
+
skeletongHeight: "24px",
|
|
152
|
+
children: slogan
|
|
153
|
+
})]
|
|
154
|
+
})]
|
|
155
|
+
}), /* @__PURE__ */ jsx(WrapperFormContent$1, {
|
|
156
|
+
children: /* @__PURE__ */ jsx(ScrollBar, {
|
|
157
|
+
children: /* @__PURE__ */ jsxs(FormContent$1, {
|
|
158
|
+
children: [/* @__PURE__ */ jsxs(ContainerModuleName$1, {
|
|
159
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
160
|
+
variant: "h5",
|
|
161
|
+
skeletonWidth: "20%",
|
|
162
|
+
skeletongHeight: "36px",
|
|
163
|
+
children: getLabel("module_name")
|
|
164
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
165
|
+
variant: "paragraph",
|
|
166
|
+
skeletonWidth: "40%",
|
|
167
|
+
skeletongHeight: "20px",
|
|
168
|
+
children: getLabel("module_description")
|
|
169
|
+
})]
|
|
170
|
+
}), children]
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
const MobileContentRoot = styled("div")(({ theme }) => ({
|
|
177
|
+
display: "flex",
|
|
178
|
+
flexDirection: "column",
|
|
179
|
+
width: "100%",
|
|
180
|
+
height: "100%",
|
|
181
|
+
backgroundColor: theme.palette.background.neutral,
|
|
182
|
+
padding: "12px",
|
|
183
|
+
gap: "32px"
|
|
184
|
+
}));
|
|
185
|
+
const MobileBanner = styled("div")(({ theme }) => ({
|
|
186
|
+
display: "flex",
|
|
187
|
+
flexDirection: "column",
|
|
188
|
+
padding: "12px",
|
|
189
|
+
gap: "20px",
|
|
190
|
+
width: "100%",
|
|
191
|
+
backgroundColor: theme.palette.state?.focus,
|
|
192
|
+
boxShadow: theme.customShadows?.z4,
|
|
193
|
+
position: "relative",
|
|
194
|
+
borderRadius: "8px",
|
|
195
|
+
"& .M4LanguagePopover-root": {
|
|
196
|
+
position: "absolute",
|
|
197
|
+
top: "12px",
|
|
198
|
+
right: "12px"
|
|
199
|
+
},
|
|
200
|
+
"& .MuiTypography-root": {
|
|
201
|
+
color: theme.palette.patronus?.marbleLight[10],
|
|
202
|
+
display: "flex",
|
|
203
|
+
textTransform: "uppercase"
|
|
204
|
+
},
|
|
205
|
+
"& .MuiSkeleton-root": {
|
|
206
|
+
backgroundColor: alpha(`${theme.palette.patronus?.marbleLight[10]}`, 0.24),
|
|
207
|
+
margin: "auto"
|
|
208
|
+
}
|
|
209
|
+
}));
|
|
210
|
+
styled("div")(() => ({
|
|
211
|
+
display: "flex"
|
|
212
|
+
}));
|
|
213
|
+
const ContainerLogo = styled("div")(({ theme }) => ({
|
|
214
|
+
display: "flex",
|
|
215
|
+
width: "52px",
|
|
216
|
+
height: "52px",
|
|
217
|
+
borderRadius: "6px",
|
|
218
|
+
backgroundColor: theme.palette.state?.active,
|
|
219
|
+
justifyContent: "center",
|
|
220
|
+
alignItems: "center",
|
|
221
|
+
boxShadow: `0px 4px 8px ${alpha(theme.palette.patronus?.coolGrey[70] || "", 0.16)}`,
|
|
222
|
+
"& .M4LImage-root": {
|
|
223
|
+
backgroundColor: theme.palette.patronus?.marbleLight[10],
|
|
224
|
+
borderRadius: "6px"
|
|
225
|
+
}
|
|
226
|
+
}));
|
|
227
|
+
const CompanyName = styled("div")(() => ({
|
|
228
|
+
display: "flex",
|
|
229
|
+
flexDirection: "column",
|
|
230
|
+
width: "100%"
|
|
231
|
+
}));
|
|
232
|
+
const FormContent = styled("div")(() => ({
|
|
233
|
+
display: "flex",
|
|
234
|
+
flexDirection: "column",
|
|
235
|
+
padding: "12px",
|
|
236
|
+
margin: "auto 0",
|
|
237
|
+
width: "100%",
|
|
238
|
+
gap: "20px"
|
|
239
|
+
}));
|
|
240
|
+
const WrapperFormContent = styled("div")(() => ({
|
|
241
|
+
display: "flex",
|
|
242
|
+
width: "100%",
|
|
243
|
+
height: "100%",
|
|
244
|
+
overflow: "hidden"
|
|
245
|
+
}));
|
|
246
|
+
const ContainerModuleName = styled("div")(() => ({
|
|
247
|
+
display: "flex",
|
|
248
|
+
flexDirection: "column",
|
|
249
|
+
width: "100%",
|
|
250
|
+
gap: "4px"
|
|
251
|
+
}));
|
|
252
|
+
const MobileContent = () => {
|
|
253
|
+
const {
|
|
254
|
+
children,
|
|
255
|
+
companyLogoSmallUrl
|
|
256
|
+
} = useBase();
|
|
257
|
+
const {
|
|
258
|
+
getLabel
|
|
259
|
+
} = useModuleDictionary();
|
|
260
|
+
const {
|
|
261
|
+
name
|
|
262
|
+
} = useDomain();
|
|
263
|
+
return /* @__PURE__ */ jsxs(MobileContentRoot, {
|
|
264
|
+
children: [/* @__PURE__ */ jsxs(MobileBanner, {
|
|
265
|
+
children: [/* @__PURE__ */ jsx(ContainerLogo, {
|
|
266
|
+
children: /* @__PURE__ */ jsx(Image, {
|
|
267
|
+
src: companyLogoSmallUrl,
|
|
268
|
+
ratio: "1:1",
|
|
269
|
+
width: "44px",
|
|
270
|
+
height: "44px"
|
|
271
|
+
})
|
|
272
|
+
}), /* @__PURE__ */ jsxs(CompanyName, {
|
|
273
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
274
|
+
variant: "subtitleDens",
|
|
275
|
+
skeletonWidth: "70%",
|
|
276
|
+
skeletongHeight: "24px",
|
|
277
|
+
children: name
|
|
278
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
279
|
+
variant: "paragraph",
|
|
280
|
+
skeletonWidth: "40%",
|
|
281
|
+
skeletongHeight: "20px",
|
|
282
|
+
children: getLabel("company_name_subtitle")
|
|
283
|
+
})]
|
|
284
|
+
}), /* @__PURE__ */ jsx(LanguagePopover, {})]
|
|
285
|
+
}), /* @__PURE__ */ jsx(WrapperFormContent, {
|
|
286
|
+
children: /* @__PURE__ */ jsx(ScrollBar, {
|
|
287
|
+
children: /* @__PURE__ */ jsxs(FormContent, {
|
|
288
|
+
children: [/* @__PURE__ */ jsxs(ContainerModuleName, {
|
|
289
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
290
|
+
variant: "h5",
|
|
291
|
+
skeletonWidth: "20%",
|
|
292
|
+
skeletongHeight: "36px",
|
|
293
|
+
children: getLabel("module_name")
|
|
294
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
295
|
+
variant: "paragraph",
|
|
296
|
+
skeletonWidth: "40%",
|
|
297
|
+
skeletongHeight: "20px",
|
|
298
|
+
children: getLabel("module_description")
|
|
299
|
+
})]
|
|
300
|
+
}), children]
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
})]
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
const InnerModule = () => {
|
|
307
|
+
const {
|
|
308
|
+
getModuleLabel
|
|
309
|
+
} = useModuleDictionary();
|
|
310
|
+
const isDesktop = useResponsiveDesktop();
|
|
311
|
+
const {
|
|
312
|
+
subtitle
|
|
313
|
+
} = useBase();
|
|
314
|
+
return /* @__PURE__ */ jsx(HelmetPage, {
|
|
315
|
+
title: getModuleLabel(),
|
|
316
|
+
subtitle,
|
|
317
|
+
children: /* @__PURE__ */ jsx(InnerModuleRoot, {
|
|
318
|
+
children: isDesktop ? /* @__PURE__ */ jsx(DesktopContent, {}) : /* @__PURE__ */ jsx(MobileContent, {})
|
|
319
|
+
})
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
const NoAuthModuleLayout = (props) => {
|
|
323
|
+
const {
|
|
324
|
+
moduleId,
|
|
325
|
+
moduleNameField,
|
|
326
|
+
children,
|
|
327
|
+
componentsDictionary,
|
|
328
|
+
skeletonFlags,
|
|
329
|
+
subtitle,
|
|
330
|
+
companyLogoSmallUrl,
|
|
331
|
+
companyLogoNormalUrl,
|
|
332
|
+
moduleIlustrationUrl
|
|
333
|
+
} = props;
|
|
334
|
+
const {
|
|
335
|
+
host_static_assets,
|
|
336
|
+
environment_assets
|
|
337
|
+
} = useEnvironment();
|
|
338
|
+
const localeString = useLocales().currentLocale?.localeString;
|
|
339
|
+
const finalCompanyLogoNormalUrl = companyLogoNormalUrl || `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/logotipo_m4l.svg`;
|
|
340
|
+
const finalCompanyLogoSmallUrl = companyLogoSmallUrl || `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/isotipo_m4l.svg`;
|
|
341
|
+
const finalIllustrationUrl = moduleIlustrationUrl || `${host_static_assets}/${environment_assets}/frontend/domain/host/commons/assets/img/illustration_noauth.png`;
|
|
342
|
+
const finalSkeletonFlags = skeletonFlags;
|
|
343
|
+
if (finalSkeletonFlags.findIndex((f) => f === "dictionary_loaded") < 0) {
|
|
344
|
+
finalSkeletonFlags.push("dictionary_loaded");
|
|
345
|
+
}
|
|
346
|
+
return /* @__PURE__ */ jsx(BaseProvider, {
|
|
347
|
+
value: {
|
|
348
|
+
subtitle,
|
|
349
|
+
companyLogoSmallUrl: finalCompanyLogoSmallUrl,
|
|
350
|
+
companyLogoNormalUrl: finalCompanyLogoNormalUrl,
|
|
351
|
+
moduleIlustrationUrl: finalIllustrationUrl,
|
|
352
|
+
children
|
|
353
|
+
},
|
|
354
|
+
children: /* @__PURE__ */ jsx(FlagsProvider, {
|
|
355
|
+
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
356
|
+
isAuth: false,
|
|
357
|
+
moduleId,
|
|
358
|
+
moduleNameField,
|
|
359
|
+
componentsDictionary,
|
|
360
|
+
currentLang: localeString,
|
|
361
|
+
children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
|
|
362
|
+
flags: finalSkeletonFlags,
|
|
363
|
+
children: /* @__PURE__ */ jsx(InnerModule, {})
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
function getNoAuthModuleLayoutComponentsDictionary() {
|
|
370
|
+
return ["no_auth_module_layout"];
|
|
371
|
+
}
|
|
372
|
+
const defaultNoAuthModuleLayoutDictionary = {
|
|
373
|
+
no_auth_module_layout: {}
|
|
374
|
+
};
|
|
375
|
+
export {
|
|
376
|
+
NoAuthModuleLayout as N,
|
|
377
|
+
defaultNoAuthModuleLayoutDictionary as d,
|
|
378
|
+
getNoAuthModuleLayoutComponentsDictionary as g
|
|
379
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ModuleLayout/index.e7218171.js";
|
|
2
|
+
import "@m4l/components";
|
|
3
|
+
import "react";
|
|
4
|
+
import "@m4l/core";
|
|
5
|
+
import "./MasterDetailLayout/index.fe6ac47b.js";
|
|
6
|
+
import "@m4l/graphics";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "./NoAuthModuleLayout/index.2808fa44.js";
|
package/layouts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ModuleLayout } from './ModuleLayout';
|
|
1
|
+
export { ModuleLayout } from './ModuleLayout/ModuleLayout';
|
|
2
2
|
export * from './ModuleLayout/dicctionary';
|
|
3
|
-
export { MasterDetailLayout } from './MasterDetailLayout';
|
|
3
|
+
export { MasterDetailLayout } from './MasterDetailLayout/MasterDetailLayout';
|
|
4
4
|
export * from './MasterDetailLayout/dicctionary';
|
|
5
5
|
export { NoAuthModuleLayout } from './NoAuthModuleLayout';
|
|
6
6
|
export * from './NoAuthModuleLayout/dicctionary';
|
package/package.json
CHANGED
package/hooks/index.a0c767ed.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as o } from "react";
|
|
2
|
-
import { M as t } from "../../layouts/ModuleLayout/index.850f7dcf.js";
|
|
3
|
-
const n = () => {
|
|
4
|
-
const e = o(t);
|
|
5
|
-
if (!e)
|
|
6
|
-
throw new Error("useModule context must be use inside ModuleContext");
|
|
7
|
-
return e;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
n as u
|
|
11
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { createContext as w, useState as h, useRef as D, useMemo as m, useCallback as g } from "react";
|
|
2
|
-
import { voidFunction as k, useEnvironment as S, useModuleDictionary as $ } from "@m4l/core";
|
|
3
|
-
import { WindowBase as z, SplitLayout as P } from "@m4l/components";
|
|
4
|
-
import { a as A, g as I } from "../ModuleLayout/index.850f7dcf.js";
|
|
5
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
6
|
-
import { useResponsiveDesktop as L } from "@m4l/graphics";
|
|
7
|
-
const N = {
|
|
8
|
-
masterSelection: void 0,
|
|
9
|
-
onChangeMasterSelection: k
|
|
10
|
-
}, x = w(N);
|
|
11
|
-
function R(n) {
|
|
12
|
-
const {
|
|
13
|
-
children: a
|
|
14
|
-
} = n, [s, t] = h(void 0);
|
|
15
|
-
return /* @__PURE__ */ c(x.Provider, {
|
|
16
|
-
value: {
|
|
17
|
-
masterSelection: s,
|
|
18
|
-
onChangeMasterSelection: t
|
|
19
|
-
},
|
|
20
|
-
children: a
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function V(n, a = [], s, t) {
|
|
24
|
-
let o = t !== void 0 && t ? [...n] : [s];
|
|
25
|
-
return o = a.concat(o), o;
|
|
26
|
-
}
|
|
27
|
-
function T(n) {
|
|
28
|
-
const {
|
|
29
|
-
moduleId: a,
|
|
30
|
-
masterComponent: s,
|
|
31
|
-
detailComponent: t,
|
|
32
|
-
moduleActions: o,
|
|
33
|
-
version: M
|
|
34
|
-
} = n, {
|
|
35
|
-
host_static_assets: l,
|
|
36
|
-
environment_assets: i
|
|
37
|
-
} = S(), [r, C] = h("vertical"), d = L(), p = D(null), {
|
|
38
|
-
getLabel: e
|
|
39
|
-
} = $(), v = m(() => [{
|
|
40
|
-
urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
|
|
41
|
-
onClick: () => u("vertical"),
|
|
42
|
-
visibility: "main",
|
|
43
|
-
label: e("master_detail_layout.split_vertical"),
|
|
44
|
-
tag: "vertical",
|
|
45
|
-
className: "splitactions",
|
|
46
|
-
disabled: r === "vertical",
|
|
47
|
-
key: "vertical"
|
|
48
|
-
}, {
|
|
49
|
-
urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
|
|
50
|
-
onClick: () => u("horizontal"),
|
|
51
|
-
visibility: "main",
|
|
52
|
-
label: e("master_detail_layout.split_horizontal"),
|
|
53
|
-
tag: "horizontal",
|
|
54
|
-
className: "splitactions",
|
|
55
|
-
disabled: r === "horizontal",
|
|
56
|
-
key: "horizontal"
|
|
57
|
-
}, {
|
|
58
|
-
urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
|
|
59
|
-
onClick: () => u("none"),
|
|
60
|
-
visibility: "main",
|
|
61
|
-
label: e("master_detail_layout.no_split"),
|
|
62
|
-
tag: "none",
|
|
63
|
-
className: "splitactions",
|
|
64
|
-
disabled: r === "none",
|
|
65
|
-
key: "none"
|
|
66
|
-
}], [e, r]), u = g((f) => {
|
|
67
|
-
C(f);
|
|
68
|
-
}, []), y = g(() => {
|
|
69
|
-
p.current?.openModal({
|
|
70
|
-
initialWidth: 500,
|
|
71
|
-
initialHeigth: 680,
|
|
72
|
-
window: /* @__PURE__ */ c(z, {
|
|
73
|
-
urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
|
|
74
|
-
title: e("master_detail_layout.view_detail"),
|
|
75
|
-
children: typeof t == "function" ? t({}) : t
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
}, [t, e]), _ = m(() => ({
|
|
79
|
-
urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
|
|
80
|
-
onClick: y,
|
|
81
|
-
disabled: !1,
|
|
82
|
-
visibility: "allways",
|
|
83
|
-
label: e("master_detail_layout.view_detail"),
|
|
84
|
-
tag: "none",
|
|
85
|
-
className: "",
|
|
86
|
-
key: "detail"
|
|
87
|
-
}), [i, y]), b = m(() => V(v, o, _, d), [v, o, d, _]);
|
|
88
|
-
return /* @__PURE__ */ c(R, {
|
|
89
|
-
children: /* @__PURE__ */ c(A, {
|
|
90
|
-
ref: p,
|
|
91
|
-
moduleId: a,
|
|
92
|
-
moduleActions: b,
|
|
93
|
-
version: M,
|
|
94
|
-
children: /* @__PURE__ */ c(P, {
|
|
95
|
-
splitPosition: d ? r : "none",
|
|
96
|
-
firstPart: s,
|
|
97
|
-
secondPart: t
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function q() {
|
|
103
|
-
return ["master_detail_layout"].concat(I());
|
|
104
|
-
}
|
|
105
|
-
const G = {
|
|
106
|
-
master_detail_layout: {
|
|
107
|
-
split_vertical: "Split vertically",
|
|
108
|
-
split_horizontal: "Split horizontally",
|
|
109
|
-
no_split: "No split",
|
|
110
|
-
view_detail: "View detail"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
export {
|
|
114
|
-
x as M,
|
|
115
|
-
T as a,
|
|
116
|
-
G as d,
|
|
117
|
-
q as g
|
|
118
|
-
};
|