@theredhead — Frontend Library - v0.2.1
    Preparing search index...

    Interface FormFieldDefinition

    Definition of a single form field. Fully JSON-serializable.

    The component key is resolved at runtime through the FormFieldRegistry to an actual Angular component that exposes a two-way value (or mapped model) signal.

    {
    "id": "email",
    "title": "E-mail address",
    "component": "text",
    "config": { "type": "email", "placeholder": "you@example.com" },
    "validation": [
    { "type": "required", "message": "E-mail is required." },
    { "type": "email", "message": "Enter a valid e-mail address." }
    ]
    }
    interface FormFieldDefinition {
        component: string;
        config?: Readonly<Record<string, unknown>>;
        defaultValue?: unknown;
        description?: string;
        enabledWhen?: Condition;
        id: string;
        options?: readonly FormFieldOption[];
        title: string;
        validation?: readonly ValidationRule[];
        visibleWhen?: Condition;
    }
    Index

    Properties

    component: string

    Registry key that maps to an Angular component.

    Built-in keys: "text", "select", "checkbox", "toggle", "radio", "autocomplete", "date", "time", "datetime", "color", "slider", "richtext", "file", "signature".

    config?: Readonly<Record<string, unknown>>

    Arbitrary key–value config forwarded as inputs to the resolved component. Keys must match the component's input() signal names.

    defaultValue?: unknown

    Default value used when the form is first created.

    description?: string

    Optional helper text shown below the field.

    enabledWhen?: Condition

    When set, the field is disabled (non-interactive) unless the condition is met.

    id: string

    Unique ID — used as the key in the form values object.

    options?: readonly FormFieldOption[]

    Options for select, radio, and autocomplete fields. Passed to the component's options or equivalent input.

    title: string

    Human-readable label shown above the field.

    validation?: readonly ValidationRule[]

    Validation rules evaluated by the form engine.

    visibleWhen?: Condition

    When set, the field is only visible if the condition is met. Hidden fields are excluded from the output JSON.