react-luminus-components 1.4.55 → 1.4.57

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.es.js CHANGED
@@ -1,80 +1,82 @@
1
- import { bt as I, j as e, c as i, Y as C, ao as R, ba as S, a2 as $, bz as A, bA as z } from "./ShortcutLinksContext-D-3_1QWF.js";
2
- import { b8 as fe, bB as Be } from "./ShortcutLinksContext-D-3_1QWF.js";
3
- import { useState as L, useRef as T, useMemo as k, useEffect as F } from "react";
4
- import { Link as q } from "react-router-dom";
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-BnnVfkMM.js";
2
+ import { b9 as Bn, bC as Cn } from "./ShortcutLinksContext-BnnVfkMM.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";
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 K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm_10", U = "_nav-button_o72rm_13", W = "_child_o72rm_21", Y = "_text_o72rm_26", E = "_icon_o72rm_36", G = "_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", H = "_children_o72rm_92", ee = "_mobile_o72rm_112", s = {
10
+ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm_10", E = "_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 = {
11
11
  "side-menu-item": "_side-menu-item_o72rm_1",
12
- sideMenuItem: K,
13
- disabled: O,
14
- hidden: D,
12
+ sideMenuItem: F,
13
+ disabled: K,
14
+ hidden: z,
15
15
  "nav-button": "_nav-button_o72rm_13",
16
- navButton: U,
17
- child: W,
18
- text: Y,
19
- icon: E,
16
+ navButton: E,
17
+ child: G,
18
+ text: H,
19
+ icon: U,
20
20
  "collapse-icon": "_collapse-icon_o72rm_42",
21
- collapseIcon: G,
22
- collapsed: J,
21
+ collapseIcon: W,
22
+ collapsed: Y,
23
23
  "collapse-icon-mini": "_collapse-icon-mini_o72rm_55",
24
- collapseIconMini: Q,
25
- expanded: V,
24
+ collapseIconMini: J,
25
+ expanded: Q,
26
26
  "children-container": "_children-container_o72rm_92",
27
- childrenContainer: X,
28
- visible: Z,
29
- children: H,
30
- mobile: ee
31
- }, ne = ({ item: n, menuExpanded: l, useTooltips: a, children: c }) => n.tooltip && !l && a ? /* @__PURE__ */ e.jsx(R, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: c }) }) : c, P = ({ item: n, menuExpanded: l, collapsed: a, onCollapse: c, currentPath: b, useHover: d, useTooltips: h, isMobile: y, disableMode: r }) => {
32
- var B, g, N, M;
33
- const [f, v] = L(!1), [p] = b.split("?"), j = n.linkTo === p || ((B = n.children) == null ? void 0 : B.some((o) => o.linkTo === p)), m = T(null);
34
- return I([m], () => a && c()), /* @__PURE__ */ e.jsxs("li", { ref: m, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: y }, {
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
35
  [s.expanded]: l
36
- }, { active: f || j }, { open: a && n.children }, {
37
- [r === "disable" ? s.disabled : s.hidden]: n.disabled || n.notPermitted || ((g = n.children) == null ? void 0 : g.every((o) => o.notPermitted || o.disabled))
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))
38
38
  }, {
39
- [r === "disable" ? "disabled" : "hidden"]: n.disabled || n.notPermitted || ((N = n.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
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
- /* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: l, useTooltips: h, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
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();
43
43
  }, children: [
44
- /* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
45
- !d && !l && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon-mini rounded", s.collapseIconMini, {
46
- [s.collapsed]: a
47
- }), children: /* @__PURE__ */ e.jsx(C, {}) }),
48
- l && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title }),
49
- l && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
50
- [s.collapsed]: a
51
- }), children: /* @__PURE__ */ e.jsx(C, {}) })
52
- ] }) }) : /* @__PURE__ */ e.jsxs(q, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: i("nav-link", s.navButton), children: [
53
- /* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
54
- l && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title })
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 })
55
55
  ] }) }),
56
- /* @__PURE__ */ e.jsx("div", { className: i("children-container", s.childrenContainer, {
57
- [s.visible]: a
58
- }), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (M = n.children) == null ? void 0 : M.map((o) => /* @__PURE__ */ e.jsx(q, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
59
- [r === "disable" ? s.disabled : s.hidden]: o.disabled || o.notPermitted
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
60
60
  }, {
61
- [r === "disable" ? "disabled" : "hidden"]: o.disabled || o.notPermitted
62
- }), onClick: c, children: /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: o.title }) }, o.linkTo)) }) })
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)) }) })
63
63
  ] });
