UNPKG

ffr-components

Version:

Fiori styled UI components

57 lines (49 loc) 2.15 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; import _inherits from "@babel/runtime/helpers/esm/inherits"; import classnames from 'classnames'; import React from 'react'; var InnerListItem = /*#__PURE__*/ function (_React$Component) { _inherits(InnerListItem, _React$Component); function InnerListItem() { _classCallCheck(this, InnerListItem); return _possibleConstructorReturn(this, _getPrototypeOf(InnerListItem).apply(this, arguments)); } _createClass(InnerListItem, [{ key: "render", value: function render() { var _classnames; var _this$props = this.props, children = _this$props.children, className = _this$props.className, renderSelection = _this$props.renderSelection, forwardRef = _this$props.forwardRef, tabIndex = _this$props.tabIndex, props = _objectWithoutProperties(_this$props, ["children", "className", "renderSelection", "forwardRef", "tabIndex"]); var listGroupItemClasses = classnames((_classnames = { 'fd-list-group__item': true }, _defineProperty(_classnames, className, className), _defineProperty(_classnames, 'selected-item', renderSelection), _classnames)); return React.createElement("li", _extends({ tabIndex: tabIndex }, props, { ref: forwardRef, className: listGroupItemClasses }), children); } }]); return InnerListItem; }(React.Component); InnerListItem.displayName = 'ListGroup.Item'; var ListItem = React.forwardRef(function (props, ref) { return React.createElement(InnerListItem, _extends({}, props, { forwardRef: ref })); }); export default ListItem;