@kiva/kv-components 6.40.1 → 6.40.3
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/index.js +60 -58
- package/dist/utils/arrayUtils.js +8 -0
- package/dist/utils/comparators.js +28 -0
- package/dist/utils/event.js +7 -0
- package/dist/utils/loanSearch/queryParamUtils.js +13 -0
- package/dist/utils/markMatches.js +12 -0
- package/dist/utils/paramCase.js +6 -0
- package/dist/utils/searchEngine.js +56 -0
- package/dist/utils/siteSearch.js +112 -0
- package/dist/vue/KvIconBag.js +41 -0
- package/dist/vue/KvLogo.js +18 -0
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.css +1 -0
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.js +176 -0
- package/dist/vue/KvWwwHeader/KvHeaderLogo.js +18 -0
- package/dist/vue/KvWwwHeader/KvHeaderMenuLink.js +12 -0
- package/dist/vue/KvWwwHeader/KvHeaderMobileMenu.js +73 -0
- package/dist/vue/KvWwwHeader/KvHeaderMyKivaMenu.js +90 -0
- package/dist/vue/KvWwwHeader/KvHeaderSearchBar.js +72 -0
- package/dist/vue/KvWwwHeader/KvHeaderSearchSuggestions.css +1 -0
- package/dist/vue/KvWwwHeader/KvHeaderSearchSuggestions.js +57 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.css +1 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.js +257 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.css +1 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.js +263 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu.js +155 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList.css +1 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList.js +38 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenuSearchList.js +32 -0
- package/dist/vue/KvWwwHeader.css +1 -0
- package/dist/vue/KvWwwHeader.js +202 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -66,26 +66,27 @@ import { default as ho } from "./vue/KvVotingCardV2.js";
|
|
|
66
66
|
import { KV_WIDE_LOAN_CARD_FRAGMENT as Vo, KV_WIDE_LOAN_CARD_USER_FRAGMENT as Bo, default as ko } from "./vue/KvWideLoanCard.js";
|
|
67
67
|
import { default as bo } from "./vue/KvAtbModal.js";
|
|
68
68
|
import { default as Uo } from "./vue/KvSecondaryNav.js";
|
|
69
|
-
import { default as Wo
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
69
|
+
import { default as Wo } from "./vue/KvWwwHeader.js";
|
|
70
|
+
import { default as jo, Mash as zo } from "./utils/Alea.js";
|
|
71
|
+
import { useAttrs as qo } from "./utils/attrs.js";
|
|
72
|
+
import { carouselUtil as Xo } from "./utils/carousels.js";
|
|
73
|
+
import { collapse as Zo, expand as $o } from "./utils/expander.js";
|
|
74
|
+
import { isLegacyPlaceholderAvatar as or, randomizedUserAvatarClass as rr } from "./utils/imageUtils.js";
|
|
75
|
+
import { LOAN_CALLOUTS_FRAGMENT as ar, LOAN_GEOCODE_FRAGMENT as fr, LOAN_PROGRESS_FRAGMENT as lr, loanCardComputedProperties as sr, loanCardMethods as dr } from "./utils/loanCard.js";
|
|
76
|
+
import { BALANCE_CAMPAIGN as pr, BASE_CAMPAIGN as ur, ERL_COOKIE_NAME as xr, NO_BALANCE_CAMPAIGN as nr, TOP_UP_CAMPAIGN as Kr, getDropdownPriceArray as vr, getLendCtaSelectedOption as Ar, isBetween25And50 as Cr, isLessThan25 as ir } from "./utils/loanUtils.js";
|
|
77
|
+
import { animationCoordinator as Lr, generateMapMarkers as Nr, getCoordinatesBetween as Tr, getCountryColor as cr, getLoansIntervals as Er } from "./utils/mapUtils.js";
|
|
78
|
+
import { lockPrintSingleEl as Or, unlockPrintSingleEl as Mr } from "./utils/printing.js";
|
|
79
|
+
import { lockScroll as Ir, lockScrollSmallOnly as Gr, unlockScroll as gr, unlockScrollSmallOnly as Pr } from "./utils/scrollLock.js";
|
|
80
|
+
import { buildTailwindClassName as Fr, headerNumberCase as Vr, kebabCase as Br, removeObjectProperty as kr } from "./utils/themeUtils.js";
|
|
81
|
+
import { throttle as br } from "./utils/throttle.js";
|
|
82
|
+
import { isTargetElement as Ur, offBodyTouchstart as wr, onBodyTouchstart as Wr } from "./utils/touchEvents.js";
|
|
83
|
+
import { getTreemap as jr } from "./utils/treemap.js";
|
|
84
|
+
import { KvBlueskyIcon as Qr } from "./assets/icons/bluesky.js";
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
jo as Alea,
|
|
87
|
+
pr as BALANCE_CAMPAIGN,
|
|
88
|
+
ur as BASE_CAMPAIGN,
|
|
89
|
+
xr as ERL_COOKIE_NAME,
|
|
89
90
|
E as KV_CLASSIC_LOAN_CARD_FRAGMENT,
|
|
90
91
|
R as KV_CLASSIC_LOAN_CARD_USER_FRAGMET,
|
|
91
92
|
ae as KV_INTRODUCTION_LOAN_CARD_FRAGMENT,
|
|
@@ -101,7 +102,7 @@ export {
|
|
|
101
102
|
r as KvAccordionItem,
|
|
102
103
|
a as KvActivityRow,
|
|
103
104
|
bo as KvAtbModal,
|
|
104
|
-
|
|
105
|
+
Qr as KvBlueskyIcon,
|
|
105
106
|
l as KvBorrowerImage,
|
|
106
107
|
d as KvButton,
|
|
107
108
|
p as KvCardFrame,
|
|
@@ -167,42 +168,43 @@ export {
|
|
|
167
168
|
go as KvVotingCard,
|
|
168
169
|
ho as KvVotingCardV2,
|
|
169
170
|
ko as KvWideLoanCard,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Xo as
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
kr as
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
171
|
+
Wo as KvWwwHeader,
|
|
172
|
+
ar as LOAN_CALLOUTS_FRAGMENT,
|
|
173
|
+
fr as LOAN_GEOCODE_FRAGMENT,
|
|
174
|
+
lr as LOAN_PROGRESS_FRAGMENT,
|
|
175
|
+
zo as Mash,
|
|
176
|
+
nr as NO_BALANCE_CAMPAIGN,
|
|
177
|
+
Kr as TOP_UP_CAMPAIGN,
|
|
178
|
+
Lr as animationCoordinator,
|
|
179
|
+
Fr as buildTailwindClassName,
|
|
180
|
+
Xo as carouselUtil,
|
|
181
|
+
Zo as collapse,
|
|
182
|
+
$o as expand,
|
|
183
|
+
Nr as generateMapMarkers,
|
|
184
|
+
Tr as getCoordinatesBetween,
|
|
185
|
+
cr as getCountryColor,
|
|
186
|
+
vr as getDropdownPriceArray,
|
|
187
|
+
Ar as getLendCtaSelectedOption,
|
|
188
|
+
Er as getLoansIntervals,
|
|
189
|
+
jr as getTreemap,
|
|
190
|
+
Vr as headerNumberCase,
|
|
191
|
+
Cr as isBetween25And50,
|
|
192
|
+
or as isLegacyPlaceholderAvatar,
|
|
193
|
+
ir as isLessThan25,
|
|
194
|
+
Ur as isTargetElement,
|
|
195
|
+
Br as kebabCase,
|
|
196
|
+
sr as loanCardComputedProperties,
|
|
197
|
+
dr as loanCardMethods,
|
|
198
|
+
Or as lockPrintSingleEl,
|
|
199
|
+
Ir as lockScroll,
|
|
200
|
+
Gr as lockScrollSmallOnly,
|
|
201
|
+
wr as offBodyTouchstart,
|
|
202
|
+
Wr as onBodyTouchstart,
|
|
203
|
+
rr as randomizedUserAvatarClass,
|
|
204
|
+
kr as removeObjectProperty,
|
|
205
|
+
br as throttle,
|
|
206
|
+
Mr as unlockPrintSingleEl,
|
|
207
|
+
gr as unlockScroll,
|
|
208
|
+
Pr as unlockScrollSmallOnly,
|
|
209
|
+
qo as useAttrs
|
|
208
210
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function a(o) {
|
|
2
|
+
return (t, r) => {
|
|
3
|
+
if (typeof t == "object" && typeof r == "object" && o)
|
|
4
|
+
return t[o].localeCompare(r[o]);
|
|
5
|
+
if (typeof t == "string" && typeof r == "string")
|
|
6
|
+
return t.localeCompare(r);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function b(o, t) {
|
|
10
|
+
const r = o.toLowerCase();
|
|
11
|
+
return (e, n) => {
|
|
12
|
+
const s = typeof e == "object", u = typeof n == "object", c = (s && t ? e[t] : e).toLowerCase(), i = (u && t ? n[t] : n).toLowerCase(), p = c.indexOf(r), f = i.indexOf(r);
|
|
13
|
+
return p === 0 ? f === 0 ? a()(c, i) : -1 : f === 0 ? 1 : a()(c, i);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function j(o, t) {
|
|
17
|
+
if (!Array.isArray(o))
|
|
18
|
+
throw new TypeError("list must be an array");
|
|
19
|
+
return (r, e) => {
|
|
20
|
+
const n = r[t], s = e[t];
|
|
21
|
+
return o.indexOf(n) < o.indexOf(s) ? -1 : 1;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
a as abc,
|
|
26
|
+
j as indexIn,
|
|
27
|
+
b as startsWith
|
|
28
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function i(a, r) {
|
|
2
|
+
if (!r || !r.length)
|
|
3
|
+
return a;
|
|
4
|
+
const e = r.map((t) => t[0]).flat(), f = r.map((t) => t[1]).flat();
|
|
5
|
+
return Array.from(a).map((t, n) => {
|
|
6
|
+
const s = e.indexOf(n) > -1 ? '<mark class="tw-bg-tertiary tw-rounded-sm tw-mix-blend-multiply tw-p-0.5 tw--m-0.5">' : "", c = f.indexOf(n) > -1 ? "</mark>" : "";
|
|
7
|
+
return `${s}${t}${c}`;
|
|
8
|
+
}).join("");
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
i as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import a from "fuse.js";
|
|
2
|
+
import { startsWith as u } from "./comparators.js";
|
|
3
|
+
class p {
|
|
4
|
+
constructor(e = []) {
|
|
5
|
+
this.ready = new Promise((s) => {
|
|
6
|
+
this.resolveReady = s;
|
|
7
|
+
}), e.length && this.init(e);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resets the engine with the provided data
|
|
11
|
+
*
|
|
12
|
+
* @param data The data to reset with
|
|
13
|
+
*/
|
|
14
|
+
reset(e) {
|
|
15
|
+
this.fuse ? this.fuse.setCollection(e) : this.init(e);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Initializes the engine with the provided data
|
|
19
|
+
*
|
|
20
|
+
* @param data The data to use
|
|
21
|
+
*/
|
|
22
|
+
init(e) {
|
|
23
|
+
var s;
|
|
24
|
+
this.fuse = new a(e, {
|
|
25
|
+
threshold: 0.25,
|
|
26
|
+
distance: 1e5,
|
|
27
|
+
includeMatches: !0,
|
|
28
|
+
keys: ["label", "keywords"]
|
|
29
|
+
}), (s = this.resolveReady) == null || s.call(this);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Searches using Fuze
|
|
33
|
+
*
|
|
34
|
+
* @param query The query to search
|
|
35
|
+
* @returns Matching results with results that start with query sorted first
|
|
36
|
+
*/
|
|
37
|
+
search(e) {
|
|
38
|
+
return this.ready.then(() => new Promise((s) => {
|
|
39
|
+
var h;
|
|
40
|
+
const i = (h = this.fuse) == null ? void 0 : h.search(e), r = i == null ? void 0 : i.filter((o) => {
|
|
41
|
+
var t;
|
|
42
|
+
return (t = o.matches) == null ? void 0 : t.length;
|
|
43
|
+
}), n = r == null ? void 0 : r.map(({ item: o, matches: t }) => {
|
|
44
|
+
var l;
|
|
45
|
+
return {
|
|
46
|
+
...o,
|
|
47
|
+
matches: (l = t == null ? void 0 : t.map((c) => c.indices)) == null ? void 0 : l.flat()
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
s((n == null ? void 0 : n.sort(u(e, "label"))) ?? []);
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
p as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ref as s, computed as f, watch as b } from "vue";
|
|
2
|
+
import { gql as q } from "@apollo/client/core";
|
|
3
|
+
import { useEventListener as g } from "./event.js";
|
|
4
|
+
import x from "./markMatches.js";
|
|
5
|
+
import { hasExcludedQueryParams as I } from "./loanSearch/queryParamUtils.js";
|
|
6
|
+
import G from "./searchEngine.js";
|
|
7
|
+
import { groupBy as U } from "./arrayUtils.js";
|
|
8
|
+
const d = {}, S = [
|
|
9
|
+
"Gender",
|
|
10
|
+
"Regions",
|
|
11
|
+
"Countries and Territories",
|
|
12
|
+
"United States",
|
|
13
|
+
"U.S. cities",
|
|
14
|
+
"Sectors",
|
|
15
|
+
"Group or Individual",
|
|
16
|
+
"Attributes",
|
|
17
|
+
"User tags",
|
|
18
|
+
"Partners",
|
|
19
|
+
"Gifts"
|
|
20
|
+
];
|
|
21
|
+
function O() {
|
|
22
|
+
const i = s(null), o = s(""), v = s(""), t = s(-1), c = s([]), m = new G(), l = f(() => {
|
|
23
|
+
const e = U(c.value, "group");
|
|
24
|
+
return Object.keys(e).map((r) => {
|
|
25
|
+
const a = e[r].slice(0, 5).map((n) => ({
|
|
26
|
+
...n,
|
|
27
|
+
html: x(n.label, n.matches)
|
|
28
|
+
}));
|
|
29
|
+
return { name: r, suggestions: a };
|
|
30
|
+
}).sort((r, a) => {
|
|
31
|
+
const n = S.indexOf(r.name), u = S.indexOf(a.name);
|
|
32
|
+
return n === -1 && u === -1 ? r.name.localeCompare(a.name) : n === -1 ? 1 : u === -1 ? -1 : n - u;
|
|
33
|
+
});
|
|
34
|
+
}), p = f(() => l.value.reduce((e, r) => e + r.suggestions.length, 0)), w = (e) => {
|
|
35
|
+
e.query({
|
|
36
|
+
query: q`
|
|
37
|
+
query LoanSearchSuggestions {
|
|
38
|
+
lend {
|
|
39
|
+
loanSearchSuggestions {
|
|
40
|
+
group
|
|
41
|
+
label
|
|
42
|
+
query
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`
|
|
47
|
+
}).then(({ data: r }) => {
|
|
48
|
+
r && r.lend && m.reset([
|
|
49
|
+
...r.lend.loanSearchSuggestions,
|
|
50
|
+
{
|
|
51
|
+
group: "Gifts",
|
|
52
|
+
label: "Kiva Cards",
|
|
53
|
+
keywords: ["gift card", "kiva card", "gift", "gift certificate"],
|
|
54
|
+
url: "https://www.kiva.org/gifts/kiva-cards"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
group: "Gifts",
|
|
58
|
+
label: "Kiva Store",
|
|
59
|
+
keywords: ["gift card", "kiva card", "gift", "gift certificate"],
|
|
60
|
+
url: "https://store.kiva.org"
|
|
61
|
+
}
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
}, h = f(() => {
|
|
65
|
+
if (t.value === -1)
|
|
66
|
+
return {};
|
|
67
|
+
let e = t.value, r = 0;
|
|
68
|
+
for (; e >= l.value[r].suggestions.length; )
|
|
69
|
+
e -= l.value[r].suggestions.length, r += 1;
|
|
70
|
+
return l.value[r].suggestions[e];
|
|
71
|
+
});
|
|
72
|
+
return b(h, (e) => {
|
|
73
|
+
v.value = (e == null ? void 0 : e.label) ?? o.value;
|
|
74
|
+
}), g(i, "input", (e) => {
|
|
75
|
+
e.target.value !== o.value && (o.value = e.target.value, t.value = -1, o.value.length > 0 ? m.search(o.value).then((r) => {
|
|
76
|
+
c.value = r;
|
|
77
|
+
}) : c.value = []);
|
|
78
|
+
}), g(i, "keydown", (e) => {
|
|
79
|
+
e.key === "ArrowUp" ? (e.preventDefault(), t.value === -1 && (t.value = p.value), t.value -= 1) : e.key === "ArrowDown" && (e.preventDefault(), t.value += 1, t.value === p.value && (t.value = -1));
|
|
80
|
+
}), g(i, "blur", () => {
|
|
81
|
+
t.value = -1;
|
|
82
|
+
}), {
|
|
83
|
+
searchInput: i,
|
|
84
|
+
displayTerm: v,
|
|
85
|
+
suggestionSections: l,
|
|
86
|
+
highlightedSuggestion: h,
|
|
87
|
+
getSuggestions: w,
|
|
88
|
+
runSearch: (e) => {
|
|
89
|
+
const r = typeof e == "object";
|
|
90
|
+
if (r && e.url)
|
|
91
|
+
window.location.href = e.url;
|
|
92
|
+
else {
|
|
93
|
+
let a;
|
|
94
|
+
if (r && e.query) {
|
|
95
|
+
const [y, k] = e.query.split("=");
|
|
96
|
+
a = { [y]: k };
|
|
97
|
+
} else
|
|
98
|
+
a = { queryString: e };
|
|
99
|
+
let n = "/lend/filter";
|
|
100
|
+
I(a) && (n = "/lend");
|
|
101
|
+
const u = new URLSearchParams(a).toString();
|
|
102
|
+
window.location.href = `${window.location.origin}${n}?${u}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function K(i = "default") {
|
|
108
|
+
return d[i] || (d[i] = O()), d[i];
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
K as useSiteSearch
|
|
112
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { openBlock as n, createElementBlock as s, createElementVNode as t, toDisplayString as l } from "vue";
|
|
2
|
+
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const i = {
|
|
4
|
+
props: {
|
|
5
|
+
count: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 0
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}, f = {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
viewBox: "0 0 24 24"
|
|
13
|
+
}, c = { id: "countMask" }, d = {
|
|
14
|
+
x: "12",
|
|
15
|
+
y: "17",
|
|
16
|
+
fill: "#000",
|
|
17
|
+
style: { "font-size": "9px", "font-weight": "631", "text-anchor": "middle" }
|
|
18
|
+
};
|
|
19
|
+
function u(p, o, e, a, m, _) {
|
|
20
|
+
return n(), s("svg", f, [
|
|
21
|
+
t("defs", null, [
|
|
22
|
+
t("mask", c, [
|
|
23
|
+
o[0] || (o[0] = t("rect", {
|
|
24
|
+
width: "100%",
|
|
25
|
+
height: "100%",
|
|
26
|
+
fill: "#fff"
|
|
27
|
+
}, null, -1)),
|
|
28
|
+
t("text", d, l(e.count), 1)
|
|
29
|
+
])
|
|
30
|
+
]),
|
|
31
|
+
o[1] || (o[1] = t("path", {
|
|
32
|
+
d: "M12,3A3,3 0 0,1 15,6H9A3,3 0 0,1 12,3M19,6H17A5,5 0 0,0 12,1A5,5 0 0,0 7,6H5C3.89,6 3,6.89 3,8V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V8C21,6.89 20.1,6 19,6Z",
|
|
33
|
+
fill: "currentColor",
|
|
34
|
+
mask: "url(#countMask)"
|
|
35
|
+
}, null, -1))
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
const h = /* @__PURE__ */ r(i, [["render", u]]);
|
|
39
|
+
export {
|
|
40
|
+
h as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { openBlock as e, createElementBlock as t, createElementVNode as c } from "vue";
|
|
2
|
+
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const n = {}, h = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
viewBox: "0 0 57 23"
|
|
6
|
+
};
|
|
7
|
+
function l(m, o) {
|
|
8
|
+
return e(), t("svg", h, o[0] || (o[0] = [
|
|
9
|
+
c("path", {
|
|
10
|
+
d: "M4.695.391H0v22.141h4.695V.391zm12.899 22.141h4.695V7.011h-4.695v15.521zm12.159 0h5.413l5.413-15.521h-4.662s-2.544 8.445-3.293 11.119h-.066c-.75-2.674-3.326-11.119-3.326-11.119h-4.956l5.477 15.521zm-23.537-8.31c7.37 0 9.092-6.158 9.092-7.21h-.637c-7.372 0-9.094 6.157-9.094 7.21h.639zm-.639.969c0 1.117 1.276 7.403 9.222 7.403h.638c0-1.119-1.277-7.403-9.221-7.403h-.639zM22.746 2.739C22.746 1.272 21.671 0 19.941 0c-1.727 0-2.804 1.272-2.804 2.739 0 1.468 1.077 2.739 2.804 2.739 1.73 0 2.805-1.271 2.805-2.739M57 7.011h-4.532V9.13c-.783-1.631-2.608-2.543-4.729-2.543-3.848 0-6.88 3.129-6.88 8.184 0 5.087 2.935 8.185 6.652 8.185 2.608 0 4.173-1.272 4.956-2.675v2.25H57V7.011zm-4.663 8.151c0 2.871-1.76 4.208-3.522 4.208-1.924 0-3.163-1.956-3.163-4.598 0-2.608 1.305-4.598 3.326-4.598 1.663 0 3.359 1.37 3.359 4.206v.782z",
|
|
11
|
+
fill: "currentColor"
|
|
12
|
+
}, null, -1)
|
|
13
|
+
]));
|
|
14
|
+
}
|
|
15
|
+
const v = /* @__PURE__ */ r(n, [["render", l]]);
|
|
16
|
+
export {
|
|
17
|
+
v as default
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.header-link[data-v-850c5e69]{cursor:pointer;padding:1rem .5rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-850c5e69]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}@media (min-width: 64rem){.header-link[data-v-850c5e69]{padding-left:1.25rem;padding-right:1.25rem}}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { defineAsyncComponent as f, ref as i, resolveComponent as g, resolveDirective as L, openBlock as l, createElementBlock as a, normalizeClass as o, createVNode as s, createCommentVNode as m, withDirectives as c, createTextVNode as h, createElementVNode as w } from "vue";
|
|
2
|
+
import { mdiAccountCircle as H, mdiChevronDown as B, mdiMagnify as C, mdiMenu as N } from "@mdi/js";
|
|
3
|
+
import S from "../KvMaterialIcon.js";
|
|
4
|
+
import p from "../KvIconBag.js";
|
|
5
|
+
import "./KvHeaderLinkBar.css";
|
|
6
|
+
import T from "../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const U = f(() => import("./KvHeaderMobileMenu.js")), A = f(() => import("./KvHeaderMyKivaMenu.js")), D = f(() => import("./LendMenu/KvLendMenu.js")), V = {
|
|
8
|
+
components: {
|
|
9
|
+
KvMaterialIcon: S,
|
|
10
|
+
KvIconBag: p
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
loggedIn: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
basketCount: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0
|
|
20
|
+
},
|
|
21
|
+
openMenuItem: {
|
|
22
|
+
type: [Object, Function],
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
loginUrl: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "/ui-login"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: [
|
|
31
|
+
"item-hover",
|
|
32
|
+
"open-search"
|
|
33
|
+
],
|
|
34
|
+
setup(y, { emit: e }) {
|
|
35
|
+
const t = i(null), n = i(null), M = i(null), b = i(null), d = i(null), k = i(null), u = i(null), r = i(null), I = i(null), x = i(null);
|
|
36
|
+
return {
|
|
37
|
+
mdiAccountCircle: H,
|
|
38
|
+
mdiChevronDown: B,
|
|
39
|
+
mdiMagnify: C,
|
|
40
|
+
mdiMenu: N,
|
|
41
|
+
onHover: (v, K) => {
|
|
42
|
+
e("item-hover", v, K);
|
|
43
|
+
},
|
|
44
|
+
openSearch: () => {
|
|
45
|
+
var v;
|
|
46
|
+
e("open-search", (v = r.value) == null ? void 0 : v.offsetLeft);
|
|
47
|
+
},
|
|
48
|
+
avatar: t,
|
|
49
|
+
lendButton: n,
|
|
50
|
+
aboutUsLink: M,
|
|
51
|
+
partnerWithUsLink: b,
|
|
52
|
+
borrowLink: d,
|
|
53
|
+
supportKivaLink: k,
|
|
54
|
+
basketLink: u,
|
|
55
|
+
searchButton: r,
|
|
56
|
+
signInLink: I,
|
|
57
|
+
menuButton: x,
|
|
58
|
+
KvHeaderMobileMenu: U,
|
|
59
|
+
KvHeaderMyKivaMenu: A,
|
|
60
|
+
KvLendMenu: D
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}, _ = { class: "tw-h-full tw-flex tw-items-center" }, E = ["href"];
|
|
64
|
+
function W(y, e, t, n, M, b) {
|
|
65
|
+
const d = g("kv-material-icon"), k = g("kv-icon-bag"), u = L("kv-track-event");
|
|
66
|
+
return l(), a("div", _, [
|
|
67
|
+
t.loggedIn ? (l(), a("button", {
|
|
68
|
+
key: 0,
|
|
69
|
+
ref: "avatar",
|
|
70
|
+
class: o(["header-link lg:tw-order-last tw-inline-flex", {
|
|
71
|
+
"tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvHeaderMyKivaMenu
|
|
72
|
+
}]),
|
|
73
|
+
onMouseover: e[0] || (e[0] = (r) => n.onHover(n.avatar, n.KvHeaderMyKivaMenu)),
|
|
74
|
+
onMouseout: e[1] || (e[1] = (r) => n.onHover())
|
|
75
|
+
}, [
|
|
76
|
+
s(d, {
|
|
77
|
+
icon: n.mdiAccountCircle,
|
|
78
|
+
class: "tw-w-3"
|
|
79
|
+
}, null, 8, ["icon"])
|
|
80
|
+
], 34)) : m("", !0),
|
|
81
|
+
c((l(), a("a", {
|
|
82
|
+
ref: "lendButton",
|
|
83
|
+
href: "/lend-by-category",
|
|
84
|
+
class: o(["tw-px-1.5 tw-py-1 tw-mx-1 tw-border-2 tw-text-eco-green-3 tw-border-current tw-no-underline hover:tw-no-underline tw-inline-flex tw-items-center", {
|
|
85
|
+
"tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvLendMenu
|
|
86
|
+
}]),
|
|
87
|
+
style: { "border-radius": "1rem" },
|
|
88
|
+
onMouseover: e[2] || (e[2] = (r) => n.onHover(n.lendButton, n.KvLendMenu)),
|
|
89
|
+
onMouseout: e[3] || (e[3] = (r) => n.onHover())
|
|
90
|
+
}, [
|
|
91
|
+
e[7] || (e[7] = h(" Lend ")),
|
|
92
|
+
e[8] || (e[8] = w("span", { class: "tw-hidden lg:tw-inline tw-ml-0.5" }, "now", -1)),
|
|
93
|
+
s(d, {
|
|
94
|
+
class: o(["tw-hidden md:tw-inline tw-w-3 tw-ml-0.5 tw-transition-transform tw-duration-300", { "tw-rotate-180": t.openMenuItem === n.KvLendMenu }]),
|
|
95
|
+
icon: n.mdiChevronDown
|
|
96
|
+
}, null, 8, ["class", "icon"])
|
|
97
|
+
], 34)), [
|
|
98
|
+
[u, ["TopNav", "click-Lend"]]
|
|
99
|
+
]),
|
|
100
|
+
w("a", {
|
|
101
|
+
ref: "aboutUsLink",
|
|
102
|
+
href: "/about",
|
|
103
|
+
class: o(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
104
|
+
}, " About us ", 2),
|
|
105
|
+
w("a", {
|
|
106
|
+
ref: "partnerWithUsLink",
|
|
107
|
+
href: "/about/partner-with-us",
|
|
108
|
+
class: o(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
109
|
+
}, " Partner with us ", 2),
|
|
110
|
+
e[10] || (e[10] = w("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
|
|
111
|
+
t.loggedIn ? m("", !0) : (l(), a("a", {
|
|
112
|
+
key: 1,
|
|
113
|
+
ref: "borrowLink",
|
|
114
|
+
href: "/borrow",
|
|
115
|
+
class: o(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
116
|
+
}, " Borrow ", 2)),
|
|
117
|
+
w("a", {
|
|
118
|
+
ref: "supportKivaLink",
|
|
119
|
+
href: "/donate/supportus",
|
|
120
|
+
class: o(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
121
|
+
}, " Support Kiva ", 2),
|
|
122
|
+
t.basketCount > 0 ? c((l(), a("a", {
|
|
123
|
+
key: 2,
|
|
124
|
+
ref: "basketLink",
|
|
125
|
+
href: "/basket",
|
|
126
|
+
class: o(["header-link tw-relative", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
127
|
+
}, [
|
|
128
|
+
s(k, {
|
|
129
|
+
class: "tw-w-3 tw-h-3 tw-pointer-events-none",
|
|
130
|
+
count: t.basketCount
|
|
131
|
+
}, null, 8, ["count"])
|
|
132
|
+
], 2)), [
|
|
133
|
+
[u, ["TopNav", "click-Basket"]]
|
|
134
|
+
]) : m("", !0),
|
|
135
|
+
c((l(), a("button", {
|
|
136
|
+
ref: "searchButton",
|
|
137
|
+
class: o(["header-link tw-flex", {
|
|
138
|
+
"tw-text-tertiary": !!t.openMenuItem
|
|
139
|
+
}]),
|
|
140
|
+
onClick: e[4] || (e[4] = (...r) => n.openSearch && n.openSearch(...r))
|
|
141
|
+
}, [
|
|
142
|
+
s(d, {
|
|
143
|
+
class: "tw-w-3 tw-h-3",
|
|
144
|
+
icon: n.mdiMagnify
|
|
145
|
+
}, null, 8, ["icon"])
|
|
146
|
+
], 2)), [
|
|
147
|
+
[u, ["TopNav", "click-Search-toggle"]]
|
|
148
|
+
]),
|
|
149
|
+
t.loggedIn ? m("", !0) : c((l(), a("a", {
|
|
150
|
+
key: 3,
|
|
151
|
+
ref: "signInLink",
|
|
152
|
+
href: t.loginUrl,
|
|
153
|
+
class: o(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
|
|
154
|
+
}, e[9] || (e[9] = [
|
|
155
|
+
h(" Sign in ")
|
|
156
|
+
]), 10, E)), [
|
|
157
|
+
[u, ["TopNav", "click-Sign-in"]]
|
|
158
|
+
]),
|
|
159
|
+
c((l(), a("button", {
|
|
160
|
+
ref: "menuButton",
|
|
161
|
+
class: o(["header-link tw-inline-flex lg:tw-hidden", {
|
|
162
|
+
"tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvHeaderMobileMenu
|
|
163
|
+
}]),
|
|
164
|
+
onMouseover: e[5] || (e[5] = (r) => n.onHover(n.menuButton, n.KvHeaderMobileMenu)),
|
|
165
|
+
onMouseout: e[6] || (e[6] = (r) => n.onHover())
|
|
166
|
+
}, [
|
|
167
|
+
s(d, { icon: n.mdiMenu }, null, 8, ["icon"])
|
|
168
|
+
], 34)), [
|
|
169
|
+
[u, t.openMenuItem === n.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
|
|
170
|
+
])
|
|
171
|
+
]);
|
|
172
|
+
}
|
|
173
|
+
const Q = /* @__PURE__ */ T(V, [["render", W], ["__scopeId", "data-v-850c5e69"]]);
|
|
174
|
+
export {
|
|
175
|
+
Q as default
|
|
176
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import t from "../KvLogo.js";
|
|
2
|
+
import { resolveComponent as e, openBlock as n, createElementBlock as r, createVNode as c } from "vue";
|
|
3
|
+
import s from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = {
|
|
5
|
+
components: {
|
|
6
|
+
KvLogo: t
|
|
7
|
+
}
|
|
8
|
+
}, m = { class: "tw-h-3 tw-w-2 md:tw-w-8 tw-overflow-hidden" };
|
|
9
|
+
function p(_, d, l, w, f, i) {
|
|
10
|
+
const o = e("kv-logo");
|
|
11
|
+
return n(), r("div", m, [
|
|
12
|
+
c(o, { class: "tw-text-brand tw-w-auto tw-h-full tw-mx-auto" })
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
const x = /* @__PURE__ */ s(a, [["render", p]]);
|
|
16
|
+
export {
|
|
17
|
+
x as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { openBlock as t, createElementBlock as r, renderSlot as o } from "vue";
|
|
2
|
+
import n from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const c = {}, s = { class: "tw-py-1.5 tw-cursor-pointer tw-no-underline hover:tw-no-underline tw-text-primary hover:tw-text-action" };
|
|
4
|
+
function a(e, i) {
|
|
5
|
+
return t(), r("a", s, [
|
|
6
|
+
o(e.$slots, "default")
|
|
7
|
+
]);
|
|
8
|
+
}
|
|
9
|
+
const _ = /* @__PURE__ */ n(c, [["render", a]]);
|
|
10
|
+
export {
|
|
11
|
+
_ as default
|
|
12
|
+
};
|