@m4l/layouts 0.1.15 → 0.1.17

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,32 @@
1
+ import { unstable_HistoryRouter as c } from "react-router-dom";
2
+ import { LocalesProvider as d, HostThemeProvider as m } from "@m4l/graphics";
3
+ import { DomainCountryProvider as u } from "@m4l/core";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ function f(o) {
6
+ const {
7
+ children: t,
8
+ currentLocale: e,
9
+ hostTheme: i,
10
+ history: n,
11
+ domainCountryId: s
12
+ } = o;
13
+ return /* @__PURE__ */ r(d, {
14
+ isMicroFrontEnd: !0,
15
+ localeHost: e,
16
+ children: /* @__PURE__ */ r(m, {
17
+ isMicroFrontEnd: !0,
18
+ ...i,
19
+ children: /* @__PURE__ */ r(u, {
20
+ domainCountryId: s,
21
+ isMicroFrontEnd: !0,
22
+ children: /* @__PURE__ */ r(c, {
23
+ history: n,
24
+ children: t
25
+ })
26
+ })
27
+ })
28
+ });
29
+ }
30
+ export {
31
+ f as M
32
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { MFHostAppProps } from './types';
3
+ export declare function MFHostApp(props: MFHostAppProps): JSX.Element;
4
+ export default MFHostApp;
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import type { AxiosOperation, EnvironmentType, HostToolsType } from '@m4l/core';
3
+ import { HostThemeType, LocaleType } from '@m4l/graphics';
4
+ import type { BrowserHistory } from 'history';
5
+ export declare type ByHostProps = {
6
+ environment: EnvironmentType;
7
+ hostTools: HostToolsType;
8
+ axiosOperation: AxiosOperation;
9
+ hostTheme: HostThemeType;
10
+ currentLocale: LocaleType;
11
+ domainCountryId: number;
12
+ };
13
+ export declare type MFHostAppProps = {
14
+ domainCountryId: number;
15
+ history: BrowserHistory;
16
+ hostTheme: HostThemeType;
17
+ currentLocale: LocaleType;
18
+ children: ReactNode;
19
+ };
@@ -0,0 +1,105 @@
1
+ import { useEffect as v, useMemo as d } from "react";
2
+ import { unstable_HistoryRouter as y } from "react-router-dom";
3
+ import { ToastContainer as P, toast as M } from "react-toastify";
4
+ import { HostThemeProvider as w, defaultThemeOptions as F, fnComponentsOverrides as H, ProgressBarStyle as g, LocalesProvider as A, getLocaleFromNetwork as k } from "@m4l/graphics";
5
+ import { A as T } from "../../contexts/AuthContext/index.6f966215.js";
6
+ import { voidFunction as m, EnvironmentProvider as x, HostToolsProvider as E, NetworkProvider as C, axiosOperation as N, DomainCountryProvider as O } from "@m4l/core";
7
+ import { c as I, f as L, N as _ } from "../../node_modules.6a6cd7c4.js";
8
+ import { u as b } from "../../hooks/useAuth/index.cb6a3420.js";
9
+ import { jsx as o, jsxs as j } from "react/jsx-runtime";
10
+ function B(r) {
11
+ const {
12
+ children: s,
13
+ user: i,
14
+ pwd: n
15
+ } = r, {
16
+ isAuthenticated: t,
17
+ isInitialized: e,
18
+ login: a
19
+ } = b();
20
+ return v(() => {
21
+ e && t === !1 && a(i, n, !1);
22
+ }, [e, t]), t ? /* @__PURE__ */ j(w, {
23
+ hostThemeOptions: F,
24
+ fnComponentsOverrides: H,
25
+ isMicroFrontEnd: !0,
26
+ children: [/* @__PURE__ */ o(g, {}), /* @__PURE__ */ o(P, {}), s]
27
+ }) : /* @__PURE__ */ o("div", {
28
+ children: "Pendiente x atenticar"
29
+ });
30
+ }
31
+ const c = I({
32
+ window
33
+ });
34
+ function U(r) {
35
+ const {
36
+ children: s,
37
+ user: i,
38
+ pwd: n,
39
+ host_api_local: t,
40
+ host_api_remote: e,
41
+ host_static_assets: a,
42
+ environment_assets: l
43
+ } = r, f = () => {
44
+ _.configure({
45
+ showSpinner: !0
46
+ }), _.start();
47
+ }, h = () => {
48
+ _.done();
49
+ }, u = d(() => ({
50
+ host: "",
51
+ isLocalhost: !0,
52
+ domain_token: "lab1",
53
+ host_api_local: t,
54
+ host_api_remote: e,
55
+ host_static_assets: a,
56
+ environment_assets: l,
57
+ dfnsFormat: {
58
+ date_format: "yyyy-MM-dd",
59
+ date_mask: "____-__-__",
60
+ time_format: "HH:mm:ss",
61
+ time_mask: "__:__:__",
62
+ datetime_format: "yyyy-MM-dd HH:mm:ss",
63
+ datetime_mask: "____-__-__ __:__:__"
64
+ }
65
+ }), []), p = d(() => ({
66
+ history: c,
67
+ toast: M,
68
+ startProgress: f,
69
+ stopProgress: h,
70
+ events_add_listener: m,
71
+ events_remove_listener: m,
72
+ events_emit: m,
73
+ formatDate: L
74
+ }), []);
75
+ return /* @__PURE__ */ o(x, {
76
+ ...u,
77
+ children: /* @__PURE__ */ o(E, {
78
+ ...p,
79
+ children: /* @__PURE__ */ o(C, {
80
+ axiosOperation: N,
81
+ children: /* @__PURE__ */ o(y, {
82
+ history: c,
83
+ children: /* @__PURE__ */ o(A, {
84
+ isMicroFrontEnd: !1,
85
+ getLocaleFromNetwork: k,
86
+ children: /* @__PURE__ */ o(O, {
87
+ domainCountryId: 1,
88
+ isMicroFrontEnd: !1,
89
+ children: /* @__PURE__ */ o(T, {
90
+ children: /* @__PURE__ */ o(B, {
91
+ user: i,
92
+ pwd: n,
93
+ children: s
94
+ })
95
+ })
96
+ })
97
+ })
98
+ })
99
+ })
100
+ })
101
+ });
102
+ }
103
+ export {
104
+ U as M
105
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { MFIsolationAppProps } from './types';
3
+ export declare function MFIsolationApp(props: MFIsolationAppProps): JSX.Element;
4
+ export default MFIsolationApp;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { MFAuthAppProps } from './types';
3
+ export declare function MFAuthApp(props: MFAuthAppProps): JSX.Element;
4
+ export default MFAuthApp;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export declare type MFAuthAppProps = {
3
+ user: string;
4
+ pwd: string;
5
+ children: ReactNode;
6
+ };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export declare type MFIsolationAppProps = {
3
+ host_api_local: string;
4
+ host_api_remote: string;
5
+ host_static_assets: string;
6
+ environment_assets: string;
7
+ user: string;
8
+ pwd: string;
9
+ children: ReactNode;
10
+ };
@@ -0,0 +1,3 @@
1
+ export { MFIsolationApp } from './MFIsolationApp';
2
+ export { MFHostApp } from './MFHostApp';
3
+ export type { ByHostProps } from './MFHostApp/types';
@@ -125,6 +125,6 @@ function R(e) {
125
125
  });
126
126
  }
