@kiva/kv-components 8.14.0 → 8.14.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.
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import w from "numeral";
|
|
2
|
+
const $ = 200, o = "...";
|
|
3
|
+
function E(t) {
|
|
4
|
+
return t.length ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return
|
|
6
|
+
function L(t, e) {
|
|
7
|
+
return e <= 0 ? "" : t.length <= e ? t : e <= o.length ? o.slice(0, e) : `${t.slice(0, e - o.length).trimEnd()}${o}`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function g(t) {
|
|
10
10
|
const {
|
|
11
|
-
anonymizationLevel:
|
|
11
|
+
anonymizationLevel: e,
|
|
12
12
|
borrowerName: a,
|
|
13
13
|
distributionModel: l,
|
|
14
14
|
formattedLocation: s,
|
|
15
|
-
loanAmount:
|
|
16
|
-
loanBorrowerCount:
|
|
17
|
-
loanStatus:
|
|
18
|
-
loanUse: c
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
b > 1 ? "a member of" : ""
|
|
15
|
+
loanAmount: S,
|
|
16
|
+
loanBorrowerCount: p,
|
|
17
|
+
loanStatus: b,
|
|
18
|
+
loanUse: c
|
|
19
|
+
} = t, f = s ? `${a} in ${s}` : a, n = e !== "full" && !!c.length, u = ["fundraising", "inactive", "reviewed"].includes(b) ? "helps" : "helped", r = n ? [
|
|
20
|
+
w(S).format("$0,0"),
|
|
21
|
+
l === "direct" ? "to" : u,
|
|
22
|
+
p > 1 ? "a member of" : ""
|
|
24
23
|
].filter(Boolean).join(" ") : "";
|
|
25
24
|
let i = "";
|
|
26
|
-
n && (i = l === "direct" ? ` ${
|
|
27
|
-
const
|
|
25
|
+
n && (i = l === "direct" ? ` ${u} ` : " ");
|
|
26
|
+
const m = n ? E(c) : "For the borrower's privacy, this loan has been made anonymous.", d = n ? `${r} ${f}${i}` : "", h = `${d}${m}`;
|
|
28
27
|
return {
|
|
29
|
-
borrowerNameWithCountry:
|
|
28
|
+
borrowerNameWithCountry: f,
|
|
30
29
|
loanUsePrefixStart: r ? `${r} ` : "",
|
|
31
30
|
loanUsePrefixEnd: i,
|
|
32
|
-
statementTitle:
|
|
33
|
-
visibleUseStatement:
|
|
31
|
+
statementTitle: h.length > $ ? h : void 0,
|
|
32
|
+
visibleUseStatement: L(m, $ - d.length)
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
$ as POST_GOAL_STATEMENT_MAX_LENGTH,
|
|
37
|
+
g as computePostGoalLoanCardStatement
|
|
39
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.loan-card-use[data-v-
|
|
1
|
+
.loan-card-use[data-v-f5998610]:hover,.loan-card-use[data-v-f5998610]: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-f5998610]{text-decoration-line:underline}.loan-card-progress[data-v-f5998610]:hover,.loan-card-progress[data-v-f5998610]:focus{text-decoration-line:none}.loan-card-use-text[data-v-f5998610] 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-f5998610] form,.loan-card-cta[data-v-f5998610] fieldset,.loan-card-cta[data-v-f5998610] .tw-w-full,.loan-card-cta[data-v-f5998610] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-f5998610] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}[data-v-f5998610] .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-f5998610] .goal-variant-callouts span{font-weight:500}.goal-variant-progress-group[data-v-f5998610] div[role=progressbar]{background-color:#d9d9d9}
|
|
@@ -316,7 +316,7 @@ function Q(g, o, t, e, X, L) {
|
|
|
316
316
|
], 2)
|
|
317
317
|
], 10, S);
|
|
318
318
|
}
|
|
319
|
-
const te = /* @__PURE__ */ G(B, [["render", Q], ["__scopeId", "data-v-
|
|
319
|
+
const te = /* @__PURE__ */ G(B, [["render", Q], ["__scopeId", "data-v-f5998610"]]);
|
|
320
320
|
export {
|
|
321
321
|
oe as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
322
322
|
le as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import p from "graphql-tag";
|
|
2
2
|
import W from "numeral";
|
|
3
|
-
import { ref as $, computed as
|
|
3
|
+
import { ref as $, computed as o, watch as H } from "vue";
|
|
4
4
|
import { mdiMapMarker as j, mdiHome as q, mdiLink as z, mdiCached as J } from "@mdi/js";
|
|
5
5
|
import { LOAN_CALLOUTS_FRAGMENT as Q, LOAN_GEOCODE_FRAGMENT as X, LOAN_PROGRESS_FRAGMENT as Y, loanCardComputedProperties as Z, loanCardMethods as ee } from "../utils/loanCard.js";
|
|
6
6
|
import { getDropdownPriceArray as te, getLendCtaSelectedOption as ae, isLessThan25 as oe } from "../utils/loanUtils.js";
|
|
@@ -217,18 +217,18 @@ const d = {
|
|
|
217
217
|
"update:selected-amount"
|
|
218
218
|
],
|
|
219
219
|
setup(e, { emit: a }) {
|
|
220
|
-
const r = $(""), s =
|
|
220
|
+
const r = $(""), s = o(
|
|
221
221
|
() => e.variant === d.postGoal
|
|
222
222
|
), {
|
|
223
223
|
allDataLoaded: C,
|
|
224
224
|
borrowerName: m,
|
|
225
225
|
city: b,
|
|
226
|
-
countryName:
|
|
226
|
+
countryName: N,
|
|
227
227
|
distributionModel: f,
|
|
228
228
|
formattedLocation: c,
|
|
229
|
-
fundraisingPercent:
|
|
230
|
-
hasProgressData:
|
|
231
|
-
imageHash:
|
|
229
|
+
fundraisingPercent: S,
|
|
230
|
+
hasProgressData: _,
|
|
231
|
+
imageHash: w,
|
|
232
232
|
isLoading: B,
|
|
233
233
|
loanAmount: v,
|
|
234
234
|
loanBorrowerCount: L,
|
|
@@ -240,17 +240,17 @@ const d = {
|
|
|
240
240
|
tag: K,
|
|
241
241
|
unreservedAmount: u,
|
|
242
242
|
sharesAvailable: R
|
|
243
|
-
} = Z(e), { clickReadMore: P } = ee(e, a), M =
|
|
243
|
+
} = Z(e), { clickReadMore: P } = ee(e, a), M = o(() => s.value ? void 0 : { width: "100px", height: "100px" }), E = o(() => {
|
|
244
244
|
if (!e.website)
|
|
245
245
|
return "";
|
|
246
246
|
const t = e.website.trim();
|
|
247
247
|
return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
|
|
248
|
-
}), G =
|
|
248
|
+
}), G = o(() => {
|
|
249
249
|
if (s.value) return {};
|
|
250
|
-
const t = e.showLightView ? "auto" : "6.75rem",
|
|
251
|
-
return { height: t, maxHeight:
|
|
252
|
-
}), l =
|
|
253
|
-
var t
|
|
250
|
+
const t = e.showLightView ? "auto" : "6.75rem", n = e.showLightView ? "none" : "6.75rem";
|
|
251
|
+
return { height: t, maxHeight: n };
|
|
252
|
+
}), l = o(() => {
|
|
253
|
+
var t;
|
|
254
254
|
return ne({
|
|
255
255
|
anonymizationLevel: (t = e.loan) == null ? void 0 : t.anonymizationLevel,
|
|
256
256
|
borrowerName: m.value,
|
|
@@ -259,18 +259,17 @@ const d = {
|
|
|
259
259
|
loanAmount: v.value,
|
|
260
260
|
loanBorrowerCount: L.value,
|
|
261
261
|
loanStatus: h.value,
|
|
262
|
-
loanUse: y.value
|
|
263
|
-
whySpecial: (o = e.loan) == null ? void 0 : o.whySpecial
|
|
262
|
+
loanUse: y.value
|
|
264
263
|
});
|
|
265
|
-
}), O =
|
|
264
|
+
}), O = o(() => l.value.borrowerNameWithCountry), U = o(() => l.value.loanUsePrefixStart), D = o(() => l.value.loanUsePrefixEnd), V = o(() => l.value.statementTitle), I = o(() => l.value.visibleUseStatement), g = o(() => {
|
|
266
265
|
var i;
|
|
267
266
|
const t = parseFloat(u.value);
|
|
268
267
|
if (!t) return [];
|
|
269
|
-
const
|
|
268
|
+
const n = t < 25 ? parseFloat(`${((i = e.loan) == null ? void 0 : i.minNoteSize) ?? 25}`) : 25;
|
|
270
269
|
return te(
|
|
271
270
|
u.value,
|
|
272
271
|
pe(t),
|
|
273
|
-
|
|
272
|
+
n,
|
|
274
273
|
e.enableFiveDollarsNotes,
|
|
275
274
|
e.isVisitor
|
|
276
275
|
);
|
|
@@ -284,7 +283,7 @@ const d = {
|
|
|
284
283
|
r.value = "";
|
|
285
284
|
return;
|
|
286
285
|
}
|
|
287
|
-
const
|
|
286
|
+
const n = ae(
|
|
288
287
|
e.getCookie,
|
|
289
288
|
e.setCookie,
|
|
290
289
|
e.enableFiveDollarsNotes,
|
|
@@ -293,11 +292,11 @@ const d = {
|
|
|
293
292
|
e.userBalance ? parseFloat(e.userBalance) : void 0,
|
|
294
293
|
e.fiveDollarsSelected
|
|
295
294
|
);
|
|
296
|
-
r.value = t.includes(
|
|
295
|
+
r.value = t.includes(n) ? n : t[0];
|
|
297
296
|
},
|
|
298
297
|
{ immediate: !0 }
|
|
299
298
|
);
|
|
300
|
-
const x =
|
|
299
|
+
const x = o(() => e.showLightView ? 3 : 4);
|
|
301
300
|
return {
|
|
302
301
|
allDataLoaded: C,
|
|
303
302
|
amountOptions: g,
|
|
@@ -305,13 +304,13 @@ const d = {
|
|
|
305
304
|
borrowerName: m,
|
|
306
305
|
borrowerNameWithCountry: O,
|
|
307
306
|
city: b,
|
|
308
|
-
countryName:
|
|
307
|
+
countryName: N,
|
|
309
308
|
distributionModel: f,
|
|
310
309
|
formattedLocation: c,
|
|
311
310
|
formattedWebsite: E,
|
|
312
|
-
fundraisingPercent:
|
|
313
|
-
hasProgressData:
|
|
314
|
-
imageHash:
|
|
311
|
+
fundraisingPercent: S,
|
|
312
|
+
hasProgressData: _,
|
|
313
|
+
imageHash: w,
|
|
315
314
|
isLoading: B,
|
|
316
315
|
isPostGoalVariant: s,
|
|
317
316
|
loanAmount: v,
|
|
@@ -348,12 +347,12 @@ const d = {
|
|
|
348
347
|
a("refresh-button", t);
|
|
349
348
|
},
|
|
350
349
|
handleSelectedAmount: (t) => {
|
|
351
|
-
var
|
|
350
|
+
var n;
|
|
352
351
|
r.value = t, a("update:selected-amount", t), e.kvTrackFunction(
|
|
353
352
|
"Lending",
|
|
354
353
|
"Modify lend amount",
|
|
355
354
|
t,
|
|
356
|
-
e.loanId ?? ((
|
|
355
|
+
e.loanId ?? ((n = e.loan) == null ? void 0 : n.id)
|
|
357
356
|
);
|
|
358
357
|
}
|
|
359
358
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.14.
|
|
3
|
+
"version": "8.14.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": "
|
|
128
|
+
"gitHead": "d0fa7bf1f6f09507d97ff5e7713842e346607cc0"
|
|
129
129
|
}
|