UNPKG

@talend/react-bootstrap

Version:

Bootstrap 3 components built with React

34 lines 1.14 kB
import classNames from 'classnames'; import React, { cloneElement } from 'react'; import PropTypes from 'prop-types'; import PagerItem from './PagerItem'; import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils'; import createChainedFunction from './utils/createChainedFunction'; import ValidComponentChildren from './utils/ValidComponentChildren'; import { jsx as _jsx } from "react/jsx-runtime"; const propTypes = { onSelect: PropTypes.func }; class Pager extends React.Component { render() { const { onSelect, className, children, ...props } = this.props; const [bsProps, elementProps] = splitBsProps(props); const classes = getClassSet(bsProps); return /*#__PURE__*/_jsx("ul", { ...elementProps, className: classNames(className, classes), children: ValidComponentChildren.map(children, child => /*#__PURE__*/cloneElement(child, { onSelect: createChainedFunction(child.props.onSelect, onSelect) })) }); } } Pager.propTypes = propTypes; Pager.Item = PagerItem; export default bsClass('pager', Pager); //# sourceMappingURL=Pager.js.map