react-luminus-components 1.5.6 → 1.5.8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-AgOPPcPf.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-AgOPPcPf.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;
package/dist/layout.es.js CHANGED
@@ -1,151 +1,154 @@
1
- import { bw as T, j as n, c as i, Y as C, ao as S, bb as $, a2 as q, bC as A, bD as O } from "./ShortcutLinksContext-CNZMOV_j.js";
2
- import { b9 as Bn, bE as Cn } from "./ShortcutLinksContext-CNZMOV_j.js";
3
- import { useState as L, useRef as R, useMemo as P, useEffect as D } from "react";
4
- import { Link as B } from "react-router-dom";
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-CNZMOV_j.js";
2
+ import { b9 as Pe, bE as Be } from "./ShortcutLinksContext-CNZMOV_j.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";
5
5
  import "react-hook-form";
6
6
  import "react-flexmonster";
7
7
  import "@azure/msal-browser";
8
8
  import "@azure/msal-react";
9
9
  import "react-dom";
10
- const E = "_side-menu-item_o72rm_1", F = "_disabled_o72rm_6", K = "_hidden_o72rm_10", z = "_nav-button_o72rm_13", G = "_child_o72rm_21", H = "_text_o72rm_26", U = "_icon_o72rm_36", W = "_collapse-icon_o72rm_42", Y = "_collapsed_o72rm_52", J = "_collapse-icon-mini_o72rm_55", Q = "_expanded_o72rm_86", V = "_children-container_o72rm_92", X = "_visible_o72rm_100", Z = "_children_o72rm_92", nn = "_mobile_o72rm_112", s = {
10
+ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm_10", G = "_nav-button_o72rm_13", H = "_child_o72rm_21", U = "_text_o72rm_26", W = "_icon_o72rm_36", Y = "_collapse-icon_o72rm_42", J = "_collapsed_o72rm_52", Q = "_collapse-icon-mini_o72rm_55", V = "_expanded_o72rm_86", X = "_children-container_o72rm_92", Z = "_visible_o72rm_100", ee = "_children_o72rm_92", ne = "_mobile_o72rm_112", s = {
11
11
  "side-menu-item": "_side-menu-item_o72rm_1",
12
- sideMenuItem: E,
13
- disabled: F,
14
- hidden: K,
12
+ sideMenuItem: F,
13
+ disabled: K,
14
+ hidden: z,
15
15
  "nav-button": "_nav-button_o72rm_13",
16
- navButton: z,
17
- child: G,
18
- text: H,
19
- icon: U,
16
+ navButton: G,
17
+ child: H,
18
+ text: U,
19
+ icon: W,
20
20
  "collapse-icon": "_collapse-icon_o72rm_42",
21
- collapseIcon: W,
22
- collapsed: Y,
21
+ collapseIcon: Y,
22
+ collapsed: J,
23
23
  "collapse-icon-mini": "_collapse-icon-mini_o72rm_55",
24
- collapseIconMini: J,
25
- expanded: Q,
24
+ collapseIconMini: Q,
25
+ expanded: V,
26
26
  "children-container": "_children-container_o72rm_92",
27
- childrenContainer: V,
28
- visible: X,
29
- children: Z,
30
- mobile: nn
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
- 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
- return T([m], () => r && c()), /* @__PURE__ */ n.jsxs("li", { ref: m, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: g }, {
35
- [s.expanded]: l
36
- }, { active: f || j }, { open: r && e.children }, {
37
- [d === "disable" ? s.disabled : s.hidden]: e.disabled || e.notPermitted || ((k = e.children) == null ? void 0 : k.every((o) => o.notPermitted || o.disabled))
27
+ childrenContainer: X,
28
+ visible: Z,
29
+ children: ee,
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 }) => {
32
+ var j, y, N, g;
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
+ return L([m], () => a && _()), /* @__PURE__ */ e.jsxs("li", { ref: m, className: l("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: M }, {
35
+ [s.expanded]: t
36
+ }, { active: f || k }, { open: a && n.children }, {
37
+ [c === "disable" ? s.disabled : s.hidden]: n.disabled || n.notPermitted || ((y = n.children) == null ? void 0 : y.every((i) => i.notPermitted || i.disabled))
38
38
  }, {
39
- [d === "disable" ? "disabled" : "hidden"]: e.disabled || e.notPermitted || ((N = e.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
40
- }), onMouseEnter: () => v(!0), onMouseLeave: () => v(!1), children: [
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
- c();
39
+ [c === "disable" ? "disabled" : "hidden"]: n.disabled || n.notPermitted || ((N = n.children) == null ? void 0 : N.every((i) => i.notPermitted || i.disabled))
40
+ }), onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), children: [
41
+ /* @__PURE__ */ e.jsx(se, { item: n, menuExpanded: t, useTooltips: x, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: l("nav-link", s.navButton), onClick: () => {
42
+ _();
43
43
  }, children: [
44
- /* @__PURE__ */ n.jsx("div", { className: i("icon", s.icon), children: e.icon }),
45
- !a && !l && /* @__PURE__ */ n.jsx("div", { className: i("collapse-icon-mini rounded", s.collapseIconMini, {
46
- [s.collapsed]: r
47
- }), children: /* @__PURE__ */ n.jsx(C, {}) }),
48
- l && /* @__PURE__ */ n.jsx("div", { className: i("text", s.text, "text-nowrap"), children: e.title }),
49
- l && /* @__PURE__ */ n.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
50
- [s.collapsed]: r
51
- }), children: /* @__PURE__ */ n.jsx(C, {}) })
52
- ] }) }) : /* @__PURE__ */ n.jsxs(B, { to: e.disabled || e.notPermitted ? "/" : e.linkTo ?? "/", className: i("nav-link", s.navButton), children: [
53
- /* @__PURE__ */ n.jsx("div", { className: i("icon", s.icon), children: e.icon }),
54
- l && /* @__PURE__ */ n.jsx("div", { className: i("text", s.text, "text-nowrap"), children: e.title })
44
+ /* @__PURE__ */ e.jsx("div", { className: l("icon", s.icon), children: n.icon }),
45
+ !d && !t && /* @__PURE__ */ e.jsx("div", { className: l("collapse-icon-mini rounded", s.collapseIconMini, {
46
+ [s.collapsed]: a
47
+ }), children: /* @__PURE__ */ e.jsx(w, {}) }),
48
+ t && /* @__PURE__ */ e.jsx("div", { className: l("text", s.text, "text-nowrap"), children: n.title }),
49
+ t && /* @__PURE__ */ e.jsx("div", { className: l("collapse-icon", s.collapseIcon, {
50
+ [s.collapsed]: a
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: [
53
+ /* @__PURE__ */ e.jsx("div", { className: l("icon", s.icon), children: n.icon }),
54
+ t && /* @__PURE__ */ e.jsx("div", { className: l("text", s.text, "text-nowrap"), children: n.title })
55
55
  ] }) }),
56
- /* @__PURE__ */ n.jsx("div", { className: i("children-container", s.childrenContainer, {
57
- [s.visible]: r
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
- [d === "disable" ? s.disabled : s.hidden]: o.disabled || o.notPermitted
56
+ /* @__PURE__ */ e.jsx("div", { className: l("children-container", s.childrenContainer, {
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, {
59
+ [c === "disable" ? s.disabled : s.hidden]: i.disabled || i.notPermitted
60
60
  }, {
61
- [d === "disable" ? "disabled" : "hidden"]: o.disabled || o.notPermitted
62
- }), onClick: c, children: /* @__PURE__ */ n.jsx("div", { className: i("text", s.text, "text-nowrap"), children: o.title }) }, o.linkTo)) }) })
61
+ [c === "disable" ? "disabled" : "hidden"]: i.disabled || i.notPermitted
62
+ }), onClick: _, children: /* @__PURE__ */ e.jsx("div", { className: l("text", s.text, "text-nowrap"), children: i.title }) }, i.linkTo)) }) })
63
63
  ] });
