@m4l/core 0.1.57 → 1.0.0
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/DomainContext/index.fc9c9f7e.js +56 -0
- package/contexts/DomainCountryContext/index.2da8b247.js +54 -0
- package/contexts/FlagsContext/index.3f08bff3.js +39 -0
- package/contexts/ModuleDictionaryContext/index.cc2a5fa3.js +76 -0
- package/contexts/ModulePrivilegesContext/index.039085db.js +58 -0
- package/contexts/ModuleSkeletonContext/index.334164fc.js +28 -0
- package/hooks/useDomain/{index.38a2a89e.js → index.73578fd1.js} +2 -2
- package/hooks/useFlagsStore/index.fa8dcf62.js +17 -0
- package/hooks/useModuleDictionary/{index.3305a123.js → index.0b2e51cf.js} +1 -1
- package/hooks/useModulePrivileges/{index.cbe0c72f.js → index.3c1155fb.js} +1 -1
- package/hooks/useModuleSkeleton/{index.739fd422.js → index.2b62072e.js} +1 -1
- package/index.js +68 -66
- package/node_modules.7069706f.js +835 -0
- package/package.json +1 -1
- package/packages/m4l_core/contexts/FlagsContext/index.d.ts +13 -0
- package/packages/m4l_core/contexts/FlagsContext/store.d.ts +11 -0
- package/{contexts → packages/m4l_core/contexts}/FlagsContext/types.d.ts +9 -0
- package/{hooks → packages/m4l_core/hooks}/index.d.ts +1 -1
- package/packages/m4l_core/hooks/useFlagsStore/index.d.ts +3 -0
- package/packages/m4l_core/vite-env.d.ts +4 -0
- package/utils/{index.c7370abf.js → index.6d56ba04.js} +14 -10
- package/vendor.3b4bd7d3.js +32 -0
- package/vite-env.d.ts +4 -4
- package/contexts/DomainContext/index.b9fd4c7f.js +0 -57
- package/contexts/DomainCountryContext/index.3cdf9462.js +0 -46
- package/contexts/FlagsContext/index.5f795859.js +0 -24
- package/contexts/FlagsContext/index.d.ts +0 -5
- package/contexts/ModuleDictionaryContext/index.848a0393.js +0 -73
- package/contexts/ModulePrivilegesContext/index.f1988b13.js +0 -54
- package/contexts/ModuleSkeletonContext/index.45963775.js +0 -20
- package/hooks/useFlags/index.a986729d.js +0 -21
- package/hooks/useFlags/index.d.ts +0 -3
- /package/{contexts → packages/m4l_core/contexts}/BaseContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/BaseContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/DomainContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/DomainContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/DomainCountryContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/DomainCountryContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/EnvironmentContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/EnvironmentContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/HostToolsContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/HostToolsContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModuleDictionaryContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModuleDictionaryContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModulePrivilegesContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModulePrivilegesContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModuleSkeletonContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/ModuleSkeletonContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/NetworkContext/index.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/NetworkContext/types.d.ts +0 -0
- /package/{contexts → packages/m4l_core/contexts}/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useBase/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useDomain/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useDomainCountry/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useEnvironment/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useHostTools/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useLocalStorage/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useLocalStorageWithListener/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useModuleDictionary/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useModulePrivileges/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useModuleSkeleton/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/useNetwork/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/usePaginate/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/usePaginate/types.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/usePropageteMF/index.d.ts +0 -0
- /package/{hooks → packages/m4l_core/hooks}/usePropageteMF/types.d.ts +0 -0
- /package/{index.d.ts → packages/m4l_core/index.d.ts} +0 -0
- /package/{types → packages/m4l_core/types}/dictionary.d.ts +0 -0
- /package/{types → packages/m4l_core/types}/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/axiosOperation/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/axiosOperation/types.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/evaluateWithContext/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/getLocalStorage/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/getPropertyByString/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/setLocalStorage/index.d.ts +0 -0
- /package/{utils → packages/m4l_core/utils}/voidFunction.d.ts +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlagsProviderProps } from './types';
|
|
3
|
+
declare const FlagsContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./types").FlagsStateWithActions>, "setState"> & {
|
|
4
|
+
setState<A extends string | {
|
|
5
|
+
type: unknown;
|
|
6
|
+
}>(partial: import("./types").FlagsStateWithActions | Partial<import("./types").FlagsStateWithActions> | ((state: import("./types").FlagsStateWithActions) => import("./types").FlagsStateWithActions | Partial<import("./types").FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
|
+
}, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: import("./types").FlagsStateWithActions | Partial<import("./types").FlagsStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./types").FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
} | undefined): void;
|
|
11
|
+
}) | null>;
|
|
12
|
+
declare function FlagsProvider({ children }: FlagsProviderProps): import("react").JSX.Element;
|
|
13
|
+
export { FlagsProvider, FlagsContext };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlagsStateWithActions, FlagsStoreState } from './types';
|
|
2
|
+
export declare const createFlagsStore: (initialState: FlagsStoreState) => Omit<Omit<import("zustand").StoreApi<FlagsStateWithActions>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: unknown;
|
|
5
|
+
}>(partial: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: FlagsStateWithActions) => FlagsStateWithActions | Partial<FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "setState"> & {
|
|
7
|
+
setState(nextStateOrUpdater: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
+
type: unknown;
|
|
9
|
+
} | undefined): void;
|
|
10
|
+
};
|
|
11
|
+
export declare type FlagsStore = ReturnType<typeof createFlagsStore>;
|
|
@@ -8,3 +8,12 @@ export interface FlagsContextProps {
|
|
|
8
8
|
clearFlags: () => void;
|
|
9
9
|
addFlag: (flag: Flag) => void;
|
|
10
10
|
}
|
|
11
|
+
export interface FlagsStoreState {
|
|
12
|
+
flags: Array<Flag>;
|
|
13
|
+
}
|
|
14
|
+
export interface FlagsStateWithActions extends FlagsStoreState {
|
|
15
|
+
flagsActions: {
|
|
16
|
+
clearFlags: () => void;
|
|
17
|
+
addFlag: (flag: Flag) => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useBase } from './useBase';
|
|
2
2
|
export { useEnvironment } from './useEnvironment';
|
|
3
|
-
export {
|
|
3
|
+
export { useFlagsStore, useFlagsPresent } from './useFlagsStore';
|
|
4
4
|
export { useHostTools } from './useHostTools';
|
|
5
5
|
export { useDomain } from './useDomain';
|
|
6
6
|
export { useLocalStorage } from './useLocalStorage';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Flag, FlagsStateWithActions } from '../../contexts/FlagsContext/types';
|
|
2
|
+
export declare function useFlagsStore<T>(selector: (state: FlagsStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
3
|
+
export declare const useFlagsPresent: (compareFlags: Array<Flag>) => boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import "axios";
|
|
2
|
+
import "qs";
|
|
3
|
+
import "camelcase-keys";
|
|
4
|
+
import "snakecase-keys";
|
|
5
|
+
function y() {
|
|
2
6
|
}
|
|
3
|
-
function
|
|
7
|
+
function p(n, e) {
|
|
4
8
|
const r = e.split(".");
|
|
5
9
|
let t = n;
|
|
6
10
|
for (const o of r) {
|
|
@@ -23,7 +27,7 @@ function u(n, e) {
|
|
|
23
27
|
}
|
|
24
28
|
return t;
|
|
25
29
|
}
|
|
26
|
-
function
|
|
30
|
+
function d(n, e) {
|
|
27
31
|
try {
|
|
28
32
|
const t = new Function(...Object.keys(n), `return \`${e}\``)(...Object.values(n));
|
|
29
33
|
return String(t).replace(/`/g, "");
|
|
@@ -31,7 +35,7 @@ function g(n, e) {
|
|
|
31
35
|
return console.error(`Error evaluating expression: ${r}`), "";
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
|
-
function
|
|
38
|
+
function m(n, e) {
|
|
35
39
|
try {
|
|
36
40
|
const r = window.localStorage.getItem(n);
|
|
37
41
|
return r !== null ? typeof e == "string" ? r : JSON.parse(r) : e;
|
|
@@ -39,7 +43,7 @@ function f(n, e) {
|
|
|
39
43
|
return e;
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
function
|
|
46
|
+
function v(n, e, r = !1) {
|
|
43
47
|
try {
|
|
44
48
|
let t = null;
|
|
45
49
|
if (typeof e == "string") {
|
|
@@ -53,9 +57,9 @@ function y(n, e, r = !1) {
|
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
m as a,
|
|
61
|
+
d as e,
|
|
62
|
+
p as g,
|
|
63
|
+
v as s,
|
|
64
|
+
y as v
|
|
61
65
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import "./contexts/BaseContext/index.f9cdc955.js";
|
|
3
|
+
import "./contexts/EnvironmentContext/index.b33784cd.js";
|
|
4
|
+
import "./contexts/FlagsContext/index.3f08bff3.js";
|
|
5
|
+
import "./contexts/HostToolsContext/index.499db832.js";
|
|
6
|
+
import "./contexts/DomainContext/index.fc9c9f7e.js";
|
|
7
|
+
import "./contexts/ModuleDictionaryContext/index.cc2a5fa3.js";
|
|
8
|
+
import "./contexts/ModulePrivilegesContext/index.039085db.js";
|
|
9
|
+
import "./contexts/ModuleSkeletonContext/index.334164fc.js";
|
|
10
|
+
import "./contexts/NetworkContext/index.ec7405cd.js";
|
|
11
|
+
import "./contexts/DomainCountryContext/index.2da8b247.js";
|
|
12
|
+
import "./hooks/useBase/index.4375dcef.js";
|
|
13
|
+
import "./hooks/useEnvironment/index.25f83176.js";
|
|
14
|
+
import "./hooks/useFlagsStore/index.fa8dcf62.js";
|
|
15
|
+
import "./hooks/useHostTools/index.66d9a667.js";
|
|
16
|
+
import "./hooks/useDomain/index.73578fd1.js";
|
|
17
|
+
import "./hooks/useLocalStorage/index.48b47dca.js";
|
|
18
|
+
import "./hooks/useModuleDictionary/index.0b2e51cf.js";
|
|
19
|
+
import "./hooks/useModulePrivileges/index.3c1155fb.js";
|
|
20
|
+
import "./hooks/useModuleSkeleton/index.2b62072e.js";
|
|
21
|
+
import "./hooks/useNetwork/index.3d79002b.js";
|
|
22
|
+
import "./hooks/usePaginate/index.1306b0de.js";
|
|
23
|
+
import "./hooks/usePropageteMF/index.c440b829.js";
|
|
24
|
+
import "./types/index.42c24946.js";
|
|
25
|
+
import "./utils/index.6d56ba04.js";
|
|
26
|
+
import "./utils/axiosOperation.ce4250d4.js";
|
|
27
|
+
function M(t) {
|
|
28
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
M as g
|
|
32
|
+
};
|
package/vite-env.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
/// <reference types="vitest" />
|
|
3
|
-
/// <reference types="vitest/globals" />
|
|
4
|
-
/// <reference types="vitest/importMeta" />
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vitest" />
|
|
3
|
+
/// <reference types="vitest/globals" />
|
|
4
|
+
/// <reference types="vitest/importMeta" />
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { createContext as f, useState as l, useEffect as p } from "react";
|
|
2
|
-
import { u as D } from "../../hooks/useFlags/index.a986729d.js";
|
|
3
|
-
import { u as v } from "../../hooks/useEnvironment/index.25f83176.js";
|
|
4
|
-
import { u as y } from "../../hooks/useNetwork/index.3d79002b.js";
|
|
5
|
-
import { C as r } from "../../types/index.42c24946.js";
|
|
6
|
-
import { jsx as $ } from "react/jsx-runtime";
|
|
7
|
-
const h = f(null);
|
|
8
|
-
function x(i) {
|
|
9
|
-
const {
|
|
10
|
-
children: _
|
|
11
|
-
} = i, {
|
|
12
|
-
domain_token: c,
|
|
13
|
-
host_static_assets: o,
|
|
14
|
-
environment_assets: n
|
|
15
|
-
} = v(), {
|
|
16
|
-
addFlag: s
|
|
17
|
-
} = D(), [u, t] = l(!1), [d, m] = l({
|
|
18
|
-
company_logo_small_url: "",
|
|
19
|
-
company_logo_normal_url: "",
|
|
20
|
-
name: "",
|
|
21
|
-
slogan: ""
|
|
22
|
-
}), {
|
|
23
|
-
networkOperation: g
|
|
24
|
-
} = y();
|
|
25
|
-
return p(() => {
|
|
26
|
-
let e = !0;
|
|
27
|
-
return g({
|
|
28
|
-
method: "GET",
|
|
29
|
-
endPoint: `na/info/${c}`
|
|
30
|
-
}).then((a) => {
|
|
31
|
-
e && (m({
|
|
32
|
-
...a.data,
|
|
33
|
-
company_logo_normal_url: a.data.company_logo_normal_url ?? `${o}/${n}/frontend/commons/assets/icons/isologo.svg`,
|
|
34
|
-
company_logo_small_url: a.data.company_logo_small_url ?? `${o}/${n}/frontend/commons/assets/icons/isotipo_m4l.svg`
|
|
35
|
-
}), s(r.FLAG_DOMAIN_LOADED), t(!0));
|
|
36
|
-
}).catch(() => {
|
|
37
|
-
m({
|
|
38
|
-
company_logo_normal_url: `${o}/${n}/frontend/commons/assets/icons/isologo.svg`,
|
|
39
|
-
company_logo_small_url: `${o}/${n}/frontend/commons/assets/icons/isotipo_m4l.svg`,
|
|
40
|
-
name: "Pending",
|
|
41
|
-
slogan: "Pending"
|
|
42
|
-
}), s(r.FLAG_DOMAIN_LOADED), t(!0);
|
|
43
|
-
}).finally(() => {
|
|
44
|
-
}), function() {
|
|
45
|
-
e = !1;
|
|
46
|
-
};
|
|
47
|
-
}, []), /* @__PURE__ */ $(h.Provider, {
|
|
48
|
-
value: {
|
|
49
|
-
...d
|
|
50
|
-
},
|
|
51
|
-
children: u && _
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
h as D,
|
|
56
|
-
x as a
|
|
57
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createContext as i, useState as l, useCallback as a } from "react";
|
|
2
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
-
const x = i(null);
|
|
4
|
-
function g({
|
|
5
|
-
children: n
|
|
6
|
-
}) {
|
|
7
|
-
const [s, r] = l([]), o = a(() => {
|
|
8
|
-
r([]);
|
|
9
|
-
}, []), c = a((e) => {
|
|
10
|
-
r((t) => t.findIndex((u) => u === e) < 0 ? [...t, e] : [...t]);
|
|
11
|
-
}, []);
|
|
12
|
-
return /* @__PURE__ */ f(x.Provider, {
|
|
13
|
-
value: {
|
|
14
|
-
flags: s,
|
|
15
|
-
addFlag: c,
|
|
16
|
-
clearFlags: o
|
|
17
|
-
},
|
|
18
|
-
children: n
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
x as F,
|
|
23
|
-
g as a
|
|
24
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FlagsContextProps, FlagsProviderProps } from './types';
|
|
3
|
-
declare const FlagsContext: import("react").Context<FlagsContextProps | null>;
|
|
4
|
-
declare function FlagsProvider({ children }: FlagsProviderProps): import("react").JSX.Element;
|
|
5
|
-
export { FlagsProvider, FlagsContext };
|
|
@@ -1,73 +0,0 @@
|
|
|
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.25f83176.js";
|
|
6
|
-
import { u as x } from "../../hooks/useHostTools/index.66d9a667.js";
|
|
7
|
-
import { u as A } from "../../hooks/useNetwork/index.3d79002b.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
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
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.3d79002b.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
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
1
|
-
import { useContext as f, useState as i, useEffect as u } from "react";
|
|
2
|
-
import { F as l } from "../../contexts/FlagsContext/index.5f795859.js";
|
|
3
|
-
const a = () => {
|
|
4
|
-
const t = f(l);
|
|
5
|
-
if (!t)
|
|
6
|
-
throw new Error("useFlags context must be use inside FlagsProvider");
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
function r(t, e) {
|
|
10
|
-
return t.filter((s) => e.findIndex((o) => o === s) !== -1).length === t.length;
|
|
11
|
-
}
|
|
12
|
-
const x = (t) => {
|
|
13
|
-
const e = a(), [n, s] = i(r(t, e.flags));
|
|
14
|
-
return u(() => {
|
|
15
|
-
r(t, e.flags) && s(!0);
|
|
16
|
-
}, [e.flags, t]), n;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
x as a,
|
|
20
|
-
a as u
|
|
21
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|