@kiva/kv-components 10.4.1 → 10.5.0
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/KvCompactLoanCard.css +1 -1
- package/dist/vue/KvCompactLoanCard.js +210 -117
- package/dist/vue/KvCompactLoanCard.vue.d.ts +14 -8
- package/dist/vue/KvCompactLoanCard2.js +107 -113
- package/dist/vue/KvLoanUse.vue.d.ts +9 -0
- package/dist/vue/KvLoanUse2.js +23 -16
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.loan-card-use[data-v-
|
|
1
|
+
.loan-card-use[data-v-330ff302]:hover,.loan-card-use[data-v-330ff302]:focus{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1))}.loan-card-active-hover:hover .loan-card-use[data-v-330ff302]{text-decoration-line:underline}.loan-card-progress[data-v-330ff302]:hover,.loan-card-progress[data-v-330ff302]:focus{text-decoration-line:none}.loan-card-use-text-light-detailed[data-v-330ff302] p{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.loan-card-cta[data-v-330ff302] form,.loan-card-cta[data-v-330ff302] fieldset,.loan-card-cta[data-v-330ff302] .tw-w-full,.loan-card-cta[data-v-330ff302] button{display:flex!important;height:2.5rem!important;max-height:2.5rem!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-330ff302] .tw-inline-flex{height:2.5rem!important;max-height:2.5rem!important;min-height:2.5rem!important}[data-v-330ff302] .amount-dropdown select{height:2.25rem;--tw-border-opacity: 1;border-color:rgb(245 245 245 / var(--tw-border-opacity, 1));padding-left:.5rem}[data-v-330ff302] .goal-variant-callouts span{font-weight:500}.goal-variant-progress-group[data-v-330ff302] div[role=progressbar]{background-color:#d9d9d9}.light-detailed-progress-group[data-v-330ff302] p:first-of-type{margin-bottom:.5rem}
|
|
@@ -1,74 +1,94 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { KV_COMPACT_LOAN_CARD_FRAGMENT as
|
|
3
|
-
import { resolveComponent as
|
|
1
|
+
import D from "./KvCompactLoanCard2.js";
|
|
2
|
+
import { KV_COMPACT_LOAN_CARD_FRAGMENT as gt, KV_COMPACT_LOAN_CARD_USER_FRAGMENT as ft } from "./KvCompactLoanCard2.js";
|
|
3
|
+
import { resolveComponent as h, openBlock as a, createElementBlock as l, normalizeClass as c, createVNode as i, createCommentVNode as g, createElementVNode as r, normalizeStyle as _, createBlock as d, resolveDynamicComponent as k, withCtx as f, Fragment as s, toDisplayString as w, withModifiers as R, renderList as u } from "vue";
|
|
4
4
|
import "./KvCompactLoanCard.css";
|
|
5
|
-
import
|
|
6
|
-
const S = ["aria-busy"],
|
|
5
|
+
import B from "../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const S = ["aria-busy"], G = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, U = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "tw-flex-shrink-0 tw-overflow-hidden"
|
|
9
9
|
}, I = {
|
|
10
10
|
key: 0,
|
|
11
|
+
class: "tw-w-full"
|
|
12
|
+
}, W = ["title"], j = { class: "tw-flex tw-items-center tw-gap-0.5 tw-w-full tw-min-w-0" }, E = { class: "tw-text-gray-600 !tw-font-medium tw-text-small tw-leading-normal tw-flex-shrink-0" }, F = ["title"], O = {
|
|
13
|
+
key: 1,
|
|
11
14
|
class: "tw-mb-0.5 tw-w-full"
|
|
12
|
-
},
|
|
15
|
+
}, K = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, z = ["href"], H = { class: "tw-truncate" }, Z = ["title"], q = { class: "tw-font-medium" }, J = {
|
|
16
|
+
key: 0,
|
|
17
|
+
"data-testid": "loan-use-loading",
|
|
18
|
+
class: "tw-w-full tw-overflow-hidden"
|
|
19
|
+
}, Q = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "loan-card-use-text-light-detailed tw-w-full tw-overflow-hidden"
|
|
22
|
+
}, X = {
|
|
13
23
|
key: 0,
|
|
14
|
-
class: "
|
|
15
|
-
},
|
|
24
|
+
class: "tw-w-full tw-overflow-hidden"
|
|
25
|
+
}, Y = { class: "tw-flex-1 tw-min-w-0 tw-mr-1" }, p = {
|
|
26
|
+
class: "tw-flex-1 tw-min-w-0 tw-px-0.5",
|
|
27
|
+
style: { "max-width": "9.75rem" }
|
|
28
|
+
}, $ = { class: "tw-flex tw-items-center tw-gap-2 tw-flex-shrink-0" }, tt = {
|
|
29
|
+
"data-testid": "light-detailed-amount-pill",
|
|
30
|
+
class: "tw-border tw-border-gray-100 tw-rounded-sm tw-px-1 tw-py-0.5 tw-text-label tw-text-primary"
|
|
31
|
+
}, et = {
|
|
16
32
|
class: "tw-flex-1 tw-min-w-0",
|
|
17
33
|
style: { "max-width": "6.5rem" }
|
|
18
|
-
},
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
class:
|
|
24
|
-
"tw-relative":
|
|
25
|
-
"!tw-p-1.5": e.showLightView || t.isPostGoalVariant
|
|
34
|
+
}, at = ["value"], ot = { class: "tw-flex-1 tw-min-w-0" }, nt = { class: "tw-p-1 tw-rounded-l-sm tw-border tw-border-gray-100 tw-border-r-0" };
|
|
35
|
+
function lt(b, n, e, t, rt, x) {
|
|
36
|
+
var V;
|
|
37
|
+
const v = h("kv-material-icon"), m = h("kv-loading-placeholder"), P = h("kv-borrower-image"), C = h("kv-loan-tag"), L = h("kv-loan-use"), M = h("kv-loan-callouts"), y = h("kv-loan-progress-group"), N = h("kv-select"), A = h("kv-lend-cta");
|
|
38
|
+
return a(), l("div", {
|
|
39
|
+
class: c(["tw-flex tw-flex-col tw-items-start tw-justify-between tw-p-1 tw-bg-white tw-shadow-lg tw-w-full", {
|
|
40
|
+
"tw-relative": t.shouldShowRefreshButton,
|
|
41
|
+
"!tw-p-1.5": e.showLightView || t.isPostGoalVariant,
|
|
42
|
+
"tw-rounded-md": !t.isLightDetailedVariant,
|
|
43
|
+
"tw-rounded": t.isLightDetailedVariant
|
|
26
44
|
}]),
|
|
27
45
|
"aria-busy": t.isLoading ? "true" : "false"
|
|
28
46
|
}, [
|
|
29
|
-
|
|
47
|
+
t.shouldShowRefreshButton ? (a(), l("button", {
|
|
30
48
|
key: 0,
|
|
31
49
|
class: "tw-absolute tw--top-1 tw--right-1 tw-bg-white tw-rounded-full tw-w-2.5 tw-h-2.5 tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-drop-shadow-sm",
|
|
32
|
-
onClick: n[0] || (n[0] = (...
|
|
50
|
+
onClick: n[0] || (n[0] = (...o) => t.handleRefreshButton && t.handleRefreshButton(...o))
|
|
33
51
|
}, [
|
|
34
|
-
i(
|
|
52
|
+
i(v, {
|
|
35
53
|
icon: t.mdiCached,
|
|
36
54
|
class: "tw-w-2.5 tw-h-2.5 tw--scale-x-100 tw-text-gray-500"
|
|
37
55
|
}, null, 8, ["icon"])
|
|
38
|
-
])) :
|
|
39
|
-
r("div",
|
|
56
|
+
])) : g("", !0),
|
|
57
|
+
r("div", G, [
|
|
40
58
|
r("div", {
|
|
41
|
-
class:
|
|
42
|
-
"!tw-gap-1": e.showLightView,
|
|
59
|
+
class: c(["tw-flex tw-items-start tw-gap-2 tw-w-full loan-card-active-hover", {
|
|
60
|
+
"!tw-gap-1": e.showLightView || t.isLightDetailedVariant,
|
|
43
61
|
"!tw-gap-1.5 md:!tw-gap-2.5": t.isPostGoalVariant
|
|
44
62
|
}]),
|
|
45
|
-
style:
|
|
63
|
+
style: _(t.customStyle)
|
|
46
64
|
}, [
|
|
47
|
-
t.isLoading ? (
|
|
65
|
+
t.isLoading ? (a(), d(m, {
|
|
48
66
|
key: 0,
|
|
49
67
|
"aria-hidden": "true",
|
|
50
|
-
class:
|
|
68
|
+
class: c({
|
|
51
69
|
"!tw-w-7.5 !tw-h-7.5": e.showLightView,
|
|
52
|
-
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": t.isPostGoalVariant
|
|
70
|
+
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": t.isPostGoalVariant,
|
|
71
|
+
"!tw-w-9.5 !tw-h-9.5": t.isLightDetailedVariant
|
|
53
72
|
}),
|
|
54
|
-
style:
|
|
55
|
-
}, null, 8, ["class", "style"])) : (
|
|
56
|
-
(
|
|
73
|
+
style: _(t.borrowerImageStyle)
|
|
74
|
+
}, null, 8, ["class", "style"])) : (a(), l("div", U, [
|
|
75
|
+
(a(), d(k(t.tag), {
|
|
57
76
|
to: t.readMorePath,
|
|
58
77
|
href: t.readMorePath,
|
|
59
78
|
target: e.externalLinksNewTab ? "_blank" : void 0,
|
|
60
79
|
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
61
80
|
class: "tw-flex",
|
|
62
81
|
"aria-label": "Borrower image",
|
|
63
|
-
onClick: n[1] || (n[1] = (
|
|
82
|
+
onClick: n[1] || (n[1] = (o) => t.clickReadMore("Photo", o))
|
|
64
83
|
}, {
|
|
65
|
-
default:
|
|
84
|
+
default: f(() => [
|
|
66
85
|
i(P, {
|
|
67
|
-
class:
|
|
86
|
+
class: c(["tw-bg-gray-300 tw-rounded-sm tw-object-cover tw-bg-clip-content", {
|
|
68
87
|
"!tw-w-7.5 !tw-h-7.5": e.showLightView,
|
|
69
|
-
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": t.isPostGoalVariant
|
|
88
|
+
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": t.isPostGoalVariant,
|
|
89
|
+
"!tw-w-9.5 !tw-h-9.5": t.isLightDetailedVariant
|
|
70
90
|
}]),
|
|
71
|
-
style:
|
|
91
|
+
style: _(t.borrowerImageStyle),
|
|
72
92
|
alt: `Photo of ${t.borrowerName}`,
|
|
73
93
|
"aspect-ratio": 1,
|
|
74
94
|
"default-image": { width: 200, faceZoom: 50 },
|
|
@@ -81,98 +101,142 @@ function Q(f, n, e, t, X, y) {
|
|
|
81
101
|
}, 8, ["to", "href", "target", "rel"]))
|
|
82
102
|
])),
|
|
83
103
|
r("div", {
|
|
84
|
-
class:
|
|
104
|
+
class: c(["tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0", { "!tw-gap-0": t.isPostGoalVariant }])
|
|
85
105
|
}, [
|
|
86
|
-
|
|
87
|
-
(
|
|
106
|
+
t.isLightDetailedVariant ? (a(), l("div", I, [
|
|
107
|
+
t.isLoading ? (a(), l(s, { key: 0 }, [
|
|
108
|
+
i(m, { class: "tw-mb-0.5 !tw-w-full !tw-h-2" }),
|
|
109
|
+
i(m, { class: "!tw-w-9 !tw-h-2" })
|
|
110
|
+
], 64)) : (a(), l(s, { key: 1 }, [
|
|
111
|
+
r("p", {
|
|
112
|
+
title: t.borrowerName,
|
|
113
|
+
class: "tw-text-primary !tw-font-medium tw-text-small tw-leading-normal tw-truncate tw-w-full"
|
|
114
|
+
}, w(t.borrowerName), 9, W),
|
|
115
|
+
r("div", j, [
|
|
116
|
+
r("span", E, w(t.lightDetailedAmount), 1),
|
|
117
|
+
t.formattedLocation ? (a(), l(s, { key: 0 }, [
|
|
118
|
+
n[14] || (n[14] = r("span", {
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
class: "tw-w-0.5 tw-h-0.5 tw-rounded-full tw-bg-gray-600 tw-flex-shrink-0"
|
|
121
|
+
}, null, -1)),
|
|
122
|
+
r("span", {
|
|
123
|
+
title: t.formattedLocation,
|
|
124
|
+
class: "tw-text-gray-600 !tw-font-medium tw-text-small tw-leading-normal tw-truncate tw-min-w-0"
|
|
125
|
+
}, w(t.formattedLocation), 9, F)
|
|
126
|
+
], 64)) : g("", !0)
|
|
127
|
+
])
|
|
128
|
+
], 64))
|
|
129
|
+
])) : e.businessName ? (a(), l("div", O, [
|
|
130
|
+
(a(), d(k(t.tag), {
|
|
88
131
|
to: t.readMorePath,
|
|
89
132
|
href: t.readMorePath,
|
|
90
133
|
target: e.externalLinksNewTab ? "_blank" : void 0,
|
|
91
134
|
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
92
135
|
class: "tw-no-underline hover:tw-underline focus:tw-no-underline",
|
|
93
136
|
"aria-label": "Business name",
|
|
94
|
-
onClick: n[2] || (n[2] = (
|
|
137
|
+
onClick: n[2] || (n[2] = (o) => t.clickReadMore("Business", o))
|
|
95
138
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
r("h3",
|
|
139
|
+
default: f(() => [
|
|
140
|
+
r("h3", K, w(e.businessName), 1)
|
|
98
141
|
]),
|
|
99
142
|
_: 1
|
|
100
143
|
}, 8, ["to", "href", "target", "rel"])),
|
|
101
|
-
e.website ? (
|
|
144
|
+
e.website ? (a(), l("a", {
|
|
102
145
|
key: 0,
|
|
103
146
|
href: t.formattedWebsite,
|
|
104
147
|
target: "_blank",
|
|
105
148
|
class: "tw-flex tw-items-center tw-gap-0.5 tw-text-secondary tw-text-small tw-font-light tw-leading-normal tw-no-underline hover:tw-underline",
|
|
106
|
-
onClick: n[3] || (n[3] = R((...
|
|
149
|
+
onClick: n[3] || (n[3] = R((...o) => t.trackWebsiteClick && t.trackWebsiteClick(...o), ["stop"]))
|
|
107
150
|
}, [
|
|
108
|
-
i(
|
|
151
|
+
i(v, {
|
|
109
152
|
icon: t.mdiLink,
|
|
110
153
|
class: "tw-w-2 tw-h-2"
|
|
111
154
|
}, null, 8, ["icon"]),
|
|
112
|
-
r("span",
|
|
113
|
-
], 8,
|
|
114
|
-
])) :
|
|
115
|
-
t.isLoading
|
|
116
|
-
key:
|
|
155
|
+
r("span", H, w(e.website), 1)
|
|
156
|
+
], 8, z)) : g("", !0)
|
|
157
|
+
])) : g("", !0),
|
|
158
|
+
!t.isLoading && !t.isLightDetailedVariant ? (a(), d(k(t.tag), {
|
|
159
|
+
key: 2,
|
|
117
160
|
to: t.readMorePath,
|
|
118
161
|
href: t.readMorePath,
|
|
119
162
|
target: e.externalLinksNewTab ? "_blank" : void 0,
|
|
120
163
|
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
121
164
|
class: "tw-flex tw-no-underline hover:tw-no-underline focus:tw-no-underline -tw-mt-1",
|
|
122
165
|
"aria-label": "Loan tag",
|
|
123
|
-
onClick: n[4] || (n[4] = (
|
|
166
|
+
onClick: n[4] || (n[4] = (o) => t.clickReadMore("Tag", o))
|
|
124
167
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
e.showTags ? (
|
|
168
|
+
default: f(() => [
|
|
169
|
+
e.showTags ? (a(), d(C, {
|
|
127
170
|
key: 0,
|
|
128
|
-
class:
|
|
171
|
+
class: c({
|
|
129
172
|
"tw-mb-1 !tw-font-medium": t.isPostGoalVariant
|
|
130
173
|
}),
|
|
131
174
|
loan: e.loan,
|
|
132
175
|
"enable-multi-matching": e.enableMultiMatching
|
|
133
|
-
}, null, 8, ["class", "loan", "enable-multi-matching"])) :
|
|
176
|
+
}, null, 8, ["class", "loan", "enable-multi-matching"])) : g("", !0)
|
|
134
177
|
]),
|
|
135
178
|
_: 1
|
|
136
|
-
}, 8, ["to", "href", "target", "rel"])),
|
|
137
|
-
t.isPostGoalVariant ? (
|
|
138
|
-
t.isLoading ? (
|
|
139
|
-
key:
|
|
179
|
+
}, 8, ["to", "href", "target", "rel"])) : g("", !0),
|
|
180
|
+
t.isPostGoalVariant ? (a(), l(s, { key: 3 }, [
|
|
181
|
+
t.isLoading ? (a(), l(s, { key: 0 }, u(4, (o) => i(m, {
|
|
182
|
+
key: o,
|
|
140
183
|
class: "tw-mb-0.5 md:!tw-mb-1.5 !tw-w-full !tw-h-1.5 md:!tw-h-2"
|
|
141
|
-
})), 64)) : (
|
|
184
|
+
})), 64)) : (a(), l("p", {
|
|
142
185
|
key: 1,
|
|
143
186
|
class: "tw-text-small tw-mb-0 tw-leading-normal",
|
|
144
187
|
style: { "line-height": "150%" },
|
|
145
188
|
title: t.statementTitle,
|
|
146
189
|
"data-testid": "loan-use-statement"
|
|
147
190
|
}, [
|
|
148
|
-
r("span", null,
|
|
149
|
-
r("span",
|
|
150
|
-
r("span", null,
|
|
151
|
-
r("span", null,
|
|
152
|
-
], 8,
|
|
153
|
-
], 64)) :
|
|
154
|
-
|
|
191
|
+
r("span", null, w(t.loanUsePrefixStart), 1),
|
|
192
|
+
r("span", q, w(t.borrowerNameWithCountry), 1),
|
|
193
|
+
r("span", null, w(t.loanUsePrefixEnd), 1),
|
|
194
|
+
r("span", null, w(t.visibleUseStatement), 1)
|
|
195
|
+
], 8, Z))
|
|
196
|
+
], 64)) : t.isLightDetailedVariant ? (a(), l(s, { key: 4 }, [
|
|
197
|
+
t.isLoading ? (a(), l("div", J, [
|
|
198
|
+
(a(!0), l(s, null, u(t.loanUseLoadingRows, (o) => (a(), l("div", {
|
|
199
|
+
key: o,
|
|
200
|
+
class: "tw-h-2 tw-mb-1"
|
|
201
|
+
}, [
|
|
202
|
+
i(m)
|
|
203
|
+
]))), 128))
|
|
204
|
+
])) : (a(), l("div", Q, [
|
|
205
|
+
i(L, {
|
|
206
|
+
use: t.loanUse,
|
|
207
|
+
"loan-amount": t.loanAmount,
|
|
208
|
+
status: t.loanStatus,
|
|
209
|
+
"borrower-count": t.loanBorrowerCount,
|
|
210
|
+
name: t.borrowerName,
|
|
211
|
+
"distribution-model": t.distributionModel,
|
|
212
|
+
"hide-borrower-details": !0,
|
|
213
|
+
"data-testid": "loan-use-statement",
|
|
214
|
+
class: "tw-text-small tw-leading-normal tw-text-primary"
|
|
215
|
+
}, null, 8, ["use", "loan-amount", "status", "borrower-count", "name", "distribution-model"])
|
|
216
|
+
]))
|
|
217
|
+
], 64)) : e.showLoanUse ? (a(), d(k(t.tag), {
|
|
218
|
+
key: 5,
|
|
155
219
|
to: t.readMorePath,
|
|
156
220
|
href: t.readMorePath,
|
|
157
221
|
target: e.externalLinksNewTab ? "_blank" : void 0,
|
|
158
222
|
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
159
223
|
class: "loan-card-use tw-no-underline tw-text-primary tw-block tw-w-full",
|
|
160
224
|
"aria-label": "Loan use",
|
|
161
|
-
onClick: n[5] || (n[5] = (
|
|
225
|
+
onClick: n[5] || (n[5] = (o) => t.clickReadMore("Use", o))
|
|
162
226
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
t.isLoading ? (
|
|
165
|
-
(
|
|
227
|
+
default: f(() => [
|
|
228
|
+
t.isLoading ? (a(), l("div", X, [
|
|
229
|
+
(a(!0), l(s, null, u([...Array(t.loanUseLoadingRows)], (o, T) => (a(), l("div", {
|
|
166
230
|
key: T,
|
|
167
231
|
class: "tw-h-2 tw-mb-1"
|
|
168
232
|
}, [
|
|
169
|
-
i(
|
|
233
|
+
i(m)
|
|
170
234
|
]))), 128))
|
|
171
|
-
])) : (
|
|
235
|
+
])) : (a(), l("div", {
|
|
172
236
|
key: 1,
|
|
173
|
-
class:
|
|
237
|
+
class: c(["tw-w-full tw-overflow-hidden", { "!tw--mt-1": e.showTags && x.hasMatchingInfo && e.showLightView }])
|
|
174
238
|
}, [
|
|
175
|
-
i(
|
|
239
|
+
i(L, {
|
|
176
240
|
use: t.loanUse,
|
|
177
241
|
"loan-amount": t.loanAmount,
|
|
178
242
|
status: t.loanStatus,
|
|
@@ -188,29 +252,58 @@ function Q(f, n, e, t, X, y) {
|
|
|
188
252
|
], 2))
|
|
189
253
|
]),
|
|
190
254
|
_: 1
|
|
191
|
-
}, 8, ["to", "href", "target", "rel"])) :
|
|
255
|
+
}, 8, ["to", "href", "target", "rel"])) : g("", !0)
|
|
192
256
|
], 2)
|
|
193
257
|
], 6),
|
|
194
|
-
t.isLoading || typeof t.loanCallouts > "u" ? (
|
|
258
|
+
t.isLoading || typeof t.loanCallouts > "u" ? (a(), d(m, {
|
|
195
259
|
key: 0,
|
|
196
260
|
class: "tw-mt-1.5 tw-mb-1 tw-rounded-full",
|
|
197
261
|
style: { width: "60%", height: "1.5rem" }
|
|
198
|
-
})) : (
|
|
262
|
+
})) : (a(), d(M, {
|
|
199
263
|
key: 1,
|
|
200
264
|
callouts: t.loanCallouts,
|
|
201
|
-
class:
|
|
202
|
-
onClick: n[6] || (n[6] = (
|
|
265
|
+
class: c(["tw-mt-1.5", { "goal-variant-callouts": t.isPostGoalVariant }]),
|
|
266
|
+
onClick: n[6] || (n[6] = (o) => b.$emit("jump-filter-page", o))
|
|
203
267
|
}, null, 8, ["callouts", "class"]))
|
|
204
268
|
]),
|
|
205
269
|
r("div", {
|
|
206
|
-
class:
|
|
270
|
+
class: c(["tw-flex tw-items-center tw-justify-between tw-w-full tw-mt-1", {
|
|
207
271
|
"tw-gap-1": t.sharesAvailable,
|
|
208
|
-
"!tw-items-end !tw-gap-2": t.isPostGoalVariant
|
|
272
|
+
"!tw-items-end !tw-gap-2": t.isPostGoalVariant,
|
|
273
|
+
"!tw-mt-1.5": t.isLightDetailedVariant
|
|
209
274
|
}])
|
|
210
275
|
}, [
|
|
211
|
-
t.hasProgressData ? t.
|
|
212
|
-
r("div",
|
|
213
|
-
i(
|
|
276
|
+
t.hasProgressData ? t.isLightDetailedVariant ? (a(), l(s, { key: 1 }, [
|
|
277
|
+
r("div", p, [
|
|
278
|
+
i(y, {
|
|
279
|
+
"money-left": t.unreservedAmount,
|
|
280
|
+
"progress-percent": t.fundraisingPercent,
|
|
281
|
+
class: "tw-text-black light-detailed-progress-group"
|
|
282
|
+
}, null, 8, ["money-left", "progress-percent"])
|
|
283
|
+
]),
|
|
284
|
+
r("div", $, [
|
|
285
|
+
r("span", tt, " $" + w(e.customAmountLent), 1),
|
|
286
|
+
(a(), d(k(t.tag), {
|
|
287
|
+
to: t.readMorePath,
|
|
288
|
+
href: t.readMorePath,
|
|
289
|
+
target: e.externalLinksNewTab ? "_blank" : void 0,
|
|
290
|
+
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
291
|
+
class: "tw-flex tw-items-center tw-justify-center",
|
|
292
|
+
"aria-label": `View ${t.borrowerName || "this borrower"}'s loan details`,
|
|
293
|
+
onClick: n[7] || (n[7] = (o) => t.clickReadMore("Arrow", o))
|
|
294
|
+
}, {
|
|
295
|
+
default: f(() => [
|
|
296
|
+
i(v, {
|
|
297
|
+
icon: t.mdiArrowRight,
|
|
298
|
+
class: "tw-w-2.5 tw-h-2.5 tw-text-action"
|
|
299
|
+
}, null, 8, ["icon"])
|
|
300
|
+
]),
|
|
301
|
+
_: 1
|
|
302
|
+
}, 8, ["to", "href", "target", "rel", "aria-label"]))
|
|
303
|
+
])
|
|
304
|
+
], 64)) : t.isPostGoalVariant ? (a(), l(s, { key: 2 }, [
|
|
305
|
+
r("div", et, [
|
|
306
|
+
i(y, {
|
|
214
307
|
"money-left": t.unreservedAmount,
|
|
215
308
|
"progress-percent": t.fundraisingPercent,
|
|
216
309
|
class: "tw-text-black goal-variant-progress-group"
|
|
@@ -218,28 +311,28 @@ function Q(f, n, e, t, X, y) {
|
|
|
218
311
|
]),
|
|
219
312
|
r("div", null, [
|
|
220
313
|
i(N, {
|
|
221
|
-
id: `PostGoalAmountDropdown_${((
|
|
314
|
+
id: `PostGoalAmountDropdown_${((V = e.loan) == null ? void 0 : V.id) ?? e.loanId}`,
|
|
222
315
|
modelValue: t.selectedAmount,
|
|
223
316
|
"onUpdate:modelValue": [
|
|
224
|
-
n[
|
|
317
|
+
n[8] || (n[8] = (o) => t.selectedAmount = o),
|
|
225
318
|
t.handleSelectedAmount
|
|
226
319
|
],
|
|
227
320
|
"aria-label": "Lend amount",
|
|
228
|
-
disabled: !t.amountOptions.length ||
|
|
321
|
+
disabled: !t.amountOptions.length || x.isInBasket,
|
|
229
322
|
class: "amount-dropdown"
|
|
230
323
|
}, {
|
|
231
|
-
default:
|
|
232
|
-
(
|
|
233
|
-
key:
|
|
234
|
-
value:
|
|
235
|
-
}, " $" +
|
|
324
|
+
default: f(() => [
|
|
325
|
+
(a(!0), l(s, null, u(t.amountOptions, (o) => (a(), l("option", {
|
|
326
|
+
key: o,
|
|
327
|
+
value: o
|
|
328
|
+
}, " $" + w(o), 9, at))), 128))
|
|
236
329
|
]),
|
|
237
330
|
_: 1
|
|
238
331
|
}, 8, ["id", "modelValue", "disabled", "onUpdate:modelValue"])
|
|
239
332
|
])
|
|
240
|
-
], 64)) : (
|
|
241
|
-
r("div",
|
|
242
|
-
t.sharesAvailable ? (
|
|
333
|
+
], 64)) : (a(), l(s, { key: 3 }, [
|
|
334
|
+
r("div", ot, [
|
|
335
|
+
t.sharesAvailable ? (a(), d(k(t.tag), {
|
|
243
336
|
key: 0,
|
|
244
337
|
to: t.readMorePath,
|
|
245
338
|
href: t.readMorePath,
|
|
@@ -247,10 +340,10 @@ function Q(f, n, e, t, X, y) {
|
|
|
247
340
|
rel: e.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
248
341
|
class: "loan-card-progress tw-no-underline tw-block",
|
|
249
342
|
"aria-label": "Loan progress",
|
|
250
|
-
onClick: n[
|
|
343
|
+
onClick: n[9] || (n[9] = (o) => t.clickReadMore("Progress", o))
|
|
251
344
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
i(
|
|
345
|
+
default: f(() => [
|
|
346
|
+
i(y, {
|
|
254
347
|
id: "loanProgress",
|
|
255
348
|
"money-left": t.unreservedAmount,
|
|
256
349
|
"progress-percent": t.fundraisingPercent,
|
|
@@ -258,18 +351,18 @@ function Q(f, n, e, t, X, y) {
|
|
|
258
351
|
}, null, 8, ["money-left", "progress-percent"])
|
|
259
352
|
]),
|
|
260
353
|
_: 1
|
|
261
|
-
}, 8, ["to", "href", "target", "rel"])) :
|
|
354
|
+
}, 8, ["to", "href", "target", "rel"])) : g("", !0)
|
|
262
355
|
]),
|
|
263
|
-
e.showLightView ? (
|
|
356
|
+
e.showLightView ? (a(), l("button", {
|
|
264
357
|
key: 0,
|
|
265
358
|
class: "tw-ml-2",
|
|
266
|
-
onClick: n[
|
|
359
|
+
onClick: n[10] || (n[10] = (o) => t.clickReadMore("View", o))
|
|
267
360
|
}, [
|
|
268
|
-
r("span",
|
|
269
|
-
n[
|
|
270
|
-
])) : (
|
|
361
|
+
r("span", nt, " $" + w(e.customAmountLent), 1),
|
|
362
|
+
n[15] || (n[15] = r("span", { class: "tw-bg-gray-100 tw-px-1.5 tw-py-1 tw-rounded-r-sm tw-border tw-border-gray-100 tw-text-action tw-font-medium hover:tw-underline tw-text-center tw-cursor-pointer" }, " View ", -1))
|
|
363
|
+
])) : (a(), l("div", {
|
|
271
364
|
key: 1,
|
|
272
|
-
class:
|
|
365
|
+
class: c(["tw-flex-shrink-0 loan-card-cta", { "tw-w-full": !t.sharesAvailable }]),
|
|
273
366
|
style: { height: "40px" }
|
|
274
367
|
}, [
|
|
275
368
|
i(A, {
|
|
@@ -292,23 +385,23 @@ function Q(f, n, e, t, X, y) {
|
|
|
292
385
|
"primary-button-text": e.primaryButtonText,
|
|
293
386
|
"secondary-button-text": e.secondaryButtonText,
|
|
294
387
|
"secondary-button-handler": e.secondaryButtonHandler,
|
|
295
|
-
onAddToBasket: n[
|
|
296
|
-
onShowLoanDetails: n[
|
|
297
|
-
onRemoveFromBasket: n[
|
|
388
|
+
onAddToBasket: n[11] || (n[11] = (o) => b.$emit("add-to-basket", o)),
|
|
389
|
+
onShowLoanDetails: n[12] || (n[12] = (o) => t.clickReadMore("ViewLoan", o)),
|
|
390
|
+
onRemoveFromBasket: n[13] || (n[13] = (o) => b.$emit("remove-from-basket", o))
|
|
298
391
|
}, null, 8, ["loan", "unreserved-amount", "basket-items", "is-loading", "is-adding", "enable-five-dollars-notes", "five-dollars-selected", "kv-track-function", "show-view-loan", "custom-loan-details", "external-links", "route", "user-balance", "get-cookie", "set-cookie", "is-visitor", "primary-button-text", "secondary-button-text", "secondary-button-handler"])
|
|
299
392
|
], 2))
|
|
300
|
-
], 64)) : (
|
|
301
|
-
r("div",
|
|
302
|
-
i(
|
|
393
|
+
], 64)) : (a(), l(s, { key: 0 }, [
|
|
394
|
+
r("div", Y, [
|
|
395
|
+
i(m, {
|
|
303
396
|
class: "tw-mb-0.5",
|
|
304
397
|
style: { width: "100%", maxWidth: "11rem", height: "1rem" }
|
|
305
398
|
}),
|
|
306
|
-
i(
|
|
399
|
+
i(m, {
|
|
307
400
|
class: "tw-rounded",
|
|
308
401
|
style: { width: "100%", maxWidth: "11rem", height: "0.5rem" }
|
|
309
402
|
})
|
|
310
403
|
]),
|
|
311
|
-
t.allDataLoaded ?
|
|
404
|
+
t.allDataLoaded ? g("", !0) : (a(), d(m, {
|
|
312
405
|
key: 0,
|
|
313
406
|
class: "tw-rounded tw-flex-shrink-0",
|
|
314
407
|
style: { width: "8rem", height: "2.5rem" }
|
|
@@ -317,9 +410,9 @@ function Q(f, n, e, t, X, y) {
|
|
|
317
410
|
], 2)
|
|
318
411
|
], 10, S);
|
|
319
412
|
}
|
|
320
|
-
const
|
|
413
|
+
const mt = /* @__PURE__ */ B(D, [["render", lt], ["__scopeId", "data-v-330ff302"]]);
|
|
321
414
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
415
|
+
gt as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
416
|
+
ft as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
417
|
+
mt as default
|
|
325
418
|
};
|
|
@@ -153,14 +153,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
153
153
|
}>;
|
|
154
154
|
borrowerName: import('vue').ComputedRef<any>;
|
|
155
155
|
borrowerNameWithCountry: import('vue').ComputedRef<string>;
|
|
156
|
-
|
|
157
|
-
countryName: import('vue').ComputedRef<any>;
|
|
156
|
+
lightDetailedAmount: import('vue').ComputedRef<any>;
|
|
158
157
|
distributionModel: import('vue').ComputedRef<any>;
|
|
159
158
|
formattedLocation: import('vue').ComputedRef<any>;
|
|
160
159
|
formattedWebsite: import('vue').ComputedRef<string>;
|
|
161
160
|
fundraisingPercent: import('vue').ComputedRef<any>;
|
|
162
161
|
hasProgressData: import('vue').ComputedRef<boolean>;
|
|
163
162
|
imageHash: import('vue').ComputedRef<any>;
|
|
163
|
+
isLightDetailedVariant: import('vue').ComputedRef<boolean>;
|
|
164
164
|
isLoading: import('vue').ComputedRef<boolean>;
|
|
165
165
|
isPostGoalVariant: import('vue').ComputedRef<boolean>;
|
|
166
166
|
loanAmount: import('vue').ComputedRef<any>;
|
|
@@ -170,12 +170,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
170
170
|
loanUse: import('vue').ComputedRef<any>;
|
|
171
171
|
loanUsePrefixEnd: import('vue').ComputedRef<string>;
|
|
172
172
|
loanUsePrefixStart: import('vue').ComputedRef<string>;
|
|
173
|
-
mdiMapMarker: string;
|
|
174
|
-
mdiHome: string;
|
|
175
173
|
mdiLink: string;
|
|
176
174
|
mdiCached: string;
|
|
175
|
+
mdiArrowRight: string;
|
|
177
176
|
readMorePath: import('vue').ComputedRef<any>;
|
|
178
|
-
|
|
177
|
+
shouldShowRefreshButton: import('vue').ComputedRef<boolean>;
|
|
179
178
|
tag: import('vue').ComputedRef<"router-link" | "a">;
|
|
180
179
|
unreservedAmount: import('vue').ComputedRef<any>;
|
|
181
180
|
sharesAvailable: import('vue').ComputedRef<boolean>;
|
|
@@ -188,15 +187,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
188
187
|
height: string;
|
|
189
188
|
maxHeight: string;
|
|
190
189
|
}>;
|
|
191
|
-
loanUseLoadingRows: import('vue').ComputedRef<3 | 4>;
|
|
190
|
+
loanUseLoadingRows: import('vue').ComputedRef<2 | 3 | 4>;
|
|
192
191
|
visibleUseStatement: import('vue').ComputedRef<string>;
|
|
193
192
|
clickReadMore: (target: string, event: Event) => void;
|
|
194
193
|
trackWebsiteClick: () => void;
|
|
195
194
|
handleRefreshButton: (event: any) => void;
|
|
196
195
|
handleSelectedAmount: (amount: string) => void;
|
|
197
196
|
}, {}, {
|
|
198
|
-
lendersNumber(): any;
|
|
199
|
-
amountLent(): any;
|
|
200
197
|
isInBasket(): any;
|
|
201
198
|
hasMatchingInfo(): boolean;
|
|
202
199
|
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("show-loan-details" | "add-to-basket" | "jump-filter-page" | "remove-from-basket" | "refresh-button" | "update:selected-amount")[], "show-loan-details" | "add-to-basket" | "jump-filter-page" | "remove-from-basket" | "refresh-button" | "update:selected-amount", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -482,6 +479,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
482
479
|
type: BooleanConstructor;
|
|
483
480
|
default: boolean;
|
|
484
481
|
};
|
|
482
|
+
hideBorrowerDetails: {
|
|
483
|
+
type: BooleanConstructor;
|
|
484
|
+
default: boolean;
|
|
485
|
+
};
|
|
485
486
|
boldName: {
|
|
486
487
|
type: BooleanConstructor;
|
|
487
488
|
default: boolean;
|
|
@@ -545,6 +546,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
545
546
|
type: BooleanConstructor;
|
|
546
547
|
default: boolean;
|
|
547
548
|
};
|
|
549
|
+
hideBorrowerDetails: {
|
|
550
|
+
type: BooleanConstructor;
|
|
551
|
+
default: boolean;
|
|
552
|
+
};
|
|
548
553
|
boldName: {
|
|
549
554
|
type: BooleanConstructor;
|
|
550
555
|
default: boolean;
|
|
@@ -575,6 +580,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
575
580
|
distributionModel: string;
|
|
576
581
|
whySpecial: string;
|
|
577
582
|
hideLoanAmount: boolean;
|
|
583
|
+
hideBorrowerDetails: boolean;
|
|
578
584
|
boldName: boolean;
|
|
579
585
|
country: string;
|
|
580
586
|
useIndicativeHelpText: boolean;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ref as
|
|
4
|
-
import {
|
|
1
|
+
import b from "graphql-tag";
|
|
2
|
+
import $ from "numeral";
|
|
3
|
+
import { ref as j, computed as a, watch as q } from "vue";
|
|
4
|
+
import { mdiArrowRight as H, mdiCached as z, mdiLink as J } from "@mdi/js";
|
|
5
5
|
import { LOAN_CALLOUTS_FRAGMENT as Q, LOAN_GEOCODE_FRAGMENT as X, LOAN_PROGRESS_FRAGMENT as Y, loanCardComputedProperties as Z, loanCardMethods as ee } from "../utils/loanCard.js";
|
|
6
6
|
import { getDropdownPriceArray as te, getLendCtaSelectedOption as ae, isLessThan25 as oe } from "../utils/loanUtils.js";
|
|
7
7
|
import { computePostGoalLoanCardStatement as ne } from "../utils/postGoalStatement.js";
|
|
8
8
|
import le from "./KvLoanUse.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import ie from "./KvBorrowerImage.js";
|
|
10
|
+
import re from "./KvLoanCallouts.js";
|
|
11
11
|
import se from "./KvLendCta.js";
|
|
12
12
|
import ue from "./KvLoanProgressGroup.js";
|
|
13
13
|
import de from "./KvLoanTag.js";
|
|
14
14
|
import me from "./KvMaterialIcon.js";
|
|
15
15
|
import fe from "./KvLoadingPlaceholder.js";
|
|
16
16
|
import ce from "./KvLoanTeamPick.js";
|
|
17
|
-
import
|
|
18
|
-
import { KV_LEND_CTA_FRAGMENT as
|
|
19
|
-
import { KV_LOAN_TAG_FRAGMENT as
|
|
17
|
+
import he from "./KvSelect.js";
|
|
18
|
+
import { KV_LEND_CTA_FRAGMENT as ve, KV_LEND_CTA_USER_FRAGMENT as ge } from "./KvLendCta2.js";
|
|
19
|
+
import { KV_LOAN_TAG_FRAGMENT as Le } from "./KvLoanTag2.js";
|
|
20
20
|
import { KV_LOAN_USE_FRAGMENT as ye } from "./KvLoanUse2.js";
|
|
21
21
|
const d = {
|
|
22
22
|
default: "default",
|
|
23
|
-
postGoal: "post-goal"
|
|
24
|
-
|
|
23
|
+
postGoal: "post-goal",
|
|
24
|
+
lightDetailed: "light-detailed"
|
|
25
|
+
}, Ae = (e) => e < 500 && e >= 25, Ce = (e) => oe(e) || Ae(e), $e = b`
|
|
25
26
|
fragment KvCompactLoanCard on LoanBasic {
|
|
26
27
|
id
|
|
27
28
|
image {
|
|
@@ -43,31 +44,31 @@ const d = {
|
|
|
43
44
|
...LoanGeocode
|
|
44
45
|
...LoanProgress
|
|
45
46
|
}
|
|
46
|
-
${
|
|
47
|
-
${
|
|
47
|
+
${ve}
|
|
48
|
+
${Le}
|
|
48
49
|
${ye}
|
|
49
50
|
${Q}
|
|
50
51
|
${X}
|
|
51
52
|
${Y}
|
|
52
|
-
`,
|
|
53
|
+
`, je = b`
|
|
53
54
|
fragment KvCompactLoanCardUser on LoanBasic {
|
|
54
55
|
id
|
|
55
56
|
...KvLendCtaUser
|
|
56
57
|
}
|
|
57
|
-
${
|
|
58
|
-
`,
|
|
58
|
+
${ge}
|
|
59
|
+
`, qe = {
|
|
59
60
|
name: "KvCompactLoanCard",
|
|
60
61
|
components: {
|
|
61
|
-
KvBorrowerImage:
|
|
62
|
+
KvBorrowerImage: ie,
|
|
62
63
|
KvLoadingPlaceholder: fe,
|
|
63
64
|
KvLoanUse: le,
|
|
64
65
|
KvMaterialIcon: me,
|
|
65
66
|
KvLendCta: se,
|
|
66
67
|
KvLoanTag: de,
|
|
67
|
-
KvLoanCallouts:
|
|
68
|
+
KvLoanCallouts: re,
|
|
68
69
|
KvLoanTeamPick: ce,
|
|
69
70
|
KvLoanProgressGroup: ue,
|
|
70
|
-
KvSelect:
|
|
71
|
+
KvSelect: he
|
|
71
72
|
},
|
|
72
73
|
props: {
|
|
73
74
|
variant: {
|
|
@@ -220,125 +221,127 @@ const d = {
|
|
|
220
221
|
"show-loan-details",
|
|
221
222
|
"update:selected-amount"
|
|
222
223
|
],
|
|
223
|
-
setup(e, { emit:
|
|
224
|
-
const
|
|
224
|
+
setup(e, { emit: o }) {
|
|
225
|
+
const l = j(""), m = a(
|
|
225
226
|
() => e.variant === d.postGoal
|
|
227
|
+
), s = a(
|
|
228
|
+
() => e.variant === d.lightDetailed
|
|
229
|
+
), c = a(
|
|
230
|
+
() => m.value || s.value
|
|
231
|
+
), w = a(
|
|
232
|
+
() => e.showRefreshButton && !s.value
|
|
226
233
|
), {
|
|
227
|
-
allDataLoaded:
|
|
228
|
-
borrowerName:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
formattedLocation: c,
|
|
233
|
-
fundraisingPercent: S,
|
|
234
|
+
allDataLoaded: S,
|
|
235
|
+
borrowerName: h,
|
|
236
|
+
distributionModel: v,
|
|
237
|
+
formattedLocation: g,
|
|
238
|
+
fundraisingPercent: B,
|
|
234
239
|
hasProgressData: _,
|
|
235
|
-
imageHash:
|
|
236
|
-
isLoading:
|
|
237
|
-
loanAmount:
|
|
238
|
-
loanBorrowerCount:
|
|
239
|
-
loanCallouts:
|
|
240
|
-
loanStatus:
|
|
241
|
-
loanUse:
|
|
242
|
-
readMorePath:
|
|
243
|
-
state: M,
|
|
240
|
+
imageHash: N,
|
|
241
|
+
isLoading: T,
|
|
242
|
+
loanAmount: f,
|
|
243
|
+
loanBorrowerCount: L,
|
|
244
|
+
loanCallouts: k,
|
|
245
|
+
loanStatus: y,
|
|
246
|
+
loanUse: A,
|
|
247
|
+
readMorePath: R,
|
|
244
248
|
tag: F,
|
|
245
249
|
unreservedAmount: u,
|
|
246
|
-
sharesAvailable:
|
|
247
|
-
} = Z(e), { clickReadMore:
|
|
250
|
+
sharesAvailable: M
|
|
251
|
+
} = Z(e), { clickReadMore: K } = ee(e, o), P = a(() => c.value ? void 0 : { width: "100px", height: "100px" }), D = a(() => {
|
|
248
252
|
if (!e.website)
|
|
249
253
|
return "";
|
|
250
254
|
const t = e.website.trim();
|
|
251
255
|
return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
|
|
252
|
-
}),
|
|
253
|
-
if (
|
|
254
|
-
const t = e.showLightView ? "auto" : "6.75rem",
|
|
255
|
-
return { height: t, maxHeight:
|
|
256
|
-
}),
|
|
256
|
+
}), E = a(() => {
|
|
257
|
+
if (c.value) return {};
|
|
258
|
+
const t = e.showLightView ? "auto" : "6.75rem", n = e.showLightView ? "none" : "6.75rem";
|
|
259
|
+
return { height: t, maxHeight: n };
|
|
260
|
+
}), G = a(() => $(f.value).format("$0,0")), i = a(() => {
|
|
257
261
|
var t;
|
|
258
262
|
return ne({
|
|
259
263
|
anonymizationLevel: (t = e.loan) == null ? void 0 : t.anonymizationLevel,
|
|
260
|
-
borrowerName:
|
|
261
|
-
distributionModel:
|
|
262
|
-
formattedLocation:
|
|
263
|
-
loanAmount:
|
|
264
|
-
loanBorrowerCount:
|
|
265
|
-
loanStatus:
|
|
266
|
-
loanUse:
|
|
264
|
+
borrowerName: h.value,
|
|
265
|
+
distributionModel: v.value,
|
|
266
|
+
formattedLocation: g.value,
|
|
267
|
+
loanAmount: f.value,
|
|
268
|
+
loanBorrowerCount: L.value,
|
|
269
|
+
loanStatus: y.value,
|
|
270
|
+
loanUse: A.value
|
|
267
271
|
});
|
|
268
|
-
}), O =
|
|
269
|
-
var
|
|
272
|
+
}), O = a(() => i.value.borrowerNameWithCountry), U = a(() => i.value.loanUsePrefixStart), V = a(() => i.value.loanUsePrefixEnd), x = a(() => i.value.statementTitle), I = a(() => i.value.visibleUseStatement), C = a(() => {
|
|
273
|
+
var r;
|
|
270
274
|
const t = parseFloat(u.value);
|
|
271
275
|
if (!t) return [];
|
|
272
|
-
const
|
|
276
|
+
const n = t < 25 ? parseFloat(`${((r = e.loan) == null ? void 0 : r.minNoteSize) ?? 25}`) : 25;
|
|
273
277
|
return te(
|
|
274
278
|
u.value,
|
|
275
|
-
|
|
276
|
-
|
|
279
|
+
Ce(t),
|
|
280
|
+
n,
|
|
277
281
|
e.enableFiveDollarsNotes,
|
|
278
282
|
e.isVisitor
|
|
279
283
|
);
|
|
280
284
|
});
|
|
281
|
-
|
|
282
|
-
|
|
285
|
+
q(
|
|
286
|
+
C,
|
|
283
287
|
(t) => {
|
|
284
|
-
var
|
|
285
|
-
if (!
|
|
288
|
+
var r, p;
|
|
289
|
+
if (!m.value) return;
|
|
286
290
|
if (!t.length) {
|
|
287
|
-
|
|
291
|
+
l.value = "";
|
|
288
292
|
return;
|
|
289
293
|
}
|
|
290
|
-
const
|
|
294
|
+
const n = ae(
|
|
291
295
|
e.getCookie,
|
|
292
296
|
e.setCookie,
|
|
293
297
|
e.enableFiveDollarsNotes,
|
|
294
|
-
(p = (
|
|
298
|
+
(p = (r = e.route) == null ? void 0 : r.query) == null ? void 0 : p.utm_campaign,
|
|
295
299
|
u.value,
|
|
296
300
|
e.userBalance ? parseFloat(e.userBalance) : void 0,
|
|
297
301
|
e.fiveDollarsSelected
|
|
298
302
|
);
|
|
299
|
-
|
|
303
|
+
l.value = t.includes(n) ? n : t[0];
|
|
300
304
|
},
|
|
301
305
|
{ immediate: !0 }
|
|
302
306
|
);
|
|
303
|
-
const
|
|
307
|
+
const W = a(() => s.value ? 2 : e.showLightView ? 3 : 4);
|
|
304
308
|
return {
|
|
305
|
-
allDataLoaded:
|
|
306
|
-
amountOptions:
|
|
309
|
+
allDataLoaded: S,
|
|
310
|
+
amountOptions: C,
|
|
307
311
|
borrowerImageStyle: P,
|
|
308
|
-
borrowerName:
|
|
312
|
+
borrowerName: h,
|
|
309
313
|
borrowerNameWithCountry: O,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
fundraisingPercent: S,
|
|
314
|
+
lightDetailedAmount: G,
|
|
315
|
+
distributionModel: v,
|
|
316
|
+
formattedLocation: g,
|
|
317
|
+
formattedWebsite: D,
|
|
318
|
+
fundraisingPercent: B,
|
|
316
319
|
hasProgressData: _,
|
|
317
|
-
imageHash:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
imageHash: N,
|
|
321
|
+
isLightDetailedVariant: s,
|
|
322
|
+
isLoading: T,
|
|
323
|
+
isPostGoalVariant: m,
|
|
324
|
+
loanAmount: f,
|
|
325
|
+
loanBorrowerCount: L,
|
|
326
|
+
loanCallouts: k,
|
|
327
|
+
loanStatus: y,
|
|
328
|
+
loanUse: A,
|
|
329
|
+
loanUsePrefixEnd: V,
|
|
326
330
|
loanUsePrefixStart: U,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
state: M,
|
|
331
|
+
mdiLink: J,
|
|
332
|
+
mdiCached: z,
|
|
333
|
+
mdiArrowRight: H,
|
|
334
|
+
readMorePath: R,
|
|
335
|
+
shouldShowRefreshButton: w,
|
|
333
336
|
tag: F,
|
|
334
337
|
unreservedAmount: u,
|
|
335
|
-
sharesAvailable:
|
|
336
|
-
selectedAmount:
|
|
337
|
-
statementTitle:
|
|
338
|
-
customStyle:
|
|
339
|
-
loanUseLoadingRows:
|
|
338
|
+
sharesAvailable: M,
|
|
339
|
+
selectedAmount: l,
|
|
340
|
+
statementTitle: x,
|
|
341
|
+
customStyle: E,
|
|
342
|
+
loanUseLoadingRows: W,
|
|
340
343
|
visibleUseStatement: I,
|
|
341
|
-
clickReadMore:
|
|
344
|
+
clickReadMore: K,
|
|
342
345
|
trackWebsiteClick: () => {
|
|
343
346
|
e.kvTrackFunction(
|
|
344
347
|
"Lending",
|
|
@@ -348,41 +351,32 @@ const d = {
|
|
|
348
351
|
);
|
|
349
352
|
},
|
|
350
353
|
handleRefreshButton: (t) => {
|
|
351
|
-
|
|
354
|
+
o("refresh-button", t);
|
|
352
355
|
},
|
|
353
356
|
handleSelectedAmount: (t) => {
|
|
354
|
-
var
|
|
355
|
-
|
|
357
|
+
var n;
|
|
358
|
+
l.value = t, o("update:selected-amount", t), e.kvTrackFunction(
|
|
356
359
|
"Lending",
|
|
357
360
|
"Modify lend amount",
|
|
358
361
|
t,
|
|
359
|
-
e.loanId ?? ((
|
|
362
|
+
e.loanId ?? ((n = e.loan) == null ? void 0 : n.id)
|
|
360
363
|
);
|
|
361
364
|
}
|
|
362
365
|
};
|
|
363
366
|
},
|
|
364
367
|
computed: {
|
|
365
|
-
lendersNumber() {
|
|
366
|
-
var e, a;
|
|
367
|
-
return ((a = (e = this.loan) == null ? void 0 : e.lenders) == null ? void 0 : a.totalCount) ?? 0;
|
|
368
|
-
},
|
|
369
|
-
amountLent() {
|
|
370
|
-
var a, n;
|
|
371
|
-
const e = ((n = (a = this.loan) == null ? void 0 : a.loanFundraisingInfo) == null ? void 0 : n.fundedAmount) ?? 0;
|
|
372
|
-
return W(e).format("$0,0");
|
|
373
|
-
},
|
|
374
368
|
isInBasket() {
|
|
375
369
|
var e;
|
|
376
|
-
return ((e = this.basketItems) == null ? void 0 : e.some((
|
|
370
|
+
return ((e = this.basketItems) == null ? void 0 : e.some((o) => o.__typename === "LoanReservation" && o.id === this.loanId)) ?? !1;
|
|
377
371
|
},
|
|
378
372
|
hasMatchingInfo() {
|
|
379
|
-
var e,
|
|
380
|
-
return !!((e = this.loan) != null && e.matchingText) || this.enableMultiMatching && (((
|
|
373
|
+
var e, o, l;
|
|
374
|
+
return !!((e = this.loan) != null && e.matchingText) || this.enableMultiMatching && (((l = (o = this.loan) == null ? void 0 : o.simultaneousMatching) == null ? void 0 : l.length) ?? 0) > 0;
|
|
381
375
|
}
|
|
382
376
|
}
|
|
383
377
|
};
|
|
384
378
|
export {
|
|
385
379
|
$e as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
386
|
-
|
|
387
|
-
|
|
380
|
+
je as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
381
|
+
qe as default
|
|
388
382
|
};
|
|
@@ -36,6 +36,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
36
36
|
type: BooleanConstructor;
|
|
37
37
|
default: boolean;
|
|
38
38
|
};
|
|
39
|
+
hideBorrowerDetails: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
39
43
|
boldName: {
|
|
40
44
|
type: BooleanConstructor;
|
|
41
45
|
default: boolean;
|
|
@@ -99,6 +103,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
99
103
|
type: BooleanConstructor;
|
|
100
104
|
default: boolean;
|
|
101
105
|
};
|
|
106
|
+
hideBorrowerDetails: {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
102
110
|
boldName: {
|
|
103
111
|
type: BooleanConstructor;
|
|
104
112
|
default: boolean;
|
|
@@ -129,6 +137,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
129
137
|
distributionModel: string;
|
|
130
138
|
whySpecial: string;
|
|
131
139
|
hideLoanAmount: boolean;
|
|
140
|
+
hideBorrowerDetails: boolean;
|
|
132
141
|
boldName: boolean;
|
|
133
142
|
country: string;
|
|
134
143
|
useIndicativeHelpText: boolean;
|
package/dist/vue/KvLoanUse2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { truncateStringByWords as
|
|
4
|
-
const
|
|
1
|
+
import u from "graphql-tag";
|
|
2
|
+
import l from "numeral";
|
|
3
|
+
import { truncateStringByWords as i } from "../utils/loanUtils.js";
|
|
4
|
+
const r = "direct", o = (e) => e.charAt(0).toUpperCase() + e.slice(1), t = (e) => e.charAt(0).toLowerCase() + e.slice(1), m = u`
|
|
5
5
|
fragment KvLoanUse on LoanBasic {
|
|
6
6
|
id
|
|
7
7
|
anonymizationLevel
|
|
@@ -13,7 +13,7 @@ const n = "direct", d = r`
|
|
|
13
13
|
distributionModel
|
|
14
14
|
whySpecial
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`, f = {
|
|
17
17
|
name: "KvLoanUse",
|
|
18
18
|
props: {
|
|
19
19
|
anonymizationLevel: {
|
|
@@ -42,7 +42,7 @@ const n = "direct", d = r`
|
|
|
42
42
|
},
|
|
43
43
|
distributionModel: {
|
|
44
44
|
type: String,
|
|
45
|
-
default:
|
|
45
|
+
default: r
|
|
46
46
|
},
|
|
47
47
|
whySpecial: {
|
|
48
48
|
type: String,
|
|
@@ -52,6 +52,11 @@ const n = "direct", d = r`
|
|
|
52
52
|
type: Boolean,
|
|
53
53
|
default: !1
|
|
54
54
|
},
|
|
55
|
+
// Unlike hideLoanAmount, this drops the name and country too and never shows a read-more link.
|
|
56
|
+
hideBorrowerDetails: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
55
60
|
boldName: {
|
|
56
61
|
type: Boolean,
|
|
57
62
|
default: !1
|
|
@@ -78,10 +83,10 @@ const n = "direct", d = r`
|
|
|
78
83
|
return this.status === "fundraising" || this.status === "inactive" || this.status === "reviewed" ? "helps" : "helped";
|
|
79
84
|
},
|
|
80
85
|
isDirect() {
|
|
81
|
-
return this.distributionModel ===
|
|
86
|
+
return this.distributionModel === r;
|
|
82
87
|
},
|
|
83
88
|
whySpecialSentence() {
|
|
84
|
-
return this.whySpecial ? ` This loan is special because ${
|
|
89
|
+
return this.whySpecial ? ` This loan is special because ${t(this.whySpecial)}` : "";
|
|
85
90
|
},
|
|
86
91
|
nameSpan() {
|
|
87
92
|
return this.boldName ? this.country ? `<span class="data-hj-suppress tw-font-medium">${this.name} in ${this.country}</span>` : `<span class="data-hj-suppress tw-font-medium">${this.name}</span>` : `<span class="data-hj-suppress">${this.name}</span>`;
|
|
@@ -89,18 +94,20 @@ const n = "direct", d = r`
|
|
|
89
94
|
loanUse() {
|
|
90
95
|
if (this.anonymizationLevel === "full" || this.use.length === 0)
|
|
91
96
|
return "For the borrower's privacy, this loan has been made anonymous.";
|
|
97
|
+
if (this.hideBorrowerDetails)
|
|
98
|
+
return `${o(this.helpLanguage)} ${t(this.use)}${this.whySpecialSentence}`;
|
|
92
99
|
if (this.hideLoanAmount) {
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
return this.showReadMore && (
|
|
100
|
+
const n = this.useIndicativeHelpText ? this.helpLanguage : "Help";
|
|
101
|
+
let a = `${o(n)} ${this.nameSpan} ${t(this.use)} ${this.whySpecialSentence}`;
|
|
102
|
+
return this.showReadMore && (a = `${i(a, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), a;
|
|
96
103
|
}
|
|
97
|
-
const
|
|
98
|
-
let
|
|
99
|
-
return this.showReadMore && (
|
|
104
|
+
const e = this.borrowerCount > 1;
|
|
105
|
+
let s = `${l(this.loanAmount).format("$0,0")} ${this.isDirect ? "to" : this.helpLanguage} ${e ? "a member of " : ""}${this.nameSpan} ${this.isDirect ? `${this.helpLanguage} ` : ""}${t(this.use)}${this.whySpecialSentence}`;
|
|
106
|
+
return this.showReadMore && (s = `${i(s, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), s;
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
};
|
|
103
110
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
m as KV_LOAN_USE_FRAGMENT,
|
|
112
|
+
f as default
|
|
106
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"fuse.js": "^7.1.0"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "007bb466335bd646f36fb385eec7bd0dea54988c"
|
|
116
116
|
}
|