You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
|
/* eslint react/prop-types: 0 */
|
|
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
var Pager = function Pager(props) {
|
|
var _classNames;
|
|
|
|
var prefixCls = "".concat(props.rootPrefixCls, "-item");
|
|
var cls = classNames(prefixCls, "".concat(prefixCls, "-").concat(props.page), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-active"), props.active), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), !props.page), _defineProperty(_classNames, props.className, !!props.className), _classNames));
|
|
|
|
var handleClick = function handleClick() {
|
|
props.onClick(props.page);
|
|
};
|
|
|
|
var handleKeyPress = function handleKeyPress(e) {
|
|
props.onKeyPress(e, props.onClick, props.page);
|
|
};
|
|
|
|
return /*#__PURE__*/React.createElement("li", {
|
|
title: props.showTitle ? props.page : null,
|
|
className: cls,
|
|
onClick: handleClick,
|
|
onKeyPress: handleKeyPress,
|
|
tabIndex: "0"
|
|
}, props.itemRender(props.page, 'page', /*#__PURE__*/React.createElement("a", {
|
|
rel: "nofollow"
|
|
}, props.page)));
|
|
};
|
|
|
|
export default Pager; |