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