@ukpc-lib/react 0.15.9-sandbox.saas-9249.patch-2 → 0.15.9-sandbox.saas-9249.patch-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/FavoriteMenu/components/MenuItem.d.ts +1 -1
- package/dist/components/GlobalMenu/components/MenuItem.d.ts +1 -1
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.js +3 -3
- package/dist/{index.esm2017-Cf6UE-oR.cjs → index.esm2017-qAWyt7zI.cjs} +86 -86
- package/dist/{index.esm2017-9tpsSc5M.js → index.esm2017-tcuviKS1.js} +4729 -4696
- package/dist/share/hooks/useSyncRouter.d.ts +1 -1
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +66 -85
- 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-DmIpBR3b.js → index-CkNwqMnZ.js} +1366 -1333
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index.esm2017-qAWyt7zI.cjs"),m=require("axios"),u=require("react"),c=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const h=o=>{const[n,s]=u.useState([]);return u.useEffect(()=>{m.get(`${o}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>s(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[o]),n},d=(o="/app")=>{const n=c.useNavigate(),s=c.useLocation();u.useEffect(()=>(window.hostNavigate=(e,t)=>{const a=s.pathname+s.search+s.hash;e!==a&&n(e,{replace:(t==null?void 0:t.replace)??!0})},()=>{delete window.hostNavigate}),[n,s]),u.useEffect(()=>{var t,a;const e=s.pathname+s.search+s.hash;(a=(t=window.top)==null?void 0:t.shellNavigate)==null||a.call(t,o+e,{replace:!0})},[s,o])};function g({open:o,disabled:n}){u.useMemo(()=>{var s,e,t,a;n||(o?(e=(s=window.top)==null?void 0:s.HostBridge)==null||e.openBackdrop(!0):(a=(t=window.top)==null?void 0:t.HostBridge)==null||a.openBackdrop(!1))},[o,n])}const l=o=>(n,s)=>{const e=h(o);return s?n.every(t=>e==null?void 0:e.includes(t)):n.some(t=>e==null?void 0:e.includes(t))},P=({baseUrl:o,accessWith:n,requireAll:s,children:e})=>l(o)(n,s)?i.jsx(i.Fragment,{children:e}):null,p=({accessWith:o,requireAll:n,baseUrl:s,unAuthorizedPath:e,children:t})=>l(s)(o,n)?i.jsx(i.Fragment,{children:t}):i.jsx(c.Navigate,{to:e,replace:!0});exports.AuthContext=r.AuthContext;exports.AuthProvider=r.AuthProvider;exports.ERROR_MESSAGE=r.ERROR_MESSAGE;exports.SaasThemeProvider=r.SaasThemeProvider;exports.TranslationProvider=r.TranslationProvider;exports.axiosInstance=r.axiosInstance;exports.color=r.color;exports.createCustomTheme=r.createCustomTheme;exports.handleErrorAxios=r.handleErrorAxios;exports.login=r.login;exports.logout=r.logout;exports.responseInterceptor=r.responseInterceptor;exports.search=r.search;exports.setFavicon=r.setFavicon;exports.setShellBackdrop=r.setShellBackdrop;exports.translate=r.translate;exports.translationConfig=r.translationConfig;exports.useAuth=r.useAuth;exports.useCustomTranslation=r.useCustomTranslation;exports.useTheme=r.useTheme;exports.useTranslation=r.useTranslation$1;exports.HasPermission=P;exports.PermissionRoute=p;exports.getUseHasPermission=l;exports.useGetPermission=h;exports.useSyncBackdrop=g;exports.useSyncRouter=d;
|
package/dist/share/index.js
CHANGED
|
@@ -1,105 +1,86 @@
|
|
|
1
|
-
import { O as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useNavigate as
|
|
5
|
-
import { jsx as
|
|
1
|
+
import { O as k, R as y, T as H, a2 as G, $ as F, a as I, c as M, a0 as O, W as $, U as j, V as L, X as U, w as V, a1 as X, s as Y, t as Z, Y as _, e as q, u as z, i as D, Z as J } from "../index.esm2017-tcuviKS1.js";
|
|
2
|
+
import m from "axios";
|
|
3
|
+
import { useState as l, useEffect as n, useMemo as h } from "react";
|
|
4
|
+
import { useNavigate as p, useLocation as d, Navigate as f } from "react-router-dom";
|
|
5
|
+
import { jsx as i, Fragment as u } from "react/jsx-runtime";
|
|
6
6
|
import "@r2wc/react-to-web-component";
|
|
7
7
|
import "@mui/material";
|
|
8
|
-
const
|
|
9
|
-
const [
|
|
10
|
-
return
|
|
11
|
-
|
|
8
|
+
const g = (r) => {
|
|
9
|
+
const [a, s] = l([]);
|
|
10
|
+
return n(() => {
|
|
11
|
+
m.get(`${r}/user-management/api/v1/users/my-account/permissions`, {
|
|
12
12
|
withCredentials: !0
|
|
13
|
-
}).then((
|
|
14
|
-
console.error("Getting user permission error:",
|
|
13
|
+
}).then((e) => s(e.data)).catch((e) => {
|
|
14
|
+
console.error("Getting user permission error:", e);
|
|
15
15
|
});
|
|
16
|
-
}, [
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
t
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const e =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (typeof r == "string" && a !== r) {
|
|
30
|
-
console.log(" useSyncRouter.tsx ~ location2:", a, r);
|
|
31
|
-
const m = s && r.startsWith(s) ? r.substring(s.length) : r;
|
|
32
|
-
n(m);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
window.MicrofeBridge = e;
|
|
37
|
-
}, [n, t]), i(() => {
|
|
38
|
-
var r, a;
|
|
39
|
-
const e = o();
|
|
40
|
-
console.log("fullPath1", window.location.pathname, e), (a = (r = window.parent) == null ? void 0 : r.HostBridge) == null || a.childRouteChange(e);
|
|
41
|
-
}, [t]), window.self === window.top) {
|
|
42
|
-
console.log("useSyncRouter: Navigate to /app path"), window.location.href = window.location.href.replace(
|
|
43
|
-
window.origin,
|
|
44
|
-
`${window.origin}/app`
|
|
45
|
-
);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
16
|
+
}, [r]), a;
|
|
17
|
+
}, B = (r = "/app") => {
|
|
18
|
+
const a = p(), s = d();
|
|
19
|
+
n(() => (window.hostNavigate = (e, t) => {
|
|
20
|
+
const o = s.pathname + s.search + s.hash;
|
|
21
|
+
e !== o && a(e, { replace: (t == null ? void 0 : t.replace) ?? !0 });
|
|
22
|
+
}, () => {
|
|
23
|
+
delete window.hostNavigate;
|
|
24
|
+
}), [a, s]), n(() => {
|
|
25
|
+
var t, o;
|
|
26
|
+
const e = s.pathname + s.search + s.hash;
|
|
27
|
+
(o = (t = window.top) == null ? void 0 : t.shellNavigate) == null || o.call(t, r + e, { replace: !0 });
|
|
28
|
+
}, [s, r]);
|
|
48
29
|
};
|
|
49
|
-
function
|
|
50
|
-
open:
|
|
51
|
-
disabled:
|
|
30
|
+
function R({
|
|
31
|
+
open: r,
|
|
32
|
+
disabled: a
|
|
52
33
|
}) {
|
|
53
34
|
h(() => {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
}, [
|
|
35
|
+
var s, e, t, o;
|
|
36
|
+
a || (r ? (e = (s = window.top) == null ? void 0 : s.HostBridge) == null || e.openBackdrop(!0) : (o = (t = window.top) == null ? void 0 : t.HostBridge) == null || o.openBackdrop(!1));
|
|
37
|
+
}, [r, a]);
|
|
57
38
|
}
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
(
|
|
62
|
-
) :
|
|
63
|
-
(
|
|
39
|
+
const c = (r) => (a, s) => {
|
|
40
|
+
const e = g(r);
|
|
41
|
+
return s ? a.every(
|
|
42
|
+
(t) => e == null ? void 0 : e.includes(t)
|
|
43
|
+
) : a.some(
|
|
44
|
+
(t) => e == null ? void 0 : e.includes(t)
|
|
64
45
|
);
|
|
65
46
|
}, A = ({
|
|
66
|
-
baseUrl:
|
|
67
|
-
accessWith:
|
|
68
|
-
requireAll:
|
|
69
|
-
children: o
|
|
70
|
-
}) => l(s)(n, t) ? /* @__PURE__ */ c(u, { children: o }) : null, E = ({
|
|
71
|
-
accessWith: s,
|
|
72
|
-
requireAll: n,
|
|
73
|
-
baseUrl: t,
|
|
74
|
-
unAuthorizedPath: o,
|
|
47
|
+
baseUrl: r,
|
|
48
|
+
accessWith: a,
|
|
49
|
+
requireAll: s,
|
|
75
50
|
children: e
|
|
76
|
-
}) =>
|
|
51
|
+
}) => c(r)(a, s) ? /* @__PURE__ */ i(u, { children: e }) : null, C = ({
|
|
52
|
+
accessWith: r,
|
|
53
|
+
requireAll: a,
|
|
54
|
+
baseUrl: s,
|
|
55
|
+
unAuthorizedPath: e,
|
|
56
|
+
children: t
|
|
57
|
+
}) => c(s)(r, a) ? /* @__PURE__ */ i(u, { children: t }) : /* @__PURE__ */ i(f, { to: e, replace: !0 });
|
|
77
58
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
k as AuthContext,
|
|
60
|
+
y as AuthProvider,
|
|
61
|
+
H as ERROR_MESSAGE,
|
|
81
62
|
A as HasPermission,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
C as PermissionRoute,
|
|
64
|
+
G as SaasThemeProvider,
|
|
65
|
+
F as TranslationProvider,
|
|
85
66
|
I as axiosInstance,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
67
|
+
M as color,
|
|
68
|
+
O as createCustomTheme,
|
|
69
|
+
c as getUseHasPermission,
|
|
70
|
+
$ as handleErrorAxios,
|
|
71
|
+
j as login,
|
|
72
|
+
L as logout,
|
|
73
|
+
U as responseInterceptor,
|
|
74
|
+
V as search,
|
|
94
75
|
X as setFavicon,
|
|
95
76
|
Y as setShellBackdrop,
|
|
96
77
|
Z as translate,
|
|
97
78
|
_ as translationConfig,
|
|
98
79
|
q as useAuth,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
80
|
+
z as useCustomTranslation,
|
|
81
|
+
g as useGetPermission,
|
|
82
|
+
R as useSyncBackdrop,
|
|
83
|
+
B as useSyncRouter,
|
|
84
|
+
D as useTheme,
|
|
85
|
+
J as useTranslation
|
|
105
86
|
};
|
package/package.json
CHANGED