@kiva/kv-components 7.6.0 → 7.6.3
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/KvContentfulImg.js +88 -77
- 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,6 +1,6 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { toRefs as v, computed as y, openBlock as a, createElementBlock as r, createElementVNode as c, Fragment as m, renderList as _, createCommentVNode as o, normalizeStyle as S, createTextVNode as q, toDisplayString as Q } from "vue";
|
|
2
|
+
import U from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const F = {
|
|
4
4
|
props: {
|
|
5
5
|
/**
|
|
6
6
|
* Large, uncompressed image url that you get back from contentful.
|
|
@@ -16,8 +16,8 @@ const Q = {
|
|
|
16
16
|
fallbackFormat: {
|
|
17
17
|
type: String,
|
|
18
18
|
default: "jpg",
|
|
19
|
-
validator(
|
|
20
|
-
return ["jpg", "png", "gif"].indexOf(
|
|
19
|
+
validator(n) {
|
|
20
|
+
return ["jpg", "png", "gif"].indexOf(n) !== -1;
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
/**
|
|
@@ -48,8 +48,8 @@ const Q = {
|
|
|
48
48
|
loading: {
|
|
49
49
|
type: String,
|
|
50
50
|
default: null,
|
|
51
|
-
validator(
|
|
52
|
-
return ["lazy", "eager"].indexOf(
|
|
51
|
+
validator(n) {
|
|
52
|
+
return ["lazy", "eager"].indexOf(n) !== -1;
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
/**
|
|
@@ -59,8 +59,8 @@ const Q = {
|
|
|
59
59
|
focus: {
|
|
60
60
|
type: String,
|
|
61
61
|
default: "center",
|
|
62
|
-
validator(
|
|
63
|
-
return ["center", "top", "right", "left", "bottom", "top_right", "top_left", "bottom_right", "bottom_left", "face", "faces"].indexOf(
|
|
62
|
+
validator(n) {
|
|
63
|
+
return ["center", "top", "right", "left", "bottom", "top_right", "top_left", "bottom_right", "bottom_left", "face", "faces"].indexOf(n) !== -1;
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
/**
|
|
@@ -70,8 +70,8 @@ const Q = {
|
|
|
70
70
|
fit: {
|
|
71
71
|
type: String,
|
|
72
72
|
default: "fill",
|
|
73
|
-
validator(
|
|
74
|
-
return ["pad", "fill", "scale", "crop", "thumb"].indexOf(
|
|
73
|
+
validator(n) {
|
|
74
|
+
return ["pad", "fill", "scale", "crop", "thumb"].indexOf(n) !== -1;
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
/**
|
|
@@ -91,106 +91,117 @@ const Q = {
|
|
|
91
91
|
default: () => []
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
setup(
|
|
94
|
+
setup(n) {
|
|
95
95
|
const {
|
|
96
|
-
alt:
|
|
96
|
+
alt: f,
|
|
97
97
|
contentfulSrc: t,
|
|
98
|
-
width:
|
|
99
|
-
height:
|
|
100
|
-
} =
|
|
101
|
-
let
|
|
102
|
-
return
|
|
103
|
-
},
|
|
98
|
+
width: e,
|
|
99
|
+
height: b
|
|
100
|
+
} = v(n), x = (l = null, w = 1) => {
|
|
101
|
+
let s = l && l.url ? `${l.url}?` : `${t.value}?`, h = l ? l.width : e.value, u = l ? l.height : b.value, g;
|
|
102
|
+
return h >= 2e3 && (g = h / 1999, h = 1999, u = Math.round(u / g)), u >= 2e3 && (g = u / 1999, u = 1999, h = Math.round(h / g)), h && (s += `w=${h * w}`), h && u && (s += "&"), u && (s += `h=${u * w}`), s;
|
|
103
|
+
}, i = (l, w) => w === "2x" ? 65 : l && parseInt(l, 10) < 200 ? 95 : 80, d = y(() => {
|
|
104
|
+
if (f.value && f.value.charAt(0) === "^") {
|
|
105
|
+
const l = f.value.charAt(1) === "#" ? 2 : 1;
|
|
106
|
+
return f.value.slice(l).trim();
|
|
107
|
+
}
|
|
108
|
+
return "";
|
|
109
|
+
}), k = y(() => !!(f.value && f.value.charAt(1) === "#"));
|
|
104
110
|
return {
|
|
105
|
-
buildUrl:
|
|
111
|
+
buildUrl: x,
|
|
106
112
|
caption: d,
|
|
107
|
-
|
|
113
|
+
removeLeafIcon: k,
|
|
114
|
+
setQuality: i
|
|
108
115
|
};
|
|
109
116
|
}
|
|
110
|
-
},
|
|
117
|
+
}, z = {
|
|
111
118
|
key: 0,
|
|
112
119
|
class: "tw-inline-block tw-not-prose"
|
|
113
|
-
},
|
|
120
|
+
}, j = {
|
|
114
121
|
class: "tw-h-full tw-w-full",
|
|
115
122
|
style: { "object-fit": "inherit" }
|
|
116
|
-
},
|
|
123
|
+
}, C = ["media", "width", "height", "srcset"], I = ["media", "width", "height", "srcset"], L = ["src", "alt", "loading"], N = ["srcset"], A = ["srcset", "src", "width", "height", "alt", "loading"], M = {
|
|
117
124
|
key: 0,
|
|
118
|
-
class: "tw-
|
|
125
|
+
class: "tw-inline-block tw-mr-0.5 tw-align-middle",
|
|
126
|
+
"aria-hidden": "true",
|
|
127
|
+
role: "img"
|
|
119
128
|
};
|
|
120
|
-
function
|
|
121
|
-
return (t.width || t.height) && t.contentfulSrc ? (
|
|
122
|
-
|
|
123
|
-
t.sourceSizes.length > 0 ? (
|
|
124
|
-
(
|
|
129
|
+
function O(n, f, t, e, b, x) {
|
|
130
|
+
return (t.width || t.height) && t.contentfulSrc ? (a(), r("figure", z, [
|
|
131
|
+
c("picture", j, [
|
|
132
|
+
t.sourceSizes.length > 0 ? (a(), r(m, { key: 0 }, [
|
|
133
|
+
(a(!0), r(m, null, _(t.sourceSizes, (i, d) => (a(), r("source", {
|
|
125
134
|
key: "webp-image" + d,
|
|
126
|
-
media: "(" +
|
|
135
|
+
media: "(" + i.media + ")",
|
|
127
136
|
type: "image/webp",
|
|
128
|
-
width:
|
|
129
|
-
height:
|
|
137
|
+
width: i.width ? i.width : null,
|
|
138
|
+
height: i.height ? i.height : null,
|
|
130
139
|
srcset: `
|
|
131
|
-
${
|
|
132
|
-
${
|
|
133
|
-
}, null, 8,
|
|
134
|
-
(
|
|
140
|
+
${e.buildUrl(i, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${e.setQuality(i.width, "2x")} 2x,
|
|
141
|
+
${e.buildUrl(i)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${e.setQuality(i.width, "1x")} 1x`
|
|
142
|
+
}, null, 8, C))), 128)),
|
|
143
|
+
(a(!0), r(m, null, _(t.sourceSizes, (i, d) => (a(), r("source", {
|
|
135
144
|
key: "fallback-image" + d,
|
|
136
|
-
media: "(" +
|
|
137
|
-
width:
|
|
138
|
-
height:
|
|
145
|
+
media: "(" + i.media + ")",
|
|
146
|
+
width: i.width ? i.width : null,
|
|
147
|
+
height: i.height ? i.height : null,
|
|
139
148
|
srcset: `
|
|
140
|
-
${
|
|
141
|
-
${
|
|
142
|
-
}, null, 8,
|
|
143
|
-
|
|
149
|
+
${e.buildUrl(i, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(i.width, "2x")} 2x,
|
|
150
|
+
${e.buildUrl(i)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(i.width, "1x")} 1x`
|
|
151
|
+
}, null, 8, I))), 128)),
|
|
152
|
+
c("img", {
|
|
144
153
|
class: "tw-max-w-full tw-max-h-full",
|
|
145
154
|
style: { width: "inherit", height: "inherit", "object-fit": "inherit" },
|
|
146
|
-
src: `${
|
|
147
|
-
alt:
|
|
155
|
+
src: `${e.buildUrl(t.width, t.height)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(t.width, "1x")}`,
|
|
156
|
+
alt: e.caption || t.alt,
|
|
148
157
|
loading: t.loading
|
|
149
|
-
}, null, 8,
|
|
150
|
-
], 64)) :
|
|
151
|
-
t.sourceSizes.length === 0 ? (
|
|
152
|
-
|
|
158
|
+
}, null, 8, L)
|
|
159
|
+
], 64)) : o("", !0),
|
|
160
|
+
t.sourceSizes.length === 0 ? (a(), r(m, { key: 1 }, [
|
|
161
|
+
c("source", {
|
|
153
162
|
type: "image/webp",
|
|
154
163
|
srcset: `
|
|
155
|
-
${
|
|
156
|
-
${
|
|
157
|
-
}, null, 8,
|
|
158
|
-
|
|
164
|
+
${e.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${e.setQuality(t.width, "2x")} 2x,
|
|
165
|
+
${e.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${e.setQuality(t.width, "1x")} 1x`
|
|
166
|
+
}, null, 8, N),
|
|
167
|
+
c("img", {
|
|
159
168
|
class: "tw-max-w-full tw-max-h-full",
|
|
160
169
|
style: { width: "inherit", height: "inherit", "object-fit": "inherit" },
|
|
161
170
|
srcset: `
|
|
162
|
-
${
|
|
163
|
-
${
|
|
164
|
-
src: `${
|
|
171
|
+
${e.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(t.width, "2x")} 2x,
|
|
172
|
+
${e.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(t.width, "1x")} 1x`,
|
|
173
|
+
src: `${e.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${e.setQuality(t.width, "1x")}`,
|
|
165
174
|
width: t.width ? t.width : null,
|
|
166
175
|
height: t.height ? t.height : null,
|
|
167
|
-
alt:
|
|
176
|
+
alt: e.caption || t.alt,
|
|
168
177
|
loading: t.loading
|
|
169
|
-
}, null, 8,
|
|
170
|
-
], 64)) :
|
|
178
|
+
}, null, 8, A)
|
|
179
|
+
], 64)) : o("", !0)
|
|
171
180
|
]),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
e.caption ? (a(), r("figcaption", {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: "tw-italic tw-my-1.5 tw-break-words tw-max-w-full tw-font-book tw-text-action-highlight",
|
|
184
|
+
style: S({ maxWidth: t.width ? `${t.width}px` : void 0 })
|
|
185
|
+
}, [
|
|
186
|
+
e.removeLeafIcon ? o("", !0) : (a(), r("span", M, f[0] || (f[0] = [
|
|
187
|
+
c("svg", {
|
|
188
|
+
width: "16",
|
|
189
|
+
height: "12",
|
|
190
|
+
viewBox: "0 0 16 12",
|
|
191
|
+
fill: "none",
|
|
181
192
|
xmlns: "http://www.w3.org/2000/svg"
|
|
182
193
|
}, [
|
|
183
|
-
|
|
184
|
-
d: "
|
|
194
|
+
c("path", {
|
|
195
|
+
d: "M1.04689 11.2079C13.06 11.2079 15.8778 1.63084 15.8778 -1.6347e-07L14.831 -1.52692e-07C2.82661 -2.91013e-08 9.85148e-08 9.56873 1.15391e-07 11.2079L1.04689 11.2079Z",
|
|
185
196
|
fill: "currentColor"
|
|
186
197
|
})
|
|
187
|
-
])
|
|
188
|
-
]
|
|
189
|
-
|
|
190
|
-
])) :
|
|
191
|
-
])) :
|
|
198
|
+
], -1)
|
|
199
|
+
]))),
|
|
200
|
+
q(" " + Q(e.caption), 1)
|
|
201
|
+
], 4)) : o("", !0)
|
|
202
|
+
])) : o("", !0);
|
|
192
203
|
}
|
|
193
|
-
const E = /* @__PURE__ */
|
|
204
|
+
const E = /* @__PURE__ */ U(F, [["render", O]]);
|
|
194
205
|
export {
|
|
195
206
|
E as default
|
|
196
207
|
};
|
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.6.
|
|
3
|
+
"version": "7.6.3",
|
|
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.2",
|
|
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": "139510f7b600b98f4f9655cf911ac08212952881"
|
|
119
127
|
}
|