@ukpc-lib/react 0.13.1-dev.12 → 0.13.1-dev.13

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.
Files changed (23) hide show
  1. package/dist/components/FavoriteMenu/components/MenuItem.d.ts +1 -0
  2. package/dist/components/index.cjs +1 -1
  3. package/dist/components/index.js +2 -2
  4. package/dist/{index.esm2017-XCT5rERk.cjs → index.esm2017-C48DXvhF.cjs} +28 -28
  5. package/dist/{index.esm2017-DK0KgGge.js → index.esm2017-D7ekKkN2.js} +331 -353
  6. package/dist/share/index.cjs +1 -1
  7. package/dist/share/index.js +1 -1
  8. package/package.json +1 -1
  9. package/web-components-bundle/access-denied/index.js +2 -2
  10. package/web-components-bundle/base-breadcrumbs/index.js +2 -2
  11. package/web-components-bundle/favorite-menu/index.js +4 -4
  12. package/web-components-bundle/global-menu/index.js +4 -4
  13. package/web-components-bundle/global-topbar/index.js +6 -6
  14. package/web-components-bundle/has-permission/index.js +3 -3
  15. package/web-components-bundle/{index-SzTQL7ca.js → index-B0EbOgi6.js} +18 -40
  16. package/web-components-bundle/{index-T58UE-6b.js → index-B2-j-GrO.js} +1 -1
  17. package/web-components-bundle/{index-BziS9Had.js → index-B8-7QZsi.js} +593 -593
  18. package/web-components-bundle/{index-BSe1av43.js → index-Cx0zTfOC.js} +1 -1
  19. package/web-components-bundle/page-not-found/index.js +2 -2
  20. package/web-components-bundle/{react-to-web-component-CXwKHjZr.js → react-to-web-component-D7SoYMky.js} +1535 -1527
  21. package/web-components-bundle/{react-toastify.esm-CrTD7cpE.js → react-toastify.esm-Y1WvK90L.js} +1 -1
  22. package/web-components-bundle/toast-config/index.js +2 -2
  23. package/web-components-bundle/toast-config-notification/index.js +2 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-XCT5rERk.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-C48DXvhF.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;
@@ -1,4 +1,4 @@
1
- import { N as F, O as M, R as N, a1 as G, Z as $, a as I, c as O, $ as j, V as z, T as L, U, W as V, w as W, a0 as X, s as Y, t as Z, X as _, b as q, u as D, g as J, Y as K } from "../index.esm2017-DK0KgGge.js";
1
+ import { N as F, O as M, R as N, a1 as G, Z as $, a as I, c as O, $ as j, V as z, T as L, U, W as V, w as W, a0 as X, s as Y, t as Z, X as _, b as q, u as D, g as J, Y as K } from "../index.esm2017-D7ekKkN2.js";
2
2
  import g from "axios";
3
3
  import { useState as d, useEffect as i, useMemo as h } from "react";
4
4
  import { useNavigate as w, useLocation as f, Navigate as p } from "react-router-dom";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.13.1-dev.12",
4
+ "version": "0.13.1-dev.13",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
- import "../react-to-web-component-CXwKHjZr.js";
2
- import { U as e } from "../index-T58UE-6b.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { U as e } from "../index-B2-j-GrO.js";
3
3
  export {
4
4
  e as UnauthorizedPage
5
5
  };
@@ -1,5 +1,5 @@
1
- import "../react-to-web-component-CXwKHjZr.js";
2
- import { aa as m } from "../index-BziS9Had.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { aa as m } from "../index-B8-7QZsi.js";
3
3
  export {
4
4
  m as BaseBreadcrumbs
5
5
  };
