ActionForm
Overview
Form shell that executes a server action, handles dry-run validation, shows success/error toasts, and provides confirm and cancel button slots.
Renders a pinned actions strip (confirm + cancel + optional hint) below the form, or, with the page prop, a sticky action bar above it. When the form has per-field errors that no rendered field shows beside itself, it also renders a structured validation alert sourced from formContext.state.errors. The alert sits with the non-field error block above the fields, so a reader meets it before the first field and the submit control. Also mounts a FormConfirmDialog bound to the action's confirmation controller, so actions the server gates behind warning acknowledgement (HTTP 409) can be confirmed and retried. ActionForm renders no warnings content of its own; a consumer that needs to render them (e.g. a bulk action grouping per-object warnings by their display name) supplies the form-confirm-dialog-warnings slot, which forwards FormConfirmDialog's warnings slot scope (warnings, the controller's raw warnings mapping). Without that slot, FormConfirmDialog's own default rendering shows through.
Theme entry: ActionForm
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| iconOverride | Object | null | A partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants. | |
| themeOverride | Object | null | A partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants. | |
| runAction | func | undefined | Function to execute the action. | |
| actionSuccessSummary | string | undefined | Toast summary text shown when the action succeeds. | |
| actionErrorSummary | string | undefined | Toast summary text shown when the action fails. | |
| confirmMessage | string | undefined | Confirmation message displayed to the user before executing the action (reserved for future use). | |
| fetchState | object | { errored: false, error: null, loading: undefined } | Reactive state object describing the data-fetch status (errored, error, loading). | |
| actionState | object | { errored: false, error: null, loading: undefined } | Reactive state object describing the action execution status (errored, error, loading). | |
| hasInput | boolean | false | Whether the form has user input fields that must be validated before submission. | |
| redirectTo | func | undefined | Async function called to navigate away after a successful action or cancel; receives "success" or "cancel" as its argument. After success, the form stays locked until it unmounts unless the function resolves false to report that it did not navigate away. | |
| onSubmissionSuccessHandler | func | undefined | Custom handler called on successful submission in place of the default success toast and redirect. | |
| onSubmissionErrorHandler | func | undefined | Custom handler called on submission error in place of the default error toast. | |
| onSubmissionWarningsRequireConfirmation | func | undefined | Custom handler called when the server requires confirmation of warnings (HTTP 409) in place of the default render-warnings-and-prompt behaviour. | |
| readyToDryRun | boolean | false | When set to true, triggers a dry-run validation pass without submitting the form. | |
| dryRunTarget | string | undefined | Identity of the current dry-run target (e.g. useModelAction's joined pks). The dry-run watcher latches on this, firing once per distinct value rather than every time readyToDryRun recomputes to true. Omit it for a caller with no target concept; the watcher then fires at most once, ever. | |
| cancelButton | boolean | true | When false, the default action bar has no cancel button. A view whose page title already offers a Go Back action sets this, so the page does not offer two ways back. | |
| page | boolean | false | When true, the form fills a view's page. The default action bar renders first, in a top-zone StickyBar that stacks with the page title, and the confirm button stays tied to the form through its form attribute. The error display, the validation summary, and the form follow in the page gutter. Without a sticky stack, the bar still renders first and spans the page, as the detail views' action bar does. A form inside a dialog or a card leaves this off. | |
| requireModified | boolean | true | When false, skips the "no changes detected" guard. Defaults to true. Set to false for forms that start empty where modification is not a meaningful concept. |
Slots
| Name | Scoped | Description |
|---|---|---|
action-bar | yes | |
confirm-button | yes | |
cancel-button | yes | |
actions-hint | ||
validation-summary | yes | Override the structured per-field validation alert shown when formContext.state.anyError is set and at least one field error has no rendered field showing it; receives entries (each { field, label, messages }, limited to those errors), count, and title. |
action-form-inner | yes | |
form-confirm-dialog-warnings | yes |
Source
client/lib/views/ActionForm.vue