@ukpc-lib/react 0.1.25 → 0.1.27
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/assets/icons/avatar.png +0 -0
- package/dist/assets/icons/favicon.png +0 -0
- package/dist/assets/icons/logo-header.png +0 -0
- package/dist/assets/js/firebase-messaging-sw.js +40 -0
- package/dist/components/Notification/NotificationToast/index.d.ts +11 -0
- package/dist/components/Notification/Subcription/index.d.ts +3 -0
- package/dist/components/Notification/firebase/firebaseConfig.d.ts +2 -0
- package/dist/components/Notification/index.d.ts +4 -0
- package/dist/components/index.cjs +41 -27
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +5550 -4875
- package/dist/index.css +1 -1
- package/dist/index.module-35d2f1ab.cjs +1086 -0
- package/dist/index.module-ebc563e0.js +22724 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +8 -8
- package/package.json +3 -2
- package/web-components-bundle/global-menu/index.cjs +950 -44
- package/web-components-bundle/global-menu/index.js +13522 -10146
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +2 -2
- package/web-components-bundle/{index-d6bbe81c.js → index-455ab881.js} +2 -2
- package/dist/index-9cc0ba79.js +0 -19616
- package/dist/index-a2ff7df9.cjs +0 -173
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.module-35d2f1ab.cjs"),l=require("axios"),i=require("react/jsx-runtime"),g=require("react"),R=require("react-router-dom");require("react-dom");require("@mui/material");require("moment");function E({config:t,pushError:n=o.pushError}){const r=l.create(t);r.interceptors.request.use(async e=>(e.headers={Accept:"application/json","Content-Type":"application/json"},e),e=>Promise.reject(e)),r.interceptors.response.use(e=>e,async e=>s(e));async function s(e){var h,p,P;console.error("Error 🚨:",e);const u=e.config,a=(p=(h=e.response)==null?void 0:h.data)==null?void 0:p.errorMessage,m=a===o.ERROR_MESSAGE.TOKEN_EXPIRED;return((P=e.response)==null?void 0:P.status)===401?m&&!u._retry?(u._retry=!0,r.post("/authentication/api/v1/auth/refresh-token").then(()=>r(u)).catch(()=>o.login(t.baseURL))):((!a||!m)&&o.login(t.baseURL),Promise.reject("Unauthorized! Please login again.")):(n(a||"Something went wrong!"),Promise.reject(e.response.data))}return r}const d=t=>{const[n,r]=g.useState([]);return g.useEffect(()=>{l.get(`${t}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>r(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[t]),n},c=t=>(n,r)=>{const s=d(t);return r?n.every(e=>s==null?void 0:s.includes(e)):n.some(e=>s==null?void 0:s.includes(e))},f=({baseUrl:t,accessWith:n,requireAll:r,children:s})=>c(t)(n,r)?i.jsx(i.Fragment,{children:s}):null,j=({accessWith:t,requireAll:n,baseUrl:r,unAuthorizedPath:s,children:e})=>c(r)(t,n)?i.jsx(i.Fragment,{children:e}):i.jsx(R.Navigate,{to:s,replace:!0});exports.AuthProvider=o.AuthProvider;exports.search=o.search;exports.useAuth=o.useAuth;exports.HasPermission=f;exports.PermissionRoute=j;exports.getAxiosInstance=E;exports.getUseHasPermission=c;exports.useGetPermission=d;
|
package/dist/share/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as C,
|
|
1
|
+
import { t as h, p as E, E as g } from "../index.module-ebc563e0.js";
|
|
2
|
+
import { A as C, i as H, u as L } from "../index.module-ebc563e0.js";
|
|
3
3
|
import f from "axios";
|
|
4
4
|
import { jsx as a, Fragment as P } from "react/jsx-runtime";
|
|
5
5
|
import { useState as d, useEffect as R } from "react";
|
|
@@ -7,7 +7,7 @@ import { Navigate as y } from "react-router-dom";
|
|
|
7
7
|
import "react-dom";
|
|
8
8
|
import "@mui/material";
|
|
9
9
|
import "moment";
|
|
10
|
-
function
|
|
10
|
+
function M({
|
|
11
11
|
config: t,
|
|
12
12
|
pushError: n = E
|
|
13
13
|
}) {
|
|
@@ -46,12 +46,12 @@ const x = (t) => {
|
|
|
46
46
|
) : n.some(
|
|
47
47
|
(e) => r == null ? void 0 : r.includes(e)
|
|
48
48
|
);
|
|
49
|
-
},
|
|
49
|
+
}, T = ({
|
|
50
50
|
baseUrl: t,
|
|
51
51
|
accessWith: n,
|
|
52
52
|
requireAll: s,
|
|
53
53
|
children: r
|
|
54
|
-
}) => l(t)(n, s) ? /* @__PURE__ */ a(P, { children: r }) : null,
|
|
54
|
+
}) => l(t)(n, s) ? /* @__PURE__ */ a(P, { children: r }) : null, U = ({
|
|
55
55
|
accessWith: t,
|
|
56
56
|
requireAll: n,
|
|
57
57
|
baseUrl: s,
|
|
@@ -60,9 +60,9 @@ const x = (t) => {
|
|
|
60
60
|
}) => l(s)(t, n) ? /* @__PURE__ */ a(P, { children: e }) : /* @__PURE__ */ a(y, { to: r, replace: !0 });
|
|
61
61
|
export {
|
|
62
62
|
C as AuthProvider,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
T as HasPermission,
|
|
64
|
+
U as PermissionRoute,
|
|
65
|
+
M as getAxiosInstance,
|
|
66
66
|
l as getUseHasPermission,
|
|
67
67
|
H as search,
|
|
68
68
|
L as useAuth,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukpc-lib/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.27",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/",
|
|
7
7
|
"module": "./dist/",
|
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
"@mui/material": "^5.15.4",
|
|
46
46
|
"@r2wc/react-to-web-component": "^2.0.3",
|
|
47
47
|
"@rollup/plugin-replace": "^5.0.5",
|
|
48
|
-
"axios": "
|
|
48
|
+
"axios": "1.6.2",
|
|
49
49
|
"bootstrap-daterangepicker": "^3.1.0",
|
|
50
50
|
"cssnano": "^6.0.3",
|
|
51
|
+
"firebase": "^10.8.1",
|
|
51
52
|
"framer-motion": "^10.18.0",
|
|
52
53
|
"jquery": "^3.7.1",
|
|
53
54
|
"moment": "^2.30.1",
|