@cyberpunk-vue/components 1.9.21 → 1.9.22
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/index.cjs +1 -1
- package/dist/index.mjs +64 -70
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -5706,64 +5706,61 @@ var ae = {
|
|
|
5706
5706
|
props: mr,
|
|
5707
5707
|
emits: hr,
|
|
5708
5708
|
setup(e, { emit: t }) {
|
|
5709
|
-
let n = e, i = t, a = Y("menu"), s = T(n.defaultActive),
|
|
5710
|
-
p.set(e, [...t]);
|
|
5711
|
-
}, g = (e) => {
|
|
5712
|
-
p.delete(e);
|
|
5713
|
-
}, b = (e, t) => {
|
|
5709
|
+
let n = e, i = t, a = Y("menu"), s = f()?.appContext.config.globalProperties.$router, c = T(n.defaultActive), l = T([]), u = T(new Set(n.defaultOpeneds)), d = T(new Set(n.defaultOpeneds)), p = T(!1), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = (e, t) => {
|
|
5714
5710
|
m.set(e, [...t]);
|
|
5715
|
-
},
|
|
5711
|
+
}, b = (e) => {
|
|
5716
5712
|
m.delete(e);
|
|
5713
|
+
}, w = (e, t) => {
|
|
5714
|
+
h.set(e, [...t]);
|
|
5717
5715
|
}, E = (e) => {
|
|
5718
|
-
|
|
5716
|
+
h.delete(e);
|
|
5717
|
+
}, D = (e) => {
|
|
5718
|
+
if (m.has(e)) return {
|
|
5719
5719
|
index: e,
|
|
5720
|
-
indexPath:
|
|
5720
|
+
indexPath: m.get(e)
|
|
5721
5721
|
};
|
|
5722
5722
|
let t = null;
|
|
5723
|
-
for (let [n, r] of
|
|
5723
|
+
for (let [n, r] of m) n !== "/" && (e.startsWith(n + "/") || e.startsWith(n + "?")) && (!t || n.length > t.index.length) && (t = {
|
|
5724
5724
|
index: n,
|
|
5725
5725
|
indexPath: r
|
|
5726
5726
|
});
|
|
5727
5727
|
return t;
|
|
5728
|
-
},
|
|
5728
|
+
}, k = (e) => {
|
|
5729
5729
|
if (!e) return;
|
|
5730
|
-
let t =
|
|
5730
|
+
let t = D(e);
|
|
5731
5731
|
if (t) {
|
|
5732
|
-
|
|
5733
|
-
let e = new Set(
|
|
5734
|
-
for (let n of t.indexPath) n !== t.index &&
|
|
5735
|
-
|
|
5732
|
+
c.value = t.index, l.value = t.indexPath;
|
|
5733
|
+
let e = new Set(u.value);
|
|
5734
|
+
for (let n of t.indexPath) n !== t.index && h.has(n) && e.add(n);
|
|
5735
|
+
u.value = e, n.collapse || (d.value = new Set(e));
|
|
5736
5736
|
}
|
|
5737
5737
|
};
|
|
5738
5738
|
R(() => n.defaultActive, (e) => {
|
|
5739
|
-
|
|
5739
|
+
k(e);
|
|
5740
5740
|
}), R(() => n.collapse, (e) => {
|
|
5741
|
-
e ? (
|
|
5742
|
-
|
|
5743
|
-
}, 350)) :
|
|
5741
|
+
e ? (p.value = !0, d.value = new Set(u.value), u.value = /* @__PURE__ */ new Set(), setTimeout(() => {
|
|
5742
|
+
p.value = !1;
|
|
5743
|
+
}, 350)) : u.value = new Set(d.value);
|
|
5744
5744
|
}, { flush: "sync" });
|
|
5745
|
-
let
|
|
5746
|
-
n.router || (
|
|
5747
|
-
}, A = (e, t) => {
|
|
5748
|
-
let r = new Set(l.value);
|
|
5749
|
-
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), l.value = r, i("open", e, t), n.collapse || (u.value = new Set(r)));
|
|
5745
|
+
let A = (e, t) => {
|
|
5746
|
+
n.router || (c.value = e, l.value = t), i("select", e, t);
|
|
5750
5747
|
}, j = (e, t) => {
|
|
5751
|
-
let r = new Set(
|
|
5752
|
-
r.has(e) && (r.
|
|
5748
|
+
let r = new Set(u.value);
|
|
5749
|
+
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), u.value = r, i("open", e, t), n.collapse || (d.value = new Set(r)));
|
|
5753
5750
|
}, N = (e, t) => {
|
|
5754
|
-
|
|
5751
|
+
let r = new Set(u.value);
|
|
5752
|
+
r.has(e) && (r.delete(e), u.value = r, i("close", e, t), n.collapse || (d.value = new Set(r)));
|
|
5753
|
+
}, P = (e, t) => {
|
|
5754
|
+
u.value.has(e) ? N(e, t) : j(e, t);
|
|
5755
5755
|
};
|
|
5756
5756
|
x(() => {
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
}), n.router) {
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
D(e);
|
|
5763
|
-
});
|
|
5764
|
-
}
|
|
5757
|
+
_(() => {
|
|
5758
|
+
k(c.value);
|
|
5759
|
+
}), n.router && s && R(() => s.currentRoute.value.path, (e) => {
|
|
5760
|
+
k(e);
|
|
5761
|
+
});
|
|
5765
5762
|
});
|
|
5766
|
-
let
|
|
5763
|
+
let F = 0, I = () => `__cp_auto_${++F}`, L = r(() => [
|
|
5767
5764
|
a.b(),
|
|
5768
5765
|
a.m(n.mode),
|
|
5769
5766
|
a.m(`shape-${n.shape}`),
|
|
@@ -5771,15 +5768,15 @@ var ae = {
|
|
|
5771
5768
|
a.is("collapse", n.collapse && n.mode === "vertical"),
|
|
5772
5769
|
n.type === "default" ? "" : a.m(n.type),
|
|
5773
5770
|
n.color ? a.is("custom-color") : ""
|
|
5774
|
-
]),
|
|
5771
|
+
]), z = r(() => {
|
|
5775
5772
|
let e = {};
|
|
5776
5773
|
return n.color && (e["--cp-menu-active-color"] = n.color, e["--cp-menu-active-color-light"] = `color-mix(in srgb, ${n.color} 20%, transparent)`), e;
|
|
5777
5774
|
});
|
|
5778
5775
|
return C(gr, {
|
|
5779
|
-
generateIndex:
|
|
5780
|
-
activeIndex:
|
|
5781
|
-
activeIndexPath:
|
|
5782
|
-
openedMenus:
|
|
5776
|
+
generateIndex: I,
|
|
5777
|
+
activeIndex: c,
|
|
5778
|
+
activeIndexPath: l,
|
|
5779
|
+
openedMenus: u,
|
|
5783
5780
|
mode: n.mode,
|
|
5784
5781
|
collapse: M(n, "collapse"),
|
|
5785
5782
|
type: n.type,
|
|
@@ -5787,18 +5784,18 @@ var ae = {
|
|
|
5787
5784
|
variant: n.variant,
|
|
5788
5785
|
router: n.router,
|
|
5789
5786
|
color: n.color,
|
|
5790
|
-
handleSelect:
|
|
5791
|
-
handleSubMenuClick:
|
|
5792
|
-
openMenu:
|
|
5793
|
-
closeMenu:
|
|
5794
|
-
addItem:
|
|
5795
|
-
removeItem:
|
|
5796
|
-
addSubMenu:
|
|
5797
|
-
removeSubMenu:
|
|
5798
|
-
suppressTransition:
|
|
5787
|
+
handleSelect: A,
|
|
5788
|
+
handleSubMenuClick: P,
|
|
5789
|
+
openMenu: j,
|
|
5790
|
+
closeMenu: N,
|
|
5791
|
+
addItem: g,
|
|
5792
|
+
removeItem: b,
|
|
5793
|
+
addSubMenu: w,
|
|
5794
|
+
removeSubMenu: E,
|
|
5795
|
+
suppressTransition: p
|
|
5799
5796
|
}), (e, t) => (S(), o("ul", {
|
|
5800
|
-
class: v(
|
|
5801
|
-
style: y(
|
|
5797
|
+
class: v(L.value),
|
|
5798
|
+
style: y(z.value),
|
|
5802
5799
|
role: "menubar"
|
|
5803
5800
|
}, [O(e.$slots, "default")], 6));
|
|
5804
5801
|
}
|
|
@@ -5829,34 +5826,31 @@ var ae = {
|
|
|
5829
5826
|
props: yr,
|
|
5830
5827
|
emits: br,
|
|
5831
5828
|
setup(e, { emit: t }) {
|
|
5832
|
-
let n = e, c = t, l = Y("menu-item"), u = m(gr, void 0),
|
|
5829
|
+
let n = e, c = t, l = Y("menu-item"), u = f()?.appContext.config.globalProperties.$router, d = m(gr, void 0), p = m(_r, void 0), h = n.index ?? d?.generateIndex() ?? `__cp_auto_fallback_${Math.random().toString(36).slice(2)}`, g = r(() => d?.activeIndex.value === h), _ = r(() => [...p?.indexPath ?? [], h]);
|
|
5833
5830
|
x(() => {
|
|
5834
|
-
|
|
5831
|
+
d?.addItem(h, _.value);
|
|
5835
5832
|
}), b(() => {
|
|
5836
|
-
|
|
5833
|
+
d?.removeItem(h);
|
|
5837
5834
|
});
|
|
5838
|
-
let
|
|
5835
|
+
let C = r(() => d?.mode === "horizontal" ? {} : { paddingLeft: `${20 * ((p?.level ?? 0) + 1)}px` }), w = r(() => [
|
|
5839
5836
|
l.b(),
|
|
5840
|
-
l.is("active",
|
|
5837
|
+
l.is("active", g.value),
|
|
5841
5838
|
l.is("disabled", n.disabled)
|
|
5842
|
-
]),
|
|
5843
|
-
if (!n.disabled && (
|
|
5844
|
-
let e =
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
e.name !== "NavigationDuplicated" && console.warn("[CpMenuItem] Router navigation failed:", e);
|
|
5849
|
-
});
|
|
5850
|
-
}
|
|
5839
|
+
]), T = () => {
|
|
5840
|
+
if (!n.disabled && (d?.handleSelect(h, _.value), c("click", h), d?.router && u)) {
|
|
5841
|
+
let e = n.route ?? h;
|
|
5842
|
+
u.push(e).catch((e) => {
|
|
5843
|
+
e.name !== "NavigationDuplicated" && console.warn("[CpMenuItem] Router navigation failed:", e);
|
|
5844
|
+
});
|
|
5851
5845
|
}
|
|
5852
5846
|
};
|
|
5853
5847
|
return (e, t) => (S(), o("li", {
|
|
5854
|
-
class: v(
|
|
5855
|
-
style: y(
|
|
5848
|
+
class: v(w.value),
|
|
5849
|
+
style: y(C.value),
|
|
5856
5850
|
role: "menuitem",
|
|
5857
5851
|
tabindex: e.disabled ? -1 : 0,
|
|
5858
|
-
onClick:
|
|
5859
|
-
onKeydown: H(
|
|
5852
|
+
onClick: T,
|
|
5853
|
+
onKeydown: H(T, ["enter"])
|
|
5860
5854
|
}, [e.icon || e.$slots.icon ? (S(), o("span", {
|
|
5861
5855
|
key: 0,
|
|
5862
5856
|
class: v(N(l).e("icon"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberpunk-vue/components",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.22",
|
|
4
4
|
"description": "Cyberpunk Vue components - A futuristic Vue 3 component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"vue": "^3.5.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cyberpunk-vue/
|
|
27
|
-
"@cyberpunk-vue/
|
|
28
|
-
"@cyberpunk-vue/
|
|
26
|
+
"@cyberpunk-vue/hooks": "1.9.22",
|
|
27
|
+
"@cyberpunk-vue/constants": "1.9.22",
|
|
28
|
+
"@cyberpunk-vue/theme-chalk": "1.9.22"
|
|
29
29
|
},
|
|
30
30
|
"author": "Juxest",
|
|
31
31
|
"license": "MIT",
|