Interface representing props for the IFileField component.

interface IFileFieldProps<Data = IAnything, Payload = IAnything> {
    description?: string;
    disabled?: boolean;
    fileAccept?: string;
    groupRef?: (element?: null | HTMLDivElement) => void;
    inputRef?: (element?: null | HTMLInputElement) => void;
    outlined?: boolean;
    placeholder?: string;
    readonly?: boolean;
    title?: string;
    tr?:
        | (s: string, data: Data, payload: Payload) => string
        | (s: string, data: Data, payload: Payload) => Promise<string>;
    upload?: (
        file: File,
        data: Data,
        payload: Payload,
    ) => string | Promise<string>;
    validation?: IValidation;
    view?: (file: string, data: Data, payload: Payload) => void | Promise<void>;
}

Type Parameters

  • Data = IAnything

    The data type for the field.

  • Payload = IAnything

    The payload type for the field.

Properties

description?: string

Type definition for the PickProp function. Extracts a specific property description from a given object type IField<Data, Payload>.

The type of data associated with the field.

The type of payload associated with the field.

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

The object from which to pick the description property.

  • The value of the description property if found, otherwise undefined.
disabled?: boolean

Represents the "disabled" property of a field.

fileAccept?: string

Represents the fileAccept property of a field.

The type of data associated with the field.

The type of payload associated with the field.

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

Represents a reference to a group within a field.

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

Represents the input reference associated with a field in a specific data payload.

outlined?: boolean

Picks the "outlined" property from a given object type.

placeholder?: string

Type definition for the placeholder property of a field.

The type of the field.

The key of the property to pick.

The data object containing the field.

The payload type for the field.

The field object.

  • The value of the field's placeholder property.
readonly?: boolean

Retrieves the value of the "readonly" property from the provided object.

The type of the object containing the "readonly" property.

The type of the data stored in the "IField" object.

The type of the payload stored in the "IField" object.

The object from which to retrieve the "readonly" property.

  • The value of the "readonly" property, or undefined if it is not present.
title?: string

Type definition for the 'title' property of the PickProp utility.

The type of object from which to pick the property.

The key of the property to be picked.

tr?:
    | (s: string, data: Data, payload: Payload) => string
    | (s: string, data: Data, payload: Payload) => Promise<string>

The translate label for FieldType.File

upload?: (file: File, data: Data, payload: Payload) => string | Promise<string>

Represents the 'upload' property of a given object.

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.

view?: (file: string, data: Data, payload: Payload) => void | Promise<void>

This variable represents a property 'view' extracted from an object of type PickProp<IField<Data, Payload>, 'view'>. The 'view' property is used to specify a specific view for processing fields.

The 'IField' type is a generic type that takes two type parameters: 'Data' and 'Payload'. It represents a field in a form, with 'Data' representing the data type of the field value , and 'Payload' representing additional payload data associated with the field.

The 'PickProp' utility type is used to extract the 'view' property from the 'IField' type.