@@ -1,7 +1,7 @@
1
- import "../react-to-web-component-CXwKHjZr.js";
2
- import { F as i, u as m } from "../index-SzTQL7ca.js";
3
- import "../index-BSe1av43.js";
4
- import "../index-BziS9Had.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { F as i, u as m } from "../index-B0EbOgi6.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-CXwKHjZr.js";
2
- import { G as i } from "../index-SzTQL7ca.js";
3
- import "../index-BSe1av43.js";
4
- import "../index-BziS9Had.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { G as i } from "../index-B0EbOgi6.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-CXwKHjZr.js";
2
- import { L as n, T as s } from "../index-SzTQL7ca.js";
3
- import "../index-BSe1av43.js";
4
- import "../index-T58UE-6b.js";
5
- import "../index-BziS9Had.js";
6
- import "../react-toastify.esm-CrTD7cpE.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { L as n, T as s } from "../index-B0EbOgi6.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-CXwKHjZr.js";
2
- import { H as e, g as m } from "../index-SzTQL7ca.js";
3
- import "../index-BziS9Had.js";
1
+ import "../react-to-web-component-D7SoYMky.js";
2
+ import { H as e, g as m } from "../index-B0EbOgi6.js";
3
+ import "../index-B8-7QZsi.js";
4
4
  export {
5
5
  e as HasPermission,
6
6
  m as getUseHasPermission
@@ -1,9 +1,9 @@
1
- import { c as $i, g as _f, r as A, j as I, R as qd, a as Le, b as Vp, s as Wp, d as YB } from "./react-to-web-component-CXwKHjZr.js";
2
- import { I as qB, i as GB, L as ay, t as ND } from "./index-T58UE-6b.js";
3
- import { c as En, T as $D, a as KB, _ as we, b as Xr, D as XB, d as ly, e as QB, f as sl, g as FD, r as ZB, u as Zc, h as Qh, s as lS, i as mu, j as gu, o as uS, k as JB, l as vu, m as Ef, n as sr, p as jD, q as zr, B as eV, t as tV, v as BD, w as VD, x as nV, y as Hp, z as z0, A as Tc, C as rV, E as cS, F as iV, G as Gd, H as sV, I as Zh, J as oV, K as aV, L as lV, M as Jh, N as uV, O as uy, P as cV, Q as cy, R as Vn, S as WD, U as fV, V as HD, W as an, X as ep, Y as UD, Z as Ao, $ as fS, a0 as dS, a1 as xh, a2 as Kd, a3 as hS, a4 as dV, a5 as hV, a6 as pV, a7 as zD, a8 as YD, a9 as qD } from "./index-BziS9Had.js";
1
+ import { c as $i, g as _f, r as A, j as I, R as qd, a as Le, b as Vp, s as Wp, d as YB } from "./react-to-web-component-D7SoYMky.js";
2
+ import { I as qB, i as GB, L as ay, t as ND } from "./index-B2-j-GrO.js";
3
+ import { c as En, T as $D, a as KB, _ as we, b as Xr, D as XB, d as ly, e as QB, f as sl, g as FD, r as ZB, u as Zc, h as Qh, s as lS, i as mu, j as gu, o as uS, k as JB, l as vu, m as Ef, n as sr, p as jD, q as zr, B as eV, t as tV, v as BD, w as VD, x as nV, y as Hp, z as z0, A as Tc, C as rV, E as cS, F as iV, G as Gd, H as sV, I as Zh, J as oV, K as aV, L as lV, M as Jh, N as uV, O as uy, P as cV, Q as cy, R as Vn, S as WD, U as fV, V as HD, W as an, X as ep, Y as UD, Z as Ao, $ as fS, a0 as dS, a1 as xh, a2 as Kd, a3 as hS, a4 as dV, a5 as hV, a6 as pV, a7 as zD, a8 as YD, a9 as qD } from "./index-B8-7QZsi.js";
4
4
  import { c as Io } from "./clsx-DB4S2d7J.js";
5
- import { S as Y0 } from "./index-BSe1av43.js";
6
- import { B as q0 } from "./react-toastify.esm-CrTD7cpE.js";
5
+ import { S as Y0 } from "./index-Cx0zTfOC.js";
6
+ import { B as q0 } from "./react-toastify.esm-Y1WvK90L.js";
7
7
  import "./toast-config/index.js";
8
8
  import "./toast-config-notification/index.js";
9
9
  function mV(e) {
@@ -16495,7 +16495,7 @@ function IA({ ...e }) {
16495
16495
  const t = e.item, n = e.level || 0, r = !!((z = e.item.children) != null && z.length), i = `level-${n}`, s = (ie, se = i) => `${ie} ${se} `, [o, l] = A.useState(!1), [c, d] = A.useState(t.isFavorite || !1), h = A.useRef(), p = A.useRef();
16496
16496
  p != null && p.current && ((re = p == null ? void 0 : p.current) == null ? void 0 : re.scrollWidth) > ((J = p == null ? void 0 : p.current) == null ? void 0 : J.clientWidth);
16497
16497
  const y = window.location.origin, x = t.path && t.path.includes("http") ? new URL(t.path) : { origin: "", pathname: "" }, T = window.location.pathname.split("/")[1], C = x.pathname.split("/")[1], k = e.item.redirectUrl || e.ssr || !y.includes("local") && y !== x.origin || C !== T, _ = r || n === 0 ? "div" : k ? "a" : zD, L = t.redirectUrl || t.path || "#", R = n + 1, V = r && o && n > 0, H = () => {
16498
- l(!0);
16498
+ e.isDrop || l(!0);
16499
16499
  }, F = () => {
16500
16500
  l(!1);
16501
16501
  }, v = "/global-menu-config/api/v1/menu-items/user/set-favorite", q = y !== x.origin || e.item.redirectUrl ? "_blank" : "_self";
@@ -16505,25 +16505,16 @@ function IA({ ...e }) {
16505
16505
  ref: h,
16506
16506
  className: s("menu-item__wrapper tree-node"),
16507
16507
  style: {
16508
- // display: 'flex',
16509
- // justifyContent: 'space-between',
16510
- // height: '56px',
16511
- // p: 2,
16512
16508
  borderRadius: "8px",
16513
- // marginLeft: `${indent}px`,
16514
- // marginTop: '2px',
16515
- // marginBottom: '8px',
16516
16509
  transition: "all 0.3s"
16517
- // border: `1px solid ${props.params.isDropTarget ? '#93D500' : 'transparent'}`,
16518
- // backgroundColor: isLevel0 ? '#E5F5ED' : '#aca2a212',
16519
- // ':hover': {
16520
- // backgroundColor: isLevel0 ? '#d3eee0' : '#aca2a226',
16521
- // },
16522
16510
  },
16523
16511
  onMouseOver: H,
16524
16512
  onMouseOut: F,
16525
16513
  onDragStart: (ie) => {
16526
- n > 1 && ie.preventDefault();
16514
+ n > 1 && ie.preventDefault(), l(!1);
16515
+ },
16516
+ onDragEnd: () => {
16517
+ console.log("drag end 1223"), l(!1);
16527
16518
  },
16528
16519
  children: [
16529
16520
  /* @__PURE__ */ I.jsxs(
@@ -16535,21 +16526,15 @@ function IA({ ...e }) {
16535
16526
  draggable: "true",
16536
16527
  className: s("menu-item__link"),
16537
16528
  style: {
16538
- // paddingLeft: paddingLeft,
16539
16529
  width: "100%",
16540
16530
  transition: "all 0.3s"
16541
- // transitionDelay: '0.1s',
16542
- // color: isActive(item.id)
16543
- // ? props.brandColors?.primary400 || color.primary400
16544
- // : undefined,
16545
- // backgroundColor:
16546
- // isActive(item.id) && level === 1
16547
- // ? props.brandColors?.primary200
16548
- // : undefined,
16549
16531
  },
16550
16532
  onDragStart: (ie) => {
16551
16533
  console.log("onDragStart component", ie.target);
16552
16534
  },
16535
+ onDragEnd: () => {
16536
+ console.log("onDragEnd menu item"), l(!1);
16537
+ },
16553
16538
  children: [
16554
16539
  /* @__PURE__ */ I.jsx(eX, { cls: s, item: t }),
16555
16540
  /* @__PURE__ */ I.jsx("span", { className: s("menu-item__label"), ref: p, children: t.name }),
@@ -21961,7 +21946,7 @@ function Iee(e) {
21961
21946
  isOverCurrent: z.isOver({ shallow: !0 })
21962
21947
  }),
21963
21948
  drop: (z) => {
21964
- x(z.index, _), z.index = _;
21949
+ z.index !== _ && (z.index < _ ? (x(z.index, _ - 1), z.index = _ - 1) : (x(z.index, _), z.index = _));
21965
21950
  }
21966
21951
  }),
21967
21952
  []
@@ -21990,7 +21975,8 @@ function Iee(e) {
21990
21975
  baseUrl: e.baseUrl,
21991
21976
  item: k,
21992
21977
  level: 1,
21993
- onSetFavoriteSuccess: p
21978
+ onSetFavoriteSuccess: p,
21979
+ isDrop: i
21994
21980
  }
21995
21981
  )
21996
21982
  }
@@ -22019,8 +22005,7 @@ function Iee(e) {
22019
22005
  display: "flex",
22020
22006
  alignItems: "center",
22021
22007
  justifyContent: "center",
22022
- borderLeft: _ && L ? "2px solid red" : "transparent",
22023
- cursor: "move"
22008
+ borderLeft: _ && L ? "2px solid var(--primary300)" : "transparent"
22024
22009
  }
22025
22010
  }
22026
22011
  );
@@ -22038,14 +22023,7 @@ function Iee(e) {
22038
22023
  overflowY: "hidden"
22039
22024
  },
22040
22025
  children: /* @__PURE__ */ I.jsx(UM, { backend: iR, children: /* @__PURE__ */ I.jsxs("div", { style: { display: "inline-flex" }, children: [
22041
- n.map((k, _) => /* @__PURE__ */ I.jsx(
22042
- T,
22043
- {
22044
- item: k,
22045
- index: _
22046
- },
22047
- k.id
22048
- )),
22026
+ n.map((k, _) => /* @__PURE__ */ I.jsx(T, { item: k, index: _ }, k.id)),
22049
22027
  /* @__PURE__ */ I.jsx(C, {})
22050
22028
  ] }) })
22051
22029
  }
@@ -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-CXwKHjZr.js";
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++) {