@kiva/kv-components 6.50.1 → 6.50.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.
|
@@ -65,7 +65,7 @@ function x(e, o, n, r, i, s) {
|
|
|
65
65
|
const a = c("KvMaterialIcon");
|
|
66
66
|
return m(), f("a", {
|
|
67
67
|
ref: n.refName,
|
|
68
|
-
class: l(["tw-no-underline hover:tw-no-underline tw-text-primary hover:tw-text-action tw-items-center tw-
|
|
68
|
+
class: l(["tw-py-1 tw-no-underline hover:tw-no-underline tw-text-primary hover:tw-text-action tw-items-center tw-cursor-pointer", r.computedClass]),
|
|
69
69
|
href: n.href,
|
|
70
70
|
onMouseover: o[0] || (o[0] = (...t) => r.handleMouseOver && r.handleMouseOver(...t))
|
|
71
71
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-link[data-v-
|
|
1
|
+
.header-link[data-v-80235e01]{cursor:pointer;padding-top:1rem;padding-bottom:1rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-80235e01]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineAsyncComponent as k, ref as l, computed as P, onMounted as z, onUnmounted as W, resolveComponent as
|
|
1
|
+
import { defineAsyncComponent as k, ref as l, computed as P, onMounted as z, onUnmounted as W, resolveComponent as b, resolveDirective as j, openBlock as i, createElementBlock as c, withDirectives as d, normalizeClass as g, createVNode as U, createBlock as h, withCtx as T, createTextVNode as w, createElementVNode as N, createCommentVNode as M, toDisplayString as F } from "vue";
|
|
2
2
|
import { mdiAccountCircle as q, mdiChevronDown as G, mdiMagnify as J, mdiMenu as Q } from "@mdi/js";
|
|
3
3
|
import X from "numeral";
|
|
4
4
|
import Y from "../KvMaterialIcon.js";
|
|
@@ -8,7 +8,7 @@ import ee from "../KvUserAvatar.js";
|
|
|
8
8
|
import { throttle as ne } from "../../utils/throttle.js";
|
|
9
9
|
import "./KvHeaderLinkBar.css";
|
|
10
10
|
import te from "../../_virtual/_plugin-vue_export-helper.js";
|
|
11
|
-
const oe = k(() => import("./KvHeaderMobileMenu.js")),
|
|
11
|
+
const oe = k(() => import("./KvHeaderMobileMenu.js")), D = k(() => import("./KvHeaderMyKivaMenu.js")), re = k(() => import("./LendMenu/KvLendMenu.js")), le = k(() => import("./KvHeaderTakeActionMenu.js")), ie = k(() => import("./KvHeaderAboutMenu.js")), C = 118, p = "avatar-menu", ae = {
|
|
12
12
|
components: {
|
|
13
13
|
KvMaterialIcon: Y,
|
|
14
14
|
KvIconBag: Z,
|
|
@@ -57,35 +57,37 @@ const oe = k(() => import("./KvHeaderMobileMenu.js")), O = k(() => import("./KvH
|
|
|
57
57
|
"item-hover"
|
|
58
58
|
],
|
|
59
59
|
setup(u, { emit: e }) {
|
|
60
|
-
const t = l(null), n = l(null), x = l(null), K = l(null),
|
|
61
|
-
e("item-hover", r,
|
|
62
|
-
}, _ = (r,
|
|
63
|
-
u.isMobile || m(r,
|
|
60
|
+
const t = l(null), n = l(null), x = l(null), K = l(null), y = l(null), f = l(null), A = l(null), H = l(null), a = l(null), o = l(null), m = (r, s, v = null) => {
|
|
61
|
+
e("item-hover", r, s, v);
|
|
62
|
+
}, _ = (r, s, v = null) => {
|
|
63
|
+
u.isMobile || m(r, s, v);
|
|
64
64
|
}, S = (r) => {
|
|
65
65
|
o.value === r && (o.value = null, m());
|
|
66
66
|
}, E = () => {
|
|
67
|
-
var B,
|
|
68
|
-
const r = (
|
|
67
|
+
var B, O;
|
|
68
|
+
const r = (O = (B = t.value) == null ? void 0 : B.userAvatar) == null ? void 0 : O.getBoundingClientRect();
|
|
69
69
|
if (!r) return null;
|
|
70
|
-
const
|
|
70
|
+
const v = r.left + r.width / 2 - C / 2;
|
|
71
71
|
return {
|
|
72
|
-
...
|
|
72
|
+
...v + C > window.outerWidth ? { right: 0 } : { left: u.isMobile ? 0 : `${v}px` },
|
|
73
|
+
marginTop: "-2px",
|
|
74
|
+
// Avoid closing avatar menu on header edge
|
|
73
75
|
borderRadius: u.isMobile ? "auto" : "0px 0px 8px 8px",
|
|
74
76
|
width: u.isMobile ? "100%" : "auto"
|
|
75
77
|
};
|
|
76
78
|
}, I = () => {
|
|
77
|
-
o.value =
|
|
78
|
-
}, V = (r,
|
|
79
|
-
!o.value || o.value !== r ? (o.value = r, r ===
|
|
79
|
+
o.value = p, m(t.value, D, E());
|
|
80
|
+
}, V = (r, s) => {
|
|
81
|
+
!o.value || o.value !== r ? (o.value = r, r === p ? I() : m(r, s)) : (o.value = null, m());
|
|
80
82
|
}, L = ne(() => {
|
|
81
|
-
o.value ===
|
|
83
|
+
o.value === p && I();
|
|
82
84
|
}, 50), R = P(() => u.isMobile ? void 0 : "/lend-by-category");
|
|
83
85
|
return z(() => {
|
|
84
86
|
import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", L);
|
|
85
87
|
}), W(() => {
|
|
86
88
|
window.removeEventListener("resize", L);
|
|
87
89
|
}), {
|
|
88
|
-
AVATAR_MENU_ID:
|
|
90
|
+
AVATAR_MENU_ID: p,
|
|
89
91
|
openMenuId: o,
|
|
90
92
|
numeral: X,
|
|
91
93
|
mdiAccountCircle: q,
|
|
@@ -97,7 +99,7 @@ const oe = k(() => import("./KvHeaderMobileMenu.js")), O = k(() => import("./KvH
|
|
|
97
99
|
lendButton: n,
|
|
98
100
|
aboutUsLink: x,
|
|
99
101
|
partnerWithUsLink: K,
|
|
100
|
-
borrowLink:
|
|
102
|
+
borrowLink: y,
|
|
101
103
|
supportKivaLink: f,
|
|
102
104
|
basketLink: A,
|
|
103
105
|
signInLink: H,
|
|
@@ -108,7 +110,7 @@ const oe = k(() => import("./KvHeaderMobileMenu.js")), O = k(() => import("./KvH
|
|
|
108
110
|
handleMouseOut: S,
|
|
109
111
|
handleAvatarMenuPosition: I,
|
|
110
112
|
KvHeaderMobileMenu: oe,
|
|
111
|
-
KvHeaderMyKivaMenu:
|
|
113
|
+
KvHeaderMyKivaMenu: D,
|
|
112
114
|
KvLendMenu: re,
|
|
113
115
|
KvHeaderTakeActionMenu: le,
|
|
114
116
|
KvHeaderAboutMenu: ie
|
|
@@ -117,31 +119,30 @@ const oe = k(() => import("./KvHeaderMobileMenu.js")), O = k(() => import("./KvH
|
|
|
117
119
|
}, de = { class: "tw-h-full tw-flex tw-items-center tw-gap-2.5" }, ue = ["href"], me = {
|
|
118
120
|
key: 0,
|
|
119
121
|
class: "tw-bg-eco-green-1 tw-py-0.5 tw-px-1 tw-text-eco-green-4"
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
const
|
|
122
|
+
}, se = ["href"];
|
|
123
|
+
function ve(u, e, t, n, x, K) {
|
|
124
|
+
const y = b("kv-material-icon"), f = b("KvHeaderDropdownLink"), A = b("kv-icon-bag"), H = b("KvUserAvatar"), a = j("kv-track-event");
|
|
123
125
|
return i(), c("div", de, [
|
|
124
126
|
d((i(), c("button", {
|
|
125
127
|
ref: "menuButton",
|
|
126
|
-
class:
|
|
128
|
+
class: g(["header-link tw-inline-flex lg:tw-hidden", {
|
|
127
129
|
"tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvHeaderMobileMenu
|
|
128
130
|
}]),
|
|
129
131
|
onMouseover: e[0] || (e[0] = (o) => n.handleOnHover(n.menuButton, n.KvHeaderMobileMenu)),
|
|
130
132
|
onMouseout: e[1] || (e[1] = (o) => n.handleMouseOut("menuButton")),
|
|
131
133
|
onTouchstart: e[2] || (e[2] = (o) => n.handleTouchStart("menuButton", n.KvHeaderMobileMenu))
|
|
132
134
|
}, [
|
|
133
|
-
U(
|
|
135
|
+
U(y, { icon: n.mdiMenu }, null, 8, ["icon"])
|
|
134
136
|
], 34)), [
|
|
135
137
|
[a, t.openMenuItem === n.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
|
|
136
138
|
]),
|
|
137
139
|
d((i(), h(f, {
|
|
138
|
-
class: "tw-border tw-rounded-md tw-px-1.5 tw-py-1",
|
|
139
140
|
"ref-name": "lendButton",
|
|
140
141
|
href: n.lendUrl,
|
|
141
142
|
"menu-component": n.KvLendMenu,
|
|
142
143
|
"open-menu-item": t.openMenuItem,
|
|
143
144
|
"dropdown-icon": n.mdiChevronDown,
|
|
144
|
-
"base-class": "tw-inline-flex",
|
|
145
|
+
"base-class": "tw-inline-flex tw-border tw-rounded-md tw-px-1.5 tw-py-1",
|
|
145
146
|
onOnHover: n.handleOnHover,
|
|
146
147
|
onMouseout: e[3] || (e[3] = (o) => n.handleMouseOut("lendButton")),
|
|
147
148
|
onTouchstart: e[4] || (e[4] = (o) => n.handleTouchStart("lendButton", n.KvLendMenu))
|
|
@@ -160,8 +161,8 @@ function se(u, e, t, n, x, K) {
|
|
|
160
161
|
"open-menu-item": t.openMenuItem,
|
|
161
162
|
"dropdown-icon": n.mdiChevronDown,
|
|
162
163
|
"send-link-position": "",
|
|
163
|
-
onOnHover: n.
|
|
164
|
-
onMouseout: e[5] || (e[5] = (o) => n.
|
|
164
|
+
onOnHover: n.handleOnHover,
|
|
165
|
+
onMouseout: e[5] || (e[5] = (o) => n.handleMouseOut("takeActionButton"))
|
|
165
166
|
}, {
|
|
166
167
|
default: T(() => e[11] || (e[11] = [
|
|
167
168
|
w(" Take action ")
|
|
@@ -172,13 +173,14 @@ function se(u, e, t, n, x, K) {
|
|
|
172
173
|
]),
|
|
173
174
|
d((i(), h(f, {
|
|
174
175
|
"ref-name": "aboutUsLink",
|
|
176
|
+
"test-id": "header-about",
|
|
175
177
|
"base-class": "tw-hidden lg:tw-inline-flex tw-py-2",
|
|
176
178
|
"menu-component": n.KvHeaderAboutMenu,
|
|
177
179
|
"open-menu-item": t.openMenuItem,
|
|
178
180
|
"dropdown-icon": n.mdiChevronDown,
|
|
179
181
|
"send-link-position": "",
|
|
180
|
-
onOnHover: n.
|
|
181
|
-
onMouseout: e[6] || (e[6] = (o) => n.
|
|
182
|
+
onOnHover: n.handleOnHover,
|
|
183
|
+
onMouseout: e[6] || (e[6] = (o) => n.handleMouseOut("aboutUsLink"))
|
|
182
184
|
}, {
|
|
183
185
|
default: T(() => e[12] || (e[12] = [
|
|
184
186
|
w(" About ")
|
|
@@ -187,12 +189,12 @@ function se(u, e, t, n, x, K) {
|
|
|
187
189
|
}, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
|
|
188
190
|
[a, ["TopNav", "click-About"]]
|
|
189
191
|
]),
|
|
190
|
-
e[15] || (e[15] =
|
|
192
|
+
e[15] || (e[15] = N("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
|
|
191
193
|
t.loggedIn ? d((i(), c("a", {
|
|
192
194
|
key: 0,
|
|
193
195
|
ref: "dashboardLink",
|
|
194
196
|
href: t.myDashboardUrl,
|
|
195
|
-
class:
|
|
197
|
+
class: g(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
196
198
|
}, e[13] || (e[13] = [
|
|
197
199
|
w(" My dashboard ")
|
|
198
200
|
]), 10, ue)), [
|
|
@@ -202,7 +204,8 @@ function se(u, e, t, n, x, K) {
|
|
|
202
204
|
key: 1,
|
|
203
205
|
ref: "basketLink",
|
|
204
206
|
href: "/basket",
|
|
205
|
-
class:
|
|
207
|
+
class: g(["header-link tw-relative", { "tw-text-tertiary": !!t.openMenuItem }]),
|
|
208
|
+
"test-id": "header-basket"
|
|
206
209
|
}, [
|
|
207
210
|
U(A, {
|
|
208
211
|
class: "tw-w-3 tw-h-3 tw-pointer-events-none",
|
|
@@ -211,7 +214,7 @@ function se(u, e, t, n, x, K) {
|
|
|
211
214
|
], 2)), [
|
|
212
215
|
[a, ["TopNav", "click-Basket"]]
|
|
213
216
|
]) : M("", !0),
|
|
214
|
-
|
|
217
|
+
N("div", {
|
|
215
218
|
class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-py-1.5",
|
|
216
219
|
onMouseover: e[7] || (e[7] = (...o) => n.handleAvatarMenuPosition && n.handleAvatarMenuPosition(...o)),
|
|
217
220
|
onMouseout: e[8] || (e[8] = (o) => n.handleMouseOut(n.AVATAR_MENU_ID)),
|
|
@@ -230,15 +233,15 @@ function se(u, e, t, n, x, K) {
|
|
|
230
233
|
key: 2,
|
|
231
234
|
ref: "signInLink",
|
|
232
235
|
href: t.loginUrl,
|
|
233
|
-
class:
|
|
236
|
+
class: g(["header-link", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
234
237
|
}, e[14] || (e[14] = [
|
|
235
238
|
w(" Sign in ")
|
|
236
|
-
]), 10,
|
|
239
|
+
]), 10, se)), [
|
|
237
240
|
[a, ["TopNav", "click-Sign-in"]]
|
|
238
241
|
])
|
|
239
242
|
]);
|
|
240
243
|
}
|
|
241
|
-
const He = /* @__PURE__ */ te(ae, [["render",
|
|
244
|
+
const He = /* @__PURE__ */ te(ae, [["render", ve], ["__scopeId", "data-v-80235e01"]]);
|
|
242
245
|
export {
|
|
243
246
|
He as default
|
|
244
247
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.50.
|
|
3
|
+
"version": "6.50.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"embla-carousel-fade",
|
|
114
114
|
"popper.js"
|
|
115
115
|
],
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "5f2b1403458069ec1143a4e8fd917c9f7cff2ac1"
|
|
117
117
|
}
|