@ukpc-lib/react 0.3.3 → 0.3.5
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/GlobalMenu/components/MenuItem.d.ts +1 -1
- package/dist/components/index.cjs +23 -23
- package/dist/components/index.js +39 -40
- package/dist/{index.module-fcfb53fb.js → index.module-9e206368.js} +10282 -10160
- package/dist/index.module-ad52e7aa.cjs +1092 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.d.ts +1 -1
- package/dist/share/index.js +19 -17
- package/dist/theme/SaasThemeProvider.d.ts +25 -1
- package/dist/theme/Theme.d.ts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/package.json +1 -1
- package/web-components-bundle/global-menu/index.cjs +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +2 -2
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +2 -2
- package/web-components-bundle/{index-ff7fd2be.cjs → index-12495706.cjs} +1 -1
- package/web-components-bundle/{index-8081b070.js → index-21a54132.js} +1 -1
- package/web-components-bundle/{index-c311c558.cjs → index-25f216cc.cjs} +16 -16
- package/web-components-bundle/{index-feebf9bf.js → index-c5021c14.js} +856 -882
- package/dist/index-5bc96a1f.js +0 -147
- package/dist/index-b3ac4c73.cjs +0 -1
- package/dist/index.module-be2c9027.cjs +0 -1092
- package/dist/share/BrandThemeProvider/Colors.d.ts +0 -33
- package/dist/share/BrandThemeProvider/Theme.d.ts +0 -21
- package/dist/share/BrandThemeProvider/index.d.ts +0 -15
- package/dist/theme/index.cjs +0 -1
- package/dist/theme/index.js +0 -461
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 s=require("../index.module-ad52e7aa.cjs"),d=require("axios"),i=require("react/jsx-runtime"),g=require("react");require("moment");require("@r2wc/react-to-web-component");require("@mui/material");const f=require("react-router-dom");function R({config:n,pushError:o=s.pushError}){const t=d.create(n);t.interceptors.request.use(async e=>(e.headers={Accept:"application/json","Content-Type":"application/json"},e),e=>Promise.reject(e)),t.interceptors.response.use(e=>e,async e=>r(e));async function r(e){var l,h,P,p;console.error("Error 🚨:",e);const a=e.config,u=(h=(l=e.response)==null?void 0:l.data)==null?void 0:h.errorMessage,m=u===s.ERROR_MESSAGE.TOKEN_EXPIRED;return((P=e.response)==null?void 0:P.status)===401?m&&!a._retry?(a._retry=!0,t.post("/authentication/api/v1/auth/refresh-token").then(()=>t(a)).catch(()=>s.login(n.baseURL))):((!u||!m)&&s.login(n.baseURL),Promise.reject("Unauthorized! Please login again.")):(((p=e.response)==null?void 0:p.status)===403?o(s.t("errorMessage.403")):o(s.t(`${u}`)||"Something went wrong!"),Promise.reject(e.response.data))}return t}const T=n=>{const[o,t]=g.useState([]);return g.useEffect(()=>{d.get(`${n}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>t(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[n]),o},c=n=>(o,t)=>{const r=T(n);return t?o.every(e=>r==null?void 0:r.includes(e)):o.some(e=>r==null?void 0:r.includes(e))},v=({baseUrl:n,accessWith:o,requireAll:t,children:r})=>c(n)(o,t)?i.jsx(i.Fragment,{children:r}):null,j=({accessWith:n,requireAll:o,baseUrl:t,unAuthorizedPath:r,children:e})=>c(t)(n,o)?i.jsx(i.Fragment,{children:e}):i.jsx(f.Navigate,{to:r,replace:!0});exports.AuthProvider=s.AuthProvider;exports.SaasThemeProvider=s.SaasThemeProvider;exports.TranslationProvider=s.TranslationProvider;exports.color=s.color;exports.createCustomTheme=s.createCustomTheme;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=v;exports.PermissionRoute=j;exports.getAxiosInstance=R;exports.getUseHasPermission=c;exports.useGetPermission=T;
|
package/dist/share/index.d.ts
CHANGED
package/dist/share/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as l, F as f, p as E, H as R } from "../index.module-9e206368.js";
|
|
2
|
+
import { J as k, V as q, T as F, c as K, R as L, n as b, N as z, M as D, K as J, u as V, U as X, O as $ } from "../index.module-9e206368.js";
|
|
3
3
|
import P from "axios";
|
|
4
|
-
import { jsx as i, Fragment as
|
|
4
|
+
import { jsx as i, Fragment as g } from "react/jsx-runtime";
|
|
5
5
|
import { useState as T, useEffect as v } from "react";
|
|
6
6
|
import "moment";
|
|
7
7
|
import "@r2wc/react-to-web-component";
|
|
@@ -39,7 +39,7 @@ const x = (t) => {
|
|
|
39
39
|
console.error("Getting user permission error:", s);
|
|
40
40
|
});
|
|
41
41
|
}, [t]), n;
|
|
42
|
-
},
|
|
42
|
+
}, d = (t) => (n, r) => {
|
|
43
43
|
const s = x(t);
|
|
44
44
|
return r ? n.every(
|
|
45
45
|
(e) => s == null ? void 0 : s.includes(e)
|
|
@@ -51,27 +51,29 @@ const x = (t) => {
|
|
|
51
51
|
accessWith: n,
|
|
52
52
|
requireAll: r,
|
|
53
53
|
children: s
|
|
54
|
-
}) =>
|
|
54
|
+
}) => d(t)(n, r) ? /* @__PURE__ */ i(g, { children: s }) : null, I = ({
|
|
55
55
|
accessWith: t,
|
|
56
56
|
requireAll: n,
|
|
57
57
|
baseUrl: r,
|
|
58
58
|
unAuthorizedPath: s,
|
|
59
59
|
children: e
|
|
60
|
-
}) =>
|
|
60
|
+
}) => d(r)(t, n) ? /* @__PURE__ */ i(g, { children: e }) : /* @__PURE__ */ i(y, { to: s, replace: !0 });
|
|
61
61
|
export {
|
|
62
|
-
|
|
63
|
-
k as BrandThemeProvider,
|
|
62
|
+
k as AuthProvider,
|
|
64
63
|
H as HasPermission,
|
|
65
64
|
I as PermissionRoute,
|
|
66
|
-
q as
|
|
65
|
+
q as SaasThemeProvider,
|
|
66
|
+
F as TranslationProvider,
|
|
67
|
+
K as color,
|
|
68
|
+
L as createCustomTheme,
|
|
67
69
|
G as getAxiosInstance,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
D as useCustomTranslation,
|
|
70
|
+
d as getUseHasPermission,
|
|
71
|
+
b as search,
|
|
72
|
+
z as translate,
|
|
73
|
+
D as translationConfig,
|
|
74
|
+
J as useAuth,
|
|
75
|
+
V as useCustomTranslation,
|
|
75
76
|
x as useGetPermission,
|
|
76
|
-
|
|
77
|
+
X as useTheme,
|
|
78
|
+
$ as useTranslation
|
|
77
79
|
};
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
1
2
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
+
import { ColorsType } from './Colors';
|
|
4
|
+
type B = {
|
|
5
|
+
url: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const useTheme: () => {
|
|
9
|
+
colors: ColorsType;
|
|
10
|
+
theme: Theme;
|
|
11
|
+
logo: any;
|
|
12
|
+
isFetching: boolean;
|
|
13
|
+
};
|
|
14
|
+
type P = {
|
|
15
|
+
brandTheme: B;
|
|
16
|
+
customTheme?: never;
|
|
17
|
+
} | {
|
|
18
|
+
brandTheme?: never;
|
|
19
|
+
customTheme: Partial<Theme>;
|
|
20
|
+
} | {
|
|
21
|
+
brandTheme?: never;
|
|
22
|
+
customTheme?: never;
|
|
23
|
+
};
|
|
24
|
+
export type BrandThemeProps = PropsWithChildren<P>;
|
|
25
|
+
export declare const SaasThemeProvider: (props: BrandThemeProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
package/dist/theme/Theme.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ declare module '@mui/material/Button' {
|
|
|
17
17
|
type ThemeProps = {
|
|
18
18
|
colors?: ColorsType;
|
|
19
19
|
};
|
|
20
|
-
export declare const createCustomTheme: (
|
|
20
|
+
export declare const createCustomTheme: (props: ThemeProps) => import("@mui/material").Theme;
|
|
21
21
|
export {};
|
package/dist/theme/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-25f216cc.cjs");exports.GlobalMenu=e.GlobalMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-25f216cc.cjs");const e=require("../index-12495706.cjs");require("../index-389a5bed.cjs");exports.TopBar=e.TopBar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../react-to-web-component-469d91d4.js";
|
|
2
|
-
import "../index-
|
|
3
|
-
import { T as i } from "../index-
|
|
2
|
+
import "../index-c5021c14.js";
|
|
3
|
+
import { T as i } from "../index-21a54132.js";
|
|
4
4
|
import "../index-bf404503.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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-12495706.cjs");require("../index-25f216cc.cjs");require("../index-389a5bed.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-
|
|
3
|
-
import "../index-
|
|
2
|
+
import { H as e, g as t } from "../index-21a54132.js";
|
|
3
|
+
import "../index-c5021c14.js";
|
|
4
4
|
import "../index-bf404503.js";
|
|
5
5
|
export {
|
|
6
6
|
e as HasPermission,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),ce=require("./index-
|
|
1
|
+
"use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),ce=require("./index-25f216cc.cjs"),Iu=require("./index-389a5bed.cjs");function qg(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=qg(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=qg(e))&&(s&&(s+=" "),s+=t);return s}function ww({primaryColor:e="#009d4f"}){return D.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:[D.jsxRuntimeExports.jsx("path",{d:"M8.5 19.5H8C4 19.5 2 18.5 2 13.5V8.5C2 4.5 4 2.5 8 2.5H16C20 2.5 22 4.5 22 8.5V13.5C22 17.5 20 19.5 16 19.5H15.5C15.19 19.5 14.89 19.65 14.7 19.9L13.2 21.9C12.54 22.78 11.46 22.78 10.8 21.9L9.3 19.9C9.14 19.68 8.77 19.5 8.5 19.5Z",stroke:e,"stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),D.jsxRuntimeExports.jsx("path",{d:"M15.9965 11.5H16.0054",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),D.jsxRuntimeExports.jsx("path",{d:"M11.9955 11.5H12.0045",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),D.jsxRuntimeExports.jsx("path",{d:"M7.99451 11.5H8.00349",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Sw=e=>{const{tabs:t}=e,r=s=>{e.setCurrentTab(s.target.id)};return D.jsxRuntimeExports.jsxs("div",{className:"tab-container",children:[D.jsxRuntimeExports.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${ce.color.grey200}`},className:"tab-container__title",children:t.map((s,o)=>D.jsxRuntimeExports.jsx("button",{id:s.id,disabled:e.currentTab===`${s.id}`,onClick:r,className:`tab-title ${e.currentTab===`${s.id}`?"is-active":""}`,children:s.tabTitle},o))}),D.jsxRuntimeExports.jsx("div",{className:"tab-content",children:t.map((s,o)=>D.jsxRuntimeExports.jsx("div",{children:e.currentTab===`${s.id}`&&D.jsxRuntimeExports.jsx("div",{children:s.children})},o))})]})};//! moment.js
|
|
2
2
|
//! version : 2.30.1
|
|
3
3
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
4
|
//! license : MIT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as V, r as ee, R as Jp, g as _r, a as Js, c as ha, s as em, b as Ex, d as Ax } from "./react-to-web-component-469d91d4.js";
|
|
2
|
-
import { c as rd, a as ns, p as rl, _ as Le, b as nr, d as Ix, o as Ox, e as Rx, n as Px, S as Nx, L as Lx } from "./index-
|
|
2
|
+
import { c as rd, a as ns, p as rl, _ as Le, b as nr, d as Ix, o as Ox, e as Rx, n as Px, S as Nx, L as Lx } from "./index-c5021c14.js";
|
|
3
3
|
import { _ as $x, L as Qp, i as Fx } from "./index-bf404503.js";
|
|
4
4
|
function tm(e) {
|
|
5
5
|
var t, r, a = "";
|