@kiva/kv-components 5.3.5 → 5.3.6
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 +63 -62
- package/package.json +2 -2
package/dist/vue/KvLendCta.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.amountDropdownWrapper[data-v-
|
|
1
|
+
.amountDropdownWrapper[data-v-ca361825] select{border-radius:14px 0 0 14px}.lend-again[data-v-ca361825] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-ca361825] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-ca361825] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-ca361825] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-ca361825] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-ca361825] 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-option[data-v-ca361825] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
|
package/dist/vue/KvLendCta.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { mdiChevronRight as
|
|
2
|
-
import { getLendCtaSelectedOption as
|
|
1
|
+
import { mdiChevronRight as x } from "@mdi/js";
|
|
2
|
+
import { getLendCtaSelectedOption as L, getDropdownPriceArray as _ } from "../utils/loanUtils.js";
|
|
3
3
|
import C from "./KvLendAmountButton.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { resolveComponent as
|
|
4
|
+
import D from "./KvSelect.js";
|
|
5
|
+
import P from "./KvButton.js";
|
|
6
|
+
import S from "./KvMaterialIcon.js";
|
|
7
|
+
import { resolveComponent as k, openBlock as i, createElementBlock as a, createBlock as l, normalizeClass as r, withCtx as d, createTextVNode as m, toDisplayString as f, createElementVNode as A, createVNode as I, withModifiers as B, Fragment as v, renderList as p, createCommentVNode as u } from "vue";
|
|
8
8
|
import "./KvLendCta.css";
|
|
9
9
|
import F from "../_virtual/_plugin-vue_export-helper.js";
|
|
10
|
-
const
|
|
10
|
+
const w = "Other", O = {
|
|
11
11
|
name: "KvLendCta",
|
|
12
12
|
components: {
|
|
13
13
|
KvLendAmountButton: C,
|
|
14
|
-
KvUiButton:
|
|
15
|
-
KvUiSelect:
|
|
16
|
-
KvMaterialIcon:
|
|
14
|
+
KvUiButton: P,
|
|
15
|
+
KvUiSelect: D,
|
|
16
|
+
KvMaterialIcon: S
|
|
17
17
|
},
|
|
18
18
|
props: {
|
|
19
19
|
loan: {
|
|
@@ -104,9 +104,9 @@ const I = {
|
|
|
104
104
|
data() {
|
|
105
105
|
var e, s, n;
|
|
106
106
|
return {
|
|
107
|
-
mdiChevronRight:
|
|
107
|
+
mdiChevronRight: x,
|
|
108
108
|
defaultAmountOptions: [25, 50, 75],
|
|
109
|
-
selectedOption:
|
|
109
|
+
selectedOption: L(
|
|
110
110
|
this.getCookie,
|
|
111
111
|
this.setCookie,
|
|
112
112
|
this.enableFiveDollarsNotes,
|
|
@@ -115,7 +115,8 @@ const I = {
|
|
|
115
115
|
this.userBalance,
|
|
116
116
|
this.fiveDollarsSelected
|
|
117
117
|
),
|
|
118
|
-
selectedDropdownOption:
|
|
118
|
+
selectedDropdownOption: w,
|
|
119
|
+
OTHER_OPTION: w
|
|
119
120
|
};
|
|
120
121
|
},
|
|
121
122
|
computed: {
|
|
@@ -148,7 +149,7 @@ const I = {
|
|
|
148
149
|
},
|
|
149
150
|
prices() {
|
|
150
151
|
const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25);
|
|
151
|
-
return
|
|
152
|
+
return _(
|
|
152
153
|
this.unreservedAmount,
|
|
153
154
|
this.isCompleteLoanActive,
|
|
154
155
|
e,
|
|
@@ -165,7 +166,7 @@ const I = {
|
|
|
165
166
|
if (this.prices.length === 4)
|
|
166
167
|
return [];
|
|
167
168
|
const e = this.prices.slice(this.defaultAmountOptions.length);
|
|
168
|
-
return e.unshift(
|
|
169
|
+
return e.unshift(w), e;
|
|
169
170
|
},
|
|
170
171
|
loanName() {
|
|
171
172
|
var e;
|
|
@@ -231,7 +232,7 @@ const I = {
|
|
|
231
232
|
return this.isLentTo && !this.isLessThan25;
|
|
232
233
|
},
|
|
233
234
|
selectedDropdown() {
|
|
234
|
-
return this.selectedDropdownOption !==
|
|
235
|
+
return this.selectedDropdownOption !== w;
|
|
235
236
|
},
|
|
236
237
|
showFilteredDropdown() {
|
|
237
238
|
return this.presetDropdownPrices.length > 1;
|
|
@@ -242,17 +243,17 @@ const I = {
|
|
|
242
243
|
},
|
|
243
244
|
watch: {
|
|
244
245
|
unreservedAmount(e, s) {
|
|
245
|
-
var n,
|
|
246
|
-
e !== s && s === "" && (this.selectedOption =
|
|
246
|
+
var n, y;
|
|
247
|
+
e !== s && s === "" && (this.selectedOption = L(
|
|
247
248
|
this.getCookie,
|
|
248
249
|
this.setCookie,
|
|
249
250
|
this.enableFiveDollarsNotes,
|
|
250
|
-
(
|
|
251
|
+
(y = (n = this.route) == null ? void 0 : n.query) == null ? void 0 : y.utm_campaign,
|
|
251
252
|
e,
|
|
252
253
|
this.userBalance,
|
|
253
254
|
this.fiveDollarsSelected,
|
|
254
255
|
this.showPresetAmounts
|
|
255
|
-
)), this.showPresetAmounts && (this.selectedOption =
|
|
256
|
+
)), this.showPresetAmounts && (this.selectedOption = w);
|
|
256
257
|
}
|
|
257
258
|
},
|
|
258
259
|
methods: {
|
|
@@ -302,7 +303,7 @@ const I = {
|
|
|
302
303
|
e,
|
|
303
304
|
this.loanId,
|
|
304
305
|
this.loanId
|
|
305
|
-
), this.selectedOption = e;
|
|
306
|
+
), this.selectedOption = e, this.selectedDropdownOption = w;
|
|
306
307
|
},
|
|
307
308
|
handleCheckout() {
|
|
308
309
|
this.kvTrackFunction(
|
|
@@ -314,18 +315,18 @@ const I = {
|
|
|
314
315
|
);
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
|
-
},
|
|
318
|
+
}, N = { class: "tw-whitespace-nowrap" }, V = {
|
|
318
319
|
key: 2,
|
|
319
320
|
class: "tw-w-full tw-text-center tw-rounded tw-p-2",
|
|
320
321
|
style: { background: "#f1f1f1" }
|
|
321
|
-
},
|
|
322
|
+
}, H = { class: "tw-flex" }, M = ["disabled"], R = ["value"], K = {
|
|
322
323
|
key: 1,
|
|
323
324
|
class: "amountDropdownWrapper"
|
|
324
|
-
},
|
|
325
|
-
function
|
|
326
|
-
const
|
|
327
|
-
return i(), a("div",
|
|
328
|
-
t.isInBasket ? (i(), l(
|
|
325
|
+
}, U = ["value"];
|
|
326
|
+
function j(e, s, n, y, h, t) {
|
|
327
|
+
const c = k("kv-ui-button"), b = k("kv-material-icon"), g = k("kv-ui-select"), T = k("kv-lend-amount-button");
|
|
328
|
+
return i(), a("div", N, [
|
|
329
|
+
t.isInBasket ? (i(), l(c, {
|
|
329
330
|
key: 0,
|
|
330
331
|
variant: "secondary",
|
|
331
332
|
class: r(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
|
|
@@ -335,18 +336,18 @@ function U(e, s, n, k, f, t) {
|
|
|
335
336
|
onClick: s[0] || (s[0] = (o) => t.clickSecondaryButton(o))
|
|
336
337
|
}, {
|
|
337
338
|
default: d(() => [
|
|
338
|
-
|
|
339
|
+
m(f(t.loanInBasketButtonText), 1)
|
|
339
340
|
]),
|
|
340
341
|
_: 1
|
|
341
|
-
}, 8, ["class", "to", "href"])) : t.showNonActionableLoanButton ? (i(), l(
|
|
342
|
+
}, 8, ["class", "to", "href"])) : t.showNonActionableLoanButton ? (i(), l(c, {
|
|
342
343
|
key: 1,
|
|
343
344
|
class: "tw-inline-flex tw-flex-1"
|
|
344
345
|
}, {
|
|
345
346
|
default: d(() => [
|
|
346
|
-
|
|
347
|
+
m(f(t.ctaButtonText), 1)
|
|
347
348
|
]),
|
|
348
349
|
_: 1
|
|
349
|
-
})) : t.isFunded ? (i(), a("div",
|
|
350
|
+
})) : t.isFunded ? (i(), a("div", V, " This loan was just funded! 🎉 ")) : n.showViewLoan ? (i(), l(c, {
|
|
350
351
|
key: 3,
|
|
351
352
|
state: `${t.allSharesReserved ? "disabled" : ""}`,
|
|
352
353
|
to: n.externalLinks ? void 0 : t.readMorePath,
|
|
@@ -355,11 +356,11 @@ function U(e, s, n, k, f, t) {
|
|
|
355
356
|
onClick: s[1] || (s[1] = (o) => e.$emit("show-loan-details", o))
|
|
356
357
|
}, {
|
|
357
358
|
default: d(() => [
|
|
358
|
-
|
|
359
|
-
s[5] || (s[5] =
|
|
360
|
-
|
|
359
|
+
A("span", H, [
|
|
360
|
+
s[5] || (s[5] = m(" View loan ")),
|
|
361
|
+
I(b, {
|
|
361
362
|
class: "tw-w-3 tw-h-3 tw-align-middle",
|
|
362
|
-
icon:
|
|
363
|
+
icon: h.mdiChevronRight
|
|
363
364
|
}, null, 8, ["icon"])
|
|
364
365
|
])
|
|
365
366
|
]),
|
|
@@ -367,9 +368,9 @@ function U(e, s, n, k, f, t) {
|
|
|
367
368
|
}, 8, ["state", "to", "href"])) : t.useFormSubmit ? (i(), a("form", {
|
|
368
369
|
key: 4,
|
|
369
370
|
class: "tw-w-full tw-flex",
|
|
370
|
-
onSubmit: s[4] || (s[4] =
|
|
371
|
+
onSubmit: s[4] || (s[4] = B((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
|
|
371
372
|
}, [
|
|
372
|
-
|
|
373
|
+
A("fieldset", {
|
|
373
374
|
class: r(["tw-w-full tw-flex", {
|
|
374
375
|
"tw-flex-col md:tw-flex-row md:tw-justify-between": n.showPresetAmounts,
|
|
375
376
|
"tw-gap-1.5": n.showPresetAmounts && !t.isLendAmountButton
|
|
@@ -381,24 +382,24 @@ function U(e, s, n, k, f, t) {
|
|
|
381
382
|
key: 0,
|
|
382
383
|
class: r(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": n.enableHugeAmount }])
|
|
383
384
|
}, [
|
|
384
|
-
t.isLendAmountButton ? u("", !0) : (i(!0), a(
|
|
385
|
+
t.isLendAmountButton ? u("", !0) : (i(!0), a(v, { key: 0 }, p(t.presetButtonsPrices, (o) => (i(), l(c, {
|
|
385
386
|
key: o,
|
|
386
387
|
variant: "secondary",
|
|
387
|
-
class: r(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option":
|
|
388
|
+
class: r(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": h.selectedOption == o }]),
|
|
388
389
|
"data-testid": "bp-lend-cta-lend-button",
|
|
389
|
-
onClick: (
|
|
390
|
+
onClick: (z) => t.clickPresetButton(o)
|
|
390
391
|
}, {
|
|
391
392
|
default: d(() => [
|
|
392
|
-
|
|
393
|
+
m(" $" + f(o), 1)
|
|
393
394
|
]),
|
|
394
395
|
_: 2
|
|
395
396
|
}, 1032, ["class", "onClick"]))), 128)),
|
|
396
397
|
t.showFilteredDropdown ? (i(), l(g, {
|
|
397
398
|
key: 1,
|
|
398
399
|
id: `LoanAmountDropdown_${t.loanId}`,
|
|
399
|
-
modelValue:
|
|
400
|
+
modelValue: h.selectedDropdownOption,
|
|
400
401
|
"onUpdate:modelValue": [
|
|
401
|
-
s[2] || (s[2] = (o) =>
|
|
402
|
+
s[2] || (s[2] = (o) => h.selectedDropdownOption = o),
|
|
402
403
|
t.trackLendAmountSelection
|
|
403
404
|
],
|
|
404
405
|
class: r(["tw-min-w-12 tw-rounded filtered-dropdown", {
|
|
@@ -407,13 +408,13 @@ function U(e, s, n, k, f, t) {
|
|
|
407
408
|
"tw-w-full": n.enableHugeAmount
|
|
408
409
|
}]),
|
|
409
410
|
"aria-label": "Lend amount",
|
|
410
|
-
onClick:
|
|
411
|
+
onClick: B(t.clickDropdown, ["stop"])
|
|
411
412
|
}, {
|
|
412
413
|
default: d(() => [
|
|
413
|
-
(i(!0), a(
|
|
414
|
+
(i(!0), a(v, null, p(t.presetDropdownPrices, (o) => (i(), a("option", {
|
|
414
415
|
key: o,
|
|
415
416
|
value: o
|
|
416
|
-
},
|
|
417
|
+
}, f(o !== h.OTHER_OPTION ? `$${o}` : o), 9, R))), 128))
|
|
417
418
|
]),
|
|
418
419
|
_: 1
|
|
419
420
|
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : u("", !0)
|
|
@@ -421,54 +422,54 @@ function U(e, s, n, k, f, t) {
|
|
|
421
422
|
t.hideShowLendDropdown && !t.isLessThan25 ? (i(), l(g, {
|
|
422
423
|
key: 0,
|
|
423
424
|
id: `LoanAmountDropdown_${t.loanId}`,
|
|
424
|
-
modelValue:
|
|
425
|
+
modelValue: h.selectedOption,
|
|
425
426
|
"onUpdate:modelValue": [
|
|
426
|
-
s[3] || (s[3] = (o) =>
|
|
427
|
+
s[3] || (s[3] = (o) => h.selectedOption = o),
|
|
427
428
|
t.trackLendAmountSelection
|
|
428
429
|
],
|
|
429
430
|
class: "tw-min-w-12",
|
|
430
431
|
style: { "border-radius": "14px 0 0 14px" },
|
|
431
432
|
"aria-label": "Lend amount",
|
|
432
|
-
onClick:
|
|
433
|
+
onClick: B(t.clickDropdown, ["stop"])
|
|
433
434
|
}, {
|
|
434
435
|
default: d(() => [
|
|
435
|
-
(i(!0), a(
|
|
436
|
+
(i(!0), a(v, null, p(t.prices, (o) => (i(), a("option", {
|
|
436
437
|
key: o,
|
|
437
438
|
value: o
|
|
438
|
-
}, " $" +
|
|
439
|
+
}, " $" + f(o), 9, U))), 128))
|
|
439
440
|
]),
|
|
440
441
|
_: 1
|
|
441
442
|
}, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : u("", !0)
|
|
442
443
|
])),
|
|
443
|
-
|
|
444
|
+
A("div", {
|
|
444
445
|
class: r({
|
|
445
446
|
lendButtonWrapper: t.hideShowLendDropdown && !n.showPresetAmounts,
|
|
446
447
|
"tw-hidden": t.hideLendButton
|
|
447
448
|
})
|
|
448
449
|
}, [
|
|
449
|
-
t.lendButtonVisibility && !t.isLessThan25 ? (i(), l(
|
|
450
|
+
t.lendButtonVisibility && !t.isLessThan25 ? (i(), l(c, {
|
|
450
451
|
key: "lendButton",
|
|
451
452
|
class: r(["tw-inline-flex tw-flex-1", { "tw-w-full": n.showPresetAmounts }]),
|
|
452
453
|
"data-testid": "bp-lend-cta-lend-button",
|
|
453
454
|
type: "submit"
|
|
454
455
|
}, {
|
|
455
456
|
default: d(() => [
|
|
456
|
-
|
|
457
|
+
m(f(t.ctaButtonText), 1)
|
|
457
458
|
]),
|
|
458
459
|
_: 1
|
|
459
|
-
}, 8, ["class"])) : t.showLendAgain ? (i(), l(
|
|
460
|
+
}, 8, ["class"])) : t.showLendAgain ? (i(), l(c, {
|
|
460
461
|
key: "lendAgainButton",
|
|
461
462
|
class: r(["lend-again", { "tw-w-full": n.showPresetAmounts }]),
|
|
462
463
|
"data-testid": "bp-lend-cta-lend-again-button",
|
|
463
464
|
type: "submit"
|
|
464
465
|
}, {
|
|
465
466
|
default: d(() => [
|
|
466
|
-
|
|
467
|
+
m(f(n.primaryButtonText || "Lend") + " again ", 1)
|
|
467
468
|
]),
|
|
468
469
|
_: 1
|
|
469
470
|
}, 8, ["class"])) : u("", !0)
|
|
470
471
|
], 2),
|
|
471
|
-
t.isLendAmountButton && !n.enableFiveDollarsNotes ? (i(), l(
|
|
472
|
+
t.isLendAmountButton && !n.enableFiveDollarsNotes ? (i(), l(T, {
|
|
472
473
|
key: 2,
|
|
473
474
|
class: "tw-w-full",
|
|
474
475
|
"loan-id": t.loanId,
|
|
@@ -477,12 +478,12 @@ function U(e, s, n, k, f, t) {
|
|
|
477
478
|
"is-adding": n.isAdding,
|
|
478
479
|
onAddToBasket: t.addToBasket
|
|
479
480
|
}, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : u("", !0),
|
|
480
|
-
!n.isLoading && n.isAdding ? (i(), l(
|
|
481
|
+
!n.isLoading && n.isAdding ? (i(), l(c, {
|
|
481
482
|
key: 3,
|
|
482
483
|
class: "tw-inline-flex tw-flex-1"
|
|
483
484
|
}, {
|
|
484
485
|
default: d(() => s[6] || (s[6] = [
|
|
485
|
-
|
|
486
|
+
m(" Adding to basket ")
|
|
486
487
|
])),
|
|
487
488
|
_: 1
|
|
488
489
|
})) : u("", !0)
|
|
@@ -490,7 +491,7 @@ function U(e, s, n, k, f, t) {
|
|
|
490
491
|
], 32)) : u("", !0)
|
|
491
492
|
]);
|
|
492
493
|
}
|
|
493
|
-
const
|
|
494
|
+
const $ = /* @__PURE__ */ F(O, [["render", j], ["__scopeId", "data-v-ca361825"]]);
|
|
494
495
|
export {
|
|
495
|
-
|
|
496
|
+
$ as default
|
|
496
497
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"embla-carousel-fade",
|
|
107
107
|
"popper.js"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "652c8676b14247fe6c5fc084ef705781e3f73b6f"
|
|
110
110
|
}
|