127
127
  export {
128
- x as A,
129
- R as a
128
+ R as A,
129
+ x as a
130
130
  };
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { A as e } from "../../contexts/AuthContext/index.59755369.js";
2
+ import { a as e } from "../../contexts/AuthContext/index.6f966215.js";
3
3
  const n = () => {
4
4
  const t = o(e);
5
5
  if (!t)
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './components';
1
2
  export * from './contexts';
2
3
  export * from './layouts';
3
4
  export * from './hooks';
package/index.js CHANGED
@@ -1,30 +1,38 @@
1
- import { A as p, a as d } from "./contexts/AuthContext/index.59755369.js";
2
- import { a as y, d as n, g as M } from "./layouts/ModuleLayout/index.842072c5.js";
3
- import "@m4l/components";
1
+ import { M as n } from "./components/MFIsolationApp/index.967f891d.js";
2
+ import { M as f } from "./components/MFHostApp/index.5af54b8e.js";
3
+ import { a as D, A } from "./contexts/AuthContext/index.6f966215.js";
4
+ import { a as c, d as g, g as h } from "./layouts/ModuleLayout/index.842072c5.js";
5
+ import { a as N, d as F, g as v } from "./layouts/MasterDetailLayout/index.71de0dc7.js";
6
+ import { N as I, d as P, g as b } from "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
7
+ import { u as k } from "./hooks/useMasterDetail/index.8e9e900b.js";
8
+ import { u as w } from "./hooks/useAuth/index.cb6a3420.js";
9
+ import { u as B } from "./hooks/useModule/index.096d7d13.js";
4
10
  import "react";
5
- import "@m4l/core";
6
- import { a as D, d as x, g as L } from "./layouts/MasterDetailLayout/index.71de0dc7.js";
11
+ import "react-router-dom";
12
+ import "react-toastify";
7
13
  import "@m4l/graphics";
8
- import "@mui/material";
14
+ import "@m4l/core";
15
+ import "./node_modules.6a6cd7c4.js";
16
+ import "./vendor.496d5f73.js";
9
17
  import "react/jsx-runtime";
10
- import { N as c, d as g, g as h } from "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
11
- import { u as N } from "./hooks/useMasterDetail/index.8e9e900b.js";
12
- import { u as P } from "./hooks/useAuth/index.ae68bf71.js";
13
- import { u as j } from "./hooks/useModule/index.096d7d13.js";
18
+ import "@m4l/components";
19
+ import "@mui/material";
14
20
  import "@mui/material/styles";
15
21
  export {
16
- p as AuthContext,
17
- d as AuthProvider,
18
- D as MasterDetailLayout,
19
- y as ModuleLayout,
20
- c as NoAuthModuleLayout,
21
- x as defaultMasterDetailDictionary,
22
- n as defaultModuleLayoutDictionary,
23
- g as defaultNoAuthModuleLayoutDictionary,
24
- L as getMasterDetailLayoutComponentsDictionary,
25
- M as getModuleLayoutComponentsDictionary,
26
- h as getNoAuthModuleLayoutComponentsDictionary,
27
- P as useAuth,
28
- N as useMasterDetail,
29
- j as useModule
22
+ D as AuthContext,
23
+ A as AuthProvider,
24
+ f as MFHostApp,
25
+ n as MFIsolationApp,
26
+ N as MasterDetailLayout,
27
+ c as ModuleLayout,
28
+ I as NoAuthModuleLayout,
29
+ F as defaultMasterDetailDictionary,
30
+ g as defaultModuleLayoutDictionary,
31
+ P as defaultNoAuthModuleLayoutDictionary,
32
+ v as getMasterDetailLayoutComponentsDictionary,
33
+ h as getModuleLayoutComponentsDictionary,
34
+ b as getNoAuthModuleLayoutComponentsDictionary,
35
+ w as useAuth,
36
+ k as useMasterDetail,
37
+ B as useModule
30
38
  };