@ukpc-lib/react 0.8.5 → 0.8.7
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/FavoriteMenu/index.d.ts +1 -0
- package/dist/components/index.cjs +29 -31
- package/dist/components/index.js +2170 -2478
- package/dist/index.module-dfee87ba.cjs +1100 -0
- package/dist/{index.module-054b4163.js → index.module-efc61dc4.js} +14019 -13701
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +22 -22
- package/package.json +1 -1
- package/web-components-bundle/favorite-menu/index.js +3 -2
- 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-70f8381f.js → index-ad1128d7.js} +4033 -4020
- package/dist/index.module-24a2eb1c.cjs +0 -1098
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-dfee87ba.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=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,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.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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as R, O as S, R as G, a1 as y, $ as H, a as I, c as N, a0 as O, V as $, T as j, U as w, W as F, t as M, Y as U, X as V, b as X, u as Y, g as Z, Z as _ } from "../index.module-efc61dc4.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,44 +17,44 @@ 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
|
+
}, v = ({
|
|
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
|
-
|
|
40
|
+
v as HasPermission,
|
|
41
41
|
A as PermissionRoute,
|
|
42
42
|
y as SaasThemeProvider,
|
|
43
43
|
H as TranslationProvider,
|
|
44
44
|
I as axiosInstance,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
N as color,
|
|
46
|
+
O as createCustomTheme,
|
|
47
47
|
i as getUseHasPermission,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
$ as handleErrorAxios,
|
|
49
|
+
j as login,
|
|
50
|
+
w as logout,
|
|
51
|
+
F as responseInterceptor,
|
|
52
|
+
M as search,
|
|
53
|
+
U as translate,
|
|
54
|
+
V as translationConfig,
|
|
55
|
+
X as useAuth,
|
|
56
|
+
Y as useCustomTranslation,
|
|
57
57
|
h as useGetPermission,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
Z as useTheme,
|
|
59
|
+
_ as useTranslation
|
|
60
60
|
};
|
package/package.json
CHANGED