@politicalwatch/tipi-uikit 1.6.1 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -14,7 +14,7 @@ export default {
14
14
  props: {
15
15
  party: String,
16
16
  },
17
- data: function() {
17
+ data: function () {
18
18
  return {
19
19
  parties: {
20
20
  Cs: {
@@ -179,22 +179,26 @@ export default {
179
179
  svg() {
180
180
  let svg = '';
181
181
  try {
182
- svg = defineAsyncComponent(() =>
183
- import(`../../assets/party_logos/icon/${this.parties[this.party].logo}.svg`)
184
- );
182
+ if (this.party in this.parties) {
183
+ svg = defineAsyncComponent(() =>
184
+ import(`../../assets/party_logos/icon/${this.parties[this.party].logo}.svg`)
185
+ );
186
+ } else {
187
+ svg = defineAsyncComponent(() => import('../../assets/svg/icon-error.svg'));
188
+ }
185
189
  } catch (error) {
186
190
  svg = this.icon;
187
191
  }
188
192
  return svg;
189
193
  },
190
- getBackground: function() {
191
- const bg = this.parties[this.party]?.color ? this.parties[this.party].color : '';
194
+ getBackground: function () {
195
+ const bg = this.parties[this.party]?.color ? this.parties[this.party].color : '#f4f6f8';
192
196
  if (bg.length == 7) {
193
197
  return 'background-color:' + bg;
194
198
  }
195
199
  return 'background-image:' + bg;
196
200
  },
197
- getName: function() {
201
+ getName: function () {
198
202
  return this.parties[this.party]?.name ? this.parties[this.party].name : '';
199
203
  },
200
204
  },
@@ -14,6 +14,8 @@ import TipiTopicLink from './TopicLink/TopicLink.vue';
14
14
  import TipiTwoCircles from './TwoCircles/TwoCircles.vue';
15
15
  import TipiSplash from './Splash/Splash.vue';
16
16
  import TipiIcon from './Icon/Icon.vue';
17
+ import PartyLogo from './PartyLogo/PartyLogo.vue';
18
+ import PartyLogoIcon from './PartyLogo/PartyLogoIcon.vue';
17
19
  import TipiInitiativeCard from './InitiativeCard/InitiativeCard.vue';
18
20
  import TipiTopicPill from './TopicPill/TopicPill.vue';
19
21
  import TipiLoader from './Loader/Loader.vue';
@@ -41,6 +43,8 @@ export {
41
43
  TipiTwoCircles,
42
44
  TipiSplash,
43
45
  TipiIcon,
46
+ PartyLogo,
47
+ PartyLogoIcon,
44
48
  TipiInitiativeCard,
45
49
  TipiTopicPill,
46
50
  TipiLoader,