@kiva/kv-components 6.46.0 → 6.47.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.
- package/dist/utils/comparators.js +6 -23
- package/dist/vue/KvWwwHeader/KvHeaderAboutMenu.js +89 -0
- package/dist/vue/KvWwwHeader/KvHeaderDropdownLink.js +84 -0
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.css +1 -1
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.js +178 -133
- package/dist/vue/KvWwwHeader/KvHeaderMobileMenu.css +1 -0
- package/dist/vue/KvWwwHeader/KvHeaderMobileMenu.js +133 -53
- package/dist/vue/KvWwwHeader/KvHeaderMyKivaMenu.js +33 -31
- package/dist/vue/KvWwwHeader/KvHeaderTakeActionMenu.js +61 -0
- package/dist/vue/KvWwwHeader.css +1 -1
- package/dist/vue/KvWwwHeader.js +99 -134
- package/package.json +2 -3
- package/dist/utils/event.js +0 -7
- package/dist/utils/loanSearch/queryParamUtils.js +0 -13
- package/dist/utils/markMatches.js +0 -12
- package/dist/utils/searchEngine.js +0 -56
- package/dist/utils/siteSearch.js +0 -112
- package/dist/vue/KvWwwHeader/KvHeaderSearchBar.js +0 -72
- package/dist/vue/KvWwwHeader/KvHeaderSearchSuggestions.css +0 -1
- package/dist/vue/KvWwwHeader/KvHeaderSearchSuggestions.js +0 -57
package/dist/vue/KvWwwHeader.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import A from "./KvThemeProvider.js";
|
|
6
|
-
import T from "./KvWwwHeader/KvHeaderSearchSuggestions.js";
|
|
1
|
+
import { ref as i, shallowRef as C, resolveComponent as c, resolveDirective as H, openBlock as v, createBlock as h, withCtx as f, createElementVNode as m, createVNode as u, Transition as k, withDirectives as g, vShow as p, createElementBlock as L, normalizeStyle as M, resolveDynamicComponent as B } from "vue";
|
|
2
|
+
import D from "./KvWwwHeader/KvHeaderLinkBar.js";
|
|
3
|
+
import x from "./KvWwwHeader/KvHeaderLogo.js";
|
|
4
|
+
import N from "./KvThemeProvider.js";
|
|
7
5
|
import "./KvWwwHeader.css";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
6
|
+
import T from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const U = {
|
|
10
8
|
components: {
|
|
11
|
-
KvHeaderLinkBar:
|
|
12
|
-
KvHeaderLogo:
|
|
13
|
-
|
|
14
|
-
KvThemeProvider: A,
|
|
15
|
-
KvHeaderSearchSuggestions: T
|
|
9
|
+
KvHeaderLinkBar: D,
|
|
10
|
+
KvHeaderLogo: x,
|
|
11
|
+
KvThemeProvider: N
|
|
16
12
|
},
|
|
17
13
|
props: {
|
|
18
14
|
loggedIn: {
|
|
@@ -42,152 +38,121 @@ const D = {
|
|
|
42
38
|
userId: {
|
|
43
39
|
type: Number,
|
|
44
40
|
default: null
|
|
41
|
+
},
|
|
42
|
+
myDashboardUrl: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "/mykiva"
|
|
45
|
+
},
|
|
46
|
+
lenderName: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
lenderImageUrl: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
isMobile: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
45
57
|
}
|
|
46
58
|
},
|
|
47
59
|
emits: [
|
|
48
60
|
"load-lend-menu-data"
|
|
49
61
|
],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
52
|
-
let
|
|
62
|
+
setup(I, { emit: n }) {
|
|
63
|
+
const e = i(!0), t = i(null), a = i(!1), l = C(null), d = i(null), r = i({ left: 0, position: "relative" });
|
|
64
|
+
let s;
|
|
53
65
|
return {
|
|
54
|
-
afterLinksNotVisible: () => {
|
|
55
|
-
m.value = !0;
|
|
56
|
-
},
|
|
57
|
-
afterSearchClosed: () => {
|
|
58
|
-
t.value = !0;
|
|
59
|
-
},
|
|
60
|
-
afterSearchOpen: () => {
|
|
61
|
-
var a;
|
|
62
|
-
(a = e.value) == null || a.onOpen();
|
|
63
|
-
},
|
|
64
66
|
emitLendMenuEvent: () => {
|
|
65
67
|
n("load-lend-menu-data");
|
|
66
68
|
},
|
|
67
|
-
linksVisible:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
linksVisible: e,
|
|
70
|
+
menuOpen: a,
|
|
71
|
+
onHover: (_, o, y) => {
|
|
72
|
+
o ? (clearTimeout(s), l.value !== o && (r.value = { left: 0, position: "relative" }), l.value = o, a.value = !0, y && (r.value = {
|
|
73
|
+
...y,
|
|
74
|
+
position: "absolute"
|
|
75
|
+
})) : a.value && (s = setTimeout(() => {
|
|
76
|
+
a.value = !1, l.value = null;
|
|
73
77
|
}, 200));
|
|
74
78
|
},
|
|
75
|
-
|
|
76
|
-
t.value = !1;
|
|
77
|
-
},
|
|
78
|
-
closeSearch: () => {
|
|
79
|
-
m.value = !1;
|
|
80
|
-
},
|
|
81
|
-
getSuggestions: (a) => {
|
|
82
|
-
var o;
|
|
83
|
-
(o = e.value) == null || o.getSuggestions(a);
|
|
84
|
-
},
|
|
85
|
-
loadMenuData: (a) => {
|
|
79
|
+
loadMenuData: (_) => {
|
|
86
80
|
var o;
|
|
87
|
-
(o =
|
|
81
|
+
(o = d.value) == null || o.onLoad(_);
|
|
88
82
|
},
|
|
89
|
-
activeHeaderItem:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
activeHeaderItem: t,
|
|
84
|
+
menuComponent: l,
|
|
85
|
+
menuComponentInstance: d,
|
|
86
|
+
menuPosition: r
|
|
93
87
|
};
|
|
94
88
|
}
|
|
95
|
-
},
|
|
89
|
+
}, S = {
|
|
96
90
|
class: "header-margins tw-relative tw-py-1 tw-px-1.5 tw-font-medium",
|
|
97
91
|
style: { height: "3.75rem" }
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
}, E = {
|
|
93
|
+
href: "/",
|
|
94
|
+
class: "tw-px-1 tw-py-2 tw-cursor-pointer tw-absolute tw-top-1/2 tw-left-1/2 tw--translate-y-1/2 tw--translate-x-1/2 tw-transition-all tw-duration-300"
|
|
95
|
+
}, K = {
|
|
96
|
+
class: "tw-absolute tw-z-modal tw-h-full tw-inset-x-0 tw-bg-eco-green-4 bg-opacity-50 tw-min-h-screen",
|
|
97
|
+
style: { top: "3.75rem" }
|
|
98
|
+
}, V = { class: "header-margins tw-px-2.5" };
|
|
99
|
+
function z(I, n, e, t, a, l) {
|
|
100
|
+
const d = c("kv-header-link-bar"), r = c("kv-header-logo"), s = c("kv-theme-provider"), b = H("kv-track-event");
|
|
101
|
+
return v(), h(s, {
|
|
102
102
|
tag: "div",
|
|
103
|
-
class: "tw-
|
|
103
|
+
class: "tw-border-b tw-border-tertiary"
|
|
104
104
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, null, 8, ["logged-in", "basket-count", "login-url", "open-menu-item", "
|
|
120
|
-
[
|
|
105
|
+
default: f(() => [
|
|
106
|
+
m("nav", S, [
|
|
107
|
+
u(k, { name: "header-fade" }, {
|
|
108
|
+
default: f(() => [
|
|
109
|
+
g(u(d, {
|
|
110
|
+
"logged-in": e.loggedIn,
|
|
111
|
+
"basket-count": e.basketCount,
|
|
112
|
+
"login-url": e.loginUrl,
|
|
113
|
+
"open-menu-item": t.menuComponent,
|
|
114
|
+
"my-dashboard-url": e.myDashboardUrl,
|
|
115
|
+
"lender-name": e.lenderName,
|
|
116
|
+
"lender-image-url": e.lenderImageUrl,
|
|
117
|
+
"is-mobile": e.isMobile,
|
|
118
|
+
onItemHover: t.onHover
|
|
119
|
+
}, null, 8, ["logged-in", "basket-count", "login-url", "open-menu-item", "my-dashboard-url", "lender-name", "lender-image-url", "is-mobile", "onItemHover"]), [
|
|
120
|
+
[p, t.linksVisible]
|
|
121
121
|
])
|
|
122
122
|
]),
|
|
123
123
|
_: 1
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}, [
|
|
131
|
-
r(i)
|
|
132
|
-
], 2)), [
|
|
133
|
-
[y, ["TopNav", "click-Logo"]]
|
|
134
|
-
]),
|
|
135
|
-
r(w, {
|
|
136
|
-
name: "header-fade",
|
|
137
|
-
onAfterEnter: e.afterSearchOpen,
|
|
138
|
-
onAfterLeave: e.afterSearchClosed
|
|
139
|
-
}, {
|
|
140
|
-
default: d(() => [
|
|
141
|
-
_(r(u, {
|
|
142
|
-
ref: "searchBar",
|
|
143
|
-
class: "tw-absolute tw-left-1/2 tw--translate-x-1/2 tw-top-1/2 tw--translate-y-1/2 tw-h-full tw-w-full",
|
|
144
|
-
style: {
|
|
145
|
-
"max-width": "600px"
|
|
146
|
-
},
|
|
147
|
-
onCloseSearch: e.closeSearch
|
|
148
|
-
}, null, 8, ["onCloseSearch"]), [
|
|
149
|
-
[b, e.searchOpen]
|
|
150
|
-
])
|
|
151
|
-
]),
|
|
152
|
-
_: 1
|
|
153
|
-
}, 8, ["onAfterEnter", "onAfterLeave"])
|
|
124
|
+
}),
|
|
125
|
+
g((v(), L("a", E, [
|
|
126
|
+
u(r)
|
|
127
|
+
])), [
|
|
128
|
+
[b, ["TopNav", "click-Logo"]]
|
|
129
|
+
])
|
|
154
130
|
]),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, 8, ["onAfterEnter"]),
|
|
164
|
-
r(w, { name: "header-fade" }, {
|
|
165
|
-
default: d(() => [
|
|
166
|
-
_(g("div", {
|
|
167
|
-
class: "tw-absolute tw-z-modal tw-h-full tw-inset-x-0 tw-bg-eco-green-4 bg-opacity-50 tw-min-h-screen",
|
|
168
|
-
style: { top: "3.75rem" },
|
|
169
|
-
onClick: n[2] || (n[2] = (...v) => e.closeSearch && e.closeSearch(...v))
|
|
170
|
-
}, [
|
|
171
|
-
g("div", {
|
|
172
|
-
class: "tw-bg-secondary tw-w-full",
|
|
173
|
-
onMouseover: n[0] || (n[0] = (v) => e.onHover(e.activeHeaderItem, e.menuComponent)),
|
|
174
|
-
onMouseout: n[1] || (n[1] = (v) => e.onHover())
|
|
131
|
+
u(k, { name: "header-fade" }, {
|
|
132
|
+
default: f(() => [
|
|
133
|
+
g(m("div", K, [
|
|
134
|
+
m("div", {
|
|
135
|
+
class: "tw-bg-primary",
|
|
136
|
+
style: M(t.menuPosition),
|
|
137
|
+
onMouseover: n[0] || (n[0] = (w) => t.onHover(t.activeHeaderItem, t.menuComponent)),
|
|
138
|
+
onMouseout: n[1] || (n[1] = (w) => t.onHover())
|
|
175
139
|
}, [
|
|
176
|
-
|
|
177
|
-
(
|
|
140
|
+
m("div", V, [
|
|
141
|
+
(v(), h(B(t.menuComponent), {
|
|
178
142
|
ref: "menuComponentInstance",
|
|
179
|
-
"logged-in":
|
|
180
|
-
"login-url":
|
|
181
|
-
"user-id":
|
|
182
|
-
balance:
|
|
183
|
-
"is-borrower":
|
|
184
|
-
"is-trustee":
|
|
185
|
-
|
|
186
|
-
|
|
143
|
+
"logged-in": e.loggedIn,
|
|
144
|
+
"login-url": e.loginUrl,
|
|
145
|
+
"user-id": e.userId,
|
|
146
|
+
balance: e.balance,
|
|
147
|
+
"is-borrower": e.isBorrower,
|
|
148
|
+
"is-trustee": e.isTrustee,
|
|
149
|
+
"my-dashboard-url": e.myDashboardUrl,
|
|
150
|
+
onLoadLendMenuData: t.emitLendMenuEvent
|
|
151
|
+
}, null, 40, ["logged-in", "login-url", "user-id", "balance", "is-borrower", "is-trustee", "my-dashboard-url", "onLoadLendMenuData"]))
|
|
187
152
|
])
|
|
188
|
-
],
|
|
153
|
+
], 36)
|
|
189
154
|
], 512), [
|
|
190
|
-
[
|
|
155
|
+
[p, t.menuOpen]
|
|
191
156
|
])
|
|
192
157
|
]),
|
|
193
158
|
_: 1
|
|
@@ -196,7 +161,7 @@ function z(C, n, t, e, m, k) {
|
|
|
196
161
|
_: 1
|
|
197
162
|
});
|
|
198
163
|
}
|
|
199
|
-
const
|
|
164
|
+
const F = /* @__PURE__ */ T(U, [["render", z], ["__scopeId", "data-v-bd1e99de"]]);
|
|
200
165
|
export {
|
|
201
|
-
|
|
166
|
+
F as default
|
|
202
167
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.47.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"eslint-plugin-vue": "^7.9.0",
|
|
64
64
|
"flag-icons": "^7.3.0",
|
|
65
65
|
"focus-trap": "^6.9.4",
|
|
66
|
-
"fuse.js": "^7.1.0",
|
|
67
66
|
"graphql-tag": "^2.12.6",
|
|
68
67
|
"import-meta-loader": "^1.1.0",
|
|
69
68
|
"jest": "^27.4.3",
|
|
@@ -114,5 +113,5 @@
|
|
|
114
113
|
"embla-carousel-fade",
|
|
115
114
|
"popper.js"
|
|
116
115
|
],
|
|
117
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "f741923b1b8b537eb11232bcdf53a09dc2d35ee2"
|
|
118
117
|
}
|
package/dist/utils/event.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/utils/siteSearch.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ref as f, resolveComponent as u, resolveDirective as h, openBlock as c, createElementBlock as w, withDirectives as d, createElementVNode as p, withKeys as v, vModelText as y, createVNode as x, normalizeClass as _, createTextVNode as S } from "vue";
|
|
2
|
-
import { useSiteSearch as g } from "../../utils/siteSearch.js";
|
|
3
|
-
import { mdiMagnify as k } from "@mdi/js";
|
|
4
|
-
import b from "../KvMaterialIcon.js";
|
|
5
|
-
import T from "../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const V = {
|
|
7
|
-
components: {
|
|
8
|
-
KvMaterialIcon: b
|
|
9
|
-
},
|
|
10
|
-
emits: [
|
|
11
|
-
"close-search"
|
|
12
|
-
],
|
|
13
|
-
setup(m, { emit: t }) {
|
|
14
|
-
const {
|
|
15
|
-
searchInput: n,
|
|
16
|
-
displayTerm: e,
|
|
17
|
-
runSearch: i,
|
|
18
|
-
getSuggestions: a
|
|
19
|
-
} = g(), o = f(!1);
|
|
20
|
-
return {
|
|
21
|
-
mdiMagnify: k,
|
|
22
|
-
closeSearch: () => {
|
|
23
|
-
o.value = !1, t("close-search");
|
|
24
|
-
},
|
|
25
|
-
displayTerm: e,
|
|
26
|
-
onOpen: () => {
|
|
27
|
-
var s;
|
|
28
|
-
o.value = !0, (s = n.value) == null || s.focus();
|
|
29
|
-
},
|
|
30
|
-
searchInput: n,
|
|
31
|
-
searchExitVisible: o,
|
|
32
|
-
runSearch: i,
|
|
33
|
-
getSuggestions: a
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}, E = { class: "tw-inline-flex tw-pl-1.5 md:tw-pl-0 tw-w-full" }, C = { class: "tw-flex-none tw-order-first tw-inline-flex tw-items-center tw-my-1.5 tw-p-0.5 tw-rounded-l tw-bg-tertiary peer-placeholder-shown:tw-bg-secondary tw-transition-colors tw-duration-100" };
|
|
37
|
-
function K(m, t, n, e, i, a) {
|
|
38
|
-
const o = u("kv-material-icon"), l = h("kv-track-event");
|
|
39
|
-
return c(), w("div", E, [
|
|
40
|
-
d(p("input", {
|
|
41
|
-
ref: "searchInput",
|
|
42
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.displayTerm = r),
|
|
43
|
-
type: "text",
|
|
44
|
-
placeholder: "Search",
|
|
45
|
-
class: "tw-peer tw-flex-1 tw-min-w-0 tw-my-1.5 tw-px-1 tw-rounded-r tw-bg-tertiary placeholder-shown:tw-bg-secondary focus:tw-outline-none placeholder:tw-text-gray-300 placeholder:tw-font-medium tw-transition-colors tw-duration-100",
|
|
46
|
-
onKeydown: t[1] || (t[1] = v((r) => e.runSearch(e.displayTerm), ["enter"]))
|
|
47
|
-
}, null, 544), [
|
|
48
|
-
[y, e.displayTerm]
|
|
49
|
-
]),
|
|
50
|
-
p("div", C, [
|
|
51
|
-
x(o, {
|
|
52
|
-
class: "tw-w-3 tw-h-3",
|
|
53
|
-
icon: e.mdiMagnify
|
|
54
|
-
}, null, 8, ["icon"])
|
|
55
|
-
]),
|
|
56
|
-
d((c(), w("button", {
|
|
57
|
-
class: _(["tw-px-2.5 tw-transition-opacity", {
|
|
58
|
-
"tw-opacity-full tw-duration-300": e.searchExitVisible,
|
|
59
|
-
"tw-opacity-0 tw-duration-100": !e.searchExitVisible
|
|
60
|
-
}]),
|
|
61
|
-
onClick: t[2] || (t[2] = (...r) => e.closeSearch && e.closeSearch(...r))
|
|
62
|
-
}, t[3] || (t[3] = [
|
|
63
|
-
S(" Cancel ")
|
|
64
|
-
]), 2)), [
|
|
65
|
-
[l, ["TopNav", "click-cancel-search"]]
|
|
66
|
-
])
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
const O = /* @__PURE__ */ T(V, [["render", K]]);
|
|
70
|
-
export {
|
|
71
|
-
O as default
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.search-results[data-v-f3f87a06]{top:3.75rem}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useSiteSearch as h } from "../../utils/siteSearch.js";
|
|
2
|
-
import { withDirectives as u, openBlock as t, createElementBlock as e, createElementVNode as i, Fragment as d, renderList as c, toDisplayString as w, normalizeClass as m, withModifiers as p, vShow as _ } from "vue";
|
|
3
|
-
import "./KvHeaderSearchSuggestions.css";
|
|
4
|
-
import g from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const f = {
|
|
6
|
-
setup() {
|
|
7
|
-
const {
|
|
8
|
-
suggestionSections: a,
|
|
9
|
-
highlightedSuggestion: r,
|
|
10
|
-
runSearch: l
|
|
11
|
-
} = h();
|
|
12
|
-
return {
|
|
13
|
-
suggestionSections: a,
|
|
14
|
-
highlightedSuggestion: r,
|
|
15
|
-
runSearch: l
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}, S = { class: "search-results tw-absolute tw-bg-primary tw-border tw-border-tertiary tw-p-2.5 tw-w-full tw-z-popover" }, v = {
|
|
19
|
-
style: {
|
|
20
|
-
"max-width": "600px"
|
|
21
|
-
},
|
|
22
|
-
class: "tw-mx-auto"
|
|
23
|
-
}, y = ["data-testid"], b = { class: "tw-text-base tw-py-0.5" }, x = ["onClick"], k = ["innerHTML"];
|
|
24
|
-
function M(a, r, l, o, C, H) {
|
|
25
|
-
return u((t(), e("div", S, [
|
|
26
|
-
i("ol", v, [
|
|
27
|
-
(t(!0), e(d, null, c(o.suggestionSections, (s) => (t(), e("li", {
|
|
28
|
-
key: s.name,
|
|
29
|
-
"data-testid": `header-search-results-${s.name}`
|
|
30
|
-
}, [
|
|
31
|
-
i("h2", b, w(s.name), 1),
|
|
32
|
-
i("ol", null, [
|
|
33
|
-
(t(!0), e(d, null, c(s.suggestions, (n) => (t(), e("li", {
|
|
34
|
-
key: n.label,
|
|
35
|
-
"data-testid": "header-search-result-item",
|
|
36
|
-
class: m(["tw-pl-1.5 tw-py-0.5 tw-rounded-sm tw-font-medium tw-cursor-pointer hover:tw-bg-tertiary hover:tw-underline", {
|
|
37
|
-
"tw-bg-tertiary tw-underline": o.highlightedSuggestion === n
|
|
38
|
-
}]),
|
|
39
|
-
onMousedown: r[0] || (r[0] = p(() => {
|
|
40
|
-
}, ["prevent"])),
|
|
41
|
-
onClick: (L) => o.runSearch(n)
|
|
42
|
-
}, [
|
|
43
|
-
i("span", {
|
|
44
|
-
innerHTML: n.html
|
|
45
|
-
}, null, 8, k)
|
|
46
|
-
], 42, x))), 128))
|
|
47
|
-
])
|
|
48
|
-
], 8, y))), 128))
|
|
49
|
-
])
|
|
50
|
-
], 512)), [
|
|
51
|
-
[_, o.suggestionSections.length]
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
const T = /* @__PURE__ */ g(f, [["render", M], ["__scopeId", "data-v-f3f87a06"]]);
|
|
55
|
-
export {
|
|
56
|
-
T as default
|
|
57
|
-
};
|