react-luminus-components 1.5.0 → 1.5.2
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 +36 -36
- package/dist/FormDisabledProvider-BPet3cgR.cjs +1 -0
- package/dist/{FormDisabledProvider-CIv-aGtv.js → FormDisabledProvider-aUfGn6S6.js} +1 -1
- package/dist/{nivo-bar.es-BrUuHr_r.cjs → ShortcutLinksContext-CFDCR0fQ.cjs} +8 -8
- package/dist/{nivo-bar.es-B3fjtFrd.js → ShortcutLinksContext-CH9KdcxB.js} +6923 -6901
- package/dist/components/UserSettings/FileDownloadUS/FileDownloadUS.d.ts +4 -0
- package/dist/components/UserSettings/LocalStorageBackupUS/CreateBackupModal/CreateBackupModal.d.ts +8 -0
- package/dist/components/UserSettings/LocalStorageBackupUS/LocalStorageBackupUS.d.ts +9 -0
- package/dist/components/UserSettings/index.d.ts +2 -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 +44 -44
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +18 -18
- package/dist/localStorageUtils-CHdu9Xvf.js +46 -0
- package/dist/localStorageUtils-DUQHXXBp.cjs +1 -0
- package/dist/main.cjs.js +51 -51
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +7825 -7765
- package/dist/models/api/localStorageSettings/LocalStorageSettingsModel.d.ts +6 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/texts/ComponentsContextTexts.d.ts +2 -0
- package/dist/models/texts/UserSettingsTexts.d.ts +18 -0
- package/dist/style.css +1 -1
- package/dist/{useLocalStorageState-qjMdpyEs.js → useLocalStorageState-C-xR82iw.js} +10 -10
- package/dist/useLocalStorageState-CAHDOgis.cjs +1 -0
- package/dist/utils/file/fileUtils.d.ts +0 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/localStorage/localStorageUtils.d.ts +2 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +70 -69
- package/dist/variables.scss +165 -165
- package/package.json +123 -123
- package/dist/FormDisabledProvider-X5m4Ty4e.cjs +0 -1
- package/dist/apiPathUtils-CkTRKCPh.cjs +0 -1
- package/dist/apiPathUtils-DiqvB8mF.js +0 -15
- package/dist/useLocalStorageState-VlOdjbMB.cjs +0 -1
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 { aw as k, aX as L, ar as O } from "./ShortcutLinksContext-CH9KdcxB.js";
|
|
2
|
+
import { bM as Y, bu as Z, bO as j, aR as J, bN as _, af as K, aY as tt, bb as et, bm as at, a2 as st, bh as rt } from "./ShortcutLinksContext-CH9KdcxB.js";
|
|
3
|
+
import { u as ot, a as ut } from "./useLocalStorageState-C-xR82iw.js";
|
|
4
|
+
import { useState as b, 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", r;
|
|
14
14
|
const a = e.then((s) => {
|
|
15
|
-
t = "success",
|
|
15
|
+
t = "success", r = s;
|
|
16
16
|
}, (s) => {
|
|
17
|
-
t = "error",
|
|
17
|
+
t = "error", r = 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 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 q(e, t) {
|
|
33
|
+
const r = k({
|
|
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] = b(null);
|
|
38
38
|
return g(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const
|
|
41
|
-
s(y(
|
|
40
|
+
const n = r.get(e).then((u) => u.data);
|
|
41
|
+
s(y(n));
|
|
42
42
|
})();
|
|
43
|
-
}, [
|
|
43
|
+
}, [r, e]), a;
|
|
44
44
|
}
|
|
45
|
-
const B = (e, t,
|
|
45
|
+
const B = (e, t, r) => {
|
|
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((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);
|
|
52
52
|
});
|
|
53
53
|
return () => {
|
|
54
54
|
switch (a) {
|
|
@@ -70,30 +70,30 @@ const B = (e, t, n) => {
|
|
|
70
70
|
enabled: !0,
|
|
71
71
|
nullStateBeforeLoad: !0,
|
|
72
72
|
nullStateOnFail: !1
|
|
73
|
-
},
|
|
74
|
-
const l =
|
|
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
75
|
silent: a,
|
|
76
76
|
customToken: u,
|
|
77
|
-
differentBaseUrl:
|
|
77
|
+
differentBaseUrl: n,
|
|
78
78
|
noToastOnStatus: o ? [404] : void 0
|
|
79
|
-
}), { startLoading: m, stopLoading:
|
|
80
|
-
if (!
|
|
79
|
+
}), { startLoading: m, stopLoading: v } = $(L), T = I(0), { isAuthenticated: D } = O(), [A, h] = b(null), w = S(async (f, C) => {
|
|
80
|
+
if (!D() || r === !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((x) => i ? i(x.data) : x.data).finally(() => !a && v(`loadData-${e}-${C}`));
|
|
86
86
|
h(B(P, c ?? !1, o ?? !1));
|
|
87
87
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
D,
|
|
89
|
+
r,
|
|
90
90
|
a,
|
|
91
91
|
m,
|
|
92
92
|
e,
|
|
93
93
|
s,
|
|
94
94
|
l,
|
|
95
95
|
i,
|
|
96
|
-
|
|
96
|
+
v,
|
|
97
97
|
c,
|
|
98
98
|
o
|
|
99
99
|
]);
|
|
@@ -109,8 +109,8 @@ const B = (e, t, n) => {
|
|
|
109
109
|
storageKey: "--tmp-scroll-save--",
|
|
110
110
|
requiredHeight: 100,
|
|
111
111
|
retryInterval: 50
|
|
112
|
-
},
|
|
113
|
-
const [s, c] =
|
|
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
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, n) => {
|
|
|
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 > r) {
|
|
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, n) => {
|
|
|
127
127
|
return () => {
|
|
128
128
|
window.clearTimeout(o);
|
|
129
129
|
};
|
|
130
|
-
}, [s,
|
|
130
|
+
}, [s, r, 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
|
+
n.current = ((m = e.current) == null ? void 0 : m.scrollTop) ?? 0, i((n.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
|
+
Y as cancelToken,
|
|
141
141
|
O as useAuth,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
k as useAxios,
|
|
143
|
+
Z as useClickOutside,
|
|
144
|
+
j as useClipboard,
|
|
145
|
+
J 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
|
+
H as useScrollSave,
|
|
158
158
|
dt as useSearchQuery,
|
|
159
159
|
mt as useSearchQueryState,
|
|
160
160
|
st as useWindowSize,
|
|
161
|
-
|
|
161
|
+
rt 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("./ShortcutLinksContext-CFDCR0fQ.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",S="_text_o72rm_26",I="_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:S,icon:I,"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,C=({item:s,menuExpanded:i,collapsed:r,onCollapse:c,currentPath:_,useHover:l,useTooltips:p,isMobile:k,disableMode:a})=>{var N,v,E,y;const[M,h]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((N=s.children)==null?void 0:N.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||((v=s.children)==null?void 0:v.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(),N=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]),v=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]:[...N,...v].length>Z}),children:[N.map((t,d)=>e.jsxRuntimeExports.jsx(C,{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)}),v.map((t,d)=>e.jsxRuntimeExports.jsx(C,{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",B={"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",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(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.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 { bu as T, j as n, c as i, Y as C, ao as S, bb as A, a2 as $, bA as q, bB as O } from "./ShortcutLinksContext-CH9KdcxB.js";
|
|
2
|
+
import { b9 as Bn, bC as Cn } from "./ShortcutLinksContext-CH9KdcxB.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(S, { 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, N, M;
|
|
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 || ((N = e.children) == null ? void 0 : N.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: (M = e.children) == null ? void 0 : M.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, Nn = ({ 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]), N = (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 M = R(null);
|
|
107
|
+
T([M], () => b(!1));
|
|
108
|
+
const { isMobile: o } = $();
|
|
109
|
+
return /* @__PURE__ */ n.jsxs("section", { ref: M, 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(q, {}),
|
|
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: () => N(_), 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: () => N(_), 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
|
+
}, Mn = ({ 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
|
+
Nn as SideMenu,
|
|
150
|
+
Mn as TopBar
|
|
151
151
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { generatePath as u } from "react-router-dom";
|
|
2
|
+
const S = (o, t, r) => {
|
|
3
|
+
let e = o;
|
|
4
|
+
return t !== void 0 && (e = Math.max(e, t)), r !== void 0 && (e = Math.min(e, r)), e;
|
|
5
|
+
}, i = (o, t, r = !0) => Object.keys(o).reduce((e, n) => {
|
|
6
|
+
const c = o[n];
|
|
7
|
+
return r && (c == null || c === "") || (e[n] = t(c, n)), e;
|
|
8
|
+
}, {}), g = (o, t) => {
|
|
9
|
+
const r = t != null && t.query ? new URLSearchParams(i(t.query, (e) => (e == null ? void 0 : e.toString()) ?? "")) : null;
|
|
10
|
+
return `${u(o, t != null && t.path ? i(t.path, (e) => (e == null ? void 0 : e.toString()) ?? null) : void 0)}${r && r.size > 0 ? `?${r.toString()}` : ""}`;
|
|
11
|
+
}, l = [
|
|
12
|
+
{ key: "msal", mode: "includes" },
|
|
13
|
+
{ key: "token", mode: "exact" },
|
|
14
|
+
{ key: "user", mode: "exact" },
|
|
15
|
+
{ key: "user-delegation", mode: "exact" }
|
|
16
|
+
], a = (o = !0) => {
|
|
17
|
+
const t = {};
|
|
18
|
+
for (let r = 0; r < localStorage.length; r++) {
|
|
19
|
+
const e = localStorage.key(r);
|
|
20
|
+
if (e && !(o && l.some(({ key: n, mode: c }) => c === "includes" ? e.includes(n) : e === n)))
|
|
21
|
+
try {
|
|
22
|
+
t[e] = JSON.parse(localStorage.getItem(e));
|
|
23
|
+
} catch {
|
|
24
|
+
t[e] = localStorage.getItem(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}, d = (o) => {
|
|
29
|
+
try {
|
|
30
|
+
const t = JSON.parse(o);
|
|
31
|
+
if (typeof t != "object" || t === null)
|
|
32
|
+
return !1;
|
|
33
|
+
Object.entries(t).forEach(([r, e]) => {
|
|
34
|
+
localStorage.setItem(r, JSON.stringify(e));
|
|
35
|
+
});
|
|
36
|
+
} catch {
|
|
37
|
+
return !1;
|
|
38
|
+
}
|
|
39
|
+
return !0;
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
a as d,
|
|
43
|
+
g,
|
|
44
|
+
S as l,
|
|
45
|
+
d as r
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react-router-dom"),l=(o,t,r)=>{let e=o;return t!==void 0&&(e=Math.max(e,t)),r!==void 0&&(e=Math.min(e,r)),e},u=(o,t,r=!0)=>Object.keys(o).reduce((e,n)=>{const c=o[n];return r&&(c==null||c==="")||(e[n]=t(c,n)),e},{}),s=(o,t)=>{const r=t!=null&&t.query?new URLSearchParams(u(t.query,e=>(e==null?void 0:e.toString())??"")):null;return`${i.generatePath(o,t!=null&&t.path?u(t.path,e=>(e==null?void 0:e.toString())??null):void 0)}${r&&r.size>0?`?${r.toString()}`:""}`},S=[{key:"msal",mode:"includes"},{key:"token",mode:"exact"},{key:"user",mode:"exact"},{key:"user-delegation",mode:"exact"}],g=(o=!0)=>{const t={};for(let r=0;r<localStorage.length;r++){const e=localStorage.key(r);if(e&&!(o&&S.some(({key:n,mode:c})=>c==="includes"?e.includes(n):e===n)))try{t[e]=JSON.parse(localStorage.getItem(e))}catch{t[e]=localStorage.getItem(e)}}return t},a=o=>{try{const t=JSON.parse(o);if(typeof t!="object"||t===null)return!1;Object.entries(t).forEach(([r,e])=>{localStorage.setItem(r,JSON.stringify(e))})}catch{return!1}return!0};exports.dumpLocalStorage=g;exports.generateApiPath=s;exports.limitNumber=l;exports.restoreLocalStorage=a;
|