64
- }, sn = "_side-menu_12rky_1", on = "_sidebar-header_12rky_15", ln = "_side-menu-content_12rky_22", tn = "_no-top-margin_12rky_28", rn = "_expand_12rky_34", an = "_only-logo_12rky_38", dn = "_mobile_12rky_41", cn = "_divider_12rky_56", p = {
64
+ }, oe = "_side-menu_12rky_1", ie = "_sidebar-header_12rky_15", le = "_side-menu-content_12rky_22", te = "_no-top-margin_12rky_28", re = "_expand_12rky_34", ae = "_only-logo_12rky_38", de = "_mobile_12rky_41", ce = "_divider_12rky_56", u = {
65
65
  "side-menu": "_side-menu_12rky_1",
66
- sideMenu: sn,
66
+ sideMenu: oe,
67
67
  "sidebar-header": "_sidebar-header_12rky_15",
68
- sidebarHeader: on,
68
+ sidebarHeader: ie,
69
69
  "side-menu-content": "_side-menu-content_12rky_22",
70
- sideMenuContent: ln,
70
+ sideMenuContent: le,
71
71
  "no-top-margin": "_no-top-margin_12rky_28",
72
- noTopMargin: tn,
73
- expand: rn,
72
+ noTopMargin: te,
73
+ expand: re,
74
74
  "only-logo": "_only-logo_12rky_38",
75
- onlyLogo: an,
76
- mobile: dn,
77
- divider: cn
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
- const [h, j] = L(-1), { checkUserHasPermissions: m } = $(), y = P(() => c.map((t) => {
80
- var _;
75
+ onlyLogo: ae,
76
+ mobile: de,
77
+ divider: ce
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) => {
80
+ var r;
81
81
  return {
82
- ...t,
83
- notPermitted: !m(t.permissions ?? [], "any"),
84
- children: (_ = t.children) == null ? void 0 : _.map((x) => ({
85
- ...x,
86
- notPermitted: !m(x.permissions ?? [], "any"),
87
- disabled: t.disabled || x.disabled
82
+ ...o,
83
+ notPermitted: !m(o.permissions ?? [], "any"),
84
+ children: (r = o.children) == null ? void 0 : r.map((p) => ({
85
+ ...p,
86
+ notPermitted: !m(p.permissions ?? [], "any"),
87
+ disabled: o.disabled || p.disabled
88
88
  }))
89
89
  };
90
- }), [c, m]), k = P(() => u.map((t) => {
91
- var _;
90
+ }), [_, m]), y = B(() => h.map((o) => {
91
+ var r;
92
92
  return {
93
- ...t,
94
- notPermitted: !m(t.permissions ?? [], "any"),
95
- children: (_ = t.children) == null ? void 0 : _.map((x) => ({
96
- ...x,
97
- notPermitted: !m(x.permissions ?? [], "any")
93
+ ...o,
94
+ notPermitted: !m(o.permissions ?? [], "any"),
95
+ children: (r = o.children) == null ? void 0 : r.map((p) => ({
96
+ ...p,
97
+ notPermitted: !m(p.permissions ?? [], "any")
98
98
  }))
99
99
  };
100
- }), [u, m]), N = (t) => {
101
- j(t === h ? -1 : t);
100
+ }), [h, m]), N = (o) => {
101
+ k(o === v ? -1 : o);
102
102
  };
103
- D(() => {
104
- a || j(-1);
105
- }, [a]);
106
- const M = R(null);
107
- T([M], () => b(!1));
108
- const { isMobile: o } = q();
109
- return /* @__PURE__ */ n.jsxs("section", { ref: M, className: i("luminus-side-menu shadow", p.sideMenu, { [p.mobile]: o }, {
110
- [p.expand]: a
111
- }, { expand: a }), onMouseEnter: () => d && b(!0), onMouseLeave: () => d && b(!1), children: [
112
- /* @__PURE__ */ n.jsx("div", { className: i("sidebar-header", p.sidebarHeader, {
113
- [p.onlyLogo]: d
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(A, {}),
116
- e
117
- ] }) : /* @__PURE__ */ n.jsx(O, {}) }),
118
- a && (l || r) ? /* @__PURE__ */ n.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
119
- r && a ? r : null,
120
- l && a ? l : null
103
+ E(() => {
104
+ d || k(-1);
105
+ }, [d]);
106
+ const g = S(null);
107
+ L([g], () => x(!1));
108
+ const i = B(() => [...j, ...y].filter((o) => {
109
+ var r;
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 }, {
113
+ [u.expand]: d
114
+ }, { expand: d }), onMouseEnter: () => c && x(!0), onMouseLeave: () => c && x(!1), children: [
115
+ /* @__PURE__ */ e.jsx("div", { className: l("sidebar-header", u.sidebarHeader, {
116
+ [u.onlyLogo]: c
117
+ }), role: c ? void 0 : "button", onClick: c ? void 0 : () => x(!d), children: c ? n : d ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
118
+ /* @__PURE__ */ e.jsx(O, {}),
119
+ n
120
+ ] }) : /* @__PURE__ */ e.jsx(D, {}) }),
121
+ d && (t || a) ? /* @__PURE__ */ e.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
122
+ a && d ? a : null,
123
+ t && d ? t : null
121
124
  ] }) : null,
122
- /* @__PURE__ */ n.jsxs("ul", { className: i(p.sideMenuContent, {
123
- [p.noTopMargin]: [...y, ...k].length > _n
125
+ /* @__PURE__ */ e.jsxs("ul", { className: l(u.sideMenuContent, {
126
+ [u.noTopMargin]: i.length > _e
124
127
  }), children: [
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
- /* @__PURE__ */ n.jsx("hr", { className: i("divider", p.divider) }),
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
+ 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)),
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))
128
131
  ] })
129
132
  ] });
