@m4l/layouts 0.1.30 → 0.1.33

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 (27) hide show
  1. package/components/MFHostApp/index.420c2626.js +73 -0
  2. package/components/MFHostApp/types.d.ts +5 -3
  3. package/components/MFIsolationApp/index.fb96bc5d.js +150 -0
  4. package/components/{index.37205bf4.js → index.80a2abab.js} +1 -1
  5. package/hooks/index.43202c4e.js +4 -0
  6. package/hooks/useMasterDetail/{index.1b024fd5.js → index.dd9cb927.js} +1 -1
  7. package/hooks/useModule/{index.6ff7d08a.js → index.97184469.js} +1 -1
  8. package/index.js +7 -7
  9. package/layouts/MasterDetailLayout/index.793884be.js +106 -0
  10. package/layouts/ModuleLayout/contexts/ModuleContext/types.d.ts +1 -2
  11. package/layouts/ModuleLayout/{index.a76397df.js → index.c673a65f.js} +35 -36
  12. package/layouts/ModuleLayout/types.d.ts +1 -1
  13. package/layouts/NoAuthModuleLayout/{index.5d1098ef.js → index.5d946846.js} +5 -5
  14. package/layouts/index.8748e200.js +8 -0
  15. package/package.json +1 -1
  16. package/components/MFHostApp/index.1700d13a.js +0 -69
  17. package/components/MFIsolationApp/index.b89e6800.js +0 -152
  18. package/hooks/index.2022a179.js +0 -4
  19. package/layouts/MasterDetailLayout/index.3da0ffda.js +0 -104
  20. package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -3
  21. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -2
  22. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/styles.d.ts +0 -2
  23. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/styles.d.ts +0 -2
  24. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/styles.d.ts +0 -3
  25. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/styles.d.ts +0 -2
  26. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/styles.d.ts +0 -2
  27. package/layouts/index.014e41ba.js +0 -8
@@ -0,0 +1,73 @@
1
+ import { unstable_HistoryRouter as p } from "react-router-dom";
2
+ import { EnvironmentProvider as v, HostToolsProvider as M, NetworkProvider as P, DomainCountryProvider as f } from "@m4l/core";
3
+ import { LocalesProvider as b, HostThemeProvider as T, FormatterProvider as g } from "@m4l/graphics";
4
+ import { WindowToolsMFProvider as E, DynamicMFParmsProvider as H } from "@m4l/components";
5
+ import { B as _ } from "../BaseModule/index.6309486a.js";
6
+ import { jsx as r } from "react/jsx-runtime";
7
+ function L(t) {
8
+ const {
9
+ children: n,
10
+ currentLocale: d,
11
+ hostTheme: m,
12
+ environment: s,
13
+ hostTools: e,
14
+ axiosOperation: c,
15
+ formatters: o,
16
+ moduleId: l,
17
+ moduleNameField: a,
18
+ skeletonFlags: u,
19
+ privileges: h,
20
+ componentsDictionary: y,
21
+ dynamicMFStore: i,
22
+ windowTools: F
23
+ } = t;
24
+ return /* @__PURE__ */ r(v, {
25
+ ...s,
26
+ children: /* @__PURE__ */ r(M, {
27
+ ...e,
28
+ children: /* @__PURE__ */ r(P, {
29
+ axiosOperation: c,
30
+ children: /* @__PURE__ */ r(b, {
31
+ isMicroFrontEnd: !0,
32
+ localeHost: d,
33
+ children: /* @__PURE__ */ r(T, {
34
+ isMicroFrontEnd: !0,
35
+ ...m,
36
+ children: /* @__PURE__ */ r(p, {
37
+ history: e.history,
38
+ children: /* @__PURE__ */ r(f, {
39
+ isMicroFrontEnd: !0,
40
+ id: i?.getState().dynamicMFParameters?.id || 1,
41
+ currency: o.currencyFormatter.code,
42
+ currency_decimal_digits: o.currencyFormatter.decimalDigits,
43
+ decimal_symbol: o.numberFormatter.decimalSymbol,
44
+ thousands_symbol: o.numberFormatter.thousandsSymbol,
45
+ children: /* @__PURE__ */ r(_, {
46
+ moduleId: l,
47
+ moduleNameField: a,
48
+ componentsDictionary: y,
49
+ skeletonFlags: u,
50
+ privileges: h,
51
+ children: /* @__PURE__ */ r(g, {
52
+ isMicroFrontEnd: !0,
53
+ ...o,
54
+ children: /* @__PURE__ */ r(E, {
55
+ ...F,
56
+ children: /* @__PURE__ */ r(H, {
57
+ store: i,
58
+ children: n
59
+ })
60
+ })
61
+ })
62
+ })
63
+ })
64
+ })
65
+ })
66
+ })
67
+ })
68
+ })
69
+ });
70
+ }
71
+ export {
72
+ L as M
73
+ };
@@ -1,7 +1,8 @@
1
1
  import type { AxiosOperation, EnvironmentType, HostToolsType } from '@m4l/core';
