@m4l/layouts 0.1.37 → 0.1.39

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 (33) hide show
  1. package/components/BaseModule/index.d.ts +2 -1
  2. package/components/MFHostApp/index.d.ts +2 -1
  3. package/components/MFIsolationApp/index.d.ts +2 -1
  4. package/components/MFIsolationApp/index.e36cf308.js +155 -0
  5. package/components/MFIsolationApp/subcomponents/MFAuthApp/index.d.ts +2 -1
  6. package/components/MFIsolationApp/types.d.ts +1 -0
  7. package/components/{index.80a2abab.js → index.aeb3cf83.js} +1 -1
  8. package/contexts/AuthContext/index.d.ts +1 -1
  9. package/hooks/index.a0c767ed.js +4 -0
  10. package/hooks/useMasterDetail/{index.dd9cb927.js → index.927c0c26.js} +1 -1
  11. package/hooks/useModule/{index.97184469.js → index.edcd7b28.js} +1 -1
  12. package/index.js +5 -5
  13. package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.d.ts +1 -1
  14. package/layouts/MasterDetailLayout/index.bca0fce5.js +118 -0
  15. package/layouts/MasterDetailLayout/index.d.ts +2 -1
  16. package/layouts/ModuleLayout/contexts/ModuleContext/index.d.ts +1 -1
  17. package/layouts/ModuleLayout/contexts/ModuleContext/types.d.ts +1 -0
  18. package/layouts/ModuleLayout/index.850f7dcf.js +103 -0
  19. package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +3 -0
  20. package/layouts/ModuleLayout/types.d.ts +1 -0
  21. package/layouts/NoAuthModuleLayout/index.d.ts +2 -1
  22. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.d.ts +2 -1
  23. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.d.ts +2 -0
  24. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/index.d.ts +2 -1
  25. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/styles.d.ts +9 -0
  26. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/index.d.ts +2 -1
  27. package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/styles.d.ts +9 -0
  28. package/layouts/{index.8e0df44b.js → index.07aacf57.js} +2 -2
  29. package/package.json +1 -1
  30. package/components/MFIsolationApp/index.fb96bc5d.js +0 -150
  31. package/hooks/index.43202c4e.js +0 -4
  32. package/layouts/MasterDetailLayout/index.793884be.js +0 -106
  33. package/layouts/ModuleLayout/index.c673a65f.js +0 -100
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { BaseModuleProps } from './types';
2
- export declare function BaseModule(props: BaseModuleProps): JSX.Element;
3
+ export declare function BaseModule(props: BaseModuleProps): import("react").JSX.Element;
3
4
  export default BaseModule;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MFHostAppProps } from './types';
2
- export declare function MFHostApp(props: MFHostAppProps): JSX.Element;
3
+ export declare function MFHostApp(props: MFHostAppProps): import("react").JSX.Element;
3
4
  export default MFHostApp;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MFIsolationAppProps } from './types';
2
- export declare function MFIsolationApp(props: MFIsolationAppProps): JSX.Element;
3
+ export declare function MFIsolationApp(props: MFIsolationAppProps): import("react").JSX.Element;
3
4
  export default MFIsolationApp;
