@clayui/pagination
Advanced tools
Comparing version 3.84.0 to 3.85.0
@@ -5,4 +5,6 @@ /** | ||
*/ | ||
import ClayLink from '@clayui/link'; | ||
import React from 'react'; | ||
export interface IPaginationItemProps extends React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement> { | ||
export interface IPaginationItemProps extends React.HTMLAttributes<HTMLAnchorElement | HTMLDivElement> { | ||
as?: 'div' | typeof ClayLink; | ||
active?: boolean; | ||
@@ -12,3 +14,3 @@ disabled?: boolean; | ||
} | ||
declare const ClayPaginationItem: ({ active, children, disabled, href, ...otherProps }: IPaginationItemProps) => JSX.Element; | ||
declare const ClayPaginationItem: ({ as: As, active, children, disabled, href, ...otherProps }: IPaginationItemProps) => JSX.Element; | ||
export default ClayPaginationItem; |
@@ -14,3 +14,3 @@ "use strict"; | ||
var _excluded = ["active", "children", "disabled", "href"]; | ||
var _excluded = ["as", "active", "children", "disabled", "href"]; | ||
@@ -26,3 +26,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var ClayPaginationItem = function ClayPaginationItem(_ref) { | ||
var _ref$active = _ref.active, | ||
var _ref$as = _ref.as, | ||
As = _ref$as === void 0 ? _link.default : _ref$as, | ||
_ref$active = _ref.active, | ||
active = _ref$active === void 0 ? false : _ref$active, | ||
@@ -40,3 +42,5 @@ children = _ref.children, | ||
}) | ||
}, /*#__PURE__*/_react.default.createElement(_link.default, _extends({}, otherProps, { | ||
}, As === 'div' ? /*#__PURE__*/_react.default.createElement(As, _extends({}, otherProps, { | ||
className: "page-link" | ||
}), children) : /*#__PURE__*/_react.default.createElement(As, _extends({}, otherProps, { | ||
"aria-current": active && href ? 'page' : undefined, | ||
@@ -53,3 +57,4 @@ className: "page-link", | ||
} | ||
} | ||
}, | ||
tabIndex: active || !href && !disabled ? 0 : undefined | ||
}), children)); | ||
@@ -56,0 +61,0 @@ }; |
@@ -14,4 +14,4 @@ /** | ||
Ellipsis: ({ alignmentPosition, disabled, disabledPages, hrefConstructor, items, onPageChange, ...otherProps }: import("./Ellipsis").IPaginationEllipsisProps) => JSX.Element; | ||
Item: ({ active, children, disabled, href, ...otherProps }: import("./Item").IPaginationItemProps) => JSX.Element; | ||
Item: ({ as: As, active, children, disabled, href, ...otherProps }: import("./Item").IPaginationItemProps) => JSX.Element; | ||
}; | ||
export default _default; |
@@ -75,2 +75,6 @@ "use strict"; | ||
if (totalPages === 0) { | ||
totalPages = 1; | ||
} | ||
var _useInternalState = (0, _shared.useInternalState)({ | ||
@@ -98,3 +102,4 @@ defaultName: 'defaultActive', | ||
}), /*#__PURE__*/_react.default.createElement(_Pagination.default.Item, { | ||
"aria-label": (0, _shared.sub)(ariaLabels.previous, [previousPage]), | ||
"aria-label": internalActive !== 1 ? (0, _shared.sub)(ariaLabels.previous, [previousPage]) : undefined, | ||
as: internalActive === 1 ? 'div' : undefined, | ||
disabled: internalActive === 1, | ||
@@ -132,3 +137,4 @@ href: previousHref, | ||
}), /*#__PURE__*/_react.default.createElement(_Pagination.default.Item, { | ||
"aria-label": (0, _shared.sub)(ariaLabels.next, [nextPage]), | ||
"aria-label": internalActive !== totalPages ? (0, _shared.sub)(ariaLabels.next, [nextPage]) : undefined, | ||
as: internalActive === totalPages ? 'div' : undefined, | ||
disabled: internalActive === totalPages, | ||
@@ -135,0 +141,0 @@ href: nextHref, |
{ | ||
"name": "@clayui/pagination", | ||
"version": "3.84.0", | ||
"version": "3.85.0", | ||
"description": "ClayPagination component", | ||
@@ -30,6 +30,6 @@ "license": "BSD-3-Clause", | ||
"@clayui/button": "^3.83.0", | ||
"@clayui/drop-down": "^3.84.0", | ||
"@clayui/drop-down": "^3.85.0", | ||
"@clayui/icon": "^3.56.0", | ||
"@clayui/link": "^3.56.0", | ||
"@clayui/shared": "^3.83.1", | ||
"@clayui/link": "^3.85.0", | ||
"@clayui/shared": "^3.85.0", | ||
"classnames": "^2.2.6" | ||
@@ -45,3 +45,3 @@ }, | ||
], | ||
"gitHead": "98a989b533a245443cdb1ed2dc954a3a367f7cb5" | ||
"gitHead": "f6f5a2415198707bd0910fb016a0c32c1a99a318" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
50444
971
Updated@clayui/drop-down@^3.85.0
Updated@clayui/link@^3.85.0
Updated@clayui/shared@^3.85.0