react-luminus-components 1.4.49 → 1.4.50

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.
Files changed (42) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +30 -30
  3. package/dist/{FormDisabledProvider-CpiQT6Ys.js → FormDisabledProvider-CWPtd32k.js} +1 -1
  4. package/dist/FormDisabledProvider-DrZHlSO4.cjs +1 -0
  5. package/dist/components/{common → Search}/AppSearch/AppSearch.d.ts +3 -1
  6. package/dist/components/Search/AppSearch/comps/AutocompleteWindow/comps/AutocompleteWindowItem/AutocompleteWindowItem.d.ts +9 -0
  7. package/dist/components/Search/AppSearch/comps/AutocompleteWindow/comps/index.d.ts +1 -0
  8. package/dist/components/Search/SearchPage/SearchPage.d.ts +11 -0
  9. package/dist/components/Search/SearchPage/comps/SearchPageItem/SearchPageItem.d.ts +8 -0
  10. package/dist/components/Search/SearchPage/comps/index.d.ts +1 -0
  11. package/dist/components/Search/common/hooks/useSearchItems.d.ts +7 -0
  12. package/dist/components/Search/common/utils/appSearchUtils.d.ts +5 -0
  13. package/dist/components/Search/index.d.ts +2 -0
  14. package/dist/components/common/index.d.ts +0 -1
  15. package/dist/contexts.cjs.js +1 -1
  16. package/dist/contexts.es.js +16 -16
  17. package/dist/hooks.cjs.js +1 -1
  18. package/dist/hooks.es.js +44 -44
  19. package/dist/layout.cjs.js +1 -1
  20. package/dist/layout.es.js +25 -25
  21. package/dist/main.cjs.js +49 -49
  22. package/dist/main.d.ts +1 -1
  23. package/dist/main.es.js +10241 -10153
  24. package/dist/models/texts/AppSearchTexts.d.ts +1 -0
  25. package/dist/models/types/SearchResultModel.d.ts +4 -0
  26. package/dist/models/types/SearchType.d.ts +10 -0
  27. package/dist/models/ui/routes/RouteInfo.d.ts +4 -0
  28. package/dist/{ShortcutLinksContext-CvGOQ1rG.js → nivo-bar.es-DS751pis.js} +12152 -12152
  29. package/dist/{ShortcutLinksContext-pXbjIn9v.cjs → nivo-bar.es-Do8vRure.cjs} +8 -8
  30. package/dist/style.css +1 -1
  31. package/dist/useLocalStorageState-BjI7PIpr.cjs +1 -0
  32. package/dist/{useLocalStorageState-B3TFIwhw.js → useLocalStorageState-DJzWOFhI.js} +9 -9
  33. package/dist/utils.cjs.js +1 -1
  34. package/dist/utils.es.js +17 -17
  35. package/dist/variables.scss +165 -165
  36. package/package.json +123 -123
  37. package/dist/FormDisabledProvider-C2s5UVBK.cjs +0 -1
  38. package/dist/useLocalStorageState-D3NipHGX.cjs +0 -1
  39. /package/dist/components/{common → Search}/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +0 -0
  40. /package/dist/components/{common → Search}/AppSearch/comps/TypeSelector/TypeSelector.d.ts +0 -0
  41. /package/dist/components/{common → Search}/AppSearch/comps/index.d.ts +0 -0
  42. /package/dist/components/{common → Search}/AppSearch/hooks/useSearchItems.d.ts +0 -0
