@kiva/kv-components 7.5.0 → 7.6.2
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/utils/mapUtils.js +59 -59
- package/dist/vue/KvCompactLoanCard.css +1 -1
- package/dist/vue/KvCompactLoanCard.js +113 -99
- package/dist/vue/KvMap.js +23 -5
- package/package.json +11 -3
package/dist/utils/mapUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function p(e,
|
|
2
|
-
return (Math.random() * (
|
|
1
|
+
function p(e, o, r) {
|
|
2
|
+
return (Math.random() * (o - e) + e).toFixed(r) * 1;
|
|
3
3
|
}
|
|
4
4
|
const d = Array.from(
|
|
5
5
|
{ length: 20 },
|
|
@@ -12,18 +12,18 @@ const d = Array.from(
|
|
|
12
12
|
800,
|
|
13
13
|
1e3
|
|
14
14
|
];
|
|
15
|
-
function M(e,
|
|
16
|
-
if (!e || !
|
|
15
|
+
function M(e, o, r) {
|
|
16
|
+
if (!e || !o || !r || r < 1 || !Array.isArray(e) || !Array.isArray(o) || e.length !== 2 || o.length !== 2)
|
|
17
17
|
return [];
|
|
18
|
-
const n =
|
|
19
|
-
let
|
|
18
|
+
const n = o[0] - e[0], s = o[1] - e[1], i = n / r, a = s / r;
|
|
19
|
+
let t = 0, l = 0;
|
|
20
20
|
const c = [];
|
|
21
|
-
for (; Math.abs(
|
|
22
|
-
c.push([e[0] +
|
|
23
|
-
return c[c.length - 1] = [
|
|
21
|
+
for (; Math.abs(t) < Math.abs(n) || Math.abs(l) < Math.abs(s); )
|
|
22
|
+
c.push([e[0] + t, e[1] + l]), Math.abs(t) < Math.abs(n) && (t += i), Math.abs(l) < Math.abs(s) && (l += a);
|
|
23
|
+
return c[c.length - 1] = [o[0], o[1]], c;
|
|
24
24
|
}
|
|
25
|
-
function b(e,
|
|
26
|
-
return new Promise((
|
|
25
|
+
function b(e, o, r) {
|
|
26
|
+
return new Promise((s) => {
|
|
27
27
|
e.addSource("endpoint", {
|
|
28
28
|
type: "geojson",
|
|
29
29
|
data: {
|
|
@@ -34,9 +34,9 @@ function b(e, t, r) {
|
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
const i = (a,
|
|
38
|
-
const
|
|
39
|
-
let
|
|
37
|
+
const i = (a, t, l, c = !1) => {
|
|
38
|
+
const f = M(a, t, 100);
|
|
39
|
+
let h = 0;
|
|
40
40
|
const u = {
|
|
41
41
|
type: "FeatureCollection",
|
|
42
42
|
features: [{
|
|
@@ -47,7 +47,7 @@ function b(e, t, r) {
|
|
|
47
47
|
}
|
|
48
48
|
}]
|
|
49
49
|
};
|
|
50
|
-
e.addSource(`startPoint${
|
|
50
|
+
e.addSource(`startPoint${l}`, {
|
|
51
51
|
type: "geojson",
|
|
52
52
|
data: {
|
|
53
53
|
type: "Point",
|
|
@@ -57,7 +57,7 @@ function b(e, t, r) {
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
}), e.addLayer({
|
|
60
|
-
id: `line-animation${
|
|
60
|
+
id: `line-animation${l}`,
|
|
61
61
|
type: "line",
|
|
62
62
|
source: {
|
|
63
63
|
type: "geojson",
|
|
@@ -72,26 +72,26 @@ function b(e, t, r) {
|
|
|
72
72
|
"line-width": 2
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
u.features[0].geometry.coordinates.push(
|
|
75
|
+
const y = () => {
|
|
76
|
+
if (h < f.length)
|
|
77
|
+
u.features[0].geometry.coordinates.push(f[h]), e.getSource(`line-animation${l}`).setData(u), requestAnimationFrame(y), h += 1;
|
|
78
78
|
else {
|
|
79
|
-
const
|
|
80
|
-
|
|
79
|
+
const g = u.features[0].geometry.coordinates;
|
|
80
|
+
g.shift(), g.shift(), g.length > 0 ? (u.features[0].geometry.coordinates = g, e.getSource(`line-animation${l}`).setData(u), requestAnimationFrame(y)) : (e.removeLayer(`line-animation${l}`), e.removeSource(`line-animation${l}`), e.removeSource(`startPoint${l}`), c && (e.removeSource("endpoint"), s()));
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
y();
|
|
84
84
|
};
|
|
85
|
-
|
|
86
|
-
i(a, r,
|
|
85
|
+
o.forEach((a, t) => {
|
|
86
|
+
i(a, r, t, t === o.length - 1);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
function $(e,
|
|
90
|
+
function $(e, o) {
|
|
91
91
|
const r = {
|
|
92
92
|
type: "FeatureCollection"
|
|
93
93
|
};
|
|
94
|
-
r.features =
|
|
94
|
+
r.features = o.map((n) => ({
|
|
95
95
|
type: "Feature",
|
|
96
96
|
properties: {
|
|
97
97
|
message: "test",
|
|
@@ -103,19 +103,19 @@ function $(e, t) {
|
|
|
103
103
|
coordinates: n.location
|
|
104
104
|
}
|
|
105
105
|
})), r.features.forEach((n) => {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const s = document.createElement("div");
|
|
107
|
+
s.className = "map-marker", s.style.backgroundImage = `url(${n.properties.image})`, s.style.width = `${n.properties.iconSize[0]}px`, s.style.height = `${n.properties.iconSize[1]}px`, new maplibregl.Marker({ element: s }).setLngLat(n.geometry.coordinates).addTo(e);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
function A(e,
|
|
110
|
+
function A(e, o) {
|
|
111
111
|
return new Promise((r) => {
|
|
112
|
-
const n =
|
|
112
|
+
const n = o.map((t) => t.location), s = n.length;
|
|
113
113
|
let i = 0;
|
|
114
|
-
const a = (
|
|
114
|
+
const a = (t) => {
|
|
115
115
|
e.flyTo({
|
|
116
116
|
// These options control the ending camera position: centered at
|
|
117
117
|
// the target, at zoom level 9, and north up.
|
|
118
|
-
center: n[
|
|
118
|
+
center: n[t],
|
|
119
119
|
zoom: 4,
|
|
120
120
|
bearing: 0,
|
|
121
121
|
// These options control the flight curve, making it move
|
|
@@ -127,48 +127,48 @@ function A(e, t) {
|
|
|
127
127
|
// change the speed at which it zooms out
|
|
128
128
|
// This can be any easing function: it takes a number between
|
|
129
129
|
// 0 and 1 and returns another number between 0 and 1.
|
|
130
|
-
easing(
|
|
131
|
-
return
|
|
130
|
+
easing(l) {
|
|
131
|
+
return l;
|
|
132
132
|
},
|
|
133
133
|
// this animation is considered essential with respect to prefers-reduced-motion
|
|
134
134
|
essential: !0
|
|
135
135
|
}, { flyEnd: !0 });
|
|
136
136
|
};
|
|
137
|
-
e.on("moveend", (
|
|
138
|
-
|
|
139
|
-
i <
|
|
137
|
+
e.on("moveend", (t) => {
|
|
138
|
+
t.flyEnd === !0 && b(e, d, n[i]).then(() => {
|
|
139
|
+
i < s - 1 ? (i += 1, a(i)) : r();
|
|
140
140
|
});
|
|
141
141
|
}), a(i);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
const F = (e,
|
|
145
|
-
const n = Math.floor((
|
|
146
|
-
if (n <= 0) return [[e,
|
|
144
|
+
const F = (e, o, r) => {
|
|
145
|
+
const n = Math.floor((o - e) / r), s = [];
|
|
146
|
+
if (n <= 0) return [[e, o]];
|
|
147
147
|
for (let i = 0; i < r; i += 1) {
|
|
148
|
-
let a = e + i * n,
|
|
149
|
-
if (i > 0 && (a += 1 * i,
|
|
148
|
+
let a = e + i * n, t = a + n < o ? a + n : o;
|
|
149
|
+
if (i > 0 && (a += 1 * i, t += 1 * i), i > 0 && t > o && (t = o), i === r - 1 && (t < o || t > o) && (t = o), s.push([a, t]), t >= o) break;
|
|
150
150
|
}
|
|
151
|
-
return
|
|
152
|
-
}, S = (e,
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
return s;
|
|
152
|
+
}, S = (e, o, r, n) => {
|
|
153
|
+
const s = [];
|
|
154
|
+
o.forEach((t) => {
|
|
155
|
+
s.push(t.value);
|
|
156
156
|
});
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
const [
|
|
160
|
-
for (let
|
|
161
|
-
const
|
|
162
|
-
if (e && e >=
|
|
163
|
-
return r.colors.brand[m[
|
|
157
|
+
const i = Math.max(...s), a = F(1, i, 6);
|
|
158
|
+
if (a.length === 1) {
|
|
159
|
+
const [t, l] = a[0];
|
|
160
|
+
for (let c = 0; c < l; c += 1) {
|
|
161
|
+
const f = c + 1;
|
|
162
|
+
if (e && e >= f && e < f + 1)
|
|
163
|
+
return r.colors.brand[m[c]];
|
|
164
164
|
}
|
|
165
165
|
} else
|
|
166
|
-
for (let
|
|
167
|
-
const [
|
|
168
|
-
if (e && e >=
|
|
169
|
-
return r.colors.brand[m[
|
|
166
|
+
for (let t = 0; t < a.length; t += 1) {
|
|
167
|
+
const [l, c] = a[t];
|
|
168
|
+
if (e && e >= l && e <= c)
|
|
169
|
+
return r.colors.brand[m[t]];
|
|
170
170
|
}
|
|
171
|
-
return r.colors.gray[300];
|
|
171
|
+
return n || r.colors.gray[300];
|
|
172
172
|
};
|
|
173
173
|
export {
|
|
174
174
|
A as animationCoordinator,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.loan-card-use[data-v-
|
|
1
|
+
.loan-card-use[data-v-df6cbfd6]:hover,.loan-card-use[data-v-df6cbfd6]: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-df6cbfd6]{text-decoration-line:underline}.loan-card-progress[data-v-df6cbfd6]:hover,.loan-card-progress[data-v-df6cbfd6]:focus{text-decoration-line:none}.loan-card-use-text[data-v-df6cbfd6] 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-df6cbfd6] form,.loan-card-cta[data-v-df6cbfd6] fieldset,.loan-card-cta[data-v-df6cbfd6] .tw-w-full,.loan-card-cta[data-v-df6cbfd6] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-df6cbfd6] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import M from "graphql-tag";
|
|
2
2
|
import V from "numeral";
|
|
3
|
-
import { computed as U, resolveComponent as d, openBlock as n, createElementBlock as i, createElementVNode as
|
|
4
|
-
import { mdiMapMarker as
|
|
5
|
-
import { LOAN_CALLOUTS_FRAGMENT as
|
|
6
|
-
import
|
|
3
|
+
import { computed as U, resolveComponent as d, openBlock as n, createElementBlock as i, createElementVNode as l, createBlock as s, resolveDynamicComponent as f, withCtx as w, createVNode as m, toDisplayString as T, withModifiers as W, createCommentVNode as c, Fragment as C, renderList as I, normalizeClass as B } from "vue";
|
|
4
|
+
import { mdiMapMarker as H, mdiHome as j, mdiLink as q } from "@mdi/js";
|
|
5
|
+
import { LOAN_CALLOUTS_FRAGMENT as Z, LOAN_GEOCODE_FRAGMENT as z, LOAN_PROGRESS_FRAGMENT as J, loanCardComputedProperties as Q, loanCardMethods as X } from "../utils/loanCard.js";
|
|
6
|
+
import Y, { KV_LOAN_USE_FRAGMENT as p } from "./KvLoanUse.js";
|
|
7
7
|
import $ from "./KvBorrowerImage.js";
|
|
8
8
|
import ee from "./KvLoanCallouts.js";
|
|
9
9
|
import te, { KV_LEND_CTA_FRAGMENT as oe, KV_LEND_CTA_USER_FRAGMENT as ae } from "./KvLendCta.js";
|
|
10
|
-
import ne, { KV_LOAN_BOOKMARK_FRAGMENT as
|
|
11
|
-
import
|
|
10
|
+
import ne, { KV_LOAN_BOOKMARK_FRAGMENT as re } from "./KvLoanBookmark.js";
|
|
11
|
+
import le from "./KvLoanProgressGroup.js";
|
|
12
12
|
import ie, { KV_LOAN_TAG_FRAGMENT as se } from "./KvLoanTag.js";
|
|
13
13
|
import de from "./KvMaterialIcon.js";
|
|
14
14
|
import me from "./KvLoadingPlaceholder.js";
|
|
15
|
-
import
|
|
15
|
+
import ue from "./KvLoanTeamPick.js";
|
|
16
16
|
import "./KvCompactLoanCard.css";
|
|
17
|
-
import
|
|
18
|
-
const
|
|
17
|
+
import ce from "../_virtual/_plugin-vue_export-helper.js";
|
|
18
|
+
const qe = M`
|
|
19
19
|
fragment KvCompactLoanCard on LoanBasic {
|
|
20
20
|
id
|
|
21
21
|
image {
|
|
@@ -39,31 +39,31 @@ const je = P`
|
|
|
39
39
|
}
|
|
40
40
|
${oe}
|
|
41
41
|
${se}
|
|
42
|
-
${
|
|
43
|
-
${q}
|
|
42
|
+
${p}
|
|
44
43
|
${Z}
|
|
45
44
|
${z}
|
|
46
|
-
|
|
45
|
+
${J}
|
|
46
|
+
`, Ze = M`
|
|
47
47
|
fragment KvCompactLoanCardUser on LoanBasic {
|
|
48
48
|
id
|
|
49
49
|
...KvLendCtaUser
|
|
50
50
|
...KvLoanBookmark
|
|
51
51
|
}
|
|
52
52
|
${ae}
|
|
53
|
-
${
|
|
53
|
+
${re}
|
|
54
54
|
`, fe = {
|
|
55
55
|
name: "KvCompactLoanCard",
|
|
56
56
|
components: {
|
|
57
57
|
KvBorrowerImage: $,
|
|
58
58
|
KvLoadingPlaceholder: me,
|
|
59
|
-
KvLoanUse:
|
|
59
|
+
KvLoanUse: Y,
|
|
60
60
|
KvMaterialIcon: de,
|
|
61
61
|
KvLendCta: te,
|
|
62
62
|
KvLoanTag: ie,
|
|
63
63
|
KvLoanCallouts: ee,
|
|
64
64
|
KvLoanBookmark: ne,
|
|
65
|
-
KvLoanTeamPick:
|
|
66
|
-
KvLoanProgressGroup:
|
|
65
|
+
KvLoanTeamPick: ue,
|
|
66
|
+
KvLoanProgressGroup: le
|
|
67
67
|
},
|
|
68
68
|
props: {
|
|
69
69
|
loanId: {
|
|
@@ -122,6 +122,10 @@ const je = P`
|
|
|
122
122
|
type: Boolean,
|
|
123
123
|
default: !1
|
|
124
124
|
},
|
|
125
|
+
externalLinksNewTab: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: !1
|
|
128
|
+
},
|
|
125
129
|
route: {
|
|
126
130
|
type: Object,
|
|
127
131
|
default: void 0
|
|
@@ -183,58 +187,58 @@ const je = P`
|
|
|
183
187
|
default: !0
|
|
184
188
|
}
|
|
185
189
|
},
|
|
186
|
-
setup(
|
|
190
|
+
setup(r, { emit: o }) {
|
|
187
191
|
const {
|
|
188
192
|
allDataLoaded: t,
|
|
189
193
|
borrowerName: e,
|
|
190
|
-
city:
|
|
191
|
-
countryName:
|
|
192
|
-
distributionModel:
|
|
194
|
+
city: N,
|
|
195
|
+
countryName: A,
|
|
196
|
+
distributionModel: h,
|
|
193
197
|
formattedLocation: g,
|
|
194
|
-
fundraisingPercent:
|
|
195
|
-
hasProgressData:
|
|
198
|
+
fundraisingPercent: b,
|
|
199
|
+
hasProgressData: u,
|
|
196
200
|
imageHash: _,
|
|
197
|
-
isLoading:
|
|
198
|
-
loanAmount:
|
|
201
|
+
isLoading: v,
|
|
202
|
+
loanAmount: y,
|
|
199
203
|
loanBorrowerCount: L,
|
|
200
204
|
loanCallouts: a,
|
|
201
|
-
loanStatus:
|
|
202
|
-
loanUse:
|
|
205
|
+
loanStatus: x,
|
|
206
|
+
loanUse: P,
|
|
203
207
|
readMorePath: K,
|
|
204
208
|
state: R,
|
|
205
209
|
tag: F,
|
|
206
210
|
unreservedAmount: E,
|
|
207
211
|
sharesAvailable: S
|
|
208
|
-
} =
|
|
212
|
+
} = Q(r), {
|
|
209
213
|
clickReadMore: D
|
|
210
|
-
} =
|
|
211
|
-
|
|
214
|
+
} = X(r, o), O = () => {
|
|
215
|
+
r.kvTrackFunction("Lending", "click-Business Website", "Website", r.loanId);
|
|
212
216
|
}, G = U(() => {
|
|
213
|
-
if (!
|
|
217
|
+
if (!r.website)
|
|
214
218
|
return "";
|
|
215
|
-
const
|
|
216
|
-
return
|
|
219
|
+
const k = r.website.trim();
|
|
220
|
+
return k.startsWith("http://") || k.startsWith("https://") ? k : `https://${k}`;
|
|
217
221
|
});
|
|
218
222
|
return {
|
|
219
223
|
allDataLoaded: t,
|
|
220
224
|
borrowerName: e,
|
|
221
|
-
city:
|
|
222
|
-
countryName:
|
|
223
|
-
distributionModel:
|
|
225
|
+
city: N,
|
|
226
|
+
countryName: A,
|
|
227
|
+
distributionModel: h,
|
|
224
228
|
formattedLocation: g,
|
|
225
229
|
formattedWebsite: G,
|
|
226
|
-
fundraisingPercent:
|
|
227
|
-
hasProgressData:
|
|
230
|
+
fundraisingPercent: b,
|
|
231
|
+
hasProgressData: u,
|
|
228
232
|
imageHash: _,
|
|
229
|
-
isLoading:
|
|
230
|
-
loanAmount:
|
|
233
|
+
isLoading: v,
|
|
234
|
+
loanAmount: y,
|
|
231
235
|
loanBorrowerCount: L,
|
|
232
236
|
loanCallouts: a,
|
|
233
|
-
loanStatus:
|
|
234
|
-
loanUse:
|
|
235
|
-
mdiMapMarker:
|
|
236
|
-
mdiHome:
|
|
237
|
-
mdiLink:
|
|
237
|
+
loanStatus: x,
|
|
238
|
+
loanUse: P,
|
|
239
|
+
mdiMapMarker: H,
|
|
240
|
+
mdiHome: j,
|
|
241
|
+
mdiLink: q,
|
|
238
242
|
readMorePath: K,
|
|
239
243
|
state: R,
|
|
240
244
|
tag: F,
|
|
@@ -246,43 +250,45 @@ const je = P`
|
|
|
246
250
|
},
|
|
247
251
|
computed: {
|
|
248
252
|
lendersNumber() {
|
|
249
|
-
var
|
|
250
|
-
return ((o = (
|
|
253
|
+
var r, o;
|
|
254
|
+
return ((o = (r = this.loan) == null ? void 0 : r.lenders) == null ? void 0 : o.totalCount) ?? 0;
|
|
251
255
|
},
|
|
252
256
|
amountLent() {
|
|
253
257
|
var o, t;
|
|
254
|
-
const
|
|
255
|
-
return V(
|
|
258
|
+
const r = ((t = (o = this.loan) == null ? void 0 : o.loanFundraisingInfo) == null ? void 0 : t.fundedAmount) ?? 0;
|
|
259
|
+
return V(r).format("$0,0");
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
|
-
}, we = { class: "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" },
|
|
262
|
+
}, we = { class: "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" }, ke = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, he = {
|
|
259
263
|
class: "tw-flex tw-items-start tw-gap-2 tw-w-full loan-card-active-hover",
|
|
260
264
|
style: { height: "6.75rem", "max-height": "6.75rem" }
|
|
261
|
-
}, ge = { class: "tw-flex-shrink-0 tw-overflow-hidden" },
|
|
265
|
+
}, ge = { class: "tw-flex-shrink-0 tw-overflow-hidden" }, be = { class: "tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0" }, _e = {
|
|
262
266
|
key: 0,
|
|
263
267
|
class: "tw-mb-0.5 tw-w-full"
|
|
264
|
-
},
|
|
268
|
+
}, ve = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, ye = ["href"], Le = { class: "tw-truncate" }, xe = {
|
|
265
269
|
key: 0,
|
|
266
270
|
class: "loan-card-use-text tw-w-full tw-overflow-hidden"
|
|
267
|
-
},
|
|
271
|
+
}, Ce = {
|
|
268
272
|
key: 1,
|
|
269
273
|
class: "loan-card-use-text tw-w-full tw-overflow-hidden"
|
|
270
|
-
},
|
|
271
|
-
function
|
|
272
|
-
const
|
|
274
|
+
}, Ne = { class: "tw-flex-1 tw-min-w-0 tw-mr-1" }, Ae = { class: "tw-flex-1 tw-min-w-0" };
|
|
275
|
+
function Te(r, o, t, e, N, A) {
|
|
276
|
+
const h = d("kv-borrower-image"), g = d("kv-material-icon"), b = d("kv-loan-tag"), u = d("kv-loading-placeholder"), _ = d("kv-loan-use"), v = d("kv-loan-callouts"), y = d("kv-loan-progress-group"), L = d("kv-lend-cta");
|
|
273
277
|
return n(), i("div", we, [
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
l("div", ke, [
|
|
279
|
+
l("div", he, [
|
|
280
|
+
l("div", ge, [
|
|
277
281
|
(n(), s(f(e.tag), {
|
|
278
282
|
to: e.readMorePath,
|
|
279
283
|
href: e.readMorePath,
|
|
284
|
+
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
285
|
+
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
280
286
|
class: "tw-flex",
|
|
281
287
|
"aria-label": "Borrower image",
|
|
282
288
|
onClick: o[0] || (o[0] = (a) => e.clickReadMore("Photo", a))
|
|
283
289
|
}, {
|
|
284
290
|
default: w(() => [
|
|
285
|
-
m(
|
|
291
|
+
m(h, {
|
|
286
292
|
class: "tw-bg-gray-300 tw-rounded-md tw-object-cover",
|
|
287
293
|
style: { width: "100px", height: "100px" },
|
|
288
294
|
alt: `Photo of ${e.borrowerName}`,
|
|
@@ -294,68 +300,74 @@ function Me(l, o, t, e, A, B) {
|
|
|
294
300
|
}, null, 8, ["alt", "hash", "photo-path"])
|
|
295
301
|
]),
|
|
296
302
|
_: 1
|
|
297
|
-
}, 8, ["to", "href"]))
|
|
303
|
+
}, 8, ["to", "href", "target", "rel"]))
|
|
298
304
|
]),
|
|
299
|
-
|
|
305
|
+
l("div", be, [
|
|
300
306
|
t.businessName ? (n(), i("div", _e, [
|
|
301
307
|
(n(), s(f(e.tag), {
|
|
302
308
|
to: e.readMorePath,
|
|
303
309
|
href: e.readMorePath,
|
|
310
|
+
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
311
|
+
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
304
312
|
class: "tw-no-underline hover:tw-underline focus:tw-no-underline",
|
|
305
313
|
"aria-label": "Business name",
|
|
306
314
|
onClick: o[1] || (o[1] = (a) => e.clickReadMore("Business", a))
|
|
307
315
|
}, {
|
|
308
316
|
default: w(() => [
|
|
309
|
-
|
|
317
|
+
l("h3", ve, T(t.businessName), 1)
|
|
310
318
|
]),
|
|
311
319
|
_: 1
|
|
312
|
-
}, 8, ["to", "href"])),
|
|
320
|
+
}, 8, ["to", "href", "target", "rel"])),
|
|
313
321
|
t.website ? (n(), i("a", {
|
|
314
322
|
key: 0,
|
|
315
323
|
href: e.formattedWebsite,
|
|
316
324
|
target: "_blank",
|
|
317
325
|
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",
|
|
318
|
-
onClick: o[2] || (o[2] =
|
|
326
|
+
onClick: o[2] || (o[2] = W((...a) => e.trackWebsiteClick && e.trackWebsiteClick(...a), ["stop"]))
|
|
319
327
|
}, [
|
|
320
328
|
m(g, {
|
|
321
329
|
icon: e.mdiLink,
|
|
322
330
|
class: "tw-w-2 tw-h-2"
|
|
323
331
|
}, null, 8, ["icon"]),
|
|
324
|
-
|
|
325
|
-
], 8,
|
|
326
|
-
])) :
|
|
332
|
+
l("span", Le, T(t.website), 1)
|
|
333
|
+
], 8, ye)) : c("", !0)
|
|
334
|
+
])) : c("", !0),
|
|
327
335
|
(n(), s(f(e.tag), {
|
|
328
336
|
to: e.readMorePath,
|
|
329
337
|
href: e.readMorePath,
|
|
338
|
+
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
339
|
+
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
330
340
|
class: "tw-flex tw-no-underline hover:tw-no-underline focus:tw-no-underline -tw-mt-1",
|
|
331
341
|
"aria-label": "Loan tag",
|
|
332
342
|
onClick: o[3] || (o[3] = (a) => e.clickReadMore("Tag", a))
|
|
333
343
|
}, {
|
|
334
344
|
default: w(() => [
|
|
335
|
-
t.showTags && !e.isLoading ? (n(), s(
|
|
345
|
+
t.showTags && !e.isLoading ? (n(), s(b, {
|
|
336
346
|
key: 0,
|
|
337
347
|
loan: t.loan
|
|
338
|
-
}, null, 8, ["loan"])) :
|
|
348
|
+
}, null, 8, ["loan"])) : c("", !0)
|
|
339
349
|
]),
|
|
340
350
|
_: 1
|
|
341
|
-
}, 8, ["to", "href"])),
|
|
351
|
+
}, 8, ["to", "href", "target", "rel"])),
|
|
342
352
|
t.showLoanUse ? (n(), s(f(e.tag), {
|
|
343
353
|
key: 1,
|
|
344
354
|
to: e.readMorePath,
|
|
345
355
|
href: e.readMorePath,
|
|
356
|
+
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
357
|
+
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
346
358
|
class: "loan-card-use tw-no-underline tw-text-primary tw-block tw-w-full",
|
|
347
359
|
"aria-label": "Loan use",
|
|
348
360
|
onClick: o[4] || (o[4] = (a) => e.clickReadMore("Use", a))
|
|
349
361
|
}, {
|
|
350
362
|
default: w(() => [
|
|
351
|
-
e.isLoading ? (n(), i("div",
|
|
352
|
-
(n(!0), i(
|
|
353
|
-
key:
|
|
363
|
+
e.isLoading ? (n(), i("div", xe, [
|
|
364
|
+
(n(!0), i(C, null, I([...Array(4)], (a, x) => (n(), i("div", {
|
|
365
|
+
key: x,
|
|
354
366
|
class: "tw-h-2 tw-mb-1"
|
|
355
367
|
}, [
|
|
356
|
-
m(
|
|
368
|
+
m(u)
|
|
357
369
|
]))), 128))
|
|
358
|
-
])) : (n(), i("div",
|
|
370
|
+
])) : (n(), i("div", Ce, [
|
|
359
371
|
m(_, {
|
|
360
372
|
use: e.loanUse,
|
|
361
373
|
"loan-amount": e.loanAmount,
|
|
@@ -370,35 +382,37 @@ function Me(l, o, t, e, A, B) {
|
|
|
370
382
|
]))
|
|
371
383
|
]),
|
|
372
384
|
_: 1
|
|
373
|
-
}, 8, ["to", "href"])) :
|
|
385
|
+
}, 8, ["to", "href", "target", "rel"])) : c("", !0)
|
|
374
386
|
])
|
|
375
387
|
]),
|
|
376
|
-
e.isLoading || typeof e.loanCallouts > "u" ? (n(), s(
|
|
388
|
+
e.isLoading || typeof e.loanCallouts > "u" ? (n(), s(u, {
|
|
377
389
|
key: 0,
|
|
378
390
|
class: "tw-mt-1.5 tw-mb-1 tw-rounded-full",
|
|
379
391
|
style: { width: "60%", height: "1.5rem" }
|
|
380
|
-
})) : (n(), s(
|
|
392
|
+
})) : (n(), s(v, {
|
|
381
393
|
key: 1,
|
|
382
394
|
callouts: e.loanCallouts,
|
|
383
395
|
class: "tw-mt-1.5",
|
|
384
|
-
onClick: o[5] || (o[5] = (a) =>
|
|
396
|
+
onClick: o[5] || (o[5] = (a) => r.$emit("jump-filter-page", a))
|
|
385
397
|
}, null, 8, ["callouts"]))
|
|
386
398
|
]),
|
|
387
|
-
|
|
388
|
-
class:
|
|
399
|
+
l("div", {
|
|
400
|
+
class: B(["tw-flex tw-items-end tw-w-full tw-mt-1", { "tw-gap-1": e.sharesAvailable }])
|
|
389
401
|
}, [
|
|
390
|
-
e.hasProgressData ? (n(), i(
|
|
391
|
-
|
|
402
|
+
e.hasProgressData ? (n(), i(C, { key: 1 }, [
|
|
403
|
+
l("div", Ae, [
|
|
392
404
|
e.sharesAvailable ? (n(), s(f(e.tag), {
|
|
393
405
|
key: 0,
|
|
394
406
|
to: e.readMorePath,
|
|
395
407
|
href: e.readMorePath,
|
|
408
|
+
target: t.externalLinksNewTab ? "_blank" : void 0,
|
|
409
|
+
rel: t.externalLinksNewTab ? "noopener noreferrer" : void 0,
|
|
396
410
|
class: "loan-card-progress tw-no-underline tw-block",
|
|
397
411
|
"aria-label": "Loan progress",
|
|
398
412
|
onClick: o[6] || (o[6] = (a) => e.clickReadMore("Progress", a))
|
|
399
413
|
}, {
|
|
400
414
|
default: w(() => [
|
|
401
|
-
m(
|
|
415
|
+
m(y, {
|
|
402
416
|
id: "loanProgress",
|
|
403
417
|
"money-left": e.unreservedAmount,
|
|
404
418
|
"progress-percent": e.fundraisingPercent,
|
|
@@ -406,10 +420,10 @@ function Me(l, o, t, e, A, B) {
|
|
|
406
420
|
}, null, 8, ["money-left", "progress-percent"])
|
|
407
421
|
]),
|
|
408
422
|
_: 1
|
|
409
|
-
}, 8, ["to", "href"])) :
|
|
423
|
+
}, 8, ["to", "href", "target", "rel"])) : c("", !0)
|
|
410
424
|
]),
|
|
411
|
-
|
|
412
|
-
class:
|
|
425
|
+
l("div", {
|
|
426
|
+
class: B(["tw-flex-shrink-0 loan-card-cta", { "tw-w-full": !e.sharesAvailable }]),
|
|
413
427
|
style: { height: "40px" }
|
|
414
428
|
}, [
|
|
415
429
|
m(L, {
|
|
@@ -432,23 +446,23 @@ function Me(l, o, t, e, A, B) {
|
|
|
432
446
|
"primary-button-text": t.primaryButtonText,
|
|
433
447
|
"secondary-button-text": t.secondaryButtonText,
|
|
434
448
|
"secondary-button-handler": t.secondaryButtonHandler,
|
|
435
|
-
onAddToBasket: o[7] || (o[7] = (a) =>
|
|
449
|
+
onAddToBasket: o[7] || (o[7] = (a) => r.$emit("add-to-basket", a)),
|
|
436
450
|
onShowLoanDetails: o[8] || (o[8] = (a) => e.clickReadMore("ViewLoan", a)),
|
|
437
|
-
onRemoveFromBasket: o[9] || (o[9] = (a) =>
|
|
451
|
+
onRemoveFromBasket: o[9] || (o[9] = (a) => r.$emit("remove-from-basket", a))
|
|
438
452
|
}, 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"])
|
|
439
453
|
], 2)
|
|
440
|
-
], 64)) : (n(), i(
|
|
441
|
-
|
|
442
|
-
m(
|
|
454
|
+
], 64)) : (n(), i(C, { key: 0 }, [
|
|
455
|
+
l("div", Ne, [
|
|
456
|
+
m(u, {
|
|
443
457
|
class: "tw-mb-0.5",
|
|
444
458
|
style: { width: "100%", maxWidth: "11rem", height: "1rem" }
|
|
445
459
|
}),
|
|
446
|
-
m(
|
|
460
|
+
m(u, {
|
|
447
461
|
class: "tw-rounded",
|
|
448
462
|
style: { width: "100%", maxWidth: "11rem", height: "0.5rem" }
|
|
449
463
|
})
|
|
450
464
|
]),
|
|
451
|
-
e.allDataLoaded ?
|
|
465
|
+
e.allDataLoaded ? c("", !0) : (n(), s(u, {
|
|
452
466
|
key: 0,
|
|
453
467
|
class: "tw-rounded tw-flex-shrink-0",
|
|
454
468
|
style: { width: "8rem", height: "2.5rem" }
|
|
@@ -457,9 +471,9 @@ function Me(l, o, t, e, A, B) {
|
|
|
457
471
|
], 2)
|
|
458
472
|
]);
|
|
459
473
|
}
|
|
460
|
-
const
|
|
474
|
+
const ze = /* @__PURE__ */ ce(fe, [["render", Te], ["__scopeId", "data-v-df6cbfd6"]]);
|
|
461
475
|
export {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
476
|
+
qe as KV_COMPACT_LOAN_CARD_FRAGMENT,
|
|
477
|
+
Ze as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
|
|
478
|
+
ze as default
|
|
465
479
|
};
|
package/dist/vue/KvMap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import n from "@kiva/kv-tokens";
|
|
2
2
|
import { generateMapMarkers as l, animationCoordinator as h, getCountryColor as r } from "../utils/mapUtils.js";
|
|
3
|
-
import { openBlock as c, createElementBlock as
|
|
3
|
+
import { openBlock as c, createElementBlock as d, normalizeStyle as m, createElementVNode as p } from "vue";
|
|
4
4
|
import "./KvMap.css";
|
|
5
5
|
import u from "../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const f = {
|
|
@@ -140,6 +140,21 @@ const f = {
|
|
|
140
140
|
showFundraisingLoans: {
|
|
141
141
|
type: Boolean,
|
|
142
142
|
default: !1
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Show tooltips on fundraising loan circles
|
|
146
|
+
* Working for leaflet only
|
|
147
|
+
*/
|
|
148
|
+
showTooltips: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
default: !0
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Default base color for countries without loans
|
|
154
|
+
*/
|
|
155
|
+
defaultBaseColor: {
|
|
156
|
+
type: String,
|
|
157
|
+
default: null
|
|
143
158
|
}
|
|
144
159
|
},
|
|
145
160
|
data() {
|
|
@@ -323,12 +338,14 @@ const f = {
|
|
|
323
338
|
countryStyle(e) {
|
|
324
339
|
return {
|
|
325
340
|
color: n.colors.white,
|
|
326
|
-
|
|
341
|
+
// eslint-disable-next-line max-len
|
|
342
|
+
fillColor: r(e.lenderLoans, this.countriesData, n, this.defaultBaseColor),
|
|
327
343
|
weight: 1,
|
|
328
344
|
fillOpacity: 1
|
|
329
345
|
};
|
|
330
346
|
},
|
|
331
347
|
onEachCountryFeature(e, t) {
|
|
348
|
+
if (!this.showTooltips) return;
|
|
332
349
|
const i = e.lenderLoans ? `${e.lenderLoans} loan${e.lenderLoans > 1 ? "s" : ""}` : "0 loans", a = `${e.properties.name} <br/> ${i}`;
|
|
333
350
|
t.bindTooltip(a, {
|
|
334
351
|
sticky: !0
|
|
@@ -345,7 +362,8 @@ const f = {
|
|
|
345
362
|
resetHighlight(e) {
|
|
346
363
|
const t = e.target, { feature: i } = t;
|
|
347
364
|
t.setStyle({
|
|
348
|
-
|
|
365
|
+
// eslint-disable-next-line max-len
|
|
366
|
+
fillColor: r(i.lenderLoans, this.countriesData, n, this.defaultBaseColor)
|
|
349
367
|
});
|
|
350
368
|
},
|
|
351
369
|
circleMapClicked(e) {
|
|
@@ -354,9 +372,9 @@ const f = {
|
|
|
354
372
|
}
|
|
355
373
|
}, b = ["id"];
|
|
356
374
|
function g(e, t, i, a, s, o) {
|
|
357
|
-
return c(),
|
|
375
|
+
return c(), d("div", {
|
|
358
376
|
class: "tw-relative tw-block tw-w-full",
|
|
359
|
-
style:
|
|
377
|
+
style: m(o.mapDimensions)
|
|
360
378
|
}, [
|
|
361
379
|
p("div", {
|
|
362
380
|
id: `kv-map-holder-${i.mapId}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
"./vue/*": "./dist/vue/*.js",
|
|
15
15
|
"./vue/*.js": "./dist/vue/*.js"
|
|
16
16
|
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/kiva/kv-ui-elements.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/kiva/kv-ui-elements/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/kiva/kv-ui-elements/tree/main/%40kiva/kv-components#readme",
|
|
17
25
|
"devDependencies": {
|
|
18
26
|
"@apollo/client": "^3.13.1",
|
|
19
27
|
"@babel/core": "^7.14.8",
|
|
@@ -21,7 +29,7 @@
|
|
|
21
29
|
"@babel/preset-env": "^7.24.8",
|
|
22
30
|
"@babel/preset-react": "^7.24.7",
|
|
23
31
|
"@babel/preset-typescript": "^7.24.7",
|
|
24
|
-
"@kiva/kv-tokens": "^3.6.
|
|
32
|
+
"@kiva/kv-tokens": "^3.6.1",
|
|
25
33
|
"@kiva/vite-plugin-vue-lib-css": "^2.0.0",
|
|
26
34
|
"@laynezh/vite-plugin-lib-assets": "^0.6.1",
|
|
27
35
|
"@mdi/js": "^7.4.47",
|
|
@@ -115,5 +123,5 @@
|
|
|
115
123
|
"embla-carousel-fade",
|
|
116
124
|
"popper.js"
|
|
117
125
|
],
|
|
118
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "f68de2ef6e9d2b237b7779a5cb0971a29c845e4a"
|
|
119
127
|
}
|