UNPKG

@talend/react-bootstrap

Version:

Bootstrap 3 components built with React

43 lines 1.15 kB
import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import elementType from 'prop-types-extra/lib/elementType'; import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils'; import { jsx as _jsx } from "react/jsx-runtime"; const propTypes = { horizontal: PropTypes.bool, inline: PropTypes.bool, componentClass: elementType }; const defaultProps = { horizontal: false, inline: false, componentClass: 'form' }; class Form extends React.Component { render() { const { horizontal, inline, componentClass: Component, className, ...props } = this.props; const [bsProps, elementProps] = splitBsProps(props); const classes = []; if (horizontal) { classes.push(prefix(bsProps, 'horizontal')); } if (inline) { classes.push(prefix(bsProps, 'inline')); } return /*#__PURE__*/_jsx(Component, { ...elementProps, className: classNames(className, classes) }); } } Form.propTypes = propTypes; Form.defaultProps = defaultProps; export default bsClass('form', Form); //# sourceMappingURL=Form.js.map