@coreui/react-pro
Version:
UI Components Library for React.js
38 lines (34 loc) • 1.5 kB
JavaScript
;
var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
var React = require('react');
var PropTypes = require('prop-types');
var index = require('../../_virtual/index.js');
var CLink = require('../link/CLink.js');
var props = require('../../props.js');
const CListGroupItem = React.forwardRef((_a, ref) => {
var { children, active, as = 'li', className, disabled, color } = _a, rest = tslib_es6.__rest(_a, ["children", "active", "as", "className", "disabled", "color"]);
const Component = as === 'a' || as === 'button' ? CLink.CLink : as;
rest = Object.assign(Object.assign(Object.assign(Object.assign({}, ((as === 'a' || as === 'button') && {
active,
disabled,
as,
ref: ref,
})), (active && { 'aria-current': true })), (disabled && { 'aria-disabled': true })), rest);
return (React.createElement(Component, Object.assign({ className: index.default('list-group-item', {
[`list-group-item-${color}`]: color,
'list-group-item-action': as === 'a' || as === 'button',
active,
disabled,
}, className) }, rest), children));
});
CListGroupItem.propTypes = {
active: PropTypes.bool,
as: PropTypes.elementType,
children: PropTypes.node,
className: PropTypes.string,
color: props.colorPropType,
disabled: PropTypes.bool,
};
CListGroupItem.displayName = 'CListGroupItem';
exports.CListGroupItem = CListGroupItem;
//# sourceMappingURL=CListGroupItem.js.map