react-luminus-components 1.5.21 → 1.5.23

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 (32) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +30 -30
  3. package/dist/{FormDisabledProvider-CI3pHhAC.js → FormDisabledProvider-BJh2Srt_.js} +1 -1
  4. package/dist/FormDisabledProvider-D-08Yrl7.cjs +1 -0
  5. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +1 -1
  6. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +1 -1
  7. package/dist/components/common/SimplePicker/SimplePicker.d.ts +6 -1
  8. package/dist/contexts.cjs.js +1 -1
  9. package/dist/contexts.es.js +32 -32
  10. package/dist/hooks/index.d.ts +1 -0
  11. package/dist/hooks/usePersistentState/usePersistentState.d.ts +2 -0
  12. package/dist/hooks.cjs.js +1 -1
  13. package/dist/hooks.es.js +110 -101
  14. package/dist/layout.cjs.js +1 -1
  15. package/dist/layout.es.js +17 -17
  16. package/dist/main.cjs.js +53 -53
  17. package/dist/main.es.js +10570 -10570
  18. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +5 -0
  19. package/dist/nivo-bar.es-Ccmu5E_p.cjs +281 -0
  20. package/dist/{ShortcutLinksContext-Ti4-xeFL.js → nivo-bar.es-D4yJw87H.js} +14210 -14204
  21. package/dist/style.css +1 -1
  22. package/dist/useLocalStorageState-CaFFn86s.cjs +1 -0
  23. package/dist/{useLocalStorageState-CCKHuYoD.js → useLocalStorageState-VrTCzVCW.js} +10 -10
  24. package/dist/utils/index.d.ts +1 -0
  25. package/dist/utils/storages/queryStorage.d.ts +3 -0
  26. package/dist/utils.cjs.js +1 -1
  27. package/dist/utils.es.js +100 -73
  28. package/dist/variables.scss +165 -165
  29. package/package.json +123 -123
  30. package/dist/FormDisabledProvider-Co150suu.cjs +0 -1
  31. package/dist/ShortcutLinksContext-9stXS_vz.cjs +0 -281
  32. package/dist/useLocalStorageState-Ct-tObyk.cjs +0 -1
