react-luminus-components 1.3.95 → 1.3.97
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/README.md +349 -349
- package/dist/.vite/manifest.json +71 -71
- package/dist/FullScreenContainer-B3XJ4xpz.cjs +1 -0
- package/dist/{FullScreenContainer-tp7EFgZX.js → FullScreenContainer-BASfWA5G.js} +1 -1
- package/dist/{Loading-g_FR6g8y.js → Loading-Bsy9x4u-.js} +1 -1
- package/dist/Loading-vPlq1TiB.cjs +1 -0
- package/dist/{nivo-bar.es-D5MjaE5X.js → ResponsiveContextDropdown-8w4v7EXg.js} +6147 -6143
- package/dist/{nivo-bar.es-aGgocNOX.cjs → ResponsiveContextDropdown-DZ3ZSgSi.cjs} +17 -17
- package/dist/SimpleTooltip-CplxJqkO.cjs +1 -0
- package/dist/{SimpleTooltip-D_7vRqv8.js → SimpleTooltip-D0ZxleAX.js} +1 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +52 -52
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +12 -12
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +5 -5
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +2789 -2789
- package/dist/{searchUtils-ze_tIbr9.js → searchUtils-BAQDePU1.js} +1 -1
- package/dist/searchUtils-lQ881iAU.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/{useClipboard-DA82lJOy.js → useClipboard-7n2nAXRP.js} +1 -1
- package/dist/useClipboard-DYH__n8n.cjs +1 -0
- package/dist/{useGetApiData-5A63Fe_4.js → useGetApiData-B0jR0Tnr.js} +6 -6
- package/dist/useGetApiData-djukGgdO.cjs +1 -0
- package/dist/usePermissions-BGlVMETN.cjs +1 -0
- package/dist/usePermissions-C6bgdotQ.js +20 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +20 -20
- package/dist/variables.scss +171 -171
- package/package.json +115 -115
- package/dist/FullScreenContainer-D3y2DqAP.cjs +0 -1
- package/dist/Loading-CLp4Ms4M.cjs +0 -1
- package/dist/SimpleTooltip-E9iyaJGA.cjs +0 -1
- package/dist/searchUtils-DOAuJvYM.cjs +0 -1
- package/dist/useClipboard-Dbp6N9BY.cjs +0 -1
- package/dist/useGetApiData-BsVBZj1s.cjs +0 -1
- package/dist/usePermissions-CTGaCmBJ.cjs +0 -1
- package/dist/usePermissions-Ct_zXS4W.js +0 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./ResponsiveContextDropdown-DZ3ZSgSi.cjs"),i=({text:e,placement:t,children:s})=>o.jsxRuntimeExports.jsx(o.OverlayTrigger,{placement:t,overlay:o.jsxRuntimeExports.jsx(o.Tooltip,{className:"luminus-tooltip",children:e}),children:s});exports.SimpleTooltip=i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as o, a0 as a, bO as e } from "./
|
|
1
|
+
import { j as o, a0 as a, bO as e } from "./ResponsiveContextDropdown-8w4v7EXg.js";
|
|
2
2
|
const l = ({ text: s, placement: r, children: t }) => /* @__PURE__ */ o.jsx(a, { placement: r, overlay: /* @__PURE__ */ o.jsx(e, { className: "luminus-tooltip", children: s }), children: t });
|
|
3
3
|
export {
|
|
4
4
|
l as S
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-DZ3ZSgSi.cjs"),t=require("react"),v=require("@azure/msal-browser"),w=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const b=require("./Loading-vPlq1TiB.cjs"),k=require("./useGetApiData-djukGgdO.cjs"),I=require("./useLocalStorageState-BFc8Gc8H.cjs");function P(s){const u=e.toDate(s);return u.setHours(23,59,59,999),u}function T(){return P(Date.now())}function M(s,u){const n=+e.toDate(s),[o,r]=[+e.toDate(u.start),+e.toDate(u.end)].sort((a,i)=>a-i);return n>=o&&n<=r}function A(){return e.startOfDay(Date.now())}const O=({children:s})=>{const[u,n]=t.useState(!1),[o,r]=t.useState(""),a=t.useCallback(c=>{n(!0),r(c)},[]),i=t.useCallback(()=>{n(!1)},[]),l=t.useMemo(()=>({show:u,text:o,showConfirm:a,hideConfirm:i}),[u,o,a,i]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:l,children:[e.jsxRuntimeExports.jsx(F,{}),s]})},N=()=>{const{texts:{confirm:s}}=t.useContext(e.LuminusComponentsContext),{isShown:u,text:n,onFinish:o}=e.usePrompt(),{options:r}=t.useContext(e.PromptContext),[a,i]=t.useState(r.defaultValue??""),l=t.useCallback(()=>{o(null)},[o]),c=t.useCallback(f=>{f.preventDefault(),!(r.required&&!a)&&o(a)},[o,r.required,a]);t.useEffect(()=>{u===!0&&i(r.defaultValue??"")},[u,r.defaultValue]);const d=t.useMemo(()=>({value:a,onChange:f=>i(f.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return e.jsxRuntimeExports.jsxs(e.Modal,{show:u,size:"sm",centered:!0,onHide:l,children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:n})}),e.jsxRuntimeExports.jsxs("form",{onSubmit:c,children:[e.jsxRuntimeExports.jsxs(e.Modal.Body,{children:[r.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...d,rows:5}):void 0,r.input==="input"?e.jsxRuntimeExports.jsx(e.FormControl,{...d,type:r.type}):void 0]}),e.jsxRuntimeExports.jsxs(e.Modal.Footer,{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(e.PrimaryButton,{variant:"outlined",color:"secondary",onClick:l,className:"flex-grow-1",children:s.cancel}),e.jsxRuntimeExports.jsx(e.PrimaryButton,{color:"primary",disabled:r.required&&!a,type:"submit",className:"flex-grow-1",children:s.confirm})]})]})]})},U=({children:s})=>{const[u,n]=t.useState(!1),[o,r]=t.useState(""),[a,i]=t.useState({input:"textarea",type:"text"}),l=t.useRef(()=>{}),c=t.useCallback(C=>{r(C),n(!0)},[]),d=t.useCallback(()=>{n(!1)},[]),f=t.useMemo(()=>({isShown:u,text:o,showPrompt:c,hidePrompt:d,resolveRef:l,options:a,setOptions:i}),[u,o,c,d,a]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:f,children:[s,e.jsxRuntimeExports.jsx(N,{})]})},G=({cookieDomain:s,axiosOptions:u,language:n,texts:o,ProjectIconComponent:r,localizationContext:a,chartColorPalette:i,children:l})=>{const c=t.useMemo(()=>({axiosOptions:u,cookieDomain:s,language:n,texts:o,ProjectIconComponent:r,localizationContext:a,chartColorPalette:i}),[u,s,n,r,a,o,i]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:c,children:e.jsxRuntimeExports.jsx(O,{children:e.jsxRuntimeExports.jsxs(U,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),l]})})})},q=({children:s})=>{const[u,n]=t.useState(!1),[o]=t.useState(new Set),r=t.useCallback(l=>{o.add(l),n(!0)},[o]),a=t.useCallback(l=>{o.delete(l),o.size===0&&n(!1)},[o]),i=t.useMemo(()=>({isLoading:u,startLoading:r,stopLoading:a}),[u,r,a]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:i,children:[u&&e.jsxRuntimeExports.jsx(b.Loading,{}),s]})},_=({children:s})=>{const u=e.useAxios(),{msalInstance:n}=t.useContext(e.AuthContext),{delegation:o,setDelegation:r,setAvailableDelegations:a,refreshAvailableDelegations:i}=t.useContext(e.DelegationContext),{getToken:l}=e.useAuth(),[c,d]=t.useState(null),f=t.useCallback(async()=>{const x=await l();x&&d(x)},[l]);t.useEffect(()=>{f()},[f]);const p=t.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[E,h]=t.useState({state:p?e.LoginState.LOGGED_IN:e.LoginState.LOGGING_IN,user:p}),L=t.useCallback(async x=>{let m=null;return await u.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(S=>{m=S.data}).catch(()=>{m=null}),m},[u]),R=t.useCallback(()=>{localStorage.removeItem("user"),h({state:e.LoginState.LOGGED_OUT,user:null}),r(null),a(null)},[a,r]),j=t.useCallback(async x=>{h({state:e.LoginState.LOGGING_IN,user:null});const m=await L(x);return m?(h({state:e.LoginState.LOGGED_IN,user:m}),localStorage.setItem("user",JSON.stringify(m)),await i(),!0):(h({state:e.LoginState.LOGIN_FAILED,user:null}),!1)},[L,i]),g=t.useCallback(()=>{R()},[R]);t.useEffect(()=>{if(n){const x=n.addEventCallback(m=>{if(m.eventType===v.EventType.LOGIN_SUCCESS&&m.payload){const S=m.payload;d(S.accessToken)}});return()=>{x&&n.removeEventCallback(x)}}return()=>{}},[n,j,g]);const y=t.useCallback(async x=>{x&&await j(x).catch(()=>{g(),r(null)})},[j,g,r]);t.useEffect(()=>{y(c)},[c,o==null?void 0:o.id,y]);const D=t.useMemo(()=>({user:E.user,userLoginState:E,loginUser:j,logoutUser:g}),[E,j,g]);return e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:D,children:s})},B=({...s})=>{const{cookieDomain:u}=t.useContext(e.LuminusComponentsContext),[,n]=e.useCookies(["Authorization"]),o=t.useMemo(()=>({useMsal:s.useMsal??!1,msalInstance:s.useMsal?s.msalInstance??null:null,msalScopes:s.useMsal?s.msalScopes??[]:[]}),[s]);return t.useEffect(()=>{if(s.useMsal){const r=s.msalInstance.addEventCallback(a=>{if(a.eventType===v.EventType.LOGIN_SUCCESS||a.eventType===v.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const i=a.payload,l=i.account;s.msalInstance.setActiveAccount(l);const c=i.accessToken,d=i.expiresOn;n("Authorization",c,{path:"/",secure:!0,sameSite:"none",domain:u,expires:d??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{r&&s.msalInstance.removeEventCallback(r)}}return()=>{}},[s,n,u]),e.jsxRuntimeExports.jsx(e.AuthContext.Provider,{value:o,children:s.useMsal?e.jsxRuntimeExports.jsx(w.MsalProvider,{instance:s.msalInstance,children:s.children}):s.children})},z=({children:s,relativeEndpoint:u})=>{const[n,o,r]=I.useLocalStorageState("user-delegation",null),a=t.useMemo(()=>{if(!n)return null;const C=n.from?e.parseISO(n.from):A(),p=n.to?e.parseISO(n.to):T();return M(new Date(Date.now()),{start:C,end:p})?n:(o(null),null)},[n,o]),{data:i,setData:l,reloadData:c}=k.useGetApiData(u,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),d=t.useRef(null);t.useEffect(()=>{const C=()=>{c(),d.current=window.setTimeout(C,e.msToStartOfNextDay()+5e3)};return C(),()=>{d.current!==null&&window.clearTimeout(d.current)}},[c]),t.useEffect(()=>{const C=()=>{r()};return window.addEventListener("focus",C),()=>{window.removeEventListener("focus",C)}},[r,c]);const f=t.useMemo(()=>({delegation:a,setDelegation:o,availableDelegations:i,setAvailableDelegations:l,refreshAvailableDelegations:c}),[a,o,i,l,c]);return e.jsxRuntimeExports.jsx(e.DelegationContext.Provider,{value:f,children:s})},F=()=>{const{texts:{confirm:s}}=t.useContext(e.LuminusComponentsContext),{onConfirm:u,onCancel:n,text:o,show:r}=e.useConfirm();return e.jsxRuntimeExports.jsxs(e.Modal,{show:r,size:"sm",centered:!0,onHide:n,children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:o})}),e.jsxRuntimeExports.jsx(e.Modal.Body,{children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(e.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:n,children:s.no}),e.jsxRuntimeExports.jsx(e.PrimaryButton,{type:"button",color:"primary",onClick:u,className:"w-100 ml",children:s.yes})]})})]})};exports.AuthContext=e.AuthContext;exports.DelegationContext=e.DelegationContext;exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.AuthProvider=B;exports.DelegationProvider=z;exports.LoadingProvider=q;exports.LuminusComponentsProvider=G;exports.UserProvider=_;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as b, b9 as
|
|
2
|
-
import { useState as v, useCallback as d, useMemo as S, useContext as
|
|
3
|
-
import { EventType as
|
|
4
|
-
import { MsalProvider as
|
|
1
|
+
import { t as b, b9 as B, j as r, ba as F, a3 as T, a_ as H, bb as U, ae as g, aZ as q, a4 as L, bc as V, aQ as J, as as Q, ay as _, bd as M, az as K, aB as w, aA as W, be as Z, aO as G, bf as $, aS as X } from "./ResponsiveContextDropdown-8w4v7EXg.js";
|
|
2
|
+
import { useState as v, useCallback as d, useMemo as S, useContext as y, useEffect as C, useRef as R } from "react";
|
|
3
|
+
import { EventType as P } from "@azure/msal-browser";
|
|
4
|
+
import { MsalProvider as Y } from "@azure/msal-react";
|
|
5
5
|
import "react-router-dom";
|
|
6
6
|
import "react-hook-form";
|
|
7
7
|
import "react-flexmonster";
|
|
8
|
-
import { L as ee } from "./Loading-
|
|
9
|
-
import { u as te } from "./useGetApiData-
|
|
8
|
+
import { L as ee } from "./Loading-Bsy9x4u-.js";
|
|
9
|
+
import { u as te } from "./useGetApiData-B0jR0Tnr.js";
|
|
10
10
|
import { u as se } from "./useLocalStorageState-Bt99kkCr.js";
|
|
11
11
|
function ne(e) {
|
|
12
12
|
const a = b(e);
|
|
@@ -23,7 +23,7 @@ function ae(e, a) {
|
|
|
23
23
|
return t >= s && t <= n;
|
|
24
24
|
}
|
|
25
25
|
function re() {
|
|
26
|
-
return
|
|
26
|
+
return B(Date.now());
|
|
27
27
|
}
|
|
28
28
|
const ie = ({ children: e }) => {
|
|
29
29
|
const [a, t] = v(!1), [s, n] = v(""), o = d((c) => {
|
|
@@ -31,12 +31,12 @@ const ie = ({ children: e }) => {
|
|
|
31
31
|
}, []), i = d(() => {
|
|
32
32
|
t(!1);
|
|
33
33
|
}, []), l = S(() => ({ show: a, text: s, showConfirm: o, hideConfirm: i }), [a, s, o, i]);
|
|
34
|
-
return /* @__PURE__ */ r.jsxs(
|
|
34
|
+
return /* @__PURE__ */ r.jsxs(F.Provider, { value: l, children: [
|
|
35
35
|
/* @__PURE__ */ r.jsx(ue, {}),
|
|
36
36
|
e
|
|
37
37
|
] });
|
|
38
38
|
}, le = () => {
|
|
39
|
-
const { texts: { confirm: e } } =
|
|
39
|
+
const { texts: { confirm: e } } = y(T), { isShown: a, text: t, onFinish: s } = H(), { options: n } = y(U), [o, i] = v(n.defaultValue ?? ""), l = d(() => {
|
|
40
40
|
s(null);
|
|
41
41
|
}, [s]), c = d((x) => {
|
|
42
42
|
x.preventDefault(), !(n.required && !o) && s(o);
|
|
@@ -83,7 +83,7 @@ const ie = ({ children: e }) => {
|
|
|
83
83
|
e,
|
|
84
84
|
/* @__PURE__ */ r.jsx(le, {})
|
|
85
85
|
] });
|
|
86
|
-
},
|
|
86
|
+
}, ye = ({ cookieDomain: e, axiosOptions: a, language: t, texts: s, ProjectIconComponent: n, localizationContext: o, chartColorPalette: i, children: l }) => {
|
|
87
87
|
const c = S(() => ({
|
|
88
88
|
axiosOptions: a,
|
|
89
89
|
cookieDomain: e,
|
|
@@ -105,7 +105,7 @@ const ie = ({ children: e }) => {
|
|
|
105
105
|
/* @__PURE__ */ r.jsx(V, {}),
|
|
106
106
|
l
|
|
107
107
|
] }) }) });
|
|
108
|
-
},
|
|
108
|
+
}, je = ({ children: e }) => {
|
|
109
109
|
const [a, t] = v(!1), [s] = v(/* @__PURE__ */ new Set()), n = d((l) => {
|
|
110
110
|
s.add(l), t(!0);
|
|
111
111
|
}, [s]), o = d((l) => {
|
|
@@ -115,38 +115,38 @@ const ie = ({ children: e }) => {
|
|
|
115
115
|
a && /* @__PURE__ */ r.jsx(ee, {}),
|
|
116
116
|
e
|
|
117
117
|
] });
|
|
118
|
-
},
|
|
119
|
-
const a = Q(), { msalInstance: t } =
|
|
118
|
+
}, Ie = ({ children: e }) => {
|
|
119
|
+
const a = Q(), { msalInstance: t } = y(_), { delegation: s, setDelegation: n, setAvailableDelegations: o, refreshAvailableDelegations: i } = y(M), { getToken: l } = K(), [c, m] = v(null), x = d(async () => {
|
|
120
120
|
const u = await l();
|
|
121
121
|
u && m(u);
|
|
122
122
|
}, [l]);
|
|
123
123
|
C(() => {
|
|
124
124
|
x();
|
|
125
125
|
}, [x]);
|
|
126
|
-
const
|
|
126
|
+
const p = d(() => {
|
|
127
127
|
const u = localStorage.getItem("user") ?? null;
|
|
128
128
|
return u ? JSON.parse(u ?? "") : null;
|
|
129
129
|
}, [])(), [N, D] = v({
|
|
130
|
-
state:
|
|
131
|
-
user:
|
|
132
|
-
}),
|
|
130
|
+
state: p ? w.LOGGED_IN : w.LOGGING_IN,
|
|
131
|
+
user: p
|
|
132
|
+
}), A = d(async (u) => {
|
|
133
133
|
let f = null;
|
|
134
|
-
return await a.get("/user/detail", u ? { headers: { Authorization: `Bearer ${u}` } } : void 0).then((
|
|
135
|
-
f =
|
|
134
|
+
return await a.get("/user/detail", u ? { headers: { Authorization: `Bearer ${u}` } } : void 0).then((O) => {
|
|
135
|
+
f = O.data;
|
|
136
136
|
}).catch(() => {
|
|
137
137
|
f = null;
|
|
138
138
|
}), f;
|
|
139
|
-
}, [a]),
|
|
139
|
+
}, [a]), E = d(() => {
|
|
140
140
|
localStorage.removeItem("user"), D({
|
|
141
141
|
state: w.LOGGED_OUT,
|
|
142
142
|
user: null
|
|
143
143
|
}), n(null), o(null);
|
|
144
|
-
}, [o, n]),
|
|
144
|
+
}, [o, n]), j = d(async (u) => {
|
|
145
145
|
D({
|
|
146
146
|
state: w.LOGGING_IN,
|
|
147
147
|
user: null
|
|
148
148
|
});
|
|
149
|
-
const f = await
|
|
149
|
+
const f = await A(u);
|
|
150
150
|
return f ? (D({
|
|
151
151
|
state: w.LOGGED_IN,
|
|
152
152
|
user: f
|
|
@@ -154,15 +154,15 @@ const ie = ({ children: e }) => {
|
|
|
154
154
|
state: w.LOGIN_FAILED,
|
|
155
155
|
user: null
|
|
156
156
|
}), !1);
|
|
157
|
-
}, [
|
|
158
|
-
|
|
159
|
-
}, [
|
|
157
|
+
}, [A, i]), I = d(() => {
|
|
158
|
+
E();
|
|
159
|
+
}, [E]);
|
|
160
160
|
C(() => {
|
|
161
161
|
if (t) {
|
|
162
162
|
const u = t.addEventCallback((f) => {
|
|
163
|
-
if (f.eventType ===
|
|
164
|
-
const
|
|
165
|
-
m(
|
|
163
|
+
if (f.eventType === P.LOGIN_SUCCESS && f.payload) {
|
|
164
|
+
const O = f.payload;
|
|
165
|
+
m(O.accessToken);
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
return () => {
|
|
@@ -171,24 +171,24 @@ const ie = ({ children: e }) => {
|
|
|
171
171
|
}
|
|
172
172
|
return () => {
|
|
173
173
|
};
|
|
174
|
-
}, [t,
|
|
175
|
-
const
|
|
176
|
-
u && await
|
|
177
|
-
|
|
174
|
+
}, [t, j, I]);
|
|
175
|
+
const k = d(async (u) => {
|
|
176
|
+
u && await j(u).catch(() => {
|
|
177
|
+
I(), n(null);
|
|
178
178
|
});
|
|
179
|
-
}, [
|
|
179
|
+
}, [j, I, n]);
|
|
180
180
|
C(() => {
|
|
181
|
-
|
|
182
|
-
}, [c, s == null ? void 0 : s.id,
|
|
183
|
-
const
|
|
181
|
+
k(c);
|
|
182
|
+
}, [c, s == null ? void 0 : s.id, k]);
|
|
183
|
+
const z = S(() => ({
|
|
184
184
|
user: N.user,
|
|
185
185
|
userLoginState: N,
|
|
186
|
-
loginUser:
|
|
187
|
-
logoutUser:
|
|
188
|
-
}), [N,
|
|
189
|
-
return /* @__PURE__ */ r.jsx(W.Provider, { value:
|
|
190
|
-
},
|
|
191
|
-
const { cookieDomain: a } =
|
|
186
|
+
loginUser: j,
|
|
187
|
+
logoutUser: I
|
|
188
|
+
}), [N, j, I]);
|
|
189
|
+
return /* @__PURE__ */ r.jsx(W.Provider, { value: z, children: e });
|
|
190
|
+
}, pe = ({ ...e }) => {
|
|
191
|
+
const { cookieDomain: a } = y(T), [, t] = Z(["Authorization"]), s = S(() => ({
|
|
192
192
|
useMsal: e.useMsal ?? !1,
|
|
193
193
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
194
194
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
@@ -196,7 +196,7 @@ const ie = ({ children: e }) => {
|
|
|
196
196
|
return C(() => {
|
|
197
197
|
if (e.useMsal) {
|
|
198
198
|
const n = e.msalInstance.addEventCallback((o) => {
|
|
199
|
-
if (o.eventType ===
|
|
199
|
+
if (o.eventType === P.LOGIN_SUCCESS || o.eventType === P.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
200
200
|
const i = o.payload, l = i.account;
|
|
201
201
|
e.msalInstance.setActiveAccount(l);
|
|
202
202
|
const c = i.accessToken, m = i.expiresOn;
|
|
@@ -216,20 +216,20 @@ const ie = ({ children: e }) => {
|
|
|
216
216
|
}
|
|
217
217
|
return () => {
|
|
218
218
|
};
|
|
219
|
-
}, [e, t, a]), /* @__PURE__ */ r.jsx(_.Provider, { value: s, children: e.useMsal ? /* @__PURE__ */ r.jsx(
|
|
219
|
+
}, [e, t, a]), /* @__PURE__ */ r.jsx(_.Provider, { value: s, children: e.useMsal ? /* @__PURE__ */ r.jsx(Y, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
220
220
|
}, De = ({ children: e, relativeEndpoint: a }) => {
|
|
221
221
|
const [t, s, n] = se("user-delegation", null), o = S(() => {
|
|
222
222
|
if (!t)
|
|
223
223
|
return null;
|
|
224
|
-
const h = t.from ? G(t.from) : re(),
|
|
225
|
-
return ae(new Date(Date.now()), { start: h, end:
|
|
224
|
+
const h = t.from ? G(t.from) : re(), p = t.to ? G(t.to) : oe();
|
|
225
|
+
return ae(new Date(Date.now()), { start: h, end: p }) ? t : (s(null), null);
|
|
226
226
|
}, [t, s]), { data: i, setData: l, reloadData: c } = te(a, {
|
|
227
227
|
nullStateBeforeLoad: !1,
|
|
228
228
|
nullStateOnFail: !0
|
|
229
229
|
}), m = R(null);
|
|
230
230
|
C(() => {
|
|
231
231
|
const h = () => {
|
|
232
|
-
c(), m.current = window.setTimeout(h,
|
|
232
|
+
c(), m.current = window.setTimeout(h, $() + 5e3);
|
|
233
233
|
};
|
|
234
234
|
return h(), () => {
|
|
235
235
|
m.current !== null && window.clearTimeout(m.current);
|
|
@@ -257,7 +257,7 @@ const ie = ({ children: e }) => {
|
|
|
257
257
|
]);
|
|
258
258
|
return /* @__PURE__ */ r.jsx(M.Provider, { value: x, children: e });
|
|
259
259
|
}, ue = () => {
|
|
260
|
-
const { texts: { confirm: e } } =
|
|
260
|
+
const { texts: { confirm: e } } = y(T), { onConfirm: a, onCancel: t, text: s, show: n } = X();
|
|
261
261
|
return /* @__PURE__ */ r.jsxs(g, { show: n, size: "sm", centered: !0, onHide: t, children: [
|
|
262
262
|
/* @__PURE__ */ r.jsx(g.Header, { className: "justify-content-center", children: /* @__PURE__ */ r.jsx(g.Title, { children: s }) }),
|
|
263
263
|
/* @__PURE__ */ r.jsx(g.Body, { children: /* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
@@ -268,13 +268,13 @@ const ie = ({ children: e }) => {
|
|
|
268
268
|
};
|
|
269
269
|
export {
|
|
270
270
|
_ as AuthContext,
|
|
271
|
-
|
|
271
|
+
pe as AuthProvider,
|
|
272
272
|
M as DelegationContext,
|
|
273
273
|
De as DelegationProvider,
|
|
274
274
|
J as LoadingContext,
|
|
275
|
-
|
|
275
|
+
je as LoadingProvider,
|
|
276
276
|
T as LuminusComponentsContext,
|
|
277
|
-
|
|
277
|
+
ye as LuminusComponentsProvider,
|
|
278
278
|
W as UserContext,
|
|
279
|
-
|
|
279
|
+
Ie as UserProvider
|
|
280
280
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./ResponsiveContextDropdown-DZ3ZSgSi.cjs"),u=require("./useClipboard-DYH__n8n.cjs"),l=require("./usePermissions-BGlVMETN.cjs"),m=require("./useGetApiData-djukGgdO.cjs"),c=require("react"),d=require("./useLocalStorageState-BFc8Gc8H.cjs"),h=a=>{let e="pending",t;const o=a.then(r=>{e="success",t=r},r=>{e="error",t=r});return()=>{switch(e){case"pending":throw o;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function S(a,e){const t=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[o,r]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=t.get(a).then(i=>i.data);r(h(n))})()},[t,a]),o}exports.cancelToken=s.cancelToken;exports.useAuth=s.useAuth;exports.useAxios=s.useAxios;exports.useConfirm=s.useConfirm;exports.useFormControlType=s.useFormControlType;exports.useNotifications=s.useNotifications;exports.usePrompt=s.usePrompt;exports.useZodSchemaTypes=s.useZodSchemaTypes;exports.useClickOutside=u.useClickOutside;exports.useClipboard=u.useClipboard;exports.useEmployeePhotoPath=u.useEmployeePhotoPath;exports.useKeyPress=u.useKeyPress;exports.useSearchQuery=u.useSearchQuery;exports.useSearchQueryState=u.useSearchQueryState;exports.usePermissions=l.usePermissions;exports.useGetApiData=m.useGetApiData;exports.useLocalStorageState=d.useLocalStorageState;exports.useGetDataBound=S;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bg as
|
|
3
|
-
import { b, u as C, e as A, a as B, c as E, d as U } from "./useClipboard-
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
1
|
+
import { as as c } from "./ResponsiveContextDropdown-8w4v7EXg.js";
|
|
2
|
+
import { bg as S, az as g, aS as y, aF as w, aR as k, a_ as D, bh as P } from "./ResponsiveContextDropdown-8w4v7EXg.js";
|
|
3
|
+
import { b, u as C, e as A, a as B, c as E, d as U } from "./useClipboard-7n2nAXRP.js";
|
|
4
|
+
import { u as G } from "./usePermissions-C6bgdotQ.js";
|
|
5
|
+
import { u as z } from "./useGetApiData-B0jR0Tnr.js";
|
|
6
6
|
import { useState as n, useEffect as m } from "react";
|
|
7
7
|
import { u as L } from "./useLocalStorageState-Bt99kkCr.js";
|
|
8
8
|
const f = (t) => {
|
|
@@ -25,7 +25,7 @@ const f = (t) => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function d(t, e) {
|
|
29
29
|
const s = c({
|
|
30
30
|
silent: !0,
|
|
31
31
|
differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
|
|
@@ -39,20 +39,20 @@ function p(t, e) {
|
|
|
39
39
|
}, [s, t]), r;
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
S as cancelToken,
|
|
43
|
+
g as useAuth,
|
|
44
44
|
c as useAxios,
|
|
45
45
|
b as useClickOutside,
|
|
46
46
|
C as useClipboard,
|
|
47
|
-
|
|
47
|
+
y as useConfirm,
|
|
48
48
|
A as useEmployeePhotoPath,
|
|
49
49
|
w as useFormControlType,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
z as useGetApiData,
|
|
51
|
+
d as useGetDataBound,
|
|
52
52
|
B as useKeyPress,
|
|
53
53
|
L as useLocalStorageState,
|
|
54
54
|
k as useNotifications,
|
|
55
|
-
|
|
55
|
+
G as usePermissions,
|
|
56
56
|
D as usePrompt,
|
|
57
57
|
E as useSearchQuery,
|
|
58
58
|
U as useSearchQueryState,
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-DZ3ZSgSi.cjs"),j=require("react"),N=require("react-router-dom");require("react-hook-form");require("react-flexmonster");const M=require("./SimpleTooltip-CplxJqkO.cjs");require("@azure/msal-browser");require("@azure/msal-react");const B=require("./usePermissions-BGlVMETN.cjs"),b=require("./FullScreenContainer-B3XJ4xpz.cjs"),k="_side-menu-item_4dpnz_1",C="_disabled_4dpnz_6",z="_nav-button_4dpnz_10",P="_child_4dpnz_18",S="_text_4dpnz_22",y="_icon_4dpnz_29",I="_collapse-icon_4dpnz_35",T="_collapsed_4dpnz_45",g="_expanded_4dpnz_52",q="_children-container_4dpnz_58",w="_visible_4dpnz_66",H="_children_4dpnz_58",i={"side-menu-item":"_side-menu-item_4dpnz_1",sideMenuItem:k,disabled:C,"nav-button":"_nav-button_4dpnz_10",navButton:z,child:P,text:S,icon:y,"collapse-icon":"_collapse-icon_4dpnz_35",collapseIcon:I,collapsed:T,expanded:g,"children-container":"_children-container_4dpnz_58",childrenContainer:q,visible:w,children:H},L=({item:s,menuExpanded:o,children:a})=>s.tooltip&&!o?e.jsxRuntimeExports.jsx(M.SimpleTooltip,{text:s.tooltip,placement:"right",children:a}):a,R=({item:s,menuExpanded:o,collapsed:a,onCollapse:r,currentPath:l})=>{var h,v,m,t;const[c,u]=j.useState(!1),[p]=l.split("?"),d=s.linkTo===p||((h=s.children)==null?void 0:h.some(n=>n.linkTo===p));return e.jsxRuntimeExports.jsxs("li",{className:e.classNames("luminus-side-menu-item",i.sideMenuItem,{[i.expanded]:o},{active:c||d},{open:a&&s.children},{[i.disabled]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(n=>n.notPermitted||n.disabled))},{disabled:s.disabled||s.notPermitted||((m=s.children)==null?void 0:m.every(n=>n.notPermitted||n.disabled))}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[e.jsxRuntimeExports.jsx(L,{item:s,menuExpanded:o,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",i.navButton),onClick:()=>r(),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",i.collapseIcon,{[i.collapsed]:a}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(N.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",i.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",i.childrenContainer,{[i.visible]:a}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",i.children),children:(t=s.children)==null?void 0:t.map(n=>e.jsxRuntimeExports.jsx(N.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link child rounded",i.navButton,i.child,{[i.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},$="_side-menu_n1hvm_1",f="_sidebar-header_n1hvm_13",F="_side-menu-content_n1hvm_18",A="_expand_n1hvm_22",D="_divider_n1hvm_26",_={"side-menu":"_side-menu_n1hvm_1",sideMenu:$,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:f,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:F,expand:A,divider:D},K=({headerItem:s,mainItems:o,secondaryItems:a,expanded:r,setExpanded:l,currentPath:c})=>{const[u,p]=j.useState(-1),{checkUserHasPermissions:d}=B.usePermissions(),h=j.useMemo(()=>o.map(t=>{var n;return{...t,notPermitted:!d(t.permissions??[],"any"),children:(n=t.children)==null?void 0:n.map(x=>({...x,notPermitted:!d(x.permissions??[],"any"),disabled:t.disabled||x.disabled}))}}),[o,d]),v=j.useMemo(()=>a.map(t=>{var n;return{...t,notPermitted:!d(t.permissions??[],"any"),children:(n=t.children)==null?void 0:n.map(x=>({...x,notPermitted:!d(x.permissions??[],"any")}))}}),[a,d]),m=t=>{p(t===u?-1:t)};return j.useEffect(()=>{r||p(-1)},[r]),e.jsxRuntimeExports.jsxs("section",{className:e.classNames("luminus-side-menu shadow",_.sideMenu,{[_.expand]:r},{expand:r}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",_.sidebarHeader),children:s}),e.jsxRuntimeExports.jsxs("ul",{className:_.sideMenuContent,children:[h.map((t,n)=>e.jsxRuntimeExports.jsx(R,{item:t,menuExpanded:r,collapsed:n===u,onCollapse:()=>m(n),currentPath:c},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",_.divider)}),v.map((t,n)=>e.jsxRuntimeExports.jsx(R,{item:t,menuExpanded:r,collapsed:n===u,onCollapse:()=>m(n),currentPath:c},t.title))]})]})},U="_top-bar_1lk80_1",G="_top-bar-brand_1lk80_14",E={"top-bar":"_top-bar_1lk80_1",topBar:U,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:G},J=({appName:s,leftOffset:o,centerContent:a,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow",E.topBar),style:{width:o?`calc(100% - ${o}px)`:void 0,left:o?`${o}px`:void 0},children:[e.jsxRuntimeExports.jsx(N.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",E.topBarBrand),children:s}),a&&e.jsxRuntimeExports.jsx("div",{children:a}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:r??null})]}),O=({title:s,children:o,sideContent:a,sideContentWidth:r=250,noPadding:l,className:c})=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",l?"p-0":"p-3",c),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:a?`${r}px`:void 0},children:[s?e.jsxRuntimeExports.jsx(b.PageTitle,{title:s}):null,o]}),a&&e.jsxRuntimeExports.jsx(b.SideContentBar,{width:r,children:a})]});exports.FullScreenContainer=b.FullScreenContainer;exports.SideContentBar=b.SideContentBar;exports.MainContainer=O;exports.SideMenu=K;exports.TopBar=J;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { j as e, c as d, ad as k } from "./
|
|
1
|
+
import { j as e, c as d, ad as k } from "./ResponsiveContextDropdown-8w4v7EXg.js";
|
|
2
2
|
import { useState as B, useMemo as N, useEffect as P } from "react";
|
|
3
3
|
import { Link as j } from "react-router-dom";
|
|
4
4
|
import "react-hook-form";
|
|
5
5
|
import "react-flexmonster";
|
|
6
|
-
import { S as I } from "./SimpleTooltip-
|
|
6
|
+
import { S as I } from "./SimpleTooltip-D0ZxleAX.js";
|
|
7
7
|
import "@azure/msal-browser";
|
|
8
8
|
import "@azure/msal-react";
|
|
9
|
-
import { u as y } from "./usePermissions-
|
|
10
|
-
import { P as C, S as f } from "./FullScreenContainer-
|
|
11
|
-
import { F as pe } from "./FullScreenContainer-
|
|
9
|
+
import { u as y } from "./usePermissions-C6bgdotQ.js";
|
|
10
|
+
import { P as C, S as f } from "./FullScreenContainer-BASfWA5G.js";
|
|
11
|
+
import { F as pe } from "./FullScreenContainer-BASfWA5G.js";
|
|
12
12
|
const w = "_side-menu-item_4dpnz_1", g = "_disabled_4dpnz_6", T = "_nav-button_4dpnz_10", S = "_child_4dpnz_18", H = "_text_4dpnz_22", $ = "_icon_4dpnz_29", E = "_collapse-icon_4dpnz_35", F = "_collapsed_4dpnz_45", L = "_expanded_4dpnz_52", R = "_children-container_4dpnz_58", A = "_visible_4dpnz_66", K = "_children_4dpnz_58", t = {
|
|
13
13
|
"side-menu-item": "_side-menu-item_4dpnz_1",
|
|
14
14
|
sideMenuItem: w,
|