跳到主要内容

ui/build/collection-form/collection-form-values

ui/build/collection-form/collection-form-values

Functions

assertCollectionFormFieldRegistration()

function assertCollectionFormFieldRegistration(
   collection,
   expectedKeys,
   registrations): void;

Defined in: apps/website/.api-docs-entry/ui/build/collection-form/collection-form-values.d.ts:16

Enforce explicit, complete form composition.

System identity remains in the record baseline for update routing, but it is framework-hidden: authors neither declare it nor satisfy completeness with it. A hidden Field still registers, so it satisfies this contract without mounting a control.

Parameters

Parameter Type
collection string
expectedKeys readonly string[]
registrations ReadonlyMap<string, number>

Returns

void


collectionFormWriteColumns()

function collectionFormWriteColumns(selection): string[];

Defined in: apps/website/.api-docs-entry/ui/build/collection-form/collection-form-values.d.ts:8

The exact catalog-backed field set a collection form must declare: the selection's columns.

Parameters

Parameter Type
selection CollectionWriteSelection

Returns

string[]


collectionFormWriteSelection()

function collectionFormWriteSelection(write, editing): CollectionWriteSelection | undefined;

Defined in: apps/website/.api-docs-entry/ui/build/collection-form/collection-form-values.d.ts:6

The selection a form writes through: update when it edits an existing record, create for a draft. Absent, the collection declares no such operation and the form is read-only.

Parameters

Parameter Type
write CollectionWriteContract | undefined
editing boolean

Returns

CollectionWriteSelection | undefined


pickCollectionFormValues()

function pickCollectionFormValues(fields, values): Record<string, unknown>;

Defined in: apps/website/.api-docs-entry/ui/build/collection-form/collection-form-values.d.ts:18

Build the form baseline without exposing framework identity to authored field composition.

Parameters

Parameter Type
fields readonly CollectionField<string>[]
values Readonly<Record<string, unknown>>

Returns

Record<string, unknown>


pickWritableFormValues()

function pickWritableFormValues(
   writableColumns,
   values,
relations?): Record<string, unknown>;

Defined in: apps/website/.api-docs-entry/ui/build/collection-form/collection-form-values.d.ts:27

Keeps only values the collection form is allowed to send back to a write.

An edit form starts from a complete hydrated row so it can render field values and framework metadata. The write boundary is deliberately narrower: the declared selection's columns, so an undeclared key can never reach the graph. The selection's with relations ride along when custom composition set them (a matrix stating a schedule's complete desired set).

Parameters

Parameter Type
writableColumns readonly string[]
values Readonly<Record<string, unknown>>
relations? readonly string[]

Returns

Record<string, unknown>