@coreui/react-pro
Version:
UI Components Library for React.js
26 lines (22 loc) • 1.4 kB
JavaScript
'use strict';
var React = require('react');
var PropTypes = require('prop-types');
var CFormFeedback = require('./CFormFeedback.js');
const CFormControlValidation = ({ describedby, feedback, feedbackInvalid, feedbackValid, invalid, tooltipFeedback, valid, }) => {
return (React.createElement(React.Fragment, null,
feedback && (valid || invalid) && (React.createElement(CFormFeedback.CFormFeedback, Object.assign({}, (invalid && { id: describedby }), { invalid: invalid, tooltip: tooltipFeedback, valid: valid }), feedback)),
feedbackInvalid && (React.createElement(CFormFeedback.CFormFeedback, { id: describedby, invalid: true, tooltip: tooltipFeedback }, feedbackInvalid)),
feedbackValid && (React.createElement(CFormFeedback.CFormFeedback, { valid: true, tooltip: tooltipFeedback }, feedbackValid))));
};
CFormControlValidation.propTypes = {
describedby: PropTypes.string,
feedback: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
feedbackValid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
feedbackInvalid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
invalid: PropTypes.bool,
tooltipFeedback: PropTypes.bool,
valid: PropTypes.bool,
};
CFormControlValidation.displayName = 'CFormControlValidation';
exports.CFormControlValidation = CFormControlValidation;
//# sourceMappingURL=CFormControlValidation.js.map