Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-pagination

Package Overview
Dependencies
Maintainers
2
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-pagination - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

README.md

7

HISTORY.md

@@ -0,3 +1,10 @@

1.3.0 / 2015-11-25
==================
* Add `defaultCurrent` prop
### 1.2.0
* Allow specifying the page size for **sizeChanger**

22

lib/Pagination.js

@@ -29,5 +29,16 @@ 'use strict';

var hasOnChange = props.onChange !== noop;
var hasCurrent = props.current !== -1;
if (hasOnChange ^ hasCurrent) {
console.warn('provide `onChange` and `current` together');
}
var current = props.defaultCurrent;
if (props.current !== -1) {
current = props.current;
}
this.state = {
current: props.current,
_current: props.current,
current: current,
_current: current,
pageSize: props.pageSize

@@ -131,2 +142,5 @@ };

var page = p;
if (this.props.onChange === noop) {
return -1;
}
if (this._isValid(page)) {

@@ -314,2 +328,3 @@ if (page > this._calcPage()) {

current: React.PropTypes.number,
defaultCurrent: React.PropTypes.number,
total: React.PropTypes.number,

@@ -328,3 +343,4 @@ pageSize: React.PropTypes.number,

Pagination.defaultProps = {
current: 1,
current: -1,
defaultCurrent: 1,
total: 0,

@@ -331,0 +347,0 @@ pageSize: 10,

14

package.json
{
"name": "rc-pagination",
"version": "1.2.2",
"version": "1.3.0",
"description": "pagination ui component for react",

@@ -42,12 +42,14 @@ "keywords": [

"expect.js": "0.3.x",
"precommit-hook": "1.x",
"rc-select": "~4.2.1",
"pre-commit": "1.x",
"rc-select": "5.x",
"rc-server": "3.x",
"rc-tools": "4.x",
"react": "0.13.x",
"react-dom": "~0.14.1"
"rc-util": "3.x",
"react": "~0.14.3",
"react-addons-test-utils": "~0.14.3",
"react-dom": "~0.14.3"
},
"precommit": [
"pre-commit": [
"lint"
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc