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