@kiva/kv-components 8.12.1 → 8.13.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/utils/postGoalStatement.d.ts +20 -0
- package/dist/utils/postGoalStatement.js +39 -0
- package/dist/vue/KvCompactLoanCard.css +1 -1
- package/dist/vue/KvCompactLoanCard.js +163 -87
- package/dist/vue/KvCompactLoanCard.vue.d.ts +87 -1
- package/dist/vue/KvCompactLoanCard2.js +191 -105
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const POST_GOAL_STATEMENT_MAX_LENGTH = 200;
|
|
2
|
+
export interface ComputePostGoalStatementArgs {
|
|
3
|
+
borrowerName: string;
|
|
4
|
+
distributionModel: string;
|
|
5
|
+
formattedLocation: string;
|
|
6
|
+
loanAmount: string;
|
|
7
|
+
loanBorrowerCount: number;
|
|
8
|
+
loanStatus: string;
|
|
9
|
+
loanUse: string;
|
|
10
|
+
anonymizationLevel?: string;
|
|
11
|
+
whySpecial?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PostGoalStatementResult {
|
|
14
|
+
borrowerNameWithCountry: string;
|
|
15
|
+
loanUsePrefixStart: string;
|
|
16
|
+
loanUsePrefixEnd: string;
|
|
17
|
+
statementTitle: string | undefined;
|
|
18
|
+
visibleUseStatement: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function computePostGoalLoanCardStatement(args: ComputePostGoalStatementArgs): PostGoalStatementResult;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import L from "numeral";
|
|
2
|
+
const S = 200, o = "...";
|
|
3
|
+
function p(e) {
|
|
4
|
+
return e.length ? e.charAt(0).toLowerCase() + e.slice(1) : "";
|
|
5
|
+
}
|
|
6
|
+
function g(e, t) {
|
|
7
|
+
return t <= 0 ? "" : e.length <= t ? e : t <= o.length ? o.slice(0, t) : `${e.slice(0, t - o.length).trimEnd()}${o}`;
|
|
8
|
+
}
|
|
9
|
+
function U(e) {
|
|
10
|
+
const {
|
|
11
|
+
anonymizationLevel: t,
|
|
12
|
+
borrowerName: a,
|
|
13
|
+
distributionModel: l,
|
|
14
|
+
formattedLocation: s,
|
|
15
|
+
loanAmount: w,
|
|
16
|
+
loanBorrowerCount: b,
|
|
17
|
+
loanStatus: T,
|
|
18
|
+
loanUse: c,
|
|
19
|
+
whySpecial: f
|
|
20
|
+
} = e, u = s ? `${a} in ${s}` : a, n = t !== "full" && !!c.length, m = ["fundraising", "inactive", "reviewed"].includes(T) ? "helps" : "helped", r = n ? [
|
|
21
|
+
L(w).format("$0,0"),
|
|
22
|
+
l === "direct" ? "to" : m,
|
|
23
|
+
b > 1 ? "a member of" : ""
|
|
24
|
+
].filter(Boolean).join(" ") : "";
|
|
25
|
+
let i = "";
|
|
26
|
+
n && (i = l === "direct" ? ` ${m} ` : " ");
|
|
27
|
+
const E = f ? ` This loan is special because ${p(f)}` : "", d = n ? `${p(c)}${E}` : "For the borrower's privacy, this loan has been made anonymous.", h = n ? `${r} ${u}${i}` : "", $ = `${h}${d}`;
|
|
28
|
+
return {
|
|
29
|
+
borrowerNameWithCountry: u,
|
|
30
|
+
loanUsePrefixStart: r ? `${r} ` : "",
|
|
31
|
+
loanUsePrefixEnd: i,
|
|
32
|
+
statementTitle: $.length > S ? $ : void 0,
|
|
33
|
+
visibleUseStatement: g(d, S - h.length)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
S as POST_GOAL_STATEMENT_MAX_LENGTH,
|
|
38
|
+
U as computePostGoalLoanCardStatement
|
|
39
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.loan-card-use[data-v-
|
|
1
|
+
.loan-card-use[data-v-7b59a69b]:hover,.loan-card-use[data-v-7b59a69b]: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-7b59a69b]{text-decoration-line:underline}.loan-card-progress[data-v-7b59a69b]:hover,.loan-card-progress[data-v-7b59a69b]:focus{text-decoration-line:none}.loan-card-use-text[data-v-7b59a69b] p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden;text-overflow:ellipsis}.loan-card-cta[data-v-7b59a69b] form,.loan-card-cta[data-v-7b59a69b] fieldset,.loan-card-cta[data-v-7b59a69b] .tw-w-full,.loan-card-cta[data-v-7b59a69b] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-7b59a69b] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}[data-v-7b59a69b] .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-7b59a69b] .goal-variant-callouts span{font-weight:500}.goal-variant-progress-group[data-v-7b59a69b] div[role=progressbar]{background-color:#d9d9d9}
|
|
@@ -1,130 +1,177 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { KV_COMPACT_LOAN_CARD_FRAGMENT as
|
|
3
|
-
import { resolveComponent as w, openBlock as
|
|
1
|
+
import T from "./KvCompactLoanCard2.js";
|
|
2
|
+
import { KV_COMPACT_LOAN_CARD_FRAGMENT as le, KV_COMPACT_LOAN_CARD_USER_FRAGMENT as re } from "./KvCompactLoanCard2.js";
|
|
3
|
+
import { resolveComponent as w, openBlock as o, createElementBlock as l, normalizeClass as s, createVNode as i, createCommentVNode as m, createElementVNode as r, normalizeStyle as b, createBlock as d, resolveDynamicComponent as g, withCtx as f, toDisplayString as c, withModifiers as R, Fragment as u, renderList as v } from "vue";
|
|
4
4
|
import "./KvCompactLoanCard.css";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import B from "../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const G = ["aria-busy"], S = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, D = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "tw-flex-shrink-0 tw-overflow-hidden"
|
|
9
|
+
}, U = {
|
|
7
10
|
key: 0,
|
|
8
11
|
class: "tw-mb-0.5 tw-w-full"
|
|
9
|
-
},
|
|
12
|
+
}, W = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, E = ["href"], F = { class: "tw-truncate" }, O = ["title"], j = { class: "tw-font-medium" }, I = {
|
|
10
13
|
key: 0,
|
|
11
14
|
class: "loan-card-use-text tw-w-full tw-overflow-hidden"
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
}, K = { class: "tw-flex-1 tw-min-w-0 tw-mr-1" }, z = {
|
|
16
|
+
class: "tw-flex-1 tw-min-w-0",
|
|
17
|
+
style: { "max-width": "6.5rem" }
|
|
18
|
+
}, H = { class: "tw-min-w-12" }, Z = ["value"], q = { class: "tw-flex-1 tw-min-w-0" }, J = { class: "tw-p-1 tw-rounded-l-sm tw-border tw-border-gray-100 tw-border-r-0" };
|
|
19
|
+
function Q(k, n, t, e, X, Y) {
|
|
20
|
+
var x;
|
|
21
|
+
const y = w("kv-material-icon"), h = w("kv-loading-placeholder"), L = w("kv-borrower-image"), P = w("kv-loan-tag"), C = w("kv-loan-use"), V = w("kv-loan-callouts"), _ = w("kv-loan-progress-group"), N = w("kv-select"), A = w("kv-lend-cta");
|
|
22
|
+
return o(), l("div", {
|
|
23
|
+
class: s(["tw-flex tw-flex-col tw-items-start tw-justify-between tw-p-1 tw-bg-white tw-rounded-md tw-shadow-lg tw-w-full", {
|
|
24
|
+
"tw-relative": t.showRefreshButton,
|
|
25
|
+
"!tw-p-1.5": t.showLightView || e.isPostGoalVariant
|
|
26
|
+
}]),
|
|
27
|
+
"aria-busy": e.isLoading ? "true" : "false"
|
|
17
28
|
}, [
|
|
18
|
-
t.showRefreshButton ? (
|
|
29
|
+
t.showRefreshButton ? (o(), l("button", {
|
|
19
30
|
key: 0,
|
|
20
31
|
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",
|
|
21
|
-
onClick:
|
|
32
|
+
onClick: n[0] || (n[0] = (...a) => e.handleRefreshButton && e.handleRefreshButton(...a))
|
|
22
33
|
}, [
|
|
23
|
-
i(
|
|
34
|
+
i(y, {
|
|
24
35
|
icon: e.mdiCached,
|
|
25
36
|
class: "tw-w-2.5 tw-h-2.5 tw--scale-x-100 tw-text-gray-500"
|
|
26
37
|
}, null, 8, ["icon"])
|
|
27
|
-
])) :
|
|
28
|
-
r("div",
|
|
38
|
+
])) : m("", !0),
|
|
39
|
+
r("div", S, [
|
|
29
40
|
r("div", {
|
|
30
|
-
class:
|
|
31
|
-
|
|
41
|
+
class: s(["tw-flex tw-items-start tw-gap-2 tw-w-full loan-card-active-hover", {
|
|
42
|
+
"!tw-gap-1": t.showLightView,
|
|
43
|
+
"!tw-gap-1.5 md:!tw-gap-2.5": e.isPostGoalVariant
|
|
44
|
+
}]),
|
|
45
|
+
style: b(e.customStyle)
|
|
32
46
|
}, [
|
|
33
|
-
|
|
34
|
-
|
|
47
|
+
e.isLoading ? (o(), d(h, {
|
|
48
|
+
key: 0,
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
class: s({
|
|
51
|
+
"!tw-w-7.5 !tw-h-7.5": t.showLightView,
|
|
52
|
+
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": e.isPostGoalVariant
|
|
53
|
+
}),
|
|
54
|
+
style: b(e.borrowerImageStyle)
|
|
55
|
+
}, null, 8, ["class", "style"])) : (o(), l("div", D, [
|
|
56
|
+
(o(), d(g(e.tag), {
|
|
35
57
|
to: e.readMorePath,
|
|
36
58
|
href: e.readMorePath,
|
|
37
59
|
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
38
60
|
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
39
61
|
class: "tw-flex",
|
|
40
62
|
"aria-label": "Borrower image",
|
|
41
|
-
onClick:
|
|
63
|
+
onClick: n[1] || (n[1] = (a) => e.clickReadMore("Photo", a))
|
|
42
64
|
}, {
|
|
43
65
|
default: f(() => [
|
|
44
|
-
i(
|
|
45
|
-
class:
|
|
46
|
-
|
|
66
|
+
i(L, {
|
|
67
|
+
class: s(["tw-bg-gray-300 tw-rounded-sm tw-object-cover tw-bg-clip-content", {
|
|
68
|
+
"!tw-w-7.5 !tw-h-7.5": t.showLightView,
|
|
69
|
+
"!tw-w-7.5 !tw-h-7.5 md:!tw-w-12.5 md:!tw-h-12.5": e.isPostGoalVariant
|
|
70
|
+
}]),
|
|
71
|
+
style: b(e.borrowerImageStyle),
|
|
47
72
|
alt: `Photo of ${e.borrowerName}`,
|
|
48
73
|
"aspect-ratio": 1,
|
|
49
74
|
"default-image": { width: 200, faceZoom: 50 },
|
|
50
75
|
hash: e.imageHash,
|
|
51
76
|
images: [{ width: 200, faceZoom: 50 }],
|
|
52
77
|
"photo-path": t.photoPath
|
|
53
|
-
}, null, 8, ["class", "alt", "hash", "photo-path"])
|
|
78
|
+
}, null, 8, ["class", "style", "alt", "hash", "photo-path"])
|
|
54
79
|
]),
|
|
55
80
|
_: 1
|
|
56
81
|
}, 8, ["to", "href", "target", "rel"]))
|
|
57
|
-
]),
|
|
58
|
-
r("div",
|
|
59
|
-
|
|
60
|
-
|
|
82
|
+
])),
|
|
83
|
+
r("div", {
|
|
84
|
+
class: s(["tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0", { "!tw-gap-0": e.isPostGoalVariant }])
|
|
85
|
+
}, [
|
|
86
|
+
t.businessName ? (o(), l("div", U, [
|
|
87
|
+
(o(), d(g(e.tag), {
|
|
61
88
|
to: e.readMorePath,
|
|
62
89
|
href: e.readMorePath,
|
|
63
90
|
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
64
91
|
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
65
92
|
class: "tw-no-underline hover:tw-underline focus:tw-no-underline",
|
|
66
93
|
"aria-label": "Business name",
|
|
67
|
-
onClick:
|
|
94
|
+
onClick: n[2] || (n[2] = (a) => e.clickReadMore("Business", a))
|
|
68
95
|
}, {
|
|
69
96
|
default: f(() => [
|
|
70
|
-
r("h3",
|
|
97
|
+
r("h3", W, c(t.businessName), 1)
|
|
71
98
|
]),
|
|
72
99
|
_: 1
|
|
73
100
|
}, 8, ["to", "href", "target", "rel"])),
|
|
74
|
-
t.website ? (
|
|
101
|
+
t.website ? (o(), l("a", {
|
|
75
102
|
key: 0,
|
|
76
103
|
href: e.formattedWebsite,
|
|
77
104
|
target: "_blank",
|
|
78
105
|
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",
|
|
79
|
-
onClick:
|
|
106
|
+
onClick: n[3] || (n[3] = R((...a) => e.trackWebsiteClick && e.trackWebsiteClick(...a), ["stop"]))
|
|
80
107
|
}, [
|
|
81
|
-
i(
|
|
108
|
+
i(y, {
|
|
82
109
|
icon: e.mdiLink,
|
|
83
110
|
class: "tw-w-2 tw-h-2"
|
|
84
111
|
}, null, 8, ["icon"]),
|
|
85
|
-
r("span",
|
|
86
|
-
], 8,
|
|
87
|
-
])) :
|
|
88
|
-
(
|
|
112
|
+
r("span", F, c(t.website), 1)
|
|
113
|
+
], 8, E)) : m("", !0)
|
|
114
|
+
])) : m("", !0),
|
|
115
|
+
e.isLoading ? m("", !0) : (o(), d(g(e.tag), {
|
|
116
|
+
key: 1,
|
|
89
117
|
to: e.readMorePath,
|
|
90
118
|
href: e.readMorePath,
|
|
91
119
|
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
92
120
|
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
93
121
|
class: "tw-flex tw-no-underline hover:tw-no-underline focus:tw-no-underline -tw-mt-1",
|
|
94
122
|
"aria-label": "Loan tag",
|
|
95
|
-
onClick:
|
|
123
|
+
onClick: n[4] || (n[4] = (a) => e.clickReadMore("Tag", a))
|
|
96
124
|
}, {
|
|
97
125
|
default: f(() => [
|
|
98
|
-
t.showTags
|
|
126
|
+
t.showTags ? (o(), d(P, {
|
|
99
127
|
key: 0,
|
|
128
|
+
class: s({
|
|
129
|
+
"tw-mb-1 !tw-font-medium": e.isPostGoalVariant
|
|
130
|
+
}),
|
|
100
131
|
loan: t.loan
|
|
101
|
-
}, null, 8, ["loan"])) :
|
|
132
|
+
}, null, 8, ["class", "loan"])) : m("", !0)
|
|
102
133
|
]),
|
|
103
134
|
_: 1
|
|
104
135
|
}, 8, ["to", "href", "target", "rel"])),
|
|
105
|
-
|
|
106
|
-
key:
|
|
136
|
+
e.isPostGoalVariant ? (o(), l(u, { key: 2 }, [
|
|
137
|
+
e.isLoading ? (o(), l(u, { key: 0 }, v(4, (a) => i(h, {
|
|
138
|
+
key: a,
|
|
139
|
+
class: "tw-mb-0.5 md:!tw-mb-1.5 !tw-w-full !tw-h-1.5 md:!tw-h-2"
|
|
140
|
+
})), 64)) : (o(), l("p", {
|
|
141
|
+
key: 1,
|
|
142
|
+
class: "tw-text-small tw-mb-0 tw-leading-normal",
|
|
143
|
+
style: { "line-height": "150%" },
|
|
144
|
+
title: e.statementTitle,
|
|
145
|
+
"data-testid": "loan-use-statement"
|
|
146
|
+
}, [
|
|
147
|
+
r("span", null, c(e.loanUsePrefixStart), 1),
|
|
148
|
+
r("span", j, c(e.borrowerNameWithCountry), 1),
|
|
149
|
+
r("span", null, c(e.loanUsePrefixEnd), 1),
|
|
150
|
+
r("span", null, c(e.visibleUseStatement), 1)
|
|
151
|
+
], 8, O))
|
|
152
|
+
], 64)) : t.showLoanUse ? (o(), d(g(e.tag), {
|
|
153
|
+
key: 3,
|
|
107
154
|
to: e.readMorePath,
|
|
108
155
|
href: e.readMorePath,
|
|
109
156
|
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
110
157
|
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
111
158
|
class: "loan-card-use tw-no-underline tw-text-primary tw-block tw-w-full",
|
|
112
159
|
"aria-label": "Loan use",
|
|
113
|
-
onClick:
|
|
160
|
+
onClick: n[5] || (n[5] = (a) => e.clickReadMore("Use", a))
|
|
114
161
|
}, {
|
|
115
162
|
default: f(() => [
|
|
116
|
-
e.isLoading ? (
|
|
117
|
-
(
|
|
163
|
+
e.isLoading ? (o(), l("div", I, [
|
|
164
|
+
(o(!0), l(u, null, v([...Array(e.loanUseLoadingRows)], (a, M) => (o(), l("div", {
|
|
118
165
|
key: M,
|
|
119
166
|
class: "tw-h-2 tw-mb-1"
|
|
120
167
|
}, [
|
|
121
|
-
i(
|
|
168
|
+
i(h)
|
|
122
169
|
]))), 128))
|
|
123
|
-
])) : (
|
|
170
|
+
])) : (o(), l("div", {
|
|
124
171
|
key: 1,
|
|
125
|
-
class:
|
|
172
|
+
class: s(["loan-card-use-text tw-w-full tw-overflow-hidden", { "!tw--mt-1": t.showTags && t.loan.matchingText && t.showLightView }])
|
|
126
173
|
}, [
|
|
127
|
-
i(
|
|
174
|
+
i(C, {
|
|
128
175
|
use: e.loanUse,
|
|
129
176
|
"loan-amount": e.loanAmount,
|
|
130
177
|
status: e.loanStatus,
|
|
@@ -140,29 +187,58 @@ function z(h, o, t, e, G, H) {
|
|
|
140
187
|
], 2))
|
|
141
188
|
]),
|
|
142
189
|
_: 1
|
|
143
|
-
}, 8, ["to", "href", "target", "rel"])) :
|
|
144
|
-
])
|
|
190
|
+
}, 8, ["to", "href", "target", "rel"])) : m("", !0)
|
|
191
|
+
], 2)
|
|
145
192
|
], 6),
|
|
146
|
-
e.isLoading || typeof e.loanCallouts > "u" ? (
|
|
193
|
+
e.isLoading || typeof e.loanCallouts > "u" ? (o(), d(h, {
|
|
147
194
|
key: 0,
|
|
148
195
|
class: "tw-mt-1.5 tw-mb-1 tw-rounded-full",
|
|
149
196
|
style: { width: "60%", height: "1.5rem" }
|
|
150
|
-
})) : (
|
|
197
|
+
})) : (o(), d(V, {
|
|
151
198
|
key: 1,
|
|
152
199
|
callouts: e.loanCallouts,
|
|
153
|
-
class: "tw-mt-1.5",
|
|
154
|
-
onClick:
|
|
155
|
-
}, null, 8, ["callouts"]))
|
|
200
|
+
class: s(["tw-mt-1.5", { "goal-variant-callouts": e.isPostGoalVariant }]),
|
|
201
|
+
onClick: n[6] || (n[6] = (a) => k.$emit("jump-filter-page", a))
|
|
202
|
+
}, null, 8, ["callouts", "class"]))
|
|
156
203
|
]),
|
|
157
204
|
r("div", {
|
|
158
|
-
class:
|
|
159
|
-
"tw-
|
|
160
|
-
|
|
161
|
-
])
|
|
205
|
+
class: s(["tw-flex tw-items-center tw-justify-between tw-w-full tw-mt-1", {
|
|
206
|
+
"tw-gap-1": e.sharesAvailable,
|
|
207
|
+
"!tw-items-end !tw-gap-2": e.isPostGoalVariant
|
|
208
|
+
}])
|
|
162
209
|
}, [
|
|
163
|
-
e.hasProgressData ? (
|
|
164
|
-
r("div",
|
|
165
|
-
|
|
210
|
+
e.hasProgressData ? e.isPostGoalVariant ? (o(), l(u, { key: 1 }, [
|
|
211
|
+
r("div", z, [
|
|
212
|
+
i(_, {
|
|
213
|
+
"money-left": e.unreservedAmount,
|
|
214
|
+
"progress-percent": e.fundraisingPercent,
|
|
215
|
+
class: "tw-text-black goal-variant-progress-group"
|
|
216
|
+
}, null, 8, ["money-left", "progress-percent"])
|
|
217
|
+
]),
|
|
218
|
+
r("div", H, [
|
|
219
|
+
i(N, {
|
|
220
|
+
id: `PostGoalAmountDropdown_${((x = t.loan) == null ? void 0 : x.id) ?? t.loanId}`,
|
|
221
|
+
modelValue: e.selectedAmount,
|
|
222
|
+
"onUpdate:modelValue": [
|
|
223
|
+
n[7] || (n[7] = (a) => e.selectedAmount = a),
|
|
224
|
+
e.handleSelectedAmount
|
|
225
|
+
],
|
|
226
|
+
"aria-label": "Lend amount",
|
|
227
|
+
disabled: !e.amountOptions.length,
|
|
228
|
+
class: "amount-dropdown"
|
|
229
|
+
}, {
|
|
230
|
+
default: f(() => [
|
|
231
|
+
(o(!0), l(u, null, v(e.amountOptions, (a) => (o(), l("option", {
|
|
232
|
+
key: a,
|
|
233
|
+
value: a
|
|
234
|
+
}, " $" + c(a), 9, Z))), 128))
|
|
235
|
+
]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["id", "modelValue", "disabled", "onUpdate:modelValue"])
|
|
238
|
+
])
|
|
239
|
+
], 64)) : (o(), l(u, { key: 2 }, [
|
|
240
|
+
r("div", q, [
|
|
241
|
+
e.sharesAvailable ? (o(), d(g(e.tag), {
|
|
166
242
|
key: 0,
|
|
167
243
|
to: e.readMorePath,
|
|
168
244
|
href: e.readMorePath,
|
|
@@ -170,10 +246,10 @@ function z(h, o, t, e, G, H) {
|
|
|
170
246
|
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
171
247
|
class: "loan-card-progress tw-no-underline tw-block",
|
|
172
248
|
"aria-label": "Loan progress",
|
|
173
|
-
onClick:
|
|
249
|
+
onClick: n[8] || (n[8] = (a) => e.clickReadMore("Progress", a))
|
|
174
250
|
}, {
|
|
175
251
|
default: f(() => [
|
|
176
|
-
i(
|
|
252
|
+
i(_, {
|
|
177
253
|
id: "loanProgress",
|
|
178
254
|
"money-left": e.unreservedAmount,
|
|
179
255
|
"progress-percent": e.fundraisingPercent,
|
|
@@ -181,21 +257,21 @@ function z(h, o, t, e, G, H) {
|
|
|
181
257
|
}, null, 8, ["money-left", "progress-percent"])
|
|
182
258
|
]),
|
|
183
259
|
_: 1
|
|
184
|
-
}, 8, ["to", "href", "target", "rel"])) :
|
|
260
|
+
}, 8, ["to", "href", "target", "rel"])) : m("", !0)
|
|
185
261
|
]),
|
|
186
|
-
t.showLightView ? (
|
|
262
|
+
t.showLightView ? (o(), l("button", {
|
|
187
263
|
key: 0,
|
|
188
264
|
class: "tw-ml-2",
|
|
189
|
-
onClick:
|
|
265
|
+
onClick: n[9] || (n[9] = (a) => e.clickReadMore("View", a))
|
|
190
266
|
}, [
|
|
191
|
-
r("span",
|
|
192
|
-
|
|
193
|
-
])) : (
|
|
267
|
+
r("span", J, " $" + c(t.customAmountLent), 1),
|
|
268
|
+
n[13] || (n[13] = 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))
|
|
269
|
+
])) : (o(), l("div", {
|
|
194
270
|
key: 1,
|
|
195
|
-
class:
|
|
271
|
+
class: s(["tw-flex-shrink-0 loan-card-cta", { "tw-w-full": !e.sharesAvailable }]),
|
|
196
272
|
style: { height: "40px" }
|
|
197
273
|
}, [
|
|
198
|
-
i(
|
|
274
|
+
i(A, {
|
|
199
275
|
loan: t.loan,
|
|
200
276
|
"unreserved-amount": e.unreservedAmount,
|
|
201
277
|
"basket-items": t.basketItems,
|
|
@@ -215,34 +291,34 @@ function z(h, o, t, e, G, H) {
|
|
|
215
291
|
"primary-button-text": t.primaryButtonText,
|
|
216
292
|
"secondary-button-text": t.secondaryButtonText,
|
|
217
293
|
"secondary-button-handler": t.secondaryButtonHandler,
|
|
218
|
-
onAddToBasket:
|
|
219
|
-
onShowLoanDetails:
|
|
220
|
-
onRemoveFromBasket:
|
|
294
|
+
onAddToBasket: n[10] || (n[10] = (a) => k.$emit("add-to-basket", a)),
|
|
295
|
+
onShowLoanDetails: n[11] || (n[11] = (a) => e.clickReadMore("ViewLoan", a)),
|
|
296
|
+
onRemoveFromBasket: n[12] || (n[12] = (a) => k.$emit("remove-from-basket", a))
|
|
221
297
|
}, 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"])
|
|
222
298
|
], 2))
|
|
223
|
-
], 64)) : (
|
|
224
|
-
r("div",
|
|
225
|
-
i(
|
|
299
|
+
], 64)) : (o(), l(u, { key: 0 }, [
|
|
300
|
+
r("div", K, [
|
|
301
|
+
i(h, {
|
|
226
302
|
class: "tw-mb-0.5",
|
|
227
303
|
style: { width: "100%", maxWidth: "11rem", height: "1rem" }
|
|
228
304
|
}),
|
|
229
|
-
i(
|
|
305
|
+
i(h, {
|
|
230
306
|
class: "tw-rounded",
|
|
231
307
|
style: { width: "100%", maxWidth: "11rem", height: "0.5rem" }
|
|
232
308
|
})
|
|
233
309
|
]),
|
|
234
|
-
e.allDataLoaded ?
|
|
310
|
+
e.allDataLoaded ? m("", !0) : (o(), d(h, {
|
|
235
311
|
key: 0,
|
|
236
312
|
class: "tw-rounded tw-flex-shrink-0",
|
|
237
313
|
style: { width: "8rem", height: "2.5rem" }
|
|
238
314
|
}))
|
|
239
315
|
], 64))
|
|
240
316
|
], 2)
|
|
241
|
-
],
|
|
317
|
+
], 10, G);
|
|
242
318
|
}
|
|
243
|
-
const
|
|
319
|
+
const ae = /* @__PURE__ */ B(T, [["render", Q], ["__scopeId", "data-v-7b59a69b"]]);
|
|
244
320
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
321
|
+
le as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
322
|
+
re as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
323
|
+
ae as default
|
|
248
324
|
};
|
|
@@ -3,6 +3,11 @@ import { GetCookieFn, SetCookieFn } from '../utils/loanUtils';
|
|
|
3
3
|
export declare const KV_COMPACT_LOAN_CARD_FRAGMENT: import('graphql').DocumentNode;
|
|
4
4
|
export declare const KV_COMPACT_LOAN_CARD_USER_FRAGMENT: import('graphql').DocumentNode;
|
|
5
5
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
variant: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: "default";
|
|
9
|
+
validator: (value: string) => boolean;
|
|
10
|
+
};
|
|
6
11
|
loanId: {
|
|
7
12
|
type: NumberConstructor;
|
|
8
13
|
default: any;
|
|
@@ -137,7 +142,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
137
142
|
};
|
|
138
143
|
}>, {
|
|
139
144
|
allDataLoaded: import('vue').ComputedRef<boolean>;
|
|
145
|
+
amountOptions: import('vue').ComputedRef<string[]>;
|
|
146
|
+
borrowerImageStyle: import('vue').ComputedRef<{
|
|
147
|
+
width: string;
|
|
148
|
+
height: string;
|
|
149
|
+
}>;
|
|
140
150
|
borrowerName: import('vue').ComputedRef<any>;
|
|
151
|
+
borrowerNameWithCountry: import('vue').ComputedRef<string>;
|
|
141
152
|
city: import('vue').ComputedRef<any>;
|
|
142
153
|
countryName: import('vue').ComputedRef<any>;
|
|
143
154
|
distributionModel: import('vue').ComputedRef<any>;
|
|
@@ -147,11 +158,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
147
158
|
hasProgressData: import('vue').ComputedRef<boolean>;
|
|
148
159
|
imageHash: import('vue').ComputedRef<any>;
|
|
149
160
|
isLoading: import('vue').ComputedRef<boolean>;
|
|
161
|
+
isPostGoalVariant: import('vue').ComputedRef<boolean>;
|
|
150
162
|
loanAmount: import('vue').ComputedRef<any>;
|
|
151
163
|
loanBorrowerCount: import('vue').ComputedRef<any>;
|
|
152
164
|
loanCallouts: import('vue').ComputedRef<import('..').Callout[]>;
|
|
153
165
|
loanStatus: import('vue').ComputedRef<any>;
|
|
154
166
|
loanUse: import('vue').ComputedRef<any>;
|
|
167
|
+
loanUsePrefixEnd: import('vue').ComputedRef<string>;
|
|
168
|
+
loanUsePrefixStart: import('vue').ComputedRef<string>;
|
|
155
169
|
mdiMapMarker: string;
|
|
156
170
|
mdiHome: string;
|
|
157
171
|
mdiLink: string;
|
|
@@ -161,18 +175,30 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
161
175
|
tag: import('vue').ComputedRef<"router-link" | "a">;
|
|
162
176
|
unreservedAmount: import('vue').ComputedRef<any>;
|
|
163
177
|
sharesAvailable: import('vue').ComputedRef<boolean>;
|
|
178
|
+
selectedAmount: import('vue').Ref<string, string>;
|
|
179
|
+
statementTitle: import('vue').ComputedRef<string>;
|
|
164
180
|
customStyle: import('vue').ComputedRef<{
|
|
181
|
+
height?: undefined;
|
|
182
|
+
maxHeight?: undefined;
|
|
183
|
+
} | {
|
|
165
184
|
height: string;
|
|
166
185
|
maxHeight: string;
|
|
167
186
|
}>;
|
|
168
187
|
loanUseLoadingRows: import('vue').ComputedRef<3 | 4>;
|
|
188
|
+
visibleUseStatement: import('vue').ComputedRef<string>;
|
|
169
189
|
clickReadMore: (target: string, event: Event) => void;
|
|
170
190
|
trackWebsiteClick: () => void;
|
|
171
191
|
handleRefreshButton: (event: any) => void;
|
|
192
|
+
handleSelectedAmount: (amount: string) => void;
|
|
172
193
|
}, {}, {
|
|
173
194
|
lendersNumber(): any;
|
|
174
195
|
amountLent(): any;
|
|
175
|
-
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button")[], "add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
196
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("show-loan-details" | "add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button" | "update:selected-amount")[], "show-loan-details" | "add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button" | "update:selected-amount", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
197
|
+
variant: {
|
|
198
|
+
type: StringConstructor;
|
|
199
|
+
default: "default";
|
|
200
|
+
validator: (value: string) => boolean;
|
|
201
|
+
};
|
|
176
202
|
loanId: {
|
|
177
203
|
type: NumberConstructor;
|
|
178
204
|
default: any;
|
|
@@ -307,10 +333,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
307
333
|
};
|
|
308
334
|
}>> & Readonly<{
|
|
309
335
|
"onAdd-to-basket"?: (...args: any[]) => any;
|
|
336
|
+
"onShow-loan-details"?: (...args: any[]) => any;
|
|
310
337
|
"onRemove-from-basket"?: (...args: any[]) => any;
|
|
311
338
|
"onJump-filter-page"?: (...args: any[]) => any;
|
|
312
339
|
"onRefresh-button"?: (...args: any[]) => any;
|
|
340
|
+
"onUpdate:selected-amount"?: (...args: any[]) => any;
|
|
313
341
|
}>, {
|
|
342
|
+
variant: string;
|
|
314
343
|
loan: Record<string, any>;
|
|
315
344
|
externalLinks: boolean;
|
|
316
345
|
customLoanDetails: boolean;
|
|
@@ -1295,5 +1324,62 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1295
1324
|
bgVariant: string;
|
|
1296
1325
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1297
1326
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1327
|
+
KvSelect: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1328
|
+
id: {
|
|
1329
|
+
type: StringConstructor;
|
|
1330
|
+
required: true;
|
|
1331
|
+
default: string;
|
|
1332
|
+
};
|
|
1333
|
+
disabled: {
|
|
1334
|
+
type: BooleanConstructor;
|
|
1335
|
+
default: boolean;
|
|
1336
|
+
};
|
|
1337
|
+
modelValue: {
|
|
1338
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
1339
|
+
default: number;
|
|
1340
|
+
};
|
|
1341
|
+
}>, {
|
|
1342
|
+
mdiChevronDown: string;
|
|
1343
|
+
onChange: (event: any) => void;
|
|
1344
|
+
classes: any[];
|
|
1345
|
+
styles: any[];
|
|
1346
|
+
inputAttrs: any;
|
|
1347
|
+
inputListeners: any;
|
|
1348
|
+
inputValue: import('vue').Ref<string | number, string | number>;
|
|
1349
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, string[], string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1350
|
+
id: {
|
|
1351
|
+
type: StringConstructor;
|
|
1352
|
+
required: true;
|
|
1353
|
+
default: string;
|
|
1354
|
+
};
|
|
1355
|
+
disabled: {
|
|
1356
|
+
type: BooleanConstructor;
|
|
1357
|
+
default: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
modelValue: {
|
|
1360
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
1361
|
+
default: number;
|
|
1362
|
+
};
|
|
1363
|
+
}>> & Readonly<{
|
|
1364
|
+
[x: `on${Capitalize<string>}`]: (...args: any[]) => any;
|
|
1365
|
+
}>, {
|
|
1366
|
+
id: string;
|
|
1367
|
+
disabled: boolean;
|
|
1368
|
+
modelValue: string | number;
|
|
1369
|
+
}, {}, {
|
|
1370
|
+
KvMaterialIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1371
|
+
icon: {
|
|
1372
|
+
type: StringConstructor;
|
|
1373
|
+
default: string;
|
|
1374
|
+
};
|
|
1375
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1376
|
+
icon: {
|
|
1377
|
+
type: StringConstructor;
|
|
1378
|
+
default: string;
|
|
1379
|
+
};
|
|
1380
|
+
}>> & Readonly<{}>, {
|
|
1381
|
+
icon: string;
|
|
1382
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1383
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1298
1384
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1299
1385
|
export default _default;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { computed as
|
|
4
|
-
import { mdiMapMarker as
|
|
5
|
-
import { LOAN_CALLOUTS_FRAGMENT as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
1
|
+
import C from "graphql-tag";
|
|
2
|
+
import W from "numeral";
|
|
3
|
+
import { ref as $, computed as o, watch as H } from "vue";
|
|
4
|
+
import { mdiMapMarker as j, mdiHome as q, mdiLink as z, mdiCached as J } from "@mdi/js";
|
|
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
|
+
import { getDropdownPriceArray as te, getLendCtaSelectedOption as ae, isLessThan25 as oe } from "../utils/loanUtils.js";
|
|
7
|
+
import { computePostGoalLoanCardStatement as ne } from "../utils/postGoalStatement.js";
|
|
8
|
+
import re from "./KvLoanUse.js";
|
|
9
|
+
import le from "./KvBorrowerImage.js";
|
|
10
|
+
import ie from "./KvLoanCallouts.js";
|
|
11
|
+
import ue from "./KvLendCta.js";
|
|
12
|
+
import se from "./KvLoanProgressGroup.js";
|
|
13
|
+
import de from "./KvLoanTag.js";
|
|
14
|
+
import me from "./KvMaterialIcon.js";
|
|
15
|
+
import fe from "./KvLoadingPlaceholder.js";
|
|
16
|
+
import ce from "./KvLoanTeamPick.js";
|
|
17
|
+
import ve from "./KvSelect.js";
|
|
18
|
+
import { KV_LEND_CTA_FRAGMENT as Le, KV_LEND_CTA_USER_FRAGMENT as he } from "./KvLendCta2.js";
|
|
19
|
+
import { KV_LOAN_TAG_FRAGMENT as ye } from "./KvLoanTag2.js";
|
|
20
|
+
import { KV_LOAN_USE_FRAGMENT as ge } from "./KvLoanUse2.js";
|
|
21
|
+
const d = {
|
|
22
|
+
default: "default",
|
|
23
|
+
postGoal: "post-goal"
|
|
24
|
+
}, Ae = (e) => e < 500 && e >= 25, Ce = (e) => oe(e) || Ae(e), $e = C`
|
|
19
25
|
fragment KvCompactLoanCard on LoanBasic {
|
|
20
26
|
id
|
|
21
27
|
image {
|
|
@@ -37,32 +43,38 @@ const ge = r`
|
|
|
37
43
|
...LoanGeocode
|
|
38
44
|
...LoanProgress
|
|
39
45
|
}
|
|
40
|
-
${
|
|
46
|
+
${Le}
|
|
47
|
+
${ye}
|
|
48
|
+
${ge}
|
|
49
|
+
${Q}
|
|
41
50
|
${X}
|
|
42
51
|
${Y}
|
|
43
|
-
|
|
44
|
-
${G}
|
|
45
|
-
${P}
|
|
46
|
-
`, Ce = r`
|
|
52
|
+
`, He = C`
|
|
47
53
|
fragment KvCompactLoanCardUser on LoanBasic {
|
|
48
54
|
id
|
|
49
55
|
...KvLendCtaUser
|
|
50
56
|
}
|
|
51
|
-
${
|
|
52
|
-
`,
|
|
57
|
+
${he}
|
|
58
|
+
`, je = {
|
|
53
59
|
name: "KvCompactLoanCard",
|
|
54
60
|
components: {
|
|
55
|
-
KvBorrowerImage:
|
|
56
|
-
KvLoadingPlaceholder:
|
|
57
|
-
KvLoanUse:
|
|
58
|
-
KvMaterialIcon:
|
|
59
|
-
KvLendCta:
|
|
60
|
-
KvLoanTag:
|
|
61
|
-
KvLoanCallouts:
|
|
62
|
-
KvLoanTeamPick:
|
|
63
|
-
KvLoanProgressGroup:
|
|
61
|
+
KvBorrowerImage: le,
|
|
62
|
+
KvLoadingPlaceholder: fe,
|
|
63
|
+
KvLoanUse: re,
|
|
64
|
+
KvMaterialIcon: me,
|
|
65
|
+
KvLendCta: ue,
|
|
66
|
+
KvLoanTag: de,
|
|
67
|
+
KvLoanCallouts: ie,
|
|
68
|
+
KvLoanTeamPick: ce,
|
|
69
|
+
KvLoanProgressGroup: se,
|
|
70
|
+
KvSelect: ve
|
|
64
71
|
},
|
|
65
72
|
props: {
|
|
73
|
+
variant: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: d.default,
|
|
76
|
+
validator: (e) => Object.values(d).includes(e)
|
|
77
|
+
},
|
|
66
78
|
loanId: {
|
|
67
79
|
type: Number,
|
|
68
80
|
default: void 0
|
|
@@ -200,92 +212,166 @@ const ge = r`
|
|
|
200
212
|
"refresh-button",
|
|
201
213
|
"jump-filter-page",
|
|
202
214
|
"add-to-basket",
|
|
203
|
-
"remove-from-basket"
|
|
215
|
+
"remove-from-basket",
|
|
216
|
+
"show-loan-details",
|
|
217
|
+
"update:selected-amount"
|
|
204
218
|
],
|
|
205
|
-
setup(e, { emit:
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} =
|
|
219
|
+
setup(e, { emit: n }) {
|
|
220
|
+
const r = $(""), u = o(
|
|
221
|
+
() => e.variant === d.postGoal
|
|
222
|
+
), {
|
|
223
|
+
allDataLoaded: p,
|
|
224
|
+
borrowerName: m,
|
|
225
|
+
city: b,
|
|
226
|
+
countryName: S,
|
|
227
|
+
distributionModel: f,
|
|
228
|
+
formattedLocation: c,
|
|
229
|
+
fundraisingPercent: w,
|
|
230
|
+
hasProgressData: N,
|
|
231
|
+
imageHash: _,
|
|
232
|
+
isLoading: B,
|
|
233
|
+
loanAmount: v,
|
|
234
|
+
loanBorrowerCount: L,
|
|
235
|
+
loanCallouts: T,
|
|
236
|
+
loanStatus: h,
|
|
237
|
+
loanUse: y,
|
|
238
|
+
readMorePath: k,
|
|
239
|
+
state: F,
|
|
240
|
+
tag: K,
|
|
241
|
+
unreservedAmount: s,
|
|
242
|
+
sharesAvailable: R
|
|
243
|
+
} = Z(e), { clickReadMore: P } = ee(e, n), M = o(() => u.value ? void 0 : { width: "100px", height: "100px" }), E = o(() => {
|
|
230
244
|
if (!e.website)
|
|
231
245
|
return "";
|
|
232
|
-
const
|
|
233
|
-
return
|
|
234
|
-
}),
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
246
|
+
const t = e.website.trim();
|
|
247
|
+
return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
|
|
248
|
+
}), G = o(() => {
|
|
249
|
+
if (u.value) return {};
|
|
250
|
+
const t = e.showLightView ? "auto" : "6.75rem", a = e.showLightView ? "none" : "6.75rem";
|
|
251
|
+
return { height: t, maxHeight: a };
|
|
252
|
+
}), l = o(() => {
|
|
253
|
+
var t, a;
|
|
254
|
+
return ne({
|
|
255
|
+
anonymizationLevel: (t = e.loan) == null ? void 0 : t.anonymizationLevel,
|
|
256
|
+
borrowerName: m.value,
|
|
257
|
+
distributionModel: f.value,
|
|
258
|
+
formattedLocation: c.value,
|
|
259
|
+
loanAmount: v.value,
|
|
260
|
+
loanBorrowerCount: L.value,
|
|
261
|
+
loanStatus: h.value,
|
|
262
|
+
loanUse: y.value,
|
|
263
|
+
whySpecial: (a = e.loan) == null ? void 0 : a.whySpecial
|
|
264
|
+
});
|
|
265
|
+
}), O = o(() => l.value.borrowerNameWithCountry), U = o(() => l.value.loanUsePrefixStart), D = o(() => l.value.loanUsePrefixEnd), V = o(() => l.value.statementTitle), x = o(() => l.value.visibleUseStatement), g = o(() => {
|
|
266
|
+
var i;
|
|
267
|
+
const t = parseFloat(s.value);
|
|
268
|
+
if (!t) return [];
|
|
269
|
+
const a = t < 25 ? parseFloat(`${((i = e.loan) == null ? void 0 : i.minNoteSize) ?? 25}`) : 25;
|
|
270
|
+
return te(
|
|
271
|
+
s.value,
|
|
272
|
+
Ce(t),
|
|
273
|
+
a,
|
|
274
|
+
e.enableFiveDollarsNotes,
|
|
275
|
+
e.isVisitor
|
|
276
|
+
);
|
|
277
|
+
});
|
|
278
|
+
H(
|
|
279
|
+
g,
|
|
280
|
+
(t) => {
|
|
281
|
+
var i, A;
|
|
282
|
+
if (!u.value) return;
|
|
283
|
+
if (!t.length) {
|
|
284
|
+
r.value = "";
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
const a = ae(
|
|
288
|
+
e.getCookie,
|
|
289
|
+
e.setCookie,
|
|
290
|
+
e.enableFiveDollarsNotes,
|
|
291
|
+
(A = (i = e.route) == null ? void 0 : i.query) == null ? void 0 : A.utm_campaign,
|
|
292
|
+
s.value,
|
|
293
|
+
e.userBalance ? parseFloat(e.userBalance) : void 0,
|
|
294
|
+
e.fiveDollarsSelected
|
|
295
|
+
);
|
|
296
|
+
r.value = t.includes(a) ? a : t[0];
|
|
297
|
+
},
|
|
298
|
+
{ immediate: !0 }
|
|
299
|
+
);
|
|
300
|
+
const I = o(() => e.showLightView ? 3 : 4);
|
|
238
301
|
return {
|
|
239
|
-
allDataLoaded:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
302
|
+
allDataLoaded: p,
|
|
303
|
+
amountOptions: g,
|
|
304
|
+
borrowerImageStyle: M,
|
|
305
|
+
borrowerName: m,
|
|
306
|
+
borrowerNameWithCountry: O,
|
|
307
|
+
city: b,
|
|
308
|
+
countryName: S,
|
|
309
|
+
distributionModel: f,
|
|
310
|
+
formattedLocation: c,
|
|
311
|
+
formattedWebsite: E,
|
|
312
|
+
fundraisingPercent: w,
|
|
313
|
+
hasProgressData: N,
|
|
314
|
+
imageHash: _,
|
|
315
|
+
isLoading: B,
|
|
316
|
+
isPostGoalVariant: u,
|
|
317
|
+
loanAmount: v,
|
|
318
|
+
loanBorrowerCount: L,
|
|
319
|
+
loanCallouts: T,
|
|
320
|
+
loanStatus: h,
|
|
321
|
+
loanUse: y,
|
|
322
|
+
loanUsePrefixEnd: D,
|
|
323
|
+
loanUsePrefixStart: U,
|
|
324
|
+
mdiMapMarker: j,
|
|
325
|
+
mdiHome: q,
|
|
326
|
+
mdiLink: z,
|
|
327
|
+
mdiCached: J,
|
|
328
|
+
readMorePath: k,
|
|
329
|
+
state: F,
|
|
330
|
+
tag: K,
|
|
331
|
+
unreservedAmount: s,
|
|
332
|
+
sharesAvailable: R,
|
|
333
|
+
selectedAmount: r,
|
|
334
|
+
statementTitle: V,
|
|
335
|
+
customStyle: G,
|
|
336
|
+
loanUseLoadingRows: I,
|
|
337
|
+
visibleUseStatement: x,
|
|
338
|
+
clickReadMore: P,
|
|
267
339
|
trackWebsiteClick: () => {
|
|
268
|
-
e.kvTrackFunction(
|
|
340
|
+
e.kvTrackFunction(
|
|
341
|
+
"Lending",
|
|
342
|
+
"click-Business Website",
|
|
343
|
+
"Website",
|
|
344
|
+
e.loanId
|
|
345
|
+
);
|
|
269
346
|
},
|
|
270
|
-
handleRefreshButton: (
|
|
271
|
-
|
|
347
|
+
handleRefreshButton: (t) => {
|
|
348
|
+
n("refresh-button", t);
|
|
349
|
+
},
|
|
350
|
+
handleSelectedAmount: (t) => {
|
|
351
|
+
var a;
|
|
352
|
+
r.value = t, n("update:selected-amount", t), e.kvTrackFunction(
|
|
353
|
+
"Lending",
|
|
354
|
+
"Modify lend amount",
|
|
355
|
+
t,
|
|
356
|
+
e.loanId ?? ((a = e.loan) == null ? void 0 : a.id)
|
|
357
|
+
);
|
|
272
358
|
}
|
|
273
359
|
};
|
|
274
360
|
},
|
|
275
361
|
computed: {
|
|
276
362
|
lendersNumber() {
|
|
277
|
-
var e,
|
|
278
|
-
return ((
|
|
363
|
+
var e, n;
|
|
364
|
+
return ((n = (e = this.loan) == null ? void 0 : e.lenders) == null ? void 0 : n.totalCount) ?? 0;
|
|
279
365
|
},
|
|
280
366
|
amountLent() {
|
|
281
|
-
var
|
|
282
|
-
const e = ((
|
|
283
|
-
return
|
|
367
|
+
var n, r;
|
|
368
|
+
const e = ((r = (n = this.loan) == null ? void 0 : n.loanFundraisingInfo) == null ? void 0 : r.fundedAmount) ?? 0;
|
|
369
|
+
return W(e).format("$0,0");
|
|
284
370
|
}
|
|
285
371
|
}
|
|
286
372
|
};
|
|
287
373
|
export {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
374
|
+
$e as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
375
|
+
He as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
376
|
+
je as default
|
|
291
377
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"embla-carousel-fade",
|
|
126
126
|
"popper.js"
|
|
127
127
|
],
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "6d0e8c2b071887742cecc20e460e29d55f181360"
|
|
129
129
|
}
|