@ukpc-lib/react 0.3.36 → 0.3.37

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../index.module-ac67a1cf.cjs"),c=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("moment");require("@mui/material");const l=require("react-router-dom"),m=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{c.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>n(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[r]),t},a=r=>(t,n)=>{const e=m(r);return n?t.every(o=>e==null?void 0:e.includes(o)):t.some(o=>e==null?void 0:e.includes(o))},P=({baseUrl:r,accessWith:t,requireAll:n,children:e})=>a(r)(t,n)?i.jsx(i.Fragment,{children:e}):null,h=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:e,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:e,replace:!0});exports.AuthProvider=s.AuthProvider;exports.SaasThemeProvider=s.SaasThemeProvider;exports.TranslationProvider=s.TranslationProvider;exports.color=s.color;exports.createCustomTheme=s.createCustomTheme;exports.getAxiosInstance=s.getAxiosInstance;exports.search=s.search;exports.translate=s.translate;exports.translationConfig=s.translationConfig;exports.useAuth=s.useAuth;exports.useCustomTranslation=s.useCustomTranslation;exports.useTheme=s.useTheme;exports.useTranslation=s.useTranslation$1;exports.HasPermission=P;exports.PermissionRoute=h;exports.getUseHasPermission=a;exports.useGetPermission=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../index.module-849752da.cjs"),c=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("moment");require("@mui/material");const l=require("react-router-dom"),m=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{c.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>n(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[r]),t},a=r=>(t,n)=>{const e=m(r);return n?t.every(o=>e==null?void 0:e.includes(o)):t.some(o=>e==null?void 0:e.includes(o))},P=({baseUrl:r,accessWith:t,requireAll:n,children:e})=>a(r)(t,n)?i.jsx(i.Fragment,{children:e}):null,h=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:e,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:e,replace:!0});exports.AuthProvider=s.AuthProvider;exports.SaasThemeProvider=s.SaasThemeProvider;exports.TranslationProvider=s.TranslationProvider;exports.color=s.color;exports.createCustomTheme=s.createCustomTheme;exports.getAxiosInstance=s.getAxiosInstance;exports.search=s.search;exports.translate=s.translate;exports.translationConfig=s.translationConfig;exports.useAuth=s.useAuth;exports.useCustomTranslation=s.useCustomTranslation;exports.useTheme=s.useTheme;exports.useTranslation=s.useTranslation$1;exports.HasPermission=P;exports.PermissionRoute=h;exports.getUseHasPermission=a;exports.useGetPermission=m;
@@ -1,4 +1,4 @@
1
- import { H as G, U as N, T as R, c as S, R as j, K as w, r as E, N as F, M as I, J, d as K, m as M, O } from "../index.module-7ec738c2.js";
1
+ import { H as G, U as N, T as R, c as S, R as j, K as w, r as E, N as F, M as I, J, d as K, m as M, O } from "../index.module-0cf98641.js";
2
2
  import m from "axios";
3
3
  import { useState as u, useEffect as c } from "react";
4
4
  import { jsx as n, Fragment as a } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.3.36",
4
+ "version": "0.3.37",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-bad82c40.cjs");exports.GlobalMenu=e.GlobalMenu;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-efaf889f.cjs");exports.GlobalMenu=e.GlobalMenu;
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import { G as e } from "../index-659d93f3.js";
2
+ import { G as e } from "../index-5b160fa7.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-bad82c40.cjs");const e=require("../index-558337af.cjs");require("../index-4327002b.cjs");exports.TopBar=e.TopBar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-efaf889f.cjs");const e=require("../index-a7ee442e.cjs");require("../index-4327002b.cjs");exports.TopBar=e.TopBar;
@@ -1,6 +1,6 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import "../index-659d93f3.js";
3
- import { T as i } from "../index-10034ebf.js";
2
+ import "../index-5b160fa7.js";
3
+ import { T as i } from "../index-64bab1ce.js";
4
4
  import "../index-b3659f2e.js";
5
5
  export {
6
6
  i as TopBar
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-558337af.cjs");require("../index-bad82c40.cjs");require("../index-4327002b.cjs");exports.HasPermission=e.HasPermission;exports.getUseHasPermission=e.getUseHasPermission;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-a7ee442e.cjs");require("../index-efaf889f.cjs");require("../index-4327002b.cjs");exports.HasPermission=e.HasPermission;exports.getUseHasPermission=e.getUseHasPermission;
@@ -1,6 +1,6 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import { H as e, g as t } from "../index-10034ebf.js";
3
- import "../index-659d93f3.js";
2
+ import { H as e, g as t } from "../index-64bab1ce.js";
3
+ import "../index-5b160fa7.js";
4
4
  import "../index-b3659f2e.js";
5
5
  export {
6
6
  e as HasPermission,
@@ -10721,7 +10721,7 @@ function Kf(e, t) {
10721
10721
  })).sort((s, a) => {
10722
10722
  const l = new URL(s.itemUrl).searchParams, u = new URL(a.itemUrl).searchParams;
10723
10723
  return Array.from(l).length - Array.from(u).length;
10724
- }).filter(({ itemUrl: s }) => n.origin === s.origin).filter(({ itemUrl: s }) => n.pathname === s.pathname).sort((s, a) => a.matchingParamsCount - s.matchingParamsCount);
10724
+ }).filter(({ itemUrl: s }) => n.origin === s.origin).filter(({ itemUrl: s }) => n.pathname === s.pathname || n.pathname.includes(s.pathname)).sort((s, a) => a.matchingParamsCount - s.matchingParamsCount);
10725
10725
  let i = r.length > 0 ? r[0].item : null;
10726
10726
  console.log("matchingItems:", r);
10727
10727
  let o = [];
@@ -1,5 +1,5 @@
1
1
  import { j as q, r as Q, R as eg, g as _r, a as Js, c as pa, b as Ix, d as Rx, s as rm } from "./react-to-web-component-469d91d4.js";
2
- import { c as Bi, _ as $e, a as nr, b as Px, o as Nx, d as Lx, e as ho, p as po, n as $x, l as tg, E as Fx, S as Yx, L as Bx } from "./index-659d93f3.js";
2
+ import { c as Bi, _ as $e, a as nr, b as Px, o as Nx, d as Lx, e as ho, p as po, n as $x, l as tg, E as Fx, S as Yx, L as Bx } from "./index-5b160fa7.js";
3
3
  import { _ as Wx, t as jx, I as Hx, i as Ux, L as $f } from "./index-b3659f2e.js";
4
4
  function im(e) {
5
5
  var t, r, a = "";
@@ -1,4 +1,4 @@
1
- "use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),se=require("./index-bad82c40.cjs"),ps=require("./index-4327002b.cjs");function Vg(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Vg(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Zn(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Vg(e))&&(s&&(s+=" "),s+=t);return s}const kw=e=>{var s,o;const{tabs:t}=e,r=c=>{e.setCurrentTab(c.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),D.jsxRuntimeExports.jsxs(D.jsxRuntimeExports.Fragment,{children:[D.jsxRuntimeExports.jsx("style",{children:`
1
+ "use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),se=require("./index-efaf889f.cjs"),ps=require("./index-4327002b.cjs");function Vg(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Vg(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Zn(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Vg(e))&&(s&&(s+=" "),s+=t);return s}const kw=e=>{var s,o;const{tabs:t}=e,r=c=>{e.setCurrentTab(c.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),D.jsxRuntimeExports.jsxs(D.jsxRuntimeExports.Fragment,{children:[D.jsxRuntimeExports.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;