react-luminus-components 1.5.23 → 1.5.25

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/hooks.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { ak as P, am as L, b9 as T } from "./nivo-bar.es-D4yJw87H.js";
2
- import { bO as Y, aM as K, bQ as tt, aj as et, bP as st, b1 as nt, an as rt, bt as at, ai as ot, aC as ut, aP as ct } from "./nivo-bar.es-D4yJw87H.js";
3
- import { u as it, a as dt } from "./useLocalStorageState-VrTCzVCW.js";
4
- import { useState as h, useEffect as w, useRef as S, useCallback as f, useMemo as E, useSyncExternalStore as A, useContext as N } from "react";
5
- import { c as ft, u as gt, a as pt, b as wt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
1
+ import { aw as O, aX as L, ar as T } from "./ShortcutLinksContext-GuMlmySg.js";
2
+ import { bN as k, bv as K, bP as tt, aR as et, bO as st, af as rt, aY as nt, ba as at, bn as ot, a2 as ut, bg as ct } from "./ShortcutLinksContext-GuMlmySg.js";
3
+ import { u as it, a as dt } from "./useLocalStorageState-BbAq2qRc.js";
4
+ import { useState as h, useEffect as p, useRef as S, useCallback as f, useMemo as E, useSyncExternalStore as A, useContext as N } from "react";
5
+ import { c as ft, u as gt, a as wt, b as pt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
6
6
  import "react-router-dom";
7
7
  import "react-dom";
8
8
  import "react-hook-form";
@@ -10,56 +10,56 @@ import "react-flexmonster";
10
10
  import "@azure/msal-browser";
11
11
  import "@azure/msal-react";
12
12
  const B = (t) => {
13
- let e = "pending", n;
14
- const r = t.then((s) => {
15
- e = "success", n = s;
13
+ let e = "pending", r;
14
+ const n = t.then((s) => {
15
+ e = "success", r = s;
16
16
  }, (s) => {
17
- e = "error", n = s;
17
+ e = "error", r = s;
18
18
  });
19
19
  return () => {
20
20
  switch (e) {
21
21
  case "pending":
22
- throw r;
22
+ throw n;
23
23
  case "success":
24
- return n;
24
+ return r;
25
25
  case "error":
26
- throw n;
26
+ throw r;
27
27
  default:
28
28
  throw new Error("Unknown status");
29
29
  }
30
30
  };
31
31
  };
32
- function y(t, e) {
33
- const n = P({
32
+ function H(t, e) {
33
+ const r = O({
34
34
  silent: !0,
35
35
  differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
36
36
  customToken: e == null ? void 0 : e.customToken
37
- }), [r, s] = h(null);
38
- return w(() => {
37
+ }), [n, s] = h(null);
38
+ return p(() => {
39
39
  (async () => {
40
- const o = n.get(t).then((u) => u.data);
40
+ const o = r.get(t).then((u) => u.data);
41
41
  s(B(o));
42
42
  })();
43
- }, [n, t]), r;
43
+ }, [r, t]), n;
44
44
  }
45
- const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => window.removeEventListener(`storage_${t}`, e)), z = (t, e, n = localStorage) => {
46
- const [r] = h(e), s = S(JSON.stringify(e)), c = S(e), o = f(() => {
47
- const i = n.getItem(t);
48
- return i !== s.current && (s.current = i, c.current = s.current ? JSON.parse(s.current) : r), c.current;
49
- }, [t, n, r]), u = E(() => U(t), [t]), l = A(u, o), a = f((i) => {
50
- n.setItem(t, JSON.stringify(i)), window.dispatchEvent(new Event(`storage_${t}`));
51
- }, [t, n]);
45
+ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => window.removeEventListener(`storage_${t}`, e)), M = (t, e, r = localStorage) => {
46
+ const [n] = h(e), s = S(JSON.stringify(e)), c = S(e), o = f(() => {
47
+ const i = r.getItem(t);
48
+ return i !== s.current && (s.current = i, c.current = s.current ? JSON.parse(s.current) : n), c.current;
49
+ }, [t, r, n]), u = E(() => U(t), [t]), l = A(u, o), a = f((i) => {
50
+ r.setItem(t, JSON.stringify(i)), window.dispatchEvent(new Event(`storage_${t}`));
51
+ }, [t, r]);
52
52
  return E(() => [l, a], [l, a]);
53
- }, F = (t, e, n) => {
54
- let r = "pending", s;
53
+ }, F = (t, e, r) => {
54
+ let n = "pending", s;
55
55
  const c = t.then((o) => {
56
- r = "success", s = o;
56
+ n = "success", s = o;
57
57
  }, (o) => {
58
58
  const u = o == null ? void 0 : o.response;
59
- (u == null ? void 0 : u.status) === 404 && n ? (r = "error-404", s = o) : (r = "error", s = o);
59
+ (u == null ? void 0 : u.status) === 404 && r ? (n = "error-404", s = o) : (n = "error", s = o);
60
60
  });
61
61
  return () => {
62
- switch (r) {
62
+ switch (n) {
63
63
  case "pending":
64
64
  throw c;
65
65
  case "success":
@@ -78,24 +78,24 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
78
78
  enabled: !0,
79
79
  nullStateBeforeLoad: !0,
80
80
  nullStateOnFail: !1
81
- }, H = (t, { loadOnInit: e = m.loadOnInit, enabled: n = m.enabled, silent: r = m.silent, nullStateBeforeLoad: s = m.nullStateBeforeLoad, nullStateOnFail: c = m.nullStateOnFail, customApiUrl: o, customBearerToken: u, dataTransformer: l, errorBoundaryOn404: a } = m) => {
82
- const d = P({
83
- silent: r,
81
+ }, X = (t, { loadOnInit: e = m.loadOnInit, enabled: r = m.enabled, silent: n = m.silent, nullStateBeforeLoad: s = m.nullStateBeforeLoad, nullStateOnFail: c = m.nullStateOnFail, customApiUrl: o, customBearerToken: u, dataTransformer: l, errorBoundaryOn404: a } = m) => {
82
+ const d = O({
83
+ silent: n,
84
84
  customToken: u,
85
85
  differentBaseUrl: o,
86
86
  noToastOnStatus: a ? [404] : void 0
87
- }), { startLoading: i, stopLoading: D } = N(L), O = S(0), { isAuthenticated: C } = T(), [V, v] = h(null), b = f(async (g, I) => {
88
- if (!C() || n === !1)
87
+ }), { startLoading: i, stopLoading: D } = N(L), P = S(0), { isAuthenticated: C } = T(), [V, v] = h(null), b = f(async (g, I) => {
88
+ if (!C() || r === !1)
89
89
  return;
90
- !r && i(`loadData-${t}-${I}`), s && v(null);
90
+ !n && i(`loadData-${t}-${I}`), s && v(null);
91
91
  const $ = d.get(t, {
92
92
  signal: g
93
- }).then((x) => l ? l(x.data) : x.data).finally(() => !r && D(`loadData-${t}-${I}`));
93
+ }).then((x) => l ? l(x.data) : x.data).finally(() => !n && D(`loadData-${t}-${I}`));
94
94
  v(F($, c ?? !1, a ?? !1));
95
95
  }, [
96
96
  C,
97
- n,
98
97
  r,
98
+ n,
99
99
  i,
100
100
  t,
101
101
  s,
@@ -105,37 +105,37 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
105
105
  c,
106
106
  a
107
107
  ]);
108
- return w(() => {
108
+ return p(() => {
109
109
  if (e === !1)
110
110
  return;
111
111
  const g = new AbortController();
112
- return b(g.signal, ++O.current), () => {
112
+ return b(g.signal, ++P.current), () => {
113
113
  g.abort();
114
114
  };
115
115
  }, [b, e]), { data: V, setData: v, reloadData: b };
116
- }, p = {
116
+ }, w = {
117
117
  storageKey: "--tmp-scroll-save--",
118
118
  requiredHeight: 100,
119
119
  retryInterval: 50
120
- }, R = (t, { storageKey: e = p.storageKey, requiredHeight: n = p.requiredHeight, retryInterval: r = p.retryInterval } = p) => {
120
+ }, Y = (t, { storageKey: e = w.storageKey, requiredHeight: r = w.requiredHeight, retryInterval: n = w.retryInterval } = w) => {
121
121
  const [s, c] = h(!1), o = S(null), u = f(() => {
122
122
  const a = localStorage.getItem(e);
123
123
  return localStorage.removeItem(e), a === null ? null : Number(a);
124
124
  }, [e]), l = f((a) => {
125
125
  localStorage.setItem(e, a);
126
126
  }, [e]);
127
- return w(() => {
127
+ return p(() => {
128
128
  const a = window.setInterval(() => {
129
- if (!s && t.current !== null && t.current.getBoundingClientRect().height > n) {
129
+ if (!s && t.current !== null && t.current.getBoundingClientRect().height > r) {
130
130
  c(!0);
131
131
  const d = u();
132
132
  d !== null && t.current.scrollTo({ top: d }), window.clearInterval(a);
133
133
  }
134
- }, r);
134
+ }, n);
135
135
  return () => {
136
136
  window.clearTimeout(a);
137
137
  };
138
- }, [s, n, u, r, t]), w(() => {
138
+ }, [s, r, u, n, t]), p(() => {
139
139
  var d;
140
140
  const a = new AbortController();
141
141
  return (d = t.current) == null || d.addEventListener("scrollend", () => {
@@ -145,27 +145,27 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
145
145
  }, [l, t]), { saveValue: l, retrieveValue: u };
146
146
  };
147
147
  export {
148
- Y as cancelToken,
148
+ k as cancelToken,
149
149
  T as useAuth,
150
- P as useAxios,
150
+ O as useAxios,
151
151
  K as useClickOutside,
152
152
  tt as useClipboard,
153
153
  et as useConfirm,
154
154
  ft as useEmployeePhotoPath,
155
155
  st as useFormControlType,
156
156
  it as useGetApiData,
157
- H as useGetApiDataBound,
158
- y as useGetDataBound,
159
- nt as useKeyPress,
157
+ X as useGetApiDataBound,
158
+ H as useGetDataBound,
159
+ rt as useKeyPress,
160
160
  dt as useLocalStorageState,
161
- rt as useNotifications,
161
+ nt as useNotifications,
162
162
  at as usePermissions,
163
- z as usePersistentState,
163
+ M as usePersistentState,
164
164
  ot as usePrompt,
165
165
  gt as useRenderDraggableInPortal,
166
- R as useScrollSave,
167
- pt as useSearchQuery,
168
- wt as useSearchQueryState,
166
+ Y as useScrollSave,
167
+ wt as useSearchQuery,
168
+ pt as useSearchQueryState,
169
169
  ut as useWindowSize,
170
170
  ct as useZodSchemaTypes
171
171
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-Ccmu5E_p.cjs"),_=require("react"),B=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const f="_side-menu-item_o72rm_1",w="_disabled_o72rm_6",T="_hidden_o72rm_10",q="_nav-button_o72rm_13",I="_child_o72rm_21",S="_text_o72rm_26",L="_icon_o72rm_36",O="_collapse-icon_o72rm_42",A="_collapsed_o72rm_52",$="_collapse-icon-mini_o72rm_55",D="_expanded_o72rm_86",K="_children-container_o72rm_92",F="_visible_o72rm_100",z="_children_o72rm_92",G="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:f,disabled:w,hidden:T,"nav-button":"_nav-button_o72rm_13",navButton:q,child:I,text:S,icon:L,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:O,collapsed:A,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:$,expanded:D,"children-container":"_children-container_o72rm_92",childrenContainer:K,visible:F,children:z,mobile:G},H=({item:s,menuExpanded:i,useTooltips:l,children:d})=>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:d})}):d,P=({item:s,menuExpanded:i,collapsed:l,onCollapse:d,currentPath:j,useHover:a,useTooltips:b,isMobile:k,disableMode:c})=>{var R,v,E,y;const[g,p]=_.useState(!1),[h]=j.split("?"),N=s.linkTo===h||((R=s.children)==null?void 0:R.some(t=>t.linkTo===h)),m=_.useRef(null);return e.useClickOutside([m],()=>l&&d()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:k},{[n.expanded]:i},{active:g||N},{open:l&&s.children},{[c==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(t=>t.notPermitted||t.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((E=s.children)==null?void 0:E.every(t=>t.notPermitted||t.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(H,{item:s,menuExpanded:i,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",n.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),!a&&!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(B.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:(y=s.children)==null?void 0:y.map(t=>e.jsxRuntimeExports.jsx(B.Link,{to:t.disabled||t.notPermitted?"/":t.linkTo??"/",className:e.classNames("nav-link child rounded",n.navButton,n.child,{[c==="disable"?n.disabled:n.hidden]:t.disabled||t.notPermitted},{[c==="disable"?"disabled":"hidden"]:t.disabled||t.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:t.title})},t.linkTo))})})]})},U="_side-menu_12rky_1",W="_sidebar-header_12rky_15",J="_side-menu-content_12rky_22",Q="_no-top-margin_12rky_28",V="_expand_12rky_34",X="_only-logo_12rky_38",Y="_mobile_12rky_41",Z="_divider_12rky_56",x={"side-menu":"_side-menu_12rky_1",sideMenu:U,"sidebar-header":"_sidebar-header_12rky_15",sidebarHeader:W,"side-menu-content":"_side-menu-content_12rky_22",sideMenuContent:J,"no-top-margin":"_no-top-margin_12rky_28",noTopMargin:Q,expand:V,"only-logo":"_only-logo_12rky_38",onlyLogo:X,mobile:Y,divider:Z},ee=14,se=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:d,secondaryItems:j,expanded:a,setExpanded:b,currentPath:k,useHover:c,useTooltips:g,disableMode:p="disable"})=>{const[h,N]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),R=_.useMemo(()=>d.map(o=>{var r;return{...o,notPermitted:!m(o.permissions??[],"any"),children:(r=o.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:o.disabled||u.disabled}))}}),[d,m]),v=_.useMemo(()=>j.map(o=>{var r;return{...o,notPermitted:!m(o.permissions??[],"any"),children:(r=o.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[j,m]),E=o=>{N(o===h?-1:o)};_.useEffect(()=>{a||N(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const t=_.useMemo(()=>[...R,...v].filter(o=>{var r;return p==="hide"?!o.disabled&&!o.notPermitted&&(((r=o.children)==null?void 0:r.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[R,v,p]),{isMobile:M}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:M},{[x.expand]:a},{expand:a}),onMouseEnter:()=>c&&b(!0),onMouseLeave:()=>c&&b(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",x.sidebarHeader,{[x.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>b(!a),children:c?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&a?l:null,i&&a?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:t.length>ee}),children:[R.map((o,r)=>e.jsxRuntimeExports.jsx(P,{item:o,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},o.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),v.map((o,r)=>e.jsxRuntimeExports.jsx(P,{item:o,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},o.title))]})]})},ne="_top-bar_lnmq0_1",oe="_top-bar-brand_lnmq0_12",C={"top-bar":"_top-bar_lnmq0_1",topBar:ne,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:oe},te=({appName:s,leftOffset:i,leftContent:l,centerContent:d,rightContent:j})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",C.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(B.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:d??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:j??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=se;exports.TopBar=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-Ch5JVOFI.cjs"),_=require("react"),C=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const f="_side-menu-item_o72rm_1",w="_disabled_o72rm_6",T="_hidden_o72rm_10",q="_nav-button_o72rm_13",I="_child_o72rm_21",S="_text_o72rm_26",L="_icon_o72rm_36",O="_collapse-icon_o72rm_42",A="_collapsed_o72rm_52",$="_collapse-icon-mini_o72rm_55",D="_expanded_o72rm_86",K="_children-container_o72rm_92",F="_visible_o72rm_100",z="_children_o72rm_92",G="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:f,disabled:w,hidden:T,"nav-button":"_nav-button_o72rm_13",navButton:q,child:I,text:S,icon:L,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:O,collapsed:A,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:$,expanded:D,"children-container":"_children-container_o72rm_92",childrenContainer:K,visible:F,children:z,mobile:G},H=({item:s,menuExpanded:i,useTooltips:l,children:d})=>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:d})}):d,P=({item:s,menuExpanded:i,collapsed:l,onCollapse:d,currentPath:j,useHover:a,useTooltips:b,isMobile:k,disableMode:c})=>{var R,N,E,y;const[g,p]=_.useState(!1),[h]=j.split("?"),v=s.linkTo===h||((R=s.children)==null?void 0:R.some(o=>o.linkTo===h)),m=_.useRef(null);return e.useClickOutside([m],()=>l&&d()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:k},{[n.expanded]:i},{active:g||v},{open:l&&s.children},{[c==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((N=s.children)==null?void 0:N.every(o=>o.notPermitted||o.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((E=s.children)==null?void 0:E.every(o=>o.notPermitted||o.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(H,{item:s,menuExpanded:i,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",n.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),!a&&!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(C.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:(y=s.children)==null?void 0:y.map(o=>e.jsxRuntimeExports.jsx(C.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",n.navButton,n.child,{[c==="disable"?n.disabled:n.hidden]:o.disabled||o.notPermitted},{[c==="disable"?"disabled":"hidden"]:o.disabled||o.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},U="_side-menu_12rky_1",W="_sidebar-header_12rky_15",J="_side-menu-content_12rky_22",Q="_no-top-margin_12rky_28",V="_expand_12rky_34",X="_only-logo_12rky_38",Y="_mobile_12rky_41",Z="_divider_12rky_56",x={"side-menu":"_side-menu_12rky_1",sideMenu:U,"sidebar-header":"_sidebar-header_12rky_15",sidebarHeader:W,"side-menu-content":"_side-menu-content_12rky_22",sideMenuContent:J,"no-top-margin":"_no-top-margin_12rky_28",noTopMargin:Q,expand:V,"only-logo":"_only-logo_12rky_38",onlyLogo:X,mobile:Y,divider:Z},ee=14,se=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:d,secondaryItems:j,expanded:a,setExpanded:b,currentPath:k,useHover:c,useTooltips:g,disableMode:p="disable"})=>{const[h,v]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),R=_.useMemo(()=>d.map(t=>{var r;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(r=t.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:t.disabled||u.disabled}))}}),[d,m]),N=_.useMemo(()=>j.map(t=>{var r;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(r=t.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[j,m]),E=t=>{v(t===h?-1:t)};_.useEffect(()=>{a||v(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const o=_.useMemo(()=>[...R,...N].filter(t=>{var r;return p==="hide"?!t.disabled&&!t.notPermitted&&(((r=t.children)==null?void 0:r.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[R,N,p]),{isMobile:M}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:M},{[x.expand]:a},{expand:a}),onMouseEnter:()=>c&&b(!0),onMouseLeave:()=>c&&b(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",x.sidebarHeader,{[x.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>b(!a),children:c?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&a?l:null,i&&a?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:o.length>ee}),children:[R.map((t,r)=>e.jsxRuntimeExports.jsx(P,{item:t,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),N.map((t,r)=>e.jsxRuntimeExports.jsx(P,{item:t,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},t.title))]})]})},ne="_top-bar_lnmq0_1",te="_top-bar-brand_lnmq0_12",B={"top-bar":"_top-bar_lnmq0_1",topBar:ne,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:te},oe=({appName:s,leftOffset:i,leftContent:l,centerContent:d,rightContent:j})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",B.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(C.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:d??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:j??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=se;exports.TopBar=oe;
package/dist/layout.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import { aM as L, j as e, c as l, Y as w, aA as q, bt as A, aC as $, bC as O, bD as D } from "./nivo-bar.es-D4yJw87H.js";
2
- import { aq as Ce, bE as Pe } from "./nivo-bar.es-D4yJw87H.js";
3
- import { useState as R, useRef as S, useMemo as P, useEffect as E } from "react";
4
- import { Link as B } from "react-router-dom";
1
+ import { bv as L, j as e, c as l, Y as w, ao as $, ba as q, a2 as A, bB as O, bC as D } from "./ShortcutLinksContext-GuMlmySg.js";
2
+ import { b8 as Be, bD as Pe } from "./ShortcutLinksContext-GuMlmySg.js";
3
+ import { useState as R, useRef as S, useMemo as P, useEffect as F } from "react";
4
+ import { Link as C } 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 F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm_10", G = "_nav-button_o72rm_13", H = "_child_o72rm_21", U = "_text_o72rm_26", W = "_icon_o72rm_36", Y = "_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", ee = "_children_o72rm_92", ne = "_mobile_o72rm_112", s = {
10
+ const K = "_side-menu-item_o72rm_1", z = "_disabled_o72rm_6", E = "_hidden_o72rm_10", G = "_nav-button_o72rm_13", H = "_child_o72rm_21", U = "_text_o72rm_26", W = "_icon_o72rm_36", Y = "_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", ee = "_children_o72rm_92", ne = "_mobile_o72rm_112", s = {
11
11
  "side-menu-item": "_side-menu-item_o72rm_1",
12
- sideMenuItem: F,
13
- disabled: K,
14
- hidden: z,
12
+ sideMenuItem: K,
13
+ disabled: z,
14
+ hidden: E,
15
15
  "nav-button": "_nav-button_o72rm_13",
16
16
  navButton: G,
17
17
  child: H,
@@ -28,7 +28,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
28
28
  visible: Z,
29
29
  children: ee,
30
30
  mobile: ne
31
- }, se = ({ item: n, menuExpanded: t, useTooltips: a, children: _ }) => n.tooltip && !t && a ? /* @__PURE__ */ e.jsx(q, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: _ }) }) : _, I = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: _, currentPath: h, useHover: d, useTooltips: x, isMobile: M, disableMode: c }) => {
31
+ }, se = ({ item: n, menuExpanded: t, useTooltips: a, children: _ }) => n.tooltip && !t && a ? /* @__PURE__ */ e.jsx($, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: _ }) }) : _, I = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: _, currentPath: h, useHover: d, useTooltips: x, isMobile: M, disableMode: c }) => {
32
32
  var j, y, N, g;
33
33
  const [f, b] = R(!1), [v] = h.split("?"), k = n.linkTo === v || ((j = n.children) == null ? void 0 : j.some((i) => i.linkTo === v)), m = S(null);
34
34
  return L([m], () => a && _()), /* @__PURE__ */ e.jsxs("li", { ref: m, className: l("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: M }, {
@@ -49,13 +49,13 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
49
49
  t && /* @__PURE__ */ e.jsx("div", { className: l("collapse-icon", s.collapseIcon, {
50
50
  [s.collapsed]: a
51
51
  }), children: /* @__PURE__ */ e.jsx(w, {}) })
52
- ] }) }) : /* @__PURE__ */ e.jsxs(B, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: l("nav-link", s.navButton), children: [
52
+ ] }) }) : /* @__PURE__ */ e.jsxs(C, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: l("nav-link", s.navButton), children: [
53
53
  /* @__PURE__ */ e.jsx("div", { className: l("icon", s.icon), children: n.icon }),
54
54
  t && /* @__PURE__ */ e.jsx("div", { className: l("text", s.text, "text-nowrap"), children: n.title })
55
55
  ] }) }),
