@kiva/kv-components 6.48.1 → 6.49.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.
@@ -1 +1 @@
1
- .amountDropdownWrapper[data-v-b607e1c2] select{border-radius:14px 0 0 14px}.lend-again[data-v-b607e1c2] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-b607e1c2] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-b607e1c2] select{cursor:pointer;border-radius:1rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-b607e1c2] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.preset-option[data-v-b607e1c2] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-b607e1c2] select,.selected-option[data-v-b607e1c2] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--bg-secondary),var(--tw-bg-opacity, 1))}.button-ellipsis[data-v-b607e1c2] span>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ .amountDropdownWrapper[data-v-ce2eaa1b] select{border-radius:14px 0 0 14px}.lend-again[data-v-ce2eaa1b] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-ce2eaa1b] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-ce2eaa1b] select{cursor:pointer;white-space:nowrap;border-radius:1rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-ce2eaa1b] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.preset-option[data-v-ce2eaa1b] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-ce2eaa1b] select,.selected-option[data-v-ce2eaa1b] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--bg-secondary),var(--tw-bg-opacity, 1))}.button-ellipsis[data-v-ce2eaa1b] span>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width: 325px){[data-testid=bp-lend-cta-select-and-button-mobile]>div.tw-flex[data-v-ce2eaa1b]{flex-wrap:wrap}.mobile-other-dd[data-v-ce2eaa1b]{flex:0 0 100px!important;min-width:100px!important;max-width:100px!important;width:100px!important}.button-ellipsis[data-v-ce2eaa1b]{flex:1 1 0%;min-width:0}}
@@ -1,34 +1,35 @@
1
- import T from "graphql-tag";
2
- import { mdiChevronRight as _ } from "@mdi/js";
3
- import { getLendCtaSelectedOption as g, getDropdownPriceArray as C } from "../utils/loanUtils.js";
4
- import D from "./KvLendAmountButton.js";
5
- import P from "./KvSelect.js";
6
- import F from "./KvButton.js";
7
- import S from "./KvMaterialIcon.js";
8
- import { resolveComponent as k, openBlock as i, createElementBlock as a, createBlock as r, withCtx as d, createTextVNode as c, toDisplayString as m, createElementVNode as p, createVNode as I, withModifiers as y, normalizeClass as f, Fragment as B, renderList as v, createCommentVNode as l } from "vue";
1
+ import _ from "graphql-tag";
2
+ import { mdiChevronRight as D } from "@mdi/js";
3
+ import { throttle as C } from "../utils/throttle.js";
4
+ import { getLendCtaSelectedOption as g, getDropdownPriceArray as P } from "../utils/loanUtils.js";
5
+ import F from "./KvLendAmountButton.js";
6
+ import S from "./KvSelect.js";
7
+ import I from "./KvButton.js";
8
+ import V from "./KvMaterialIcon.js";
9
+ import { resolveComponent as b, openBlock as o, createElementBlock as d, createBlock as l, withCtx as u, createTextVNode as w, toDisplayString as h, createElementVNode as f, createVNode as N, withModifiers as v, Fragment as k, renderList as y, normalizeClass as m, createCommentVNode as r } from "vue";
9
10
  import "./KvLendCta.css";
