@ukpc-lib/react 0.16.3-dev.20 → 0.16.3-dev.23
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/components/MenuItem.d.ts +1 -1
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.js +273 -273
- package/dist/{index.esm2017-CfqFJQ9r.cjs → index.esm2017-DRyvZpXK.cjs} +23 -23
- package/dist/{index.esm2017-BGIhKoPQ.js → index.esm2017-DwhyAk8J.js} +366 -366
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +295 -70
- package/dist/theme/ThemeProvider.d.ts +6 -0
- package/dist/theme/index.d.ts +1 -0
- package/package.json +2 -1
- package/web-components-bundle/{SaasThemeProvider-A_eMJWqw.js → SaasThemeProvider-DUpoV8xb.js} +1 -1
- package/web-components-bundle/access-denied/index.js +6 -6
- package/web-components-bundle/base-breadcrumbs/index.js +3 -3
- package/web-components-bundle/favorite-menu/index.js +6 -6
- package/web-components-bundle/global-menu/index.js +5 -5
- package/web-components-bundle/global-topbar/index.js +6 -6
- package/web-components-bundle/has-permission/index.js +2 -2
- package/web-components-bundle/{index-B0KNckiL.js → index-BYJonILY.js} +200 -200
- package/web-components-bundle/{index-CKnnH8IY.js → index-Dkof1OzO.js} +493 -493
- package/web-components-bundle/{index-BwEhsh9S.js → index-N6zjI_u_.js} +2 -2
- package/web-components-bundle/page-not-found/index.js +3 -3
- package/web-components-bundle/{react-to-web-component-BOygDorD.js → react-to-web-component-w5r1Fs9q.js} +1527 -1535
- package/web-components-bundle/{react-toastify.esm-DnABvuky.js → react-toastify.esm-H_Xdunfj.js} +1 -1
- package/web-components-bundle/toast-config/index.js +2 -2
- package/web-components-bundle/toast-config-notification/index.js +2 -2
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.esm2017-DRyvZpXK.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;
|
package/dist/share/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { K as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import { jsx as
|
|
1
|
+
import { K as U, U as D, M as R } from "../index.esm2017-DwhyAk8J.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-DwhyAk8J.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";
|
|
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
|
|
13
|
-
const [
|
|
14
|
-
return
|
|
15
|
-
|
|
12
|
+
const ne = (r) => {
|
|
13
|
+
const [t, e] = H([]);
|
|
14
|
+
return I(() => {
|
|
15
|
+
$.get(`${r}/user-management/api/v1/users/my-account/permissions`, {
|
|
16
16
|
withCredentials: !0
|
|
17
|
-
}).then((
|
|
18
|
-
console.error("Getting user permission error:",
|
|
17
|
+
}).then((i) => e(i.data)).catch((i) => {
|
|
18
|
+
console.error("Getting user permission error:", i);
|
|
19
19
|
});
|
|
20
|
-
}, [
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
var
|
|
25
|
-
let e =
|
|
26
|
-
|
|
27
|
-
}, [
|
|
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) {
|
|
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,62 +32,287 @@ const C = (s) => {
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
function
|
|
36
|
-
open:
|
|
37
|
-
disabled:
|
|
35
|
+
function se({
|
|
36
|
+
open: r,
|
|
37
|
+
disabled: t
|
|
38
38
|
}) {
|
|
39
|
-
|
|
40
|
-
var e,
|
|
41
|
-
|
|
42
|
-
}, [
|
|
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]);
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
axiosInstance:
|
|
47
|
-
baseUrl:
|
|
44
|
+
const _ = (r, t) => (e, i) => {
|
|
45
|
+
const c = U({
|
|
46
|
+
axiosInstance: t,
|
|
47
|
+
baseUrl: r
|
|
48
48
|
}).data;
|
|
49
|
-
return
|
|
50
|
-
(
|
|
49
|
+
return c ? i ? e.every(
|
|
50
|
+
(d) => c == null ? void 0 : c.includes(d)
|
|
51
51
|
) : e.some(
|
|
52
|
-
(
|
|
52
|
+
(d) => c == null ? void 0 : c.includes(d)
|
|
53
53
|
) : !1;
|
|
54
|
-
},
|
|
55
|
-
baseUrl:
|
|
56
|
-
accessWith:
|
|
54
|
+
}, oe = ({
|
|
55
|
+
baseUrl: r,
|
|
56
|
+
accessWith: t,
|
|
57
57
|
requireAll: e,
|
|
58
|
-
children:
|
|
59
|
-
}) =>
|
|
60
|
-
accessWith:
|
|
61
|
-
requireAll:
|
|
58
|
+
children: i
|
|
59
|
+
}) => _(r)(t, e) ? /* @__PURE__ */ O(T, { children: i }) : null, ae = ({
|
|
60
|
+
accessWith: r,
|
|
61
|
+
requireAll: t,
|
|
62
62
|
baseUrl: e,
|
|
63
|
-
children:
|
|
64
|
-
}) =>
|
|
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
|
+
};
|
|
65
289
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
|
93
318
|
};
|
package/dist/theme/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukpc-lib/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.16.3-dev.
|
|
4
|
+
"version": "0.16.3-dev.23",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/",
|
|
7
7
|
"module": "./dist/",
|
|
@@ -62,6 +62,7 @@
|
|
|
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",
|
|
65
66
|
"react-dnd": "^16.0.1",
|
|
66
67
|
"react-i18next": "^12.3.1",
|
|
67
68
|
"react-icons": "^5.0.1",
|
package/web-components-bundle/{SaasThemeProvider-A_eMJWqw.js → SaasThemeProvider-DUpoV8xb.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as j, r as b } from "./react-to-web-component-
|
|
1
|
+
import { a as j, r as b } from "./react-to-web-component-w5r1Fs9q.js";
|
|
2
2
|
function c() {
|
|
3
3
|
return c = Object.assign ? Object.assign.bind() : function(t) {
|
|
4
4
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { U as d } from "../index-
|
|
3
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { U as d } from "../index-BYJonILY.js";
|
|
3
|
+
import "../react-toastify.esm-H_Xdunfj.js";
|
|
4
4
|
import "../toast-config/index.js";
|
|
5
5
|
import "../toast-config-notification/index.js";
|
|
6
|
-
import "../SaasThemeProvider-
|
|
7
|
-
import "../index-
|
|
8
|
-
import "../index-
|
|
6
|
+
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
7
|
+
import "../index-N6zjI_u_.js";
|
|
8
|
+
import "../index-Dkof1OzO.js";
|
|
9
9
|
export {
|
|
10
10
|
d as UnauthorizedPage
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { X as e } from "../index-
|
|
3
|
-
import "../SaasThemeProvider-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { X as e } from "../index-Dkof1OzO.js";
|
|
3
|
+
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
4
4
|
export {
|
|
5
5
|
e as BaseBreadcrumbs
|
|
6
6
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { F as u, u as F } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { F as u, u as F } from "../index-BYJonILY.js";
|
|
3
|
+
import "../index-N6zjI_u_.js";
|
|
4
|
+
import "../index-Dkof1OzO.js";
|
|
5
|
+
import "../react-toastify.esm-H_Xdunfj.js";
|
|
6
6
|
import "../toast-config/index.js";
|
|
7
7
|
import "../toast-config-notification/index.js";
|
|
8
|
-
import "../SaasThemeProvider-
|
|
8
|
+
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
9
9
|
export {
|
|
10
10
|
u as FavoriteMenu,
|
|
11
11
|
F as updateFavoriteItems
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { G as a } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../SaasThemeProvider-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { G as a } from "../index-BYJonILY.js";
|
|
3
|
+
import "../index-N6zjI_u_.js";
|
|
4
|
+
import "../index-Dkof1OzO.js";
|
|
5
|
+
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
6
6
|
export {
|
|
7
7
|
a as GlobalMenu
|
|
8
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { L as n, T as s } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../SaasThemeProvider-
|
|
6
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { L as n, T as s } from "../index-BYJonILY.js";
|
|
3
|
+
import "../index-N6zjI_u_.js";
|
|
4
|
+
import "../index-Dkof1OzO.js";
|
|
5
|
+
import "../SaasThemeProvider-DUpoV8xb.js";
|
|
6
|
+
import "../react-toastify.esm-H_Xdunfj.js";
|
|
7
7
|
import "../toast-config/index.js";
|
|
8
8
|
import "../toast-config-notification/index.js";
|
|
9
9
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { H as o, g as r } from "../index-
|
|
1
|
+
import "../react-to-web-component-w5r1Fs9q.js";
|
|
2
|
+
import { H as o, g as r } from "../index-BYJonILY.js";
|
|
3
3
|
export {
|
|
4
4
|
o as HasPermission,
|
|
5
5
|
r as getUseHasPermission
|