UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

26 lines (23 loc) 1.51 kB
import { __assign } from '../../node_modules/tslib/tslib.es6.js'; import React from 'react'; import PropTypes from 'prop-types'; import { CFormFeedback } from './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, __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