@m4l/core 0.1.50 → 0.1.52

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 (26) hide show
  1. package/contexts/DomainContext/{index.8d81b39c.js → index.ecd8b5ac.js} +2 -2
  2. package/contexts/DomainCountryContext/index.3cdf9462.js +46 -0
  3. package/contexts/EnvironmentContext/index.421e4f74.js +29 -0
  4. package/contexts/EnvironmentContext/index.d.ts +2 -2
  5. package/contexts/EnvironmentContext/types.d.ts +10 -2
  6. package/contexts/ModuleDictionaryContext/index.e6103934.js +73 -0
  7. package/contexts/ModulePrivilegesContext/index.ec71c5bb.js +54 -0
  8. package/contexts/ModuleSkeletonContext/index.45963775.js +20 -0
  9. package/contexts/NetworkContext/{index.d1dfbc3a.js → index.583e4f85.js} +1 -1
  10. package/hooks/useDomain/{index.9e5dc4a4.js → index.2ef00a51.js} +2 -2
  11. package/hooks/useEnvironment/index.d.ts +2 -2
  12. package/hooks/useEnvironment/{index.04dca988.js → index.f4050a0c.js} +1 -1
  13. package/hooks/useModuleDictionary/{index.93177cf8.js → index.ee9282aa.js} +1 -1
  14. package/hooks/useModulePrivileges/{index.4b22874b.js → index.125a7496.js} +1 -1
  15. package/hooks/useModuleSkeleton/{index.0429108c.js → index.739fd422.js} +1 -1
  16. package/hooks/useNetwork/{index.acbf28d5.js → index.e1736c31.js} +1 -1
  17. package/hooks/usePaginate/{index.030f3b27.js → index.13fa70ac.js} +1 -1
  18. package/index.js +60 -60
  19. package/package.json +1 -1
  20. package/types/index.d.ts +19 -2
  21. package/utils/{index.6d56ba04.js → index.c7370abf.js} +10 -14
  22. package/contexts/DomainCountryContext/index.85791bcb.js +0 -54
  23. package/contexts/EnvironmentContext/index.7045c64f.js +0 -17
  24. package/contexts/ModuleDictionaryContext/index.b7c026b1.js +0 -78
  25. package/contexts/ModulePrivilegesContext/index.7abed4dc.js +0 -60
  26. package/contexts/ModuleSkeletonContext/index.18801a35.js +0 -28
@@ -1,7 +1,7 @@
1
1
  import { createContext as f, useState as s, useEffect as p } from "react";
2
2
  import { u as g } from "../../hooks/useFlags/index.a986729d.js";
3
- import { u as D } from "../../hooks/useEnvironment/index.04dca988.js";
4
- import { u as v } from "../../hooks/useNetwork/index.acbf28d5.js";
3
+ import { u as D } from "../../hooks/useEnvironment/index.f4050a0c.js";
4
+ import { u as v } from "../../hooks/useNetwork/index.e1736c31.js";
5
5
  import { C as y } from "../../types/index.42c24946.js";
6
6
  import { jsx as h } from "react/jsx-runtime";
7
7
  const $ = f(null);
