diff --git a/dist/index.js b/dist/index.js index e4a7f32..8e913a0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=4)}([function(e,t){e.exports=require("react")},function(e,t,r){e.exports=r(2)()},function(e,t,r){"use strict";var n=r(3);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,o,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";r.r(t);var n=r(0),a=r.n(n),o=r(1),i=r.n(o);function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:1,n=e,a=[];n<=t;)a.push(n),n+=r;return a};function g(e){var t=s(Object(n.useState)(function(){return t=e.totalRecords,r=void 0===t?null:t,n=e.pageLimit,a=void 0===n?20:n,o=e.pageNeighbours,{pageLimit:a="number"==typeof a?a:20,totalRecords:r="number"==typeof r?r:0,pageNeighbours:i="number"==typeof(i=void 0===o?0:o)?Math.max(0,Math.min(i,2)):0,totalPages:Math.ceil(r/a)};var t,r,n,a,o,i}),2),r=t[0],o=t[1],i=Object(n.useRef)(!0);Object(n.useEffect)(function(){g(1)},[g]),Object(n.useEffect)(function(){e.setOffset((e.currentPage-1)*e.pageLimit)},[e.currentPage]),Object(n.useEffect)(function(){if(i.current)i.current=!1;else{var t=e.totalRecords,n=Math.ceil(t/r.pageLimit);o(function(e){for(var t=1;to+2){var i=[],u=n-a,s=n+a,g=t-1,b=u>2?u:2,m=s2,d=m2&&void 0!==arguments[2]?arguments[2]:1,n=e,a=[];n<=t;)a.push(n),n+=r;return a};function g(e){var t=s(Object(n.useState)(function(){return t=e.totalRecords,r=void 0===t?null:t,n=e.pageLimit,a=void 0===n?20:n,o=e.pageNeighbours,{pageLimit:a="number"==typeof a?a:20,totalRecords:r="number"==typeof r?r:0,pageNeighbours:i="number"==typeof(i=void 0===o?0:o)?Math.max(0,Math.min(i,2)):0,totalPages:Math.ceil(r/a)};var t,r,n,a,o,i}),2),r=t[0],o=t[1],i=Object(n.useRef)(!0);Object(n.useEffect)(function(){g(1)},[g]),Object(n.useEffect)(function(){e.setOffset((e.currentPage-1)*e.pageLimit)},[e.currentPage]),Object(n.useEffect)(function(){if(i.current)i.current=!1;else{var t=e.totalRecords,n=Math.ceil(t/r.pageLimit);o(function(e){for(var t=1;to+2){var i=[],u=n-a,s=n+a,g=t-1,b=u>2?u:2,m=s2,d=m