interface FormOptions {
    idPrefix: string;
    live?: boolean;
    openOverlay?: (el: HTMLElement, opts?: OverlayOptions) => () => void;
    preserveInvalidNumbers?: boolean;
    translate?: WidgetTranslator;
    values: Readonly<Record<string, unknown>>;
    custom(control: FormControl, row: HTMLElement): null | HTMLElement;
    onChange(key: string, value: unknown): void;
    unavailable(key: string, option?: string): null | string;
}

Hierarchy (View Summary)

Properties

idPrefix: string

Prefix for element ids, so two forms in one document never share one.

live?: boolean

Emit colour and slider edits on input as well as change, for a dialog that previews live. Off, a colour is one edit when the picker closes and a slider one edit on release, which is what a per-edit undo history wants.

openOverlay?: (el: HTMLElement, opts?: OverlayOptions) => () => void

Shared overlay owner for nested colour pickers.

Type declaration

    • (el: HTMLElement, opts?: OverlayOptions): () => void
    • Show el over the widget: positioned from opts.anchor (or centred as a dialog), focus-trapped, closed by Escape and by a press outside. Returns the closer.

      Parameters

      Returns () => void

preserveInvalidNumbers?: boolean

Keep an invalid numeric draft visible for validation when a form is saved.

translate?: WidgetTranslator

Translates widget-owned text. Omit to preserve English rendering.

values: Readonly<Record<string, unknown>>

Methods

  • Renders the control column of a custom row. Null skips the row.

    Parameters

    Returns null | HTMLElement

  • Every edit, with the value in the control's declared type.

    Parameters

    • key: string
    • value: unknown

    Returns void

  • Why a control, or one option of a select, cannot act right now, or null when it can. Drawn disabled with the reason as its title, never hidden: a greyed row is information, an absent one is a mystery. Asked again after every edit and every sync, beside the control's activeWhen, and its reason wins where both apply because the host knows the context.

    Parameters

    • key: string
    • Optionaloption: string

    Returns null | string