react-responsive-pagination
Advanced tools
Comparing version 1.8.1 to 1.9.0-beta.1
# React Responsive Pagination Changelog | ||
# [1.9.0-beta.1](https://github.com/jonelantha/react-responsive-pagination/compare/v1.8.1...v1.9.0-beta.1) (2022-11-20) | ||
### Bug Fixes | ||
* Remove href attribute ([8a38c8a](https://github.com/jonelantha/react-responsive-pagination/commit/8a38c8a29bfa36db81527942150e009bbcd69b0a)) | ||
### Features | ||
* linkHref prop to omit href from a tags ([f5b0567](https://github.com/jonelantha/react-responsive-pagination/commit/f5b0567ca2b2935b8d2a0b47a404f34a21f52f62)) | ||
## [1.8.1](https://github.com/jonelantha/react-responsive-pagination/compare/v1.8.0...v1.8.1) (2022-11-19) | ||
@@ -4,0 +16,0 @@ |
@@ -12,3 +12,3 @@ import React from 'react'; | ||
export default _default; | ||
declare function BootstrapPagination({ current, total, onPageChange: handlePageChange, maxWidth, narrowStrategy, className, extraClassName, pageItemClassName, pageLinkClassName, activeItemClassName, disabledItemClassName, srOnlyClassName, previousLabel, nextLabel, a11yActiveLabel, ariaCurrentAttr, }: BootstrapPaginationProps): JSX.Element | null; | ||
declare function BootstrapPagination({ current, total, onPageChange: handlePageChange, maxWidth, narrowStrategy, className, extraClassName, pageItemClassName, pageLinkClassName, activeItemClassName, disabledItemClassName, srOnlyClassName, previousLabel, nextLabel, a11yActiveLabel, ariaCurrentAttr, linkHref, }: BootstrapPaginationProps): JSX.Element | null; | ||
declare namespace BootstrapPagination { | ||
@@ -33,2 +33,3 @@ var propTypes: { | ||
ariaCurrentAttr: PropTypes.Requireable<boolean>; | ||
linkHref: PropTypes.Requireable<string>; | ||
}; | ||
@@ -54,2 +55,3 @@ } | ||
ariaCurrentAttr?: boolean; | ||
linkHref?: 'hash' | 'omit'; | ||
}; |
@@ -43,4 +43,4 @@ "use strict"; | ||
function BootstrapPagination(_a) { | ||
var current = _a.current, total = _a.total, handlePageChange = _a.onPageChange, maxWidth = _a.maxWidth, narrowStrategy = _a.narrowStrategy, className = _a.className, _b = _a.extraClassName, extraClassName = _b === void 0 ? 'justify-content-center' : _b, _c = _a.pageItemClassName, pageItemClassName = _c === void 0 ? 'page-item' : _c, _d = _a.pageLinkClassName, pageLinkClassName = _d === void 0 ? 'page-link' : _d, _e = _a.activeItemClassName, activeItemClassName = _e === void 0 ? 'active' : _e, _f = _a.disabledItemClassName, disabledItemClassName = _f === void 0 ? 'disabled' : _f, _g = _a.srOnlyClassName, srOnlyClassName = _g === void 0 ? 'sr-only' : _g, previousLabel = _a.previousLabel, nextLabel = _a.nextLabel, _h = _a.a11yActiveLabel, a11yActiveLabel = _h === void 0 ? '(current)' : _h, ariaCurrentAttr = _a.ariaCurrentAttr; | ||
var _j = (0, usePaginationItems_1.usePaginationItems)(current, total, maxWidth, { | ||
var current = _a.current, total = _a.total, handlePageChange = _a.onPageChange, maxWidth = _a.maxWidth, narrowStrategy = _a.narrowStrategy, className = _a.className, _b = _a.extraClassName, extraClassName = _b === void 0 ? 'justify-content-center' : _b, _c = _a.pageItemClassName, pageItemClassName = _c === void 0 ? 'page-item' : _c, _d = _a.pageLinkClassName, pageLinkClassName = _d === void 0 ? 'page-link' : _d, _e = _a.activeItemClassName, activeItemClassName = _e === void 0 ? 'active' : _e, _f = _a.disabledItemClassName, disabledItemClassName = _f === void 0 ? 'disabled' : _f, _g = _a.srOnlyClassName, srOnlyClassName = _g === void 0 ? 'sr-only' : _g, previousLabel = _a.previousLabel, nextLabel = _a.nextLabel, _h = _a.a11yActiveLabel, a11yActiveLabel = _h === void 0 ? '(current)' : _h, ariaCurrentAttr = _a.ariaCurrentAttr, _j = _a.linkHref, linkHref = _j === void 0 ? 'hash' : _j; | ||
var _k = (0, usePaginationItems_1.usePaginationItems)(current, total, maxWidth, { | ||
narrowStrategy: narrowStrategy, | ||
@@ -50,3 +50,3 @@ previousLabel: previousLabel, | ||
a11yActiveLabel: a11yActiveLabel, | ||
}), items = _j.items, ref = _j.ref, clearCache = _j.clearCache; | ||
}), items = _k.items, ref = _k.ref, clearCache = _k.clearCache; | ||
(0, react_1.useEffect)(function () { | ||
@@ -85,3 +85,3 @@ return function () { return clearCache(); }; | ||
react_1.default.createElement("li", { key: item.key, className: "".concat(pageItemClassName).concat(item.active && activeItemClassName ? ' ' + activeItemClassName : ''), "aria-current": item.active && ariaCurrentAttr ? 'page' : undefined }, | ||
react_1.default.createElement("a", { className: pageLinkClassName, href: "#", onClick: (0, dom_1.preventDefault)(function () { return handlePageChange(item.gotoPage); }), "aria-label": item.a11yLabel }, getLabel(item.label, item.a11yLabel)))) : ( | ||
react_1.default.createElement("a", { className: pageLinkClassName, href: linkHref === 'hash' ? '#' : undefined, onClick: (0, dom_1.preventDefault)(function () { return handlePageChange(item.gotoPage); }), "aria-label": item.a11yLabel }, getLabel(item.label, item.a11yLabel)))) : ( | ||
// item = NonClickableItem | ||
@@ -113,2 +113,3 @@ react_1.default.createElement("li", { key: item.key, className: "".concat(pageItemClassName, " ").concat(disabledItemClassName), "aria-hidden": item.a11yHidden }, | ||
ariaCurrentAttr: prop_types_1.default.bool, | ||
linkHref: prop_types_1.default.oneOf(['hash', 'omit']), | ||
}; |
@@ -12,3 +12,3 @@ import React from 'react'; | ||
export default _default; | ||
declare function BootstrapPagination({ current, total, onPageChange: handlePageChange, maxWidth, narrowStrategy, className, extraClassName, pageItemClassName, pageLinkClassName, activeItemClassName, disabledItemClassName, srOnlyClassName, previousLabel, nextLabel, a11yActiveLabel, ariaCurrentAttr, }: BootstrapPaginationProps): JSX.Element | null; | ||
declare function BootstrapPagination({ current, total, onPageChange: handlePageChange, maxWidth, narrowStrategy, className, extraClassName, pageItemClassName, pageLinkClassName, activeItemClassName, disabledItemClassName, srOnlyClassName, previousLabel, nextLabel, a11yActiveLabel, ariaCurrentAttr, linkHref, }: BootstrapPaginationProps): JSX.Element | null; | ||
declare namespace BootstrapPagination { | ||
@@ -33,2 +33,3 @@ var propTypes: { | ||
ariaCurrentAttr: PropTypes.Requireable<boolean>; | ||
linkHref: PropTypes.Requireable<string>; | ||
}; | ||
@@ -54,2 +55,3 @@ } | ||
ariaCurrentAttr?: boolean; | ||
linkHref?: 'hash' | 'omit'; | ||
}; |
@@ -14,4 +14,4 @@ import React, { memo, useEffect } from 'react'; | ||
function BootstrapPagination(_a) { | ||
var current = _a.current, total = _a.total, handlePageChange = _a.onPageChange, maxWidth = _a.maxWidth, narrowStrategy = _a.narrowStrategy, className = _a.className, _b = _a.extraClassName, extraClassName = _b === void 0 ? 'justify-content-center' : _b, _c = _a.pageItemClassName, pageItemClassName = _c === void 0 ? 'page-item' : _c, _d = _a.pageLinkClassName, pageLinkClassName = _d === void 0 ? 'page-link' : _d, _e = _a.activeItemClassName, activeItemClassName = _e === void 0 ? 'active' : _e, _f = _a.disabledItemClassName, disabledItemClassName = _f === void 0 ? 'disabled' : _f, _g = _a.srOnlyClassName, srOnlyClassName = _g === void 0 ? 'sr-only' : _g, previousLabel = _a.previousLabel, nextLabel = _a.nextLabel, _h = _a.a11yActiveLabel, a11yActiveLabel = _h === void 0 ? '(current)' : _h, ariaCurrentAttr = _a.ariaCurrentAttr; | ||
var _j = usePaginationItems(current, total, maxWidth, { | ||
var current = _a.current, total = _a.total, handlePageChange = _a.onPageChange, maxWidth = _a.maxWidth, narrowStrategy = _a.narrowStrategy, className = _a.className, _b = _a.extraClassName, extraClassName = _b === void 0 ? 'justify-content-center' : _b, _c = _a.pageItemClassName, pageItemClassName = _c === void 0 ? 'page-item' : _c, _d = _a.pageLinkClassName, pageLinkClassName = _d === void 0 ? 'page-link' : _d, _e = _a.activeItemClassName, activeItemClassName = _e === void 0 ? 'active' : _e, _f = _a.disabledItemClassName, disabledItemClassName = _f === void 0 ? 'disabled' : _f, _g = _a.srOnlyClassName, srOnlyClassName = _g === void 0 ? 'sr-only' : _g, previousLabel = _a.previousLabel, nextLabel = _a.nextLabel, _h = _a.a11yActiveLabel, a11yActiveLabel = _h === void 0 ? '(current)' : _h, ariaCurrentAttr = _a.ariaCurrentAttr, _j = _a.linkHref, linkHref = _j === void 0 ? 'hash' : _j; | ||
var _k = usePaginationItems(current, total, maxWidth, { | ||
narrowStrategy: narrowStrategy, | ||
@@ -21,3 +21,3 @@ previousLabel: previousLabel, | ||
a11yActiveLabel: a11yActiveLabel, | ||
}), items = _j.items, ref = _j.ref, clearCache = _j.clearCache; | ||
}), items = _k.items, ref = _k.ref, clearCache = _k.clearCache; | ||
useEffect(function () { | ||
@@ -56,3 +56,3 @@ return function () { return clearCache(); }; | ||
React.createElement("li", { key: item.key, className: "".concat(pageItemClassName).concat(item.active && activeItemClassName ? ' ' + activeItemClassName : ''), "aria-current": item.active && ariaCurrentAttr ? 'page' : undefined }, | ||
React.createElement("a", { className: pageLinkClassName, href: "#", onClick: preventDefault(function () { return handlePageChange(item.gotoPage); }), "aria-label": item.a11yLabel }, getLabel(item.label, item.a11yLabel)))) : ( | ||
React.createElement("a", { className: pageLinkClassName, href: linkHref === 'hash' ? '#' : undefined, onClick: preventDefault(function () { return handlePageChange(item.gotoPage); }), "aria-label": item.a11yLabel }, getLabel(item.label, item.a11yLabel)))) : ( | ||
// item = NonClickableItem | ||
@@ -84,2 +84,3 @@ React.createElement("li", { key: item.key, className: "".concat(pageItemClassName, " ").concat(disabledItemClassName), "aria-hidden": item.a11yHidden }, | ||
ariaCurrentAttr: PropTypes.bool, | ||
linkHref: PropTypes.oneOf(['hash', 'omit']), | ||
}; |
{ | ||
"name": "react-responsive-pagination", | ||
"version": "1.8.1", | ||
"version": "1.9.0-beta.1", | ||
"description": "React component for responsive pagination", | ||
@@ -5,0 +5,0 @@ "author": "jonelantha", |
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
149488
2858
1