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) and, when the form has unresolved per-field errors, a structured validation alert sourced from formContext.state.errors. 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 | String|Object|Array | null | A partial theme object merged with the component's default theme; accepts a class string, class array, or theme object. | |
| 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. | |
| 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. | |
| 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-form-inner | yes | |
validation-summary | yes | Override the structured per-field validation alert shown when formContext.state.anyError is set; receives entries, count, and title. |
action-bar | yes | |
confirm-button | yes | |
cancel-button | yes | |
actions-hint | ||
form-confirm-dialog-warnings | yes |
Source
client/lib/views/ActionForm.vue