@m4l/core 2.0.2 → 2.0.4

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 (43) hide show
  1. package/contexts/AuthContext/constants.d.ts +5 -0
  2. package/contexts/AuthContext/index.d.ts +1 -1
  3. package/contexts/AuthContext/index.dd2ed9e6.js +137 -0
  4. package/contexts/AuthContext/types.d.ts +17 -18
  5. package/contexts/BaseContext/index.d.ts +1 -0
  6. package/contexts/DomainContext/index.d.ts +1 -0
  7. package/contexts/DomainCountryContext/index.3cdf9462.js +46 -0
  8. package/contexts/DomainCountryContext/index.d.ts +1 -0
  9. package/contexts/EnvironmentContext/index.d.ts +1 -0
  10. package/contexts/FlagsContext/index.d.ts +1 -0
  11. package/contexts/HostToolsContext/index.d.ts +1 -0
  12. package/contexts/ModuleDictionaryContext/index.63e1dbbd.js +74 -0
  13. package/contexts/ModuleDictionaryContext/index.d.ts +1 -0
  14. package/contexts/ModulePrivilegesContext/index.1274092a.js +52 -0
  15. package/contexts/ModulePrivilegesContext/index.d.ts +1 -0
  16. package/contexts/ModuleSkeletonContext/index.9267d86a.js +20 -0
  17. package/contexts/ModuleSkeletonContext/index.d.ts +1 -0
  18. package/contexts/NetworkContext/index.d.ts +1 -0
  19. package/contexts/index.d.ts +1 -1
  20. package/hooks/useAuth/index.94b696a7.js +11 -0
  21. package/hooks/useAuth/useAuth.d.ts +1 -1
  22. package/hooks/useDomain/{index.be2722d9.js → index.dd6909f6.js} +1 -1
  23. package/hooks/useModuleDictionary/{index.9004a259.js → index.80b52ae5.js} +1 -1
  24. package/hooks/useModulePrivileges/{index.6ebd7c42.js → index.e93abed8.js} +1 -1
  25. package/hooks/useModuleSkeleton/{index.1cdf5081.js → index.a8238d1d.js} +1 -1
  26. package/hooks/usePaginate/index.0a5d70e5.js +74 -0
  27. package/hooks/usePaginate/index.d.ts +1 -0
  28. package/hooks/usePaginate/types.d.ts +2 -0
  29. package/index.js +66 -66
  30. package/package.json +1 -1
  31. package/types/dictionary.d.ts +1 -1
  32. package/types/index.d.ts +1 -0
  33. package/utils/getPropertyByString/index.d.ts +3 -1
  34. package/utils/index.54ccec2f.js +61 -0
  35. package/vite-env.d.ts +4 -4
  36. package/contexts/AuthContext/index.db46edbc.js +0 -150
  37. package/contexts/DomainCountryContext/index.506456a3.js +0 -57
  38. package/contexts/ModuleDictionaryContext/index.a64207d4.js +0 -81
  39. package/contexts/ModulePrivilegesContext/index.79c3cc04.js +0 -62
  40. package/contexts/ModuleSkeletonContext/index.f6150fb9.js +0 -30
  41. package/hooks/useAuth/index.4154d394.js +0 -21
  42. package/hooks/usePaginate/index.1306b0de.js +0 -70
  43. package/utils/index.2f5ce5aa.js +0 -65
package/index.js CHANGED
@@ -1,33 +1,33 @@
1
- import "react";
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.b33784cd.js";
4
- import { F as P, a as C } from "./contexts/FlagsContext/index.5b096265.js";
5
- import "zustand";
1
+ import { C as p, E as l } from "./types/index.42c24946.js";
2
+ import { B as d, a as v } from "./contexts/BaseContext/index.f9cdc955.js";
3
+ import { E as P, a as C } from "./contexts/EnvironmentContext/index.b33784cd.js";
6
4
  import { H as D, a as S } from "./contexts/HostToolsContext/index.499db832.js";
