@kiva/kv-components 6.59.2 → 6.59.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-link[data-v-
|
|
1
|
+
.header-link[data-v-d33b2f4e]{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-d33b2f4e]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}[data-v-d33b2f4e] .avatar div:first-child{display:flex}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineAsyncComponent as k, ref as r, computed as x, watch as
|
|
2
|
-
import { mdiAccountCircle as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { throttle as
|
|
9
|
-
import { isLegacyPlaceholderAvatar as
|
|
1
|
+
import { defineAsyncComponent as k, ref as r, inject as Y, computed as x, watch as C, onMounted as Z, onUnmounted as $, resolveComponent as b, resolveDirective as ee, openBlock as i, createElementBlock as w, withDirectives as s, normalizeClass as p, withModifiers as H, createVNode as L, createBlock as y, withCtx as U, createTextVNode as f, createElementVNode as T, createCommentVNode as _, vShow as P, toDisplayString as ne } from "vue";
|
|
2
|
+
import { mdiAccountCircle as te, mdiChevronDown as oe, mdiMagnify as ae, mdiMenu as le } from "@mdi/js";
|
|
3
|
+
import re from "numeral";
|
|
4
|
+
import ie from "../KvMaterialIcon.js";
|
|
5
|
+
import de from "../KvIconBag.js";
|
|
6
|
+
import ue from "./KvHeaderDropdownLink.js";
|
|
7
|
+
import me from "../KvUserAvatar.js";
|
|
8
|
+
import { throttle as ve } from "../../utils/throttle.js";
|
|
9
|
+
import { isLegacyPlaceholderAvatar as se } from "../../utils/imageUtils.js";
|
|
10
10
|
import "./KvHeaderLinkBar.css";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import ce from "../../_virtual/_plugin-vue_export-helper.js";
|
|
12
|
+
const we = k(() => import("./KvHeaderMobileMenu.js")), V = k(() => import("./KvHeaderMyKivaMenu.js")), fe = k(() => import("./LendMenu/KvLendMenu.js")), Me = k(() => import("./KvHeaderTakeActionMenu.js")), ke = k(() => import("./KvHeaderAboutMenu.js")), B = 120, M = "avatar-menu", K = "menuButton", R = { top: "-3.75rem", width: "100%" }, F = "lendButton", ge = {
|
|
13
13
|
components: {
|
|
14
|
-
KvMaterialIcon:
|
|
15
|
-
KvIconBag:
|
|
16
|
-
KvHeaderDropdownLink:
|
|
17
|
-
KvUserAvatar:
|
|
14
|
+
KvMaterialIcon: ie,
|
|
15
|
+
KvIconBag: de,
|
|
16
|
+
KvHeaderDropdownLink: ue,
|
|
17
|
+
KvUserAvatar: me
|
|
18
18
|
},
|
|
19
19
|
props: {
|
|
20
20
|
loggedIn: {
|
|
@@ -58,97 +58,101 @@ const se = k(() => import("./KvHeaderMobileMenu.js")), V = k(() => import("./KvH
|
|
|
58
58
|
"item-hover"
|
|
59
59
|
],
|
|
60
60
|
setup(l, { emit: n }) {
|
|
61
|
-
const a = r(null), e = r(null),
|
|
62
|
-
n("item-hover", o,
|
|
63
|
-
},
|
|
61
|
+
const a = r(null), e = r(null), N = r(null), O = r(null), g = r(null), c = r(null), A = r(null), I = r(null), d = r(null), t = r(null), z = Y("$kvTrackEvent"), u = (o, v, m = null) => {
|
|
62
|
+
n("item-hover", o, v, m);
|
|
63
|
+
}, W = (o, v, m = null) => {
|
|
64
64
|
navigator.maxTouchPoints || (t.value = o, u(
|
|
65
65
|
o,
|
|
66
|
-
|
|
66
|
+
v,
|
|
67
67
|
o === K && l.isMobile ? R : m
|
|
68
68
|
));
|
|
69
|
-
},
|
|
69
|
+
}, j = (o) => {
|
|
70
70
|
!navigator.maxTouchPoints && t.value === o && (t.value = null, u());
|
|
71
|
-
},
|
|
72
|
-
var
|
|
73
|
-
const o = (
|
|
71
|
+
}, E = () => {
|
|
72
|
+
var S;
|
|
73
|
+
const o = (S = a.value) == null ? void 0 : S.getBoundingClientRect();
|
|
74
74
|
if (!o) return null;
|
|
75
|
-
const m = o.left + o.width / 2 -
|
|
75
|
+
const m = o.left + o.width / 2 - B / 2;
|
|
76
76
|
return {
|
|
77
|
-
...m +
|
|
77
|
+
...m + B > window.innerWidth ? { right: 0 } : { left: l.isMobile ? 0 : `${m}px` },
|
|
78
78
|
marginTop: "-2px",
|
|
79
79
|
// Avoid closing avatar menu on header edge
|
|
80
80
|
borderRadius: l.isMobile ? "auto" : "0px 0px 8px 8px",
|
|
81
|
-
width: l.isMobile ? "100%" : `${
|
|
81
|
+
width: l.isMobile ? "100%" : `${B}px`
|
|
82
82
|
};
|
|
83
83
|
}, h = () => {
|
|
84
|
-
t.value = M, u(a.value, V,
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
t.value = M, u(a.value, V, E());
|
|
85
|
+
}, q = (o, v, m) => {
|
|
86
|
+
o === F && t.value !== F && z(
|
|
87
|
+
"TopNav",
|
|
88
|
+
"hover-Lend-menu",
|
|
89
|
+
"Lend"
|
|
90
|
+
), t.value === K && (t.value = null), !t.value || t.value !== o ? (t.value = o, o === M ? h() : o === K && l.isMobile ? u(o, v, R) : u(o, v, m)) : (t.value = null, u());
|
|
91
|
+
}, D = ve(() => {
|
|
88
92
|
t.value === M && h();
|
|
89
|
-
}, 100),
|
|
93
|
+
}, 100), G = x(() => l.isMobile ? void 0 : "/lend-by-category"), J = x(() => {
|
|
90
94
|
var o;
|
|
91
95
|
return ((o = l.lenderImageUrl) == null ? void 0 : o.split("/").pop()) ?? "";
|
|
92
|
-
}),
|
|
96
|
+
}), Q = x(() => Math.floor(l.balance)), X = (o) => {
|
|
93
97
|
o.target === o.currentTarget && u();
|
|
94
98
|
};
|
|
95
|
-
return
|
|
99
|
+
return C(
|
|
96
100
|
() => l.isMobile,
|
|
97
101
|
() => {
|
|
98
102
|
t.value === M && h();
|
|
99
103
|
}
|
|
100
|
-
),
|
|
104
|
+
), C(
|
|
101
105
|
() => l.openMenuItem,
|
|
102
106
|
(o) => {
|
|
103
107
|
o || (t.value = null);
|
|
104
108
|
}
|
|
105
|
-
),
|
|
106
|
-
import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize",
|
|
107
|
-
}),
|
|
108
|
-
window.removeEventListener("resize",
|
|
109
|
+
), Z(() => {
|
|
110
|
+
import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", D);
|
|
111
|
+
}), $(() => {
|
|
112
|
+
window.removeEventListener("resize", D);
|
|
109
113
|
}), {
|
|
110
114
|
AVATAR_MENU_ID: M,
|
|
111
115
|
openMenuId: t,
|
|
112
|
-
numeral:
|
|
113
|
-
mdiAccountCircle:
|
|
114
|
-
mdiChevronDown:
|
|
115
|
-
mdiMagnify:
|
|
116
|
-
mdiMenu:
|
|
116
|
+
numeral: re,
|
|
117
|
+
mdiAccountCircle: te,
|
|
118
|
+
mdiChevronDown: oe,
|
|
119
|
+
mdiMagnify: ae,
|
|
120
|
+
mdiMenu: le,
|
|
117
121
|
onHover: u,
|
|
118
122
|
avatar: a,
|
|
119
123
|
lendButton: e,
|
|
120
|
-
aboutUsLink:
|
|
121
|
-
partnerWithUsLink:
|
|
124
|
+
aboutUsLink: N,
|
|
125
|
+
partnerWithUsLink: O,
|
|
122
126
|
borrowLink: g,
|
|
123
127
|
supportKivaLink: c,
|
|
124
128
|
basketLink: A,
|
|
125
129
|
signInLink: I,
|
|
126
130
|
menuButton: d,
|
|
127
|
-
lendUrl:
|
|
128
|
-
avatarFilename:
|
|
129
|
-
handleOnHover:
|
|
130
|
-
handleTouchStart:
|
|
131
|
-
handleMouseOut:
|
|
131
|
+
lendUrl: G,
|
|
132
|
+
avatarFilename: J,
|
|
133
|
+
handleOnHover: W,
|
|
134
|
+
handleTouchStart: q,
|
|
135
|
+
handleMouseOut: j,
|
|
132
136
|
handleAvatarMenuPosition: h,
|
|
133
|
-
KvHeaderMobileMenu:
|
|
137
|
+
KvHeaderMobileMenu: we,
|
|
134
138
|
KvHeaderMyKivaMenu: V,
|
|
135
|
-
KvLendMenu:
|
|
136
|
-
KvHeaderTakeActionMenu:
|
|
137
|
-
KvHeaderAboutMenu:
|
|
138
|
-
isLegacyPlaceholderAvatar:
|
|
139
|
-
getAvatarMenuPosition:
|
|
140
|
-
handleEmptySpaceClick:
|
|
141
|
-
roundedBalance:
|
|
139
|
+
KvLendMenu: fe,
|
|
140
|
+
KvHeaderTakeActionMenu: Me,
|
|
141
|
+
KvHeaderAboutMenu: ke,
|
|
142
|
+
isLegacyPlaceholderAvatar: se,
|
|
143
|
+
getAvatarMenuPosition: E,
|
|
144
|
+
handleEmptySpaceClick: X,
|
|
145
|
+
roundedBalance: Q
|
|
142
146
|
};
|
|
143
147
|
}
|
|
144
|
-
},
|
|
145
|
-
function
|
|
146
|
-
const g = b("kv-material-icon"), c = b("KvHeaderDropdownLink"), A = b("kv-icon-bag"), I = b("KvUserAvatar"), d =
|
|
148
|
+
}, he = ["href"], be = { class: "tw-text-eco-green-4" }, pe = ["href"];
|
|
149
|
+
function ye(l, n, a, e, N, O) {
|
|
150
|
+
const g = b("kv-material-icon"), c = b("KvHeaderDropdownLink"), A = b("kv-icon-bag"), I = b("KvUserAvatar"), d = ee("kv-track-event");
|
|
147
151
|
return i(), w("div", {
|
|
148
152
|
class: "tw-h-full tw-flex tw-items-center tw-gap-0.5 md:tw-gap-2 lg:tw-gap-2.5",
|
|
149
153
|
onTouchstart: n[10] || (n[10] = (...t) => e.handleEmptySpaceClick && e.handleEmptySpaceClick(...t))
|
|
150
154
|
}, [
|
|
151
|
-
|
|
155
|
+
s((i(), w("button", {
|
|
152
156
|
ref: "menuButton",
|
|
153
157
|
class: p(["header-link tw-inline-flex md:tw-hidden", {
|
|
154
158
|
"tw-text-tertiary": a.openMenuItem && a.openMenuItem !== e.KvHeaderMobileMenu
|
|
@@ -157,11 +161,11 @@ function he(l, n, a, e, O, N) {
|
|
|
157
161
|
onMouseout: n[1] || (n[1] = (t) => e.handleMouseOut("menuButton")),
|
|
158
162
|
onTouchstart: n[2] || (n[2] = H((t) => e.handleTouchStart("menuButton", e.KvHeaderMobileMenu), ["stop"]))
|
|
159
163
|
}, [
|
|
160
|
-
|
|
164
|
+
L(g, { icon: e.mdiMenu }, null, 8, ["icon"])
|
|
161
165
|
], 34)), [
|
|
162
166
|
[d, a.openMenuItem === e.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
|
|
163
167
|
]),
|
|
164
|
-
|
|
168
|
+
s((i(), y(c, {
|
|
165
169
|
class: "tw-py-1",
|
|
166
170
|
"ref-name": "lendButton",
|
|
167
171
|
href: e.lendUrl,
|
|
@@ -173,14 +177,14 @@ function he(l, n, a, e, O, N) {
|
|
|
173
177
|
onMouseout: n[3] || (n[3] = (t) => e.handleMouseOut("lendButton")),
|
|
174
178
|
onTouchstart: n[4] || (n[4] = H((t) => e.handleTouchStart("lendButton", e.KvLendMenu), ["stop"]))
|
|
175
179
|
}, {
|
|
176
|
-
default:
|
|
180
|
+
default: U(() => n[11] || (n[11] = [
|
|
177
181
|
f(" Lend ")
|
|
178
182
|
])),
|
|
179
183
|
_: 1
|
|
180
184
|
}, 8, ["href", "menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
|
|
181
185
|
[d, ["TopNav", "click-Lend"]]
|
|
182
186
|
]),
|
|
183
|
-
|
|
187
|
+
s((i(), y(c, {
|
|
184
188
|
"ref-name": "takeActionButton",
|
|
185
189
|
"base-class": "tw-hidden md:tw-inline-flex tw-py-1",
|
|
186
190
|
"menu-component": e.KvHeaderTakeActionMenu,
|
|
@@ -191,14 +195,14 @@ function he(l, n, a, e, O, N) {
|
|
|
191
195
|
onMouseout: n[5] || (n[5] = (t) => e.handleMouseOut("takeActionButton")),
|
|
192
196
|
onUserTap: e.handleTouchStart
|
|
193
197
|
}, {
|
|
194
|
-
default:
|
|
198
|
+
default: U(() => n[12] || (n[12] = [
|
|
195
199
|
f(" Take action ")
|
|
196
200
|
])),
|
|
197
201
|
_: 1
|
|
198
202
|
}, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"])), [
|
|
199
203
|
[d, ["TopNav", "click-take-action"]]
|
|
200
204
|
]),
|
|
201
|
-
|
|
205
|
+
L(c, {
|
|
202
206
|
"ref-name": "aboutUsLink",
|
|
203
207
|
"data-testid": "header-about",
|
|
204
208
|
"base-class": "tw-hidden md:tw-inline-flex tw-py-1",
|
|
@@ -210,30 +214,30 @@ function he(l, n, a, e, O, N) {
|
|
|
210
214
|
onMouseout: n[6] || (n[6] = (t) => e.handleMouseOut("aboutUsLink")),
|
|
211
215
|
onUserTap: e.handleTouchStart
|
|
212
216
|
}, {
|
|
213
|
-
default:
|
|
217
|
+
default: U(() => n[13] || (n[13] = [
|
|
214
218
|
f(" About ")
|
|
215
219
|
])),
|
|
216
220
|
_: 1
|
|
217
221
|
}, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"]),
|
|
218
222
|
n[17] || (n[17] = T("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
|
|
219
|
-
a.loggedIn ?
|
|
223
|
+
a.loggedIn ? s((i(), w("a", {
|
|
220
224
|
key: 0,
|
|
221
225
|
ref: "dashboardLink",
|
|
222
226
|
href: a.myDashboardUrl,
|
|
223
227
|
class: p(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!a.openMenuItem }])
|
|
224
228
|
}, n[14] || (n[14] = [
|
|
225
229
|
f(" My dashboard ")
|
|
226
|
-
]), 10,
|
|
230
|
+
]), 10, he)), [
|
|
227
231
|
[d, ["TopNav", "click-Dashboard"]]
|
|
228
232
|
]) : _("", !0),
|
|
229
|
-
|
|
233
|
+
s((i(), w("a", {
|
|
230
234
|
ref: "basketLink",
|
|
231
235
|
href: "/basket",
|
|
232
236
|
class: p(["header-link tw-relative md:!tw-mr-0 tw-flex tw-items-center tw-gap-0.5", { "tw-text-tertiary": !!a.openMenuItem }]),
|
|
233
237
|
style: { "margin-right": "2px" },
|
|
234
238
|
"data-testid": "header-basket"
|
|
235
239
|
}, [
|
|
236
|
-
|
|
240
|
+
L(A, {
|
|
237
241
|
class: "tw-w-3 tw-h-3 md:tw-w-3.5 md:tw-h-3.5 tw-pointer-events-none",
|
|
238
242
|
count: a.basketCount
|
|
239
243
|
}, null, 8, ["count"]),
|
|
@@ -242,7 +246,7 @@ function he(l, n, a, e, O, N) {
|
|
|
242
246
|
[P, a.basketCount > 0],
|
|
243
247
|
[d, ["TopNav", "click-Basket"]]
|
|
244
248
|
]),
|
|
245
|
-
|
|
249
|
+
s(T("div", {
|
|
246
250
|
ref: "avatar",
|
|
247
251
|
class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-bg-eco-green-1 tw-rounded-md tw-py-0.5 md:tw-py-1 tw-px-1 md:tw-px-2",
|
|
248
252
|
onMouseover: n[7] || (n[7] = (t) => e.handleOnHover(e.AVATAR_MENU_ID, e.KvHeaderMyKivaMenu, e.getAvatarMenuPosition())),
|
|
@@ -260,23 +264,23 @@ function he(l, n, a, e, O, N) {
|
|
|
260
264
|
"lender-image-url": a.lenderImageUrl,
|
|
261
265
|
"is-small": ""
|
|
262
266
|
}, null, 8, ["lender-name", "lender-image-url"])),
|
|
263
|
-
T("span",
|
|
267
|
+
T("span", be, ne(e.numeral(e.roundedBalance).format("$0")), 1)
|
|
264
268
|
], 544), [
|
|
265
269
|
[P, a.loggedIn]
|
|
266
270
|
]),
|
|
267
|
-
a.loggedIn ? _("", !0) :
|
|
271
|
+
a.loggedIn ? _("", !0) : s((i(), w("a", {
|
|
268
272
|
key: 1,
|
|
269
273
|
ref: "signInLink",
|
|
270
274
|
href: a.loginUrl,
|
|
271
275
|
class: p(["header-link", { "tw-text-tertiary": !!a.openMenuItem }])
|
|
272
276
|
}, n[16] || (n[16] = [
|
|
273
277
|
f(" Sign in ")
|
|
274
|
-
]), 10,
|
|
278
|
+
]), 10, pe)), [
|
|
275
279
|
[d, ["TopNav", "click-Sign-in"]]
|
|
276
280
|
])
|
|
277
281
|
], 32);
|
|
278
282
|
}
|
|
279
|
-
const
|
|
283
|
+
const De = /* @__PURE__ */ ce(ge, [["render", ye], ["__scopeId", "data-v-d33b2f4e"]]);
|
|
280
284
|
export {
|
|
281
|
-
|
|
285
|
+
De as default
|
|
282
286
|
};
|
|
@@ -24,7 +24,7 @@ const k = {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}, w = { class: "tw--mt-0.5 tw-pb-0.5 tw-flex tw-flex-col tw-items-start tw-font-medium tw-px-2.5" };
|
|
27
|
-
function y(c, o, n, b, T,
|
|
27
|
+
function y(c, o, n, b, T, N) {
|
|
28
28
|
const e = u("kv-header-menu-link"), r = m("kv-track-event");
|
|
29
29
|
return t(), p("nav", w, [
|
|
30
30
|
a((t(), i(e, {
|
|
@@ -52,7 +52,7 @@ function y(c, o, n, b, T, D) {
|
|
|
52
52
|
])),
|
|
53
53
|
_: 1
|
|
54
54
|
})), [
|
|
55
|
-
[r, ["TopNav", "click-Portfolio-My
|
|
55
|
+
[r, ["TopNav", "click-Portfolio-My teams"]]
|
|
56
56
|
]),
|
|
57
57
|
a((t(), i(e, { href: "/portfolio/donations" }, {
|
|
58
58
|
default: l(() => o[3] || (o[3] = [
|
|
@@ -79,7 +79,7 @@ function y(c, o, n, b, T, D) {
|
|
|
79
79
|
])),
|
|
80
80
|
_: 1
|
|
81
81
|
})), [
|
|
82
|
-
[r, ["TopNav", "click-Portfolio-My borrower
|
|
82
|
+
[r, ["TopNav", "click-Portfolio-My borrower dashboard"]]
|
|
83
83
|
]) : f("", !0),
|
|
84
84
|
n.isTrustee ? a((t(), i(e, {
|
|
85
85
|
key: 1,
|
|
@@ -90,7 +90,7 @@ function y(c, o, n, b, T, D) {
|
|
|
90
90
|
])),
|
|
91
91
|
_: 1
|
|
92
92
|
})), [
|
|
93
|
-
[r, ["TopNav", "click-Portfolio-My Trustee
|
|
93
|
+
[r, ["TopNav", "click-Portfolio-My Trustee dashboard"]]
|
|
94
94
|
]) : f("", !0),
|
|
95
95
|
a((t(), i(e, {
|
|
96
96
|
href: "/ui-logout",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.59.
|
|
3
|
+
"version": "6.59.4",
|
|
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": "0e86d06c371a8ddc1b13ec2532b0fbf69e26377f"
|
|
118
118
|
}
|