react-luminus-components 1.5.37 → 1.5.38

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 { aw as O, aX as L, ar as T } from "./ShortcutLinksContext-CXaPhocV.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-CXaPhocV.js";
3
- import { u as it, a as dt } from "./useLocalStorageState-CoNYw5tD.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";
1
+ import { ak as P, am as L, b9 as T } from "./nivo-bar.es--AbsdroC.js";
2
+ import { bN as Y, aM as K, bP as tt, aj as et, bO as st, b1 as nt, an as rt, bs as at, ai as ot, aC as ut, aP as ct } from "./nivo-bar.es--AbsdroC.js";
3
+ import { u as it, a as dt } from "./useLocalStorageState-B2VDAPTK.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";
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", r;
14
- const n = t.then((s) => {
15
- e = "success", r = s;
13
+ let e = "pending", n;
14
+ const r = t.then((s) => {
15
+ e = "success", n = s;
16
16
  }, (s) => {
17
- e = "error", r = s;
17
+ e = "error", n = s;
18
18
  });
19
19
  return () => {
20
20
  switch (e) {
21
21
  case "pending":
22
- throw n;
22
+ throw r;
23
23
  case "success":
24
- return r;
24
+ return n;
25
25
  case "error":
26
- throw r;
26
+ throw n;
27
27
  default:
28
28
  throw new Error("Unknown status");
29
29
  }
30
30
  };
31
31
  };
32
- function H(t, e) {
33
- const r = O({
32
+ function y(t, e) {
33
+ const n = P({
34
34
  silent: !0,
35
35
  differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
36
36
  customToken: e == null ? void 0 : e.customToken
37
- }), [n, s] = h(null);
38
- return p(() => {
37
+ }), [r, s] = h(null);
38
+ return w(() => {
39
39
  (async () => {
40
- const o = r.get(t).then((u) => u.data);
40
+ const o = n.get(t).then((u) => u.data);
41
41
  s(B(o));
42
42
  })();
43
- }, [r, t]), n;
43
+ }, [n, t]), r;
44
44
  }
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]);
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]);
52
52
  return E(() => [l, a], [l, a]);
53
- }, F = (t, e, r) => {
54
- let n = "pending", s;
53
+ }, F = (t, e, n) => {
54
+ let r = "pending", s;
55
55
  const c = t.then((o) => {
56
- n = "success", s = o;
56
+ r = "success", s = o;
57
57
  }, (o) => {
58
58
  const u = o == null ? void 0 : o.response;
59
- (u == null ? void 0 : u.status) === 404 && r ? (n = "error-404", s = o) : (n = "error", s = o);
59
+ (u == null ? void 0 : u.status) === 404 && n ? (r = "error-404", s = o) : (r = "error", s = o);
60
60
  });
61
61
  return () => {
62
- switch (n) {
62
+ switch (r) {
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
- }, 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,
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,
84
84
  customToken: u,
85
85
  differentBaseUrl: o,
86
86
  noToastOnStatus: a ? [404] : void 0
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)
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)
89
89
  return;
90
- !n && i(`loadData-${t}-${I}`), s && v(null);
90
+ !r && 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(() => !n && D(`loadData-${t}-${I}`));
93
+ }).then((x) => l ? l(x.data) : x.data).finally(() => !r && D(`loadData-${t}-${I}`));
94
94
  v(F($, c ?? !1, a ?? !1));
