Interface for specifying the props of a complete field.

Payload - The types of data and payload.

interface ICompleteFieldProps<Data = IAnything, Payload = IAnything> {
    autoFocus?: boolean;
    description?: string;
    disabled?: boolean;
    groupRef?: (element?: null | HTMLDivElement) => void;
    inputAutocomplete?: "new-password" | "on" | "off" | "false";
    inputFormatter?: (input: string) => string;
    inputFormatterAllowed?: RegExp | (char: string, idx: number) => boolean;
    inputFormatterReplace?: (char: string) => null | string;
    inputFormatterSymbol?: string;
    inputFormatterTemplate?: string;
    inputMode?:
        | "search"
        | "text"
        | "email"
        | "tel"
        | "url"
        | "none"
        | "numeric"
        | "decimal";
    inputPattern?: string;
    inputRef?: (element?: null | HTMLInputElement) => void;
    inputType?:
        | "number"
        | "color"
        | "search"
        | "text"
        | "date"
        | "email"
        | "month"
        | "password"
        | "tel"
        | "time"
        | "url"
        | "week";
    keepRaw?: boolean;
    labelShrink?: boolean;
    outlined?: boolean;
    placeholder?: string;
    readonly?: boolean;
    tip?: | string[]
    | (
        value: string,
        data: Data,
        payload: Payload,
    ) => string[] | Promise<string[]>;
    tipSelect?: (
        value: string,
        data: Data,
        payload: Payload,
        onChange: (data: Data) => void,
    ) => void;
    title?: string;
    validation?: IValidation;
}

Type Parameters

Properties

autoFocus?: boolean

Specifies whether the field should be automatically focused.

description?: string

Retrieves the "description" property from a given object and its nested properties if available.

The type of the object to pick the "description" property from.

The keys of the properties in T.

The object to pick the "description" property from.

  • The picked object with "description" property.
disabled?: boolean

Represents the "disabled" property of a field.

The type of data associated with the field.

The type of payload for the field's actions.

groupRef?: (element?: null | HTMLDivElement) => void

Represents a reference to a group within a field.

inputAutocomplete?: "new-password" | "on" | "off" | "false"

Represents the optional prop "inputAutocomplete" for a field.

The value of the "inputAutocomplete" prop.

inputFormatter?: (input: string) => string

Represents the input formatter property of a field within a specific data type.

inputFormatterAllowed?: RegExp | (char: string, idx: number) => boolean

Determines whether input formatting is allowed for a given field.

inputFormatterReplace?: (char: string) => null | string

Replaces the input formatter of a field with a new one.

inputFormatterSymbol?: string

Represents the input formatter symbol for a specific field.

inputFormatterTemplate?: string

Represents a template for formatting input data.

inputMode?:
    | "search"
    | "text"
    | "email"
    | "tel"
    | "url"
    | "none"
    | "numeric"
    | "decimal"

Represents the input mode of a field in the data object payload.

inputPattern?: string

Represents the input pattern of a field.

inputRef?: (element?: null | HTMLInputElement) => void

Represents the input reference of a field.

inputType?:
    | "number"
    | "color"
    | "search"
    | "text"
    | "date"
    | "email"
    | "month"
    | "password"
    | "tel"
    | "time"
    | "url"
    | "week"

Represents the input type of a field.

The type of data associated with the field.

The type of payload associated with the field.

keepRaw?: boolean

Represents the value of the keepRaw property, which indicates whether to keep the raw data in a field.

The data type of the field.

The payload type of the field.

labelShrink?: boolean

Reduces the size of the label for a given field.

The label shrink configuration for a field.

outlined?: boolean

Returns the value of the outlined property from the provided object.

The type of the object.

The keyof T representing the property to pick.

The object from which to pick the property.

The key representing the property to pick.

  • The value of the picked property.
placeholder?: string

Retrieves the placeholder property of a given field.

The type of data associated with the field.

The type of payload associated with the field.

The type of field.

The field to pick the placeholder property from.

  • The placeholder property of the given field, if present. Otherwise, undefined.
readonly?: boolean

Retrieves the "readonly" property from the provided field object.

The field object.

  • The value of the "readonly" property.
tip?:
    | string[]
    | (
        value: string,
        data: Data,
        payload: Payload,
    ) => string[] | Promise<string[]>

Represents the "tip" property of an object.

The type of the object.

The key of the property to pick.

tipSelect?: (
    value: string,
    data: Data,
    payload: Payload,
    onChange: (data: Data) => void,
) => void

Represents a variable that holds the value of the "tipSelect" property.

title?: string

Type definition for the "title" property picked from the "IField" object type, where "IField" is a generic object with properties "Data" and "Payload". The resulting type is determined by the "PickProp" utility, which selects the specific property from the provided object type.

The generic object type with properties "Data" and "Payload".

The data type of the "IField" object.

The payload type of the "IField" object.

The specific property key to pick from the "IField" object.

The type of the picked property.

validation?: IValidation

Validation factory config

Type representing the field object.

Type representing the data object.

Type representing the payload object.

The value of the "validation" property.