@m4l/layouts 0.1.28 → 0.1.31

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.
@@ -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,152 @@
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 N } from "react-toastify";
4
+ import { HostThemeProvider as H, FormatterProvider as I, 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: n,
23
+ isInitialized: c,
24
+ login: u,
25
+ user: e
26
+ } = W();
27
+ if (y(() => {
28
+ c && n === !1 && (console.log("useEffect MFAuthApp Login"), 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__ */ X(H, {
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(I, {
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: n,
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: A,
78
+ onLoad: P,
79
+ activeAreasNetwork: b = !1
80
+ } = m, t = f(() => new J(), []), w = _((i, s) => {
81
+ t.on(i, s);
82
+ }, [t]), E = _((i, s) => {
83
+ if (s === null) {
84
+ t.removeListener(i);
85
+ return;
86
+ }
87
+ t.removeListener(i, s);
88
+ }, [t]), M = _((i, s) => {
89
+ t.emit(i, s);
90
+ }, [t]), k = () => {
91
+ p.configure({
92
+ showSpinner: !0
93
+ }), p.start();
94
+ }, L = () => {
95
+ p.done();
96
+ }, T = f(() => ({
97
+ host: "",
98
+ isLocalhost: !0,
99
+ domain_token: "lab1",
100
+ host_api_local: n,
101
+ host_api_remote: c,
102
+ host_static_assets: u,
103
+ environment_assets: e
104
+ }), []), x = f(() => ({
105
+ history: h,
106
+ toast: N,
107
+ startProgress: k,
108
+ stopProgress: L,
109
+ events_add_listener: w,
110
+ events_remove_listener: E,
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: A,
135
+ moduleNameField: g,
136
+ children: /* @__PURE__ */ r(Z, {
137
+ onLoad: P,
138
+ loadAreasFromNetwork: b,
139
+ children: a
140
+ })
141
+ })
142
+ })
143
+ })
144
+ })
145
+ })
146
+ })
147
+ })
148
+ });
149
+ }
150
+ export {
151
+ ho as M
152
+ };
@@ -1,4 +1,4 @@
1
- import "./MFIsolationApp/index.b21e5671.js";
1
+ import "./MFIsolationApp/index.c250368a.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.4872d95e.js";
3
+ import "../contexts/AuthContext/index.6f966215.js";
4
+ import "../layouts/ModuleLayout/index.de97329e.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.4872d95e.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.de97329e.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 y } from "./components/MFIsolationApp/index.b21e5671.js";
2
- import { M as x } from "./components/MFHostApp/index.1700d13a.js";
3
- import { B as A } from "./components/BaseModule/index.6309486a.js";
4
- import { a as c, A as g } from "./contexts/AuthContext/index.6f966215.js";
5
- import { a as C, d as N, g as B } from "./layouts/ModuleLayout/index.a76397df.js";
6
- import { a as v, d as H, g as I } from "./layouts/MasterDetailLayout/index.3da0ffda.js";
7
- import { N as b, d as j, g as k } from "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
8
- import { u as w } from "./hooks/useMasterDetail/index.1b024fd5.js";
9
- import { u as E } from "./hooks/useAuth/index.cb6a3420.js";
10
- import { u as J } from "./hooks/useModule/index.6ff7d08a.js";
1
+ import { M as f } from "./components/MFIsolationApp/index.c250368a.js";
2
+ import { M as D } from "./components/MFHostApp/index.420c2626.js";
3
+ import { B as L } from "./components/BaseModule/index.6309486a.js";
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.de97329e.js";
6
+ import { a as H, d as I, g as P } from "./layouts/MasterDetailLayout/index.4872d95e.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.9e7fc609.js";
9
+ import { u as G } from "./hooks/useAuth/index.cb6a3420.js";
10
+ import { u as K } from "./hooks/useModule/index.0533b6b0.js";
11
11
  import "react";
12
12
  import "react-router-dom";
13
13
  import "react-toastify";
@@ -16,26 +16,27 @@ import "@m4l/core";
16
16
  import "history";
