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

47 lines
1.6 KiB
JavaScript
Raw 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 = {
tag: tagPropType,
flush: PropTypes.bool,
className: PropTypes.string,
cssModule: PropTypes.object,
horizontal: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
};
var defaultProps = {
tag: 'ul',
horizontal: false
};
var getHorizontalClass = function getHorizontalClass(horizontal) {
if (horizontal === false) {
return false;
} else if (horizontal === true || horizontal === "xs") {
return "list-group-horizontal";
}
return "list-group-horizontal-" + horizontal;
};
var ListGroup = function ListGroup(props) {
var className = props.className,
cssModule = props.cssModule,
Tag = props.tag,
flush = props.flush,
horizontal = props.horizontal,
attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush", "horizontal"]);
var classes = mapToCssModules(classNames(className, 'list-group', // list-group-horizontal cannot currently be mixed with list-group-flush
// we only try to apply horizontal classes if flush is false
flush ? 'list-group-flush' : getHorizontalClass(horizontal)), cssModule);
return /*#__PURE__*/React.createElement(Tag, _extends({}, attributes, {
className: classes
}));
};
ListGroup.propTypes = propTypes;
ListGroup.defaultProps = defaultProps;
export default ListGroup;