@ukpc-lib/react 0.4.2 → 0.4.4
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/index.cjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/{index.module-44ec02f0.cjs → index.module-2dd750b7.cjs} +105 -105
- package/dist/{index.module-a5f6062a.js → index.module-c9025b11.js} +3144 -3110
- package/dist/share/AuthProvider/index.d.ts +1 -0
- package/dist/share/hooks/useUserPermissions.d.ts +5 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- package/dist/share/interceptor/index.d.ts +1 -0
- package/package.json +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-84a2cb1e.js → index-f07fb4a6.js} +4165 -4131
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-2dd750b7.cjs"),c=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const m=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{c.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=m(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,replace:!0});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.search=e.search;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=m;
|
package/dist/share/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as R, K as S, M as G, Y as y, W as H, a as M, c as N, X as O, R as j, N as w, O as F, t as I, U as J, T as K, u as U, e as V, n as X, V as Y } from "../index.module-
|
|
1
|
+
import { J as R, K as S, M as G, Y as y, W as H, a as M, c as N, X as O, R as j, N as w, O as F, t as I, U as J, T as K, u as U, e as V, n as X, V as Y } from "../index.module-c9025b11.js";
|
|
2
2
|
import u from "axios";
|
|
3
3
|
import { useState as m, useEffect as c } from "react";
|
|
4
4
|
import { jsx as a, Fragment as n } from "react/jsx-runtime";
|
|
@@ -7,6 +7,7 @@ export declare const logout: (baseURL: string) => void;
|
|
|
7
7
|
declare const axiosInstance: import("axios").AxiosInstance;
|
|
8
8
|
type HandleErrorOptions = {
|
|
9
9
|
handle403?: (error: any) => any;
|
|
10
|
+
handleOtherError?: (error: any) => any;
|
|
10
11
|
disabledPushNotify?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare function handleErrorAxios(error: any, options?: HandleErrorOptions): void | Promise<import("axios").AxiosResponse<any, any>>;
|
package/package.json
CHANGED