@dxos/react-ui-form
    Preparing search index...

    Type Alias FormHandler<T>

    FormHandler: Pick<FormHandlerProps<T>, "schema" | "autoSave"> & {
        canSave: boolean;
        changed: Record<SchemaEx.JsonPath, boolean>;
        commitOn: CommitOn;
        errors: Record<SchemaEx.JsonPath, string>;
        getOverride: (path: (string | number)[]) => FormFieldOverride | undefined;
        getStatus: (path: string | (string | number)[]) => FormFieldStatus;
        getValue: <V>(path: (string | number)[]) => V | undefined;
        isValid: boolean;
        onBlur: (path: (string | number)[]) => void;
        onCancel: () => void;
        onRevert: (path: (string | number)[]) => void;
        onSave: () => void;
        onValueChange: <V>(
            path: (string | number)[],
            type: SchemaAST.AST,
            value: V,
        ) => void;
        touched: Record<SchemaEx.JsonPath, boolean>;
        values: Partial<T>;
    }

    Form handler properties and methods.

    Type Parameters

    • T extends AnyProperties

    Type declaration

    • canSave: boolean

      Whether the submit affordance should be enabled. Stricter than isValid: it also requires no save in flight (saving) and only blocks on errors for touched fields, so a pristine form with not-yet-touched required fields can still show an enabled control.

    • changed: Record<SchemaEx.JsonPath, boolean>

      Fields whose value has been edited (set by onValueChange). Gates autosave-on-blur.

    • commitOn: CommitOn

      When typed values commit.

    • errors: Record<SchemaEx.JsonPath, string>

      Map of error strings.

    • getOverride: (path: (string | number)[]) => FormFieldOverride | undefined

      The caller's override for the field at path, if any.

    • getStatus: (path: string | (string | number)[]) => FormFieldStatus
    • getValue: <V>(path: (string | number)[]) => V | undefined
    • isValid: boolean

      Whether the values pass validation (no errors at all).

    • onBlur: (path: (string | number)[]) => void
    • onCancel: () => void
    • onRevert: (path: (string | number)[]) => void

      Drops the field's uncommitted edit, so it shows the source again and its blur saves nothing.

    • onSave: () => void
    • onValueChange: <V>(path: (string | number)[], type: SchemaAST.AST, value: V) => void
    • touched: Record<SchemaEx.JsonPath, boolean>

      Fields the user has interacted with (set by onBlur). Gates error visibility — errors only surface once touched.

    • values: Partial<T>

      Initial values (which may not pass validation).