7
- import { D as y, a as F } from "./contexts/DomainContext/index.2ed56159.js";
8
- import { M as k, a as h } from "./contexts/ModuleDictionaryContext/index.a64207d4.js";
9
- import { M as L, a as A } from "./contexts/ModulePrivilegesContext/index.79c3cc04.js";
10
- import { M as N, a as w } from "./contexts/ModuleSkeletonContext/index.f6150fb9.js";
11
- import { N as W, a as O } from "./contexts/NetworkContext/index.ec7405cd.js";
12
- import { D as j, a as q } from "./contexts/DomainCountryContext/index.506456a3.js";
13
- import { A as G, a as I } from "./contexts/AuthContext/index.db46edbc.js";
14
- import { u as K } from "./hooks/useBase/index.4375dcef.js";
15
- import { u as R } from "./hooks/useEnvironment/index.25f83176.js";
16
- import { a as V, u as X } from "./hooks/useFlagsStore/index.f7c613ac.js";
17
- import { u as Z } from "./hooks/useHostTools/index.66d9a667.js";
18
- import { u as $, a as oo } from "./hooks/useDomain/index.be2722d9.js";
19
- import { a as ro, u as to } from "./hooks/useLocalStorage/index.91bc0791.js";
20
- import { u as so } from "./hooks/useModuleDictionary/index.9004a259.js";
21
- import { u as mo } from "./hooks/useModulePrivileges/index.6ebd7c42.js";
22
- import { u as uo } from "./hooks/useModuleSkeleton/index.1cdf5081.js";
23
- import { u as po } from "./hooks/useNetwork/index.3d79002b.js";
24
- import { i as fo, u as vo } from "./hooks/usePaginate/index.1306b0de.js";
25
- import { u as Po } from "./hooks/usePropageteMF/index.c440b829.js";
26
- import { u as Mo } from "./hooks/useAuth/index.4154d394.js";
27
- import { C as So, E as co } from "./types/index.42c24946.js";
28
- import { e as Fo, g as Eo, a as ko, s as ho, v as Bo } from "./utils/index.2f5ce5aa.js";
5
+ import { N as y, a as F } from "./contexts/NetworkContext/index.ec7405cd.js";
6
+ import { F as k, a as h } from "./contexts/FlagsContext/index.5b096265.js";
7
+ import { D as L, a as A } from "./contexts/DomainContext/index.2ed56159.js";
8
+ import { M as N, a as w } from "./contexts/ModuleDictionaryContext/index.63e1dbbd.js";
9
+ import { M as W, a as O } from "./contexts/ModulePrivilegesContext/index.1274092a.js";
10
+ import { M as j, a as q } from "./contexts/ModuleSkeletonContext/index.9267d86a.js";
11
+ import { D as G, a as I } from "./contexts/DomainCountryContext/index.3cdf9462.js";
12
+ import { A as K, a as Q } from "./contexts/AuthContext/index.dd2ed9e6.js";
13
+ import { u as U } from "./hooks/useBase/index.4375dcef.js";
14
+ import { u as X } from "./hooks/useEnvironment/index.25f83176.js";
15
+ import { a as Z, u as _ } from "./hooks/useFlagsStore/index.f7c613ac.js";
16
+ import { u as oo } from "./hooks/useHostTools/index.66d9a667.js";
17
+ import { u as ro, a as to } from "./hooks/useDomain/index.dd6909f6.js";
18
+ import { a as so, u as io } from "./hooks/useLocalStorage/index.91bc0791.js";
19
+ import { u as no } from "./hooks/useModuleDictionary/index.80b52ae5.js";
20
+ import { u as xo } from "./hooks/useModulePrivileges/index.e93abed8.js";
21
+ import { u as lo } from "./hooks/useModuleSkeleton/index.a8238d1d.js";
22
+ import { u as vo } from "./hooks/useNetwork/index.3d79002b.js";
23
+ import { i as Po, u as Co } from "./hooks/usePaginate/index.0a5d70e5.js";
24
+ import { u as Do } from "./hooks/usePropageteMF/index.c440b829.js";
25
+ import { u as co } from "./hooks/useAuth/index.94b696a7.js";
26
+ import { e as Fo, g as Eo, a as ko, s as ho, v as Bo } from "./utils/index.54ccec2f.js";
29
27
  import { a as Ao } from "./utils/axiosOperation.ac6c8eef.js";
