@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
|
@@ -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
|
|
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
|
|
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({
|