package/dist/hooks.es.js CHANGED
@@ -1,57 +1,65 @@
1
- import { aw as k, aX as L, ar as O } from "./ShortcutLinksContext-Ti4-xeFL.js";
2
- import { bO as Z, bw as j, bQ as J, aR as M, bP as _, af as K, aY as tt, bb as et, bo as at, a2 as st, bh as rt } from "./ShortcutLinksContext-Ti4-xeFL.js";
3
- import { u as ot, a as ut } from "./useLocalStorageState-CCKHuYoD.js";
4
- import { useState as b, useEffect as g, useContext as $, useRef as I, useCallback as S } from "react";
5
- import { c as ct, u as it, a as dt, b as mt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
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";
6
6
  import "react-router-dom";
7
7
  import "react-dom";
8
8
  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;
14
- const a = e.then((s) => {
15
- t = "success", r = s;
12
+ const B = (t) => {
13
+ let e = "pending", n;
14
+ const r = t.then((s) => {
15
+ e = "success", n = s;
16
16
  }, (s) => {
17
- t = "error", r = s;
17
+ e = "error", n = s;
18
18
  });
19
19
  return () => {
20
- switch (t) {
20
+ switch (e) {
21
21
  case "pending":
22
- throw a;
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 q(e, t) {
33
- const r = k({
32
+ function y(t, e) {
33
+ const n = P({
34
34
  silent: !0,
35
- differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
36
- customToken: t == null ? void 0 : t.customToken
37
- }), [a, s] = b(null);
38
- return g(() => {
35
+ differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
36
+ customToken: e == null ? void 0 : e.customToken
37
+ }), [r, s] = h(null);
38
+ return w(() => {
39
39
  (async () => {
40
- const n = r.get(e).then((u) => u.data);
41
- s(y(n));
40
+ const o = n.get(t).then((u) => u.data);
41
+ s(B(o));
42
42
  })();
43
- }, [r, e]), a;
43
+ }, [n, t]), r;
44
44
  }
45
- const B = (e, t, r) => {
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);
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
+ return E(() => [l, a], [l, a]);
53
+ }, F = (t, e, n) => {
54
+ let r = "pending", s;
55
+ const c = t.then((o) => {
56
+ r = "success", s = o;
57
+ }, (o) => {
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);
52
60
  });
53
61
  return () => {
54
- switch (a) {
62
+ switch (r) {
55
63
  case "pending":
56
64
  throw c;
57
65
  case "success":
@@ -64,99 +72,100 @@ const B = (e, t, r) => {
64
72
  throw new Error("Unknown status");
65
73
  }
66
74
  };
67
- }, d = {
75
+ }, m = {
68
76
  loadOnInit: !0,
69
77
  silent: !1,
70
78
  enabled: !0,
71
79
  nullStateBeforeLoad: !0,
72
80
  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({
75
- silent: a,
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,
76
84
  customToken: u,
77
- differentBaseUrl: n,
78
- noToastOnStatus: o ? [404] : void 0
79
- }), { startLoading: m, stopLoading: v } = $(L), P = I(0), { isAuthenticated: D } = O(), [T, w] = b(null), h = S(async (f, C) => {
80
- if (!D() || r === !1)
85
+ differentBaseUrl: o,
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)
81
89
  return;
82
- !a && m(`loadData-${e}-${C}`), s && w(null);
83
- const A = l.get(e, {
84
- signal: f
85
- }).then((x) => i ? i(x.data) : x.data).finally(() => !a && v(`loadData-${e}-${C}`));
86
- w(B(A, c ?? !1, o ?? !1));
90
+ !r && i(`loadData-${t}-${I}`), s && v(null);
91
+ const $ = d.get(t, {
92
+ signal: g
93
+ }).then((x) => l ? l(x.data) : x.data).finally(() => !r && D(`loadData-${t}-${I}`));
94
+ v(F($, c ?? !1, a ?? !1));
87
95
  }, [
88
- D,
96
+ C,
97
+ n,
89
98
  r,
90
- a,
91
- m,
92
- e,
99
+ i,
100
+ t,
93
101
  s,
102
+ d,
94
103
  l,
95
- i,
96
- v,
104
+ D,
97
105
  c,
98
- o
106
+ a
99
107
  ]);
100
- return g(() => {
101
- if (t === !1)
108
+ return w(() => {
109
+ if (e === !1)
102
110
  return;
103
- const f = new AbortController();
104
- return h(f.signal, ++P.current), () => {
105
- f.abort();
111
+ const g = new AbortController();
112
+ return b(g.signal, ++O.current), () => {
113
+ g.abort();
106
114
  };
107
- }, [h, t]), { data: T, setData: w, reloadData: h };
115
+ }, [b, e]), { data: V, setData: v, reloadData: b };
108
116
  }, p = {
109
117
  storageKey: "--tmp-scroll-save--",
110
118
  requiredHeight: 100,
111
119
  retryInterval: 50
112
- }, H = (e, { storageKey: t = p.storageKey, requiredHeight: r = p.requiredHeight, retryInterval: a = p.retryInterval } = p) => {
113
- const [s, c] = b(!1), n = I(null), u = S(() => {
114
- const o = localStorage.getItem(t);
115
- return localStorage.removeItem(t), o === null ? null : Number(o);
116
- }, [t]), i = S((o) => {
117
- localStorage.setItem(t, o);
118
- }, [t]);
119
- return g(() => {
120
- const o = window.setInterval(() => {
121
- if (!s && e.current !== null && e.current.getBoundingClientRect().height > r) {
120
+ }, R = (t, { storageKey: e = p.storageKey, requiredHeight: n = p.requiredHeight, retryInterval: r = p.retryInterval } = p) => {
121
+ const [s, c] = h(!1), o = S(null), u = f(() => {
122
+ const a = localStorage.getItem(e);
123
+ return localStorage.removeItem(e), a === null ? null : Number(a);
124
+ }, [e]), l = f((a) => {
125
+ localStorage.setItem(e, a);
126
+ }, [e]);
127
+ return w(() => {
128
+ const a = window.setInterval(() => {
129
+ if (!s && t.current !== null && t.current.getBoundingClientRect().height > n) {
122
130
  c(!0);
123
- const l = u();
124
- l !== null && e.current.scrollTo({ top: l }), window.clearInterval(o);
131
+ const d = u();
132
+ d !== null && t.current.scrollTo({ top: d }), window.clearInterval(a);
125
133
  }
126
- }, a);
134
+ }, r);
127
135
  return () => {
128
- window.clearTimeout(o);
136
+ window.clearTimeout(a);
129
137
  };
130
- }, [s, r, u, a, e]), g(() => {
131
- var l;
132
- const o = new AbortController();
133
- return (l = e.current) == null || l.addEventListener("scrollend", () => {
134
- var m;
135
- n.current = ((m = e.current) == null ? void 0 : m.scrollTop) ?? 0, i((n.current ?? 0).toString());
136
- }, { signal: o.signal }), () => o.abort();
137
- }, [i, e]), { saveValue: i, retrieveValue: u };
138
+ }, [s, n, u, r, t]), w(() => {
139
+ var d;
140
+ const a = new AbortController();
141
+ return (d = t.current) == null || d.addEventListener("scrollend", () => {
142
+ var i;
143
+ o.current = ((i = t.current) == null ? void 0 : i.scrollTop) ?? 0, l((o.current ?? 0).toString());
144
+ }, { signal: a.signal }), () => a.abort();
145
+ }, [l, t]), { saveValue: l, retrieveValue: u };
138
146
  };
139
147
  export {
140
- Z as cancelToken,
141
- O as useAuth,
142
- k as useAxios,
143
- j as useClickOutside,
144
- J as useClipboard,
145
- M as useConfirm,
146
- ct as useEmployeePhotoPath,
147
- _ as useFormControlType,
148
- ot as useGetApiData,
149
- z as useGetApiDataBound,
150
- q as useGetDataBound,
151
- K as useKeyPress,
152
- ut as useLocalStorageState,
153
- tt as useNotifications,
154
- et as usePermissions,
155
- at as usePrompt,
156
- it as useRenderDraggableInPortal,
157
- H as useScrollSave,
158
- dt as useSearchQuery,
159
- mt as useSearchQueryState,
160
- st as useWindowSize,
161
- rt as useZodSchemaTypes
148
+ Y as cancelToken,
149
+ T as useAuth,
150
+ P as useAxios,
151
+ K as useClickOutside,
152
+ tt as useClipboard,
153
+ et as useConfirm,
154
+ ft as useEmployeePhotoPath,
155
+ st as useFormControlType,
156
+ it as useGetApiData,
157
+ H as useGetApiDataBound,
158
+ y as useGetDataBound,
159
+ nt as useKeyPress,
160
+ dt as useLocalStorageState,
161
+ rt as useNotifications,
162
+ at as usePermissions,
163
+ z as usePersistentState,
164
+ ot as usePrompt,
165
+ gt as useRenderDraggableInPortal,
166
+ R as useScrollSave,
167
+ pt as useSearchQuery,
168
+ wt as useSearchQueryState,
169
+ ut as useWindowSize,
170
+ ct as useZodSchemaTypes
162
171
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-9stXS_vz.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;
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;
package/dist/layout.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { bw as L, j as e, c as l, Y as w, ao as $, bb as q, a2 as A, bC as O, bD as D } from "./ShortcutLinksContext-Ti4-xeFL.js";
2
- import { b9 as Pe, bE as Be } from "./ShortcutLinksContext-Ti4-xeFL.js";
3
- import { useState as R, useRef as S, useMemo as B, useEffect as E } from "react";
4
- import { Link as C } from "react-router-dom";
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";
5
5
  import "react-hook-form";
6
6
  import "react-flexmonster";
7
7
  import "@azure/msal-browser";
@@ -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($, { 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(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 }) => {
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(C, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: l("nav-link", s.navButton), children: [
52
+ ] }) }) : /* @__PURE__ */ e.jsxs(B, { 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(C, { 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(B, { 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 } = q(), j = B(() => _.map((o) => {
79
+ const [v, k] = R(-1), { checkUserHasPermissions: m } = A(), j = P(() => _.map((o) => {
80
80
  var r;
81
81
  return {
82
82
  ...o,
@@ -87,7 +87,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
87
87
  disabled: o.disabled || p.disabled
88
88
  }))
89
89
  };
90
- }), [_, m]), y = B(() => h.map((o) => {
90
+ }), [_, m]), y = P(() => h.map((o) => {
91
91
  var r;
92
92
  return {
93
93
  ...o,
@@ -105,11 +105,11 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
105
105
  }, [d]);
106
106
  const g = S(null);
107
107
  L([g], () => x(!1));
108
- const i = B(() => [...j, ...y].filter((o) => {
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: P } = A();
112
- return /* @__PURE__ */ e.jsxs("section", { ref: g, className: l("luminus-side-menu shadow", u.sideMenu, { [u.mobile]: P }, {
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 }, {
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: P, 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: C, 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: P, 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: C, disableMode: b }, o.title))
131
131
  ] })
132
132
  ] });
133
133
  }, me = "_top-bar_lnmq0_1", pe = "_top-bar-brand_lnmq0_12", T = {
@@ -140,15 +140,15 @@ 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(C, { to: "/", className: l("luminus-top-bar-brand", T.topBarBrand), children: n }),
143
+ /* @__PURE__ */ e.jsx(B, { 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
- Pe as PageContainer,
151
- Be as SideContentBar,
150
+ Ce as PageContainer,
151
+ Pe as SideContentBar,
152
152
  Ne as SideMenu,
153
153
  ge as TopBar
154
154
  };