/** * Known issues with React Native TextInput component * 1. iOS - input inner padding is off in multiline mode * 2. Android - input has minHeight that can't be overridden with zero padding (unlike iOS) * 3. Passing typography preset that includes lineHeight usually cause alignment issues with * other elements (leading/trailing accessories). It usually best to set lineHeight with undefined */ import React, { ReactElement } from 'react'; import { ViewStyle, TextStyle } from 'react-native'; import { ForwardRefInjectedProps, BaseComponentInjectedProps, MarginModifiers, PaddingModifiers, TypographyModifiers, ColorsModifiers } from '../../commons/new'; import { ValidationMessagePosition, Validator } from './types'; import { InputProps } from './Input'; import { ValidationMessageProps } from './ValidationMessage'; import { LabelProps } from './Label'; import { FloatingPlaceholderProps } from './FloatingPlaceholder'; import { CharCounterProps } from './CharCounter'; export declare type TextFieldProps = MarginModifiers & PaddingModifiers & TypographyModifiers & ColorsModifiers & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Omit & { /** * Pass to render a leading element */ leadingAccessory?: ReactElement; /** * Pass to render a trailing element */ trailingAccessory?: ReactElement; /** * Pass to add floating placeholder support */ floatingPlaceholder?: boolean; /** * Custom style for the floating placeholder */ floatingPlaceholderStyle?: TextStyle; /** * A single or multiple validator. Can be a string (required, email) or custom function. */ validate?: Validator | Validator[]; /** * Should validate when the TextField mounts */ validateOnStart?: boolean; /** * Should validate when the TextField value changes */ validateOnChange?: boolean; /** * Should validate when losing focus of TextField */ validateOnBlur?: boolean; /** * Callback for when field validity has changed */ onChangeValidity?: (isValid: boolean) => void; /** * The position of the validation message (top/bottom) */ validationMessagePosition?: ValidationMessagePosition; /** * Internal style for the field container */ fieldStyle?: ViewStyle; /** * Container style of the whole component */ containerStyle?: ViewStyle; /** * Predefined preset to use for styling the field */ preset?: 'default' | undefined; }; export declare type InternalTextFieldProps = TextFieldProps & BaseComponentInjectedProps & ForwardRefInjectedProps; interface StaticMembers { validationMessagePositions: typeof ValidationMessagePosition; } declare const _default: React.ComponentClass<(Partial> & Partial> & import("../../commons/modifiers").CustomModifier & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Pick & { /** * Pass to render a leading element */ leadingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to render a trailing element */ trailingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to add floating placeholder support */ floatingPlaceholder?: boolean | undefined; /** * Custom style for the floating placeholder */ floatingPlaceholderStyle?: TextStyle | undefined; /** * A single or multiple validator. Can be a string (required, email) or custom function. */ validate?: "number" | Function | "required" | "email" | "url" | "price" | Validator[] | undefined; /** * Should validate when the TextField mounts */ validateOnStart?: boolean | undefined; /** * Should validate when the TextField value changes */ validateOnChange?: boolean | undefined; /** * Should validate when losing focus of TextField */ validateOnBlur?: boolean | undefined; /** * Callback for when field validity has changed */ onChangeValidity?: ((isValid: boolean) => void) | undefined; /** * The position of the validation message (top/bottom) */ validationMessagePosition?: ValidationMessagePosition | undefined; /** * Internal style for the field container */ fieldStyle?: ViewStyle | undefined; /** * Container style of the whole component */ containerStyle?: ViewStyle | undefined; /** * Predefined preset to use for styling the field */ preset?: "default" | undefined; } & { useCustomTheme?: boolean | undefined; }) | (Partial> & Partial> & import("../../commons/modifiers").CustomModifier & Partial> & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Pick & { /** * Pass to render a leading element */ leadingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to render a trailing element */ trailingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to add floating placeholder support */ floatingPlaceholder?: boolean | undefined; /** * Custom style for the floating placeholder */ floatingPlaceholderStyle?: TextStyle | undefined; /** * A single or multiple validator. Can be a string (required, email) or custom function. */ validate?: "number" | Function | "required" | "email" | "url" | "price" | Validator[] | undefined; /** * Should validate when the TextField mounts */ validateOnStart?: boolean | undefined; /** * Should validate when the TextField value changes */ validateOnChange?: boolean | undefined; /** * Should validate when losing focus of TextField */ validateOnBlur?: boolean | undefined; /** * Callback for when field validity has changed */ onChangeValidity?: ((isValid: boolean) => void) | undefined; /** * The position of the validation message (top/bottom) */ validationMessagePosition?: ValidationMessagePosition | undefined; /** * Internal style for the field container */ fieldStyle?: ViewStyle | undefined; /** * Container style of the whole component */ containerStyle?: ViewStyle | undefined; /** * Predefined preset to use for styling the field */ preset?: "default" | undefined; } & { useCustomTheme?: boolean | undefined; }) | (Partial> & Partial> & Partial> & import("../../commons/modifiers").CustomModifier & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Pick & { /** * Pass to render a leading element */ leadingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to render a trailing element */ trailingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to add floating placeholder support */ floatingPlaceholder?: boolean | undefined; /** * Custom style for the floating placeholder */ floatingPlaceholderStyle?: TextStyle | undefined; /** * A single or multiple validator. Can be a string (required, email) or custom function. */ validate?: "number" | Function | "required" | "email" | "url" | "price" | Validator[] | undefined; /** * Should validate when the TextField mounts */ validateOnStart?: boolean | undefined; /** * Should validate when the TextField value changes */ validateOnChange?: boolean | undefined; /** * Should validate when losing focus of TextField */ validateOnBlur?: boolean | undefined; /** * Callback for when field validity has changed */ onChangeValidity?: ((isValid: boolean) => void) | undefined; /** * The position of the validation message (top/bottom) */ validationMessagePosition?: ValidationMessagePosition | undefined; /** * Internal style for the field container */ fieldStyle?: ViewStyle | undefined; /** * Container style of the whole component */ containerStyle?: ViewStyle | undefined; /** * Predefined preset to use for styling the field */ preset?: "default" | undefined; } & { useCustomTheme?: boolean | undefined; }) | (Partial> & Partial> & Partial> & Partial> & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Pick & { /** * Pass to render a leading element */ leadingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to render a trailing element */ trailingAccessory?: React.ReactElement React.ReactElement | null) | (new (props: any) => React.Component)> | undefined; /** * Pass to add floating placeholder support */ floatingPlaceholder?: boolean | undefined; /** * Custom style for the floating placeholder */ floatingPlaceholderStyle?: TextStyle | undefined; /** * A single or multiple validator. Can be a string (required, email) or custom function. */ validate?: "number" | Function | "required" | "email" | "url" | "price" | Validator[] | undefined; /** * Should validate when the TextField mounts */ validateOnStart?: boolean | undefined; /** * Should validate when the TextField value changes */ validateOnChange?: boolean | undefined; /** * Should validate when losing focus of TextField */ validateOnBlur?: boolean | undefined; /** * Callback for when field validity has changed */ onChangeValidity?: ((isValid: boolean) => void) | undefined; /** * The position of the validation message (top/bottom) */ validationMessagePosition?: ValidationMessagePosition | undefined; /** * Internal style for the field container */ fieldStyle?: ViewStyle | undefined; /** * Container style of the whole component */ containerStyle?: ViewStyle | undefined; /** * Predefined preset to use for styling the field */ preset?: "default" | undefined; } & { useCustomTheme?: boolean | undefined; }), any> & StaticMembers; export default _default;