react-responsive-pagination
Advanced tools
Comparing version 1.10.0-beta.2 to 1.10.0-beta.3
# React Responsive Pagination Changelog | ||
# [1.10.0-beta.3](https://github.com/jonelantha/react-responsive-pagination/compare/v1.10.0-beta.2...v1.10.0-beta.3) (2022-11-27) | ||
### Bug Fixes | ||
* Active page number for ARIA incorrectly being hidden ([ea955d9](https://github.com/jonelantha/react-responsive-pagination/commit/ea955d935dc08e91a3fb6c4f237ed1493dc21925)) | ||
* Remove incorrect aria-label for current page and move space into srOnly ([b1ef80d](https://github.com/jonelantha/react-responsive-pagination/commit/b1ef80dfb9cb541454afa7f769d0afb79354431e)) | ||
### Features | ||
* ariaPreviousLabel and ariaNextLabel props ([e7bdf02](https://github.com/jonelantha/react-responsive-pagination/commit/e7bdf02508a657e5e48de486ca9d43bf0ac44333)) | ||
# [1.10.0-beta.2](https://github.com/jonelantha/react-responsive-pagination/compare/v1.10.0-beta.1...v1.10.0-beta.2) (2022-11-27) | ||
@@ -4,0 +17,0 @@ |
@@ -78,5 +78,7 @@ "use strict"; | ||
function getLabel(label, a11yLabel) { | ||
return a11yLabel ? (react_1.default.createElement(react_1.default.Fragment, null, | ||
a11yLabel.mode === 'replace' ? (react_1.default.createElement("span", { "aria-hidden": "true" }, label)) : (label + (srOnlyClassName ? ' ' : '')), | ||
srOnlyClassName && (react_1.default.createElement("span", { className: srOnlyClassName }, a11yLabel.label)))) : (label); | ||
return (react_1.default.createElement(react_1.default.Fragment, null, | ||
!a11yLabel || a11yLabel.mode === 'additional' ? (label) : (react_1.default.createElement("span", { "aria-hidden": "true" }, label)), | ||
a11yLabel && srOnlyClassName && (react_1.default.createElement("span", { className: srOnlyClassName }, | ||
a11yLabel.mode === 'additional' ? ' ' : '', | ||
a11yLabel.label)))); | ||
} | ||
@@ -88,6 +90,6 @@ return (react_1.default.createElement("ul", { className: getContainerClassName(), ref: ref }, items.map(function (item) { | ||
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: linkHref === 'hash' ? '#' : undefined, onClick: (0, dom_1.preventDefault)(function () { return handlePageChange(item.gotoPage); }), "aria-label": (_a = item.a11yLabel) === null || _a === void 0 ? void 0 : _a.label }, 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": ((_a = item.a11yLabel) === null || _a === void 0 ? void 0 : _a.mode) === 'replace' ? item.a11yLabel.label : undefined }, getLabel(item.label, item.a11yLabel)))) : ( | ||
// item = NonClickableItem | ||
react_1.default.createElement("li", { key: item.key, className: "".concat(pageItemClassName, " ").concat(disabledItemClassName), "aria-hidden": item.a11yHidden }, | ||
react_1.default.createElement("span", { className: pageLinkClassName, "aria-label": (_b = item.a11yLabel) === null || _b === void 0 ? void 0 : _b.label }, getLabel(item.label, item.a11yLabel)))); | ||
react_1.default.createElement("span", { className: pageLinkClassName, "aria-label": ((_b = item.a11yLabel) === null || _b === void 0 ? void 0 : _b.mode) === 'replace' ? item.a11yLabel.label : undefined }, getLabel(item.label, item.a11yLabel)))); | ||
}))); | ||
@@ -94,0 +96,0 @@ } |
@@ -49,5 +49,7 @@ import React, { memo, useEffect } from 'react'; | ||
function getLabel(label, a11yLabel) { | ||
return a11yLabel ? (React.createElement(React.Fragment, null, | ||
a11yLabel.mode === 'replace' ? (React.createElement("span", { "aria-hidden": "true" }, label)) : (label + (srOnlyClassName ? ' ' : '')), | ||
srOnlyClassName && (React.createElement("span", { className: srOnlyClassName }, a11yLabel.label)))) : (label); | ||
return (React.createElement(React.Fragment, null, | ||
!a11yLabel || a11yLabel.mode === 'additional' ? (label) : (React.createElement("span", { "aria-hidden": "true" }, label)), | ||
a11yLabel && srOnlyClassName && (React.createElement("span", { className: srOnlyClassName }, | ||
a11yLabel.mode === 'additional' ? ' ' : '', | ||
a11yLabel.label)))); | ||
} | ||
@@ -59,6 +61,6 @@ return (React.createElement("ul", { className: getContainerClassName(), ref: ref }, items.map(function (item) { | ||
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: linkHref === 'hash' ? '#' : undefined, onClick: preventDefault(function () { return handlePageChange(item.gotoPage); }), "aria-label": (_a = item.a11yLabel) === null || _a === void 0 ? void 0 : _a.label }, getLabel(item.label, item.a11yLabel)))) : ( | ||
React.createElement("a", { className: pageLinkClassName, href: linkHref === 'hash' ? '#' : undefined, onClick: preventDefault(function () { return handlePageChange(item.gotoPage); }), "aria-label": ((_a = item.a11yLabel) === null || _a === void 0 ? void 0 : _a.mode) === 'replace' ? item.a11yLabel.label : undefined }, getLabel(item.label, item.a11yLabel)))) : ( | ||
// item = NonClickableItem | ||
React.createElement("li", { key: item.key, className: "".concat(pageItemClassName, " ").concat(disabledItemClassName), "aria-hidden": item.a11yHidden }, | ||
React.createElement("span", { className: pageLinkClassName, "aria-label": (_b = item.a11yLabel) === null || _b === void 0 ? void 0 : _b.label }, getLabel(item.label, item.a11yLabel)))); | ||
React.createElement("span", { className: pageLinkClassName, "aria-label": ((_b = item.a11yLabel) === null || _b === void 0 ? void 0 : _b.mode) === 'replace' ? item.a11yLabel.label : undefined }, getLabel(item.label, item.a11yLabel)))); | ||
}))); | ||
@@ -65,0 +67,0 @@ } |
{ | ||
"name": "react-responsive-pagination", | ||
"version": "1.10.0-beta.2", | ||
"version": "1.10.0-beta.3", | ||
"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
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
159877
3015