/* eslint-disable react/forbid-prop-types */ /* eslint-disable react/require-default-props */ /* eslint-disable @typescript-eslint/no-explicit-any */ import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; // component - CoreUI / CInput const commonPropTypes = { className: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, PropTypes.object, ]), innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), valid: PropTypes.bool, invalid: PropTypes.bool, id: PropTypes.string, placeholder: PropTypes.string, required: PropTypes.bool, name: PropTypes.string, disabled: PropTypes.bool, autoComplete: PropTypes.string, value: PropTypes.any, onChange: PropTypes.func, }; const CInput = (props: any) => { const { className, // innerRef, type, valid, invalid, plaintext, size, sizeHtml, ...attributes } = props; // render const classes = classNames( plaintext ? 'form-control-plaintext' : 'form-control', size && `form-control-${size}`, invalid && 'is-invalid', valid && 'is-valid', className ); return ( <> ); }; CInput.propTypes = { ...commonPropTypes, plaintext: PropTypes.bool, type: PropTypes.string, size: PropTypes.string, sizeHtml: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; CInput.defaultProps = { type: 'text', }; const CTextarea = (props: any) => { const { className, // innerRef, valid, invalid, plaintext, size, ...attributes } = props; // render const classes = classNames( plaintext ? 'form-control-plaintext' : 'form-control', size && `form-control-${size}`, invalid && 'is-invalid', valid && 'is-valid', className ); return ( <>