FieldConfig: {
    _isGenerated?: boolean;
    editor: EditorId;
    name?: string;
    params?: {
        _isAddonCustomField?: boolean;
        autoFocus?: boolean;
        defaultValue?: number | string | string[];
        inputMaskError?: string;
        inputMaskRegex?: string;
        label?: string;
        labelInfo?: string;
        options?: AdvancedSelectOptions;
        remember?: boolean;
        required?: boolean;
        [index: string]: unknown;
    };
    waitOnEmpty?: boolean;
}

Type declaration

  • Optional _isGenerated?: boolean

    used by addons to identify stuff to regenerate

  • editor: EditorId
  • Optional name?: string

    must be unique per application and not be notes prefer specifying the name here, not in params. this name is used in reports (and in the form when params.label is not defined)

  • Optional params?: {
        _isAddonCustomField?: boolean;
        autoFocus?: boolean;
        defaultValue?: number | string | string[];
        inputMaskError?: string;
        inputMaskRegex?: string;
        label?: string;
        labelInfo?: string;
        options?: AdvancedSelectOptions;
        remember?: boolean;
        required?: boolean;
        [index: string]: unknown;
    }

    params passed to the corresponding editor

    • common flags: required, remember, disabled, autoFocus
    • use label, labelInfo for a different display name
    • you can provide placeholder for line and text editors
    • use values: { "foo": 1, "bar": 2, "baz": 3 } for select editors
    • use options for structured select options with distinct IDs and weights
    • select option values should start from 1
    • use values: ["foo", "bar", "baz"] for checkbox/radio editors
    • you can provide defaultValue for checkbox/radio/select
    • [index: string]: unknown
    • Optional _isAddonCustomField?: boolean

      set to true for fields added by admin to add-on forms, so they are preserved on update

    • Optional autoFocus?: boolean

      should this field get focus as soon as the form is displayed?

    • Optional defaultValue?: number | string | string[]

      default value; for selects, use the id instead of the label

    • Optional inputMaskError?: string

      error message shown when inputMaskRegex doesn't match

    • Optional inputMaskRegex?: string

      user-entered valued must match this regex (select, line)

    • Optional label?: string

      override name used as form label

    • Optional labelInfo?: string

      information text in gray after the label

    • Optional options?: AdvancedSelectOptions

      structured select options; IDs are distinct, weights may repeat

    • Optional remember?: boolean

      use the last value submitted for this field as default

    • Optional required?: boolean

      block submission if this field is not filled

  • Optional waitOnEmpty?: boolean

    wait for confirmation before saving without this field