Skip to main content
Version: 2.0.0-alpha

Interface: EntityFormProps<M>

Type parameters

Name
M

Properties

collection

collection: EntityCollection<M, string, User>

The collection is used to build the fields of the form

Defined in

lib/src/form/EntityForm.tsx:46


entity

Optional entity: Entity<M>

The updated entity is passed from the parent component when the underlying data has changed in the datasource

Defined in

lib/src/form/EntityForm.tsx:52


path

path: string

Path of the collection this entity is located

Defined in

lib/src/form/EntityForm.tsx:41


status

status: EntityStatus

New or existing status

Defined in

lib/src/form/EntityForm.tsx:36

Methods

onDiscard

Optional onDiscard(): void

The callback function called when discard is clicked

Returns

void

Defined in

lib/src/form/EntityForm.tsx:71


onEntitySave

Optional onEntitySave(props): Promise<void>

The callback function called when Save is clicked and validation is correct

Parameters

NameType
propsObject
props.collectionResolvedEntityCollection<M>
props.entityIdundefined | string
props.pathstring
props.previousValues?M
props.valuesM

Returns

Promise<void>

Defined in

lib/src/form/EntityForm.tsx:57


onModified

Optional onModified(dirty): void

The callback function when the form is dirty, so the values are different from the original ones

Parameters

NameType
dirtyboolean

Returns

void

Defined in

lib/src/form/EntityForm.tsx:77


onValuesChanged

Optional onValuesChanged(values?): void

The callback function when the form original values have been modified

Parameters

NameType
values?M

Returns

void

Defined in

lib/src/form/EntityForm.tsx:82