vue-sliding-pagination
Advanced tools
Comparing version 1.1.0 to 1.1.1
1.1.1 / 2020-12-04 | ||
================== | ||
* Bumped dev dependencies to current versions | ||
1.1.0 / 2020-05-15 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){},function(e){e.exports=JSON.parse('{"componentClass":"c-sliding-pagination","list":"c-sliding-pagination__list","element":"c-sliding-pagination__list-element","elementDisabled":"c-sliding-pagination__list-element--disabled","elementActive":"c-sliding-pagination__list-element--active","page":"c-sliding-pagination__page"}')},function(e,t,n){"use strict";var i=n(0);n.n(i).a},function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{class:e.classMap.component,attrs:{"aria-label":e.ariaPaginationLabel}},[n("ul",{class:e.classMap.list},[e.showPreviousPageAction?n("li",{class:[e.classMap.element,1==e.current?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaPreviousPageLabel,disabled:1==e.current},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current-1)}}},[e._t("previous-page",[e._v("«")])],2)]):e._e(),e._l(e.beginningPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasBeginningGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-left",[e._v("…")])],2)]):e._e(),e._l(e.slidingWindowPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasEndingGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-right",[e._v("…")])],2)]):e._e(),e._l(e.endingPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.showNextPageAction?n("li",{staticClass:"c-sliding-pagination__list-element",class:[e.classMap.element,e.current==e.total?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaNextPageLabel,disabled:e.current==e.total},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current+1)}}},[e._t("next-page",[e._v("»")])],2)]):e._e()],2)])};i._withStripped=!0;var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{class:e.pageClass,attrs:{href:"#","aria-label":e.ariaPageLabel},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.goToPage(e.page)}}},[e._v("\n "+e._s(e.page)+"\n")])};function r(e,t,n,i,a,r,s,l){var o,g="function"==typeof e?e.options:e;if(t&&(g.render=t,g.staticRenderFns=n,g._compiled=!0),i&&(g.functional=!0),r&&(g._scopeId="data-v-"+r),s?(o=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__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},g._ssrRegister=o):a&&(o=l?function(){a.call(this,this.$root.$options.shadowRoot)}:a),o)if(g.functional){g._injectStyles=o;var u=g.render;g.render=function(e,t){return o.call(t),u(e,t)}}else{var c=g.beforeCreate;g.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:g}}a._withStripped=!0;var s=r({name:"SlidingPaginationDefaultPage",props:{ariaPageLabel:{type:String,required:!0},isCurrent:{type:Boolean,required:!0},page:{type:Number,required:!0},pageClass:{type:String,required:!0}},computed:{currentClass:function(){return this.isCurrent?"c-sliding-pagination__page--current":""}},methods:{goToPage:function(){this.$emit("page-click",this.page)}}},a,[],!1,null,null,null);s.options.__file="src/SlidingPaginationDefaultPage.vue";var l=s.exports,o=n(1);function g(e,t){var n=[];if("number"!=typeof e||"number"!=typeof t)return n;if(e>t){var i=e;e=t,t=i}for(var a=e;a<=t;a++)n.push(a);return n}var u={name:"SlidingPagination",props:{ariaPaginationLabel:{type:String,required:!1,default:"Pagination Navigation"},ariaGotoPageLabel:{type:String,required:!1,default:"Go to page %page% of %total%"},ariaPreviousPageLabel:{type:String,required:!1,default:"Go to previous page"},ariaNextPageLabel:{type:String,required:!1,default:"Go to next page"},ariaCurrentPageLabel:{type:String,required:!1,default:"Page %page% of %total%, current page"},classMap:{type:Object,required:!1,default:function(){return o}},current:{required:!0,type:Number},total:{required:!0,type:Number},slidingEndingSize:{required:!1,type:Number,default:2},slidingWindowSize:{required:!1,type:Number,default:3},nonSlidingSize:{required:!1,type:Number,default:9},pageComponent:{required:!1,type:String,default:"sliding-pagination-default-page"}},components:{SlidingPaginationDefaultPage:l},computed:{isSliding:function(){return this.total>this.nonSlidingSize},hasBeginningGap:function(){return!!this.isSliding&&this.lastBeginningPage+1!==this.firstWindowPage},hasEndingGap:function(){return!!this.isSliding&&this.lastWindowPage+1!==this.firstEndingPage},beginningPages:function(){return g(1,this.isSliding?this.slidingEndingSize:this.total)},lastBeginningPage:function(){return this.beginningPages[this.beginningPages.length-1]},endingPages:function(){return this.isSliding?g(this.total-this.slidingEndingSize+1,this.total):[]},firstEndingPage:function(){return this.endingPages[0]},slidingWindowHalf:function(){var e=this.slidingWindowSize/2;return this.slidingWindowSize%2==1&&(e-=.5),e},slidingWindowPages:function(){if(!this.isSliding)return[];var e=this.lastBeginningPage+this.slidingWindowHalf,t=this.firstEndingPage-this.slidingWindowHalf;if(this.current<=e)return g(this.lastBeginningPage+1,this.lastBeginningPage+this.slidingWindowSize);if(this.current>e&&this.current<t){var n=this.slidingWindowHalf;return this.slidingWindowSize%2==0&&(n/=2),g(-this.slidingWindowHalf+this.current,n+this.current)}return g(this.firstEndingPage-this.slidingWindowSize,this.firstEndingPage-1)},firstWindowPage:function(){return this.slidingWindowPages[0]},lastWindowPage:function(){return this.slidingWindowPages[this.slidingWindowPages.length-1]},showPreviousPageAction:function(){return this.total>this.nonSlidingSize},showNextPageAction:function(){return this.total>this.nonSlidingSize}},methods:{replaceLabelVars:function(e,t){return e.replace("%total%",this.total).replace("%page%",t)},isCurrentPage:function(e){return this.current===e},currentPageLabel:function(e){return this.replaceLabelVars(this.ariaCurrentPageLabel,e)},goToPage:function(e){this.$emit("page-change",e)},goToPageLabel:function(e){return this.replaceLabelVars(this.ariaGotoPageLabel,e)},pageLabel:function(e){return this.isCurrentPage(e)?this.currentPageLabel(e):this.goToPageLabel(e)}}},c=(n(2),r(u,i,[],!1,null,null,null));c.options.__file="src/SlidingPagination.vue";var p=c.exports;t.default={install:function(e,t){e.component("SlidingPagination",p)}}}]); | ||
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"componentClass":"c-sliding-pagination","list":"c-sliding-pagination__list","element":"c-sliding-pagination__list-element","elementDisabled":"c-sliding-pagination__list-element--disabled","elementActive":"c-sliding-pagination__list-element--active","page":"c-sliding-pagination__page"}')},function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{class:e.classMap.component,attrs:{"aria-label":e.ariaPaginationLabel}},[n("ul",{class:e.classMap.list},[e.showPreviousPageAction?n("li",{class:[e.classMap.element,1==e.current?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaPreviousPageLabel,disabled:1==e.current},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current-1)}}},[e._t("previous-page",[e._v("«")])],2)]):e._e(),e._l(e.beginningPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasBeginningGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-left",[e._v("…")])],2)]):e._e(),e._l(e.slidingWindowPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasEndingGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-right",[e._v("…")])],2)]):e._e(),e._l(e.endingPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.showNextPageAction?n("li",{staticClass:"c-sliding-pagination__list-element",class:[e.classMap.element,e.current==e.total?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaNextPageLabel,disabled:e.current==e.total},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current+1)}}},[e._t("next-page",[e._v("»")])],2)]):e._e()],2)])};i._withStripped=!0;var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{class:e.pageClass,attrs:{href:"#","aria-label":e.ariaPageLabel},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.goToPage(e.page)}}},[e._v("\n "+e._s(e.page)+"\n")])};function r(e,t,n,i,a,r,s,l){var o,g="function"==typeof e?e.options:e;if(t&&(g.render=t,g.staticRenderFns=n,g._compiled=!0),i&&(g.functional=!0),r&&(g._scopeId="data-v-"+r),s?(o=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__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},g._ssrRegister=o):a&&(o=l?function(){a.call(this,(g.functional?this.parent:this).$root.$options.shadowRoot)}:a),o)if(g.functional){g._injectStyles=o;var u=g.render;g.render=function(e,t){return o.call(t),u(e,t)}}else{var c=g.beforeCreate;g.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:g}}a._withStripped=!0;var s=r({name:"SlidingPaginationDefaultPage",props:{ariaPageLabel:{type:String,required:!0},isCurrent:{type:Boolean,required:!0},page:{type:Number,required:!0},pageClass:{type:String,required:!0}},computed:{currentClass:function(){return this.isCurrent?"c-sliding-pagination__page--current":""}},methods:{goToPage:function(){this.$emit("page-click",this.page)}}},a,[],!1,null,null,null);s.options.__file="src/SlidingPaginationDefaultPage.vue";var l=s.exports,o=n(0);function g(e,t){var n=[];if("number"!=typeof e||"number"!=typeof t)return n;if(e>t){var i=e;e=t,t=i}for(var a=e;a<=t;a++)n.push(a);return n}var u=r({name:"SlidingPagination",props:{ariaPaginationLabel:{type:String,required:!1,default:"Pagination Navigation"},ariaGotoPageLabel:{type:String,required:!1,default:"Go to page %page% of %total%"},ariaPreviousPageLabel:{type:String,required:!1,default:"Go to previous page"},ariaNextPageLabel:{type:String,required:!1,default:"Go to next page"},ariaCurrentPageLabel:{type:String,required:!1,default:"Page %page% of %total%, current page"},classMap:{type:Object,required:!1,default:function(){return o}},current:{required:!0,type:Number},total:{required:!0,type:Number},slidingEndingSize:{required:!1,type:Number,default:2},slidingWindowSize:{required:!1,type:Number,default:3},nonSlidingSize:{required:!1,type:Number,default:9},pageComponent:{required:!1,type:String,default:"sliding-pagination-default-page"}},components:{SlidingPaginationDefaultPage:l},computed:{isSliding:function(){return this.total>this.nonSlidingSize},hasBeginningGap:function(){return!!this.isSliding&&this.lastBeginningPage+1!==this.firstWindowPage},hasEndingGap:function(){return!!this.isSliding&&this.lastWindowPage+1!==this.firstEndingPage},beginningPages:function(){return g(1,this.isSliding?this.slidingEndingSize:this.total)},lastBeginningPage:function(){return this.beginningPages[this.beginningPages.length-1]},endingPages:function(){return this.isSliding?g(this.total-this.slidingEndingSize+1,this.total):[]},firstEndingPage:function(){return this.endingPages[0]},slidingWindowHalf:function(){var e=this.slidingWindowSize/2;return this.slidingWindowSize%2==1&&(e-=.5),e},slidingWindowPages:function(){if(!this.isSliding)return[];var e=this.lastBeginningPage+this.slidingWindowHalf,t=this.firstEndingPage-this.slidingWindowHalf;if(this.current<=e)return g(this.lastBeginningPage+1,this.lastBeginningPage+this.slidingWindowSize);if(this.current>e&&this.current<t){var n=this.slidingWindowHalf;return this.slidingWindowSize%2==0&&(n/=2),g(-this.slidingWindowHalf+this.current,n+this.current)}return g(this.firstEndingPage-this.slidingWindowSize,this.firstEndingPage-1)},firstWindowPage:function(){return this.slidingWindowPages[0]},lastWindowPage:function(){return this.slidingWindowPages[this.slidingWindowPages.length-1]},showPreviousPageAction:function(){return this.total>this.nonSlidingSize},showNextPageAction:function(){return this.total>this.nonSlidingSize}},methods:{replaceLabelVars:function(e,t){return e.replace("%total%",this.total).replace("%page%",t)},isCurrentPage:function(e){return this.current===e},currentPageLabel:function(e){return this.replaceLabelVars(this.ariaCurrentPageLabel,e)},goToPage:function(e){this.$emit("page-change",e)},goToPageLabel:function(e){return this.replaceLabelVars(this.ariaGotoPageLabel,e)},pageLabel:function(e){return this.isCurrentPage(e)?this.currentPageLabel(e):this.goToPageLabel(e)}}},i,[],!1,null,null,null);u.options.__file="src/SlidingPagination.vue";var c=u.exports;t.default={install:function(e,t){e.component("SlidingPagination",c)}}}]); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vue-sliding-pagination",[],t):"object"==typeof exports?exports["vue-sliding-pagination"]=t():e["vue-sliding-pagination"]=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){},function(e){e.exports=JSON.parse('{"componentClass":"c-sliding-pagination","list":"c-sliding-pagination__list","element":"c-sliding-pagination__list-element","elementDisabled":"c-sliding-pagination__list-element--disabled","elementActive":"c-sliding-pagination__list-element--active","page":"c-sliding-pagination__page"}')},function(e,t,n){"use strict";var i=n(0);n.n(i).a},function(e,t,n){"use strict";n.r(t),n.d(t,"range",(function(){return g}));var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{class:e.classMap.component,attrs:{"aria-label":e.ariaPaginationLabel}},[n("ul",{class:e.classMap.list},[e.showPreviousPageAction?n("li",{class:[e.classMap.element,1==e.current?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaPreviousPageLabel,disabled:1==e.current},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current-1)}}},[e._t("previous-page",[e._v("«")])],2)]):e._e(),e._l(e.beginningPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasBeginningGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-left",[e._v("…")])],2)]):e._e(),e._l(e.slidingWindowPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasEndingGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-right",[e._v("…")])],2)]):e._e(),e._l(e.endingPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.showNextPageAction?n("li",{staticClass:"c-sliding-pagination__list-element",class:[e.classMap.element,e.current==e.total?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaNextPageLabel,disabled:e.current==e.total},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current+1)}}},[e._t("next-page",[e._v("»")])],2)]):e._e()],2)])};i._withStripped=!0;var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{class:e.pageClass,attrs:{href:"#","aria-label":e.ariaPageLabel},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.goToPage(e.page)}}},[e._v("\n "+e._s(e.page)+"\n")])};function r(e,t,n,i,a,r,s,l){var o,g="function"==typeof e?e.options:e;if(t&&(g.render=t,g.staticRenderFns=n,g._compiled=!0),i&&(g.functional=!0),r&&(g._scopeId="data-v-"+r),s?(o=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__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},g._ssrRegister=o):a&&(o=l?function(){a.call(this,this.$root.$options.shadowRoot)}:a),o)if(g.functional){g._injectStyles=o;var u=g.render;g.render=function(e,t){return o.call(t),u(e,t)}}else{var c=g.beforeCreate;g.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:g}}a._withStripped=!0;var s=r({name:"SlidingPaginationDefaultPage",props:{ariaPageLabel:{type:String,required:!0},isCurrent:{type:Boolean,required:!0},page:{type:Number,required:!0},pageClass:{type:String,required:!0}},computed:{currentClass:function(){return this.isCurrent?"c-sliding-pagination__page--current":""}},methods:{goToPage:function(){this.$emit("page-click",this.page)}}},a,[],!1,null,null,null);s.options.__file="src/SlidingPaginationDefaultPage.vue";var l=s.exports,o=n(1);function g(e,t){var n=[];if("number"!=typeof e||"number"!=typeof t)return n;if(e>t){var i=e;e=t,t=i}for(var a=e;a<=t;a++)n.push(a);return n}var u={name:"SlidingPagination",props:{ariaPaginationLabel:{type:String,required:!1,default:"Pagination Navigation"},ariaGotoPageLabel:{type:String,required:!1,default:"Go to page %page% of %total%"},ariaPreviousPageLabel:{type:String,required:!1,default:"Go to previous page"},ariaNextPageLabel:{type:String,required:!1,default:"Go to next page"},ariaCurrentPageLabel:{type:String,required:!1,default:"Page %page% of %total%, current page"},classMap:{type:Object,required:!1,default:function(){return o}},current:{required:!0,type:Number},total:{required:!0,type:Number},slidingEndingSize:{required:!1,type:Number,default:2},slidingWindowSize:{required:!1,type:Number,default:3},nonSlidingSize:{required:!1,type:Number,default:9},pageComponent:{required:!1,type:String,default:"sliding-pagination-default-page"}},components:{SlidingPaginationDefaultPage:l},computed:{isSliding:function(){return this.total>this.nonSlidingSize},hasBeginningGap:function(){return!!this.isSliding&&this.lastBeginningPage+1!==this.firstWindowPage},hasEndingGap:function(){return!!this.isSliding&&this.lastWindowPage+1!==this.firstEndingPage},beginningPages:function(){return g(1,this.isSliding?this.slidingEndingSize:this.total)},lastBeginningPage:function(){return this.beginningPages[this.beginningPages.length-1]},endingPages:function(){return this.isSliding?g(this.total-this.slidingEndingSize+1,this.total):[]},firstEndingPage:function(){return this.endingPages[0]},slidingWindowHalf:function(){var e=this.slidingWindowSize/2;return this.slidingWindowSize%2==1&&(e-=.5),e},slidingWindowPages:function(){if(!this.isSliding)return[];var e=this.lastBeginningPage+this.slidingWindowHalf,t=this.firstEndingPage-this.slidingWindowHalf;if(this.current<=e)return g(this.lastBeginningPage+1,this.lastBeginningPage+this.slidingWindowSize);if(this.current>e&&this.current<t){var n=this.slidingWindowHalf;return this.slidingWindowSize%2==0&&(n/=2),g(-this.slidingWindowHalf+this.current,n+this.current)}return g(this.firstEndingPage-this.slidingWindowSize,this.firstEndingPage-1)},firstWindowPage:function(){return this.slidingWindowPages[0]},lastWindowPage:function(){return this.slidingWindowPages[this.slidingWindowPages.length-1]},showPreviousPageAction:function(){return this.total>this.nonSlidingSize},showNextPageAction:function(){return this.total>this.nonSlidingSize}},methods:{replaceLabelVars:function(e,t){return e.replace("%total%",this.total).replace("%page%",t)},isCurrentPage:function(e){return this.current===e},currentPageLabel:function(e){return this.replaceLabelVars(this.ariaCurrentPageLabel,e)},goToPage:function(e){this.$emit("page-change",e)},goToPageLabel:function(e){return this.replaceLabelVars(this.ariaGotoPageLabel,e)},pageLabel:function(e){return this.isCurrentPage(e)?this.currentPageLabel(e):this.goToPageLabel(e)}}},c=(n(2),r(u,i,[],!1,null,null,null));c.options.__file="src/SlidingPagination.vue";t.default=c.exports}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vue-sliding-pagination",[],t):"object"==typeof exports?exports["vue-sliding-pagination"]=t():e["vue-sliding-pagination"]=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"componentClass":"c-sliding-pagination","list":"c-sliding-pagination__list","element":"c-sliding-pagination__list-element","elementDisabled":"c-sliding-pagination__list-element--disabled","elementActive":"c-sliding-pagination__list-element--active","page":"c-sliding-pagination__page"}')},function(e,t,n){"use strict";n.r(t),n.d(t,"range",(function(){return g}));var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{class:e.classMap.component,attrs:{"aria-label":e.ariaPaginationLabel}},[n("ul",{class:e.classMap.list},[e.showPreviousPageAction?n("li",{class:[e.classMap.element,1==e.current?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaPreviousPageLabel,disabled:1==e.current},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current-1)}}},[e._t("previous-page",[e._v("«")])],2)]):e._e(),e._l(e.beginningPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasBeginningGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-left",[e._v("…")])],2)]):e._e(),e._l(e.slidingWindowPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.hasEndingGap?n("li",{class:[e.classMap.element,e.classMap.elementDisabled],attrs:{"aria-hidden":"true"}},[n("a",{class:e.classMap.page,attrs:{href:"#",disabled:""}},[e._t("gap-right",[e._v("…")])],2)]):e._e(),e._l(e.endingPages,(function(t){return n("li",{key:t,class:[e.classMap.element,e.isCurrentPage(t)?e.classMap.elementActive:""]},[n(e.pageComponent,{tag:"component",attrs:{"is-current":e.isCurrentPage(t),"aria-page-label":e.pageLabel(t),page:t,"page-class":e.classMap.page},on:{"page-click":function(n){return e.goToPage(t)}}})],1)})),e.showNextPageAction?n("li",{staticClass:"c-sliding-pagination__list-element",class:[e.classMap.element,e.current==e.total?e.classMap.elementDisabled:""]},[n("a",{class:e.classMap.page,attrs:{href:"#","aria-label":e.ariaNextPageLabel,disabled:e.current==e.total},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.goToPage(e.current+1)}}},[e._t("next-page",[e._v("»")])],2)]):e._e()],2)])};i._withStripped=!0;var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{class:e.pageClass,attrs:{href:"#","aria-label":e.ariaPageLabel},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.goToPage(e.page)}}},[e._v("\n "+e._s(e.page)+"\n")])};function r(e,t,n,i,a,r,s,l){var o,g="function"==typeof e?e.options:e;if(t&&(g.render=t,g.staticRenderFns=n,g._compiled=!0),i&&(g.functional=!0),r&&(g._scopeId="data-v-"+r),s?(o=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__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},g._ssrRegister=o):a&&(o=l?function(){a.call(this,(g.functional?this.parent:this).$root.$options.shadowRoot)}:a),o)if(g.functional){g._injectStyles=o;var u=g.render;g.render=function(e,t){return o.call(t),u(e,t)}}else{var c=g.beforeCreate;g.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:g}}a._withStripped=!0;var s=r({name:"SlidingPaginationDefaultPage",props:{ariaPageLabel:{type:String,required:!0},isCurrent:{type:Boolean,required:!0},page:{type:Number,required:!0},pageClass:{type:String,required:!0}},computed:{currentClass:function(){return this.isCurrent?"c-sliding-pagination__page--current":""}},methods:{goToPage:function(){this.$emit("page-click",this.page)}}},a,[],!1,null,null,null);s.options.__file="src/SlidingPaginationDefaultPage.vue";var l=s.exports,o=n(0);function g(e,t){var n=[];if("number"!=typeof e||"number"!=typeof t)return n;if(e>t){var i=e;e=t,t=i}for(var a=e;a<=t;a++)n.push(a);return n}var u=r({name:"SlidingPagination",props:{ariaPaginationLabel:{type:String,required:!1,default:"Pagination Navigation"},ariaGotoPageLabel:{type:String,required:!1,default:"Go to page %page% of %total%"},ariaPreviousPageLabel:{type:String,required:!1,default:"Go to previous page"},ariaNextPageLabel:{type:String,required:!1,default:"Go to next page"},ariaCurrentPageLabel:{type:String,required:!1,default:"Page %page% of %total%, current page"},classMap:{type:Object,required:!1,default:function(){return o}},current:{required:!0,type:Number},total:{required:!0,type:Number},slidingEndingSize:{required:!1,type:Number,default:2},slidingWindowSize:{required:!1,type:Number,default:3},nonSlidingSize:{required:!1,type:Number,default:9},pageComponent:{required:!1,type:String,default:"sliding-pagination-default-page"}},components:{SlidingPaginationDefaultPage:l},computed:{isSliding:function(){return this.total>this.nonSlidingSize},hasBeginningGap:function(){return!!this.isSliding&&this.lastBeginningPage+1!==this.firstWindowPage},hasEndingGap:function(){return!!this.isSliding&&this.lastWindowPage+1!==this.firstEndingPage},beginningPages:function(){return g(1,this.isSliding?this.slidingEndingSize:this.total)},lastBeginningPage:function(){return this.beginningPages[this.beginningPages.length-1]},endingPages:function(){return this.isSliding?g(this.total-this.slidingEndingSize+1,this.total):[]},firstEndingPage:function(){return this.endingPages[0]},slidingWindowHalf:function(){var e=this.slidingWindowSize/2;return this.slidingWindowSize%2==1&&(e-=.5),e},slidingWindowPages:function(){if(!this.isSliding)return[];var e=this.lastBeginningPage+this.slidingWindowHalf,t=this.firstEndingPage-this.slidingWindowHalf;if(this.current<=e)return g(this.lastBeginningPage+1,this.lastBeginningPage+this.slidingWindowSize);if(this.current>e&&this.current<t){var n=this.slidingWindowHalf;return this.slidingWindowSize%2==0&&(n/=2),g(-this.slidingWindowHalf+this.current,n+this.current)}return g(this.firstEndingPage-this.slidingWindowSize,this.firstEndingPage-1)},firstWindowPage:function(){return this.slidingWindowPages[0]},lastWindowPage:function(){return this.slidingWindowPages[this.slidingWindowPages.length-1]},showPreviousPageAction:function(){return this.total>this.nonSlidingSize},showNextPageAction:function(){return this.total>this.nonSlidingSize}},methods:{replaceLabelVars:function(e,t){return e.replace("%total%",this.total).replace("%page%",t)},isCurrentPage:function(e){return this.current===e},currentPageLabel:function(e){return this.replaceLabelVars(this.ariaCurrentPageLabel,e)},goToPage:function(e){this.$emit("page-change",e)},goToPageLabel:function(e){return this.replaceLabelVars(this.ariaGotoPageLabel,e)},pageLabel:function(e){return this.isCurrentPage(e)?this.currentPageLabel(e):this.goToPageLabel(e)}}},i,[],!1,null,null,null);u.options.__file="src/SlidingPagination.vue";t.default=u.exports}])})); |
{ | ||
"name": "vue-sliding-pagination", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"repository": { | ||
@@ -33,3 +33,3 @@ "type": "git", | ||
"dependencies": { | ||
"vue": ">=2.4" | ||
"vue": ">=2.4|<2.6.12" | ||
}, | ||
@@ -51,6 +51,6 @@ "devDependencies": { | ||
"babel-preset-stage-2": "^6.22.0", | ||
"copy-webpack-plugin": "^5.0.4", | ||
"css-loader": "^3.2.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"copy-webpack-plugin": "^6.3.2", | ||
"css-loader": "^5.0.1", | ||
"eslint": "^7.14.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-friendly-formatter": "^4.0.1", | ||
@@ -61,10 +61,9 @@ "eslint-loader": "^4.0.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"eslint-plugin-vue": "^7.1.0", | ||
"file-loader": "^6.0.0", | ||
"friendly-errors-webpack-plugin": "^1.6.1", | ||
"jest": "^25.1.0", | ||
"jest": "^26.1.0", | ||
"jest-serializer-vue": "^2.0.2", | ||
"mini-css-extract-plugin": "^0.9.0", | ||
"node-sass": "^4.10.0", | ||
"mini-css-extract-plugin": "^1.3.1", | ||
"optimize-css-assets-webpack-plugin": "^5.0.3", | ||
@@ -74,8 +73,9 @@ "portfinder": "^1.0.13", | ||
"postcss-loader": "^3.0.0", | ||
"postcss-url": "^8.0.0", | ||
"postcss-url": "^9.0.0", | ||
"rimraf": "^3.0.0", | ||
"sass-loader": "^8.0.2", | ||
"sass": "^1.27.0", | ||
"sass-loader": "^10.0.4", | ||
"semver": "^7.1.3", | ||
"shelljs": "^0.8.3", | ||
"style-loader": "^1.0.0", | ||
"style-loader": "^2.0.0", | ||
"uglifyjs-webpack-plugin": "^2.2.0", | ||
@@ -86,7 +86,7 @@ "url-loader": "^4.0.0", | ||
"vue-style-loader": "^4.1.2", | ||
"vue-template-compiler": "^2.5.2", | ||
"vuepress": "^1.4.0", | ||
"vue-template-compiler": "2.6.11", | ||
"vuepress": "^1.7.1", | ||
"webpack": "^4.0.0", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-merge": "^4.1.0" | ||
"webpack-cli": "^4.1.0", | ||
"webpack-merge": "^5.2.0" | ||
}, | ||
@@ -93,0 +93,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35951
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/parser@7.26.2(transitive)
- Removed@babel/types@7.26.0(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@vue/compiler-core@3.5.13(transitive)
- Removed@vue/compiler-dom@3.5.13(transitive)
- Removed@vue/compiler-sfc@3.5.13(transitive)
- Removed@vue/compiler-ssr@3.5.13(transitive)
- Removed@vue/reactivity@3.5.13(transitive)
- Removed@vue/runtime-core@3.5.13(transitive)
- Removed@vue/runtime-dom@3.5.13(transitive)
- Removed@vue/server-renderer@3.5.13(transitive)
- Removed@vue/shared@3.5.13(transitive)
- Removedcsstype@3.1.3(transitive)
- Removedentities@4.5.0(transitive)
- Removedestree-walker@2.0.2(transitive)
- Removedmagic-string@0.30.13(transitive)
- Removednanoid@3.3.7(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpostcss@8.4.49(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedvue@3.5.13(transitive)
Updatedvue@>=2.4|<2.6.12