react-ultimate-pagination
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -19,5 +19,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
@@ -254,3 +254,7 @@ /******/ var module = installedModules[moduleId] = { | ||
process.emit = noop; | ||
process.prependListener = noop; | ||
process.prependOnceListener = noop; | ||
process.listeners = function (name) { return [] } | ||
process.binding = function (name) { | ||
@@ -276,7 +280,5 @@ throw new Error('process.binding is not supported'); | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
@@ -319,7 +321,5 @@ * | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
@@ -381,8 +381,6 @@ */ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -403,8 +401,6 @@ | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2014-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2014-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
@@ -427,41 +423,39 @@ */ | ||
if (process.env.NODE_ENV !== 'production') { | ||
(function () { | ||
var printWarning = function printWarning(format) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var printWarning = function printWarning(format) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
warning = function warning(condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
warning = function warning(condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (format.indexOf('Failed Composite propType: ') === 0) { | ||
return; // Ignore CompositeComponent proptype check. | ||
if (format.indexOf('Failed Composite propType: ') === 0) { | ||
return; // Ignore CompositeComponent proptype check. | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
printWarning.apply(undefined, [format].concat(args)); | ||
} | ||
}; | ||
})(); | ||
printWarning.apply(undefined, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
@@ -501,8 +495,6 @@ | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -525,7 +517,7 @@ | ||
var throwOnDirectAccess = true; | ||
module.exports = __webpack_require__(12)(isValidElement, throwOnDirectAccess); | ||
module.exports = __webpack_require__(13)(isValidElement, throwOnDirectAccess); | ||
} else { | ||
// By explicitly using `prop-types` you are opting into new production behavior. | ||
// http://fb.me/prop-types-in-prod | ||
module.exports = __webpack_require__(11)(); | ||
module.exports = __webpack_require__(12)(); | ||
} | ||
@@ -541,4 +533,4 @@ | ||
var ultimate_pagination_utils_1 = __webpack_require__(14); | ||
var ultimate_pagination_item_factories_1 = __webpack_require__(13); | ||
var ultimate_pagination_utils_1 = __webpack_require__(15); | ||
var ultimate_pagination_item_factories_1 = __webpack_require__(14); | ||
function getPaginationModel(options) { | ||
@@ -748,9 +740,104 @@ if (options == null) { | ||
"use strict"; | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
try { | ||
if (!Object.assign) { | ||
return false; | ||
} | ||
// Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | ||
test1[5] = 'de'; | ||
if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test2 = {}; | ||
for (var i = 0; i < 10; i++) { | ||
test2['_' + String.fromCharCode(i)] = i; | ||
} | ||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | ||
return test2[n]; | ||
}); | ||
if (order2.join('') !== '0123456789') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
test3[letter] = letter; | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== | ||
'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
return true; | ||
} catch (err) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
return false; | ||
} | ||
} | ||
module.exports = shouldUseNative() ? Object.assign : function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
}; | ||
/***/ }), | ||
/* 11 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -789,3 +876,3 @@ | ||
// behavior as without this statement except with a better message. | ||
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); | ||
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | ||
@@ -815,3 +902,3 @@ } catch (ex) { | ||
/***/ }), | ||
/* 11 */ | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -821,8 +908,6 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -872,3 +957,4 @@ | ||
oneOfType: getShim, | ||
shape: getShim | ||
shape: getShim, | ||
exact: getShim | ||
}; | ||
@@ -884,3 +970,3 @@ | ||
/***/ }), | ||
/* 12 */ | ||
/* 13 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -890,8 +976,6 @@ | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -904,5 +988,6 @@ | ||
var warning = __webpack_require__(4); | ||
var assign = __webpack_require__(10); | ||
var ReactPropTypesSecret = __webpack_require__(3); | ||
var checkPropTypes = __webpack_require__(10); | ||
var checkPropTypes = __webpack_require__(11); | ||
@@ -1003,3 +1088,4 @@ module.exports = function(isValidElement, throwOnDirectAccess) { | ||
oneOfType: createUnionTypeChecker, | ||
shape: createShapeTypeChecker | ||
shape: createShapeTypeChecker, | ||
exact: createStrictShapeTypeChecker, | ||
}; | ||
@@ -1219,3 +1305,3 @@ | ||
false, | ||
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + | ||
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | ||
'received %s at index %s.', | ||
@@ -1274,2 +1360,32 @@ getPostfixForTypeWarning(checker), | ||
function createStrictShapeTypeChecker(shapeTypes) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== 'object') { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | ||
} | ||
// We need to check all keys in case some are required but missing from | ||
// props. | ||
var allKeys = assign({}, props[propName], shapeTypes); | ||
for (var key in allKeys) { | ||
var checker = shapeTypes[key]; | ||
if (!checker) { | ||
return new PropTypeError( | ||
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | ||
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | ||
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | ||
); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
if (error) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function isNode(propValue) { | ||
@@ -1410,3 +1526,3 @@ switch (typeof propValue) { | ||
/***/ }), | ||
/* 13 */ | ||
/* 14 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1483,3 +1599,3 @@ | ||
/***/ }), | ||
/* 14 */ | ||
/* 15 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1486,0 +1602,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.reactUltimatePagination=t(require("react")):e.reactUltimatePagination=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},function(e,t,n){e.exports=n(7)()},function(e,t,n){"use strict";function r(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var n=Number(e.currentPage);if(isNaN(n))throw new Error("getPaginationModel(): currentPage should be a number");if(n<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(n>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var r=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(r))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(r<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var o=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(o))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(o<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var u=Boolean(e.hidePreviousAndNextPageLinks),s=Boolean(e.hideFirstAndLastPageLinks),c=Boolean(e.hideEllipsis),l=c?0:1,P=[],g=i.createPageFunctionFactory(e);if(s||P.push(i.createFirstPageLink(e)),u||P.push(i.createPreviousPageLink(e)),1+2*l+2*o+2*r>=t){var E=a.createRange(1,t).map(g);P.push.apply(P,E)}else{var f=r,p=a.createRange(1,f).map(g),d=t+1-r,_=t,I=a.createRange(d,_).map(g),h=Math.min(Math.max(n-o,f+l+1),d-l-2*o-1),v=h+2*o,T=a.createRange(h,v).map(g);if(P.push.apply(P,p),!c){var L=h-1,S=L===f+1,b=S?g:i.createFirstEllipsis,y=b(L);P.push(y)}if(P.push.apply(P,T),!c){var m=v+1,N=m===d-1,A=N?g:i.createSecondEllipsis,R=A(m);P.push(R)}P.push.apply(P,I)}return u||P.push(i.createNextPageLink(e)),s||P.push(i.createLastPageLink(e)),P}var a=n(10),i=n(9);t.getPaginationModel=r;var o=n(0);t.ITEM_TYPES=o.ITEM_TYPES,t.ITEM_KEYS=o.ITEM_KEYS},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ITEM_TYPES=t.createUltimatePagination=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),o=r(i),u=n(1),s=r(u),c=n(2),l=function(e,t,n){var r=function(e){return function(){n&&t!==e&&n(e)}};return function(t){var n=e[t.type],i=r(t.value);return o.default.createElement(n,a({onClick:i},t))}};t.createUltimatePagination=function(e){var t=e.itemTypeToComponent,n=e.WrapperComponent,r=void 0===n?"div":n,a=function(e){var n=e.currentPage,a=e.totalPages,i=e.boundaryPagesRange,u=e.siblingPagesRange,s=e.hideEllipsis,P=e.hidePreviousAndNextPageLinks,g=e.hideFirstAndLastPageLinks,E=e.onChange,f=(0,c.getPaginationModel)({currentPage:n,totalPages:a,boundaryPagesRange:i,siblingPagesRange:u,hideEllipsis:s,hidePreviousAndNextPageLinks:P,hideFirstAndLastPageLinks:g}),p=l(t,n,E);return o.default.createElement(r,null,f.map(p))};return a.propTypes={currentPage:s.default.number.isRequired,totalPages:s.default.number.isRequired,boundaryPagesRange:s.default.number,siblingPagesRange:s.default.number,hideEllipsis:s.default.bool,hidePreviousAndNextPageLinks:s.default.bool,hideFirstAndLastPageLinks:s.default.bool,onChange:s.default.func},a};t.ITEM_TYPES=c.ITEM_TYPES},function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,i,o,u,s){if(a(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,u,s],P=0;c=new Error(t.replace(/%s/g,function(){return l[P++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var a=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(5),a=n(6),i=n(8);e.exports=function(){function e(e,t,n,r,o,u){u!==i&&a(!1,"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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(0);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,n=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(n,t+1),isActive:t===n}},t.createLastPageLink=function(e){var t=e.currentPage,n=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:n,isActive:t===n}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},function(e,t,n){"use strict";function r(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n}t.createRange=r}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.reactUltimatePagination=t(require("react")):e.reactUltimatePagination=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},function(e,t,n){e.exports=n(7)()},function(e,t,n){"use strict";function r(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var n=Number(e.currentPage);if(isNaN(n))throw new Error("getPaginationModel(): currentPage should be a number");if(n<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(n>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var r=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(r))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(r<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var o=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(o))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(o<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var u=Boolean(e.hidePreviousAndNextPageLinks),s=Boolean(e.hideFirstAndLastPageLinks),c=Boolean(e.hideEllipsis),l=c?0:1,P=[],g=i.createPageFunctionFactory(e);if(s||P.push(i.createFirstPageLink(e)),u||P.push(i.createPreviousPageLink(e)),1+2*l+2*o+2*r>=t){var E=a.createRange(1,t).map(g);P.push.apply(P,E)}else{var f=r,p=a.createRange(1,f).map(g),d=t+1-r,_=t,I=a.createRange(d,_).map(g),h=Math.min(Math.max(n-o,f+l+1),d-l-2*o-1),v=h+2*o,T=a.createRange(h,v).map(g);if(P.push.apply(P,p),!c){var L=h-1,S=L===f+1,b=S?g:i.createFirstEllipsis,y=b(L);P.push(y)}if(P.push.apply(P,T),!c){var m=v+1,N=m===d-1,A=N?g:i.createSecondEllipsis,R=A(m);P.push(R)}P.push.apply(P,I)}return u||P.push(i.createNextPageLink(e)),s||P.push(i.createLastPageLink(e)),P}var a=n(10),i=n(9);t.getPaginationModel=r;var o=n(0);t.ITEM_TYPES=o.ITEM_TYPES,t.ITEM_KEYS=o.ITEM_KEYS},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ITEM_TYPES=t.createUltimatePagination=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),o=r(i),u=n(1),s=r(u),c=n(2),l=function(e,t,n){var r=function(e){return function(){n&&t!==e&&n(e)}};return function(t){var n=e[t.type],i=r(t.value);return o.default.createElement(n,a({onClick:i},t))}};t.createUltimatePagination=function(e){var t=e.itemTypeToComponent,n=e.WrapperComponent,r=void 0===n?"div":n,a=function(e){var n=e.currentPage,a=e.totalPages,i=e.boundaryPagesRange,u=e.siblingPagesRange,s=e.hideEllipsis,P=e.hidePreviousAndNextPageLinks,g=e.hideFirstAndLastPageLinks,E=e.onChange,f=(0,c.getPaginationModel)({currentPage:n,totalPages:a,boundaryPagesRange:i,siblingPagesRange:u,hideEllipsis:s,hidePreviousAndNextPageLinks:P,hideFirstAndLastPageLinks:g}),p=l(t,n,E);return o.default.createElement(r,null,f.map(p))};return a.propTypes={currentPage:s.default.number.isRequired,totalPages:s.default.number.isRequired,boundaryPagesRange:s.default.number,siblingPagesRange:s.default.number,hideEllipsis:s.default.bool,hidePreviousAndNextPageLinks:s.default.bool,hideFirstAndLastPageLinks:s.default.bool,onChange:s.default.func},a};t.ITEM_TYPES=c.ITEM_TYPES},function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,i,o,u,s){if(a(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,u,s],P=0;c=new Error(t.replace(/%s/g,function(){return l[P++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var a=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(5),a=n(6),i=n(8);e.exports=function(){function e(e,t,n,r,o,u){u!==i&&a(!1,"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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(0);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,n=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(n,t+1),isActive:t===n}},t.createLastPageLink=function(e){var t=e.currentPage,n=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:n,isActive:t===n}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},function(e,t,n){"use strict";function r(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n}t.createRange=r}])}); | ||
//# sourceMappingURL=react-ultimate-pagination.min.js.map |
{ | ||
"name": "react-ultimate-pagination", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "React.js pagination component based on ultimate-pagination", | ||
@@ -41,4 +41,4 @@ "main": "lib/react-ultimate-pagination.js", | ||
"peerDependencies": { | ||
"react": "^0.14.0 || ^15.0.0", | ||
"react-dom": "^0.14.0 || ^15.0.0" | ||
"react": "^0.14.0 || ^15.0.0 || ^16.0.0", | ||
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0" | ||
}, | ||
@@ -45,0 +45,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
191304
1500
0