@kiva/kv-components 7.2.1 → 7.2.2
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/vue/KvUtilityMenu.js +42 -21
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as r, onMounted as f, onBeforeUnmount as g, resolveComponent as h, resolveDirective as y, openBlock as s, createElementBlock as d, normalizeClass as u, withDirectives as m, withModifiers as b, createVNode as k, createElementVNode as S, normalizeStyle as C, renderSlot as M, vShow as z } from "vue";
|
|
2
2
|
import { mdiDotsVertical as w } from "@mdi/js";
|
|
3
3
|
import _ from "./KvMaterialIcon.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import B from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const p = {
|
|
6
6
|
name: "KvUtilityMenu",
|
|
7
7
|
components: {
|
|
8
8
|
KvMaterialIcon: _
|
|
@@ -22,11 +22,12 @@ const A = {
|
|
|
22
22
|
},
|
|
23
23
|
buttonSize: {
|
|
24
24
|
type: String,
|
|
25
|
-
default: "
|
|
25
|
+
default: "large",
|
|
26
26
|
validator(n) {
|
|
27
27
|
return [
|
|
28
28
|
"small",
|
|
29
|
-
"medium"
|
|
29
|
+
"medium",
|
|
30
|
+
"large"
|
|
30
31
|
].includes(n);
|
|
31
32
|
}
|
|
32
33
|
},
|
|
@@ -34,6 +35,14 @@ const A = {
|
|
|
34
35
|
type: String,
|
|
35
36
|
default: w
|
|
36
37
|
},
|
|
38
|
+
menuBorderClass: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "tw-border tw-border-tertiary"
|
|
41
|
+
},
|
|
42
|
+
menuRadiusClass: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "tw-rounded"
|
|
45
|
+
},
|
|
37
46
|
menuPosition: {
|
|
38
47
|
type: String,
|
|
39
48
|
default: "left-aligned",
|
|
@@ -49,8 +58,8 @@ const A = {
|
|
|
49
58
|
"kv-utility-menu-clicked"
|
|
50
59
|
],
|
|
51
60
|
setup(n, { emit: i }) {
|
|
52
|
-
const t =
|
|
53
|
-
t.value && !t.value.contains(
|
|
61
|
+
const t = r(null), e = r(!1), c = r(null), l = (a) => {
|
|
62
|
+
t.value && !t.value.contains(a.target) && (e.value = !1);
|
|
54
63
|
}, o = () => {
|
|
55
64
|
e.value = !e.value, i("kv-utility-menu-clicked", { open: e.value });
|
|
56
65
|
};
|
|
@@ -68,11 +77,15 @@ const A = {
|
|
|
68
77
|
};
|
|
69
78
|
}
|
|
70
79
|
};
|
|
71
|
-
function
|
|
72
|
-
const o = h("KvMaterialIcon"),
|
|
80
|
+
function A(n, i, t, e, c, l) {
|
|
81
|
+
const o = h("KvMaterialIcon"), a = y("kv-track-event");
|
|
73
82
|
return s(), d("div", {
|
|
74
83
|
class: u(["tw-relative utility-menu-wrapper", [
|
|
75
|
-
|
|
84
|
+
{
|
|
85
|
+
"tw-w-4 tw-h-4": t.buttonSize === "small",
|
|
86
|
+
"tw-w-5 tw-h-5": t.buttonSize === "medium",
|
|
87
|
+
"tw-w-6 tw-h-6": t.buttonSize === "large"
|
|
88
|
+
}
|
|
76
89
|
]])
|
|
77
90
|
}, [
|
|
78
91
|
m((s(), d("button", {
|
|
@@ -80,28 +93,36 @@ function B(n, i, t, e, c, l) {
|
|
|
80
93
|
class: u(["tw-absolute tw-bg-white tw-flex tw-items-center tw-justify-center menu-trigger", [
|
|
81
94
|
t.buttonBorderClass,
|
|
82
95
|
t.buttonRadiusClass,
|
|
83
|
-
|
|
96
|
+
{
|
|
97
|
+
"tw-w-4 tw-h-4": t.buttonSize === "small",
|
|
98
|
+
"tw-w-5 tw-h-5": t.buttonSize === "medium",
|
|
99
|
+
"tw-w-6 tw-h-6": t.buttonSize === "large"
|
|
100
|
+
}
|
|
84
101
|
]]),
|
|
85
|
-
onClick: i[0] || (i[0] =
|
|
102
|
+
onClick: i[0] || (i[0] = b((...v) => e.handleMenuAnchorClick && e.handleMenuAnchorClick(...v), ["stop"]))
|
|
86
103
|
}, [
|
|
87
|
-
|
|
104
|
+
k(o, { icon: t.icon }, null, 8, ["icon"])
|
|
88
105
|
], 2)), [
|
|
89
|
-
[
|
|
106
|
+
[a, [t.analyticsCategory, "click", "utility-menu"]]
|
|
90
107
|
]),
|
|
91
|
-
m(
|
|
108
|
+
m(S("div", {
|
|
92
109
|
ref: "optionsMenu",
|
|
93
|
-
class: u(["tw-absolute tw-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
class: u(["tw-absolute tw-bg-white tw-z-1 tw-shadow-lg vertical-menu", [
|
|
111
|
+
t.menuBorderClass,
|
|
112
|
+
t.menuRadiusClass,
|
|
113
|
+
{
|
|
114
|
+
"tw-right-0": t.menuPosition === "right-aligned"
|
|
115
|
+
}
|
|
116
|
+
]]),
|
|
96
117
|
style: C(`width: 236px; top: ${t.buttonSize === "small" ? "2.5rem" : "3.5rem"};`)
|
|
97
118
|
}, [
|
|
98
119
|
M(n.$slots, "default")
|
|
99
120
|
], 6), [
|
|
100
|
-
[
|
|
121
|
+
[z, e.menuOpen]
|
|
101
122
|
])
|
|
102
123
|
], 2);
|
|
103
124
|
}
|
|
104
|
-
const
|
|
125
|
+
const D = /* @__PURE__ */ B(p, [["render", A]]);
|
|
105
126
|
export {
|
|
106
|
-
|
|
127
|
+
D as default
|
|
107
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"embla-carousel-fade",
|
|
115
115
|
"popper.js"
|
|
116
116
|
],
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "a1f47f0b2511bbed3305b181a8e139e175657237"
|
|
118
118
|
}
|