@itfin/components 1.0.54 → 1.0.55

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": "@itfin/components",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
 
5
5
  "main": "dist/itfin-components.umd.js",
6
6
  "unpkg": "dist/itfin-components.common.js",
@@ -163,7 +163,7 @@ class itfButton extends Vue {
163
163
  @Prop(String) target;
164
164
 
165
165
  get isLink() {
166
- return this.to || this.href;
166
+ return this.href || this.to;
167
167
  }
168
168
  }
169
169
  </script>
@@ -3,7 +3,7 @@
3
3
  <nav aria-label="Page navigation example">
4
4
  <ul class="pagination itf-pagination">
5
5
  <li
6
- v-for="(page, n) in pages"
6
+ v-for="(page, n) in pagesArr"
7
7
  :key="n"
8
8
  class="page-item"
9
9
  :class="{'active': page.current, 'disabled': !page.active && !page.current }"
@@ -57,6 +57,7 @@ class itfPagination extends Vue {
57
57
  @Model('input') value;
58
58
  @Prop({ type: [String, Number], default: 0 }) length;
59
59
  @Prop({ type: [String, Number], default: 20 }) size;
60
+ @Prop({ type: [String, Number] }) pages;
60
61
  @Prop({ type: [String, Number], default: MIN_PAGES_BLOCKS }) minBlocks;
61
62
  @Prop({ type: [String, Number], default: MAX_PAGES_BLOCKS }) maxBlocks;
62
63
 
@@ -64,7 +65,7 @@ class itfPagination extends Vue {
64
65
  this.$emit('input', page);
65
66
  }
66
67
 
67
- get pages () {
68
+ get pagesArr () {
68
69
  const pageSize = Number(this.size);
69
70
  const totalItems = Number(this.length);
70
71
  const currentPage = this.value;
@@ -73,7 +74,7 @@ class itfPagination extends Vue {
73
74
  const minBlocks = Number(this.minBlocks);
74
75
 
75
76
  const pages = [];
76
- const numPages = Math.ceil(totalItems / pageSize);
77
+ const numPages = this.pages ? Number(this.pages) : Math.ceil(totalItems / pageSize);
77
78
 
78
79
  if (numPages > 1) {
79
80
  pages.push({