@m4l/layouts 2.0.0 → 2.0.2
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/MFHostApp/{index.6286a793.js → index-_3WAKrrA.js} +7 -2
- package/components/MFHostApp/index.d.ts +1 -1
- package/components/MFHostApp/types.d.ts +5 -0
- package/components/MFWindowsTitle/MFWindowsTitle.d.ts +3 -0
- package/components/MFWindowsTitle/index.d.ts +1 -0
- package/components/MFWindowsTitle/types.d.ts +5 -0
- package/components/{index.56bd7864.js → index-uQ5qk7MJ.js} +15 -2
- package/contexts/AuthContext/{index.59755369.js → index-DARkRRM4.js} +4 -3
- package/hooks/useAuth/{index.ae68bf71.js → index-8hAi3guc.js} +2 -3
- package/hooks/useMasterDetail/{index.d45f2a86.js → index-D4QUQYYc.js} +1 -1
- package/hooks/useModule/{index.b5f598b1.js → index-FY5nsBmE.js} +2 -3
- package/index.js +14 -23
- package/layouts/MasterDetailLayout/{index.748f7ada.js → index-DeC4RoBs.js} +6 -1
- package/layouts/ModuleLayout/{index.e7218171.js → index-DAtDuh6s.js} +7 -0
- package/layouts/NoAuthModuleLayout/{index.83cd3ea3.js → index-BxJ0vCUq.js} +2 -0
- package/package.json +1 -1
- /package/contexts/{index.ee173661.js → index-l0sNRNKZ.js} +0 -0
- /package/hooks/{index.77acdde7.js → index-l0sNRNKZ.js} +0 -0
- /package/layouts/{index.417b6868.js → index-l0sNRNKZ.js} +0 -0
|
@@ -3,6 +3,7 @@ import { EnvironmentProvider, HostToolsProvider, NetworkProvider, DomainCountryP
|
|
|
3
3
|
import { LocalesProvider, HostThemeProvider, ResponsiveContainerProvider, FormatterProvider } from "@m4l/graphics";
|
|
4
4
|
import { BaseModule, WindowToolsMFProvider, DynamicMFParmsProvider } from "@m4l/components";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { M as MFWindowsTitle } from "../index-uQ5qk7MJ.js";
|
|
6
7
|
function MFHostApp(props) {
|
|
7
8
|
const {
|
|
8
9
|
children,
|
|
@@ -20,7 +21,8 @@ function MFHostApp(props) {
|
|
|
20
21
|
componentsDictionary,
|
|
21
22
|
dynamicMFStore,
|
|
22
23
|
windowTools,
|
|
23
|
-
observedDivRef
|
|
24
|
+
observedDivRef,
|
|
25
|
+
isAddEditModule = false
|
|
24
26
|
} = props;
|
|
25
27
|
return /* @__PURE__ */ jsx(EnvironmentProvider, {
|
|
26
28
|
...environment,
|
|
@@ -59,7 +61,10 @@ function MFHostApp(props) {
|
|
|
59
61
|
...windowTools,
|
|
60
62
|
children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
|
|
61
63
|
store: dynamicMFStore,
|
|
62
|
-
children
|
|
64
|
+
children: /* @__PURE__ */ jsx(MFWindowsTitle, {
|
|
65
|
+
isAddEditModule,
|
|
66
|
+
children
|
|
67
|
+
})
|
|
63
68
|
})
|
|
64
69
|
})
|
|
65
70
|
})
|
|
@@ -12,5 +12,10 @@ export interface ByHostProps {
|
|
|
12
12
|
dynamicMFStore: DynamicMFStore;
|
|
13
13
|
windowTools: WindowToolsMF;
|
|
14
14
|
observedDivRef: Element | Text | null;
|
|
15
|
+
/**
|
|
16
|
+
* isAddEditModule saber si el módulo es tipo add/edit, para poder asignar el title automáticamente
|
|
17
|
+
* cuando se cambia el idioma, desde MFHostApp/MFWindowsTitle
|
|
18
|
+
*/
|
|
19
|
+
isAddEditModule?: boolean;
|
|
15
20
|
}
|
|
16
21
|
export declare type MFHostAppProps = ByHostProps & BaseModuleProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MFWindowsTitle';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DomainCountryProvider } from "@m4l/core";
|
|
2
2
|
import { FormatterProvider, ResponsiveContainerProvider } from "@m4l/graphics";
|
|
3
|
-
import { BaseModule } from "@m4l/components";
|
|
3
|
+
import { BaseModule, useSetWindowsTitle } from "@m4l/components";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment } from "react";
|
|
5
6
|
function MFNoAuthApp(props) {
|
|
6
7
|
const {
|
|
7
8
|
children,
|
|
@@ -42,6 +43,18 @@ function MFNoAuthApp(props) {
|
|
|
42
43
|
})
|
|
43
44
|
});
|
|
44
45
|
}
|
|
46
|
+
function MFWindowsTitle({
|
|
47
|
+
isAddEditModule = false,
|
|
48
|
+
children
|
|
49
|
+
}) {
|
|
50
|
+
useSetWindowsTitle({
|
|
51
|
+
isAddEditModule
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
}
|
|
45
57
|
export {
|
|
46
|
-
|
|
58
|
+
MFWindowsTitle as M,
|
|
59
|
+
MFNoAuthApp as a
|
|
47
60
|
};
|
|
@@ -61,8 +61,9 @@ function AuthProvider(props) {
|
|
|
61
61
|
domain_token
|
|
62
62
|
} = useEnvironment();
|
|
63
63
|
const [nextValSession, setNextValSession] = useLocalStorageWithListener(
|
|
64
|
+
//Variable para saber si ha cambiado la session en otro navegador
|
|
64
65
|
"vSession",
|
|
65
|
-
new Date().getTime() + ""
|
|
66
|
+
(/* @__PURE__ */ new Date()).getTime() + ""
|
|
66
67
|
);
|
|
67
68
|
useEffect(() => {
|
|
68
69
|
const initialize = async () => {
|
|
@@ -124,7 +125,7 @@ function AuthProvider(props) {
|
|
|
124
125
|
user
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
|
-
setNextValSession(new Date().getTime() + "");
|
|
128
|
+
setNextValSession((/* @__PURE__ */ new Date()).getTime() + "");
|
|
128
129
|
});
|
|
129
130
|
};
|
|
130
131
|
const logout = async (isAuthenticated) => {
|
|
@@ -137,7 +138,7 @@ function AuthProvider(props) {
|
|
|
137
138
|
dispatch({
|
|
138
139
|
type: EnumTypes.Logout
|
|
139
140
|
});
|
|
140
|
-
setNextValSession(new Date().getTime() + "");
|
|
141
|
+
setNextValSession((/* @__PURE__ */ new Date()).getTime() + "");
|
|
141
142
|
};
|
|
142
143
|
const onNetserviceUnautorized = () => {
|
|
143
144
|
logout(false);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { A as AuthContext } from "../../contexts/AuthContext/index.
|
|
2
|
+
import { A as AuthContext } from "../../contexts/AuthContext/index-DARkRRM4.js";
|
|
3
3
|
const useAuth = () => {
|
|
4
4
|
const context = useContext(AuthContext);
|
|
5
|
-
if (!context)
|
|
6
|
-
throw new Error("Auth context must be use inside AuthProvider");
|
|
5
|
+
if (!context) throw new Error("Auth context must be use inside AuthProvider");
|
|
7
6
|
return context;
|
|
8
7
|
};
|
|
9
8
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.
|
|
2
|
+
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index-DeC4RoBs.js";
|
|
3
3
|
const useMasterDetail = () => useContext(MasterDetailContext);
|
|
4
4
|
export {
|
|
5
5
|
useMasterDetail as u
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as ModuleContext } from "../../layouts/ModuleLayout/index.
|
|
2
|
+
import { M as ModuleContext } from "../../layouts/ModuleLayout/index-DAtDuh6s.js";
|
|
3
3
|
const useModule = () => {
|
|
4
4
|
const context = useContext(ModuleContext);
|
|
5
|
-
if (!context)
|
|
6
|
-
throw new Error("useModule context must be use inside ModuleContext");
|
|
5
|
+
if (!context) throw new Error("useModule context must be use inside ModuleContext");
|
|
7
6
|
return context;
|
|
8
7
|
};
|
|
9
8
|
export {
|
package/index.js
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { M
|
|
3
|
-
import { A, a } from "./contexts/AuthContext/index.
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.
|
|
7
|
-
import { u } from "./hooks/useMasterDetail/index.
|
|
8
|
-
import { u as u2 } from "./hooks/useAuth/index.
|
|
9
|
-
import { u as u3 } from "./hooks/useModule/index.
|
|
10
|
-
import "@m4l/core";
|
|
11
|
-
import "@m4l/graphics";
|
|
12
|
-
import "@m4l/components";
|
|
13
|
-
import "react/jsx-runtime";
|
|
14
|
-
import "react-router-dom";
|
|
15
|
-
import "react";
|
|
16
|
-
import "@mui/material/styles";
|
|
17
|
-
import "@mui/material";
|
|
18
|
-
import "@mui/base";
|
|
1
|
+
import { a } from "./components/index-uQ5qk7MJ.js";
|
|
2
|
+
import { M } from "./components/MFHostApp/index-_3WAKrrA.js";
|
|
3
|
+
import { A, a as a2 } from "./contexts/AuthContext/index-DARkRRM4.js";
|
|
4
|
+
import { a as a3, d, g } from "./layouts/ModuleLayout/index-DAtDuh6s.js";
|
|
5
|
+
import { a as a4, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index-DeC4RoBs.js";
|
|
6
|
+
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index-BxJ0vCUq.js";
|
|
7
|
+
import { u } from "./hooks/useMasterDetail/index-D4QUQYYc.js";
|
|
8
|
+
import { u as u2 } from "./hooks/useAuth/index-8hAi3guc.js";
|
|
9
|
+
import { u as u3 } from "./hooks/useModule/index-FY5nsBmE.js";
|
|
19
10
|
export {
|
|
20
11
|
A as AuthContext,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
a2 as AuthProvider,
|
|
13
|
+
M as MFHostApp,
|
|
14
|
+
a as MFNoAuthApp,
|
|
15
|
+
a4 as MasterDetailLayout,
|
|
16
|
+
a3 as ModuleLayout,
|
|
26
17
|
N as NoAuthModuleLayout,
|
|
27
18
|
d2 as defaultMasterDetailDictionary,
|
|
28
19
|
d as defaultModuleLayoutDictionary,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useState, useRef, useMemo, useCallback } from "react";
|
|
2
2
|
import { voidFunction, useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
4
|
-
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.
|
|
4
|
+
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index-DAtDuh6s.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
7
|
import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/material";
|
|
@@ -29,7 +29,9 @@ function MasterDetailProvider(props) {
|
|
|
29
29
|
}
|
|
30
30
|
const componentName = "M4LMasterDetailLayout";
|
|
31
31
|
generateUtilityClasses(componentName, [
|
|
32
|
+
/* elements */
|
|
32
33
|
"root"
|
|
34
|
+
/* states or variants of elements */
|
|
33
35
|
]);
|
|
34
36
|
function getMasterDetailLayoutUtilityClass(slot) {
|
|
35
37
|
return generateUtilityClass(componentName, slot);
|
|
@@ -58,6 +60,7 @@ function MasterDetailLayout(props) {
|
|
|
58
60
|
detailComponent,
|
|
59
61
|
moduleActions,
|
|
60
62
|
version
|
|
63
|
+
// defaultDictionary,
|
|
61
64
|
} = props;
|
|
62
65
|
const {
|
|
63
66
|
host_static_assets,
|
|
@@ -111,6 +114,7 @@ function MasterDetailLayout(props) {
|
|
|
111
114
|
children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
|
|
112
115
|
}
|
|
113
116
|
)
|
|
117
|
+
// actions: undefined,
|
|
114
118
|
});
|
|
115
119
|
}, [detailComponent, getLabel]);
|
|
116
120
|
const finalModuleActions = useMemo(() => {
|
|
@@ -146,6 +150,7 @@ const defaultMasterDetailDictionary = {
|
|
|
146
150
|
no_split: "No split",
|
|
147
151
|
view_detail: "View detail"
|
|
148
152
|
}
|
|
153
|
+
//...defaultModuleLayoutDictionary,
|
|
149
154
|
};
|
|
150
155
|
export {
|
|
151
156
|
MasterDetailContext as M,
|
|
@@ -11,8 +11,10 @@ const InnerModuleRoot = styled("div")(({
|
|
|
11
11
|
}));
|
|
12
12
|
const componentName = "M4LModuleLayout";
|
|
13
13
|
generateUtilityClasses(componentName, [
|
|
14
|
+
/* elements */
|
|
14
15
|
"root",
|
|
15
16
|
"moduleContent"
|
|
17
|
+
/* states or variants of elements */
|
|
16
18
|
]);
|
|
17
19
|
function getModuleLayoutUtilityClass(slot) {
|
|
18
20
|
return generateUtilityClass(componentName, slot);
|
|
@@ -74,8 +76,13 @@ function ModuleProvider(props) {
|
|
|
74
76
|
}, [finalModuleActions]);
|
|
75
77
|
return /* @__PURE__ */ jsx(ModuleContext.Provider, {
|
|
76
78
|
value: {
|
|
79
|
+
// moduleActions: finalModuleActions,
|
|
80
|
+
// dynamicActions,
|
|
77
81
|
setDynamicActions,
|
|
78
82
|
moduleId: configOptions.moduleId
|
|
83
|
+
// moduleNameField: configOptions.moduleNameField,
|
|
84
|
+
// urlIcon: configOptions.urlIcon,
|
|
85
|
+
// breadcrumbLinks: configOptions.breadcrumbLinks,
|
|
79
86
|
},
|
|
80
87
|
children
|
|
81
88
|
});
|
|
@@ -269,6 +269,8 @@ const CompanyName = styled$1("div")(() => ({
|
|
|
269
269
|
const FormContent = styled$1("div")(() => ({
|
|
270
270
|
display: "flex",
|
|
271
271
|
flexDirection: "column",
|
|
272
|
+
/* justifyContent: 'flex-start',
|
|
273
|
+
alignItems: 'center', */
|
|
272
274
|
padding: "12px",
|
|
273
275
|
margin: "auto 0",
|
|
274
276
|
width: "100%",
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|