react-luminus-components 1.3.106 → 1.3.108
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/.vite/manifest.json +67 -67
- package/dist/{FullScreenContainer-DWMaq7ei.cjs → FullScreenContainer-BCkQt6Aq.cjs} +1 -1
- package/dist/{FullScreenContainer-DR8ViApX.js → FullScreenContainer-D0yAJKHP.js} +1 -1
- package/dist/{Loading-H5IapNQC.cjs → Loading-DwxC92Wf.cjs} +1 -1
- package/dist/{Loading-DMtI6ziE.js → Loading-mcHn37wo.js} +1 -1
- package/dist/{ResponsiveContextDropdown-CKD8WwD7.js → ResponsiveContextDropdown-BXtbwhRj.js} +824 -819
- package/dist/{ResponsiveContextDropdown-CiKOleS8.cjs → ResponsiveContextDropdown-C3qRV31t.cjs} +39 -39
- package/dist/{SimpleTooltip-C9UIJAri.js → SimpleTooltip-B8dnY-Or.js} +1 -1
- package/dist/{SimpleTooltip--WMjE4rb.cjs → SimpleTooltip-CFEF4-Ap.cjs} +1 -1
- package/dist/components/common/AppSearch/AppSearch.d.ts +2 -1
- package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +3 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +39 -39
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +17 -17
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +21 -21
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +902 -890
- package/dist/{searchUtils-Yr7036T2.cjs → searchUtils-BbHhz2xA.cjs} +1 -1
- package/dist/{searchUtils-Dafq3oMV.js → searchUtils-Bx9-o25P.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useClipboard-D_TKJIzz.cjs → useClipboard-2QjZh01g.cjs} +1 -1
- package/dist/{useClipboard-Bdye8gd-.js → useClipboard-CgSOX1bO.js} +5 -5
- package/dist/{useGetApiData-DRU71hbF.cjs → useGetApiData-DSFjBOJv.cjs} +1 -1
- package/dist/{useGetApiData-BdkVoF0S.js → useGetApiData-VNEisTXi.js} +9 -9
- package/dist/{usePermissions-CgsgxTCZ.cjs → usePermissions-BXT-mfxC.cjs} +1 -1
- package/dist/{usePermissions-DA_-uYww.js → usePermissions-B_TUwJ27.js} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +19 -19
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as o, a0 as e,
|
|
1
|
+
import { j as o, a0 as e, bR as i } from "./ResponsiveContextDropdown-BXtbwhRj.js";
|
|
2
2
|
const p = ({ text: s, placement: r, children: t, delay: a }) => /* @__PURE__ */ o.jsx(e, { placement: r, overlay: /* @__PURE__ */ o.jsx(i, { className: "luminus-tooltip", children: s }), delay: a, children: t });
|
|
3
3
|
export {
|
|
4
4
|
p as S
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./ResponsiveContextDropdown-
|
|
1
|
+
"use strict";const o=require("./ResponsiveContextDropdown-C3qRV31t.cjs"),r=({text:e,placement:t,children:s,delay:i})=>o.jsxRuntimeExports.jsx(o.OverlayTrigger,{placement:t,overlay:o.jsxRuntimeExports.jsx(o.Tooltip,{className:"luminus-tooltip",children:e}),delay:i,children:s});exports.SimpleTooltip=r;
|
|
@@ -4,6 +4,7 @@ type Props = {
|
|
|
4
4
|
searchTypes: SearchType[];
|
|
5
5
|
navigateFunction: (url: string) => void;
|
|
6
6
|
currentPath: string;
|
|
7
|
+
homePath?: string;
|
|
7
8
|
};
|
|
8
|
-
declare const AppSearch: ({ searchTypes, navigateFunction, currentPath }: Props) => import("react").JSX.Element;
|
|
9
|
+
declare const AppSearch: ({ searchTypes, navigateFunction, currentPath, homePath }: Props) => import("react").JSX.Element;
|
|
9
10
|
export default AppSearch;
|
|
@@ -3,12 +3,14 @@ import { ImgProps, PhotoAction, PhotoLibraryItemModel } from '../../../models/in
|
|
|
3
3
|
type Props = {
|
|
4
4
|
photos: PhotoLibraryItemModel[];
|
|
5
5
|
uploadPhotosText?: string;
|
|
6
|
+
noPhotosText?: string;
|
|
6
7
|
onUploadPhotos?: (files: File[]) => void;
|
|
7
8
|
photoActions?: PhotoAction[];
|
|
8
9
|
baseUrl?: string;
|
|
9
10
|
customToken?: string;
|
|
10
11
|
placeholder?: string;
|
|
11
12
|
ImgComponent?: React.ComponentType<ImgProps>;
|
|
13
|
+
noLightboxOnlyButtonOnEmpty?: boolean;
|
|
12
14
|
};
|
|
13
|
-
declare const PhotoLibrary: ({ photos, onUploadPhotos, uploadPhotosText, photoActions, baseUrl, customToken, placeholder, ImgComponent, }: Props) => import("react").JSX.Element
|
|
15
|
+
declare const PhotoLibrary: ({ photos, onUploadPhotos, uploadPhotosText, noPhotosText, photoActions, baseUrl, customToken, placeholder, ImgComponent, noLightboxOnlyButtonOnEmpty, }: Props) => import("react").JSX.Element;
|
|
14
16
|
export default PhotoLibrary;
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-C3qRV31t.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-DwxC92Wf.cjs"),k=require("./useGetApiData-DSFjBOJv.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,24 +1,24 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { useState as g, useCallback as d, useMemo as S, useContext as
|
|
3
|
-
import { EventType as
|
|
4
|
-
import { MsalProvider as
|
|
1
|
+
import { t as T, bc as B, j as r, bd as F, a3 as b, a$ as H, be as U, ae as v, a_ as q, a4 as L, bf as V, aR as J, as as $, az as _, bg as M, aA as K, aC as w, aB as Q, bh as W, aP as G, bi as X, aT as Y } from "./ResponsiveContextDropdown-BXtbwhRj.js";
|
|
2
|
+
import { useState as g, useCallback as d, useMemo as S, useContext as j, useEffect as C, useRef as R } from "react";
|
|
3
|
+
import { EventType as O } from "@azure/msal-browser";
|
|
4
|
+
import { MsalProvider as Z } 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-mcHn37wo.js";
|
|
9
|
+
import { u as te } from "./useGetApiData-VNEisTXi.js";
|
|
10
10
|
import { u as se } from "./useLocalStorageState-Bt99kkCr.js";
|
|
11
11
|
function ne(e) {
|
|
12
|
-
const a =
|
|
12
|
+
const a = T(e);
|
|
13
13
|
return a.setHours(23, 59, 59, 999), a;
|
|
14
14
|
}
|
|
15
15
|
function oe() {
|
|
16
16
|
return ne(Date.now());
|
|
17
17
|
}
|
|
18
18
|
function ae(e, a) {
|
|
19
|
-
const t = +
|
|
20
|
-
+
|
|
21
|
-
+
|
|
19
|
+
const t = +T(e), [s, n] = [
|
|
20
|
+
+T(a.start),
|
|
21
|
+
+T(a.end)
|
|
22
22
|
].sort((o, i) => o - i);
|
|
23
23
|
return t >= s && t <= n;
|
|
24
24
|
}
|
|
@@ -36,7 +36,7 @@ const ie = ({ children: e }) => {
|
|
|
36
36
|
e
|
|
37
37
|
] });
|
|
38
38
|
}, le = () => {
|
|
39
|
-
const { texts: { confirm: e } } =
|
|
39
|
+
const { texts: { confirm: e } } = j(b), { isShown: a, text: t, onFinish: s } = H(), { options: n } = j(U), [o, i] = g(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
|
+
}, je = ({ 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,
|
|
@@ -101,11 +101,11 @@ const ie = ({ children: e }) => {
|
|
|
101
101
|
s,
|
|
102
102
|
i
|
|
103
103
|
]);
|
|
104
|
-
return /* @__PURE__ */ r.jsx(
|
|
104
|
+
return /* @__PURE__ */ r.jsx(b.Provider, { value: c, children: /* @__PURE__ */ r.jsx(ie, { children: /* @__PURE__ */ r.jsxs(ce, { children: [
|
|
105
105
|
/* @__PURE__ */ r.jsx(V, {}),
|
|
106
106
|
l
|
|
107
107
|
] }) }) });
|
|
108
|
-
},
|
|
108
|
+
}, ye = ({ children: e }) => {
|
|
109
109
|
const [a, t] = g(!1), [s] = g(/* @__PURE__ */ new Set()), n = d((l) => {
|
|
110
110
|
s.add(l), t(!0);
|
|
111
111
|
}, [s]), o = d((l) => {
|
|
@@ -116,7 +116,7 @@ const ie = ({ children: e }) => {
|
|
|
116
116
|
e
|
|
117
117
|
] });
|
|
118
118
|
}, Ie = ({ children: e }) => {
|
|
119
|
-
const a =
|
|
119
|
+
const a = $(), { msalInstance: t } = j(_), { delegation: s, setDelegation: n, setAvailableDelegations: o, refreshAvailableDelegations: i } = j(M), { getToken: l } = K(), [c, m] = g(null), x = d(async () => {
|
|
120
120
|
const u = await l();
|
|
121
121
|
u && m(u);
|
|
122
122
|
}, [l]);
|
|
@@ -126,13 +126,13 @@ const ie = ({ children: e }) => {
|
|
|
126
126
|
const p = d(() => {
|
|
127
127
|
const u = localStorage.getItem("user") ?? null;
|
|
128
128
|
return u ? JSON.parse(u ?? "") : null;
|
|
129
|
-
}, [])(), [
|
|
129
|
+
}, [])(), [P, D] = g({
|
|
130
130
|
state: p ? w.LOGGED_IN : w.LOGGING_IN,
|
|
131
131
|
user: p
|
|
132
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((N) => {
|
|
135
|
+
f = N.data;
|
|
136
136
|
}).catch(() => {
|
|
137
137
|
f = null;
|
|
138
138
|
}), f;
|
|
@@ -141,7 +141,7 @@ const ie = ({ children: e }) => {
|
|
|
141
141
|
state: w.LOGGED_OUT,
|
|
142
142
|
user: null
|
|
143
143
|
}), n(null), o(null);
|
|
144
|
-
}, [o, n]),
|
|
144
|
+
}, [o, n]), y = d(async (u) => {
|
|
145
145
|
D({
|
|
146
146
|
state: w.LOGGING_IN,
|
|
147
147
|
user: null
|
|
@@ -160,9 +160,9 @@ const ie = ({ children: 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 === O.LOGIN_SUCCESS && f.payload) {
|
|
164
|
+
const N = f.payload;
|
|
165
|
+
m(N.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,
|
|
174
|
+
}, [t, y, I]);
|
|
175
175
|
const k = d(async (u) => {
|
|
176
|
-
u && await
|
|
176
|
+
u && await y(u).catch(() => {
|
|
177
177
|
I(), n(null);
|
|
178
178
|
});
|
|
179
|
-
}, [
|
|
179
|
+
}, [y, I, n]);
|
|
180
180
|
C(() => {
|
|
181
181
|
k(c);
|
|
182
182
|
}, [c, s == null ? void 0 : s.id, k]);
|
|
183
183
|
const z = S(() => ({
|
|
184
|
-
user:
|
|
185
|
-
userLoginState:
|
|
186
|
-
loginUser:
|
|
184
|
+
user: P.user,
|
|
185
|
+
userLoginState: P,
|
|
186
|
+
loginUser: y,
|
|
187
187
|
logoutUser: I
|
|
188
|
-
}), [
|
|
189
|
-
return /* @__PURE__ */ r.jsx(
|
|
188
|
+
}), [P, y, I]);
|
|
189
|
+
return /* @__PURE__ */ r.jsx(Q.Provider, { value: z, children: e });
|
|
190
190
|
}, pe = ({ ...e }) => {
|
|
191
|
-
const { cookieDomain: a } =
|
|
191
|
+
const { cookieDomain: a } = j(b), [, t] = W(["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 === O.LOGIN_SUCCESS || o.eventType === O.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,7 +216,7 @@ 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(Z, { 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)
|
|
@@ -229,7 +229,7 @@ const ie = ({ children: e }) => {
|
|
|
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, X() + 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 } } = j(b), { onConfirm: a, onCancel: t, text: s, show: n } = Y();
|
|
261
261
|
return /* @__PURE__ */ r.jsxs(v, { show: n, size: "sm", centered: !0, onHide: t, children: [
|
|
262
262
|
/* @__PURE__ */ r.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ r.jsx(v.Title, { children: s }) }),
|
|
263
263
|
/* @__PURE__ */ r.jsx(v.Body, { children: /* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
@@ -272,9 +272,9 @@ export {
|
|
|
272
272
|
M as DelegationContext,
|
|
273
273
|
De as DelegationProvider,
|
|
274
274
|
J as LoadingContext,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
ye as LoadingProvider,
|
|
276
|
+
b as LuminusComponentsContext,
|
|
277
|
+
je as LuminusComponentsProvider,
|
|
278
|
+
Q 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("./ResponsiveContextDropdown-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./ResponsiveContextDropdown-C3qRV31t.cjs"),l=require("./useClickOutside-D0505nsm.cjs"),d=require("./usePermissions-BXT-mfxC.cjs"),r=require("./useClipboard-2QjZh01g.cjs"),m=require("./useGetApiData-DSFjBOJv.cjs"),c=require("react"),h=require("./useLocalStorageState-BFc8Gc8H.cjs"),S=a=>{let e="pending",t;const o=a.then(u=>{e="success",t=u},u=>{e="error",t=u});return()=>{switch(e){case"pending":throw o;case"success":return t;case"error":throw t;default:throw new Error("Unknown status")}}};function y(a,e){const t=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[o,u]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=t.get(a).then(i=>i.data);u(S(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=l.useClickOutside;exports.usePermissions=d.usePermissions;exports.useClipboard=r.useClipboard;exports.useEmployeePhotoPath=r.useEmployeePhotoPath;exports.useKeyPress=r.useKeyPress;exports.useSearchQuery=r.useSearchQuery;exports.useSearchQueryState=r.useSearchQueryState;exports.useGetApiData=m.useGetApiData;exports.useLocalStorageState=h.useLocalStorageState;exports.useGetDataBound=y;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { as as c } from "./ResponsiveContextDropdown-
|
|
2
|
-
import {
|
|
1
|
+
import { as as c } from "./ResponsiveContextDropdown-BXtbwhRj.js";
|
|
2
|
+
import { bj as S, aA as y, aT as g, aG as k, aS as w, a$ as T, bk as D } from "./ResponsiveContextDropdown-BXtbwhRj.js";
|
|
3
3
|
import { u as b } from "./useClickOutside-BmlXg38T.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as E, d as
|
|
6
|
-
import { u as
|
|
4
|
+
import { u as C } from "./usePermissions-B_TUwJ27.js";
|
|
5
|
+
import { u as E, d as G, a as U, b as Q, c as j } from "./useClipboard-CgSOX1bO.js";
|
|
6
|
+
import { u as K } from "./useGetApiData-VNEisTXi.js";
|
|
7
7
|
import { useState as n, useEffect as m } from "react";
|
|
8
|
-
import { u as
|
|
8
|
+
import { u as N } from "./useLocalStorageState-Bt99kkCr.js";
|
|
9
9
|
const f = (t) => {
|
|
10
10
|
let e = "pending", s;
|
|
11
11
|
const r = t.then((a) => {
|
|
@@ -46,16 +46,16 @@ export {
|
|
|
46
46
|
b as useClickOutside,
|
|
47
47
|
E as useClipboard,
|
|
48
48
|
g as useConfirm,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
G as useEmployeePhotoPath,
|
|
50
|
+
k as useFormControlType,
|
|
51
|
+
K as useGetApiData,
|
|
52
52
|
p as useGetDataBound,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
U as useKeyPress,
|
|
54
|
+
N as useLocalStorageState,
|
|
55
|
+
w as useNotifications,
|
|
56
|
+
C as usePermissions,
|
|
57
|
+
T as usePrompt,
|
|
58
|
+
Q as useSearchQuery,
|
|
59
|
+
j as useSearchQueryState,
|
|
60
|
+
D as useZodSchemaTypes
|
|
61
61
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-C3qRV31t.cjs"),m=require("react"),E=require("react-router-dom");require("react-hook-form");require("react-flexmonster");const C=require("./SimpleTooltip-CFEF4-Ap.cjs");require("@azure/msal-browser");require("@azure/msal-react");const y=require("./useClickOutside-D0505nsm.cjs"),B=require("./usePermissions-BXT-mfxC.cjs"),q=require("./FullScreenContainer-BCkQt6Aq.cjs"),g="_side-menu-item_ql22m_1",P="_disabled_ql22m_6",I="_nav-button_ql22m_10",S="_child_ql22m_18",w="_text_ql22m_23",f="_icon_ql22m_30",T="_collapse-icon_ql22m_36",L="_collapsed_ql22m_46",O="_collapse-icon-mini_ql22m_49",F="_expanded_ql22m_80",$="_children-container_ql22m_86",A="_visible_ql22m_94",D="_children_ql22m_86",o={"side-menu-item":"_side-menu-item_ql22m_1",sideMenuItem:g,disabled:P,"nav-button":"_nav-button_ql22m_10",navButton:I,child:S,text:w,icon:f,"collapse-icon":"_collapse-icon_ql22m_36",collapseIcon:T,collapsed:L,"collapse-icon-mini":"_collapse-icon-mini_ql22m_49",collapseIconMini:O,expanded:F,"children-container":"_children-container_ql22m_86",childrenContainer:$,visible:A,children:D},K=({item:s,menuExpanded:l,useTooltips:r,children:t})=>s.tooltip&&!l&&r?e.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:t})}):t,M=({item:s,menuExpanded:l,collapsed:r,onCollapse:t,currentPath:c,useHover:u,useTooltips:a})=>{var N,h,b,i;const[R,x]=m.useState(!1),[p]=c.split("?"),d=s.linkTo===p||((N=s.children)==null?void 0:N.some(n=>n.linkTo===p)),v=m.useRef(null);return y.useClickOutside([v],()=>r&&t()),e.jsxRuntimeExports.jsxs("li",{ref:v,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:l},{active:R||d},{open:r&&s.children},{[o.disabled]:s.disabled||s.notPermitted||((h=s.children)==null?void 0:h.every(n=>n.notPermitted||n.disabled))},{disabled:s.disabled||s.notPermitted||((b=s.children)==null?void 0:b.every(n=>n.notPermitted||n.disabled))}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[e.jsxRuntimeExports.jsx(K,{item:s,menuExpanded:l,useTooltips:a,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{t()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),!u&&!l&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),l&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title}),l&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(E.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),l&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:r}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(i=s.children)==null?void 0:i.map(n=>e.jsxRuntimeExports.jsx(E.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),onClick:t,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},U="_side-menu_1deqc_1",z="_sidebar-header_1deqc_13",G="_side-menu-content_1deqc_20",J="_expand_1deqc_24",Q="_only-logo_1deqc_28",V="_divider_1deqc_31",j={"side-menu":"_side-menu_1deqc_1",sideMenu:U,"sidebar-header":"_sidebar-header_1deqc_13",sidebarHeader:z,"side-menu-content":"_side-menu-content_1deqc_20",sideMenuContent:G,expand:J,"only-logo":"_only-logo_1deqc_28",onlyLogo:Q,divider:V},X=({headerItem:s,mainItems:l,secondaryItems:r,expanded:t,setExpanded:c,currentPath:u,useHover:a,useTooltips:R})=>{const[x,p]=m.useState(-1),{checkUserHasPermissions:d}=B.usePermissions(),v=m.useMemo(()=>l.map(i=>{var n;return{...i,notPermitted:!d(i.permissions??[],"any"),children:(n=i.children)==null?void 0:n.map(_=>({..._,notPermitted:!d(_.permissions??[],"any"),disabled:i.disabled||_.disabled}))}}),[l,d]),N=m.useMemo(()=>r.map(i=>{var n;return{...i,notPermitted:!d(i.permissions??[],"any"),children:(n=i.children)==null?void 0:n.map(_=>({..._,notPermitted:!d(_.permissions??[],"any")}))}}),[r,d]),h=i=>{p(i===x?-1:i)};m.useEffect(()=>{t||p(-1)},[t]);const b=m.useRef(null);return y.useClickOutside([b],()=>c(!1)),e.jsxRuntimeExports.jsxs("section",{ref:b,className:e.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:t},{expand:t}),onMouseEnter:()=>a&&c(!0),onMouseLeave:()=>a&&c(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",j.sidebarHeader,{[j.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>c(!t),children:a?s:t?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),e.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[v.map((i,n)=>e.jsxRuntimeExports.jsx(M,{item:i,menuExpanded:t,collapsed:n===x,onCollapse:()=>h(n),currentPath:u,useHover:a,useTooltips:R},i.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",j.divider)}),N.map((i,n)=>e.jsxRuntimeExports.jsx(M,{item:i,menuExpanded:t,collapsed:n===x,onCollapse:()=>h(n),currentPath:u,useHover:a,useTooltips:R},i.title))]})]})},Y="_top-bar_1lk80_1",Z="_top-bar-brand_1lk80_14",k={"top-bar":"_top-bar_1lk80_1",topBar:Y,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:Z},H=({appName:s,leftOffset:l,centerContent:r,rightContent:t})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow",k.topBar),style:{width:l?`calc(100% - ${l}px)`:void 0,left:l?`${l}px`:void 0},children:[e.jsxRuntimeExports.jsx(E.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",k.topBarBrand),children:s}),r&&e.jsxRuntimeExports.jsx("div",{children:r}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:t??null})]}),W=({title:s,children:l,sideContent:r,sideContentWidth:t=250,noPadding:c,className:u})=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",c?"p-0":"p-3",u),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:r?`${t}px`:void 0},children:[s?e.jsxRuntimeExports.jsx(q.PageTitle,{title:s}):null,l]}),r&&e.jsxRuntimeExports.jsx(q.SideContentBar,{width:t,children:r})]});exports.FullScreenContainer=q.FullScreenContainer;exports.SideContentBar=q.SideContentBar;exports.MainContainer=W;exports.SideMenu=X;exports.TopBar=H;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { j as e, c as t, ad as y,
|
|
1
|
+
import { j as e, c as t, ad as y, ba as C, bb as w } from "./ResponsiveContextDropdown-BXtbwhRj.js";
|
|
2
2
|
import { useState as P, useRef as g, useMemo as f, useEffect as L } from "react";
|
|
3
3
|
import { Link as N } from "react-router-dom";
|
|
4
4
|
import "react-hook-form";
|
|
5
5
|
import "react-flexmonster";
|
|
6
|
-
import { S } from "./SimpleTooltip-
|
|
6
|
+
import { S } from "./SimpleTooltip-B8dnY-Or.js";
|
|
7
7
|
import "@azure/msal-browser";
|
|
8
8
|
import "@azure/msal-react";
|
|
9
9
|
import { u as I } from "./useClickOutside-BmlXg38T.js";
|
|
10
|
-
import { u as T } from "./usePermissions-
|
|
11
|
-
import { P as R, S as $ } from "./FullScreenContainer-
|
|
12
|
-
import { F as Me } from "./FullScreenContainer-
|
|
10
|
+
import { u as T } from "./usePermissions-B_TUwJ27.js";
|
|
11
|
+
import { P as R, S as $ } from "./FullScreenContainer-D0yAJKHP.js";
|
|
12
|
+
import { F as Me } from "./FullScreenContainer-D0yAJKHP.js";
|
|
13
13
|
const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_ql22m_10", O = "_child_ql22m_18", D = "_text_ql22m_23", U = "_icon_ql22m_30", z = "_collapse-icon_ql22m_36", E = "_collapsed_ql22m_46", G = "_collapse-icon-mini_ql22m_49", J = "_expanded_ql22m_80", Q = "_children-container_ql22m_86", V = "_visible_ql22m_94", X = "_children_ql22m_86", l = {
|
|
14
14
|
"side-menu-item": "_side-menu-item_ql22m_1",
|
|
15
15
|
sideMenuItem: F,
|
|
@@ -30,12 +30,12 @@ const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_q
|
|
|
30
30
|
visible: V,
|
|
31
31
|
children: X
|
|
32
32
|
}, Y = ({ item: n, menuExpanded: a, useTooltips: d, children: i }) => n.tooltip && !a && d ? /* @__PURE__ */ e.jsx(S, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: i }) }) : i, k = ({ item: n, menuExpanded: a, collapsed: d, onCollapse: i, currentPath: r, useHover: m, useTooltips: c }) => {
|
|
33
|
-
var M,
|
|
33
|
+
var M, h, v, o;
|
|
34
34
|
const [j, p] = P(!1), [u] = r.split("?"), _ = n.linkTo === u || ((M = n.children) == null ? void 0 : M.some((s) => s.linkTo === u)), q = g(null);
|
|
35
35
|
return I([q], () => d && i()), /* @__PURE__ */ e.jsxs("li", { ref: q, className: t("luminus-side-menu-item", l.sideMenuItem, {
|
|
36
36
|
[l.expanded]: a
|
|
37
37
|
}, { active: j || _ }, { open: d && n.children }, {
|
|
38
|
-
[l.disabled]: n.disabled || n.notPermitted || ((
|
|
38
|
+
[l.disabled]: n.disabled || n.notPermitted || ((h = n.children) == null ? void 0 : h.every((s) => s.notPermitted || s.disabled))
|
|
39
39
|
}, {
|
|
40
40
|
disabled: n.disabled || n.notPermitted || ((v = n.children) == null ? void 0 : v.every((s) => s.notPermitted || s.disabled))
|
|
41
41
|
}), onMouseEnter: () => p(!0), onMouseLeave: () => p(!1), children: [
|
|
@@ -58,7 +58,7 @@ const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_q
|
|
|
58
58
|
[l.visible]: d
|
|
59
59
|
}), children: /* @__PURE__ */ e.jsx("div", { className: t("shadow rounded children", l.children), children: (o = n.children) == null ? void 0 : o.map((s) => /* @__PURE__ */ e.jsx(N, { to: s.disabled || s.notPermitted ? "/" : s.linkTo ?? "/", className: t("nav-link child rounded", l.navButton, l.child, { [l.disabled]: s.disabled || s.notPermitted }, { disabled: s.disabled || s.notPermitted }), onClick: i, children: /* @__PURE__ */ e.jsx("div", { className: t("text", l.text, "text-nowrap"), children: s.title }) }, s.linkTo)) }) })
|
|
60
60
|
] });
|
|
61
|
-
}, Z = "_side-menu_1deqc_1", H = "_sidebar-header_1deqc_13", W = "_side-menu-content_1deqc_20", ee = "_expand_1deqc_24", ne = "_only-logo_1deqc_28", se = "_divider_1deqc_31",
|
|
61
|
+
}, Z = "_side-menu_1deqc_1", H = "_sidebar-header_1deqc_13", W = "_side-menu-content_1deqc_20", ee = "_expand_1deqc_24", ne = "_only-logo_1deqc_28", se = "_divider_1deqc_31", b = {
|
|
62
62
|
"side-menu": "_side-menu_1deqc_1",
|
|
63
63
|
sideMenu: Z,
|
|
64
64
|
"sidebar-header": "_sidebar-header_1deqc_13",
|
|
@@ -69,7 +69,7 @@ const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_q
|
|
|
69
69
|
"only-logo": "_only-logo_1deqc_28",
|
|
70
70
|
onlyLogo: ne,
|
|
71
71
|
divider: se
|
|
72
|
-
},
|
|
72
|
+
}, be = ({ headerItem: n, mainItems: a, secondaryItems: d, expanded: i, setExpanded: r, currentPath: m, useHover: c, useTooltips: j }) => {
|
|
73
73
|
const [p, u] = P(-1), { checkUserHasPermissions: _ } = T(), q = f(() => a.map((o) => {
|
|
74
74
|
var s;
|
|
75
75
|
return {
|
|
@@ -91,26 +91,26 @@ const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_q
|
|
|
91
91
|
notPermitted: !_(x.permissions ?? [], "any")
|
|
92
92
|
}))
|
|
93
93
|
};
|
|
94
|
-
}), [d, _]),
|
|
94
|
+
}), [d, _]), h = (o) => {
|
|
95
95
|
u(o === p ? -1 : o);
|
|
96
96
|
};
|
|
97
97
|
L(() => {
|
|
98
98
|
i || u(-1);
|
|
99
99
|
}, [i]);
|
|
100
100
|
const v = g(null);
|
|
101
|
-
return I([v], () => r(!1)), /* @__PURE__ */ e.jsxs("section", { ref: v, className: t("luminus-side-menu shadow",
|
|
102
|
-
[
|
|
101
|
+
return I([v], () => r(!1)), /* @__PURE__ */ e.jsxs("section", { ref: v, className: t("luminus-side-menu shadow", b.sideMenu, {
|
|
102
|
+
[b.expand]: i
|
|
103
103
|
}, { expand: i }), onMouseEnter: () => c && r(!0), onMouseLeave: () => c && r(!1), children: [
|
|
104
|
-
/* @__PURE__ */ e.jsx("div", { className: t("sidebar-header",
|
|
105
|
-
[
|
|
104
|
+
/* @__PURE__ */ e.jsx("div", { className: t("sidebar-header", b.sidebarHeader, {
|
|
105
|
+
[b.onlyLogo]: c
|
|
106
106
|
}), role: c ? void 0 : "button", onClick: c ? void 0 : () => r(!i), children: c ? n : i ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
107
107
|
/* @__PURE__ */ e.jsx(C, {}),
|
|
108
108
|
n
|
|
109
109
|
] }) : /* @__PURE__ */ e.jsx(w, {}) }),
|
|
110
|
-
/* @__PURE__ */ e.jsxs("ul", { className:
|
|
111
|
-
q.map((o, s) => /* @__PURE__ */ e.jsx(k, { item: o, menuExpanded: i, collapsed: s === p, onCollapse: () =>
|
|
112
|
-
/* @__PURE__ */ e.jsx("hr", { className: t("divider",
|
|
113
|
-
M.map((o, s) => /* @__PURE__ */ e.jsx(k, { item: o, menuExpanded: i, collapsed: s === p, onCollapse: () =>
|
|
110
|
+
/* @__PURE__ */ e.jsxs("ul", { className: b.sideMenuContent, children: [
|
|
111
|
+
q.map((o, s) => /* @__PURE__ */ e.jsx(k, { item: o, menuExpanded: i, collapsed: s === p, onCollapse: () => h(s), currentPath: m, useHover: c, useTooltips: j }, o.title)),
|
|
112
|
+
/* @__PURE__ */ e.jsx("hr", { className: t("divider", b.divider) }),
|
|
113
|
+
M.map((o, s) => /* @__PURE__ */ e.jsx(k, { item: o, menuExpanded: i, collapsed: s === p, onCollapse: () => h(s), currentPath: m, useHover: c, useTooltips: j }, o.title))
|
|
114
114
|
] })
|
|
115
115
|
] });
|
|
116
116
|
}, ie = "_top-bar_1lk80_1", oe = "_top-bar-brand_1lk80_14", B = {
|
|
@@ -118,7 +118,7 @@ const F = "_side-menu-item_ql22m_1", A = "_disabled_ql22m_6", K = "_nav-button_q
|
|
|
118
118
|
topBar: ie,
|
|
119
119
|
"top-bar-brand": "_top-bar-brand_1lk80_14",
|
|
120
120
|
topBarBrand: oe
|
|
121
|
-
},
|
|
121
|
+
}, he = ({ appName: n, leftOffset: a, centerContent: d, rightContent: i }) => /* @__PURE__ */ e.jsxs("nav", { className: t("luminus-top-bar shadow", B.topBar), style: {
|
|
122
122
|
width: a ? `calc(100% - ${a}px)` : void 0,
|
|
123
123
|
left: a ? `${a}px` : void 0
|
|
124
124
|
}, children: [
|
|
@@ -136,6 +136,6 @@ export {
|
|
|
136
136
|
Me as FullScreenContainer,
|
|
137
137
|
ve as MainContainer,
|
|
138
138
|
$ as SideContentBar,
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
be as SideMenu,
|
|
140
|
+
he as TopBar
|
|
141
141
|
};
|