@ck-ui/component-library 2.0.1 → 2.0.3
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/assets/Sidebar-D5jVJ-ln.css +1 -0
- package/dist/assets/index-B5N2Zvs1.css +1 -0
- package/dist/assets/index-B8lwBNV9.css +1 -0
- package/dist/assets/index-BD0iilmm.css +1 -0
- package/dist/assets/index-BioJVhpT.css +1 -0
- package/dist/assets/index-C6j9Ze5V.css +1 -0
- package/dist/assets/index-CSofT_ix.css +1 -0
- package/dist/assets/index-C_Tn9jS-.css +1 -0
- package/dist/assets/index-eZS6kms7.css +1 -0
- package/dist/assets/index-tIl-UucG.css +1 -0
- package/dist/assets/styles-DGlqPkdv.css +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +271 -196
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts +5 -3
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts.map +1 -1
- package/dist/components/PopupAndDialogBox/_types/popupAndDialog.types.d.ts +3 -0
- package/dist/components/PopupAndDialogBox/_types/popupAndDialog.types.d.ts.map +1 -1
- package/dist/components/PopupAndDialogBox/components/DialogFooter.d.ts.map +1 -1
- package/dist/components/PopupAndDialogBox/components/DialogFooter.js +36 -29
- package/dist/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.js +118 -40
- package/dist/components/Sidebar/Sidebar.types.d.ts +5 -51
- package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.utils.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.utils.d.ts.map +1 -1
- package/dist/components/Sidebar/components/CollapsedTooltip/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/CollapsedTooltip/index.js +5 -33
- package/dist/components/Sidebar/components/ContactUsButton/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/ContactUsButton/index.js +11 -7
- package/dist/components/Sidebar/components/ExploreSection/index.d.ts +1 -1
- package/dist/components/Sidebar/components/ExploreSection/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/ExploreSection/index.js +22 -16
- package/dist/components/Sidebar/components/GptCard/index.d.ts +1 -1
- package/dist/components/Sidebar/components/GptCard/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/GptCard/index.js +27 -15
- package/dist/components/Sidebar/components/IconRenderer/index.js +10 -8
- package/dist/components/Sidebar/components/MenuItemWrapper/index.d.ts +1 -1
- package/dist/components/Sidebar/components/MenuItemWrapper/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/MenuItemWrapper/index.js +19 -24
- package/dist/components/Sidebar/components/MenuRenderer/CollapsedMenu.d.ts +11 -0
- package/dist/components/Sidebar/components/MenuRenderer/CollapsedMenu.d.ts.map +1 -0
- package/dist/components/Sidebar/components/MenuRenderer/CollapsedMenu.js +84 -0
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.d.ts +18 -0
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.d.ts.map +1 -0
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.js +59 -0
- package/dist/components/Sidebar/components/MenuRenderer/index.d.ts +5 -2
- package/dist/components/Sidebar/components/MenuRenderer/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/MenuRenderer/index.js +25 -73
- package/dist/components/Sidebar/components/ModuleSwitchButton/index.d.ts +1 -1
- package/dist/components/Sidebar/components/ModuleSwitchButton/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/ModuleSwitchButton/index.js +17 -12
- package/dist/components/Sidebar/components/SectionLabel/index.d.ts +4 -2
- package/dist/components/Sidebar/components/SectionLabel/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/SectionLabel/index.js +6 -4
- package/dist/components/Sidebar/components/SubMenuWrapper/index.d.ts +3 -2
- package/dist/components/Sidebar/components/SubMenuWrapper/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/SubMenuWrapper/index.js +34 -18
- package/dist/components/Sidebar/components/index.d.ts +11 -0
- package/dist/components/Sidebar/components/index.d.ts.map +1 -0
- package/dist/components/Sidebar/components/index.js +22 -0
- package/dist/components/Sidebar/hooks/index.d.ts +4 -0
- package/dist/components/Sidebar/hooks/index.d.ts.map +1 -0
- package/dist/components/Sidebar/hooks/index.js +8 -0
- package/dist/components/Sidebar/hooks/useActiveDetection.d.ts +1 -1
- package/dist/components/Sidebar/hooks/useActiveDetection.d.ts.map +1 -1
- package/dist/components/Sidebar/hooks/useMenuState.d.ts +9 -3
- package/dist/components/Sidebar/hooks/useMenuState.d.ts.map +1 -1
- package/dist/components/Sidebar/hooks/useMenuState.js +56 -38
- package/dist/components/Sidebar/hooks/useModuleSwitch.d.ts +4 -2
- package/dist/components/Sidebar/hooks/useModuleSwitch.d.ts.map +1 -1
- package/dist/components/Sidebar/index.d.ts +16 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +40 -3
- package/dist/components/Sidebar/types/explore.types.d.ts +8 -0
- package/dist/components/Sidebar/types/explore.types.d.ts.map +1 -0
- package/dist/components/Sidebar/types/explore.types.js +1 -0
- package/dist/components/Sidebar/types/gpt.types.d.ts +9 -0
- package/dist/components/Sidebar/types/gpt.types.d.ts.map +1 -0
- package/dist/components/Sidebar/types/gpt.types.js +1 -0
- package/dist/components/Sidebar/types/index.d.ts +6 -0
- package/dist/components/Sidebar/types/index.d.ts.map +1 -0
- package/dist/components/Sidebar/types/index.js +1 -0
- package/dist/components/Sidebar/types/menu.types.d.ts +12 -0
- package/dist/components/Sidebar/types/menu.types.d.ts.map +1 -0
- package/dist/components/Sidebar/types/menu.types.js +1 -0
- package/dist/components/Sidebar/types/module.types.d.ts +8 -0
- package/dist/components/Sidebar/types/module.types.d.ts.map +1 -0
- package/dist/components/Sidebar/types/module.types.js +1 -0
- package/dist/components/Sidebar/types/sidebar.types.d.ts +51 -0
- package/dist/components/Sidebar/types/sidebar.types.d.ts.map +1 -0
- package/dist/components/Sidebar/types/sidebar.types.js +1 -0
- package/dist/index-CSxlVCTW.js +52 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +60 -49
- package/dist/styles.module-xqgv3wwP.js +12 -0
- package/package.json +1 -1
- package/dist/assets/styles-Dz05pjuA.css +0 -1
- package/dist/styles.module-BIdwTiuE.js +0 -66
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import '../../../../assets/index-BioJVhpT.css';const t = {
|
|
4
|
+
"icon-img": "_icon-img_1rj7w_1",
|
|
5
|
+
"icon-node": "_icon-node_1rj7w_7"
|
|
6
|
+
}, o = /* @__PURE__ */ s("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
5
7
|
/* @__PURE__ */ r("rect", { x: "1", y: "1", width: "6", height: "6", rx: "1.5", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
6
8
|
/* @__PURE__ */ r("rect", { x: "9", y: "1", width: "6", height: "6", rx: "1.5", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
7
9
|
/* @__PURE__ */ r("rect", { x: "1", y: "9", width: "6", height: "6", rx: "1.5", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
8
10
|
/* @__PURE__ */ r("rect", { x: "9", y: "9", width: "6", height: "6", rx: "1.5", stroke: "currentColor", strokeWidth: "1.4" })
|
|
9
11
|
] });
|
|
10
|
-
function
|
|
11
|
-
const [
|
|
12
|
-
return e ? typeof e == "string" ?
|
|
12
|
+
function a({ icon: e }) {
|
|
13
|
+
const [i, n] = c(!1);
|
|
14
|
+
return e ? typeof e == "string" ? i ? /* @__PURE__ */ r("span", { className: t["icon-node"], children: o }) : /* @__PURE__ */ r("img", { src: e, alt: "", className: t["icon-img"], "aria-hidden": "true", onError: () => n(!0) }) : /* @__PURE__ */ r("span", { className: t["icon-node"], children: e }) : /* @__PURE__ */ r("span", { className: t["icon-node"], children: o });
|
|
13
15
|
}
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
a as IconRenderer
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuItemWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuItemWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAW,EAAE,KAAS,EAAE,UAAU,EAAE,eAAe,GAC7E,EAAE,oBAAoB,2CAkCtB"}
|
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { IconRenderer as f } from "../IconRenderer/index.js";
|
|
3
|
-
import { addBreakOpportunities as
|
|
4
|
-
import { s as e } from "../../../../styles.module-
|
|
3
|
+
import { addBreakOpportunities as h } from "../../Sidebar.utils.js";
|
|
4
|
+
import { s as e } from "../../../../styles.module-xqgv3wwP.js";
|
|
5
5
|
function $({
|
|
6
6
|
item: n,
|
|
7
|
-
active:
|
|
8
|
-
collapsed:
|
|
9
|
-
icon:
|
|
10
|
-
level:
|
|
7
|
+
active: o,
|
|
8
|
+
collapsed: c,
|
|
9
|
+
icon: d = !0,
|
|
10
|
+
level: s = 0,
|
|
11
11
|
onNavigate: m,
|
|
12
|
-
onMenuItemClick:
|
|
12
|
+
onMenuItemClick: p
|
|
13
13
|
}) {
|
|
14
|
-
const
|
|
15
|
-
n.url && m(n.url),
|
|
16
|
-
},
|
|
14
|
+
const t = () => {
|
|
15
|
+
n.url && m(n.url), p?.(n);
|
|
16
|
+
}, i = s > 0, l = i && o;
|
|
17
17
|
return /* @__PURE__ */ u(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
|
-
className: `${e["sidebar-menu-item"]} ${e["leaf-item"]} ${
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
className: `${e["sidebar-menu-item"]} ${e["leaf-item"]} ${o ? e.active : ""} ${i ? e.nested : ""}`,
|
|
21
|
+
style: s > 1 ? { paddingLeft: `${12 + (s - 1) * 14}px` } : void 0,
|
|
22
|
+
onClick: t,
|
|
23
|
+
onKeyDown: (a) => {
|
|
24
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), t());
|
|
24
25
|
},
|
|
25
26
|
role: "menuitem",
|
|
26
27
|
tabIndex: 0,
|
|
27
|
-
"aria-current":
|
|
28
|
+
"aria-current": o ? "page" : void 0,
|
|
28
29
|
children: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className: e["active-indicator"],
|
|
33
|
-
style: { left: `-${l}px` }
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
c && /* @__PURE__ */ r("span", { className: e["menu-icon"], children: /* @__PURE__ */ r(f, { icon: n.icon }) }),
|
|
37
|
-
!i && /* @__PURE__ */ r("span", { className: e["menu-content"], children: N(n.name) })
|
|
30
|
+
l && /* @__PURE__ */ r("span", { className: e["active-indicator"] }),
|
|
31
|
+
d && /* @__PURE__ */ r("span", { className: e["menu-icon"], children: /* @__PURE__ */ r(f, { icon: n.icon }) }),
|
|
32
|
+
!c && /* @__PURE__ */ r("span", { className: e["menu-content"], children: h(n.name) })
|
|
38
33
|
]
|
|
39
34
|
}
|
|
40
35
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SidebarMenuItem as MenuItem } from '../../types';
|
|
2
|
+
interface CollapsedMenuProps {
|
|
3
|
+
menuItems: MenuItem[];
|
|
4
|
+
isActive: (item: MenuItem) => boolean;
|
|
5
|
+
isTreeActive: (item: MenuItem) => boolean;
|
|
6
|
+
onNavigate: (path: string) => void;
|
|
7
|
+
onMenuItemClick?: (item: MenuItem) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function CollapsedMenu({ menuItems, isActive, isTreeActive, onNavigate, onMenuItemClick }: CollapsedMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=CollapsedMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapsedMenu.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuRenderer/CollapsedMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAO/D,UAAU,kBAAkB;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IAC1C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE,kBAAkB,2CA6FnH"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as r, jsxs as c, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as h } from "react";
|
|
3
|
+
import { C as m, p as n } from "../../../../index-CSxlVCTW.js";
|
|
4
|
+
import { IconRenderer as t } from "../IconRenderer/index.js";
|
|
5
|
+
import { addBreakOpportunities as u } from "../../Sidebar.utils.js";
|
|
6
|
+
import { s as v } from "../../../../styles.module-xqgv3wwP.js";
|
|
7
|
+
function $({ menuItems: f, isActive: l, isTreeActive: d, onNavigate: a, onMenuItemClick: s }) {
|
|
8
|
+
const b = h((e, i) => {
|
|
9
|
+
const o = e.dashboardServices && e.dashboardServices.length > 0, p = d(e);
|
|
10
|
+
return o ? /* @__PURE__ */ r(
|
|
11
|
+
m,
|
|
12
|
+
{
|
|
13
|
+
active: p,
|
|
14
|
+
icon: /* @__PURE__ */ r("span", { className: v["menu-icon"], children: /* @__PURE__ */ r(t, { icon: e.icon }) }),
|
|
15
|
+
popupClassName: i <= 1 ? n["single-child-popover"] : "",
|
|
16
|
+
children: /* @__PURE__ */ c("div", { className: n["popover-menu"], children: [
|
|
17
|
+
/* @__PURE__ */ r("div", { className: n["popover-title"], children: e.name }),
|
|
18
|
+
/* @__PURE__ */ r("div", { className: n["popover-children"], children: e.dashboardServices.map((C) => w(C)) })
|
|
19
|
+
] })
|
|
20
|
+
},
|
|
21
|
+
e.name
|
|
22
|
+
) : /* @__PURE__ */ r(
|
|
23
|
+
m,
|
|
24
|
+
{
|
|
25
|
+
active: l(e),
|
|
26
|
+
icon: /* @__PURE__ */ r("span", { className: v["menu-icon"], children: /* @__PURE__ */ r(t, { icon: e.icon }) }),
|
|
27
|
+
onClick: () => {
|
|
28
|
+
e.url && a(e.url), s?.(e);
|
|
29
|
+
},
|
|
30
|
+
children: /* @__PURE__ */ r("div", { className: n["popover-title-single"], children: e.name })
|
|
31
|
+
},
|
|
32
|
+
e.name
|
|
33
|
+
);
|
|
34
|
+
}, [l, d, a, s]), w = h((e) => e.dashboardServices && e.dashboardServices.length > 0 ? /* @__PURE__ */ c("div", { className: n["popover-child-with-sub"], children: [
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
m,
|
|
37
|
+
{
|
|
38
|
+
active: d(e),
|
|
39
|
+
icon: null,
|
|
40
|
+
label: e.name,
|
|
41
|
+
popupClassName: n["nested-popover"],
|
|
42
|
+
children: /* @__PURE__ */ c("div", { className: n["popover-menu"], children: [
|
|
43
|
+
/* @__PURE__ */ r("div", { className: n["popover-title"], children: e.name }),
|
|
44
|
+
/* @__PURE__ */ r("div", { className: n["popover-children"], children: e.dashboardServices.map((o) => /* @__PURE__ */ r(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: `${n["popover-child-item"]} ${l(o) ? n.active : ""}`,
|
|
48
|
+
onClick: () => {
|
|
49
|
+
o.url && a(o.url), s?.(o);
|
|
50
|
+
},
|
|
51
|
+
onKeyDown: (p) => {
|
|
52
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), o.url && a(o.url), s?.(o));
|
|
53
|
+
},
|
|
54
|
+
role: "menuitem",
|
|
55
|
+
tabIndex: 0,
|
|
56
|
+
children: u(o.name)
|
|
57
|
+
},
|
|
58
|
+
o.name
|
|
59
|
+
)) })
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ r("span", { className: n["popover-child-arrow"], children: /* @__PURE__ */ r("svg", { width: "6", height: "10", viewBox: "0 0 6 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M1 1L5 5L1 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
64
|
+
] }, e.name) : /* @__PURE__ */ r(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: `${n["popover-child-item"]} ${l(e) ? n.active : ""}`,
|
|
68
|
+
onClick: () => {
|
|
69
|
+
e.url && a(e.url), s?.(e);
|
|
70
|
+
},
|
|
71
|
+
onKeyDown: (o) => {
|
|
72
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), e.url && a(e.url), s?.(e));
|
|
73
|
+
},
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
tabIndex: 0,
|
|
76
|
+
children: u(e.name)
|
|
77
|
+
},
|
|
78
|
+
e.name
|
|
79
|
+
), [l, d, a, s]);
|
|
80
|
+
return /* @__PURE__ */ r(N, { children: f.map((e, i) => b(e, i)) });
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
$ as CollapsedMenu
|
|
84
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SidebarMenuItem as MenuItem } from '../../types';
|
|
2
|
+
interface ExpandedMenuProps {
|
|
3
|
+
menuItems: MenuItem[];
|
|
4
|
+
currentPath: string;
|
|
5
|
+
isActive: (item: MenuItem) => boolean;
|
|
6
|
+
isTreeActive: (item: MenuItem) => boolean;
|
|
7
|
+
onNavigate: (path: string) => void;
|
|
8
|
+
onMenuItemClick?: (item: MenuItem) => void;
|
|
9
|
+
/** Whether to show icons on child (nested) menu items. Defaults to true. */
|
|
10
|
+
showChildIcons?: boolean;
|
|
11
|
+
/** Max parent-level items that can be expanded simultaneously. Undefined = unlimited. */
|
|
12
|
+
maxOpenParents?: number;
|
|
13
|
+
/** Max child-level items (within a parent) that can be expanded simultaneously. Undefined = unlimited. */
|
|
14
|
+
maxOpenChildren?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function ExpandedMenu({ menuItems, currentPath, isActive, isTreeActive, onNavigate, onMenuItemClick, showChildIcons, maxOpenParents, maxOpenChildren, }: ExpandedMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=ExpandedMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpandedMenu.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuRenderer/ExpandedMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK/D,UAAU,iBAAiB;IACzB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IAC1C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0GAA0G;IAC1G,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,cAAqB,EACrB,cAAc,EACd,eAAe,GAChB,EAAE,iBAAiB,2CA4DnB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as E, useCallback as T } from "react";
|
|
3
|
+
import { MenuItemWrapper as $ } from "../MenuItemWrapper/index.js";
|
|
4
|
+
import { SubMenuWrapper as j } from "../SubMenuWrapper/index.js";
|
|
5
|
+
import { useMenuState as k } from "../../hooks/useMenuState.js";
|
|
6
|
+
function O({
|
|
7
|
+
menuItems: n,
|
|
8
|
+
currentPath: g,
|
|
9
|
+
isActive: a,
|
|
10
|
+
isTreeActive: s,
|
|
11
|
+
onNavigate: c,
|
|
12
|
+
onMenuItemClick: d,
|
|
13
|
+
showChildIcons: p = !0,
|
|
14
|
+
maxOpenParents: b,
|
|
15
|
+
maxOpenChildren: i
|
|
16
|
+
}) {
|
|
17
|
+
const { openByLevel: t, toggleMenu: h } = k({
|
|
18
|
+
menuItems: n,
|
|
19
|
+
currentPath: g,
|
|
20
|
+
maxOpenParents: b,
|
|
21
|
+
maxOpenChildren: i
|
|
22
|
+
}), u = E(
|
|
23
|
+
() => n.filter((r) => r.dashboardServices && r.dashboardServices.length > 0),
|
|
24
|
+
[n]
|
|
25
|
+
), f = T((r, o = 0) => {
|
|
26
|
+
const M = r.dashboardServices && r.dashboardServices.length > 0, l = `${o}-${r.name}`, x = !!t[l], L = s(r), W = o === 0 && u.length === 1, S = o === 0 ? !0 : p;
|
|
27
|
+
return M ? /* @__PURE__ */ e(
|
|
28
|
+
j,
|
|
29
|
+
{
|
|
30
|
+
item: r,
|
|
31
|
+
isOpen: x,
|
|
32
|
+
active: L,
|
|
33
|
+
collapsed: !1,
|
|
34
|
+
level: o,
|
|
35
|
+
isSingleTopLevel: W,
|
|
36
|
+
showIcon: S,
|
|
37
|
+
onToggle: () => h(l, o, r),
|
|
38
|
+
children: r.dashboardServices.map((v) => f(v, o + 1))
|
|
39
|
+
},
|
|
40
|
+
r.name
|
|
41
|
+
) : /* @__PURE__ */ e(
|
|
42
|
+
$,
|
|
43
|
+
{
|
|
44
|
+
item: r,
|
|
45
|
+
active: a(r),
|
|
46
|
+
collapsed: !1,
|
|
47
|
+
icon: S,
|
|
48
|
+
level: o,
|
|
49
|
+
onNavigate: c,
|
|
50
|
+
onMenuItemClick: d
|
|
51
|
+
},
|
|
52
|
+
r.name
|
|
53
|
+
);
|
|
54
|
+
}, [t, a, s, h, c, d, u, p]);
|
|
55
|
+
return /* @__PURE__ */ e(y, { children: n.map((r) => f(r, 0)) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
O as ExpandedMenu
|
|
59
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SidebarMenuItem as MenuItem } from '../../
|
|
1
|
+
import { SidebarMenuItem as MenuItem } from '../../types';
|
|
2
2
|
interface MenuRendererProps {
|
|
3
3
|
menuItems: MenuItem[];
|
|
4
4
|
currentPath: string;
|
|
@@ -6,7 +6,10 @@ interface MenuRendererProps {
|
|
|
6
6
|
multicloudExploreList?: unknown[];
|
|
7
7
|
onNavigate: (path: string) => void;
|
|
8
8
|
onMenuItemClick?: (item: MenuItem) => void;
|
|
9
|
+
showChildIcons?: boolean;
|
|
10
|
+
maxOpenParents?: number;
|
|
11
|
+
maxOpenChildren?: number;
|
|
9
12
|
}
|
|
10
|
-
export declare function MenuRenderer({ menuItems, currentPath, collapsed, multicloudExploreList, onNavigate, onMenuItemClick }: MenuRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function MenuRenderer({ menuItems, currentPath, collapsed, multicloudExploreList, onNavigate, onMenuItemClick, showChildIcons, maxOpenParents, maxOpenChildren }: MenuRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export {};
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuRenderer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/MenuRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQ/D,UAAU,iBAAiB;IACzB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAC;IAClC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,EAAE,iBAAiB,2CAwChM"}
|
|
@@ -1,77 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
] }) }
|
|
23
|
-
e.url && i(e.url), l?.(e);
|
|
24
|
-
}, children: /* @__PURE__ */ n("div", { className: o["popover-title-single"], children: e.name }) }, e.name);
|
|
25
|
-
}, [c, p, i, l]), x = f((e) => e.dashboardServices && e.dashboardServices.length > 0 ? /* @__PURE__ */ v("div", { className: o["popover-child-with-sub"], children: [
|
|
26
|
-
/* @__PURE__ */ n(b, { active: p(e), icon: null, label: e.name, popupClassName: o["nested-popover"], children: /* @__PURE__ */ v("div", { className: o["popover-menu"], children: [
|
|
27
|
-
/* @__PURE__ */ n("div", { className: o["popover-title"], children: e.name }),
|
|
28
|
-
/* @__PURE__ */ n("div", { className: o["popover-children"], children: e.dashboardServices.map((r) => /* @__PURE__ */ n(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: `${o["popover-child-item"]} ${c(r) ? o.active : ""}`,
|
|
32
|
-
onClick: () => {
|
|
33
|
-
r.url && i(r.url), l?.(r);
|
|
34
|
-
},
|
|
35
|
-
onKeyDown: (s) => {
|
|
36
|
-
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), r.url && i(r.url), l?.(r));
|
|
37
|
-
},
|
|
38
|
-
role: "menuitem",
|
|
39
|
-
tabIndex: 0,
|
|
40
|
-
children: T(r.name)
|
|
41
|
-
},
|
|
42
|
-
r.name
|
|
43
|
-
)) })
|
|
44
|
-
] }) }),
|
|
45
|
-
/* @__PURE__ */ n("span", { className: o["popover-child-arrow"], children: /* @__PURE__ */ n("svg", { width: "6", height: "10", viewBox: "0 0 6 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1 1L5 5L1 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
46
|
-
] }, e.name) : /* @__PURE__ */ n(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: `${o["popover-child-item"]} ${c(e) ? o.active : ""}`,
|
|
50
|
-
onClick: () => {
|
|
51
|
-
e.url && i(e.url), l?.(e);
|
|
52
|
-
},
|
|
53
|
-
onKeyDown: (r) => {
|
|
54
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.url && i(e.url), l?.(e));
|
|
55
|
-
},
|
|
56
|
-
role: "menuitem",
|
|
57
|
-
tabIndex: 0,
|
|
58
|
-
children: T(e.name)
|
|
59
|
-
},
|
|
60
|
-
e.name
|
|
61
|
-
), [c, p, i, l]), h = f((e, a = 0) => {
|
|
62
|
-
const r = e.dashboardServices && e.dashboardServices.length > 0, s = `${a}-${e.name}`, m = !!w[s], D = p(e), $ = a === 0 && k.length === 1;
|
|
63
|
-
return r ? /* @__PURE__ */ n(A, { item: e, isOpen: m, active: D, collapsed: !1, level: a, isSingleTopLevel: $, onToggle: () => C(s, a, e), children: e.dashboardServices.map((E) => h(E, a + 1)) }, e.name) : /* @__PURE__ */ n(g, { item: e, active: c(e), collapsed: !1, level: a, onNavigate: i, onMenuItemClick: l }, e.name);
|
|
64
|
-
}, [w, c, p, C, i, l, k]);
|
|
65
|
-
if (y && y.length > 0 && d.length > 0) {
|
|
66
|
-
const e = d.filter((r) => r.key === N), a = d.filter((r) => r.key !== N);
|
|
67
|
-
return /* @__PURE__ */ v("nav", { className: o["menu-renderer"], role: "menu", "aria-label": "Sidebar navigation", children: [
|
|
68
|
-
e.map((r, s) => t ? u(r, s) : h(r, 0)),
|
|
69
|
-
/* @__PURE__ */ n(O, { label: "Services", collapsed: t }),
|
|
70
|
-
a.map((r, s) => t ? u(r, s) : h(r, 0))
|
|
71
|
-
] });
|
|
1
|
+
import { jsx as e, jsxs as v, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useActiveDetection as D } from "../../hooks/useActiveDetection.js";
|
|
3
|
+
import { SectionLabel as T } from "../SectionLabel/index.js";
|
|
4
|
+
import { MULTICLOUD_VIEW_KEY as j, CHAT_BOT_KEY as K } from "../../Sidebar.constants.js";
|
|
5
|
+
import { CollapsedMenu as c } from "./CollapsedMenu.js";
|
|
6
|
+
import { ExpandedMenu as _ } from "./ExpandedMenu.js";
|
|
7
|
+
import '../../../../assets/index-C6j9Ze5V.css';const E = {
|
|
8
|
+
"menu-renderer": "_menu-renderer_w3wyj_1"
|
|
9
|
+
};
|
|
10
|
+
function R({ menuItems: r, currentPath: n, collapsed: l, multicloudExploreList: a, onNavigate: i, onMenuItemClick: t, showChildIcons: u = !0, maxOpenParents: o, maxOpenChildren: d }) {
|
|
11
|
+
const { isActive: m, isTreeActive: s } = D({ currentPath: n, allItems: r });
|
|
12
|
+
if (a && a.length > 0 && r.length > 0) {
|
|
13
|
+
const f = r.filter((b) => b.key === j), S = r.filter((b) => b.key !== j);
|
|
14
|
+
return /* @__PURE__ */ e("nav", { className: E["menu-renderer"], role: "menu", "aria-label": "Sidebar navigation", children: l ? /* @__PURE__ */ v(A, { children: [
|
|
15
|
+
/* @__PURE__ */ e(c, { menuItems: f, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t }),
|
|
16
|
+
/* @__PURE__ */ e(T, { label: "Services", collapsed: l }),
|
|
17
|
+
/* @__PURE__ */ e(c, { menuItems: S, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t })
|
|
18
|
+
] }) : /* @__PURE__ */ v(A, { children: [
|
|
19
|
+
/* @__PURE__ */ e(_, { menuItems: f, currentPath: n, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t, showChildIcons: u, maxOpenParents: o, maxOpenChildren: d }),
|
|
20
|
+
/* @__PURE__ */ e(T, { label: "Services", collapsed: l }),
|
|
21
|
+
/* @__PURE__ */ e(_, { menuItems: S, currentPath: n, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t, showChildIcons: u, maxOpenParents: o, maxOpenChildren: d })
|
|
22
|
+
] }) });
|
|
72
23
|
}
|
|
73
|
-
|
|
24
|
+
const y = l ? r : r.filter((f) => f.key !== K);
|
|
25
|
+
return /* @__PURE__ */ e("nav", { className: E["menu-renderer"], role: "menu", "aria-label": "Sidebar navigation", children: l ? /* @__PURE__ */ e(c, { menuItems: y, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t }) : /* @__PURE__ */ e(_, { menuItems: y, currentPath: n, isActive: m, isTreeActive: s, onNavigate: i, onMenuItemClick: t, showChildIcons: u, maxOpenParents: o, maxOpenChildren: d }) });
|
|
74
26
|
}
|
|
75
27
|
export {
|
|
76
|
-
|
|
28
|
+
R as MenuRenderer
|
|
77
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/ModuleSwitchButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/ModuleSwitchButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,UAAU,uBAAuB;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,uBAAuB,kDA6B5H"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { capitalizeFirstLetter as u } from "../../Sidebar.utils.js";
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { Tooltip as w } from "../../../Tooltip/index.js";
|
|
4
|
+
import '../../../../assets/index-CSofT_ix.css';const r = {
|
|
5
|
+
"box-shadow": "_box-shadow_rhe0s_1",
|
|
6
|
+
"switch-module-wrapper": "_switch-module-wrapper_rhe0s_10",
|
|
7
|
+
"switch-module-btn": "_switch-module-btn_rhe0s_17",
|
|
8
|
+
"switch-module-collapsed": "_switch-module-collapsed_rhe0s_42"
|
|
9
|
+
};
|
|
10
|
+
function f({ modules: s, collapsed: i, currentModuleId: d, userType: h, onModuleSwitch: a }) {
|
|
11
|
+
if (h !== "CUSTOMER") return null;
|
|
12
|
+
const l = s.filter((e) => e.feEnabled && e.type === "CUSTOMER" && e.id !== d);
|
|
13
|
+
return l.length === 0 ? null : /* @__PURE__ */ t("div", { className: r["box-shadow"], children: l.map((e) => {
|
|
14
|
+
const o = `Switch to ${u(e.displayName)}`, n = /* @__PURE__ */ c("button", { type: "button", className: `${r["switch-module-btn"]} ${i ? r["switch-module-collapsed"] : ""}`, onClick: () => a(e.name), "aria-label": o, children: [
|
|
15
|
+
!i && /* @__PURE__ */ t("span", { children: o }),
|
|
16
|
+
/* @__PURE__ */ t("svg", { width: "8", height: "12", viewBox: "0 0 8 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", style: { marginLeft: i ? 0 : "8px" }, children: /* @__PURE__ */ t("path", { d: "M1.5 1L6.5 6L1.5 11", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
12
17
|
] });
|
|
13
|
-
return i ? /* @__PURE__ */
|
|
18
|
+
return i ? /* @__PURE__ */ t("div", { className: r["switch-module-wrapper"], children: /* @__PURE__ */ t(w, { title: o, placement: "right", arrow: !0, children: /* @__PURE__ */ t("span", { children: n }) }) }, e.id) : /* @__PURE__ */ t("div", { className: r["switch-module-wrapper"], children: n }, e.id);
|
|
14
19
|
}) });
|
|
15
20
|
}
|
|
16
21
|
export {
|
|
17
|
-
|
|
22
|
+
f as ModuleSwitchButton
|
|
18
23
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
interface SectionLabelProps {
|
|
2
2
|
label: string;
|
|
3
3
|
collapsed: boolean;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
export declare function SectionLabel({ label, collapsed }: SectionLabelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export {};
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/SectionLabel/index.tsx"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/SectionLabel/index.tsx"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,iBAAiB,kDAGnE"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import '../../../../assets/index-tIl-UucG.css';const a = {
|
|
3
|
+
"sidebar-tag": "_sidebar-tag_1wvk7_1"
|
|
4
|
+
};
|
|
5
|
+
function i({ label: e, collapsed: r }) {
|
|
6
|
+
return r ? null : /* @__PURE__ */ t("p", { className: a["sidebar-tag"], children: e });
|
|
5
7
|
}
|
|
6
8
|
export {
|
|
7
|
-
|
|
9
|
+
i as SectionLabel
|
|
8
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { SidebarMenuItem } from '../../
|
|
2
|
+
import { SidebarMenuItem } from '../../types';
|
|
3
3
|
interface SubMenuWrapperProps {
|
|
4
4
|
item: SidebarMenuItem;
|
|
5
5
|
isOpen: boolean;
|
|
@@ -7,9 +7,10 @@ interface SubMenuWrapperProps {
|
|
|
7
7
|
collapsed: boolean;
|
|
8
8
|
level: number;
|
|
9
9
|
isSingleTopLevel?: boolean;
|
|
10
|
+
showIcon?: boolean;
|
|
10
11
|
onToggle: () => void;
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
}
|
|
13
|
-
export declare function SubMenuWrapper({ item, isOpen, active, collapsed, level, isSingleTopLevel, onToggle, children }: SubMenuWrapperProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare function SubMenuWrapper({ item, isOpen, active, collapsed, level, isSingleTopLevel, showIcon, onToggle, children }: SubMenuWrapperProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/SubMenuWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Sidebar/components/SubMenuWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAwB,EAAE,QAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,mBAAmB,kDAsC5J"}
|
|
@@ -1,35 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { IconRenderer as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { IconRenderer as d } from "../IconRenderer/index.js";
|
|
3
|
+
import '../../../../assets/index-eZS6kms7.css';const h = "_submenu_qk07k_1", b = "_active_qk07k_21", p = "_open_qk07k_80", w = "_arrow_qk07k_117", q = "_rotate_qk07k_130", e = {
|
|
4
|
+
submenu: h,
|
|
5
|
+
"parent-item": "_parent-item_qk07k_4",
|
|
6
|
+
active: b,
|
|
7
|
+
"top-level": "_top-level_qk07k_25",
|
|
8
|
+
"with-child": "_with-child_qk07k_32",
|
|
9
|
+
"submenu-children": "_submenu-children_qk07k_41",
|
|
10
|
+
"submenu-children-inner": "_submenu-children-inner_qk07k_44",
|
|
11
|
+
"nested-submenu": "_nested-submenu_qk07k_50",
|
|
12
|
+
"has-active": "_has-active_qk07k_55",
|
|
13
|
+
"submenu-label": "_submenu-label_qk07k_65",
|
|
14
|
+
open: p,
|
|
15
|
+
arrow: w,
|
|
16
|
+
rotate: q,
|
|
17
|
+
"menu-icon": "_menu-icon_qk07k_134",
|
|
18
|
+
"menu-content": "_menu-content_qk07k_151"
|
|
19
|
+
};
|
|
20
|
+
function f({ item: o, isOpen: t, active: u, collapsed: _, level: r, isSingleTopLevel: a = !1, showIcon: m = !0, onToggle: i, children: l }) {
|
|
21
|
+
if (_) return null;
|
|
22
|
+
const k = !(a && t);
|
|
23
|
+
return /* @__PURE__ */ c("div", { className: `${e.submenu} ${t ? e["with-child"] : ""} ${u && r === 0 ? e["has-active"] : ""} ${r > 0 ? e["nested-submenu"] : ""}`, children: [
|
|
24
|
+
/* @__PURE__ */ c(
|
|
9
25
|
"div",
|
|
10
26
|
{
|
|
11
|
-
className: `${e["
|
|
27
|
+
className: `${e["parent-item"]} ${r === 0 ? e["top-level"] : ""} ${u || t ? e.active : ""}`,
|
|
12
28
|
onClick: () => {
|
|
13
|
-
a &&
|
|
29
|
+
a && t || i();
|
|
14
30
|
},
|
|
15
31
|
onKeyDown: (s) => {
|
|
16
|
-
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a &&
|
|
32
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a && t || i());
|
|
17
33
|
},
|
|
18
34
|
role: "menuitem",
|
|
19
35
|
tabIndex: 0,
|
|
20
|
-
"aria-expanded":
|
|
36
|
+
"aria-expanded": t,
|
|
21
37
|
children: [
|
|
22
|
-
|
|
23
|
-
/* @__PURE__ */ n("span", { className: e["menu-content"], children: /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */ n("span", { children:
|
|
25
|
-
|
|
38
|
+
m && r === 0 && /* @__PURE__ */ n("span", { className: e["menu-icon"], children: /* @__PURE__ */ n(d, { icon: o.icon }) }),
|
|
39
|
+
/* @__PURE__ */ n("span", { className: e["menu-content"], children: /* @__PURE__ */ c("span", { className: e["submenu-label"], children: [
|
|
40
|
+
/* @__PURE__ */ n("span", { children: o.name }),
|
|
41
|
+
k && /* @__PURE__ */ n("span", { className: `${e.arrow} ${t ? e.rotate : ""}`, children: /* @__PURE__ */ n("svg", { width: "6", height: "10", viewBox: "0 0 6 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1 1L5 5L1 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
26
42
|
] }) })
|
|
27
43
|
]
|
|
28
44
|
}
|
|
29
45
|
),
|
|
30
|
-
/* @__PURE__ */ n("div", { className: `${e["submenu-children"]} ${
|
|
46
|
+
/* @__PURE__ */ n("div", { className: `${e["submenu-children"]} ${t ? e.open : ""}`, children: /* @__PURE__ */ n("div", { className: e["submenu-children-inner"], children: l }) })
|
|
31
47
|
] });
|
|
32
48
|
}
|
|
33
49
|
export {
|
|
34
|
-
|
|
50
|
+
f as SubMenuWrapper
|
|
35
51
|
};
|