@@ -0,0 +1,46 @@
1
+ import { createContext as d, useState as y, useCallback as T } from "react";
2
+ import { E as r } from "../../types/index.42c24946.js";
3
+ import { jsx as f } from "react/jsx-runtime";
4
+ import { u as D } from "../../hooks/useHostTools/index.66d9a667.js";
5
+ import { u as M } from "../../hooks/usePropageteMF/index.c440b829.js";
6
+ const N = d(null);
7
+ function A(e) {
8
+ const {
9
+ children: s,
10
+ isMicroFrontEnd: t,
11
+ id: i,
12
+ currency: a,
13
+ currency_decimal_digits: m,
14
+ decimal_symbol: c,
15
+ thousands_symbol: u
16
+ } = e, {
17
+ events_emit: _
18
+ } = D(), [l, C] = y({
19
+ id: i,
20
+ currency: a,
21
+ currency_decimal_digits: m,
22
+ decimal_symbol: c,
23
+ thousands_symbol: u
24
+ }), n = (o) => {
25
+ C(o);
26
+ };
27
+ M({
28
+ isMicroFrontEnd: t,
29
+ event: r.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE,
30
+ setHandler: n
31
+ });
32
+ const E = T((o) => {
33
+ t || (n(o), _(r.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE, o));
34
+ }, []);
35
+ return /* @__PURE__ */ f(N.Provider, {
36
+ value: {
37
+ ...l,
38
+ changeDomainCountry: E
39
+ },
40
+ children: s
41
+ });
42
+ }
43
+ export {
44
+ N as D,
45
+ A as a
46
+ };
@@ -0,0 +1,29 @@
1
+ import { createContext as i, useCallback as l, useState as u } from "react";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ const d = i(null);
4
+ function f(e) {
5
+ const {
6
+ children: o,
7
+ ...s
8
+ } = e, n = l((t) => {
9
+ if (e.isIsolatation)
10
+ return `${e.host}/module/assets/icons/${t}`;
11
+ if (e?.isMicroFrontend) {
12
+ if (!e.mfProps)
13
+ throw new Error("mfProps is required");
14
+ return e?.isLocalhost ? `https://${window.location.hostname}:${e.mfProps.debugPort}/module/assets/icons/${t}` : `module/${e.mfProps.moduleId}/module/assets/icons/${t}`;
15
+ } else
16
+ return `module/assets/icons/${t}`;
17
+ }, []), [r] = u({
18
+ ...s,
19
+ getModuleUrlIconAsset: n
20
+ });
21
+ return /* @__PURE__ */ a(d.Provider, {
22
+ value: r,
23
+ children: o
24
+ });
25
+ }
26
+ export {
27
+ d as E,
28
+ f as a
29
+ };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { EnvironmentProviderProps } from './types';
3
- declare const EnvironmentContext: import("react").Context<import("../..").EnvironmentType | null>;
2
+ import { EnvironmentContextType, EnvironmentProviderProps } from './types';
3
+ declare const EnvironmentContext: import("react").Context<EnvironmentContextType | null>;
4
4
  declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
5
5
  export { EnvironmentProvider, EnvironmentContext };
