Svelte · Screens
EditForm
A create / edit form for any model, derived from its manifest definition and resolved field policy (#3718).Public export
typescript
import { EditForm } from '@happyvertical/smrt-svelte/screens';- Import path
@happyvertical/smrt-svelte/screens- Props
- 14
- Props described
- 11 of 14
- Bindable state
- 0
- Callback events
- 2
- Verified release
- 0.62.10
Props
NameTypeRequiredDescription
referencesScreenReferenceSourcesNoExposed target definitions, sources and optional record routes.definitionScreenCollectionDefinitionYesNot describedpolicyScreenPolicy | nullNoResolved field policy for the same object; omit for the code seed.recordScreenRecordNoThe record being edited; omit to create a new one.titlestringNoPage title. Defaults to "New x" / "Edit x" from the class name.fieldsreadonly string[]NoExplicit field names, in order (overrides the derived set).currencystringNoISO 4217 code used by money fields.showHeaderbooleanNoNot describedsubmittingbooleanNoTrue while the host is persisting; locks the form.fieldErrorsReadonly<Record<string, string>>NoServer-reported field messages, keyed by field name.errorstring | nullNoA form-level failure message from the host.derivedFieldsreadonly string[]NoFields computed elsewhere (a subtotal / tax / total worked out from the line items): shown read-only with a hint and never part of the payload.onsubmit(values: Record<string, unknown>, context: { isNew: boolean; }) => void | EditFormSubmitResult | Promise<void | EditFormSubmitResult>YesReceives wire-ready values for the displayed fields.oncancel() => voidNoNot describedBindable state
This component has no bindable public state.
Callback events
onsubmit(values: Record<string, unknown>, context: { isNew: boolean; }) => void | EditFormSubmitResult | Promise<void | EditFormSubmitResult>oncancel() => void