2
- import { Formatters, HostThemeType, LocaleType } from '@m4l/graphics';
3
- import { DynamicMFParameters } from '@m4l/components';
2
+ import { Formatters, LocaleType } from '@m4l/graphics';
3
+ import { DynamicMFStore, WindowToolsMF } from '@m4l/components';
4
4
  import { BaseModuleProps } from '../BaseModule/types';
5
+ import { HostThemeType } from '@m4l/graphics';
5
6
  export interface ByHostProps {
6
7
  environment: EnvironmentType;
7
8
  hostTools: HostToolsType;
@@ -9,6 +10,7 @@ export interface ByHostProps {
9
10
  currentLocale: LocaleType;
10
11
  axiosOperation: AxiosOperation;
11
12
  formatters: Formatters;
12
- dynamicMFParameters: DynamicMFParameters;
13
+ dynamicMFStore: DynamicMFStore;
14
+ windowTools: WindowToolsMF;
13
15
  }
14
16
  export declare type MFHostAppProps = ByHostProps & BaseModuleProps;
@@ -0,0 +1,150 @@
1
+ import { useEffect as x, useMemo as _, useCallback as f } from "react";
2
+ import { unstable_HistoryRouter as C } from "react-router-dom";
3
+ import { ToastContainer as D, toast as N } from "react-toastify";
4
+ import { HostThemeProvider as H, FormatterProvider as O, LocalesProvider as B, getLocaleFromNetwork as I } from "@m4l/graphics";
5
+ import { A as j } from "../../contexts/AuthContext/index.6f966215.js";
6
+ import { DomainCountryProvider as S, EnvironmentProvider as U, HostToolsProvider as z, NetworkProvider as R, axiosOperation as q } from "@m4l/core";
7
+ import { createBrowserHistory as G } from "history";
8
+ import J from "eventemitter3";
9
+ import { format as K } from "date-fns";
10
+ import { defaultThemeOptions as Q, fnComponentsOverrides as V } from "@m4l/styles";
11
+ import { u as W } from "../../hooks/useAuth/index.cb6a3420.js";
12
+ import { jsx as o, jsxs as X } from "react/jsx-runtime";
13
+ import h from "nprogress";
14
+ import { B as Y } from "../BaseModule/index.6309486a.js";
15
+ import { AreasProvider as Z } from "@m4l/components";
16
+ function $(m) {
17
+ const {
18
+ children: a,
19
+ user: d,
20
+ pwd: l
21
+ } = m, {
22
+ isAuthenticated: s,
23
+ isInitialized: c,
24
+ login: u,
25
+ user: e
26
+ } = W();
27
+ if (x(() => {
28
+ c && s === !1 && u(d, l, !1);
29
+ }, [c, s]), !s)
30
+ return /* @__PURE__ */ o("div", {
31
+ children: "Pendiente x atenticar"
32
+ });
33
+ const r = {
34
+ id: 1,
35
+ currency: "USD",
36
+ currency_decimal_digits: 2,
37
+ decimal_symbol: ".",
38
+ thousands_symbol: ","
39
+ };
40
+ return e?.domain_country && (r.id = e?.domain_country.id ?? r.id, r.currency = e?.domain_country.currency ?? r.currency, r.currency_decimal_digits = e?.domain_country.currency_decimal_digits ?? r.currency_decimal_digits, r.decimal_symbol = e?.domain_country.decimal_symbol ?? r.decimal_symbol, r.thousands_symbol = e?.domain_country?.thousands_symbol ?? r.thousands_symbol), /* @__PURE__ */ X(H, {
41
+ hostThemeOptions: Q,
42
+ fnComponentsOverrides: V,
43
+ isMicroFrontEnd: !0,
44
+ children: [/* @__PURE__ */ o(D, {}), /* @__PURE__ */ o(S, {
45
+ ...r,
46
+ isMicroFrontEnd: !1,
47
+ children: /* @__PURE__ */ o(O, {
48
+ isMicroFrontEnd: !1,
49
+ dateFormatter: {
50
+ formatDate: K
51
+ },
52
+ currencyFormatter: {
53
+ code: r.currency,
54
+ decimalDigits: r.currency_decimal_digits
55
+ },
56
+ children: a
57
+ })
58
+ })]
59
+ });
60
+ }
61
+ const p = G({
62
+ window
63
+ });
64
+ function hr(m) {
65
+ const {
66
+ children: a,
67
+ user: d,
68
+ pwd: l,
69
+ host_api_local: s,
70
+ host_api_remote: c,
71
+ host_static_assets: u,
72
+ environment_assets: e,
73
+ moduleId: r,
74
+ skeletonFlags: y,
75
+ moduleNameField: v,
76
+ privileges: g,
77
+ componentsDictionary: F,
78
+ onLoad: P,
79
+ activeAreasNetwork: b = !1
80
+ } = m, t = _(() => new J(), []), w = f((i, n) => {
81
+ t.on(i, n);
82
+ }, [t]), A = f((i, n) => {
83
+ if (n === null) {
84
+ t.removeListener(i);
85
+ return;
86
+ }
87
+ t.removeListener(i, n);
88
+ }, [t]), E = f((i, n) => {
89
+ t.emit(i, n);
90
+ }, [t]), M = () => {
91
+ h.configure({
92
+ showSpinner: !0
93
+ }), h.start();
94
+ }, k = () => {
95
+ h.done();
96
+ }, L = _(() => ({
97
+ host: "",
98
+ isLocalhost: !0,
99
+ domain_token: "lab1",
100
+ host_api_local: s,
101
+ host_api_remote: c,
102
+ host_static_assets: u,
103
+ environment_assets: e
104
+ }), []), T = _(() => ({
105
+ history: p,
106
+ toast: N,
107
+ startProgress: M,
108
+ stopProgress: k,
109
+ events_add_listener: w,
110
+ events_remove_listener: A,
111
+ events_emit: E
112
+ }), []);
113
+ return /* @__PURE__ */ o(U, {
114
+ ...L,
115
+ children: /* @__PURE__ */ o(z, {
116
+ ...T,
117
+ children: /* @__PURE__ */ o(R, {
118
+ axiosOperation: q,
119
+ children: /* @__PURE__ */ o(C, {
120
+ history: p,
121
+ children: /* @__PURE__ */ o(B, {
122
+ isMicroFrontEnd: !1,
123
+ getLocaleFromNetwork: I,
124
+ children: /* @__PURE__ */ o(j, {
125
+ children: /* @__PURE__ */ o($, {
126
+ user: d,
127
+ pwd: l,
128
+ children: /* @__PURE__ */ o(Y, {
129
+ moduleId: r,
130
+ privileges: g,
131
+ skeletonFlags: y,
132
+ componentsDictionary: F,
133
+ moduleNameField: v,
134
+ children: /* @__PURE__ */ o(Z, {
135
+ onLoad: P,
136
+ loadAreasFromNetwork: b,
137
+ children: a
138
+ })
139
+ })
140
+ })
141
+ })
142
+ })
143
+ })
144
+ })
145
+ })
146
+ });
147
+ }
148
+ export {
149
+ hr as M
150
+ };
@@ -1,4 +1,4 @@
1
- import "./MFIsolationApp/index.b89e6800.js";
1
+ import "./MFIsolationApp/index.fb96bc5d.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.793884be.js";
3
+ import "../contexts/AuthContext/index.6f966215.js";
4
+ import "../layouts/ModuleLayout/index.c673a65f.js";
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../layouts/MasterDetailLayout/index.3da0ffda.js";
2
+ import { M as e } from "../../layouts/MasterDetailLayout/index.793884be.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.a76397df.js";
2
+ import { M as t } from "../../layouts/ModuleLayout/index.c673a65f.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.b89e6800.js";
2
- import { M as D } from "./components/MFHostApp/index.1700d13a.js";
1
+ import { M as f } from "./components/MFIsolationApp/index.fb96bc5d.js";
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.a76397df.js";
6
- import { a as H, d as I, g as P } from "./layouts/MasterDetailLayout/index.3da0ffda.js";
7
- import { N as j, d as k, g as q } from "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
8
- import { u as z } from "./hooks/useMasterDetail/index.1b024fd5.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";
9
9
  import { u as G } from "./hooks/useAuth/index.cb6a3420.js";
10
- import { u as K } from "./hooks/useModule/index.6ff7d08a.js";
10
+ import { u as K } from "./hooks/useModule/index.97184469.js";
11
11
  import "react";
12
12
  import "react-router-dom";
13
13
  import "react-toastify";
@@ -0,0 +1,106 @@
1
+ import { createContext as $, useState as y, useRef as k, useMemo as p, useCallback as g } from "react";
2
+ import { voidFunction as w, useEnvironment as P } from "@m4l/core";
3
+ import { SplitLayout as z } from "@m4l/components";
4
+ import { a as I, g as L } from "../ModuleLayout/index.c673a65f.js";
5
+ import { jsx as c } from "react/jsx-runtime";
6
+ import { useResponsiveDesktop as F } from "@m4l/graphics";
7
+ const N = {
8
+ masterSelection: void 0,
9
+ onChangeMasterSelection: w
10
+ }, x = $(N);
11
+ function R(o) {
12
+ const {
13
+ children: e
14
+ } = o, [n, t] = y(void 0);
15
+ return /* @__PURE__ */ c(x.Provider, {
16
+ value: {
17
+ masterSelection: n,
18
+ onChangeMasterSelection: t
19
+ },
20
+ children: e
21
+ });
22
+ }
23
+ function V(o, e = [], n, t) {
24
+ let i = t !== void 0 && t ? [...o] : [n];
25
+ return i = e.concat(i), i;
26
+ }
27
+ function H(o) {
28
+ const {
29
+ moduleId: e,
30
+ masterComponent: n,
31
+ detailComponent: t,
32
+ moduleActions: i
33
+ } = o, {
34
+ host_static_assets: r,
35
+ environment_assets: s
36
+ } = P(), [C, h] = y("vertical"), d = F(), M = k(null), S = p(() => [{
37
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
38
+ onClick: () => u("vertical"),
39
+ disabled: !0,
40
+ visibility: "main",
41
+ dictionaryField: "master_detail_layout.split_vertical",
42
+ tag: "vertical",
43
+ className: "splitactions"
44
+ }, {
45
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
46
+ onClick: () => u("horizontal"),
47
+ disabled: !1,
48
+ visibility: "main",
49
+ dictionaryField: "master_detail_layout.split_horizontal",
50
+ tag: "horizontal",
51
+ className: "splitactions"
52
+ }, {
53
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
54
+ onClick: () => u("none"),
55
+ disabled: !1,
56
+ visibility: "main",
57
+ dictionaryField: "master_detail_layout.no_split",
58
+ tag: "none",
59
+ className: "splitactions"
60
+ }], []), [v, b] = y(S), u = g((m) => {
61
+ b((A) => {
62
+ const a = [...A];
63
+ for (let l = 0; l < a.length; l++)
64
+ a[l].disabled = !1, a[l].tag === m && (a[l].disabled = !0);
65
+ return a;
66
+ }), h(m);
67
+ }, []), _ = g(() => {
68
+ }, [t]), f = p(() => ({
69
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
70
+ onClick: _,
71
+ disabled: !1,
72
+ visibility: "allways",
73
+ dictionaryField: "master_detail_layout.view_detail",
74
+ tag: "none",
75
+ className: ""
76
+ }), [s, _]), D = p(() => V(v, i, f, d), [v, i, d, f]);
77
+ return /* @__PURE__ */ c(R, {
78
+ children: /* @__PURE__ */ c(I, {
79
+ ref: M,
80
+ moduleId: e,
81
+ moduleActions: D,
82
+ children: /* @__PURE__ */ c(z, {
83
+ splitPosition: d ? C : "none",
84
+ firstPart: n,
85
+ secondPart: t
86
+ })
87
+ })
88
+ });
89
+ }
90
+ function J() {
91
+ return ["master_detail_layout"].concat(L());
92
+ }
93
+ const K = {
94
+ master_detail_layout: {
95
+ split_vertical: "Split vertically",
96
+ split_horizontal: "Split horizontally",
97
+ no_split: "No split",
98
+ view_detail: "View detail"
99
+ }
100
+ };
101
+ export {
102
+ x as M,
103
+ H as a,
104
+ K as d,
105
+ J as g
106
+ };
@@ -5,9 +5,8 @@ export interface ModuleLayoutContextStateProps {
5
5
  }
6
6
  export interface ModuleLayoutProviderProps extends Omit<ModuleLayoutContextStateProps, 'init'> {
7
7
  children: ReactNode;
8
- moduleActions: ModuleAction[];
8
+ moduleActions?: ModuleAction[];
9
9
  }
10
10
  export interface ModuleLayoutContextProps extends ModuleLayoutContextStateProps {
11
- moduleActions: ModuleAction[];
12
11
  setDynamicActions: (dynamicActions: ModuleAction[]) => void;
13
12
  }
@@ -1,8 +1,8 @@
1
- import { useModal as y, useDynamicMFParameters as x, ModalProvider as v, getModalDialogComponentsDictionary as g } from "@m4l/components";
2
- import { forwardRef as a, useRef as m, useImperativeHandle as p, createContext as h, useState as s, useMemo as I, useEffect as A } from "react";
1
+ import { useModal as y, useWindowToolsMF as x, ModalProvider as v, getModalDialogComponentsDictionary as g } from "@m4l/components";
2
+ import { forwardRef as a, useRef as p, useImperativeHandle as m, createContext as h, useState as s, useMemo as I, useEffect as C } from "react";
3
3
  import { styled as f } from "@mui/material/styles";
4
4
  import { jsx as t } from "react/jsx-runtime";
5
- const C = f("div")(() => ({
5
+ const A = f("div")(() => ({
6
6
  display: "flex",
7
7
  flexDirection: "column",
8
8
  position: "absolute",
@@ -21,16 +21,16 @@ const C = f("div")(() => ({
21
21
  justifyContent: "center",
22
22
  flexGrow: "1",
23
23
  overflow: "hidden"
24
- })), M = a((o, l) => {
24
+ })), M = a((o, r) => {
25
25
  const {
26
26
  children: e
27
27
  } = o, {
28
- openModal: r
29
- } = y(), n = m(null);
30
- return p(l, () => ({
31
- openModal: r,
28
+ openModal: l
29
+ } = y(), n = p(null);
30
+ return m(r, () => ({
31
+ openModal: l,
32
32
  current: n.current
33
- })), /* @__PURE__ */ t(C, {
33
+ })), /* @__PURE__ */ t(A, {
34
34
  id: "WrapperInnerModule",
35
35
  className: "m4l_module_layout",
36
36
  ref: n,
@@ -41,43 +41,42 @@ const C = f("div")(() => ({
41
41
  });
42
42
  });
43
43
  M.displayName = "InnerModule";
44
- const P = h(null);
45
- function w(o) {
44
+ const w = h(null);
45
+ function L(o) {
46
46
  const {
47
- children: l,
47
+ children: r,
48
48
  moduleActions: e,
49
- moduleId: r
49
+ moduleId: l
50
50
  } = o, [n] = s(() => ({
51
- moduleId: r,
51
+ moduleId: l,
52
52
  dictionary: void 0
53
53
  })), {
54
- setModuleActions: d
55
- } = x(), [i, c] = s([]), u = I(() => e.concat(i), [e, i]);
56
- return A(() => {
57
- console.log("useEffect ModuleProvider", u), d(u);
58
- }, [u]), /* @__PURE__ */ t(P.Provider, {
54
+ setActions: d
55
+ } = x(), [i, u] = s([]), c = I(() => (e || []).concat(i), [e, i]);
56
+ return C(() => {
57
+ d(c);
58
+ }, [c]), /* @__PURE__ */ t(w.Provider, {
59
59
  value: {
60
- moduleActions: u,
61
- setDynamicActions: c,
60
+ setDynamicActions: u,
62
61
  moduleId: n.moduleId
63
62
  },
64
- children: l
63
+ children: r
65
64
  });
66
65
  }
67
- const L = a((o, l) => {
66
+ const R = a((o, r) => {
68
67
  const {
69
68
  moduleId: e,
70
- moduleActions: r,
69
+ moduleActions: l,
71
70
  children: n
72
- } = o, d = m(null), i = (c) => {
73
- d.current?.openModal(c);
71
+ } = o, d = p(null), i = (u) => {
72
+ d.current?.openModal(u);
74
73
  };
75
- return p(l, () => ({
74
+ return m(r, () => ({
76
75
  openModal: i,
77
76
  current: d.current
78
- })), /* @__PURE__ */ t(w, {
77
+ })), /* @__PURE__ */ t(L, {
79
78
  moduleId: e,
80
- moduleActions: r,
79
+ moduleActions: l,
81
80
  children: /* @__PURE__ */ t(v, {
82
81
  children: /* @__PURE__ */ t(M, {
83
82
  ref: d,
@@ -86,16 +85,16 @@ const L = a((o, l) => {
86
85
  })
87
86
  });
88
87
  });
89
- L.displayName = "ModuleLayout";
90
- function j() {
88
+ R.displayName = "ModuleLayout";
89
+ function b() {
91
90
  return ["module_layout"].concat(g());
92
91
  }
93
- const E = {
92
+ const j = {
94
93
  module_layout: {}
95
94
  };
96
95
  export {
97
- P as M,
98
- L as a,
99
- E as d,
100
- j as g
96
+ w as M,
97
+ R as a,
98
+ j as d,
99
+ b as g
101
100
  };
@@ -10,6 +10,6 @@ export declare type ModuleLayoutRef = {
10
10
  };
11
11
  export interface ModuleLayoutProps {
12
12
  moduleId: string;
13
- moduleActions: ModuleAction[];
13
+ moduleActions?: ModuleAction[];
14
14
  children: ReactNode;
15
15
  }
@@ -1,12 +1,12 @@
1
1
  import { useResponsive as h, useLocales as N } from "@m4l/graphics";
2
2
  import { Image as p, Typography as u, LanguagePopover as W, HelmetPage as k } from "@m4l/components";
3
- import { useModuleDictionary as m, useBase as g, useEnvironment as S, BaseProvider as b, FlagsProvider as I, ModuleDictionaryProvider as F, ModuleSkeletonProvider as A } from "@m4l/core";
3
+ import { useModuleDictionary as m, useBase as g, useEnvironment as b, BaseProvider as I, FlagsProvider as S, ModuleDictionaryProvider as F, ModuleSkeletonProvider as A } from "@m4l/core";
4
4
  import { styled as t } from "@mui/material/styles";
5
5
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
6
6
  const C = t("div")(({
7
7
  theme: o
8
8
  }) => ({
9
- boxShadow: o.customShadows.card,
9
+ boxShadow: o.shadows[1],
10
10
  borderRadius: o.spacing(2),
11
11
  width: "100%",
12
12
  maxWidth: "464px",
@@ -160,15 +160,15 @@ const C = t("div")(({
160
160
  } = o, {
161
161
  host_static_assets: s,
162
162
  environment_assets: d
163
- } = S(), _ = N().currentLocale?.localeString, w = L || `${s}/${d}/frontend/commons/assets/icons/logotipo_m4l.svg`, M = x || `${s}/${d}/frontend/commons/assets/icons/isotipo_m4l.svg`, U = v || `${s}/${d}/frontend/domain/host/commons/assets/img/illustration_noauth.png`, c = f;
164
- return c.findIndex((D) => D === "dictionary_loaded") < 0 && c.push("dictionary_loaded"), /* @__PURE__ */ e(b, {
163
+ } = b(), _ = N().currentLocale?.localeString, w = L || `${s}/${d}/frontend/commons/assets/icons/logotipo_m4l.svg`, M = x || `${s}/${d}/frontend/commons/assets/icons/isotipo_m4l.svg`, U = v || `${s}/${d}/frontend/domain/host/commons/assets/img/illustration_noauth.png`, c = f;
164
+ return c.findIndex((D) => D === "dictionary_loaded") < 0 && c.push("dictionary_loaded"), /* @__PURE__ */ e(I, {
165
165
  value: {
166
166
  subtitle: y,
167
167
  companyLogoSmallUrl: M,
168
168
  companyLogoNormalUrl: w,
169
169
  moduleIlustrationUrl: U
170
170
  },
171
- children: /* @__PURE__ */ e(I, {
171
+ children: /* @__PURE__ */ e(S, {
172
172
  children: /* @__PURE__ */ e(F, {
173
173
  isAuth: !1,
174
174
  moduleId: n,
@@ -0,0 +1,8 @@
1
+ import "./ModuleLayout/index.c673a65f.js";
2
+ import "@m4l/components";
3
+ import "react";
4
+ import "@m4l/core";
5
+ import "./MasterDetailLayout/index.793884be.js";
6
+ import "@m4l/graphics";
7
+ import "react/jsx-runtime";
8
+ import "./NoAuthModuleLayout/index.5d946846.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.30",
3
+ "version": "0.1.33",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",
@@ -1,69 +0,0 @@
1
- import { unstable_HistoryRouter as F } from "react-router-dom";
2
- import { EnvironmentProvider as p, HostToolsProvider as v, NetworkProvider as P, DomainCountryProvider as M } from "@m4l/core";
3
- import { LocalesProvider as f, HostThemeProvider as b, FormatterProvider as E } from "@m4l/graphics";
4
- import { B as H } from "../BaseModule/index.6309486a.js";
5
- import { DynamicMFParmsProvider as _ } from "@m4l/components";
6
- import { jsx as r } from "react/jsx-runtime";
7
- function L(t) {
8
- const {
9
- children: n,
10
- currentLocale: m,
11
- hostTheme: d,
12
- environment: s,
13
- hostTools: e,
14
- axiosOperation: c,
15
- formatters: o,
16
- dynamicMFParameters: i,
17
- moduleId: l,
18
- moduleNameField: a,
19
- skeletonFlags: u,
20
- privileges: h,
21
- componentsDictionary: y
22
- } = t;
23
- return /* @__PURE__ */ r(p, {
24
- ...s,
25
- children: /* @__PURE__ */ r(v, {
26
- ...e,
27
- children: /* @__PURE__ */ r(P, {
28
- axiosOperation: c,
29
- children: /* @__PURE__ */ r(f, {
30
- isMicroFrontEnd: !0,
31
- localeHost: m,
32
- children: /* @__PURE__ */ r(b, {
33
- isMicroFrontEnd: !0,
34
- ...d,
35
- children: /* @__PURE__ */ r(F, {
36
- history: e.history,
37
- children: /* @__PURE__ */ r(M, {
38
- isMicroFrontEnd: !0,
39
- id: i?.id || 1,
40
- currency: o.currencyFormatter.code,
41
- currency_decimal_digits: o.currencyFormatter.decimalDigits,
42
- decimal_symbol: o.numberFormatter.decimalSymbol,
43
- thousands_symbol: o.numberFormatter.thousandsSymbol,
44
- children: /* @__PURE__ */ r(H, {
45
- moduleId: l,
46
- moduleNameField: a,
47
- componentsDictionary: y,
48
- skeletonFlags: u,
49
- privileges: h,
50
- children: /* @__PURE__ */ r(E, {
51
- isMicroFrontEnd: !0,
52
- ...o,
53
- children: /* @__PURE__ */ r(_, {
54
- ...i,
55
- children: n
56
- })
57
- })
58
- })
59
- })
60
- })
61
- })
62
- })
63
- })
64
- })
65
- });
66
- }
67
- export {
68
- L as M
69
- };
@@ -1,152 +0,0 @@
1
- import { useEffect as y, useMemo as f, useCallback as _ } from "react";
2
- import { unstable_HistoryRouter as C } from "react-router-dom";
3
- import { ToastContainer as D, toast as H } from "react-toastify";
4
- import { HostThemeProvider as I, FormatterProvider as N, LocalesProvider as O, getLocaleFromNetwork as B } from "@m4l/graphics";
5
- import { A as j } from "../../contexts/AuthContext/index.6f966215.js";
6
- import { DomainCountryProvider as S, EnvironmentProvider as U, HostToolsProvider as z, NetworkProvider as R, axiosOperation as q } from "@m4l/core";
7
- import { createBrowserHistory as G } from "history";
8
- import J from "eventemitter3";
9
- import { format as K } from "date-fns";
10
- import { defaultThemeOptions as Q, fnComponentsOverrides as V } from "@m4l/styles";
11
- import { u as W } from "../../hooks/useAuth/index.cb6a3420.js";
12
- import { jsx as r, jsxs as X } from "react/jsx-runtime";
13
- import p from "nprogress";
14
- import { B as Y } from "../BaseModule/index.6309486a.js";
15
- import { AreasProvider as Z } from "@m4l/components";
16
- function $(m) {
17
- const {
18
- children: a,
19
- user: d,
20
- pwd: l
21
- } = m, {
22
- isAuthenticated: s,
23
- isInitialized: c,
24
- login: u,
25
- user: e
26
- } = W();
27
- if (y(() => {
28
- c && s === !1 && (console.log("useEffect MFAuthApp Login"), u(d, l, !1));
29
- }, [c, s]), !s)
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__ */ X(I, {
41
- hostThemeOptions: Q,
42
- fnComponentsOverrides: V,
43
- isMicroFrontEnd: !0,
44
- children: [/* @__PURE__ */ r(D, {}), /* @__PURE__ */ r(S, {
45
- ...o,
46
- isMicroFrontEnd: !1,
47
- children: /* @__PURE__ */ r(N, {
48
- isMicroFrontEnd: !1,
49
- dateFormatter: {
50
- formatDate: K
51
- },
52
- currencyFormatter: {
53
- code: o.currency,
54
- decimalDigits: o.currency_decimal_digits
55
- },
56
- children: a
57
- })
58
- })]
59
- });
60
- }
61
- const h = G({
62
- window
63
- });
64
- function ho(m) {
65
- const {
66
- children: a,
67
- user: d,
68
- pwd: l,
69
- host_api_local: s,
70
- host_api_remote: c,
71
- host_static_assets: u,
72
- environment_assets: e,
73
- moduleId: o,
74
- skeletonFlags: v,
75
- moduleNameField: g,
76
- privileges: F,
77
- componentsDictionary: P,
78
- onLoad: A,
79
- activeAreasNetwork: b = !1
80
- } = m, t = f(() => new J(), []), E = _((i, n) => {
81
- t.on(i, n);
82
- }, [t]), w = _((i, n) => {
83
- if (n === null) {
84
- t.removeListener(i);
85
- return;
86
- }
87
- t.removeListener(i, n);
88
- }, [t]), M = _((i, n) => {
89
- t.emit(i, n);
90
- }, [t]), L = () => {
91
- p.configure({
92
- showSpinner: !0
93
- }), p.start();
94
- }, k = () => {
95
- p.done();
96
- }, T = f(() => ({
97
- host: "",
98
- isLocalhost: !0,
99
- domain_token: "lab1",
100
- host_api_local: s,
101
- host_api_remote: c,
102
- host_static_assets: u,
103
- environment_assets: e
104
- }), []), x = f(() => ({
105
- history: h,
106
- toast: H,
107
- startProgress: L,
108
- stopProgress: k,
109
- events_add_listener: E,
110
- events_remove_listener: w,
111
- events_emit: M
112
- }), []);
113
- return y(() => {
114
- console.log("useEffect IsolationApp");
115
- }, []), /* @__PURE__ */ r(U, {
116
- ...T,
117
- children: /* @__PURE__ */ r(z, {
118
- ...x,
119
- children: /* @__PURE__ */ r(R, {
120
- axiosOperation: q,
121
- children: /* @__PURE__ */ r(C, {
122
- history: h,
123
- children: /* @__PURE__ */ r(O, {
124
- isMicroFrontEnd: !1,
125
- getLocaleFromNetwork: B,
126
- children: /* @__PURE__ */ r(j, {
127
- children: /* @__PURE__ */ r($, {
128
- user: d,
129
- pwd: l,
130
- children: /* @__PURE__ */ r(Y, {
131
- moduleId: o,
132
- privileges: F,
133
- skeletonFlags: v,
134
- componentsDictionary: P,
135
- moduleNameField: g,
136
- children: /* @__PURE__ */ r(Z, {
137
- onLoad: A,
138
- activeAreasNetwork: b,
139
- children: a
140
- })
141
- })
142
- })
143
- })
144
- })
145
- })
146
- })
147
- })
148
- });
149
- }
150
- export {
151
- ho as M
152
- };
@@ -1,4 +0,0 @@
1
- import "react";
2
- import "../layouts/MasterDetailLayout/index.3da0ffda.js";
3
- import "../contexts/AuthContext/index.6f966215.js";
4
- import "../layouts/ModuleLayout/index.a76397df.js";
@@ -1,104 +0,0 @@
1
- import { createContext as D, useState as p, useRef as A, useCallback as $, useMemo as g } from "react";
2
- import { voidFunction as k, useEnvironment as w } from "@m4l/core";
3
- import { SplitLayout as P } from "@m4l/components";
4
- import { a as z, g as I } from "../ModuleLayout/index.a76397df.js";
5
- import { jsx as c } from "react/jsx-runtime";
6
- import { useResponsiveDesktop as L } from "@m4l/graphics";
7
- const F = {
8
- masterSelection: void 0,
9
- onChangeMasterSelection: k
10
- }, N = D(F);
11
- function x(o) {
12
- const {
13
- children: e
14
- } = o, [s, t] = p(void 0);
15
- return /* @__PURE__ */ c(N.Provider, {
16
- value: {
17
- masterSelection: s,
18
- onChangeMasterSelection: t
19
- },
20
- children: e
21
- });
22
- }
23
- function R(o, e, s, t) {
24
- let i = t !== void 0 && t ? [...o] : [s];
25
- return i = e.concat(i), i;
26
- }
27
- function G(o) {
28
- const {
29
- moduleId: e,
30
- masterComponent: s,
31
- detailComponent: t,
32
- moduleActions: i
33
- } = o, {
34
- host_static_assets: r,
35
- environment_assets: n
36
- } = w(), [C, h] = p("vertical"), d = L(), M = A(null), u = (m) => {
37
- const a = [...y];
38
- for (let l = 0; l < a.length; l++)
39
- a[l].disabled = !1, a[l].tag === m && (a[l].disabled = !0);
40
- S(a), h(m);
41
- }, y = [{
42
- urlIcon: `${r}/${n}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
43
- onClick: () => u("vertical"),
44
- disabled: !0,
45
- visibility: "main",
46
- dictionaryField: "master_detail_layout.split_vertical",
47
- tag: "vertical",
48
- className: "splitactions"
49
- }, {
50
- urlIcon: `${r}/${n}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
51
- onClick: () => u("horizontal"),
52
- disabled: !1,
53
- visibility: "main",
54
- dictionaryField: "master_detail_layout.split_horizontal",
55
- tag: "horizontal",
56
- className: "splitactions"
57
- }, {
58
- urlIcon: `${r}/${n}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
59
- onClick: () => u("none"),
60
- disabled: !1,
61
- visibility: "main",
62
- dictionaryField: "master_detail_layout.no_split",
63
- tag: "none",
64
- className: "splitactions"
65
- }], v = $(() => {
66
- }, [t]), _ = g(() => ({
67
- urlIcon: `${r}/${n}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
68
- onClick: v,
69
- disabled: !1,
70
- visibility: "allways",
71
- dictionaryField: "master_detail_layout.view_detail",
72
- tag: "none",
73
- className: ""
74
- }), [n, v]), [f, S] = p(y), b = g(() => R(f, i, _, d), [f, i, d, _]);
75
- return /* @__PURE__ */ c(x, {
76
- children: /* @__PURE__ */ c(z, {
77
- ref: M,
78
- moduleId: e,
79
- moduleActions: b,
80
- children: /* @__PURE__ */ c(P, {
81
- splitPosition: d ? C : "none",
82
- firstPart: s,
83
- secondPart: t
84
- })
85
- })
86
- });
87
- }
88
- function H() {
89
- return ["master_detail_layout"].concat(I());
90
- }
91
- const J = {
92
- master_detail_layout: {
93
- split_vertical: "Split vertically",
94
- split_horizontal: "Split horizontally",
95
- no_split: "No split",
96
- view_detail: "View detail"
97
- }
98
- };
99
- export {
100
- N as M,
101
- G as a,
102
- J as d,
103
- H as g
104
- };
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperInnerModule: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
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>, {}>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperMain: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperAppBarForm: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperAppBar: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperFormScroll: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
- export declare const WrapperForm: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperNameDescription: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperLogoLeyend: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +0,0 @@
1
- import "./ModuleLayout/index.a76397df.js";
2
- import "@m4l/components";
3
- import "react";
4
- import "@m4l/core";
5
- import "./MasterDetailLayout/index.3da0ffda.js";
6
- import "@m4l/graphics";
7
- import "react/jsx-runtime";
8
- import "./NoAuthModuleLayout/index.5d1098ef.js";