@ukpc-lib/react 0.9.2 → 0.9.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.
- package/dist/components/index.cjs +21 -21
- package/dist/components/index.js +154 -154
- package/dist/{index.module-0c3c857a.cjs → index.module-51819053.cjs} +115 -115
- package/dist/{index.module-04bdd843.js → index.module-e5200164.js} +6691 -6808
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.d.ts +0 -1
- package/dist/share/index.js +21 -22
- package/package.json +1 -1
- package/web-components-bundle/favorite-menu/index.js +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-1feb4da1.js → index-2d1e02cf.js} +11425 -11544
- package/dist/share/error-logs/ErrorBoundary.d.ts +0 -9
- package/dist/share/error-logs/axiosErrorHandler.d.ts +0 -1
- package/dist/share/error-logs/globalErrorHandler.d.ts +0 -6
- package/dist/share/error-logs/index.d.ts +0 -13
- package/dist/share/error-logs/logToLoki.d.ts +0 -22
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-51819053.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=c(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
|
package/dist/share/index.d.ts
CHANGED
package/dist/share/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as R, N as S, O as G,
|
|
1
|
+
import { M as R, N as S, O as G, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-e5200164.js";
|
|
2
2
|
import u from "axios";
|
|
3
3
|
import { useState as m, useEffect as c } from "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as a, Fragment as n } from "react/jsx-runtime";
|
|
5
5
|
import "@r2wc/react-to-web-component";
|
|
6
6
|
import { Navigate as l } from "react-router-dom";
|
|
7
7
|
import "@mui/material";
|
|
@@ -17,46 +17,45 @@ const h = (e) => {
|
|
|
17
17
|
}, i = (e) => (r, t) => {
|
|
18
18
|
const s = h(e);
|
|
19
19
|
return t ? r.every(
|
|
20
|
-
(
|
|
20
|
+
(o) => s == null ? void 0 : s.includes(o)
|
|
21
21
|
) : r.some(
|
|
22
|
-
(
|
|
22
|
+
(o) => s == null ? void 0 : s.includes(o)
|
|
23
23
|
);
|
|
24
24
|
}, T = ({
|
|
25
25
|
baseUrl: e,
|
|
26
26
|
accessWith: r,
|
|
27
27
|
requireAll: t,
|
|
28
28
|
children: s
|
|
29
|
-
}) => i(e)(r, t) ? /* @__PURE__ */
|
|
29
|
+
}) => i(e)(r, t) ? /* @__PURE__ */ a(n, { children: s }) : null, A = ({
|
|
30
30
|
accessWith: e,
|
|
31
31
|
requireAll: r,
|
|
32
32
|
baseUrl: t,
|
|
33
33
|
unAuthorizedPath: s,
|
|
34
|
-
children:
|
|
35
|
-
}) => i(t)(e, r) ? /* @__PURE__ */
|
|
34
|
+
children: o
|
|
35
|
+
}) => i(t)(e, r) ? /* @__PURE__ */ a(n, { children: o }) : /* @__PURE__ */ a(l, { to: s, replace: !0 });
|
|
36
36
|
export {
|
|
37
37
|
R as AuthContext,
|
|
38
38
|
S as AuthProvider,
|
|
39
39
|
G as ERROR_MESSAGE,
|
|
40
|
-
M as ErrorManager,
|
|
41
40
|
T as HasPermission,
|
|
42
|
-
|
|
41
|
+
A as PermissionRoute,
|
|
43
42
|
y as SaasThemeProvider,
|
|
44
43
|
F as TranslationProvider,
|
|
45
44
|
H as axiosInstance,
|
|
46
45
|
I as color,
|
|
47
|
-
|
|
46
|
+
M as createCustomTheme,
|
|
48
47
|
i as getUseHasPermission,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
N as handleErrorAxios,
|
|
49
|
+
O as login,
|
|
50
|
+
$ as logout,
|
|
51
|
+
j as responseInterceptor,
|
|
52
|
+
w as search,
|
|
53
|
+
U as setFavicon,
|
|
54
|
+
V as translate,
|
|
55
|
+
X as translationConfig,
|
|
56
|
+
Y as useAuth,
|
|
57
|
+
Z as useCustomTranslation,
|
|
59
58
|
h as useGetPermission,
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
_ as useTheme,
|
|
60
|
+
b as useTranslation
|
|
62
61
|
};
|
package/package.json
CHANGED