@kiva/kv-components 9.0.3 → 9.1.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.
- package/dist/utils/headerMenuTiming.d.ts +6 -0
- package/dist/utils/headerMenuTiming.js +9 -0
- package/dist/utils/useHeaderMenuGroup.d.ts +27 -0
- package/dist/utils/useHeaderMenuGroup.js +68 -0
- package/dist/utils/useHeaderMenuPlacement.d.ts +6 -0
- package/dist/utils/useHeaderMenuPlacement.js +30 -0
- package/dist/utils/useHeaderMenuState.d.ts +10 -0
- package/dist/utils/useHeaderMenuState.js +21 -0
- package/dist/utils/useHoverIntent.d.ts +5 -0
- package/dist/utils/useHoverIntent.js +17 -0
- package/dist/utils/useOutsidePointerDown.d.ts +2 -0
- package/dist/utils/useOutsidePointerDown.js +19 -0
- package/dist/utils/usePointerType.d.ts +5 -0
- package/dist/utils/usePointerType.js +19 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu2.js +62 -61
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.css +1 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.js +35 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.vue.d.ts +25 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup2.js +37 -0
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +29 -75
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +37 -92
- package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/LinkBar.js +206 -132
- package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +226 -185
- package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +69 -96
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +12 -11
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/SearchBar.js +12 -12
- package/dist/vue/KvWwwHeaderBasic/SearchBar.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/SearchBar2.js +49 -43
- package/package.json +3 -4
- package/dist/utils/useHeaderBasicMenuState.d.ts +0 -3197
- package/dist/utils/useHeaderBasicMenuState.js +0 -30
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import u from "./KvWwwHeaderBasic2.js";
|
|
2
|
+
import { resolveComponent as o, openBlock as g, createBlock as c, withCtx as r, createElementVNode as b, normalizeStyle as k, createVNode as l, Transition as v, withDirectives as f, vShow as w } from "vue";
|
|
3
3
|
import "./KvWwwHeaderBasic.css";
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
4
|
+
import _ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
function h(i, t, e, a, L, I) {
|
|
6
|
+
const s = o("link-bar"), d = o("kv-page-container"), m = o("kv-theme-provider");
|
|
7
|
+
return g(), c(m, {
|
|
8
8
|
tag: "div",
|
|
9
9
|
class: "tw-bg-primary"
|
|
10
10
|
}, {
|
|
11
|
-
default:
|
|
12
|
-
|
|
13
|
-
ref: "navRef",
|
|
11
|
+
default: r(() => [
|
|
12
|
+
b("nav", {
|
|
14
13
|
class: "tw-font-medium tw-relative",
|
|
15
|
-
style:
|
|
14
|
+
style: k({ minHeight: a.MIN_HEADER_HEIGHT })
|
|
16
15
|
}, [
|
|
17
|
-
|
|
18
|
-
default:
|
|
19
|
-
|
|
20
|
-
default:
|
|
21
|
-
|
|
16
|
+
l(d, null, {
|
|
17
|
+
default: r(() => [
|
|
18
|
+
l(v, { name: "header-fade" }, {
|
|
19
|
+
default: r(() => [
|
|
20
|
+
f(l(s, {
|
|
21
|
+
ref: "linkBarRef",
|
|
22
22
|
"logged-in": e.loggedIn,
|
|
23
23
|
"basket-count": e.basketCount,
|
|
24
24
|
balance: e.balance,
|
|
25
25
|
"user-id": e.userId,
|
|
26
26
|
"is-borrower": e.isBorrower,
|
|
27
27
|
"is-trustee": e.isTrustee,
|
|
28
|
+
"trustee-id": e.trusteeId,
|
|
29
|
+
"most-recent-borrowed-loan-id": e.mostRecentBorrowedLoanId,
|
|
28
30
|
"lender-name": e.lenderName,
|
|
29
31
|
"lender-image-url": e.lenderImageUrl,
|
|
30
32
|
"is-user-data-loading": e.isUserDataLoading,
|
|
@@ -34,16 +36,15 @@ function L(t, o, e, n, C, D) {
|
|
|
34
36
|
"login-url": e.loginUrl,
|
|
35
37
|
"my-dashboard-url": e.myDashboardUrl,
|
|
36
38
|
"countries-not-lent-to-url": e.countriesNotLentToUrl,
|
|
37
|
-
"app-origin":
|
|
38
|
-
"search-suggestions":
|
|
39
|
-
"is-mobile":
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
[b, n.linksVisible]
|
|
39
|
+
"app-origin": a.resolvedAppOrigin,
|
|
40
|
+
"search-suggestions": a.effectiveSuggestions,
|
|
41
|
+
"is-mobile": a.isMobile,
|
|
42
|
+
onLoadLendMenuData: t[0] || (t[0] = (n) => i.$emit("load-lend-menu-data")),
|
|
43
|
+
onLoadSearchData: t[1] || (t[1] = (n) => i.$emit("load-search-data")),
|
|
44
|
+
onSearchSubmit: t[2] || (t[2] = (n) => i.$emit("search-submit", n)),
|
|
45
|
+
onLoginClick: t[3] || (t[3] = (n) => i.$emit("login-click", n))
|
|
46
|
+
}, null, 8, ["logged-in", "basket-count", "balance", "user-id", "is-borrower", "is-trustee", "trustee-id", "most-recent-borrowed-loan-id", "lender-name", "lender-image-url", "is-user-data-loading", "is-basket-data-loading", "use-esi-avatar", "show-m-g-upsell-link", "login-url", "my-dashboard-url", "countries-not-lent-to-url", "app-origin", "search-suggestions", "is-mobile"]), [
|
|
47
|
+
[w, a.linksVisible]
|
|
47
48
|
])
|
|
48
49
|
]),
|
|
49
50
|
_: 1
|
|
@@ -51,59 +52,12 @@ function L(t, o, e, n, C, D) {
|
|
|
51
52
|
]),
|
|
52
53
|
_: 1
|
|
53
54
|
})
|
|
54
|
-
], 4)
|
|
55
|
-
r(g, { name: "header-fade" }, {
|
|
56
|
-
default: a(() => [
|
|
57
|
-
v(s("div", {
|
|
58
|
-
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",
|
|
59
|
-
style: d({ top: n.navHeight }),
|
|
60
|
-
onTouchstart: o[9] || (o[9] = (...i) => n.handleOverlayClick && n.handleOverlayClick(...i))
|
|
61
|
-
}, [
|
|
62
|
-
s("div", {
|
|
63
|
-
ref: "menuPanelRef",
|
|
64
|
-
class: h(["tw-bg-primary tw-overflow-y-auto", n.menuPanelClass]),
|
|
65
|
-
style: d({
|
|
66
|
-
...n.menuPosition,
|
|
67
|
-
maxHeight: n.isMobileMenuActive ? "auto" : `calc(100dvh - ${n.navHeight})`
|
|
68
|
-
}),
|
|
69
|
-
onMouseenter: o[7] || (o[7] = (i) => n.setMenu(n.menuItem, n.menuComponent)),
|
|
70
|
-
onMouseleave: o[8] || (o[8] = (i) => n.setMenu())
|
|
71
|
-
}, [
|
|
72
|
-
(m(), u(y(n.menuComponent), {
|
|
73
|
-
ref: "menuComponentInstance",
|
|
74
|
-
"logged-in": e.loggedIn,
|
|
75
|
-
"login-url": e.loginUrl,
|
|
76
|
-
"user-id": e.userId,
|
|
77
|
-
"is-borrower": e.isBorrower,
|
|
78
|
-
"is-trustee": e.isTrustee,
|
|
79
|
-
"trustee-id": e.trusteeId,
|
|
80
|
-
"most-recent-borrowed-loan-id": e.mostRecentBorrowedLoanId,
|
|
81
|
-
"my-dashboard-url": e.myDashboardUrl,
|
|
82
|
-
"show-m-g-upsell-link": e.showMGUpsellLink,
|
|
83
|
-
"is-mobile": n.isMobile,
|
|
84
|
-
"countries-not-lent-to-url": e.countriesNotLentToUrl,
|
|
85
|
-
"use-mobile-mega-menu": !0,
|
|
86
|
-
"app-origin": n.resolvedAppOrigin,
|
|
87
|
-
"search-suggestions": n.effectiveSuggestions,
|
|
88
|
-
onLoadLendMenuData: n.emitLendMenuEvent,
|
|
89
|
-
onLoadSearchData: o[3] || (o[3] = (i) => t.$emit("load-search-data")),
|
|
90
|
-
onSearchSubmit: o[4] || (o[4] = (i) => t.$emit("search-submit", i)),
|
|
91
|
-
onClosingMenu: o[5] || (o[5] = (i) => n.setMenu()),
|
|
92
|
-
onTouchstart: o[6] || (o[6] = M(() => {
|
|
93
|
-
}, ["stop"]))
|
|
94
|
-
}, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "trustee-id", "most-recent-borrowed-loan-id", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "countries-not-lent-to-url", "app-origin", "search-suggestions", "onLoadLendMenuData"]))
|
|
95
|
-
], 38)
|
|
96
|
-
], 36), [
|
|
97
|
-
[b, n.menuOpen]
|
|
98
|
-
])
|
|
99
|
-
]),
|
|
100
|
-
_: 1
|
|
101
|
-
})
|
|
55
|
+
], 4)
|
|
102
56
|
]),
|
|
103
57
|
_: 1
|
|
104
58
|
});
|
|
105
59
|
}
|
|
106
|
-
const
|
|
60
|
+
const U = /* @__PURE__ */ _(u, [["render", h], ["__scopeId", "data-v-25e697e2"]]);
|
|
107
61
|
export {
|
|
108
|
-
|
|
62
|
+
U as default
|
|
109
63
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ref as o, computed as
|
|
2
|
-
import { gql as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useBreakpoints as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
const S = "4rem", Y = G`
|
|
1
|
+
import { ref as o, computed as S, onMounted as h } from "vue";
|
|
2
|
+
import { gql as b } from "@apollo/client/core";
|
|
3
|
+
import v from "../KvThemeProvider.js";
|
|
4
|
+
import B from "../KvPageContainer.js";
|
|
5
|
+
import { useBreakpoints as w } from "../../utils/useBreakpoints.js";
|
|
6
|
+
import k from "./LinkBar.js";
|
|
7
|
+
const N = "4rem", I = b`
|
|
9
8
|
query loanSearchSuggestions {
|
|
10
9
|
lend {
|
|
11
10
|
loanSearchSuggestions {
|
|
@@ -15,12 +14,12 @@ const S = "4rem", Y = G`
|
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
`,
|
|
17
|
+
`, _ = {
|
|
19
18
|
name: "KvWwwHeaderBasic",
|
|
20
19
|
components: {
|
|
21
|
-
KvThemeProvider:
|
|
22
|
-
KvPageContainer:
|
|
23
|
-
LinkBar:
|
|
20
|
+
KvThemeProvider: v,
|
|
21
|
+
KvPageContainer: B,
|
|
22
|
+
LinkBar: k
|
|
24
23
|
},
|
|
25
24
|
props: {
|
|
26
25
|
loggedIn: { type: Boolean, default: !1 },
|
|
@@ -45,96 +44,42 @@ const S = "4rem", Y = G`
|
|
|
45
44
|
mostRecentBorrowedLoanId: { type: Number, default: null }
|
|
46
45
|
},
|
|
47
46
|
emits: ["load-lend-menu-data", "load-search-data", "search-submit", "login-click"],
|
|
48
|
-
setup(
|
|
49
|
-
const { isMobile:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} = V(), l = o(null), w = o(null), r = o(null), y = o(S), c = o(null), L = o(!0), b = o(d.appOrigin);
|
|
58
|
-
let u = null;
|
|
59
|
-
const m = o([]);
|
|
60
|
-
let p = !1;
|
|
61
|
-
const U = s(
|
|
62
|
-
() => m.value.length ? m.value : d.searchSuggestions
|
|
63
|
-
), g = s(() => {
|
|
64
|
-
var t, e;
|
|
65
|
-
return ((e = (t = l.value) == null ? void 0 : t.$options) == null ? void 0 : e.name) === "MobileMenu";
|
|
66
|
-
}), h = s(() => {
|
|
67
|
-
var t, e;
|
|
68
|
-
return ((e = (t = l.value) == null ? void 0 : t.$options) == null ? void 0 : e.name) === "MyKivaMenu";
|
|
69
|
-
}), q = s(() => {
|
|
70
|
-
var t, e;
|
|
71
|
-
return ((e = (t = l.value) == null ? void 0 : t.$options) == null ? void 0 : e.name) === "AboutMenu";
|
|
72
|
-
}), C = s(() => g.value ? "tw-w-full tw-min-h-dvh tw-rounded-none" : h.value ? "tw-w-auto tw-rounded-b tw-border tw-border-t-0 tw-border-tertiary" : q.value ? "tw-w-full md:tw-w-auto tw-rounded-none !tw-rounded-b md:tw-border md:tw-border-t-0 md:tw-border-tertiary" : "tw-w-full md:tw-w-auto tw-rounded-none !md:tw-rounded-b");
|
|
73
|
-
function E(t, e, n, i = null) {
|
|
74
|
-
c.value = i, f(t, e, n);
|
|
47
|
+
setup(n) {
|
|
48
|
+
const { isMobile: d, checkIsMobile: f } = w(), i = o(null), p = o(!0), s = o(n.appOrigin), l = o([]);
|
|
49
|
+
let r = !1;
|
|
50
|
+
const g = S(
|
|
51
|
+
() => l.value.length ? l.value : n.searchSuggestions
|
|
52
|
+
);
|
|
53
|
+
function c(u) {
|
|
54
|
+
var e, t;
|
|
55
|
+
(t = (e = i.value) == null ? void 0 : e.loadMenuData) == null || t.call(e, u);
|
|
75
56
|
}
|
|
76
|
-
|
|
77
|
-
if (!t || c.value == null) return;
|
|
78
|
-
await P();
|
|
79
|
-
const e = w.value;
|
|
80
|
-
if (!e) return;
|
|
81
|
-
const n = e.offsetWidth, i = c.value, a = Math.max(0, window.innerWidth - (i + n / 2));
|
|
82
|
-
v.value = { right: `${a}px`, position: "absolute" };
|
|
83
|
-
});
|
|
84
|
-
function R() {
|
|
85
|
-
M("load-lend-menu-data");
|
|
86
|
-
}
|
|
87
|
-
function T(t) {
|
|
88
|
-
var e, n;
|
|
89
|
-
(n = (e = l.value) == null ? void 0 : e.onLoad) == null || n.call(e, t);
|
|
90
|
-
}
|
|
91
|
-
async function _(t) {
|
|
57
|
+
async function m(u) {
|
|
92
58
|
var e;
|
|
93
|
-
if (!
|
|
94
|
-
|
|
59
|
+
if (!r) {
|
|
60
|
+
r = !0;
|
|
95
61
|
try {
|
|
96
|
-
const { data:
|
|
97
|
-
|
|
62
|
+
const { data: t } = await u.query({ query: I }), y = ((e = t == null ? void 0 : t.lend) == null ? void 0 : e.loanSearchSuggestions) ?? [];
|
|
63
|
+
l.value = y.filter((a) => !!a).map((a) => ({ group: a.group ?? "", label: a.label ?? "", query: a.query ?? void 0 }));
|
|
98
64
|
} catch {
|
|
99
|
-
|
|
65
|
+
r = !1;
|
|
100
66
|
}
|
|
101
67
|
}
|
|
102
68
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
return K(() => {
|
|
107
|
-
!d.appOrigin && typeof window < "u" && (b.value = window.location.origin), k(), O(), r.value && typeof ResizeObserver < "u" && (u = new ResizeObserver(() => {
|
|
108
|
-
r.value && (y.value = `${r.value.offsetHeight}px`);
|
|
109
|
-
}), u.observe(r.value));
|
|
110
|
-
}), $(() => {
|
|
111
|
-
u == null || u.disconnect(), u = null;
|
|
69
|
+
return h(() => {
|
|
70
|
+
!n.appOrigin && typeof window < "u" && (s.value = window.location.origin), f();
|
|
112
71
|
}), {
|
|
113
|
-
MIN_HEADER_HEIGHT:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
menuComponent: A,
|
|
122
|
-
menuItem: N,
|
|
123
|
-
menuPosition: v,
|
|
124
|
-
isMobileMenuActive: g,
|
|
125
|
-
menuPanelClass: C,
|
|
126
|
-
menuComponentInstance: l,
|
|
127
|
-
menuPanelRef: w,
|
|
128
|
-
pinMenuOpen: H,
|
|
129
|
-
setMenu: f,
|
|
130
|
-
onItemHover: E,
|
|
131
|
-
handleOverlayClick: x,
|
|
132
|
-
emitLendMenuEvent: R,
|
|
133
|
-
loadMenuData: T,
|
|
134
|
-
loadSearchSuggestions: _
|
|
72
|
+
MIN_HEADER_HEIGHT: N,
|
|
73
|
+
linkBarRef: i,
|
|
74
|
+
linksVisible: p,
|
|
75
|
+
resolvedAppOrigin: s,
|
|
76
|
+
effectiveSuggestions: g,
|
|
77
|
+
isMobile: d,
|
|
78
|
+
loadMenuData: c,
|
|
79
|
+
loadSearchSuggestions: m
|
|
135
80
|
};
|
|
136
81
|
}
|
|
137
82
|
};
|
|
138
83
|
export {
|
|
139
|
-
|
|
84
|
+
_ as default
|
|
140
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.link-bar[data-v-
|
|
1
|
+
.link-bar[data-v-816544c3]{display:flex;align-items:center;gap:.5rem}.link-bar__logo[data-v-816544c3]{position:absolute;top:50%;left:50%;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}@media(min-width:45.875rem){.link-bar[data-v-816544c3]{display:grid;-moz-column-gap:1rem;column-gap:1rem;grid-template-areas:"logo lend right" "search search search";grid-template-columns:1fr auto auto;grid-template-rows:4rem auto;row-gap:.5rem}.link-bar__logo[data-v-816544c3]{position:static;--tw-translate-x: 0;--tw-translate-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));grid-area:logo;justify-self:start}.link-bar__lend[data-v-816544c3]{grid-area:lend}.link-bar__search[data-v-816544c3]{grid-area:search;margin-bottom:.5rem}.link-bar__right[data-v-816544c3]{grid-area:right;align-self:stretch}}@media(min-width:64rem){.link-bar[data-v-816544c3]{-moz-column-gap:1.25rem;column-gap:1.25rem;grid-template-areas:"logo lend search right";grid-template-columns:auto auto 1fr auto;grid-template-rows:4rem}.link-bar__search[data-v-816544c3]{margin-bottom:0}}.header-link[data-v-816544c3]{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-816544c3]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}.menu-trigger[data-v-816544c3]{border:0;background:none;font:inherit;cursor:pointer}.backdrop[data-v-816544c3]{position:absolute;z-index:1300;top:var(--nav-height, 4rem);inset-inline:0;height:0;background-color:rgba(var(--bg-action-highlight),.5);visibility:hidden;opacity:0;transition:opacity var(--menu-close-fade) ease var(--menu-open-delay),visibility 0s calc(var(--menu-open-delay) + var(--menu-close-fade)),height 0s calc(var(--menu-open-delay) + var(--menu-close-fade))}.link-bar:has(.menu-group>[aria-expanded=true])>.backdrop[data-v-816544c3],.link-bar[data-pointer=mouse]:has(.menu-group:hover)>.backdrop[data-v-816544c3]{visibility:visible;opacity:1;height:100vh;transition:opacity .3s ease var(--menu-open-delay),visibility 0s var(--menu-open-delay),height 0s var(--menu-open-delay)}.chevron[data-v-816544c3]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.menu-group:has(>[aria-expanded=true]) .chevron[data-v-816544c3],[data-pointer=mouse] .menu-group:hover .chevron[data-v-816544c3]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.link-bar__basket-count-loader[data-v-816544c3]{width:1.5ch;height:1.375em;height:1lh}
|