@coreui/react-pro
Version:
UI Components Library for React.js
24 lines (21 loc) • 1.32 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { CFormFeedback } from './CFormFeedback.js';
const CFormControlValidation = ({ describedby, feedback, feedbackInvalid, feedbackValid, invalid, tooltipFeedback, valid, }) => {
return (React.createElement(React.Fragment, null,
feedback && (valid || invalid) && (React.createElement(CFormFeedback, Object.assign({}, (invalid && { id: describedby }), { invalid: invalid, tooltip: tooltipFeedback, valid: valid }), feedback)),
feedbackInvalid && (React.createElement(CFormFeedback, { id: describedby, invalid: true, tooltip: tooltipFeedback }, feedbackInvalid)),
feedbackValid && (React.createElement(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';
export { CFormControlValidation };
//# sourceMappingURL=CFormControlValidation.js.map