react-luminus-components 1.5.39 → 1.5.41
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-BAiNdOtC.js → FormDisabledProvider-Bnx4rLPt.js} +1 -1
- package/dist/FormDisabledProvider-D3_uZkaG.cjs +1 -0
- package/dist/{nivo-bar.es--AbsdroC.js → ShortcutLinksContext-B3a1Cd5G.js} +6657 -6656
- package/dist/{nivo-bar.es-B9IJx7pj.cjs → ShortcutLinksContext-DL1kqHiR.cjs} +7 -7
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +7 -3
- package/dist/components/NotifCenter/Actions/components/index.d.ts +2 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationActionAddModal.d.ts +11 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateAddModal.d.ts +13 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateEditModal.d.ts +6 -4
- package/dist/components/NotifCenter/NotifStyles/NotifStyles.d.ts +10 -0
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleFormSchema.d.ts +16 -0
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleTableColumns.d.ts +7 -0
- package/dist/components/NotifCenter/index.d.ts +1 -0
- package/dist/components/UserSettings/LanguageSettingsUS/LanguageSettingsUS.d.ts +2 -0
- package/dist/components/UserSettings/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +56 -56
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +56 -56
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +8 -8
- package/dist/main.cjs.js +54 -54
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +10976 -10799
- package/dist/models/index.d.ts +3 -0
- package/dist/models/texts/NotifCentrumTexts.d.ts +15 -0
- package/dist/models/texts/UserSettingsTexts.d.ts +1 -0
- package/dist/models/types/notifCenter/NotifStyleModel.d.ts +6 -0
- package/dist/models/types/notifCenter/NotifTemplateCreateModel.d.ts +11 -0
- package/dist/models/types/notifCenter/NotifTemplateEditModel.d.ts +6 -0
- package/dist/models/types/notifCenter/NotificationAttachmentModel.d.ts +4 -0
- package/dist/models/types/notifCenter/NotificationModel.d.ts +2 -1
- package/dist/models/types/notifCenter/NotificationTemplate.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/{useLocalStorageState-B2VDAPTK.js → useLocalStorageState-DIgKUvq6.js} +13 -13
- package/dist/useLocalStorageState-DJIRaF9a.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +23 -23
- package/dist/variables.scss +165 -165
- package/package.json +123 -123
- package/dist/FormDisabledProvider-Cs9zynFk.cjs +0 -1
- package/dist/useLocalStorageState-i8aLBOb5.cjs +0 -1
package/dist/hooks.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bN as
|
|
3
|
-
import { u as it, a as dt } from "./useLocalStorageState-
|
|
4
|
-
import { useState as h, useEffect as
|
|
5
|
-
import { c as ft, u as gt, a as
|
|
1
|
+
import { aw as O, aX as L, ar as T } from "./ShortcutLinksContext-B3a1Cd5G.js";
|
|
2
|
+
import { bN as k, bw as K, bP as tt, aR as et, bO as st, af as rt, aY as nt, ba as at, bn as ot, a2 as ut, bg as ct } from "./ShortcutLinksContext-B3a1Cd5G.js";
|
|
3
|
+
import { u as it, a as dt } from "./useLocalStorageState-DIgKUvq6.js";
|
|
4
|
+
import { useState as h, useEffect as p, useRef as S, useCallback as f, useMemo as E, useSyncExternalStore as A, useContext as N } from "react";
|
|
5
|
+
import { c as ft, u as gt, a as wt, b as pt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
6
6
|
import "react-router-dom";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
import "react-hook-form";
|
|
@@ -10,56 +10,56 @@ import "react-flexmonster";
|
|
|
10
10
|
import "@azure/msal-browser";
|
|
11
11
|
import "@azure/msal-react";
|
|
12
12
|
const B = (t) => {
|
|
13
|
-
let e = "pending",
|
|
14
|
-
const
|
|
15
|
-
e = "success",
|
|
13
|
+
let e = "pending", r;
|
|
14
|
+
const n = t.then((s) => {
|
|
15
|
+
e = "success", r = s;
|
|
16
16
|
}, (s) => {
|
|
17
|
-
e = "error",
|
|
17
|
+
e = "error", r = s;
|
|
18
18
|
});
|
|
19
19
|
return () => {
|
|
20
20
|
switch (e) {
|
|
21
21
|
case "pending":
|
|
22
|
-
throw
|
|
22
|
+
throw n;
|
|
23
23
|
case "success":
|
|
24
|
-
return
|
|
24
|
+
return r;
|
|
25
25
|
case "error":
|
|
26
|
-
throw
|
|
26
|
+
throw r;
|
|
27
27
|
default:
|
|
28
28
|
throw new Error("Unknown status");
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
const
|
|
32
|
+
function H(t, e) {
|
|
33
|
+
const r = O({
|
|
34
34
|
silent: !0,
|
|
35
35
|
differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
|
|
36
36
|
customToken: e == null ? void 0 : e.customToken
|
|
37
|
-
}), [
|
|
38
|
-
return
|
|
37
|
+
}), [n, s] = h(null);
|
|
38
|
+
return p(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const o =
|
|
40
|
+
const o = r.get(t).then((u) => u.data);
|
|
41
41
|
s(B(o));
|
|
42
42
|
})();
|
|
43
|
-
}, [
|
|
43
|
+
}, [r, t]), n;
|
|
44
44
|
}
|
|
45
|
-
const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => window.removeEventListener(`storage_${t}`, e)),
|
|
46
|
-
const [
|
|
47
|
-
const i =
|
|
48
|
-
return i !== s.current && (s.current = i, c.current = s.current ? JSON.parse(s.current) :
|
|
49
|
-
}, [t,
|
|
50
|
-
|
|
51
|
-
}, [t,
|
|
45
|
+
const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => window.removeEventListener(`storage_${t}`, e)), M = (t, e, r = localStorage) => {
|
|
46
|
+
const [n] = h(e), s = S(JSON.stringify(e)), c = S(e), o = f(() => {
|
|
47
|
+
const i = r.getItem(t);
|
|
48
|
+
return i !== s.current && (s.current = i, c.current = s.current ? JSON.parse(s.current) : n), c.current;
|
|
49
|
+
}, [t, r, n]), u = E(() => U(t), [t]), l = A(u, o), a = f((i) => {
|
|
50
|
+
r.setItem(t, JSON.stringify(i)), window.dispatchEvent(new Event(`storage_${t}`));
|
|
51
|
+
}, [t, r]);
|
|
52
52
|
return E(() => [l, a], [l, a]);
|
|
53
|
-
}, F = (t, e,
|
|
54
|
-
let
|
|
53
|
+
}, F = (t, e, r) => {
|
|
54
|
+
let n = "pending", s;
|
|
55
55
|
const c = t.then((o) => {
|
|
56
|
-
|
|
56
|
+
n = "success", s = o;
|
|
57
57
|
}, (o) => {
|
|
58
58
|
const u = o == null ? void 0 : o.response;
|
|
59
|
-
(u == null ? void 0 : u.status) === 404 &&
|
|
59
|
+
(u == null ? void 0 : u.status) === 404 && r ? (n = "error-404", s = o) : (n = "error", s = o);
|
|
60
60
|
});
|
|
61
61
|
return () => {
|
|
62
|
-
switch (
|
|
62
|
+
switch (n) {
|
|
63
63
|
case "pending":
|
|
64
64
|
throw c;
|
|
65
65
|
case "success":
|
|
@@ -78,24 +78,24 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
|
|
|
78
78
|
enabled: !0,
|
|
79
79
|
nullStateBeforeLoad: !0,
|
|
80
80
|
nullStateOnFail: !1
|
|
81
|
-
},
|
|
82
|
-
const d =
|
|
83
|
-
silent:
|
|
81
|
+
}, X = (t, { loadOnInit: e = m.loadOnInit, enabled: r = m.enabled, silent: n = m.silent, nullStateBeforeLoad: s = m.nullStateBeforeLoad, nullStateOnFail: c = m.nullStateOnFail, customApiUrl: o, customBearerToken: u, dataTransformer: l, errorBoundaryOn404: a } = m) => {
|
|
82
|
+
const d = O({
|
|
83
|
+
silent: n,
|
|
84
84
|
customToken: u,
|
|
85
85
|
differentBaseUrl: o,
|
|
86
86
|
noToastOnStatus: a ? [404] : void 0
|
|
87
|
-
}), { startLoading: i, stopLoading: D } = N(L),
|
|
88
|
-
if (!C() ||
|
|
87
|
+
}), { startLoading: i, stopLoading: D } = N(L), P = S(0), { isAuthenticated: C } = T(), [V, v] = h(null), b = f(async (g, I) => {
|
|
88
|
+
if (!C() || r === !1)
|
|
89
89
|
return;
|
|
90
|
-
!
|
|
90
|
+
!n && i(`loadData-${t}-${I}`), s && v(null);
|
|
91
91
|
const $ = d.get(t, {
|
|
92
92
|
signal: g
|
|
93
|
-
}).then((x) => l ? l(x.data) : x.data).finally(() => !
|
|
93
|
+
}).then((x) => l ? l(x.data) : x.data).finally(() => !n && D(`loadData-${t}-${I}`));
|
|
94
94
|
v(F($, c ?? !1, a ?? !1));
|
|
95
95
|
}, [
|
|
96
96
|
C,
|
|
97
|
-
n,
|
|
98
97
|
r,
|
|
98
|
+
n,
|
|
99
99
|
i,
|
|
100
100
|
t,
|
|
101
101
|
s,
|
|
@@ -105,37 +105,37 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
|
|
|
105
105
|
c,
|
|
106
106
|
a
|
|
107
107
|
]);
|
|
108
|
-
return
|
|
108
|
+
return p(() => {
|
|
109
109
|
if (e === !1)
|
|
110
110
|
return;
|
|
111
111
|
const g = new AbortController();
|
|
112
|
-
return b(g.signal, ++
|
|
112
|
+
return b(g.signal, ++P.current), () => {
|
|
113
113
|
g.abort();
|
|
114
114
|
};
|
|
115
115
|
}, [b, e]), { data: V, setData: v, reloadData: b };
|
|
116
|
-
},
|
|
116
|
+
}, w = {
|
|
117
117
|
storageKey: "--tmp-scroll-save--",
|
|
118
118
|
requiredHeight: 100,
|
|
119
119
|
retryInterval: 50
|
|
120
|
-
},
|
|
120
|
+
}, Y = (t, { storageKey: e = w.storageKey, requiredHeight: r = w.requiredHeight, retryInterval: n = w.retryInterval } = w) => {
|
|
121
121
|
const [s, c] = h(!1), o = S(null), u = f(() => {
|
|
122
122
|
const a = localStorage.getItem(e);
|
|
123
123
|
return localStorage.removeItem(e), a === null ? null : Number(a);
|
|
124
124
|
}, [e]), l = f((a) => {
|
|
125
125
|
localStorage.setItem(e, a);
|
|
126
126
|
}, [e]);
|
|
127
|
-
return
|
|
127
|
+
return p(() => {
|
|
128
128
|
const a = window.setInterval(() => {
|
|
129
|
-
if (!s && t.current !== null && t.current.getBoundingClientRect().height >
|
|
129
|
+
if (!s && t.current !== null && t.current.getBoundingClientRect().height > r) {
|
|
130
130
|
c(!0);
|
|
131
131
|
const d = u();
|
|
132
132
|
d !== null && t.current.scrollTo({ top: d }), window.clearInterval(a);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, n);
|
|
135
135
|
return () => {
|
|
136
136
|
window.clearTimeout(a);
|
|
137
137
|
};
|
|
138
|
-
}, [s,
|
|
138
|
+
}, [s, r, u, n, t]), p(() => {
|
|
139
139
|
var d;
|
|
140
140
|
const a = new AbortController();
|
|
141
141
|
return (d = t.current) == null || d.addEventListener("scrollend", () => {
|
|
@@ -145,27 +145,27 @@ const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => windo
|
|
|
145
145
|
}, [l, t]), { saveValue: l, retrieveValue: u };
|
|
146
146
|
};
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
k as cancelToken,
|
|
149
149
|
T as useAuth,
|
|
150
|
-
|
|
150
|
+
O as useAxios,
|
|
151
151
|
K as useClickOutside,
|
|
152
152
|
tt as useClipboard,
|
|
153
153
|
et as useConfirm,
|
|
154
154
|
ft as useEmployeePhotoPath,
|
|
155
155
|
st as useFormControlType,
|
|
156
156
|
it as useGetApiData,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
X as useGetApiDataBound,
|
|
158
|
+
H as useGetDataBound,
|
|
159
|
+
rt as useKeyPress,
|
|
160
160
|
dt as useLocalStorageState,
|
|
161
|
-
|
|
161
|
+
nt as useNotifications,
|
|
162
162
|
at as usePermissions,
|
|
163
|
-
|
|
163
|
+
M as usePersistentState,
|
|
164
164
|
ot as usePrompt,
|
|
165
165
|
gt as useRenderDraggableInPortal,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
Y as useScrollSave,
|
|
167
|
+
wt as useSearchQuery,
|
|
168
|
+
pt as useSearchQueryState,
|
|
169
169
|
ut as useWindowSize,
|
|
170
170
|
ct as useZodSchemaTypes
|
|
171
171
|
};
|
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("./ShortcutLinksContext-DL1kqHiR.cjs"),_=require("react"),B=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");function L(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"},child:[]}]})(s)}function I(s){return e.GenIcon({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M56.88,31.93A12,12,0,1,0,39.12,48.07L60,71A76,76,0,0,0,35.46,84.51a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.9,228c.47,0,.94,0,1.41-.05A20,20,0,0,0,171.87,220a97.47,97.47,0,0,0,9.54-15.46l17.72,19.49a12,12,0,1,0,17.76-16.14Zm98.49,169.88L54.08,100.52C62,95,70.31,92.12,78.91,91.83l84.51,93A62,62,0,0,1,155.37,201.81Zm82.78-95-39,39.11a12,12,0,1,1-17-16.95l36.19-36.3-55-55L130.59,70.5a12,12,0,0,1-17-16.94l35.57-35.69a20,20,0,0,1,28.3,0l60.69,60.68A20,20,0,0,1,238.15,106.83Z"},child:[]}]})(s)}const A="_side-menu-item_o72rm_1",S="_disabled_o72rm_6",T="_hidden_o72rm_10",q="_nav-button_o72rm_13",O="_child_o72rm_21",Z="_text_o72rm_26",$="_icon_o72rm_36",G="_collapse-icon_o72rm_42",D="_collapsed_o72rm_52",F="_collapse-icon-mini_o72rm_55",K="_expanded_o72rm_86",z="_children-container_o72rm_92",H="_visible_o72rm_100",U="_children_o72rm_92",W="_mobile_o72rm_112",t={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:A,disabled:S,hidden:T,"nav-button":"_nav-button_o72rm_13",navButton:q,child:O,text:Z,icon:$,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:G,collapsed:D,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:F,expanded:K,"children-container":"_children-container_o72rm_92",childrenContainer:z,visible:H,children:U,mobile:W},J=({item:s,menuExpanded:o,useTooltips:r,children:d})=>s.tooltip&&!o&&r?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:d})}):d,f=({item:s,menuExpanded:o,collapsed:r,onCollapse:d,currentPath:h,useHover:a,useTooltips:b,isMobile:E,disableMode:c})=>{var R,m,v,N;const[g,p]=_.useState(!1),[M]=h.split("?"),P=s.linkTo===M||((R=s.children)==null?void 0:R.some(i=>i.linkTo===M)),j=_.useRef(null);return e.useClickOutside([j],()=>r&&d()),e.jsxRuntimeExports.jsxs("li",{ref:j,className:e.classNames("luminus-side-menu-item",t.sideMenuItem,{[t.mobile]:E},{[t.expanded]:o},{active:g||P},{open:r&&s.children},{[c==="disable"?t.disabled:t.hidden]:s.disabled||s.notPermitted||((m=s.children)==null?void 0:m.every(i=>i.notPermitted||i.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(i=>i.notPermitted||i.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(J,{item:s,menuExpanded:o,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",t.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",t.icon),children:s.icon}),!a&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",t.collapseIconMini,{[t.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:s.title}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",t.collapseIcon,{[t.collapsed]:r}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(B.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",t.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",t.icon),children:s.icon}),o&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",t.childrenContainer,{[t.visible]:r}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",t.children),children:(N=s.children)==null?void 0:N.map(i=>e.jsxRuntimeExports.jsx(B.Link,{to:i.disabled||i.notPermitted?"/":i.linkTo??"/",className:e.classNames("nav-link child rounded",t.navButton,t.child,{[c==="disable"?t.disabled:t.hidden]:i.disabled||i.notPermitted},{[c==="disable"?"disabled":"hidden"]:i.disabled||i.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",t.text,"text-nowrap"),children:i.title})},i.linkTo))})})]})},Q="_side-menu_140bh_1",V="_sidebar-header_140bh_15",X="_side-menu-pin_140bh_22",Y="_side-menu-content_140bh_27",ee="_no-top-margin_140bh_33",se="_expand_140bh_39",ne="_only-logo_140bh_43",te="_mobile_140bh_46",ie="_divider_140bh_61",x={"side-menu":"_side-menu_140bh_1",sideMenu:Q,"sidebar-header":"_sidebar-header_140bh_15",sidebarHeader:V,"side-menu-pin":"_side-menu-pin_140bh_22",sideMenuPin:X,"side-menu-content":"_side-menu-content_140bh_27",sideMenuContent:Y,"no-top-margin":"_no-top-margin_140bh_33",noTopMargin:ee,expand:se,"only-logo":"_only-logo_140bh_43",onlyLogo:ne,mobile:te,divider:ie},oe=14,le=({headerItem:s,searchItem:o,shortcutsItem:r,mainItems:d,secondaryItems:h,expanded:a,setExpanded:b,currentPath:E,useHover:c,useTooltips:g,disableMode:p="disable",sideMenuPinned:M,toggleSideMenuPinned:P})=>{const[j,R]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),v=_.useMemo(()=>d.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:n.disabled||u.disabled}))}}),[d,m]),N=_.useMemo(()=>h.map(n=>{var l;return{...n,notPermitted:!m(n.permissions??[],"any"),children:(l=n.children)==null?void 0:l.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[h,m]),i=n=>{R(n===j?-1:n)};_.useEffect(()=>{a||R(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const w=_.useMemo(()=>[...v,...N].filter(n=>{var l;return p==="hide"?!n.disabled&&!n.notPermitted&&(((l=n.children)==null?void 0:l.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[v,N,p]),{isMobile:C}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:C},{[x.expand]:a},{expand:a}),onMouseEnter:()=>c&&b(!0),onMouseLeave:()=>c&&b(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",x.sidebarHeader,{[x.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>b(!a),children:c?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{role:"button",onClick:n=>{n.stopPropagation(),P()},className:x.sideMenuPin,children:M?e.jsxRuntimeExports.jsx(I,{}):e.jsxRuntimeExports.jsx(L,{})}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(o||r)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[r&&a?r:null,o&&a?o:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:w.length>oe}),children:[v.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>i(l),currentPath:E,useHover:c,useTooltips:g,isMobile:C,disableMode:p},n.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),N.map((n,l)=>e.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:a,collapsed:l===j,onCollapse:()=>i(l),currentPath:E,useHover:c,useTooltips:g,isMobile:C,disableMode:p},n.title))]})]})},re="_top-bar_lnmq0_1",ae="_top-bar-brand_lnmq0_12",k={"top-bar":"_top-bar_lnmq0_1",topBar:re,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ae},ce=({appName:s,leftOffset:o,leftContent:r,centerContent:d,rightContent:h})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",k.topBar),style:{width:o?`calc(100% - ${o}px)`:void 0,left:o?`${o}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(B.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",k.topBarBrand),children:s}),r]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:d??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:h??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=le;exports.TopBar=ce;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { bB as T,
|
|
2
|
-
import {
|
|
3
|
-
import { useState as S, useRef as
|
|
1
|
+
import { bB as T, bw as R, j as n, c as l, Y as I, ao as q, ba as O, a2 as D, bC as F } from "./ShortcutLinksContext-B3a1Cd5G.js";
|
|
2
|
+
import { b8 as Ln, bD as Tn } from "./ShortcutLinksContext-B3a1Cd5G.js";
|
|
3
|
+
import { useState as S, useRef as Z, useMemo as y, useEffect as G } from "react";
|
|
4
4
|
import { Link as k } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|
|
6
6
|
import "react-flexmonster";
|
|
@@ -34,9 +34,9 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
|
|
|
34
34
|
visible: on,
|
|
35
35
|
children: ln,
|
|
36
36
|
mobile: tn
|
|
37
|
-
}, an = ({ item: e, menuExpanded: t, useTooltips: r, children: _ }) => e.tooltip && !t && r ? /* @__PURE__ */ n.jsx(
|
|
37
|
+
}, an = ({ item: e, menuExpanded: t, useTooltips: r, children: _ }) => e.tooltip && !t && r ? /* @__PURE__ */ n.jsx(q, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: _ }) }) : _, A = ({ item: e, menuExpanded: t, collapsed: r, onCollapse: _, currentPath: p, useHover: d, useTooltips: x, isMobile: N, disableMode: c }) => {
|
|
38
38
|
var j, m, g, M;
|
|
39
|
-
const [P, b] = S(!1), [f] = p.split("?"), B = e.linkTo === f || ((j = e.children) == null ? void 0 : j.some((o) => o.linkTo === f)), v =
|
|
39
|
+
const [P, b] = S(!1), [f] = p.split("?"), B = e.linkTo === f || ((j = e.children) == null ? void 0 : j.some((o) => o.linkTo === f)), v = Z(null);
|
|
40
40
|
return R([v], () => r && _()), /* @__PURE__ */ n.jsxs("li", { ref: v, className: l("luminus-side-menu-item", i.sideMenuItem, { [i.mobile]: N }, {
|
|
41
41
|
[i.expanded]: t
|
|
42
42
|
}, { active: P || B }, { open: r && e.children }, {
|
|
@@ -111,9 +111,9 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
|
|
|
111
111
|
G(() => {
|
|
112
112
|
d || j(-1);
|
|
113
113
|
}, [d]);
|
|
114
|
-
const w =
|
|
114
|
+
const w = Z(null);
|
|
115
115
|
R([w], () => x(!1));
|
|
116
|
-
const
|
|
116
|
+
const $ = y(() => [...g, ...M].filter((s) => {
|
|
117
117
|
var a;
|
|
118
118
|
return b === "hide" ? !s.disabled && !s.notPermitted && (((a = s.children) == null ? void 0 : a.filter((u) => !u.disabled && !u.notPermitted)) ?? []).length > 0 : !0;
|
|
119
119
|
}), [g, M, b]), { isMobile: C } = D();
|
|
@@ -133,7 +133,7 @@ const H = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", U = "_hidden_o72rm
|
|
|
133
133
|
t && d ? t : null
|
|
134
134
|
] }) : null,
|
|
135
135
|
/* @__PURE__ */ n.jsxs("ul", { className: l(h.sideMenuContent, {
|
|
136
|
-
[h.noTopMargin]:
|
|
136
|
+
[h.noTopMargin]: $.length > xn
|
|
137
137
|
}), children: [
|
|
138
138
|
g.map((s, a) => /* @__PURE__ */ n.jsx(A, { item: s, menuExpanded: d, collapsed: a === v, onCollapse: () => o(a), currentPath: N, useHover: c, useTooltips: P, isMobile: C, disableMode: b }, s.title)),
|
|
139
139
|
/* @__PURE__ */ n.jsx("hr", { className: l("divider", h.divider) }),
|