Skip to content

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
TypeBuilding block
Elementsea-form
ReactSeaForm from @sea-dev/widget-lit/react/form
Without React@sea-dev/widget-lit/form
ConnectionAn ancestor Context provider
ConfigureAttributes 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 ​

PropertyAttributeTypeDefaultDescription
activeCitationIdactive-citation-idstring 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.
stepLabelstep-labelstring or undefined—Selects one step by its unique pipeline label within the enclosing process.
stepRolestep-rolePipelineStepRoleWire or undefined—Validates the selected step's purpose, such as extraction or analysis.
stepIdstep-idstring or undefined—Selects a pipeline step definition within the enclosing process.
runStepIdrun-step-idstring or undefined—Selects one executable step instance within the enclosing process.
outputFormIdoutput-form-idstring or undefined—Narrows the selected step's outputs to this form.
outputSubmissionIdoutput-submission-idstring or undefined—Selects an exact output submission from the enclosing process.
frontMatter—Record<string, string> or undefined—Supplies metadata displayed above the grouped values.
routingClassrouting-classstring""Displays the selected routing class. Changes emit an event for host persistence.
isCheckis-checkbooleanfalseDisplays boolean fields as check decisions.
noToolbarno-toolbarbooleanfalseHides the viewer filter and sort toolbar.
noBannerno-bannerbooleanfalseHides viewer-level status and review banners.
readOnlyread-onlybooleanfalseDisables edits and group changes while keeping source navigation available.
parentGroupFilterparent-group-filterstring""Applies the host-selected group filter.
parentFieldFilterparent-field-filterstring""Applies the host-selected field filter.
parentFieldSortparent-field-sortstring""Applies the host-selected field sort.
parentAlertsOnlyparent-alerts-onlybooleanfalseRestricts the viewer to fields needing review.

Events ​

EventTypeDescription
citation-clearedCustomEventClears source selection with a null detail.
citation-selectedCustomEvent{ citationId, documentExtractionId?, annotationKey?, confidenceReview? } when a source is selected.
correction-submittedCustomEvent{ submissionId, itemId, correction, cleared? } after a correction is saved.
routing-class-changedCustomEvent{ submissionId, previous, value } for the host to persist the selected class.
entry-removedCustomEvent{ submissionId, formGroupId, groupId, order } when entry removal is staged.
entry-restoredCustomEvent{ submissionId, groupId, order } when staged removal is undone.
value-changedCustomEvent{ submissionId, itemId, value } after the current value changes.
checks-statusCustomEvent{ 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 ​

PartDescription
rootThe form container.
toolbarThe filter and display controls.
contentThe scrollable values area.
groupA group of fields.
fieldAn individual field row.
statusLoading, empty and error messages.

Common problems ​

SymptomAction
No dataCheck the ancestor context and submission ID
Fields are missingCheck the array filter properties and hidden field definitions
Source unavailableCheck the item's citation and source document