17
17
  import "eventemitter3";
18
18
  import "date-fns";
19
+ import "@m4l/styles";
19
20
  import "react/jsx-runtime";
20
21
  import "nprogress";
21
22
  import "@m4l/components";
22
23
  import "@mui/material/styles";
23
24
  export {
24
- c as AuthContext,
25
- g as AuthProvider,
26
- A as BaseModule,
27
- x as MFHostApp,
28
- y as MFIsolationApp,
29
- v as MasterDetailLayout,
30
- C as ModuleLayout,
31
- b as NoAuthModuleLayout,
32
- H as defaultMasterDetailDictionary,
33
- N as defaultModuleLayoutDictionary,
34
- j as defaultNoAuthModuleLayoutDictionary,
35
- I as getMasterDetailLayoutComponentsDictionary,
36
- B as getModuleLayoutComponentsDictionary,
37
- k as getNoAuthModuleLayoutComponentsDictionary,
38
- E as useAuth,
39
- w as useMasterDetail,
40
- J as useModule
25
+ g as AuthContext,
26
+ h as AuthProvider,
27
+ L as BaseModule,
28
+ D as MFHostApp,
29
+ f as MFIsolationApp,
30
+ H as MasterDetailLayout,
31
+ N as ModuleLayout,
32
+ j as NoAuthModuleLayout,
33
+ I as defaultMasterDetailDictionary,
34
+ B as defaultModuleLayoutDictionary,
35
+ k as defaultNoAuthModuleLayoutDictionary,
36
+ P as getMasterDetailLayoutComponentsDictionary,
37
+ F as getModuleLayoutComponentsDictionary,
38
+ q as getNoAuthModuleLayoutComponentsDictionary,
39
+ G as useAuth,
40
+ z as useMasterDetail,
41
+ K as useModule
41
42
  };
