@m4l/layouts 0.1.30 → 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;
@@ -1,7 +1,7 @@
1
1
  import { useEffect as y, useMemo as f, useCallback as _ } from "react";
2
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";
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
5
  import { A as j } from "../../contexts/AuthContext/index.6f966215.js";
6
6
  import { DomainCountryProvider as S, EnvironmentProvider as U, HostToolsProvider as z, NetworkProvider as R, axiosOperation as q } from "@m4l/core";
7
7
  import { createBrowserHistory as G } from "history";
@@ -19,14 +19,14 @@ function $(m) {
19
19
  user: d,
20
20
  pwd: l
21
21
  } = m, {
22
- isAuthenticated: s,
22
+ isAuthenticated: n,
23
23
  isInitialized: c,
24
24
  login: u,
25
25
  user: e
26
26
  } = W();
27
27
  if (y(() => {
28
- c && s === !1 && (console.log("useEffect MFAuthApp Login"), u(d, l, !1));
29
- }, [c, s]), !s)
28
+ c && n === !1 && (console.log("useEffect MFAuthApp Login"), u(d, l, !1));
29
+ }, [c, n]), !n)
30
30
  return /* @__PURE__ */ r("div", {
31
31
  children: "Pendiente x atenticar"
32
32
  });
@@ -37,14 +37,14 @@ function $(m) {
37
37
  decimal_symbol: ".",
38
38
  thousands_symbol: ","
39
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, {
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
41
  hostThemeOptions: Q,
42
42
  fnComponentsOverrides: V,
43
43
  isMicroFrontEnd: !0,
44
44
  children: [/* @__PURE__ */ r(D, {}), /* @__PURE__ */ r(S, {
45
45
  ...o,
46
46
  isMicroFrontEnd: !1,
47
- children: /* @__PURE__ */ r(N, {
47
+ children: /* @__PURE__ */ r(I, {
48
48
  isMicroFrontEnd: !1,
49
49
  dateFormatter: {
50
50
  formatDate: K
@@ -66,7 +66,7 @@ function ho(m) {
66
66
  children: a,
67
67
  user: d,
68
68
  pwd: l,
69
- host_api_local: s,
69
+ host_api_local: n,
70
70
  host_api_remote: c,
71
71
  host_static_assets: u,
72
72
  environment_assets: e,
@@ -74,40 +74,40 @@ function ho(m) {
74
74
  skeletonFlags: v,
75
75
  moduleNameField: g,
76
76
  privileges: F,
77
- componentsDictionary: P,
78
- onLoad: A,
77
+ componentsDictionary: A,
78
+ onLoad: P,
79
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) {
80
+ } = m, t = f(() => new J(), []), w = _((i, s) => {
81
+ t.on(i, s);
82
+ }, [t]), E = _((i, s) => {
83
+ if (s === null) {
84
84
  t.removeListener(i);
85
85
  return;
86
86
  }
87
- t.removeListener(i, n);
88
- }, [t]), M = _((i, n) => {
89
- t.emit(i, n);
90
- }, [t]), L = () => {
87
+ t.removeListener(i, s);
88
+ }, [t]), M = _((i, s) => {
89
+ t.emit(i, s);
90
+ }, [t]), k = () => {
91
91
  p.configure({
92
92
  showSpinner: !0
93
93
  }), p.start();
94
- }, k = () => {
94
+ }, L = () => {
95
95
  p.done();
96
96
  }, T = f(() => ({
97
97
  host: "",
98
98
  isLocalhost: !0,
99
99
  domain_token: "lab1",
100
- host_api_local: s,
100
+ host_api_local: n,
101
101
  host_api_remote: c,
102
102
  host_static_assets: u,
103
103
  environment_assets: e
104
104
  }), []), x = f(() => ({
105
105
  history: h,
106
- toast: H,
107
- startProgress: L,
108
- stopProgress: k,
109
- events_add_listener: E,
110
- events_remove_listener: w,
106
+ toast: N,
107
+ startProgress: k,
108
+ stopProgress: L,
109
+ events_add_listener: w,
110
+ events_remove_listener: E,
111
111
  events_emit: M
112
112
  }), []);
113
113
  return y(() => {
@@ -131,11 +131,11 @@ function ho(m) {
131
131
  moduleId: o,
132
132
  privileges: F,
133
133
  skeletonFlags: v,
134
- componentsDictionary: P,
134
+ componentsDictionary: A,
135
135
  moduleNameField: g,
136
136
  children: /* @__PURE__ */ r(Z, {
137
- onLoad: A,
138
- activeAreasNetwork: b,
137
+ onLoad: P,
138
+ loadAreasFromNetwork: b,
139
139
  children: a
140
140
  })
141
141
  })
@@ -1,4 +1,4 @@
1
- import "./MFIsolationApp/index.b89e6800.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 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.c250368a.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.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
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.0533b6b0.js";
11
11
  import "react";
12
12
  import "react-router-dom";
13
13
  import "react-toastify";
@@ -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,12 +1,11 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",
7
7
  "@m4l/core": "*",
8
- "@m4l/graphics": "*",
9
- "@m4l/styles": "*"
8
+ "@m4l/graphics": "*"
10
9
  },
11
10
  "peerDependencies": {
12
11
  "@types/react": "^17.0.0 || ^18.0.0",
@@ -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,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";
File without changes