Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,7 @@ Name | Type | Default | Description
`linkClassPrev` | String | | Class of the previous `<a>` tag
`linkClassNext` | String | | Class of the next `<a>` tag
`linkClassLast` | String | | Class of the last `<a>` tag
`onNext` | function | | invoked on next arrow click
`onPrev` | function | | invoked on prev arrow click
`onLast` | function | | invoked on Last arrow click
`onFirst` | function | | invoked on First arrow click
6 changes: 4 additions & 2 deletions dist/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ function (_Component) {
value: function handleClick(e) {
var _this$props = this.props,
isDisabled = _this$props.isDisabled,
pageNumber = _this$props.pageNumber;
pageNumber = _this$props.pageNumber,
onClick = _this$props.onClick,
ariaLabel = _this$props.ariaLabel;
e.preventDefault();

if (isDisabled) {
return;
}

this.props.onClick(pageNumber);
onClick(pageNumber, ariaLabel);
}
}, {
key: "render",
Expand Down
14 changes: 9 additions & 5 deletions dist/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function (_React$Component) {
linkClass: linkClass,
activeClass: activeClass,
activeLinkClass: activeLinkClass,
ariaLabel: "Go to page number ".concat(i)
ariaLabel: "".concat(i)
}));
}

Expand All @@ -149,7 +149,7 @@ function (_React$Component) {
itemClass: (0, _classnames["default"])(itemClass, itemClassPrev),
linkClass: (0, _classnames["default"])(linkClass, linkClassPrev),
disabledClass: disabledClass,
ariaLabel: "Go to previous page"
ariaLabel: "Previous Page"
}));
this.isFirstPageVisible(paginationInfo.has_previous_page) && pages.unshift(_react["default"].createElement(_Page["default"], {
key: "first",
Expand All @@ -161,7 +161,7 @@ function (_React$Component) {
itemClass: (0, _classnames["default"])(itemClass, itemClassFirst),
linkClass: (0, _classnames["default"])(linkClass, linkClassFirst),
disabledClass: disabledClass,
ariaLabel: "Go to first page"
ariaLabel: "Return to Beginning"
}));
this.isNextPageVisible(paginationInfo.has_next_page) && pages.push(_react["default"].createElement(_Page["default"], {
key: "next" + paginationInfo.next_page,
Expand All @@ -173,7 +173,7 @@ function (_React$Component) {
itemClass: (0, _classnames["default"])(itemClass, itemClassNext),
linkClass: (0, _classnames["default"])(linkClass, linkClassNext),
disabledClass: disabledClass,
ariaLabel: "Go to next page"
ariaLabel: "Next Page"
}));
this.isLastPageVisible(paginationInfo.has_next_page) && pages.push(_react["default"].createElement(_Page["default"], {
key: "last",
Expand All @@ -185,7 +185,7 @@ function (_React$Component) {
itemClass: (0, _classnames["default"])(itemClass, itemClassLast),
linkClass: (0, _classnames["default"])(linkClass, linkClassLast),
disabledClass: disabledClass,
ariaLabel: "Go to last page"
ariaLabel: "Go to End"
}));
return pages;
}
Expand All @@ -207,6 +207,10 @@ exports["default"] = Pagination;
_defineProperty(Pagination, "propTypes", {
totalItemsCount: _propTypes["default"].number.isRequired,
onChange: _propTypes["default"].func.isRequired,
onNext: _propTypes["default"].func,
onPrev: _propTypes["default"].func,
onFirst: _propTypes["default"].func,
onLast: _propTypes["default"].func,
activePage: _propTypes["default"].number,
itemsCountPerPage: _propTypes["default"].number,
pageRangeDisplayed: _propTypes["default"].number,
Expand Down
Loading