28
+ import "react";
30
29
  import "react/jsx-runtime";
30
+ import "zustand";
31
31
  import "zustand/middleware";
32
32
  import "./node_modules.04fac7e9.js";
33
33
  import "axios";
@@ -35,51 +35,51 @@ import "qs";
35
35
  import "camelcase-keys";
36
36
  import "snakecase-keys";
37
37
  export {
38
- G as AuthContext,
39
- I as AuthProvider,
40
- p as BaseContext,
41
- l as BaseProvider,
42
- So as CommonFlags,
43
- y as DomainContext,
44
- j as DomainCountryContext,
45
- q as DomainCountryProvider,
46
- F as DomainProvider,
47
- co as EmitEvents,
48
- d as EnvironmentContext,
49
- v as EnvironmentProvider,
50
- P as FlagsContext,
51
- C as FlagsProvider,
38
+ K as AuthContext,
39
+ Q as AuthProvider,
40
+ d as BaseContext,
41
+ v as BaseProvider,
42
+ p as CommonFlags,
43
+ L as DomainContext,
44
+ G as DomainCountryContext,
45
+ I as DomainCountryProvider,
46
+ A as DomainProvider,
47
+ l as EmitEvents,
48
+ P as EnvironmentContext,
49
+ C as EnvironmentProvider,
50
+ k as FlagsContext,
51
+ h as FlagsProvider,
52
52
  D as HostToolsContext,
53
53
  S as HostToolsProvider,
54
- k as ModuleDictionaryContext,
55
- h as ModuleDictionaryProvider,
56
- L as ModulePrivilegesContext,
57
- A as ModulePrivilegesProvider,
58
- N as ModuleSkeletonContext,
59
- w as ModuleSkeletonProvider,
60
- W as NetworkContext,
61
- O as NetworkProvider,
54
+ N as ModuleDictionaryContext,
55
+ w as ModuleDictionaryProvider,
56
+ W as ModulePrivilegesContext,
57
+ O as ModulePrivilegesProvider,
58
+ j as ModuleSkeletonContext,
59
+ q as ModuleSkeletonProvider,
60
+ y as NetworkContext,
61
+ F as NetworkProvider,
62
62
  Ao as axiosOperation,
63
63
  Fo as evaluateWithContext,
64
64
  Eo as getLocalStorage,
65
65
  ko as getPropertyByString,
66
- fo as initialPagerState,
66
+ Po as initialPagerState,
67
67
  ho as setLocalStorage,
68
- Mo as useAuth,
69
- K as useBase,
70
- $ as useDomain,
71
- oo as useDomainCountry,
72
- R as useEnvironment,
73
- V as useFlagsPresent,
74
- X as useFlagsStore,
75
- Z as useHostTools,
76
- ro as useLocalStorage,
77
- to as useLocalStorageWithListener,
78
- so as useModuleDictionary,
79
- mo as useModulePrivileges,
80
- uo as useModuleSkeleton,
81
- po as useNetwork,
82
- vo as usePaginate,
83
- Po as usePropageteMF,
68
+ co as useAuth,
69
+ U as useBase,
70
+ ro as useDomain,
71
+ to as useDomainCountry,
72
+ X as useEnvironment,
73
+ Z as useFlagsPresent,
74
+ _ as useFlagsStore,
75
+ oo as useHostTools,
76
+ so as useLocalStorage,
77
+ io as useLocalStorageWithListener,
78
+ no as useModuleDictionary,
79
+ xo as useModulePrivileges,
80
+ lo as useModuleSkeleton,
81
+ vo as useNetwork,
82
+ Co as usePaginate,
83
+ Do as usePropageteMF,
84
84
  Bo as voidFunction
85
85
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
@@ -1,4 +1,4 @@
1
- export declare type GetLabelType = (key: string) => string;
1
+ export declare type GetLabelType = (key: string, ...args: string[]) => string;
2
2
  export interface ComponentDictionary {
3
3
  [key: string]: string;
4
4
  }
package/types/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export declare type EnvironmentType = {
33
33
  host_api_local: string;
34
34
  host_static_assets: string;
35
35
  environment_assets: string;
36
+ host_api_icons?: string;
36
37
  };
37
38
  export declare type NetworkProps = {
38
39
  method: any;
@@ -1 +1,3 @@
1
- export declare function getPropertyByString(object: any, key: string): string | undefined | any[] | Record<any, any>;
1
+ declare type PropertyType = string | undefined | any[] | Record<any, any>;
2
+ export declare function getPropertyByString<T extends PropertyType = PropertyType>(object: any, key: string, defaultValue?: T): T;
3
+ export {};
@@ -0,0 +1,61 @@
1
+ function u() {
2
+ }
3
+ function g(n, r, e) {
4
+ const o = r.split(".");
5
+ let t = n;
6
+ for (const a of o) {
7
+ const c = a.match(/^(\w+)\[(\w+)\]$/);
8
+ if (c) {
9
+ const s = c[1], i = c[2];
10
+ if (t[s] && Array.isArray(t[s])) {
11
+ if (i === "lastIndex")
12
+ return t[s][t[s].length - 1];
13
+ {
14
+ const l = parseInt(i);
15
+ return t[s][l];
16
+ }
17
+ } else
18
+ return e;
19
+ } else if (t[a] !== void 0)
20
+ t = t[a];
21
+ else
22
+ return e;
23
+ }
24
+ return t;
25
+ }
26
+ function f(n, r) {
27
+ try {
28
+ const o = new Function(...Object.keys(n), `return \`${r}\``)(...Object.values(n));
29
+ return String(o).replace(/`/g, "");
30
+ } catch (e) {
31
+ return console.error(`Error evaluating expression: ${e}`), "";
32
+ }
33
+ }
34
+ function y(n, r) {
35
+ try {
36
+ const e = window.localStorage.getItem(n);
37
+ return e !== null ? typeof r == "string" ? e : JSON.parse(e) : r;
38
+ } catch {
39
+ return r;
40
+ }
41
+ }
42
+ function S(n, r, e = !1) {
43
+ try {
44
+ let o = null;
45
+ if (typeof r == "string") {
46
+ window.localStorage.setItem(n, r);
47
+ return;
48
+ }
49
+ e && (o = window.localStorage.getItem(n));
50
+ let t = o !== null ? JSON.parse(o) : {};
51
+ t = { ...t, ...r }, window.localStorage.setItem(n, JSON.stringify(t));
52
+ } catch {
53
+ }
54
+ }
55
+ export {
56
+ g as a,
57
+ f as e,
58
+ y as g,
59
+ S as s,
60
+ u as v
61
+ };
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,150 +0,0 @@
1
- import { createContext as T, useReducer as y, useEffect as m } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import { u as E } from "../../hooks/useEnvironment/index.25f83176.js";
4
- import "../FlagsContext/index.5b096265.js";
5
- import "zustand";
6
- import { u as v } from "../../hooks/useHostTools/index.66d9a667.js";
7
- import "../DomainContext/index.2ed56159.js";
8
- import { u as D } from "../../hooks/useLocalStorage/index.91bc0791.js";
9
- import "../ModuleDictionaryContext/index.a64207d4.js";
10
- import "../ModulePrivilegesContext/index.79c3cc04.js";
11
- import "../ModuleSkeletonContext/index.f6150fb9.js";
12
- import { u as N } from "../../hooks/useNetwork/index.3d79002b.js";
13
- import "../DomainCountryContext/index.506456a3.js";
14
- import "../EnvironmentContext/index.b33784cd.js";
15
- import "../HostToolsContext/index.499db832.js";
16
- import "../NetworkContext/index.ec7405cd.js";
17
- import { g as O, s as u } from "../../utils/index.2f5ce5aa.js";
18
- import "axios";
19
- import "qs";
20
- import "camelcase-keys";
21
- import "snakecase-keys";
22
- import { E as S } from "../../types/index.42c24946.js";
23
- import { jsx as U } from "react/jsx-runtime";
24
- var o = /* @__PURE__ */ ((t) => (t.Initial = "INITIALIZE", t.Login = "LOGIN", t.Logout = "LOGOUT", t))(o || {});
25
- const w = {
26
- isAuthenticated: !1,
27
- isInitialized: !1,
28
- user: null
29
- }, _ = (t, e) => {
30
- switch (e.type) {
31
- case "INITIALIZE":
32
- return {
33
- isAuthenticated: e.payload.isAuthenticated,
34
- isInitialized: !0,
35
- user: e.payload.user
36
- };
37
- case "LOGIN":
38
- return {
39
- ...t,
40
- isAuthenticated: !0,
41
- user: e.payload.user
42
- };
43
- case "LOGOUT":
44
- return {
45
- ...t,
46
- isAuthenticated: !1,
47
- user: null
48
- };
49
- default:
50
- return t;
51
- }
52
- }, P = T(null);
53
- function x(t) {
54
- t({
55
- type: o.Initial,
56
- payload: {
57
- isAuthenticated: !1,
58
- user: null
59
- }
60
- });
61
- }
62
- function it(t) {
63
- const {
64
- children: e
65
- } = t, [d, r] = y(_, w), {
66
- events_add_listener: p
67
- } = v(), {
68
- networkOperation: n
69
- } = N(), {
70
- domain_token: h
71
- } = E(), [f, l] = D(
72
- "vSession",
73
- new Date().getTime() + ""
74
- );
75
- m(() => {
76
- (async () => {
77
- n({
78
- method: "GET",
79
- endPoint: "auth/login",
80
- parms: {
81
- user_data: !0
82
- },
83
- checkUnAuthorized: !1
84
- }).then((a) => {
85
- r({
86
- type: o.Initial,
87
- payload: {
88
- isAuthenticated: !0,
89
- user: a.user
90
- }
91
- }), O("userData", {
92
- email: a.user.email,
93
- remember: !0
94
- })?.email !== a.user.email && u("userData", {
95
- email: a.user.email
96
- }, !0);
97
- }).catch(() => {
98
- x(r);
99
- });
100
- })();
101
- }, [f]);
102
- const I = async (i, a, s) => {
103
- await n({
104
- endPoint: "auth/login",
105
- method: "POST",
106
- data: {
107
- email: i,
108
- password: a,
109
- domain_token: h
110
- }
111
- }).then((L) => {
112
- const A = L.data;
113
- s ? u("userData", {
114
- email: i,
115
- remember: s
116
- }) : u("userData", {
117
- email: "",
118
- remember: s
119
- }), r({
120
- type: o.Login,
121
- payload: {
122
- user: A
123
- }
124
- }), l(new Date().getTime() + "");
125
- });
126
- }, c = async (i) => {
127
- i && await n({
128
- endPoint: "auth/logout",
129
- method: "POST"
130
- }), r({
131
- type: o.Logout
132
- }), l(new Date().getTime() + "");
133
- }, g = () => {
134
- c(!1);
135
- };
136
- return m(function() {
137
- p(S.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, g);
138
- }, []), /* @__PURE__ */ U(P.Provider, {
139
- value: {
140
- ...d,
141
- login: I,
142
- logout: c
143
- },
144
- children: e
145
- });
146
- }
147
- export {
148
- P as A,
149
- it as a
150
- };
@@ -1,57 +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.b33784cd.js";
4
- import "../FlagsContext/index.5b096265.js";
5
- import "zustand";
6
- import { u as T } from "../../hooks/useHostTools/index.66d9a667.js";
7
- import "../DomainContext/index.2ed56159.js";
8
- import "../ModuleDictionaryContext/index.a64207d4.js";
9
- import "../ModulePrivilegesContext/index.79c3cc04.js";
10
- import "../ModuleSkeletonContext/index.f6150fb9.js";
11
- import "../NetworkContext/index.ec7405cd.js";
12
- import { u as f } from "../../hooks/usePropageteMF/index.c440b829.js";
13
- import "../HostToolsContext/index.499db832.js";
14
- import "../AuthContext/index.db46edbc.js";
15
- import { E as i } from "../../types/index.42c24946.js";
16
- import { jsx as D } from "react/jsx-runtime";
17
- const M = E(null);
18
- function V(n) {
19
- const {
20
- children: m,
21
- isMicroFrontEnd: t,
22
- id: e,
23
- currency: s,
24
- currency_decimal_digits: a,
25
- decimal_symbol: c,
26
- thousands_symbol: p
27
- } = n, {
28
- events_emit: u
29
- } = T(), [_, l] = d({
30
- id: e,
31
- currency: s,
32
- currency_decimal_digits: a,
33
- decimal_symbol: c,
34
- thousands_symbol: p
35
- }), r = (o) => {
36
- l(o);
37
- };
38
- f({
39
- isMicroFrontEnd: t,
40
- event: i.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE,
41
- setHandler: r
42
- });
43
- const C = y((o) => {
44
- t || (r(o), u(i.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE, o));
45
- }, []);
46
- return /* @__PURE__ */ D(M.Provider, {
47
- value: {
48
- ..._,
49
- changeDomainCountry: C
50
- },
51
- children: m
52
- });
53
- }
54
- export {
55
- M as D,
56
- V as a
57
- };
@@ -1,81 +0,0 @@
1
- import { createContext as F, useState as y, useEffect as A, useCallback as m } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import { u as L } from "../../hooks/useEnvironment/index.25f83176.js";
4
- import { u as M } from "../../hooks/useFlagsStore/index.f7c613ac.js";
5
- import { u as N } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.2ed56159.js";
7
- import "../ModulePrivilegesContext/index.79c3cc04.js";
8
- import "../ModuleSkeletonContext/index.f6150fb9.js";
9
- import { u as P } from "../../hooks/useNetwork/index.3d79002b.js";
10
- import "../DomainCountryContext/index.506456a3.js";
11
- import "../EnvironmentContext/index.b33784cd.js";
12
- import "../HostToolsContext/index.499db832.js";
13
- import "../NetworkContext/index.ec7405cd.js";
14
- import "../AuthContext/index.db46edbc.js";
15
- import "../FlagsContext/index.5b096265.js";
16
- import { C as _ } from "../../types/index.42c24946.js";
17
- import { jsx as x } from "react/jsx-runtime";
18
- const E = F(null);
19
- function K(u) {
20
- const {
21
- children: l,
22
- componentsDictionary: c,
23
- moduleId: n,
24
- moduleNameField: s = "module_name",
25
- currentLang: d = "en",
26
- isAuth: a = !0
27
- } = u, p = M((t) => t.flagsActions.addFlag), [r, f] = y(void 0), {
28
- domain_token: g
29
- } = L(), {
30
- startProgress: D,
31
- stopProgress: h
32
- } = N(), {
33
- networkOperation: v
34
- } = P();
35
- A(() => {
36
- let t = !0;
37
- return D(), v({
38
- method: "GET",
39
- endPoint: a ? `dictionaries/${n}` : `na/dictionaries/${n}`,
40
- parms: {
41
- comps: c,
42
- ...a ? {} : {
43
- domain_token: g
44
- }
45
- }
46
- }).then((o) => {
47
- t && (f({
48
- ...o
49
- }), p(_.FLAG_DICTIONARY_LOADED));
50
- }).finally(() => {
51
- h();
52
- }), function() {
53
- t = !1;
54
- };
55
- }, [d]);
56
- const i = m((t) => {
57
- if (r === void 0)
58
- return "";
59
- if (t === "")
60
- return "No key";
61
- let o;
62
- const e = t.split(".");
63
- try {
64
- e.length === 1 && (o = r.data[t]), e.length === 2 && (o = r[e[0]][e[1]]);
65
- } catch {
66
- }
67
- return o || `N_D:[${t}]`;
68
- }, [r]), C = m(() => i(s), [s, i]);
69
- return /* @__PURE__ */ x(E.Provider, {
70
- value: {
71
- moduleDictionary: r,
72
- getLabel: i,
73
- getModuleLabel: C
74
- },
75
- children: l
76
- });
77
- }
78
- export {
79
- E as M,
80
- K as a
81
- };
@@ -1,62 +0,0 @@
1
- import { createContext as c, useState as f, useEffect as d, useCallback as P } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import "../EnvironmentContext/index.b33784cd.js";
4
- import { u as v } from "../../hooks/useFlagsStore/index.f7c613ac.js";
5
- import { u as E } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.2ed56159.js";
7
- import "../ModuleDictionaryContext/index.a64207d4.js";
8
- import "../ModuleSkeletonContext/index.f6150fb9.js";
9
- import { u as h } from "../../hooks/useNetwork/index.3d79002b.js";
10
- import "../DomainCountryContext/index.506456a3.js";
11
- import "../HostToolsContext/index.499db832.js";
12
- import "../NetworkContext/index.ec7405cd.js";
13
- import "../AuthContext/index.db46edbc.js";
14
- import "../FlagsContext/index.5b096265.js";
15
- import { C as s } from "../../types/index.42c24946.js";
16
- import { jsx as F } from "react/jsx-runtime";
17
- const L = c(null);
18
- function b(n) {
19
- const {
20
- children: a,
21
- queryPrivileges: o
22
- } = n, e = v((t) => t.flagsActions.addFlag), [r, l] = f({}), {
23
- startProgress: m,
24
- stopProgress: p
25
- } = E(), {
26
- networkOperation: u
27
- } = h();
28
- d(() => {
29
- let t = !0;
30
- if (o.length === 0) {
31
- e(s.FLAG_PRIVILEGES_LOADED);
32
- return;
33
- }
34
- return m(), u({
35
- method: "GET",
36
- endPoint: "auth/login",
37
- parms: {
38
- privileges: o
39
- }
40
- }).then((i) => {
41
- t && (l({
42
- ...i.data
43
- }), e(s.FLAG_PRIVILEGES_LOADED));
44
- }).finally(() => {
45
- p();
46
- }), function() {
47
- t = !1;
48
- };
49
- }, []);
50
- const g = P((t) => t in r, [r]);
51
- return /* @__PURE__ */ F(L.Provider, {
52
- value: {
53
- hasPrivilege: g,
54
- privileges: r
55
- },
56
- children: a
57
- });
58
- }
59
- export {
60
- L as M,
61
- b as a
62
- };
@@ -1,30 +0,0 @@
1
- import { createContext as i } from "react";
2
- import "../BaseContext/index.f9cdc955.js";
3
- import "../EnvironmentContext/index.b33784cd.js";
4
- import { a as m } from "../../hooks/useFlagsStore/index.f7c613ac.js";
5
- import "../HostToolsContext/index.499db832.js";
6
- import "../DomainContext/index.2ed56159.js";
7
- import "../ModuleDictionaryContext/index.a64207d4.js";
8
- import "../ModulePrivilegesContext/index.79c3cc04.js";
9
- import "../NetworkContext/index.ec7405cd.js";
10
- import "../DomainCountryContext/index.506456a3.js";
11
- import "../AuthContext/index.db46edbc.js";
12
- import "../FlagsContext/index.5b096265.js";
13
- import { jsx as n } from "react/jsx-runtime";
14
- const p = i(null);
15
- function g(o) {
16
- const {
17
- children: t,
18
- flags: r
19
- } = o, e = !m(r);
20
- return /* @__PURE__ */ n(p.Provider, {
21
- value: {
22
- isSkeleton: e
23
- },
24
- children: t
25
- });
26
- }
27
- export {
28
- p as M,
29
- g as a
30
- };
@@ -1,21 +0,0 @@
1
- import { useContext as o } from "react";
2
- import "../../contexts/BaseContext/index.f9cdc955.js";
3
- import "../../contexts/EnvironmentContext/index.b33784cd.js";
4
- import "../../contexts/HostToolsContext/index.499db832.js";
5
- import "../../contexts/NetworkContext/index.ec7405cd.js";
6
- import { A as r } from "../../contexts/AuthContext/index.db46edbc.js";
7
- import "../../contexts/FlagsContext/index.5b096265.js";
8
- import "../../contexts/DomainContext/index.2ed56159.js";
9
- import "../../contexts/ModuleDictionaryContext/index.a64207d4.js";
10
- import "../../contexts/ModulePrivilegesContext/index.79c3cc04.js";
11
- import "../../contexts/ModuleSkeletonContext/index.f6150fb9.js";
12
- import "../../contexts/DomainCountryContext/index.506456a3.js";
13
- const a = () => {
14
- const t = o(r);
15
- if (!t)
16
- throw new Error("Auth context must be use inside AuthProvider");
17
- return t;
18
- };
19
- export {
20
- a as u
21
- };