@kiva/kv-components 3.95.1 → 3.97.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/CHANGELOG.md +22 -0
- package/package.json +2 -2
- package/vue/KvMap.vue +8 -4
- package/vue/KvPieChart.vue +14 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.97.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.96.0...@kiva/kv-components@3.97.0) (2024-08-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* emitted event added to pie chart component ([#452](https://github.com/kiva/kv-ui-elements/issues/452)) ([1d95611](https://github.com/kiva/kv-ui-elements/commit/1d95611471b25b3c2f5fb9e26431295bd1942a1f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.96.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.95.1...@kiva/kv-components@3.96.0) (2024-08-28)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* async countries border data import ([#451](https://github.com/kiva/kv-ui-elements/issues/451)) ([aa27135](https://github.com/kiva/kv-ui-elements/commit/aa2713540d61ad2cd780a0fdfbfd8249030d9cbd))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [3.95.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.95.0...@kiva/kv-components@3.95.1) (2024-08-28)
|
|
7
29
|
|
|
8
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.97.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"optional": true
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "00a1948fdc646666968cd5c98ef55c0e810d5ee4"
|
|
88
88
|
}
|
package/vue/KvMap.vue
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
<script>
|
|
16
16
|
import kvTokensPrimitives from '@kiva/kv-tokens/primitives.json';
|
|
17
17
|
import { animationCoordinator, generateMapMarkers, getCountryColor } from '../utils/mapUtils';
|
|
18
|
-
import countriesBorders from '../data/countries-borders.json';
|
|
19
18
|
|
|
20
19
|
export default {
|
|
21
20
|
name: 'KvMap',
|
|
@@ -164,6 +163,7 @@ export default {
|
|
|
164
163
|
mapLibreReady: false,
|
|
165
164
|
mapLoaded: false,
|
|
166
165
|
zoomActive: false,
|
|
166
|
+
countriesBorders: {},
|
|
167
167
|
};
|
|
168
168
|
},
|
|
169
169
|
computed: {
|
|
@@ -201,7 +201,11 @@ export default {
|
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
},
|
|
204
|
-
mounted() {
|
|
204
|
+
async mounted() {
|
|
205
|
+
if (this.countriesData) {
|
|
206
|
+
this.countriesBorders = await import('../data/countries-borders.json');
|
|
207
|
+
}
|
|
208
|
+
|
|
205
209
|
if (!this.mapLibreReady && !this.leafletReady) {
|
|
206
210
|
this.initializeMap();
|
|
207
211
|
}
|
|
@@ -498,7 +502,7 @@ export default {
|
|
|
498
502
|
});
|
|
499
503
|
},
|
|
500
504
|
getCountriesData() {
|
|
501
|
-
const countriesFeatures = countriesBorders.features ?? [];
|
|
505
|
+
const countriesFeatures = this.countriesBorders.features ?? [];
|
|
502
506
|
|
|
503
507
|
countriesFeatures.forEach((country, index) => {
|
|
504
508
|
const countryData = this.countriesData.find((data) => data.isoCode === country.properties.ISO_A2);
|
|
@@ -508,7 +512,7 @@ export default {
|
|
|
508
512
|
}
|
|
509
513
|
});
|
|
510
514
|
|
|
511
|
-
return countriesBorders;
|
|
515
|
+
return this.countriesBorders;
|
|
512
516
|
},
|
|
513
517
|
countryStyle(feature) {
|
|
514
518
|
return {
|
package/vue/KvPieChart.vue
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
:stroke="slice.color"
|
|
30
30
|
:stroke-width="lineWidth"
|
|
31
31
|
fill="none"
|
|
32
|
-
@mouseenter="
|
|
33
|
-
@click="
|
|
32
|
+
@mouseenter="setActiveSlice(slice)"
|
|
33
|
+
@click="setActiveSlice(slice)"
|
|
34
34
|
/>
|
|
35
35
|
</svg>
|
|
36
36
|
<!-- active slice -->
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
v-for="(slice, index) in slices.slice(pageIndex * slicesPerPage, (pageIndex + 1) * slicesPerPage)"
|
|
60
60
|
:key="index"
|
|
61
61
|
class="tw-flex tw-items-center"
|
|
62
|
-
@mouseenter="
|
|
63
|
-
@click="
|
|
62
|
+
@mouseenter="setActiveSlice(slice)"
|
|
63
|
+
@click="setActiveSlice(slice)"
|
|
64
64
|
>
|
|
65
65
|
<div
|
|
66
66
|
class="tw-w-2 tw-h-2 tw-mr-1 tw-rounded-full tw-flex-none"
|
|
@@ -125,7 +125,10 @@ export default {
|
|
|
125
125
|
default: () => ([]),
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
|
-
|
|
128
|
+
emits: [
|
|
129
|
+
'click',
|
|
130
|
+
],
|
|
131
|
+
setup(props, { emit }) {
|
|
129
132
|
const {
|
|
130
133
|
values,
|
|
131
134
|
} = toRefs(props);
|
|
@@ -200,6 +203,11 @@ export default {
|
|
|
200
203
|
}
|
|
201
204
|
};
|
|
202
205
|
|
|
206
|
+
const setActiveSlice = (slice) => {
|
|
207
|
+
activeSlice.value = slice;
|
|
208
|
+
emit('click', slice.label);
|
|
209
|
+
};
|
|
210
|
+
|
|
203
211
|
return {
|
|
204
212
|
svgSize,
|
|
205
213
|
lineWidth,
|
|
@@ -213,6 +221,7 @@ export default {
|
|
|
213
221
|
pageCount,
|
|
214
222
|
prevPage,
|
|
215
223
|
nextPage,
|
|
224
|
+
setActiveSlice,
|
|
216
225
|
};
|
|
217
226
|
},
|
|
218
227
|
};
|