import React from 'react'; import Input from '../Input'; import { BoxProps } from '../internals/Box'; import type { CheckType } from 'schema-typed'; import type { ErrorMessagePlacement, FormControlBaseProps, CheckTriggerType } from '../internals/types'; /** * Props that FormControl passes to its accepter */ export type FormControlAccepterProps = FormControlBaseProps; export interface FormControlProps extends BoxProps, Omit, 'value' | 'onChange' | 'color'> { /** Proxied components */ accepter?: React.ElementType; /** * The name of form-control, support nested path. such as `address.city`. * The path will be used to get and set form values. * * @example * ```js *
* * * ``` **/ name: string; /** The current value (controlled) */ value?: ValueType; /** The data validation trigger type, and it wiill overrides the setting on
*/ checkTrigger?: CheckTriggerType; /** Show error messages */ errorMessage?: React.ReactNode; /** The placement of error messages */ errorPlacement?: ErrorMessagePlacement; /** Make the control readonly */ readOnly?: boolean; /** Render the control as plain text */ plaintext?: boolean; /** Disable the form control. */ disabled?: boolean; /** Asynchronous check value */ checkAsync?: boolean; /** Remove field value and error message when component is unmounted */ shouldResetWithUnmount?: boolean; /** Validation rule */ rule?: CheckType; /** Callback fired when data changing */ onChange?(value: ValueType, event: React.SyntheticEvent): void; } export interface FormControlComponent extends React.FC { (props: FormControlProps & { accepter?: Accepter; } & React.ComponentPropsWithRef): React.ReactElement | null; } /** * The `` component is used to wrap the components that need to be validated. * @see https://rsuitejs.com/components/form/ */ declare const FormControl: FormControlComponent; export default FormControl;