@kiva/kv-components 8.12.1 → 8.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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-b1272f83]:hover,.loan-card-use[data-v-b1272f83]: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-b1272f83]{text-decoration-line:underline}.loan-card-progress[data-v-b1272f83]:hover,.loan-card-progress[data-v-b1272f83]:focus{text-decoration-line:none}.loan-card-use-text[data-v-b1272f83] 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-b1272f83] form,.loan-card-cta[data-v-b1272f83] fieldset,.loan-card-cta[data-v-b1272f83] .tw-w-full,.loan-card-cta[data-v-b1272f83] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-b1272f83] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}
1
+ .loan-card-use[data-v-02c91111]:hover,.loan-card-use[data-v-02c91111]: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-02c91111]{text-decoration-line:underline}.loan-card-progress[data-v-02c91111]:hover,.loan-card-progress[data-v-02c91111]:focus{text-decoration-line:none}.loan-card-use-text[data-v-02c91111] 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-02c91111] form,.loan-card-cta[data-v-02c91111] fieldset,.loan-card-cta[data-v-02c91111] .tw-w-full,.loan-card-cta[data-v-02c91111] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-02c91111] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}[data-v-02c91111] .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-02c91111] .goal-variant-callouts span{font-weight:500}.goal-variant-progress-group[data-v-02c91111] div[role=progressbar]{background-color:#d9d9d9}
@@ -1,130 +1,177 @@
1
- import N from "./KvCompactLoanCard2.js";
2
- import { KV_COMPACT_LOAN_CARD_FRAGMENT as p, KV_COMPACT_LOAN_CARD_USER_FRAGMENT as $ } from "./KvCompactLoanCard2.js";
3
- import { resolveComponent as w, openBlock as a, createElementBlock as l, normalizeClass as c, createVNode as i, createCommentVNode as d, createElementVNode as r, normalizeStyle as T, createBlock as s, resolveDynamicComponent as u, withCtx as f, toDisplayString as k, withModifiers as P, Fragment as g, renderList as A } from "vue";
1
+ import B from "./KvCompactLoanCard2.js";
2
+ import { KV_COMPACT_LOAN_CARD_FRAGMENT as oe, KV_COMPACT_LOAN_CARD_USER_FRAGMENT as le } from "./KvCompactLoanCard2.js";
3
+ import { resolveComponent as w, openBlock as n, createElementBlock as l, normalizeClass as s, createVNode as i, createCommentVNode as m, createElementVNode as r, normalizeStyle as b, createBlock as d, resolveDynamicComponent as k, withCtx as f, toDisplayString as c, withModifiers as R, Fragment as u, renderList as v } from "vue";
4
4
  import "./KvCompactLoanCard.css";
5
- import R from "../_virtual/_plugin-vue_export-helper.js";
6
- const B = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, V = { class: "tw-flex-shrink-0 tw-overflow-hidden" }, D = { class: "tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0" }, S = {
5
+ import G from "../_virtual/_plugin-vue_export-helper.js";
6
+ const S = ["aria-busy"], D = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, U = {
7
+ key: 1,
8
+ class: "tw-flex-shrink-0 tw-overflow-hidden"
9
+ }, W = {
7
10
  key: 0,
8
11
  class: "tw-mb-0.5 tw-w-full"
9
- }, F = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, W = ["href"], j = { class: "tw-truncate" }, E = {
12
+ }, E = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, F = ["href"], I = { class: "tw-truncate" }, O = ["title"], j = { class: "tw-font-medium" }, K = {
10
13
  key: 0,
11
14
  class: "loan-card-use-text tw-w-full tw-overflow-hidden"
12
- }, U = { class: "tw-flex-1 tw-min-w-0 tw-mr-1" }, O = { class: "tw-flex-1 tw-min-w-0" }, K = { class: "tw-p-1 tw-rounded-l-sm tw-border tw-border-gray-100 tw-border-r-0" };
13
- function z(h, o, t, e, G, H) {
14
- const b = w("kv-material-icon"), v = w("kv-borrower-image"), x = w("kv-loan-tag"), m = w("kv-loading-placeholder"), _ = w("kv-loan-use"), y = w("kv-loan-callouts"), L = w("kv-loan-progress-group"), C = w("kv-lend-cta");
15
- return a(), l("div", {
16
- class: c(["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", { "tw-relative": t.showRefreshButton, "!tw-p-1.5": t.showLightView }])
15
+ }, z = { class: "tw-flex-1 tw-min-w-0 tw-mr-1" }, H = {
16
+ class: "tw-flex-1 tw-min-w-0",
17
+ style: { "max-width": "6.5rem" }
18
+ }, 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(g, o, t, e, X, L) {
20
+ var x;
21
+ const y = w("kv-material-icon"), h = w("kv-loading-placeholder"), P = w("kv-borrower-image"), C = w("kv-loan-tag"), V = w("kv-loan-use"), N = w("kv-loan-callouts"), _ = w("kv-loan-progress-group"), A = w("kv-select"), M = w("kv-lend-cta");
22
+ return n(), 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 ? (a(), l("button", {
29
+ t.showRefreshButton ? (n(), 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: o[0] || (o[0] = (...n) => e.handleRefreshButton && e.handleRefreshButton(...n))
32
+ onClick: o[0] || (o[0] = (...a) => e.handleRefreshButton && e.handleRefreshButton(...a))
22
33
  }, [
23
- i(b, {
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
- ])) : d("", !0),
28
- r("div", B, [
38
+ ])) : m("", !0),
39
+ r("div", D, [
29
40
  r("div", {
30
- class: c(["tw-flex tw-items-start tw-gap-2 tw-w-full loan-card-active-hover", { "!tw-gap-1": t.showLightView }]),
31
- style: T(e.customStyle)
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
- r("div", V, [
34
- (a(), s(u(e.tag), {
47
+ e.isLoading ? (n(), 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"])) : (n(), l("div", U, [
56
+ (n(), d(k(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: o[1] || (o[1] = (n) => e.clickReadMore("Photo", n))
63
+ onClick: o[1] || (o[1] = (a) => e.clickReadMore("Photo", a))
42
64
  }, {
43
65
  default: f(() => [
44
- i(v, {
45
- class: c(["tw-bg-gray-300 tw-rounded-sm tw-object-cover tw-bg-clip-content", { "!tw-w-7.5 !tw-h-7.5": t.showLightView }]),
46
- style: { width: "100px", height: "100px" },
66
+ i(P, {
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", D, [
59
- t.businessName ? (a(), l("div", S, [
60
- (a(), s(u(e.tag), {
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 ? (n(), l("div", W, [
87
+ (n(), d(k(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: o[2] || (o[2] = (n) => e.clickReadMore("Business", n))
94
+ onClick: o[2] || (o[2] = (a) => e.clickReadMore("Business", a))
68
95
  }, {
69
96
  default: f(() => [
70
- r("h3", F, k(t.businessName), 1)
97
+ r("h3", E, c(t.businessName), 1)
71
98
  ]),
72
99
  _: 1
73
100
  }, 8, ["to", "href", "target", "rel"])),
74
- t.website ? (a(), l("a", {
101
+ t.website ? (n(), 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: o[3] || (o[3] = P((...n) => e.trackWebsiteClick && e.trackWebsiteClick(...n), ["stop"]))
106
+ onClick: o[3] || (o[3] = R((...a) => e.trackWebsiteClick && e.trackWebsiteClick(...a), ["stop"]))
80
107
  }, [
81
- i(b, {
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", j, k(t.website), 1)
86
- ], 8, W)) : d("", !0)
87
- ])) : d("", !0),
88
- (a(), s(u(e.tag), {
112
+ r("span", I, c(t.website), 1)
113
+ ], 8, F)) : m("", !0)
114
+ ])) : m("", !0),
115
+ e.isLoading ? m("", !0) : (n(), d(k(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: o[4] || (o[4] = (n) => e.clickReadMore("Tag", n))
123
+ onClick: o[4] || (o[4] = (a) => e.clickReadMore("Tag", a))
96
124
  }, {
97
125
  default: f(() => [
98
- t.showTags && !e.isLoading ? (a(), s(x, {
126
+ t.showTags ? (n(), d(C, {
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"])) : d("", !0)
132
+ }, null, 8, ["class", "loan"])) : m("", !0)
102
133
  ]),
103
134
  _: 1
104
135
  }, 8, ["to", "href", "target", "rel"])),
105
- t.showLoanUse ? (a(), s(u(e.tag), {
106
- key: 1,
136
+ e.isPostGoalVariant ? (n(), l(u, { key: 2 }, [
137
+ e.isLoading ? (n(), 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)) : (n(), 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 ? (n(), d(k(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: o[5] || (o[5] = (n) => e.clickReadMore("Use", n))
160
+ onClick: o[5] || (o[5] = (a) => e.clickReadMore("Use", a))
114
161
  }, {
115
162
  default: f(() => [
116
- e.isLoading ? (a(), l("div", E, [
117
- (a(!0), l(g, null, A([...Array(e.loanUseLoadingRows)], (n, M) => (a(), l("div", {
118
- key: M,
163
+ e.isLoading ? (n(), l("div", K, [
164
+ (n(!0), l(u, null, v([...Array(e.loanUseLoadingRows)], (a, T) => (n(), l("div", {
165
+ key: T,
119
166
  class: "tw-h-2 tw-mb-1"
120
167
  }, [
121
- i(m)
168
+ i(h)
122
169
  ]))), 128))
123
- ])) : (a(), l("div", {
170
+ ])) : (n(), l("div", {
124
171
  key: 1,
125
- class: c(["loan-card-use-text tw-w-full tw-overflow-hidden", { "!tw--mt-1": t.showTags && t.loan.matchingText && t.showLightView }])
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(V, {
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"])) : d("", !0)
144
- ])
190
+ }, 8, ["to", "href", "target", "rel"])) : m("", !0)
191
+ ], 2)
145
192
  ], 6),
146
- e.isLoading || typeof e.loanCallouts > "u" ? (a(), s(m, {
193
+ e.isLoading || typeof e.loanCallouts > "u" ? (n(), 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
- })) : (a(), s(y, {
197
+ })) : (n(), d(N, {
151
198
  key: 1,
152
199
  callouts: e.loanCallouts,
153
- class: "tw-mt-1.5",
154
- onClick: o[6] || (o[6] = (n) => h.$emit("jump-filter-page", n))
155
- }, null, 8, ["callouts"]))
200
+ class: s(["tw-mt-1.5", { "goal-variant-callouts": e.isPostGoalVariant }]),
201
+ onClick: o[6] || (o[6] = (a) => g.$emit("jump-filter-page", a))
202
+ }, null, 8, ["callouts", "class"]))
156
203
  ]),
157
204
  r("div", {
158
- class: c([
159
- "tw-flex tw-items-center tw-justify-between tw-w-full tw-mt-1",
160
- { "tw-gap-1": e.sharesAvailable }
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 ? (a(), l(g, { key: 1 }, [
164
- r("div", O, [
165
- e.sharesAvailable ? (a(), s(u(e.tag), {
210
+ e.hasProgressData ? e.isPostGoalVariant ? (n(), l(u, { key: 1 }, [
211
+ r("div", H, [
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", null, [
219
+ i(A, {
220
+ id: `PostGoalAmountDropdown_${((x = t.loan) == null ? void 0 : x.id) ?? t.loanId}`,
221
+ modelValue: e.selectedAmount,
222
+ "onUpdate:modelValue": [
223
+ o[7] || (o[7] = (a) => e.selectedAmount = a),
224
+ e.handleSelectedAmount
225
+ ],
226
+ "aria-label": "Lend amount",
227
+ disabled: !e.amountOptions.length || L.isInBasket,
228
+ class: "amount-dropdown"
229
+ }, {
230
+ default: f(() => [
231
+ (n(!0), l(u, null, v(e.amountOptions, (a) => (n(), 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)) : (n(), l(u, { key: 2 }, [
240
+ r("div", q, [
241
+ e.sharesAvailable ? (n(), d(k(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: o[7] || (o[7] = (n) => e.clickReadMore("Progress", n))
249
+ onClick: o[8] || (o[8] = (a) => e.clickReadMore("Progress", a))
174
250
  }, {
175
251
  default: f(() => [
176
- i(L, {
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"])) : d("", !0)
260
+ }, 8, ["to", "href", "target", "rel"])) : m("", !0)
185
261
  ]),
186
- t.showLightView ? (a(), l("button", {
262
+ t.showLightView ? (n(), l("button", {
187
263
  key: 0,
188
264
  class: "tw-ml-2",
189
- onClick: o[8] || (o[8] = (n) => e.clickReadMore("View", n))
265
+ onClick: o[9] || (o[9] = (a) => e.clickReadMore("View", a))
190
266
  }, [
191
- r("span", K, " $" + k(t.customAmountLent), 1),
192
- o[12] || (o[12] = 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))
193
- ])) : (a(), l("div", {
267
+ r("span", J, " $" + c(t.customAmountLent), 1),
268
+ o[13] || (o[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
+ ])) : (n(), l("div", {
194
270
  key: 1,
195
- class: c(["tw-flex-shrink-0 loan-card-cta", { "tw-w-full": !e.sharesAvailable }]),
271
+ class: s(["tw-flex-shrink-0 loan-card-cta", { "tw-w-full": !e.sharesAvailable }]),
196
272
  style: { height: "40px" }
197
273
  }, [
198
- i(C, {
274
+ i(M, {
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: o[9] || (o[9] = (n) => h.$emit("add-to-basket", n)),
219
- onShowLoanDetails: o[10] || (o[10] = (n) => e.clickReadMore("ViewLoan", n)),
220
- onRemoveFromBasket: o[11] || (o[11] = (n) => h.$emit("remove-from-basket", n))
294
+ onAddToBasket: o[10] || (o[10] = (a) => g.$emit("add-to-basket", a)),
295
+ onShowLoanDetails: o[11] || (o[11] = (a) => e.clickReadMore("ViewLoan", a)),
296
+ onRemoveFromBasket: o[12] || (o[12] = (a) => g.$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)) : (a(), l(g, { key: 0 }, [
224
- r("div", U, [
225
- i(m, {
299
+ ], 64)) : (n(), l(u, { key: 0 }, [
300
+ r("div", z, [
301
+ i(h, {
226
302
  class: "tw-mb-0.5",
227
303
  style: { width: "100%", maxWidth: "11rem", height: "1rem" }
228
304
  }),
229
- i(m, {
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 ? d("", !0) : (a(), s(m, {
310
+ e.allDataLoaded ? m("", !0) : (n(), 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
- ], 2);
317
+ ], 10, S);
242
318
  }
243
- const Q = /* @__PURE__ */ R(N, [["render", z], ["__scopeId", "data-v-b1272f83"]]);
319
+ const te = /* @__PURE__ */ G(B, [["render", Q], ["__scopeId", "data-v-02c91111"]]);
244
320
  export {
245
- p as KV_COMPACT_LOAN_CARD_FRAGMENT,
246
- $ as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
247
- Q as default
321
+ oe as KV_COMPACT_LOAN_CARD_FRAGMENT,
322
+ le as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
323
+ te 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,31 @@ 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
+ isInBasket(): any;
197
+ }, {}, 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<{
198
+ variant: {
199
+ type: StringConstructor;
200
+ default: "default";
201
+ validator: (value: string) => boolean;
202
+ };
176
203
  loanId: {
177
204
  type: NumberConstructor;
178
205
  default: any;
@@ -307,10 +334,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
307
334
  };
308
335
  }>> & Readonly<{
309
336
  "onAdd-to-basket"?: (...args: any[]) => any;
337
+ "onShow-loan-details"?: (...args: any[]) => any;
310
338
  "onRemove-from-basket"?: (...args: any[]) => any;
311
339
  "onJump-filter-page"?: (...args: any[]) => any;
312
340
  "onRefresh-button"?: (...args: any[]) => any;
341
+ "onUpdate:selected-amount"?: (...args: any[]) => any;
313
342
  }>, {
343
+ variant: string;
314
344
  loan: Record<string, any>;
315
345
  externalLinks: boolean;
316
346
  customLoanDetails: boolean;
@@ -1295,5 +1325,62 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1295
1325
  bgVariant: string;
1296
1326
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1297
1327
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1328
+ KvSelect: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
1329
+ id: {
1330
+ type: StringConstructor;
1331
+ required: true;
1332
+ default: string;
1333
+ };
1334
+ disabled: {
1335
+ type: BooleanConstructor;
1336
+ default: boolean;
1337
+ };
1338
+ modelValue: {
1339
+ type: (StringConstructor | NumberConstructor)[];
1340
+ default: number;
1341
+ };
1342
+ }>, {
1343
+ mdiChevronDown: string;
1344
+ onChange: (event: any) => void;
1345
+ classes: any[];
1346
+ styles: any[];
1347
+ inputAttrs: any;
1348
+ inputListeners: any;
1349
+ inputValue: import('vue').Ref<string | number, string | number>;
1350
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, string[], string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
1351
+ id: {
1352
+ type: StringConstructor;
1353
+ required: true;
1354
+ default: string;
1355
+ };
1356
+ disabled: {
1357
+ type: BooleanConstructor;
1358
+ default: boolean;
1359
+ };
1360
+ modelValue: {
1361
+ type: (StringConstructor | NumberConstructor)[];
1362
+ default: number;
1363
+ };
1364
+ }>> & Readonly<{
1365
+ [x: `on${Capitalize<string>}`]: (...args: any[]) => any;
1366
+ }>, {
1367
+ id: string;
1368
+ disabled: boolean;
1369
+ modelValue: string | number;
1370
+ }, {}, {
1371
+ KvMaterialIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
1372
+ icon: {
1373
+ type: StringConstructor;
1374
+ default: string;
1375
+ };
1376
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
1377
+ icon: {
1378
+ type: StringConstructor;
1379
+ default: string;
1380
+ };
1381
+ }>> & Readonly<{}>, {
1382
+ icon: string;
1383
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1384
+ }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1298
1385
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1299
1386
  export default _default;
@@ -1,21 +1,27 @@
1
- import r from "graphql-tag";
2
- import R from "numeral";
3
- import { computed as n } from "vue";
4
- import { mdiMapMarker as F, mdiHome as M, mdiLink as S, mdiCached as E } from "@mdi/js";
5
- import { LOAN_CALLOUTS_FRAGMENT as O, LOAN_GEOCODE_FRAGMENT as G, LOAN_PROGRESS_FRAGMENT as P, loanCardComputedProperties as V, loanCardMethods as U } from "../utils/loanCard.js";
6
- import D from "./KvLoanUse.js";
7
- import $ from "./KvBorrowerImage.js";
8
- import W from "./KvLoanCallouts.js";
9
- import I from "./KvLendCta.js";
10
- import x from "./KvLoanProgressGroup.js";
11
- import H from "./KvLoanTag.js";
12
- import j from "./KvMaterialIcon.js";
13
- import q from "./KvLoadingPlaceholder.js";
14
- import z from "./KvLoanTeamPick.js";
15
- import { KV_LEND_CTA_FRAGMENT as J, KV_LEND_CTA_USER_FRAGMENT as Q } from "./KvLendCta2.js";
16
- import { KV_LOAN_TAG_FRAGMENT as X } from "./KvLoanTag2.js";
17
- import { KV_LOAN_USE_FRAGMENT as Y } from "./KvLoanUse2.js";
18
- const ge = r`
1
+ import p from "graphql-tag";
2
+ import W from "numeral";
3
+ import { ref as $, computed as n, 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 se from "./KvLendCta.js";
12
+ import ue 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, pe = (e) => oe(e) || Ae(e), $e = p`
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
- ${J}
46
+ ${Le}
47
+ ${ye}
48
+ ${ge}
49
+ ${Q}
41
50
  ${X}
42
51
  ${Y}
43
- ${O}
44
- ${G}
45
- ${P}
46
- `, Ce = r`
52
+ `, He = p`
47
53
  fragment KvCompactLoanCardUser on LoanBasic {
48
54
  id
49
55
  ...KvLendCtaUser
50
56
  }
51
- ${Q}
52
- `, Ae = {
57
+ ${he}
58
+ `, je = {
53
59
  name: "KvCompactLoanCard",
54
60
  components: {
55
- KvBorrowerImage: $,
56
- KvLoadingPlaceholder: q,
57
- KvLoanUse: D,
58
- KvMaterialIcon: j,
59
- KvLendCta: I,
60
- KvLoanTag: H,
61
- KvLoanCallouts: W,
62
- KvLoanTeamPick: z,
63
- KvLoanProgressGroup: x
61
+ KvBorrowerImage: le,
62
+ KvLoadingPlaceholder: fe,
63
+ KvLoanUse: re,
64
+ KvMaterialIcon: me,
65
+ KvLendCta: se,
66
+ KvLoanTag: de,
67
+ KvLoanCallouts: ie,
68
+ KvLoanTeamPick: ce,
69
+ KvLoanProgressGroup: ue,
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,170 @@ 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: t }) {
206
- const {
207
- allDataLoaded: a,
208
- borrowerName: i,
209
- city: s,
210
- countryName: l,
211
- distributionModel: u,
212
- formattedLocation: d,
213
- fundraisingPercent: m,
214
- hasProgressData: f,
215
- imageHash: c,
216
- isLoading: p,
217
- loanAmount: L,
218
- loanBorrowerCount: h,
219
- loanCallouts: y,
220
- loanStatus: g,
221
- loanUse: C,
222
- readMorePath: A,
223
- state: _,
224
- tag: N,
225
- unreservedAmount: b,
226
- sharesAvailable: B
227
- } = V(e), {
228
- clickReadMore: T
229
- } = U(e, t), v = n(() => {
219
+ setup(e, { emit: a }) {
220
+ const r = $(""), s = n(
221
+ () => e.variant === d.postGoal
222
+ ), {
223
+ allDataLoaded: C,
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: u,
242
+ sharesAvailable: R
243
+ } = Z(e), { clickReadMore: P } = ee(e, a), M = n(() => s.value ? void 0 : { width: "100px", height: "100px" }), E = n(() => {
230
244
  if (!e.website)
231
245
  return "";
232
- const o = e.website.trim();
233
- return o.startsWith("http://") || o.startsWith("https://") ? o : `https://${o}`;
234
- }), w = n(() => {
235
- const o = e.showLightView ? "auto" : "6.75rem", K = e.showLightView ? "none" : "6.75rem";
236
- return { height: o, maxHeight: K };
237
- }), k = n(() => e.showLightView ? 3 : 4);
246
+ const t = e.website.trim();
247
+ return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
248
+ }), G = n(() => {
249
+ if (s.value) return {};
250
+ const t = e.showLightView ? "auto" : "6.75rem", o = e.showLightView ? "none" : "6.75rem";
251
+ return { height: t, maxHeight: o };
252
+ }), l = n(() => {
253
+ var t, o;
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: (o = e.loan) == null ? void 0 : o.whySpecial
264
+ });
265
+ }), O = n(() => l.value.borrowerNameWithCountry), U = n(() => l.value.loanUsePrefixStart), D = n(() => l.value.loanUsePrefixEnd), V = n(() => l.value.statementTitle), I = n(() => l.value.visibleUseStatement), g = n(() => {
266
+ var i;
267
+ const t = parseFloat(u.value);
268
+ if (!t) return [];
269
+ const o = t < 25 ? parseFloat(`${((i = e.loan) == null ? void 0 : i.minNoteSize) ?? 25}`) : 25;
270
+ return te(
271
+ u.value,
272
+ pe(t),
273
+ o,
274
+ e.enableFiveDollarsNotes,
275
+ e.isVisitor
276
+ );
277
+ });
278
+ H(
279
+ g,
280
+ (t) => {
281
+ var i, A;
282
+ if (!s.value) return;
283
+ if (!t.length) {
284
+ r.value = "";
285
+ return;
286
+ }
287
+ const o = 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
+ u.value,
293
+ e.userBalance ? parseFloat(e.userBalance) : void 0,
294
+ e.fiveDollarsSelected
295
+ );
296
+ r.value = t.includes(o) ? o : t[0];
297
+ },
298
+ { immediate: !0 }
299
+ );
300
+ const x = n(() => e.showLightView ? 3 : 4);
238
301
  return {
239
- allDataLoaded: a,
240
- borrowerName: i,
241
- city: s,
242
- countryName: l,
243
- distributionModel: u,
244
- formattedLocation: d,
245
- formattedWebsite: v,
246
- fundraisingPercent: m,
247
- hasProgressData: f,
248
- imageHash: c,
249
- isLoading: p,
250
- loanAmount: L,
251
- loanBorrowerCount: h,
252
- loanCallouts: y,
253
- loanStatus: g,
254
- loanUse: C,
255
- mdiMapMarker: F,
256
- mdiHome: M,
257
- mdiLink: S,
258
- mdiCached: E,
259
- readMorePath: A,
260
- state: _,
261
- tag: N,
262
- unreservedAmount: b,
263
- sharesAvailable: B,
264
- customStyle: w,
265
- loanUseLoadingRows: k,
266
- clickReadMore: T,
302
+ allDataLoaded: C,
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: s,
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: u,
332
+ sharesAvailable: R,
333
+ selectedAmount: r,
334
+ statementTitle: V,
335
+ customStyle: G,
336
+ loanUseLoadingRows: x,
337
+ visibleUseStatement: I,
338
+ clickReadMore: P,
267
339
  trackWebsiteClick: () => {
268
- e.kvTrackFunction("Lending", "click-Business Website", "Website", e.loanId);
340
+ e.kvTrackFunction(
341
+ "Lending",
342
+ "click-Business Website",
343
+ "Website",
344
+ e.loanId
345
+ );
346
+ },
347
+ handleRefreshButton: (t) => {
348
+ a("refresh-button", t);
269
349
  },
270
- handleRefreshButton: (o) => {
271
- t("refresh-button", o);
350
+ handleSelectedAmount: (t) => {
351
+ var o;
352
+ r.value = t, a("update:selected-amount", t), e.kvTrackFunction(
353
+ "Lending",
354
+ "Modify lend amount",
355
+ t,
356
+ e.loanId ?? ((o = e.loan) == null ? void 0 : o.id)
357
+ );
272
358
  }
273
359
  };
274
360
  },
275
361
  computed: {
276
362
  lendersNumber() {
277
- var e, t;
278
- return ((t = (e = this.loan) == null ? void 0 : e.lenders) == null ? void 0 : t.totalCount) ?? 0;
363
+ var e, a;
364
+ return ((a = (e = this.loan) == null ? void 0 : e.lenders) == null ? void 0 : a.totalCount) ?? 0;
279
365
  },
280
366
  amountLent() {
281
- var t, a;
282
- const e = ((a = (t = this.loan) == null ? void 0 : t.loanFundraisingInfo) == null ? void 0 : a.fundedAmount) ?? 0;
283
- return R(e).format("$0,0");
367
+ var a, r;
368
+ const e = ((r = (a = this.loan) == null ? void 0 : a.loanFundraisingInfo) == null ? void 0 : r.fundedAmount) ?? 0;
369
+ return W(e).format("$0,0");
370
+ },
371
+ isInBasket() {
372
+ var e;
373
+ return ((e = this.basketItems) == null ? void 0 : e.some((a) => a.__typename === "LoanReservation" && a.id === this.loanId)) ?? !1;
284
374
  }
285
375
  }
286
376
  };
287
377
  export {
288
- ge as KV_COMPACT_LOAN_CARD_FRAGMENT,
289
- Ce as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
290
- Ae as default
378
+ $e as KV_COMPACT_LOAN_CARD_FRAGMENT,
379
+ He as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
380
+ je as default
291
381
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.12.1",
3
+ "version": "8.13.1",
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": "e59ae2dea66fcfd4999501f2a72f483216950354"
128
+ "gitHead": "3e46955f45bfc6410794544fd0a750a5ed3d32f7"
129
129
  }