@@ -0,0 +1,155 @@
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 S } from "react-toastify";
4
+ import { HostThemeProvider as H, GlobalStyles as O, FormatterProvider as B, LocalesProvider as I, getLocaleFromNetwork as j } from "@m4l/graphics";
5
+ import { A as U } from "../../contexts/AuthContext/index.6f966215.js";
6
+ import { DomainCountryProvider as z, EnvironmentProvider as G, HostToolsProvider as R, NetworkProvider as q, 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 { defaultThemeOptions as W, fnComponentsOverrides as X } from "@m4l/styles";
11
+ import { u as Y } from "../../hooks/useAuth/index.cb6a3420.js";
12
+ import { jsx as r, jsxs as Z } from "react/jsx-runtime";
13
+ import y from "nprogress";
14
+ import { B as $ } from "../BaseModule/index.6309486a.js";
15
+ import { AreasProvider as oo } from "@m4l/components";
16
+ function ro(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
+ } = Y();
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__ */ Z(H, {
41
+ hostThemeOptions: W,
42
+ fnComponentsOverrides: X,
43
+ isMicroFrontEnd: !0,
44
+ children: [/* @__PURE__ */ r(D, {}), /* @__PURE__ */ r(O, {}), /* @__PURE__ */ r(z, {
45
+ ...o,
46
+ isMicroFrontEnd: !1,
47
+ children: /* @__PURE__ */ r(B, {
48
+ isMicroFrontEnd: !1,
49
+ dateFormatter: {
50
+ formatDate: V
51
+ },
52
+ currencyFormatter: {
53
+ code: o.currency,
54
+ decimalDigits: o.currency_decimal_digits
55
+ },
56
+ children: a
57
+ })
58
+ })]
59
+ });
60
+ }
61
+ const h = K({
62
+ window
63
+ });
64
+ function vo(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: p,
75
+ moduleNameField: v,
76
+ privileges: g,
77
+ componentsDictionary: F,
78
+ onLoad: w,
79
+ activeAreasNetwork: P = !1,
80
+ activeCookiesFromNetwork: b = !1
81
+ } = m, i = _(() => new Q(), []), k = f((t, s) => {
82
+ i.on(t, s);
83
+ }, [i]), A = f((t, s) => {
84
+ if (s === null) {
85
+ i.removeListener(t);
86
+ return;
87
+ }
88
+ i.removeListener(t, s);
89
+ }, [i]), E = f((t, s) => {
90
+ i.emit(t, s);
91
+ }, [i]), M = () => {
92
+ y.configure({
93
+ showSpinner: !0
94
+ }), y.start();
95
+ }, L = () => {
96
+ y.done();
97
+ }, C = _(() => ({
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
+ }), []), N = _(() => ({
106
+ history: h,
107
+ toast: S,
108
+ startProgress: M,
109
+ stopProgress: L,
110
+ events_add_listener: k,
111
+ events_remove_listener: A,
112
+ events_emit: E
113
+ }), []);
114
+ return /* @__PURE__ */ r(G, {
115
+ ...C,
116
+ children: /* @__PURE__ */ r(R, {
117
+ ...N,
118
+ children: /* @__PURE__ */ r(q, {
119
+ axiosOperation: J,
120
+ children: /* @__PURE__ */ r(x, {
121
+ history: h,
122
+ children: /* @__PURE__ */ r(I, {
123
+ isMicroFrontEnd: !1,
124
+ getLocaleFromNetwork: j,
125
+ children: /* @__PURE__ */ r(U, {
126
+ children: /* @__PURE__ */ r(ro, {
127
+ user: d,
128
+ pwd: l,
129
+ children: /* @__PURE__ */ r($, {
130
+ moduleId: o,
131
+ privileges: g,
132
+ skeletonFlags: p,
133
+ componentsDictionary: F,
134
+ moduleNameField: v,
135
+ children: /* @__PURE__ */ r(oo, {
136
+ onLoad: w,
137
+ loadAreasFromNetwork: P,
138
+ loadCookiesFromNetwork: b,
139
+ onSelectLayout: (t) => {
140
+ console.log("onSelectLayout", t);
141
+ },
142
+ children: a
143
+ })
144
+ })
145
+ })
146
+ })
147
+ })
148
+ })
149
+ })
150
+ })
151
+ });
152
+ }
153
+ export {
154
+ vo as M
155
+ };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MFAuthAppProps } from './types';
2
- export declare function MFAuthApp(props: MFAuthAppProps): JSX.Element;
3
+ export declare function MFAuthApp(props: MFAuthAppProps): import("react").JSX.Element;
3
4
  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.e36cf308.js";
2
2
  import "react-router-dom";
