diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml
new file mode 100644
index 0000000..9338ba6
--- /dev/null
+++ b/.idea/watcherTasks.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/dist/vue-paginate.js b/dist/vue-paginate.js
index e1b3828..ec63fa7 100644
--- a/dist/vue-paginate.js
+++ b/dist/vue-paginate.js
@@ -6885,6 +6885,9 @@
function getSimpleLinks (vm, h) {
var lastPage = vm.listOfPages.length - 1
var prevData = {
+ domProps: {
+ innerHTML: vm.simple.prev
+ },
on: {
click: function (e) {
e.preventDefault()
@@ -6893,6 +6896,9 @@
}
}
var nextData = {
+ domProps: {
+ innerHTML: vm.simple.next
+ },
on: {
click: function (e) {
e.preventDefault()
@@ -6902,8 +6908,8 @@
}
var nextListData = { class: ['next', vm.currentPage >= lastPage ? 'disabled' : ''] }
var prevListData = { class: ['prev', vm.currentPage <= 0 ? 'disabled' : ''] }
- var prevLink = h('li', prevListData, [h('a', prevData, vm.simple.prev)])
- var nextLink = h('li', nextListData, [h('a', nextData, vm.simple.next)])
+ var prevLink = h('li', prevListData, [h('a', prevData)])
+ var nextLink = h('li', nextListData, [h('a', nextData)])
return [prevLink, nextLink]
}
diff --git a/dist/vue-paginate.min.js b/dist/vue-paginate.min.js
index 8f6d23d..e1951cd 100644
--- a/dist/vue-paginate.min.js
+++ b/dist/vue-paginate.min.js
@@ -3,6 +3,6 @@
* (c) 2017 Taha Shashtari
* @license MIT
*/
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VuePaginate=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return t===!0}function r(t){return t===!1}function i(t){return"string"==typeof t||"number"==typeof t}function o(t){return null!==t&&"object"==typeof t}function a(t){return"[object Object]"===hr.call(t)}function s(t){return"[object RegExp]"===hr.call(t)}function c(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function u(t){var e=parseFloat(t);return isNaN(e)?t:e}function l(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function p(t,e){return vr.call(t,e)}function d(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}function h(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function v(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){for(var e={},n=0;n1?v(n):n;for(var r=v(arguments,1),i=0,o=n.length;ihi&&ui[n].id>t.id;)n--;ui.splice(n+1,0,t)}else ui.push(t);pi||(pi=!0,Wr(xt))}}function Lt(t){gi.clear(),Et(t,gi)}function Et(t,e){var n,r,i=Array.isArray(t);if((i||o(t))&&Object.isExtensible(t)){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(n=t.length;n--;)Et(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)Et(t[r[n]],e)}}function jt(t,e,n){yi.get=function(){return this[e][n]},yi.set=function(t){this[e][n]=t},Object.defineProperty(t,n,yi)}function Tt(t){t._watchers=[];var e=t.$options;e.props&&It(t,e.props),e.methods&&Rt(t,e.methods),e.data?Dt(t):E(t._data={},!0),e.computed&&Mt(t,e.computed),e.watch&&Ut(t,e.watch)}function It(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;Xr.shouldConvert=o;var a=function(o){i.push(o);var a=z(o,e,n,t);j(r,o,a),o in t||jt(t,"_props",o)};for(var s in e)a(s);Xr.shouldConvert=!0}function Dt(t){var e=t.$options.data;e=t._data="function"==typeof e?Nt(e,t):e||{},a(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=n.length;i--;)r&&p(r,n[i])||w(n[i])||jt(t,"_data",n[i]);E(e,!0)}function Nt(t,e){try{return t.call(e)}catch(t){return x(t,e,"data()"),{}}}function Mt(t,e){var n=t._computedWatchers=Object.create(null);for(var r in e){var i=e[r],o="function"==typeof i?i:i.get;n[r]=new mi(t,o,y,_i),r in t||Vt(t,r,i)}}function Vt(t,e,n){"function"==typeof n?(yi.get=Bt(e),yi.set=y):(yi.get=n.get?n.cache!==!1?Bt(e):n.get:y,yi.set=n.set?n.set:y),Object.defineProperty(t,e,yi)}function Bt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Jr.target&&e.depend(),e.value}}function Rt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?y:h(e[n],t)}function Ut(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function _e(t){this._init(t)}function be(t){t.use=function(t){if(t.installed)return this;var e=v(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):"function"==typeof t&&t.apply(null,e),t.installed=!0,this}}function $e(t){t.mixin=function(t){return this.options=U(this.options,t),this}}function we(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=U(n.options,t),a.super=n,a.options.props&&ke(a),a.options.computed&&Ce(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Cr.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=m({},a.options),i[r]=a,a}}function ke(t){var e=t.options.props;for(var n in e)jt(t.prototype,"_props",n)}function Ce(t){var e=t.options.computed;for(var n in e)Vt(t.prototype,n,e[n])}function xe(t){Cr.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&a(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Ae(t){return t&&(t.Ctor.options.name||t.tag)}function Oe(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:!!s(t)&&t.test(e)}function Pe(t,e,n){for(var r in t){var i=t[r];if(i){var o=Ae(i.componentOptions);o&&!n(o)&&(i!==e&&Se(i),t[r]=null)}}}function Se(t){t&&t.componentInstance.$destroy()}function Le(t){var e={};e.get=function(){return Ar},Object.defineProperty(t,"config",e),t.util={warn:Sr,extend:m,mergeOptions:U,defineReactive:j},t.set=T,t.delete=I,t.nextTick=Wr,t.options=Object.create(null),Cr.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,m(t.options.components,Oi),be(t),$e(t),we(t),xe(t)}function Ee(t){for(var n=t.data,r=t,i=t;e(i.componentInstance);)i=i.componentInstance._vnode,i.data&&(n=je(i.data,n));for(;e(r=r.parent);)r.data&&(n=je(n,r.data));return Te(n)}function je(t,n){return{staticClass:Ie(t.staticClass,n.staticClass),class:e(t.class)?[t.class,n.class]:n.class}}function Te(t){var n=t.class,r=t.staticClass;return e(r)||e(n)?Ie(r,De(n)):""}function Ie(t,e){return t?e?t+" "+e:t:e||""}function De(n){if(t(n))return"";if("string"==typeof n)return n;var r="";if(Array.isArray(n)){for(var i,a=0,s=n.length;a-1?zi[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:zi[t]=/HTMLUnknownElement/.test(e.toString())}function Ve(t){if("string"==typeof t){var e=document.querySelector(t);return e?e:document.createElement("div")}return t}function Be(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Re(t,e){return document.createElementNS(Bi[t],e)}function Ue(t){return document.createTextNode(t)}function He(t){return document.createComment(t)}function ze(t,e,n){t.insertBefore(e,n)}function Fe(t,e){t.removeChild(e)}function qe(t,e){t.appendChild(e)}function We(t){return t.parentNode}function Ke(t){return t.nextSibling}function Je(t){return t.tagName}function Ge(t,e){t.textContent=e}function Ye(t,e,n){t.setAttribute(e,n)}function Ze(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.componentInstance||t.elm,o=r.$refs;e?Array.isArray(o[n])?f(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])&&o[n].indexOf(i)<0?o[n].push(i):o[n]=[i]:o[n]=i}}function Qe(t,n){return t.key===n.key&&t.tag===n.tag&&t.isComment===n.isComment&&e(t.data)===e(n.data)&&Xe(t,n)}function Xe(t,n){if("input"!==t.tag)return!0;var r,i=e(r=t.data)&&e(r=r.attrs)&&r.type,o=e(r=n.data)&&e(r=r.attrs)&&r.type;return i===o}function tn(t,n,r){var i,o,a={};for(i=n;i<=r;++i)o=t[i].key,e(o)&&(a[o]=i);return a}function en(r){function o(t){return new ri(L.tagName(t).toLowerCase(),{},[],void 0,t)}function a(t,e){function n(){0===--n.listeners&&s(t)}return n.listeners=e,n}function s(t){var n=L.parentNode(t);e(n)&&L.removeChild(n,t)}function c(t,r,i,o,a){if(t.isRootInsert=!a,!u(t,r,i,o)){var s=t.data,c=t.children,l=t.tag;e(l)?(t.elm=t.ns?L.createElementNS(t.ns,l):L.createElement(l,t),g(t),h(t,c,r),e(s)&&m(t,r),d(i,t.elm,o)):n(t.isComment)?(t.elm=L.createComment(t.text),d(i,t.elm,o)):(t.elm=L.createTextNode(t.text),d(i,t.elm,o))}}function u(t,r,i,o){var a=t.data;if(e(a)){var s=e(t.componentInstance)&&a.keepAlive;if(e(a=a.hook)&&e(a=a.init)&&a(t,!1,i,o),e(t.componentInstance))return f(t,r),n(s)&&p(t,r,i,o),!0}}function f(t,n){e(t.data.pendingInsert)&&n.push.apply(n,t.data.pendingInsert),t.elm=t.componentInstance.$el,v(t)?(m(t,n),g(t)):(Ze(t),n.push(t))}function p(t,n,r,i){for(var o,a=t;a.componentInstance;)if(a=a.componentInstance._vnode,e(o=a.data)&&e(o=o.transition)){for(o=0;oh?(f=t(i[g+1])?null:i[g+1].elm,y(n,f,i,d,g,o)):d>g&&b(n,r,p,h)}function k(r,i,o,a){if(r!==i){if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))return i.elm=r.elm,void(i.componentInstance=r.componentInstance);var s,c=i.data;e(c)&&e(s=c.hook)&&e(s=s.prepatch)&&s(r,i);var u=i.elm=r.elm,l=r.children,f=i.children;if(e(c)&&v(i)){for(s=0;s-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Cn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function xn(t){if(t){if("object"==typeof t){var e={};return t.css!==!1&&m(e,lo(t.name||"v")),m(e,t),e}return"string"==typeof t?lo(t):void 0}}function An(t){_o(function(){_o(t)})}function On(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),kn(t,e)}function Pn(t,e){t._transitionClasses&&f(t._transitionClasses,e),Cn(t,e)}function Sn(t,e,n){var r=Ln(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===po?mo:yo,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=po,l=a,f=o.length):e===ho?u>0&&(n=ho,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?po:ho:null,f=n?n===po?o.length:c.length:0);var p=n===po&&bo.test(r[vo+"Property"]);return{type:n,timeout:l,propCount:f,hasTransform:p}}function En(t,e){for(;t.length1}function Mn(t,e){e.data.show!==!0&&Tn(e)}function Vn(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(_(Rn(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function Bn(t,e){for(var n=0,r=e.length;n0&&(t.currentPage-=1)}}},i={on:{click:function(e){e.preventDefault(),t.currentPage=n?"disabled":""]},a={class:["prev",t.currentPage<=0?"disabled":""]},s=e("li",a,[e("a",r,t.simple.prev)]),c=e("li",o,[e("a",i,t.simple.next)]);return[s,c]}function nr(t,e){return t.filter(function(t){return"paginate"===t.$vnode.componentOptions.tag}).find(function(t){return t.name===e})}function rr(t){return Array.apply(null,{length:t}).map(function(t,e){return e})}function ir(t,e,n,r){var i=r.prev,o=r.next,a=[];return t===i?a.push("left-arrow"):t===o?a.push("right-arrow"):t===Do?a.push("ellipses"):a.push("number"),t===e&&a.push("active"),t===i&&e<=0?a.push("disabled"):t===o&&e>=n&&a.push("disabled"),a}function or(t,e,n,r,i,o){var a=i.prev,s=i.next;void 0===o&&(o=null);var c=Math.floor(n/e);if(t===a)return n-1<0?0:n-1;if(t===s)return n+1>r.length-1?r.length-1:n+1;if(o&&"right-ellipses"===o)return(c+1)*e;if(o&&"left-ellipses"===o){var u=r.slice(c*e,c*e+e),l=n===r.length-1;return l&&1===u.length&&c--,(c-1)*e+e-1}return t}function ar(t){return t.map(function(e,n){return e===Do&&0===t[n-1]?"left-ellipses":e===Do&&0!==t[n-1]?"right-ellipses":e})}function sr(t,e){Object.keys(e).forEach(function(n){if("ul"===n){var r=e.ul;Array.isArray(r)?r.forEach(function(e){return t.classList.add(e)}):t.classList.add(r)}t.querySelectorAll(n).forEach(function(t){var r=e[n];Array.isArray(r)?r.forEach(function(e){return t.classList.add(e)}):t.classList.add(r)})})}function cr(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return t[e]={list:[],page:0},t},{})}var ur,lr=function(){},fr="undefined"!=typeof console;lr=function(t,e,n){void 0===n&&(n="error"),fr&&console[n]("[vue-paginate]: "+t+" "+(e?pr(ur(e)):""))},ur=function(t){if(t.$root===t)return"root instance";var e=t._isVue?t.$options.name||t.$options._componentTag:t.name;return(e?"component <"+e+">":"anonymous component")+(t._isVue&&t.$options.__file?" at "+t.$options.__file:"")};var pr=function(t){return"anonymous component"===t&&(t+=' - use the "name" option for better debugging messages.'),"\n(found in "+t+")"},dr={name:"paginate",props:{name:{type:String,required:!0},list:{type:Array,required:!0},per:{type:Number,default:3,validator:function(t){return t>0}},tag:{type:String,default:"ul"}},data:function(){return{initialListSize:this.list.length}},computed:{currentPage:{get:function(){if(this.$parent.paginate[this.name])return this.$parent.paginate[this.name].page},set:function(t){this.$parent.paginate[this.name].page=t}},pageItemsCount:function(){var t=this.list.length,e=this.currentPage*this.per+1,n=Math.min(this.currentPage*this.per+this.per,t);return e+"-"+n+" of "+t}},mounted:function(){return this.per<=0&&lr(' 'per' prop can't be 0 or less.",this.$parent),this.$parent.paginate[this.name]?void this.paginateList():void lr("'"+this.name+"' is not registered in 'paginate' array.",this.$parent)},watch:{currentPage:function(){this.paginateList()},list:function(){this.initialListSize!==this.list.length&&(this.currentPage=0),this.paginateList()},per:function(){this.currentPage=0,this.paginateList()}},methods:{paginateList:function(){var t=this.currentPage*this.per,e=this.list.slice(t,t+this.per);this.$parent.paginate[this.name].list=e},goToPage:function(t){var e=Math.ceil(this.list.length/this.per);return t>e?void lr("You cannot go to page "+t+". The last page is "+e+".",this.$parent):void(this.currentPage=t-1)}},render:function(t){return t(this.tag,{},this.$slots.default)}},hr=Object.prototype.toString,vr=(l("slot,component",!0),Object.prototype.hasOwnProperty),mr=/-(\w)/g,gr=d(function(t){return t.replace(mr,function(t,e){return e?e.toUpperCase():""})}),yr=d(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),_r=/([^-])([A-Z])/g,br=d(function(t){return t.replace(_r,"$1-$2").replace(_r,"$1-$2").toLowerCase()}),$r=function(){return!1},wr=function(t){return t},kr="data-server-rendered",Cr=["component","directive","filter"],xr=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated"],Ar={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:$r,isReservedAttr:$r,isUnknownElement:$r,getTagNamespace:y,parsePlatformTagName:wr,mustUseProp:$r,_lifecycleHooks:xr},Or=Object.freeze({}),Pr=/[^\w.$]/,Sr=y,Lr="__proto__"in{},Er="undefined"!=typeof window,jr=Er&&window.navigator.userAgent.toLowerCase(),Tr=jr&&/msie|trident/.test(jr),Ir=jr&&jr.indexOf("msie 9.0")>0,Dr=jr&&jr.indexOf("edge/")>0,Nr=jr&&jr.indexOf("android")>0,Mr=jr&&/iphone|ipad|ipod|ios/.test(jr),Vr=jr&&/chrome\/\d+/.test(jr)&&!Dr,Br=!1;if(Er)try{var Rr={};Object.defineProperty(Rr,"passive",{get:function(){Br=!0}}),window.addEventListener("test-passive",null,Rr)}catch(t){}var Ur,Hr,zr=function(){return void 0===Ur&&(Ur=!Er&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),Ur},Fr=Er&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,qr="undefined"!=typeof Symbol&&A(Symbol)&&"undefined"!=typeof Reflect&&A(Reflect.ownKeys),Wr=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1&&(e[n[0].trim()]=n[1].trim())}}),e}),io=/^--/,oo=/\s*!important$/,ao=function(t,e,n){if(io.test(e))t.style.setProperty(e,n);else if(oo.test(n))t.style.setProperty(e,n.replace(oo,""),"important");else{var r=co(e);if(Array.isArray(n))for(var i=0,o=n.length;i=this.limit&&(t.unshift(Do),t.unshift(0)),this.lastPage-this.limit>this._currentChunkIndex()&&t.push(Do),t},No.prototype._buildSecondHalf=function(){var t=[this.lastPage];return t},No.prototype._currentChunkIndex=function(){var t=Math.floor(this.currentPage/this.limit);return t*this.limit},No.prototype._allPagesButLast=function(){var t=this;return this.listOfPages.filter(function(e){return e!==t.lastPage})};var Mo={name:"paginate-links",props:{for:{type:String,required:!0},limit:{type:Number,default:0},simple:{type:Object,default:null,validator:function(t){return t.prev&&t.next}},stepLinks:{type:Object,default:function(){return{prev:To,next:Io}},validator:function(t){return t.prev&&t.next}},showStepLinks:{type:Boolean},hideSinglePage:{type:Boolean},classes:{type:Object,default:null},async:{type:Boolean,default:!1}},data:function(){return{listOfPages:[],numberOfPages:0,target:null}},computed:{currentPage:{get:function(){if(this.$parent.paginate[this.for])return this.$parent.paginate[this.for].page},set:function(t){this.$parent.paginate[this.for].page=t}}},mounted:function(){var t=this;this.simple&&this.limit&&lr(' 'simple' and 'limit' props can't be used at the same time. In this case, 'simple' will take precedence, and 'limit' will be ignored.",this.$parent,"warn"),this.simple&&!this.simple.next&&lr(' 'simple' prop doesn't contain 'next' value.",this.$parent),this.simple&&!this.simple.prev&&lr(' 'simple' prop doesn't contain 'prev' value.",this.$parent),this.stepLinks&&!this.stepLinks.next&&lr(' 'step-links' prop doesn't contain 'next' value.",this.$parent),this.stepLinks&&!this.stepLinks.prev&&lr(' 'step-links' prop doesn't contain 'prev' value.",this.$parent),_e.nextTick(function(){t.updateListOfPages()})},watch:{"$parent.paginate":{handler:function(){this.updateListOfPages()},deep:!0},currentPage:function(t,e){this.$emit("change",t+1,e+1)}},methods:{updateListOfPages:function(){if(this.target=nr(this.$parent.$children,this.for),!this.target){if(this.async)return;return lr(' can\'t be used without its companion ',this.$parent),void lr('To fix that issue you may need to use :async="true" on component to allow for asyncronous rendering',this.$parent,"warn")}this.numberOfPages=Math.ceil(this.target.list.length/this.target.per),this.listOfPages=rr(this.numberOfPages);
-}},render:function(t){var e=this;if(!this.target&&this.async)return null;var n=this.simple?er(this,t):this.limit>1?tr(this,t):Xn(this,t);if(this.hideSinglePage&&this.numberOfPages<=1)return null;var r=t("ul",{class:["paginate-links",this.for]},n);return this.classes&&_e.nextTick(function(){sr(r.elm,e.classes)}),r}},Vo={};return Vo.install=function(t){t.mixin({created:function(){"undefined"!==this.paginate&&this.paginate instanceof Array&&(this.paginate=cr(this.paginate))},methods:{paginated:function(t){return this.paginate&&this.paginate[t]?this.paginate[t].list:void lr("'"+t+"' is not registered in 'paginate' array.",this)}}}),t.component("paginate",dr),t.component("paginate-links",Mo)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(Vo),Vo});
\ No newline at end of file
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VuePaginate=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return!1===t}function i(t){return"string"==typeof t||"number"==typeof t}function o(t){return null!==t&&"object"==typeof t}function a(t){return"[object Object]"===sr.call(t)}function s(t){return"[object RegExp]"===sr.call(t)}function c(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function u(t){var e=parseFloat(t);return isNaN(e)?t:e}function l(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function p(t,e){return cr.call(t,e)}function d(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function h(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function v(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){for(var e={},n=0;nsi&&ni[n].id>t.id;)n--;ni.splice(n+1,0,t)}else ni.push(t);oi||(oi=!0,Br(kt))}}function Pt(t){li.clear(),St(t,li)}function St(t,e){var n,r,i=Array.isArray(t);if((i||o(t))&&Object.isExtensible(t)){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(n=t.length;n--;)St(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)St(t[r[n]],e)}}function Lt(t,e,n){fi.get=function(){return this[e][n]},fi.set=function(t){this[e][n]=t},Object.defineProperty(t,n,fi)}function Et(t){t._watchers=[];var e=t.$options;e.props&&Tt(t,e.props),e.methods&&Vt(t,e.methods),e.data?jt(t):E(t._data={},!0),e.computed&&Dt(t,e.computed),e.watch&&Bt(t,e.watch)}function Tt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;Wr.shouldConvert=o;for(var a in e)!function(o){i.push(o);var a=z(o,e,n,t);T(r,o,a),o in t||Lt(t,"_props",o)}(a);Wr.shouldConvert=!0}function jt(t){var e=t.$options.data;e=t._data="function"==typeof e?It(e,t):e||{},a(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=n.length;i--;)r&&p(r,n[i])||w(n[i])||Lt(t,"_data",n[i]);E(e,!0)}function It(t,e){try{return t.call(e)}catch(t){return x(t,e,"data()"),{}}}function Dt(t,e){var n=t._computedWatchers=Object.create(null);for(var r in e){var i=e[r],o="function"==typeof i?i:i.get;n[r]=new ui(t,o,y,pi),r in t||Nt(t,r,i)}}function Nt(t,e,n){"function"==typeof n?(fi.get=Mt(e),fi.set=y):(fi.get=n.get?!1!==n.cache?Mt(e):n.get:y,fi.set=n.set?n.set:y),Object.defineProperty(t,e,fi)}function Mt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Ur.target&&e.depend(),e.value}}function Vt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?y:h(e[n],t)}function Bt(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function he(t){this._init(t)}function ve(t){t.use=function(t){if(t.installed)return this;var e=v(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):"function"==typeof t&&t.apply(null,e),t.installed=!0,this}}function me(t){t.mixin=function(t){return this.options=U(this.options,t),this}}function ge(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=U(n.options,t),a.super=n,a.options.props&&ye(a),a.options.computed&&_e(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,gr.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=m({},a.options),i[r]=a,a}}function ye(t){var e=t.options.props;for(var n in e)Lt(t.prototype,"_props",n)}function _e(t){var e=t.options.computed;for(var n in e)Nt(t.prototype,n,e[n])}function be(t){gr.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&a(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function $e(t){return t&&(t.Ctor.options.name||t.tag)}function we(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:!!s(t)&&t.test(e)}function ke(t,e,n){for(var r in t){var i=t[r];if(i){var o=$e(i.componentOptions);o&&!n(o)&&(i!==e&&Ce(i),t[r]=null)}}}function Ce(t){t&&t.componentInstance.$destroy()}function xe(t){for(var n=t.data,r=t,i=t;e(i.componentInstance);)i=i.componentInstance._vnode,i.data&&(n=Ae(i.data,n));for(;e(r=r.parent);)r.data&&(n=Ae(n,r.data));return Oe(n)}function Ae(t,n){return{staticClass:Pe(t.staticClass,n.staticClass),class:e(t.class)?[t.class,n.class]:n.class}}function Oe(t){var n=t.class,r=t.staticClass;return e(r)||e(n)?Pe(r,Se(n)):""}function Pe(t,e){return t?e?t+" "+e:t:e||""}function Se(n){if(t(n))return"";if("string"==typeof n)return n;var r="";if(Array.isArray(n)){for(var i,a=0,s=n.length;a-1?Ni[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ni[t]=/HTMLUnknownElement/.test(e.toString())}function Te(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function je(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Ie(t,e){return document.createElementNS(Ti[t],e)}function De(t){return document.createTextNode(t)}function Ne(t){return document.createComment(t)}function Me(t,e,n){t.insertBefore(e,n)}function Ve(t,e){t.removeChild(e)}function Be(t,e){t.appendChild(e)}function Re(t){return t.parentNode}function Ue(t){return t.nextSibling}function He(t){return t.tagName}function ze(t,e){t.textContent=e}function Fe(t,e,n){t.setAttribute(e,n)}function qe(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.componentInstance||t.elm,o=r.$refs;e?Array.isArray(o[n])?f(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])&&o[n].indexOf(i)<0?o[n].push(i):o[n]=[i]:o[n]=i}}function We(t,n){return t.key===n.key&&t.tag===n.tag&&t.isComment===n.isComment&&e(t.data)===e(n.data)&&Ke(t,n)}function Ke(t,n){if("input"!==t.tag)return!0;var r;return(e(r=t.data)&&e(r=r.attrs)&&r.type)===(e(r=n.data)&&e(r=r.attrs)&&r.type)}function Je(t,n,r){var i,o,a={};for(i=n;i<=r;++i)o=t[i].key,e(o)&&(a[o]=i);return a}function Ge(t,e){(t.data.directives||e.data.directives)&&Ye(t,e)}function Ye(t,e){var n,r,i,o=t===Bi,a=e===Bi,s=Ze(t.data.directives,t.context),c=Ze(e.data.directives,e.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,Xe(i,"update",e,t),i.def&&i.def.componentUpdated&&l.push(i)):(Xe(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function gn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function yn(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&m(e,ro(t.name||"v")),m(e,t),e}return"string"==typeof t?ro(t):void 0}}function _n(t){fo(function(){fo(t)})}function bn(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),mn(t,e)}function $n(t,e){t._transitionClasses&&f(t._transitionClasses,e),gn(t,e)}function wn(t,e,n){var r=kn(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===oo?co:lo,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=oo,l=a,f=o.length):e===ao?u>0&&(n=ao,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?oo:ao:null,f=n?n===oo?o.length:c.length:0),{type:n,timeout:l,propCount:f,hasTransform:n===oo&&po.test(r[so+"Property"])}}function Cn(t,e){for(;t.length1}function Ln(t,e){!0!==e.data.show&&An(e)}function En(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(_(jn(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function Tn(t,e){for(var n=0,r=e.length;n0&&(t.currentPage-=1)}}},i={domProps:{innerHTML:t.simple.next},on:{click:function(e){e.preventDefault(),t.currentPage=n?"disabled":""]};return[e("li",{class:["prev",t.currentPage<=0?"disabled":""]},[e("a",r)]),e("li",o,[e("a",i)])]}function Gn(t,e){return t.filter(function(t){return"paginate"===t.$vnode.componentOptions.tag}).find(function(t){return t.name===e})}function Yn(t){return Array.apply(null,{length:t}).map(function(t,e){return e})}function Zn(t,e,n,r){var i=r.prev,o=r.next,a=[];return t===i?a.push("left-arrow"):t===o?a.push("right-arrow"):t===Ao?a.push("ellipses"):a.push("number"),t===e&&a.push("active"),t===i&&e<=0?a.push("disabled"):t===o&&e>=n&&a.push("disabled"),a}function Qn(t,e,n,r,i,o){var a=i.prev,s=i.next;void 0===o&&(o=null);var c=Math.floor(n/e);if(t===a)return n-1<0?0:n-1;if(t===s)return n+1>r.length-1?r.length-1:n+1;if(o&&"right-ellipses"===o)return(c+1)*e;if(o&&"left-ellipses"===o){var u=r.slice(c*e,c*e+e);return n===r.length-1&&1===u.length&&c--,(c-1)*e+e-1}return t}function Xn(t){return t.map(function(e,n){return e===Ao&&0===t[n-1]?"left-ellipses":e===Ao&&0!==t[n-1]?"right-ellipses":e})}function tr(t,e){Object.keys(e).forEach(function(n){if("ul"===n){var r=e.ul;Array.isArray(r)?r.forEach(function(e){return t.classList.add(e)}):t.classList.add(r)}t.querySelectorAll(n).forEach(function(t){var r=e[n];Array.isArray(r)?r.forEach(function(e){return t.classList.add(e)}):t.classList.add(r)})})}function er(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return t[e]={list:[],page:0},t},{})}var nr,rr=function(){},ir="undefined"!=typeof console;rr=function(t,e,n){void 0===n&&(n="error"),ir&&console[n]("[vue-paginate]: "+t+" "+(e?or(nr(e)):""))},nr=function(t){if(t.$root===t)return"root instance";var e=t._isVue?t.$options.name||t.$options._componentTag:t.name;return(e?"component <"+e+">":"anonymous component")+(t._isVue&&t.$options.__file?" at "+t.$options.__file:"")};var or=function(t){return"anonymous component"===t&&(t+=' - use the "name" option for better debugging messages.'),"\n(found in "+t+")"},ar={name:"paginate",props:{name:{type:String,required:!0},list:{type:Array,required:!0},per:{type:Number,default:3,validator:function(t){return t>0}},tag:{type:String,default:"ul"}},data:function(){return{initialListSize:this.list.length}},computed:{currentPage:{get:function(){if(this.$parent.paginate[this.name])return this.$parent.paginate[this.name].page},set:function(t){this.$parent.paginate[this.name].page=t}},pageItemsCount:function(){var t=this.list.length;return this.currentPage*this.per+1+"-"+Math.min(this.currentPage*this.per+this.per,t)+" of "+t}},mounted:function(){if(this.per<=0&&rr(' 'per' prop can't be 0 or less.",this.$parent),!this.$parent.paginate[this.name])return void rr("'"+this.name+"' is not registered in 'paginate' array.",this.$parent);this.paginateList()},watch:{currentPage:function(){this.paginateList()},list:function(){this.initialListSize!==this.list.length&&(this.currentPage=0),this.paginateList()},per:function(){this.currentPage=0,this.paginateList()}},methods:{paginateList:function(){var t=this.currentPage*this.per,e=this.list.slice(t,t+this.per);this.$parent.paginate[this.name].list=e},goToPage:function(t){var e=Math.ceil(this.list.length/this.per);if(t>e)return void rr("You cannot go to page "+t+". The last page is "+e+".",this.$parent);this.currentPage=t-1}},render:function(t){return t(this.tag,{},this.$slots.default)}},sr=Object.prototype.toString,cr=(l("slot,component",!0),Object.prototype.hasOwnProperty),ur=/-(\w)/g,lr=d(function(t){return t.replace(ur,function(t,e){return e?e.toUpperCase():""})}),fr=d(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),pr=/([^-])([A-Z])/g,dr=d(function(t){return t.replace(pr,"$1-$2").replace(pr,"$1-$2").toLowerCase()}),hr=function(){return!1},vr=function(t){return t},mr="data-server-rendered",gr=["component","directive","filter"],yr=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated"],_r={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:hr,isReservedAttr:hr,isUnknownElement:hr,getTagNamespace:y,parsePlatformTagName:vr,mustUseProp:hr,_lifecycleHooks:yr},br=Object.freeze({}),$r=/[^\w.$]/,wr=y,kr="__proto__"in{},Cr="undefined"!=typeof window,xr=Cr&&window.navigator.userAgent.toLowerCase(),Ar=xr&&/msie|trident/.test(xr),Or=xr&&xr.indexOf("msie 9.0")>0,Pr=xr&&xr.indexOf("edge/")>0,Sr=xr&&xr.indexOf("android")>0,Lr=xr&&/iphone|ipad|ipod|ios/.test(xr),Er=xr&&/chrome\/\d+/.test(xr)&&!Pr,Tr=!1;if(Cr)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){Tr=!0}}),window.addEventListener("test-passive",null,jr)}catch(t){}var Ir,Dr,Nr=function(){return void 0===Ir&&(Ir=!Cr&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),Ir},Mr=Cr&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Vr="undefined"!=typeof Symbol&&A(Symbol)&&"undefined"!=typeof Reflect&&A(Reflect.ownKeys),Br=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1?v(n):n;for(var r=v(arguments,1),i=0,o=n.length;i1&&(e[n[0].trim()]=n[1].trim())}}),e}),Zi=/^--/,Qi=/\s*!important$/,Xi=function(t,e,n){if(Zi.test(e))t.style.setProperty(e,n);else if(Qi.test(n))t.style.setProperty(e,n.replace(Qi,""),"important");else{var r=eo(e);if(Array.isArray(n))for(var i=0,o=n.length;ih?(f=t(i[g+1])?null:i[g+1].elm,y(n,f,i,d,g,o)):d>g&&b(n,r,p,h)}function k(r,i,o,a){if(r!==i){if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))return i.elm=r.elm,void(i.componentInstance=r.componentInstance);var s,c=i.data;e(c)&&e(s=c.hook)&&e(s=s.prepatch)&&s(r,i);var u=i.elm=r.elm,l=r.children,f=i.children;if(e(c)&&v(i)){for(s=0;s=this.limit&&(t.unshift(Ao),t.unshift(0)),this.lastPage-this.limit>this._currentChunkIndex()&&t.push(Ao),t},Oo.prototype._buildSecondHalf=function(){return[this.lastPage]},Oo.prototype._currentChunkIndex=function(){return Math.floor(this.currentPage/this.limit)*this.limit},Oo.prototype._allPagesButLast=function(){var t=this;return this.listOfPages.filter(function(e){return e!==t.lastPage})};var Po={name:"paginate-links",props:{for:{type:String,required:!0},limit:{type:Number,default:0},simple:{type:Object,default:null,validator:function(t){return t.prev&&t.next}},stepLinks:{type:Object,default:function(){return{prev:"«",next:"»"}},validator:function(t){return t.prev&&t.next}},showStepLinks:{type:Boolean},hideSinglePage:{type:Boolean},classes:{type:Object,default:null},async:{type:Boolean,default:!1}},data:function(){return{listOfPages:[],numberOfPages:0,target:null}},computed:{currentPage:{get:function(){if(this.$parent.paginate[this.for])return this.$parent.paginate[this.for].page},set:function(t){this.$parent.paginate[this.for].page=t}}},mounted:function(){var t=this;this.simple&&this.limit&&rr(' 'simple' and 'limit' props can't be used at the same time. In this case, 'simple' will take precedence, and 'limit' will be ignored.",this.$parent,"warn"),this.simple&&!this.simple.next&&rr(' 'simple' prop doesn't contain 'next' value.",this.$parent),this.simple&&!this.simple.prev&&rr(' 'simple' prop doesn't contain 'prev' value.",this.$parent),this.stepLinks&&!this.stepLinks.next&&rr(' 'step-links' prop doesn't contain 'next' value.",this.$parent),this.stepLinks&&!this.stepLinks.prev&&rr(' 'step-links' prop doesn't contain 'prev' value.",this.$parent),he.nextTick(function(){t.updateListOfPages()})},watch:{"$parent.paginate":{handler:function(){this.updateListOfPages()},deep:!0},currentPage:function(t,e){this.$emit("change",t+1,e+1)}},methods:{updateListOfPages:function(){if(this.target=Gn(this.$parent.$children,this.for),!this.target){if(this.async)return;return rr(' can\'t be used without its companion ',this.$parent),void rr('To fix that issue you may need to use :async="true" on component to allow for asyncronous rendering',this.$parent,"warn")}this.numberOfPages=Math.ceil(this.target.list.length/this.target.per),this.listOfPages=Yn(this.numberOfPages)}},render:function(t){var e=this
+;if(!this.target&&this.async)return null;var n=this.simple?Jn(this,t):this.limit>1?Kn(this,t):Wn(this,t);if(this.hideSinglePage&&this.numberOfPages<=1)return null;var r=t("ul",{class:["paginate-links",this.for]},n);return this.classes&&he.nextTick(function(){tr(r.elm,e.classes)}),r}},So={};return So.install=function(t){t.mixin({created:function(){"undefined"!==this.paginate&&this.paginate instanceof Array&&(this.paginate=er(this.paginate))},methods:{paginated:function(t){return this.paginate&&this.paginate[t]?this.paginate[t].list:void rr("'"+t+"' is not registered in 'paginate' array.",this)}}}),t.component("paginate",ar),t.component("paginate-links",Po)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(So),So});
\ No newline at end of file
diff --git a/src/components/PaginateLinks.js b/src/components/PaginateLinks.js
index 8705d79..5ea68cf 100644
--- a/src/components/PaginateLinks.js
+++ b/src/components/PaginateLinks.js
@@ -216,6 +216,9 @@ function getLimitedLinks (vm, h) {
function getSimpleLinks (vm, h) {
const lastPage = vm.listOfPages.length - 1
const prevData = {
+ domProps: {
+ innerHTML: vm.simple.prev
+ },
on: {
click: (e) => {
e.preventDefault()
@@ -224,6 +227,9 @@ function getSimpleLinks (vm, h) {
}
}
const nextData = {
+ domProps: {
+ innerHTML: vm.simple.next
+ },
on: {
click: (e) => {
e.preventDefault()
@@ -233,8 +239,8 @@ function getSimpleLinks (vm, h) {
}
const nextListData = { class: ['next', vm.currentPage >= lastPage ? 'disabled' : ''] }
const prevListData = { class: ['prev', vm.currentPage <= 0 ? 'disabled' : ''] }
- const prevLink = h('li', prevListData, [h('a', prevData, vm.simple.prev)])
- const nextLink = h('li', nextListData, [h('a', nextData, vm.simple.next)])
+ const prevLink = h('li', prevListData, [h('a', prevData)])
+ const nextLink = h('li', nextListData, [h('a', nextData)])
return [prevLink, nextLink]
}