UNPKG

@geoblink/design-system

Version:

Geoblink Design System for Vue.js

1 lines 5.34 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["components/GeoTablePagination"]=t():e["components/GeoTablePagination"]=t()}(window,function(){return a={},e.m=t={101:function(e,t,a){e.exports=a("rL4p")},"KHd+":function(e,t,a){"use strict";function n(e,t,a,n,o,i,r,s){var u,g="function"==typeof e?e.options:e;if(t&&(g.render=t,g.staticRenderFns=a,g._compiled=!0),n&&(g.functional=!0),i&&(g._scopeId="data-v-"+i),r?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},g._ssrRegister=u):o&&(u=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(g.functional){g._injectStyles=u;var c=g.render;g.render=function(e,t){return u.call(t),c(e,t)}}else{var l=g.beforeCreate;g.beforeCreate=l?[].concat(l,u):[u]}return{exports:e,options:g}}a.d(t,"a",function(){return n})},rL4p:function(e,t,a){"use strict";a.r(t);var n={props:{pageSize:{type:Number,required:!0},currentPage:{type:Number,required:!0},sourceDataLength:{type:Number,required:!0}},computed:{totalPages:function(){return Math.ceil(this.sourceDataLength/this.pageSize)},lastPage:function(){return this.totalPages-1},hasPreviousPage:function(){return 0<this.currentPage},hasNextPage:function(){return this.currentPage<this.lastPage},hasMultiplePages:function(){return 1<this.totalPages},rangeStart:function(){return this.currentPage*this.pageSize},rangeEnd:function(){return Math.min((this.currentPage+1)*this.pageSize,this.sourceDataLength)}},methods:{goToFirstPage:function(){this.goToPage(0)},goToLastPage:function(){this.goToPage(this.lastPage)},goToPreviousPage:function(){this.goToPage(this.currentPage-1)},goToNextPage:function(){this.goToPage(this.currentPage+1)},goToPage:function(e){this.$emit("go-to-page",e)}}},o={name:"GeoTablePagination",status:"ready",release:"10.1.0",mixins:[n],constants:{GeoTablePaginationMixin:n}},i=a("KHd+"),r=Object(i.a)(o,function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.hasMultiplePages?a("div",{staticClass:"geo-table-pagination"},[e._t("firstPageShortcut",[e.hasPreviousPage?a("font-awesome-icon",{staticClass:"geo-table-pagination__action-first",attrs:{icon:["fal","step-backward"],"aria-hidden":"true","fixed-width":""},on:{click:function(t){return e.goToFirstPage()}}}):a("div",{staticClass:"geo-table-pagination__action-first--disabled",attrs:{"aria-hidden":"true"}})],{action:e.goToFirstPage,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage}),e._v(" "),e._t("prevPageShortcut",[e.hasPreviousPage?a("font-awesome-icon",{staticClass:"geo-table-pagination__action-prev",attrs:{icon:["fal","chevron-left"],"aria-hidden":"true","fixed-width":""},on:{click:function(t){return e.goToPreviousPage()}}}):a("div",{staticClass:"geo-table-pagination__action-prev--disabled",attrs:{"aria-hidden":"true"}})],{action:e.goToPreviousPage,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage}),e._v(" "),a("div",{staticClass:"geo-table-pagination__current-range"},[e._t("default",[e._v("\n "+e._s(e.rangeStart)+"-"+e._s(e.rangeEnd)+" ("+e._s(e.sourceDataLength)+")\n ")],{hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage,currentPage:e.currentPage,pageSize:e.pageSize,sourceDataLength:e.sourceDataLength,rangeStart:e.rangeStart,rangeEnd:e.rangeEnd})],2),e._v(" "),e._t("nextPageShortcut",[e.hasNextPage?a("font-awesome-icon",{staticClass:"geo-table-pagination__action-next",attrs:{icon:["fal","chevron-right"],"aria-hidden":"true","fixed-width":""},on:{click:function(t){return e.goToNextPage()}}}):a("div",{staticClass:"geo-table-pagination__action-next--disabled",attrs:{"aria-hidden":"true"}})],{action:e.goToNextPage,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage}),e._v(" "),e._t("lastPageShortcut",[e.hasNextPage?a("font-awesome-icon",{staticClass:"geo-table-pagination__action-last",attrs:{icon:["fal","step-forward"],"aria-hidden":"true","fixed-width":""},on:{click:function(t){return e.goToLastPage()}}}):a("div",{staticClass:"geo-table-pagination__action-last--disabled",attrs:{"aria-hidden":"true"}})],{action:e.goToLastPage,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage})],2):e._e()},[],!1,null,null,null);t.default=r.exports}},e.c=a,e.d=function(t,a,n){e.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:n})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,a){if(1&a&&(t=e(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var o in t)e.d(n,o,function(e){return t[e]}.bind(null,o));return n},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="/",e(e.s=101);function e(n){if(a[n])return a[n].exports;var o=a[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t,a});