3
3
  import "@m4l/core";
4
4
  import "@m4l/graphics";
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { AuthProviderProps, SessionContextType } from './types';
3
3
  declare const AuthContext: import("react").Context<SessionContextType | null>;
4
- declare function AuthProvider(props: AuthProviderProps): JSX.Element;
4
+ declare function AuthProvider(props: AuthProviderProps): import("react").JSX.Element;
5
5
  export { AuthContext, AuthProvider };
@@ -0,0 +1,4 @@
1
+ import "react";
2
+ import "../layouts/MasterDetailLayout/index.bca0fce5.js";
3
+ import "../contexts/AuthContext/index.6f966215.js";
4
+ import "../layouts/ModuleLayout/index.850f7dcf.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.bca0fce5.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.850f7dcf.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.e36cf308.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";
5
+ import { a as N, d as B, g as F } from "./layouts/ModuleLayout/index.850f7dcf.js";
6
+ import { a as H, d as I, g as P } from "./layouts/MasterDetailLayout/index.bca0fce5.js";
7
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.dd9cb927.js";
8
+ import { u as z } from "./hooks/useMasterDetail/index.927c0c26.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.edcd7b28.js";
11
11
  import "react";
12
12
  import "react-router-dom";
13
13
  import "react-toastify";
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { MasterDetailContextProps, MasterDetailProviderProps } from './types';
3
3
  declare const MasterDetailContext: import("react").Context<MasterDetailContextProps>;
4
- declare function MasterDetailProvider(props: MasterDetailProviderProps): JSX.Element;
4
+ declare function MasterDetailProvider(props: MasterDetailProviderProps): import("react").JSX.Element;
5
5
  export { MasterDetailProvider, MasterDetailContext };
