react-ultimate-pagination
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -91,10 +91,10 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var createUltimatePagination = exports.createUltimatePagination = function createUltimatePagination(_ref) { | ||
var itemTypeToComponent = _ref.itemTypeToComponent; | ||
var _ref$WrapperComponent = _ref.WrapperComponent; | ||
var WrapperComponent = _ref$WrapperComponent === undefined ? 'div' : _ref$WrapperComponent; | ||
var itemTypeToComponent = _ref.itemTypeToComponent, | ||
_ref$WrapperComponent = _ref.WrapperComponent, | ||
WrapperComponent = _ref$WrapperComponent === undefined ? 'div' : _ref$WrapperComponent; | ||
var UltimatePaginationComponent = function UltimatePaginationComponent(_ref2) { | ||
var currentPage = _ref2.currentPage; | ||
var totalPages = _ref2.totalPages; | ||
var onChange = _ref2.onChange; | ||
var currentPage = _ref2.currentPage, | ||
totalPages = _ref2.totalPages, | ||
onChange = _ref2.onChange; | ||
@@ -224,4 +224,4 @@ var paginationModel = (0, _ultimatePagination.getPaginationModel)({ currentPage: currentPage, totalPages: totalPages }); | ||
return { | ||
type: ultimate_pagination_constants_1.ITEM_TYPES.PREVIOS_PAGE_LINK, | ||
key: ultimate_pagination_constants_1.ITEM_KEYS.PREVIOS_PAGE_LINK, | ||
type: ultimate_pagination_constants_1.ITEM_TYPES.PREVIOUS_PAGE_LINK, | ||
key: ultimate_pagination_constants_1.ITEM_KEYS.PREVIOUS_PAGE_LINK, | ||
value: Math.max(1, currentPage - 1), | ||
@@ -271,3 +271,3 @@ isActive: currentPage === 1 | ||
FIRST_PAGE_LINK: 'FIRST_PAGE_LINK', | ||
PREVIOS_PAGE_LINK: 'PREVIOS_PAGE_LINK', | ||
PREVIOUS_PAGE_LINK: 'PREVIOUS_PAGE_LINK', | ||
NEXT_PAGE_LINK: 'NEXT_PAGE_LINK', | ||
@@ -280,3 +280,3 @@ LAST_PAGE_LINK: 'LAST_PAGE_LINK' | ||
FIRST_PAGE_LINK: -3, | ||
PREVIOS_PAGE_LINK: -4, | ||
PREVIOUS_PAGE_LINK: -4, | ||
NEXT_PAGE_LINK: -5, | ||
@@ -283,0 +283,0 @@ LAST_PAGE_LINK: -6 |
@@ -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(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(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 r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(5),u=n(i),o=r(4),c=function(e,t,r){var n=function(e){return function(){r&&t!==e&&r(e)}};return function(t){var r=e[t.type],i=n(t.value);return u["default"].createElement(r,a({onClick:i},t))}};t.createUltimatePagination=function(e){var t=e.itemTypeToComponent,r=e.WrapperComponent,n=void 0===r?"div":r,a=function(e){var r=e.currentPage,a=e.totalPages,i=e.onChange,E=(0,o.getPaginationModel)({currentPage:r,totalPages:a}),P=c(t,r,i);return u["default"].createElement(n,null,E.map(P))};return a.propTypes={currentPage:u["default"].PropTypes.number.isRequired,totalPages:u["default"].PropTypes.number.isRequired,onChange:u["default"].PropTypes.func},a};t.ITEM_TYPES=o.ITEM_TYPES},function(e,t){"use strict";t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOS_PAGE_LINK:"PREVIOS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLISPIS:-2,FIRST_PAGE_LINK:-3,PREVIOS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},function(e,t,r){"use strict";var n=r(1);t.createFirstEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.SECOND_ELLISPIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.FIRST_PAGE_LINK,key:n.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.PREVIOS_PAGE_LINK,key:n.ITEM_KEYS.PREVIOS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,r=e.totalPages;return{type:n.ITEM_TYPES.NEXT_PAGE_LINK,key:n.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(r,t+1),isActive:t===r}},t.createLastPageLink=function(e){var t=e.currentPage,r=e.totalPages;return{type:n.ITEM_TYPES.LAST_PAGE_LINK,key:n.ITEM_KEYS.LAST_PAGE_LINK,value:r,isActive:t===r}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:n.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},function(e,t){"use strict";function r(e,t){for(var r=[],n=e;t>=n;n++)r.push(n);return r}t.createRange=r},function(e,t,r){"use strict";function n(e){var t=e.currentPage,r=e.totalPages,n=[],u=i.createPageFunctionFactory(e),o=Math.max(2,Math.max(t-1,3)-Math.max(0,t+3-r)),c=Math.min(r-1,Math.min(t+1,r-2)+Math.max(0,4-t)),E=a.createRange(o,c).map(u);return n.push(i.createFirstPageLink(e)),n.push(i.createPreviousPageLink(e)),n.push(u(1)),o>3?n.push(i.createFirstEllipsis(o-1)):2!==o&&n.push(u(2)),n.push.apply(n,E),r-2>c?n.push(i.createSecondEllipsis(c+1)):c!==r-1&&n.push(u(r-1)),r>1&&n.push(u(r)),n.push(i.createNextPageLink(e)),n.push(i.createLastPageLink(e)),n}var a=r(3),i=r(2);t.getPaginationModel=n;var u=r(1);t.ITEM_TYPES=u.ITEM_TYPES,t.ITEM_KEYS=u.ITEM_KEYS},function(t,r){t.exports=e}])}); | ||
!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(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(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 r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(5),u=n(i),o=r(4),c=function(e,t,r){var n=function(e){return function(){r&&t!==e&&r(e)}};return function(t){var r=e[t.type],i=n(t.value);return u.default.createElement(r,a({onClick:i},t))}};t.createUltimatePagination=function(e){var t=e.itemTypeToComponent,r=e.WrapperComponent,n=void 0===r?"div":r,a=function(e){var r=e.currentPage,a=e.totalPages,i=e.onChange,E=(0,o.getPaginationModel)({currentPage:r,totalPages:a}),P=c(t,r,i);return u.default.createElement(n,null,E.map(P))};return a.propTypes={currentPage:u.default.PropTypes.number.isRequired,totalPages:u.default.PropTypes.number.isRequired,onChange:u.default.PropTypes.func},a};t.ITEM_TYPES=o.ITEM_TYPES},function(e,t){"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_ELLISPIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},function(e,t,r){"use strict";var n=r(1);t.createFirstEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.SECOND_ELLISPIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.FIRST_PAGE_LINK,key:n.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:n.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,r=e.totalPages;return{type:n.ITEM_TYPES.NEXT_PAGE_LINK,key:n.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(r,t+1),isActive:t===r}},t.createLastPageLink=function(e){var t=e.currentPage,r=e.totalPages;return{type:n.ITEM_TYPES.LAST_PAGE_LINK,key:n.ITEM_KEYS.LAST_PAGE_LINK,value:r,isActive:t===r}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:n.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},function(e,t){"use strict";function r(e,t){for(var r=[],n=e;n<=t;n++)r.push(n);return r}t.createRange=r},function(e,t,r){"use strict";function n(e){var t=e.currentPage,r=e.totalPages,n=[],u=i.createPageFunctionFactory(e),o=Math.max(2,Math.max(t-1,3)-Math.max(0,t+3-r)),c=Math.min(r-1,Math.min(t+1,r-2)+Math.max(0,4-t)),E=a.createRange(o,c).map(u);return n.push(i.createFirstPageLink(e)),n.push(i.createPreviousPageLink(e)),n.push(u(1)),o>3?n.push(i.createFirstEllipsis(o-1)):2!==o&&n.push(u(2)),n.push.apply(n,E),c<r-2?n.push(i.createSecondEllipsis(c+1)):c!==r-1&&n.push(u(r-1)),r>1&&n.push(u(r)),n.push(i.createNextPageLink(e)),n.push(i.createLastPageLink(e)),n}var a=r(3),i=r(2);t.getPaginationModel=n;var u=r(1);t.ITEM_TYPES=u.ITEM_TYPES,t.ITEM_KEYS=u.ITEM_KEYS},function(t,r){t.exports=e}])}); | ||
//# sourceMappingURL=react-ultimate-pagination.min.js.map |
@@ -35,10 +35,10 @@ 'use strict'; | ||
var createUltimatePagination = exports.createUltimatePagination = function createUltimatePagination(_ref) { | ||
var itemTypeToComponent = _ref.itemTypeToComponent; | ||
var _ref$WrapperComponent = _ref.WrapperComponent; | ||
var WrapperComponent = _ref$WrapperComponent === undefined ? 'div' : _ref$WrapperComponent; | ||
var itemTypeToComponent = _ref.itemTypeToComponent, | ||
_ref$WrapperComponent = _ref.WrapperComponent, | ||
WrapperComponent = _ref$WrapperComponent === undefined ? 'div' : _ref$WrapperComponent; | ||
var UltimatePaginationComponent = function UltimatePaginationComponent(_ref2) { | ||
var currentPage = _ref2.currentPage; | ||
var totalPages = _ref2.totalPages; | ||
var onChange = _ref2.onChange; | ||
var currentPage = _ref2.currentPage, | ||
totalPages = _ref2.totalPages, | ||
onChange = _ref2.onChange; | ||
@@ -45,0 +45,0 @@ var paginationModel = (0, _ultimatePagination.getPaginationModel)({ currentPage: currentPage, totalPages: totalPages }); |
{ | ||
"name": "react-ultimate-pagination", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "React.js pagination component based on ultimate-pagination", | ||
@@ -39,3 +39,3 @@ "main": "lib/react-ultimate-pagination.js", | ||
"react-dom": "^15.0.1", | ||
"ultimate-pagination": "0.7.0" | ||
"ultimate-pagination": "0.8.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -44,3 +44,3 @@ [![ultimate-pagination logo](https://raw.githubusercontent.com/ultimate-pagination/logo/master/ultimate-pagination-250x250.png)](https://github.com/ultimate-pagination/react-ultimate-pagination) | ||
- `FIRST_PAGE_LINK` - a link to the first page | ||
- `PREVIOS_PAGE_LINK` - a link to the previous page | ||
- `PREVIOUS_PAGE_LINK` - a link to the previous page | ||
- `NEXT_PAGE_LINK` - a link to the next page | ||
@@ -73,3 +73,3 @@ - `LAST_PAGE_LINK` - a link to the last page | ||
function PreviousPageLink(props) { | ||
return <button onClick={props.onClick}>Previos</button> | ||
return <button onClick={props.onClick}>Previous</button> | ||
} | ||
@@ -93,3 +93,3 @@ | ||
'FIRST_PAGE_LINK': FirstPageLink, | ||
'PREVIOS_PAGE_LINK': PreviousPageLink, | ||
'PREVIOUS_PAGE_LINK': PreviousPageLink, | ||
'NEXT_PAGE_LINK': NextPageLink, | ||
@@ -96,0 +96,0 @@ 'LAST_PAGE_LINK': LastPageLink |
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
64201
+ Addedultimate-pagination@0.8.0(transitive)
- Removedultimate-pagination@0.7.0(transitive)
Updatedultimate-pagination@0.8.0