@ukpc-lib/react 0.16.3-dev.7 → 0.16.3-sandbox.saas-9356.patch-1
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 -2
- package/dist/components/GlobalMenu/components/MenuItem.d.ts +0 -1
- package/dist/components/GlobalMenu/helpers/index.d.ts +1 -3
- package/dist/components/index.cjs +16 -16
- package/dist/components/index.js +1816 -1726
- package/dist/{index.esm2017-CXxDim8P.cjs → index.esm2017-BCDQhSLR.cjs} +115 -115
- package/dist/{index.esm2017-CMDbs_nd.js → index.esm2017-DzNnUDWP.js} +9389 -9445
- package/dist/share/TranslationProvider/index.d.ts +1 -1
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +79 -85
- package/dist/share/permissions/HasPermission.d.ts +1 -1
- package/dist/share/permissions/PermissionRoute.d.ts +2 -1
- package/dist/translations/config.d.ts +7 -1
- package/package.json +1 -1
- package/web-components-bundle/access-denied/index.js +2 -6
- package/web-components-bundle/favorite-menu/index.js +3 -6
- 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 +4 -3
- package/web-components-bundle/{index-4NtySNi1.js → index-BNvYaqXI.js} +4858 -4822
|
@@ -6,6 +6,6 @@ export declare const useCustomTranslation: () => {
|
|
|
6
6
|
setLanguage: import('react').Dispatch<import('react').SetStateAction<Language | undefined>>;
|
|
7
7
|
};
|
|
8
8
|
export declare const translationConfig: import('i18next').i18n;
|
|
9
|
-
export declare const translate:
|
|
9
|
+
export declare const translate: (key: string, options?: any) => never;
|
|
10
10
|
export declare const useTranslation: () => import('react-i18next').UseTranslationResponse<import('i18next').Namespace, undefined>;
|
|
11
11
|
export declare const TranslationProvider: FC<PropsWithChildren>;
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-BCDQhSLR.cjs"),h=require("axios"),c=require("react"),l=require("react-router-dom"),u=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const m=n=>{const[s,r]=c.useState([]);return c.useEffect(()=>{h.get(`${n}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(o=>r(o.data)).catch(o=>{console.error("Getting user permission error:",o)})},[n]),s},f=n=>{const s=l.useNavigate(),r=l.useLocation();console.log(" useSyncRouter.tsx ~ location1:",r,window.location.pathname);const o=(t=r)=>(n||"")+t.pathname+t.search+t.hash;if(c.useEffect(()=>{const t={changeRoute:i=>{const a=o();if(typeof i=="string"&&a!==i){console.log(" useSyncRouter.tsx ~ location2:",a,i);const g=n&&i.startsWith(n)?i.substring(n.length):i;s(g)}}};window.MicrofeBridge=t},[s,r]),c.useEffect(()=>{var i,a;const t=o();console.log("fullPath1",window.location.pathname,t),(a=(i=window.parent)==null?void 0:i.HostBridge)==null||a.childRouteChange(t)},[r]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}};function w({open:n,disabled:s}){c.useMemo(()=>{var r,o,t,i;s||(n?(o=(r=window.top)==null?void 0:r.HostBridge)==null||o.openBackdrop(!0):(i=(t=window.top)==null?void 0:t.HostBridge)==null||i.openBackdrop(!1))},[n,s])}const d=n=>(s,r)=>{const o=m(n);return r?s.every(t=>o==null?void 0:o.includes(t)):s.some(t=>o==null?void 0:o.includes(t))},P=({baseUrl:n,accessWith:s,requireAll:r,children:o})=>d(n)(s,r)?u.jsx(u.Fragment,{children:o}):null,p=({accessWith:n,requireAll:s,baseUrl:r,unAuthorizedPath:o,children:t})=>d(r)(n,s)?u.jsx(u.Fragment,{children:t}):u.jsx(l.Navigate,{to:o,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.setShellBackdrop=e.setShellBackdrop;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=P;exports.PermissionRoute=p;exports.getUseHasPermission=d;exports.useGetPermission=m;exports.useSyncBackdrop=w;exports.useSyncRouter=f;
|
package/dist/share/index.js
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as u, Fragment as c } from "react/jsx-runtime";
|
|
1
|
+
import { O as F, R as M, T as G, a2 as N, $, a as I, c as O, a0 as j, W as z, U as L, V as U, X as V, w as W, a1 as X, s as Y, t as Z, Y as _, e as q, u as D, i as J, Z as K } from "../index.esm2017-DzNnUDWP.js";
|
|
2
|
+
import d from "axios";
|
|
3
|
+
import { useState as g, useEffect as i, useMemo as h } from "react";
|
|
4
|
+
import { useNavigate as w, useLocation as f, Navigate as p } from "react-router-dom";
|
|
5
|
+
import { jsx as c, Fragment as u } from "react/jsx-runtime";
|
|
7
6
|
import "@r2wc/react-to-web-component";
|
|
8
7
|
import "@mui/material";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const [r, s] = f([]);
|
|
14
|
-
return a(() => {
|
|
15
|
-
p.get(`${e}/user-management/api/v1/users/my-account/permissions`, {
|
|
8
|
+
const P = (s) => {
|
|
9
|
+
const [n, t] = g([]);
|
|
10
|
+
return i(() => {
|
|
11
|
+
d.get(`${s}/user-management/api/v1/users/my-account/permissions`, {
|
|
16
12
|
withCredentials: !0
|
|
17
|
-
}).then((
|
|
18
|
-
console.error("Getting user permission error:",
|
|
13
|
+
}).then((o) => t(o.data)).catch((o) => {
|
|
14
|
+
console.error("Getting user permission error:", o);
|
|
19
15
|
});
|
|
20
|
-
}, [
|
|
21
|
-
},
|
|
22
|
-
const
|
|
16
|
+
}, [s]), n;
|
|
17
|
+
}, T = (s) => {
|
|
18
|
+
const n = w(), t = f();
|
|
23
19
|
console.log(
|
|
24
20
|
" useSyncRouter.tsx ~ location1:",
|
|
25
|
-
|
|
21
|
+
t,
|
|
26
22
|
window.location.pathname
|
|
27
23
|
);
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
changeRoute: (
|
|
32
|
-
const
|
|
33
|
-
if (typeof
|
|
34
|
-
console.log(" useSyncRouter.tsx ~ location2:",
|
|
35
|
-
const m =
|
|
36
|
-
|
|
24
|
+
const o = (e = t) => (s || "") + e.pathname + e.search + e.hash;
|
|
25
|
+
if (i(() => {
|
|
26
|
+
const e = {
|
|
27
|
+
changeRoute: (r) => {
|
|
28
|
+
const a = o();
|
|
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);
|
|
37
33
|
}
|
|
38
34
|
}
|
|
39
35
|
};
|
|
40
|
-
window.MicrofeBridge =
|
|
41
|
-
}, [
|
|
42
|
-
var
|
|
43
|
-
const
|
|
44
|
-
console.log("fullPath1", window.location.pathname,
|
|
45
|
-
}, [
|
|
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) {
|
|
46
42
|
console.log("useSyncRouter: Navigate to /app path"), window.location.href = window.location.href.replace(
|
|
47
43
|
window.origin,
|
|
48
44
|
`${window.origin}/app`
|
|
@@ -50,62 +46,60 @@ const H = (e) => {
|
|
|
50
46
|
return;
|
|
51
47
|
}
|
|
52
48
|
};
|
|
53
|
-
function
|
|
54
|
-
open:
|
|
55
|
-
disabled:
|
|
49
|
+
function C({
|
|
50
|
+
open: s,
|
|
51
|
+
disabled: n
|
|
56
52
|
}) {
|
|
57
53
|
h(() => {
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
}, [
|
|
54
|
+
var t, o, e, r;
|
|
55
|
+
n || (s ? (o = (t = window.top) == null ? void 0 : t.HostBridge) == null || o.openBackdrop(!0) : (r = (e = window.top) == null ? void 0 : e.HostBridge) == null || r.openBackdrop(!1));
|
|
56
|
+
}, [s, n]);
|
|
61
57
|
}
|
|
62
|
-
const l = (
|
|
63
|
-
const o =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(i) => o == null ? void 0 : o.includes(i)
|
|
71
|
-
) : !1;
|
|
72
|
-
}, F = ({
|
|
73
|
-
baseUrl: e,
|
|
74
|
-
accessWith: r,
|
|
75
|
-
requireAll: s,
|
|
76
|
-
children: t
|
|
77
|
-
}) => l(e)(r, s) ? /* @__PURE__ */ u(c, { children: t }) : null, G = ({
|
|
78
|
-
accessWith: e,
|
|
79
|
-
requireAll: r,
|
|
58
|
+
const l = (s) => (n, t) => {
|
|
59
|
+
const o = P(s);
|
|
60
|
+
return t ? n.every(
|
|
61
|
+
(e) => o == null ? void 0 : o.includes(e)
|
|
62
|
+
) : n.some(
|
|
63
|
+
(e) => o == null ? void 0 : o.includes(e)
|
|
64
|
+
);
|
|
65
|
+
}, A = ({
|
|
80
66
|
baseUrl: s,
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
accessWith: n,
|
|
68
|
+
requireAll: t,
|
|
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,
|
|
75
|
+
children: e
|
|
76
|
+
}) => l(t)(s, n) ? /* @__PURE__ */ c(u, { children: e }) : /* @__PURE__ */ c(p, { to: o, replace: !0 });
|
|
83
77
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
F as AuthContext,
|
|
79
|
+
M as AuthProvider,
|
|
80
|
+
G as ERROR_MESSAGE,
|
|
81
|
+
A as HasPermission,
|
|
82
|
+
E as PermissionRoute,
|
|
89
83
|
N as SaasThemeProvider,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
$ as TranslationProvider,
|
|
85
|
+
I as axiosInstance,
|
|
86
|
+
O as color,
|
|
87
|
+
j as createCustomTheme,
|
|
94
88
|
l as getUseHasPermission,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
89
|
+
z as handleErrorAxios,
|
|
90
|
+
L as login,
|
|
91
|
+
U as logout,
|
|
92
|
+
V as responseInterceptor,
|
|
93
|
+
W as search,
|
|
94
|
+
X as setFavicon,
|
|
95
|
+
Y as setShellBackdrop,
|
|
96
|
+
Z as translate,
|
|
97
|
+
_ as translationConfig,
|
|
98
|
+
q as useAuth,
|
|
99
|
+
D as useCustomTranslation,
|
|
100
|
+
P as useGetPermission,
|
|
101
|
+
C as useSyncBackdrop,
|
|
102
|
+
T as useSyncRouter,
|
|
103
|
+
J as useTheme,
|
|
104
|
+
K as useTranslation
|
|
111
105
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const getUseHasPermission: (baseUrl: string
|
|
3
|
+
export declare const getUseHasPermission: (baseUrl: string) => (accessWith: string[], requireAll?: boolean) => boolean;
|
|
4
4
|
type HasPermissionProps = {
|
|
5
5
|
baseUrl: string;
|
|
6
6
|
accessWith: string[];
|
|
@@ -4,6 +4,7 @@ type PermissionRouteProps = {
|
|
|
4
4
|
accessWith: string[];
|
|
5
5
|
baseUrl: string;
|
|
6
6
|
requireAll?: boolean;
|
|
7
|
+
unAuthorizedPath: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const PermissionRoute: ({ accessWith, requireAll, baseUrl, children, }: PropsWithChildren<PermissionRouteProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const PermissionRoute: ({ accessWith, requireAll, baseUrl, unAuthorizedPath, children, }: PropsWithChildren<PermissionRouteProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { default as i18n } from 'i18next';
|
|
2
2
|
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
i18n?: typeof i18n;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
3
8
|
export declare enum Language {
|
|
4
9
|
en = "en",
|
|
5
10
|
de = "de"
|
|
@@ -8,4 +13,5 @@ export declare const languages: {
|
|
|
8
13
|
readonly en: "English";
|
|
9
14
|
readonly de: "German";
|
|
10
15
|
};
|
|
11
|
-
|
|
16
|
+
declare let i18nInstance: typeof i18n;
|
|
17
|
+
export default i18nInstance;
|
package/package.json
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { U } from "../index-
|
|
3
|
-
import "../react-toastify.esm-H_Xdunfj.js";
|
|
4
|
-
import "../toast-config/index.js";
|
|
5
|
-
import "../toast-config-notification/index.js";
|
|
2
|
+
import { U as e } from "../index-BNvYaqXI.js";
|
|
6
3
|
import "../index-UUkm_4Gc.js";
|
|
7
|
-
import "../index-DqxmsDJs.js";
|
|
8
4
|
export {
|
|
9
|
-
|
|
5
|
+
e as UnauthorizedPage
|
|
10
6
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { F as
|
|
2
|
+
import { F as i, u as m } from "../index-BNvYaqXI.js";
|
|
3
3
|
import "../index-DqxmsDJs.js";
|
|
4
4
|
import "../index-UUkm_4Gc.js";
|
|
5
|
-
import "../react-toastify.esm-H_Xdunfj.js";
|
|
6
|
-
import "../toast-config/index.js";
|
|
7
|
-
import "../toast-config-notification/index.js";
|
|
8
5
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
i as FavoriteMenu,
|
|
7
|
+
m as updateFavoriteItems
|
|
11
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { L as g, T as n } from "../index-
|
|
2
|
+
import { L as g, T as n } from "../index-BNvYaqXI.js";
|
|
3
3
|
import "../index-DqxmsDJs.js";
|
|
4
4
|
import "../index-UUkm_4Gc.js";
|
|
5
5
|
import "../react-toastify.esm-H_Xdunfj.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { H as
|
|
2
|
+
import { H as e, g as m } from "../index-BNvYaqXI.js";
|
|
3
|
+
import "../index-UUkm_4Gc.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
e as HasPermission,
|
|
6
|
+
m as getUseHasPermission
|
|
6
7
|
};
|