@m4l/layouts 0.1.35 → 0.1.38

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.
Files changed (38) hide show
  1. package/components/BaseModule/index.d.ts +0 -1
  2. package/components/MFHostApp/index.d.ts +0 -1
  3. package/components/MFIsolationApp/index.d.ts +0 -1
  4. package/components/MFIsolationApp/index.ed197bc0.js +152 -0
  5. package/components/MFIsolationApp/subcomponents/MFAuthApp/index.d.ts +0 -1
  6. package/components/MFIsolationApp/types.d.ts +1 -0
  7. package/components/{index.80a2abab.js → index.604759d6.js} +1 -1
  8. package/hooks/index.18c6b299.js +4 -0
  9. package/hooks/useMasterDetail/{index.dd9cb927.js → index.50331312.js} +1 -1
  10. package/hooks/useModule/{index.97184469.js → index.35cc5fe0.js} +1 -1
  11. package/index.js +6 -6
  12. package/layouts/MasterDetailLayout/index.2c363c7a.js +109 -0
  13. package/layouts/MasterDetailLayout/index.d.ts +0 -1
  14. package/layouts/ModuleLayout/contexts/ModuleContext/types.d.ts +1 -0
  15. package/layouts/ModuleLayout/index.90b4dc8e.js +103 -0
  16. package/layouts/ModuleLayout/types.d.ts +1 -0
  17. package/layouts/NoAuthModuleLayout/index.d.ts +0 -1
  18. package/layouts/NoAuthModuleLayout/index.eabf38c1.js +345 -0
  19. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.d.ts +1 -3
  20. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/index.d.ts +1 -0
  21. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/index.d.ts +1 -0
  22. package/layouts/NoAuthModuleLayout/types.d.ts +1 -1
  23. package/layouts/index.3e2d546f.js +8 -0
  24. package/package.json +1 -1
  25. package/components/MFIsolationApp/index.fb96bc5d.js +0 -150
  26. package/hooks/index.43202c4e.js +0 -4
  27. package/layouts/MasterDetailLayout/index.793884be.js +0 -106
  28. package/layouts/ModuleLayout/index.c673a65f.js +0 -100
  29. package/layouts/NoAuthModuleLayout/index.5d946846.js +0 -198
  30. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/index.d.ts +0 -3
  31. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/index.d.ts +0 -2
  32. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/index.d.ts +0 -3
  33. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/index.d.ts +0 -2
  34. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/types.d.ts +0 -4
  35. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/types.d.ts +0 -4
  36. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/index.d.ts +0 -2
  37. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/types.d.ts +0 -4
  38. package/layouts/index.8748e200.js +0 -8
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BaseModuleProps } from './types';
3
2
  export declare function BaseModule(props: BaseModuleProps): JSX.Element;
4
3
  export default BaseModule;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MFHostAppProps } from './types';
3
2
  export declare function MFHostApp(props: MFHostAppProps): JSX.Element;
4
3
  export default MFHostApp;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MFIsolationAppProps } from './types';
3
2
  export declare function MFIsolationApp(props: MFIsolationAppProps): JSX.Element;
4
3
  export default MFIsolationApp;
@@ -0,0 +1,152 @@
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
+ };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MFAuthAppProps } from './types';
3
2
  export declare function MFAuthApp(props: MFAuthAppProps): JSX.Element;
4
3
  export default MFAuthApp;
@@ -8,4 +8,5 @@ export declare type MFIsolationAppProps = BaseModuleProps & {
8
8
  environment_assets: string;
9
9
  onLoad: () => void;
10
10
  activeAreasNetwork?: boolean;
11
+ activeCookiesFromNetwork?: boolean;
11
12
  };
@@ -1,4 +1,4 @@
1
- import "./MFIsolationApp/index.fb96bc5d.js";
1
+ import "./MFIsolationApp/index.ed197bc0.js";
2
2
  import "react-router-dom";
3
3
  import "@m4l/core";
4
4
  import "@m4l/graphics";
@@ -0,0 +1,4 @@
1
+ import "react";
2
+ import "../layouts/MasterDetailLayout/index.2c363c7a.js";
3
+ import "../contexts/AuthContext/index.6f966215.js";
4
+ import "../layouts/ModuleLayout/index.90b4dc8e.js";
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../layouts/MasterDetailLayout/index.793884be.js";
2
+ import { M as e } from "../../layouts/MasterDetailLayout/index.2c363c7a.js";
3
3
  const s = () => t(e);
4
4
  export {
5
5
  s as u
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { M as t } from "../../layouts/ModuleLayout/index.c673a65f.js";
2
+ import { M as t } from "../../layouts/ModuleLayout/index.90b4dc8e.js";
3
3
  const n = () => {
4
4
  const e = o(t);
5
5
  if (!e)
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { M as f } from "./components/MFIsolationApp/index.fb96bc5d.js";
1
+ import { M as f } from "./components/MFIsolationApp/index.ed197bc0.js";
2
2
  import { M as D } from "./components/MFHostApp/index.420c2626.js";
3
3
  import { B as L } from "./components/BaseModule/index.6309486a.js";
4
4
  import { a as g, A as h } from "./contexts/AuthContext/index.6f966215.js";
5
- import { a as N, d as B, g as F } from "./layouts/ModuleLayout/index.c673a65f.js";
6
- import { a as H, d as I, g as P } from "./layouts/MasterDetailLayout/index.793884be.js";
7
- import { N as j, d as k, g as q } from "./layouts/NoAuthModuleLayout/index.5d946846.js";
8
- import { u as z } from "./hooks/useMasterDetail/index.dd9cb927.js";
5
+ import { a as N, d as B, g as F } from "./layouts/ModuleLayout/index.90b4dc8e.js";
6
+ import { a as H, d as I, g as P } from "./layouts/MasterDetailLayout/index.2c363c7a.js";
7
+ import { N as j, d as k, g as q } from "./layouts/NoAuthModuleLayout/index.eabf38c1.js";
8
+ import { u as z } from "./hooks/useMasterDetail/index.50331312.js";
9
9
  import { u as G } from "./hooks/useAuth/index.cb6a3420.js";
10
- import { u as K } from "./hooks/useModule/index.97184469.js";
10
+ import { u as K } from "./hooks/useModule/index.35cc5fe0.js";
11
11
  import "react";
12
12
  import "react-router-dom";
13
13
  import "react-toastify";
@@ -0,0 +1,109 @@
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,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { MasterDetailLayoutProps } from './types';
3
2
  export declare function MasterDetailLayout(props: MasterDetailLayoutProps): JSX.Element;
@@ -5,6 +5,7 @@ export interface ModuleLayoutContextStateProps {
5
5
  }
6
6
  export interface ModuleLayoutProviderProps extends Omit<ModuleLayoutContextStateProps, 'init'> {
7
7
  children: ReactNode;
8
+ version: string;
8
9
  moduleActions?: ModuleAction[];
9
10
  }
10
11
  export interface ModuleLayoutContextProps extends ModuleLayoutContextStateProps {
@@ -0,0 +1,103 @@
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
+ };
@@ -12,4 +12,5 @@ export interface ModuleLayoutProps {
12
12
  moduleId: string;
13
13
  moduleActions?: ModuleAction[];
14
14
  children: ReactNode;
15
+ version: string;
15
16
  }
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { NoAuthModuleLayoutProps } from './types';
3
2
  export declare const NoAuthModuleLayout: (props: NoAuthModuleLayoutProps) => JSX.Element;