package/dist/hooks.es.js CHANGED
@@ -1,7 +1,7 @@
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";
1
+ import { ak as x, am as P, b5 as $ } from "./nivo-bar.es-DS751pis.js";
2
+ import { bK as R, aM as J, bM as K, aj as X, bL as Y, aZ as _, an as tt, bo as et, ai as at, aC as st, bq as nt } from "./nivo-bar.es-DS751pis.js";
3
+ import { u as ot, a as ut } from "./useLocalStorageState-DJzWOFhI.js";
4
+ import { useState as v, useEffect as g, useContext as y, 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,46 +9,46 @@ import "react-hook-form";
9
9
  import "react-flexmonster";
10
10
  import "@azure/msal-browser";
11
11
  import "@azure/msal-react";
12
- const y = (e) => {
13
- let t = "pending", r;
12
+ const B = (e) => {
13
+ let t = "pending", n;
14
14
  const a = e.then((s) => {
15
- t = "success", r = s;
15
+ t = "success", n = s;
16
16
  }, (s) => {
17
- t = "error", r = s;
17
+ t = "error", n = s;
18
18
  });
19
19
  return () => {
20
20
  switch (t) {
21
21
  case "pending":
22
22
  throw a;
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 q(e, t) {
33
- const r = k({
32
+ function Q(e, t) {
33
+ const n = x({
34
34
  silent: !0,
35
35
  differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
36
36
  customToken: t == null ? void 0 : t.customToken
37
37
  }), [a, s] = v(null);
38
38
  return g(() => {
39
39
  (async () => {
40
- const n = r.get(e).then((u) => u.data);
41
- s(y(n));
40
+ const r = n.get(e).then((u) => u.data);
41
+ s(B(r));
42
42
  })();
43
- }, [r, e]), a;
43
+ }, [n, e]), a;
44
44
  }
45
- const E = (e, t, r) => {
45
+ const E = (e, t, n) => {
46
46
  let a = "pending", s;
47
- const c = e.then((n) => {
48
- a = "success", s = n;
49
- }, (n) => {
50
- const u = n == null ? void 0 : n.response;
51
- (u == null ? void 0 : u.status) === 404 && r ? (a = "error-404", s = n) : (a = "error", s = n);
47
+ const c = e.then((r) => {
48
+ a = "success", s = r;
49
+ }, (r) => {
50
+ const u = r == null ? void 0 : r.response;
51
+ (u == null ? void 0 : u.status) === 404 && n ? (a = "error-404", s = r) : (a = "error", s = r);
52
52
  });
53
53
  return () => {
54
54
  switch (a) {
@@ -70,23 +70,23 @@ const E = (e, t, r) => {
70
70
  enabled: !0,
71
71
  nullStateBeforeLoad: !0,
72
72
  nullStateOnFail: !1
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 = k({
73
+ }, Z = (e, { loadOnInit: t = d.loadOnInit, enabled: n = d.enabled, silent: a = d.silent, nullStateBeforeLoad: s = d.nullStateBeforeLoad, nullStateOnFail: c = d.nullStateOnFail, customApiUrl: r, customBearerToken: u, dataTransformer: i, errorBoundaryOn404: o } = d) => {
74
+ const l = x({
75
75
  silent: a,
76
76
  customToken: u,
77
- differentBaseUrl: n,
77
+ differentBaseUrl: r,
78
78
  noToastOnStatus: o ? [404] : void 0
79
- }), { startLoading: m, stopLoading: D } = B(P), T = I(0), { isAuthenticated: b } = $(), [A, h] = v(null), w = S(async (f, C) => {
80
- if (!b() || r === !1)
79
+ }), { startLoading: m, stopLoading: D } = y(P), T = I(0), { isAuthenticated: b } = $(), [A, h] = v(null), w = S(async (f, C) => {
80
+ if (!b() || n === !1)
81
81
  return;
82
82
  !a && m(`loadData-${e}-${C}`), s && h(null);
83
83
  const L = l.get(e, {
84
84
  signal: f
85
- }).then((x) => i ? i(x.data) : x.data).finally(() => !a && D(`loadData-${e}-${C}`));
85
+ }).then((k) => i ? i(k.data) : k.data).finally(() => !a && D(`loadData-${e}-${C}`));
86
86
  h(E(L, c ?? !1, o ?? !1));
87
87
  }, [
88
88
  b,
89
- r,
89
+ n,
90
90
  a,
91
91
  m,
92
92
  e,
@@ -109,8 +109,8 @@ const E = (e, t, r) => {
109
109
  storageKey: "--tmp-scroll-save--",
110
110
  requiredHeight: 100,
111
111
  retryInterval: 50
112
- }, H = (e, { storageKey: t = p.storageKey, requiredHeight: r = p.requiredHeight, retryInterval: a = p.retryInterval } = p) => {
113
- const [s, c] = v(!1), n = I(null), u = S(() => {
112
+ }, j = (e, { storageKey: t = p.storageKey, requiredHeight: n = p.requiredHeight, retryInterval: a = p.retryInterval } = p) => {
113
+ const [s, c] = v(!1), r = I(null), u = S(() => {
114
114
  const o = localStorage.getItem(t);
115
115
  return localStorage.removeItem(t), o === null ? null : Number(o);
116
116
  }, [t]), i = S((o) => {
@@ -118,7 +118,7 @@ const E = (e, t, r) => {
118
118
  }, [t]);
119
119
  return g(() => {
120
120
  const o = window.setInterval(() => {
121
- if (!s && e.current !== null && e.current.getBoundingClientRect().height > r) {
121
+ if (!s && e.current !== null && e.current.getBoundingClientRect().height > n) {
122
122
  c(!0);
123
123
  const l = u();
124
124
  l !== null && e.current.scrollTo({ top: l }), window.clearInterval(o);
@@ -127,36 +127,36 @@ const E = (e, t, r) => {
127
127
  return () => {
128
128
  window.clearTimeout(o);
129
129
  };
130
- }, [s, r, u, a, e]), g(() => {
130
+ }, [s, n, u, a, e]), g(() => {
131
131
  var l;
132
132
  const o = new AbortController();
133
133
  return (l = e.current) == null || l.addEventListener("scrollend", () => {
134
134
  var m;
135
- n.current = ((m = e.current) == null ? void 0 : m.scrollTop) ?? 0, i((n.current ?? 0).toString());
135
+ r.current = ((m = e.current) == null ? void 0 : m.scrollTop) ?? 0, i((r.current ?? 0).toString());
136
136
  }, { signal: o.signal }), () => o.abort();
137
137
  }, [i, e]), { saveValue: i, retrieveValue: u };
138
138
  };
139
139
  export {
140
- Z as cancelToken,
140
+ R as cancelToken,
141
141
  $ as useAuth,
142
- k as useAxios,
143
- _ as useClickOutside,
144
- J as useClipboard,
145
- K as useConfirm,
142
+ x as useAxios,
143
+ J as useClickOutside,
144
+ K as useClipboard,
145
+ X as useConfirm,
146
146
  ct as useEmployeePhotoPath,
147
- X as useFormControlType,
147
+ Y as useFormControlType,
148
148
  ot as useGetApiData,
149
- z as useGetApiDataBound,
150
- q as useGetDataBound,
151
- Y as useKeyPress,
149
+ Z as useGetApiDataBound,
150
+ Q as useGetDataBound,
151
+ _ as useKeyPress,
152
152
  ut as useLocalStorageState,
153
153
  tt as useNotifications,
154
154
  et as usePermissions,
155
155
  at as usePrompt,
156
156
  it as useRenderDraggableInPortal,
157
- H as useScrollSave,
157
+ j as useScrollSave,
158
158
  dt as useSearchQuery,
159
159
  mt as useSearchQueryState,
160
160
  st as useWindowSize,
161
- rt as useZodSchemaTypes
161
+ nt as useZodSchemaTypes
162
162
  };
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-Do8vRure.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 k="_side-menu-item_o72rm_1",P="_disabled_o72rm_6",f="_hidden_o72rm_10",w="_nav-button_o72rm_13",I="_child_o72rm_21",S="_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:k,disabled:P,hidden:f,"nav-button":"_nav-button_o72rm_13",navButton:w,child:I,text:S,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,B=({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(B,{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(B,{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",C={"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",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(g.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: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,7 +1,7 @@
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";
1
+ import { aM as I, j as e, c as i, Y as C, aA as A, bo as R, aC as S, by as $, bz as z } from "./nivo-bar.es-DS751pis.js";
2
+ import { aq as fe, bA as ge } from "./nivo-bar.es-DS751pis.js";
3
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";
4
+ import { Link as B } from "react-router-dom";
5
5
  import "react-hook-form";
6
6
  import "react-flexmonster";
7
7
  import "@azure/msal-browser";
@@ -28,17 +28,17 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
28
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(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);
31
+ }, ne = ({ item: n, menuExpanded: l, useTooltips: a, children: c }) => n.tooltip && !l && a ? /* @__PURE__ */ e.jsx(A, { 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: h, useHover: d, useTooltips: p, isMobile: y, disableMode: r }) => {
32
+ var g, q, N, M;
33
+ const [f, v] = L(!1), [b] = h.split("?"), j = n.linkTo === b || ((g = n.children) == null ? void 0 : g.some((o) => o.linkTo === b)), 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 || ((B = n.children) == null ? void 0 : B.every((o) => o.notPermitted || o.disabled))
37
+ [r === "disable" ? s.disabled : s.hidden]: n.disabled || n.notPermitted || ((q = n.children) == null ? void 0 : q.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: h, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
41
+ /* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: l, useTooltips: p, 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 }),
@@ -49,13 +49,13 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
49
49
  l && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
50
50
  [s.collapsed]: a
51
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: [
52
+ ] }) }) : /* @__PURE__ */ e.jsxs(B, { 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(q, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
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(B, { 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 K = "_side-menu-item_o72rm_1", O = "_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: 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) => {
76
+ }, je = ({ headerItem: n, searchItem: l, shortcutsItem: a, mainItems: c, secondaryItems: h, expanded: d, setExpanded: p, currentPath: y, useHover: r, useTooltips: f, disableMode: v = "disable" }) => {
77
+ const [b, j] = L(-1), { checkUserHasPermissions: m } = R(), g = k(() => c.map((t) => {
78
78
  var _;
79
79
  return {
80
80
  ...t,
@@ -85,7 +85,7 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
85
85
  disabled: t.disabled || x.disabled
86
86
  }))
87
87
  };
88
- }), [c, m]), B = k(() => b.map((t) => {
88
+ }), [c, m]), q = k(() => h.map((t) => {
89
89
  var _;
90
90
  return {
91
91
  ...t,
@@ -95,22 +95,22 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
95
95
  notPermitted: !m(x.permissions ?? [], "any")
96
96
  }))
97
97
  };
98
- }), [b, m]), N = (t) => {
99
- j(t === p ? -1 : t);
98
+ }), [h, m]), N = (t) => {
99
+ j(t === b ? -1 : t);
100
100
  };
101
101
  F(() => {
102
102
  d || j(-1);
103
103
  }, [d]);
104
104
  const M = T(null);
105
- I([M], () => h(!1));
106
- const { isMobile: o } = $();
105
+ I([M], () => p(!1));
106
+ const { isMobile: o } = S();
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 && h(!0), onMouseLeave: () => r && h(!1), children: [
109
+ }, { expand: d }), onMouseEnter: () => r && p(!0), onMouseLeave: () => r && p(!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 : () => h(!d), children: r ? n : d ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
113
- /* @__PURE__ */ e.jsx(A, {}),
112
+ }), role: r ? void 0 : "button", onClick: r ? void 0 : () => p(!d), children: r ? n : d ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
113
+ /* @__PURE__ */ e.jsx($, {}),
114
114
  n
115
115
  ] }) : /* @__PURE__ */ e.jsx(z, {}) }),
116
116
  d && (l || a) ? /* @__PURE__ */ e.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
@@ -118,9 +118,9 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
118
118
  l && d ? l : null
119
119
  ] }) : null,
120
120
  /* @__PURE__ */ e.jsxs("ul", { className: u.sideMenuContent, children: [
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)),
121
+ g.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === b, 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
- 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))
123
+ q.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === b, 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,16 +128,16 @@ const K = "_side-menu-item_o72rm_1", O = "_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: b }) => /* @__PURE__ */ e.jsx("nav", { className: i("luminus-top-bar shadow", w.topBar), style: {
131
+ }, Ne = ({ appName: n, leftOffset: l, leftContent: a, centerContent: c, rightContent: h }) => /* @__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(q, { to: "/", className: i("luminus-top-bar-brand", w.topBarBrand), children: n }),
136
+ /* @__PURE__ */ e.jsx(B, { 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: b ?? null })
140
+ /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: h ?? null })
141
141
  ] }) });
142
142
  export {
143
143
  fe as PageContainer,