@kiva/kv-components 6.62.0 → 6.62.2

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.
@@ -0,0 +1,9 @@
1
+ const r = (t, o) => {
2
+ let e;
3
+ return (...u) => {
4
+ clearTimeout(e), e = setTimeout(() => t(...u), o);
5
+ };
6
+ };
7
+ export {
8
+ r as debounce
9
+ };
@@ -71,7 +71,7 @@ function I(e, n, o, r, a, c) {
71
71
  ref: o.refName,
72
72
  class: "tw-py-1 tw-no-underline hover:tw-no-underline tw-text-primary hover:tw-text-action tw-items-center tw-cursor-pointer",
73
73
  href: o.href,
74
- onMouseover: n[0] || (n[0] = (...t) => r.handleMouseOver && r.handleMouseOver(...t)),
74
+ onMouseenter: n[0] || (n[0] = (...t) => r.handleMouseOver && r.handleMouseOver(...t)),
75
75
  onTouchstart: n[1] || (n[1] = h((...t) => r.handleTouchStart && r.handleTouchStart(...t), ["prevent"]))
76
76
  }, [
77
77
  p("div", {
@@ -1 +1 @@
1
- .header-link[data-v-d33b2f4e]{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-d33b2f4e]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}[data-v-d33b2f4e] .avatar div:first-child{display:flex}
1
+ .header-link[data-v-1f562db1]{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-1f562db1]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}[data-v-1f562db1] .avatar div:first-child{display:flex}
@@ -1,4 +1,4 @@
1
- import { defineAsyncComponent as k, ref as r, inject as Y, computed as x, watch as C, onMounted as Z, onUnmounted as $, resolveComponent as b, resolveDirective as ee, openBlock as i, createElementBlock as w, withDirectives as s, normalizeClass as p, withModifiers as H, createVNode as L, createBlock as y, withCtx as U, createTextVNode as f, createElementVNode as T, createCommentVNode as _, vShow as P, toDisplayString as ne } from "vue";
1
+ import { defineAsyncComponent as h, ref as r, inject as Y, computed as x, watch as P, onMounted as Z, onUnmounted as $, resolveComponent as p, resolveDirective as ee, openBlock as i, createElementBlock as w, withDirectives as s, normalizeClass as y, withModifiers as H, createVNode as U, createBlock as T, withCtx as B, createTextVNode as f, createElementVNode as M, createCommentVNode as V, vShow as R, toDisplayString as ne } from "vue";
2
2
  import { mdiAccountCircle as te, mdiChevronDown as oe, mdiMagnify as ae, mdiMenu as le } from "@mdi/js";
3
3
  import re from "numeral";
4
4
  import ie from "../KvMaterialIcon.js";
@@ -9,7 +9,7 @@ import { throttle as ve } from "../../utils/throttle.js";
9
9
  import { isLegacyPlaceholderAvatar as se } from "../../utils/imageUtils.js";
10
10
  import "./KvHeaderLinkBar.css";
11
11
  import ce from "../../_virtual/_plugin-vue_export-helper.js";
12
- const we = k(() => import("./KvHeaderMobileMenu.js")), V = k(() => import("./KvHeaderMyKivaMenu.js")), fe = k(() => import("./LendMenu/KvLendMenu.js")), Me = k(() => import("./KvHeaderTakeActionMenu.js")), ke = k(() => import("./KvHeaderAboutMenu.js")), B = 120, M = "avatar-menu", K = "menuButton", R = { top: "-3.75rem", width: "100%" }, F = "lendButton", ge = {
12
+ const we = h(() => import("./KvHeaderMobileMenu.js")), F = h(() => import("./KvHeaderMyKivaMenu.js")), fe = h(() => import("./LendMenu/KvLendMenu.js")), Me = h(() => import("./KvHeaderTakeActionMenu.js")), ke = h(() => import("./KvHeaderAboutMenu.js")), K = 120, k = "avatar-menu", N = "menuButton", z = { top: "-3.75rem", width: "100%" }, A = "lendButton", he = {
13
13
  components: {
14
14
  KvMaterialIcon: ie,
15
15
  KvIconBag: de,
@@ -58,60 +58,64 @@ const we = k(() => import("./KvHeaderMobileMenu.js")), V = k(() => import("./KvH
58
58
  "item-hover"
59
59
  ],
60
60
  setup(l, { emit: n }) {
61
- const a = r(null), e = r(null), N = r(null), O = r(null), g = r(null), c = r(null), A = r(null), I = r(null), d = r(null), t = r(null), z = Y("$kvTrackEvent"), u = (o, v, m = null) => {
61
+ const a = r(null), e = r(null), O = r(null), E = r(null), g = r(null), c = r(null), I = r(null), L = r(null), d = r(null), t = r(null), D = Y("$kvTrackEvent"), u = (o, v, m = null) => {
62
62
  n("item-hover", o, v, m);
63
63
  }, W = (o, v, m = null) => {
64
- navigator.maxTouchPoints || (t.value = o, u(
64
+ navigator.maxTouchPoints || (o === A && t.value !== A && D(
65
+ "TopNav",
66
+ "hover-Lend-menu",
67
+ "Lend"
68
+ ), t.value = o, u(
65
69
  o,
66
70
  v,
67
- o === K && l.isMobile ? R : m
71
+ o === N && l.isMobile ? z : m
68
72
  ));
69
73
  }, j = (o) => {
70
74
  !navigator.maxTouchPoints && t.value === o && (t.value = null, u());
71
- }, E = () => {
72
- var S;
73
- const o = (S = a.value) == null ? void 0 : S.getBoundingClientRect();
75
+ }, S = () => {
76
+ var _;
77
+ const o = (_ = a.value) == null ? void 0 : _.getBoundingClientRect();
74
78
  if (!o) return null;
75
- const m = o.left + o.width / 2 - B / 2;
79
+ const m = o.left + o.width / 2 - K / 2;
76
80
  return {
77
- ...m + B > window.innerWidth ? { right: 0 } : { left: l.isMobile ? 0 : `${m}px` },
81
+ ...m + K > window.innerWidth ? { right: 0 } : { left: l.isMobile ? 0 : `${m}px` },
78
82
  marginTop: "-2px",
79
83
  // Avoid closing avatar menu on header edge
80
84
  borderRadius: l.isMobile ? "auto" : "0px 0px 8px 8px",
81
- width: l.isMobile ? "100%" : `${B}px`
85
+ width: l.isMobile ? "100%" : `${K}px`
82
86
  };
83
- }, h = () => {
84
- t.value = M, u(a.value, V, E());
87
+ }, b = () => {
88
+ t.value = k, u(a.value, F, S());
85
89
  }, q = (o, v, m) => {
86
- o === F && t.value !== F && z(
90
+ o === A && t.value !== A && D(
87
91
  "TopNav",
88
92
  "hover-Lend-menu",
89
93
  "Lend"
90
- ), t.value === K && (t.value = null), !t.value || t.value !== o ? (t.value = o, o === M ? h() : o === K && l.isMobile ? u(o, v, R) : u(o, v, m)) : (t.value = null, u());
91
- }, D = ve(() => {
92
- t.value === M && h();
94
+ ), t.value === N && (t.value = null), !t.value || t.value !== o ? (t.value = o, o === k ? b() : o === N && l.isMobile ? u(o, v, z) : u(o, v, m)) : (t.value = null, u());
95
+ }, C = ve(() => {
96
+ t.value === k && b();
93
97
  }, 100), G = x(() => l.isMobile ? void 0 : "/lend-by-category"), J = x(() => {
94
98
  var o;
95
99
  return ((o = l.lenderImageUrl) == null ? void 0 : o.split("/").pop()) ?? "";
96
100
  }), Q = x(() => Math.floor(l.balance)), X = (o) => {
97
101
  o.target === o.currentTarget && u();
98
102
  };
99
- return C(
103
+ return P(
100
104
  () => l.isMobile,
101
105
  () => {
102
- t.value === M && h();
106
+ t.value === k && b();
103
107
  }
104
- ), C(
108
+ ), P(
105
109
  () => l.openMenuItem,
106
110
  (o) => {
107
111
  o || (t.value = null);
108
112
  }
109
113
  ), Z(() => {
110
- import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", D);
114
+ import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", C);
111
115
  }), $(() => {
112
- window.removeEventListener("resize", D);
116
+ window.removeEventListener("resize", C);
113
117
  }), {
114
- AVATAR_MENU_ID: M,
118
+ AVATAR_MENU_ID: k,
115
119
  openMenuId: t,
116
120
  numeral: re,
117
121
  mdiAccountCircle: te,
@@ -121,51 +125,54 @@ const we = k(() => import("./KvHeaderMobileMenu.js")), V = k(() => import("./KvH
121
125
  onHover: u,
122
126
  avatar: a,
123
127
  lendButton: e,
124
- aboutUsLink: N,
125
- partnerWithUsLink: O,
128
+ aboutUsLink: O,
129
+ partnerWithUsLink: E,
126
130
  borrowLink: g,
127
131
  supportKivaLink: c,
128
- basketLink: A,
129
- signInLink: I,
132
+ basketLink: I,
133
+ signInLink: L,
130
134
  menuButton: d,
131
135
  lendUrl: G,
132
136
  avatarFilename: J,
133
137
  handleOnHover: W,
134
138
  handleTouchStart: q,
135
139
  handleMouseOut: j,
136
- handleAvatarMenuPosition: h,
140
+ handleAvatarMenuPosition: b,
137
141
  KvHeaderMobileMenu: we,
138
- KvHeaderMyKivaMenu: V,
142
+ KvHeaderMyKivaMenu: F,
139
143
  KvLendMenu: fe,
140
144
  KvHeaderTakeActionMenu: Me,
141
145
  KvHeaderAboutMenu: ke,
142
146
  isLegacyPlaceholderAvatar: se,
143
- getAvatarMenuPosition: E,
147
+ getAvatarMenuPosition: S,
144
148
  handleEmptySpaceClick: X,
145
149
  roundedBalance: Q
146
150
  };
147
151
  }
148
- }, he = ["href"], be = { class: "tw-text-eco-green-4" }, pe = ["href"];
149
- function ye(l, n, a, e, N, O) {
150
- const g = b("kv-material-icon"), c = b("KvHeaderDropdownLink"), A = b("kv-icon-bag"), I = b("KvUserAvatar"), d = ee("kv-track-event");
152
+ }, ge = ["href"], be = {
153
+ ref: "avatar",
154
+ class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-bg-eco-green-1 tw-rounded-md tw-py-0.5 md:tw-py-1 tw-px-1 md:tw-px-2"
155
+ }, pe = { class: "tw-text-eco-green-4" }, ye = ["href"];
156
+ function Te(l, n, a, e, O, E) {
157
+ const g = p("kv-material-icon"), c = p("KvHeaderDropdownLink"), I = p("kv-icon-bag"), L = p("KvUserAvatar"), d = ee("kv-track-event");
151
158
  return i(), w("div", {
152
159
  class: "tw-h-full tw-flex tw-items-center tw-gap-0.5 md:tw-gap-2 lg:tw-gap-2.5",
153
160
  onTouchstart: n[10] || (n[10] = (...t) => e.handleEmptySpaceClick && e.handleEmptySpaceClick(...t))
154
161
  }, [
155
162
  s((i(), w("button", {
156
163
  ref: "menuButton",
157
- class: p(["header-link tw-inline-flex md:tw-hidden", {
164
+ class: y(["header-link tw-inline-flex md:tw-hidden", {
158
165
  "tw-text-tertiary": a.openMenuItem && a.openMenuItem !== e.KvHeaderMobileMenu
159
166
  }]),
160
167
  onMouseover: n[0] || (n[0] = (t) => e.handleOnHover("menuButton", e.KvHeaderMobileMenu)),
161
168
  onMouseout: n[1] || (n[1] = (t) => e.handleMouseOut("menuButton")),
162
169
  onTouchstart: n[2] || (n[2] = H((t) => e.handleTouchStart("menuButton", e.KvHeaderMobileMenu), ["stop"]))
163
170
  }, [
164
- L(g, { icon: e.mdiMenu }, null, 8, ["icon"])
171
+ U(g, { icon: e.mdiMenu }, null, 8, ["icon"])
165
172
  ], 34)), [
166
173
  [d, a.openMenuItem === e.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
167
174
  ]),
168
- s((i(), y(c, {
175
+ s((i(), T(c, {
169
176
  class: "tw-py-1",
170
177
  "ref-name": "lendButton",
171
178
  href: e.lendUrl,
@@ -174,17 +181,17 @@ function ye(l, n, a, e, N, O) {
174
181
  "dropdown-icon": e.mdiChevronDown,
175
182
  "base-class": "tw-inline-flex md:tw-border md:tw-rounded-md tw-px-1.5 tw-py-1",
176
183
  onOnHover: e.handleOnHover,
177
- onMouseout: n[3] || (n[3] = (t) => e.handleMouseOut("lendButton")),
184
+ onMouseleave: n[3] || (n[3] = (t) => e.handleMouseOut("lendButton")),
178
185
  onTouchstart: n[4] || (n[4] = H((t) => e.handleTouchStart("lendButton", e.KvLendMenu), ["stop"]))
179
186
  }, {
180
- default: U(() => n[11] || (n[11] = [
187
+ default: B(() => n[11] || (n[11] = [
181
188
  f(" Lend ")
182
189
  ])),
183
190
  _: 1
184
191
  }, 8, ["href", "menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
185
192
  [d, ["TopNav", "click-Lend"]]
186
193
  ]),
187
- s((i(), y(c, {
194
+ s((i(), T(c, {
188
195
  "ref-name": "takeActionButton",
189
196
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
190
197
  "menu-component": e.KvHeaderTakeActionMenu,
@@ -192,17 +199,17 @@ function ye(l, n, a, e, N, O) {
192
199
  "dropdown-icon": e.mdiChevronDown,
193
200
  "send-link-position": "",
194
201
  onOnHover: e.handleOnHover,
195
- onMouseout: n[5] || (n[5] = (t) => e.handleMouseOut("takeActionButton")),
202
+ onMouseleave: n[5] || (n[5] = (t) => e.handleMouseOut("takeActionButton")),
196
203
  onUserTap: e.handleTouchStart
197
204
  }, {
198
- default: U(() => n[12] || (n[12] = [
205
+ default: B(() => n[12] || (n[12] = [
199
206
  f(" Take action ")
200
207
  ])),
201
208
  _: 1
202
209
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"])), [
203
210
  [d, ["TopNav", "click-take-action"]]
204
211
  ]),
205
- L(c, {
212
+ U(c, {
206
213
  "ref-name": "aboutUsLink",
207
214
  "data-testid": "header-about",
208
215
  "base-class": "tw-hidden md:tw-inline-flex tw-py-1",
@@ -211,76 +218,77 @@ function ye(l, n, a, e, N, O) {
211
218
  "dropdown-icon": e.mdiChevronDown,
212
219
  "send-link-position": "",
213
220
  onOnHover: e.handleOnHover,
214
- onMouseout: n[6] || (n[6] = (t) => e.handleMouseOut("aboutUsLink")),
221
+ onMouseleave: n[6] || (n[6] = (t) => e.handleMouseOut("aboutUsLink")),
215
222
  onUserTap: e.handleTouchStart
216
223
  }, {
217
- default: U(() => n[13] || (n[13] = [
224
+ default: B(() => n[13] || (n[13] = [
218
225
  f(" About ")
219
226
  ])),
220
227
  _: 1
221
228
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover", "onUserTap"]),
222
- n[17] || (n[17] = T("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
229
+ n[17] || (n[17] = M("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
223
230
  a.loggedIn ? s((i(), w("a", {
224
231
  key: 0,
225
232
  ref: "dashboardLink",
226
233
  href: a.myDashboardUrl,
227
- class: p(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!a.openMenuItem }])
234
+ class: y(["header-link tw-hidden md:tw-block", { "tw-text-tertiary": !!a.openMenuItem }])
228
235
  }, n[14] || (n[14] = [
229
236
  f(" My dashboard ")
230
- ]), 10, he)), [
237
+ ]), 10, ge)), [
231
238
  [d, ["TopNav", "click-Dashboard"]]
232
- ]) : _("", !0),
239
+ ]) : V("", !0),
233
240
  s((i(), w("a", {
234
241
  ref: "basketLink",
235
242
  href: "/basket",
236
- class: p(["header-link tw-relative md:!tw-mr-0 tw-flex tw-items-center tw-gap-0.5", { "tw-text-tertiary": !!a.openMenuItem }]),
243
+ class: y(["header-link tw-relative md:!tw-mr-0 tw-flex tw-items-center tw-gap-0.5", { "tw-text-tertiary": !!a.openMenuItem }]),
237
244
  style: { "margin-right": "2px" },
238
245
  "data-testid": "header-basket"
239
246
  }, [
240
- L(A, {
247
+ U(I, {
241
248
  class: "tw-w-3 tw-h-3 md:tw-w-3.5 md:tw-h-3.5 tw-pointer-events-none",
242
249
  count: a.basketCount
243
250
  }, null, 8, ["count"]),
244
- n[15] || (n[15] = T("span", { class: "tw-hidden md:tw-block" }, "Basket", -1))
251
+ n[15] || (n[15] = M("span", { class: "tw-hidden md:tw-block" }, "Basket", -1))
245
252
  ], 2)), [
246
- [P, a.basketCount > 0],
253
+ [R, a.basketCount > 0],
247
254
  [d, ["TopNav", "click-Basket"]]
248
255
  ]),
249
- s(T("div", {
250
- ref: "avatar",
251
- class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1 tw-bg-eco-green-1 tw-rounded-md tw-py-0.5 md:tw-py-1 tw-px-1 md:tw-px-2",
252
- onMouseover: n[7] || (n[7] = (t) => e.handleOnHover(e.AVATAR_MENU_ID, e.KvHeaderMyKivaMenu, e.getAvatarMenuPosition())),
253
- onMouseout: n[8] || (n[8] = (t) => e.handleMouseOut(e.AVATAR_MENU_ID)),
256
+ M("div", {
257
+ class: "md:tw-py-1",
258
+ onMouseenter: n[7] || (n[7] = (t) => e.handleOnHover(e.AVATAR_MENU_ID, e.KvHeaderMyKivaMenu, e.getAvatarMenuPosition())),
259
+ onMouseleave: n[8] || (n[8] = (t) => e.handleMouseOut(e.AVATAR_MENU_ID)),
254
260
  onTouchstart: n[9] || (n[9] = H((t) => e.handleTouchStart(e.AVATAR_MENU_ID), ["stop"]))
255
261
  }, [
256
- e.isLegacyPlaceholderAvatar(e.avatarFilename) || !e.avatarFilename ? (i(), y(g, {
257
- key: 0,
258
- icon: e.mdiAccountCircle,
259
- class: "tw-w-3"
260
- }, null, 8, ["icon"])) : (i(), y(I, {
261
- key: 1,
262
- class: "avatar",
263
- "lender-name": a.lenderName,
264
- "lender-image-url": a.lenderImageUrl,
265
- "is-small": ""
266
- }, null, 8, ["lender-name", "lender-image-url"])),
267
- T("span", be, ne(e.numeral(e.roundedBalance).format("$0")), 1)
268
- ], 544), [
269
- [P, a.loggedIn]
270
- ]),
271
- a.loggedIn ? _("", !0) : s((i(), w("a", {
262
+ s(M("div", be, [
263
+ e.isLegacyPlaceholderAvatar(e.avatarFilename) || !e.avatarFilename ? (i(), T(g, {
264
+ key: 0,
265
+ icon: e.mdiAccountCircle,
266
+ class: "tw-w-3"
267
+ }, null, 8, ["icon"])) : (i(), T(L, {
268
+ key: 1,
269
+ class: "avatar",
270
+ "lender-name": a.lenderName,
271
+ "lender-image-url": a.lenderImageUrl,
272
+ "is-small": ""
273
+ }, null, 8, ["lender-name", "lender-image-url"])),
274
+ M("span", pe, ne(e.numeral(e.roundedBalance).format("$0")), 1)
275
+ ], 512), [
276
+ [R, a.loggedIn]
277
+ ])
278
+ ], 32),
279
+ a.loggedIn ? V("", !0) : s((i(), w("a", {
272
280
  key: 1,
273
281
  ref: "signInLink",
274
282
  href: a.loginUrl,
275
- class: p(["header-link", { "tw-text-tertiary": !!a.openMenuItem }])
283
+ class: y(["header-link", { "tw-text-tertiary": !!a.openMenuItem }])
276
284
  }, n[16] || (n[16] = [
277
285
  f(" Sign in ")
278
- ]), 10, pe)), [
286
+ ]), 10, ye)), [
279
287
  [d, ["TopNav", "click-Sign-in"]]
280
288
  ])
281
289
  ], 32);
282
290
  }
283
- const De = /* @__PURE__ */ ce(ge, [["render", ye], ["__scopeId", "data-v-d33b2f4e"]]);
291
+ const Se = /* @__PURE__ */ ce(he, [["render", Te], ["__scopeId", "data-v-1f562db1"]]);
284
292
  export {
285
- De as default
293
+ Se as default
286
294
  };
@@ -1 +1 @@
1
- .header-fade-enter-active[data-v-8d56e82f]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-8d56e82f]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-8d56e82f],.header-fade-leave-to[data-v-8d56e82f]{opacity:0}.header-fade-leave[data-v-8d56e82f],.header-fade-enter-to[data-v-8d56e82f]{opacity:1}.bg-opacity-50[data-v-8d56e82f]{background-color:rgba(var(--bg-action-highlight),.5)}
1
+ .header-fade-enter-active[data-v-7fe52aee]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-7fe52aee]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-7fe52aee],.header-fade-leave-to[data-v-7fe52aee]{opacity:0}.header-fade-leave[data-v-7fe52aee],.header-fade-enter-to[data-v-7fe52aee]{opacity:1}.bg-opacity-50[data-v-7fe52aee]{background-color:rgba(var(--bg-action-highlight),.5)}
@@ -1,18 +1,19 @@
1
- import { ref as a, shallowRef as N, computed as B, onMounted as S, onBeforeUnmount as x, resolveComponent as g, resolveDirective as A, openBlock as w, createBlock as E, withCtx as b, createElementVNode as k, normalizeStyle as h, createVNode as v, Transition as I, withDirectives as y, vShow as T, createElementBlock as K, normalizeClass as O, resolveDynamicComponent as G, withModifiers as z } from "vue";
2
- import P from "@kiva/kv-tokens";
3
- import R from "./KvWwwHeader/KvHeaderLinkBar.js";
4
- import V from "./KvWwwHeader/KvHeaderLogo.js";
5
- import W from "./KvThemeProvider.js";
6
- import Y from "./KvPageContainer.js";
7
- import { throttle as j } from "../utils/throttle.js";
1
+ import { ref as l, shallowRef as B, computed as S, onMounted as x, onBeforeUnmount as A, resolveComponent as g, resolveDirective as K, openBlock as w, createBlock as I, withCtx as b, createElementVNode as k, normalizeStyle as h, createVNode as v, Transition as C, withDirectives as y, vShow as T, createElementBlock as O, normalizeClass as G, resolveDynamicComponent as z, withModifiers as P } from "vue";
2
+ import R from "@kiva/kv-tokens";
3
+ import V from "./KvWwwHeader/KvHeaderLinkBar.js";
4
+ import W from "./KvWwwHeader/KvHeaderLogo.js";
5
+ import Y from "./KvThemeProvider.js";
6
+ import j from "./KvPageContainer.js";
7
+ import { throttle as q } from "../utils/throttle.js";
8
+ import { debounce as F } from "../utils/debounce.js";
8
9
  import "./KvWwwHeader.css";
9
- import q from "../_virtual/_plugin-vue_export-helper.js";
10
- const F = "3.75rem", J = ["lendMenu", "aboutUsLink"], Q = {
10
+ import J from "../_virtual/_plugin-vue_export-helper.js";
11
+ const Q = "3.7rem", X = ["lendMenu", "aboutUsLink"], Z = {
11
12
  components: {
12
- KvHeaderLinkBar: R,
13
- KvHeaderLogo: V,
14
- KvThemeProvider: W,
15
- KvPageContainer: Y
13
+ KvHeaderLinkBar: V,
14
+ KvHeaderLogo: W,
15
+ KvThemeProvider: Y,
16
+ KvPageContainer: j
16
17
  },
17
18
  props: {
18
19
  loggedIn: {
@@ -67,56 +68,56 @@ const F = "3.75rem", J = ["lendMenu", "aboutUsLink"], Q = {
67
68
  emits: [
68
69
  "load-lend-menu-data"
69
70
  ],
70
- setup(C, { emit: o }) {
71
- const n = a(!0), e = a(null), r = a(!1), i = N(null), u = a(null), d = a({ left: 0, position: "relative" }), m = a(!1), c = a(null);
72
- let f;
73
- const l = B(() => {
71
+ setup(L, { emit: o }) {
72
+ const n = l(!0), e = l(null), r = l(!1), i = B(null), u = l(null), d = l({ left: 0, position: "relative" }), m = l(!1), c = l(null), f = l(!1);
73
+ let a;
74
+ const _ = S(() => {
74
75
  var s, t;
75
76
  return ((t = (s = u.value) == null ? void 0 : s.$options) == null ? void 0 : t.name) === "KvHeaderMobileMenu";
76
- }), _ = (s, t, p) => {
77
- t ? (c.value = s, clearTimeout(f), i.value !== t && (d.value = { left: 0, position: "relative" }), i.value = t, r.value = !0, p && (d.value = {
78
- ...p,
77
+ }), M = F((s, t, E) => {
78
+ f.value && (t ? (c.value = s, clearTimeout(a), i.value !== t && (d.value = { left: 0, position: "relative" }), i.value = t, r.value = !0, E && (d.value = {
79
+ ...E,
79
80
  position: "absolute"
80
- })) : r.value && (f = setTimeout(() => {
81
+ })) : r.value && (a = setTimeout(() => {
81
82
  r.value = !1, i.value = null;
82
- }, 100));
83
- }, L = (s) => {
83
+ }, 50)));
84
+ }, 100), U = (s) => {
84
85
  var t;
85
86
  (t = u.value) == null || t.onLoad(s);
86
- }, U = () => {
87
- if (!l.value) return _();
88
87
  }, D = () => {
88
+ if (!_.value) return M();
89
+ }, N = () => {
89
90
  o("load-lend-menu-data");
90
- }, M = () => {
91
- m.value = (window == null ? void 0 : window.innerWidth) < P.breakpoints.md, m.value && J.includes(c.value) && (i.value = null, r.value = !1);
92
- }, H = j(M, 100);
93
- return S(() => {
94
- M(), window.addEventListener("resize", H);
95
- }), x(() => {
91
+ }, p = () => {
92
+ m.value = (window == null ? void 0 : window.innerWidth) < R.breakpoints.md, m.value && X.includes(c.value) && (i.value = null, r.value = !1);
93
+ }, H = q(p, 100);
94
+ return x(() => {
95
+ p(), window.addEventListener("resize", H), f.value = !0;
96
+ }), A(() => {
96
97
  window.removeEventListener("resize", H);
97
98
  }), {
98
- HEADER_HEIGHT: F,
99
- emitLendMenuEvent: D,
99
+ HEADER_HEIGHT: Q,
100
+ emitLendMenuEvent: N,
100
101
  isMobile: m,
101
102
  linksVisible: n,
102
103
  menuOpen: r,
103
- isMobileMenuActive: l,
104
- onHover: _,
105
- loadMenuData: L,
106
- handleOverlayClick: U,
104
+ isMobileMenuActive: _,
105
+ onHover: M,
106
+ loadMenuData: U,
107
+ handleOverlayClick: D,
107
108
  activeHeaderItem: e,
108
109
  menuComponent: i,
109
110
  menuComponentInstance: u,
110
111
  menuPosition: d
111
112
  };
112
113
  }
113
- }, X = {
114
+ }, $ = {
114
115
  href: "/",
115
116
  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"
116
117
  };
117
- function Z(C, o, n, e, r, i) {
118
- const u = g("kv-header-link-bar"), d = g("kv-header-logo"), m = g("kv-page-container"), c = g("kv-theme-provider"), f = A("kv-track-event");
119
- return w(), E(c, {
118
+ function ee(L, o, n, e, r, i) {
119
+ const u = g("kv-header-link-bar"), d = g("kv-header-logo"), m = g("kv-page-container"), c = g("kv-theme-provider"), f = K("kv-track-event");
120
+ return w(), I(c, {
120
121
  tag: "div",
121
122
  class: "tw-bg-primary"
122
123
  }, {
@@ -127,7 +128,7 @@ function Z(C, o, n, e, r, i) {
127
128
  }, [
128
129
  v(m, null, {
129
130
  default: b(() => [
130
- v(I, { name: "header-fade" }, {
131
+ v(C, { name: "header-fade" }, {
131
132
  default: b(() => [
132
133
  y(v(u, {
133
134
  "logged-in": n.loggedIn,
@@ -146,7 +147,7 @@ function Z(C, o, n, e, r, i) {
146
147
  ]),
147
148
  _: 1
148
149
  }),
149
- y((w(), K("a", X, [
150
+ y((w(), O("a", $, [
150
151
  v(d)
151
152
  ])), [
152
153
  [f, ["TopNav", "click-Logo"]]
@@ -155,23 +156,23 @@ function Z(C, o, n, e, r, i) {
155
156
  _: 1
156
157
  })
157
158
  ], 4),
158
- v(I, { name: "header-fade" }, {
159
+ v(C, { name: "header-fade" }, {
159
160
  default: b(() => [
160
161
  y(k("div", {
161
162
  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",
162
163
  style: h({ top: e.HEADER_HEIGHT }),
163
- onTouchstart: o[4] || (o[4] = (...l) => e.handleOverlayClick && e.handleOverlayClick(...l))
164
+ onTouchstart: o[4] || (o[4] = (...a) => e.handleOverlayClick && e.handleOverlayClick(...a))
164
165
  }, [
165
166
  k("div", {
166
- class: O(["tw-bg-primary tw-overflow-y-auto", { "tw-min-h-dvh": e.isMobileMenuActive }]),
167
+ class: G(["tw-bg-primary tw-overflow-y-auto", { "tw-min-h-dvh": e.isMobileMenuActive }]),
167
168
  style: h({
168
169
  ...e.menuPosition,
169
170
  maxHeight: e.isMobileMenuActive ? "auto" : `calc(100dvh - ${e.HEADER_HEIGHT})`
170
171
  }),
171
- onMouseover: o[2] || (o[2] = (l) => e.onHover(e.activeHeaderItem, e.menuComponent)),
172
- onMouseout: o[3] || (o[3] = (l) => e.onHover())
172
+ onMouseenter: o[2] || (o[2] = (a) => e.onHover(e.activeHeaderItem, e.menuComponent)),
173
+ onMouseleave: o[3] || (o[3] = (a) => e.onHover())
173
174
  }, [
174
- (w(), E(G(e.menuComponent), {
175
+ (w(), I(z(e.menuComponent), {
175
176
  ref: "menuComponentInstance",
176
177
  "logged-in": n.loggedIn,
177
178
  "login-url": n.loginUrl,
@@ -183,8 +184,8 @@ function Z(C, o, n, e, r, i) {
183
184
  "is-mobile": e.isMobile,
184
185
  "countries-not-lent-to-url": n.countriesNotLentToUrl,
185
186
  onLoadLendMenuData: e.emitLendMenuEvent,
186
- onClosingMenu: o[0] || (o[0] = (l) => e.onHover()),
187
- onTouchstart: o[1] || (o[1] = z(() => {
187
+ onClosingMenu: o[0] || (o[0] = (a) => e.onHover()),
188
+ onTouchstart: o[1] || (o[1] = P(() => {
188
189
  }, ["stop"]))
189
190
  }, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "countries-not-lent-to-url", "onLoadLendMenuData"]))
190
191
  ], 38)
@@ -198,7 +199,7 @@ function Z(C, o, n, e, r, i) {
198
199
  _: 1
199
200
  });
200
201
  }
201
- const se = /* @__PURE__ */ q(Q, [["render", Z], ["__scopeId", "data-v-8d56e82f"]]);
202
+ const me = /* @__PURE__ */ J(Z, [["render", ee], ["__scopeId", "data-v-7fe52aee"]]);
202
203
  export {
203
- se as default
204
+ me as default
204
205
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.62.0",
3
+ "version": "6.62.2",
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": "e0ac2f7a901efa25536b185c77d9371e41c21dcd"
117
+ "gitHead": "f508a0add91e8d46355db11db0890eb45a6df070"
118
118
  }