@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.
@@ -1,5 +1,5 @@
1
- function p(e, t, r) {
2
- return (Math.random() * (t - e) + e).toFixed(r) * 1;
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, t, r) {
16
- if (!e || !t || !r || r < 1 || !Array.isArray(e) || !Array.isArray(t) || e.length !== 2 || t.length !== 2)
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 = t[0] - e[0], l = t[1] - e[1], i = n / r, a = l / r;
19
- let o = 0, s = 0;
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(o) < Math.abs(n) || Math.abs(s) < Math.abs(l); )
22
- c.push([e[0] + o, e[1] + s]), Math.abs(o) < Math.abs(n) && (o += i), Math.abs(s) < Math.abs(l) && (s += a);
23
- return c[c.length - 1] = [t[0], t[1]], c;
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, t, r) {
26
- return new Promise((l) => {
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, o, s, c = !1) => {
38
- const y = M(a, o, 100);
39
- let g = 0;
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${s}`, {
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${s}`,
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 h = () => {
76
- if (g < y.length)
77
- u.features[0].geometry.coordinates.push(y[g]), e.getSource(`line-animation${s}`).setData(u), requestAnimationFrame(h), g += 1;
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 f = u.features[0].geometry.coordinates;
80
- f.shift(), f.shift(), f.length > 0 ? (u.features[0].geometry.coordinates = f, e.getSource(`line-animation${s}`).setData(u), requestAnimationFrame(h)) : (e.removeLayer(`line-animation${s}`), e.removeSource(`line-animation${s}`), e.removeSource(`startPoint${s}`), c && (e.removeSource("endpoint"), l()));
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
- h();
83
+ y();
84
84
  };
85
- t.forEach((a, o) => {
86
- i(a, r, o, o === t.length - 1);
85
+ o.forEach((a, t) => {
86
+ i(a, r, t, t === o.length - 1);
87
87
  });
88
88
  });
89
89
  }
90
- function $(e, t) {
90
+ function $(e, o) {
91
91
  const r = {
92
92
  type: "FeatureCollection"
93
93
  };
94
- r.features = t.map((n) => ({
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 l = document.createElement("div");
107
- l.className = "map-marker", l.style.backgroundImage = `url(${n.properties.image})`, l.style.width = `${n.properties.iconSize[0]}px`, l.style.height = `${n.properties.iconSize[1]}px`, new maplibregl.Marker({ element: l }).setLngLat(n.geometry.coordinates).addTo(e);
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, t) {
110
+ function A(e, o) {
111
111
  return new Promise((r) => {
112
- const n = t.map((o) => o.location), l = n.length;
112
+ const n = o.map((t) => t.location), s = n.length;
113
113
  let i = 0;
114
- const a = (o) => {
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[o],
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(s) {
131
- return s;
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", (o) => {
138
- o.flyEnd === !0 && b(e, d, n[i]).then(() => {
139
- i < l - 1 ? (i += 1, a(i)) : r();
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, t, r) => {
145
- const n = Math.floor((t - e) / r), l = [];
146
- if (n <= 0) return [[e, t]];
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, o = a + n < t ? a + n : t;
149
- if (i > 0 && (a += 1 * i, o += 1 * i), i > 0 && o > t && (o = t), i === r - 1 && (o < t || o > t) && (o = t), l.push([a, o]), o >= t) break;
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 l;
152
- }, S = (e, t, r) => {
153
- const n = [];
154
- t.forEach((a) => {
155
- n.push(a.value);
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 l = Math.max(...n), i = F(1, l, 6);
158
- if (i.length === 1) {
159
- const [a, o] = i[0];
160
- for (let s = 0; s < o; s += 1) {
161
- const c = s + 1;
162
- if (e && e >= c && e < c + 1)
163
- return r.colors.brand[m[s]];
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 a = 0; a < i.length; a += 1) {
167
- const [o, s] = i[a];
168
- if (e && e >= o && e <= s)
169
- return r.colors.brand[m[a]];
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 _, computed as k, openBlock as h, createElementBlock as c, createElementVNode as r, Fragment as g, renderList as y, createCommentVNode as b, createTextVNode as S, toDisplayString as v } from "vue";
2
- import q from "../_virtual/_plugin-vue_export-helper.js";
3
- const Q = {
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(e) {
20
- return ["jpg", "png", "gif"].indexOf(e) !== -1;
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(e) {
52
- return ["lazy", "eager"].indexOf(e) !== -1;
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(e) {
63
- return ["center", "top", "right", "left", "bottom", "top_right", "top_left", "bottom_right", "bottom_left", "face", "faces"].indexOf(e) !== -1;
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(e) {
74
- return ["pad", "fill", "scale", "crop", "thumb"].indexOf(e) !== -1;
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(e) {
94
+ setup(n) {
95
95
  const {
96
- alt: u,
96
+ alt: f,
97
97
  contentfulSrc: t,
98
- width: i,
99
- height: x
100
- } = _(e), m = (n = null, o = 1) => {
101
- let w = n && n.url ? `${n.url}?` : `${t.value}?`, f = n ? n.width : i.value, a = n ? n.height : x.value, s;
102
- return f >= 2e3 && (s = f / 1999, f = 1999, a = Math.round(a / s)), a >= 2e3 && (s = a / 1999, a = 1999, f = Math.round(f / s)), f && (w += `w=${f * o}`), f && a && (w += "&"), a && (w += `h=${a * o}`), w;
103
- }, l = (n, o) => o === "2x" ? 65 : n && parseInt(n, 10) < 200 ? 95 : 80, d = k(() => u.value && u.value.charAt(0) === "^" ? u.value.slice(1).trim() : "");
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: m,
111
+ buildUrl: x,
106
112
  caption: d,
107
- setQuality: l
113
+ removeLeafIcon: k,
114
+ setQuality: i
108
115
  };
109
116
  }
110
- }, U = {
117
+ }, z = {
111
118
  key: 0,
112
119
  class: "tw-inline-block tw-not-prose"
113
- }, F = {
120
+ }, j = {
114
121
  class: "tw-h-full tw-w-full",
115
122
  style: { "object-fit": "inherit" }
116
- }, z = ["media", "width", "height", "srcset"], j = ["media", "width", "height", "srcset"], N = ["src", "alt", "loading"], O = ["srcset"], B = ["srcset", "src", "width", "height", "alt", "loading"], C = {
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-text-h4 tw-mt-2"
125
+ class: "tw-inline-block tw-mr-0.5 tw-align-middle",
126
+ "aria-hidden": "true",
127
+ role: "img"
119
128
  };
120
- function M(e, u, t, i, x, m) {
121
- return (t.width || t.height) && t.contentfulSrc ? (h(), c("figure", U, [
122
- r("picture", F, [
123
- t.sourceSizes.length > 0 ? (h(), c(g, { key: 0 }, [
124
- (h(!0), c(g, null, y(t.sourceSizes, (l, d) => (h(), c("source", {
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: "(" + l.media + ")",
135
+ media: "(" + i.media + ")",
127
136
  type: "image/webp",
128
- width: l.width ? l.width : null,
129
- height: l.height ? l.height : null,
137
+ width: i.width ? i.width : null,
138
+ height: i.height ? i.height : null,
130
139
  srcset: `
131
- ${i.buildUrl(l, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(l.width, "2x")} 2x,
132
- ${i.buildUrl(l)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(l.width, "1x")} 1x`
133
- }, null, 8, z))), 128)),
134
- (h(!0), c(g, null, y(t.sourceSizes, (l, d) => (h(), c("source", {
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: "(" + l.media + ")",
137
- width: l.width ? l.width : null,
138
- height: l.height ? l.height : null,
145
+ media: "(" + i.media + ")",
146
+ width: i.width ? i.width : null,
147
+ height: i.height ? i.height : null,
139
148
  srcset: `
140
- ${i.buildUrl(l, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(l.width, "2x")} 2x,
141
- ${i.buildUrl(l)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(l.width, "1x")} 1x`
142
- }, null, 8, j))), 128)),
143
- r("img", {
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: `${i.buildUrl(t.width, t.height)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")}`,
147
- alt: i.caption || t.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, N)
150
- ], 64)) : b("", !0),
151
- t.sourceSizes.length === 0 ? (h(), c(g, { key: 1 }, [
152
- r("source", {
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
- ${i.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(t.width, "2x")} 2x,
156
- ${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(t.width, "1x")} 1x`
157
- }, null, 8, O),
158
- r("img", {
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
- ${i.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "2x")} 2x,
163
- ${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")} 1x`,
164
- src: `${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")}`,
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: i.caption || t.alt,
176
+ alt: e.caption || t.alt,
168
177
  loading: t.loading
169
- }, null, 8, B)
170
- ], 64)) : b("", !0)
178
+ }, null, 8, A)
179
+ ], 64)) : o("", !0)
171
180
  ]),
172
- i.caption ? (h(), c("figcaption", C, [
173
- u[0] || (u[0] = r("span", {
174
- class: "tw-inline-flex tw-align-text-top",
175
- "aria-hidden": "true",
176
- role: "img"
177
- }, [
178
- r("svg", {
179
- class: "tw-h-2 tw-w-2.5",
180
- viewBox: "0 0 20 20",
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
- r("path", {
184
- d: "m3.12088 18.7441c12.86212 0 15.87912-14.52631 15.87912-16.99996h-1.1209c-12.85272 0-15.8791 14.51376-15.8791 16.99996z",
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
- ], -1)),
189
- S(" " + v(i.caption), 1)
190
- ])) : b("", !0)
191
- ])) : b("", !0);
198
+ ], -1)
199
+ ]))),
200
+ q(" " + Q(e.caption), 1)
201
+ ], 4)) : o("", !0)
202
+ ])) : o("", !0);
192
203
  }
193
- const E = /* @__PURE__ */ q(Q, [["render", M]]);
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 m, normalizeStyle as d, createElementVNode as p } from "vue";
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
- fillColor: r(e.lenderLoans, this.countriesData, n),
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
- fillColor: r(i.lenderLoans, this.countriesData, n)
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(), m("div", {
375
+ return c(), d("div", {
358
376
  class: "tw-relative tw-block tw-w-full",
359
- style: d(o.mapDimensions)
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.0",
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.0",
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": "76df0f5473e78a4d36bba8e19c3388cc8a055921"
126
+ "gitHead": "139510f7b600b98f4f9655cf911ac08212952881"
119
127
  }