@coreui/react
Version:
UI Components Library for React.js
28 lines (24 loc) • 1.6 kB
JavaScript
'use strict';
var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
var React = require('react');
var PropTypes = require('prop-types');
var CFormFeedback = require('./CFormFeedback.js');
var CFormControlValidation = function (_a) {
var describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, invalid = _a.invalid, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
return (React.createElement(React.Fragment, null,
feedback && (valid || invalid) && (React.createElement(CFormFeedback.CFormFeedback, tslib_es6.__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