@kiva/kv-components 8.12.0 → 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.
@@ -1,5 +1,5 @@
1
1
  import n from "@kiva/kv-tokens";
2
- const { colors: e } = n, i = e.gray[100], g = e.gray[300], o = [
2
+ const { colors: e } = n, i = e.gray[200], g = e.gray[300], o = [
3
3
  // Tier 1 — Bold primaries
4
4
  e["eco-green"][3],
5
5
  // #276A43
@@ -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-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 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 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 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 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
- }, F = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, W = ["href"], j = { class: "tw-truncate" }, E = {
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
- }, 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
+ }, 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 ? (a(), l("button", {
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: o[0] || (o[0] = (...n) => e.handleRefreshButton && e.handleRefreshButton(...n))
32
+ onClick: n[0] || (n[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", S, [
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 ? (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: o[1] || (o[1] = (n) => e.clickReadMore("Photo", n))
63
+ onClick: n[1] || (n[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(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", 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 ? (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: o[2] || (o[2] = (n) => e.clickReadMore("Business", n))
94
+ onClick: n[2] || (n[2] = (a) => e.clickReadMore("Business", a))
68
95
  }, {
69
96
  default: f(() => [
70
- r("h3", F, k(t.businessName), 1)
97
+ r("h3", W, 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 ? (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: o[3] || (o[3] = P((...n) => e.trackWebsiteClick && e.trackWebsiteClick(...n), ["stop"]))
106
+ onClick: n[3] || (n[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", 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: o[4] || (o[4] = (n) => e.clickReadMore("Tag", n))
123
+ onClick: n[4] || (n[4] = (a) => e.clickReadMore("Tag", a))
96
124
  }, {
97
125
  default: f(() => [
98
- t.showTags && !e.isLoading ? (a(), s(x, {
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"])) : 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 ? (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: o[5] || (o[5] = (n) => e.clickReadMore("Use", n))
160
+ onClick: n[5] || (n[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", {
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(m)
168
+ i(h)
122
169
  ]))), 128))
123
- ])) : (a(), l("div", {
170
+ ])) : (o(), 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(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"])) : 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" ? (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
- })) : (a(), s(y, {
197
+ })) : (o(), d(V, {
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: n[6] || (n[6] = (a) => k.$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 ? (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: o[7] || (o[7] = (n) => e.clickReadMore("Progress", n))
249
+ onClick: n[8] || (n[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 ? (o(), 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: n[9] || (n[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
+ 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: 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(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: 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: 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)) : (a(), l(g, { key: 0 }, [
224
- r("div", U, [
225
- i(m, {
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(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) : (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
- ], 2);
317
+ ], 10, G);
242
318
  }
243
- const Q = /* @__PURE__ */ R(N, [["render", z], ["__scopeId", "data-v-b1272f83"]]);
319
+ const ae = /* @__PURE__ */ B(T, [["render", Q], ["__scopeId", "data-v-7b59a69b"]]);
244
320
  export {
245
- p as KV_COMPACT_LOAN_CARD_FRAGMENT,
246
- $ as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
247
- Q as default
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 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 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
- ${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 = C`
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: 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: 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: 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 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 = 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: 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: 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("Lending", "click-Business Website", "Website", e.loanId);
340
+ e.kvTrackFunction(
341
+ "Lending",
342
+ "click-Business Website",
343
+ "Website",
344
+ e.loanId
345
+ );
269
346
  },
270
- handleRefreshButton: (o) => {
271
- t("refresh-button", o);
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, t;
278
- return ((t = (e = this.loan) == null ? void 0 : e.lenders) == null ? void 0 : t.totalCount) ?? 0;
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 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 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
- ge as KV_COMPACT_LOAN_CARD_FRAGMENT,
289
- Ce as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
290
- Ae as default
374
+ $e as KV_COMPACT_LOAN_CARD_FRAGMENT,
375
+ He as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
376
+ je as default
291
377
  };
@@ -1 +1 @@
1
- .segment-circle[data-v-3e2d3156]{transition:stroke-dashoffset .5s ease-in-out}.skeleton-ring[data-v-3e2d3156]{transition:opacity .5s ease-in-out}.legend-dot[data-v-3e2d3156]{transition:background-color .5s ease-in-out}
1
+ .segment-circle[data-v-73c9f5f9]{transition:stroke-dashoffset .5s ease-in-out}.skeleton-ring[data-v-73c9f5f9]{opacity:1;transition:opacity .5s ease-in-out}.skeleton-ring--loading[data-v-73c9f5f9]{animation:skeleton-ring-pulse-73c9f5f9 1.4s ease-in-out infinite;transform-origin:center}.legend-dot[data-v-73c9f5f9]{transition:background-color .5s ease-in-out}@keyframes skeleton-ring-pulse-73c9f5f9{0%,to{opacity:.45}50%{opacity:1}}@media (prefers-reduced-motion: reduce){.skeleton-ring--loading[data-v-73c9f5f9]{animation:none}}
@@ -1,5 +1,5 @@
1
1
  import y from "./KvPieChartV22.js";
2
- import { resolveComponent as x, openBlock as l, createElementBlock as o, createElementVNode as r, normalizeClass as k, createCommentVNode as n, Fragment as d, renderList as c, normalizeStyle as a, toDisplayString as w, createBlock as _, withCtx as b } from "vue";
2
+ import { resolveComponent as x, openBlock as l, createElementBlock as o, createElementVNode as r, normalizeClass as k, createCommentVNode as n, Fragment as d, renderList as c, normalizeStyle as s, toDisplayString as w, createBlock as _, withCtx as b } from "vue";
3
3
  import "./KvPieChartV2.css";
4
4
  import u from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const v = {
@@ -14,25 +14,25 @@ const v = {
14
14
  }, S = ["cx", "cy", "r", "stroke", "stroke-width"], L = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "transform"], O = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "transform"], V = {
15
15
  key: 0,
16
16
  class: "tw-flex tw-flex-wrap tw-justify-center tw-gap-0.5 tw-w-full tw-pt-0.5"
17
- }, W = { class: "tw-flex tw-gap-0.5 tw-items-center tw-min-w-0 tw-overflow-hidden" }, p = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, B = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0" }, I = { class: "tw-grid tw-grid-cols-2 tw-grid-flow-row tw-gap-0.5" }, E = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0 tw-overflow-hidden" }, X = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, Y = {
17
+ }, W = { class: "tw-flex tw-gap-0.5 tw-items-center tw-min-w-0 tw-overflow-hidden" }, B = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, p = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0" }, E = { class: "tw-grid tw-grid-cols-2 tw-grid-flow-row tw-gap-0.5" }, I = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0 tw-overflow-hidden" }, X = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, Y = {
18
18
  class: "tw-font-light tw-text-small tw-text-primary tw-text-right tw-shrink-0 tw-tabular-nums",
19
19
  style: { "min-width": "2.8ch" }
20
20
  };
21
- function G(N, s, i, t, M, R) {
21
+ function G(N, i, a, t, M, R) {
22
22
  var h, m;
23
23
  const f = x("kv-lightbox");
24
24
  return l(), o("figure", v, [
25
25
  r("div", C, [
26
26
  (l(), o("svg", D, [
27
- i.loading || !t.hasData ? (l(), o("circle", {
27
+ a.loading || !t.hasData ? (l(), o("circle", {
28
28
  key: 0,
29
29
  cx: t.CX,
30
30
  cy: t.CY,
31
31
  r: t.radius,
32
32
  stroke: t.LOADING_BG_COLOR,
33
- "stroke-width": i.strokeWidth,
33
+ "stroke-width": a.strokeWidth,
34
34
  fill: "none",
35
- class: k(["skeleton-ring tw-opacity-0", { "skeleton-ring--hidden": t.animatedIn }])
35
+ class: k(["skeleton-ring", { "skeleton-ring--loading": a.loading }])
36
36
  }, null, 10, S)) : n("", !0),
37
37
  (l(!0), o(d, null, c(t.visibleSegments, (e) => (l(), o("circle", {
38
38
  key: e.label,
@@ -40,12 +40,12 @@ function G(N, s, i, t, M, R) {
40
40
  cy: t.CY,
41
41
  r: t.radius,
42
42
  stroke: e.color,
43
- "stroke-width": i.strokeWidth,
43
+ "stroke-width": a.strokeWidth,
44
44
  fill: "none",
45
45
  "stroke-dasharray": `${e.dashLength} ${t.circumference * 2}`,
46
46
  transform: `rotate(${e.startDeg}, ${t.CX}, ${t.CY})`,
47
47
  class: "segment-circle",
48
- style: a({
48
+ style: s({
49
49
  strokeDashoffset: e.isVisible ? 0 : e.dashLength,
50
50
  transitionDelay: `${e.delay}ms`
51
51
  })
@@ -56,19 +56,19 @@ function G(N, s, i, t, M, R) {
56
56
  cy: t.CY,
57
57
  r: t.radius,
58
58
  stroke: t.OTHER_SEGMENT_BG_COLOR,
59
- "stroke-width": i.strokeWidth,
59
+ "stroke-width": a.strokeWidth,
60
60
  fill: "none",
61
61
  "stroke-dasharray": `${t.otherSegment.dashLength} ${t.circumference * 2}`,
62
62
  transform: `rotate(${t.otherSegment.startDeg}, ${t.CX}, ${t.CY})`,
63
63
  class: "segment-circle",
64
- style: a({
64
+ style: s({
65
65
  strokeDashoffset: t.otherSegment.isVisible ? 0 : t.otherSegment.dashLength,
66
66
  transitionDelay: `${t.otherSegment.delay}ms`
67
67
  })
68
68
  }, null, 12, O)) : n("", !0)
69
69
  ]))
70
70
  ]),
71
- t.hasData && !i.loading ? (l(), o("div", V, [
71
+ t.hasData && !a.loading ? (l(), o("div", V, [
72
72
  (l(!0), o(d, null, c(t.visibleSegments, (e, g) => (l(), o("div", {
73
73
  key: e.label,
74
74
  class: "tw-bg-gray-100 tw-flex tw-gap-0.5 tw-items-center tw-px-1 tw-py-0.5 tw-rounded-xs"
@@ -76,56 +76,56 @@ function G(N, s, i, t, M, R) {
76
76
  r("div", W, [
77
77
  r("span", {
78
78
  class: "tw-shrink-0 tw-w-1 tw-h-1 tw-rounded-full legend-dot",
79
- style: a({
79
+ style: s({
80
80
  backgroundColor: e.isVisible ? e.color : "#d1d5db",
81
81
  transitionDelay: `${e.delay}ms`
82
82
  })
83
83
  }, null, 4),
84
- r("span", p, w(e.label), 1)
84
+ r("span", B, w(e.label), 1)
85
85
  ]),
86
86
  r("span", {
87
87
  class: "tw-font-light tw-text-small tw-text-primary tw-text-right tw-shrink-0 tw-tabular-nums",
88
- style: a({ minWidth: t.valueMinWidth })
88
+ style: s({ minWidth: t.valueMinWidth })
89
89
  }, w(t.formatDisplayValue(g)), 5)
90
90
  ]))), 128)),
91
91
  t.otherItems.length > 0 ? (l(), o("button", {
92
92
  key: 0,
93
93
  class: "tw-bg-gray-100 tw-flex tw-gap-0.5 tw-items-center tw-px-1 tw-py-0.5 tw-rounded-xs tw-cursor-pointer tw-border-0 tw-text-left",
94
94
  type: "button",
95
- onClick: s[0] || (s[0] = (e) => t.showOtherLightbox = !0)
95
+ onClick: i[0] || (i[0] = (e) => t.showOtherLightbox = !0)
96
96
  }, [
97
- r("div", B, [
97
+ r("div", p, [
98
98
  r("span", {
99
99
  class: "tw-shrink-0 tw-w-1 tw-h-1 tw-rounded-full legend-dot",
100
- style: a({
100
+ style: s({
101
101
  backgroundColor: (h = t.otherSegment) != null && h.isVisible ? "#C4C4C4" : "#d1d5db",
102
102
  transitionDelay: `${((m = t.otherSegment) == null ? void 0 : m.delay) ?? 0}ms`
103
103
  })
104
104
  }, null, 4),
105
- s[2] || (s[2] = r("span", { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap" }, " Other ", -1))
105
+ i[2] || (i[2] = r("span", { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap" }, " Other ", -1))
106
106
  ]),
107
107
  r("span", {
108
108
  class: "tw-font-light tw-text-small tw-text-primary tw-text-right tw-shrink-0 tw-tabular-nums",
109
- style: a({ minWidth: t.valueMinWidth })
109
+ style: s({ minWidth: t.valueMinWidth })
110
110
  }, w(t.formatOtherDisplayValue()), 5)
111
111
  ])) : n("", !0)
112
112
  ])) : n("", !0),
113
- t.hasData && !i.loading ? (l(), _(f, {
113
+ t.hasData && !a.loading ? (l(), _(f, {
114
114
  key: 1,
115
115
  visible: t.showOtherLightbox,
116
116
  title: "Other",
117
- onLightboxClosed: s[1] || (s[1] = (e) => t.showOtherLightbox = !1)
117
+ onLightboxClosed: i[1] || (i[1] = (e) => t.showOtherLightbox = !1)
118
118
  }, {
119
119
  default: b(() => [
120
- r("div", I, [
120
+ r("div", E, [
121
121
  (l(!0), o(d, null, c(t.allItemsWithColors, (e) => (l(), o("div", {
122
122
  key: e.label,
123
123
  class: "tw-bg-gray-100 tw-flex tw-gap-0.5 tw-items-center tw-px-1 tw-py-0.5 tw-rounded-xs tw-justify-between tw-w-full"
124
124
  }, [
125
- r("div", E, [
125
+ r("div", I, [
126
126
  r("span", {
127
127
  class: "tw-shrink-0 tw-w-1 tw-h-1 tw-rounded-full",
128
- style: a({ backgroundColor: e.color })
128
+ style: s({ backgroundColor: e.color })
129
129
  }, null, 4),
130
130
  r("span", X, w(e.label), 1)
131
131
  ]),
@@ -137,7 +137,7 @@ function G(N, s, i, t, M, R) {
137
137
  }, 8, ["visible"])) : n("", !0)
138
138
  ]);
139
139
  }
140
- const A = /* @__PURE__ */ u(y, [["render", G], ["__scopeId", "data-v-3e2d3156"]]);
140
+ const A = /* @__PURE__ */ u(y, [["render", G], ["__scopeId", "data-v-73c9f5f9"]]);
141
141
  export {
142
142
  A as default
143
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.12.0",
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": "395f5add0d2149a52dd1e07d7df2da2a321ab11a"
128
+ "gitHead": "6d0e8c2b071887742cecc20e460e29d55f181360"
129
129
  }