react-luminus-components 1.4.46 → 1.4.47
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 +30 -30
- package/dist/FormDisabledProvider-C2s5UVBK.cjs +1 -0
- package/dist/FormDisabledProvider-CpiQT6Ys.js +40 -0
- package/dist/{nivo-bar.es-CZIO12ob.js → ShortcutLinksContext-CvGOQ1rG.js} +9766 -9799
- package/dist/ShortcutLinksContext-pXbjIn9v.cjs +281 -0
- package/dist/contexts/auth/AuthContext.d.ts +2 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +459 -427
- package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +0 -4
- package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +0 -3
- package/dist/hooks/useAuth/useAuth.d.ts +0 -4
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +23 -23
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +38 -38
- package/dist/main.cjs.js +49 -49
- package/dist/main.es.js +7935 -7935
- package/dist/style.css +1 -1
- package/dist/{useLocalStorageState-Di1g3-X5.js → useLocalStorageState-B3TFIwhw.js} +13 -13
- package/dist/useLocalStorageState-D3NipHGX.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +28 -28
- package/dist/variables.scss +165 -165
- package/package.json +123 -123
- package/dist/FormDisabledProvider-BKhJ3z8H.cjs +0 -1
- package/dist/FormDisabledProvider-CRvfN8Ti.js +0 -20
- package/dist/nivo-bar.es-c-ieD_Y7.cjs +0 -281
- package/dist/useLocalStorageState-B8rqdAt7.cjs +0 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { AuthToken } from '../../../models/index';
|
|
2
|
-
|
|
3
1
|
declare const useMsalAuth: () => {
|
|
4
2
|
isAuthenticated: () => boolean;
|
|
5
3
|
isAuthenticating: () => boolean;
|
|
6
4
|
login: () => Promise<string | null>;
|
|
7
5
|
logout: () => void;
|
|
8
|
-
getToken: () => Promise<AuthToken | null>;
|
|
9
6
|
};
|
|
10
7
|
export default useMsalAuth;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
declare const useAuth: () => {
|
|
2
2
|
isAuthenticated: () => boolean;
|
|
3
3
|
isAuthenticating: () => boolean;
|
|
4
|
-
getToken: (() => {
|
|
5
|
-
token: string;
|
|
6
|
-
expiresOn: Date;
|
|
7
|
-
} | null) | (() => Promise<import('../../models').AuthToken | null>);
|
|
8
4
|
login: (kid: string, password: string) => Promise<string | null>;
|
|
9
5
|
logout: () => void;
|
|
10
6
|
};
|
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("./ShortcutLinksContext-pXbjIn9v.cjs"),b=require("./useLocalStorageState-D3NipHGX.cjs"),l=require("react"),p=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const q=t=>{let e="pending",n;const r=t.then(a=>{e="success",n=a},a=>{e="error",n=a});return()=>{switch(e){case"pending":throw r;case"success":return n;case"error":throw n;default:throw new Error("Unknown status")}}};function I(t,e){const n=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[r,a]=l.useState(null);return l.useEffect(()=>{(async()=>{const u=n.get(t).then(c=>c.data);a(q(u))})()},[n,t]),r}const x=(t,e,n)=>{let r="pending",a;const d=t.then(u=>{r="success",a=u},u=>{const c=u==null?void 0:u.response;(c==null?void 0:c.status)===404&&n?(r="error-404",a=u):(r="error",a=u)});return()=>{switch(r){case"pending":throw d;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},S={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},E=(t,{loadOnInit:e=S.loadOnInit,enabled:n=S.enabled,silent:r=S.silent,nullStateBeforeLoad:a=S.nullStateBeforeLoad,nullStateOnFail:d=S.nullStateOnFail,customApiUrl:u,customBearerToken:c,dataTransformer:f,errorBoundaryOn404:o}=S)=>{const i=s.useAxios({silent:r,customToken:c,differentBaseUrl:u,noToastOnStatus:o?[404]:void 0}),{startLoading:g,stopLoading:C}=l.useContext(s.LoadingContext),k=l.useRef(0),{isAuthenticated:v}=s.useAuth(),[y,w]=l.useState(null),D=l.useCallback(async(h,P)=>{if(!v()||n===!1)return;!r&&g(`loadData-${t}-${P}`),a&&w(null);const T=i.get(t,{signal:h}).then(A=>f?f(A.data):A.data).finally(()=>!r&&C(`loadData-${t}-${P}`));w(x(T,d??!1,o??!1))},[v,n,r,g,t,a,i,f,C,d,o]);return l.useEffect(()=>{if(e===!1)return;const h=new AbortController;return D(h.signal,++k.current),()=>{h.abort()}},[D,e]),{data:y,setData:w,reloadData:D}},m={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},L=(t,{storageKey:e=m.storageKey,requiredHeight:n=m.requiredHeight,retryInterval:r=m.retryInterval}=m)=>{const[a,d]=l.useState(!1),u=l.useRef(null),c=l.useCallback(()=>{const o=localStorage.getItem(e);return localStorage.removeItem(e),o===null?null:Number(o)},[e]),f=l.useCallback(o=>{localStorage.setItem(e,o)},[e]);return l.useEffect(()=>{const o=window.setInterval(()=>{if(!a&&t.current!==null&&t.current.getBoundingClientRect().height>n){d(!0);const i=c();i!==null&&t.current.scrollTo({top:i}),window.clearInterval(o)}},r);return()=>{window.clearTimeout(o)}},[a,n,c,r,t]),l.useEffect(()=>{var i;const o=new AbortController;return(i=t.current)==null||i.addEventListener("scrollend",()=>{var g;u.current=((g=t.current)==null?void 0:g.scrollTop)??0,f((u.current??0).toString())},{signal:o.signal}),()=>o.abort()},[f,t]),{saveValue:f,retrieveValue:c}};exports.cancelToken=s.cancelToken;exports.useAuth=s.useAuth;exports.useAxios=s.useAxios;exports.useClickOutside=s.useClickOutside;exports.useClipboard=s.useClipboard;exports.useConfirm=s.useConfirm;exports.useFormControlType=s.useFormControlType;exports.useKeyPress=s.useKeyPress;exports.useNotifications=s.useNotifications;exports.usePermissions=s.usePermissions;exports.usePrompt=s.usePrompt;exports.useWindowSize=s.useWindowSize;exports.useZodSchemaTypes=s.useZodSchemaTypes;exports.useGetApiData=b.useGetApiData;exports.useLocalStorageState=b.useLocalStorageState;exports.useEmployeePhotoPath=p.useEmployeePhotoPath;exports.useRenderDraggableInPortal=p.useRenderDraggableInPortal;exports.useSearchQuery=p.useSearchQuery;exports.useSearchQueryState=p.useSearchQueryState;exports.useGetApiDataBound=E;exports.useGetDataBound=I;exports.useScrollSave=L;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as ot, a as ut } from "./useLocalStorageState-
|
|
4
|
-
import { useState as v, useEffect as g, useContext as
|
|
1
|
+
import { ag as k, a_ as P, aB as $ } from "./ShortcutLinksContext-CvGOQ1rG.js";
|
|
2
|
+
import { bK as Z, ad as _, bM as J, b0 as K, bL as X, ap as Y, a$ as tt, bd as et, bo as at, a2 as st, bj as rt } from "./ShortcutLinksContext-CvGOQ1rG.js";
|
|
3
|
+
import { u as ot, a as ut } from "./useLocalStorageState-B3TFIwhw.js";
|
|
4
|
+
import { useState as v, useEffect as g, useContext as B, useRef as I, useCallback as S } from "react";
|
|
5
5
|
import { c as ct, u as it, a as dt, b as mt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
6
6
|
import "react-router-dom";
|
|
7
7
|
import "react-dom";
|
|
@@ -9,7 +9,7 @@ import "react-hook-form";
|
|
|
9
9
|
import "react-flexmonster";
|
|
10
10
|
import "@azure/msal-browser";
|
|
11
11
|
import "@azure/msal-react";
|
|
12
|
-
const
|
|
12
|
+
const y = (e) => {
|
|
13
13
|
let t = "pending", r;
|
|
14
14
|
const a = e.then((s) => {
|
|
15
15
|
t = "success", r = s;
|
|
@@ -29,8 +29,8 @@ const O = (e) => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
const r =
|
|
32
|
+
function q(e, t) {
|
|
33
|
+
const r = k({
|
|
34
34
|
silent: !0,
|
|
35
35
|
differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
|
|
36
36
|
customToken: t == null ? void 0 : t.customToken
|
|
@@ -38,11 +38,11 @@ function R(e, t) {
|
|
|
38
38
|
return g(() => {
|
|
39
39
|
(async () => {
|
|
40
40
|
const n = r.get(e).then((u) => u.data);
|
|
41
|
-
s(
|
|
41
|
+
s(y(n));
|
|
42
42
|
})();
|
|
43
43
|
}, [r, e]), a;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const E = (e, t, r) => {
|
|
46
46
|
let a = "pending", s;
|
|
47
47
|
const c = e.then((n) => {
|
|
48
48
|
a = "success", s = n;
|
|
@@ -71,19 +71,19 @@ const y = (e, t, r) => {
|
|
|
71
71
|
nullStateBeforeLoad: !0,
|
|
72
72
|
nullStateOnFail: !1
|
|
73
73
|
}, z = (e, { loadOnInit: t = d.loadOnInit, enabled: r = d.enabled, silent: a = d.silent, nullStateBeforeLoad: s = d.nullStateBeforeLoad, nullStateOnFail: c = d.nullStateOnFail, customApiUrl: n, customBearerToken: u, dataTransformer: i, errorBoundaryOn404: o } = d) => {
|
|
74
|
-
const l =
|
|
74
|
+
const l = k({
|
|
75
75
|
silent: a,
|
|
76
76
|
customToken: u,
|
|
77
77
|
differentBaseUrl: n,
|
|
78
78
|
noToastOnStatus: o ? [404] : void 0
|
|
79
|
-
}), { startLoading: m, stopLoading: D } =
|
|
79
|
+
}), { startLoading: m, stopLoading: D } = B(P), T = I(0), { isAuthenticated: b } = $(), [A, h] = v(null), w = S(async (f, C) => {
|
|
80
80
|
if (!b() || r === !1)
|
|
81
81
|
return;
|
|
82
82
|
!a && m(`loadData-${e}-${C}`), s && h(null);
|
|
83
|
-
const
|
|
83
|
+
const L = l.get(e, {
|
|
84
84
|
signal: f
|
|
85
|
-
}).then((
|
|
86
|
-
h(
|
|
85
|
+
}).then((x) => i ? i(x.data) : x.data).finally(() => !a && D(`loadData-${e}-${C}`));
|
|
86
|
+
h(E(L, c ?? !1, o ?? !1));
|
|
87
87
|
}, [
|
|
88
88
|
b,
|
|
89
89
|
r,
|
|
@@ -137,18 +137,18 @@ const y = (e, t, r) => {
|
|
|
137
137
|
}, [i, e]), { saveValue: i, retrieveValue: u };
|
|
138
138
|
};
|
|
139
139
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
Z as cancelToken,
|
|
141
|
+
$ as useAuth,
|
|
142
|
+
k as useAxios,
|
|
143
|
+
_ as useClickOutside,
|
|
144
|
+
J as useClipboard,
|
|
145
|
+
K as useConfirm,
|
|
146
146
|
ct as useEmployeePhotoPath,
|
|
147
|
-
|
|
147
|
+
X as useFormControlType,
|
|
148
148
|
ot as useGetApiData,
|
|
149
149
|
z as useGetApiDataBound,
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
q as useGetDataBound,
|
|
151
|
+
Y as useKeyPress,
|
|
152
152
|
ut as useLocalStorageState,
|
|
153
153
|
tt as useNotifications,
|
|
154
154
|
et as usePermissions,
|
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("./ShortcutLinksContext-pXbjIn9v.cjs"),x=require("react"),g=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const B="_side-menu-item_o72rm_1",P="_disabled_o72rm_6",f="_hidden_o72rm_10",w="_nav-button_o72rm_13",S="_child_o72rm_21",I="_text_o72rm_26",L="_icon_o72rm_36",T="_collapse-icon_o72rm_42",O="_collapsed_o72rm_52",$="_collapse-icon-mini_o72rm_55",A="_expanded_o72rm_86",K="_children-container_o72rm_92",D="_visible_o72rm_100",F="_children_o72rm_92",z="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:B,disabled:P,hidden:f,"nav-button":"_nav-button_o72rm_13",navButton:w,child:S,text:I,icon:L,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:T,collapsed:O,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:$,expanded:A,"children-container":"_children-container_o72rm_92",childrenContainer:K,visible:D,children:F,mobile:z},U=({item:s,menuExpanded:i,useTooltips:l,children:c})=>s.tooltip&&!i&&l?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:c})}):c,C=({item:s,menuExpanded:i,collapsed:l,onCollapse:c,currentPath:_,useHover:r,useTooltips:p,isMobile:E,disableMode:a})=>{var q,y,v,N;const[M,b]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((q=s.children)==null?void 0:q.some(o=>o.linkTo===j)),m=x.useRef(null);return e.useClickOutside([m],()=>l&&c()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:E},{[n.expanded]:i},{active:M||R},{open:l&&s.children},{[a==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((y=s.children)==null?void 0:y.every(o=>o.notPermitted||o.disabled))},{[a==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(o=>o.notPermitted||o.disabled))}),onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[e.jsxRuntimeExports.jsx(U,{item:s,menuExpanded:i,useTooltips:p,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",n.navButton),onClick:()=>{c()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),!r&&!i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",n.collapseIconMini,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",n.collapseIcon,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(g.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",n.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",n.childrenContainer,{[n.visible]:l}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",n.children),children:(N=s.children)==null?void 0:N.map(o=>e.jsxRuntimeExports.jsx(g.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",n.navButton,n.child,{[a==="disable"?n.disabled:n.hidden]:o.disabled||o.notPermitted},{[a==="disable"?"disabled":"hidden"]:o.disabled||o.notPermitted}),onClick:c,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},W="_side-menu_1q9oh_1",G="_sidebar-header_1q9oh_15",J="_side-menu-content_1q9oh_22",Q="_expand_1q9oh_27",V="_only-logo_1q9oh_31",X="_mobile_1q9oh_34",Y="_divider_1q9oh_49",u={"side-menu":"_side-menu_1q9oh_1",sideMenu:W,"sidebar-header":"_sidebar-header_1q9oh_15",sidebarHeader:G,"side-menu-content":"_side-menu-content_1q9oh_22",sideMenuContent:J,expand:Q,"only-logo":"_only-logo_1q9oh_31",onlyLogo:V,mobile:X,divider:Y},Z=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:c,secondaryItems:_,expanded:r,setExpanded:p,currentPath:E,useHover:a,useTooltips:M,disableMode:b="disable"})=>{const[j,R]=x.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),q=x.useMemo(()=>c.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(h=>({...h,notPermitted:!m(h.permissions??[],"any"),disabled:t.disabled||h.disabled}))}}),[c,m]),y=x.useMemo(()=>_.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(h=>({...h,notPermitted:!m(h.permissions??[],"any")}))}}),[_,m]),v=t=>{R(t===j?-1:t)};x.useEffect(()=>{r||R(-1)},[r]);const N=x.useRef(null);e.useClickOutside([N],()=>p(!1));const{isMobile:o}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",u.sideMenu,{[u.mobile]:o},{[u.expand]:r},{expand:r}),onMouseEnter:()=>a&&p(!0),onMouseLeave:()=>a&&p(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",u.sidebarHeader,{[u.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>p(!r),children:a?s:r?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),r&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&r?l:null,i&&r?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:u.sideMenuContent,children:[q.map((t,d)=>e.jsxRuntimeExports.jsx(C,{item:t,menuExpanded:r,collapsed:d===j,onCollapse:()=>v(d),currentPath:E,useHover:a,useTooltips:M,isMobile:o,disableMode:b},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),y.map((t,d)=>e.jsxRuntimeExports.jsx(C,{item:t,menuExpanded:r,collapsed:d===j,onCollapse:()=>v(d),currentPath:E,useHover:a,useTooltips:M,isMobile:o,disableMode:b},t.title))]})]})},H="_top-bar_lnmq0_1",ee="_top-bar-brand_lnmq0_12",k={"top-bar":"_top-bar_lnmq0_1",topBar:H,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ee},se=({appName:s,leftOffset:i,leftContent:l,centerContent:c,rightContent:_})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",k.topBar),style:{width:i?`calc(100% - ${i}px)`:void 0,left:i?`${i}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",k.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:c??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:_??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Z;exports.TopBar=se;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useState as L, useRef as
|
|
4
|
-
import { Link as
|
|
1
|
+
import { ad as I, j as e, c as i, Y as C, ay as R, bd as S, a2 as $, by as A, bz as z } from "./ShortcutLinksContext-CvGOQ1rG.js";
|
|
2
|
+
import { bb as fe, bA as ge } from "./ShortcutLinksContext-CvGOQ1rG.js";
|
|
3
|
+
import { useState as L, useRef as T, useMemo as k, useEffect as F } from "react";
|
|
4
|
+
import { Link as q } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|
|
6
6
|
import "react-flexmonster";
|
|
7
7
|
import "@azure/msal-browser";
|
|
8
8
|
import "@azure/msal-react";
|
|
9
9
|
import "react-dom";
|
|
10
|
-
const
|
|
10
|
+
const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm_10", U = "_nav-button_o72rm_13", W = "_child_o72rm_21", Y = "_text_o72rm_26", E = "_icon_o72rm_36", G = "_collapse-icon_o72rm_42", J = "_collapsed_o72rm_52", Q = "_collapse-icon-mini_o72rm_55", V = "_expanded_o72rm_86", X = "_children-container_o72rm_92", Z = "_visible_o72rm_100", H = "_children_o72rm_92", ee = "_mobile_o72rm_112", s = {
|
|
11
11
|
"side-menu-item": "_side-menu-item_o72rm_1",
|
|
12
|
-
sideMenuItem:
|
|
13
|
-
disabled:
|
|
12
|
+
sideMenuItem: K,
|
|
13
|
+
disabled: O,
|
|
14
14
|
hidden: D,
|
|
15
15
|
"nav-button": "_nav-button_o72rm_13",
|
|
16
|
-
navButton:
|
|
17
|
-
child:
|
|
18
|
-
text:
|
|
19
|
-
icon:
|
|
16
|
+
navButton: U,
|
|
17
|
+
child: W,
|
|
18
|
+
text: Y,
|
|
19
|
+
icon: E,
|
|
20
20
|
"collapse-icon": "_collapse-icon_o72rm_42",
|
|
21
21
|
collapseIcon: G,
|
|
22
22
|
collapsed: J,
|
|
@@ -25,37 +25,37 @@ const O = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", D = "_hidden_o72rm
|
|
|
25
25
|
expanded: V,
|
|
26
26
|
"children-container": "_children-container_o72rm_92",
|
|
27
27
|
childrenContainer: X,
|
|
28
|
-
visible:
|
|
28
|
+
visible: Z,
|
|
29
29
|
children: H,
|
|
30
30
|
mobile: ee
|
|
31
|
-
}, ne = ({ item: n, menuExpanded: l, useTooltips: a, children: c }) => n.tooltip && !l && a ? /* @__PURE__ */ e.jsx(
|
|
32
|
-
var
|
|
33
|
-
const [f, v] = L(!1), [
|
|
31
|
+
}, ne = ({ item: n, menuExpanded: l, useTooltips: a, children: c }) => n.tooltip && !l && a ? /* @__PURE__ */ e.jsx(R, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: c }) }) : c, P = ({ item: n, menuExpanded: l, collapsed: a, onCollapse: c, currentPath: b, useHover: d, useTooltips: h, isMobile: y, disableMode: r }) => {
|
|
32
|
+
var g, B, N, M;
|
|
33
|
+
const [f, v] = L(!1), [p] = b.split("?"), j = n.linkTo === p || ((g = n.children) == null ? void 0 : g.some((o) => o.linkTo === p)), m = T(null);
|
|
34
34
|
return I([m], () => a && c()), /* @__PURE__ */ e.jsxs("li", { ref: m, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: y }, {
|
|
35
35
|
[s.expanded]: l
|
|
36
36
|
}, { active: f || j }, { open: a && n.children }, {
|
|
37
|
-
[r === "disable" ? s.disabled : s.hidden]: n.disabled || n.notPermitted || ((
|
|
37
|
+
[r === "disable" ? s.disabled : s.hidden]: n.disabled || n.notPermitted || ((B = n.children) == null ? void 0 : B.every((o) => o.notPermitted || o.disabled))
|
|
38
38
|
}, {
|
|
39
39
|
[r === "disable" ? "disabled" : "hidden"]: n.disabled || n.notPermitted || ((N = n.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
|
|
40
40
|
}), onMouseEnter: () => v(!0), onMouseLeave: () => v(!1), children: [
|
|
41
|
-
/* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: l, useTooltips:
|
|
41
|
+
/* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: l, useTooltips: h, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
|
|
42
42
|
c();
|
|
43
43
|
}, children: [
|
|
44
44
|
/* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
|
|
45
45
|
!d && !l && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon-mini rounded", s.collapseIconMini, {
|
|
46
46
|
[s.collapsed]: a
|
|
47
|
-
}), children: /* @__PURE__ */ e.jsx(
|
|
47
|
+
}), children: /* @__PURE__ */ e.jsx(C, {}) }),
|
|
48
48
|
l && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title }),
|
|
49
49
|
l && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
|
|
50
50
|
[s.collapsed]: a
|
|
51
|
-
}), children: /* @__PURE__ */ e.jsx(
|
|
52
|
-
] }) }) : /* @__PURE__ */ e.jsxs(
|
|
51
|
+
}), children: /* @__PURE__ */ e.jsx(C, {}) })
|
|
52
|
+
] }) }) : /* @__PURE__ */ e.jsxs(q, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: i("nav-link", s.navButton), children: [
|
|
53
53
|
/* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
|
|
54
54
|
l && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title })
|
|
55
55
|
] }) }),
|
|
56
56
|
/* @__PURE__ */ e.jsx("div", { className: i("children-container", s.childrenContainer, {
|
|
57
57
|
[s.visible]: a
|
|
58
|
-
}), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (M = n.children) == null ? void 0 : M.map((o) => /* @__PURE__ */ e.jsx(
|
|
58
|
+
}), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (M = n.children) == null ? void 0 : M.map((o) => /* @__PURE__ */ e.jsx(q, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
|
|
59
59
|
[r === "disable" ? s.disabled : s.hidden]: o.disabled || o.notPermitted
|
|
60
60
|
}, {
|
|
61
61
|
[r === "disable" ? "disabled" : "hidden"]: o.disabled || o.notPermitted
|
|
@@ -73,8 +73,8 @@ const O = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", D = "_hidden_o72rm
|
|
|
73
73
|
onlyLogo: te,
|
|
74
74
|
mobile: ae,
|
|
75
75
|
divider: de
|
|
76
|
-
}, je = ({ headerItem: n, searchItem: l, shortcutsItem: a, mainItems: c, secondaryItems:
|
|
77
|
-
const [
|
|
76
|
+
}, je = ({ headerItem: n, searchItem: l, shortcutsItem: a, mainItems: c, secondaryItems: b, expanded: d, setExpanded: h, currentPath: y, useHover: r, useTooltips: f, disableMode: v = "disable" }) => {
|
|
77
|
+
const [p, j] = L(-1), { checkUserHasPermissions: m } = S(), g = k(() => c.map((t) => {
|
|
78
78
|
var _;
|
|
79
79
|
return {
|
|
80
80
|
...t,
|
|
@@ -85,7 +85,7 @@ const O = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", D = "_hidden_o72rm
|
|
|
85
85
|
disabled: t.disabled || x.disabled
|
|
86
86
|
}))
|
|
87
87
|
};
|
|
88
|
-
}), [c, m]),
|
|
88
|
+
}), [c, m]), B = k(() => b.map((t) => {
|
|
89
89
|
var _;
|
|
90
90
|
return {
|
|
91
91
|
...t,
|
|
@@ -95,32 +95,32 @@ const O = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", D = "_hidden_o72rm
|
|
|
95
95
|
notPermitted: !m(x.permissions ?? [], "any")
|
|
96
96
|
}))
|
|
97
97
|
};
|
|
98
|
-
}), [
|
|
99
|
-
j(t ===
|
|
98
|
+
}), [b, m]), N = (t) => {
|
|
99
|
+
j(t === p ? -1 : t);
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
F(() => {
|
|
102
102
|
d || j(-1);
|
|
103
103
|
}, [d]);
|
|
104
|
-
const M =
|
|
105
|
-
I([M], () =>
|
|
104
|
+
const M = T(null);
|
|
105
|
+
I([M], () => h(!1));
|
|
106
106
|
const { isMobile: o } = $();
|
|
107
107
|
return /* @__PURE__ */ e.jsxs("section", { ref: M, className: i("luminus-side-menu shadow", u.sideMenu, { [u.mobile]: o }, {
|
|
108
108
|
[u.expand]: d
|
|
109
|
-
}, { expand: d }), onMouseEnter: () => r &&
|
|
109
|
+
}, { expand: d }), onMouseEnter: () => r && h(!0), onMouseLeave: () => r && h(!1), children: [
|
|
110
110
|
/* @__PURE__ */ e.jsx("div", { className: i("sidebar-header", u.sidebarHeader, {
|
|
111
111
|
[u.onlyLogo]: r
|
|
112
|
-
}), role: r ? void 0 : "button", onClick: r ? void 0 : () =>
|
|
112
|
+
}), role: r ? void 0 : "button", onClick: r ? void 0 : () => h(!d), children: r ? n : d ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
113
113
|
/* @__PURE__ */ e.jsx(A, {}),
|
|
114
114
|
n
|
|
115
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
115
|
+
] }) : /* @__PURE__ */ e.jsx(z, {}) }),
|
|
116
116
|
d && (l || a) ? /* @__PURE__ */ e.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
|
|
117
117
|
a && d ? a : null,
|
|
118
118
|
l && d ? l : null
|
|
119
119
|
] }) : null,
|
|
120
120
|
/* @__PURE__ */ e.jsxs("ul", { className: u.sideMenuContent, children: [
|
|
121
|
-
|
|
121
|
+
g.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === p, onCollapse: () => N(_), currentPath: y, useHover: r, useTooltips: f, isMobile: o, disableMode: v }, t.title)),
|
|
122
122
|
/* @__PURE__ */ e.jsx("hr", { className: i("divider", u.divider) }),
|
|
123
|
-
|
|
123
|
+
B.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === p, onCollapse: () => N(_), currentPath: y, useHover: r, useTooltips: f, isMobile: o, disableMode: v }, t.title))
|
|
124
124
|
] })
|
|
125
125
|
] });
|
|
126
126
|
}, re = "_top-bar_lnmq0_1", ce = "_top-bar-brand_lnmq0_12", w = {
|
|
@@ -128,20 +128,20 @@ const O = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", D = "_hidden_o72rm
|
|
|
128
128
|
topBar: re,
|
|
129
129
|
"top-bar-brand": "_top-bar-brand_lnmq0_12",
|
|
130
130
|
topBarBrand: ce
|
|
131
|
-
}, Ne = ({ appName: n, leftOffset: l, leftContent: a, centerContent: c, rightContent:
|
|
131
|
+
}, Ne = ({ appName: n, leftOffset: l, leftContent: a, centerContent: c, rightContent: b }) => /* @__PURE__ */ e.jsx("nav", { className: i("luminus-top-bar shadow", w.topBar), style: {
|
|
132
132
|
width: l ? `calc(100% - ${l}px)` : void 0,
|
|
133
133
|
left: l ? `${l}px` : void 0
|
|
134
134
|
}, children: /* @__PURE__ */ e.jsxs("div", { className: "w-100 row g-0", children: [
|
|
135
135
|
/* @__PURE__ */ e.jsxs("div", { className: "col-4 d-flex gap-3 align-items-center", children: [
|
|
136
|
-
/* @__PURE__ */ e.jsx(
|
|
136
|
+
/* @__PURE__ */ e.jsx(q, { to: "/", className: i("luminus-top-bar-brand", w.topBarBrand), children: n }),
|
|
137
137
|
a
|
|
138
138
|
] }),
|
|
139
139
|
/* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex align-items-center", children: c ?? null }),
|
|
140
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children:
|
|
140
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: b ?? null })
|
|
141
141
|
] }) });
|
|
142
142
|
export {
|
|
143
143
|
fe as PageContainer,
|
|
144
|
-
|
|
144
|
+
ge as SideContentBar,
|
|
145
145
|
je as SideMenu,
|
|
146
146
|
Ne as TopBar
|
|
147
147
|
};
|