@@ -0,0 +1,107 @@
1
+ import { createContext as $, useState as y, useRef as k, useMemo as p, useCallback as C } from "react";
2
+ import { voidFunction as I, useEnvironment as P } from "@m4l/core";
3
+ import { SplitLayout as w } from "@m4l/components";
4
+ import { a as z, g as L } from "../ModuleLayout/index.de97329e.js";
5
+ import { jsx as d } from "react/jsx-runtime";
6
+ import { useResponsiveDesktop as F } from "@m4l/graphics";
7
+ const N = {
8
+ masterSelection: void 0,
9
+ onChangeMasterSelection: I
10
+ }, x = $(N);
11
+ function R(o) {
12
+ const {
13
+ children: e
14
+ } = o, [n, t] = y(void 0);
15
+ return /* @__PURE__ */ d(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(), [h, M] = y("vertical"), u = F(), S = k(null), b = p(() => [{
37
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
38
+ onClick: () => m("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: () => m("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: () => m("none"),
55
+ disabled: !1,
56
+ visibility: "main",
57
+ dictionaryField: "master_detail_layout.no_split",
58
+ tag: "none",
59
+ className: "splitactions"
60
+ }], []), [v, D] = y(b), m = C((c) => {
61
+ D((g) => {
62
+ console.log("onChangePostionInternal", c, g);
63
+ const a = [...g];
64
+ for (let l = 0; l < a.length; l++)
65
+ a[l].disabled = !1, a[l].tag === c && (a[l].disabled = !0);
66
+ return a;
67
+ }), M(c);
68
+ }, []), _ = C(() => {
69
+ }, [t]), f = p(() => ({
70
+ urlIcon: `${r}/${s}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
71
+ onClick: _,
72
+ disabled: !1,
73
+ visibility: "allways",
74
+ dictionaryField: "master_detail_layout.view_detail",
75
+ tag: "none",
76
+ className: ""
77
+ }), [s, _]), A = p(() => V(v, i, f, u), [v, i, u, f]);
78
+ return /* @__PURE__ */ d(R, {
79
+ children: /* @__PURE__ */ d(z, {
80
+ ref: S,
81
+ moduleId: e,
82
+ moduleActions: A,
83
+ children: /* @__PURE__ */ d(w, {
84
+ splitPosition: u ? h : "none",
85
+ firstPart: n,
86
+ secondPart: t
87
+ })
88
+ })
89
+ });
90
+ }
91
+ function J() {
92
+ return ["master_detail_layout"].concat(L());
93
+ }
94
+ const K = {
95
+ master_detail_layout: {
96
+ split_vertical: "Split vertically",
97
+ split_horizontal: "Split horizontally",
98
+ no_split: "No split",
99
+ view_detail: "View detail"
100
+ }
101
+ };
102
+ export {
103
+ x as M,
104
+ H as a,
105
+ K as d,
106
+ J as g
107
+ };
@@ -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
  }
@@ -0,0 +1,104 @@
1
+ import { useModal as x, useWindowToolsMF as v, ModalProvider as g, getModalDialogComponentsDictionary as h } from "@m4l/components";
2
+ import { forwardRef as m, useRef as p, useImperativeHandle as f, createContext as I, useState as a, useMemo as A, useEffect as s } from "react";
3
+ import { styled as M } from "@mui/material/styles";
4
+ import { jsx as t } from "react/jsx-runtime";
5
+ const C = 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
+ })), D = 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 = m((o, l) => {
25
+ const {
26
+ children: e
27
+ } = o, {
28
+ openModal: r
29
+ } = x(), n = p(null);
30
+ return f(l, () => ({
31
+ openModal: r,
32
+ current: n.current
33
+ })), /* @__PURE__ */ t(C, {
34
+ id: "WrapperInnerModule",
35
+ className: "m4l_module_layout",
36
+ ref: n,
37
+ children: /* @__PURE__ */ t(D, {
38
+ id: "ModuleContent",
39
+ children: e
40
+ })
41
+ });
42
+ });
43
+ y.displayName = "InnerModule";
44
+ const w = I(null);
45
+ function L(o) {
46
+ const {
47
+ children: l,
48
+ moduleActions: e,
49
+ moduleId: r
50
+ } = o, [n] = a(() => ({
51
+ moduleId: r,
52
+ dictionary: void 0
53
+ })), {
54
+ setActions: d
55
+ } = v(), [i, u] = a([]), c = A(() => (console.log("useMemo finalModuleActions, ", e, i), (e || []).concat(i)), [e, i]);
56
+ return s(() => {
57
+ console.log("useEffect ModuleProvider load", c);
58
+ }, []), s(() => {
59
+ d(c);
60
+ }, [c]), /* @__PURE__ */ t(w.Provider, {
61
+ value: {
62
+ setDynamicActions: u,
63
+ moduleId: n.moduleId
64
+ },
65
+ children: l
66
+ });
67
+ }
68
+ const P = m((o, l) => {
69
+ const {
70
+ moduleId: e,
71
+ moduleActions: r,
72
+ children: n
73
+ } = o, d = p(null), i = (u) => {
74
+ d.current?.openModal(u);
75
+ };
76
+ return f(l, () => ({
77
+ openModal: i,
78
+ current: d.current
79
+ })), s(() => {
80
+ console.log("useEffect ModuleLayout");
81
+ }, []), /* @__PURE__ */ t(L, {
82
+ moduleId: e,
83
+ moduleActions: r,
84
+ children: /* @__PURE__ */ t(g, {
85
+ children: /* @__PURE__ */ t(y, {
86
+ ref: d,
87
+ children: n
88
+ })
89
+ })
90
+ });
91
+ });
92
+ P.displayName = "ModuleLayout";
93
+ function W() {
94
+ return ["module_layout"].concat(h());
95
+ }
96
+ const b = {
97
+ module_layout: {}
98
+ };
99
+ export {
100
+ w as M,
101
+ P as a,
102
+ b as d,
103
+ W as g
104
+ };
@@ -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.de97329e.js";
2
+ import "@m4l/components";
3
+ import "react";
4
+ import "@m4l/core";
5
+ import "./MasterDetailLayout/index.4872d95e.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.28",
3
+ "version": "0.1.31",
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,151 +0,0 @@
1
- import { useEffect as y, useMemo as _, useCallback as f } 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, defaultThemeOptions as N, fnComponentsOverrides as O, FormatterProvider as B, LocalesProvider as j, getLocaleFromNetwork as S } from "@m4l/graphics";
5
- import { A as U } from "../../contexts/AuthContext/index.6f966215.js";
6
- import { DomainCountryProvider as z, EnvironmentProvider as R, HostToolsProvider as q, NetworkProvider as G, axiosOperation as J } from "@m4l/core";
7
- import { createBrowserHistory as K } from "history";
8
- import Q from "eventemitter3";
9
- import { format as V } from "date-fns";
10
- import { u as W } from "../../hooks/useAuth/index.cb6a3420.js";
11
- import { jsx as e, jsxs as X } from "react/jsx-runtime";
12
- import p from "nprogress";
13
- import { B as Y } from "../BaseModule/index.6309486a.js";
14
- import { AreasProvider as Z } from "@m4l/components";
15
- function $(m) {
16
- const {
17
- children: a,
18
- user: d,
19
- pwd: l
20
- } = m, {
21
- isAuthenticated: s,
22
- isInitialized: c,
23
- login: u,
24
- user: r
25
- } = W();
26
- if (y(() => {
27
- c && s === !1 && (console.log("useEffect MFAuthApp Login"), u(d, l, !1));
28
- }, [c, s]), !s)
29
- return /* @__PURE__ */ e("div", {
30
- children: "Pendiente x atenticar"
31
- });
32
- const o = {
33
- id: 1,
34
- currency: "USD",
35
- currency_decimal_digits: 2,
36
- decimal_symbol: ".",
37
- thousands_symbol: ","
38
- };
39
- return r?.domain_country && (o.id = r?.domain_country.id ?? o.id, o.currency = r?.domain_country.currency ?? o.currency, o.currency_decimal_digits = r?.domain_country.currency_decimal_digits ?? o.currency_decimal_digits, o.decimal_symbol = r?.domain_country.decimal_symbol ?? o.decimal_symbol, o.thousands_symbol = r?.domain_country?.thousands_symbol ?? o.thousands_symbol), /* @__PURE__ */ X(I, {
40
- hostThemeOptions: N,
41
- fnComponentsOverrides: O,
42
- isMicroFrontEnd: !0,
43
- children: [/* @__PURE__ */ e(D, {}), /* @__PURE__ */ e(z, {
44
- ...o,
45
- isMicroFrontEnd: !1,
46
- children: /* @__PURE__ */ e(B, {
47
- isMicroFrontEnd: !1,
48
- dateFormatter: {
49
- formatDate: V
50
- },
51
- currencyFormatter: {
52
- code: o.currency,
53
- decimalDigits: o.currency_decimal_digits
54
- },
55
- children: a
56
- })
57
- })]
58
- });
59
- }
60
- const h = K({
61
- window
62
- });
63
- function po(m) {
64
- const {
65
- children: a,
66
- user: d,
67
- pwd: l,
68
- host_api_local: s,
69
- host_api_remote: c,
70
- host_static_assets: u,
71
- environment_assets: r,
72
- moduleId: o,
73
- skeletonFlags: v,
74
- moduleNameField: g,
75
- privileges: F,
76
- componentsDictionary: P,
77
- onLoad: A,
78
- activeAreasNetwork: b = !1
79
- } = m, t = _(() => new Q(), []), E = f((i, n) => {
80
- t.on(i, n);
81
- }, [t]), w = f((i, n) => {
82
- if (n === null) {
83
- t.removeListener(i);
84
- return;
85
- }
86
- t.removeListener(i, n);
87
- }, [t]), M = f((i, n) => {
88
- t.emit(i, n);
89
- }, [t]), L = () => {
90
- p.configure({
91
- showSpinner: !0
92
- }), p.start();
93
- }, k = () => {
94
- p.done();
95
- }, T = _(() => ({
96
- host: "",
97
- isLocalhost: !0,
98
- domain_token: "lab1",
99
- host_api_local: s,
100
- host_api_remote: c,
101
- host_static_assets: u,
102
- environment_assets: r
103
- }), []), x = _(() => ({
104
- history: h,
105
- toast: H,
106
- startProgress: L,
107
- stopProgress: k,
108
- events_add_listener: E,
109
- events_remove_listener: w,
110
- events_emit: M
111
- }), []);
112
- return y(() => {
113
- console.log("useEffect IsolationApp");
114
- }, []), /* @__PURE__ */ e(R, {
115
- ...T,
116
- children: /* @__PURE__ */ e(q, {
117
- ...x,
118
- children: /* @__PURE__ */ e(G, {
119
- axiosOperation: J,
120
- children: /* @__PURE__ */ e(C, {
121
- history: h,
122
- children: /* @__PURE__ */ e(j, {
123
- isMicroFrontEnd: !1,
124
- getLocaleFromNetwork: S,
125
- children: /* @__PURE__ */ e(U, {
126
- children: /* @__PURE__ */ e($, {
127
- user: d,
128
- pwd: l,
129
- children: /* @__PURE__ */ e(Y, {
130
- moduleId: o,
131
- privileges: F,
132
- skeletonFlags: v,
133
- componentsDictionary: P,
134
- moduleNameField: g,
135
- children: /* @__PURE__ */ e(Z, {
136
- onLoad: A,
137
- activeAreasNetwork: b,
138
- children: a
139
- })
140
- })
141
- })
142
- })
143
- })
144
- })
145
- })
146
- })
147
- });
148
- }
149
- export {
150
- po as M
151
- };
@@ -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,101 +0,0 @@
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";
3
- import { styled as f } from "@mui/material/styles";
4
- import { jsx as t } from "react/jsx-runtime";
5
- const C = f("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
- })), D = f("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
- })), M = a((o, l) => {
25
- const {
26
- children: e
27
- } = o, {
28
- openModal: r
29
- } = y(), n = m(null);
30
- return p(l, () => ({
31
- openModal: r,
32
- current: n.current
33
- })), /* @__PURE__ */ t(C, {
34
- id: "WrapperInnerModule",
35
- className: "m4l_module_layout",
36
- ref: n,
37
- children: /* @__PURE__ */ t(D, {
38
- id: "ModuleContent",
39
- children: e
40
- })
41
- });
42
- });
43
- M.displayName = "InnerModule";
44
- const P = h(null);
45
- function w(o) {
46
- const {
47
- children: l,
48
- moduleActions: e,
49
- moduleId: r
50
- } = o, [n] = s(() => ({
51
- moduleId: r,
52
- dictionary: void 0
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, {
59
- value: {
60
- moduleActions: u,
61
- setDynamicActions: c,
62
- moduleId: n.moduleId
63
- },
64
- children: l
65
- });
66
- }
67
- const L = a((o, l) => {
68
- const {
69
- moduleId: e,
70
- moduleActions: r,
71
- children: n
72
- } = o, d = m(null), i = (c) => {
73
- d.current?.openModal(c);
74
- };
75
- return p(l, () => ({
76
- openModal: i,
77
- current: d.current
78
- })), /* @__PURE__ */ t(w, {
79
- moduleId: e,
80
- moduleActions: r,
81
- children: /* @__PURE__ */ t(v, {
82
- children: /* @__PURE__ */ t(M, {
83
- ref: d,
84
- children: n
85
- })
86
- })
87
- });
88
- });
89
- L.displayName = "ModuleLayout";
90
- function j() {
91
- return ["module_layout"].concat(g());
92
- }
93
- const E = {
94
- module_layout: {}
95
- };
96
- export {
97
- P as M,
98
- L as a,
99
- E as d,
100
- j as g
101
- };
@@ -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";