@ck-ui/component-library 2.0.2 → 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/index-eZS6kms7.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 +196 -173
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.js +45 -39
- package/dist/components/Sidebar/components/CollapsedTooltip/index.js +2 -2
- package/dist/components/Sidebar/components/MenuItemWrapper/index.js +19 -18
- package/dist/components/Sidebar/components/MenuRenderer/CollapsedMenu.js +2 -2
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.d.ts +7 -1
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.d.ts.map +1 -1
- package/dist/components/Sidebar/components/MenuRenderer/ExpandedMenu.js +42 -25
- package/dist/components/Sidebar/components/MenuRenderer/index.d.ts +4 -1
- package/dist/components/Sidebar/components/MenuRenderer/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/MenuRenderer/index.js +22 -22
- package/dist/components/Sidebar/components/SubMenuWrapper/index.d.ts +2 -1
- package/dist/components/Sidebar/components/SubMenuWrapper/index.d.ts.map +1 -1
- package/dist/components/Sidebar/components/SubMenuWrapper/index.js +33 -29
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Sidebar/hooks/useMenuState.d.ts +5 -1
- package/dist/components/Sidebar/hooks/useMenuState.d.ts.map +1 -1
- package/dist/components/Sidebar/hooks/useMenuState.js +56 -38
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Sidebar/types/sidebar.types.d.ts +3 -0
- package/dist/components/Sidebar/types/sidebar.types.d.ts.map +1 -1
- package/dist/{index-DKHB_5Ee.js → index-CSxlVCTW.js} +1 -1
- package/dist/styles.module-xqgv3wwP.js +12 -0
- package/package.json +1 -1
- package/dist/assets/index-DrxnMAdp.css +0 -1
- package/dist/assets/styles-BCYQ4rbx.css +0 -1
- package/dist/styles.module-V3iL6ubH.js +0 -11
|
@@ -1,51 +1,69 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { isTreeActive as
|
|
3
|
-
function
|
|
4
|
-
const [
|
|
5
|
-
|
|
6
|
-
if (!
|
|
7
|
-
const e = {},
|
|
8
|
-
for (const o of
|
|
9
|
-
if (
|
|
10
|
-
e[`${
|
|
1
|
+
import { useState as E, useEffect as v, useCallback as j } from "react";
|
|
2
|
+
import { isTreeActive as S } from "../Sidebar.utils.js";
|
|
3
|
+
function w({ menuItems: c, currentPath: n, maxOpenParents: b, maxOpenChildren: h }) {
|
|
4
|
+
const [$, l] = E({});
|
|
5
|
+
v(() => {
|
|
6
|
+
if (!c.length) return;
|
|
7
|
+
const e = {}, t = (f, r = 0) => {
|
|
8
|
+
for (const o of f)
|
|
9
|
+
if (S(o, n, c)) {
|
|
10
|
+
e[`${r}-${o.name}`] = !0, o.dashboardServices && t(o.dashboardServices, r + 1);
|
|
11
11
|
break;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
if (!
|
|
17
|
-
const e = {},
|
|
18
|
-
for (const o of
|
|
19
|
-
if (
|
|
20
|
-
e[`${
|
|
14
|
+
t(c), l(e);
|
|
15
|
+
}, [c]), v(() => {
|
|
16
|
+
if (!c.length) return;
|
|
17
|
+
const e = {}, t = (f, r = 0) => {
|
|
18
|
+
for (const o of f)
|
|
19
|
+
if (S(o, n, c)) {
|
|
20
|
+
e[`${r}-${o.name}`] = !0, o.dashboardServices && t(o.dashboardServices, r + 1);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
const
|
|
27
|
-
(e,
|
|
28
|
-
|
|
29
|
-
const o = { ...
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
t(c), l((f) => ({ ...f, ...e }));
|
|
25
|
+
}, [n]);
|
|
26
|
+
const u = j(
|
|
27
|
+
(e, t, f) => {
|
|
28
|
+
l((r) => {
|
|
29
|
+
const o = { ...r }, g = !r[e];
|
|
30
|
+
if (g) {
|
|
31
|
+
if (t === 0 && b !== void 0) {
|
|
32
|
+
const s = Object.keys(o).filter(
|
|
33
|
+
(i) => i.startsWith("0-") && o[i]
|
|
34
|
+
);
|
|
35
|
+
s.length >= b && s.slice(0, s.length - b + 1).forEach((d) => {
|
|
36
|
+
delete o[d], Object.keys(o).forEach((a) => {
|
|
37
|
+
a !== d && o[a] && parseInt(a.split("-")[0], 10);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
} else if (t > 0 && h !== void 0) {
|
|
41
|
+
const s = Object.keys(o).filter(
|
|
42
|
+
(i) => i.startsWith(`${t}-`) && o[i] && i !== e
|
|
43
|
+
);
|
|
44
|
+
s.length >= h && s.slice(0, s.length - h + 1).forEach((d) => {
|
|
45
|
+
delete o[d];
|
|
46
|
+
});
|
|
47
|
+
} else if (t === 0 && b === void 0 && (Object.keys(o).forEach((s) => {
|
|
48
|
+
s !== e && delete o[s];
|
|
49
|
+
}), f.dashboardServices)) {
|
|
50
|
+
const s = (i, d) => {
|
|
51
|
+
for (const a of i)
|
|
52
|
+
if (S(a, n, c)) {
|
|
53
|
+
o[`${d}-${a.name}`] = !0, a.dashboardServices && s(a.dashboardServices, d + 1);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
s(f.dashboardServices, t + 1);
|
|
58
|
+
}
|
|
41
59
|
}
|
|
42
|
-
return o[e] =
|
|
60
|
+
return o[e] = g, o;
|
|
43
61
|
});
|
|
44
62
|
},
|
|
45
|
-
[c,
|
|
63
|
+
[n, c, b, h]
|
|
46
64
|
);
|
|
47
|
-
return { openByLevel:
|
|
65
|
+
return { openByLevel: $, toggleMenu: u };
|
|
48
66
|
}
|
|
49
67
|
export {
|
|
50
|
-
|
|
68
|
+
w as useMenuState
|
|
51
69
|
};
|
|
@@ -2,7 +2,7 @@ import { Sidebar as o, Sidebar as t } from "./Sidebar.js";
|
|
|
2
2
|
import { MenuRenderer as i } from "./components/MenuRenderer/index.js";
|
|
3
3
|
import { MenuItemWrapper as a } from "./components/MenuItemWrapper/index.js";
|
|
4
4
|
import { SubMenuWrapper as x } from "./components/SubMenuWrapper/index.js";
|
|
5
|
-
import { C as u } from "../../index-
|
|
5
|
+
import { C as u } from "../../index-CSxlVCTW.js";
|
|
6
6
|
import { ExploreSection as d } from "./components/ExploreSection/index.js";
|
|
7
7
|
import { ModuleSwitchButton as s } from "./components/ModuleSwitchButton/index.js";
|
|
8
8
|
import { ContactUsButton as D } from "./components/ContactUsButton/index.js";
|
|
@@ -44,5 +44,8 @@ export interface SidebarProps {
|
|
|
44
44
|
renderFooter?: () => ReactNode;
|
|
45
45
|
/** Optional header slot for rendering custom content at the top (above module switch). */
|
|
46
46
|
renderHeader?: () => ReactNode;
|
|
47
|
+
showChildIcons?: boolean;
|
|
48
|
+
maxOpenParents?: number;
|
|
49
|
+
maxOpenChildren?: number;
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=sidebar.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.types.d.ts","sourceRoot":"","sources":["../../../../lib/components/Sidebar/types/sidebar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,M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,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE9B,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAElD,wDAAwD;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;IAE/B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useRef as a } from "react";
|
|
3
|
-
import { s as n } from "./styles.module-
|
|
3
|
+
import { s as n } from "./styles.module-xqgv3wwP.js";
|
|
4
4
|
import './assets/index-C_Tn9jS-.css';const f = "_active_1ugk5_80", o = {
|
|
5
5
|
"sidebar-popup": "_sidebar-popup_1ugk5_1",
|
|
6
6
|
"popover-container": "_popover-container_1ugk5_7",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './assets/styles-DGlqPkdv.css';const e = "_nested_1sba1_21", t = "_active_1sba1_29", _ = {
|
|
2
|
+
"sidebar-menu-item": "_sidebar-menu-item_1sba1_1",
|
|
3
|
+
nested: e,
|
|
4
|
+
active: t,
|
|
5
|
+
"leaf-item": "_leaf-item_1sba1_39",
|
|
6
|
+
"active-indicator": "_active-indicator_1sba1_47",
|
|
7
|
+
"menu-icon": "_menu-icon_1sba1_58",
|
|
8
|
+
"menu-content": "_menu-content_1sba1_75"
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
_ as s
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._submenu_kaorb_1{margin:2px 0}._submenu_kaorb_1._with-child_kaorb_4{border-radius:8px}._submenu_kaorb_1._with-child_kaorb_4>._parent-item_kaorb_7{margin:0;background-color:var(--ckcl-primary-80, #F1F6FF);border-color:var(--ckcl-primary-200, #B0CDF6);border-radius:8px}._submenu_kaorb_1._with-child_kaorb_4 ._submenu-children_kaorb_13{padding-left:0}._submenu_kaorb_1._with-child_kaorb_4 ._submenu-children_kaorb_13 ._submenu-children-inner_kaorb_16{margin-left:22px;margin-top:8px;padding-left:14px;border-left:1px solid var(--ckcl-primary-300, #81AFF0);position:relative}._submenu-label_kaorb_24{display:flex;justify-content:space-between;align-items:center;width:100%}._submenu-children_kaorb_13{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease}._submenu-children_kaorb_13>*{overflow:hidden}._submenu-children_kaorb_13._open_kaorb_39{grid-template-rows:1fr}._submenu-children_kaorb_13._open_kaorb_39>*{overflow:visible}._submenu-children-inner_kaorb_16{overflow:hidden}._arrow_kaorb_50{display:inline-flex;align-items:center;transition:transform .2s ease;padding-left:4px;color:var(--ckcl-black-400, #737373);transform:rotate(90deg)}._arrow_kaorb_50 svg{width:6px;height:10px}._rotate_kaorb_63{transform:rotate(-90deg)}._menu-icon_kaorb_67{display:flex;align-items:center;justify-content:center;border-radius:6px;border:1px solid transparent;width:28px;min-width:28px;height:28px;margin-right:10px;transition:background-color .15s ease,border-color .15s ease}._menu-icon_kaorb_67 img,._menu-icon_kaorb_67 svg{max-width:16px;max-height:16px}._menu-content_kaorb_84{font-size:var(--ckcl-fs-xs, 12px);width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._sidebar-menu-item_1qm5r_1{display:flex;align-items:center;margin:2px 0;padding:8px 12px;cursor:pointer;border-radius:8px;border:1px solid transparent;color:var(--ckcl-black-500, #2B2B2B);font-size:var(--ckcl-fs-xs, 12px);line-height:var(--ckcl-leading-sm, 16px);font-weight:var(--ckcl-font-weight-regular, 400);text-decoration:none;outline:none;transition:background-color .15s ease,border-color .15s ease,color .15s ease}._sidebar-menu-item_1qm5r_1:hover{background-color:var(--ckcl-primary-80, #F1F6FF);color:var(--ckcl-primary-500, #3A72E4)}._sidebar-menu-item_1qm5r_1:hover ._menu-icon_1qm5r_21{background-color:var(--ckcl-primary-100, #D9E6FB);border-color:var(--ckcl-primary-200, #B0CDF6)}._sidebar-menu-item_1qm5r_1:focus-visible{outline:2px solid var(--ckcl-primary-500, #3A72E4);outline-offset:-2px}._sidebar-menu-item_1qm5r_1._active_1qm5r_29{background-color:var(--ckcl-primary-80, #F1F6FF);border-color:var(--ckcl-primary-200, #B0CDF6);color:var(--ckcl-primary-500, #3A72E4)}._sidebar-menu-item_1qm5r_1._active_1qm5r_29 ._menu-icon_1qm5r_21{background-color:var(--ckcl-primary-100, #D9E6FB);border-color:var(--ckcl-primary-200, #B0CDF6)}._leaf-item_1qm5r_39{position:relative}._active-indicator_1qm5r_43{position:absolute;top:50%;width:var(--indicator-width, 3px);height:16px;background-color:var(--ckcl-primary-500, #3A72E4);border-radius:2px;transform:translateY(-50%);margin-left:var(--indicator-nudge, 0px)}._menu-icon_1qm5r_21{display:flex;align-items:center;justify-content:center;border-radius:6px;border:1px solid transparent;width:28px;min-width:28px;height:28px;margin-right:10px;transition:background-color .15s ease,border-color .15s ease}._menu-icon_1qm5r_21 img,._menu-icon_1qm5r_21 svg{max-width:16px;max-height:16px}._menu-content_1qm5r_71{font-size:var(--ckcl-fs-xs, 12px);width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './assets/styles-BCYQ4rbx.css';const e = "_active_1qm5r_29", t = {
|
|
2
|
-
"sidebar-menu-item": "_sidebar-menu-item_1qm5r_1",
|
|
3
|
-
"menu-icon": "_menu-icon_1qm5r_21",
|
|
4
|
-
active: e,
|
|
5
|
-
"leaf-item": "_leaf-item_1qm5r_39",
|
|
6
|
-
"active-indicator": "_active-indicator_1qm5r_43",
|
|
7
|
-
"menu-content": "_menu-content_1qm5r_71"
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
t as s
|
|
11
|
-
};
|