react-luminus-components 1.4.57 → 1.4.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +349 -349
- package/dist/.vite/manifest.json +30 -30
- package/dist/{FormDisabledProvider-6tUxmuDM.js → FormDisabledProvider-CIv-aGtv.js} +1 -1
- package/dist/FormDisabledProvider-X5m4Ty4e.cjs +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +153 -155
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +44 -44
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +18 -18
- package/dist/main.cjs.js +49 -49
- package/dist/main.es.js +10104 -10104
- package/dist/{ShortcutLinksContext-BnnVfkMM.js → nivo-bar.es-B3fjtFrd.js} +12154 -12155
- package/dist/{ShortcutLinksContext-DTVPEbpS.cjs → nivo-bar.es-BrUuHr_r.cjs} +7 -7
- package/dist/style.css +1 -1
- package/dist/useLocalStorageState-VlOdjbMB.cjs +1 -0
- package/dist/{useLocalStorageState-DtLtD3Dq.js → useLocalStorageState-qjMdpyEs.js} +10 -10
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +22 -22
- package/dist/variables.scss +165 -165
- package/package.json +123 -123
- package/dist/FormDisabledProvider-IJvvekVE.cjs +0 -1
- package/dist/useLocalStorageState-CjYiTOYJ.cjs +0 -1
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar.es-BrUuHr_r.cjs"),b=require("./useLocalStorageState-VlOdjbMB.cjs"),l=require("react"),p=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const q=t=>{let e="pending",n;const r=t.then(a=>{e="success",n=a},a=>{e="error",n=a});return()=>{switch(e){case"pending":throw r;case"success":return n;case"error":throw n;default:throw new Error("Unknown status")}}};function I(t,e){const n=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[r,a]=l.useState(null);return l.useEffect(()=>{(async()=>{const u=n.get(t).then(c=>c.data);a(q(u))})()},[n,t]),r}const E=(t,e,n)=>{let r="pending",a;const d=t.then(u=>{r="success",a=u},u=>{const c=u==null?void 0:u.response;(c==null?void 0:c.status)===404&&n?(r="error-404",a=u):(r="error",a=u)});return()=>{switch(r){case"pending":throw d;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},S={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},x=(t,{loadOnInit:e=S.loadOnInit,enabled:n=S.enabled,silent:r=S.silent,nullStateBeforeLoad:a=S.nullStateBeforeLoad,nullStateOnFail:d=S.nullStateOnFail,customApiUrl:u,customBearerToken:c,dataTransformer:f,errorBoundaryOn404:o}=S)=>{const i=s.useAxios({silent:r,customToken:c,differentBaseUrl:u,noToastOnStatus:o?[404]:void 0}),{startLoading:g,stopLoading:v}=l.useContext(s.LoadingContext),y=l.useRef(0),{isAuthenticated:C}=s.useAuth(),[k,w]=l.useState(null),D=l.useCallback(async(m,P)=>{if(!C()||n===!1)return;!r&&g(`loadData-${t}-${P}`),a&&w(null);const T=i.get(t,{signal:m}).then(A=>f?f(A.data):A.data).finally(()=>!r&&v(`loadData-${t}-${P}`));w(E(T,d??!1,o??!1))},[C,n,r,g,t,a,i,f,v,d,o]);return l.useEffect(()=>{if(e===!1)return;const m=new AbortController;return D(m.signal,++y.current),()=>{m.abort()}},[D,e]),{data:k,setData:w,reloadData:D}},h={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},B=(t,{storageKey:e=h.storageKey,requiredHeight:n=h.requiredHeight,retryInterval:r=h.retryInterval}=h)=>{const[a,d]=l.useState(!1),u=l.useRef(null),c=l.useCallback(()=>{const o=localStorage.getItem(e);return localStorage.removeItem(e),o===null?null:Number(o)},[e]),f=l.useCallback(o=>{localStorage.setItem(e,o)},[e]);return l.useEffect(()=>{const o=window.setInterval(()=>{if(!a&&t.current!==null&&t.current.getBoundingClientRect().height>n){d(!0);const i=c();i!==null&&t.current.scrollTo({top:i}),window.clearInterval(o)}},r);return()=>{window.clearTimeout(o)}},[a,n,c,r,t]),l.useEffect(()=>{var i;const o=new AbortController;return(i=t.current)==null||i.addEventListener("scrollend",()=>{var g;u.current=((g=t.current)==null?void 0:g.scrollTop)??0,f((u.current??0).toString())},{signal:o.signal}),()=>o.abort()},[f,t]),{saveValue:f,retrieveValue:c}};exports.cancelToken=s.cancelToken;exports.useAuth=s.useAuth;exports.useAxios=s.useAxios;exports.useClickOutside=s.useClickOutside;exports.useClipboard=s.useClipboard;exports.useConfirm=s.useConfirm;exports.useFormControlType=s.useFormControlType;exports.useKeyPress=s.useKeyPress;exports.useNotifications=s.useNotifications;exports.usePermissions=s.usePermissions;exports.usePrompt=s.usePrompt;exports.useWindowSize=s.useWindowSize;exports.useZodSchemaTypes=s.useZodSchemaTypes;exports.useGetApiData=b.useGetApiData;exports.useLocalStorageState=b.useLocalStorageState;exports.useEmployeePhotoPath=p.useEmployeePhotoPath;exports.useRenderDraggableInPortal=p.useRenderDraggableInPortal;exports.useSearchQuery=p.useSearchQuery;exports.useSearchQueryState=p.useSearchQueryState;exports.useGetApiDataBound=x;exports.useGetDataBound=I;exports.useScrollSave=B;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bM as
|
|
3
|
-
import { u as ot, a as ut } from "./useLocalStorageState-
|
|
4
|
-
import { useState as
|
|
1
|
+
import { ak as x, am as L, b5 as O } from "./nivo-bar.es-B3fjtFrd.js";
|
|
2
|
+
import { bM as R, aM as J, bO as X, aj as Y, bN as _, aZ as K, an as tt, bq as et, ai as at, aC as st, bs as nt } from "./nivo-bar.es-B3fjtFrd.js";
|
|
3
|
+
import { u as ot, a as ut } from "./useLocalStorageState-qjMdpyEs.js";
|
|
4
|
+
import { useState as v, useEffect as g, useContext as $, 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";
|
|
@@ -10,45 +10,45 @@ import "react-flexmonster";
|
|
|
10
10
|
import "@azure/msal-browser";
|
|
11
11
|
import "@azure/msal-react";
|
|
12
12
|
const y = (e) => {
|
|
13
|
-
let t = "pending",
|
|
13
|
+
let t = "pending", n;
|
|
14
14
|
const a = e.then((s) => {
|
|
15
|
-
t = "success",
|
|
15
|
+
t = "success", n = s;
|
|
16
16
|
}, (s) => {
|
|
17
|
-
t = "error",
|
|
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
|
|
24
|
+
return n;
|
|
25
25
|
case "error":
|
|
26
|
-
throw
|
|
26
|
+
throw n;
|
|
27
27
|
default:
|
|
28
28
|
throw new Error("Unknown status");
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
const
|
|
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
|
-
}), [a, s] =
|
|
37
|
+
}), [a, s] = v(null);
|
|
38
38
|
return g(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const
|
|
41
|
-
s(y(
|
|
40
|
+
const r = n.get(e).then((u) => u.data);
|
|
41
|
+
s(y(r));
|
|
42
42
|
})();
|
|
43
|
-
}, [
|
|
43
|
+
}, [n, e]), a;
|
|
44
44
|
}
|
|
45
|
-
const B = (e, t,
|
|
45
|
+
const B = (e, t, n) => {
|
|
46
46
|
let a = "pending", s;
|
|
47
|
-
const c = e.then((
|
|
48
|
-
a = "success", s =
|
|
49
|
-
}, (
|
|
50
|
-
const u =
|
|
51
|
-
(u == null ? void 0 : u.status) === 404 &&
|
|
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,30 +70,30 @@ const B = (e, t, r) => {
|
|
|
70
70
|
enabled: !0,
|
|
71
71
|
nullStateBeforeLoad: !0,
|
|
72
72
|
nullStateOnFail: !1
|
|
73
|
-
},
|
|
74
|
-
const l =
|
|
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:
|
|
77
|
+
differentBaseUrl: r,
|
|
78
78
|
noToastOnStatus: o ? [404] : void 0
|
|
79
|
-
}), { startLoading: m, stopLoading:
|
|
80
|
-
if (!
|
|
79
|
+
}), { startLoading: m, stopLoading: D } = $(L), T = I(0), { isAuthenticated: b } = O(), [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 P = l.get(e, {
|
|
84
84
|
signal: f
|
|
85
|
-
}).then((
|
|
85
|
+
}).then((k) => i ? i(k.data) : k.data).finally(() => !a && D(`loadData-${e}-${C}`));
|
|
86
86
|
h(B(P, c ?? !1, o ?? !1));
|
|
87
87
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
b,
|
|
89
|
+
n,
|
|
90
90
|
a,
|
|
91
91
|
m,
|
|
92
92
|
e,
|
|
93
93
|
s,
|
|
94
94
|
l,
|
|
95
95
|
i,
|
|
96
|
-
|
|
96
|
+
D,
|
|
97
97
|
c,
|
|
98
98
|
o
|
|
99
99
|
]);
|
|
@@ -109,8 +109,8 @@ const B = (e, t, r) => {
|
|
|
109
109
|
storageKey: "--tmp-scroll-save--",
|
|
110
110
|
requiredHeight: 100,
|
|
111
111
|
retryInterval: 50
|
|
112
|
-
},
|
|
113
|
-
const [s, c] =
|
|
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 B = (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 >
|
|
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 B = (e, t, r) => {
|
|
|
127
127
|
return () => {
|
|
128
128
|
window.clearTimeout(o);
|
|
129
129
|
};
|
|
130
|
-
}, [s,
|
|
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
|
-
|
|
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
|
-
|
|
140
|
+
R as cancelToken,
|
|
141
141
|
O as useAuth,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
x as useAxios,
|
|
143
|
+
J as useClickOutside,
|
|
144
|
+
X as useClipboard,
|
|
145
|
+
Y as useConfirm,
|
|
146
146
|
ct as useEmployeePhotoPath,
|
|
147
147
|
_ as useFormControlType,
|
|
148
148
|
ot as useGetApiData,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
Z as useGetApiDataBound,
|
|
150
|
+
Q as useGetDataBound,
|
|
151
151
|
K 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
|
-
|
|
157
|
+
j as useScrollSave,
|
|
158
158
|
dt as useSearchQuery,
|
|
159
159
|
mt as useSearchQueryState,
|
|
160
160
|
st as useWindowSize,
|
|
161
|
-
|
|
161
|
+
nt as useZodSchemaTypes
|
|
162
162
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-BrUuHr_r.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 P="_side-menu-item_o72rm_1",f="_disabled_o72rm_6",w="_hidden_o72rm_10",T="_nav-button_o72rm_13",q="_child_o72rm_21",I="_text_o72rm_26",S="_icon_o72rm_36",L="_collapse-icon_o72rm_42",O="_collapsed_o72rm_52",A="_collapse-icon-mini_o72rm_55",$="_expanded_o72rm_86",D="_children-container_o72rm_92",K="_visible_o72rm_100",F="_children_o72rm_92",z="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:P,disabled:f,hidden:w,"nav-button":"_nav-button_o72rm_13",navButton:T,child:q,text:I,icon:S,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:L,collapsed:O,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:A,expanded:$,"children-container":"_children-container_o72rm_92",childrenContainer:D,visible:K,children:F,mobile:z},G=({item:s,menuExpanded:i,useTooltips:r,children:c})=>s.tooltip&&!i&&r?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:r,onCollapse:c,currentPath:_,useHover:l,useTooltips:p,isMobile:k,disableMode:a})=>{var v,N,E,y;const[M,h]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((v=s.children)==null?void 0:v.some(o=>o.linkTo===j)),m=x.useRef(null);return e.useClickOutside([m],()=>r&&c()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:k},{[n.expanded]:i},{active:M||R},{open:r&&s.children},{[a==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((N=s.children)==null?void 0:N.every(o=>o.notPermitted||o.disabled))},{[a==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((E=s.children)==null?void 0:E.every(o=>o.notPermitted||o.disabled))}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[e.jsxRuntimeExports.jsx(G,{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}),!l&&!i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",n.collapseIconMini,{[n.collapsed]:r}),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]:r}),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]:r}),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(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))})})]})},H="_side-menu_12rky_1",U="_sidebar-header_12rky_15",W="_side-menu-content_12rky_22",J="_no-top-margin_12rky_28",Q="_expand_12rky_34",V="_only-logo_12rky_38",X="_mobile_12rky_41",Y="_divider_12rky_56",u={"side-menu":"_side-menu_12rky_1",sideMenu:H,"sidebar-header":"_sidebar-header_12rky_15",sidebarHeader:U,"side-menu-content":"_side-menu-content_12rky_22",sideMenuContent:W,"no-top-margin":"_no-top-margin_12rky_28",noTopMargin:J,expand:Q,"only-logo":"_only-logo_12rky_38",onlyLogo:V,mobile:X,divider:Y},Z=14,ee=({headerItem:s,searchItem:i,shortcutsItem:r,mainItems:c,secondaryItems:_,expanded:l,setExpanded:p,currentPath:k,useHover:a,useTooltips:M,disableMode:h="disable"})=>{const[j,R]=x.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),v=x.useMemo(()=>c.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(b=>({...b,notPermitted:!m(b.permissions??[],"any"),disabled:t.disabled||b.disabled}))}}),[c,m]),N=x.useMemo(()=>_.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(b=>({...b,notPermitted:!m(b.permissions??[],"any")}))}}),[_,m]),E=t=>{R(t===j?-1:t)};x.useEffect(()=>{l||R(-1)},[l]);const y=x.useRef(null);e.useClickOutside([y],()=>p(!1));const{isMobile:o}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",u.sideMenu,{[u.mobile]:o},{[u.expand]:l},{expand:l}),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(!l),children:a?s:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),l&&(i||r)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[r&&l?r:null,i&&l?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(u.sideMenuContent,{[u.noTopMargin]:[...v,...N].length>Z}),children:[v.map((t,d)=>e.jsxRuntimeExports.jsx(B,{item:t,menuExpanded:l,collapsed:d===j,onCollapse:()=>E(d),currentPath:k,useHover:a,useTooltips:M,isMobile:o,disableMode:h},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),N.map((t,d)=>e.jsxRuntimeExports.jsx(B,{item:t,menuExpanded:l,collapsed:d===j,onCollapse:()=>E(d),currentPath:k,useHover:a,useTooltips:M,isMobile:o,disableMode:h},t.title))]})]})},se="_top-bar_lnmq0_1",ne="_top-bar-brand_lnmq0_12",C={"top-bar":"_top-bar_lnmq0_1",topBar:se,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ne},oe=({appName:s,leftOffset:i,leftContent:r,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}),r]}),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=ee;exports.TopBar=oe;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { aM as T, j as n, c as i, Y as C, aA as q, bq as A, aC as S, bA as $, bB as O } from "./nivo-bar.es-B3fjtFrd.js";
|
|
2
|
+
import { aq as Bn, bC as Cn } from "./nivo-bar.es-B3fjtFrd.js";
|
|
3
3
|
import { useState as L, useRef as R, useMemo as P, useEffect as D } from "react";
|
|
4
4
|
import { Link as B } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|
|
@@ -28,15 +28,15 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
28
28
|
visible: X,
|
|
29
29
|
children: Z,
|
|
30
30
|
mobile: nn
|
|
31
|
-
}, en = ({ item: e, menuExpanded: l, useTooltips: r, children: c }) => e.tooltip && !l && r ? /* @__PURE__ */ n.jsx(
|
|
32
|
-
var y, k,
|
|
31
|
+
}, en = ({ item: e, menuExpanded: l, useTooltips: r, children: c }) => e.tooltip && !l && r ? /* @__PURE__ */ n.jsx(q, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: c }) }) : c, w = ({ item: e, menuExpanded: l, collapsed: r, onCollapse: c, currentPath: u, useHover: a, useTooltips: b, isMobile: g, disableMode: d }) => {
|
|
32
|
+
var y, k, M, N;
|
|
33
33
|
const [f, v] = L(!1), [h] = u.split("?"), j = e.linkTo === h || ((y = e.children) == null ? void 0 : y.some((o) => o.linkTo === h)), m = R(null);
|
|
34
34
|
return T([m], () => r && c()), /* @__PURE__ */ n.jsxs("li", { ref: m, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: g }, {
|
|
35
35
|
[s.expanded]: l
|
|
36
36
|
}, { active: f || j }, { open: r && e.children }, {
|
|
37
37
|
[d === "disable" ? s.disabled : s.hidden]: e.disabled || e.notPermitted || ((k = e.children) == null ? void 0 : k.every((o) => o.notPermitted || o.disabled))
|
|
38
38
|
}, {
|
|
39
|
-
[d === "disable" ? "disabled" : "hidden"]: e.disabled || e.notPermitted || ((
|
|
39
|
+
[d === "disable" ? "disabled" : "hidden"]: e.disabled || e.notPermitted || ((M = e.children) == null ? void 0 : M.every((o) => o.notPermitted || o.disabled))
|
|
40
40
|
}), onMouseEnter: () => v(!0), onMouseLeave: () => v(!1), children: [
|
|
41
41
|
/* @__PURE__ */ n.jsx(en, { item: e, menuExpanded: l, useTooltips: b, children: e.children ? /* @__PURE__ */ n.jsx(n.Fragment, { children: /* @__PURE__ */ n.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
|
|
42
42
|
c();
|
|
@@ -55,7 +55,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
55
55
|
] }) }),
|
|
56
56
|
/* @__PURE__ */ n.jsx("div", { className: i("children-container", s.childrenContainer, {
|
|
57
57
|
[s.visible]: r
|
|
58
|
-
}), children: /* @__PURE__ */ n.jsx("div", { className: i("shadow rounded children", s.children), children: (
|
|
58
|
+
}), children: /* @__PURE__ */ n.jsx("div", { className: i("shadow rounded children", s.children), children: (N = e.children) == null ? void 0 : N.map((o) => /* @__PURE__ */ n.jsx(B, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
|
|
59
59
|
[d === "disable" ? s.disabled : s.hidden]: o.disabled || o.notPermitted
|
|
60
60
|
}, {
|
|
61
61
|
[d === "disable" ? "disabled" : "hidden"]: o.disabled || o.notPermitted
|
|
@@ -75,7 +75,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
75
75
|
onlyLogo: an,
|
|
76
76
|
mobile: dn,
|
|
77
77
|
divider: cn
|
|
78
|
-
}, _n = 14,
|
|
78
|
+
}, _n = 14, Mn = ({ headerItem: e, searchItem: l, shortcutsItem: r, mainItems: c, secondaryItems: u, expanded: a, setExpanded: b, currentPath: g, useHover: d, useTooltips: f, disableMode: v = "disable" }) => {
|
|
79
79
|
const [h, j] = L(-1), { checkUserHasPermissions: m } = A(), y = P(() => c.map((t) => {
|
|
80
80
|
var _;
|
|
81
81
|
return {
|
|
@@ -97,22 +97,22 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
97
97
|
notPermitted: !m(x.permissions ?? [], "any")
|
|
98
98
|
}))
|
|
99
99
|
};
|
|
100
|
-
}), [u, m]),
|
|
100
|
+
}), [u, m]), M = (t) => {
|
|
101
101
|
j(t === h ? -1 : t);
|
|
102
102
|
};
|
|
103
103
|
D(() => {
|
|
104
104
|
a || j(-1);
|
|
105
105
|
}, [a]);
|
|
106
|
-
const
|
|
107
|
-
T([
|
|
108
|
-
const { isMobile: o } =
|
|
109
|
-
return /* @__PURE__ */ n.jsxs("section", { ref:
|
|
106
|
+
const N = R(null);
|
|
107
|
+
T([N], () => b(!1));
|
|
108
|
+
const { isMobile: o } = S();
|
|
109
|
+
return /* @__PURE__ */ n.jsxs("section", { ref: N, className: i("luminus-side-menu shadow", p.sideMenu, { [p.mobile]: o }, {
|
|
110
110
|
[p.expand]: a
|
|
111
111
|
}, { expand: a }), onMouseEnter: () => d && b(!0), onMouseLeave: () => d && b(!1), children: [
|
|
112
112
|
/* @__PURE__ */ n.jsx("div", { className: i("sidebar-header", p.sidebarHeader, {
|
|
113
113
|
[p.onlyLogo]: d
|
|
114
114
|
}), role: d ? void 0 : "button", onClick: d ? void 0 : () => b(!a), children: d ? e : a ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
115
|
-
/* @__PURE__ */ n.jsx(
|
|
115
|
+
/* @__PURE__ */ n.jsx($, {}),
|
|
116
116
|
e
|
|
117
117
|
] }) : /* @__PURE__ */ n.jsx(O, {}) }),
|
|
118
118
|
a && (l || r) ? /* @__PURE__ */ n.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
|
|
@@ -122,9 +122,9 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
122
122
|
/* @__PURE__ */ n.jsxs("ul", { className: i(p.sideMenuContent, {
|
|
123
123
|
[p.noTopMargin]: [...y, ...k].length > _n
|
|
124
124
|
}), children: [
|
|
125
|
-
y.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () =>
|
|
125
|
+
y.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => M(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title)),
|
|
126
126
|
/* @__PURE__ */ n.jsx("hr", { className: i("divider", p.divider) }),
|
|
127
|
-
k.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () =>
|
|
127
|
+
k.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => M(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title))
|
|
128
128
|
] })
|
|
129
129
|
] });
|
|
130
130
|
}, mn = "_top-bar_lnmq0_1", pn = "_top-bar-brand_lnmq0_12", I = {
|
|
@@ -132,7 +132,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
132
132
|
topBar: mn,
|
|
133
133
|
"top-bar-brand": "_top-bar-brand_lnmq0_12",
|
|
134
134
|
topBarBrand: pn
|
|
135
|
-
},
|
|
135
|
+
}, Nn = ({ appName: e, leftOffset: l, leftContent: r, centerContent: c, rightContent: u }) => /* @__PURE__ */ n.jsx("nav", { className: i("luminus-top-bar shadow", I.topBar), style: {
|
|
136
136
|
width: l ? `calc(100% - ${l}px)` : void 0,
|
|
137
137
|
left: l ? `${l}px` : void 0
|
|
138
138
|
}, children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 row g-0", children: [
|
|
@@ -146,6 +146,6 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
|
|
|
146
146
|
export {
|
|
147
147
|
Bn as PageContainer,
|
|
148
148
|
Cn as SideContentBar,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
Mn as SideMenu,
|
|
150
|
+
Nn as TopBar
|
|
151
151
|
};
|