@@ -0,0 +1,118 @@
1
+ import { createContext as w, useState as h, useRef as D, useMemo as m, useCallback as g } from "react";
2
+ import { voidFunction as k, useEnvironment as S, useModuleDictionary as $ } from "@m4l/core";
3
+ import { WindowBase as z, SplitLayout as P } from "@m4l/components";
4
+ import { a as A, g as I } from "../ModuleLayout/index.850f7dcf.js";
5
+ import { jsx as c } from "react/jsx-runtime";
6
+ import { useResponsiveDesktop as L } from "@m4l/graphics";
7
+ const N = {
8
+ masterSelection: void 0,
9
+ onChangeMasterSelection: k
10
+ }, x = w(N);
11
+ function R(n) {
12
+ const {
13
+ children: a
14
+ } = n, [s, t] = h(void 0);
15
+ return /* @__PURE__ */ c(x.Provider, {
16
+ value: {
17
+ masterSelection: s,
18
+ onChangeMasterSelection: t
19
+ },
20
+ children: a
21
+ });
22
+ }
23
+ function V(n, a = [], s, t) {
24
+ let o = t !== void 0 && t ? [...n] : [s];
25
+ return o = a.concat(o), o;
26
+ }
27
+ function T(n) {
28
+ const {
29
+ moduleId: a,
30
+ masterComponent: s,
31
+ detailComponent: t,
32
+ moduleActions: o,
33
+ version: M
34
+ } = n, {
35
+ host_static_assets: l,
36
+ environment_assets: i
37
+ } = S(), [r, C] = h("vertical"), d = L(), p = D(null), {
38
+ getLabel: e
39
+ } = $(), v = m(() => [{
40
+ urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
41
+ onClick: () => u("vertical"),
42
+ visibility: "main",
43
+ label: e("master_detail_layout.split_vertical"),
44
+ tag: "vertical",
45
+ className: "splitactions",
46
+ disabled: r === "vertical",
47
+ key: "vertical"
48
+ }, {
49
+ urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
50
+ onClick: () => u("horizontal"),
51
+ visibility: "main",
52
+ label: e("master_detail_layout.split_horizontal"),
53
+ tag: "horizontal",
54
+ className: "splitactions",
55
+ disabled: r === "horizontal",
56
+ key: "horizontal"
57
+ }, {
58
+ urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
59
+ onClick: () => u("none"),
60
+ visibility: "main",
61
+ label: e("master_detail_layout.no_split"),
62
+ tag: "none",
63
+ className: "splitactions",
64
+ disabled: r === "none",
65
+ key: "none"
66
+ }], [e, r]), u = g((f) => {
67
+ C(f);
68
+ }, []), y = g(() => {
69
+ p.current?.openModal({
70
+ initialWidth: 500,
71
+ initialHeigth: 680,
72
+ window: /* @__PURE__ */ c(z, {
73
+ urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
74
+ title: e("master_detail_layout.view_detail"),
75
+ children: typeof t == "function" ? t({}) : t
76
+ })
77
+ });
78
+ }, [t, e]), _ = m(() => ({
79
+ urlIcon: `${l}/${i}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
80
+ onClick: y,
81
+ disabled: !1,
82
+ visibility: "allways",
83
+ label: e("master_detail_layout.view_detail"),
84
+ tag: "none",
85
+ className: "",
86
+ key: "detail"
87
+ }), [i, y]), b = m(() => V(v, o, _, d), [v, o, d, _]);
88
+ return /* @__PURE__ */ c(R, {
89
+ children: /* @__PURE__ */ c(A, {
90
+ ref: p,
91
+ moduleId: a,
92
+ moduleActions: b,
93
+ version: M,
94
+ children: /* @__PURE__ */ c(P, {
95
+ splitPosition: d ? r : "none",
96
+ firstPart: s,
97
+ secondPart: t
98
+ })
99
+ })
100
+ });
101
+ }
102
+ function q() {
103
+ return ["master_detail_layout"].concat(I());
104
+ }
105
+ const G = {
106
+ master_detail_layout: {
107
+ split_vertical: "Split vertically",
108
+ split_horizontal: "Split horizontally",
109
+ no_split: "No split",
110
+ view_detail: "View detail"
111
+ }
112
+ };
113
+ export {
114
+ x as M,
115
+ T as a,
116
+ G as d,
117
+ q as g
118
+ };
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { MasterDetailLayoutProps } from './types';
2
- export declare function MasterDetailLayout(props: MasterDetailLayoutProps): JSX.Element;
3
+ export declare function MasterDetailLayout(props: MasterDetailLayoutProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ModuleLayoutContextProps, ModuleLayoutProviderProps } from './types';
3
3
  declare const ModuleContext: import("react").Context<ModuleLayoutContextProps | null>;
4
- declare function ModuleProvider(props: ModuleLayoutProviderProps): JSX.Element;
4
+ declare function ModuleProvider(props: ModuleLayoutProviderProps): import("react").JSX.Element;
5
5
  export { ModuleProvider, ModuleContext };
@@ -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: e
27
+ } = o, {
28
+ openModal: l
29
+ } = x(), n = m(null);
30
+ return f(r, () => ({
31
+ openModal: l,
32
+ current: n.current
33
+ })), /* @__PURE__ */ t(D, {
34
+ id: "WrapperInnerModule",
35
+ className: "m4l_module_layout",
36
+ ref: n,
37
+ children: /* @__PURE__ */ t(w, {
38
+ id: "ModuleContent",
39
+ children: e
40
+ })
41
+ });
42
+ });
43
+ y.displayName = "InnerModule";
44
+ const L = I(null);
45
+ function R(o) {
46
+ const {
47
+ children: r,
48
+ moduleActions: e,
49
+ moduleId: l,
50
+ version: n
51
+ } = o, [u] = a(() => ({
52
+ moduleId: l,
53
+ dictionary: void 0
54
+ })), {
55
+ setActions: d
56
+ } = v(), [i, s] = a([]), c = C(() => (e || []).concat(i), [e, i]);
57
+ return A(() => {
58
+ d(c, n);
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: e,
70
+ moduleActions: l,
71
+ version: n,
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: e,
81
+ moduleActions: l,
82
+ version: n,
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
+ };
@@ -0,0 +1,3 @@
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>, {}>;
@@ -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,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { NoAuthModuleLayoutProps } from './types';
2
- export declare const NoAuthModuleLayout: (props: NoAuthModuleLayoutProps) => JSX.Element;
3
+ export declare const NoAuthModuleLayout: (props: NoAuthModuleLayoutProps) => import("react").JSX.Element;
@@ -1 +1,2 @@
1
- export declare const InnerModule: () => JSX.Element;
1
+ /// <reference types="react" />
2
+ export declare const InnerModule: () => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const InnerModuleRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1 +1,2 @@
1
- export declare const DesktopContent: () => JSX.Element;
1
+ /// <reference types="react" />
2
+ export declare const DesktopContent: () => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const DesktopContentRoot: 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 DesktopBanner: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ export declare const ContainerLogo: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const CompanyName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const CompanyLeyend: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const FormContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const WrapperFormContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export declare const ContainerModuleName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1 +1,2 @@
1
- export declare const MobileContent: () => JSX.Element;
1
+ /// <reference types="react" />
2
+ export declare const MobileContent: () => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const MobileContentRoot: 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 MobileBanner: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ export declare const ContainerImageLanguage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const ContainerLogo: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const CompanyName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const FormContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const WrapperFormContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export declare const ContainerModuleName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +1,8 @@
1
- import "./ModuleLayout/index.c673a65f.js";
1
+ import "./ModuleLayout/index.850f7dcf.js";
2
2
  import "@m4l/components";
3
3
  import "react";
4
4
  import "@m4l/core";
5
- import "./MasterDetailLayout/index.793884be.js";
5
+ import "./MasterDetailLayout/index.bca0fce5.js";
6
6
  import "@m4l/graphics";
7
7
  import "react/jsx-runtime";
8
8
  import "./NoAuthModuleLayout/index.eabf38c1.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",
@@ -1,150 +0,0 @@
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 +0,0 @@
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,106 +0,0 @@
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
- };
@@ -1,100 +0,0 @@
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
- import { styled as f } from "@mui/material/styles";
4
- import { jsx as t } from "react/jsx-runtime";
5
- const A = 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, r) => {
25
- const {
26
- children: e
27
- } = o, {
28
- openModal: l
29
- } = y(), n = p(null);
30
- return m(r, () => ({
31
- openModal: l,
32
- current: n.current
33
- })), /* @__PURE__ */ t(A, {
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 w = h(null);
45
- function L(o) {
46
- const {
47
- children: r,
48
- moduleActions: e,
49
- moduleId: l
50
- } = o, [n] = s(() => ({
51
- moduleId: l,
52
- dictionary: void 0
53
- })), {
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
- value: {
60
- setDynamicActions: u,
61
- moduleId: n.moduleId
62
- },
63
- children: r
64
- });
65
- }
66
- const R = a((o, r) => {
67
- const {
68
- moduleId: e,
69
- moduleActions: l,
70
- children: n
71
- } = o, d = p(null), i = (u) => {
72
- d.current?.openModal(u);
73
- };
74
- return m(r, () => ({
75
- openModal: i,
76
- current: d.current
77
- })), /* @__PURE__ */ t(L, {
78
- moduleId: e,
79
- moduleActions: l,
80
- children: /* @__PURE__ */ t(v, {
81
- children: /* @__PURE__ */ t(M, {
82
- ref: d,
83
- children: n
84
- })
85
- })
86
- });
87
- });
88
- R.displayName = "ModuleLayout";
89
- function b() {
90
- return ["module_layout"].concat(g());
91
- }
92
- const j = {
93
- module_layout: {}
94
- };
95
- export {
96
- w as M,
97
- R as a,
98
- j as d,
99
- b as g
100
- };