Компонент высшего порядка makeField перехватывает управление над свойствами поля

interface IManagedShallow<Data = IAnything, Payload = IAnything> {
    baseline?: boolean;
    blur?: (
        name: string,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void;
    click?: (
        name: string,
        e: MouseEvent<HTMLElement>,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void | Promise<void>;
    columns?: string;
    columnsOverride?: string;
    compute?: (v: Data, payload: Payload) => Value | Promise<Value>;
    debug?: (params: IDebug<Data, Payload>) => void;
    defaultValue?: Value | (payload: Payload) => Value;
    desktopColumns?: string;
    desktopHidden?: boolean | (payload: any) => boolean;
    dirty?: boolean;
    disabled?: boolean;
    features?: string[];
    fieldBottomMargin?: string;
    fieldRightMargin?: string;
    focus?: (
        name: string,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void;
    hidden?: boolean | (payload: Payload) => boolean;
    invalidity?: (name: string, e: string, payload: Payload) => void;
    isDisabled?: (v: Data, payload: Payload) => boolean;
    isIncorrect?: (v: Data, payload: Payload) => null | string;
    isInvalid?: (v: Data, payload: Payload) => null | string;
    isReadonly?: (v: Data, payload: Payload) => boolean;
    isVisible?: (v: Data, payload: Payload) => boolean;
    map?: (data: Data, payload: Payload) => Data;
    menu?: (
        name: string,
        action: string,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void;
    menuItems?: IFieldMenu<any, any>[];
    noBaseline?: boolean;
    phoneColumns?: string;
    phoneHidden?: boolean | (payload: any) => boolean;
    shouldRecompute?: (
        prevData: Data,
        nextData: Data,
        payload: Payload,
    ) => boolean;
    shouldUpdateItemList?: (
        prevData: Data,
        currentData: Data,
        payload: Payload,
    ) => boolean;
    shouldUpdateTr?: (
        prevArgs: [string, Data],
        currentArgs: [string, Data],
        payload: Payload,
    ) => boolean;
    sx?: any;
    tabletColumns?: string;
    tabletHidden?: boolean | (payload: any) => boolean;
    testId?: string;
}

Type Parameters

Hierarchy (View Summary)

Properties

baseline?: boolean

Represents an optional property baseline that is picked from the interface IField using the PickProp utility type.

The type of data associated with the field.

The type of payload associated with the field.

blur?: (
    name: string,
    data: Data,
    payload: Payload,
    onValueChange: (value: Value) => void,
    onChange: (data: Data) => void,
) => void

Type definition for the 'blur' property.

The 'blur' property is an optional property of type PickProp<IField<Data, Payload>, 'blur'>. It represents whether the field should be blurred or not.

click?: (
    name: string,
    e: MouseEvent<HTMLElement>,
    data: Data,
    payload: Payload,
    onValueChange: (value: Value) => void,
    onChange: (data: Data) => void,
) => void | Promise<void>

Represents the "click" property of a specific field in a data object.

columns?: string

Retrieves the specific columns from a given object.

columnsOverride?: string

Represents override columns configuration for a field.

compute?: (v: Data, payload: Payload) => Value | Promise<Value>

Type definition for the compute property of an object.

Type declaration

debug?: (params: IDebug<Data, Payload>) => void

Represents the debug property of a field.

defaultValue?: Value | (payload: Payload) => Value

Retrieves the defaultValue property from the given field.

The field to get the defaultValue from.

  • The defaultValue of the field, if defined.
desktopColumns?: string

Represents the number of columns on a desktop layout for a field in a data payload object.

desktopHidden?: boolean | (payload: any) => boolean

Represents the optional property desktopHidden of type PickProp<IField<Data, Payload>, 'desktopHidden'>.

dirty?: boolean

Отменяет ожидание фокуса для валидации

disabled?: boolean

Represents the disabled property of a field.

features?: string[]

Extracts the 'features' property from the given variable.

The variable to pick 'features' property from.

  • The extracted 'features' property.
fieldBottomMargin?: string

Represents the optional configuration for the bottom margin of a field.

fieldRightMargin?: string

Represents the right margin of a field.

focus?: (
    name: string,
    data: Data,
    payload: Payload,
    onValueChange: (value: Value) => void,
    onChange: (data: Data) => void,
) => void

Type definition for the focus property with pick properties.

The focus property is used to pick a specific property from an object type. This type definition is a utility type that leverages Pick and keyof to select the specified property from the provided object type.

hidden?: boolean | (payload: Payload) => boolean

Type definition for the 'hidden' property of a field in a form.

The type of data object expected by the form.

The type of payload expected when submitting the form.

The type of the 'hidden' property in the field.

invalidity?: (name: string, e: string, payload: Payload) => void
isDisabled?: (v: Data, payload: Payload) => boolean

Represents the isDisabled property of a field object.

The isDisabled property indicates whether a field is disabled or not. If isDisabled is true, the field is disabled, meaning it cannot be interacted with. If isDisabled is false, the field is enabled and can be interacted with.

isIncorrect?: (v: Data, payload: Payload) => null | string

Checks if the field is incorrect.

Type declaration

    • (v: Data, payload: Payload): null | string
    • Parameters

      Returns null | string

      • A boolean indicating whether the field is incorrect.
isInvalid?: (v: Data, payload: Payload) => null | string

Represents the isInvalid field of a given field.

isReadonly?: (v: Data, payload: Payload) => boolean

Determines if the field is readonly.

isVisible?: (v: Data, payload: Payload) => boolean

Determines the visibility of a field.

Type declaration

    • (v: Data, payload: Payload): boolean
    • Parameters

      Returns boolean

      • Returns true if the field is visible, false otherwise.

The isVisible property is used to determine whether a field is visible or hidden.

map?: (data: Data, payload: Payload) => Data

Represents a map property of a field.

menu?: (
    name: string,
    action: string,
    data: Data,
    payload: Payload,
    onValueChange: (value: Value) => void,
    onChange: (data: Data) => void,
) => void

Represents the 'menu' variable.

menuItems?: IFieldMenu<any, any>[]

Represents the menuItems property of a field in a form.

noBaseline?: boolean

Represents an optional property noBaseline that is picked from the interface IField using the PickProp utility type.

The type of data associated with the field.

The type of payload associated with the field.

phoneColumns?: string

Represents the phone columns configuration for a field

phoneHidden?: boolean | (payload: any) => boolean

Represents the phoneHidden property of a field object.

shouldRecompute?: (prevData: Data, nextData: Data, payload: Payload) => boolean

Determines if the field should be recomputed.

shouldUpdateItemList?: (
    prevData: Data,
    currentData: Data,
    payload: Payload,
) => boolean

Check if 'shouldUpdateItemList' property is present in the given variable.

Type declaration

    • (prevData: Data, currentData: Data, payload: Payload): boolean
    • Parameters

      Returns boolean

      • Returns true if 'shouldUpdateItemList' property is present, otherwise false.
shouldUpdateTr?: (
    prevArgs: [string, Data],
    currentArgs: [string, Data],
    payload: Payload,
) => boolean

Determines if the 'shouldUpdateTr' property should be updated.

sx?: any

Represents the 'sx' property of the 'PickProp' type.

tabletColumns?: string

Represents the number of columns for the "tablet" viewport size of a field. This property is optional.

tabletHidden?: boolean | (payload: any) => boolean

Represents the optional property 'tabletHidden' in a field object.

testId?: string

Идентификатор для тестирования шаблона