@cocoar/vue-ui 2.2.0 → 2.2.1
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.js
CHANGED
|
@@ -8660,6 +8660,7 @@ var wu = {
|
|
|
8660
8660
|
}), [["__scopeId", "data-v-13d4d08e"]]), Ou = [
|
|
8661
8661
|
"href",
|
|
8662
8662
|
"aria-disabled",
|
|
8663
|
+
"aria-current",
|
|
8663
8664
|
"tabindex",
|
|
8664
8665
|
"onClick"
|
|
8665
8666
|
], ku = {
|
|
@@ -8668,11 +8669,16 @@ var wu = {
|
|
|
8668
8669
|
}, Au = { class: "coar-menu-item__label" }, ju = [
|
|
8669
8670
|
"href",
|
|
8670
8671
|
"aria-disabled",
|
|
8672
|
+
"aria-current",
|
|
8671
8673
|
"tabindex"
|
|
8672
8674
|
], Mu = {
|
|
8673
8675
|
class: "coar-menu-item__icon",
|
|
8674
8676
|
"aria-hidden": "true"
|
|
8675
|
-
}, Nu = { class: "coar-menu-item__label" }, Pu = [
|
|
8677
|
+
}, Nu = { class: "coar-menu-item__label" }, Pu = [
|
|
8678
|
+
"aria-disabled",
|
|
8679
|
+
"aria-current",
|
|
8680
|
+
"tabindex"
|
|
8681
|
+
], Fu = {
|
|
8676
8682
|
class: "coar-menu-item__icon",
|
|
8677
8683
|
"aria-hidden": "true"
|
|
8678
8684
|
}, Iu = { class: "coar-menu-item__label" }, Lu = /* @__PURE__ */ X(/* @__PURE__ */ d({
|
|
@@ -8681,6 +8687,10 @@ var wu = {
|
|
|
8681
8687
|
label: { default: void 0 },
|
|
8682
8688
|
icon: { default: void 0 },
|
|
8683
8689
|
to: { default: void 0 },
|
|
8690
|
+
active: {
|
|
8691
|
+
type: Boolean,
|
|
8692
|
+
default: void 0
|
|
8693
|
+
},
|
|
8684
8694
|
disabled: {
|
|
8685
8695
|
type: Boolean,
|
|
8686
8696
|
default: !1
|
|
@@ -8690,25 +8700,35 @@ var wu = {
|
|
|
8690
8700
|
setup(t, { emit: n }) {
|
|
8691
8701
|
let a = t, c = n, d = Cu(), f = m(yu, void 0), p = O(null), { RouterLink: h, hasRouterLink: g, warnIfMisconfigured: _ } = Ge();
|
|
8692
8702
|
U(() => a.to, (e) => _(e, "CoarMenuItem"), { immediate: !0 });
|
|
8693
|
-
let v = r(() => a.to !== void 0 && a.to !== null)
|
|
8703
|
+
let v = r(() => a.to !== void 0 && a.to !== null);
|
|
8704
|
+
function b(e) {
|
|
8705
|
+
return {
|
|
8706
|
+
"coar-menu-item--active": a.active ?? e,
|
|
8707
|
+
"coar-menu-item--disabled": a.disabled
|
|
8708
|
+
};
|
|
8709
|
+
}
|
|
8710
|
+
function x(e) {
|
|
8711
|
+
return a.active ?? e ? "page" : void 0;
|
|
8712
|
+
}
|
|
8713
|
+
let T = null;
|
|
8694
8714
|
C(() => {
|
|
8695
8715
|
if (f && p.value) {
|
|
8696
8716
|
let e = {
|
|
8697
8717
|
el: p.value,
|
|
8698
8718
|
disabled: a.disabled
|
|
8699
8719
|
};
|
|
8700
|
-
|
|
8720
|
+
T = f.register(e), U(() => a.disabled, (t) => {
|
|
8701
8721
|
e.disabled = t;
|
|
8702
8722
|
});
|
|
8703
8723
|
}
|
|
8704
8724
|
}), S(() => {
|
|
8705
|
-
|
|
8725
|
+
T?.();
|
|
8706
8726
|
});
|
|
8707
|
-
let
|
|
8708
|
-
function
|
|
8727
|
+
let E = r(() => a.disabled ? -1 : f ? f.items.value.findIndex((e) => e.el === p.value) === f.activeIndex.value ? 0 : -1 : 0);
|
|
8728
|
+
function D(e) {
|
|
8709
8729
|
return e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
|
|
8710
8730
|
}
|
|
8711
|
-
function
|
|
8731
|
+
function k(e) {
|
|
8712
8732
|
let t = !0;
|
|
8713
8733
|
return c("clicked", {
|
|
8714
8734
|
event: e,
|
|
@@ -8717,30 +8737,30 @@ var wu = {
|
|
|
8717
8737
|
}
|
|
8718
8738
|
}), { shouldClose: t };
|
|
8719
8739
|
}
|
|
8720
|
-
function
|
|
8740
|
+
function M(e) {
|
|
8721
8741
|
if (a.disabled) {
|
|
8722
8742
|
e.preventDefault(), e.stopPropagation();
|
|
8723
8743
|
return;
|
|
8724
8744
|
}
|
|
8725
8745
|
e.stopPropagation();
|
|
8726
|
-
let { shouldClose: t } =
|
|
8746
|
+
let { shouldClose: t } = k(e);
|
|
8727
8747
|
t && d && queueMicrotask(() => d());
|
|
8728
8748
|
}
|
|
8729
|
-
function
|
|
8749
|
+
function N(e, t) {
|
|
8730
8750
|
if (a.disabled) {
|
|
8731
8751
|
e.preventDefault(), e.stopPropagation();
|
|
8732
8752
|
return;
|
|
8733
8753
|
}
|
|
8734
|
-
let n =
|
|
8754
|
+
let n = D(e), { shouldClose: r } = k(e);
|
|
8735
8755
|
!n && t && t(e), r && d && !n && queueMicrotask(() => d());
|
|
8736
8756
|
}
|
|
8737
|
-
function
|
|
8757
|
+
function F(e) {
|
|
8738
8758
|
if (e.key !== "Enter" && e.key !== " " || a.disabled || v.value && e.key === "Enter") return;
|
|
8739
8759
|
if (e.preventDefault(), v.value && p.value) {
|
|
8740
8760
|
p.value.click();
|
|
8741
8761
|
return;
|
|
8742
8762
|
}
|
|
8743
|
-
let { shouldClose: t } =
|
|
8763
|
+
let { shouldClose: t } = k(new MouseEvent("click"));
|
|
8744
8764
|
t && d && queueMicrotask(() => d());
|
|
8745
8765
|
}
|
|
8746
8766
|
return (n, r) => v.value && L(g) ? (w(), i(j(L(h)), {
|
|
@@ -8748,16 +8768,17 @@ var wu = {
|
|
|
8748
8768
|
to: t.to,
|
|
8749
8769
|
custom: ""
|
|
8750
8770
|
}, {
|
|
8751
|
-
default: G(({ href: t,
|
|
8771
|
+
default: G(({ href: t, isActive: r, navigate: i }) => [s("a", {
|
|
8752
8772
|
ref_key: "itemRef",
|
|
8753
8773
|
ref: p,
|
|
8754
8774
|
role: "menuitem",
|
|
8755
8775
|
href: t,
|
|
8756
|
-
class: y(["coar-menu-item",
|
|
8776
|
+
class: y(["coar-menu-item", b(r)]),
|
|
8757
8777
|
"aria-disabled": a.disabled || void 0,
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8778
|
+
"aria-current": x(r),
|
|
8779
|
+
tabindex: E.value,
|
|
8780
|
+
onClick: (e) => N(e, i),
|
|
8781
|
+
onKeydown: F
|
|
8761
8782
|
}, [s("span", ku, [u(Z, {
|
|
8762
8783
|
name: a.icon || "square-dashed",
|
|
8763
8784
|
size: "s"
|
|
@@ -8769,11 +8790,12 @@ var wu = {
|
|
|
8769
8790
|
ref: p,
|
|
8770
8791
|
role: "menuitem",
|
|
8771
8792
|
href: String(t.to),
|
|
8772
|
-
class: y(["coar-menu-item",
|
|
8793
|
+
class: y(["coar-menu-item", b(!1)]),
|
|
8773
8794
|
"aria-disabled": a.disabled || void 0,
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8795
|
+
"aria-current": x(!1),
|
|
8796
|
+
tabindex: E.value,
|
|
8797
|
+
onClick: N,
|
|
8798
|
+
onKeydown: F
|
|
8777
8799
|
}, [s("span", Mu, [u(Z, {
|
|
8778
8800
|
name: a.icon || "square-dashed",
|
|
8779
8801
|
size: "s"
|
|
@@ -8782,17 +8804,18 @@ var wu = {
|
|
|
8782
8804
|
ref_key: "itemRef",
|
|
8783
8805
|
ref: p,
|
|
8784
8806
|
role: "menuitem",
|
|
8785
|
-
class: y(["coar-menu-item",
|
|
8807
|
+
class: y(["coar-menu-item", b(!1)]),
|
|
8786
8808
|
"aria-disabled": a.disabled || void 0,
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8809
|
+
"aria-current": x(!1),
|
|
8810
|
+
tabindex: E.value,
|
|
8811
|
+
onClick: M,
|
|
8812
|
+
onKeydown: F
|
|
8790
8813
|
}, [s("span", Fu, [u(Z, {
|
|
8791
8814
|
name: a.icon || "square-dashed",
|
|
8792
8815
|
size: "s"
|
|
8793
8816
|
}, null, 8, ["name"])]), s("span", Iu, [a.label ? (w(), o(e, { key: 0 }, [l(P(a.label), 1)], 64)) : A(n.$slots, "default", { key: 1 }, void 0, !0)])], 42, Pu));
|
|
8794
8817
|
}
|
|
8795
|
-
}), [["__scopeId", "data-v-
|
|
8818
|
+
}), [["__scopeId", "data-v-8edc345f"]]), Ru = {}, zu = {
|
|
8796
8819
|
role: "separator",
|
|
8797
8820
|
class: "coar-menu-divider"
|
|
8798
8821
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocoar/vue-ui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Cocoar Design System — a touch-first Vue 3 component library with 30+ accessible, themeable components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typecheck": "vue-tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cocoar/vue-localization": "2.2.
|
|
52
|
+
"@cocoar/vue-localization": "2.2.1",
|
|
53
53
|
"@fontsource/cascadia-code": "^5.2.3",
|
|
54
54
|
"@fontsource/inter": "^5.2.8",
|
|
55
55
|
"@fontsource/poppins": "^5.2.7",
|