@@ -1,6 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EnvironmentType } from '../../types';
3
- export interface EnvironmentProviderProps extends EnvironmentType {
3
+ export interface EnvironmentProviderProps extends Omit<EnvironmentType, 'getMfUrlIconAsset'> {
4
4
  children: ReactNode;
5
5
  }
6
- export declare type EnvironmentContextType = EnvironmentType;
6
+ export declare type EnvironmentContextType = EnvironmentType & {
7
+ /**
8
+ * "getModuleUrlIconAsset" función encargada de obtener la url de un recurso de un microfrontend
9
+ * basado
10
+ * @param iconName
11
+ * @returns
12
+ */
13
+ getModuleUrlIconAsset: (iconName: string) => string;
14
+ };
@@ -0,0 +1,73 @@
1
+ import { createContext as y, useState as F, useEffect as L, useCallback as u } from "react";
2
+ import { C as M } from "../../types/index.42c24946.js";
3
+ import { jsx as N } from "react/jsx-runtime";
4
+ import { u as P } from "../../hooks/useFlags/index.a986729d.js";
5
+ import { u as _ } from "../../hooks/useEnvironment/index.f4050a0c.js";
6
+ import { u as x } from "../../hooks/useHostTools/index.66d9a667.js";
7
+ import { u as A } from "../../hooks/useNetwork/index.e1736c31.js";
8
+ const E = y(null);
9
+ function j(l) {
10
+ const {
11
+ children: c,
12
+ componentsDictionary: m,
13
+ moduleId: i,
14
+ moduleNameField: s = "module_name",
15
+ currentLang: d = "en",
16
+ isAuth: a = !0
17
+ } = l, {
18
+ addFlag: f
19
+ } = P(), [e, p] = F(void 0), {
20
+ domain_token: g
21
+ } = _(), {
22
+ startProgress: D,
23
+ stopProgress: h
24
+ } = x(), {
25
+ networkOperation: v
26
+ } = A();
27
+ L(() => {
28
+ let t = !0;
29
+ return D(), v({
30
+ method: "GET",
31
+ endPoint: a ? `dictionaries/${i}` : `na/dictionaries/${i}`,
32
+ parms: {
33
+ comps: m,
34
+ ...a ? {} : {
35
+ domain_token: g
36
+ }
37
+ }
38
+ }).then((o) => {
39
+ t && (p({
40
+ ...o
41
+ }), f(M.FLAG_DICTIONARY_LOADED));
42
+ }).finally(() => {
43
+ h();
44
+ }), function() {
45
+ t = !1;
46
+ };
47
+ }, [d]);
48
+ const n = u((t) => {
49
+ if (e === void 0)
50
+ return "";
51
+ if (t === "")
52
+ return "No key";
53
+ let o;
54
+ const r = t.split(".");
55
+ try {
56
+ r.length === 1 && (o = e.data[t]), r.length === 2 && (o = e[r[0]][r[1]]);
57
+ } catch {
58
+ }
59
+ return o || `N_D:[${t}]`;
60
+ }, [e]), C = u(() => n(s), [s, n]);
61
+ return /* @__PURE__ */ N(E.Provider, {
62
+ value: {
63
+ moduleDictionary: e,
64
+ getLabel: n,
65
+ getModuleLabel: C
66
+ },
67
+ children: c
68
+ });
69
+ }
70
+ export {
71
+ E as M,
72
+ j as a
73
+ };
@@ -0,0 +1,54 @@
1
+ import { createContext as g, useState as p, useEffect as P, useCallback as d } from "react";
2
+ import { C as i } from "../../types/index.42c24946.js";
3
+ import { jsx as v } from "react/jsx-runtime";
4
+ import { u as E } from "../../hooks/useFlags/index.a986729d.js";
5
+ import { u as h } from "../../hooks/useHostTools/index.66d9a667.js";
6
+ import { u as L } from "../../hooks/useNetwork/index.e1736c31.js";
7
+ const C = g(null);
8
+ function _(n) {
9
+ const {
10
+ children: a,
11
+ queryPrivileges: t
12
+ } = n, {
13
+ addFlag: o
14
+ } = E(), [r, l] = p({}), {
15
+ startProgress: u,
16
+ stopProgress: m
17
+ } = h(), {
18
+ networkOperation: c
19
+ } = L();
20
+ P(() => {
21
+ let e = !0;
22
+ if (t.length === 0) {
23
+ o(i.FLAG_PRIVILEGES_LOADED);
24
+ return;
25
+ }
26
+ return u(), c({
27
+ method: "GET",
28
+ endPoint: "auth/login",
29
+ parms: {
30
+ privileges: t
31
+ }
32
+ }).then((s) => {
33
+ e && (l({
34
+ ...s.data
35
+ }), o(i.FLAG_PRIVILEGES_LOADED));
36
+ }).finally(() => {
37
+ m();
38
+ }), function() {
39
+ e = !1;
40
+ };
41
+ }, []);
42
+ const f = d((e) => e in r, [r]);
43
+ return /* @__PURE__ */ v(C.Provider, {
44
+ value: {
45
+ hasPrivilege: f,
46
+ privileges: r
47
+ },
48
+ children: a
49
+ });
50
+ }
51
+ export {
52
+ C as M,
53
+ _ as a
54
+ };
@@ -0,0 +1,20 @@
1
+ import { createContext as n } from "react";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import { a as l } from "../../hooks/useFlags/index.a986729d.js";
4
+ const a = n(null);
5
+ function m(e) {
6
+ const {
7
+ children: o,
8
+ flags: t
9
+ } = e, r = !l(t);
10
+ return /* @__PURE__ */ s(a.Provider, {
11
+ value: {
12
+ isSkeleton: r
13
+ },
14
+ children: o
15
+ });
16
+ }
17
+ export {
18
+ a as M,
19
+ m as a
20
+ };
@@ -1,5 +1,5 @@
1
1
  import { createContext as i, useCallback as c } from "react";
2
- import { u as m } from "../../hooks/useEnvironment/index.04dca988.js";
2
+ import { u as m } from "../../hooks/useEnvironment/index.f4050a0c.js";
3
3
  import { u } from "../../hooks/useHostTools/index.66d9a667.js";
4
4
  import { jsx as l } from "react/jsx-runtime";
5
5
  const p = i(null);
@@ -1,6 +1,6 @@
1
1
  import { useContext as t } from "react";
2
- import { D as n } from "../../contexts/DomainContext/index.8d81b39c.js";
3
- import { D as e } from "../../contexts/DomainCountryContext/index.85791bcb.js";
2
+ import { D as n } from "../../contexts/DomainContext/index.ecd8b5ac.js";
3
+ import { D as e } from "../../contexts/DomainCountryContext/index.3cdf9462.js";
4
4
  const m = () => {
5
5
  const o = t(n);
6
6
  if (!o)
@@ -1,3 +1,3 @@
1
- import { EnvironmentType } from '../../types';
2
- export declare const useEnvironment: () => EnvironmentType;
1
+ import { EnvironmentContextType } from '../../contexts/EnvironmentContext/types';
2
+ export declare const useEnvironment: () => EnvironmentContextType;
3
3
  export default useEnvironment;
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { E as e } from "../../contexts/EnvironmentContext/index.7045c64f.js";
2
+ import { E as e } from "../../contexts/EnvironmentContext/index.421e4f74.js";
3
3
  const s = () => {
4
4
  const n = t(e);
5
5
  if (!n)
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../contexts/ModuleDictionaryContext/index.b7c026b1.js";
2
+ import { M as e } from "../../contexts/ModuleDictionaryContext/index.e6103934.js";
3
3
  const n = () => {
4
4
  const o = t(e);
5
5
  if (!o)
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { M as t } from "../../contexts/ModulePrivilegesContext/index.7abed4dc.js";
2
+ import { M as t } from "../../contexts/ModulePrivilegesContext/index.ec71c5bb.js";
3
3
  const i = () => {
4
4
  const e = o(t);
5
5
  if (!e)
@@ -1,5 +1,5 @@
1
1
  import { useState as n, useContext as s, useEffect as u } from "react";
2
- import { M as r } from "../../contexts/ModuleSkeletonContext/index.18801a35.js";
2
+ import { M as r } from "../../contexts/ModuleSkeletonContext/index.45963775.js";
3
3
  const S = () => {
4
4
  const [t, o] = n(!0), e = s(r);
5
5
  if (!e)
@@ -1,5 +1,5 @@
1
1
  import { useContext as e } from "react";
2
- import { N as o } from "../../contexts/NetworkContext/index.d1dfbc3a.js";
2
+ import { N as o } from "../../contexts/NetworkContext/index.583e4f85.js";
3
3
  const s = () => {
4
4
  const t = e(o);
5
5
  if (!t)
@@ -1,6 +1,6 @@
1
1
  import { useState as s, useRef as G, useCallback as H, useEffect as p } from "react";
2
2
  import { u as L } from "../useHostTools/index.66d9a667.js";
3
- import { u as N } from "../useNetwork/index.acbf28d5.js";
3
+ import { u as N } from "../useNetwork/index.e1736c31.js";
4
4
  const a = {
5
5
  page: 0,
6
6
  rowsPerPage: 25,
package/index.js CHANGED
@@ -1,77 +1,77 @@
1
- import "react";
2
- import { B as m, a as u } from "./contexts/BaseContext/index.f9cdc955.js";
3
- import { E as p, a as l } from "./contexts/EnvironmentContext/index.7045c64f.js";
4
- import { F as d, a as v } from "./contexts/FlagsContext/index.5f795859.js";
1
+ import { C as m, E as u } from "./types/index.42c24946.js";
2
+ import { B as p, a as l } from "./contexts/BaseContext/index.f9cdc955.js";
3
+ import { E as d, a as v } from "./contexts/EnvironmentContext/index.421e4f74.js";
5
4
  import { H as P, a as C } from "./contexts/HostToolsContext/index.499db832.js";
6
- import { D, a as S } from "./contexts/DomainContext/index.8d81b39c.js";
7
- import { M as y, a as F } from "./contexts/ModuleDictionaryContext/index.b7c026b1.js";
8
- import { M as k, a as B } from "./contexts/ModulePrivilegesContext/index.7abed4dc.js";
9
- import { M as H, a as N } from "./contexts/ModuleSkeletonContext/index.18801a35.js";
10
- import { N as T, a as h } from "./contexts/NetworkContext/index.d1dfbc3a.js";
11
- import { D as O, a as b } from "./contexts/DomainCountryContext/index.85791bcb.js";
12
- import { u as q } from "./hooks/useBase/index.4375dcef.js";
13
- import { u as A } from "./hooks/useEnvironment/index.04dca988.js";
14
- import { u as I, a as J } from "./hooks/useFlags/index.a986729d.js";
15
- import { u as Q } from "./hooks/useHostTools/index.66d9a667.js";
16
- import { u as U, a as V } from "./hooks/useDomain/index.9e5dc4a4.js";
17
- import { u as Y, a as Z } from "./hooks/useLocalStorage/index.48b47dca.js";
18
- import { u as $ } from "./hooks/useModuleDictionary/index.93177cf8.js";
19
- import { u as eo } from "./hooks/useModulePrivileges/index.4b22874b.js";
20
- import { u as ao } from "./hooks/useModuleSkeleton/index.0429108c.js";
21
- import { u as so } from "./hooks/useNetwork/index.acbf28d5.js";
22
- import { i as no, u as mo } from "./hooks/usePaginate/index.030f3b27.js";
23
- import { u as xo } from "./hooks/usePropageteMF/index.c440b829.js";
24
- import { C as lo, E as fo } from "./types/index.42c24946.js";
25
- import { e as go, a as Po, g as Co, s as Mo, v as Do } from "./utils/index.6d56ba04.js";
5
+ import { N as D, a as S } from "./contexts/NetworkContext/index.583e4f85.js";
6
+ import { F as y, a as F } from "./contexts/FlagsContext/index.5f795859.js";
7
+ import { D as k, a as B } from "./contexts/DomainContext/index.ecd8b5ac.js";
8
+ import { M as H, a as N } from "./contexts/ModuleDictionaryContext/index.e6103934.js";
9
+ import { M as T, a as h } from "./contexts/ModulePrivilegesContext/index.ec71c5bb.js";
10
+ import { M as O, a as b } from "./contexts/ModuleSkeletonContext/index.45963775.js";
11
+ import { D as q, a as z } from "./contexts/DomainCountryContext/index.3cdf9462.js";
12
+ import { u as G } from "./hooks/useBase/index.4375dcef.js";
13
+ import { u as J } from "./hooks/useEnvironment/index.f4050a0c.js";
14
+ import { u as Q, a as R } from "./hooks/useFlags/index.a986729d.js";
15
+ import { u as V } from "./hooks/useHostTools/index.66d9a667.js";
16
+ import { u as Y, a as Z } from "./hooks/useDomain/index.2ef00a51.js";
17
+ import { u as $, a as oo } from "./hooks/useLocalStorage/index.48b47dca.js";
18
+ import { u as ro } from "./hooks/useModuleDictionary/index.ee9282aa.js";
19
+ import { u as to } from "./hooks/useModulePrivileges/index.125a7496.js";
20
+ import { u as io } from "./hooks/useModuleSkeleton/index.739fd422.js";
21
+ import { u as mo } from "./hooks/useNetwork/index.e1736c31.js";
22
+ import { i as xo, u as po } from "./hooks/usePaginate/index.13fa70ac.js";
23
+ import { u as fo } from "./hooks/usePropageteMF/index.c440b829.js";
24
+ import { e as go, a as Po, g as Co, s as Mo, v as Do } from "./utils/index.c7370abf.js";
26
25
  import { a as co } from "./utils/axiosOperation.30c7cc9d.js";
26
+ import "react";
27
27
  import "react/jsx-runtime";
28
28
  import "axios";
29
29
  import "qs";
30
30
  import "camelcase-keys";
31
31
  import "snakecase-keys";
32
32
  export {
33
- m as BaseContext,
34
- u as BaseProvider,
35
- lo as CommonFlags,
36
- D as DomainContext,
37
- O as DomainCountryContext,
38
- b as DomainCountryProvider,
39
- S as DomainProvider,
40
- fo as EmitEvents,
41
- p as EnvironmentContext,
42
- l as EnvironmentProvider,
43
- d as FlagsContext,
44
- v as FlagsProvider,
33
+ p as BaseContext,
34
+ l as BaseProvider,
35
+ m as CommonFlags,
36
+ k as DomainContext,
37
+ q as DomainCountryContext,
38
+ z as DomainCountryProvider,
39
+ B as DomainProvider,
40
+ u as EmitEvents,
41
+ d as EnvironmentContext,
42
+ v as EnvironmentProvider,
43
+ y as FlagsContext,
44
+ F as FlagsProvider,
45
45
  P as HostToolsContext,
46
46
  C as HostToolsProvider,
47
- y as ModuleDictionaryContext,
48
- F as ModuleDictionaryProvider,
49
- k as ModulePrivilegesContext,
50
- B as ModulePrivilegesProvider,
51
- H as ModuleSkeletonContext,
52
- N as ModuleSkeletonProvider,
53
- T as NetworkContext,
54
- h as NetworkProvider,
47
+ H as ModuleDictionaryContext,
48
+ N as ModuleDictionaryProvider,
49
+ T as ModulePrivilegesContext,
50
+ h as ModulePrivilegesProvider,
51
+ O as ModuleSkeletonContext,
52
+ b as ModuleSkeletonProvider,
53
+ D as NetworkContext,
54
+ S as NetworkProvider,
55
55
  co as axiosOperation,
56
56
  go as evaluateWithContext,
57
57
  Po as getLocalStorage,
58
58
  Co as getPropertyByString,
59
- no as initialPagerState,
59
+ xo as initialPagerState,
60
60
  Mo as setLocalStorage,
61
- q as useBase,
62
- U as useDomain,
63
- V as useDomainCountry,
64
- A as useEnvironment,
65
- I as useFlags,
66
- J as useFlagsPresent,
67
- Q as useHostTools,
68
- Y as useLocalStorage,
69
- Z as useLocalStorageWithListener,
70
- $ as useModuleDictionary,
71
- eo as useModulePrivileges,
72
- ao as useModuleSkeleton,
73
- so as useNetwork,
74
- mo as usePaginate,
75
- xo as usePropageteMF,
61
+ G as useBase,
62
+ Y as useDomain,
63
+ Z as useDomainCountry,
64
+ J as useEnvironment,
65
+ Q as useFlags,
66
+ R as useFlagsPresent,
67
+ V as useHostTools,
68
+ $ as useLocalStorage,
69
+ oo as useLocalStorageWithListener,
70
+ ro as useModuleDictionary,
71
+ to as useModulePrivileges,
72
+ io as useModuleSkeleton,
73
+ mo as useNetwork,
74
+ po as usePaginate,
75
+ fo as usePropageteMF,
76
76
  Do as voidFunction
77
77
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/core",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
package/types/index.d.ts CHANGED
@@ -4,7 +4,23 @@ import { ResponseType } from 'axios';
4
4
  import { DomainCountry } from '../contexts';
5
5
  import { AxiosOptions } from '../utils/axiosOperation/types';
6
6
  export declare type Maybe<T> = T | undefined | null;
7
- export declare interface EnvironmentType {
7
+ declare type MFProps = {
8
+ moduleId: string;
9
+ debugPort: number;
10
+ };
11
+ export declare type EnvironmentType = {
12
+ /**
13
+ * "isIsolatation" Indica si la aplicacion esta ejecutando stand alone sin el host.
14
+ * Por defecto es false.
15
+ * El componente ByIsolation pone esta configuración.
16
+ */
17
+ isIsolatation?: boolean;
18
+ isMicroFrontend?: boolean;
19
+ mfProps?: MFProps;
20
+ /**
21
+ * "isLocalhost": Indica si la aplicacion esta en localhost.
22
+ * Se determina con base en el window.host.
23
+ */
8
24
  isLocalhost: boolean;
9
25
  host: string;
10
26
  domain_token: string;
@@ -12,7 +28,7 @@ export declare interface EnvironmentType {
12
28
  host_api_local: string;
13
29
  host_static_assets: string;
14
30
  environment_assets: string;
15
- }
31
+ };
16
32
  export declare type NetworkProps = {
17
33
  method: any;
18
34
  endPoint: string;
@@ -74,3 +90,4 @@ export declare enum CommonFlags {
74
90
  FLAG_FORM_LOADED = "form_loaded"
75
91
  }
76
92
  export declare type AxiosOperation = (props: NetworkProps, enviroment: EnvironmentType, hostTools: HostToolsType) => Promise<any>;
93
+ export {};
@@ -1,10 +1,6 @@
1
- import "axios";
2
- import "qs";
3
- import "camelcase-keys";
4
- import "snakecase-keys";
5
- function y() {
1
+ function l() {
6
2
  }
7
- function p(n, e) {
3
+ function u(n, e) {
8
4
  const r = e.split(".");
9
5
  let t = n;
10
6
  for (const o of r) {
@@ -27,7 +23,7 @@ function p(n, e) {
27
23
  }
28
24
  return t;
29
25
  }
30
- function d(n, e) {
26
+ function g(n, e) {
31
27
  try {
32
28
  const t = new Function(...Object.keys(n), `return \`${e}\``)(...Object.values(n));
33
29
  return String(t).replace(/`/g, "");
@@ -35,7 +31,7 @@ function d(n, e) {
35
31
  return console.error(`Error evaluating expression: ${r}`), "";
36
32
  }
37
33
  }
38
- function m(n, e) {
34
+ function f(n, e) {
39
35
  try {
40
36
  const r = window.localStorage.getItem(n);
41
37
  return r !== null ? typeof e == "string" ? r : JSON.parse(r) : e;
@@ -43,7 +39,7 @@ function m(n, e) {
43
39
  return e;
44
40
  }
45
41
  }
46
- function v(n, e, r = !1) {
42
+ function y(n, e, r = !1) {
47
43
  try {
48
44
  let t = null;
49
45
  if (typeof e == "string") {
@@ -57,9 +53,9 @@ function v(n, e, r = !1) {
57
53
  }
58
54
  }
59
55
  export {
60
- m as a,
61
- d as e,
62
- p as g,
63
- v as s,
64
- y as v
56
+ f as a,
57
+ g as e,
58
+ u as g,
59
+ y as s,
60
+ l as v
65
61
  };
@@ -1,54 +0,0 @@
1
- import { createContext as E, useState as d, useCallback as y } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import "../EnvironmentContext/index.7045c64f.js";
4
- import "../FlagsContext/index.5f795859.js";
5
- import { u as T } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.8d81b39c.js";
7
- import "../ModuleDictionaryContext/index.b7c026b1.js";
8
- import "../ModulePrivilegesContext/index.7abed4dc.js";
9
- import "../ModuleSkeletonContext/index.18801a35.js";
10
- import "../NetworkContext/index.d1dfbc3a.js";
11
- import { u as f } from "../../hooks/usePropageteMF/index.c440b829.js";
12
- import { E as i } from "../../types/index.42c24946.js";
13
- import { jsx as D } from "react/jsx-runtime";
14
- const M = E(null);
15
- function G(n) {
16
- const {
17
- children: e,
18
- isMicroFrontEnd: t,
19
- id: m,
20
- currency: s,
21
- currency_decimal_digits: a,
22
- decimal_symbol: c,
23
- thousands_symbol: u
24
- } = n, {
25
- events_emit: p
26
- } = T(), [_, l] = d({
27
- id: m,
28
- currency: s,
29
- currency_decimal_digits: a,
30
- decimal_symbol: c,
31
- thousands_symbol: u
32
- }), r = (o) => {
33
- l(o);
34
- };
35
- f({
36
- isMicroFrontEnd: t,
37
- event: i.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE,
38
- setHandler: r
39
- });
40
- const C = y((o) => {
41
- t || (r(o), p(i.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE, o));
42
- }, []);
43
- return /* @__PURE__ */ D(M.Provider, {
44
- value: {
45
- ..._,
46
- changeDomainCountry: C
47
- },
48
- children: e
49
- });
50
- }
51
- export {
52
- M as D,
53
- G as a
54
- };
@@ -1,17 +0,0 @@
1
- import { createContext as e, useState as i } from "react";
2
- import { jsx as a } from "react/jsx-runtime";
3
- const m = e(null);
4
- function v(n) {
5
- const {
6
- children: t,
7
- ...o
8
- } = n, [r] = i(o);
9
- return /* @__PURE__ */ a(m.Provider, {
10
- value: r,
11
- children: t
12
- });
13
- }
14
- export {
15
- m as E,
16
- v as a
17
- };
@@ -1,78 +0,0 @@
1
- import { createContext as y, useState as F, useEffect as L, useCallback as m } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import { u as M } from "../../hooks/useEnvironment/index.04dca988.js";
4
- import { u as N } from "../../hooks/useFlags/index.a986729d.js";
5
- import { u as P } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.8d81b39c.js";
7
- import "../ModulePrivilegesContext/index.7abed4dc.js";
8
- import "../ModuleSkeletonContext/index.18801a35.js";
9
- import { u as _ } from "../../hooks/useNetwork/index.acbf28d5.js";
10
- import "../DomainCountryContext/index.85791bcb.js";
11
- import { C as x } from "../../types/index.42c24946.js";
12
- import { jsx as A } from "react/jsx-runtime";
13
- const E = y(null);
14
- function Y(u) {
15
- const {
16
- children: l,
17
- componentsDictionary: c,
18
- moduleId: i,
19
- moduleNameField: s = "module_name",
20
- currentLang: d = "en",
21
- isAuth: a = !0
22
- } = u, {
23
- addFlag: p
24
- } = N(), [r, f] = F(void 0), {
25
- domain_token: g
26
- } = M(), {
27
- startProgress: D,
28
- stopProgress: h
29
- } = P(), {
30
- networkOperation: v
31
- } = _();
32
- L(() => {
33
- let t = !0;
34
- return D(), v({
35
- method: "GET",
36
- endPoint: a ? `dictionaries/${i}` : `na/dictionaries/${i}`,
37
- parms: {
38
- comps: c,
39
- ...a ? {} : {
40
- domain_token: g
41
- }
42
- }
43
- }).then((o) => {
44
- t && (f({
45
- ...o
46
- }), p(x.FLAG_DICTIONARY_LOADED));
47
- }).finally(() => {
48
- h();
49
- }), function() {
50
- t = !1;
51
- };
52
- }, [d]);
53
- const n = m((t) => {
54
- if (r === void 0)
55
- return "";
56
- if (t === "")
57
- return "No key";
58
- let o;
59
- const e = t.split(".");
60
- try {
61
- e.length === 1 && (o = r.data[t]), e.length === 2 && (o = r[e[0]][e[1]]);
62
- } catch {
63
- }
64
- return o || `N_D:[${t}]`;
65
- }, [r]), C = m(() => n(s), [s, n]);
66
- return /* @__PURE__ */ A(E.Provider, {
67
- value: {
68
- moduleDictionary: r,
69
- getLabel: n,
70
- getModuleLabel: C
71
- },
72
- children: l
73
- });
74
- }
75
- export {
76
- E as M,
77
- Y as a
78
- };
@@ -1,60 +0,0 @@
1
- import { createContext as f, useState as g, useEffect as P, useCallback as d } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import "../EnvironmentContext/index.7045c64f.js";
4
- import { u as v } from "../../hooks/useFlags/index.a986729d.js";
5
- import { u as E } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.8d81b39c.js";
7
- import "../ModuleDictionaryContext/index.b7c026b1.js";
8
- import "../ModuleSkeletonContext/index.18801a35.js";
9
- import { u as h } from "../../hooks/useNetwork/index.acbf28d5.js";
10
- import "../DomainCountryContext/index.85791bcb.js";
11
- import { C as i } from "../../types/index.42c24946.js";
12
- import { jsx as L } from "react/jsx-runtime";
13
- const C = f(null);
14
- function y(n) {
15
- const {
16
- children: a,
17
- queryPrivileges: t
18
- } = n, {
19
- addFlag: o
20
- } = v(), [r, l] = g({}), {
21
- startProgress: m,
22
- stopProgress: u
23
- } = E(), {
24
- networkOperation: p
25
- } = h();
26
- P(() => {
27
- let e = !0;
28
- if (t.length === 0) {
29
- o(i.FLAG_PRIVILEGES_LOADED);
30
- return;
31
- }
32
- return m(), p({
33
- method: "GET",
34
- endPoint: "auth/login",
35
- parms: {
36
- privileges: t
37
- }
38
- }).then((s) => {
39
- e && (l({
40
- ...s.data
41
- }), o(i.FLAG_PRIVILEGES_LOADED));
42
- }).finally(() => {
43
- u();
44
- }), function() {
45
- e = !1;
46
- };
47
- }, []);
48
- const c = d((e) => e in r, [r]);
49
- return /* @__PURE__ */ L(C.Provider, {
50
- value: {
51
- hasPrivilege: c,
52
- privileges: r
53
- },
54
- children: a
55
- });
56
- }
57
- export {
58
- C as M,
59
- y as a
60
- };
@@ -1,28 +0,0 @@
1
- import { createContext as i } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import "../EnvironmentContext/index.7045c64f.js";
4
- import { a as m } from "../../hooks/useFlags/index.a986729d.js";
5
- import "../HostToolsContext/index.499db832.js";
6
- import "../DomainContext/index.8d81b39c.js";
7
- import "../ModuleDictionaryContext/index.b7c026b1.js";
8
- import "../ModulePrivilegesContext/index.7abed4dc.js";
9
- import "../NetworkContext/index.d1dfbc3a.js";
10
- import "../DomainCountryContext/index.85791bcb.js";
11
- import { jsx as n } from "react/jsx-runtime";
12
- const p = i(null);
13
- function P(o) {
14
- const {
15
- children: t,
16
- flags: r
17
- } = o, e = !m(r);
18
- return /* @__PURE__ */ n(p.Provider, {
19
- value: {
20
- isSkeleton: e
21
- },
22
- children: t
23
- });
24
- }
25
- export {
26
- p as M,
27
- P as a
28
- };