@politicalwatch/tipi-uikit 1.9.0 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -17,7 +17,7 @@ const { icon, color } = toRefs(props);
17
17
  const svg = computed(() => {
18
18
  let svg = '';
19
19
  try {
20
- svg = defineAsyncComponent(() => import(`@/assets/svg/icon-${icon.value}.svg`));
20
+ svg = defineAsyncComponent(() => import(`../../assets/svg/icon-${icon.value}.svg`));
21
21
  } catch (error) {
22
22
  svg = icon.value;
23
23
  }
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script setup>
6
- import { ref, onMounted, watch } from 'vue';
6
+ import { ref, toRef, onMounted, watch } from 'vue';
7
7
  import { select } from 'd3-selection';
8
8
  import { transition } from 'd3-transition';
9
9
 
@@ -18,6 +18,9 @@ const { selection, styles, topic } = defineProps({
18
18
  topic: String,
19
19
  });
20
20
 
21
+ const selectionRef = toRef(selection);
22
+ const topicRef = toRef(topic);
23
+
21
24
  const twoCirclesRef = ref(null);
22
25
 
23
26
  const loadVizz = () => {
@@ -31,10 +34,10 @@ const loadVizz = () => {
31
34
  let maxRadius = 150;
32
35
  let minRadius = 5;
33
36
 
34
- let mainTopic = topic;
35
- let data = [selection.selected];
36
- let maxName = selection.compareswith._id;
37
- let maxNumber = selection.compareswith.initiatives;
37
+ let mainTopic = topicRef.value;
38
+ let data = [selectionRef.value.selected];
39
+ let maxName = selectionRef.value.compareswith._id;
40
+ let maxNumber = selectionRef.value.compareswith.initiatives;
38
41
  let mainColor = styles.topics[mainTopic] ? styles.topics[mainTopic].color : styles.defaultColor;
39
42
  let maxColor = styles.topics[maxName] ? styles.topics[maxName].color : mainColor;
40
43
 
@@ -115,7 +118,7 @@ onMounted(() => {
115
118
  loadVizz();
116
119
  });
117
120
 
118
- watch(selection.selected._id, () => {
121
+ watch(selectionRef.value.selected._id, () => {
119
122
  loadVizz();
120
123
  });
121
124
  </script>