UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

27 lines (23 loc) 1.99 kB
'use strict'; var React = require('react'); var PropTypes = require('prop-types'); var CFormControlValidation = require('./CFormControlValidation.js'); var CFormFloating = require('./CFormFloating.js'); var CFormLabel = require('./CFormLabel.js'); var CFormText = require('./CFormText.js'); const CFormControlWrapper = ({ children, describedby, feedback, feedbackInvalid, feedbackValid, floatingClassName, floatingLabel, id, invalid, label, text, tooltipFeedback, valid, }) => { const FormControlValidation = () => (React.createElement(CFormControlValidation.CFormControlValidation, { describedby: describedby, feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })); return floatingLabel ? (React.createElement(CFormFloating.CFormFloating, { className: floatingClassName }, children, React.createElement(CFormLabel.CFormLabel, { htmlFor: id }, label || floatingLabel), text && React.createElement(CFormText.CFormText, { id: describedby }, text), React.createElement(FormControlValidation, null))) : (React.createElement(React.Fragment, null, label && React.createElement(CFormLabel.CFormLabel, { htmlFor: id }, label), children, text && React.createElement(CFormText.CFormText, { id: describedby }, text), React.createElement(FormControlValidation, null))); }; CFormControlWrapper.propTypes = Object.assign({ children: PropTypes.node, floatingClassName: PropTypes.string, floatingLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), text: PropTypes.oneOfType([PropTypes.node, PropTypes.string]) }, CFormControlValidation.CFormControlValidation.propTypes); CFormControlWrapper.displayName = 'CFormControlWrapper'; exports.CFormControlWrapper = CFormControlWrapper; //# sourceMappingURL=CFormControlWrapper.js.map