@ukpc-lib/react 0.16.10 → 0.16.11-sandbox.saas-9885.patch-3
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 +4 -0
- package/dist/components/GlobalMenu/index.d.ts +5 -0
- package/dist/components/MenuTabs/index.d.ts +10 -0
- package/dist/components/Notification/Tabs/index.d.ts +1 -0
- package/dist/components/Topbar/icons/HamburgerIcon.d.ts +4 -0
- package/dist/components/Topbar/icons/SearchIcon.d.ts +7 -0
- package/dist/components/index.cjs +30 -18
- package/dist/components/index.js +2625 -2391
- package/dist/components/main.d.ts +1 -1
- package/dist/index.esm2017-BzovwrBD.cjs +1078 -0
- package/dist/{index.esm2017-DmaL4yoT.js → index.esm2017-Dl3V5vng.js} +13488 -13148
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +49 -52
- package/dist/share/interceptor/index.d.ts +1 -4
- package/package.json +1 -1
- package/web-components-bundle/base-breadcrumbs/index.js +1 -1
- package/web-components-bundle/favorite-menu/index.js +2 -2
- package/web-components-bundle/global-menu/index.js +4 -3
- package/web-components-bundle/global-topbar/index.js +2 -2
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-BBl8HzU3.js → index-BGXlqh1w.js} +5 -5
- package/web-components-bundle/{index-sOLfUmht.js → index-CEjd1_YL.js} +23962 -23383
- package/dist/index.esm2017-C_jhc-uY.cjs +0 -1078
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-BzovwrBD.cjs"),m=require("axios"),u=require("react"),d=require("react-router-dom"),a=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");require("react-query");require("react-dom");require("moment");const h=s=>{const[t,r]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(o=>r(o.data)).catch(o=>{console.error("Getting user permission error:",o)})},[s]),t},p=s=>{const t=d.useLocation();if(u.useEffect(()=>{var o,i;let r=t.pathname+t.search+t.hash;s&&!r.includes(s)&&(r=s+r),console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:",r),(i=(o=window.top)==null?void 0:o.shellNavigate)==null||i.call(o,"/app"+r,{replace:!0})},[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}};function g({open:s,disabled:t}){u.useMemo(()=>{var r,o,i,n;t||(s?(o=(r=window.top)==null?void 0:r.HostBridge)==null||o.openBackdrop(!0):(n=(i=window.top)==null?void 0:i.HostBridge)==null||n.openBackdrop(!1))},[s,t])}const l=(s,t)=>(r,o)=>{const n=e.useUserPermissions({axiosInstance:t,baseUrl:s}).data;return n?o?r.every(c=>n==null?void 0:n.includes(c)):r.some(c=>n==null?void 0:n.includes(c)):!1},f=({baseUrl:s,accessWith:t,requireAll:r,children:o})=>l(s)(t,r)?a.jsx(a.Fragment,{children:o}):null,P=({accessWith:s,requireAll:t,baseUrl:r,children:o})=>l(r)(s,t)?a.jsx(a.Fragment,{children:o}):a.jsx(e.UnauthorizedPage,{});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;exports.HasPermission=f;exports.PermissionRoute=P;exports.getUseHasPermission=l;exports.useGetPermission=h;exports.useSyncBackdrop=g;exports.useSyncRouter=p;
|
package/dist/share/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useState as
|
|
1
|
+
import { V as p, R as l } from "../index.esm2017-Dl3V5vng.js";
|
|
2
|
+
import { W as F, X as I, Y as L, a7 as M, a4 as N, a as U, c as j, a5 as z, a0 as O, Z as V, $ as X, a1 as Y, y as Z, a6 as _, s as q, t as J, a2 as K, g as Q, u as W, m as b, a3 as oo } from "../index.esm2017-Dl3V5vng.js";
|
|
3
|
+
import f from "axios";
|
|
4
|
+
import { useState as d, useEffect as u, useMemo as h } from "react";
|
|
5
5
|
import { useLocation as w } from "react-router-dom";
|
|
6
6
|
import { jsx as i, Fragment as c } from "react/jsx-runtime";
|
|
7
7
|
import "@r2wc/react-to-web-component";
|
|
@@ -9,22 +9,22 @@ import "@mui/material";
|
|
|
9
9
|
import "react-query";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
import "moment";
|
|
12
|
-
const
|
|
13
|
-
const [r,
|
|
12
|
+
const C = (e) => {
|
|
13
|
+
const [r, o] = d([]);
|
|
14
14
|
return u(() => {
|
|
15
|
-
|
|
15
|
+
f.get(`${e}/user-management/api/v1/users/my-account/permissions`, {
|
|
16
16
|
withCredentials: !0
|
|
17
|
-
}).then((s) =>
|
|
17
|
+
}).then((s) => o(s.data)).catch((s) => {
|
|
18
18
|
console.error("Getting user permission error:", s);
|
|
19
19
|
});
|
|
20
|
-
}, [
|
|
21
|
-
},
|
|
20
|
+
}, [e]), r;
|
|
21
|
+
}, E = (e) => {
|
|
22
22
|
const r = w();
|
|
23
23
|
if (u(() => {
|
|
24
24
|
var s, a;
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
}, [r,
|
|
25
|
+
let o = r.pathname + r.search + r.hash;
|
|
26
|
+
e && !o.includes(e) && (o = e + o), console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:", o), (a = (s = window.top) == null ? void 0 : s.shellNavigate) == null || a.call(s, "/app" + o, { replace: !0 });
|
|
27
|
+
}, [r, e]), window.self === window.top) {
|
|
28
28
|
console.log("useSyncRouter: Navigate to /app path"), window.location.href = window.location.href.replace(
|
|
29
29
|
window.origin,
|
|
30
30
|
`${window.origin}/app`
|
|
@@ -33,64 +33,61 @@ const y = (o) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
function k({
|
|
36
|
-
open:
|
|
36
|
+
open: e,
|
|
37
37
|
disabled: r
|
|
38
38
|
}) {
|
|
39
39
|
h(() => {
|
|
40
|
-
var
|
|
41
|
-
r || (
|
|
42
|
-
}, [
|
|
40
|
+
var o, s, a, t;
|
|
41
|
+
r || (e ? (s = (o = window.top) == null ? void 0 : o.HostBridge) == null || s.openBackdrop(!0) : (t = (a = window.top) == null ? void 0 : a.HostBridge) == null || t.openBackdrop(!1));
|
|
42
|
+
}, [e, r]);
|
|
43
43
|
}
|
|
44
|
-
const m = (
|
|
44
|
+
const m = (e, r) => (o, s) => {
|
|
45
45
|
const t = p({
|
|
46
46
|
axiosInstance: r,
|
|
47
|
-
baseUrl:
|
|
47
|
+
baseUrl: e
|
|
48
48
|
}).data;
|
|
49
|
-
return t ? s ?
|
|
49
|
+
return t ? s ? o.every(
|
|
50
50
|
(n) => t == null ? void 0 : t.includes(n)
|
|
51
|
-
) :
|
|
51
|
+
) : o.some(
|
|
52
52
|
(n) => t == null ? void 0 : t.includes(n)
|
|
53
53
|
) : !1;
|
|
54
54
|
}, H = ({
|
|
55
|
-
baseUrl:
|
|
55
|
+
baseUrl: e,
|
|
56
56
|
accessWith: r,
|
|
57
|
-
requireAll:
|
|
57
|
+
requireAll: o,
|
|
58
58
|
children: s
|
|
59
|
-
}) => m(
|
|
60
|
-
accessWith:
|
|
59
|
+
}) => m(e)(r, o) ? /* @__PURE__ */ i(c, { children: s }) : null, G = ({
|
|
60
|
+
accessWith: e,
|
|
61
61
|
requireAll: r,
|
|
62
|
-
baseUrl:
|
|
62
|
+
baseUrl: o,
|
|
63
63
|
children: s
|
|
64
|
-
}) => m(
|
|
64
|
+
}) => m(o)(e, r) ? /* @__PURE__ */ i(c, { children: s }) : /* @__PURE__ */ i(l, {});
|
|
65
65
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
F as AuthContext,
|
|
67
|
+
I as AuthProvider,
|
|
68
|
+
L as ERROR_MESSAGE,
|
|
69
69
|
H as HasPermission,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
X as createCustomTheme,
|
|
70
|
+
G as PermissionRoute,
|
|
71
|
+
M as SaasThemeProvider,
|
|
72
|
+
N as TranslationProvider,
|
|
73
|
+
U as axiosInstance,
|
|
74
|
+
j as color,
|
|
75
|
+
z as createCustomTheme,
|
|
77
76
|
m as getUseHasPermission,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
K as logout,
|
|
82
|
-
V as requestInterceptor,
|
|
77
|
+
O as handleErrorAxios,
|
|
78
|
+
V as login,
|
|
79
|
+
X as logout,
|
|
83
80
|
Y as responseInterceptor,
|
|
84
81
|
Z as search,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
_ as setFavicon,
|
|
83
|
+
q as setShellBackdrop,
|
|
84
|
+
J as translate,
|
|
85
|
+
K as translationConfig,
|
|
86
|
+
Q as useAuth,
|
|
87
|
+
W as useCustomTranslation,
|
|
88
|
+
C as useGetPermission,
|
|
92
89
|
k as useSyncBackdrop,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
E as useSyncRouter,
|
|
91
|
+
b as useTheme,
|
|
92
|
+
oo as useTranslation
|
|
96
93
|
};
|
|
@@ -2,7 +2,6 @@ export declare const ERROR_MESSAGE: {
|
|
|
2
2
|
TOKEN_MALFORMED: string;
|
|
3
3
|
TOKEN_EXPIRED: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const X_AUTO_CANCEL = "true";
|
|
6
5
|
export declare const login: (baseURL: string) => void;
|
|
7
6
|
export declare const logout: (baseURL: string) => void;
|
|
8
7
|
declare const axiosInstance: import('axios').AxiosInstance;
|
|
@@ -12,7 +11,5 @@ export type HandleErrorOptions = {
|
|
|
12
11
|
disabledPushNotify?: boolean;
|
|
13
12
|
};
|
|
14
13
|
export declare function handleErrorAxios(error: any, options?: HandleErrorOptions): void | Promise<import('axios').AxiosResponse<any, any>>;
|
|
15
|
-
declare const requestInterceptor: number;
|
|
16
14
|
declare const responseInterceptor: number;
|
|
17
|
-
export
|
|
18
|
-
export { axiosInstance, responseInterceptor, requestInterceptor };
|
|
15
|
+
export { axiosInstance, responseInterceptor };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { F, u as v } from "../index-
|
|
2
|
+
import { F, u as v } from "../index-CEjd1_YL.js";
|
|
3
3
|
import "../index-N6zjI_u_.js";
|
|
4
|
-
import "../index-
|
|
4
|
+
import "../index-BGXlqh1w.js";
|
|
5
5
|
import "../react-toastify.esm-H_Xdunfj.js";
|
|
6
6
|
import "../toast-config/index.js";
|
|
7
7
|
import "../toast-config-notification/index.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { G as e } from "../index-
|
|
2
|
+
import { G as e, a as n } from "../index-CEjd1_YL.js";
|
|
3
3
|
import "../index-N6zjI_u_.js";
|
|
4
|
-
import "../index-
|
|
4
|
+
import "../index-BGXlqh1w.js";
|
|
5
5
|
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
6
6
|
import "../index-Ch-015PG.js";
|
|
7
7
|
export {
|
|
8
|
-
e as GlobalMenu
|
|
8
|
+
e as GlobalMenu,
|
|
9
|
+
n as LanguageDropdown
|
|
9
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
-
import { L as s, T as L } from "../index-
|
|
2
|
+
import { L as s, T as L } from "../index-CEjd1_YL.js";
|
|
3
3
|
import "../index-N6zjI_u_.js";
|
|
4
4
|
import "../index-Ch-015PG.js";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-BGXlqh1w.js";
|
|
6
6
|
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
7
7
|
import "../react-toastify.esm-H_Xdunfj.js";
|
|
8
8
|
import "../toast-config/index.js";
|
|
@@ -5143,12 +5143,12 @@ export {
|
|
|
5143
5143
|
bl as M,
|
|
5144
5144
|
Ce as N,
|
|
5145
5145
|
wr as O,
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5146
|
+
Vu as P,
|
|
5147
|
+
Uu as Q,
|
|
5148
|
+
Yr as R,
|
|
5149
|
+
pf as S,
|
|
5150
5150
|
It as T,
|
|
5151
|
-
|
|
5151
|
+
Yu as U,
|
|
5152
5152
|
rf as V,
|
|
5153
5153
|
va as _,
|
|
5154
5154
|
Ut as a,
|