react-luminus-components 1.2.30 → 1.2.31
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/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +29 -29
- package/package.json +1 -1
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-DEb7Klk7.cjs"),d=require("react"),w=require("./usePermissions-zYTcBjf7.cjs"),C=require("./SimpleTooltip-CjMfPKvQ.cjs"),M=require("./Typography-Plu1Wa0_.cjs"),B="_side-menu-item_6vbwa_1",k="_disabled_6vbwa_5",g="_nav-button_6vbwa_9",S="_child_6vbwa_17",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-DEb7Klk7.cjs"),d=require("react"),w=require("./usePermissions-zYTcBjf7.cjs"),C=require("./SimpleTooltip-CjMfPKvQ.cjs"),M=require("./Typography-Plu1Wa0_.cjs"),B="_side-menu-item_6vbwa_1",k="_disabled_6vbwa_5",g="_nav-button_6vbwa_9",S="_child_6vbwa_17",y="_text_6vbwa_21",P="_icon_6vbwa_28",T="_collapse-icon_6vbwa_34",f="_collapsed_6vbwa_44",I="_expanded_6vbwa_51",$="_children-container_6vbwa_57",H="_visible_6vbwa_65",L="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:B,disabled:k,"nav-button":"_nav-button_6vbwa_9",navButton:g,child:S,text:y,icon:P,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:T,collapsed:f,expanded:I,"children-container":"_children-container_6vbwa_57",childrenContainer:$,visible:H,children:L},q=({item:e,menuExpanded:t,children:i})=>e.tooltip&&!t?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:e.tooltip,placement:"right",children:i}):i,N=({item:e,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l})=>{var v,_;const{LinkComponent:m}=d.useContext(s.LuminusComponentsContext),[p,x]=d.useState(!1),[c]=l.split("?"),h=e.linkTo===c||((v=e.children)==null?void 0:v.some(n=>n.linkTo===c));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:t},{active:p||h},{open:i&&e.children},{[o.disabled]:e.disabled||e.notPermitted},{disabled:e.disabled||e.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[s.jsxRuntimeExports.jsx(q,{item:e,menuExpanded:t,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",o.navButton),onClick:()=>a(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(m,{to:e.disabled||e.notPermitted?"/":e.linkTo??"/",className:s.classNames("nav-link",o.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",o.children),children:(_=e.children)==null?void 0:_.map(n=>s.jsxRuntimeExports.jsx(m,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:s.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},F="_side-menu_n1hvm_1",A="_sidebar-header_n1hvm_13",U="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",z="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:F,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:A,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:U,expand:K,divider:z},D=({headerItem:e,mainItems:t,secondaryItems:i,expanded:a,setExpanded:l,currentPath:m})=>{const[p,x]=d.useState(-1),{checkUserHasPermissions:c}=w.usePermissions(),h=d.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!c(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(u=>({...u,notPermitted:!c(u.permissions??[]),disabled:n.disabled||u.disabled}))}}),[t,c]),v=d.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!c(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(u=>({...u,notPermitted:!c(u.permissions??[])}))}}),[i,c]),_=n=>{x(n===p?-1:n)};return d.useEffect(()=>{a||x(-1)},[a]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:a},{expand:a}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",j.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[h.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:m},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:m},n.title))]})]})},G="_top-bar_1lk80_1",J="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:G,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:J},O=({appName:e,leftOffset:t,centerContent:i,rightContent:a})=>{const{LinkComponent:l}=d.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar shadow",R.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[s.jsxRuntimeExports.jsx(l,{to:"/",className:s.classNames("luminus-top-bar-brand",R.topBarBrand),children:e}),i&&s.jsxRuntimeExports.jsx("div",{children:i}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:a??null})]})},Q="_side-content-bar_17kwd_1",V={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:Q},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar shadow",V.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(M.Typography,{variant:"h3",children:e}):e}),W=({title:e,children:t,sideContent:i,noPadding:a,className:l})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",a?"p-0":"p-3",l),children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?"250px":void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:250,children:i})]}),X="_full-screen-container_1rm4r_1",Y={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:X},Z=({title:e,children:t,sideContent:i,noPadding:a,className:l})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",a?"p-0":"p-3",l,Y.fullScreenContainer),style:{width:i?"calc(100% - 250px)":"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:250,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=W;exports.SideContentBar=b;exports.SideMenu=D;exports.TopBar=O;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { L as C, j as e, c as
|
|
1
|
+
import { L as C, j as e, c as o, M as I } from "./UserAvatarToggle-BWDRIIXE.js";
|
|
2
2
|
import { useContext as M, useState as B, useMemo as j, useEffect as P } from "react";
|
|
3
3
|
import { u as g } from "./usePermissions-Cg_BMKPX.js";
|
|
4
4
|
import { S as y } from "./SimpleTooltip-cMiObSvf.js";
|
|
5
5
|
import { T } from "./Typography-B12JkmMC.js";
|
|
6
|
-
const S = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6vbwa_9", L = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", R = "_collapse-icon_6vbwa_34", A = "_collapsed_6vbwa_44", K = "_expanded_6vbwa_51", U = "_children-container_6vbwa_57", q = "_visible_6vbwa_65", z = "_children_6vbwa_57",
|
|
6
|
+
const S = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6vbwa_9", L = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", R = "_collapse-icon_6vbwa_34", A = "_collapsed_6vbwa_44", K = "_expanded_6vbwa_51", U = "_children-container_6vbwa_57", q = "_visible_6vbwa_65", z = "_children_6vbwa_57", i = {
|
|
7
7
|
"side-menu-item": "_side-menu-item_6vbwa_1",
|
|
8
8
|
sideMenuItem: S,
|
|
9
9
|
disabled: $,
|
|
@@ -23,22 +23,22 @@ const S = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
23
23
|
}, D = ({ item: n, menuExpanded: t, children: a }) => n.tooltip && !t ? /* @__PURE__ */ e.jsx(y, { text: n.tooltip, placement: "right", children: a }) : a, w = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: r, currentPath: l }) => {
|
|
24
24
|
var b, h;
|
|
25
25
|
const { LinkComponent: m } = M(C), [p, _] = B(!1), [c] = l.split("?"), x = n.linkTo === c || ((b = n.children) == null ? void 0 : b.some((s) => s.linkTo === c));
|
|
26
|
-
return /* @__PURE__ */ e.jsxs("li", { className:
|
|
27
|
-
[
|
|
28
|
-
}, { active: p || x }, { open: a && n.children }, { [
|
|
29
|
-
/* @__PURE__ */ e.jsx(D, { item: n, menuExpanded: t, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className:
|
|
30
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
31
|
-
t && /* @__PURE__ */ e.jsx("div", { className:
|
|
32
|
-
t && /* @__PURE__ */ e.jsx("div", { className:
|
|
33
|
-
[
|
|
26
|
+
return /* @__PURE__ */ e.jsxs("li", { className: o("luminus-side-menu-item", i.sideMenuItem, {
|
|
27
|
+
[i.expanded]: t
|
|
28
|
+
}, { active: p || x }, { open: a && n.children }, { [i.disabled]: n.disabled || n.notPermitted }, { disabled: n.disabled || n.notPermitted }), onMouseEnter: () => _(!0), onMouseLeave: () => _(!1), children: [
|
|
29
|
+
/* @__PURE__ */ e.jsx(D, { item: n, menuExpanded: t, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", i.navButton), onClick: () => r(), children: [
|
|
30
|
+
/* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
|
|
31
|
+
t && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title }),
|
|
32
|
+
t && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", i.collapseIcon, {
|
|
33
|
+
[i.collapsed]: a
|
|
34
34
|
}), children: /* @__PURE__ */ e.jsx(I, {}) })
|
|
35
|
-
] }) }) : /* @__PURE__ */ e.jsxs(m, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className:
|
|
36
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
37
|
-
t && /* @__PURE__ */ e.jsx("div", { className:
|
|
35
|
+
] }) }) : /* @__PURE__ */ e.jsxs(m, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: o("nav-link", i.navButton), children: [
|
|
36
|
+
/* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
|
|
37
|
+
t && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title })
|
|
38
38
|
] }) }),
|
|
39
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
40
|
-
[
|
|
41
|
-
}), children: /* @__PURE__ */ e.jsx("div", { className:
|
|
39
|
+
/* @__PURE__ */ e.jsx("div", { className: o("children-container", i.childrenContainer, {
|
|
40
|
+
[i.visible]: a
|
|
41
|
+
}), children: /* @__PURE__ */ e.jsx("div", { className: o("shadow rounded children", i.children), children: (h = n.children) == null ? void 0 : h.map((s) => /* @__PURE__ */ e.jsx(m, { to: s.disabled || s.notPermitted ? "/" : s.linkTo ?? "/", className: o("nav-link child rounded", i.navButton, i.child, { [i.disabled]: s.disabled || s.notPermitted }, { disabled: s.disabled || s.notPermitted }), children: /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: s.title }) }, s.linkTo)) }) })
|
|
42
42
|
] });
|
|
43
43
|
}, G = "_side-menu_n1hvm_1", J = "_sidebar-header_n1hvm_13", Q = "_side-menu-content_n1hvm_18", V = "_expand_n1hvm_22", W = "_divider_n1hvm_26", v = {
|
|
44
44
|
"side-menu": "_side-menu_n1hvm_1",
|
|
@@ -76,13 +76,13 @@ const S = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
76
76
|
};
|
|
77
77
|
return P(() => {
|
|
78
78
|
r || _(-1);
|
|
79
|
-
}, [r]), /* @__PURE__ */ e.jsxs("section", { className:
|
|
79
|
+
}, [r]), /* @__PURE__ */ e.jsxs("section", { className: o("luminus-side-menu shadow", v.sideMenu, {
|
|
80
80
|
[v.expand]: r
|
|
81
81
|
}, { expand: r }), onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
|
|
82
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
82
|
+
/* @__PURE__ */ e.jsx("div", { className: o("sidebar-header", v.sidebarHeader), children: n }),
|
|
83
83
|
/* @__PURE__ */ e.jsxs("ul", { className: v.sideMenuContent, children: [
|
|
84
84
|
x.map((s, d) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: r, collapsed: d === p, onCollapse: () => h(d), currentPath: m }, s.title)),
|
|
85
|
-
/* @__PURE__ */ e.jsx("hr", { className:
|
|
85
|
+
/* @__PURE__ */ e.jsx("hr", { className: o("divider", v.divider) }),
|
|
86
86
|
b.map((s, d) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: r, collapsed: d === p, onCollapse: () => h(d), currentPath: m }, s.title))
|
|
87
87
|
] })
|
|
88
88
|
] });
|
|
@@ -93,39 +93,39 @@ const S = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
93
93
|
topBarBrand: Y
|
|
94
94
|
}, de = ({ appName: n, leftOffset: t, centerContent: a, rightContent: r }) => {
|
|
95
95
|
const { LinkComponent: l } = M(C);
|
|
96
|
-
return /* @__PURE__ */ e.jsxs("nav", { className:
|
|
96
|
+
return /* @__PURE__ */ e.jsxs("nav", { className: o("luminus-top-bar shadow", N.topBar), style: {
|
|
97
97
|
width: t ? `calc(100% - ${t}px)` : void 0,
|
|
98
98
|
left: t ? `${t}px` : void 0
|
|
99
99
|
}, children: [
|
|
100
|
-
/* @__PURE__ */ e.jsx(l, { to: "/", className:
|
|
100
|
+
/* @__PURE__ */ e.jsx(l, { to: "/", className: o("luminus-top-bar-brand", N.topBarBrand), children: n }),
|
|
101
101
|
a && /* @__PURE__ */ e.jsx("div", { children: a }),
|
|
102
102
|
/* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: r ?? null })
|
|
103
103
|
] });
|
|
104
104
|
}, Z = "_side-content-bar_17kwd_1", O = {
|
|
105
105
|
"side-content-bar": "_side-content-bar_17kwd_1",
|
|
106
106
|
sideContentBar: Z
|
|
107
|
-
},
|
|
107
|
+
}, k = ({ width: n, children: t }) => /* @__PURE__ */ e.jsx("section", { className: o("luminus-side-content-bar shadow", O.sideContentBar), style: {
|
|
108
108
|
width: `${n}px`
|
|
109
|
-
}, children: t }),
|
|
109
|
+
}, children: t }), f = ({ title: n }) => /* @__PURE__ */ e.jsx("div", { className: "mb-3", children: typeof n == "string" ? /* @__PURE__ */ e.jsx(T, { variant: "h3", children: n }) : n }), le = ({ title: n, children: t, sideContent: a, noPadding: r, className: l }) => /* @__PURE__ */ e.jsxs("div", { className: o("container-fluid", r ? "p-0" : "p-3", l), children: [
|
|
110
110
|
/* @__PURE__ */ e.jsxs("div", { style: { paddingRight: a ? "250px" : void 0 }, children: [
|
|
111
|
-
n ? /* @__PURE__ */ e.jsx(
|
|
111
|
+
n ? /* @__PURE__ */ e.jsx(f, { title: n }) : null,
|
|
112
112
|
t
|
|
113
113
|
] }),
|
|
114
|
-
a && /* @__PURE__ */ e.jsx(
|
|
114
|
+
a && /* @__PURE__ */ e.jsx(k, { width: 250, children: a })
|
|
115
115
|
] }), ee = "_full-screen-container_1rm4r_1", ne = {
|
|
116
116
|
"full-screen-container": "_full-screen-container_1rm4r_1",
|
|
117
117
|
fullScreenContainer: ee
|
|
118
118
|
}, ce = ({ title: n, children: t, sideContent: a, noPadding: r, className: l }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
119
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
120
|
-
n ? /* @__PURE__ */ e.jsx(
|
|
119
|
+
/* @__PURE__ */ e.jsxs("div", { className: o("overflow-hidden luminus-full-screen-container", r ? "p-0" : "p-3", l, ne.fullScreenContainer), style: { width: a ? "calc(100% - 250px)" : "100%" }, children: [
|
|
120
|
+
n ? /* @__PURE__ */ e.jsx(f, { title: n }) : null,
|
|
121
121
|
t
|
|
122
122
|
] }),
|
|
123
|
-
a && /* @__PURE__ */ e.jsx(
|
|
123
|
+
a && /* @__PURE__ */ e.jsx(k, { width: 250, children: a })
|
|
124
124
|
] });
|
|
125
125
|
export {
|
|
126
126
|
ce as FullScreenContainer,
|
|
127
127
|
le as MainContainer,
|
|
128
|
-
|
|
128
|
+
k as SideContentBar,
|
|
129
129
|
re as SideMenu,
|
|
130
130
|
de as TopBar
|
|
131
131
|
};
|