@m4l/layouts 0.1.38 → 0.1.40
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/BaseModule/index.d.ts +2 -1
- package/components/MFHostApp/index.420c2626.js +58 -58
- package/components/MFHostApp/index.d.ts +2 -1
- package/components/MFIsolationApp/index.d.ts +2 -1
- package/components/MFIsolationApp/index.e36cf308.js +175 -0
- package/components/MFIsolationApp/subcomponents/MFAuthApp/index.d.ts +2 -1
- package/components/{index.604759d6.js → index.aeb3cf83.js} +1 -1
- package/contexts/AuthContext/index.6f966215.js +118 -88
- package/contexts/AuthContext/index.d.ts +1 -1
- package/hooks/index.a0c767ed.js +4 -0
- package/hooks/useAuth/index.cb6a3420.js +7 -7
- package/hooks/useMasterDetail/index.927c0c26.js +6 -0
- package/hooks/useModule/index.edcd7b28.js +11 -0
- package/index.js +27 -27
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.d.ts +1 -1
- package/layouts/MasterDetailLayout/index.bca0fce5.js +136 -0
- package/layouts/MasterDetailLayout/index.d.ts +2 -1
- package/layouts/ModuleLayout/contexts/ModuleContext/index.d.ts +1 -1
- package/layouts/ModuleLayout/index.850f7dcf.js +118 -0
- package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +3 -0
- package/layouts/NoAuthModuleLayout/index.d.ts +2 -1
- package/layouts/NoAuthModuleLayout/index.eabf38c1.js +179 -146
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.d.ts +2 -1
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.d.ts +2 -0
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/index.d.ts +2 -1
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/styles.d.ts +9 -0
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/index.d.ts +2 -1
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/styles.d.ts +9 -0
- package/layouts/{index.3e2d546f.js → index.07aacf57.js} +2 -2
- package/package.json +2 -1
- package/components/MFIsolationApp/index.ed197bc0.js +0 -152
- package/hooks/index.18c6b299.js +0 -4
- package/hooks/useMasterDetail/index.50331312.js +0 -6
- package/hooks/useModule/index.35cc5fe0.js +0 -11
- package/layouts/MasterDetailLayout/index.2c363c7a.js +0 -109
- package/layouts/ModuleLayout/index.90b4dc8e.js +0 -103
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { useEffect as T, useMemo as _, useCallback as f } from "react";
|
|
2
|
-
import { unstable_HistoryRouter as x } from "react-router-dom";
|
|
3
|
-
import { ToastContainer as D, toast as H } from "react-toastify";
|
|
4
|
-
import { HostThemeProvider as O, FormatterProvider as B, LocalesProvider as I, getLocaleFromNetwork as j } from "@m4l/graphics";
|
|
5
|
-
import { A as S } from "../../contexts/AuthContext/index.6f966215.js";
|
|
6
|
-
import { DomainCountryProvider as U, EnvironmentProvider as z, HostToolsProvider as R, NetworkProvider as q, axiosOperation as G } from "@m4l/core";
|
|
7
|
-
import { createBrowserHistory as J } from "history";
|
|
8
|
-
import K from "eventemitter3";
|
|
9
|
-
import { format as Q } from "date-fns";
|
|
10
|
-
import { defaultThemeOptions as V, fnComponentsOverrides as W } from "@m4l/styles";
|
|
11
|
-
import { u as X } from "../../hooks/useAuth/index.cb6a3420.js";
|
|
12
|
-
import { jsx as r, jsxs as Y } from "react/jsx-runtime";
|
|
13
|
-
import h from "nprogress";
|
|
14
|
-
import { B as Z } from "../BaseModule/index.6309486a.js";
|
|
15
|
-
import { AreasProvider as $ } from "@m4l/components";
|
|
16
|
-
function oo(m) {
|
|
17
|
-
const {
|
|
18
|
-
children: a,
|
|
19
|
-
user: d,
|
|
20
|
-
pwd: l
|
|
21
|
-
} = m, {
|
|
22
|
-
isAuthenticated: n,
|
|
23
|
-
isInitialized: c,
|
|
24
|
-
login: u,
|
|
25
|
-
user: e
|
|
26
|
-
} = X();
|
|
27
|
-
if (T(() => {
|
|
28
|
-
c && n === !1 && u(d, l, !1);
|
|
29
|
-
}, [c, n]), !n)
|
|
30
|
-
return /* @__PURE__ */ r("div", {
|
|
31
|
-
children: "Pendiente x atenticar"
|
|
32
|
-
});
|
|
33
|
-
const o = {
|
|
34
|
-
id: 1,
|
|
35
|
-
currency: "USD",
|
|
36
|
-
currency_decimal_digits: 2,
|
|
37
|
-
decimal_symbol: ".",
|
|
38
|
-
thousands_symbol: ","
|
|
39
|
-
};
|
|
40
|
-
return e?.domain_country && (o.id = e?.domain_country.id ?? o.id, o.currency = e?.domain_country.currency ?? o.currency, o.currency_decimal_digits = e?.domain_country.currency_decimal_digits ?? o.currency_decimal_digits, o.decimal_symbol = e?.domain_country.decimal_symbol ?? o.decimal_symbol, o.thousands_symbol = e?.domain_country?.thousands_symbol ?? o.thousands_symbol), /* @__PURE__ */ Y(O, {
|
|
41
|
-
hostThemeOptions: V,
|
|
42
|
-
fnComponentsOverrides: W,
|
|
43
|
-
isMicroFrontEnd: !0,
|
|
44
|
-
children: [/* @__PURE__ */ r(D, {}), /* @__PURE__ */ r(U, {
|
|
45
|
-
...o,
|
|
46
|
-
isMicroFrontEnd: !1,
|
|
47
|
-
children: /* @__PURE__ */ r(B, {
|
|
48
|
-
isMicroFrontEnd: !1,
|
|
49
|
-
dateFormatter: {
|
|
50
|
-
formatDate: Q
|
|
51
|
-
},
|
|
52
|
-
currencyFormatter: {
|
|
53
|
-
code: o.currency,
|
|
54
|
-
decimalDigits: o.currency_decimal_digits
|
|
55
|
-
},
|
|
56
|
-
children: a
|
|
57
|
-
})
|
|
58
|
-
})]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const p = J({
|
|
62
|
-
window
|
|
63
|
-
});
|
|
64
|
-
function yo(m) {
|
|
65
|
-
const {
|
|
66
|
-
children: a,
|
|
67
|
-
user: d,
|
|
68
|
-
pwd: l,
|
|
69
|
-
host_api_local: n,
|
|
70
|
-
host_api_remote: c,
|
|
71
|
-
host_static_assets: u,
|
|
72
|
-
environment_assets: e,
|
|
73
|
-
moduleId: o,
|
|
74
|
-
skeletonFlags: y,
|
|
75
|
-
moduleNameField: v,
|
|
76
|
-
privileges: F,
|
|
77
|
-
componentsDictionary: g,
|
|
78
|
-
onLoad: w,
|
|
79
|
-
activeAreasNetwork: P = !1,
|
|
80
|
-
activeCookiesFromNetwork: b = !1
|
|
81
|
-
} = m, t = _(() => new K(), []), k = f((i, s) => {
|
|
82
|
-
t.on(i, s);
|
|
83
|
-
}, [t]), A = f((i, s) => {
|
|
84
|
-
if (s === null) {
|
|
85
|
-
t.removeListener(i);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
t.removeListener(i, s);
|
|
89
|
-
}, [t]), E = f((i, s) => {
|
|
90
|
-
t.emit(i, s);
|
|
91
|
-
}, [t]), M = () => {
|
|
92
|
-
h.configure({
|
|
93
|
-
showSpinner: !0
|
|
94
|
-
}), h.start();
|
|
95
|
-
}, C = () => {
|
|
96
|
-
h.done();
|
|
97
|
-
}, N = _(() => ({
|
|
98
|
-
host: "",
|
|
99
|
-
isLocalhost: !0,
|
|
100
|
-
domain_token: "lab1",
|
|
101
|
-
host_api_local: n,
|
|
102
|
-
host_api_remote: c,
|
|
103
|
-
host_static_assets: u,
|
|
104
|
-
environment_assets: e
|
|
105
|
-
}), []), L = _(() => ({
|
|
106
|
-
history: p,
|
|
107
|
-
toast: H,
|
|
108
|
-
startProgress: M,
|
|
109
|
-
stopProgress: C,
|
|
110
|
-
events_add_listener: k,
|
|
111
|
-
events_remove_listener: A,
|
|
112
|
-
events_emit: E
|
|
113
|
-
}), []);
|
|
114
|
-
return /* @__PURE__ */ r(z, {
|
|
115
|
-
...N,
|
|
116
|
-
children: /* @__PURE__ */ r(R, {
|
|
117
|
-
...L,
|
|
118
|
-
children: /* @__PURE__ */ r(q, {
|
|
119
|
-
axiosOperation: G,
|
|
120
|
-
children: /* @__PURE__ */ r(x, {
|
|
121
|
-
history: p,
|
|
122
|
-
children: /* @__PURE__ */ r(I, {
|
|
123
|
-
isMicroFrontEnd: !1,
|
|
124
|
-
getLocaleFromNetwork: j,
|
|
125
|
-
children: /* @__PURE__ */ r(S, {
|
|
126
|
-
children: /* @__PURE__ */ r(oo, {
|
|
127
|
-
user: d,
|
|
128
|
-
pwd: l,
|
|
129
|
-
children: /* @__PURE__ */ r(Z, {
|
|
130
|
-
moduleId: o,
|
|
131
|
-
privileges: F,
|
|
132
|
-
skeletonFlags: y,
|
|
133
|
-
componentsDictionary: g,
|
|
134
|
-
moduleNameField: v,
|
|
135
|
-
children: /* @__PURE__ */ r($, {
|
|
136
|
-
onLoad: w,
|
|
137
|
-
loadAreasFromNetwork: P,
|
|
138
|
-
loadCookiesFromNetwork: b,
|
|
139
|
-
children: a
|
|
140
|
-
})
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
})
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
export {
|
|
151
|
-
yo as M
|
|
152
|
-
};
|
package/hooks/index.18c6b299.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as o } from "react";
|
|
2
|
-
import { M as t } from "../../layouts/ModuleLayout/index.90b4dc8e.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,109 +0,0 @@
|
|
|
1
|
-
import { createContext as D, useState as g, useRef as k, useMemo as m, useCallback as f } from "react";
|
|
2
|
-
import { voidFunction as S, useEnvironment as z, useModuleDictionary as P } from "@m4l/core";
|
|
3
|
-
import { SplitLayout as $ } from "@m4l/components";
|
|
4
|
-
import { a as w, g as A } from "../ModuleLayout/index.90b4dc8e.js";
|
|
5
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
6
|
-
import { useResponsiveDesktop as L } from "@m4l/graphics";
|
|
7
|
-
const I = {
|
|
8
|
-
masterSelection: void 0,
|
|
9
|
-
onChangeMasterSelection: S
|
|
10
|
-
}, N = D(I);
|
|
11
|
-
function x(e) {
|
|
12
|
-
const {
|
|
13
|
-
children: i
|
|
14
|
-
} = e, [n, t] = g(void 0);
|
|
15
|
-
return /* @__PURE__ */ c(N.Provider, {
|
|
16
|
-
value: {
|
|
17
|
-
masterSelection: n,
|
|
18
|
-
onChangeMasterSelection: t
|
|
19
|
-
},
|
|
20
|
-
children: i
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function R(e, i = [], n, t) {
|
|
24
|
-
let o = t !== void 0 && t ? [...e] : [n];
|
|
25
|
-
return o = i.concat(o), o;
|
|
26
|
-
}
|
|
27
|
-
function B(e) {
|
|
28
|
-
const {
|
|
29
|
-
moduleId: i,
|
|
30
|
-
masterComponent: n,
|
|
31
|
-
detailComponent: t,
|
|
32
|
-
moduleActions: o,
|
|
33
|
-
version: h
|
|
34
|
-
} = e, {
|
|
35
|
-
host_static_assets: r,
|
|
36
|
-
environment_assets: a
|
|
37
|
-
} = z(), [s, C] = g("vertical"), d = L(), M = k(null), {
|
|
38
|
-
getLabel: l
|
|
39
|
-
} = P(), p = m(() => [{
|
|
40
|
-
urlIcon: `${r}/${a}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
|
|
41
|
-
onClick: () => u("vertical"),
|
|
42
|
-
visibility: "main",
|
|
43
|
-
label: l("master_detail_layout.split_vertical"),
|
|
44
|
-
tag: "vertical",
|
|
45
|
-
className: "splitactions",
|
|
46
|
-
disabled: s === "vertical",
|
|
47
|
-
key: "vertical"
|
|
48
|
-
}, {
|
|
49
|
-
urlIcon: `${r}/${a}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
|
|
50
|
-
onClick: () => u("horizontal"),
|
|
51
|
-
visibility: "main",
|
|
52
|
-
label: l("master_detail_layout.split_horizontal"),
|
|
53
|
-
tag: "horizontal",
|
|
54
|
-
className: "splitactions",
|
|
55
|
-
disabled: s === "horizontal",
|
|
56
|
-
key: "horizontal"
|
|
57
|
-
}, {
|
|
58
|
-
urlIcon: `${r}/${a}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
|
|
59
|
-
onClick: () => u("none"),
|
|
60
|
-
visibility: "main",
|
|
61
|
-
label: l("master_detail_layout.no_split"),
|
|
62
|
-
tag: "none",
|
|
63
|
-
className: "splitactions",
|
|
64
|
-
disabled: s === "none",
|
|
65
|
-
key: "none"
|
|
66
|
-
}], [l, s]), u = f((_) => {
|
|
67
|
-
C(_);
|
|
68
|
-
}, []), v = f(() => {
|
|
69
|
-
}, [t]), y = m(() => ({
|
|
70
|
-
urlIcon: `${r}/${a}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
|
|
71
|
-
onClick: v,
|
|
72
|
-
disabled: !1,
|
|
73
|
-
visibility: "allways",
|
|
74
|
-
label: l("master_detail_layout.view_detail"),
|
|
75
|
-
tag: "none",
|
|
76
|
-
className: "",
|
|
77
|
-
key: "detail"
|
|
78
|
-
}), [a, v]), b = m(() => R(p, o, y, d), [p, o, d, y]);
|
|
79
|
-
return /* @__PURE__ */ c(x, {
|
|
80
|
-
children: /* @__PURE__ */ c(w, {
|
|
81
|
-
ref: M,
|
|
82
|
-
moduleId: i,
|
|
83
|
-
moduleActions: b,
|
|
84
|
-
version: h,
|
|
85
|
-
children: /* @__PURE__ */ c($, {
|
|
86
|
-
splitPosition: d ? s : "none",
|
|
87
|
-
firstPart: n,
|
|
88
|
-
secondPart: t
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function G() {
|
|
94
|
-
return ["master_detail_layout"].concat(A());
|
|
95
|
-
}
|
|
96
|
-
const H = {
|
|
97
|
-
master_detail_layout: {
|
|
98
|
-
split_vertical: "Split vertically",
|
|
99
|
-
split_horizontal: "Split horizontally",
|
|
100
|
-
no_split: "No split",
|
|
101
|
-
view_detail: "View detail"
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
N as M,
|
|
106
|
-
B as a,
|
|
107
|
-
H as d,
|
|
108
|
-
G as g
|
|
109
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { useModal as x, useWindowToolsMF as v, ModalProvider as g, getModalDialogComponentsDictionary as h } from "@m4l/components";
|
|
2
|
-
import { forwardRef as p, useRef as m, useImperativeHandle as f, createContext as I, useState as a, useMemo as C, useEffect as A } from "react";
|
|
3
|
-
import { styled as M } from "@mui/material/styles";
|
|
4
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
const D = M("div")(() => ({
|
|
6
|
-
display: "flex",
|
|
7
|
-
flexDirection: "column",
|
|
8
|
-
position: "absolute",
|
|
9
|
-
margin: "0px 12px 12px 12px",
|
|
10
|
-
left: "0px",
|
|
11
|
-
right: "0px",
|
|
12
|
-
top: "0px",
|
|
13
|
-
bottom: "0px",
|
|
14
|
-
overflow: "hidden"
|
|
15
|
-
})), w = M("div")(({
|
|
16
|
-
theme: o
|
|
17
|
-
}) => ({
|
|
18
|
-
display: "flex",
|
|
19
|
-
position: "relative",
|
|
20
|
-
marginTop: o.spacing(1),
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
flexGrow: "1",
|
|
23
|
-
overflow: "hidden"
|
|
24
|
-
})), y = p((o, r) => {
|
|
25
|
-
const {
|
|
26
|
-
children: n
|
|
27
|
-
} = o, {
|
|
28
|
-
openModal: l
|
|
29
|
-
} = x(), e = m(null);
|
|
30
|
-
return f(r, () => ({
|
|
31
|
-
openModal: l,
|
|
32
|
-
current: e.current
|
|
33
|
-
})), /* @__PURE__ */ t(D, {
|
|
34
|
-
id: "WrapperInnerModule",
|
|
35
|
-
className: "m4l_module_layout",
|
|
36
|
-
ref: e,
|
|
37
|
-
children: /* @__PURE__ */ t(w, {
|
|
38
|
-
id: "ModuleContent",
|
|
39
|
-
children: n
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
y.displayName = "InnerModule";
|
|
44
|
-
const L = I(null);
|
|
45
|
-
function R(o) {
|
|
46
|
-
const {
|
|
47
|
-
children: r,
|
|
48
|
-
moduleActions: n,
|
|
49
|
-
moduleId: l,
|
|
50
|
-
version: e
|
|
51
|
-
} = o, [u] = a(() => ({
|
|
52
|
-
moduleId: l,
|
|
53
|
-
dictionary: void 0
|
|
54
|
-
})), {
|
|
55
|
-
setActions: d
|
|
56
|
-
} = v(), [i, s] = a([]), c = C(() => (n || []).concat(i), [n, i]);
|
|
57
|
-
return A(() => {
|
|
58
|
-
console.log("**Version layout", e), d(c, e);
|
|
59
|
-
}, [c]), /* @__PURE__ */ t(L.Provider, {
|
|
60
|
-
value: {
|
|
61
|
-
setDynamicActions: s,
|
|
62
|
-
moduleId: u.moduleId
|
|
63
|
-
},
|
|
64
|
-
children: r
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
const _ = p((o, r) => {
|
|
68
|
-
const {
|
|
69
|
-
moduleId: n,
|
|
70
|
-
moduleActions: l,
|
|
71
|
-
version: e,
|
|
72
|
-
children: u
|
|
73
|
-
} = o, d = m(null), i = (s) => {
|
|
74
|
-
d.current?.openModal(s);
|
|
75
|
-
};
|
|
76
|
-
return f(r, () => ({
|
|
77
|
-
openModal: i,
|
|
78
|
-
current: d.current
|
|
79
|
-
})), /* @__PURE__ */ t(R, {
|
|
80
|
-
moduleId: n,
|
|
81
|
-
moduleActions: l,
|
|
82
|
-
version: e,
|
|
83
|
-
children: /* @__PURE__ */ t(g, {
|
|
84
|
-
children: /* @__PURE__ */ t(y, {
|
|
85
|
-
ref: d,
|
|
86
|
-
children: u
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
_.displayName = "ModuleLayout";
|
|
92
|
-
function j() {
|
|
93
|
-
return ["module_layout"].concat(h());
|
|
94
|
-
}
|
|
95
|
-
const T = {
|
|
96
|
-
module_layout: {}
|
|
97
|
-
};
|
|
98
|
-
export {
|
|
99
|
-
L as M,
|
|
100
|
-
_ as a,
|
|
101
|
-
T as d,
|
|
102
|
-
j as g
|
|
103
|
-
};
|