@kiva/kv-components 8.15.1 → 8.16.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/vue/KvClassicLoanCard.css +1 -1
- package/dist/vue/KvClassicLoanCard.js +4 -3
- package/dist/vue/KvClassicLoanCard.vue.d.ts +22 -0
- package/dist/vue/KvClassicLoanCard2.js +24 -20
- package/dist/vue/KvCompactLoanCard.css +1 -1
- package/dist/vue/KvCompactLoanCard.js +32 -31
- package/dist/vue/KvCompactLoanCard.vue.d.ts +23 -0
- package/dist/vue/KvCompactLoanCard2.js +65 -57
- package/dist/vue/KvIntroductionLoanCard.css +1 -1
- package/dist/vue/KvIntroductionLoanCard.js +9 -8
- package/dist/vue/KvIntroductionLoanCard.vue.d.ts +22 -0
- package/dist/vue/KvIntroductionLoanCard2.js +26 -22
- package/dist/vue/KvLoanTag.js +39 -18
- package/dist/vue/KvLoanTag.vue.d.ts +13 -0
- package/dist/vue/KvLoanTag2.js +53 -28
- package/dist/vue/KvWideLoanCard.css +1 -1
- package/dist/vue/KvWideLoanCard.js +4 -3
- package/dist/vue/KvWideLoanCard.vue.d.ts +22 -0
- package/dist/vue/KvWideLoanCard2.js +22 -18
- package/package.json +2 -2
package/dist/vue/KvLoanTag2.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { parseISO as s, differenceInDays as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { parseISO as s, differenceInDays as r } from "date-fns";
|
|
2
|
+
import u from "graphql-tag";
|
|
3
|
+
import l from "numeral";
|
|
4
|
+
import h from "./KvCountdownTimer.js";
|
|
5
|
+
import d from "./KvTooltip.js";
|
|
6
|
+
const m = "N/A", a = {
|
|
6
7
|
almostFunded: "almost-funded",
|
|
7
8
|
endingSoon: "ending-soon",
|
|
8
9
|
matchedLoan: "matched-loan",
|
|
9
10
|
lseLoan: "lse-loan"
|
|
10
|
-
}, L =
|
|
11
|
+
}, L = u`
|
|
11
12
|
fragment KvLoanTag on LoanBasic {
|
|
12
13
|
id
|
|
13
14
|
loanFundraisingInfo {
|
|
@@ -18,15 +19,20 @@ const m = "N/A", t = {
|
|
|
18
19
|
loanAmount
|
|
19
20
|
matchRatio
|
|
20
21
|
matchingText
|
|
22
|
+
multiMatching {
|
|
23
|
+
matchRatio
|
|
24
|
+
matchingText
|
|
25
|
+
}
|
|
21
26
|
plannedExpirationDate
|
|
22
27
|
... on LoanPartner {
|
|
23
28
|
partnerName
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
|
-
`,
|
|
31
|
+
`, x = {
|
|
27
32
|
name: "KvLoanTag",
|
|
28
33
|
components: {
|
|
29
|
-
KvCountdownTimer:
|
|
34
|
+
KvCountdownTimer: h,
|
|
35
|
+
KvTooltip: d
|
|
30
36
|
},
|
|
31
37
|
props: {
|
|
32
38
|
loan: {
|
|
@@ -36,36 +42,55 @@ const m = "N/A", t = {
|
|
|
36
42
|
useExpandedStyles: {
|
|
37
43
|
type: Boolean,
|
|
38
44
|
default: !1
|
|
45
|
+
},
|
|
46
|
+
enableMultiMatching: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
39
49
|
}
|
|
40
50
|
},
|
|
41
51
|
computed: {
|
|
42
52
|
deadline() {
|
|
43
|
-
var
|
|
44
|
-
return s((
|
|
53
|
+
var t;
|
|
54
|
+
return s((t = this.loan) == null ? void 0 : t.plannedExpirationDate);
|
|
45
55
|
},
|
|
46
56
|
isLseLoan() {
|
|
47
|
-
var
|
|
48
|
-
return ((
|
|
57
|
+
var t, n;
|
|
58
|
+
return ((n = (t = this.loan) == null ? void 0 : t.partnerName) == null ? void 0 : n.toUpperCase().includes(m)) ?? !1;
|
|
49
59
|
},
|
|
50
60
|
amountLeft() {
|
|
51
|
-
var
|
|
52
|
-
const
|
|
53
|
-
return
|
|
61
|
+
var e, o;
|
|
62
|
+
const t = ((e = this.loan) == null ? void 0 : e.loanFundraisingInfo) ?? { fundedAmount: 0, reservedAmount: 0 }, { fundedAmount: n, reservedAmount: i } = t;
|
|
63
|
+
return l((o = this.loan) == null ? void 0 : o.loanAmount).subtract(n).subtract(i).value();
|
|
64
|
+
},
|
|
65
|
+
multiMatchingOrgs() {
|
|
66
|
+
var t;
|
|
67
|
+
return ((t = this.loan) == null ? void 0 : t.multiMatching) ?? [];
|
|
68
|
+
},
|
|
69
|
+
isMultipleMatch() {
|
|
70
|
+
return this.enableMultiMatching && this.multiMatchingOrgs.length > 1;
|
|
71
|
+
},
|
|
72
|
+
totalMatchRatio() {
|
|
73
|
+
return this.multiMatchingOrgs.reduce((t, n) => t + n.matchRatio + 1, 0);
|
|
54
74
|
},
|
|
55
75
|
variation() {
|
|
56
|
-
var
|
|
57
|
-
|
|
76
|
+
var i, e;
|
|
77
|
+
const t = !!((i = this.loan) != null && i.matchingText), n = this.enableMultiMatching && this.multiMatchingOrgs.length > 0;
|
|
78
|
+
return t || n ? a.matchedLoan : this.isLseLoan ? a.lseLoan : r(s((e = this.loan) == null ? void 0 : e.plannedExpirationDate), Date.now()) <= 3 ? a.endingSoon : this.amountLeft < 100 && this.amountLeft >= 0 ? a.almostFunded : null;
|
|
58
79
|
},
|
|
59
80
|
tagText() {
|
|
60
|
-
var
|
|
81
|
+
var t;
|
|
61
82
|
switch (this.variation) {
|
|
62
|
-
case
|
|
83
|
+
case a.lseLoan:
|
|
63
84
|
return `${this.useExpandedStyles ? "⚡ " : ""}High community impact`;
|
|
64
|
-
case
|
|
85
|
+
case a.almostFunded:
|
|
65
86
|
return `${this.useExpandedStyles ? "💸 " : ""}Almost funded`;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
case a.matchedLoan: {
|
|
88
|
+
if (this.enableMultiMatching && this.multiMatchingOrgs.length === 1) {
|
|
89
|
+
const n = this.multiMatchingOrgs[0];
|
|
90
|
+
return `${this.useExpandedStyles ? "🤝 " : ""}${n.matchRatio + 1}x matching by ${n.matchingText}`;
|
|
91
|
+
}
|
|
92
|
+
return `${this.useExpandedStyles ? "🤝 " : ""}${this.matchRatio + 1}x matching by ${(t = this.loan) == null ? void 0 : t.matchingText}`;
|
|
93
|
+
}
|
|
69
94
|
default:
|
|
70
95
|
return `${this.useExpandedStyles ? "⏰ " : ""}Ending soon: `;
|
|
71
96
|
}
|
|
@@ -73,9 +98,9 @@ const m = "N/A", t = {
|
|
|
73
98
|
tagColor() {
|
|
74
99
|
if (this.useExpandedStyles)
|
|
75
100
|
switch (this.variation) {
|
|
76
|
-
case
|
|
101
|
+
case a.almostFunded:
|
|
77
102
|
return "#AF741C";
|
|
78
|
-
case
|
|
103
|
+
case a.endingSoon:
|
|
79
104
|
return "#CE2626";
|
|
80
105
|
default:
|
|
81
106
|
return "#2B7C5F";
|
|
@@ -83,12 +108,12 @@ const m = "N/A", t = {
|
|
|
83
108
|
return "#CE4A00";
|
|
84
109
|
},
|
|
85
110
|
matchRatio() {
|
|
86
|
-
var
|
|
87
|
-
return (
|
|
111
|
+
var t;
|
|
112
|
+
return (t = this.loan) == null ? void 0 : t.matchRatio;
|
|
88
113
|
}
|
|
89
114
|
}
|
|
90
115
|
};
|
|
91
116
|
export {
|
|
92
117
|
L as KV_LOAN_TAG_FRAGMENT,
|
|
93
|
-
|
|
118
|
+
x as default
|
|
94
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.loan-card-use[data-v-
|
|
1
|
+
.loan-card-use[data-v-6b9da1b7]:hover,.loan-card-use[data-v-6b9da1b7]: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-6b9da1b7]{text-decoration-line:underline}.loan-card-progress[data-v-6b9da1b7],.loan-card-progress[data-v-6b9da1b7]:hover,.loan-card-progress[data-v-6b9da1b7]:focus{text-decoration-line:none}.loan-callouts[data-v-6b9da1b7] div{height:auto;flex-wrap:wrap}
|
|
@@ -82,8 +82,9 @@ function O(h, a, t, e, j, g) {
|
|
|
82
82
|
default: k(() => [
|
|
83
83
|
t.showTags && !e.isLoading ? (o(), n(x, {
|
|
84
84
|
key: 0,
|
|
85
|
-
loan: t.loan
|
|
86
|
-
|
|
85
|
+
loan: t.loan,
|
|
86
|
+
"enable-multi-matching": t.enableMultiMatching
|
|
87
|
+
}, null, 8, ["loan", "enable-multi-matching"])) : c("", !0)
|
|
87
88
|
]),
|
|
88
89
|
_: 1
|
|
89
90
|
}, 8, ["to", "href"])),
|
|
@@ -185,7 +186,7 @@ function O(h, a, t, e, j, g) {
|
|
|
185
186
|
])
|
|
186
187
|
], 2);
|
|
187
188
|
}
|
|
188
|
-
const X = /* @__PURE__ */ R(P, [["render", O], ["__scopeId", "data-v-
|
|
189
|
+
const X = /* @__PURE__ */ R(P, [["render", O], ["__scopeId", "data-v-6b9da1b7"]]);
|
|
189
190
|
export {
|
|
190
191
|
p as KV_WIDE_LOAN_CARD_FRAGMENT,
|
|
191
192
|
$ as KV_WIDE_LOAN_CARD_USER_FRAGMENT,
|
|
@@ -87,6 +87,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
87
87
|
type: StringConstructor;
|
|
88
88
|
default: string;
|
|
89
89
|
};
|
|
90
|
+
enableMultiMatching: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
90
94
|
}>, {
|
|
91
95
|
allDataLoaded: import('vue').ComputedRef<boolean>;
|
|
92
96
|
borrowerName: import('vue').ComputedRef<any>;
|
|
@@ -203,6 +207,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
203
207
|
type: StringConstructor;
|
|
204
208
|
default: string;
|
|
205
209
|
};
|
|
210
|
+
enableMultiMatching: {
|
|
211
|
+
type: BooleanConstructor;
|
|
212
|
+
default: boolean;
|
|
213
|
+
};
|
|
206
214
|
}>> & Readonly<{}>, {
|
|
207
215
|
loan: Record<string, any>;
|
|
208
216
|
externalLinks: boolean;
|
|
@@ -222,6 +230,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
222
230
|
fiveDollarsSelected: boolean;
|
|
223
231
|
isVisitor: boolean;
|
|
224
232
|
isBookmarked: boolean;
|
|
233
|
+
enableMultiMatching: boolean;
|
|
225
234
|
showTags: boolean;
|
|
226
235
|
}, {}, {
|
|
227
236
|
KvBorrowerImage: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -1129,10 +1138,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1129
1138
|
type: BooleanConstructor;
|
|
1130
1139
|
default: boolean;
|
|
1131
1140
|
};
|
|
1141
|
+
enableMultiMatching: {
|
|
1142
|
+
type: BooleanConstructor;
|
|
1143
|
+
default: boolean;
|
|
1144
|
+
};
|
|
1132
1145
|
}>, {}, {}, {
|
|
1133
1146
|
deadline(): Date;
|
|
1134
1147
|
isLseLoan(): any;
|
|
1135
1148
|
amountLeft(): any;
|
|
1149
|
+
multiMatchingOrgs(): any;
|
|
1150
|
+
isMultipleMatch(): boolean;
|
|
1151
|
+
totalMatchRatio(): any;
|
|
1136
1152
|
variation(): string;
|
|
1137
1153
|
tagText(): string;
|
|
1138
1154
|
tagColor(): "#AF741C" | "#CE2626" | "#2B7C5F" | "#CE4A00";
|
|
@@ -1146,8 +1162,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1146
1162
|
type: BooleanConstructor;
|
|
1147
1163
|
default: boolean;
|
|
1148
1164
|
};
|
|
1165
|
+
enableMultiMatching: {
|
|
1166
|
+
type: BooleanConstructor;
|
|
1167
|
+
default: boolean;
|
|
1168
|
+
};
|
|
1149
1169
|
}>> & Readonly<{}>, {
|
|
1150
1170
|
useExpandedStyles: boolean;
|
|
1171
|
+
enableMultiMatching: boolean;
|
|
1151
1172
|
}, {}, {
|
|
1152
1173
|
KvCountdownTimer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1153
1174
|
deadline: {
|
|
@@ -1163,6 +1184,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1163
1184
|
required: true;
|
|
1164
1185
|
};
|
|
1165
1186
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1187
|
+
KvTooltip: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
1166
1188
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1167
1189
|
KvLoanCallouts: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1168
1190
|
callouts: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LOAN_CALLOUTS_FRAGMENT as E, LOAN_GEOCODE_FRAGMENT as
|
|
1
|
+
import a from "graphql-tag";
|
|
2
|
+
import { LOAN_CALLOUTS_FRAGMENT as E, LOAN_GEOCODE_FRAGMENT as M, LOAN_PROGRESS_FRAGMENT as B, loanCardComputedProperties as R, loanCardMethods as S } from "../utils/loanCard.js";
|
|
3
3
|
import T from "./KvLoanUse.js";
|
|
4
4
|
import w from "./KvBorrowerImage.js";
|
|
5
5
|
import O from "./KvLoanProgressGroup.js";
|
|
@@ -7,13 +7,13 @@ import D from "./KvLoanCallouts.js";
|
|
|
7
7
|
import F from "./KvLendCta.js";
|
|
8
8
|
import G from "./KvLoanBookmark.js";
|
|
9
9
|
import k from "./KvLoanTag.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import b from "./KvMaterialIcon.js";
|
|
11
|
+
import P from "./KvLoadingPlaceholder.js";
|
|
12
12
|
import { KV_LEND_CTA_FRAGMENT as U, KV_LEND_CTA_USER_FRAGMENT as V } from "./KvLendCta2.js";
|
|
13
13
|
import { KV_LOAN_TAG_FRAGMENT as W } from "./KvLoanTag2.js";
|
|
14
14
|
import { KV_LOAN_USE_FRAGMENT as $ } from "./KvLoanUse2.js";
|
|
15
15
|
import { KV_LOAN_BOOKMARK_FRAGMENT as z } from "./KvLoanBookmark2.js";
|
|
16
|
-
const ne =
|
|
16
|
+
const ne = a`
|
|
17
17
|
fragment KvWideLoanCard on LoanBasic {
|
|
18
18
|
id
|
|
19
19
|
image {
|
|
@@ -32,9 +32,9 @@ const ne = o`
|
|
|
32
32
|
${W}
|
|
33
33
|
${$}
|
|
34
34
|
${E}
|
|
35
|
-
${
|
|
35
|
+
${M}
|
|
36
36
|
${B}
|
|
37
|
-
`, ie =
|
|
37
|
+
`, ie = a`
|
|
38
38
|
fragment KvWideLoanCardUser on LoanBasic {
|
|
39
39
|
id
|
|
40
40
|
...KvLendCtaUser
|
|
@@ -42,14 +42,14 @@ const ne = o`
|
|
|
42
42
|
}
|
|
43
43
|
${V}
|
|
44
44
|
${z}
|
|
45
|
-
`,
|
|
45
|
+
`, le = {
|
|
46
46
|
name: "KvWideLoanCard",
|
|
47
47
|
components: {
|
|
48
48
|
KvBorrowerImage: w,
|
|
49
|
-
KvLoadingPlaceholder:
|
|
49
|
+
KvLoadingPlaceholder: P,
|
|
50
50
|
KvLoanUse: T,
|
|
51
51
|
KvLoanProgressGroup: O,
|
|
52
|
-
KvMaterialIcon:
|
|
52
|
+
KvMaterialIcon: b,
|
|
53
53
|
KvLendCta: F,
|
|
54
54
|
KvLoanTag: k,
|
|
55
55
|
KvLoanCallouts: D,
|
|
@@ -139,16 +139,20 @@ const ne = o`
|
|
|
139
139
|
customHref: {
|
|
140
140
|
type: String,
|
|
141
141
|
default: ""
|
|
142
|
+
},
|
|
143
|
+
enableMultiMatching: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: !1
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
|
-
setup(e, { emit:
|
|
148
|
+
setup(e, { emit: o }) {
|
|
145
149
|
const {
|
|
146
150
|
allDataLoaded: t,
|
|
147
151
|
borrowerName: r,
|
|
148
152
|
city: n,
|
|
149
153
|
countryName: i,
|
|
150
|
-
distributionModel:
|
|
151
|
-
formattedLocation:
|
|
154
|
+
distributionModel: l,
|
|
155
|
+
formattedLocation: d,
|
|
152
156
|
fundraisingPercent: s,
|
|
153
157
|
hasProgressData: u,
|
|
154
158
|
imageHash: m,
|
|
@@ -164,16 +168,16 @@ const ne = o`
|
|
|
164
168
|
tag: K,
|
|
165
169
|
unreservedAmount: N,
|
|
166
170
|
sharesAvailable: h
|
|
167
|
-
} =
|
|
171
|
+
} = R(e), {
|
|
168
172
|
clickReadMore: C
|
|
169
|
-
} = S(e,
|
|
173
|
+
} = S(e, o);
|
|
170
174
|
return {
|
|
171
175
|
allDataLoaded: t,
|
|
172
176
|
borrowerName: r,
|
|
173
177
|
city: n,
|
|
174
178
|
countryName: i,
|
|
175
|
-
distributionModel:
|
|
176
|
-
formattedLocation:
|
|
179
|
+
distributionModel: l,
|
|
180
|
+
formattedLocation: d,
|
|
177
181
|
fundraisingPercent: s,
|
|
178
182
|
hasProgressData: u,
|
|
179
183
|
imageHash: m,
|
|
@@ -216,5 +220,5 @@ const ne = o`
|
|
|
216
220
|
export {
|
|
217
221
|
ne as KV_WIDE_LOAN_CARD_FRAGMENT,
|
|
218
222
|
ie as KV_WIDE_LOAN_CARD_USER_FRAGMENT,
|
|
219
|
-
|
|
223
|
+
le as default
|
|
220
224
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"fuse.js": "^7.1.0"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "23b0928e2e0d6fc6899df814e04cf53989a39a65"
|
|
132
132
|
}
|