3232 :page-text =" pageText"
3333 :info-fn =" infoFn"
3434 :mode =" mode" />
35+ <button
36+ v-if =" jumpFirstOrLast"
37+ type =" button"
38+ aria-controls =" vgt-table"
39+ class =" footer__navigation__page-btn"
40+ :class =" { disabled: !firstIsPossible }"
41+ @click.prevent.stop =" firstPage"
42+ >
43+ <span
44+ aria-hidden =" true"
45+ class =" chevron start"
46+ ></span >
47+ <span >{{ firstText }}</span >
48+ </button >
49+
3550 <button
3651 type =" button"
3752 aria-controls =" vgt-table"
3853 class =" footer__navigation__page-btn"
3954 :class =" { disabled: !prevIsPossible }"
4055 @click.prevent.stop =" previousPage" >
41- <span aria-hidden =" true" class =" chevron" v-bind:class = " { 'left': !rtl, 'right': rtl } " ></span >
56+ <span aria-hidden =" true" class =" chevron start " ></span >
4257 <span >{{prevText}}</span >
4358 </button >
4459
4964 :class =" { disabled: !nextIsPossible }"
5065 @click.prevent.stop =" nextPage" >
5166 <span >{{nextText}}</span >
52- <span aria-hidden =" true" class =" chevron" v-bind:class =" { 'right': !rtl, 'left': rtl }" ></span >
67+ <span aria-hidden =" true" class =" chevron end" ></span >
68+ </button >
69+
70+ <button
71+ v-if =" jumpFirstOrLast"
72+ type =" button"
73+ aria-controls =" vgt-table"
74+ class =" footer__navigation__page-btn"
75+ :class =" { disabled: !lastIsPossible }"
76+ @click.prevent.stop =" lastPage"
77+ >
78+ <span >{{ lastText }}</span >
79+ <span
80+ aria-hidden =" true"
81+ class =" chevron end"
82+ ></span >
5383 </button >
5484 </div >
5585 </div >
@@ -73,8 +103,11 @@ export default {
73103 customRowsPerPageDropdown: { default () { return []; } },
74104 paginateDropdownAllowAll: { default: true },
75105 mode: { default: PAGINATION_MODES .Records },
106+ jumpFirstOrLast: { default: false },
76107
77108 // text options
109+ firstText: { default: " First" },
110+ lastText: { default: " Last" },
78111 nextText: { default: ' Next' },
79112 prevText: { default: ' Prev' },
80113 rowsPerPageText: { default: ' Rows per page:' },
@@ -104,8 +137,8 @@ export default {
104137
105138 customRowsPerPageDropdown: {
106139 handler () {
107- this .handlePerPage ();
108- },
140+ this .handlePerPage ();
141+ },
109142 deep: true ,
110143 },
111144
@@ -121,12 +154,26 @@ export default {
121154 computed: {
122155 // Number of pages
123156 pagesCount () {
157+ // if the setting is set to 'all'
158+ if (this .currentPerPage === - 1 ) {
159+ return 1 ;
160+ }
124161 const quotient = Math .floor (this .total / this .currentPerPage );
125162 const remainder = this .total % this .currentPerPage ;
126163
127164 return remainder === 0 ? quotient : quotient + 1 ;
128165 },
129166
167+ // Can go to first page
168+ firstIsPossible () {
169+ return this .currentPage > 1 ;
170+ },
171+
172+ // Can go to last page
173+ lastIsPossible () {
174+ return this .currentPage < Math .ceil (this .total / this .currentPerPage );
175+ },
176+
130177 // Can go to next page
131178 nextIsPossible () {
132179 return this .currentPage < this .pagesCount ;
@@ -151,6 +198,24 @@ export default {
151198 }
152199 },
153200
201+ // Go to first page
202+ firstPage () {
203+ if (this .firstIsPossible ) {
204+ this .currentPage = 1 ;
205+ this .prevPage = 0 ;
206+ this .pageChanged ();
207+ }
208+ },
209+
210+ // Go to last page
211+ lastPage () {
212+ if (this .lastIsPossible ) {
213+ this .currentPage = this .pagesCount ;
214+ this .prev = this .currentPage - 1 ;
215+ this .pageChanged ();
216+ }
217+ },
218+
154219 // Go to next page
155220 nextPage () {
156221 if (this .nextIsPossible ) {
0 commit comments