@politicalwatch/tipi-uikit 1.6.10 → 1.6.12

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.10",
3
+ "version": "1.6.12",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16">
2
+ <path fill="#2D4252" d="M8 0C3.584 0 0 3.584 0 8s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8zm.8 12H7.2v-1.6h1.6V12zm0-3.2H7.2V4h1.6v4.8z"/>
3
+ </svg>
@@ -16,10 +16,6 @@ export default {
16
16
  },
17
17
  data: function () {
18
18
  return {
19
- icons: import.meta.glob('../../assets/party_logos/icon/*.svg', {
20
- as: 'raw',
21
- eager: true,
22
- }),
23
19
  parties: {
24
20
  Cs: {
25
21
  name: 'Ciudadanos',
@@ -181,15 +177,19 @@ export default {
181
177
  },
182
178
  computed: {
183
179
  svg() {
184
- // let svg;
185
- // if (this.party in this.parties) {
186
- // svg = defineAsyncComponent(() => this.icons[`${this.parties[this.party].logo}.svg`]());
187
- // } else {
188
- // svg = defineAsyncComponent(() => import('../../assets/svg/icon-error.svg'));
189
- // }
190
- return this.party in this.parties
191
- ? this.icons[`${this.parties[this.party].logo}.svg`]
192
- : defineAsyncComponent(() => import('../../assets/svg/icon-error.svg'));
180
+ let svg = '';
181
+ try {
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
+ }
189
+ } catch (error) {
190
+ svg = this.icon;
191
+ }
192
+ return svg;
193
193
  },
194
194
  getBackground: function () {
195
195
  const bg = this.parties[this.party]?.color ? this.parties[this.party].color : '#f4f6f8';