64
- }, se = "_side-menu_1q9oh_1", oe = "_sidebar-header_1q9oh_15", ie = "_side-menu-content_1q9oh_22", le = "_expand_1q9oh_27", te = "_only-logo_1q9oh_31", ae = "_mobile_1q9oh_34", de = "_divider_1q9oh_49", u = {
65
- "side-menu": "_side-menu_1q9oh_1",
66
- sideMenu: se,
67
- "sidebar-header": "_sidebar-header_1q9oh_15",
68
- sidebarHeader: oe,
69
- "side-menu-content": "_side-menu-content_1q9oh_22",
70
- sideMenuContent: ie,
71
- expand: le,
72
- "only-logo": "_only-logo_1q9oh_31",
73
- onlyLogo: te,
74
- mobile: ae,
75
- divider: de
76
- }, je = ({ headerItem: n, searchItem: l, shortcutsItem: a, mainItems: c, secondaryItems: b, expanded: d, setExpanded: h, currentPath: y, useHover: r, useTooltips: f, disableMode: v = "disable" }) => {
77
- const [p, j] = L(-1), { checkUserHasPermissions: m } = S(), B = k(() => c.map((t) => {
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 = {
65
+ "side-menu": "_side-menu_12rky_1",
66
+ sideMenu: sn,
67
+ "sidebar-header": "_sidebar-header_12rky_15",
68
+ sidebarHeader: on,
69
+ "side-menu-content": "_side-menu-content_12rky_22",
70
+ sideMenuContent: ln,
71
+ "no-top-margin": "_no-top-margin_12rky_28",
72
+ noTopMargin: tn,
73
+ expand: rn,
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 } = A(), y = P(() => c.map((t) => {
78
80
  var _;
79
81
  return {
80
82
  ...t,
@@ -85,7 +87,7 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
85
87
  disabled: t.disabled || x.disabled
86
88
  }))
87
89
  };
88
- }), [c, m]), g = k(() => b.map((t) => {
90
+ }), [c, m]), k = P(() => u.map((t) => {
89
91
  var _;
90
92
  return {
91
93
  ...t,
@@ -95,53 +97,55 @@ const K = "_side-menu-item_o72rm_1", O = "_disabled_o72rm_6", D = "_hidden_o72rm
95
97
  notPermitted: !m(x.permissions ?? [], "any")
96
98
  }))
97
99
  };
98
- }), [b, m]), N = (t) => {
99
- j(t === p ? -1 : t);
100
+ }), [u, m]), N = (t) => {
101
+ j(t === h ? -1 : t);
100
102
  };
101
- F(() => {
102
- d || j(-1);
103
- }, [d]);
104
- const M = T(null);
105
- I([M], () => h(!1));
103
+ D(() => {
104
+ a || j(-1);
105
+ }, [a]);
106
+ const M = R(null);
107
+ T([M], () => b(!1));
106
108
  const { isMobile: o } = $();
107
- return /* @__PURE__ */ e.jsxs("section", { ref: M, className: i("luminus-side-menu shadow", u.sideMenu, { [u.mobile]: o }, {
108
- [u.expand]: d
109
- }, { expand: d }), onMouseEnter: () => r && h(!0), onMouseLeave: () => r && h(!1), children: [
110
- /* @__PURE__ */ e.jsx("div", { className: i("sidebar-header", u.sidebarHeader, {
111
- [u.onlyLogo]: r
112
- }), role: r ? void 0 : "button", onClick: r ? void 0 : () => h(!d), children: r ? n : d ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
113
- /* @__PURE__ */ e.jsx(A, {}),
114
- n
115
- ] }) : /* @__PURE__ */ e.jsx(z, {}) }),
116
- d && (l || a) ? /* @__PURE__ */ e.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
117
- a && d ? a : null,
118
- l && d ? l : null
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(q, {}),
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
119
121
  ] }) : null,
120
- /* @__PURE__ */ e.jsxs("ul", { className: u.sideMenuContent, children: [
121
- B.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === p, onCollapse: () => N(_), currentPath: y, useHover: r, useTooltips: f, isMobile: o, disableMode: v }, t.title)),
122
- /* @__PURE__ */ e.jsx("hr", { className: i("divider", u.divider) }),
123
- g.map((t, _) => /* @__PURE__ */ e.jsx(P, { item: t, menuExpanded: d, collapsed: _ === p, onCollapse: () => N(_), currentPath: y, useHover: r, useTooltips: f, isMobile: o, disableMode: v }, t.title))
122
+ /* @__PURE__ */ n.jsxs("ul", { className: i(p.sideMenuContent, {
123
+ [p.noTopMargin]: [...y, ...k].length > _n
124
+ }), 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))
124
128
  ] })
125
129
  ] });
126
- }, re = "_top-bar_lnmq0_1", ce = "_top-bar-brand_lnmq0_12", w = {
130
+ }, mn = "_top-bar_lnmq0_1", pn = "_top-bar-brand_lnmq0_12", I = {
127
131
  "top-bar": "_top-bar_lnmq0_1",
128
- topBar: re,
132
+ topBar: mn,
129
133
  "top-bar-brand": "_top-bar-brand_lnmq0_12",
130
- topBarBrand: ce
131
- }, Ne = ({ appName: n, leftOffset: l, leftContent: a, centerContent: c, rightContent: b }) => /* @__PURE__ */ e.jsx("nav", { className: i("luminus-top-bar shadow", w.topBar), style: {
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: {
132
136
  width: l ? `calc(100% - ${l}px)` : void 0,
133
137
  left: l ? `${l}px` : void 0
134
- }, children: /* @__PURE__ */ e.jsxs("div", { className: "w-100 row g-0", children: [
135
- /* @__PURE__ */ e.jsxs("div", { className: "col-4 d-flex gap-3 align-items-center", children: [
136
- /* @__PURE__ */ e.jsx(q, { to: "/", className: i("luminus-top-bar-brand", w.topBarBrand), children: n }),
137
- a
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
138
142
  ] }),
139
- /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex align-items-center", children: c ?? null }),
140
- /* @__PURE__ */ e.jsx("div", { className: "col-4 d-flex justify-content-end align-items-center", children: b ?? null })
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 })
141
145
  ] }) });
142
146
  export {
143
- fe as PageContainer,
144
- Be as SideContentBar,
145
- je as SideMenu,
146
- Ne as TopBar
147
+ Bn as PageContainer,
148
+ Cn as SideContentBar,
149
+ Nn as SideMenu,
150
+ Mn as TopBar
147
151
  };