@europeana/portal
Version:
Europeana Portal
2 lines • 3.53 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{733:function(t,e,n){"use strict";n.r(e);n(16),n(15),n(13),n(10),n(19),n(14),n(20);var r=n(2);n(250);function o(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function l(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?o(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):o(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var c={name:"PaginationNavInput",components:{SmartLink:n(203).a},props:{perPage:{type:Number,default:24},totalResults:{type:Number,default:0},maxResults:{type:Number,default:null}},data:function(){var t,e;return{page:Number(null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.page)||1}},computed:{showPagination:function(){return this.totalResults>this.perPage},totalPages:function(){var t=Math.max(this.totalResults,1);return Math.ceil(Math.min(t,this.maxResults||t)/this.perPage)},prevDisabled:function(){return this.page<=1},prevUrl:function(){return this.linkGen(this.page-1)},nextUrl:function(){return this.linkGen(this.page+1)},nextDisabled:function(){return this.page===this.totalPages}},watch:{"$route.query.page":function(){var t,e;this.page=Number(null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.page)||1},page:"changePaginationNav"},methods:{changePaginationNav:function(){var t=l(l({},this.$route.query),{},{page:this.page}),e={path:this.$route.path,query:t};this.$goto(e)},linkGen:function(t){return{path:this.$route.path,query:l(l({},this.$route.query),{},{page:t})}}}},d=n(59),component=Object(d.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{directives:[{name:"show",rawName:"v-show",value:t.showPagination,expression:"showPagination"}],staticClass:"pagination-nav-input",attrs:{"aria-hidden":"false","aria-label":t.$t("pagination.label"),"data-qa":"pagination navigation"}},[n("ul",{staticClass:"pl-0 d-flex justify-content-center"},[n("li",{staticClass:"page-item btn-prev pl-0",class:{disabled:t.prevDisabled},attrs:{"data-qa":"prev button"}},[n("SmartLink",{staticClass:"page-link",attrs:{destination:t.prevUrl,"aria-label":t.$t("actions.previous"),disabled:t.prevDisabled,"aria-hidden":t.prevDisabled}},[n("span",{staticClass:"icon-arrow-down"}),t._v("\n "+t._s(t.$t("actions.previous"))+"\n ")])],1),t._v(" "),n("li",{staticClass:"page-item page-input"},[n("b-form-input",{attrs:{"aria-label":t.$t("pageNumber"),lazy:!0,max:t.totalPages,min:1,number:!0,"data-qa":"pagination input",type:"number"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}}),t._v(" "+t._s(t.$t("of"))+" "+t._s(t.totalPages)+"\n ")],1),t._v(" "),n("li",{staticClass:"page-item btn-next pr-0",class:{disabled:t.nextDisabled},attrs:{"data-qa":"next button"}},[n("SmartLink",{staticClass:"page-link",attrs:{destination:t.nextUrl,"aria-label":t.$t("actions.next"),disabled:t.nextDisabled,"aria-hidden":t.nextDisabled}},[t._v("\n "+t._s(t.$t("actions.next"))+"\n "),n("span",{staticClass:"icon-arrow-down"})])],1)])])}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=722054b.js.map