56
56
  /* @__PURE__ */ e.jsx("div", { className: l("children-container", s.childrenContainer, {
57
57
  [s.visible]: a
58
- }), children: /* @__PURE__ */ e.jsx("div", { className: l("shadow rounded children", s.children), children: (g = n.children) == null ? void 0 : g.map((i) => /* @__PURE__ */ e.jsx(B, { to: i.disabled || i.notPermitted ? "/" : i.linkTo ?? "/", className: l("nav-link child rounded", s.navButton, s.child, {
58
+ }), children: /* @__PURE__ */ e.jsx("div", { className: l("shadow rounded children", s.children), children: (g = n.children) == null ? void 0 : g.map((i) => /* @__PURE__ */ e.jsx(C, { to: i.disabled || i.notPermitted ? "/" : i.linkTo ?? "/", className: l("nav-link child rounded", s.navButton, s.child, {
59
59
  [c === "disable" ? s.disabled : s.hidden]: i.disabled || i.notPermitted
60
60
  }, {
61
61
  [c === "disable" ? "disabled" : "hidden"]: i.disabled || i.notPermitted
@@ -76,7 +76,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
76
76
  mobile: de,
77
77
  divider: ce
78
78
  }, _e = 14, Ne = ({ headerItem: n, searchItem: t, shortcutsItem: a, mainItems: _, secondaryItems: h, expanded: d, setExpanded: x, currentPath: M, useHover: c, useTooltips: f, disableMode: b = "disable" }) => {
79
- const [v, k] = R(-1), { checkUserHasPermissions: m } = A(), j = P(() => _.map((o) => {
79
+ const [v, k] = R(-1), { checkUserHasPermissions: m } = q(), j = P(() => _.map((o) => {
80
80
  var r;
81
81
  return {
82
82
  ...o,
@@ -100,7 +100,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
100
100
  }), [h, m]), N = (o) => {
101
101
  k(o === v ? -1 : o);
102
102
  };
103
- E(() => {
103
+ F(() => {
104
104
  d || k(-1);
105
105
  }, [d]);
106
106
  const g = S(null);
@@ -108,8 +108,8 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
108
108
  const i = P(() => [...j, ...y].filter((o) => {
109
109
  var r;
110
110
  return b === "hide" ? !o.disabled && !o.notPermitted && (((r = o.children) == null ? void 0 : r.filter((p) => !p.disabled && !p.notPermitted)) ?? []).length > 0 : !0;
111
- }), [j, y, b]), { isMobile: C } = $();
112
- return /* @__PURE__ */ e.jsxs("section", { ref: g, className: l("luminus-side-menu shadow", u.sideMenu, { [u.mobile]: C }, {
111
+ }), [j, y, b]), { isMobile: B } = A();
112
+ return /* @__PURE__ */ e.jsxs("section", { ref: g, className: l("luminus-side-menu shadow", u.sideMenu, { [u.mobile]: B }, {
113
113
  [u.expand]: d
114
114
  }, { expand: d }), onMouseEnter: () => c && x(!0), onMouseLeave: () => c && x(!1), children: [
115
115
  /* @__PURE__ */ e.jsx("div", { className: l("sidebar-header", u.sidebarHeader, {
@@ -125,9 +125,9 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
125
125
  /* @__PURE__ */ e.jsxs("ul", { className: l(u.sideMenuContent, {
126
126
  [u.noTopMargin]: i.length > _e
127
127
  }), children: [
128
- j.map((o, r) => /* @__PURE__ */ e.jsx(I, { item: o, menuExpanded: d, collapsed: r === v, onCollapse: () => N(r), currentPath: M, useHover: c, useTooltips: f, isMobile: C, disableMode: b }, o.title)),
128
+ j.map((o, r) => /* @__PURE__ */ e.jsx(I, { item: o, menuExpanded: d, collapsed: r === v, onCollapse: () => N(r), currentPath: M, useHover: c, useTooltips: f, isMobile: B, disableMode: b }, o.title)),
129
129
  /* @__PURE__ */ e.jsx("hr", { className: l("divider", u.divider) }),
130
- y.map((o, r) => /* @__PURE__ */ e.jsx(I, { item: o, menuExpanded: d, collapsed: r === v, onCollapse: () => N(r), currentPath: M, useHover: c, useTooltips: f, isMobile: C, disableMode: b }, o.title))
130
+ y.map((o, r) => /* @__PURE__ */ e.jsx(I, { item: o, menuExpanded: d, collapsed: r === v, onCollapse: () => N(r), currentPath: M, useHover: c, useTooltips: f, isMobile: B, disableMode: b }, o.title))
131
131
  ] })
132
132
  ] });
133
133
  }, me = "_top-bar_lnmq0_1", pe = "_top-bar-brand_lnmq0_12", T = {
@@ -140,14 +140,14 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
140
140
  left: t ? `${t}px` : void 0
141
141
  }, children: /* @__PURE__ */ e.jsxs("div", { className: "w-100 row g-0", children: [
142
142
  /* @__PURE__ */ e.jsxs("div", { className: "col-4 d-flex gap-3 align-items-center", children: [
143
- /* @__PURE__ */ e.jsx(B, { to: "/", className: l("luminus-top-bar-brand", T.topBarBrand), children: n }),
143
+ /* @__PURE__ */ e.jsx(C, { to: "/", className: l("luminus-top-bar-brand", T.topBarBrand), children: n }),
144
144
  a
145
145
  ] }),
146
146
  /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex align-items-center", children: _ ?? null }),
147
147
  /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: h ?? null })
148
148
  ] }) });
149
149
  export {
150
- Ce as PageContainer,
150
+ Be as PageContainer,
151
151
  Pe as SideContentBar,
152
152
  Ne as SideMenu,
153
153
  ge as TopBar