130
- }, mn = "_top-bar_lnmq0_1", pn = "_top-bar-brand_lnmq0_12", I = {
133
+ }, me = "_top-bar_lnmq0_1", pe = "_top-bar-brand_lnmq0_12", T = {
131
134
  "top-bar": "_top-bar_lnmq0_1",
132
- topBar: mn,
135
+ topBar: me,
133
136
  "top-bar-brand": "_top-bar-brand_lnmq0_12",
134
- topBarBrand: pn
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
- width: l ? `calc(100% - ${l}px)` : void 0,
137
- left: l ? `${l}px` : void 0
138
- }, children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 row g-0", children: [
139
- /* @__PURE__ */ n.jsxs("div", { className: "col-4 d-flex gap-3 align-items-center", children: [
140
- /* @__PURE__ */ n.jsx(B, { to: "/", className: i("luminus-top-bar-brand", I.topBarBrand), children: e }),
141
- r
137
+ topBarBrand: pe
138
+ }, ge = ({ appName: n, leftOffset: t, leftContent: a, centerContent: _, rightContent: h }) => /* @__PURE__ */ e.jsx("nav", { className: l("luminus-top-bar shadow", T.topBar), style: {
139
+ width: t ? `calc(100% - ${t}px)` : void 0,
140
+ left: t ? `${t}px` : void 0
141
+ }, children: /* @__PURE__ */ e.jsxs("div", { className: "w-100 row g-0", children: [
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 }),
144
+ a
142
145
  ] }),
143
- /* @__PURE__ */ n.jsx("div", { className: "col-4 d-flex align-items-center", children: c ?? null }),
144
- /* @__PURE__ */ n.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: u ?? null })
146
+ /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex align-items-center", children: _ ?? null }),
147
+ /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: h ?? null })
145
148
  ] }) });
146
149
  export {
147
- Bn as PageContainer,
148
- Cn as SideContentBar,
149
- Nn as SideMenu,
150
- Mn as TopBar
150
+ Pe as PageContainer,
151
+ Be as SideContentBar,
152
+ Ne as SideMenu,
153
+ ge as TopBar
151
154
  };
@@ -1,10 +1,9 @@
1
- import { NameIdIntModel } from 'react-luminus-components/types';
2
- import { default as EmployeeSmallModel } from '../employee/EmployeeSmallModel';
1
+ import { default as NameIdIntModel } from '../../types/NameIdIntModel';
3
2
 
4
3
  export default interface ApprovalDelegationModel {
5
4
  id: number | null;
6
- employee: EmployeeSmallModel | null;
7
- delegate: EmployeeSmallModel | null;
5
+ employee: NameIdIntModel | null;
6
+ delegate: NameIdIntModel | null;
8
7
  dateFrom: string | null;
9
8
  dateTo: string | null;
10
9
  approval: NameIdIntModel | null;
@@ -1,10 +1,10 @@
1
- import { default as EmployeeSmallModel } from '../employee/EmployeeSmallModel';
1
+ import { default as NameIdIntModel } from '../../types/NameIdIntModel';
2
2
  import { default as ApprovalState } from './ApprovalState';
3
3
 
4
4
  export default interface ApprovalPersonModel {
5
5
  id: number;
6
- approver: EmployeeSmallModel;
7
- delegatedApprover: EmployeeSmallModel;
6
+ approver: NameIdIntModel;
7
+ delegatedApprover: NameIdIntModel;
8
8
  state: ApprovalState;
9
9
  responseDate: string | null;
10
10
  automaticApproval: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {