@ukpc-lib/react 0.12.1-dev.9 → 0.13.1-dev.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/dist/components/index.cjs +9 -9
- package/dist/components/index.js +8 -8
- package/dist/{index.esm2017-D13q7k3i.js → index.esm2017-D3VDEGOb.js} +20 -9
- package/dist/{index.esm2017-DIs_XI9p.cjs → index.esm2017-DtX2uFv9.cjs} +3 -3
- package/dist/share/hooks/index.d.ts +1 -0
- package/dist/share/hooks/useSyncRouter.d.ts +7 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +71 -50
- package/package.json +1 -1
- package/web-components-bundle/access-denied/index.js +2 -2
- package/web-components-bundle/base-breadcrumbs/index.js +2 -2
- package/web-components-bundle/favorite-menu/index.js +4 -4
- package/web-components-bundle/global-menu/index.js +4 -4
- package/web-components-bundle/global-topbar/index.js +6 -6
- package/web-components-bundle/has-permission/index.js +3 -3
- package/web-components-bundle/{index-T58UE-6b.js → index-B2-j-GrO.js} +1 -1
- package/web-components-bundle/{index-BziS9Had.js → index-B8-7QZsi.js} +593 -593
- package/web-components-bundle/{index-BSe1av43.js → index-Cx0zTfOC.js} +1 -1
- package/web-components-bundle/{index-DSZn86FM.js → index-DkWIzRN3.js} +29 -18
- package/web-components-bundle/page-not-found/index.js +2 -2
- package/web-components-bundle/{react-to-web-component-CXwKHjZr.js → react-to-web-component-D7SoYMky.js} +1535 -1527
- package/web-components-bundle/{react-toastify.esm-CrTD7cpE.js → react-toastify.esm-Y1WvK90L.js} +1 -1
- package/web-components-bundle/toast-config/index.js +2 -2
- package/web-components-bundle/toast-config-notification/index.js +2 -2
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-DtX2uFv9.cjs"),h=require("axios"),a=require("react"),u=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const l=o=>{const[s,t]=a.useState([]);return a.useEffect(()=>{h.get(`${o}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>t(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[o]),s},m=()=>{const o=u.useNavigate(),s=u.useLocation();if(a.useEffect(()=>{const t={changeRoute:e=>{typeof e=="string"&&s.pathname+s.search+s.hash!==e&&o(e)}};window.MicrofeBridge=t},[o,s]),a.useEffect(()=>{var e,n;const t=s.pathname+s.search+s.hash;(n=(e=window.parent)==null?void 0:e.HostBridge)==null||n.childRouteChange(t)},[s]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}},c=o=>(s,t)=>{const e=l(o);return t?s.every(n=>e==null?void 0:e.includes(n)):s.some(n=>e==null?void 0:e.includes(n))},g=({baseUrl:o,accessWith:s,requireAll:t,children:e})=>c(o)(s,t)?i.jsx(i.Fragment,{children:e}):null,d=({accessWith:o,requireAll:s,baseUrl:t,unAuthorizedPath:e,children:n})=>c(t)(o,s)?i.jsx(i.Fragment,{children:n}):i.jsx(u.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.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=g;exports.PermissionRoute=d;exports.getUseHasPermission=c;exports.useGetPermission=l;exports.useSyncRouter=m;
|
package/dist/share/index.js
CHANGED
|
@@ -1,61 +1,82 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import
|
|
3
|
-
import { useState as m, useEffect as
|
|
4
|
-
import {
|
|
1
|
+
import { M as E, N as M, O as N, a0 as B, Y as G, a as H, c as $, Z as F, U as I, R as O, T as j, V as L, v as U, $ as V, t as X, W as Y, b as Z, u as _, g as b, X as k } from "../index.esm2017-D3VDEGOb.js";
|
|
2
|
+
import c from "axios";
|
|
3
|
+
import { useState as m, useEffect as n } from "react";
|
|
4
|
+
import { useNavigate as h, useLocation as l, Navigate as g } from "react-router-dom";
|
|
5
|
+
import { jsx as a, Fragment as i } from "react/jsx-runtime";
|
|
5
6
|
import "@r2wc/react-to-web-component";
|
|
6
|
-
import { Navigate as l } from "react-router-dom";
|
|
7
7
|
import "@mui/material";
|
|
8
|
-
const
|
|
9
|
-
const [
|
|
10
|
-
return
|
|
11
|
-
|
|
8
|
+
const p = (o) => {
|
|
9
|
+
const [s, t] = m([]);
|
|
10
|
+
return n(() => {
|
|
11
|
+
c.get(`${o}/user-management/api/v1/users/my-account/permissions`, {
|
|
12
12
|
withCredentials: !0
|
|
13
|
-
}).then((
|
|
14
|
-
console.error("Getting user permission error:",
|
|
13
|
+
}).then((e) => t(e.data)).catch((e) => {
|
|
14
|
+
console.error("Getting user permission error:", e);
|
|
15
15
|
});
|
|
16
|
-
}, [
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
}, [o]), s;
|
|
17
|
+
}, T = () => {
|
|
18
|
+
const o = h(), s = l();
|
|
19
|
+
if (n(() => {
|
|
20
|
+
const t = {
|
|
21
|
+
changeRoute: (e) => {
|
|
22
|
+
typeof e == "string" && s.pathname + s.search + s.hash !== e && o(e);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
window.MicrofeBridge = t;
|
|
26
|
+
}, [o, s]), n(() => {
|
|
27
|
+
var e, r;
|
|
28
|
+
const t = s.pathname + s.search + s.hash;
|
|
29
|
+
(r = (e = window.parent) == null ? void 0 : e.HostBridge) == null || r.childRouteChange(t);
|
|
30
|
+
}, [s]), window.self === window.top) {
|
|
31
|
+
console.log("useSyncRouter: Navigate to /app path"), window.location.href = window.location.href.replace(
|
|
32
|
+
window.origin,
|
|
33
|
+
`${window.origin}/app`
|
|
34
|
+
);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}, u = (o) => (s, t) => {
|
|
38
|
+
const e = p(o);
|
|
39
|
+
return t ? s.every(
|
|
40
|
+
(r) => e == null ? void 0 : e.includes(r)
|
|
41
|
+
) : s.some(
|
|
42
|
+
(r) => e == null ? void 0 : e.includes(r)
|
|
23
43
|
);
|
|
24
|
-
},
|
|
25
|
-
baseUrl:
|
|
26
|
-
accessWith:
|
|
44
|
+
}, C = ({
|
|
45
|
+
baseUrl: o,
|
|
46
|
+
accessWith: s,
|
|
27
47
|
requireAll: t,
|
|
28
|
-
children:
|
|
29
|
-
}) =>
|
|
30
|
-
accessWith:
|
|
31
|
-
requireAll:
|
|
48
|
+
children: e
|
|
49
|
+
}) => u(o)(s, t) ? /* @__PURE__ */ a(i, { children: e }) : null, S = ({
|
|
50
|
+
accessWith: o,
|
|
51
|
+
requireAll: s,
|
|
32
52
|
baseUrl: t,
|
|
33
|
-
unAuthorizedPath:
|
|
34
|
-
children:
|
|
35
|
-
}) =>
|
|
53
|
+
unAuthorizedPath: e,
|
|
54
|
+
children: r
|
|
55
|
+
}) => u(t)(o, s) ? /* @__PURE__ */ a(i, { children: r }) : /* @__PURE__ */ a(g, { to: e, replace: !0 });
|
|
36
56
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
E as AuthContext,
|
|
58
|
+
M as AuthProvider,
|
|
59
|
+
N as ERROR_MESSAGE,
|
|
60
|
+
C as HasPermission,
|
|
61
|
+
S as PermissionRoute,
|
|
62
|
+
B as SaasThemeProvider,
|
|
63
|
+
G as TranslationProvider,
|
|
44
64
|
H as axiosInstance,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
$ as color,
|
|
66
|
+
F as createCustomTheme,
|
|
67
|
+
u as getUseHasPermission,
|
|
68
|
+
I as handleErrorAxios,
|
|
49
69
|
O as login,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
b as
|
|
70
|
+
j as logout,
|
|
71
|
+
L as responseInterceptor,
|
|
72
|
+
U as search,
|
|
73
|
+
V as setFavicon,
|
|
74
|
+
X as translate,
|
|
75
|
+
Y as translationConfig,
|
|
76
|
+
Z as useAuth,
|
|
77
|
+
_ as useCustomTranslation,
|
|
78
|
+
p as useGetPermission,
|
|
79
|
+
T as useSyncRouter,
|
|
80
|
+
b as useTheme,
|
|
81
|
+
k as useTranslation
|
|
61
82
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { F as i, u as m } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
1
|
+
import "../react-to-web-component-D7SoYMky.js";
|
|
2
|
+
import { F as i, u as m } from "../index-DkWIzRN3.js";
|
|
3
|
+
import "../index-Cx0zTfOC.js";
|
|
4
|
+
import "../index-B8-7QZsi.js";
|
|
5
5
|
export {
|
|
6
6
|
i as FavoriteMenu,
|
|
7
7
|
m as updateFavoriteItems
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { G as i } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
1
|
+
import "../react-to-web-component-D7SoYMky.js";
|
|
2
|
+
import { G as i } from "../index-DkWIzRN3.js";
|
|
3
|
+
import "../index-Cx0zTfOC.js";
|
|
4
|
+
import "../index-B8-7QZsi.js";
|
|
5
5
|
export {
|
|
6
6
|
i as GlobalMenu
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { L as n, T as s } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../index-
|
|
6
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-D7SoYMky.js";
|
|
2
|
+
import { L as n, T as s } from "../index-DkWIzRN3.js";
|
|
3
|
+
import "../index-Cx0zTfOC.js";
|
|
4
|
+
import "../index-B2-j-GrO.js";
|
|
5
|
+
import "../index-B8-7QZsi.js";
|
|
6
|
+
import "../react-toastify.esm-Y1WvK90L.js";
|
|
7
7
|
import "../toast-config/index.js";
|
|
8
8
|
import "../toast-config-notification/index.js";
|
|
9
9
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { H as e, g as m } from "../index-
|
|
3
|
-
import "../index-
|
|
1
|
+
import "../react-to-web-component-D7SoYMky.js";
|
|
2
|
+
import { H as e, g as m } from "../index-DkWIzRN3.js";
|
|
3
|
+
import "../index-B8-7QZsi.js";
|
|
4
4
|
export {
|
|
5
5
|
e as HasPermission,
|
|
6
6
|
m as getUseHasPermission
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as $, c as ce, g as Jt, s as Xt, j as E } from "./react-to-web-component-
|
|
1
|
+
import { r as $, c as ce, g as Jt, s as Xt, j as E } from "./react-to-web-component-D7SoYMky.js";
|
|
2
2
|
import { _ as Wt, a as Y } from "./setPrototypeOf-BVKdEITT.js";
|
|
3
3
|
function Gt(i, e) {
|
|
4
4
|
for (var t = 0; t < e.length; t++) {
|