@kiva/kv-components 6.49.0 → 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.
- package/dist/vue/KvLendCta.css +1 -1
- package/dist/vue/KvLendCta.js +323 -189
- package/package.json +2 -2
package/dist/vue/KvLendCta.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.amountDropdownWrapper[data-v-
|
|
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}}
|
package/dist/vue/KvLendCta.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mdiChevronRight as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`,
|
|
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:
|
|
29
|
-
KvUiButton:
|
|
30
|
-
KvUiSelect:
|
|
31
|
-
KvMaterialIcon:
|
|
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
|
-
|
|
112
|
-
|
|
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,
|
|
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
|
-
(
|
|
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:
|
|
142
|
-
OTHER_OPTION:
|
|
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,
|
|
163
|
-
return ((
|
|
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((
|
|
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),
|
|
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 ?
|
|
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(
|
|
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 !==
|
|
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,
|
|
268
|
-
var
|
|
269
|
-
t !==
|
|
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
|
-
(
|
|
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 =
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
365
|
+
}, Y = ["value"], Z = {
|
|
348
366
|
key: 1,
|
|
349
367
|
class: "amountDropdownWrapper"
|
|
350
|
-
},
|
|
351
|
-
function
|
|
352
|
-
const
|
|
353
|
-
return
|
|
354
|
-
e.isInBasket ? (
|
|
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:
|
|
360
|
-
href:
|
|
361
|
-
onClick:
|
|
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:
|
|
364
|
-
|
|
381
|
+
default: u(() => [
|
|
382
|
+
w(h(e.loanInBasketButtonText), 1)
|
|
365
383
|
]),
|
|
366
384
|
_: 1
|
|
367
|
-
}, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (
|
|
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:
|
|
372
|
-
|
|
389
|
+
default: u(() => [
|
|
390
|
+
w(h(e.ctaButtonText), 1)
|
|
373
391
|
]),
|
|
374
392
|
_: 1
|
|
375
|
-
})) : e.isFunded ? (
|
|
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:
|
|
379
|
-
href:
|
|
396
|
+
to: i.externalLinks ? void 0 : e.readMorePath,
|
|
397
|
+
href: i.externalLinks ? e.readMorePath : void 0,
|
|
380
398
|
class: "tw-mb-0",
|
|
381
|
-
onClick:
|
|
399
|
+
onClick: s[1] || (s[1] = (n) => t.$emit("show-loan-details", n))
|
|
382
400
|
}, {
|
|
383
|
-
default:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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:
|
|
406
|
+
icon: a.mdiChevronRight
|
|
389
407
|
}, null, 8, ["icon"])
|
|
390
408
|
])
|
|
391
409
|
]),
|
|
392
410
|
_: 1
|
|
393
|
-
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (
|
|
411
|
+
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (o(), d("form", {
|
|
394
412
|
key: 4,
|
|
395
413
|
class: "tw-w-full tw-flex",
|
|
396
|
-
onSubmit:
|
|
414
|
+
onSubmit: s[6] || (s[6] = v((...n) => e.addToBasket && e.addToBasket(...n), ["prevent"]))
|
|
397
415
|
}, [
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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
|
-
|
|
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:
|
|
435
|
-
(
|
|
436
|
-
|
|
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
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
id:
|
|
446
|
-
|
|
447
|
-
"
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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:
|
|
489
|
-
|
|
490
|
-
]),
|
|
640
|
+
default: u(() => s[9] || (s[9] = [
|
|
641
|
+
w(" Adding to basket ")
|
|
642
|
+
])),
|
|
491
643
|
_: 1
|
|
492
|
-
}
|
|
493
|
-
],
|
|
494
|
-
|
|
495
|
-
|
|
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
|
|
650
|
+
const me = /* @__PURE__ */ O(M, [["render", ee], ["__scopeId", "data-v-ce2eaa1b"]]);
|
|
517
651
|
export {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
652
|
+
ce as KV_LEND_CTA_FRAGMENT,
|
|
653
|
+
we as KV_LEND_CTA_USER_FRAGMENT,
|
|
654
|
+
me as default
|
|
521
655
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.49.
|
|
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": "
|
|
116
|
+
"gitHead": "f03ff523198dcc597eebe95a49a39847fb1d37e0"
|
|
117
117
|
}
|