10
- import N from "../_virtual/_plugin-vue_export-helper.js";
11
- const w = "Other", nt = T`
12
- fragment KvLendCta on LoanBasic {
13
- id
14
- name
15
- status
16
- minNoteSize
17
- }
18
- `, st = T`
19
- fragment KvLendCtaUser on LoanBasic {
20
- id
21
- userProperties {
22
- lentTo
23
- }
24
- }
25
- `, O = {
11
+ import O from "../_virtual/_plugin-vue_export-helper.js";
12
+ const A = "Other", ce = _`
13
+ fragment KvLendCta on LoanBasic {
14
+ id
15
+ name
16
+ status
17
+ minNoteSize
18
+ }
19
+ `, we = _`
20
+ fragment KvLendCtaUser on LoanBasic {
21
+ id
22
+ userProperties {
23
+ lentTo
24
+ }
25
+ }
26
+ `, M = {
26
27
  name: "KvLendCta",
27
28
  components: {
28
- KvLendAmountButton: D,
29
- KvUiButton: F,
30
- KvUiSelect: P,
31
- KvMaterialIcon: S
29
+ KvLendAmountButton: F,
30
+ KvUiButton: I,
31
+ KvUiSelect: S,
32
+ KvMaterialIcon: V
32
33
  },
33
34
  props: {
34
35
  loan: {
@@ -108,9 +109,9 @@ const w = "Other", nt = T`
108
109
  default: void 0
109
110
  },
110
111
  /**
111
- * Hide preset buttons under this amount when
112
- * showPresetAmounts is true
113
- * */
112
+ * Hide preset buttons under this amount when
113
+ * showPresetAmounts is true
114
+ * */
114
115
  maxAmount: {
115
116
  type: String,
116
117
  default: ""
@@ -125,21 +126,24 @@ const w = "Other", nt = T`
125
126
  }
126
127
  },
127
128
  data() {
128
- var t, n;
129
+ var t, s;
129
130
  return {
130
- mdiChevronRight: _,
131
+ mdiChevronRight: D,
131
132
  defaultAmountOptions: [25, 50, 75],
132
133
  selectedOption: g(
133
134
  this.getCookie,
134
135
  this.setCookie,
135
136
  this.enableFiveDollarsNotes,
136
- (n = (t = this.route) == null ? void 0 : t.query) == null ? void 0 : n.utm_campaign,
137
+ (s = (t = this.route) == null ? void 0 : t.query) == null ? void 0 : s.utm_campaign,
137
138
  this.unreservedAmount,
138
139
  this.userBalance,
139
140
  this.fiveDollarsSelected
140
141
  ),
141
- selectedDropdownOption: w,
142
- OTHER_OPTION: w
142
+ selectedDropdownOption: A,
143
+ OTHER_OPTION: A,
144
+ // SSR-safe viewport width initialization
145
+ viewportWidth: typeof window < "u" ? window.innerWidth : 1024,
146
+ resizeHandler: void 0
143
147
  };
144
148
  },
145
149
  computed: {
@@ -159,22 +163,22 @@ const w = "Other", nt = T`
159
163
  return ((t = this.loan) == null ? void 0 : t.minNoteSize) ?? "";
160
164
  },
161
165
  lentPreviously() {
162
- var t, n;
163
- return ((n = (t = this.loan) == null ? void 0 : t.userProperties) == null ? void 0 : n.lentTo) ?? !1;
166
+ var t, s;
167
+ return ((s = (t = this.loan) == null ? void 0 : t.userProperties) == null ? void 0 : s.lentTo) ?? !1;
164
168
  },
165
169
  isInBasket() {
166
170
  var t;
167
- return ((t = this.basketItems) == null ? void 0 : t.some((n) => n.__typename === "LoanReservation" && n.id === this.loanId)) ?? !1;
171
+ return ((t = this.basketItems) == null ? void 0 : t.some((s) => s.__typename === "LoanReservation" && s.id === this.loanId)) ?? !1;
168
172
  },
169
173
  prices() {
170
- const t = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), n = C(
174
+ const t = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), s = P(
171
175
  this.unreservedAmount,
172
176
  this.isCompleteLoanActive,
173
177
  t,
174
178
  this.enableFiveDollarsNotes,
175
179
  this.isVisitor
176
180
  );
177
- return this.maxAmount ? n.filter((s) => parseFloat(s) <= parseFloat(this.maxAmount)) : n;
181
+ return this.maxAmount ? s.filter((i) => parseFloat(i) <= parseFloat(this.maxAmount)) : s;
178
182
  },
179
183
  presetButtonsPrices() {
180
184
  const t = this.prices.slice(0, 3);
@@ -184,7 +188,7 @@ const w = "Other", nt = T`
184
188
  if (this.prices.length === 4)
185
189
  return [];
186
190
  const t = this.prices.slice(this.defaultAmountOptions.length);
187
- return t.unshift(w), t;
191
+ return t.unshift(A), t;
188
192
  },
189
193
  loanName() {
190
194
  var t;
@@ -254,7 +258,7 @@ const w = "Other", nt = T`
254
258
  return this.isLentTo && !this.isLessThan25;
255
259
  },
256
260
  selectedDropdown() {
257
- return this.selectedDropdownOption !== w;
261
+ return this.selectedDropdownOption !== A;
258
262
  },
259
263
  showFilteredDropdown() {
260
264
  return this.presetDropdownPrices.length > 1;
@@ -264,20 +268,28 @@ const w = "Other", nt = T`
264
268
  }
265
269
  },
266
270
  watch: {
267
- unreservedAmount(t, n) {
268
- var s, A;
269
- t !== n && n === "" && (this.selectedOption = g(
271
+ unreservedAmount(t, s) {
272
+ var i, p;
273
+ t !== s && s === "" && (this.selectedOption = g(
270
274
  this.getCookie,
271
275
  this.setCookie,
272
276
  this.enableFiveDollarsNotes,
273
- (A = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : A.utm_campaign,
277
+ (p = (i = this.route) == null ? void 0 : i.query) == null ? void 0 : p.utm_campaign,
274
278
  t,
275
279
  this.userBalance,
276
280
  this.fiveDollarsSelected,
277
281
  this.showPresetAmounts
278
- )), this.showPresetAmounts && (this.selectedOption = w);
282
+ )), this.showPresetAmounts && (this.selectedOption = A);
279
283
  }
280
284
  },
285
+ mounted() {
286
+ typeof window < "u" && (this.viewportWidth = window.innerWidth, this.resizeHandler = C(() => {
287
+ this.viewportWidth = window.innerWidth;
288
+ }, 50), window.addEventListener("resize", this.resizeHandler));
289
+ },
290
+ beforeDestroy() {
291
+ this.resizeHandler && typeof window < "u" && window.removeEventListener("resize", this.resizeHandler);
292
+ },
281
293
  methods: {
282
294
  async addToBasket() {
283
295
  this.kvTrackFunction(
@@ -325,7 +337,7 @@ const w = "Other", nt = T`
325
337
  t,
326
338
  this.loanId,
327
339
  this.loanId
328
- ), this.selectedOption = t, this.selectedDropdownOption = w;
340
+ ), this.selectedOption = t, this.selectedDropdownOption = A;
329
341
  },
330
342
  handleCheckout() {
331
343
  this.kvTrackFunction(
@@ -337,185 +349,307 @@ const w = "Other", nt = T`
337
349
  );
338
350
  }
339
351
  }
340
- }, V = { class: "tw-whitespace-nowrap" }, K = {
352
+ }, E = { class: "tw-whitespace-nowrap" }, R = {
341
353
  key: 2,
342
354
  class: "tw-w-full tw-text-center tw-rounded tw-p-2",
343
355
  style: { background: "#f1f1f1" }
344
- }, M = { class: "tw-flex" }, R = ["disabled"], E = {
356
+ }, U = { class: "tw-flex" }, z = { class: "md:tw-hidden tw-w-full" }, H = ["disabled"], K = { class: "tw-flex tw-gap-1 lg:tw-gap-2" }, W = ["value"], j = {
357
+ key: 0,
358
+ class: "tw-flex tw-gap-1 tw-mt-1"
359
+ }, q = ["value"], G = {
360
+ key: 1,
361
+ class: "tw-mt-1 mobile-cta-row"
362
+ }, J = { class: "tw-hidden md:tw-block tw-w-full" }, Q = ["disabled"], X = {
345
363
  key: 0,
346
364
  class: "tw-flex tw-gap-1 lg:tw-gap-2 tw-flex-wrap md:tw-flex-nowrap"
347
- }, U = ["value"], z = {
365
+ }, Y = ["value"], Z = {
348
366
  key: 1,
349
367
  class: "amountDropdownWrapper"
350
- }, H = ["value"];
351
- function j(t, n, s, A, u, e) {
352
- const h = k("kv-ui-button"), x = k("kv-material-icon"), L = k("kv-ui-select"), b = k("kv-lend-amount-button");
353
- return i(), a("div", V, [
354
- e.isInBasket ? (i(), r(h, {
368
+ }, $ = ["value"];
369
+ function ee(t, s, i, p, a, e) {
370
+ const c = b("kv-ui-button"), x = b("kv-material-icon"), B = b("kv-ui-select"), L = b("kv-lend-amount-button");
371
+ return o(), d("div", E, [
372
+ e.isInBasket ? (o(), l(c, {
355
373
  key: 0,
356
374
  variant: "secondary",
357
375
  class: "tw-inline-flex tw-flex-1 tw-w-full",
358
376
  "data-testid": "bp-lend-cta-checkout-button",
359
- to: s.externalLinks ? void 0 : "/basket",
360
- href: s.externalLinks ? "/basket" : void 0,
361
- onClick: n[0] || (n[0] = (o) => e.clickSecondaryButton(o))
377
+ to: i.externalLinks ? void 0 : "/basket",
378
+ href: i.externalLinks ? "/basket" : void 0,
379
+ onClick: s[0] || (s[0] = (n) => e.clickSecondaryButton(n))
362
380
  }, {
363
- default: d(() => [
364
- c(m(e.loanInBasketButtonText), 1)
381
+ default: u(() => [
382
+ w(h(e.loanInBasketButtonText), 1)
365
383
  ]),
366
384
  _: 1
367
- }, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (i(), r(h, {
385
+ }, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (o(), l(c, {
368
386
  key: 1,
369
387
  class: "tw-inline-flex tw-flex-1"
370
388
  }, {
371
- default: d(() => [
372
- c(m(e.ctaButtonText), 1)
389
+ default: u(() => [
390
+ w(h(e.ctaButtonText), 1)
373
391
  ]),
374
392
  _: 1
375
- })) : e.isFunded ? (i(), a("div", K, " This loan was just funded! 🎉 ")) : s.showViewLoan ? (i(), r(h, {
393
+ })) : e.isFunded ? (o(), d("div", R, " This loan was just funded! 🎉 ")) : i.showViewLoan ? (o(), l(c, {
376
394
  key: 3,
377
395
  state: `${e.allSharesReserved ? "disabled" : ""}`,
378
- to: s.externalLinks ? void 0 : e.readMorePath,
379
- href: s.externalLinks ? e.readMorePath : void 0,
396
+ to: i.externalLinks ? void 0 : e.readMorePath,
397
+ href: i.externalLinks ? e.readMorePath : void 0,
380
398
  class: "tw-mb-0",
381
- onClick: n[1] || (n[1] = (o) => t.$emit("show-loan-details", o))
399
+ onClick: s[1] || (s[1] = (n) => t.$emit("show-loan-details", n))
382
400
  }, {
383
- default: d(() => [
384
- p("span", M, [
385
- n[5] || (n[5] = c(" View loan ")),
386
- I(x, {
401
+ default: u(() => [
402
+ f("span", U, [
403
+ s[7] || (s[7] = w(" View loan ")),
404
+ N(x, {
387
405
  class: "tw-w-3 tw-h-3 tw-align-middle",
388
- icon: u.mdiChevronRight
406
+ icon: a.mdiChevronRight
389
407
  }, null, 8, ["icon"])
390
408
  ])
391
409
  ]),
392
410
  _: 1
393
- }, 8, ["state", "to", "href"])) : e.useFormSubmit ? (i(), a("form", {
411
+ }, 8, ["state", "to", "href"])) : e.useFormSubmit ? (o(), d("form", {
394
412
  key: 4,
395
413
  class: "tw-w-full tw-flex",
396
- onSubmit: n[4] || (n[4] = y((...o) => e.addToBasket && e.addToBasket(...o), ["prevent"]))
414
+ onSubmit: s[6] || (s[6] = v((...n) => e.addToBasket && e.addToBasket(...n), ["prevent"]))
397
415
  }, [
398
- p("fieldset", {
399
- class: f(["tw-w-full tw-flex", {
400
- "tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": s.showPresetAmounts,
401
- "tw-gap-1.5": s.showPresetAmounts && !e.isLendAmountButton
402
- }]),
403
- disabled: s.isAdding,
404
- "data-testid": "bp-lend-cta-select-and-button"
405
- }, [
406
- s.showPresetAmounts && !s.isAdding ? (i(), a("div", E, [
407
- e.isLendAmountButton ? l("", !0) : (i(!0), a(B, { key: 0 }, v(e.presetButtonsPrices, (o) => (i(), r(h, {
408
- key: o,
409
- variant: "secondary",
410
- class: f(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": u.selectedOption == o }]),
411
- "data-testid": "bp-lend-cta-lend-button",
412
- onClick: (q) => e.clickPresetButton(o)
413
- }, {
414
- default: d(() => [
415
- c(" $" + m(o), 1)
416
+ f("div", z, [
417
+ f("fieldset", {
418
+ class: "tw-w-full tw-min-w-0",
419
+ disabled: i.isAdding,
420
+ "data-testid": "bp-lend-cta-select-and-button-mobile"
421
+ }, [
422
+ i.isAdding ? r("", !0) : (o(), d(k, { key: 0 }, [
423
+ f("div", K, [
424
+ e.isLendAmountButton ? r("", !0) : (o(!0), d(k, { key: 0 }, y(e.presetButtonsPrices, (n) => (o(), l(c, {
425
+ key: "m-" + n,
426
+ variant: "secondary",
427
+ class: m(["preset-option tw-basis-0 tw-flex-1 tw-min-w-0", { "selected-option": a.selectedOption == n }]),
428
+ "data-testid": "bp-lend-cta-lend-button-mobile",
429
+ onClick: (T) => e.clickPresetButton(n)
430
+ }, {
431
+ default: u(() => [
432
+ w(" $" + h(n), 1)
433
+ ]),
434
+ _: 2
435
+ }, 1032, ["class", "onClick"]))), 128)),
436
+ e.showFilteredDropdown && a.viewportWidth > 325 ? (o(), l(B, {
437
+ key: 1,
438
+ id: `LoanAmountDropdownMobile_${e.loanId}`,
439
+ modelValue: a.selectedDropdownOption,
440
+ "onUpdate:modelValue": [
441
+ s[2] || (s[2] = (n) => a.selectedDropdownOption = n),
442
+ e.trackLendAmountSelection
443
+ ],
444
+ class: m(["filtered-dropdown tw-rounded tw-w-auto tw-flex-none mobile-other-dd tw-min-w-max", {
445
+ "unselected-dropdown": !e.selectedDropdown,
446
+ "selected-dropdown": e.selectedDropdown
447
+ }]),
448
+ "aria-label": "Lend amount",
449
+ onClick: v(e.clickDropdown, ["stop"])
450
+ }, {
451
+ default: u(() => [
452
+ (o(!0), d(k, null, y(e.presetDropdownPrices, (n) => (o(), d("option", {
453
+ key: "m-" + n,
454
+ value: n
455
+ }, h(n !== a.OTHER_OPTION ? `$${n}` : n), 9, W))), 128))
456
+ ]),
457
+ _: 1
458
+ }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : r("", !0)
416
459
  ]),
417
- _: 2
418
- }, 1032, ["class", "onClick"]))), 128)),
419
- e.showFilteredDropdown ? (i(), r(L, {
460
+ a.viewportWidth <= 325 ? (o(), d("div", j, [
461
+ e.showFilteredDropdown ? (o(), l(B, {
462
+ key: 0,
463
+ id: `LoanAmountDropdownMobile_${e.loanId}`,
464
+ modelValue: a.selectedDropdownOption,
465
+ "onUpdate:modelValue": [
466
+ s[3] || (s[3] = (n) => a.selectedDropdownOption = n),
467
+ e.trackLendAmountSelection
468
+ ],
469
+ class: m(["filtered-dropdown tw-rounded tw-w-auto tw-flex-none mobile-other-dd", {
470
+ "unselected-dropdown": !e.selectedDropdown,
471
+ "selected-dropdown": e.selectedDropdown
472
+ }]),
473
+ "aria-label": "Lend amount",
474
+ style: { "min-width": "90px", "max-width": "110px" },
475
+ onClick: v(e.clickDropdown, ["stop"])
476
+ }, {
477
+ default: u(() => [
478
+ (o(!0), d(k, null, y(e.presetDropdownPrices, (n) => (o(), d("option", {
479
+ key: "m-" + n,
480
+ value: n
481
+ }, h(n !== a.OTHER_OPTION ? `$${n}` : n), 9, q))), 128))
482
+ ]),
483
+ _: 1
484
+ }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : r("", !0),
485
+ e.lendButtonVisibility && !e.isLessThan25 && !e.hideLendButton ? (o(), l(c, {
486
+ key: "lendButtonMobile",
487
+ class: "button-ellipsis tw-flex-1",
488
+ "data-testid": "bp-lend-cta-lend-button-mobile",
489
+ type: "submit"
490
+ }, {
491
+ default: u(() => [
492
+ w(h(e.ctaButtonText), 1)
493
+ ]),
494
+ _: 1
495
+ })) : r("", !0)
496
+ ])) : (o(), d("div", G, [
497
+ e.lendButtonVisibility && !e.isLessThan25 && !e.hideLendButton ? (o(), l(c, {
498
+ key: "lendButtonMobile",
499
+ class: "button-ellipsis tw-w-full",
500
+ "data-testid": "bp-lend-cta-lend-button-mobile",
501
+ type: "submit"
502
+ }, {
503
+ default: u(() => [
504
+ w(h(e.ctaButtonText), 1)
505
+ ]),
506
+ _: 1
507
+ })) : r("", !0)
508
+ ]))
509
+ ], 64)),
510
+ !i.isLoading && i.isAdding ? (o(), l(c, {
420
511
  key: 1,
421
- id: `LoanAmountDropdown_${e.loanId}`,
422
- modelValue: u.selectedDropdownOption,
423
- "onUpdate:modelValue": [
424
- n[2] || (n[2] = (o) => u.selectedDropdownOption = o),
425
- e.trackLendAmountSelection
426
- ],
427
- class: f(["tw-min-w-12 tw-rounded filtered-dropdown tw-w-full", {
428
- "unselected-dropdown": !e.selectedDropdown,
429
- "selected-dropdown": e.selectedDropdown
430
- }]),
431
- "aria-label": "Lend amount",
432
- onClick: y(e.clickDropdown, ["stop"])
512
+ class: "tw-inline-flex tw-flex-1 tw-w-full"
433
513
  }, {
434
- default: d(() => [
435
- (i(!0), a(B, null, v(e.presetDropdownPrices, (o) => (i(), a("option", {
436
- key: o,
437
- value: o
438
- }, m(o !== u.OTHER_OPTION ? `$${o}` : o), 9, U))), 128))
439
- ]),
514
+ default: u(() => s[8] || (s[8] = [
515
+ w(" Adding to basket ")
516
+ ])),
440
517
  _: 1
441
- }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : l("", !0)
442
- ])) : s.showPresetAmounts ? l("", !0) : (i(), a("div", z, [
443
- e.hideShowLendDropdown && !e.isLessThan25 ? (i(), r(L, {
444
- key: 0,
445
- id: `LoanAmountDropdown_${e.loanId}`,
446
- modelValue: u.selectedOption,
447
- "onUpdate:modelValue": [
448
- n[3] || (n[3] = (o) => u.selectedOption = o),
449
- e.trackLendAmountSelection
450
- ],
451
- class: "tw-min-w-12",
452
- style: { "border-radius": "14px 0 0 14px" },
453
- "aria-label": "Lend amount",
454
- onClick: y(e.clickDropdown, ["stop"])
455
- }, {
456
- default: d(() => [
457
- (i(!0), a(B, null, v(e.prices, (o) => (i(), a("option", {
458
- key: o,
459
- value: o
460
- }, " $" + m(o), 9, H))), 128))
461
- ]),
462
- _: 1
463
- }, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : l("", !0)
464
- ])),
465
- p("div", {
466
- class: f({
467
- "tw-min-w-0": s.showPresetAmounts,
468
- lendButtonWrapper: e.hideShowLendDropdown && !s.showPresetAmounts,
469
- "tw-hidden": e.hideLendButton
470
- })
518
+ })) : r("", !0),
519
+ e.isLendAmountButton && !i.enableFiveDollarsNotes ? (o(), l(L, {
520
+ key: 2,
521
+ class: "tw-w-full",
522
+ "loan-id": e.loanId,
523
+ "show-now": !1,
524
+ "amount-left": e.amountForLendAmountButton,
525
+ "is-adding": i.isAdding,
526
+ onAddToBasket: e.addToBasket
527
+ }, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : r("", !0)
528
+ ], 8, H)
529
+ ]),
530
+ f("div", J, [
531
+ f("fieldset", {
532
+ class: m(["tw-w-full tw-flex", {
533
+ "tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": i.showPresetAmounts,
534
+ "tw-gap-1.5": i.showPresetAmounts && !e.isLendAmountButton
535
+ }]),
536
+ disabled: i.isAdding,
537
+ "data-testid": "bp-lend-cta-select-and-button"
471
538
  }, [
472
- e.lendButtonVisibility && !e.isLessThan25 ? (i(), r(h, {
473
- key: "lendButton",
474
- class: f(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": s.showPresetAmounts }]),
475
- "data-testid": "bp-lend-cta-lend-button",
476
- type: "submit"
477
- }, {
478
- default: d(() => [
479
- c(m(e.ctaButtonText), 1)
480
- ]),
481
- _: 1
482
- }, 8, ["class"])) : e.showLendAgain ? (i(), r(h, {
483
- key: "lendAgainButton",
484
- class: f(["lend-again", { "tw-w-full": s.showPresetAmounts }]),
485
- "data-testid": "bp-lend-cta-lend-again-button",
486
- type: "submit"
539
+ i.showPresetAmounts && !i.isAdding ? (o(), d("div", X, [
540
+ e.isLendAmountButton ? r("", !0) : (o(!0), d(k, { key: 0 }, y(e.presetButtonsPrices, (n) => (o(), l(c, {
541
+ key: n,
542
+ variant: "secondary",
543
+ class: m(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": a.selectedOption == n }]),
544
+ "data-testid": "bp-lend-cta-lend-button",
545
+ onClick: (T) => e.clickPresetButton(n)
546
+ }, {
547
+ default: u(() => [
548
+ w(" $" + h(n), 1)
549
+ ]),
550
+ _: 2
551
+ }, 1032, ["class", "onClick"]))), 128)),
552
+ e.showFilteredDropdown ? (o(), l(B, {
553
+ key: 1,
554
+ id: `LoanAmountDropdown_${e.loanId}`,
555
+ modelValue: a.selectedDropdownOption,
556
+ "onUpdate:modelValue": [
557
+ s[4] || (s[4] = (n) => a.selectedDropdownOption = n),
558
+ e.trackLendAmountSelection
559
+ ],
560
+ class: m(["tw-min-w-12 tw-rounded filtered-dropdown tw-w-full", {
561
+ "unselected-dropdown": !e.selectedDropdown,
562
+ "selected-dropdown": e.selectedDropdown
563
+ }]),
564
+ "aria-label": "Lend amount",
565
+ onClick: v(e.clickDropdown, ["stop"])
566
+ }, {
567
+ default: u(() => [
568
+ (o(!0), d(k, null, y(e.presetDropdownPrices, (n) => (o(), d("option", {
569
+ key: n,
570
+ value: n
571
+ }, h(n !== a.OTHER_OPTION ? `$${n}` : n), 9, Y))), 128))
572
+ ]),
573
+ _: 1
574
+ }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : r("", !0)
575
+ ])) : i.showPresetAmounts ? r("", !0) : (o(), d("div", Z, [
576
+ e.hideShowLendDropdown && !e.isLessThan25 ? (o(), l(B, {
577
+ key: 0,
578
+ id: `LoanAmountDropdown_${e.loanId}`,
579
+ modelValue: a.selectedOption,
580
+ "onUpdate:modelValue": [
581
+ s[5] || (s[5] = (n) => a.selectedOption = n),
582
+ e.trackLendAmountSelection
583
+ ],
584
+ class: "tw-min-w-12",
585
+ style: { "border-radius": "14px 0 0 14px" },
586
+ "aria-label": "Lend amount",
587
+ onClick: v(e.clickDropdown, ["stop"])
588
+ }, {
589
+ default: u(() => [
590
+ (o(!0), d(k, null, y(e.prices, (n) => (o(), d("option", {
591
+ key: n,
592
+ value: n
593
+ }, " $" + h(n), 9, $))), 128))
594
+ ]),
595
+ _: 1
596
+ }, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : r("", !0)
597
+ ])),
598
+ f("div", {
599
+ class: m({
600
+ "tw-min-w-0": i.showPresetAmounts,
601
+ lendButtonWrapper: e.hideShowLendDropdown && !i.showPresetAmounts,
602
+ "tw-hidden": e.hideLendButton
603
+ })
604
+ }, [
605
+ e.lendButtonVisibility && !e.isLessThan25 ? (o(), l(c, {
606
+ key: "lendButton",
607
+ class: m(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": i.showPresetAmounts }]),
608
+ "data-testid": "bp-lend-cta-lend-button",
609
+ type: "submit"
610
+ }, {
611
+ default: u(() => [
612
+ w(h(e.ctaButtonText), 1)
613
+ ]),
614
+ _: 1
615
+ }, 8, ["class"])) : e.showLendAgain ? (o(), l(c, {
616
+ key: "lendAgainButton",
617
+ class: m(["lend-again", { "tw-w-full": i.showPresetAmounts }]),
618
+ "data-testid": "bp-lend-cta-lend-again-button",
619
+ type: "submit"
620
+ }, {
621
+ default: u(() => [
622
+ w(h(i.primaryButtonText || "Lend") + " again ", 1)
623
+ ]),
624
+ _: 1
625
+ }, 8, ["class"])) : r("", !0)
626
+ ], 2),
627
+ e.isLendAmountButton && !i.enableFiveDollarsNotes ? (o(), l(L, {
628
+ key: 2,
629
+ class: "tw-w-full",
630
+ "loan-id": e.loanId,
631
+ "show-now": !1,
632
+ "amount-left": e.amountForLendAmountButton,
633
+ "is-adding": i.isAdding,
634
+ onAddToBasket: e.addToBasket
635
+ }, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : r("", !0),
636
+ !i.isLoading && i.isAdding ? (o(), l(c, {
637
+ key: 3,
638
+ class: "tw-inline-flex tw-flex-1"
487
639
  }, {
488
- default: d(() => [
489
- c(m(s.primaryButtonText || "Lend") + " again ", 1)
490
- ]),
640
+ default: u(() => s[9] || (s[9] = [
641
+ w(" Adding to basket ")
642
+ ])),
491
643
  _: 1
492
- }, 8, ["class"])) : l("", !0)
493
- ], 2),
494
- e.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), r(b, {
495
- key: 2,
496
- class: "tw-w-full",
497
- "loan-id": e.loanId,
498
- "show-now": !1,
499
- "amount-left": e.amountForLendAmountButton,
500
- "is-adding": s.isAdding,
501
- onAddToBasket: e.addToBasket
502
- }, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : l("", !0),
503
- !s.isLoading && s.isAdding ? (i(), r(h, {
504
- key: 3,
505
- class: "tw-inline-flex tw-flex-1"
506
- }, {
507
- default: d(() => n[6] || (n[6] = [
508
- c(" Adding to basket ")
509
- ])),
510
- _: 1
511
- })) : l("", !0)
512
- ], 10, R)
513
- ], 32)) : l("", !0)
644
+ })) : r("", !0)
645
+ ], 10, Q)
646
+ ])
647
+ ], 32)) : r("", !0)
514
648
  ]);
515
649
  }
516
- const ot = /* @__PURE__ */ N(O, [["render", j], ["__scopeId", "data-v-b607e1c2"]]);
650
+ const me = /* @__PURE__ */ O(M, [["render", ee], ["__scopeId", "data-v-ce2eaa1b"]]);
517
651
  export {
518
- nt as KV_LEND_CTA_FRAGMENT,
519
- st as KV_LEND_CTA_USER_FRAGMENT,
520
- ot as default
652
+ ce as KV_LEND_CTA_FRAGMENT,
653
+ we as KV_LEND_CTA_USER_FRAGMENT,
654
+ me as default
521
655
  };
@@ -1 +1 @@
1
- .header-link[data-v-c569a6b0]{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-c569a6b0]: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-c569a6b0]{padding-left:1.25rem;padding-right:1.25rem}}
1
+ .header-link[data-v-ae8c3f96]{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-ae8c3f96]: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-ae8c3f96]{padding-left:1.25rem;padding-right:1.25rem}}
@@ -1,19 +1,19 @@
1
- import { defineAsyncComponent as f, ref as a, computed as O, onMounted as S, onUnmounted as E, resolveComponent as M, resolveDirective as P, openBlock as i, createElementBlock as m, withDirectives as d, normalizeClass as g, createVNode as B, createBlock as b, withCtx as I, createTextVNode as v, createElementVNode as T, createCommentVNode as c, toDisplayString as V } from "vue";
2
- import { mdiAccountCircle as z, mdiChevronDown as W, mdiMagnify as j, mdiMenu as F } from "@mdi/js";
3
- import q from "numeral";
4
- import G from "../KvMaterialIcon.js";
5
- import J from "../KvIconBag.js";
6
- import Q from "./KvHeaderDropdownLink.js";
7
- import R from "../KvUserAvatar.js";
8
- import { throttle as X } from "../../utils/throttle.js";
1
+ import { defineAsyncComponent as w, ref as l, computed as P, onMounted as z, onUnmounted as W, resolveComponent as g, resolveDirective as j, openBlock as i, createElementBlock as c, withDirectives as u, normalizeClass as b, createVNode as U, createBlock as h, withCtx as p, createTextVNode as M, createElementVNode as D, createCommentVNode as k, toDisplayString as F } from "vue";
2
+ import { mdiAccountCircle as q, mdiChevronDown as G, mdiMagnify as J, mdiMenu as Q } from "@mdi/js";
3
+ import X from "numeral";
4
+ import Y from "../KvMaterialIcon.js";
5
+ import Z from "../KvIconBag.js";
6
+ import $ from "./KvHeaderDropdownLink.js";
7
+ import ee from "../KvUserAvatar.js";
8
+ import { throttle as ne } from "../../utils/throttle.js";
9
9
  import "./KvHeaderLinkBar.css";
10
- import Y from "../../_virtual/_plugin-vue_export-helper.js";
11
- const Z = f(() => import("./KvHeaderMobileMenu.js")), C = f(() => import("./KvHeaderMyKivaMenu.js")), $ = f(() => import("./LendMenu/KvLendMenu.js")), ee = f(() => import("./KvHeaderTakeActionMenu.js")), ne = f(() => import("./KvHeaderAboutMenu.js")), D = 118, oe = {
10
+ import te from "../../_virtual/_plugin-vue_export-helper.js";
11
+ const oe = w(() => import("./KvHeaderMobileMenu.js")), O = w(() => import("./KvHeaderMyKivaMenu.js")), re = w(() => import("./LendMenu/KvLendMenu.js")), le = w(() => import("./KvHeaderTakeActionMenu.js")), ie = w(() => import("./KvHeaderAboutMenu.js")), C = 118, T = "avatar-menu", ae = {
12
12
  components: {
13
- KvMaterialIcon: G,
14
- KvIconBag: J,
15
- KvHeaderDropdownLink: Q,
16
- KvUserAvatar: R
13
+ KvMaterialIcon: Y,
14
+ KvIconBag: Z,
15
+ KvHeaderDropdownLink: $,
16
+ KvUserAvatar: ee
17
17
  },
18
18
  props: {
19
19
  loggedIn: {
@@ -56,175 +56,188 @@ const Z = f(() => import("./KvHeaderMobileMenu.js")), C = f(() => import("./KvHe
56
56
  emits: [
57
57
  "item-hover"
58
58
  ],
59
- setup(u, { emit: e }) {
60
- const o = a(null), n = a(null), x = a(null), h = a(null), p = a(null), s = a(null), H = a(null), y = a(null), r = a(null), t = (l, w, k = null) => {
61
- e("item-hover", l, w, k);
62
- }, K = () => {
63
- var L, N;
64
- const l = (N = (L = o.value) == null ? void 0 : L.userAvatar) == null ? void 0 : N.getBoundingClientRect();
65
- let w = null, k = !1;
66
- if (l) {
67
- const U = (l == null ? void 0 : l.left) + (l == null ? void 0 : l.width) / 2 - D / 2;
68
- U + D > window.outerWidth && (k = !0), w = {
69
- ...k ? { right: 0 } : { left: u.isMobile ? 0 : `${U}px` },
70
- borderRadius: "0px 0px 8px 8px",
71
- width: `${u.isMobile ? "100%" : "auto"}`
72
- };
73
- }
74
- t(o.value, C, w);
75
- }, A = X(() => {
76
- u.openMenuItem && K();
77
- }, 50), _ = O(() => u.isMobile ? void 0 : "/lend-by-category");
78
- return S(() => {
79
- import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", A);
80
- }), E(() => {
81
- window.removeEventListener("resize", A);
59
+ setup(d, { emit: e }) {
60
+ const t = l(null), n = l(null), K = l(null), x = l(null), A = l(null), f = l(null), H = l(null), y = l(null), a = l(null), o = l(null), m = (r, v, s = null) => {
61
+ e("item-hover", r, v, s);
62
+ }, _ = (r, v, s = null) => {
63
+ d.isMobile || m(r, v, s);
64
+ }, S = (r) => {
65
+ o.value === r && (o.value = null, m());
66
+ }, E = () => {
67
+ var B, N;
68
+ const r = (N = (B = t.value) == null ? void 0 : B.userAvatar) == null ? void 0 : N.getBoundingClientRect();
69
+ if (!r) return null;
70
+ const s = r.left + r.width / 2 - C / 2;
71
+ return {
72
+ ...s + C > window.outerWidth ? { right: 0 } : { left: d.isMobile ? 0 : `${s}px` },
73
+ borderRadius: "0px 0px 8px 8px",
74
+ width: d.isMobile ? "100%" : "auto"
75
+ };
76
+ }, I = () => {
77
+ o.value = T, m(t.value, O, E());
78
+ }, V = (r, v) => {
79
+ !o.value || o.value !== r ? (o.value = r, r === T ? I() : m(r, v)) : (o.value = null, m());
80
+ }, L = ne(() => {
81
+ d.openMenuItem && I();
82
+ }, 50), R = P(() => d.isMobile ? void 0 : "/lend-by-category");
83
+ return z(() => {
84
+ import("./KvHeaderMobileMenu.js"), import("./KvHeaderMyKivaMenu.js"), import("./LendMenu/KvLendMenu.js"), import("./KvHeaderTakeActionMenu.js"), import("./KvHeaderAboutMenu.js"), window.addEventListener("resize", L);
85
+ }), W(() => {
86
+ window.removeEventListener("resize", L);
82
87
  }), {
83
- numeral: q,
84
- mdiAccountCircle: z,
85
- mdiChevronDown: W,
86
- mdiMagnify: j,
87
- mdiMenu: F,
88
- onHover: t,
89
- avatar: o,
88
+ AVATAR_MENU_ID: T,
89
+ openMenuId: o,
90
+ numeral: X,
91
+ mdiAccountCircle: q,
92
+ mdiChevronDown: G,
93
+ mdiMagnify: J,
94
+ mdiMenu: Q,
95
+ onHover: m,
96
+ avatar: t,
90
97
  lendButton: n,
91
- aboutUsLink: x,
92
- partnerWithUsLink: h,
93
- borrowLink: p,
94
- supportKivaLink: s,
98
+ aboutUsLink: K,
99
+ partnerWithUsLink: x,
100
+ borrowLink: A,
101
+ supportKivaLink: f,
95
102
  basketLink: H,
96
103
  signInLink: y,
97
- menuButton: r,
98
- lendUrl: _,
99
- handleAvatarMenuPosition: K,
100
- KvHeaderMobileMenu: Z,
101
- KvHeaderMyKivaMenu: C,
102
- KvLendMenu: $,
103
- KvHeaderTakeActionMenu: ee,
104
- KvHeaderAboutMenu: ne
104
+ menuButton: a,
105
+ lendUrl: R,
106
+ handleOnHover: _,
107
+ handleTouchStart: V,
108
+ handleMouseOut: S,
109
+ handleAvatarMenuPosition: I,
110
+ KvHeaderMobileMenu: oe,
111
+ KvHeaderMyKivaMenu: O,
112
+ KvLendMenu: re,
113
+ KvHeaderTakeActionMenu: le,
114
+ KvHeaderAboutMenu: ie
105
115
  };
106
116
  }
107
- }, te = { class: "tw-h-full tw-flex tw-items-center" }, ie = ["href"], re = {
117
+ }, ue = { class: "tw-h-full tw-flex tw-items-center" }, de = ["href"], me = {
108
118
  key: 0,
109
119
  class: "tw-bg-eco-green-1 tw-py-0.5 tw-px-1 tw-text-eco-green-4"
110
- }, le = ["href"];
111
- function ae(u, e, o, n, x, h) {
112
- const p = M("kv-material-icon"), s = M("KvHeaderDropdownLink"), H = M("kv-icon-bag"), y = M("KvUserAvatar"), r = P("kv-track-event");
113
- return i(), m("div", te, [
114
- d((i(), m("button", {
120
+ }, ve = ["href"];
121
+ function se(d, e, t, n, K, x) {
122
+ const A = g("kv-material-icon"), f = g("KvHeaderDropdownLink"), H = g("kv-icon-bag"), y = g("KvUserAvatar"), a = j("kv-track-event");
123
+ return i(), c("div", ue, [
124
+ u((i(), c("button", {
115
125
  ref: "menuButton",
116
- class: g(["header-link tw-inline-flex lg:tw-hidden", {
117
- "tw-text-tertiary": o.openMenuItem && o.openMenuItem !== n.KvHeaderMobileMenu
126
+ class: b(["header-link tw-inline-flex lg:tw-hidden", {
127
+ "tw-text-tertiary": t.openMenuItem && t.openMenuItem !== n.KvHeaderMobileMenu
118
128
  }]),
119
- onMouseover: e[0] || (e[0] = (t) => n.onHover(n.menuButton, n.KvHeaderMobileMenu)),
120
- onMouseout: e[1] || (e[1] = (t) => n.onHover())
129
+ onMouseover: e[0] || (e[0] = (o) => n.handleOnHover(n.menuButton, n.KvHeaderMobileMenu)),
130
+ onMouseout: e[1] || (e[1] = (o) => n.handleMouseOut("menuButton")),
131
+ onTouchstart: e[2] || (e[2] = (o) => n.handleTouchStart("menuButton", n.KvHeaderMobileMenu))
121
132
  }, [
122
- B(p, { icon: n.mdiMenu }, null, 8, ["icon"])
133
+ U(A, { icon: n.mdiMenu }, null, 8, ["icon"])
123
134
  ], 34)), [
124
- [r, o.openMenuItem === n.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
135
+ [a, t.openMenuItem === n.KvHeaderMobileMenu ? ["TopNav", "click-Hamburger-menu"] : null]
125
136
  ]),
126
- d((i(), b(s, {
137
+ u((i(), h(f, {
127
138
  "ref-name": "lendButton",
128
139
  href: n.lendUrl,
129
140
  "menu-component": n.KvLendMenu,
130
- "open-menu-item": o.openMenuItem,
141
+ "open-menu-item": t.openMenuItem,
131
142
  "dropdown-icon": n.mdiChevronDown,
132
143
  "base-class": "tw-inline-flex",
133
- onOnHover: n.onHover,
134
- onMouseout: e[2] || (e[2] = (t) => n.onHover())
144
+ onOnHover: n.handleOnHover,
145
+ onMouseout: e[3] || (e[3] = (o) => n.handleMouseOut("lendButton")),
146
+ onTouchstart: e[4] || (e[4] = (o) => n.handleTouchStart("lendButton", n.KvLendMenu))
135
147
  }, {
136
- default: I(() => e[7] || (e[7] = [
137
- v(" Lend ")
148
+ default: p(() => e[10] || (e[10] = [
149
+ M(" Lend ")
138
150
  ])),
139
151
  _: 1
140
152
  }, 8, ["href", "menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
141
- [r, ["TopNav", "click-Lend"]]
153
+ [a, ["TopNav", "click-Lend"]]
142
154
  ]),
143
- d((i(), b(s, {
155
+ u((i(), h(f, {
144
156
  "ref-name": "takeActionButton",
145
157
  "base-class": "tw-hidden lg:tw-inline-flex",
146
158
  "menu-component": n.KvHeaderTakeActionMenu,
147
- "open-menu-item": o.openMenuItem,
159
+ "open-menu-item": t.openMenuItem,
148
160
  "dropdown-icon": n.mdiChevronDown,
149
161
  "send-link-position": "",
150
162
  onOnHover: n.onHover,
151
- onMouseout: e[3] || (e[3] = (t) => n.onHover())
163
+ onMouseout: e[5] || (e[5] = (o) => n.onHover())
152
164
  }, {
153
- default: I(() => e[8] || (e[8] = [
154
- v(" Take action ")
165
+ default: p(() => e[11] || (e[11] = [
166
+ M(" Take action ")
155
167
  ])),
156
168
  _: 1
157
169
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
158
- [r, ["TopNav", "click-TakeAction"]]
170
+ [a, ["TopNav", "click-TakeAction"]]
159
171
  ]),
160
- d((i(), b(s, {
172
+ u((i(), h(f, {
161
173
  "ref-name": "aboutUsLink",
162
174
  "base-class": "tw-hidden lg:tw-inline-flex",
163
175
  "menu-component": n.KvHeaderAboutMenu,
164
- "open-menu-item": o.openMenuItem,
176
+ "open-menu-item": t.openMenuItem,
165
177
  "dropdown-icon": n.mdiChevronDown,
166
178
  "send-link-position": "",
167
179
  onOnHover: n.onHover,
168
- onMouseout: e[4] || (e[4] = (t) => n.onHover())
180
+ onMouseout: e[6] || (e[6] = (o) => n.onHover())
169
181
  }, {
170
- default: I(() => e[9] || (e[9] = [
171
- v(" About ")
182
+ default: p(() => e[12] || (e[12] = [
183
+ M(" About ")
172
184
  ])),
173
185
  _: 1
174
186
  }, 8, ["menu-component", "open-menu-item", "dropdown-icon", "onOnHover"])), [
175
- [r, ["TopNav", "click-About"]]
187
+ [a, ["TopNav", "click-About"]]
176
188
  ]),
177
- e[12] || (e[12] = T("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
178
- o.loggedIn ? d((i(), m("a", {
189
+ e[15] || (e[15] = D("div", { class: "tw-flex-1 tw-h-full" }, null, -1)),
190
+ t.loggedIn ? u((i(), c("a", {
179
191
  key: 0,
180
192
  ref: "dashboardLink",
181
- href: o.myDashboardUrl,
182
- class: g(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!o.openMenuItem }])
183
- }, e[10] || (e[10] = [
184
- v(" My dashboard ")
185
- ]), 10, ie)), [
186
- [r, ["TopNav", "click-Dashboard"]]
187
- ]) : c("", !0),
188
- o.basketCount > 0 ? d((i(), m("a", {
193
+ href: t.myDashboardUrl,
194
+ class: b(["header-link tw-hidden lg:tw-block", { "tw-text-tertiary": !!t.openMenuItem }])
195
+ }, e[13] || (e[13] = [
196
+ M(" My dashboard ")
197
+ ]), 10, de)), [
198
+ [a, ["TopNav", "click-Dashboard"]]
199
+ ]) : k("", !0),
200
+ t.basketCount > 0 ? u((i(), c("a", {
189
201
  key: 1,
190
202
  ref: "basketLink",
191
203
  href: "/basket",
192
- class: g(["header-link tw-relative", { "tw-text-tertiary": !!o.openMenuItem }])
204
+ class: b(["header-link tw-relative", { "tw-text-tertiary": !!t.openMenuItem }])
193
205
  }, [
194
- B(H, {
206
+ U(H, {
195
207
  class: "tw-w-3 tw-h-3 tw-pointer-events-none",
196
- count: o.basketCount
208
+ count: t.basketCount
197
209
  }, null, 8, ["count"])
198
210
  ], 2)), [
199
- [r, ["TopNav", "click-Basket"]]
200
- ]) : c("", !0),
201
- T("div", {
211
+ [a, ["TopNav", "click-Basket"]]
212
+ ]) : k("", !0),
213
+ D("div", {
202
214
  class: "tw-cursor-pointer tw-flex tw-items-center tw-gap-1",
203
- onMouseover: e[5] || (e[5] = (...t) => n.handleAvatarMenuPosition && n.handleAvatarMenuPosition(...t)),
204
- onMouseout: e[6] || (e[6] = (t) => n.onHover())
215
+ onMouseover: e[7] || (e[7] = (...o) => n.handleAvatarMenuPosition && n.handleAvatarMenuPosition(...o)),
216
+ onMouseout: e[8] || (e[8] = (o) => n.handleMouseOut(n.AVATAR_MENU_ID)),
217
+ onTouchstart: e[9] || (e[9] = (o) => n.handleTouchStart(n.AVATAR_MENU_ID))
205
218
  }, [
206
- o.loggedIn ? (i(), m("span", re, V(n.numeral(o.balance).format("$0")), 1)) : c("", !0),
207
- o.loggedIn ? (i(), b(y, {
219
+ t.loggedIn ? (i(), c("span", me, F(n.numeral(t.balance).format("$0")), 1)) : k("", !0),
220
+ t.loggedIn ? (i(), h(y, {
208
221
  key: 1,
209
222
  ref: "avatar",
210
- "lender-name": o.lenderName,
211
- "lender-image-url": o.lenderImageUrl,
223
+ "lender-name": t.lenderName,
224
+ "lender-image-url": t.lenderImageUrl,
212
225
  "is-small": ""
213
- }, null, 8, ["lender-name", "lender-image-url"])) : c("", !0)
226
+ }, null, 8, ["lender-name", "lender-image-url"])) : k("", !0)
214
227
  ], 32),
215
- o.loggedIn ? c("", !0) : d((i(), m("a", {
228
+ t.loggedIn ? k("", !0) : u((i(), c("a", {
216
229
  key: 2,
217
230
  ref: "signInLink",
218
- href: o.loginUrl,
219
- class: g(["header-link", { "tw-text-tertiary": !!o.openMenuItem }])
220
- }, e[11] || (e[11] = [
221
- v(" Sign in ")
222
- ]), 10, le)), [
223
- [r, ["TopNav", "click-Sign-in"]]
231
+ href: t.loginUrl,
232
+ class: b(["header-link", { "tw-text-tertiary": !!t.openMenuItem }])
233
+ }, e[14] || (e[14] = [
234
+ M(" Sign in ")
235
+ ]), 10, ve)), [
236
+ [a, ["TopNav", "click-Sign-in"]]
224
237
  ])
225
238
  ]);
226
239
  }
227
- const pe = /* @__PURE__ */ Y(oe, [["render", ae], ["__scopeId", "data-v-c569a6b0"]]);
240
+ const Ie = /* @__PURE__ */ te(ae, [["render", se], ["__scopeId", "data-v-ae8c3f96"]]);
228
241
  export {
229
- pe as default
242
+ Ie as default
230
243
  };
@@ -1 +1 @@
1
- .mobile-link[data-v-c9569b42]{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.mobile-link[data-v-c9569b42]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
1
+ .mobile-link[data-v-463ea821]{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.mobile-link[data-v-463ea821]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
@@ -74,7 +74,10 @@ const b = {
74
74
  function $(H, e, M, S, p, V) {
75
75
  const c = k("KvAccordionItem"), i = v("kv-track-event");
76
76
  return t(), o("nav", _, [
77
- d(c, { class: "tw-w-full tw-border-b-0" }, {
77
+ d(c, {
78
+ open: "",
79
+ class: "tw-w-full tw-border-b-0"
80
+ }, {
78
81
  header: a(() => e[0] || (e[0] = [
79
82
  l("h3", null, "Take action", -1)
80
83
  ])),
@@ -147,7 +150,7 @@ function $(H, e, M, S, p, V) {
147
150
  })
148
151
  ]);
149
152
  }
150
- const q = /* @__PURE__ */ h(b, [["render", $], ["__scopeId", "data-v-c9569b42"]]);
153
+ const q = /* @__PURE__ */ h(b, [["render", $], ["__scopeId", "data-v-463ea821"]]);
151
154
  export {
152
155
  q as default
153
156
  };
@@ -1 +1 @@
1
- .header-margins[data-v-588c2857]{margin:0 auto;max-width:1400px}.header-fade-enter-active[data-v-588c2857]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-588c2857]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-588c2857],.header-fade-leave-to[data-v-588c2857]{opacity:0}.header-fade-leave[data-v-588c2857],.header-fade-enter-to[data-v-588c2857]{opacity:1}.bg-opacity-50[data-v-588c2857]{background-color:rgba(var(--bg-action-highlight),.5)}
1
+ .header-margins[data-v-c4b7061b]{margin:0 auto;max-width:1400px}.header-fade-enter-active[data-v-c4b7061b]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-c4b7061b]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-c4b7061b],.header-fade-leave-to[data-v-c4b7061b]{opacity:0}.header-fade-leave[data-v-c4b7061b],.header-fade-enter-to[data-v-c4b7061b]{opacity:1}.bg-opacity-50[data-v-c4b7061b]{background-color:rgba(var(--bg-action-highlight),.5)}
@@ -78,7 +78,7 @@ const T = {
78
78
  position: "absolute"
79
79
  })) : l.value && (d = setTimeout(() => {
80
80
  l.value = !1, a.value = null;
81
- }, 200));
81
+ }, 50));
82
82
  },
83
83
  loadMenuData: (_) => {
84
84
  var o;
@@ -101,7 +101,7 @@ const T = {
101
101
  style: { top: "3.75rem" }
102
102
  }, V = { class: "header-margins tw-px-2.5" };
103
103
  function z(I, n, e, t, l, a) {
104
- const s = c("kv-header-link-bar"), r = c("kv-header-logo"), d = c("kv-theme-provider"), w = M("kv-track-event");
104
+ const s = c("kv-header-link-bar"), r = c("kv-header-logo"), d = c("kv-theme-provider"), b = M("kv-track-event");
105
105
  return v(), y(d, { tag: "div" }, {
106
106
  default: f(() => [
107
107
  m("nav", S, [
@@ -127,7 +127,7 @@ function z(I, n, e, t, l, a) {
127
127
  g((v(), C("a", E, [
128
128
  u(r)
129
129
  ])), [
130
- [w, ["TopNav", "click-Logo"]]
130
+ [b, ["TopNav", "click-Logo"]]
131
131
  ])
132
132
  ]),
133
133
  u(k, { name: "header-fade" }, {
@@ -136,8 +136,8 @@ function z(I, n, e, t, l, a) {
136
136
  m("div", {
137
137
  class: "tw-bg-primary",
138
138
  style: H(t.menuPosition),
139
- onMouseover: n[0] || (n[0] = (b) => t.onHover(t.activeHeaderItem, t.menuComponent)),
140
- onMouseout: n[1] || (n[1] = (b) => t.onHover())
139
+ onMouseover: n[0] || (n[0] = (w) => t.onHover(t.activeHeaderItem, t.menuComponent)),
140
+ onMouseout: n[1] || (n[1] = (w) => t.onHover())
141
141
  }, [
142
142
  m("div", V, [
143
143
  (v(), y(B(t.menuComponent), {
@@ -163,7 +163,7 @@ function z(I, n, e, t, l, a) {
163
163
  _: 1
164
164
  });
165
165
  }
166
- const A = /* @__PURE__ */ N(T, [["render", z], ["__scopeId", "data-v-588c2857"]]);
166
+ const A = /* @__PURE__ */ N(T, [["render", z], ["__scopeId", "data-v-c4b7061b"]]);
167
167
  export {
168
168
  A as default
169
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.48.1",
3
+ "version": "6.49.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -113,5 +113,5 @@
113
113
  "embla-carousel-fade",
114
114
  "popper.js"
115
115
  ],
116
- "gitHead": "d6faecba8a629cf10ff434d9fdcbad291a517fe1"
116
+ "gitHead": "f03ff523198dcc597eebe95a49a39847fb1d37e0"
117
117
  }