GoScrobble/web/node_modules/reactstrap/es/Pagination.js

47 lines
1.6 KiB
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { mapToCssModules, tagPropType } from './utils';
var propTypes = {
children: PropTypes.node,
className: PropTypes.string,
listClassName: PropTypes.string,
cssModule: PropTypes.object,
size: PropTypes.string,
tag: tagPropType,
listTag: tagPropType,
'aria-label': PropTypes.string
};
var defaultProps = {
tag: 'nav',
listTag: 'ul',
'aria-label': 'pagination'
};
var Pagination = function Pagination(props) {
var _classNames;
var className = props.className,
listClassName = props.listClassName,
cssModule = props.cssModule,
size = props.size,
Tag = props.tag,
ListTag = props.listTag,
label = props['aria-label'],
attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
var classes = mapToCssModules(classNames(className), cssModule);
var listClasses = mapToCssModules(classNames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
return /*#__PURE__*/React.createElement(Tag, {
className: classes,
"aria-label": label
}, /*#__PURE__*/React.createElement(ListTag, _extends({}, attributes, {
className: listClasses
})));
};
Pagination.propTypes = propTypes;
Pagination.defaultProps = defaultProps;
export default Pagination;