rc-pagination
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -0,3 +1,10 @@ | ||
1.3.0 / 2015-11-25 | ||
================== | ||
* Add `defaultCurrent` prop | ||
### 1.2.0 | ||
* Allow specifying the page size for **sizeChanger** |
@@ -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, |
{ | ||
"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" | ||
] | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
30149
11
722
0
91
9