@ukpc-lib/react 0.16.10-sandbox.saas-9834.patch-1 → 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.
Files changed (31) hide show
  1. package/dist/components/FavoriteMenu/components/MenuItem.d.ts +0 -1
  2. package/dist/components/FavoriteMenu/index.d.ts +4 -0
  3. package/dist/components/GlobalMenu/index.d.ts +5 -0
  4. package/dist/components/MenuTabs/index.d.ts +10 -0
  5. package/dist/components/Notification/Tabs/index.d.ts +1 -0
  6. package/dist/components/Topbar/icons/HamburgerIcon.d.ts +4 -0
  7. package/dist/components/Topbar/icons/SearchIcon.d.ts +7 -0
  8. package/dist/components/index.cjs +30 -18
  9. package/dist/components/index.js +2625 -2391
  10. package/dist/components/main.d.ts +1 -1
  11. package/dist/index.esm2017-BzovwrBD.cjs +1078 -0
  12. package/dist/{index.esm2017-Caitdg72.js → index.esm2017-Dl3V5vng.js} +13442 -13117
  13. package/dist/share/index.cjs +1 -1
  14. package/dist/share/index.js +72 -297
  15. package/dist/theme/index.d.ts +0 -1
  16. package/dist/translations/config.d.ts +0 -6
  17. package/package.json +1 -2
  18. package/web-components-bundle/access-denied/index.js +2 -8
  19. package/web-components-bundle/base-breadcrumbs/index.js +1 -1
  20. package/web-components-bundle/favorite-menu/index.js +5 -4
  21. package/web-components-bundle/global-menu/index.js +5 -3
  22. package/web-components-bundle/global-topbar/index.js +5 -4
  23. package/web-components-bundle/has-permission/index.js +1 -1
  24. package/web-components-bundle/{index-Dkof1OzO.js → index-BGXlqh1w.js} +1112 -1123
  25. package/web-components-bundle/index-CEjd1_YL.js +41487 -0
  26. package/web-components-bundle/index-Ch-015PG.js +3528 -0
  27. package/web-components-bundle/page-not-found/index.js +1 -1
  28. package/web-components-bundle/setPrototypeOf-CP0c5ut2.js +14 -0
  29. package/dist/index.esm2017-Dd_pRw5E.cjs +0 -1078
  30. package/dist/theme/ThemeProvider.d.ts +0 -6
  31. package/web-components-bundle/index-DcHZsdYi.js +0 -44453
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.esm2017-Dd_pRw5E.cjs"),R=require("axios"),y=require("react"),U=require("react-router-dom"),g=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");require("react-query");require("react-dom");require("moment");const D=r=>{const[t,e]=y.useState([]);return y.useEffect(()=>{R.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(i=>e(i.data)).catch(i=>{console.error("Getting user permission error:",i)})},[r]),t},H=r=>{const t=U.useLocation();if(y.useEffect(()=>{var i,c;let e=t.pathname+t.search+t.hash;r&&!e.includes(r)&&(e=r+e),console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:",e),(c=(i=window.top)==null?void 0:i.shellNavigate)==null||c.call(i,"/app"+e,{replace:!0})},[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 $({open:r,disabled:t}){y.useMemo(()=>{var e,i,c,u;t||(r?(i=(e=window.top)==null?void 0:e.HostBridge)==null||i.openBackdrop(!0):(u=(c=window.top)==null?void 0:c.HostBridge)==null||u.openBackdrop(!1))},[r,t])}const k=(r,t)=>(e,i)=>{const u=o.useUserPermissions({axiosInstance:t,baseUrl:r}).data;return u?i?e.every(f=>u==null?void 0:u.includes(f)):e.some(f=>u==null?void 0:u.includes(f)):!1},M=({baseUrl:r,accessWith:t,requireAll:e,children:i})=>k(r)(t,e)?g.jsx(g.Fragment,{children:i}):null,q=({accessWith:r,requireAll:t,baseUrl:e,children:i})=>k(e)(r,t)?g.jsx(g.Fragment,{children:i}):g.jsx(o.UnauthorizedPage,{});var p={},I;function z(){if(I)return p;I=1,Object.defineProperty(p,"__esModule",{value:!0}),p.parse=f,p.serialize=_;const r=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,e=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/,c=Object.prototype.toString,u=(()=>{const s=function(){};return s.prototype=Object.create(null),s})();function f(s,l){const n=new u,h=s.length;if(h<2)return n;const w=(l==null?void 0:l.decode)||b;let a=0;do{const d=s.indexOf("=",a);if(d===-1)break;const E=s.indexOf(";",a),S=E===-1?h:E;if(d>S){a=s.lastIndexOf(";",d-1)+1;continue}const v=m(s,a,d),j=x(s,d,v),T=s.slice(v,j);if(n[T]===void 0){let P=m(s,d+1,S),L=x(s,S,P);const N=w(s.slice(P,L));n[T]=N}a=S+1}while(a<h);return n}function m(s,l,n){do{const h=s.charCodeAt(l);if(h!==32&&h!==9)return l}while(++l<n);return n}function x(s,l,n){for(;l>n;){const h=s.charCodeAt(--l);if(h!==32&&h!==9)return l+1}return n}function _(s,l,n){const h=(n==null?void 0:n.encode)||encodeURIComponent;if(!r.test(s))throw new TypeError(`argument name is invalid: ${s}`);const w=h(l);if(!t.test(w))throw new TypeError(`argument val is invalid: ${l}`);let a=s+"="+w;if(!n)return a;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!e.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!i.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!A(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function b(s){if(s.indexOf("%")===-1)return s;try{return decodeURIComponent(s)}catch{return s}}function A(s){return c.call(s)==="[object Date]"}return p}var O=z();function B(){const r=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof r=="boolean"?r:typeof document=="object"&&typeof document.cookie=="string"}function K(r){return typeof r=="string"?O.parse(r):typeof r=="object"&&r!==null?r:{}}function C(r,t={}){const e=V(r);if(!t.doNotParse)try{return JSON.parse(e)}catch{}return r}function V(r){return r&&r[0]==="j"&&r[1]===":"?r.substr(2):r}class F{constructor(t,e={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const c=this.cookies;this.cookies=O.parse(document.cookie),this._checkChanges(c)};const i=typeof document>"u"?"":document.cookie;this.cookies=K(t||i),this.defaultSetOptions=e,this.HAS_DOCUMENT_COOKIE=B()}_emitChange(t){for(let e=0;e<this.changeListeners.length;++e)this.changeListeners[e](t)}_checkChanges(t){new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach(i=>{t[i]!==this.cookies[i]&&this._emitChange({name:i,value:C(this.cookies[i])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(t,e={}){return e.doNotUpdate||this.update(),C(this.cookies[t],e)}getAll(t={}){t.doNotUpdate||this.update();const e={};for(let i in this.cookies)e[i]=C(this.cookies[i],t);return e}set(t,e,i){i?i=Object.assign(Object.assign({},this.defaultSetOptions),i):i=this.defaultSetOptions;const c=typeof e=="string"?e:JSON.stringify(e);this.cookies=Object.assign(Object.assign({},this.cookies),{[t]:c}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=O.serialize(t,c,i)),this._emitChange({name:t,value:e,options:i})}remove(t,e){const i=e=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),e),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=O.serialize(t,"",i)),this._emitChange({name:t,value:void 0,options:e})}addChangeListener(t){this.changeListeners.push(t),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(t){const e=this.changeListeners.indexOf(t);e>=0&&this.changeListeners.splice(e,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}const G=r=>{const t=new F;let i=new URLSearchParams(window.location.search).get("tenantId")||t.get("tenantId");const c=t.get("accessToken")||null;if(console.log("ThemeProvider1:tenantId",i),!i&&c){const f=atob(c.split(".")[1]),m=JSON.parse(f);i=m.tenantId?m.tenantId.toString():null}console.log("ThemeProvider2:tenantId",i);const u=r.isBrand||i!=null?r.viteThemeUrl:"";return console.log("themeUrl",u),g.jsx(o.SaasThemeProvider,{brandTheme:{enabled:!!u,url:u},children:r.children})};exports.AuthContext=o.AuthContext;exports.AuthProvider=o.AuthProvider;exports.ERROR_MESSAGE=o.ERROR_MESSAGE;exports.SaasThemeProvider=o.SaasThemeProvider;exports.TranslationProvider=o.TranslationProvider;exports.axiosInstance=o.axiosInstance;exports.color=o.color;exports.createCustomTheme=o.createCustomTheme;exports.handleErrorAxios=o.handleErrorAxios;exports.login=o.login;exports.logout=o.logout;exports.responseInterceptor=o.responseInterceptor;exports.search=o.search;exports.setFavicon=o.setFavicon;exports.setShellBackdrop=o.setShellBackdrop;exports.translate=o.translate;exports.translationConfig=o.translationConfig;exports.useAuth=o.useAuth;exports.useCustomTranslation=o.useCustomTranslation;exports.useTheme=o.useTheme;exports.useTranslation=o.useTranslation;exports.HasPermission=M;exports.PermissionRoute=q;exports.ThemeProvider=G;exports.getUseHasPermission=k;exports.useGetPermission=D;exports.useSyncBackdrop=$;exports.useSyncRouter=H;
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;
@@ -1,30 +1,30 @@
1
- import { K as U, U as D, M as R } from "../index.esm2017-Caitdg72.js";
2
- import { O as he, R as de, T as fe, a0 as ge, a as me, c as pe, a1 as we, X as Oe, V as Se, W as ye, Y as ke, r as Ce, a2 as xe, s as Ee, t as ve, Z as Ie, e as Te, u as _e, i as be, $ as Pe } from "../index.esm2017-Caitdg72.js";
3
- import $ from "axios";
4
- import { useState as H, useEffect as I, useMemo as M } from "react";
5
- import { useLocation as z } from "react-router-dom";
6
- import { jsx as O, Fragment as T } from "react/jsx-runtime";
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
+ import { useLocation as w } from "react-router-dom";
6
+ import { jsx as i, Fragment as c } from "react/jsx-runtime";
7
7
  import "@r2wc/react-to-web-component";
8
8
  import "@mui/material";
9
9
  import "react-query";
10
10
  import "react-dom";
11
11
  import "moment";
12
- const ne = (r) => {
13
- const [t, e] = H([]);
14
- return I(() => {
15
- $.get(`${r}/user-management/api/v1/users/my-account/permissions`, {
12
+ const C = (e) => {
13
+ const [r, o] = d([]);
14
+ return u(() => {
15
+ f.get(`${e}/user-management/api/v1/users/my-account/permissions`, {
16
16
  withCredentials: !0
17
- }).then((i) => e(i.data)).catch((i) => {
18
- console.error("Getting user permission error:", i);
17
+ }).then((s) => o(s.data)).catch((s) => {
18
+ console.error("Getting user permission error:", s);
19
19
  });
20
- }, [r]), t;
21
- }, re = (r) => {
22
- const t = z();
23
- if (I(() => {
24
- var i, a;
25
- let e = t.pathname + t.search + t.hash;
26
- r && !e.includes(r) && (e = r + e), console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:", e), (a = (i = window.top) == null ? void 0 : i.shellNavigate) == null || a.call(i, "/app" + e, { replace: !0 });
27
- }, [t, r]), window.self === window.top) {
20
+ }, [e]), r;
21
+ }, E = (e) => {
22
+ const r = w();
23
+ if (u(() => {
24
+ var s, a;
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`
@@ -32,287 +32,62 @@ const ne = (r) => {
32
32
  return;
33
33
  }
34
34
  };
35
- function se({
36
- open: r,
37
- disabled: t
35
+ function k({
36
+ open: e,
37
+ disabled: r
38
38
  }) {
39
- M(() => {
40
- var e, i, a, c;
41
- t || (r ? (i = (e = window.top) == null ? void 0 : e.HostBridge) == null || i.openBackdrop(!0) : (c = (a = window.top) == null ? void 0 : a.HostBridge) == null || c.openBackdrop(!1));
42
- }, [r, t]);
39
+ h(() => {
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 _ = (r, t) => (e, i) => {
45
- const c = U({
46
- axiosInstance: t,
47
- baseUrl: r
44
+ const m = (e, r) => (o, s) => {
45
+ const t = p({
46
+ axiosInstance: r,
47
+ baseUrl: e
48
48
  }).data;
49
- return c ? i ? e.every(
50
- (d) => c == null ? void 0 : c.includes(d)
51
- ) : e.some(
52
- (d) => c == null ? void 0 : c.includes(d)
49
+ return t ? s ? o.every(
50
+ (n) => t == null ? void 0 : t.includes(n)
51
+ ) : o.some(
52
+ (n) => t == null ? void 0 : t.includes(n)
53
53
  ) : !1;
54
- }, oe = ({
55
- baseUrl: r,
56
- accessWith: t,
57
- requireAll: e,
58
- children: i
59
- }) => _(r)(t, e) ? /* @__PURE__ */ O(T, { children: i }) : null, ae = ({
60
- accessWith: r,
61
- requireAll: t,
54
+ }, H = ({
62
55
  baseUrl: e,
63
- children: i
64
- }) => _(e)(r, t) ? /* @__PURE__ */ O(T, { children: i }) : /* @__PURE__ */ O(D, {});
65
- var g = {}, v;
66
- function K() {
67
- if (v)
68
- return g;
69
- v = 1, Object.defineProperty(g, "__esModule", { value: !0 }), g.parse = d, g.serialize = b;
70
- const r = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, t = /^[\u0021-\u003A\u003C-\u007E]*$/, e = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, i = /^[\u0020-\u003A\u003D-\u007E]*$/, a = Object.prototype.toString, c = /* @__PURE__ */ (() => {
71
- const s = function() {
72
- };
73
- return s.prototype = /* @__PURE__ */ Object.create(null), s;
74
- })();
75
- function d(s, u) {
76
- const n = new c(), l = s.length;
77
- if (l < 2)
78
- return n;
79
- const m = (u == null ? void 0 : u.decode) || P;
80
- let o = 0;
81
- do {
82
- const h = s.indexOf("=", o);
83
- if (h === -1)
84
- break;
85
- const k = s.indexOf(";", o), p = k === -1 ? l : k;
86
- if (h > p) {
87
- o = s.lastIndexOf(";", h - 1) + 1;
88
- continue;
89
- }
90
- const C = f(s, o, h), L = y(s, h, C), x = s.slice(C, L);
91
- if (n[x] === void 0) {
92
- let E = f(s, h + 1, p), j = y(s, p, E);
93
- const N = m(s.slice(E, j));
94
- n[x] = N;
95
- }
96
- o = p + 1;
97
- } while (o < l);
98
- return n;
99
- }
100
- function f(s, u, n) {
101
- do {
102
- const l = s.charCodeAt(u);
103
- if (l !== 32 && l !== 9)
104
- return u;
105
- } while (++u < n);
106
- return n;
107
- }
108
- function y(s, u, n) {
109
- for (; u > n; ) {
110
- const l = s.charCodeAt(--u);
111
- if (l !== 32 && l !== 9)
112
- return u + 1;
113
- }
114
- return n;
115
- }
116
- function b(s, u, n) {
117
- const l = (n == null ? void 0 : n.encode) || encodeURIComponent;
118
- if (!r.test(s))
119
- throw new TypeError(`argument name is invalid: ${s}`);
120
- const m = l(u);
121
- if (!t.test(m))
122
- throw new TypeError(`argument val is invalid: ${u}`);
123
- let o = s + "=" + m;
124
- if (!n)
125
- return o;
126
- if (n.maxAge !== void 0) {
127
- if (!Number.isInteger(n.maxAge))
128
- throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);
129
- o += "; Max-Age=" + n.maxAge;
130
- }
131
- if (n.domain) {
132
- if (!e.test(n.domain))
133
- throw new TypeError(`option domain is invalid: ${n.domain}`);
134
- o += "; Domain=" + n.domain;
135
- }
136
- if (n.path) {
137
- if (!i.test(n.path))
138
- throw new TypeError(`option path is invalid: ${n.path}`);
139
- o += "; Path=" + n.path;
140
- }
141
- if (n.expires) {
142
- if (!A(n.expires) || !Number.isFinite(n.expires.valueOf()))
143
- throw new TypeError(`option expires is invalid: ${n.expires}`);
144
- o += "; Expires=" + n.expires.toUTCString();
145
- }
146
- if (n.httpOnly && (o += "; HttpOnly"), n.secure && (o += "; Secure"), n.partitioned && (o += "; Partitioned"), n.priority)
147
- switch (typeof n.priority == "string" ? n.priority.toLowerCase() : void 0) {
148
- case "low":
149
- o += "; Priority=Low";
150
- break;
151
- case "medium":
152
- o += "; Priority=Medium";
153
- break;
154
- case "high":
155
- o += "; Priority=High";
156
- break;
157
- default:
158
- throw new TypeError(`option priority is invalid: ${n.priority}`);
159
- }
160
- if (n.sameSite)
161
- switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
162
- case !0:
163
- case "strict":
164
- o += "; SameSite=Strict";
165
- break;
166
- case "lax":
167
- o += "; SameSite=Lax";
168
- break;
169
- case "none":
170
- o += "; SameSite=None";
171
- break;
172
- default:
173
- throw new TypeError(`option sameSite is invalid: ${n.sameSite}`);
174
- }
175
- return o;
176
- }
177
- function P(s) {
178
- if (s.indexOf("%") === -1)
179
- return s;
180
- try {
181
- return decodeURIComponent(s);
182
- } catch {
183
- return s;
184
- }
185
- }
186
- function A(s) {
187
- return a.call(s) === "[object Date]";
188
- }
189
- return g;
190
- }
191
- var w = K();
192
- function V() {
193
- const r = typeof global > "u" ? void 0 : global.TEST_HAS_DOCUMENT_COOKIE;
194
- return typeof r == "boolean" ? r : typeof document == "object" && typeof document.cookie == "string";
195
- }
196
- function B(r) {
197
- return typeof r == "string" ? w.parse(r) : typeof r == "object" && r !== null ? r : {};
198
- }
199
- function S(r, t = {}) {
200
- const e = q(r);
201
- if (!t.doNotParse)
202
- try {
203
- return JSON.parse(e);
204
- } catch {
205
- }
206
- return r;
207
- }
208
- function q(r) {
209
- return r && r[0] === "j" && r[1] === ":" ? r.substr(2) : r;
210
- }
211
- class F {
212
- constructor(t, e = {}) {
213
- this.changeListeners = [], this.HAS_DOCUMENT_COOKIE = !1, this.update = () => {
214
- if (!this.HAS_DOCUMENT_COOKIE)
215
- return;
216
- const a = this.cookies;
217
- this.cookies = w.parse(document.cookie), this._checkChanges(a);
218
- };
219
- const i = typeof document > "u" ? "" : document.cookie;
220
- this.cookies = B(t || i), this.defaultSetOptions = e, this.HAS_DOCUMENT_COOKIE = V();
221
- }
222
- _emitChange(t) {
223
- for (let e = 0; e < this.changeListeners.length; ++e)
224
- this.changeListeners[e](t);
225
- }
226
- _checkChanges(t) {
227
- new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach((i) => {
228
- t[i] !== this.cookies[i] && this._emitChange({
229
- name: i,
230
- value: S(this.cookies[i])
231
- });
232
- });
233
- }
234
- _startPolling() {
235
- this.pollingInterval = setInterval(this.update, 300);
236
- }
237
- _stopPolling() {
238
- this.pollingInterval && clearInterval(this.pollingInterval);
239
- }
240
- get(t, e = {}) {
241
- return e.doNotUpdate || this.update(), S(this.cookies[t], e);
242
- }
243
- getAll(t = {}) {
244
- t.doNotUpdate || this.update();
245
- const e = {};
246
- for (let i in this.cookies)
247
- e[i] = S(this.cookies[i], t);
248
- return e;
249
- }
250
- set(t, e, i) {
251
- i ? i = Object.assign(Object.assign({}, this.defaultSetOptions), i) : i = this.defaultSetOptions;
252
- const a = typeof e == "string" ? e : JSON.stringify(e);
253
- this.cookies = Object.assign(Object.assign({}, this.cookies), { [t]: a }), this.HAS_DOCUMENT_COOKIE && (document.cookie = w.serialize(t, a, i)), this._emitChange({ name: t, value: e, options: i });
254
- }
255
- remove(t, e) {
256
- const i = e = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), e), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 });
257
- this.cookies = Object.assign({}, this.cookies), delete this.cookies[t], this.HAS_DOCUMENT_COOKIE && (document.cookie = w.serialize(t, "", i)), this._emitChange({ name: t, value: void 0, options: e });
258
- }
259
- addChangeListener(t) {
260
- this.changeListeners.push(t), this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1 && (typeof window == "object" && "cookieStore" in window ? window.cookieStore.addEventListener("change", this.update) : this._startPolling());
261
- }
262
- removeChangeListener(t) {
263
- const e = this.changeListeners.indexOf(t);
264
- e >= 0 && this.changeListeners.splice(e, 1), this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0 && (typeof window == "object" && "cookieStore" in window ? window.cookieStore.removeEventListener("change", this.update) : this._stopPolling());
265
- }
266
- removeAllChangeListeners() {
267
- for (; this.changeListeners.length > 0; )
268
- this.removeChangeListener(this.changeListeners[0]);
269
- }
270
- }
271
- const ce = (r) => {
272
- const t = new F();
273
- let i = new URLSearchParams(window.location.search).get("tenantId") || t.get("tenantId");
274
- const a = t.get("accessToken") || null;
275
- if (console.log("ThemeProvider1:tenantId", i), !i && a) {
276
- const d = atob(a.split(".")[1]), f = JSON.parse(d);
277
- i = f.tenantId ? f.tenantId.toString() : null;
278
- }
279
- console.log("ThemeProvider2:tenantId", i);
280
- const c = r.isBrand || i != null ? r.viteThemeUrl : "";
281
- return console.log("themeUrl", c), /* @__PURE__ */ O(
282
- R,
283
- {
284
- brandTheme: { enabled: !!c, url: c },
285
- children: r.children
286
- }
287
- );
288
- };
56
+ accessWith: r,
57
+ requireAll: o,
58
+ children: s
59
+ }) => m(e)(r, o) ? /* @__PURE__ */ i(c, { children: s }) : null, G = ({
60
+ accessWith: e,
61
+ requireAll: r,
62
+ baseUrl: o,
63
+ children: s
64
+ }) => m(o)(e, r) ? /* @__PURE__ */ i(c, { children: s }) : /* @__PURE__ */ i(l, {});
289
65
  export {
290
- he as AuthContext,
291
- de as AuthProvider,
292
- fe as ERROR_MESSAGE,
293
- oe as HasPermission,
294
- ae as PermissionRoute,
295
- R as SaasThemeProvider,
296
- ce as ThemeProvider,
297
- ge as TranslationProvider,
298
- me as axiosInstance,
299
- pe as color,
300
- we as createCustomTheme,
301
- _ as getUseHasPermission,
302
- Oe as handleErrorAxios,
303
- Se as login,
304
- ye as logout,
305
- ke as responseInterceptor,
306
- Ce as search,
307
- xe as setFavicon,
308
- Ee as setShellBackdrop,
309
- ve as translate,
310
- Ie as translationConfig,
311
- Te as useAuth,
312
- _e as useCustomTranslation,
313
- ne as useGetPermission,
314
- se as useSyncBackdrop,
315
- re as useSyncRouter,
316
- be as useTheme,
317
- Pe as useTranslation
66
+ F as AuthContext,
67
+ I as AuthProvider,
68
+ L as ERROR_MESSAGE,
69
+ H as HasPermission,
70
+ G as PermissionRoute,
71
+ M as SaasThemeProvider,
72
+ N as TranslationProvider,
73
+ U as axiosInstance,
74
+ j as color,
75
+ z as createCustomTheme,
76
+ m as getUseHasPermission,
77
+ O as handleErrorAxios,
78
+ V as login,
79
+ X as logout,
80
+ Y as responseInterceptor,
81
+ Z as search,
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,
89
+ k as useSyncBackdrop,
90
+ E as useSyncRouter,
91
+ b as useTheme,
92
+ oo as useTranslation
318
93
  };
@@ -2,4 +2,3 @@ export { color } from './Colors';
2
2
  export type { ColorsType } from './Colors';
3
3
  export * from './Theme';
4
4
  export * from './SaasThemeProvider';
5
- export * from './ThemeProvider';
@@ -1,11 +1,5 @@
1
1
  import { default as i18n } from 'i18next';
2
2
 
3
- declare global {
4
- interface Window {
5
- translations?: Record<string, Record<string, any>>;
6
- resources?: Record<string, Record<string, any>>;
7
- }
8
- }
9
3
  export declare enum Language {
10
4
  en = "en",
11
5
  de = "de"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.16.10-sandbox.saas-9834.patch-1",
4
+ "version": "0.16.11-sandbox.saas-9885.patch-3",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -62,7 +62,6 @@
62
62
  "jquery": "^3.7.1",
63
63
  "moment": "^2.30.1",
64
64
  "react-bootstrap-daterangepicker": "^8.0.0",
65
- "react-cookie": "^8.0.1",
66
65
  "react-dnd": "^16.0.1",
67
66
  "react-i18next": "^12.3.1",
68
67
  "react-icons": "^5.0.1",
@@ -1,11 +1,5 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { U as d } from "../index-DcHZsdYi.js";
3
- import "../react-toastify.esm-H_Xdunfj.js";
4
- import "../toast-config/index.js";
5
- import "../toast-config-notification/index.js";
6
- import "../SaasThemeProvider-DUpoV8xb.js";
7
- import "../index-N6zjI_u_.js";
8
- import "../index-Dkof1OzO.js";
2
+ import { U as e } from "../index-Ch-015PG.js";
9
3
  export {
10
- d as UnauthorizedPage
4
+ e as UnauthorizedPage
11
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { X as e } from "../index-Dkof1OzO.js";
2
+ import { V as e } from "../index-BGXlqh1w.js";
3
3
  import "../SaasThemeProvider-DUpoV8xb.js";
4
4
  export {
5
5
  e as BaseBreadcrumbs
@@ -1,12 +1,13 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { F as u, u as F } from "../index-DcHZsdYi.js";
2
+ import { F, u as v } from "../index-CEjd1_YL.js";
3
3
  import "../index-N6zjI_u_.js";
4
- import "../index-Dkof1OzO.js";
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";
8
8
  import "../SaasThemeProvider-DUpoV8xb.js";
9
+ import "../index-Ch-015PG.js";
9
10
  export {
10
- u as FavoriteMenu,
11
- F as updateFavoriteItems
11
+ F as FavoriteMenu,
12
+ v as updateFavoriteItems
12
13
  };
@@ -1,8 +1,10 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { G as a } from "../index-DcHZsdYi.js";
2
+ import { G as e, a as n } from "../index-CEjd1_YL.js";
3
3
  import "../index-N6zjI_u_.js";
4
- import "../index-Dkof1OzO.js";
4
+ import "../index-BGXlqh1w.js";
5
5
  import "../SaasThemeProvider-DUpoV8xb.js";
6
+ import "../index-Ch-015PG.js";
6
7
  export {
7
- a as GlobalMenu
8
+ e as GlobalMenu,
9
+ n as LanguageDropdown
8
10
  };
@@ -1,12 +1,13 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { L as n, T as s } from "../index-DcHZsdYi.js";
2
+ import { L as s, T as L } from "../index-CEjd1_YL.js";
3
3
  import "../index-N6zjI_u_.js";
4
- import "../index-Dkof1OzO.js";
4
+ import "../index-Ch-015PG.js";
5
+ import "../index-BGXlqh1w.js";
5
6
  import "../SaasThemeProvider-DUpoV8xb.js";
6
7
  import "../react-toastify.esm-H_Xdunfj.js";
7
8
  import "../toast-config/index.js";
8
9
  import "../toast-config-notification/index.js";
9
10
  export {
10
- n as LanguageDropdown,
11
- s as TopBar
11
+ s as LanguageDropdown,
12
+ L as TopBar
12
13
  };
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-w5r1Fs9q.js";
2
- import { H as o, g as r } from "../index-DcHZsdYi.js";
2
+ import { H as o, g as r } from "../index-CEjd1_YL.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission