@politicalwatch/tipi-uikit 1.5.0 → 1.5.1

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.5.0",
3
+ "version": "1.5.1",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -24,7 +24,7 @@
24
24
  />
25
25
  </div>
26
26
  </section>
27
- <div class="o-grid o-grid--center" v-if="this.$listeners.loadMore && isMoreResults">
27
+ <div class="o-grid o-grid--center" v-if="isMoreResults">
28
28
  <div class="o-grid__col">
29
29
  <a href="#" class="c-button c-button--secondary" @click.prevent="loadMore">
30
30
  Cargar más {{ nextResultsLabel }}
@@ -49,7 +49,7 @@ export default {
49
49
  loadingResults: Boolean,
50
50
  initiatives: {
51
51
  type: Array,
52
- default: function() {
52
+ default: function () {
53
53
  return [];
54
54
  },
55
55
  },
@@ -61,23 +61,23 @@ export default {
61
61
  metaColors: { type: Object, default: undefined },
62
62
  },
63
63
  computed: {
64
- isMoreResults: function() {
65
- return !this.loadingResults && this.queryMeta.page < this.queryMeta.pages;
64
+ isMoreResults: function () {
65
+ return !this.loadingResults && this.queryMeta?.page < this.queryMeta?.pages;
66
66
  },
67
- nextResultsLabel: function() {
68
- let nextResult = this.queryMeta.page * this.queryMeta.per_page + 1;
69
- let lastResult = nextResult + this.queryMeta.per_page - 1;
67
+ nextResultsLabel: function () {
68
+ let nextResult = this.queryMeta?.page * this.queryMeta?.per_page + 1;
69
+ let lastResult = nextResult + this.queryMeta?.per_page - 1;
70
70
  return `(${nextResult}-${lastResult})`;
71
71
  },
72
- extendedLayout: function() {
72
+ extendedLayout: function () {
73
73
  return this.layout != 'tiny';
74
74
  },
75
75
  },
76
76
  methods: {
77
- loadMore: function() {
77
+ loadMore: function () {
78
78
  this.$emit('loadMore');
79
79
  },
80
- setupMasonry: function() {
80
+ setupMasonry: function () {
81
81
  let grid = document.querySelector('.o-masonry');
82
82
  if (grid) {
83
83
  let msnry = new Masonry(grid, {
@@ -90,17 +90,17 @@ export default {
90
90
  },
91
91
  },
92
92
  watch: {
93
- initiatives: function() {
93
+ initiatives: function () {
94
94
  if (this.initiatives && this.initiatives.length && !this.loadingResults) {
95
95
  this.setupMasonry();
96
96
  }
97
97
  },
98
98
  },
99
- mounted: function() {
99
+ mounted: function () {
100
100
  this.setupMasonry();
101
101
  window.addEventListener(
102
102
  'resize',
103
- function() {
103
+ function () {
104
104
  this.setupMasonry();
105
105
  }.bind(this)
106
106
  );