@kiva/kv-components 6.13.2 → 6.14.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/index.js +178 -163
- package/dist/utils/loanCard.js +128 -87
- package/dist/vue/KvClassicLoanCard.css +1 -1
- package/dist/vue/KvClassicLoanCard.js +144 -100
- package/dist/vue/KvIntroductionLoanCard.css +1 -1
- package/dist/vue/KvIntroductionLoanCard.js +135 -95
- package/dist/vue/KvLendCta.css +1 -1
- package/dist/vue/KvLendCta.js +98 -81
- package/dist/vue/KvLoanActivities.css +1 -1
- package/dist/vue/KvLoanActivities.js +49 -36
- package/dist/vue/KvLoanBookmark.js +24 -15
- package/dist/vue/KvLoanTag.js +51 -28
- package/dist/vue/KvLoanUse.js +24 -10
- package/dist/vue/KvWideLoanCard.css +1 -1
- package/dist/vue/KvWideLoanCard.js +134 -99
- package/package.json +4 -2
|
@@ -1,29 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import j from "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
1
|
+
import A from "graphql-tag";
|
|
2
|
+
import E from "numeral";
|
|
3
|
+
import { LOAN_CALLOUTS_FRAGMENT as I, LOAN_GEOCODE_FRAGMENT as G, LOAN_PROGRESS_FRAGMENT as U, loanCardComputedProperties as V, loanCardMethods as z } from "../utils/loanCard.js";
|
|
4
|
+
import W, { KV_LOAN_BOOKMARK_FRAGMENT as M } from "./KvLoanBookmark.js";
|
|
5
|
+
import j, { KV_LOAN_USE_FRAGMENT as q } from "./KvLoanUse.js";
|
|
6
|
+
import H from "./KvBorrowerImage.js";
|
|
7
|
+
import J from "./KvLoanProgressGroup.js";
|
|
8
|
+
import Q from "./KvLoanCallouts.js";
|
|
9
|
+
import X, { KV_LOAN_TAG_FRAGMENT as Y } from "./KvLoanTag.js";
|
|
10
|
+
import Z from "./KvMaterialIcon.js";
|
|
11
|
+
import $ from "./KvLoadingPlaceholder.js";
|
|
12
|
+
import ee from "./KvFlag.js";
|
|
13
|
+
import { resolveComponent as m, openBlock as t, createElementBlock as s, normalizeClass as x, normalizeStyle as te, createElementVNode as c, createBlock as a, resolveDynamicComponent as f, withCtx as h, createVNode as d, Suspense as oe, createTextVNode as ae, toDisplayString as N, createCommentVNode as u, Fragment as re, renderList as ne } from "vue";
|
|
13
14
|
import "./KvIntroductionLoanCard.css";
|
|
14
|
-
import
|
|
15
|
-
const
|
|
15
|
+
import le from "../_virtual/_plugin-vue_export-helper.js";
|
|
16
|
+
const Se = A`
|
|
17
|
+
fragment KvIntroductionLoanCard on LoanBasic {
|
|
18
|
+
id
|
|
19
|
+
image {
|
|
20
|
+
id
|
|
21
|
+
hash # for imageHash
|
|
22
|
+
}
|
|
23
|
+
lenders(limit: 0) {
|
|
24
|
+
totalCount # for lendersNumber
|
|
25
|
+
}
|
|
26
|
+
loanFundraisingInfo {
|
|
27
|
+
id
|
|
28
|
+
fundedAmount # for amountLent
|
|
29
|
+
}
|
|
30
|
+
name # for borrowerName
|
|
31
|
+
status # for isFunded
|
|
32
|
+
...KvLoanBookmark
|
|
33
|
+
...KvLoanTag
|
|
34
|
+
...KvLoanUse
|
|
35
|
+
...LoanCallouts
|
|
36
|
+
...LoanGeocode
|
|
37
|
+
...LoanProgress
|
|
38
|
+
}
|
|
39
|
+
${M}
|
|
40
|
+
${Y}
|
|
41
|
+
${q}
|
|
42
|
+
${I}
|
|
43
|
+
${G}
|
|
44
|
+
${U}
|
|
45
|
+
`, De = A`
|
|
46
|
+
fragment KvIntroductionLoanCardUser on LoanBasic {
|
|
47
|
+
id
|
|
48
|
+
...KvLoanBookmark
|
|
49
|
+
}
|
|
50
|
+
${M}
|
|
51
|
+
`, ie = {
|
|
16
52
|
name: "KvIntroductionLoanCard",
|
|
17
53
|
components: {
|
|
18
|
-
KvBorrowerImage:
|
|
19
|
-
KvLoadingPlaceholder:
|
|
20
|
-
KvLoanUse:
|
|
21
|
-
KvLoanProgressGroup:
|
|
22
|
-
KvMaterialIcon:
|
|
23
|
-
KvLoanTag:
|
|
24
|
-
KvLoanCallouts:
|
|
25
|
-
KvFlag:
|
|
26
|
-
KvLoanBookmark:
|
|
54
|
+
KvBorrowerImage: H,
|
|
55
|
+
KvLoadingPlaceholder: $,
|
|
56
|
+
KvLoanUse: j,
|
|
57
|
+
KvLoanProgressGroup: J,
|
|
58
|
+
KvMaterialIcon: Z,
|
|
59
|
+
KvLoanTag: X,
|
|
60
|
+
KvLoanCallouts: Q,
|
|
61
|
+
KvFlag: ee,
|
|
62
|
+
KvLoanBookmark: W
|
|
27
63
|
},
|
|
28
64
|
props: {
|
|
29
65
|
loanId: {
|
|
@@ -87,24 +123,25 @@ const $ = {
|
|
|
87
123
|
countryName: w,
|
|
88
124
|
countryCode: l,
|
|
89
125
|
distributionModel: g,
|
|
90
|
-
formattedLocation:
|
|
126
|
+
formattedLocation: _,
|
|
91
127
|
fundraisingPercent: k,
|
|
92
|
-
hasProgressData:
|
|
93
|
-
imageHash:
|
|
128
|
+
hasProgressData: y,
|
|
129
|
+
imageHash: v,
|
|
94
130
|
isLoading: b,
|
|
95
|
-
loanAmount:
|
|
131
|
+
loanAmount: L,
|
|
96
132
|
loanBorrowerCount: r,
|
|
97
|
-
loanCallouts:
|
|
98
|
-
loanStatus:
|
|
99
|
-
loanUse:
|
|
100
|
-
mdiMapMarker:
|
|
101
|
-
readMorePath:
|
|
133
|
+
loanCallouts: p,
|
|
134
|
+
loanStatus: P,
|
|
135
|
+
loanUse: K,
|
|
136
|
+
mdiMapMarker: R,
|
|
137
|
+
readMorePath: B,
|
|
102
138
|
state: F,
|
|
103
|
-
tag:
|
|
104
|
-
unreservedAmount:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
139
|
+
tag: O,
|
|
140
|
+
unreservedAmount: T,
|
|
141
|
+
sharesAvailable: S
|
|
142
|
+
} = V(n, !0), {
|
|
143
|
+
clickReadMore: D
|
|
144
|
+
} = z(n, o);
|
|
108
145
|
return {
|
|
109
146
|
allDataLoaded: i,
|
|
110
147
|
borrowerName: e,
|
|
@@ -112,22 +149,23 @@ const $ = {
|
|
|
112
149
|
countryName: w,
|
|
113
150
|
countryCode: l,
|
|
114
151
|
distributionModel: g,
|
|
115
|
-
formattedLocation:
|
|
152
|
+
formattedLocation: _,
|
|
116
153
|
fundraisingPercent: k,
|
|
117
|
-
hasProgressData:
|
|
118
|
-
imageHash:
|
|
154
|
+
hasProgressData: y,
|
|
155
|
+
imageHash: v,
|
|
119
156
|
isLoading: b,
|
|
120
|
-
loanAmount:
|
|
157
|
+
loanAmount: L,
|
|
121
158
|
loanBorrowerCount: r,
|
|
122
|
-
loanCallouts:
|
|
123
|
-
loanStatus:
|
|
124
|
-
loanUse:
|
|
125
|
-
mdiMapMarker:
|
|
126
|
-
readMorePath:
|
|
159
|
+
loanCallouts: p,
|
|
160
|
+
loanStatus: P,
|
|
161
|
+
loanUse: K,
|
|
162
|
+
mdiMapMarker: R,
|
|
163
|
+
readMorePath: B,
|
|
127
164
|
state: F,
|
|
128
|
-
tag:
|
|
129
|
-
unreservedAmount:
|
|
130
|
-
|
|
165
|
+
tag: O,
|
|
166
|
+
unreservedAmount: T,
|
|
167
|
+
sharesAvailable: S,
|
|
168
|
+
clickReadMore: D
|
|
131
169
|
};
|
|
132
170
|
},
|
|
133
171
|
computed: {
|
|
@@ -152,49 +190,49 @@ const $ = {
|
|
|
152
190
|
amountLent() {
|
|
153
191
|
var o, i;
|
|
154
192
|
const n = ((i = (o = this.loan) == null ? void 0 : o.loanFundraisingInfo) == null ? void 0 : i.fundedAmount) ?? 0;
|
|
155
|
-
return
|
|
193
|
+
return E(n).format("$0,0");
|
|
156
194
|
},
|
|
157
195
|
isFunded() {
|
|
158
196
|
var n;
|
|
159
|
-
return ((n = this.loan) == null ? void 0 : n.status) === "funded" ||
|
|
197
|
+
return ((n = this.loan) == null ? void 0 : n.status) === "funded" || this.hasProgressData && !this.sharesAvailable;
|
|
160
198
|
}
|
|
161
199
|
}
|
|
162
|
-
},
|
|
200
|
+
}, se = { class: "tw-grow" }, de = { class: "loan-card-active-hover" }, me = {
|
|
163
201
|
key: 1,
|
|
164
202
|
style: { height: "11rem" },
|
|
165
203
|
class: "tw-relative tw-overflow-hidden"
|
|
166
|
-
},
|
|
204
|
+
}, ce = { key: 0 }, ue = {
|
|
167
205
|
class: "tw-absolute tw-bottom-1 tw-left-1 tw-text-primary tw-bg-white tw-rounded tw-p-1 tw-mb-0 tw-mr-2 tw-text-h4 tw-inline-flex tw-items-center !tw-capitalize",
|
|
168
206
|
style: { padding: "2px 6px" }
|
|
169
|
-
},
|
|
207
|
+
}, we = {
|
|
170
208
|
key: 3,
|
|
171
209
|
class: "tw-flex tw-justify-center tw-gap-2"
|
|
172
|
-
},
|
|
210
|
+
}, he = {
|
|
173
211
|
key: 0,
|
|
174
212
|
class: "tw-w-full",
|
|
175
213
|
style: { height: "5.5rem" }
|
|
176
|
-
},
|
|
214
|
+
}, fe = { key: 1 }, ge = { class: "tw-px-2" }, _e = {
|
|
177
215
|
key: 0,
|
|
178
216
|
class: "tw-w-full tw-pr-1"
|
|
179
|
-
},
|
|
217
|
+
}, ke = { class: "tw-flex tw-justify-between" }, ye = {
|
|
180
218
|
key: 2,
|
|
181
219
|
class: "tw-bg-eco-green-1 tw-text-action tw-text-center tw-py-1.5",
|
|
182
220
|
style: { "font-weight": "bold", "font-size": "13px", "border-radius": "8px" }
|
|
183
221
|
};
|
|
184
|
-
function
|
|
185
|
-
const l = m("kv-loading-placeholder"), g = m("kv-borrower-image"),
|
|
186
|
-
return t(),
|
|
187
|
-
class:
|
|
222
|
+
function ve(n, o, i, e, C, w) {
|
|
223
|
+
const l = m("kv-loading-placeholder"), g = m("kv-borrower-image"), _ = m("kv-flag"), k = m("kv-loan-bookmark"), y = m("kv-loan-callouts"), v = m("kv-loan-use"), b = m("kv-loan-progress-group"), L = m("kv-loan-tag");
|
|
224
|
+
return t(), s("div", {
|
|
225
|
+
class: x(["tw-flex tw-flex-col tw-bg-white tw-rounded tw-w-full tw-pb-2", { "tw-pointer-events-none": e.isLoading }]),
|
|
188
226
|
"data-testid": "loan-card",
|
|
189
|
-
style:
|
|
227
|
+
style: te([{ "box-shadow": "0px 4px 8px 0px rgba(0, 0, 0, 0.38)" }, { minWidth: "230px", maxWidth: w.cardWidth }])
|
|
190
228
|
}, [
|
|
191
|
-
c("div",
|
|
192
|
-
c("div",
|
|
229
|
+
c("div", se, [
|
|
230
|
+
c("div", de, [
|
|
193
231
|
e.isLoading ? (t(), a(l, {
|
|
194
232
|
key: 0,
|
|
195
233
|
class: "tw-w-full tw-rounded-t",
|
|
196
234
|
style: { height: "11rem" }
|
|
197
|
-
})) : (t(),
|
|
235
|
+
})) : (t(), s("div", me, [
|
|
198
236
|
(t(), a(f(e.tag), {
|
|
199
237
|
to: e.readMorePath,
|
|
200
238
|
href: e.readMorePath,
|
|
@@ -203,7 +241,7 @@ function ue(n, o, i, e, C, w) {
|
|
|
203
241
|
onClick: o[0] || (o[0] = (r) => e.clickReadMore("Photo", r))
|
|
204
242
|
}, {
|
|
205
243
|
default: h(() => [
|
|
206
|
-
|
|
244
|
+
d(g, {
|
|
207
245
|
class: "tw-relative tw-w-full tw-bg-black tw-rounded-t borrower-image",
|
|
208
246
|
alt: `Photo of ${e.borrowerName}`,
|
|
209
247
|
"aspect-ratio": w.imageAspectRatio,
|
|
@@ -212,11 +250,11 @@ function ue(n, o, i, e, C, w) {
|
|
|
212
250
|
images: w.imageSizes,
|
|
213
251
|
"photo-path": i.photoPath
|
|
214
252
|
}, null, 8, ["alt", "aspect-ratio", "default-image", "hash", "images", "photo-path"]),
|
|
215
|
-
e.countryName ? (t(),
|
|
216
|
-
c("p",
|
|
217
|
-
(t(), a(
|
|
253
|
+
e.countryName ? (t(), s("div", ce, [
|
|
254
|
+
c("p", ue, [
|
|
255
|
+
(t(), a(oe, null, {
|
|
218
256
|
default: h(() => [
|
|
219
|
-
|
|
257
|
+
d(_, {
|
|
220
258
|
class: "tw-ml-0.5 tw-mr-1",
|
|
221
259
|
country: e.countryCode,
|
|
222
260
|
name: e.countryName,
|
|
@@ -226,7 +264,7 @@ function ue(n, o, i, e, C, w) {
|
|
|
226
264
|
]),
|
|
227
265
|
_: 1
|
|
228
266
|
})),
|
|
229
|
-
|
|
267
|
+
ae(" " + N(e.formattedLocation), 1)
|
|
230
268
|
])
|
|
231
269
|
])) : u("", !0)
|
|
232
270
|
]),
|
|
@@ -255,13 +293,13 @@ function ue(n, o, i, e, C, w) {
|
|
|
255
293
|
}, {
|
|
256
294
|
default: h(() => [
|
|
257
295
|
c("h3", {
|
|
258
|
-
class:
|
|
296
|
+
class: x(["loan-card-name", { "tw-text-center": e.borrowerName.length < 20 }]),
|
|
259
297
|
style: { "font-size": "28px" }
|
|
260
|
-
},
|
|
298
|
+
}, N(e.borrowerName), 3)
|
|
261
299
|
]),
|
|
262
300
|
_: 1
|
|
263
301
|
}, 8, ["to", "href"])),
|
|
264
|
-
e.isLoading ? (t(),
|
|
302
|
+
e.isLoading ? (t(), s("div", we, [
|
|
265
303
|
e.isLoading || typeof e.loanCallouts > "u" ? (t(), a(l, {
|
|
266
304
|
key: 0,
|
|
267
305
|
class: "tw-mt-0.5 tw-mb-1",
|
|
@@ -286,7 +324,7 @@ function ue(n, o, i, e, C, w) {
|
|
|
286
324
|
onClick: o[3] || (o[3] = (r) => e.clickReadMore("Tag", r))
|
|
287
325
|
}, {
|
|
288
326
|
default: h(() => [
|
|
289
|
-
|
|
327
|
+
d(y, {
|
|
290
328
|
callouts: e.loanCallouts,
|
|
291
329
|
"add-bg-color": !1,
|
|
292
330
|
class: "loan-callouts"
|
|
@@ -303,17 +341,17 @@ function ue(n, o, i, e, C, w) {
|
|
|
303
341
|
}, {
|
|
304
342
|
default: h(() => [
|
|
305
343
|
c("div", {
|
|
306
|
-
class:
|
|
344
|
+
class: x(["tw-pt-0.5 tw-px-2", { "tw-mb-1.5": !e.isLoading }])
|
|
307
345
|
}, [
|
|
308
|
-
e.isLoading ? (t(),
|
|
309
|
-
(t(!0),
|
|
310
|
-
key:
|
|
346
|
+
e.isLoading ? (t(), s("div", he, [
|
|
347
|
+
(t(!0), s(re, null, ne([...Array(3)], (r, p) => (t(), s("div", {
|
|
348
|
+
key: p,
|
|
311
349
|
class: "tw-h-2 tw-mb-1"
|
|
312
350
|
}, [
|
|
313
|
-
|
|
351
|
+
d(l)
|
|
314
352
|
]))), 128))
|
|
315
|
-
])) : (t(),
|
|
316
|
-
|
|
353
|
+
])) : (t(), s("div", fe, [
|
|
354
|
+
d(v, {
|
|
317
355
|
use: e.loanUse,
|
|
318
356
|
"loan-amount": e.loanAmount,
|
|
319
357
|
status: e.loanStatus,
|
|
@@ -330,25 +368,25 @@ function ue(n, o, i, e, C, w) {
|
|
|
330
368
|
}, 8, ["to", "href"]))
|
|
331
369
|
])
|
|
332
370
|
]),
|
|
333
|
-
c("div",
|
|
334
|
-
e.hasProgressData ? u("", !0) : (t(),
|
|
335
|
-
c("div",
|
|
336
|
-
|
|
371
|
+
c("div", ge, [
|
|
372
|
+
e.hasProgressData ? u("", !0) : (t(), s("div", _e, [
|
|
373
|
+
c("div", ke, [
|
|
374
|
+
d(l, {
|
|
337
375
|
class: "tw-mb-0.5",
|
|
338
376
|
style: { width: "20%", height: "1.3rem" }
|
|
339
377
|
}),
|
|
340
|
-
|
|
378
|
+
d(l, {
|
|
341
379
|
class: "tw-mb-0.5",
|
|
342
380
|
style: { width: "20%", height: "1.3rem" }
|
|
343
381
|
})
|
|
344
382
|
]),
|
|
345
|
-
|
|
383
|
+
d(l, {
|
|
346
384
|
class: "tw-rounded",
|
|
347
385
|
style: { width: "100%", height: "0.5rem" }
|
|
348
386
|
})
|
|
349
387
|
])),
|
|
350
388
|
c("div", null, [
|
|
351
|
-
e.
|
|
389
|
+
e.sharesAvailable ? (t(), a(f(e.tag), {
|
|
352
390
|
key: 0,
|
|
353
391
|
to: e.readMorePath,
|
|
354
392
|
href: e.readMorePath,
|
|
@@ -357,10 +395,10 @@ function ue(n, o, i, e, C, w) {
|
|
|
357
395
|
onClick: o[5] || (o[5] = (r) => e.clickReadMore("Progress", r))
|
|
358
396
|
}, {
|
|
359
397
|
default: h(() => [
|
|
360
|
-
|
|
398
|
+
d(b, {
|
|
361
399
|
id: "loanProgress",
|
|
362
|
-
"money-left":
|
|
363
|
-
"amount-goal":
|
|
400
|
+
"money-left": e.unreservedAmount,
|
|
401
|
+
"amount-goal": e.loanAmount,
|
|
364
402
|
"progress-percent": e.fundraisingPercent,
|
|
365
403
|
class: "tw-text-secondary"
|
|
366
404
|
}, null, 8, ["money-left", "amount-goal", "progress-percent"])
|
|
@@ -372,7 +410,7 @@ function ue(n, o, i, e, C, w) {
|
|
|
372
410
|
key: 1,
|
|
373
411
|
class: "tw-rounded tw-mx-auto tw-mt-2",
|
|
374
412
|
style: { width: "9rem", height: "1rem" }
|
|
375
|
-
})) : w.isFunded ? (t(),
|
|
413
|
+
})) : w.isFunded ? (t(), s("div", ye, " 🎉 Fully funded! ")) : (t(), a(L, {
|
|
376
414
|
key: 3,
|
|
377
415
|
loan: i.loan,
|
|
378
416
|
"use-expanded-styles": !0,
|
|
@@ -382,7 +420,9 @@ function ue(n, o, i, e, C, w) {
|
|
|
382
420
|
])
|
|
383
421
|
], 6);
|
|
384
422
|
}
|
|
385
|
-
const
|
|
423
|
+
const Ee = /* @__PURE__ */ le(ie, [["render", ve], ["__scopeId", "data-v-4b1d705c"]]);
|
|
386
424
|
export {
|
|
387
|
-
|
|
425
|
+
Se as KV_INTRODUCTION_LOAN_CARD_FRAGMENT,
|
|
426
|
+
De as KV_INTRODUCTION_LOAN_CARD_USER_FRAGMENT,
|
|
427
|
+
Ee as default
|
|
388
428
|
};
|
package/dist/vue/KvLendCta.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.amountDropdownWrapper[data-v-
|
|
1
|
+
.amountDropdownWrapper[data-v-1ac5c3c8] select{border-radius:14px 0 0 14px}.lend-again[data-v-1ac5c3c8] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-1ac5c3c8] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-1ac5c3c8] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-1ac5c3c8] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-option[data-v-1ac5c3c8] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
|