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

    Type Alias RefFieldDataProps

    Data plumbing for resolving and creating ref targets: how to look up the ref type, query candidate objects, map them to options, and persist a newly-created one.

    type RefFieldDataProps = {
        getCreateDefaults?: (
            props: { jsonPath: string; schema: Type.AnyEntity },
        ) => Record<string, unknown> | undefined;
        getOptions?: (
            objects: Entity.Any[],
            options?: {
                getTypePlaceholder?: (typename: string) => string;
                parentLabel?: boolean;
            },
        ) => RefOption[];
        onCreate?: (
            schema: Type.AnyEntity,
            values: any,
        ) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void;
        resolveCreateEntry?: (typename: string) => CreateEntryOverride | undefined;
        useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
        useType?: (db?: Database.Database, typeUri?: URI.URI) => Type.AnyEntity;
    }
    Index

    Properties

    getCreateDefaults?: (
        props: { jsonPath: string; schema: Type.AnyEntity },
    ) => Record<string, unknown> | undefined

    Supply default values for a newly-created owned object when the user clicks "add" on an owned-ref array field (see FormCreateAnnotation). Keyed by the field's json path so a container can pre-populate the new object (e.g. a back-reference to the parent). The returned values are passed to onCreate(schema, values) before the object is persisted.

    getOptions?: (
        objects: Entity.Any[],
        options?: {
            getTypePlaceholder?: (typename: string) => string;
            parentLabel?: boolean;
        },
    ) => RefOption[]
    onCreate?: (
        schema: Type.AnyEntity,
        values: any,
    ) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void

    Persist a newly-created object. Called after the user fills out the inline create form and clicks Save. Should add the object to the database and return it (sync or async). The returned object is then wired into this slot's form value as a Ref.

    resolveCreateEntry?: (typename: string) => CreateEntryOverride | undefined

    Optional resolver that maps a ref's typename to a CreateEntryOverride, replacing the raw ECHO type schema and/or the default onCreate path with plugin-registered create logic (e.g. SpaceCapabilities.CreateObjectEntry). When absent or returning undefined for a given typename the existing fallback behaviour is preserved.

    useResults?: (db?: Database.Database, typename?: string) => Entity.Any[]
    useType?: (db?: Database.Database, typeUri?: URI.URI) => Type.AnyEntity