95
95
  }, [
96
96
  C,
97
- r,
98
97
  n,
98
+ r,
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 p(() => {
108
+ return w(() => {
109
109
  if (e === !1)
110
110
  return;
111
111
  const g = new AbortController();
112
- return b(g.signal, ++P.current), () => {
112
+ return b(g.signal, ++O.current), () => {
113
113
  g.abort();
114
114
  };
115
115
  }, [b, e]), { data: V, setData: v, reloadData: b };
116
- }, w = {
116
+ }, p = {
117
117
  storageKey: "--tmp-scroll-save--",
118
118
  requiredHeight: 100,
119
119
  retryInterval: 50
120
- }, Y = (t, { storageKey: e = w.storageKey, requiredHeight: r = w.requiredHeight, retryInterval: n = w.retryInterval } = w) => {
120
+ }, R = (t, { storageKey: e = p.storageKey, requiredHeight: n = p.requiredHeight, retryInterval: r = p.retryInterval } = p) => {
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 p(() => {
127
+ return w(() => {
128
128
  const a = window.setInterval(() => {
129
- if (!s && t.current !== null && t.current.getBoundingClientRect().height > r) {
129
+ if (!s && t.current !== null && t.current.getBoundingClientRect().height > n) {
130
130
  c(!0);
131
131
  const d = u();
132
132
  d !== null && t.current.scrollTo({ top: d }), window.clearInterval(a);
133
133
  }
134
- }, n);
134
+ }, r);
135
135
  return () => {
136
136
  window.clearTimeout(a);
137
137
  };
138
- }, [s, r, u, n, t]), p(() => {
138
+ }, [s, n, u, r, t]), w(() => {
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
- k as cancelToken,
148
+ Y as cancelToken,
149
149
  T as useAuth,
150
- O as useAxios,
150
+ P 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
- X as useGetApiDataBound,
158
- H as useGetDataBound,
159
- rt as useKeyPress,
157
+ H as useGetApiDataBound,
158
+ y as useGetDataBound,
159
+ nt as useKeyPress,
160
160
  dt as useLocalStorageState,
161
- nt as useNotifications,
161
+ rt as useNotifications,
162
162
  at as usePermissions,
163
- M as usePersistentState,
163
+ z as usePersistentState,
164
164
  ot as usePrompt,
165
165
  gt as useRenderDraggableInPortal,
166
- Y as useScrollSave,
167
- wt as useSearchQuery,
168
- pt as useSearchQueryState,
166
+ R as useScrollSave,
167
+ pt as useSearchQuery,
168
+ wt 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("./ShortcutLinksContext-DL1kqHiR.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");function L(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"},child:[]}]})(s)}function I(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M56.88,31.93A12,12,0,1,0,39.12,48.07L60,71A76,76,0,0,0,35.46,84.51a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.9,228c.47,0,.94,0,1.41-.05A20,20,0,0,0,171.87,220a97.47,97.47,0,0,0,9.54-15.46l17.72,19.49a12,12,0,1,0,17.76-16.14Zm98.49,169.88L54.08,100.52C62,95,70.31,92.12,78.91,91.83l84.51,93A62,62,0,0,1,155.37,201.81Zm82.78-95-39,39.11a12,12,0,1,1-17-16.95l36.19-36.3-55-55L130.59,70.5a12,12,0,0,1-17-16.94l35.57-35.69a20,20,0,0,1,28.3,0l60.69,60.68A20,20,0,0,1,238.15,106.83Z"},child:[]}]})(s)}const A="_side-menu-item_o72rm_1",S="_disabled_o72rm_6",T="_hidden_o72rm_10",q="_nav-button_o72rm_13",O="_child_o72rm_21",Z="_text_o72rm_26",$="_icon_o72rm_36",G="_collapse-icon_o72rm_42",D="_collapsed_o72rm_52",F="_collapse-icon-mini_o72rm_55",K="_expanded_o72rm_86",z="_children-container_o72rm_92",H="_visible_o72rm_100",U="_children_o72rm_92",W="_mobile_o72rm_112",t={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:A,disabled:S,hidden:T,"nav-button":"_nav-button_o72rm_13",navButton:q,child:O,text:Z,icon:$,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:G,collapsed:D,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:F,expanded:K,"children-container":"_children-container_o72rm_92",childrenContainer:z,visible:H,children:U,mobile:W},J=({item:s,menuExpanded:o,useTooltips:r,children:d})=>s.tooltip&&!o&&r?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:d})}):d,f=({item:s,menuExpanded:o,collapsed:r,onCollapse:d,currentPath:h,useHover:a,useTooltips:b,isMobile:E,disableMode:c})=>{var R,m,v,N;const[g,p]=_.useState(!1),[M]=h.split("?"),P=s.linkTo===M||((R=s.children)==null?void 0:R.some(i=>i.linkTo===M)),j=_.useRef(null);return e.useClickOutside([j],()=>r&&d()),e.jsxRuntimeExports.jsxs("li",{ref:j,className:e.classNames("luminus-side-menu-item",t.sideMenuItem,{[t.mobile]:E},{[t.expanded]:o},{active:g||P},{open:r&&s.children},{[c==="disable"?t.disabled:t.hidden]:s.disabled||s.notPermitted||((m=s.children)==null?void 0:m.every(i=>i.notPermitted||i.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(i=>i.notPermitted||i.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(J,{item:s,menuExpanded:o,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",t.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",t.icon),children:s.icon}),!a&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",t.collapseIconMini,{[t.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:s.title}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",t.collapseIcon,{[t.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(B.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",t.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",t.icon),children:s.icon}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",t.childrenContainer,{[t.visible]:r}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",t.children),children:(N=s.children)==null?void 0:N.map(i=>e.jsxRuntimeExports.jsx(B.Link,{to:i.disabled||i.notPermitted?"/":i.linkTo??"/",className:e.classNames("nav-link child rounded",t.navButton,t.child,{[c==="disable"?t.disabled:t.hidden]:i.disabled||i.notPermitted},{[c==="disable"?"disabled":"hidden"]:i.disabled||i.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:i.title})},i.linkTo))})})]})},Q="_side-menu_140bh_1",V="_sidebar-header_140bh_15",X="_side-menu-pin_140bh_22",Y="_side-menu-content_140bh_27",ee="_no-top-margin_140bh_33",se="_expand_140bh_39",ne="_only-logo_140bh_43",te="_mobile_140bh_46",ie="_divider_140bh_61",x={"side-menu":"_side-menu_140bh_1",sideMenu:Q,"sidebar-header":"_sidebar-header_140bh_15",sidebarHeader:V,"side-menu-pin":"_side-menu-pin_140bh_22",sideMenuPin:X,"side-menu-content":"_side-menu-content_140bh_27",sideMenuContent:Y,"no-top-margin":"_no-top-margin_140bh_33",noTopMargin:ee,expand:se,"only-logo":"_only-logo_140bh_43",onlyLogo:ne,mobile:te,divider:ie},oe=14,le=({headerItem:s,searchItem:o,shortcutsItem:r,mainItems:d,secondaryItems:h,expanded:a,setExpanded:b,currentPath:E,useHover:c,useTooltips:g,disableMode:p="disable",sideMenuPinned:M,toggleSideMenuPinned:P})=>{const[j,R]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),v=_.useMemo(()=>d.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:n.disabled||u.disabled}))}}),[d,m]),N=_.useMemo(()=>h.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[h,m]),i=n=>{R(n===j?-1:n)};_.useEffect(()=>{a||R(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const w=_.useMemo(()=>[...v,...N].filter(n=>{var l;return p==="hide"?!n.disabled&&!n.notPermitted&&(((l=n.children)==null?void 0:l.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[v,N,p]),{isMobile:C}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:C},{[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("div",{role:"button",onClick:n=>{n.stopPropagation(),P()},className:x.sideMenuPin,children:M?e.jsxRuntimeExports.jsx(I,{}):e.jsxRuntimeExports.jsx(L,{})}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(o||r)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[r&&a?r:null,o&&a?o:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:w.length>oe}),children:[v.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>i(l),currentPath:E,useHover:c,useTooltips:g,isMobile:C,disableMode:p},n.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),N.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>i(l),currentPath:E,useHover:c,useTooltips:g,isMobile:C,disableMode:p},n.title))]})]})},re="_top-bar_lnmq0_1",ae="_top-bar-brand_lnmq0_12",k={"top-bar":"_top-bar_lnmq0_1",topBar:re,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ae},ce=({appName:s,leftOffset:o,leftContent:r,centerContent:d,rightContent:h})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",k.topBar),style:{width:o?`calc(100% - ${o}px)`:void 0,left:o?`${o}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",k.topBarBrand),children:s}),r]}),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:h??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=le;exports.TopBar=ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-B9IJx7pj.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");function I(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"},child:[]}]})(s)}function L(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M56.88,31.93A12,12,0,1,0,39.12,48.07L60,71A76,76,0,0,0,35.46,84.51a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.9,228c.47,0,.94,0,1.41-.05A20,20,0,0,0,171.87,220a97.47,97.47,0,0,0,9.54-15.46l17.72,19.49a12,12,0,1,0,17.76-16.14Zm98.49,169.88L54.08,100.52C62,95,70.31,92.12,78.91,91.83l84.51,93A62,62,0,0,1,155.37,201.81Zm82.78-95-39,39.11a12,12,0,1,1-17-16.95l36.19-36.3-55-55L130.59,70.5a12,12,0,0,1-17-16.94l35.57-35.69a20,20,0,0,1,28.3,0l60.69,60.68A20,20,0,0,1,238.15,106.83Z"},child:[]}]})(s)}const A="_side-menu-item_o72rm_1",T="_disabled_o72rm_6",q="_hidden_o72rm_10",S="_nav-button_o72rm_13",O="_child_o72rm_21",Z="_text_o72rm_26",$="_icon_o72rm_36",G="_collapse-icon_o72rm_42",D="_collapsed_o72rm_52",F="_collapse-icon-mini_o72rm_55",K="_expanded_o72rm_86",z="_children-container_o72rm_92",H="_visible_o72rm_100",U="_children_o72rm_92",W="_mobile_o72rm_112",i={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:A,disabled:T,hidden:q,"nav-button":"_nav-button_o72rm_13",navButton:S,child:O,text:Z,icon:$,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:G,collapsed:D,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:F,expanded:K,"children-container":"_children-container_o72rm_92",childrenContainer:z,visible:H,children:U,mobile:W},J=({item:s,menuExpanded:o,useTooltips:r,children:d})=>s.tooltip&&!o&&r?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:d})}):d,f=({item:s,menuExpanded:o,collapsed:r,onCollapse:d,currentPath:h,useHover:a,useTooltips:b,isMobile:E,disableMode:c})=>{var R,m,v,N;const[g,p]=_.useState(!1),[M]=h.split("?"),P=s.linkTo===M||((R=s.children)==null?void 0:R.some(t=>t.linkTo===M)),j=_.useRef(null);return e.useClickOutside([j],()=>r&&d()),e.jsxRuntimeExports.jsxs("li",{ref:j,className:e.classNames("luminus-side-menu-item",i.sideMenuItem,{[i.mobile]:E},{[i.expanded]:o},{active:g||P},{open:r&&s.children},{[c==="disable"?i.disabled:i.hidden]:s.disabled||s.notPermitted||((m=s.children)==null?void 0:m.every(t=>t.notPermitted||t.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(t=>t.notPermitted||t.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(J,{item:s,menuExpanded:o,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",i.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),!a&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",i.collapseIconMini,{[i.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",i.collapseIcon,{[i.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(C.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",i.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",i.childrenContainer,{[i.visible]:r}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",i.children),children:(N=s.children)==null?void 0:N.map(t=>e.jsxRuntimeExports.jsx(C.Link,{to:t.disabled||t.notPermitted?"/":t.linkTo??"/",className:e.classNames("nav-link child rounded",i.navButton,i.child,{[c==="disable"?i.disabled:i.hidden]:t.disabled||t.notPermitted},{[c==="disable"?"disabled":"hidden"]:t.disabled||t.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:t.title})},t.linkTo))})})]})},Q="_side-menu_140bh_1",V="_sidebar-header_140bh_15",X="_side-menu-pin_140bh_22",Y="_side-menu-content_140bh_27",ee="_no-top-margin_140bh_33",se="_expand_140bh_39",ne="_only-logo_140bh_43",ie="_mobile_140bh_46",te="_divider_140bh_61",x={"side-menu":"_side-menu_140bh_1",sideMenu:Q,"sidebar-header":"_sidebar-header_140bh_15",sidebarHeader:V,"side-menu-pin":"_side-menu-pin_140bh_22",sideMenuPin:X,"side-menu-content":"_side-menu-content_140bh_27",sideMenuContent:Y,"no-top-margin":"_no-top-margin_140bh_33",noTopMargin:ee,expand:se,"only-logo":"_only-logo_140bh_43",onlyLogo:ne,mobile:ie,divider:te},oe=14,le=({headerItem:s,searchItem:o,shortcutsItem:r,mainItems:d,secondaryItems:h,expanded:a,setExpanded:b,currentPath:E,useHover:c,useTooltips:g,disableMode:p="disable",sideMenuPinned:M,toggleSideMenuPinned:P})=>{const[j,R]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),v=_.useMemo(()=>d.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:n.disabled||u.disabled}))}}),[d,m]),N=_.useMemo(()=>h.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[h,m]),t=n=>{R(n===j?-1:n)};_.useEffect(()=>{a||R(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const w=_.useMemo(()=>[...v,...N].filter(n=>{var l;return p==="hide"?!n.disabled&&!n.notPermitted&&(((l=n.children)==null?void 0:l.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[v,N,p]),{isMobile:B}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:B},{[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("div",{role:"button",onClick:n=>{n.stopPropagation(),P()},className:x.sideMenuPin,children:M?e.jsxRuntimeExports.jsx(L,{}):e.jsxRuntimeExports.jsx(I,{})}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(o||r)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[r&&a?r:null,o&&a?o:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:w.length>oe}),children:[v.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>t(l),currentPath:E,useHover:c,useTooltips:g,isMobile:B,disableMode:p},n.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),N.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>t(l),currentPath:E,useHover:c,useTooltips:g,isMobile:B,disableMode:p},n.title))]})]})},re="_top-bar_lnmq0_1",ae="_top-bar-brand_lnmq0_12",k={"top-bar":"_top-bar_lnmq0_1",topBar:re,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ae},ce=({appName:s,leftOffset:o,leftContent:r,centerContent:d,rightContent:h})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",k.topBar),style:{width:o?`calc(100% - ${o}px)`:void 0,left:o?`${o}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",k.topBarBrand),children:s}),r]}),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:h??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=le;exports.TopBar=ce;
package/dist/layout.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { bB as T, bv as R, j as n, c as l, Y as I, ao as q, ba as O, a2 as D, bC as F } from "./ShortcutLinksContext-CXaPhocV.js";
2
- import { b8 as Ln, bD as Tn } from "./ShortcutLinksContext-CXaPhocV.js";
3
- import { useState as S, useRef as Z, useMemo as y, useEffect as G } from "react";
1
+ import { bB as T, aM as R, j as n, c as l, Y as I, aB as $, bs as O, aC as D, bC as F } from "./nivo-bar.es--AbsdroC.js";
2
+ import { aq as Ln, bD as Tn } from "./nivo-bar.es--AbsdroC.js";
3
+ import { useState as S, useRef as q, useMemo as y, useEffect as G } from "react";
4
4
  import { Link as k } from "react-router-dom";
5
5
  import "react-hook-form";
6
6
  import "react-flexmonster";
@@ -34,9 +34,9 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
34
34
  visible: on,
35
35
  children: ln,
36
36
  mobile: tn
37
- }, an = ({ item: e, menuExpanded: t, useTooltips: r, children: _ }) => e.tooltip && !t && r ? /* @__PURE__ */ n.jsx(q, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: _ }) }) : _, A = ({ item: e, menuExpanded: t, collapsed: r, onCollapse: _, currentPath: p, useHover: d, useTooltips: x, isMobile: N, disableMode: c }) => {
37
+ }, an = ({ item: e, menuExpanded: t, useTooltips: r, children: _ }) => e.tooltip && !t && r ? /* @__PURE__ */ n.jsx($, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: _ }) }) : _, A = ({ item: e, menuExpanded: t, collapsed: r, onCollapse: _, currentPath: p, useHover: d, useTooltips: x, isMobile: N, disableMode: c }) => {
38
38
  var j, m, g, M;
39
- const [P, b] = S(!1), [f] = p.split("?"), B = e.linkTo === f || ((j = e.children) == null ? void 0 : j.some((o) => o.linkTo === f)), v = Z(null);
39
+ const [P, b] = S(!1), [f] = p.split("?"), B = e.linkTo === f || ((j = e.children) == null ? void 0 : j.some((o) => o.linkTo === f)), v = q(null);
40
40
  return R([v], () => r && _()), /* @__PURE__ */ n.jsxs("li", { ref: v, className: l("luminus-side-menu-item", i.sideMenuItem, { [i.mobile]: N }, {
41
41
  [i.expanded]: t
42
42
  }, { active: P || B }, { open: r && e.children }, {
@@ -111,9 +111,9 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
111
111
  G(() => {
112
112
  d || j(-1);
113
113
  }, [d]);
114
- const w = Z(null);
114
+ const w = q(null);
115
115
  R([w], () => x(!1));
116
- const $ = y(() => [...g, ...M].filter((s) => {
116
+ const Z = y(() => [...g, ...M].filter((s) => {
117
117
  var a;
118
118
  return b === "hide" ? !s.disabled && !s.notPermitted && (((a = s.children) == null ? void 0 : a.filter((u) => !u.disabled && !u.notPermitted)) ?? []).length > 0 : !0;
119
119
  }), [g, M, b]), { isMobile: C } = D();
@@ -133,7 +133,7 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
133
133
  t && d ? t : null
134
134
  ] }) : null,
135
135
  /* @__PURE__ */ n.jsxs("ul", { className: l(h.sideMenuContent, {
136
- [h.noTopMargin]: $.length > xn
136
+ [h.noTopMargin]: Z.length > xn
137
137
  }), children: [
138
138
  g.map((s, a) => /* @__PURE__ */ n.jsx(A, { item: s, menuExpanded: d, collapsed: a === v, onCollapse: () => o(a), currentPath: N, useHover: c, useTooltips: P, isMobile: C, disableMode: b }, s.title)),
139
139
  /* @__PURE__ */ n.jsx("hr", { className: l("divider", h.divider) }),