Form
<sea-form> displays a submission's data with corrections and source citations. Inside a process, step-label and step-role resolve the corresponding step's output submission. The form uses the same data viewer for every submission.
| At a glance | |
|---|---|
| Type | Building block |
| Element | sea-form |
| React | SeaForm from @sea-dev/widget-lit/react/form |
| Without React | @sea-dev/widget-lit/form |
| Connection | An ancestor Context provider |
| Configure | Attributes and properties |
Usage
Set step-label="data" or inherit a binding from a step group. Add step-role to constrain the expected step kind. These selectors choose the submission to display. Set is-check separately to present boolean values as check decisions. Step binding covers unique labels and outputs from multi steps.
A pending or blocked manual step displays its linked draft so values can be reviewed before completing the input. Other step outputs appear when completed. A step without an output stays empty.
tsx
import * as React from "react";
import { SeaContextProvider } from "@sea-dev/widget-lit/react/context";
import { SeaProcess } from "@sea-dev/widget-lit/react/process";
import { SeaForm } from "@sea-dev/widget-lit/react/form";
export function GroupedData(p: {
bearerToken: string;
runId: string;
stepLabel?: string;
formFieldIds?: readonly string[];
submissionGroupIds?: readonly string[];
}) {
return (
<SeaContextProvider bearerToken={p.bearerToken}>
<SeaProcess runId={p.runId}>
<SeaForm
stepLabel={p.stepLabel ?? "data"}
formFieldIds={p.formFieldIds}
submissionGroupIds={p.submissionGroupIds}
/>
</SeaProcess>
</SeaContextProvider>
);
}Use Application integration to add a source viewer beside the data.
Edit a field inline, then choose Save or press Enter in its value control. Leaving a field keeps its draft. Choose Cancel or press Escape to restore its saved value. Correction reasons are optional. Enter adds a new line in the reason box. If a save fails, the value and reason remain available for retry. Each field keeps its own draft. Save or cancel all drafts before switching records. Set read-only to disable edits while retaining source navigation.
Attributes and properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
activeCitationId | active-citation-id | string or undefined | — | Selects the citation whose field the viewer scrolls into view. |
formFieldIds | — | readonly string[] or undefined | — | Selects form fields by ID, with an omitted list showing all visible fields and an empty list showing none. |
submissionGroupIds | — | readonly string[] or undefined | — | Selects submission groups by ID, with an omitted list showing all entries and an empty list showing none. |
stepLabel | step-label | string or undefined | — | Selects one step by its unique pipeline label within the enclosing process. |
stepRole | step-role | PipelineStepRoleWire or undefined | — | Validates the selected step's purpose, such as extraction or analysis. |
stepId | step-id | string or undefined | — | Selects a pipeline step definition within the enclosing process. |
runStepId | run-step-id | string or undefined | — | Selects one executable step instance within the enclosing process. |
outputFormId | output-form-id | string or undefined | — | Narrows the selected step's outputs to this form. |
outputSubmissionId | output-submission-id | string or undefined | — | Selects an exact output submission from the enclosing process. |
frontMatter | — | Record<string, string> or undefined | — | Supplies metadata displayed above the grouped values. |
routingClass | routing-class | string | "" | Displays the selected routing class. Changes emit an event for host persistence. |
isCheck | is-check | boolean | false | Displays boolean fields as check decisions. |
noToolbar | no-toolbar | boolean | false | Hides the viewer filter and sort toolbar. |
noBanner | no-banner | boolean | false | Hides viewer-level status and review banners. |
readOnly | read-only | boolean | false | Disables edits and group changes while keeping source navigation available. |
parentGroupFilter | parent-group-filter | string | "" | Applies the host-selected group filter. |
parentFieldFilter | parent-field-filter | string | "" | Applies the host-selected field filter. |
parentFieldSort | parent-field-sort | string | "" | Applies the host-selected field sort. |
parentAlertsOnly | parent-alerts-only | boolean | false | Restricts the viewer to fields needing review. |
Events
| Event | Type | Description |
|---|---|---|
citation-cleared | CustomEvent | Clears source selection with a null detail. |
citation-selected | CustomEvent | { citationId, documentExtractionId?, annotationKey?, confidenceReview? } when a source is selected. |
correction-submitted | CustomEvent | { submissionId, itemId, correction, cleared? } after a correction is saved. |
routing-class-changed | CustomEvent | { submissionId, previous, value } for the host to persist the selected class. |
entry-removed | CustomEvent | { submissionId, formGroupId, groupId, order } when entry removal is staged. |
entry-restored | CustomEvent | { submissionId, groupId, order } when staged removal is undone. |
value-changed | CustomEvent | { submissionId, itemId, value } after the current value changes. |
checks-status | CustomEvent | { submissionId, approveAllowed, amberUnresolved, redCount, greenCount } when check readiness changes. |
Filtering and review controls
formFieldIds and submissionGroupIds are array properties. Unset includes all matching fields or entries. An empty array includes none. frontMatter supplies metadata displayed above groups. isCheck presents boolean fields as check decisions. noToolbar and noBanner hide the viewer's own controls when the host supplies them.
parentGroupFilter, parentFieldFilter, parentFieldSort and parentAlertsOnly apply externally selected filter and sort settings.
Labelled check outputs
Use is-check to review values produced by a particular labelled check step:
html
<sea-form step-label="doc-check" is-check></sea-form>
<sea-form step-label="cross-check" is-check></sea-form>Step binding explains label and output selection. Backend accuracy flags remain until the backend clears them. Opening a source does not clear them.
What it needs from the API
An ancestor Sea context supplies the client. The enclosing process loads the selected output submission. Existing submission views can load through Sea context directly. The viewer saves corrections through the API. routing-class-changed reports a requested routing class for the host to persist. Entry removal and restoration events describe staged changes. Confirmed removal deletes the entry through the API.
Styling parts
| Part | Description |
|---|---|
root | The form container. |
toolbar | The filter and display controls. |
content | The scrollable values area. |
group | A group of fields. |
field | An individual field row. |
status | Loading, empty and error messages. |
Common problems
| Symptom | Action |
|---|---|
| No data | Check the ancestor context and submission ID |
| Fields are missing | Check the array filter properties and hidden field definitions |
| Source unavailable | Check the item's citation and source document |