@ukpc-lib/react 0.9.8 → 0.9.9
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 +22 -22
- package/dist/components/index.js +22 -22
- package/dist/{index.module-1418394f.cjs → index.module-1f4dcd01.cjs} +1 -1
- package/dist/{index.module-242ff528.js → index.module-54e27930.js} +1 -5
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- 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-dee8a2ec.js → index-23ac67cd.js} +20 -20
|
@@ -2823,11 +2823,7 @@ function XA(e) {
|
|
|
2823
2823
|
var l, c, d;
|
|
2824
2824
|
const { data: t, isFetching: n } = ay(
|
|
2825
2825
|
["customTheme"],
|
|
2826
|
-
() => e != null && e.url ? fetch(e.url).then((v) => v.json())
|
|
2827
|
-
var S, T, P;
|
|
2828
|
-
const p = v;
|
|
2829
|
-
return (S = p == null ? void 0 : p.theme) != null && S.image && (p.theme.image = p.theme.image + "?v=" + Date.now()), (T = p == null ? void 0 : p.theme) != null && T.favicon && (p.theme.favicon = p.theme.favicon + "?v=" + Date.now()), (P = p == null ? void 0 : p.theme) != null && P.icon && (p.theme.icon = p.theme.icon + "?v=" + Date.now()), p;
|
|
2830
|
-
}) : void 0,
|
|
2826
|
+
() => e != null && e.url ? fetch(e.url).then((v) => v.json()) : void 0,
|
|
2831
2827
|
{
|
|
2832
2828
|
enabled: !!(e != null && e.url) && (e == null ? void 0 : e.enabled),
|
|
2833
2829
|
refetchOnWindowFocus: !1,
|
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-1f4dcd01.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=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=c(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,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.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,4 +1,4 @@
|
|
|
1
|
-
import { M as R, N as S, O as G, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-
|
|
1
|
+
import { M as R, N as S, O as G, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-54e27930.js";
|
|
2
2
|
import u from "axios";
|
|
3
3
|
import { useState as m, useEffect as c } from "react";
|
|
4
4
|
import { jsx as a, Fragment as n } from "react/jsx-runtime";
|
package/package.json
CHANGED
|
@@ -14804,16 +14804,16 @@ function YM({ classNames: e = "", ...t }) {
|
|
|
14804
14804
|
notiprops: u,
|
|
14805
14805
|
isBrand: f,
|
|
14806
14806
|
logout: h
|
|
14807
|
-
} = t, p =
|
|
14807
|
+
} = t, p = {
|
|
14808
14808
|
...s,
|
|
14809
14809
|
color: (a == null ? void 0 : a.headerTextColor) || "white",
|
|
14810
14810
|
backgroundColor: (a == null ? void 0 : a.headerBgColor) || "black"
|
|
14811
|
-
}, [
|
|
14812
|
-
console.log("term",
|
|
14813
|
-
const [
|
|
14814
|
-
console.log("searchPermission",
|
|
14815
|
-
const
|
|
14816
|
-
|
|
14811
|
+
}, [v, b] = P.useState(!1), w = P.useRef(null), { Term: x } = TZ();
|
|
14812
|
+
console.log("term", x);
|
|
14813
|
+
const [E, T] = P.useState(x || ""), M = GZ({ baseUrl: i });
|
|
14814
|
+
console.log("searchPermission", M.hasPermission);
|
|
14815
|
+
const R = KZ(i, E), $ = P.useCallback((N) => {
|
|
14816
|
+
T(N);
|
|
14817
14817
|
}, []);
|
|
14818
14818
|
return /* @__PURE__ */ j.jsxs(
|
|
14819
14819
|
S1,
|
|
@@ -14833,11 +14833,11 @@ function YM({ classNames: e = "", ...t }) {
|
|
|
14833
14833
|
"nav",
|
|
14834
14834
|
{
|
|
14835
14835
|
className: `navbar-wrapper ${e}`,
|
|
14836
|
-
style: a ?
|
|
14836
|
+
style: a ? p : s,
|
|
14837
14837
|
children: /* @__PURE__ */ j.jsxs("div", { className: "navbar-container", children: [
|
|
14838
|
-
/* @__PURE__ */ j.jsx("a", { href: "/home", className: "logo-container", children: /* @__PURE__ */ j.jsx("img", { src:
|
|
14838
|
+
/* @__PURE__ */ j.jsx("a", { href: "/home", className: "logo-container", children: /* @__PURE__ */ j.jsx("img", { src: n || "#", alt: " ", style: { height: "40px" } }) }),
|
|
14839
14839
|
/* @__PURE__ */ j.jsxs("div", { className: "right-side-container", children: [
|
|
14840
|
-
f &&
|
|
14840
|
+
f && M.hasPermission ? /* @__PURE__ */ j.jsx("span", { children: /* @__PURE__ */ j.jsxs(
|
|
14841
14841
|
"label",
|
|
14842
14842
|
{
|
|
14843
14843
|
className: "topbar-search-label",
|
|
@@ -14850,14 +14850,14 @@ function YM({ classNames: e = "", ...t }) {
|
|
|
14850
14850
|
className: "topbar-search-input",
|
|
14851
14851
|
id: "GlobalSearchInput",
|
|
14852
14852
|
placeholder: "Search",
|
|
14853
|
-
onChange: (
|
|
14854
|
-
const
|
|
14855
|
-
|
|
14853
|
+
onChange: (N) => {
|
|
14854
|
+
const V = N.target.value;
|
|
14855
|
+
$(V);
|
|
14856
14856
|
},
|
|
14857
|
-
ref:
|
|
14858
|
-
value:
|
|
14859
|
-
onKeyDown: (
|
|
14860
|
-
|
|
14857
|
+
ref: w,
|
|
14858
|
+
value: E,
|
|
14859
|
+
onKeyDown: (N) => {
|
|
14860
|
+
N.key === "Enter" && R();
|
|
14861
14861
|
}
|
|
14862
14862
|
}
|
|
14863
14863
|
),
|
|
@@ -14900,7 +14900,7 @@ function YM({ classNames: e = "", ...t }) {
|
|
|
14900
14900
|
primaryColor: a == null ? void 0 : a.headerTextColor,
|
|
14901
14901
|
avatarUrl: r == null ? void 0 : r.avatarUrl,
|
|
14902
14902
|
userName: r == null ? void 0 : r.firstName,
|
|
14903
|
-
setShowConfirmModal:
|
|
14903
|
+
setShowConfirmModal: b
|
|
14904
14904
|
}
|
|
14905
14905
|
),
|
|
14906
14906
|
/* @__PURE__ */ j.jsx(
|
|
@@ -14929,8 +14929,8 @@ function YM({ classNames: e = "", ...t }) {
|
|
|
14929
14929
|
/* @__PURE__ */ j.jsx(
|
|
14930
14930
|
uR,
|
|
14931
14931
|
{
|
|
14932
|
-
isOpen:
|
|
14933
|
-
onClose: () =>
|
|
14932
|
+
isOpen: v,
|
|
14933
|
+
onClose: () => b(!1),
|
|
14934
14934
|
onConfirm: h
|
|
14935
14935
|
}
|
|
14936
14936
|
)
|