@m4l/core 0.1.29 → 0.1.30
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.
- package/contexts/BaseContext/index.f9cdc955.js +17 -0
- package/contexts/DomainContext/index.f9025d3b.js +51 -0
- package/contexts/DomainCountryContext/{index.0a8be64d.js → index.cfd81c74.js} +6 -6
- package/contexts/ModuleDictionaryContext/{index.dc124e04.js → index.0247f396.js} +20 -21
- package/contexts/ModulePrivilegesContext/{index.b163a7a9.js → index.c5aacd43.js} +6 -6
- package/contexts/ModuleSkeletonContext/{index.82c9e98f.js → index.3a180789.js} +5 -5
- package/hooks/useBase/index.4375dcef.js +11 -0
- package/hooks/useDomain/{index.41602da4.js → index.5bccbdc3.js} +2 -2
- package/hooks/useLocalStorage/index.fa31b0d1.js +51 -0
- package/hooks/useModuleDictionary/{index.3fb05525.js → index.af27f447.js} +1 -1
- package/hooks/useModulePrivileges/{index.f250cb2d.js → index.8b7c3831.js} +1 -1
- package/hooks/useModuleSkeleton/{index.73b1f9d4.js → index.fd0dcf82.js} +1 -1
- package/index.js +68 -84
- package/package.json +1 -1
- package/types/index.38eca705.js +5 -0
- package/types/index.d.ts +1 -0
- package/utils/{axiosOperation.6118a64a.js → axiosOperation.6efd68f1.js} +1 -1
- package/utils/index.6c53abe1.js +38 -0
- package/contexts/DomainContext/index.8f3b8dbb.js +0 -49
- package/hooks/useLocalStorage/index.281b7ae8.js +0 -48
- package/types/index.5f1b0c45.js +0 -5
- package/utils/index.4b6999c8.js +0 -34
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
const a = t(null);
|
|
4
|
+
function c(r) {
|
|
5
|
+
const {
|
|
6
|
+
children: e,
|
|
7
|
+
value: o
|
|
8
|
+
} = r;
|
|
9
|
+
return /* @__PURE__ */ n(a.Provider, {
|
|
10
|
+
value: o,
|
|
11
|
+
children: e
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as B,
|
|
16
|
+
c as a
|
|
17
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createContext as u, useState as m, useEffect as g } from "react";
|
|
2
|
+
import { u as p } from "../../hooks/useFlags/index.a986729d.js";
|
|
3
|
+
import { u as v } from "../../hooks/useEnvironment/index.04dca988.js";
|
|
4
|
+
import { u as D } from "../../hooks/useNetwork/index.acbf28d5.js";
|
|
5
|
+
import { C as y } from "../../types/index.38eca705.js";
|
|
6
|
+
import { jsxs as h, jsx as x } from "react/jsx-runtime";
|
|
7
|
+
const $ = u(null);
|
|
8
|
+
function O(r) {
|
|
9
|
+
const {
|
|
10
|
+
children: l
|
|
11
|
+
} = r, {
|
|
12
|
+
domain_token: i,
|
|
13
|
+
host_static_assets: n,
|
|
14
|
+
environment_assets: a
|
|
15
|
+
} = v(), {
|
|
16
|
+
addFlag: d
|
|
17
|
+
} = p(), [s, c] = m(!1), [t, f] = m({
|
|
18
|
+
company_logo_small_url: "",
|
|
19
|
+
company_logo_normal_url: "",
|
|
20
|
+
name: ""
|
|
21
|
+
}), {
|
|
22
|
+
networkOperation: _
|
|
23
|
+
} = D();
|
|
24
|
+
return console.log("domain values", t), g(() => {
|
|
25
|
+
let e = !0;
|
|
26
|
+
return _({
|
|
27
|
+
method: "GET",
|
|
28
|
+
endPoint: `na/info/${i}`
|
|
29
|
+
}).then((o) => {
|
|
30
|
+
e && (f({
|
|
31
|
+
...o.data,
|
|
32
|
+
company_logo_normal_url: o.data.company_logo_normal_url ?? `${n}/${a}/frontend/commons/assets/icons/isologo.svg`,
|
|
33
|
+
company_logo_small_url: o.data.company_logo_small_url ?? `${n}/${a}/frontend/commons/assets/icons/isotipo_m4l.svg`
|
|
34
|
+
}), d(y.FLAG_DOMAIN_LOADED), c(!0));
|
|
35
|
+
}).finally(() => {
|
|
36
|
+
}), function() {
|
|
37
|
+
e = !1;
|
|
38
|
+
};
|
|
39
|
+
}, []), /* @__PURE__ */ h($.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
...t
|
|
42
|
+
},
|
|
43
|
+
children: [s && l, !s && /* @__PURE__ */ x("div", {
|
|
44
|
+
children: "cargansdfasfsafsdfsafsdafdsfsfasdo"
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
$ as D,
|
|
50
|
+
O as a
|
|
51
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createContext as c, useState as T, useCallback as e, useEffect as d } from "react";
|
|
2
|
-
import "
|
|
2
|
+
import "../BaseContext/index.f9cdc955.js";
|
|
3
3
|
import "../EnvironmentContext/index.7045c64f.js";
|
|
4
4
|
import "../FlagsContext/index.5f795859.js";
|
|
5
5
|
import { u as N } from "../../hooks/useHostTools/index.66d9a667.js";
|
|
6
|
-
import "../DomainContext/index.
|
|
7
|
-
import "../ModuleDictionaryContext/index.
|
|
8
|
-
import "../ModulePrivilegesContext/index.
|
|
9
|
-
import "../ModuleSkeletonContext/index.
|
|
6
|
+
import "../DomainContext/index.f9025d3b.js";
|
|
7
|
+
import "../ModuleDictionaryContext/index.0247f396.js";
|
|
8
|
+
import "../ModulePrivilegesContext/index.c5aacd43.js";
|
|
9
|
+
import "../ModuleSkeletonContext/index.3a180789.js";
|
|
10
10
|
import "../NetworkContext/index.d1dfbc3a.js";
|
|
11
|
-
import { E as n } from "../../types/index.
|
|
11
|
+
import { E as n } from "../../types/index.38eca705.js";
|
|
12
12
|
import { jsx as f } from "react/jsx-runtime";
|
|
13
13
|
const l = c(null);
|
|
14
14
|
function R(m) {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { createContext as y, useState as F, useEffect as L, useCallback as
|
|
2
|
-
import "
|
|
1
|
+
import { createContext as y, useState as F, useEffect as L, useCallback as m } from "react";
|
|
2
|
+
import "../BaseContext/index.f9cdc955.js";
|
|
3
3
|
import { u as M } from "../../hooks/useEnvironment/index.04dca988.js";
|
|
4
4
|
import { u as N } from "../../hooks/useFlags/index.a986729d.js";
|
|
5
5
|
import { u as P } from "../../hooks/useHostTools/index.66d9a667.js";
|
|
6
|
-
import "../DomainContext/index.
|
|
7
|
-
import "../ModulePrivilegesContext/index.
|
|
8
|
-
import "../ModuleSkeletonContext/index.
|
|
6
|
+
import "../DomainContext/index.f9025d3b.js";
|
|
7
|
+
import "../ModulePrivilegesContext/index.c5aacd43.js";
|
|
8
|
+
import "../ModuleSkeletonContext/index.3a180789.js";
|
|
9
9
|
import { u as _ } from "../../hooks/useNetwork/index.acbf28d5.js";
|
|
10
|
-
import "../DomainCountryContext/index.
|
|
11
|
-
import { C as x } from "../../types/index.
|
|
10
|
+
import "../DomainCountryContext/index.cfd81c74.js";
|
|
11
|
+
import { C as x } from "../../types/index.38eca705.js";
|
|
12
12
|
import { jsx as A } from "react/jsx-runtime";
|
|
13
13
|
const E = y(null);
|
|
14
|
-
function Y(
|
|
14
|
+
function Y(u) {
|
|
15
15
|
const {
|
|
16
|
-
children:
|
|
17
|
-
componentsDictionary:
|
|
16
|
+
children: l,
|
|
17
|
+
componentsDictionary: c,
|
|
18
18
|
moduleId: i,
|
|
19
19
|
moduleNameField: s = "module_name",
|
|
20
|
-
currentLang:
|
|
21
|
-
isAuth:
|
|
22
|
-
} =
|
|
20
|
+
currentLang: d = "en",
|
|
21
|
+
isAuth: a = !0
|
|
22
|
+
} = u, {
|
|
23
23
|
addFlag: p
|
|
24
24
|
} = N(), [r, f] = F(void 0), {
|
|
25
25
|
domain_token: g
|
|
@@ -33,11 +33,10 @@ function Y(l) {
|
|
|
33
33
|
let t = !0;
|
|
34
34
|
return D(), v({
|
|
35
35
|
method: "GET",
|
|
36
|
-
endPoint:
|
|
36
|
+
endPoint: a ? `dictionaries/${i}` : `na/dictionaries/${i}`,
|
|
37
37
|
parms: {
|
|
38
|
-
comps:
|
|
39
|
-
|
|
40
|
-
...m ? {} : {
|
|
38
|
+
comps: c,
|
|
39
|
+
...a ? {} : {
|
|
41
40
|
domain_token: g
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -50,8 +49,8 @@ function Y(l) {
|
|
|
50
49
|
}), function() {
|
|
51
50
|
t = !1;
|
|
52
51
|
};
|
|
53
|
-
}, [
|
|
54
|
-
const n =
|
|
52
|
+
}, [d]);
|
|
53
|
+
const n = m((t) => {
|
|
55
54
|
if (r === void 0)
|
|
56
55
|
return "";
|
|
57
56
|
if (t === "")
|
|
@@ -63,14 +62,14 @@ function Y(l) {
|
|
|
63
62
|
} catch {
|
|
64
63
|
}
|
|
65
64
|
return o || `N_D:[${t}]`;
|
|
66
|
-
}, [r]), C =
|
|
65
|
+
}, [r]), C = m(() => n(s), [s, n]);
|
|
67
66
|
return /* @__PURE__ */ A(E.Provider, {
|
|
68
67
|
value: {
|
|
69
68
|
moduleDictionary: r,
|
|
70
69
|
getLabel: n,
|
|
71
70
|
getModuleLabel: C
|
|
72
71
|
},
|
|
73
|
-
children:
|
|
72
|
+
children: l
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createContext as f, useState as g, useEffect as P, useCallback as d } from "react";
|
|
2
|
-
import "
|
|
2
|
+
import "../BaseContext/index.f9cdc955.js";
|
|
3
3
|
import "../EnvironmentContext/index.7045c64f.js";
|
|
4
4
|
import { u as v } from "../../hooks/useFlags/index.a986729d.js";
|
|
5
5
|
import { u as E } from "../../hooks/useHostTools/index.66d9a667.js";
|
|
6
|
-
import "../DomainContext/index.
|
|
7
|
-
import "../ModuleDictionaryContext/index.
|
|
8
|
-
import "../ModuleSkeletonContext/index.
|
|
6
|
+
import "../DomainContext/index.f9025d3b.js";
|
|
7
|
+
import "../ModuleDictionaryContext/index.0247f396.js";
|
|
8
|
+
import "../ModuleSkeletonContext/index.3a180789.js";
|
|
9
9
|
import { u as h } from "../../hooks/useNetwork/index.acbf28d5.js";
|
|
10
|
-
import "../DomainCountryContext/index.
|
|
11
|
-
import { C as i } from "../../types/index.
|
|
10
|
+
import "../DomainCountryContext/index.cfd81c74.js";
|
|
11
|
+
import { C as i } from "../../types/index.38eca705.js";
|
|
12
12
|
import { jsx as L } from "react/jsx-runtime";
|
|
13
13
|
const C = f(null);
|
|
14
14
|
function y(n) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createContext as i } from "react";
|
|
2
|
-
import "
|
|
2
|
+
import "../BaseContext/index.f9cdc955.js";
|
|
3
3
|
import "../EnvironmentContext/index.7045c64f.js";
|
|
4
4
|
import { a as m } from "../../hooks/useFlags/index.a986729d.js";
|
|
5
5
|
import "../HostToolsContext/index.499db832.js";
|
|
6
|
-
import "../DomainContext/index.
|
|
7
|
-
import "../ModuleDictionaryContext/index.
|
|
8
|
-
import "../ModulePrivilegesContext/index.
|
|
6
|
+
import "../DomainContext/index.f9025d3b.js";
|
|
7
|
+
import "../ModuleDictionaryContext/index.0247f396.js";
|
|
8
|
+
import "../ModulePrivilegesContext/index.c5aacd43.js";
|
|
9
9
|
import "../NetworkContext/index.d1dfbc3a.js";
|
|
10
|
-
import "../DomainCountryContext/index.
|
|
10
|
+
import "../DomainCountryContext/index.cfd81c74.js";
|
|
11
11
|
import { jsx as n } from "react/jsx-runtime";
|
|
12
12
|
const p = i(null);
|
|
13
13
|
function P(o) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { B as o } from "../../contexts/BaseContext/index.f9cdc955.js";
|
|
3
|
+
function r() {
|
|
4
|
+
const e = t(o);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("useBase context must be use inside BaseContext");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
r as u
|
|
11
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
|
-
import { D as n } from "../../contexts/DomainContext/index.
|
|
3
|
-
import { D as e } from "../../contexts/DomainCountryContext/index.
|
|
2
|
+
import { D as n } from "../../contexts/DomainContext/index.f9025d3b.js";
|
|
3
|
+
import { D as e } from "../../contexts/DomainCountryContext/index.cfd81c74.js";
|
|
4
4
|
const m = () => {
|
|
5
5
|
const o = t(n);
|
|
6
6
|
if (!o)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useState as c, useEffect as l } from "react";
|
|
2
|
+
function S(r, e) {
|
|
3
|
+
const [s, n] = c(() => {
|
|
4
|
+
try {
|
|
5
|
+
const t = window.localStorage.getItem(r);
|
|
6
|
+
return t !== null ? typeof e == "string" ? t : JSON.parse(t) : e;
|
|
7
|
+
} catch {
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return [s, (t) => {
|
|
12
|
+
try {
|
|
13
|
+
window.localStorage.setItem(
|
|
14
|
+
r,
|
|
15
|
+
typeof e == "string" ? String(t) : JSON.stringify(t)
|
|
16
|
+
), n(t);
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
}];
|
|
20
|
+
}
|
|
21
|
+
function i(r, e) {
|
|
22
|
+
const [s, n] = c(() => {
|
|
23
|
+
try {
|
|
24
|
+
const t = localStorage.getItem(r);
|
|
25
|
+
return t === null ? e : JSON.parse(t);
|
|
26
|
+
} catch {
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return l(() => {
|
|
31
|
+
const t = (o) => {
|
|
32
|
+
if (o.storageArea === localStorage && o.key === r)
|
|
33
|
+
try {
|
|
34
|
+
o.newValue && n(JSON.parse(o.newValue));
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return window.addEventListener("storage", t), () => {
|
|
39
|
+
window.removeEventListener("storage", t);
|
|
40
|
+
};
|
|
41
|
+
}, [r, e]), [s, (t) => {
|
|
42
|
+
n((o) => {
|
|
43
|
+
const a = typeof t == "function" ? t(o) : t;
|
|
44
|
+
return localStorage.setItem(r, JSON.stringify(a)), a;
|
|
45
|
+
});
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
i as a,
|
|
50
|
+
S as u
|
|
51
|
+
};
|
|
@@ -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.
|
|
2
|
+
import { M as r } from "../../contexts/ModuleSkeletonContext/index.3a180789.js";
|
|
3
3
|
const S = () => {
|
|
4
4
|
const [t, o] = n(!0), e = s(r);
|
|
5
5
|
if (!e)
|
package/index.js
CHANGED
|
@@ -1,88 +1,72 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { M as
|
|
8
|
-
import { M as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { a as
|
|
25
|
-
import "./
|
|
1
|
+
import "react";
|
|
2
|
+
import { B as i, a as n } from "./contexts/BaseContext/index.f9cdc955.js";
|
|
3
|
+
import { E as u, a as x } from "./contexts/EnvironmentContext/index.7045c64f.js";
|
|
4
|
+
import { F as l, a as f } from "./contexts/FlagsContext/index.5f795859.js";
|
|
5
|
+
import { H as v, a as g } from "./contexts/HostToolsContext/index.499db832.js";
|
|
6
|
+
import { D as C, a as M } from "./contexts/DomainContext/index.f9025d3b.js";
|
|
7
|
+
import { M as S, a as c } from "./contexts/ModuleDictionaryContext/index.0247f396.js";
|
|
8
|
+
import { M as E, a as F } from "./contexts/ModulePrivilegesContext/index.c5aacd43.js";
|
|
9
|
+
import { M as B, a as L } from "./contexts/ModuleSkeletonContext/index.3a180789.js";
|
|
10
|
+
import { N, a as w } from "./contexts/NetworkContext/index.d1dfbc3a.js";
|
|
11
|
+
import { D as h, a as O } from "./contexts/DomainCountryContext/index.cfd81c74.js";
|
|
12
|
+
import { u as b } from "./hooks/useBase/index.4375dcef.js";
|
|
13
|
+
import { u as q } from "./hooks/useEnvironment/index.04dca988.js";
|
|
14
|
+
import { u as A, a as G } from "./hooks/useFlags/index.a986729d.js";
|
|
15
|
+
import { u as J } from "./hooks/useHostTools/index.66d9a667.js";
|
|
16
|
+
import { u as Q, a as R } from "./hooks/useDomain/index.5bccbdc3.js";
|
|
17
|
+
import { u as V, a as X } from "./hooks/useLocalStorage/index.fa31b0d1.js";
|
|
18
|
+
import { u as Z } from "./hooks/useModuleDictionary/index.af27f447.js";
|
|
19
|
+
import { u as $ } from "./hooks/useModulePrivileges/index.8b7c3831.js";
|
|
20
|
+
import { u as eo } from "./hooks/useModuleSkeleton/index.fd0dcf82.js";
|
|
21
|
+
import { u as ao } from "./hooks/useNetwork/index.acbf28d5.js";
|
|
22
|
+
import { i as so, u as io } from "./hooks/usePaginate/index.7cb17527.js";
|
|
23
|
+
import { C as mo, E as uo } from "./types/index.38eca705.js";
|
|
24
|
+
import { a as po, g as lo, s as fo, v as vo } from "./utils/index.6c53abe1.js";
|
|
25
|
+
import { a as Po } from "./utils/axiosOperation.6efd68f1.js";
|
|
26
|
+
import "react/jsx-runtime";
|
|
26
27
|
import "axios";
|
|
27
28
|
import "qs";
|
|
28
|
-
const e = a(null);
|
|
29
|
-
function p(o) {
|
|
30
|
-
const {
|
|
31
|
-
children: r,
|
|
32
|
-
value: t
|
|
33
|
-
} = o;
|
|
34
|
-
return /* @__PURE__ */ n(e.Provider, {
|
|
35
|
-
value: t,
|
|
36
|
-
children: r
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function f() {
|
|
40
|
-
const o = s(e);
|
|
41
|
-
if (!o)
|
|
42
|
-
throw new Error("useBase context must be use inside BaseContext");
|
|
43
|
-
return o;
|
|
44
|
-
}
|
|
45
29
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
30
|
+
i as BaseContext,
|
|
31
|
+
n as BaseProvider,
|
|
32
|
+
mo as CommonFlags,
|
|
33
|
+
C as DomainContext,
|
|
34
|
+
h as DomainCountryContext,
|
|
35
|
+
O as DomainCountryProvider,
|
|
36
|
+
M as DomainProvider,
|
|
37
|
+
uo as EmitEvents,
|
|
38
|
+
u as EnvironmentContext,
|
|
39
|
+
x as EnvironmentProvider,
|
|
40
|
+
l as FlagsContext,
|
|
41
|
+
f as FlagsProvider,
|
|
42
|
+
v as HostToolsContext,
|
|
43
|
+
g as HostToolsProvider,
|
|
44
|
+
S as ModuleDictionaryContext,
|
|
45
|
+
c as ModuleDictionaryProvider,
|
|
46
|
+
E as ModulePrivilegesContext,
|
|
47
|
+
F as ModulePrivilegesProvider,
|
|
48
|
+
B as ModuleSkeletonContext,
|
|
49
|
+
L as ModuleSkeletonProvider,
|
|
50
|
+
N as NetworkContext,
|
|
51
|
+
w as NetworkProvider,
|
|
52
|
+
Po as axiosOperation,
|
|
53
|
+
po as getLocalStorage,
|
|
54
|
+
lo as getPropertyByString,
|
|
55
|
+
so as initialPagerState,
|
|
56
|
+
fo as setLocalStorage,
|
|
57
|
+
b as useBase,
|
|
58
|
+
Q as useDomain,
|
|
59
|
+
R as useDomainCountry,
|
|
60
|
+
q as useEnvironment,
|
|
61
|
+
A as useFlags,
|
|
62
|
+
G as useFlagsPresent,
|
|
63
|
+
J as useHostTools,
|
|
64
|
+
V as useLocalStorage,
|
|
65
|
+
X as useLocalStorageWithListener,
|
|
66
|
+
Z as useModuleDictionary,
|
|
67
|
+
$ as useModulePrivileges,
|
|
68
|
+
eo as useModuleSkeleton,
|
|
69
|
+
ao as useNetwork,
|
|
70
|
+
io as usePaginate,
|
|
71
|
+
vo as voidFunction
|
|
88
72
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var E = /* @__PURE__ */ ((_) => (_.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized", _.EMMIT_EVENT_HOST_LOCALE_CHANGE = "host_locale_change", _.EMMIT_EVENT_HOST_THEME_CHANGE = "host_theme_change", _.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE = "domain_country_change", _))(E || {}), T = /* @__PURE__ */ ((_) => (_.FLAG_PRIVILEGES_LOADED = "privileges_loaded", _.FLAG_DICTIONARY_LOADED = "dictionary_loaded", _.FLAG_DOMAIN_LOADED = "domain_loaded", _))(T || {});
|
|
2
|
+
export {
|
|
3
|
+
T as C,
|
|
4
|
+
E
|
|
5
|
+
};
|
package/types/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare interface HostToolsType {
|
|
|
44
44
|
}
|
|
45
45
|
export declare enum EmitEvents {
|
|
46
46
|
EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized",
|
|
47
|
+
EMMIT_EVENT_HOST_LOCALE_CHANGE = "host_locale_change",
|
|
47
48
|
EMMIT_EVENT_HOST_THEME_CHANGE = "host_theme_change",
|
|
48
49
|
EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE = "domain_country_change"
|
|
49
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import f from "axios";
|
|
2
2
|
import p from "qs";
|
|
3
|
-
import { E } from "../types/index.
|
|
3
|
+
import { E } from "../types/index.38eca705.js";
|
|
4
4
|
function l(e, s, a) {
|
|
5
5
|
const { toast: d } = a;
|
|
6
6
|
return s && s.data && typeof s.data == "object" ? s.data.error && s.data.error?.code && s.data.error?.msg !== void 0 ? Promise.reject({ ...s.data.error, status: s.status }) : (s.data.message && d(s.data.message, { type: "success", autoClose: 1e4 }), s.data) : Promise.reject({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "axios";
|
|
2
|
+
import "qs";
|
|
3
|
+
function l() {
|
|
4
|
+
}
|
|
5
|
+
function s(n, e) {
|
|
6
|
+
let t = n;
|
|
7
|
+
const o = e.split(".");
|
|
8
|
+
for (let r = 0; r < o.length && t[o[r]] !== void 0; r += 1)
|
|
9
|
+
t = t[o[r]];
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function c(n, e) {
|
|
13
|
+
try {
|
|
14
|
+
const t = window.localStorage.getItem(n);
|
|
15
|
+
return t !== null ? typeof e == "string" ? t : JSON.parse(t) : e;
|
|
16
|
+
} catch {
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function g(n, e, t = !1) {
|
|
21
|
+
try {
|
|
22
|
+
let o = null;
|
|
23
|
+
if (typeof e == "string") {
|
|
24
|
+
window.localStorage.setItem(n, e);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
t && (o = window.localStorage.getItem(n));
|
|
28
|
+
let r = o !== null ? JSON.parse(o) : {};
|
|
29
|
+
r = { ...r, ...e }, window.localStorage.setItem(n, JSON.stringify(r));
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
c as a,
|
|
35
|
+
s as g,
|
|
36
|
+
g as s,
|
|
37
|
+
l as v
|
|
38
|
+
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { createContext as c, useState as u, useEffect as d } from "react";
|
|
2
|
-
import { u as f } from "../../hooks/useFlags/index.a986729d.js";
|
|
3
|
-
import { u as p } from "../../hooks/useEnvironment/index.04dca988.js";
|
|
4
|
-
import { u as g } from "../../hooks/useNetwork/index.acbf28d5.js";
|
|
5
|
-
import { C as v } from "../../types/index.5f1b0c45.js";
|
|
6
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
7
|
-
const D = c(null);
|
|
8
|
-
function k(m) {
|
|
9
|
-
const {
|
|
10
|
-
children: e
|
|
11
|
-
} = m, {
|
|
12
|
-
domain_token: l,
|
|
13
|
-
host_static_assets: n,
|
|
14
|
-
environment_assets: t
|
|
15
|
-
} = p(), {
|
|
16
|
-
addFlag: r
|
|
17
|
-
} = f(), [a, i] = u({
|
|
18
|
-
company_logo_small_url: "",
|
|
19
|
-
company_logo_normal_url: "",
|
|
20
|
-
name: ""
|
|
21
|
-
}), {
|
|
22
|
-
networkOperation: _
|
|
23
|
-
} = g();
|
|
24
|
-
return console.log("domain values", a), d(() => {
|
|
25
|
-
let s = !0;
|
|
26
|
-
return _({
|
|
27
|
-
method: "GET",
|
|
28
|
-
endPoint: `na/info/${l}`
|
|
29
|
-
}).then((o) => {
|
|
30
|
-
s && (i({
|
|
31
|
-
...o.data,
|
|
32
|
-
company_logo_normal_url: o.data.company_logo_normal_url ?? `${n}/${t}/frontend/commons/assets/icons/isologo.svg`,
|
|
33
|
-
company_logo_small_url: o.data.company_logo_small_url ?? `${n}/${t}/frontend/commons/assets/icons/isotipo_m4l.svg`
|
|
34
|
-
}), r(v.FLAG_DOMAIN_LOADED));
|
|
35
|
-
}).finally(() => {
|
|
36
|
-
}), function() {
|
|
37
|
-
s = !1;
|
|
38
|
-
};
|
|
39
|
-
}, []), /* @__PURE__ */ y(D.Provider, {
|
|
40
|
-
value: {
|
|
41
|
-
...a
|
|
42
|
-
},
|
|
43
|
-
children: e
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
D,
|
|
48
|
-
k as a
|
|
49
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useState as c, useEffect as u } from "react";
|
|
2
|
-
function i(e, o) {
|
|
3
|
-
const [n, a] = c(() => {
|
|
4
|
-
try {
|
|
5
|
-
const t = window.localStorage.getItem(e);
|
|
6
|
-
return t !== null ? JSON.parse(t) : o;
|
|
7
|
-
} catch {
|
|
8
|
-
return o;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
return [n, (t) => {
|
|
12
|
-
try {
|
|
13
|
-
window.localStorage.setItem(e, JSON.stringify(t)), a(t);
|
|
14
|
-
} catch {
|
|
15
|
-
}
|
|
16
|
-
}];
|
|
17
|
-
}
|
|
18
|
-
function S(e, o) {
|
|
19
|
-
const [n, a] = c(() => {
|
|
20
|
-
try {
|
|
21
|
-
const t = localStorage.getItem(e);
|
|
22
|
-
return t === null ? o : JSON.parse(t);
|
|
23
|
-
} catch {
|
|
24
|
-
return o;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return u(() => {
|
|
28
|
-
const t = (r) => {
|
|
29
|
-
if (r.storageArea === localStorage && r.key === e)
|
|
30
|
-
try {
|
|
31
|
-
r.newValue && a(JSON.parse(r.newValue));
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
return window.addEventListener("storage", t), () => {
|
|
36
|
-
window.removeEventListener("storage", t);
|
|
37
|
-
};
|
|
38
|
-
}, [e, o]), [n, (t) => {
|
|
39
|
-
a((r) => {
|
|
40
|
-
const s = typeof t == "function" ? t(r) : t;
|
|
41
|
-
return localStorage.setItem(e, JSON.stringify(s)), s;
|
|
42
|
-
});
|
|
43
|
-
}];
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
S as a,
|
|
47
|
-
i as u
|
|
48
|
-
};
|
package/types/index.5f1b0c45.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var E = /* @__PURE__ */ ((_) => (_.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized", _.EMMIT_EVENT_HOST_THEME_CHANGE = "host_theme_change", _.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE = "domain_country_change", _))(E || {}), e = /* @__PURE__ */ ((_) => (_.FLAG_PRIVILEGES_LOADED = "privileges_loaded", _.FLAG_DICTIONARY_LOADED = "dictionary_loaded", _.FLAG_DOMAIN_LOADED = "domain_loaded", _))(e || {});
|
|
2
|
-
export {
|
|
3
|
-
e as C,
|
|
4
|
-
E
|
|
5
|
-
};
|
package/utils/index.4b6999c8.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "axios";
|
|
2
|
-
import "qs";
|
|
3
|
-
function i() {
|
|
4
|
-
}
|
|
5
|
-
function c(r, n) {
|
|
6
|
-
let t = r;
|
|
7
|
-
const e = n.split(".");
|
|
8
|
-
for (let o = 0; o < e.length && t[e[o]] !== void 0; o += 1)
|
|
9
|
-
t = t[e[o]];
|
|
10
|
-
return t;
|
|
11
|
-
}
|
|
12
|
-
function s(r, n) {
|
|
13
|
-
try {
|
|
14
|
-
const t = window.localStorage.getItem(r);
|
|
15
|
-
return t !== null ? JSON.parse(t) : n;
|
|
16
|
-
} catch {
|
|
17
|
-
return n;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function g(r, n, t = !1) {
|
|
21
|
-
try {
|
|
22
|
-
let e = null;
|
|
23
|
-
t && (e = window.localStorage.getItem(r));
|
|
24
|
-
let o = e !== null ? JSON.parse(e) : {};
|
|
25
|
-
o = { ...o, ...n }, window.localStorage.setItem(r, JSON.stringify(o));
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
s as a,
|
|
31
|
-
c as g,
|
|
32
|
-
g as s,
|
|
33
|
-
i as v
|
|
34
|
-
};
|